Disable rdoc and ri from gemspec / Gemfile
Asked Answered
A

1

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

Accepted answered 23/4, 2013 at 11:12 Comment(9)
so save it into a bash script? echo 'gem: --no-ri --no-rdoc' > ~/.gemrcKowtko
@Kowtko How to trigger bash script on gem install foo?Accepted
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.Kowtko
@Kowtko 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 :)Accepted
haha, sorry for not being of more help!Kowtko
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?Zink
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.Briefcase
@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).Accepted
Thanks @Dolphin (and sorry if my doubt had sounded blunt/rude)Briefcase
W
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

Wimsatt answered 3/6, 2013 at 21:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.