提交 51095be1 编写于 作者: J José Valim

Get rid of more 1.8.x dead code

上级 2d5f5c32
......@@ -12,19 +12,10 @@
require 'active_support/railtie'
require 'action_dispatch/railtie'
# For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the
# multibyte safe operations. Plugin authors supporting other encodings
# should override this behavior and set the relevant +default_charset+
# on ActionController::Base.
#
# For Ruby 1.9, UTF-8 is the default internal and external encoding.
if RUBY_VERSION < '1.9'
$KCODE='u'
else
silence_warnings do
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
silence_warnings do
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
module Rails
......
......@@ -478,7 +478,7 @@ class RecursiveHTTPFetcher
def initialize(urls_to_fetch, level = 1, cwd = ".")
@level = level
@cwd = cwd
@urls_to_fetch = RUBY_VERSION >= '1.9' ? urls_to_fetch.lines : urls_to_fetch.to_a
@urls_to_fetch = urls_to_fetch.lines
@quiet = false
end
......
......@@ -182,11 +182,7 @@ def convert_database_option_for_jruby
end
def ruby_debugger_gemfile_entry
if RUBY_VERSION < "1.9"
"gem 'ruby-debug'"
else
"gem 'ruby-debug19', :require => 'ruby-debug'"
end
"gem 'ruby-debug19', :require => 'ruby-debug'"
end
def assets_gemfile_entry
......
......@@ -182,14 +182,9 @@ def self.check_class_collision(options={})
end
end
# Returns Ruby 1.9 style key-value pair if current code is running on
# Ruby 1.9.x. Returns the old-style (with hash rocket) otherwise.
# Returns Ruby 1.9 style key-value pair.
def key_value(key, value)
if options[:old_style_hash] || RUBY_VERSION < '1.9'
":#{key} => #{value}"
else
"#{key}: #{value}"
end
"#{key}: #{value}"
end
end
end
......
......@@ -5,7 +5,6 @@ source 'https://rubygems.org'
<%= database_gemfile_entry -%>
<%= "gem 'jruby-openssl'\n" if defined?(JRUBY_VERSION) -%>
<%= "gem 'json'\n" if RUBY_VERSION < "1.9.2" -%>
<%= assets_gemfile_entry %>
<%= javascript_gemfile_entry %>
......
......@@ -189,12 +189,8 @@ def teardown
end
def assert_utf8
if RUBY_VERSION < '1.9'
assert_equal "UTF8", $KCODE
else
assert_equal Encoding::UTF_8, Encoding.default_external
assert_equal Encoding::UTF_8, Encoding.default_internal
end
assert_equal Encoding::UTF_8, Encoding.default_external
assert_equal Encoding::UTF_8, Encoding.default_internal
end
test "skipping config.encoding still results in 'utf-8' as the default" do
......
......@@ -285,17 +285,10 @@ def test_javascript_is_skipped_if_required
end
end
def test_inclusion_of_ruby_debug
def test_inclusion_of_ruby_debug19
run_generator
assert_file "Gemfile" do |contents|
assert_match(/gem 'ruby-debug'/, contents) if RUBY_VERSION < '1.9'
end
end
def test_inclusion_of_ruby_debug19_if_ruby19
run_generator
assert_file "Gemfile" do |contents|
assert_match(/gem 'ruby-debug19', :require => 'ruby-debug'/, contents) unless RUBY_VERSION < '1.9'
assert_match(/gem 'ruby-debug19', :require => 'ruby-debug'/, contents)
end
end
......
......@@ -10,11 +10,7 @@ def test_mailer_skeleton_is_created
run_generator
assert_file "app/mailers/notifier.rb" do |mailer|
assert_match(/class Notifier < ActionMailer::Base/, mailer)
if RUBY_VERSION < "1.9"
assert_match(/default :from => "from@example.com"/, mailer)
else
assert_match(/default from: "from@example.com"/, mailer)
end
assert_match(/default from: "from@example.com"/, mailer)
end
end
......
......@@ -155,11 +155,7 @@ def test_mailer_skeleton_is_created
assert_file "app/mailers/test_app/notifier.rb" do |mailer|
assert_match(/module TestApp/, mailer)
assert_match(/class Notifier < ActionMailer::Base/, mailer)
if RUBY_VERSION < "1.9"
assert_match(/default :from => "from@example.com"/, mailer)
else
assert_match(/default from: "from@example.com"/, mailer)
end
assert_match(/default from: "from@example.com"/, mailer)
end
end
......
......@@ -46,10 +46,6 @@ def build_engine(is_mountable=false)
gem 'rails', :path => '#{RAILS_FRAMEWORK_ROOT}'
gem 'sqlite3'
if RUBY_VERSION < '1.9'
gem "ruby-debug", ">= 0.10.3"
end
GEMFILE
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册