Skip to content

remove backported string interpolation #6327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion activesupport/lib/active_support/core_ext/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
require 'active_support/core_ext/string/access'
require 'active_support/core_ext/string/xchar'
require 'active_support/core_ext/string/behavior'
require 'active_support/core_ext/string/interpolation'
require 'active_support/core_ext/string/output_safety'
require 'active_support/core_ext/string/exclude'
require 'active_support/core_ext/string/strip'
Expand Down

This file was deleted.

14 changes: 0 additions & 14 deletions guides/source/active_support_core_extensions.textile
Original file line number Diff line number Diff line change
Expand Up @@ -1277,20 +1277,6 @@ The <tt>inquiry</tt> method converts a string into a +StringInquirer+ object mak
"active".inquiry.inactive? # => false
</ruby>

h4. Key-based Interpolation

In Ruby 1.9 the <tt>%</tt> string operator supports key-based interpolation, both formatted and unformatted:

<ruby>
"Total is %<total>.02f" % {:total => 43.1} # => Total is 43.10
"I say %{foo}" % {:foo => "wadus"} # => "I say wadus"
"I say %{woo}" % {:foo => "wadus"} # => KeyError
</ruby>

Active Support adds that functionality to <tt>%</tt> in previous versions of Ruby.

NOTE: Defined in +active_support/core_ext/string/interpolation.rb+.

h4. +starts_with?+ and +ends_with?+

Active Support defines 3rd person aliases of +String#start_with?+ and +String#end_with?+:
Expand Down