capistrano-nodeenv 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,9 +12,9 @@ module Capistrano
12
12
  _cset(:nodeenv_version, nil)
13
13
  _cset(:nodeenv_jobs, 4)
14
14
  _cset(:nodeenv_verbose, true)
15
- _cset(:nodeenv_verbose, true)
15
+ _cset(:nodeenv_with_npm, true)
16
16
 
17
- _cset(:nodeenv_script_url, 'https://raw.github.com/ekalinin/nodeenv/master/nodeenv.py')
17
+ _cset(:nodeenv_script_url, 'https://raw.github.com/ekalinin/nodeenv/e85a806e21d9bb5e417f1c17080964c485332b27/nodeenv.py')
18
18
  _cset(:nodeenv_script_file) {
19
19
  File.join(shared_path, 'nodeenv', File.basename(URI.parse(nodeenv_script_url).path))
20
20
  }
@@ -38,7 +38,7 @@ module Capistrano
38
38
  os << "--jobs=#{nodeenv_jobs} "
39
39
  os << "--verbose " if nodeenv_verbose
40
40
  os << "--node=#{nodeenv_version} " if nodeenv_version
41
- os << "--with-npm" if with_npm
41
+ #os << "--with-npm" if nodeenv_with_npm
42
42
  #os << "--requirement=#{nodeenv_requirements_file}" if nodeenv_requirements_file
43
43
  os
44
44
  }
@@ -161,14 +161,19 @@ module Capistrano
161
161
  unless nodeenv_requirements.empty?
162
162
  top.safe_put(nodeenv_requirements.join("\n"), nodeenv_requirements_file, :place => :if_modified)
163
163
  end
164
- run("touch #{nodeenv_requirements_file} && #{nodeenv_shared_npm_cmd} install #{nodeenv_npm_install_options.join(' ')} #{nodeenv_requirements_file}")
164
+ cmds = ["touch #{nodeenv_requirements_file}"]
165
+ cmds << ". #{nodeenv_shared_path}/bin/activate"
166
+ cmds << "cat #{nodeenv_requirements_file}/package.json | python -c 'import json,sys;obj=json.load(sys.stdin);print \"\\r\\n\".join([k+\"@\"+v for k, v in obj.get(\"dependencies\", {}).items()])' | awk '{ print \"npm install -g #{nodeenv_npm_install_options.join(' ')} \"$0}' | bash"
167
+ cmds << "deactivate_node"
168
+ #run( && && #{nodeenv_shared_npm_cmd} install -g #{nodeenv_npm_install_options.join(' ')} #{nodeenv_requirements_file}")
169
+ invoke_command(cmds.join(' && '))
165
170
 
166
171
  puts("Updated requirements")
167
172
  execute = nodeenv_build_requirements.map { |package, options|
168
173
  build_options = ( options || [] )
169
- "#{nodeenv_shared_npm_cmd} install #{nodeenv_npm_install_options.join(' ')} #{build_options.join(' ')} #{package.dump}"
174
+ ". #{nodeenv_shared_path}/bin/activate && #{nodeenv_shared_npm_cmd} install -g #{nodeenv_npm_install_options.join(' ')} #{build_options.join(' ')} #{package.dump} && deactivate_node"
170
175
  }
171
- run(execute.join(' && ')) unless execute.empty?
176
+ invoke_command(execute.join(' && ')) unless execute.empty?
172
177
  }
173
178
 
174
179
  task(:create_release, :except => { :no_release => true }) {
@@ -179,7 +184,7 @@ module Capistrano
179
184
  # Copy nodeenv from shared to release directory
180
185
  cmds << "cp -rf #{nodeenv_shared_path} #{nodeenv_release_path}"
181
186
  cmds << "sed -i -e 's|#{nodeenv_shared_path}|#{nodeenv_release_path}|g' #{nodeenv_release_path}/bin/activate"
182
- run(cmds.join(' && '))
187
+ invoke_command(cmds.join(' && '))
183
188
  }
184
189
  }
185
190
  }
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Nodeenv
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-nodeenv
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alexandr Lispython
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-03-26 00:00:00 Z
18
+ date: 2013-03-29 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: capistrano