capistrano-rbenv 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -32,7 +32,6 @@ Following options are available to manage your rbenv.
32
32
  * `:rbenv_bundler_version` - version for `bundler` package.
33
33
  * `:rbenv_cmd` - the `rbenv` command.
34
34
  * `:rbenv_path` - the path where `rbenv` will be installed. use `$HOME/.rbenv` by default.
35
- * `:rbenv_plugins_options` - install options for rbenv plugins.
36
35
  * `:rbenv_plugins` - rbenv plugins to install. install `ruby-build` by default.
37
36
  * `:rbenv_repository` - repository URL of rbenv.
38
37
  * `:rbenv_ruby_dependencies` - dependency packages.
@@ -19,12 +19,10 @@ module Capistrano
19
19
  _cset(:rbenv_repository, 'git://github.com/sstephenson/rbenv.git')
20
20
  _cset(:rbenv_branch, 'master')
21
21
 
22
- _cset(:rbenv_plugins, {
23
- 'ruby-build' => 'git://github.com/sstephenson/ruby-build.git',
24
- })
25
- _cset(:rbenv_plugins_options, {
26
- 'ruby-build' => {:branch => 'master'},
27
- })
22
+ _cset(:rbenv_plugins) {{
23
+ "ruby-build" => { :repository => "git://github.com/sstephenson/ruby-build.git", :branch => "master" },
24
+ }}
25
+ _cset(:rbenv_plugins_options, {}) # for backward compatibility. plugin options can be configured from :rbenv_plugins.
28
26
  _cset(:rbenv_plugins_path) {
29
27
  File.join(rbenv_path, 'plugins')
30
28
  }
@@ -47,16 +45,16 @@ module Capistrano
47
45
 
48
46
  def rbenv_update_repository(destination, options={})
49
47
  configuration = Capistrano::Configuration.new()
48
+ options = {
49
+ :source => proc { Capistrano::Deploy::SCM.new(configuration[:scm], configuration) },
50
+ :revision => proc { configuration[:source].head },
51
+ :real_revision => proc {
52
+ configuration[:source].local.query_revision(configuration[:revision]) { |cmd| with_env("LC_ALL", "C") { run_locally(cmd) } }
53
+ },
54
+ }.merge(options)
50
55
  variables.merge(options).each do |key, val|
51
56
  configuration.set(key, val)
52
57
  end
53
- configuration.set(:source) { Capistrano::Deploy::SCM.new(configuration[:scm], configuration) }
54
- configuration.set(:revision) { configuration[:source].head }
55
- configuration.set(:real_revision) {
56
- configuration[:source].local.query_revision(configuration[:revision]) { |cmd|
57
- with_env("LC_ALL", "C") { run_locally(cmd) }
58
- }
59
- }
60
58
  source = configuration[:source]
61
59
  revision = configuration[:real_revision]
62
60
  #
@@ -90,11 +88,12 @@ module Capistrano
90
88
  namespace(:plugins) {
91
89
  desc("Update rbenv plugins.")
92
90
  task(:update, :except => { :no_release => true }) {
93
- rbenv_plugins.each { |name, repository|
94
- options = ( rbenv_plugins_options[name] || {})
95
- branch = ( options[:branch] || 'master' )
96
- rbenv_update_repository(File.join(rbenv_plugins_path, name), :scm => :git, :repository => repository, :branch => branch)
97
- }
91
+ rbenv_plugins.each do |name, repository|
92
+ # for backward compatibility, obtain plugin options from :rbenv_plugins_options first
93
+ options = rbenv_plugins_options.fetch(name, {})
94
+ options = options.merge(Hash === repository ? repository : {:repository => repository})
95
+ rbenv_update_repository(File.join(rbenv_plugins_path, name), options.merge(:scm => :git))
96
+ end
98
97
  }
99
98
  }
100
99
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module RbEnv
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-rbenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-04 00:00:00.000000000 Z
12
+ date: 2012-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano