aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-20 17:58:45 +0100
committerJosé Valim <jose.valim@gmail.com>2011-12-20 17:59:26 +0100
commit51095be1b08b1dd2a8a049f009bac6220fa7a68b (patch)
tree25d95e9b68455d237d058828fe48bfa87123de82 /railties
parent2d5f5c32e6a172863e08a1eecea39b69b1d23d14 (diff)
downloadrails-51095be1b08b1dd2a8a049f009bac6220fa7a68b.tar.gz
rails-51095be1b08b1dd2a8a049f009bac6220fa7a68b.tar.bz2
rails-51095be1b08b1dd2a8a049f009bac6220fa7a68b.zip
Get rid of more 1.8.x dead code
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails.rb15
-rw-r--r--railties/lib/rails/commands/plugin.rb2
-rw-r--r--railties/lib/rails/generators/app_base.rb6
-rw-r--r--railties/lib/rails/generators/named_base.rb9
-rw-r--r--railties/lib/rails/generators/rails/app/templates/Gemfile1
-rw-r--r--railties/test/application/configuration_test.rb8
-rw-r--r--railties/test/generators/app_generator_test.rb11
-rw-r--r--railties/test/generators/mailer_generator_test.rb6
-rw-r--r--railties/test/generators/namespaced_generators_test.rb6
-rw-r--r--railties/test/railties/generators_test.rb4
10 files changed, 13 insertions, 55 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb
index 04c7415f3f..658756ad51 100644
--- a/railties/lib/rails.rb
+++ b/railties/lib/rails.rb
@@ -12,19 +12,10 @@ require 'rails/version'
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
diff --git a/railties/lib/rails/commands/plugin.rb b/railties/lib/rails/commands/plugin.rb
index c99a2e6685..4ddd12ae0b 100644
--- a/railties/lib/rails/commands/plugin.rb
+++ b/railties/lib/rails/commands/plugin.rb
@@ -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
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index ab699e4c9e..0ed1eb4af8 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -182,11 +182,7 @@ module Rails
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
diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb
index 547b31cf7b..e96fc63ee9 100644
--- a/railties/lib/rails/generators/named_base.rb
+++ b/railties/lib/rails/generators/named_base.rb
@@ -182,14 +182,9 @@ module Rails
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
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile
index 082642d5cd..60ea394d2f 100644
--- a/railties/lib/rails/generators/rails/app/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -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 %>
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 28ffff58ca..8f2e6e9ac0 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -189,12 +189,8 @@ module ApplicationTests
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
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 7ac222d84f..a15943dfc6 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -285,17 +285,10 @@ class AppGeneratorTest < Rails::Generators::TestCase
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
diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb
index 63a97404ee..c501780e7f 100644
--- a/railties/test/generators/mailer_generator_test.rb
+++ b/railties/test/generators/mailer_generator_test.rb
@@ -10,11 +10,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase
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
diff --git a/railties/test/generators/namespaced_generators_test.rb b/railties/test/generators/namespaced_generators_test.rb
index dd1e4bdac1..5c63b13dce 100644
--- a/railties/test/generators/namespaced_generators_test.rb
+++ b/railties/test/generators/namespaced_generators_test.rb
@@ -155,11 +155,7 @@ class NamespacedMailerGeneratorTest < NamespacedGeneratorTestCase
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
diff --git a/railties/test/railties/generators_test.rb b/railties/test/railties/generators_test.rb
index f8540d69d9..6ebbabc0ff 100644
--- a/railties/test/railties/generators_test.rb
+++ b/railties/test/railties/generators_test.rb
@@ -46,10 +46,6 @@ module RailtiesTests
gem 'rails', :path => '#{RAILS_FRAMEWORK_ROOT}'
gem 'sqlite3'
-
- if RUBY_VERSION < '1.9'
- gem "ruby-debug", ">= 0.10.3"
- end
GEMFILE
end
end