diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-04-04 10:43:24 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-04-04 10:43:24 -0700 |
commit | a9398a7da4fa845a0182bd53273c607dae55b1ee (patch) | |
tree | d3b3f2f95a45ce19f10b774d6d07b41b318afa99 /railties | |
parent | c6bd8a9d3ac2ebd5d0af4573d6d799085ac2219b (diff) | |
parent | 2d8396fc9fbea9189e9e945e41e643925da5b2cb (diff) | |
download | rails-a9398a7da4fa845a0182bd53273c607dae55b1ee.tar.gz rails-a9398a7da4fa845a0182bd53273c607dae55b1ee.tar.bz2 rails-a9398a7da4fa845a0182bd53273c607dae55b1ee.zip |
Merge pull request #5716 from jurriaan/tr-gsub-cleanup
Updated/changed unneeded tr/gsubs
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/named_base.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/resource_helpers.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/railtie.rb | 2 | ||||
-rw-r--r-- | railties/test/rails_info_test.rb | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb index 862fd9e88d..c457b5fbbc 100644 --- a/railties/lib/rails/generators/named_base.rb +++ b/railties/lib/rails/generators/named_base.rb @@ -99,7 +99,7 @@ module Rails end def i18n_scope - @i18n_scope ||= file_path.gsub('/', '.') + @i18n_scope ||= file_path.tr('/', '.') end def table_name diff --git a/railties/lib/rails/generators/resource_helpers.rb b/railties/lib/rails/generators/resource_helpers.rb index 3c5b39fa16..48833869e5 100644 --- a/railties/lib/rails/generators/resource_helpers.rb +++ b/railties/lib/rails/generators/resource_helpers.rb @@ -50,7 +50,7 @@ module Rails end def controller_i18n_scope - @controller_i18n_scope ||= controller_file_path.gsub('/', '.') + @controller_i18n_scope ||= controller_file_path.tr('/', '.') end # Loads the ORM::Generators::ActiveModel class. This class is responsible diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index e8563f4daf..dc5de4084e 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -162,7 +162,7 @@ module Rails protected def generate_railtie_name(class_or_module) - ActiveSupport::Inflector.underscore(class_or_module).gsub("/", "_") + ActiveSupport::Inflector.underscore(class_or_module).tr("/", "_") end end diff --git a/railties/test/rails_info_test.rb b/railties/test/rails_info_test.rb index 1da66062aa..b9fb071d23 100644 --- a/railties/test/rails_info_test.rb +++ b/railties/test/rails_info_test.rb @@ -43,7 +43,7 @@ class InfoTest < ActiveSupport::TestCase def test_frameworks_exist Rails::Info.frameworks.each do |framework| - dir = File.dirname(__FILE__) + "/../../" + framework.gsub('_', '') + dir = File.dirname(__FILE__) + "/../../" + framework.delete('_') assert File.directory?(dir), "#{framework.classify} does not exist" end end |