capistrano-nvm 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-nvm.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Capistrano::nvm
2
+
3
+ This gem provides idiomatic [nvm](https://github.com/creationix/nvm) support for Capistrano 3.x (and 3.x
4
+ *only*).
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'capistrano', '~> 3.0'
11
+ gem 'capistrano-nvm', github: "koenpunt/capistrano-nvm"
12
+
13
+ And then execute:
14
+
15
+ $ bundle --binstubs
16
+ $ cap install
17
+
18
+ ## Usage
19
+
20
+ # Capfile
21
+
22
+ require 'capistrano/nvm'
23
+
24
+ set :nvm_type, :user # or :system, depends on your nvm setup
25
+ set :nvm_node, 'v0.10.21'
26
+
27
+ If your nvm is located in some custom path, you can use `nvm_custom_path` to set it.
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork it
32
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
33
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
34
+ 4. Push to the branch (`git push origin my-new-feature`)
35
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'capistrano-nvm'
7
+ spec.version = '0.0.1'
8
+ spec.authors = ['Koen Punt']
9
+ spec.email = ['me@koen.pt']
10
+ spec.description = %q{nvm support for Capistrano 3.x}
11
+ spec.summary = %q{nvm support for Capistrano 3.x}
12
+ spec.homepage = 'https://github.com/koenpunt/capistrano-nvm'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'capistrano', '>= 3.0.0.pre'
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.3'
23
+ spec.add_development_dependency 'rake'
24
+ end
File without changes
@@ -0,0 +1 @@
1
+ load File.expand_path("../tasks/nvm.cap", __FILE__)
@@ -0,0 +1,44 @@
1
+ namespace :deploy do
2
+ before :starting, :'nvm:check'
3
+ end
4
+
5
+ namespace :nvm do
6
+ task :check do
7
+ on roles(:all) do
8
+ nvm_node = fetch(:nvm_node)
9
+ if nvm_node.nil?
10
+ error "nvm: nvm_node is not set"
11
+ exit 1
12
+ end
13
+
14
+ unless test "[ -d #{fetch(:nvm_node_dir)} ]"
15
+ error "nvm: #{nvm_node} is not installed or not found in #{fetch(:nvm_node_dir)}"
16
+ exit 1
17
+ end
18
+
19
+ default_env = fetch(:default_env)
20
+ default_env[:path] = if default_env[:path].nil?
21
+ "#{fetch(:nvm_bin_path)}:$PATH"
22
+ else
23
+ "#{fetch(:nvm_bin_path)}:#{default_env[:path]}"
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ namespace :load do
30
+ task :defaults do
31
+
32
+ set :nvm_dir, -> {
33
+ nvm_dir = fetch(:nvm_custom_dir)
34
+ nvm_dir ||= if fetch(:nvm_type, :user) == :system
35
+ "/usr/local/nvm"
36
+ else
37
+ "~/.nvm"
38
+ end
39
+ }
40
+
41
+ set :nvm_node_dir, -> { "#{fetch(:nvm_dir)}/#{fetch(:nvm_node)}" }
42
+ set :nvm_bin_path, -> { "#{fetch(:nvm_node_dir)}/bin" }
43
+ end
44
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-nvm
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Koen Punt
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-11-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.0.pre
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.0.0.pre
30
+ - !ruby/object:Gem::Dependency
31
+ name: bundler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.3'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.3'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: nvm support for Capistrano 3.x
63
+ email:
64
+ - me@koen.pt
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - Gemfile
70
+ - README.md
71
+ - Rakefile
72
+ - capistrano-nvm.gemspec
73
+ - lib/capistrano-nvm.rb
74
+ - lib/capistrano/nvm.rb
75
+ - lib/capistrano/tasks/nvm.cap
76
+ homepage: https://github.com/koenpunt/capistrano-nvm
77
+ licenses:
78
+ - MIT
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ segments:
90
+ - 0
91
+ hash: 2827476677612085551
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ segments:
99
+ - 0
100
+ hash: 2827476677612085551
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 1.8.23
104
+ signing_key:
105
+ specification_version: 3
106
+ summary: nvm support for Capistrano 3.x
107
+ test_files: []