Skip to content

Commit 4d202d2

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 24323ca + 51a2c2a commit 4d202d2

File tree

6 files changed

+20
-15
lines changed

6 files changed

+20
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v1.0.1:
2+
3+
* fixed bug that prevented overwritting the node/npm versions (moved the `src_url`s as local variables instead of attributes) - thanks @johannesbecker
4+
* updated the default versions to the latest node/npm
5+
16
## v1.0.0:
27

38
* added packages installation support thanks to Nathan L Smith

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ REQUIREMENTS
1111

1212
## Platform
1313

14-
* Tested on Debian 5+ and Ubuntu 10.04
14+
* Tested on Debian 6 and Ubuntu 10.04
1515
* Should work fine on Centos, RHEL, etc.
1616

1717
## Cookbooks:

attributes/default.rb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,7 @@
1818
#
1919

2020
default['nodejs']['install_method'] = 'source'
21-
default['nodejs']['version'] = '0.8.2'
22-
default['nodejs']['checksum'] = '94bbdb2d62645fd2ad5b96e41cfec68abf004fd03fabaaf7d71c48b39013cbd1'
21+
default['nodejs']['version'] = '0.8.6'
22+
default['nodejs']['checksum'] = 'dbd42800e69644beff5c2cf11a9d4cf6dfbd644a9a36ffdd5e8c6b8db9240854'
2323
default['nodejs']['dir'] = '/usr/local'
24-
default['nodejs']['npm'] = '1.1.39'
25-
26-
nodejs_tar_path = "node-v#{node['nodejs']['version']}.tar.gz"
27-
if node['nodejs']['version'].split('.')[1].to_i >= 5
28-
nodejs_tar_path = "v#{node['nodejs']['version']}/#{nodejs_tar_path}"
29-
end
30-
31-
default['nodejs']['src_url'] = "http://nodejs.org/dist/#{nodejs_tar_path}"
32-
default['nodejs']['npm_src_url'] = "http://registry.npmjs.org/npm/-/npm-#{node['nodejs']['npm']}.tgz"
24+
default['nodejs']['npm'] = '1.1.48'

metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
license "Apache 2.0"
44
description "Installs/Configures nodejs"
55
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6-
version "1.0.0"
6+
version "1.0.1"
77

88
recipe "nodejs", "Installs Node.JS based on the default installation method"
99
recipe "nodejs::install_from_source", "Installs Node.JS from source"

recipes/install_from_source.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,17 @@
2828
end
2929

3030
nodejs_tar = "node-v#{node['nodejs']['version']}.tar.gz"
31+
nodejs_tar_path = nodejs_tar
32+
if node['nodejs']['version'].split('.')[1].to_i >= 5
33+
nodejs_tar_path = "v#{node['nodejs']['version']}/#{nodejs_tar_path}"
34+
end
35+
nodejs_src_url = "http://nodejs.org/dist/#{nodejs_tar_path}"
3136

3237
remote_file "/usr/local/src/#{nodejs_tar}" do
33-
source node['nodejs']['src_url']
38+
source nodejs_src_url
3439
checksum node['nodejs']['checksum']
3540
mode 0644
41+
action :create_if_missing
3642
end
3743

3844
# --no-same-owner required overcome "Cannot change ownership" bug

recipes/npm.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222

2323
package "curl"
2424

25+
npm_src_url = "http://registry.npmjs.org/npm/-/npm-#{node['nodejs']['npm']}.tgz"
26+
2527
bash "install npm - package manager for node" do
2628
cwd "/usr/local/src"
2729
user "root"
2830
code <<-EOH
2931
mkdir -p npm-v#{node['nodejs']['npm']} && \
3032
cd npm-v#{node['nodejs']['npm']}
31-
curl -L #{node['nodejs']['npm_src_url']} | tar xzf - --strip-components=1 && \
33+
curl -L #{npm_src_url} | tar xzf - --strip-components=1 && \
3234
make uninstall dev
3335
EOH
3436
not_if "#{node['nodejs']['dir']}/bin/npm -v 2>&1 | grep '#{node['nodejs']['npm']}'"

0 commit comments

Comments
 (0)