about summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-01-24 23:27:06 +0000
committerzimbatm <zimbatm@zimbatm.com>2016-02-18 23:44:49 +0000
commit24e0fc99f9fecc817d917944f937648c7de119f2 (patch)
tree412231af096bb51cfa09f35c1ade91359bec2083 /pkgs/development/interpreters/ruby
parent885acea1dd82b0354ff2b6bcf1268b3031cf93df (diff)
downloadnixlib-24e0fc99f9fecc817d917944f937648c7de119f2.tar
nixlib-24e0fc99f9fecc817d917944f937648c7de119f2.tar.gz
nixlib-24e0fc99f9fecc817d917944f937648c7de119f2.tar.bz2
nixlib-24e0fc99f9fecc817d917944f937648c7de119f2.tar.lz
nixlib-24e0fc99f9fecc817d917944f937648c7de119f2.tar.xz
nixlib-24e0fc99f9fecc817d917944f937648c7de119f2.tar.zst
nixlib-24e0fc99f9fecc817d917944f937648c7de119f2.zip
buildRubyGem: remove unecessary duplication
Diffstat (limited to 'pkgs/development/interpreters/ruby')
-rw-r--r--pkgs/development/interpreters/ruby/build-ruby-gem/default.nix24
1 files changed, 12 insertions, 12 deletions
diff --git a/pkgs/development/interpreters/ruby/build-ruby-gem/default.nix b/pkgs/development/interpreters/ruby/build-ruby-gem/default.nix
index c5b9fba37aa0..effd343ecfd9 100644
--- a/pkgs/development/interpreters/ruby/build-ruby-gem/default.nix
+++ b/pkgs/development/interpreters/ruby/build-ruby-gem/default.nix
@@ -50,24 +50,24 @@ lib.makeOverridable (
 , passthru ? {}
 , ...} @ attrs:
 
-if ! builtins.elem type [ "git" "gem" ]
-then throw "buildRubyGem: don't know how to build a gem of type \"${type}\""
-else
-
 let
   shellEscape = x: "'${lib.replaceChars ["'"] [("'\\'" + "'")] x}'";
   rubygems = (attrs.rubygems or defs.rubygems).override {
     inherit ruby;
   };
   src = attrs.src or (
-    if type == "gem"
-    then fetchurl {
-      urls = map (remote: "${remote}/gems/${gemName}-${version}.gem") remotes;
-      inherit (attrs) sha256;
-    } else fetchgit {
-      inherit (attrs) url rev sha256 fetchSubmodules;
-      leaveDotGit = true;
-    }
+    if type == "gem" then
+      fetchurl {
+        urls = map (remote: "${remote}/gems/${gemName}-${version}.gem") remotes;
+        inherit (attrs) sha256;
+      }
+    else if type == "git" then
+      fetchgit {
+        inherit (attrs) url rev sha256 fetchSubmodules;
+        leaveDotGit = true;
+      }
+    else
+      throw "buildRubyGem: don't know how to build a gem of type \"${type}\""
   );
   documentFlag =
     if document == []