From e6e2ed3b2802a65ff35242c688a9ee568478f929 Mon Sep 17 00:00:00 2001 From: Oscar Del Ben Date: Sun, 8 Jul 2012 09:35:57 -0700 Subject: [PATCH] Remove checks for RUBY_VERSION --- lib/cgi.rb | 2 -- lib/drb/drb.rb | 13 +++---------- lib/irb/init.rb | 8 ++------ lib/open-uri.rb | 5 ----- lib/webrick/httpproxy.rb | 2 -- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/lib/cgi.rb b/lib/cgi.rb index 31730bd..7c15e04 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -10,8 +10,6 @@ # Documentation: Wakou Aoyama (RDoc'd and embellished by William Webber) # -raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0" - # == Overview # # The Common Gateway Interface (CGI) is a simple protocol for passing an HTTP diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb index bd148d5..85b46da 100644 --- a/lib/drb/drb.rb +++ b/lib/drb/drb.rb @@ -1545,16 +1545,9 @@ module DRb end - if RUBY_VERSION >= '1.8' - require 'drb/invokemethod' - class InvokeMethod - include InvokeMethod18Mixin - end - else - require 'drb/invokemethod16' - class InvokeMethod - include InvokeMethod16Mixin - end + require 'drb/invokemethod' + class InvokeMethod + include InvokeMethod18Mixin end # The main loop performed by a DRbServer's internal thread. diff --git a/lib/irb/init.rb b/lib/irb/init.rb index fce2df4..b0aa4d2 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -122,8 +122,6 @@ module IRB @CONF[:LC_MESSAGES].load("irb/error.rb") end - FEATURE_IOPT_CHANGE_VERSION = "1.9.0" - # option analyzing def IRB.parse_opts load_path = [] @@ -220,10 +218,8 @@ module IRB break end end - if RUBY_VERSION >= FEATURE_IOPT_CHANGE_VERSION - load_path.collect! do |path| - /\A\.\// =~ path ? path : File.expand_path(path) - end + load_path.collect! do |path| +/\A\.\// =~ path ? path : File.expand_path(path) end $LOAD_PATH.unshift(*load_path) diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 6e24b40..67e71e3 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -249,11 +249,6 @@ module OpenURI raise "Non-HTTP proxy URI: #{proxy_uri}" if proxy_uri.class != URI::HTTP end - if target.userinfo && "1.9.0" <= RUBY_VERSION - # don't raise for 1.8 because compatibility. - raise ArgumentError, "userinfo not supported. [RFC3986]" - end - header = {} options.each {|k, v| header[k] = v if String === k } diff --git a/lib/webrick/httpproxy.rb b/lib/webrick/httpproxy.rb index e7226a0..84612a4 100644 --- a/lib/webrick/httpproxy.rb +++ b/lib/webrick/httpproxy.rb @@ -12,8 +12,6 @@ require "webrick/httpserver" require "net/http" -Net::HTTP::version_1_2 if RUBY_VERSION < "1.7" - module WEBrick NullReader = Object.new class << NullReader -- 1.7.11