Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Enable version as named attribute #2

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 30 additions & 37 deletions Berksfile.lock
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
{
"sources": {
"nvm": {
"path": "."
},
"apt": {
"locked_version": "2.1.0"
},
"minitest-handler": {
"locked_version": "0.2.1"
},
"nvm_test": {
"path": "./test/cookbooks/nvm_test"
},
"git": {
"locked_version": "2.6.0"
},
"dmg": {
"locked_version": "2.0.0"
},
"build-essential": {
"locked_version": "1.4.2"
},
"yum": {
"locked_version": "2.3.0"
},
"windows": {
"locked_version": "1.10.0"
},
"chef_handler": {
"locked_version": "1.1.4"
},
"runit": {
"locked_version": "1.2.0"
}
}
}
DEPENDENCIES
apt
minitest-handler (~> 0.2.1)
nvm
path: .
metadata: true
nvm_test
path: test/cookbooks/nvm_test

GRAPH
apt (2.7.0)
build-essential (2.2.3)
chef_handler (1.2.0)
dmg (2.2.2)
git (4.3.0)
build-essential (>= 0.0.0)
dmg (>= 0.0.0)
windows (>= 0.0.0)
yum-epel (>= 0.0.0)
minitest-handler (0.2.1)
chef_handler (>= 0.0.0)
nvm (0.1.4)
git (>= 2.1.0)
nvm_test (0.1.0)
nvm (>= 0.0.0)
windows (1.37.0)
chef_handler (>= 0.0.0)
yum (3.6.3)
yum-epel (0.6.2)
yum (~> 3.2)
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source "https://rubygems.org"

gem "rake", "~> 10.1.0"
gem "berkshelf", "~> 2.0.9"
gem "json", "= 1.7.7"
gem "json", "= 1.8.2"
gem "minitest-chef-handler", "~> 1.0.1", :group => :integration
gem "kitchen-vagrant", "~> 0.11.0", :group => :integration
gem "cookbook-development", :github => "hipsnip-cookbooks/cookbook-development"
gem "cookbook-development", :github => "hipsnip-cookbooks/cookbook-development"
243 changes: 0 additions & 243 deletions Gemfile.lock

This file was deleted.

51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Chef cookbook for setting up NVM from [creationix's github repository](https://github.com/creationix/nvm).

[![Build Status](https://travis-ci.org/hipsnip-cookbooks/nvm.png?branch=master)](https://travis-ci.org/hipsnip-cookbooks/nvm) [![Dependency Status](https://gemnasium.com/hipsnip-cookbooks/nvm.png)](https://gemnasium.com/hipsnip-cookbooks/nvm)

## Requirements

Built to run on Linux distributions. Tested on Ubuntu 12.04.
Expand Down Expand Up @@ -49,6 +47,13 @@ Install a node.js version from source or binaries
- `from_source` - install from source if true, default to false
- `alias_as_default` - alias the current version as the default version, default true

##### Only used for user install
- `user_install` - install nvm for a particular user, default false
- `user` - user to install nvm as, no default
- `group` - group to install nvm as, defaults to user
- `user_nome` - home directory of user for user install if it is a non standard home directory, default /home/$user
- `nvm_directory` -

#### Examples

Install from binary
Expand All @@ -67,6 +72,48 @@ Install from source
action :create
end

Install as user

nvm_install '0.10.5' do
user 'myuser'
group 'mygroup'
from_source false
alias_as_default true
action :create
end

Multiple user installs

nvm_install 'nvm for userone' do
version '0.10.5'
user 'userone'
group 'userone'
from_source false
alias_as_default true
action :create
end

nvm_install 'nvm for usertwo' do
version '0.10.5'
user 'usertwo'
group 'usertwo'
from_source false
alias_as_default true
action :create
end

Nonstandard user home user install

nvm_install '0.10.5' do
user 'usertwo'
group 'usertwo'
user_home '/opt/usertwo'
from_source false
alias_as_default true
action :create
end



### nvm_alias_default

Expand Down
Loading