String#% is not working on Ruby 1.8.7

To reproduce, I just copied the example right from ruby-doc
class String - RDoc Documentation into irb
session.

"foo = %{foo}" % { :foo => 'bar' }

ArgumentError: malformed format string - %{
  from (irb):1:in `%'
  from (irb):1

I'm using
ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]
on Ubuntu amd64

They changed the default Ruby on ruby-doc to 1.9.2, docs for 1.8.7 are at

···

On Fri, Jan 7, 2011 at 1:02 AM, Vikrant Chaudhary <nasa42@gmail.com> wrote:

To reproduce, I just copied the example right from ruby-doc
class String - RDoc Documentation into irb
session.

>> "foo = %{foo}" % { :foo => 'bar' }
ArgumentError: malformed format string - %{
       from (irb):1:in `%'
       from (irb):1

I'm using
ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]
on Ubuntu amd64

I altered the RDoc template as well to show the Ruby version.

For example, the String class page, up at the top, should show

Class String
In: string.c
Ruby version: Ruby 1.9.2

for the default docs, and

  Class: String (Ruby 1.8.7)

has

Class String
In: string.c
Ruby version: Ruby 1.8.7

James

···

On Fri, Jan 7, 2011 at 12:23 AM, Josh Cheek <josh.cheek@gmail.com> wrote:

They changed the default Ruby on ruby-doc to 1.9.2, docs for 1.8.7 are at
Class: String (Ruby 1.8.7)

I've been hit by this a few times too. Usually I land in the middle of a
page through Google, and thus I always miss the "head" of the page when
I quickly want to look up things.

Would be nice if, when new features are introduced, they also get
document. In this case, .e.g.

str % arg - since Ruby 1.x.y
Support for hashes - since Ruby 1.9.2
...

- Markus

···

On 08.01.2011 03:34, James Britt wrote:

On Fri, Jan 7, 2011 at 12:23 AM, Josh Cheek <josh.cheek@gmail.com> wrote:

They changed the default Ruby on ruby-doc to 1.9.2, docs for 1.8.7 are at
Class: String (Ruby 1.8.7)

I altered the RDoc template as well to show the Ruby version.

For example, the String class page, up at the top, should show

Class String
In: string.c
Ruby version: Ruby 1.9.2

for the default docs, and

  Class: String (Ruby 1.8.7)

has

Class String
In: string.c
Ruby version: Ruby 1.8.7

James

I always go the other way, since Google always found 1.8.6 docs, I only knew
1.8.6 API, and I would see people use useful / cool methods that I didn't
even know about :stuck_out_tongue: I'm happy about this decision :slight_smile:

···

On Fri, Jan 7, 2011 at 10:35 PM, Markus Fischer <markus@fischer.name> wrote:

I've been hit by this a few times too. Usually I land in the middle of a
page through Google, and thus I always miss the "head" of the page when
I quickly want to look up things.

Would be nice if, when new features are introduced, they also get
document. In this case, .e.g.

str % arg - since Ruby 1.x.y
Support for hashes - since Ruby 1.9.2
...