Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
commit 4d202d2fd43cac453397b27c9bc8b42dc76b2c47 2 parents 24323ca + 51a2c2a
@sax sax authored
View
5 CHANGELOG.md
@@ -1,3 +1,8 @@
+## v1.0.1:
+
+ * fixed bug that prevented overwritting the node/npm versions (moved the `src_url`s as local variables instead of attributes) - thanks @johannesbecker
+ * updated the default versions to the latest node/npm
+
## v1.0.0:
* added packages installation support thanks to Nathan L Smith
View
2  README.md
@@ -11,7 +11,7 @@ REQUIREMENTS
## Platform
-* Tested on Debian 5+ and Ubuntu 10.04
+* Tested on Debian 6 and Ubuntu 10.04
* Should work fine on Centos, RHEL, etc.
## Cookbooks:
View
14 attributes/default.rb
@@ -18,15 +18,7 @@
#
default['nodejs']['install_method'] = 'source'
-default['nodejs']['version'] = '0.8.2'
-default['nodejs']['checksum'] = '94bbdb2d62645fd2ad5b96e41cfec68abf004fd03fabaaf7d71c48b39013cbd1'
+default['nodejs']['version'] = '0.8.6'
+default['nodejs']['checksum'] = 'dbd42800e69644beff5c2cf11a9d4cf6dfbd644a9a36ffdd5e8c6b8db9240854'
default['nodejs']['dir'] = '/usr/local'
-default['nodejs']['npm'] = '1.1.39'
-
-nodejs_tar_path = "node-v#{node['nodejs']['version']}.tar.gz"
-if node['nodejs']['version'].split('.')[1].to_i >= 5
- nodejs_tar_path = "v#{node['nodejs']['version']}/#{nodejs_tar_path}"
-end
-
-default['nodejs']['src_url'] = "http://nodejs.org/dist/#{nodejs_tar_path}"
-default['nodejs']['npm_src_url'] = "http://registry.npmjs.org/npm/-/npm-#{node['nodejs']['npm']}.tgz"
+default['nodejs']['npm'] = '1.1.48'
View
2  metadata.rb
@@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs/Configures nodejs"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "1.0.0"
+version "1.0.1"
recipe "nodejs", "Installs Node.JS based on the default installation method"
recipe "nodejs::install_from_source", "Installs Node.JS from source"
View
8 recipes/install_from_source.rb
@@ -28,11 +28,17 @@
end
nodejs_tar = "node-v#{node['nodejs']['version']}.tar.gz"
+nodejs_tar_path = nodejs_tar
+if node['nodejs']['version'].split('.')[1].to_i >= 5
+ nodejs_tar_path = "v#{node['nodejs']['version']}/#{nodejs_tar_path}"
+end
+nodejs_src_url = "http://nodejs.org/dist/#{nodejs_tar_path}"
remote_file "/usr/local/src/#{nodejs_tar}" do
- source node['nodejs']['src_url']
+ source nodejs_src_url
checksum node['nodejs']['checksum']
mode 0644
+ action :create_if_missing
end
# --no-same-owner required overcome "Cannot change ownership" bug
View
4 recipes/npm.rb
@@ -22,13 +22,15 @@
package "curl"
+npm_src_url = "http://registry.npmjs.org/npm/-/npm-#{node['nodejs']['npm']}.tgz"
+
bash "install npm - package manager for node" do
cwd "/usr/local/src"
user "root"
code <<-EOH
mkdir -p npm-v#{node['nodejs']['npm']} && \
cd npm-v#{node['nodejs']['npm']}
- curl -L #{node['nodejs']['npm_src_url']} | tar xzf - --strip-components=1 && \
+ curl -L #{npm_src_url} | tar xzf - --strip-components=1 && \
make uninstall dev
EOH
not_if "#{node['nodejs']['dir']}/bin/npm -v 2>&1 | grep '#{node['nodejs']['npm']}'"
Please sign in to comment.
Something went wrong with that request. Please try again.