From 895a10cb7a76358c605c525392e7522d35d144e0 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 20 Feb 2006 00:15:36 +0000 Subject: * lib/webrick/httpservlet/cgihandler.rb (WEBrick::HTTPServlet::CGIHandler): qualify the access for Config constant. [ruby-dev:28338] * lib/resolv.rb (Resolv::DNS::Resource::IN::A): qualify ClassValue. [ruby-dev:28338] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rational.rb | 40 ++++++----------------------------- lib/resolv.rb | 20 +++++++++++------- lib/webrick/httpservlet/cgihandler.rb | 2 +- 3 files changed, 20 insertions(+), 42 deletions(-) (limited to 'lib') diff --git a/lib/rational.rb b/lib/rational.rb index fd5bc95a3..45bd141c8 100644 --- a/lib/rational.rb +++ b/lib/rational.rb @@ -435,42 +435,16 @@ class Integer # The result is positive, no matter the sign of the arguments. # def gcd(n) - m = self.abs - n = n.abs - - return n if m == 0 - return m if n == 0 - - b = 0 - while n[0] == 0 && m[0] == 0 - b += 1; n >>= 1; m >>= 1 - end - m >>= 1 while m[0] == 0 - n >>= 1 while n[0] == 0 - while m != n - m, n = n, m if n > m - m -= n; m >>= 1 while m[0] == 0 - end - m << b - end - - def gcd2(int) - a = self.abs - b = int.abs - - a, b = b, a if a < b - - while b != 0 - void, a = a.divmod(b) - a, b = b, a + min = self.abs + max = other.abs + while min > 0 + tmp = min + min = max % min + max = tmp end - return a + max end - # - # Returns the lowest common multiple (LCM) of the two arguments - # (+self+ and +other+). - # # Examples: # 6.lcm 7 # -> 42 # 6.lcm 9 # -> 18 diff --git a/lib/resolv.rb b/lib/resolv.rb index 4f83560b8..6bc41d796 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -1810,8 +1810,9 @@ class Resolv # IPv4 Address resource class A < Resource - - ClassHash[[TypeValue = 1, ClassValue = ClassValue]] = self # :nodoc: + TypeValue = 1 + ClassValue = IN::ClassValue + ClassHash[[TypeValue, ClassValue]] = self # :nodoc: ## # Creates a new A for +address+. @@ -1838,8 +1839,9 @@ class Resolv # Well Known Service resource. class WKS < Resource - - ClassHash[[TypeValue = 11, ClassValue = ClassValue]] = self # :nodoc: + TypeValue = 11 + ClassValue = IN::ClassValue + ClassHash[[TypeValue, ClassValue]] = self # :nodoc: def initialize(address, protocol, bitmap) @address = IPv4.create(address) @@ -1885,8 +1887,9 @@ class Resolv # An IPv6 address record. class AAAA < Resource - - ClassHash[[TypeValue = 28, ClassValue = ClassValue]] = self # :nodoc: + TypeValue = 28 + ClassValue = IN::ClassValue + ClassHash[[TypeValue, ClassValue]] = self # :nodoc: ## # Creates a new AAAA for +address+. @@ -1916,8 +1919,9 @@ class Resolv # available at. class SRV < Resource - - ClassHash[[TypeValue = 33, ClassValue = ClassValue]] = self # :nodoc: + TypeValue = 33 + ClassValue = IN::ClassValue + ClassHash[[TypeValue, ClassValue]] = self # :nodoc: # Create a SRV resource record. # diff --git a/lib/webrick/httpservlet/cgihandler.rb b/lib/webrick/httpservlet/cgihandler.rb index 40247366f..5ec673c5b 100644 --- a/lib/webrick/httpservlet/cgihandler.rb +++ b/lib/webrick/httpservlet/cgihandler.rb @@ -20,7 +20,7 @@ module WEBrick Ruby = File::join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name']) Ruby << ::Config::CONFIG['EXEEXT'] - CGIRunner = "\"#{Ruby}\" \"#{Config::LIBDIR}/httpservlet/cgi_runner.rb\"" + CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\"" def initialize(server, name) super(server, name) -- cgit