Commits

sirex  committed ef75617

Updated documentation for gem versions feature and made some improvements to
this feature.

  • Participants
  • Parent commits 7227b21

Comments (0)

Files changed (2)

     recipe = rubygemsrecipe
     gems =
         sass
+        compass==0.10
 
 After running buildout you can use SASS from buildout environment::
 
 =======
 
 gems
-    list of gem package names.
+    list of gem package names, also you can specify gem version, example:
+    ``sass==3.1.1``.
 
 version
     rubygems version, if not specified, recipe will try to find most recent
             self._install_rubygems()
             gem_executable = self.get_gem_executable(bindir)
 
-        for gem in self.gems:
-            s = {
-                'GEM': gem_executable,
-                'OPTIONS': ' '.join([
-                        '--no-rdoc',
-                        '--no-ri',
-                        '--bindir=%s' % bindir,
-                    ]),
-                'GEMNAME': gem
-            }
-            if '=' in gem:
-                gemname, version = (gem.strip() for gem in gem.split('='))
+        s = {
+            'GEM': gem_executable,
+            'OPTIONS': ' '.join([
+                    '--no-rdoc',
+                    '--no-ri',
+                    '--bindir=%s' % bindir,
+                ]),
+        }
+        for gemname in self.gems:
+            if '==' in gemname:
+                gemname, version = gemname.split('==', 1)
+                s['GEMNAME'] = gemname.strip()
+                s['OPTIONS'] += ' --version %s' % version.strip()
+            else:
                 s['GEMNAME'] = gemname
-                s['OPTIONS'] += ' --version %s' % version
-            self.run('%(GEM)s install %(OPTIONS)s %(GEMNAME)s' % s, self._get_env())
+            self.run('%(GEM)s install %(OPTIONS)s %(GEMNAME)s' % s,
+                     self._get_env())
 
         for executable in os.listdir(bindir):
             installed_path = self._install_executable(