Dne 9.1.2013 16:40, Ralf Haferkamp napsal(a):
On Wed, Jan 09, 2013 at 01:37:18PM +0100, Josef Reidinger wrote:
On Wed, 9 Jan 2013 13:25:22 +0100 Ralf Haferkamp <rhafer@suse.de> wrote: [...] Yeah, this is the approach (or at least a similar one) I am currently trying as well. I created a small script that parses the Gemfile an filters out unneeded groups and platforms and generates a new Gemfile from that.
I have a simple rake task for this in Webyast: https://github.com/webyast/webyast/blob/master/webyast/lib/tasks/gemfile.rak... The Gemfiles are created during build in .spec: https://github.com/webyast/webyast/blob/master/webyast/package/webyast-base....
Webyast have some task, that allows to install specific gemfile for given environment - see https://github.com/webyast/webyast/tree/master/webyast part in spec file.
The additional Gemfiles are used for specific tasks, like this: BUNDLE_GEMFILE=Gemfile.test RAILS_ENV=test rake test
Also it is interesting that Gemfile can interpret ruby code, so you can comment it out quite easy.
Gemfile is basically a Ruby file which is eval()ed, so you can write any Ruby code there. WebYast uses this feature for finding the installed webyast modules (gems) at runtime. It loads the gems dynamically depending on what's present in the system. https://github.com/webyast/webyast/blob/master/webyast/package/webyast-base.... WebYast also loads some more additional development gems when running from Git checkout (a nice trick, it's convenient for developers and does not affect deployment/RPM build): https://github.com/webyast/webyast/blob/master/webyast/Gemfile#L63 -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org