[ANN] rdoc_osx_dictionary 1.2.0 Released

rdoc_osx_dictionary version 1.2.0 has been released!

* <http://rubyforge.org/projects/seattlerb>

rdoc via Apple's Dictionary.app. Automatically builds and installs an
Apple Dictionary with all rdoc nicely formatted.

Changes:

### 1.2.0 / 2010-02-03

* 3 minor enhancements:

  * Added -d flag to delete .ri directory to help me debug.
  * Loudly skip bad files created from rdoc.
  * Skip _reduce_\d+ methods (generated methods from racc of no value to rdoc).

* 2 bug fixes:

  * Added extra de-duping on xml creation to fix The Bug I Cannot Repro(tm).
  * OMG I am an idiot. Generating class id string properly now. :confused:

Thanks, it worked good on my 1.9.2 now :slight_smile:

Just a notice that links inside classes to methods, search for methods
without the class name before.
I suppose that's an auto behavior of Dictionary.app

Also, it seems my Spotlight didn't index the Ruby Dictionary, maybe only the
main dictionary is indexed.

Anyway thanks for the new version !

···

On 3 February 2010 20:32, Ryan Davis <ryand-ruby@zenspider.com> wrote:

rdoc_osx_dictionary version 1.2.0 has been released!

* <http://rubyforge.org/projects/seattlerb&gt;

rdoc via Apple's Dictionary.app. Automatically builds and installs an
Apple Dictionary with all rdoc nicely formatted.

Changes:

### 1.2.0 / 2010-02-03

* 3 minor enhancements:

* Added -d flag to delete .ri directory to help me debug.
* Loudly skip bad files created from rdoc.
* Skip _reduce_\d+ methods (generated methods from racc of no value to
rdoc).

* 2 bug fixes:

* Added extra de-duping on xml creation to fix The Bug I Cannot Repro(tm).
* OMG I am an idiot. Generating class id string properly now. :confused:

Looks like rdoc_osx_dictionary is subject to $PATH for finding ruby instead
of using the ruby it was installed with.

In this case, root's path does not have /opt/local/bin in it.

    % sudo gem install rubygems-sing
    Successfully installed rubygems-sing-1.2.0
    1 gem installed
    Installing ri documentation for rubygems-sing-1.2.0...
    Updating ri class cache with 7950 classes...
    Installing RDoc documentation for rubygems-sing-1.2.0...
    updating OSX ruby + gem dictionary, if necessary
    DEBUG: Using /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby to run rdoc_osx_dictionary
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rdoc_osx_dictionary (LoadError)
            from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
            from /opt/local/lib/ruby/gems/1.8/gems/rdoc_osx_dictionary-1.2.0/bin/rdoc_osx_dictionary:10

Looks like this patch against 1.2.0 should fix it, at least it works for me.

--- a/lib/rdoc_osx_dictionary.rb
+++ b/lib/rdoc_osx_dictionary.rb
@@ -291,7 +291,8 @@ class RDoc::OSXDictionary
   def self.install_gem_hooks
     return if @hooked[:hook]

- cmd = File.expand_path File.join(__FILE__, "../../bin/rdoc_osx_dictionary")
+ rdoc_osx_dictionary_path = File.expand_path File.join(__FILE__, "../../bin/rdoc_osx_dictionary")
+ cmd = "#{Gem.ruby} #{rdoc_osx_dictionary_path}"

     # post_install isn't actually fully post-install... so I must
     # force via at_exit :frowning:

enjoy,

-jeremy

···

On Thu, Feb 04, 2010 at 04:32:41AM +0900, Ryan Davis wrote:

rdoc_osx_dictionary version 1.2.0 has been released!

* <http://rubyforge.org/projects/seattlerb&gt;

rdoc via Apple's Dictionary.app. Automatically builds and installs an
Apple Dictionary with all rdoc nicely formatted.

--

Jeremy Hinegardner jeremy@hinegardner.org

Thanks, it worked good on my 1.9.2 now :slight_smile:

awesome

Just a notice that links inside classes to methods, search for methods
without the class name before.
I suppose that's an auto behavior of Dictionary.app

I have no idea if I can do anything about that or not. I know EVERY word is hyperlinked ("the" goes to the dictionary), but rdoc MAY be able to give me something better to use to cross-link the methods. I dunno. I'll talk to eric.

Also, it seems my Spotlight didn't index the Ruby Dictionary, maybe only the
main dictionary is indexed.

Indeed. It only indexes the top dictionary listed in the prefs.

Anyway thanks for the new version !

you're welcome!

···

On Feb 3, 2010, at 12:27 , Benoit Daloze wrote:

> rdoc_osx_dictionary version 1.2.0 has been released!

1) Why do I never see Ryan's original announcements on the
comp.lang.ruby side of things, but only others' responses? See:
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/1fe6802b6db67ee5/4fbe195e7fca9340#4fbe195e7fca9340

> * <http://rubyforge.org/projects/seattlerb&gt;

2) Ryan, you do wonderful work, but why oh why must you continue to
hostenormous piles of wholly disparate projects under a single web
site? The home page for 'this' project, http://seattlerb.rubyforge.org/,
doesn't even list rdoc_osx_dictionary.

> rdoc via Apple's Dictionary.app. Automatically builds and installs an
> Apple Dictionary with all rdoc nicely formatted.

Sadly, no glory for me. I'm wholly guessing that this is a gem I
install (given no instructions in the quoted email, and I'm assuming
not in the original). Given that, here's what I get:

phrogz$ sudo gem install rdoc_osx_dictionary
Password:
Successfully installed rdoc_osx_dictionary-1.2.0
1 gem installed
Installing ri documentation for rdoc_osx_dictionary-1.2.0...
Installing RDoc documentation for rdoc_osx_dictionary-1.2.0...
updating OSX ruby + gem dictionary, if necessary
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- rdoc_osx_dictionary
(LoadError)
  from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`require'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rdoc_osx_dictionary-1.0.1/
bin/rdoc_osx_dictionary:6

I love the idea of this project; anything I can do to help debug
further, please let me know.

···

On Feb 3, 1:27 pm, Benoit Daloze <erego...@gmail.com> wrote:

On 3 February 2010 20:32, Ryan Davis <ryand-r...@zenspider.com> wrote:

I found this: [1]
That one looks cleaner for the format of code inside documentation,
could you imitate that?

Thanks for so quick answers and update :slight_smile:

[1] http://priithaamer.com/blog/ruby-on-rails-dictionary-for-macosx

···

On 4 February 2010 02:45, Ryan Davis <ryand-ruby@zenspider.com> wrote:

On Feb 3, 2010, at 12:27 , Benoit Daloze wrote:

> Just a notice that links inside classes to methods, search for methods
> without the class name before.
> I suppose that's an auto behavior of Dictionary

rdoc_osx_dictionary version 1.2.0 has been released!

1) Why do I never see Ryan's original announcements on the
comp.lang.ruby side of things, but only others' responses? See:
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/1fe6802b6db67ee5/4fbe195e7fca9340#4fbe195e7fca9340

I have absolutely no idea. Blame google? No... my guess is that it is prolly the gateway... but really I don't know. I never read it that way. Why do you? Are there tangible benefits?

* <http://rubyforge.org/projects/seattlerb&gt;

2) Ryan, you do wonderful work, but why oh why must you continue to
hostenormous piles of wholly disparate projects under a single web
site?

because it drives our stats up? :smiley:

The home page for 'this' project, http://seattlerb.rubyforge.org/,
doesn't even list rdoc_osx_dictionary.

That's because I'm lazy and haven't automated that page yet :slight_smile:

rdoc via Apple's Dictionary.app. Automatically builds and installs an
Apple Dictionary with all rdoc nicely formatted.

Sadly, no glory for me. I'm wholly guessing that this is a gem I
install (given no instructions in the quoted email, and I'm assuming
not in the original). Given that, here's what I get:

phrogz$ sudo gem install rdoc_osx_dictionary
Password:
Successfully installed rdoc_osx_dictionary-1.2.0
1 gem installed
Installing ri documentation for rdoc_osx_dictionary-1.2.0...
Installing RDoc documentation for rdoc_osx_dictionary-1.2.0...
updating OSX ruby + gem dictionary, if necessary
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- rdoc_osx_dictionary
(LoadError)
  from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`require'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rdoc_osx_dictionary-1.0.1/
bin/rdoc_osx_dictionary:6

I just had a bug reported about the gem using PATH to figure out what ruby to invoke... possibly this is related? does `which gem` and `which ruby` resolve to the same install for you? I'd guess not based on the mix of /usr/local/lib and /Library/Ruby in your backtrace.

···

On Feb 4, 2010, at 21:25 , Phrogz wrote:

On Feb 3, 1:27 pm, Benoit Daloze <erego...@gmail.com> wrote:

On 3 February 2010 20:32, Ryan Davis <ryand-r...@zenspider.com> wrote:

I love the idea of this project; anything I can do to help debug
further, please let me know.

I can't have this gem working :frowning: it installs just fine, but i can't
find it nowhere in my dictionary. Any hint?

> 1) Why do I never see Ryan's original announcements on the
> comp.lang.ruby side of things, but only others' responses? See:
>http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/1fe68\.\.\.

I have absolutely no idea. Blame google? No... my guess is that it is prolly the gateway... but really I don't know. I never read it that way. Why do you? Are there tangible benefits?

I'm not subscribed to the ML these days due to traffic; I just visit
CLR as time permits, and I prefer the Google Groups interface for
keeping track of what I've read and nested threading over something
like ruby forum.

I just had a bug reported about the gem using PATH to figure out what ruby to invoke... possibly this is related? does `which gem` and `which ruby` resolve to the same install for you? I'd guess not based on the mix of /usr/local/lib and /Library/Ruby in your backtrace.

They do:

Slim2:~ phrogz$ which ruby
/usr/local/bin/ruby
Slim2:~ phrogz$ which gem
/usr/local/bin/gem

I don't know what this means, though:
Slim2:~ phrogz$ ruby -e "puts `which gem`"
-e:1: unknown regexp options - lcal

···

On Feb 5, 12:36 am, Ryan Davis <ryand-r...@zenspider.com> wrote:

On Feb 4, 2010, at 21:25 , Phrogz wrote:

got it.. i had to launch rdoc_osx_dictionary to build the dictionary

···

On 5 Feb, 12:42, Il France <frances...@gmail.com> wrote:

I can't have this gem working :frowning: it installs just fine, but i can't
find it nowhere in my dictionary. Any hint?

Silly me, wrong quotes:

Slim2:~ phrogz$ ruby -e 'puts `which gem`, `which ruby`'
/usr/local/bin/gem
/usr/local/bin/ruby

···

On Feb 5, 6:43 am, Phrogz <phr...@mac.com> wrote:

I don't know what this means, though:
Slim2:~ phrogz$ ruby -e "puts `which gem`"
-e:1: unknown regexp options - lcal

hrm... what does `gem env` say?

···

On Feb 5, 2010, at 06:22 , Phrogz wrote:

On Feb 5, 6:43 am, Phrogz <phr...@mac.com> wrote:

I don't know what this means, though:
Slim2:~ phrogz$ ruby -e "puts `which gem`"
-e:1: unknown regexp options - lcal

Silly me, wrong quotes:

Slim2:~ phrogz$ ruby -e 'puts `which gem`, `which ruby`'
/usr/local/bin/gem
/usr/local/bin/ruby

When 'rdoc_osx_dictionary' is run in the at_exit handler from post_install hook
it is run directly as
INSTALLATION_DIRECTORY/gems/rdoc_osx_dictionary-1.2.0/bin/rdoc_osx_dictionary
and not through the gem bin wrapper.

% head -1 $(gemdir rdoc_osx_dictionary)/bin/rdoc_osx_dictionary
#!/usr/bin/ruby -ws

Looks like it is going to invoke the system ruby every time no matter what.

enjoy,

-jeremy

···

On Sat, Feb 06, 2010 at 03:16:55AM +0900, Ryan Davis wrote:

On Feb 5, 2010, at 06:22 , Phrogz wrote:

> On Feb 5, 6:43 am, Phrogz <phr...@mac.com> wrote:
>> I don't know what this means, though:
>> Slim2:~ phrogz$ ruby -e "puts `which gem`"
>> -e:1: unknown regexp options - lcal
>
> Silly me, wrong quotes:
>
> Slim2:~ phrogz$ ruby -e 'puts `which gem`, `which ruby`'
> /usr/local/bin/gem
> /usr/local/bin/ruby

hrm... what does `gem env` say?

--

Jeremy Hinegardner jeremy@hinegardner.org

kk. that'll be fixed in my next release... along with awesome indexing improvements...

But I'd like to know how this happened in the first place:

1) your root doesn't have /opt/local/bin in the path.
2) if you head your wrapper script, its path is /usr/bin/ruby

How'd you install?
How'd you run?
What are you seeing?

I assume `sudo gem install blah` invoked it.

···

On Feb 5, 2010, at 11:45 , Jeremy Hinegardner wrote:

When 'rdoc_osx_dictionary' is run in the at_exit handler from post_install hook
it is run directly as
INSTALLATION_DIRECTORY/gems/rdoc_osx_dictionary-1.2.0/bin/rdoc_osx_dictionary
and not through the gem bin wrapper.

% head -1 $(gemdir rdoc_osx_dictionary)/bin/rdoc_osx_dictionary
#!/usr/bin/ruby -ws

Looks like it is going to invoke the system ruby every time no matter what.