diff options
author | Pat Allan <pat@freelancing-gods.com> | 2017-07-22 22:45:53 +1000 |
---|---|---|
committer | Pat Allan <pat@freelancing-gods.com> | 2017-08-14 19:00:24 +0200 |
commit | d435c92721a1fbecf0bc6d1b6c5cf95d228c851a (patch) | |
tree | c08015501962c1f6c513e526ed8959880a9e921b /railties/lib | |
parent | 5949cc05d395f5e1435d04d4adee7b26f13a517d (diff) | |
download | rails-d435c92721a1fbecf0bc6d1b6c5cf95d228c851a.tar.gz rails-d435c92721a1fbecf0bc6d1b6c5cf95d228c851a.tar.bz2 rails-d435c92721a1fbecf0bc6d1b6c5cf95d228c851a.zip |
Railties updates for frozen string literals.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/command/base.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/dbconsole/dbconsole_command.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/generated_attribute.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/info.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/source_annotation_extractor.rb | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb index cd0720be4e..d986df8a80 100644 --- a/railties/lib/rails/command/base.rb +++ b/railties/lib/rails/command/base.rb @@ -73,7 +73,7 @@ module Rails # Use Rails' default banner. def banner(*) - "#{executable} #{arguments.map(&:usage).join(' ')} [options]".squish! + "#{executable} #{arguments.map(&:usage).join(' ')} [options]".squish end # Sets the base_name taking into account the current class namespace. diff --git a/railties/lib/rails/commands/dbconsole/dbconsole_command.rb b/railties/lib/rails/commands/dbconsole/dbconsole_command.rb index 71b3455473..1c16c3f0eb 100644 --- a/railties/lib/rails/commands/dbconsole/dbconsole_command.rb +++ b/railties/lib/rails/commands/dbconsole/dbconsole_command.rb @@ -58,7 +58,7 @@ module Rails logon = "" if config["username"] - logon = config["username"] + logon = config["username"].dup logon << "/#{config['password']}" if config["password"] && @options["include_password"] logon << "@#{config['database']}" if config["database"] end diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index 8915441d4c..dbc43159a6 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -271,7 +271,7 @@ module Rails else options = sorted_groups.flat_map(&:last) suggestions = options.sort_by { |suggested| levenshtein_distance(namespace.to_s, suggested) }.first(3) - msg = "Could not find generator '#{namespace}'. " + msg = "Could not find generator '#{namespace}'. ".dup msg << "Maybe you meant #{ suggestions.map { |s| "'#{s}'" }.to_sentence(last_word_connector: " or ", locale: :en) }\n" msg << "Run `rails generate --help` for more options." puts msg diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb index baed7bf1e3..d2c8ba9255 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -151,7 +151,7 @@ module Rails end def inject_options - "".tap { |s| options_for_migration.each { |k, v| s << ", #{k}: #{v.inspect}" } } + "".dup.tap { |s| options_for_migration.each { |k, v| s << ", #{k}: #{v.inspect}" } } end def inject_index_options diff --git a/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb b/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb index 42705107ae..56b85e1da1 100644 --- a/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb +++ b/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb @@ -36,7 +36,7 @@ module Rails private def route_string - @route_string ||= "" + @route_string ||= "".dup end def write(str, indent) diff --git a/railties/lib/rails/info.rb b/railties/lib/rails/info.rb index db08d578c0..cc2f75a1d3 100644 --- a/railties/lib/rails/info.rb +++ b/railties/lib/rails/info.rb @@ -39,7 +39,7 @@ module Rails alias inspect to_s def to_html - "<table>".tap do |table| + "<table>".dup.tap do |table| properties.each do |(name, value)| table << %(<tr><td class="name">#{CGI.escapeHTML(name.to_s)}</td>) formatted_value = if value.kind_of?(Array) diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb index e9088c44ce..0412d725df 100644 --- a/railties/lib/rails/source_annotation_extractor.rb +++ b/railties/lib/rails/source_annotation_extractor.rb @@ -45,7 +45,7 @@ class SourceAnnotationExtractor # If +options+ has a flag <tt>:tag</tt> the tag is shown as in the example above. # Otherwise the string contains just line and text. def to_s(options = {}) - s = "[#{line.to_s.rjust(options[:indent])}] " + s = "[#{line.to_s.rjust(options[:indent])}] ".dup s << "[#{tag}] " if options[:tag] s << text end |