flombe 0.1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. data/.gitignore +4 -0
  2. data/.gitmodules +3 -0
  3. data/.rspec +2 -0
  4. data/Flombefile +9 -0
  5. data/Gemfile +10 -0
  6. data/Gemfile.lock +57 -0
  7. data/LICENSE +20 -0
  8. data/Rakefile +33 -0
  9. data/bin/flombe +17 -0
  10. data/config/rake.rb +38 -0
  11. data/cookbooks/homebrew/README.rdoc +8 -0
  12. data/cookbooks/homebrew/metadata.rb +8 -0
  13. data/cookbooks/homebrew/providers/homebrew.rb +39 -0
  14. data/cookbooks/homebrew/recipes/default.rb +42 -0
  15. data/cookbooks/homebrew/resources/homebrew.rb +14 -0
  16. data/cookbooks/mysql/README.rdoc +8 -0
  17. data/cookbooks/mysql/metadata.rb +6 -0
  18. data/cookbooks/mysql/recipes/default.rb +43 -0
  19. data/cookbooks/mysql/recipes/timezone.rb +10 -0
  20. data/cookbooks/redis/README.rdoc +8 -0
  21. data/cookbooks/redis/metadata.rb +6 -0
  22. data/cookbooks/redis/recipes/2.0.4.rb +24 -0
  23. data/cookbooks/redis/recipes/default.rb +7 -0
  24. data/cookbooks/rvm/CHANGELOG.md +19 -0
  25. data/cookbooks/rvm/README.md +564 -0
  26. data/cookbooks/rvm/Rakefile +35 -0
  27. data/cookbooks/rvm/attributes/default.rb +54 -0
  28. data/cookbooks/rvm/attributes/gem_package.rb +23 -0
  29. data/cookbooks/rvm/attributes/vagrant.rb +22 -0
  30. data/cookbooks/rvm/libraries/gem_package_monkeypatch.rb +34 -0
  31. data/cookbooks/rvm/libraries/helpers.rb +334 -0
  32. data/cookbooks/rvm/libraries/rvm_rubygems_package.rb +108 -0
  33. data/cookbooks/rvm/metadata.json +271 -0
  34. data/cookbooks/rvm/metadata.rb +95 -0
  35. data/cookbooks/rvm/providers/default_ruby.rb +46 -0
  36. data/cookbooks/rvm/providers/environment.rb +50 -0
  37. data/cookbooks/rvm/providers/gemset.rb +135 -0
  38. data/cookbooks/rvm/providers/global_gem.rb +99 -0
  39. data/cookbooks/rvm/providers/ruby.rb +100 -0
  40. data/cookbooks/rvm/providers/shell.rb +68 -0
  41. data/cookbooks/rvm/providers/wrapper.rb +58 -0
  42. data/cookbooks/rvm/recipes/default.rb +73 -0
  43. data/cookbooks/rvm/recipes/gem_package.rb +23 -0
  44. data/cookbooks/rvm/recipes/system.rb +69 -0
  45. data/cookbooks/rvm/recipes/user.rb +47 -0
  46. data/cookbooks/rvm/recipes/vagrant.rb +30 -0
  47. data/cookbooks/rvm/resources/default_ruby.rb +29 -0
  48. data/cookbooks/rvm/resources/environment.rb +29 -0
  49. data/cookbooks/rvm/resources/gem.rb +36 -0
  50. data/cookbooks/rvm/resources/gemset.rb +30 -0
  51. data/cookbooks/rvm/resources/global_gem.rb +33 -0
  52. data/cookbooks/rvm/resources/ruby.rb +29 -0
  53. data/cookbooks/rvm/resources/shell.rb +40 -0
  54. data/cookbooks/rvm/resources/wrapper.rb +32 -0
  55. data/cookbooks/rvm/templates/default/rvmrc.erb +14 -0
  56. data/cookbooks/rvm/templates/default/vagrant-chef-solo-wrapper.erb +23 -0
  57. data/cookbooks/utils/README.rdoc +8 -0
  58. data/cookbooks/utils/metadata.rb +6 -0
  59. data/cookbooks/utils/recipes/default.rb +10 -0
  60. data/cookbooks/utils/recipes/dotfiles.rb +21 -0
  61. data/cookbooks/utils/templates/default/dot.profile.erb +36 -0
  62. data/flombe.gemspec +28 -0
  63. data/lib/flombe/dsl.rb +66 -0
  64. data/lib/flombe.rb +107 -0
  65. data/spec/dsl_spec.rb +111 -0
  66. data/spec/flombe_spec.rb +30 -0
  67. data/spec/quality_spec.rb +11 -0
  68. data/spec/spec_helper.rb +21 -0
  69. data/spec/support/helpers.rb +18 -0
  70. data/spec/support/matchers.rb +9 -0
  71. data/spec/support/path.rb +21 -0
  72. data/templates/chef_solo.erb +11 -0
  73. metadata +154 -0
@@ -0,0 +1,564 @@
1
+ # DESCRIPTION
2
+
3
+ Installs a system-wide RVM and manages installed rubies. Several lightweight
4
+ resources and providers (LWRP) are also defined.
5
+
6
+ # REQUIREMENTS
7
+
8
+ ## Platform
9
+
10
+ Tested on Ubuntu 10.04/10.10, Debian 6.0, and OpenSuSE 11.4. Also reported
11
+ to work on CentOS, Redhat and Fedora.
12
+
13
+ ## Cookbooks
14
+
15
+ There are no explicit external cookbook dependencies. However, the Opscode
16
+ *java* cookbook can be used when installing JRuby.
17
+
18
+ # RECIPES
19
+
20
+ ## default
21
+
22
+ Installs RVM system-wide, builds RVM Rubies, sets a default Ruby, installs
23
+ any gems and global gems. **Note** that the `system` recipe is included to
24
+ install RVM.
25
+
26
+ ## system
27
+
28
+ Installs any package dependencies and installs RVM system-wide.
29
+
30
+ ## vagrant
31
+
32
+ An optional recipe if Chef is installed in a non-RVM Ruby in a
33
+ [Vagrant](http://vagrantup.com) virtual machine. This recipe adds the
34
+ default vagrant user to the RVM unix group and installs a `chef-solo`
35
+ wrapper script so Chef doesn't need to be re-installed in the default
36
+ RVM Ruby.
37
+
38
+ ## gem_package
39
+
40
+ An experimental recipe that patches the
41
+ [gem_package resource](http://wiki.opscode.com/display/chef/Resources#Resources-Package)
42
+ to use the `Chef::Provider::Package::RVMRubygems` provider. An attribute
43
+ `rvm/gem_package/rvm_string` will determine which RVM ruby is used for
44
+ install/remove/upgrade/purge actions. This may help when using a third
45
+ party or upstream cookbook that assumes a non-RVM managed system ruby.
46
+
47
+ **Warning:** Here be dragons! This is either brilliant or the dumbest idea
48
+ ever, so feedback is appreciated.
49
+
50
+ # USAGE
51
+
52
+ The typical case will be to include the `rvm` recipe which will install RVM
53
+ system-wide, install all listed RVM rubies and gems and set a default RVM ruby.
54
+
55
+ If node is running in a Vagrant VM, then the `rvm::vagrant` recipe can help
56
+ with resolving the *chef-solo* binary on subsequent provision executions.
57
+
58
+ There are also several resources declared which can be used in other recipes
59
+ that are RVM-supported. See below for more details.
60
+
61
+ # ATTRIBUTES
62
+
63
+ ## `default_ruby`
64
+
65
+ The default ruby for RVM. If the RVM ruby is not installed, it will be
66
+ built as a pre-requisite. The value can also contain a gemset in the form of
67
+ `"ruby-1.8.7-p330@awesome"`.
68
+
69
+ **Note:** a fully qualified RVM string name needs to be used, which can be
70
+ found when running `rvm list known`.
71
+
72
+ The default is `"ruby-1.9.2-p180"`. To disable a default ruby from being
73
+ set, use an empty string (`""`) or a value of `"system"`.
74
+
75
+ ## `rubies`
76
+
77
+ A list of additional RVM rubies to be built and installed. This list does not need to
78
+ necessarily contain your default ruby as the `rvm_default_ruby` resource will take
79
+ care of installing itself. For example:
80
+
81
+ node['rvm']['rubies'] = [ "ree-1.8.7", "jruby-1.5.6" ]
82
+
83
+ **Note:** a fully qualified RVM string name needs to be used, which can be
84
+ found when running `rvm list known`.
85
+
86
+ The default is an empty array. To disable a default ruby from being
87
+ installed, see the `install_rubies` attribute.
88
+
89
+ ## `install_rubies`
90
+
91
+ Can enable or disable installation of a default ruby and additional rubies set
92
+ attribute metadata. The primary use case for this attribute is when you don't
93
+ want any rubies installed (but you want RVM installed). To do so:
94
+
95
+ node['rvm']['install_rubies'] = "false"
96
+
97
+ The default is `"true"`.
98
+
99
+ ## `global_gems`
100
+
101
+ A list of gem hashes to be installed into the *global* gemset in each
102
+ installed RVM ruby. The RVM global.gems files will be added to and all
103
+ installed rubies will be iterated over to ensure full installation coverage.
104
+ See the `rvm_gem` resource for more details about the options for each
105
+ gem hash. The default puts bundler in each ruby:
106
+
107
+ node['rvm']['global_gems'] = [
108
+ { 'name' => "bundler" }
109
+ ]
110
+
111
+ ## `gems`
112
+
113
+ A list of gem hashes to be installed into arbitrary RVM rubies and gemsets.
114
+ See the `rvm_gem` resource for more details about the options for each gem
115
+ hash and target ruby environment. The default is an empty hash.
116
+
117
+ ## `rvmrc`
118
+
119
+ A hash of system-wide `rvmrc` options. The key is the RVM setting name
120
+ (in String or Symbol form) and the value is the desired setting value.
121
+ An example used on a build box might be:
122
+
123
+ node['rvm']['rvmrc'] = {
124
+ 'rvm_gemset_create_on_use_flag' => 1,
125
+ 'rvm_trust_rvmrcs_flag' => 1
126
+ }
127
+
128
+ The default is an empty hash.
129
+
130
+ ## `branch`
131
+
132
+ A specific git branch to use when installing system-wide. For example:
133
+
134
+ node['rvm']['branch'] = "crazy"
135
+
136
+ The default is `nil` which corresponds to the master branch.
137
+
138
+ ## `version`
139
+
140
+ A specific tagged version to use when installing system-wide. This value is
141
+ passed directly to the `rvm-installer` script and current valid values are:
142
+ `"head"` (the default, last git commit), `"latest"` (last tagged release
143
+ version) and a specific tagged version of the form `"1.2.3"`. You may want
144
+ to use a specific version of RVM to prevent differences in deployment from
145
+ one day to the next (RVM head moves pretty darn quickly):
146
+
147
+ node['rvm']['version'] = "1.5.3"
148
+
149
+ The default is `nil`, which corresponds to RVM `"head"`.
150
+
151
+ ## `upgrade`
152
+
153
+ Determines how to handle installing updates to the RVM framework. There are
154
+ currently 3 valid values:
155
+
156
+ * `"none"`, `false`, or `nil`: will not update RVM and leave it in its
157
+ current state. **Note** that this is the default.
158
+ * `"latest"`: runs `rvm get latest` which downloads and installs the latest
159
+ *"stable"* RVM release listed by
160
+ [http://rvm.beginrescueend.com/releases/stable-version.txt](http://rvm.beginrescueend.com/releases/stable-version.txt).
161
+ * `"head"`: runs the infamous `rvm get head` which clones (via git) and installs
162
+ the latest RVM repository HEAD.
163
+
164
+ ## `root_path`
165
+
166
+ The path prefix to RVM in a system-wide installation. The default is
167
+ `"/usr/local/rvm"`.
168
+
169
+ ## `installer_url`
170
+
171
+ The URL that provides the RVM installer. The default is
172
+ `http://rvm.beginrescueend.com/install/rvm`.
173
+
174
+ ## `group_users`
175
+
176
+ A list of users that will be added to the `rvm` group. These users
177
+ will then be able to manage RVM in a system-wide installation. The default
178
+ is an empty list.
179
+
180
+ ## `rvm_gem_options`
181
+
182
+ These options are passed to the *gem* command in a RVM environment.
183
+ In the interest of speed, rdoc and ri docs will not be generated by default.
184
+ To re-enable the documentation generation set:
185
+
186
+ node['rvm']['rvm_gem_options'] = "--rdoc --ri"
187
+
188
+ The default is `"--no-rdoc --no-ri"`.
189
+
190
+ ## `vagrant/system_chef_solo`
191
+
192
+ If using the `vagrant` recipe, this sets the path to the package-installed
193
+ *chef-solo* binary. The default is `"/usr/bin/chef-solo"`.
194
+
195
+ ## `gem_package/rvm_string`
196
+
197
+ If using the `gem_package` recipe, this determines which ruby will be used by the
198
+ `gem_package` resource in other cookbooks. The default is the value of the
199
+ `default_ruby` attribute.
200
+
201
+ # RESOURCES AND PROVIDERS
202
+
203
+ ## rvm_ruby
204
+
205
+ ### Actions
206
+
207
+ Action |Description |Default
208
+ ----------|------------------------------|-------
209
+ install |Build and install an RVM ruby. See [RVM rubies/installing](http://rvm.beginrescueend.com/rubies/installing/) for more details. |Yes
210
+ remove |Remove the ruby, source files and optional gemsets/archives. See [RVM rubies/removing](http://rvm.beginrescueend.com/rubies/removing/) for more details. |
211
+ uninstall |Just remove the ruby and leave everything else. See [RVM rubies/removing](http://rvm.beginrescueend.com/rubies/removing/) for more details. |
212
+
213
+ ### Attributes
214
+
215
+ Attribute |Description |Default value
216
+ ------------|------------|-------------
217
+ ruby_string |**Name attribute:** a fully qualified RVM ruby string that could contain a gemset. See the section *RVM Ruby Strings* for more details. If a gemset is given (for example, `"ruby-1.8.7-p330@awesome"`), then it will be stripped. |`nil`
218
+
219
+ ### Examples
220
+
221
+ #### Install Ruby
222
+
223
+ rvm_ruby "ree-1.8.7-2011.01" do
224
+ action :install
225
+ end
226
+
227
+ rvm_ruby "jruby-1.5.6"
228
+
229
+ **Note:** the install action is default, so the second example is a more common
230
+ usage.
231
+
232
+ #### Remove Ruby
233
+
234
+ rvm_ruby "ree-1.8.7-2011.01" do
235
+ action :remove
236
+ end
237
+
238
+ **Note:** the RVM documentation mentions that this method is far preferred to
239
+ using uninstall since it purges almost everything.
240
+
241
+ #### Uninstall Ruby
242
+
243
+ rvm_ruby "ree-1.8.7-2011.01" do
244
+ action :uninstall
245
+ end
246
+
247
+ ## rvm_default_ruby
248
+
249
+ This resource sets the default RVM ruby, optionally with gemset. The given
250
+ ruby will be installed if it isn't already and a gemset will be created in
251
+ none currently exist. If multiple declarations are used then the last executed
252
+ one "wins".
253
+
254
+ ### Actions
255
+
256
+ Action |Description |Default
257
+ ----------|------------------------------|-------
258
+ create |Set the default RVM ruby. See [RVM rubies/default](http://rvm.beginrescueend.com/rubies/default/) for more details. |Yes
259
+
260
+ ### Attributes
261
+
262
+ Attribute |Description |Default value
263
+ ------------|------------|-------------
264
+ ruby_string |**Name attribute:** a fully qualified RVM ruby string that could contain a gemset. See the section *RVM Ruby Strings* for more details. If a gemset is given (for example, `"ruby-1.8.7-p330@awesome"`), then it will be included. |`nil`
265
+
266
+ ### Examples
267
+
268
+ #### Setting The Default Ruby
269
+
270
+ rvm_default_ruby "ree-1.8.7-2011.01" do
271
+ action :create
272
+ end
273
+
274
+ rvm_default_ruby "jruby-1.5.6"
275
+
276
+ **Note:** the create action is default, so the second example is a more common
277
+ usage.
278
+
279
+ ## rvm_environment
280
+
281
+ This resource ensures that the specified RVM ruby is installed and the optional
282
+ gemset is created. It is a convenience resource which wraps `rvm_ruby` and
283
+ `rvm_gemset` so it can be used as a sort of *über ruby* resource which
284
+ parallels the `rvm_default_ruby` resource.
285
+
286
+ ### Actions
287
+
288
+ Action |Description |Default
289
+ -------|------------------------------|-------
290
+ create |Installs the specified RVM ruby and gemset. |Yes
291
+
292
+ ### Attributes
293
+
294
+ Attribute |Description |Default value
295
+ ------------|------------|-------------
296
+ ruby_string |**Name attribute:** a fully qualified RVM ruby string that could contain a gemset. See the section *RVM Ruby Strings* for more details. If a gemset is given (for example, `"ruby-1.8.7-p330@awesome"`), then it will be used. |`nil`
297
+
298
+ ### Examples
299
+
300
+ #### Creating A Passenger Environment In Production
301
+
302
+ rvm_environment "ree-1.8.7-2011.01@passenger"
303
+
304
+ ## rvm_gemset
305
+ See [RVM gemsets](http://rvm.beginrescueend.com/gemsets/) for more background
306
+ concerning gemsets.
307
+
308
+ ### Actions
309
+
310
+ Action |Description |Default
311
+ ----------|------------------------------|-------
312
+ create |Creates a new gemset in a given RVM ruby. See [RVM gemsets/creating](http://rvm.beginrescueend.com/gemsets/creating/) for more details. |Yes
313
+ update |Update all gems installed to the gemset in a given RVM ruby. |
314
+ empty |Remove all gems installed to the gemset in a given RVM ruby. See [RVM gemsets/emptying](http://rvm.beginrescueend.com/gemsets/emptying/) for more details. |
315
+ delete |Delete gemset from the given RVM ruby. See [RVM gemsets/deleting](http://rvm.beginrescueend.com/gemsets/deleting/) for more details. |
316
+
317
+ ### Attributes
318
+
319
+ Attribute |Description |Default value
320
+ ------------|------------|-------------
321
+ gemset |**Name attribute:** Either a fully qualified RVM ruby string containing a gemset or a bare gemset name. If only the gemset name is given, then the `ruby_string` attribute must be used to indicate which RVM ruby to target. |`nil`
322
+ ruby_string |A fully qualified RVM ruby string that should not contain a gemset. See the section *RVM Ruby Strings* for more details. |`nil`
323
+
324
+ ### Examples
325
+
326
+ #### Creating A Gemset
327
+
328
+ rvm_gemset "rails" do
329
+ ruby_string "ruby-1.9.2-p136"
330
+ action :create
331
+ end
332
+
333
+ rvm_gemset "ruby-1.9.2-p136@rails"
334
+
335
+ **Note:** the create action is default, so the second example is a more common
336
+ usage.
337
+
338
+ #### Updating A Gemset
339
+
340
+ rvm_gemset "jruby-1.6.0.RC2@development" do
341
+ action :update
342
+ end
343
+
344
+ #### Emptying A Gemset
345
+
346
+ rvm_gemset "development" do
347
+ ruby_string "jruby-1.6.0.RC2"
348
+ action :empty
349
+ end
350
+
351
+ #### Deleting A Gemset
352
+
353
+ rvm_gemset "ruby-1.9.2-p136@rails" do
354
+ action :delete
355
+ end
356
+
357
+ ## rvm_gem
358
+ This resource is a close analog to the `gem_package` provider/resource which
359
+ is RVM-aware. See the Opscode
360
+ [package resource](http://wiki.opscode.com/display/chef/Resources#Resources-Package)
361
+ and [gem package options](http://wiki.opscode.com/display/chef/Resources#Resources-GemPackageOptions)
362
+ pages for more details.
363
+
364
+ ### Actions
365
+
366
+ Action |Description |Default
367
+ ----------|------------------------------|-------
368
+ install |Install a gem - if version is provided, install that specific version. |Yes
369
+ upgrade |Upgrade a gem - if version is provided, upgrade to that specific version.|
370
+ remove |Remove a gem.|
371
+ purge |Purge a gem.|
372
+
373
+ ### Attributes
374
+
375
+ Attribute |Description |Default value
376
+ ------------|------------|-------------
377
+ package_name |**Name Attribute:** the name of the gem to install.|`nil`
378
+ ruby_string |A fully qualified RVM ruby string that could contain a gemset. See the section *RVM Ruby Strings* for more details. If a gemset is given (for example, `"ruby-1.8.7-p330@awesome"`), then it will be used. |`"default"`
379
+ version |The specific version of the gem to install/upgrade. |`nil`
380
+ options |Add additional options to the underlying gem command. |`nil`
381
+ source |Provide an additional source for gem providers (such as rubygems). |`nil`
382
+
383
+ ### Examples
384
+
385
+ #### Install A Gem
386
+
387
+ rvm_gem "thor" do
388
+ ruby_string "ruby-1.8.7-p330"
389
+ action :install
390
+ end
391
+
392
+ rvm_gem "json" do
393
+ ruby_string "ruby-1.8.7-p330@awesome"
394
+ end
395
+
396
+ rvm_gem "nokogiri" do
397
+ ruby_string "jruby-1.5.6"
398
+ version "1.5.0.beta.4"
399
+ action :install
400
+ end
401
+
402
+ **Note:** the install action is default, so the second example is a more common
403
+ usage. Gemsets can also be specified.
404
+
405
+ #### Keep A Gem Up To Date
406
+
407
+ rvm_gem "homesick" do
408
+ action :upgrade
409
+ end
410
+
411
+ **Note:** the default RVM ruby will be targetted if no `ruby_string` attribute
412
+ is given.
413
+
414
+ #### Remove A Gem
415
+
416
+ rvm_gem "nokogiri" do
417
+ ruby_string "jruby-1.5.6"
418
+ version "1.4.4.2"
419
+ action :remove
420
+ end
421
+
422
+ ## rvm_global_gem
423
+ This resource will use the `rvm_gem` resource to manage a gem in the *global*
424
+ gemset accross all RVM rubies. An entry will also be made/removed in RVM's
425
+ *global.gems* file. See the Opscode
426
+ [package resource](http://wiki.opscode.com/display/chef/Resources#Resources-Package)
427
+ and [gem package options](http://wiki.opscode.com/display/chef/Resources#Resources-GemPackageOptions)
428
+ pages for more details.
429
+
430
+ ### Actions
431
+
432
+ Action |Description |Default
433
+ ----------|------------------------------|-------
434
+ install |Install a gem across all rubies - if version is provided, install that specific version. |Yes
435
+ upgrade |Upgrade a gem across all rubies - if version is provided, upgrade to that specific version.|
436
+ remove |Remove a gem across all rubies.|
437
+ purge |Purge a gem across all rubies.|
438
+
439
+ ### Attributes
440
+
441
+ Attribute |Description |Default value
442
+ ------------|------------|-------------
443
+ package_name |**Name Attribute:** the name of the gem to install.|`nil`
444
+ version |The specific version of the gem to install/upgrade. |`nil`
445
+ options |Add additional options to the underlying gem command. |`nil`
446
+ source |Provide an additional source for gem providers (such as rubygems). |`nil`
447
+ gem_binary |A gem_package attribute to specify a gem binary. |`gem`
448
+
449
+ ## rvm_shell
450
+ This resource is a wrapper for the `script` resource which wraps the code block
451
+ in an RVM-aware environment.. See the Opscode [script resource](http://wiki.opscode.com/display/chef/Resources#Resources-Script) page for more details.
452
+
453
+ ### Actions
454
+
455
+ Action |Description |Default
456
+ ----------|------------------------------|-------
457
+ run |Run the script |Yes
458
+ nothing |Do not run this command |
459
+
460
+ Use `action :nothing` to set a command to only run if another resource
461
+ notifies it.
462
+
463
+ ### Attributes
464
+
465
+ Attribute |Description |Default value
466
+ ------------|------------|-------------
467
+ name |**Name Attribute:** Name of the command to execute. |name
468
+ ruby_string |A fully qualified RVM ruby string that could contain a gemset. See the section *RVM Ruby Strings* for more details. If a gemset is given (for example, `"ruby-1.8.7-p330@awesome"`), then it will be used. |`"default"`
469
+ code |Quoted script of code to execute. |`nil`
470
+ creates |A file this command creates - if the file exists, the command will not be run. |`nil`
471
+ cwd |Current working director to run the command from. |`nil`
472
+ environment |A has of environment variables to set before running this command. |`nil`
473
+ group |A group or group ID that we should change to before running this command. |`nil`
474
+ path |An array of paths to use when searching for the command. |`nil`, uses system path
475
+ returns |The return value of the command (may be an array of accepted values) - this resource raises an exception if the return value(s) do not match. |`0`
476
+ timeout |How many seconds to let the command run before timing out. |`nil`
477
+ user |A user name or user ID that we should change to before running this command. |`nil`
478
+ umask |Umask for files created by the command. |`nil`
479
+
480
+ ### Examples
481
+
482
+ #### Run A Rake Task
483
+
484
+ rvm_shell "migrate_rails_database" do
485
+ ruby_string "ruby-1.8.7-p334@webapp"
486
+ user "deploy"
487
+ group "deploy"
488
+ cwd "/srv/webapp/current"
489
+ code %{rake RAILS_ENV=production db:migrate}
490
+ end
491
+
492
+ ## rvm_wrapper
493
+
494
+ This resource creates a wrapper script for a binary or list of binaries in
495
+ a given RVM ruby (and optional gemset). The given ruby will be installed if
496
+ it isn't already and a gemset will be created in none currently exist.
497
+
498
+ ### Actions
499
+
500
+ Action |Description |Default
501
+ -------|------------------------------|-------
502
+ create |Creates one or more wrapper scripts. |Yes
503
+
504
+ ### Attributes
505
+
506
+ Attribute |Description |Default value
507
+ ------------|------------|-------------
508
+ prefix |**Name attribute:** a prefix string for the wrapper script name. |`nil`
509
+ ruby_string |A fully qualified RVM ruby string that could contain a gemset. See the section *RVM Ruby Strings* for more details. If a gemset is given (for example, `"ruby-1.8.7-p330@awesome"`), then it will be used. |`nil`
510
+ binary |A single binary to be wrapped. If this attribute is used do not set values for the `binaries` attribute. |`nil`
511
+ binaries |A list of binaries to be wrapped. If this attribute is used do not set a value for the `binary` attribute. |`nil`
512
+
513
+ **Note:** only `binary` or `binaries` should be used by themselves (never at
514
+ the same time).
515
+
516
+ ### Examples
517
+
518
+ #### Wrapping A Ruby CLI
519
+
520
+ rvm_wrapper "sys" do
521
+ ruby_string "jruby-1.5.6@utils"
522
+ binary "thor"
523
+ end
524
+
525
+ This will create a wrapper script called `sys_thor` in the `bin` directory
526
+ under `node['rvm']['root_path']`.
527
+
528
+ #### Wrapping A List Of Binaries
529
+
530
+ rvm_wrapper "test" do
531
+ ruby_string "default@testing"
532
+ binaries [ "rspec", "cucumber" ]
533
+ action :create
534
+ end
535
+
536
+ # DEVELOPMENT
537
+
538
+ * Source hosted at [GitHub](https://github.com/fnichol/chef-rvm)
539
+ * Report issues/Questions/Feature requests on [GitHub Issues](https://github.com/fnichol/chef-rvm/issues)
540
+
541
+ Pull requests are very welcome! Make sure your patches are well tested.
542
+ Ideally create a topic branch for every seperate change you make.
543
+
544
+ # LICENSE and AUTHOR
545
+
546
+ Author:: Fletcher Nichol (<fnichol@nichol.ca>)
547
+
548
+ Contributors:: Bram Swenson (<bram@craniumisajar.com>)
549
+
550
+ Contributors:: Phil Cohen (http://phlippers.net/)
551
+
552
+ Copyright:: 2010, 2011, Fletcher Nichol
553
+
554
+ Licensed under the Apache License, Version 2.0 (the "License");
555
+ you may not use this file except in compliance with the License.
556
+ You may obtain a copy of the License at
557
+
558
+ http://www.apache.org/licenses/LICENSE-2.0
559
+
560
+ Unless required by applicable law or agreed to in writing, software
561
+ distributed under the License is distributed on an "AS IS" BASIS,
562
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
563
+ See the License for the specific language governing permissions and
564
+ limitations under the License.
@@ -0,0 +1,35 @@
1
+ #
2
+ # Rakefile for chef-rvm
3
+ #
4
+ # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
5
+ # Copyright:: Copyright (c) 2011 Fletcher Nichol
6
+ # License:: Apache License, Version 2.0
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+
21
+ # The top of the repository checkout
22
+ TOPDIR = File.expand_path(File.join(File.dirname(__FILE__)))
23
+
24
+ desc "Bundle a single cookbook for distribution"
25
+ task :bundle_cookbook, :cookbook, :tag do |t, args|
26
+ tarball_name = "#{args.cookbook}.tar.gz"
27
+ tarball_dir = File.join(TOPDIR, "pkgs")
28
+ FileUtils.rm_rf(tarball_dir)
29
+ FileUtils.mkdir_p(tarball_dir)
30
+
31
+ sh <<-CMD
32
+ git archive --prefix=#{args.cookbook}/ #{args.tag} | \
33
+ gzip > #{File.join(tarball_dir, tarball_name)}
34
+ CMD
35
+ end
@@ -0,0 +1,54 @@
1
+ #
2
+ # Cookbook Name:: rvm
3
+ # Attributes:: default
4
+ #
5
+ # Author:: Fletcher Nichol <fnichol@nichol.ca>
6
+ #
7
+ # Copyright 2010, 2011, Fletcher Nichol
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+
22
+ default['rvm']['user'] = ENV['USER'] || 'root'
23
+ default['rvm']['group'] = Etc.getgrgid(Process.gid).name || 'rvm'
24
+ default['rvm']['root_path'] = default['rvm']['user'] == 'root' ? "/usr/local/rvm" : "#{ENV['HOME']}/.rvm"
25
+ default['rvm']['group_users'] = []
26
+ default['rvm']['rvmrc'] = Hash.new
27
+
28
+ default['rvm']['installer_url'] = "https://rvm.beginrescueend.com/install/rvm"
29
+
30
+ default['rvm']['branch'] = nil
31
+ default['rvm']['version'] = nil
32
+
33
+ default['rvm']['upgrade'] = "none"
34
+
35
+ # a hook to disable installing any default/additional rubies
36
+ default['rvm']['install_rubies'] = "true"
37
+
38
+ # ruby that will get installed and set to `rvm use default`.
39
+ default['rvm']['default_ruby'] = "ruby-1.9.2-p180"
40
+
41
+ # list of additional rubies that will be installed
42
+ default['rvm']['rubies'] = []
43
+
44
+ # list of gems to be installed in global gemset of all rubies
45
+ default['rvm']['global_gems'] = [
46
+ { 'name' => "bundler" },
47
+ { 'name' => "rake" }
48
+ ]
49
+
50
+ # hash of gemsets and their list of additional gems to be installed.
51
+ default['rvm']['gems'] = Hash.new
52
+
53
+ # default rvm_gem_options (skip rdoc/ri generation)
54
+ default['rvm']['rvm_gem_options'] = "--no-rdoc --no-ri"
@@ -0,0 +1,23 @@
1
+ #
2
+ # Cookbook Name:: rvm
3
+ # Attributes:: gem_package
4
+ #
5
+ # Author:: Fletcher Nichol <fnichol@nichol.ca>
6
+ #
7
+ # Copyright 2010, 2011, Fletcher Nichol
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+
22
+ # rvm ruby that will be used for gem_package resources
23
+ default['rvm']['gem_package']['rvm_string'] = node['rvm']['default_ruby']
@@ -0,0 +1,22 @@
1
+ #
2
+ # Cookbook Name:: rvm
3
+ # Attributes:: vagrant
4
+ #
5
+ # Author:: Fletcher Nichol <fnichol@nichol.ca>
6
+ #
7
+ # Copyright 2010, 2011, Fletcher Nichol
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+
22
+ default['rvm']['vagrant']['system_chef_solo'] = "/usr/bin/chef-solo"