Permalink
Browse files

Changed the gemset name separator from / to @

This change makes a backwards incompatible change to the way gemsets are
defined and used.  You should now use this syntax:

    rvm_gemset {
      'ruby-1.9.2-p290@mygemset':
        ensure => present,
        require => Rvm_system_ruby['ruby-1.9.2-p290'];
    }

    rvm_gem {
      'ruby-1.9.2-p290@mygemset/bundler':
        ensure => present,
        require => Rvm_gemset['ruby-1.9.2-p290@mygemset'];
    }

Ruby versions are now separated from gemsets with an `@` instead of a
`/`.  Gems still use a `/` in their name to separate them from the ruby
version.  This should make it defining and using gemsets a bit cleaner
and more like rvm.

Sorry for the inconvenience.  Fixes #17.
  • Loading branch information...
Brandon Turner
Brandon Turner committed Aug 30, 2011
1 parent 0ed76e0 commit 9705a1731d9a78ef619af42c8898c47fe8ea1e8a
Showing with 22 additions and 39 deletions.
  1. +21 −38 README.markdown
  2. +1 −1 lib/puppet/type/rvm_gemset.rb
View
@@ -72,60 +72,43 @@ You can tell RVM to install one or more Ruby versions with:
You should use the full version number. While the shorthand version may work (e.g. '1.9.2'), the provider will be unable to detect if the correct version is installed.
-## Installing Gems
+## Creating Gemsets
-Install a gem with:
+Create a gemset with:
if $rvm_installed == "true" {
- rvm_gem {
- 'bundler':
- ruby_version => 'ruby-1.9.2-p180',
- ensure => '1.0.13',
- require => Rvm_system_ruby['ruby-1.9.2-p180'];
- }
+ rvm_gemset {
+ "ruby-1.9.2-p290@myproject":
+ ensure => present,
+ require => Rvm_system_ruby['ruby-1.9.2-p290'];
+ }
}
-Sometimes you need to install the same gem for multiple rubies:
- if $rvm_installed == "true" {
- rvm_gem {
- 'bundler192':
- name => 'bundler',
- ruby_version => 'ruby-1.9.2-p180',
- ensure => '1.0.13',
- require => Rvm_system_ruby['ruby-1.9.2-p180'];
- 'bundler187':
- name => 'bundler',
- ruby_version => 'ruby-1.8.7-p334',
- ensure => '1.0.13',
- require => 'Rvm_system_ruby['ruby-1.8.7-p334'];
- }
- }
+## Installing Gems
-Alternatively, you can use this less verbose, but slightly uglier syntax:
+Install a gem with:
if $rvm_installed == "true" {
rvm_gem {
- 'ruby-1.9.2-p180/bundler':
- ensure => '1.0.13',
- require => Rvm_system_ruby['ruby-1.9.2-p180'];
- 'ruby-1.8.7-p334/bundler':
- ensure => '1.0.13',
- require => Rvm_system_ruby['ruby-1.8.7-p334'];
+ 'ruby-1.9.2-p290@myproject/bundler':
+ ensure => '1.0.18',
+ require => Rvm_gemset['ruby-1.9.2-p290@myproject'];
}
}
+The *name* of the gem should be `<ruby-version>[@<gemset>]/<gemname>`. For example, you can install bundler for ruby-1.9.2 using `ruby-1.9.2-p290/bundler`. You could install rails in your project's gemset with: `ruby-1.9.2-p290@myproject/rails`.
-## Creating Gemsets
-
-Create a gemset with:
+Alternatively, you can use this more verbose syntax:
if $rvm_installed == "true" {
- rvm_gemset {
- "ruby-1.9.2-p290/myproject":
- ensure => present,
- require => Rvm_system_ruby['ruby-1.9.2-p290'];
- }
+ rvm_gem {
+ 'bundler':
+ name => 'bundler',
+ ruby_version => 'ruby-1.9.2-p290',
+ ensure => latest,
+ require => Rvm_system_ruby['ruby-1.9.2-p334'];
+ }
}
@@ -2,7 +2,7 @@
@doc = "Manage RVM Gemsets."
def self.title_patterns
- [ [ /^(?:(.*)\/)?(.*)$/, [ [ :ruby_version, lambda{|x| x} ], [ :name, lambda{|x| x} ] ] ] ]
+ [ [ /^(?:(.*)@)?(.*)$/, [ [ :ruby_version, lambda{|x| x} ], [ :name, lambda{|x| x} ] ] ] ]
end
ensurable

0 comments on commit 9705a17

Please sign in to comment.