I tried other classes, and now I always get this error message. How to
fix that?
Oooh, oooh, call on me teacher, call on me, I know I know. It’s because
you’ve defined an alias of “ri”; it now stands for “ri -i”. When “ri”
stands for “ri -i”, it ignores the argument that follows. Instead, it
presents the “>>” prompt, and now you can type the name of what you
want to look up. So:
Big-iMac-Attack:~ mattneub$ ri -i
Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.
Prepends objects to the front of array. other elements up one.
a = [ "b", "c", "d" ]
a.unshift("a") #=> ["a", "b", "c", "d"]
a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"]
Big-iMac-Attack:~ mattneub$
Notice the blank line at the end (I hit Return) in order to get out of
interactive mode. m.
want to look up. So:
Then take it one step further: have it examine the command line, use
the arguments if any, and enter the interactive mode if none are
present
Since there is no way to distinguish the first from the second, or the
third from the fourth, I am now USCWAP. In particular, there is
absolutely no way to get ri to provide an explanation for
String#squeeze! on my machine:
Actually the patch I really want is the ability to enter numbers
String#squeeze! [Ruby 1.8]
Somehow you managed to install ri data twice.
No, I don’t think so. I mean, yes, I did, but I deleted the second set
of data some time ago (at your suggestion). But, this is different.
Look, you can see right on this Web page that there are two squeeze!
entries:
There are two squeeze entries and two squeeze! entries. Just like on my
machine. So it isn’t just me, it’s everybody. I don’t know why, and I
don’t care why; I’m just saying that since this kind of thing can and
does happen, it would be cool if ri would give me a way to choose
between them. m.
patches welcome
String#squeeze [Ruby 1.8] class String - RDoc Documentation
That webpage is not built with a stock RDoc template. RDoc HTML
output and ri output are not the same.
There are two squeeze entries and two squeeze! entries. Just like on
my
machine. So it isn’t just me, it’s everybody.
It’s not me:
apple ruby 1.8.6 with RDoc 2.4.3:
$ ri String#squeeze
Updating ri class cache with 4563 classes…
--------------------------------------------------------- String#squeeze
str.squeeze([other_str]*) => new_str
From Ruby 1.8
Builds a set of characters from the other_str parameter(s) using
[...]
Builds a set of characters from the other_str parameter(s) using
[...]
Ruby 1.9.1 with RDoc 2.4.2:
$ ri19 String#squeeze
Updating ri class cache with 1688 classes…
--------------------------------------------------------- String#squeeze
str.squeeze([other_str]*) => new_str
From Ruby 1.9.1
Builds a set of characters from the other_str parameter(s) using
[...]
So I don’t believe this happens with a stock ruby or with a modern RDoc.
I don’t know why, and I
don’t care why; I’m just saying that since this kind of thing can and
does happen, it would be cool if ri would give me a way to choose
between them. m.
I can’t fix this bug without your help. You’ll have to do some
investigation to find out what the problem is so I can reproduce and
fix it.
So it isn’t looking in any unusual places, and it isn’t find two
complete sets of ri data. My guess is that you’re going to tell me to
rebuild my ri data again. But every time I’ve done this, i.e. trying
to use “modern rdoc” against ruby 1.8.6 source, it’s been a disaster.
That’s why my current ri data is built with the rdoc that ships with the
1.8.6 source. I’ve asked for explicit instructions that work, but have
never gotten any. m.
PS Your shell line didn’t work OMM so I wrote a version in a language I
understand a little better, i.e. Ruby:
ri --list-doc-dirs.each {
|s| puts find '#{s.chomp}' -name '*squeeze-i.yaml'
}
PPS I would just like to repeat that I don’t actually care about this
particular problem. Even without the peculiar case of squeeze!, I would still like interactive ri to present me with a list of numbers to type
instead of names. One or two characters (digits) is a much faster
alternative for picking the one you want.
PPS I would just like to repeat that I don’t actually care about this
particular problem. Even without the peculiar case of squeeze!, I
would still like interactive ri to present me with a list of numbers to
type
instead of names. One or two characters (digits) is a much faster
alternative for picking the one you want.
So write a patch. We don’t really care what you really care about or
not. We need a repro for this problem and we have yet to have anyone
give us one.
rubygems via svn. I’ve grepped through all of them and none of them
define a squeeze method. So I’m still without a repro. The code I used
is below and I dry ran it with def.+initialize to ensure I was doing
it right:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.