summary refs log tree commit diff
path: root/doc/languages-frameworks
diff options
context:
space:
mode:
authorCharles Strahan <charles@cstrahan.com>2017-07-28 23:22:21 -0400
committerGitHub <noreply@github.com>2017-07-28 23:22:21 -0400
commit2b57cb91691d7fef08266f292108c8f2bd00f490 (patch)
treeb08c18df18f9c24cccdd0b0c6849d2774aa96794 /doc/languages-frameworks
parente8d8633f4e9bb67db56cafdbfa658b57bcac7211 (diff)
parent5142e8f2b2057ec02c59f4406019d41bebaff59f (diff)
downloadnixpkgs-2b57cb91691d7fef08266f292108c8f2bd00f490.tar
nixpkgs-2b57cb91691d7fef08266f292108c8f2bd00f490.tar.gz
nixpkgs-2b57cb91691d7fef08266f292108c8f2bd00f490.tar.bz2
nixpkgs-2b57cb91691d7fef08266f292108c8f2bd00f490.tar.lz
nixpkgs-2b57cb91691d7fef08266f292108c8f2bd00f490.tar.xz
nixpkgs-2b57cb91691d7fef08266f292108c8f2bd00f490.tar.zst
nixpkgs-2b57cb91691d7fef08266f292108c8f2bd00f490.zip
Merge pull request #25980 from nyarly/bundlerenv_usecases
BundlerEnv, now with groups and paths
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r--doc/languages-frameworks/ruby.xml25
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/languages-frameworks/ruby.xml b/doc/languages-frameworks/ruby.xml
index b13da92dcc4..eb1696ad224 100644
--- a/doc/languages-frameworks/ruby.xml
+++ b/doc/languages-frameworks/ruby.xml
@@ -41,7 +41,29 @@ bundlerEnv rec {
 <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.
 </para>
 
-<para>Resulting derivations also have two helpful items, <literal>env</literal> and <literal>wrapper</literal>. The first one allows one to quickly drop into
+<para>For tools written in Ruby - i.e. where the desire is to install a package and then execute e.g. <command>rake</command> at the command line, there is an alternative builder called <literal>bundlerApp</literal>. Set up the <filename>gemset.nix</filename> the same way, and then, for example:
+</para>
+
+<screen>
+  <![CDATA[{ lib, bundlerApp }:
+
+bundlerApp {
+  pname = "corundum";
+  gemdir = ./.;
+  exes = [ "corundum-skel" ];
+
+  meta = with lib; {
+    description = "Tool and libraries for maintaining Ruby gems.";
+    homepage    = https://github.com/nyarly/corundum;
+    license     = licenses.mit;
+    maintainers = [ maintainers.nyarly ];
+    platforms   = platforms.unix;
+  };
+}]]>
+
+<para>The chief advantage of <literal>bundlerApp</literal> over <literal>bundlerEnv</literal> is the executables introduced in the environment are precisely those selected in the <literal>exes</literal> list, as opposed to <literal>bundlerEnv</literal> which adds all the executables made available by gems in the gemset, which can mean e.g. <command>rspec</command> or <command>rake</command> in unpredictable versions available from various packages.
+
+<para>Resulting derivations for both builders also have two helpful attributes, <literal>env</literal> and <literal>wrapper</literal>. The first one allows one to quickly drop into
 <command>nix-shell</command> with the specified environment present. E.g. <command>nix-shell -A sensu.env</command> would give you an environment with Ruby preset
 so it has all the libraries necessary for <literal>sensu</literal> in its paths. The second one can be used to make derivations from custom Ruby scripts which have
 <filename>Gemfile</filename>s with their dependencies specified. It is a derivation with <command>ruby</command> wrapped so it can find all the needed dependencies.
@@ -74,4 +96,3 @@ in stdenv.mkDerivation {
 </programlisting>
 
 </section>
-