6

I have a client gem which I will distribute business clients via rubygems. Gem client has cca. dozen gem dependencies and when it is being installed it takes a long time to install it due to generation of rdoc and ri for each gem.

Clients are business user and they have no use for rdoc/ri, I am looking for a way to disable that via .gemspec or Gemfile. I am familiar with a solution which utilizes system file .gemrc to disable rdoc / ri. But that is not acceptable solution since I want my installation to be simple as typing:

gem install foo

Haris Krajina
  • 14,824
  • 12
  • 64
  • 81
  • so save it into a bash script? `echo 'gem: --no-ri --no-rdoc' > ~/.gemrc` – shime Apr 23 '13 at 11:52
  • @shime How to trigger bash script on `gem install foo`? – Haris Krajina Apr 23 '13 at 12:29
  • 3
    ah, sorry for misunderstanding. now I understand what's the problem. it seems weird to me, though. I would not like for gem to be able to change my gem installing preferences globally. why wouldn't you simply instruct them to use `gem install foo --no-ri --no-rdoc`? I don't think there are any pre-installation hooks available. – shime Apr 24 '13 at 13:06
  • @shime That is one of the ways but I was hoping I will find a way to do it automatic but after research it seems there is no option for this. Hvala Šime :) – Haris Krajina Apr 24 '13 at 13:31
  • haha, sorry for not being of more help! – shime Apr 24 '13 at 14:41
  • Why not create a simple gem that shells out and puts 'gem: --no-ri --no-rdoc' into ~/.gemrc? Or have the application that they're installing setup .gemrc? – Arthur Maltson Apr 30 '13 at 12:59
  • 2
    I have some basic doubts, please correct me if I'm wrong. If your clients are business users, then its really not their business to dabble with terminal commands, `gem install`, then using it through `irb`, etc. That is just technical stuff. If someone is doing those, they are techies, and its not a big deal to ask them to do `gem install --no-ri --no-rdoc`. I think that while you're trying to sweeten things up for them, it doesn't make operational sense. – Subhas May 21 '13 at 18:09
  • @RDX It is little different in sense that gem is executable, meaning it will create executable ruby script in `/bin`. Client will not use it trough irb, but trough designed CLI. (command line interface). – Haris Krajina May 21 '13 at 22:30
  • 1
    Thanks @Dolphin (and sorry if my doubt had sounded blunt/rude) – Subhas May 22 '13 at 05:55

1 Answers1

1

You could use a post-install message to explain that they can make it install quicker by running what @shime suggested: echo 'gem: --no-ri --no-rdoc' > ~/.gemrc

ghr
  • 647
  • 4
  • 16