git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #7109 from ctheune/submit/update-ruby-doc

Update the ruby packaging docs to show how to bundle Ruby Gem-based

commit9bbf60c80ed320565c82645b5241e557f7d648d4 authorDomen Kožar <domen@dev.si> dateTue 31 Mar 2015, 19:08 (12 years ago) parenta87e2ae86d82df
1 file changed+35−5
doc/language-support.xml+35−5
doc/language-support.xml+35−5
@@ -612,15 +612,45 @@ sed -i '/ = data_files/d' setup.py</programlisting>
612612
613613
614614<section xml:id="ssec-language-ruby"><title>Ruby</title>
615− <para>For example, to package yajl-ruby package, use gem-nix:</para>
615+ <para>There currently is support to bundle applications that are packaged as Ruby gems. The utility "bundix" allows you to write a <filename>Gemfile</filename>, let bundler create a <filename>Gemfile.lock</filename>, and then convert
616+ this into a nix expression that contains all Gem dependencies automatically.</para>
617+
618+ <para>For example, to package sensu, we did:</para>
616619
617620<screen>
618−$ nix-env -i gem-nix
619−$ gem-nix --no-user-install --nix-file=pkgs/development/interpreters/ruby/generated.nix yajl-ruby
620−$ nix-build -A rubyPackages.yajl-ruby
621+<![CDATA[$ cd pkgs/servers/monitoring
622+$ mkdir sensu
623+$ cat > Gemfile
624+source 'https://rubygems.org'
625+gem 'sensu'
626+$ bundler package --path /tmp/vendor/bundle
627+$ $(nix-build '&nixpkgs>' -A bundix)/bin/bundix
628+$ cat > default.nix
629+{ lib, bundlerEnv, ruby }:
630+
631+bundlerEnv {
632+ name = "sensu-0.17.1";
633+
634+ inherit ruby;
635+ gemfile = ./Gemfile;
636+ lockfile = ./Gemfile.lock;
637+ gemset = ./gemset.nix;
638+
639+ meta = with lib; {
640+ description = "A monitoring framework that aims to be simple, malleable,
641+and scalable.";
642+ homepage = http://sensuapp.org/;
643+ license = with licenses; mit;
644+ maintainers = with maintainers; [ theuni ];
645+ platforms = platforms.unix;
646+ };
647+}]]>
621648</screen>
622−</section>
623649
650+<para>Please check in the <filename>Gemfile</filename>, <filename>Gemfile.lock</filename> and the <filename>gemset.nix</filename> so future updates can be run easily.
651+</para>
652+
653+</section>
624654
625655<section xml:id="ssec-language-go"><title>Go</title>
626656