diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-16 17:47:19 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-16 17:47:19 +0000 |
commit | 8ef5da3be1577bb5ae7f55b60cf9fedb10ecb85e (patch) | |
tree | a700e3fe92165180b04451746f9c4fda4f038289 /lib | |
parent | 3ec0bc3828794a6ef6293b53b403af8bc2362934 (diff) | |
download | ruby-8ef5da3be1577bb5ae7f55b60cf9fedb10ecb85e.tar.gz |
consistent parentheses in assignment RHS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi.rb | 4 | ||||
-rw-r--r-- | lib/cgi/session/pstore.rb | 4 | ||||
-rw-r--r-- | lib/irb/cmd/fork.rb | 2 | ||||
-rw-r--r-- | lib/irb/completion.rb | 8 | ||||
-rw-r--r-- | lib/irb/workspace.rb | 2 | ||||
-rw-r--r-- | lib/mkmf.rb | 2 | ||||
-rw-r--r-- | lib/net/telnet.rb | 2 | ||||
-rw-r--r-- | lib/resolv.rb | 2 | ||||
-rw-r--r-- | lib/rexml/dtd/entitydecl.rb | 2 | ||||
-rw-r--r-- | lib/rexml/dtd/notationdecl.rb | 2 | ||||
-rw-r--r-- | lib/rexml/element.rb | 16 | ||||
-rw-r--r-- | lib/rexml/light/node.rb | 4 | ||||
-rw-r--r-- | lib/rexml/source.rb | 2 | ||||
-rw-r--r-- | lib/rexml/text.rb | 2 | ||||
-rw-r--r-- | lib/shell/command-processor.rb | 2 | ||||
-rw-r--r-- | lib/shell/process-controller.rb | 2 | ||||
-rw-r--r-- | lib/time.rb | 2 | ||||
-rw-r--r-- | lib/xmlrpc/parser.rb | 2 |
18 files changed, 31 insertions, 31 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index 116cd42eef..a55c9ca4bd 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -2302,8 +2302,8 @@ class CGI else at_exit() do if defined?(CGI_PARAMS) - self.class.class_eval("remove_const(:CGI_PARAMS)") - self.class.class_eval("remove_const(:CGI_COOKIES)") + CGI.class_eval("remove_const(:CGI_PARAMS)") + CGI.class_eval("remove_const(:CGI_COOKIES)") end end end diff --git a/lib/cgi/session/pstore.rb b/lib/cgi/session/pstore.rb index eea06c2ce9..8f4beb978a 100644 --- a/lib/cgi/session/pstore.rb +++ b/lib/cgi/session/pstore.rb @@ -69,7 +69,7 @@ class CGI unless File::exist? path @hash = {} end - @p = ::PStore.new path + @p = ::PStore.new(path) end # Restore session state from the session's PStore file. @@ -114,7 +114,7 @@ if $0 == __FILE__ # :enddoc: STDIN.reopen("/dev/null") cgi = CGI.new - session = CGI::Session.new cgi, 'database_manager' => CGI::Session::PStore + session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::PStore) session['key'] = {'k' => 'v'} puts session['key'].class fail unless Hash === session['key'] diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb index 1cc4458b13..30024dc5e0 100644 --- a/lib/irb/cmd/fork.rb +++ b/lib/irb/cmd/fork.rb @@ -3,7 +3,7 @@ module IRB module ExtendCommand class Fork<Nop def execute(&block) - pid = send ExtendCommand.irb_original_method_name("fork") + pid = send(ExtendCommand.irb_original_method_name("fork")) unless pid class<<self alias_method :exit, ExtendCommand.irb_original_method_name('exit') diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index c207cf09ef..46e6f24f30 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -112,7 +112,7 @@ module IRB select_message(receiver, message, candidates) when /^(\$[^.]*)$/ - candidates = global_variables.grep Regexp.new(Regexp.quote($1)) + candidates = global_variables.grep(Regexp.new(Regexp.quote($1))) # when /^(\$?(\.?[^.]+)+)\.([^.]*)$/ when /^((\.?[^.]+)+)\.([^.]*)$/ @@ -120,9 +120,9 @@ module IRB receiver = $1 message = Regexp.quote($3) - gv = eval "global_variables", bind - lv = eval "local_variables", bind - cv = eval "self.class.constants", bind + gv = eval("global_variables", bind) + lv = eval("local_variables", bind) + cv = eval("self.class.constants", bind) if (gv | lv | cv).include?(receiver) # foo.func and foo is local var. diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb index 3659fa8b56..531995fc44 100644 --- a/lib/irb/workspace.rb +++ b/lib/irb/workspace.rb @@ -56,7 +56,7 @@ EOF end end if main.empty? - @main = eval "self", @binding + @main = eval("self", @binding) else @main = main[0] IRB.conf[:__MAIN__] = @main diff --git a/lib/mkmf.rb b/lib/mkmf.rb index ca661d6148..b0a719e86e 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -797,7 +797,7 @@ def create_makefile(target, srcprefix = nil) deffile = EXPORT_PREFIX + origdef unless File.exist? deffile if File.exist? File.join(srcdir, deffile) - deffile = File.join srcdir, deffile + deffile = File.join(srcdir, deffile) elsif !EXPORT_PREFIX.empty? and File.exist?(origdef = File.join(srcdir, origdef)) open(origdef) do |d| open(deffile, 'wb') do |f| diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb index 7e2cd50f71..55c9a4e6c3 100644 --- a/lib/net/telnet.rb +++ b/lib/net/telnet.rb @@ -313,7 +313,7 @@ module Net # :nodoc: end hexvals = line.unpack('H*')[0] hexvals += ' ' * (32 - hexvals.length) - hexvals = format "%s %s %s %s " * 4, *hexvals.unpack('a2' * 16) + hexvals = format("%s %s %s %s " * 4, *hexvals.unpack('a2' * 16)) line = line.gsub(/[\000-\037\177-\377]/n, '.') printf "%s 0x%5.5x: %s%s\n", dir, addr, hexvals, line addr += 16 diff --git a/lib/resolv.rb b/lib/resolv.rb index 6dac504747..edc17c2f19 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -1155,7 +1155,7 @@ class Resolv len, = self.get_unpack('n') save_limit = @limit @limit = @index + len - d = yield len + d = yield(len) if @index < @limit raise DecodeError.new("junk exist") elsif @limit < @index diff --git a/lib/rexml/dtd/entitydecl.rb b/lib/rexml/dtd/entitydecl.rb index 83156dfc71..164825570f 100644 --- a/lib/rexml/dtd/entitydecl.rb +++ b/lib/rexml/dtd/entitydecl.rb @@ -48,7 +48,7 @@ module REXML def EntityDecl.parse_source source, listener md = source.match( PATTERN_RE, true ) - thing = md[0].squeeze " \t\n\r" + thing = md[0].squeeze(" \t\n\r") listener.send inspect.downcase, thing end end diff --git a/lib/rexml/dtd/notationdecl.rb b/lib/rexml/dtd/notationdecl.rb index 09b6743c5c..d577ce0631 100644 --- a/lib/rexml/dtd/notationdecl.rb +++ b/lib/rexml/dtd/notationdecl.rb @@ -31,7 +31,7 @@ module REXML def NotationDecl.parse_source source, listener md = source.match( PATTERN_RE, true ) - thing = md[0].squeeze " \t\n\r" + thing = md[0].squeeze(" \t\n\r") listener.send inspect.downcase, thing end end diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index 89e419345c..ffaeddbf54 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -52,8 +52,8 @@ module REXML def initialize( arg = UNDEFINED, parent=nil, context=nil ) super(parent) - @elements = Elements.new self - @attributes = Attributes.new self + @elements = Elements.new(self) + @attributes = Attributes.new(self) @context = context if arg.kind_of? String @@ -253,7 +253,7 @@ module REXML # el = Element.new 'my-tag' # doc.add_element el def add_element element=nil, attrs=nil - el = @elements.add element + el = @elements.add(element) if attrs.kind_of? Hash attrs.each do |key, value| el.attributes[key]=value if key =~ /^xmlns:/ @@ -412,7 +412,7 @@ module REXML # # The element 'p' has two text elements, "some text " and " more text". # doc.root.text #-> "some text " def text( path = nil ) - rv = get_text path + rv = get_text(path) return rv.value unless rv.nil? nil end @@ -724,7 +724,7 @@ module REXML def []( index, name=nil) if index.kind_of? Integer raise "index (#{index}) must be >= 1" if index < 1 - name = literalize name if name + name = literalize(name) if name num = 0 child = nil @element.find { |child| @@ -1016,13 +1016,13 @@ module REXML # doc.root.attributes['x:foo'] = nil def []=( name, value ) if value.nil? # Delete the named attribute - attr = get_attribute name + attr = get_attribute(name) delete attr return end value = Attribute.new(name, value) unless value.kind_of? Attribute value.element = @element - old_attr = fetch value.name, nil + old_attr = fetch(value.name, nil) if old_attr.nil? store(value.name, value) elsif old_attr.kind_of? Hash @@ -1104,7 +1104,7 @@ module REXML prefix, name = $1, $2 prefix = '' unless prefix end - old = fetch name, nil + old = fetch(name, nil) attr = nil if old.kind_of? Hash # the supplied attribute is one of many attr = old.delete(prefix) diff --git a/lib/rexml/light/node.rb b/lib/rexml/light/node.rb index 9dafd687dd..ff8cb987f0 100644 --- a/lib/rexml/light/node.rb +++ b/lib/rexml/light/node.rb @@ -135,8 +135,8 @@ module REXML end def text=( foo ) - replace = at(4).kind_of? String ? 1 : 0 - self._old_put(4,replace, normalizefoo) + replace = at(4).kind_of?(String) ? 1 : 0 + _old_put(4, replace, normalizefoo) end def root diff --git a/lib/rexml/source.rb b/lib/rexml/source.rb index 915b6efc27..8161750694 100644 --- a/lib/rexml/source.rb +++ b/lib/rexml/source.rb @@ -102,7 +102,7 @@ module REXML # @return the current line in the source def current_line lines = @orig.split - res = lines.grep @buffer[0..30] + res = lines.grep(@buffer[0..30]) res = res[-1] if res.kind_of? Array lines.index( res ) if res end diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb index 906f4d41fc..0614e51d47 100644 --- a/lib/rexml/text.rb +++ b/lib/rexml/text.rb @@ -245,7 +245,7 @@ module REXML def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil ) rv = string.clone rv.gsub!( /\r\n?/, "\n" ) - matches = rv.scan REFERENCE + matches = rv.scan(REFERENCE) return rv if matches.size == 0 rv.gsub!( NUMERICENTITY ) {|m| m=$1 diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb index 876192e8b1..ce5102a9c4 100644 --- a/lib/shell/command-processor.rb +++ b/lib/shell/command-processor.rb @@ -393,7 +393,7 @@ class Shell end]), nil, __FILE__, __LINE__ - 1) else - args = opts.collect{|opt| '"' + opt + '"'}.join "," + args = opts.collect{|opt| '"' + opt + '"'}.join(",") eval((d = %Q[def #{ali}(*opts) @shell.__send__(:#{command}, #{args}, *opts) end]), nil, __FILE__, __LINE__ - 1) diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb index 26fb1d9f08..f74abfd686 100644 --- a/lib/shell/process-controller.rb +++ b/lib/shell/process-controller.rb @@ -165,7 +165,7 @@ class Shell return elsif @active_jobs.include?(command) begin - r = command.kill sig + r = command.kill(sig) ProcessController.inactivate(self) rescue print "Shell: Warn: $!\n" if @shell.verbose? diff --git a/lib/time.rb b/lib/time.rb index 115e7e9633..9d2ac558d9 100644 --- a/lib/time.rb +++ b/lib/time.rb @@ -135,7 +135,7 @@ class Time # def parse(date, now=Time.now) year, mon, day, hour, min, sec, zone, _ = ParseDate.parsedate(date) - year = yield year if year && block_given? + year = yield(year) if year && block_given? if now begin diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb index 233dd596fd..cfbf78f3b3 100644 --- a/lib/xmlrpc/parser.rb +++ b/lib/xmlrpc/parser.rb @@ -111,7 +111,7 @@ module XMLRPC else begin mod = Module - klass.split("::").each {|const| mod = mod.const_get const.strip } + klass.split("::").each {|const| mod = mod.const_get(const.strip)} Thread.critical = true # let initialize take 0 parameters |