from-scratch 0.5.0 → 0.6.0
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.
- checksums.yaml +4 -4
- data/Berksfile +1 -7
- data/Berksfile.lock +6 -0
- data/README.md +8 -3
- data/bin/scratchify +1 -1
- data/cookbooks/ruby_build/CHANGELOG.md +72 -0
- data/cookbooks/ruby_build/README.md +338 -0
- data/cookbooks/ruby_build/attributes/default.rb +67 -0
- data/cookbooks/ruby_build/libraries/ruby_build_recipe_helpers.rb +40 -0
- data/cookbooks/ruby_build/metadata.json +39 -0
- data/cookbooks/ruby_build/providers/ruby.rb +88 -0
- data/cookbooks/ruby_build/recipes/default.rb +69 -0
- data/cookbooks/ruby_build/resources/ruby.rb +33 -0
- data/cookbooks/ruby_rbenv/CHANGELOG.md +221 -0
- data/cookbooks/ruby_rbenv/README.md +1059 -0
- data/cookbooks/ruby_rbenv/attributes/default.rb +73 -0
- data/cookbooks/ruby_rbenv/libraries/chef_provider_package_rbenvrubygems.rb +94 -0
- data/cookbooks/ruby_rbenv/libraries/chef_rbenv_mixin.rb +49 -0
- data/cookbooks/ruby_rbenv/libraries/chef_rbenv_recipe_helpers.rb +118 -0
- data/cookbooks/ruby_rbenv/libraries/chef_rbenv_script_helpers.rb +79 -0
- data/cookbooks/ruby_rbenv/libraries/matchers.rb +25 -0
- data/cookbooks/ruby_rbenv/metadata.json +1 -0
- data/cookbooks/ruby_rbenv/providers/global.rb +53 -0
- data/cookbooks/ruby_rbenv/providers/plugin.rb +55 -0
- data/cookbooks/ruby_rbenv/providers/rehash.rb +45 -0
- data/cookbooks/ruby_rbenv/providers/ruby.rb +123 -0
- data/cookbooks/ruby_rbenv/providers/script.rb +81 -0
- data/cookbooks/ruby_rbenv/recipes/default.rb +23 -0
- data/cookbooks/ruby_rbenv/recipes/system.rb +52 -0
- data/cookbooks/ruby_rbenv/recipes/system_install.rb +45 -0
- data/cookbooks/ruby_rbenv/recipes/user.rb +76 -0
- data/cookbooks/ruby_rbenv/recipes/user_install.rb +48 -0
- data/cookbooks/ruby_rbenv/resources/gem.rb +44 -0
- data/cookbooks/ruby_rbenv/resources/global.rb +33 -0
- data/cookbooks/ruby_rbenv/resources/plugin.rb +15 -0
- data/cookbooks/ruby_rbenv/resources/rehash.rb +29 -0
- data/cookbooks/ruby_rbenv/resources/ruby.rb +43 -0
- data/cookbooks/ruby_rbenv/resources/script.rb +39 -0
- data/cookbooks/ruby_rbenv/templates/default/rbenv.sh.erb +15 -0
- data/cookbooks/scratchify/Berksfile +1 -7
- data/cookbooks/scratchify/Berksfile.lock +6 -0
- data/cookbooks/scratchify/README.md +8 -3
- data/cookbooks/scratchify/bin/scratchify +1 -1
- data/cookbooks/scratchify/from-scratch.gemspec +1 -0
- data/cookbooks/scratchify/lib/from-scratch.rb +51 -9
- data/cookbooks/scratchify/lib/from-scratch/version.rb +2 -2
- data/cookbooks/scratchify/metadata.json +2 -1
- data/cookbooks/scratchify/spec/from/scratch_spec.rb +62 -5
- data/cookbooks/scratchify/spec/spec_helper.rb +8 -1
- data/cookbooks/scratchify/templates/node.json.erb +28 -7
- data/cookbooks/scratchify/templates/user.json.erb +1 -1
- data/from-scratch.gemspec +1 -0
- data/lib/from-scratch.rb +51 -9
- data/lib/from-scratch/version.rb +2 -2
- data/metadata.rb +1 -0
- data/templates/node.json.erb +28 -7
- data/templates/user.json.erb +1 -1
- metadata +50 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3665e16b338521516687e86af0988408a6caed1
|
4
|
+
data.tar.gz: c3141e1f2fc858d5a06461938465d07cce9da1e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b4689995e6a4d6453356727e22fc167e533459170e6096b611cbbfaa8a268b18d9f89801ef6c3acdbc930e4e6750855aaf2e5094e4aea0c5dd7ee5786ecaed0
|
7
|
+
data.tar.gz: 13b9438685118f017ad6c24986b77d8008d03e7e033c227b6ead2adff75be620a0ec43caade74758452cf010ef5b3b13fb5d05d7c98105422c3e2111a9c395aa
|
data/Berksfile
CHANGED
@@ -9,10 +9,4 @@ cookbook 'user'
|
|
9
9
|
cookbook 'rvm', github: 'martinisoft/chef-rvm'
|
10
10
|
cookbook 'postgresql', github: 'sandrew/postgresql', branch: 'develop'
|
11
11
|
cookbook 'nginx'
|
12
|
-
|
13
|
-
# cookbook 'dpkg_packages', git: "https://gitlab.acid.cl/acidlabs/chef-dpkg-packages.git"
|
14
|
-
# cookbook 'nginx', git: "https://gitlab.acid.cl/acidlabs/chef-nginx.git"
|
15
|
-
# cookbook 'postgresql', git: "https://github.com/phlipper/chef-postgresql.git"
|
16
|
-
# cookbook 'rvm'
|
17
|
-
# cookbook 'ssh-hardening'
|
18
|
-
# cookbook 'sudo'
|
12
|
+
cookbook 'ruby_rbenv'
|
data/Berksfile.lock
CHANGED
@@ -4,6 +4,7 @@ DEPENDENCIES
|
|
4
4
|
git: git://github.com/sandrew/postgresql.git
|
5
5
|
revision: a1f3ce3e2e22515bc175011a3e3faa0af98dd8db
|
6
6
|
branch: develop
|
7
|
+
ruby_rbenv
|
7
8
|
rvm
|
8
9
|
git: git://github.com/martinisoft/chef-rvm.git
|
9
10
|
revision: 08ec265f277e112a5a2e4b201bd32ddfe1bb968c
|
@@ -36,6 +37,10 @@ GRAPH
|
|
36
37
|
build-essential (>= 0.0.0)
|
37
38
|
openssl (~> 4.0)
|
38
39
|
rsyslog (2.2.0)
|
40
|
+
ruby_build (0.8.0)
|
41
|
+
ruby_rbenv (1.0.1)
|
42
|
+
java (> 1.4.0)
|
43
|
+
ruby_build (>= 0.0.0)
|
39
44
|
runit (1.7.4)
|
40
45
|
packagecloud (>= 0.0.0)
|
41
46
|
rvm (0.10.1)
|
@@ -44,6 +49,7 @@ GRAPH
|
|
44
49
|
scratchify (0.1.0)
|
45
50
|
nginx (>= 0.0.0)
|
46
51
|
postgresql (>= 0.0.0)
|
52
|
+
ruby_rbenv (>= 0.0.0)
|
47
53
|
rvm (>= 0.0.0)
|
48
54
|
user (>= 0.0.0)
|
49
55
|
user (0.4.2)
|
data/README.md
CHANGED
@@ -23,11 +23,16 @@ OS:
|
|
23
23
|
- APT-based Linux (Ubuntu, Debian)
|
24
24
|
- YUM-based Linux (RedHat, CentOS)
|
25
25
|
|
26
|
+
Ruby installers:
|
27
|
+
|
28
|
+
- RVM (default)
|
29
|
+
- rbenv: `scratchify your_app_name your.host.com --rbenv`
|
30
|
+
|
26
31
|
## It's a kind of magic!
|
27
32
|
|
28
33
|
Not actully. Just preconfigured [Chef](https://www.chef.io/). Here are the things done with the command:
|
29
34
|
|
30
|
-
- Install
|
35
|
+
- Install user-wide RVM with latest MRI (2.2.3)
|
31
36
|
- Install PostgreSQL, create database with user, pg_tune a little
|
32
37
|
- Add _deploy_ non-admin user to system specially for your app, upload your SSH pub key to it
|
33
38
|
- Install nginx and replace it's default site config with one prepared for rails app
|
@@ -46,11 +51,11 @@ Both `postgres` and `your_app_name` DB users get (different) randomly generated
|
|
46
51
|
|
47
52
|
## Development
|
48
53
|
|
49
|
-
|
54
|
+
Feel free to create bug-reports and feature-requests here on [Issues page](https://github.com/sandrew/from-scratch/issues)
|
50
55
|
|
51
56
|
## Contributing
|
52
57
|
|
53
|
-
|
58
|
+
All help is highly appreciated. I'll be thankful for recipes fixes and advices as well as new features implementations. Just fork and pull-request when you have some proposals.
|
54
59
|
|
55
60
|
## License
|
56
61
|
|
data/bin/scratchify
CHANGED
@@ -0,0 +1,72 @@
|
|
1
|
+
## 0.8.0 / 2013-05-22
|
2
|
+
|
3
|
+
### Bug fixes
|
4
|
+
|
5
|
+
* Pull request [#8][]: Remove libyaml-devel pkg dependency for Red Hat family
|
6
|
+
platforms. ([@fnichol][])
|
7
|
+
|
8
|
+
### Improvements
|
9
|
+
|
10
|
+
* Pull request [#9][]: Use the HTTPS clone URL. ([@adammck][])
|
11
|
+
* Pull request [#10][]: Use old-form notifies to support AWS OpsWorks.
|
12
|
+
([@tsabat][])
|
13
|
+
* Issue [#7][]: Install Git package(s) only if Git is not previously installed.
|
14
|
+
([@fnichol][], [@ChrisLundquist][])
|
15
|
+
* Convert project from Jamie to Test Kitchen. ([@fnichol][])
|
16
|
+
|
17
|
+
|
18
|
+
## 0.7.2 / 2012-12-31
|
19
|
+
|
20
|
+
### Bug fixes
|
21
|
+
|
22
|
+
* Add missing package dependencies for C Ruby versions on RHEL family.
|
23
|
+
([@fnichol][])
|
24
|
+
|
25
|
+
### Improvements
|
26
|
+
|
27
|
+
* Print Ruby build time to :info logger (formerly :debug). ([@fnichol][])
|
28
|
+
* Add integration tests for commonly installed Ruby versions. ([@fnichol][])
|
29
|
+
|
30
|
+
|
31
|
+
## 0.7.0 / 2012-11-21
|
32
|
+
|
33
|
+
### New features
|
34
|
+
|
35
|
+
* Add environment attr to ruby_build_ruby. This allows for adding custom
|
36
|
+
compilation flags, as well as newer ruby-build environment variables, such
|
37
|
+
as RUBY_BUILD_MIRROR_URL. ([@fnichol][])
|
38
|
+
|
39
|
+
### Improvements
|
40
|
+
|
41
|
+
* Update foodcritic configuration and update .travis.yml. ([@fnichol][])
|
42
|
+
* Update Installation section of README (welcome Berkshelf). ([@fnichol][])
|
43
|
+
|
44
|
+
|
45
|
+
## 0.6.2 / 2012-05-03
|
46
|
+
|
47
|
+
### Bug fixes
|
48
|
+
|
49
|
+
* ruby_build_ruby LWRP now notifies when updated (FC017). ([@fnichol][])
|
50
|
+
* Add plaform equivalents in default attrs (FC024). ([@fnichol][])
|
51
|
+
* JRuby requires make package on Ubuntu/Debian. ([@fnichol][])
|
52
|
+
* Ensure `Chef::Config[:file_cache_path]` exists in solo mode. ([@fnichol][])
|
53
|
+
|
54
|
+
### Improvements
|
55
|
+
|
56
|
+
* Add TravisCI to run Foodcritic linter. ([@fnichol][])
|
57
|
+
* Reorganize README with section links. ([@fnichol][])
|
58
|
+
|
59
|
+
|
60
|
+
## 0.6.0 / 2011-12-10
|
61
|
+
|
62
|
+
The initial release.
|
63
|
+
|
64
|
+
<!--- The following link definition list is generated by PimpMyChangelog --->
|
65
|
+
[#7]: https://github.com/fnichol/chef-ruby_build/issues/7
|
66
|
+
[#8]: https://github.com/fnichol/chef-ruby_build/issues/8
|
67
|
+
[#9]: https://github.com/fnichol/chef-ruby_build/issues/9
|
68
|
+
[#10]: https://github.com/fnichol/chef-ruby_build/issues/10
|
69
|
+
[@ChrisLundquist]: https://github.com/ChrisLundquist
|
70
|
+
[@adammck]: https://github.com/adammck
|
71
|
+
[@fnichol]: https://github.com/fnichol
|
72
|
+
[@tsabat]: https://github.com/tsabat
|
@@ -0,0 +1,338 @@
|
|
1
|
+
# <a name="title"></a> chef-ruby_build
|
2
|
+
|
3
|
+
[](http://travis-ci.org/fnichol/chef-ruby_build)
|
4
|
+
|
5
|
+
## <a name="description"></a> Description
|
6
|
+
|
7
|
+
Manages the [ruby-build][rb_site] framework and its installed Rubies.
|
8
|
+
A lightweight resources and providers ([LWRP][lwrp]) is also defined.
|
9
|
+
|
10
|
+
## <a name="usage"></a> Usage
|
11
|
+
|
12
|
+
Simply include `recipe[ruby_build]` in your run\_list to have ruby-build
|
13
|
+
installed. You will also have access to the `ruby_build_ruby` resource. See
|
14
|
+
the [Resources and Providers](#lwrps) section for more details.
|
15
|
+
|
16
|
+
## <a name="requirements"></a> Requirements
|
17
|
+
|
18
|
+
### <a name="requirements-chef"></a> Chef
|
19
|
+
|
20
|
+
Tested on 0.10.8 but newer and older version should work just
|
21
|
+
fine. File an [issue][issues] if this isn't the case.
|
22
|
+
|
23
|
+
### <a name="requirements-platform"></a> Platform
|
24
|
+
|
25
|
+
The following platforms have been tested with this cookbook, meaning that
|
26
|
+
the recipes and LWRPs run on these platforms without error:
|
27
|
+
|
28
|
+
* ubuntu (10.04/10.10/11.04/11.10/12.04)
|
29
|
+
* mac\_os\_x (10.7/10.8)
|
30
|
+
* debian
|
31
|
+
* freebsd
|
32
|
+
* redhat
|
33
|
+
* centos
|
34
|
+
* fedora
|
35
|
+
* amazon
|
36
|
+
* scientific
|
37
|
+
* suse
|
38
|
+
|
39
|
+
Please [report][issues] any additional platforms so they can be added.
|
40
|
+
|
41
|
+
### <a name="requirements-cookbooks"></a> Cookbooks
|
42
|
+
|
43
|
+
There are **no** external cookbook dependencies. However, if you are
|
44
|
+
installing [JRuby][jruby] then a Java runtime will need to be installed.
|
45
|
+
The Opscode [java cookbook][java_cb] can be used on supported platforms.
|
46
|
+
|
47
|
+
## <a name="installation"></a> Installation
|
48
|
+
|
49
|
+
Depending on the situation and use case there are several ways to install
|
50
|
+
this cookbook. All the methods listed below assume a tagged version release
|
51
|
+
is the target, but omit the tags to get the head of development. A valid
|
52
|
+
Chef repository structure like the [Opscode repo][chef_repo] is also assumed.
|
53
|
+
|
54
|
+
### <a name="installation-platform"></a> From the Opscode Community Platform
|
55
|
+
|
56
|
+
To install this cookbook from the Opscode platform, use the *knife* command:
|
57
|
+
|
58
|
+
knife cookbook site install ruby_build
|
59
|
+
|
60
|
+
### <a name="installation-berkshelf"></a> Using Berkshelf
|
61
|
+
|
62
|
+
[Berkshelf][berkshelf] is a cookbook dependency manager and development
|
63
|
+
workflow assistant. To install Berkshelf:
|
64
|
+
|
65
|
+
cd chef-repo
|
66
|
+
gem install berkshelf
|
67
|
+
berks init
|
68
|
+
|
69
|
+
To use the Community Site version:
|
70
|
+
|
71
|
+
echo "cookbook 'ruby_build'" >> Berksfile
|
72
|
+
berks install
|
73
|
+
|
74
|
+
Or to reference the Git version:
|
75
|
+
|
76
|
+
repo="fnichol/chef-ruby_build"
|
77
|
+
latest_release=$(curl -s https://api.github.com/repos/$repo/git/refs/tags \
|
78
|
+
| ruby -rjson -e '
|
79
|
+
j = JSON.parse(STDIN.read);
|
80
|
+
puts j.map { |t| t["ref"].split("/").last }.sort.last
|
81
|
+
')
|
82
|
+
cat >> Berksfile <<END_OF_BERKSFILE
|
83
|
+
cookbook 'ruby_build',
|
84
|
+
:git => 'git://github.com/$repo.git', :branch => '$latest_release'
|
85
|
+
END_OF_BERKSFILE
|
86
|
+
|
87
|
+
### <a name="installation-librarian"></a> Using Librarian-Chef
|
88
|
+
|
89
|
+
[Librarian-Chef][librarian] is a bundler for your Chef cookbooks.
|
90
|
+
To install Librarian-Chef:
|
91
|
+
|
92
|
+
cd chef-repo
|
93
|
+
gem install librarian
|
94
|
+
librarian-chef init
|
95
|
+
|
96
|
+
To use the Opscode platform version:
|
97
|
+
|
98
|
+
echo "cookbook 'ruby_build'" >> Cheffile
|
99
|
+
librarian-chef install
|
100
|
+
|
101
|
+
Or to reference the Git version:
|
102
|
+
|
103
|
+
repo="fnichol/chef-ruby_build"
|
104
|
+
latest_release=$(curl -s https://api.github.com/repos/$repo/git/refs/tags \
|
105
|
+
| ruby -rjson -e '
|
106
|
+
j = JSON.parse(STDIN.read);
|
107
|
+
puts j.map { |t| t["ref"].split("/").last }.sort.last
|
108
|
+
')
|
109
|
+
cat >> Cheffile <<END_OF_CHEFFILE
|
110
|
+
cookbook 'ruby_build',
|
111
|
+
:git => 'git://github.com/$repo.git', :ref => '$latest_release'
|
112
|
+
END_OF_CHEFFILE
|
113
|
+
librarian-chef install
|
114
|
+
|
115
|
+
## <a name="recipes"></a> Recipes
|
116
|
+
|
117
|
+
### <a name="recipes-default"></a> default
|
118
|
+
|
119
|
+
Installs the ruby-build codebase and initializes Chef to use the Lightweight
|
120
|
+
Resources and Providers ([LWRPs][lwrp]).
|
121
|
+
|
122
|
+
## <a name="attributes"></a> Attributes
|
123
|
+
|
124
|
+
### <a name="attributes-git-url"></a> git_url
|
125
|
+
|
126
|
+
The Git URL which is used to install ruby-build.
|
127
|
+
|
128
|
+
The default is `"git://github.com/sstephenson/ruby-build.git"`.
|
129
|
+
|
130
|
+
### <a name="attributes-git-ref"></a> git_ref
|
131
|
+
|
132
|
+
A specific Git branch/tag/reference to use when installing ruby-build. For
|
133
|
+
example, to pin ruby-build to a specific release:
|
134
|
+
|
135
|
+
node['ruby_build']['git_ref'] = "v20111030"
|
136
|
+
|
137
|
+
The default is `"master"`.
|
138
|
+
|
139
|
+
### <a name="attributes-default-ruby-base-path"></a> default_ruby_base_path
|
140
|
+
|
141
|
+
The default base path for a system-wide installed Ruby. For example, the
|
142
|
+
following resource:
|
143
|
+
|
144
|
+
ruby_build_ruby "1.9.3-p0"
|
145
|
+
|
146
|
+
will be installed into
|
147
|
+
`"#{node['ruby_build']['default_ruby_base_path']}/1.9.3-p0"` unless a
|
148
|
+
`prefix_path` attribute is explicitly set.
|
149
|
+
|
150
|
+
The default is `"/usr/local/ruby"`.
|
151
|
+
|
152
|
+
### <a name="attributes-upgrade"></a> upgrade
|
153
|
+
|
154
|
+
Determines how to handle installing updates to the ruby-build framework.
|
155
|
+
There are currently 2 valid values:
|
156
|
+
|
157
|
+
* `"none"`, `false`, or `nil`: will not update ruby-build and leave it in its
|
158
|
+
current state.
|
159
|
+
* `"sync"` or `true`: updates ruby-build to the version specified by the
|
160
|
+
`git_ref` attribute or the head of the master branch by default.
|
161
|
+
|
162
|
+
The default is `"none"`.
|
163
|
+
|
164
|
+
## <a name="lwrps"></a> Resources and Providers
|
165
|
+
|
166
|
+
### <a name="lwrps-rbr"></a> ruby_build_ruby
|
167
|
+
|
168
|
+
#### <a name="lwrps-rbr-actions"></a> Actions
|
169
|
+
|
170
|
+
<table>
|
171
|
+
<thead>
|
172
|
+
<tr>
|
173
|
+
<th>Action</th>
|
174
|
+
<th>Description</th>
|
175
|
+
<th>Default</th>
|
176
|
+
</tr>
|
177
|
+
</thead>
|
178
|
+
<tbody>
|
179
|
+
<tr>
|
180
|
+
<td>install</td>
|
181
|
+
<td>
|
182
|
+
Build and install a Ruby from a definition file. See the ruby-build
|
183
|
+
readme<sup>(1)</sup> for more details.
|
184
|
+
</td>
|
185
|
+
<td>Yes</td>
|
186
|
+
</tr>
|
187
|
+
<tr>
|
188
|
+
<td>reinstall</td>
|
189
|
+
<td>
|
190
|
+
Force a recompiliation of the Ruby from source. The :install action
|
191
|
+
will skip a build if the target install directory already exists.
|
192
|
+
</td>
|
193
|
+
<td> </td>
|
194
|
+
</tr>
|
195
|
+
</tbody>
|
196
|
+
</table>
|
197
|
+
|
198
|
+
1. [ruby-build readme][rb_readme]
|
199
|
+
|
200
|
+
#### <a name="lwrps-rbr-attributes"></a> Attributes
|
201
|
+
|
202
|
+
<table>
|
203
|
+
<thead>
|
204
|
+
<tr>
|
205
|
+
<th>Attribute</th>
|
206
|
+
<th>Description</th>
|
207
|
+
<th>Default Value</th>
|
208
|
+
</tr>
|
209
|
+
</thead>
|
210
|
+
<tbody>
|
211
|
+
<tr>
|
212
|
+
<td>definition</td>
|
213
|
+
<td>
|
214
|
+
<b>Name attribute:</b> the name of a built-in definition<sup>(1)</sup>
|
215
|
+
or the path to a ruby-build definition file.
|
216
|
+
</td>
|
217
|
+
<td><code>nil</code></td>
|
218
|
+
</tr>
|
219
|
+
<tr>
|
220
|
+
<td>prefix_path</td>
|
221
|
+
<td>The path to which the Ruby will be installed.</td>
|
222
|
+
<td><code>nil</code></td>
|
223
|
+
</tr>
|
224
|
+
<tr>
|
225
|
+
<td>user</td>
|
226
|
+
<td>
|
227
|
+
A user which will own the installed Ruby. The default value of
|
228
|
+
<code>nil</code> denotes a system-wide Ruby (root-owned) is being
|
229
|
+
targeted. <b>Note:</b> if specified, the user must already exist.
|
230
|
+
</td>
|
231
|
+
<td><code>nil</code></td>
|
232
|
+
</tr>
|
233
|
+
<tr>
|
234
|
+
<td>group</td>
|
235
|
+
<td>
|
236
|
+
A group which will own the installed Ruby. The default value of
|
237
|
+
<code>nil</code> denotes a system-wide Ruby (root-owned) is being
|
238
|
+
targeted. <b>Note:</b> if specified, the group must already exist.
|
239
|
+
</td>
|
240
|
+
<td><code>nil</code></td>
|
241
|
+
</tr>
|
242
|
+
<tr>
|
243
|
+
<td>environment</td>
|
244
|
+
<td>
|
245
|
+
A Hash of additional environment variables<sup>(2)</sup>, such as
|
246
|
+
<code>CONFIGURE_OPTS</code> or <code>RUBY_BUILD_MIRROR_URL</code>.
|
247
|
+
</td>
|
248
|
+
<td><code>nil</code></td>
|
249
|
+
</tr>
|
250
|
+
</tbody>
|
251
|
+
</table>
|
252
|
+
|
253
|
+
1. [built-in definition][rb_definitions]
|
254
|
+
2. [special environment variables][rb_environment]
|
255
|
+
|
256
|
+
#### <a name="lwrps-rbr-examples"></a> Examples
|
257
|
+
|
258
|
+
##### Install Ruby
|
259
|
+
|
260
|
+
# See: https://github.com/sstephenson/ruby-build/issues/186
|
261
|
+
ruby_build_ruby "ree-1.8.7-2012.02" do
|
262
|
+
environment({ 'CONFIGURE_OPTS' => '--no-tcmalloc' })
|
263
|
+
end
|
264
|
+
|
265
|
+
ruby_build_ruby "1.9.3-p0" do
|
266
|
+
prefix_path "/usr/local/ruby/ruby-1.9.3-p0"
|
267
|
+
environment({
|
268
|
+
'RUBY_BUILD_MIRROR_URL' => 'http://local.example.com'
|
269
|
+
})
|
270
|
+
|
271
|
+
action :install
|
272
|
+
end
|
273
|
+
|
274
|
+
ruby_build_ruby "jruby-1.6.5"
|
275
|
+
|
276
|
+
**Note:** the install action is default, so the second example is more common.
|
277
|
+
|
278
|
+
##### Install A Ruby For A User
|
279
|
+
|
280
|
+
ruby_build_ruby "maglev-1.0.0" do
|
281
|
+
prefix_path "/home/deploy/.rubies/maglev-1.0.0"
|
282
|
+
user "deploy"
|
283
|
+
group "deploy"
|
284
|
+
end
|
285
|
+
|
286
|
+
##### Reinstall Ruby
|
287
|
+
|
288
|
+
ruby_build_ruby "rbx-1.2.4" do
|
289
|
+
prefix_path "/opt/rbx-1.2.4"
|
290
|
+
|
291
|
+
action :reinstall
|
292
|
+
end
|
293
|
+
|
294
|
+
**Note:** the Ruby will be built whether or not the Ruby exists in the
|
295
|
+
`prefix_path` directory.
|
296
|
+
|
297
|
+
## <a name="development"></a> Development
|
298
|
+
|
299
|
+
* Source hosted at [GitHub][repo]
|
300
|
+
* Report issues/Questions/Feature requests on [GitHub Issues][issues]
|
301
|
+
|
302
|
+
Pull requests are very welcome! Make sure your patches are well tested.
|
303
|
+
Ideally create a topic branch for every separate change you make.
|
304
|
+
|
305
|
+
## <a name="license"></a> License and Author
|
306
|
+
|
307
|
+
Author:: [Fletcher Nichol][fnichol] (<fnichol@nichol.ca>) [](http://coderwall.com/fnichol)
|
308
|
+
|
309
|
+
Copyright 2011, Fletcher Nichol
|
310
|
+
|
311
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
312
|
+
you may not use this file except in compliance with the License.
|
313
|
+
You may obtain a copy of the License at
|
314
|
+
|
315
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
316
|
+
|
317
|
+
Unless required by applicable law or agreed to in writing, software
|
318
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
319
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
320
|
+
See the License for the specific language governing permissions and
|
321
|
+
limitations under the License.
|
322
|
+
|
323
|
+
[berkshelf]: http://berkshelf.com/
|
324
|
+
[chef_repo]: https://github.com/opscode/chef-repo
|
325
|
+
[cheffile]: https://github.com/applicationsonline/librarian/blob/master/lib/librarian/chef/templates/Cheffile
|
326
|
+
[java_cb]: http://community.opscode.com/cookbooks/java
|
327
|
+
[jruby]: http://jruby.org/
|
328
|
+
[kgc]: https://github.com/websterclay/knife-github-cookbooks#readme
|
329
|
+
[librarian]: https://github.com/applicationsonline/librarian#readme
|
330
|
+
[lwrp]: http://wiki.opscode.com/display/chef/Lightweight+Resources+and+Providers+%28LWRP%29
|
331
|
+
[rb_readme]: https://github.com/sstephenson/ruby-build#readme
|
332
|
+
[rb_site]: https://github.com/sstephenson/ruby-build
|
333
|
+
[rb_environment]: https://github.com/sstephenson/ruby-build#special-environment-variables
|
334
|
+
[rb_definitions]: https://github.com/sstephenson/ruby-build/tree/master/share/ruby-build
|
335
|
+
|
336
|
+
[fnichol]: https://github.com/fnichol
|
337
|
+
[repo]: https://github.com/fnichol/chef-ruby_build
|
338
|
+
[issues]: https://github.com/fnichol/chef-ruby_build/issues
|