Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/cgi/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,11 @@ def local_path
/Content-Disposition:.* filename=(?:"(.*?)"|([^;\r\n]*))/i.match(head)
filename = $1 || $2 || ''
filename = CGI.unescape(filename) if unescape_filename?()
body.instance_variable_set('@original_filename', filename.taint)
body.instance_variable_set(:@original_filename, filename.taint)
## content type
/Content-Type: (.*)/i.match(head)
(content_type = $1 || '').chomp!
body.instance_variable_set('@content_type', content_type.taint)
body.instance_variable_set(:@content_type, content_type.taint)
## query parameter name
/Content-Disposition:.* name=(?:"(.*?)"|([^;\r\n]*))/i.match(head)
name = $1 || $2 || ''
Expand Down
4 changes: 2 additions & 2 deletions lib/drb/drb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,8 @@ def self._load(s)

def self.new_with(uri, ref)
it = self.allocate
it.instance_variable_set('@uri', uri)
it.instance_variable_set('@ref', ref)
it.instance_variable_set(:@uri, uri)
it.instance_variable_set(:@ref, ref)
it
end

Expand Down
2 changes: 1 addition & 1 deletion lib/ipaddr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def _to_string(addr)

end

unless Socket.const_defined? "AF_INET6"
unless Socket.const_defined? :AF_INET6
class Socket < BasicSocket
# IPv6 protocol family
AF_INET6 = Object.new
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/workspace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def initialize(*main)
unless defined? BINDING_QUEUE
require "thread"

IRB.const_set("BINDING_QUEUE", SizedQueue.new(1))
IRB.const_set(:BINDING_QUEUE, SizedQueue.new(1))
Thread.abort_on_exception = true
Thread.start do
eval "require \"irb/ws-for-case-2\"", TOPLEVEL_BINDING, __FILE__, __LINE__
Expand Down
2 changes: 1 addition & 1 deletion lib/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def wait(timeout = nil)
@monitor.__send__(:mon_check_owner)
count = @monitor.__send__(:mon_exit_for_cond)
begin
@cond.wait(@monitor.instance_variable_get("@mon_mutex"), timeout)
@cond.wait(@monitor.instance_variable_get(:@mon_mutex), timeout)
return true
ensure
@monitor.__send__(:mon_enter_for_cond, count)
Expand Down
4 changes: 2 additions & 2 deletions lib/rss/maker/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def inherited_base
end

def inherited(subclass)
subclass.const_set("OTHER_ELEMENTS", [])
subclass.const_set("NEED_INITIALIZE_VARIABLES", [])
subclass.const_set(:OTHER_ELEMENTS, [])
subclass.const_set(:NEED_INITIALIZE_VARIABLES, [])
end

def add_other_element(variable_name)
Expand Down
18 changes: 9 additions & 9 deletions lib/rss/rss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -701,18 +701,18 @@ def inherited_base
end

def inherited(klass)
klass.const_set("MUST_CALL_VALIDATORS", {})
klass.const_set("MODELS", [])
klass.const_set("GET_ATTRIBUTES", [])
klass.const_set("HAVE_CHILDREN_ELEMENTS", [])
klass.const_set("TO_ELEMENT_METHODS", [])
klass.const_set("NEED_INITIALIZE_VARIABLES", [])
klass.const_set("PLURAL_FORMS", {})
klass.const_set(:MUST_CALL_VALIDATORS, {})
klass.const_set(:MODELS, [])
klass.const_set(:GET_ATTRIBUTES, [])
klass.const_set(:HAVE_CHILDREN_ELEMENTS, [])
klass.const_set(:TO_ELEMENT_METHODS, [])
klass.const_set(:NEED_INITIALIZE_VARIABLES, [])
klass.const_set(:PLURAL_FORMS, {})

tag_name = klass.name.split(/::/).last
tag_name[0, 1] = tag_name[0, 1].downcase
klass.instance_variable_set("@tag_name", tag_name)
klass.instance_variable_set("@have_content", false)
klass.instance_variable_set(:@tag_name, tag_name)
klass.instance_variable_set(:@have_content, false)
end

def install_must_call_validator(prefix, uri)
Expand Down
8 changes: 4 additions & 4 deletions lib/xmlrpc/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,10 @@ def initialize
if defined? XML::DOM::Builder
return if defined? XML::DOM::Node::DOCUMENT # code below has been already executed
klass = XML::DOM::Node
klass.const_set("DOCUMENT", klass::DOCUMENT_NODE)
klass.const_set("TEXT", klass::TEXT_NODE)
klass.const_set("COMMENT", klass::COMMENT_NODE)
klass.const_set("ELEMENT", klass::ELEMENT_NODE)
klass.const_set(:DOCUMENT, klass::DOCUMENT_NODE)
klass.const_set(:TEXT, klass::TEXT_NODE)
klass.const_set(:COMMENT, klass::COMMENT_NODE)
klass.const_set(:ELEMENT, klass::ELEMENT_NODE)
end
end

Expand Down