capistrano-nodenv 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b5ea87d56b1b281249803bb05273a80d4bf9b411
4
+ data.tar.gz: 28c7ff7eabadb3b96db39fb39bfc80335a1026ac
5
+ SHA512:
6
+ metadata.gz: 28a97706c96d2fc97b6203fdfbca046dd5c977c5f13ccba696703cf7511ce21742cbf427e43fb054942490214b71f820947f9009bbcfadcef837f5f2c8014df5
7
+ data.tar.gz: b664d777037a520b29e7f382338a2814d2d1d1321190f898c7efa3643c6927eb241fab9610ca2653a93417e67579cebee23d0f9a86edd7e16451890b72a18873
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-rbenv.gemspec
4
+ gemspec
@@ -0,0 +1,32 @@
1
+ # Capistrano::nodenv
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ gem 'capistrano', github: 'capistrano/capistrano', branch: 'v3'
8
+ gem 'capistrano-nodenv', github: "platanus/nodenv"
9
+
10
+ And then execute:
11
+
12
+ $ bundle --binstubs
13
+ $ cap install
14
+
15
+ ## Usage
16
+
17
+ # Capfile
18
+
19
+ require 'capistrano/nodenv'
20
+
21
+ set :nodenv_type, :user # or :system, depends on your nodenv setup
22
+ set :nodenv_node, '0.10.3'
23
+
24
+ If your nodenv is located in some custom path, you can use `nodenv_custom_path` to set it.
25
+
26
+ ## Contributing
27
+
28
+ 1. Fork it
29
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
30
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
31
+ 4. Push to the branch (`git push origin my-new-feature`)
32
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,20 @@
1
+ # -*- encoding: 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 |gem|
6
+ gem.name = "capistrano-nodenv"
7
+ gem.version = '0.0.1'
8
+ gem.authors = ["Juan Ignacio Donoso"]
9
+ gem.email = ["jidonoso@gmail.com"]
10
+ gem.description = %q{nodenv integration for Capistrano}
11
+ gem.summary = %q{nodenv integration for Capistrano}
12
+ gem.homepage = "https://github.com/capistrano/nodenv"
13
+
14
+ gem.files = `git ls-files`.split($/)
15
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.require_paths = ["lib"]
17
+
18
+ gem.add_dependency 'capistrano'
19
+
20
+ end
File without changes
@@ -0,0 +1 @@
1
+ load File.expand_path("../tasks/nodenv.rake", __FILE__)
@@ -0,0 +1,48 @@
1
+ SSHKit.config.command_map = Hash.new do |hash, key|
2
+ if fetch(:nodenv_map_bins).include?(key.to_s)
3
+ prefix = "NODENV_ROOT=#{fetch(:nodenv_path)} NODENV_VERSION=#{fetch(:nodenv_node)} #{fetch(:nodenv_path)}/bin/nodenv exec"
4
+ hash[key] = "#{prefix} #{key}"
5
+ else
6
+ hash[key] = key
7
+ end
8
+ end
9
+
10
+ namespace :deploy do
11
+ before :starting, :hook_nodenv_bins do
12
+ invoke :'nodenv:check'
13
+ end
14
+ end
15
+
16
+ namespace :nodenv do
17
+ task :check do
18
+ on roles(:all) do
19
+ nodenv_node = fetch(:nodenv_node)
20
+ if nodenv_node.nil?
21
+ error "nodenv: nodenv_node is not set"
22
+ exit 1
23
+ end
24
+
25
+ if test "[ ! -d #{fetch(:nodenv_node_dir)} ]"
26
+ error "nodenv: #{nodenv_node} is not installed or not found in #{fetch(:nodenv_node_dir)}"
27
+ exit 1
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+ namespace :load do
34
+ task :defaults do
35
+
36
+ set :nodenv_path, -> {
37
+ nodenv_path = fetch(:nodenv_custom_path)
38
+ nodenv_path ||= if fetch(:nodenv_type, :user) == :system
39
+ "/usr/local/nodenv"
40
+ else
41
+ "~/.nodenv"
42
+ end
43
+ }
44
+
45
+ set :nodenv_node_dir, -> { "#{fetch(:nodenv_path)}/versions/#{fetch(:nodenv_node)}" }
46
+ set :nodenv_map_bins, %w{node npm}
47
+ end
48
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-nodenv
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Juan Ignacio Donoso
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: nodenv integration for Capistrano
28
+ email:
29
+ - jidonoso@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - Gemfile
35
+ - README.md
36
+ - Rakefile
37
+ - capistrano-nodenv.gemspec
38
+ - lib/capistrano-nodenv.rb
39
+ - lib/capistrano/nodenv.rb
40
+ - lib/capistrano/tasks/nodenv.rake
41
+ homepage: https://github.com/capistrano/nodenv
42
+ licenses: []
43
+ metadata: {}
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 2.0.2
61
+ signing_key:
62
+ specification_version: 4
63
+ summary: nodenv integration for Capistrano
64
+ test_files: []