rvm-capistrano 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 1.2.4 / 2012-07-17
2
+
3
+ * fix detecting Capistrano constant in Ruby 1.8.7, fix #28, closes #23
4
+
1
5
  ### 1.2.3 / 2012-07-07
2
6
 
3
7
  * Add LICENSE, merged #14
data/README.md CHANGED
@@ -8,7 +8,7 @@ RVM / Capistrano Integration Gem
8
8
 
9
9
  ## Installation
10
10
 
11
- RVM / Capistrano integration is now available as a separate gem
11
+ RVM / Capistrano integration is available as a separate gem
12
12
 
13
13
  $ gem install rvm-capistrano
14
14
 
@@ -34,6 +34,15 @@ Example:
34
34
 
35
35
  set :rvm_ruby_string, :local
36
36
 
37
+ ## Tasks
38
+
39
+ ```bash
40
+ $ cap -T rvm
41
+ cap rvm:create_gemset # Create gemset
42
+ cap rvm:install_ruby # Install RVM ruby to the server, create gemset ...
43
+ cap rvm:install_rvm # Install RVM of the given choice to the server.
44
+ ```
45
+
37
46
  ## Development
38
47
 
39
48
  $ rake spec
@@ -1,144 +1,146 @@
1
1
  # Recipes for using RVM on a server with capistrano.
2
2
 
3
- Capistrano::Configuration.instance(true).load do
3
+ module Capistrano
4
+ Configuration.instance(true).load do
4
5
 
5
- # Taken from the capistrano code.
6
- def _cset(name, *args, &block)
7
- unless exists?(name)
8
- set(name, *args, &block)
6
+ # Taken from the capistrano code.
7
+ def _cset(name, *args, &block)
8
+ unless exists?(name)
9
+ set(name, *args, &block)
10
+ end
9
11
  end
10
- end
11
-
12
- set :default_shell do
13
- shell = File.join(rvm_bin_path, "rvm-shell")
14
- ruby = rvm_ruby_string.to_s.strip
15
- case ruby
16
- when "release_path"
17
- shell = "rvm_path=#{rvm_path} #{shell} --path '#{release_path}'"
18
- when "local"
19
- ruby = (ENV['GEM_HOME'] || "").gsub(/.*\//, "")
20
- raise "Failed to get ruby version from GEM_HOME. Please make sure rvm is loaded!" if ruby.empty?
21
- shell = "rvm_path=#{rvm_path} #{shell} '#{ruby}'"
22
- else
23
- shell = "rvm_path=#{rvm_path} #{shell} '#{ruby}'" unless ruby.empty?
12
+
13
+ set :default_shell do
14
+ shell = File.join(rvm_bin_path, "rvm-shell")
15
+ ruby = rvm_ruby_string.to_s.strip
16
+ case ruby
17
+ when "release_path"
18
+ shell = "rvm_path=#{rvm_path} #{shell} --path '#{release_path}'"
19
+ when "local"
20
+ ruby = (ENV['GEM_HOME'] || "").gsub(/.*\//, "")
21
+ raise "Failed to get ruby version from GEM_HOME. Please make sure rvm is loaded!" if ruby.empty?
22
+ shell = "rvm_path=#{rvm_path} #{shell} '#{ruby}'"
23
+ else
24
+ shell = "rvm_path=#{rvm_path} #{shell} '#{ruby}'" unless ruby.empty?
25
+ end
26
+ shell
24
27
  end
25
- shell
26
- end
27
-
28
- # Let users set the type of their rvm install.
29
- _cset(:rvm_type, :user)
30
-
31
- # Define rvm_path
32
- # This is used in the default_shell command to pass the required variable to rvm-shell, allowing
33
- # rvm to boostrap using the proper path. This is being lost in Capistrano due to the lack of a
34
- # full environment.
35
- _cset(:rvm_path) do
36
- case rvm_type
37
- when :root, :system
38
- "/usr/local/rvm"
39
- when :local, :user, :default
40
- "$HOME/.rvm/"
41
- else
42
- rvm_type.to_s.empty? ? "$HOME/.rvm" : rvm_type.to_s
28
+
29
+ # Let users set the type of their rvm install.
30
+ _cset(:rvm_type, :user)
31
+
32
+ # Define rvm_path
33
+ # This is used in the default_shell command to pass the required variable to rvm-shell, allowing
34
+ # rvm to boostrap using the proper path. This is being lost in Capistrano due to the lack of a
35
+ # full environment.
36
+ _cset(:rvm_path) do
37
+ case rvm_type
38
+ when :root, :system
39
+ "/usr/local/rvm"
40
+ when :local, :user, :default
41
+ "$HOME/.rvm/"
42
+ else
43
+ rvm_type.to_s.empty? ? "$HOME/.rvm" : rvm_type.to_s
44
+ end
43
45
  end
44
- end
45
-
46
- # Let users override the rvm_bin_path
47
- _cset(:rvm_bin_path) do
48
- case rvm_type
49
- when :root, :system
50
- "/usr/local/rvm/bin"
51
- when :local, :user, :default
52
- "$HOME/.rvm/bin"
53
- else
54
- rvm_type.to_s.empty? ? "#{rvm_path}/bin" : rvm_type.to_s
46
+
47
+ # Let users override the rvm_bin_path
48
+ _cset(:rvm_bin_path) do
49
+ case rvm_type
50
+ when :root, :system
51
+ "/usr/local/rvm/bin"
52
+ when :local, :user, :default
53
+ "$HOME/.rvm/bin"
54
+ else
55
+ rvm_type.to_s.empty? ? "#{rvm_path}/bin" : rvm_type.to_s
56
+ end
55
57
  end
56
- end
57
58
 
58
- # Use the default ruby on the server, by default :)
59
- _cset(:rvm_ruby_string, "default")
59
+ # Use the default ruby on the server, by default :)
60
+ _cset(:rvm_ruby_string, "default")
60
61
 
61
- # Default sudo state
62
- _cset(:rvm_install_with_sudo, false)
62
+ # Default sudo state
63
+ _cset(:rvm_install_with_sudo, false)
63
64
 
64
- # Let users set the install type and shell of their choice.
65
- _cset(:rvm_install_type, :stable)
66
- _cset(:rvm_install_shell, :bash)
65
+ # Let users set the install type and shell of their choice.
66
+ _cset(:rvm_install_type, :stable)
67
+ _cset(:rvm_install_shell, :bash)
67
68
 
68
- # Let users set the (re)install for ruby.
69
- _cset(:rvm_install_ruby, :install)
70
- _cset(:rvm_install_ruby_threads, "$(cat /proc/cpuinfo | grep vendor_id | wc -l)")
69
+ # Let users set the (re)install for ruby.
70
+ _cset(:rvm_install_ruby, :install)
71
+ _cset(:rvm_install_ruby_threads, "$(cat /proc/cpuinfo | grep vendor_id | wc -l)")
71
72
 
72
- # Pass no special params to the ruby build by default
73
- _cset(:rvm_install_ruby_params, '')
73
+ # Pass no special params to the ruby build by default
74
+ _cset(:rvm_install_ruby_params, '')
74
75
 
75
- namespace :rvm do
76
- desc <<-EOF
77
- Install RVM of the given choice to the server.
78
- By default RVM "stable" is installed, change with:
76
+ namespace :rvm do
77
+ desc <<-EOF
78
+ Install RVM of the given choice to the server.
79
+ By default RVM "stable" is installed, change with:
79
80
 
80
- set :rvm_install_type, :head
81
+ set :rvm_install_type, :head
81
82
 
82
- By default BASH is used for installer, change with:
83
+ By default BASH is used for installer, change with:
83
84
 
84
- set :rvm_install_shell, :zsh
85
- EOF
86
- task :install_rvm do
87
- command_fetch="curl -L get.rvm.io | "
88
- case rvm_type
89
- when :root, :system
90
- if use_sudo == false && rvm_install_with_sudo == false
91
- raise ":use_sudo is set to 'false' but sudo is needed to install rvm_type: #{rvm_type}. You can enable use_sudo within rvm for use only by this install operation by adding to deploy.rb: set :rvm_install_with_sudo, true"
85
+ set :rvm_install_shell, :zsh
86
+ EOF
87
+ task :install_rvm do
88
+ command_fetch="curl -L get.rvm.io | "
89
+ case rvm_type
90
+ when :root, :system
91
+ if use_sudo == false && rvm_install_with_sudo == false
92
+ raise ":use_sudo is set to 'false' but sudo is needed to install rvm_type: #{rvm_type}. You can enable use_sudo within rvm for use only by this install operation by adding to deploy.rb: set :rvm_install_with_sudo, true"
93
+ else
94
+ command_install = "#{sudo} "
95
+ end
92
96
  else
93
- command_install = "#{sudo} "
97
+ command_install = ''
94
98
  end
95
- else
96
- command_install = ''
99
+ command_install << "#{rvm_install_shell} -s #{rvm_install_type} --path #{rvm_path}"
100
+ run "#{command_fetch} #{command_install}", :shell => "#{rvm_install_shell}"
97
101
  end
98
- command_install << "#{rvm_install_shell} -s #{rvm_install_type} --path #{rvm_path}"
99
- run "#{command_fetch} #{command_install}", :shell => "#{rvm_install_shell}"
100
- end
101
102
 
102
- desc <<-EOF
103
- Install RVM ruby to the server, create gemset if needed.
104
- By default ruby is installed, you can reinstall with:
103
+ desc <<-EOF
104
+ Install RVM ruby to the server, create gemset if needed.
105
+ By default ruby is installed, you can reinstall with:
105
106
 
106
- set :rvm_install_ruby, :reinstall
107
+ set :rvm_install_ruby, :reinstall
107
108
 
108
- By default ruby is compiled using all CPU cores, change with:
109
+ By default ruby is compiled using all CPU cores, change with:
109
110
 
110
- set :rvm_install_ruby_threads, :reinstall
111
+ set :rvm_install_ruby_threads, :reinstall
111
112
 
112
- By default BASH is used for installer, change with:
113
+ By default BASH is used for installer, change with:
113
114
 
114
- set :rvm_install_shell, :zsh
115
- EOF
116
- task :install_ruby do
117
- ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
118
- if %w( release_path default ).include? "#{ruby}"
119
- raise "ruby can not be installed when using :rvm_ruby_string => :#{ruby}"
120
- else
121
- run "#{File.join(rvm_bin_path, "rvm")} #{rvm_install_ruby} #{ruby} -j #{rvm_install_ruby_threads} #{rvm_install_ruby_params}", :shell => "#{rvm_install_shell}"
122
- if gemset
123
- run "#{File.join(rvm_bin_path, "rvm")} #{ruby} do rvm gemset create #{gemset}", :shell => "#{rvm_install_shell}"
115
+ set :rvm_install_shell, :zsh
116
+ EOF
117
+ task :install_ruby do
118
+ ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
119
+ if %w( release_path default ).include? "#{ruby}"
120
+ raise "ruby can not be installed when using :rvm_ruby_string => :#{ruby}"
121
+ else
122
+ run "#{File.join(rvm_bin_path, "rvm")} #{rvm_install_ruby} #{ruby} -j #{rvm_install_ruby_threads} #{rvm_install_ruby_params}", :shell => "#{rvm_install_shell}"
123
+ if gemset
124
+ run "#{File.join(rvm_bin_path, "rvm")} #{ruby} do rvm gemset create #{gemset}", :shell => "#{rvm_install_shell}"
125
+ end
124
126
  end
125
127
  end
126
- end
127
128
 
128
- desc "Create gemset"
129
- task :create_gemset do
130
- ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
131
- if %w( release_path default ).include? "#{ruby}"
132
- raise "gemset can not be created when using :rvm_ruby_string => :#{ruby}"
133
- else
134
- if gemset
135
- run "#{File.join(rvm_bin_path, "rvm")} #{ruby} do rvm gemset create #{gemset}", :shell => "#{rvm_install_shell}"
129
+ desc "Create gemset"
130
+ task :create_gemset do
131
+ ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
132
+ if %w( release_path default ).include? "#{ruby}"
133
+ raise "gemset can not be created when using :rvm_ruby_string => :#{ruby}"
134
+ else
135
+ if gemset
136
+ run "#{File.join(rvm_bin_path, "rvm")} #{ruby} do rvm gemset create #{gemset}", :shell => "#{rvm_install_shell}"
137
+ end
136
138
  end
137
139
  end
138
- end
139
140
 
140
- end
141
- end if Kernel.const_defined? 'Capistrano'
141
+ end
142
+ end if const_defined? :Configuration
143
+ end
142
144
 
143
145
  # E.g, to use ree and rails 3:
144
146
  #
@@ -1,5 +1,5 @@
1
1
  module RVM
2
2
  class Capistrano
3
- VERSION="1.2.3"
3
+ VERSION="1.2.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,73 +1,78 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rvm-capistrano
3
- version: !ruby/object:Gem::Version
4
- version: 1.2.3
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 2
9
+ - 4
10
+ version: 1.2.4
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Wayne E. Seguin
9
14
  - Michal Papis
10
15
  autorequire:
11
16
  bindir: bin
12
17
  cert_chain: []
13
- date: 2012-07-07 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
18
+
19
+ date: 2012-07-17 00:00:00 Z
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
16
22
  name: capistrano
17
- requirement: !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - ! '>='
21
- - !ruby/object:Gem::Version
22
- version: 2.0.0
23
- type: :runtime
24
23
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
26
25
  none: false
27
- requirements:
28
- - - ! '>='
29
- - !ruby/object:Gem::Version
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 15
30
+ segments:
31
+ - 2
32
+ - 0
33
+ - 0
30
34
  version: 2.0.0
31
- - !ruby/object:Gem::Dependency
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
32
38
  name: rake
33
- requirement: !ruby/object:Gem::Requirement
34
- none: false
35
- requirements:
36
- - - ! '>='
37
- - !ruby/object:Gem::Version
38
- version: '0'
39
- type: :development
40
39
  prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- - !ruby/object:Gem::Dependency
48
- name: minitest
49
- requirement: !ruby/object:Gem::Requirement
40
+ requirement: &id002 !ruby/object:Gem::Requirement
50
41
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
55
49
  type: :development
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: minitest
56
53
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
54
+ requirement: &id003 !ruby/object:Gem::Requirement
58
55
  none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 3
60
+ segments:
61
+ - 0
62
+ version: "0"
63
+ type: :development
64
+ version_requirements: *id003
63
65
  description: RVM / Capistrano Integration Gem
64
- email:
66
+ email:
65
67
  - wayneeseguin@gmail.com
66
68
  - mpapis@gmail.com
67
69
  executables: []
70
+
68
71
  extensions: []
72
+
69
73
  extra_rdoc_files: []
70
- files:
74
+
75
+ files:
71
76
  - History.md
72
77
  - Manifest.yml
73
78
  - README.md
@@ -77,29 +82,37 @@ files:
77
82
  - lib/rvm/capistrano/version.rb
78
83
  - spec/spec_helper.rb
79
84
  homepage: https://rvm.beginrescueend.com/integration/capistrano
80
- licenses:
85
+ licenses:
81
86
  - MIT
82
87
  post_install_message:
83
88
  rdoc_options: []
84
- require_paths:
89
+
90
+ require_paths:
85
91
  - lib
86
- required_ruby_version: !ruby/object:Gem::Requirement
92
+ required_ruby_version: !ruby/object:Gem::Requirement
87
93
  none: false
88
- requirements:
89
- - - ! '>='
90
- - !ruby/object:Gem::Version
91
- version: '0'
92
- required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 3
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
102
  none: false
94
- requirements:
95
- - - ! '>='
96
- - !ruby/object:Gem::Version
97
- version: '0'
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ hash: 3
107
+ segments:
108
+ - 0
109
+ version: "0"
98
110
  requirements: []
111
+
99
112
  rubyforge_project:
100
113
  rubygems_version: 1.8.24
101
114
  signing_key:
102
115
  specification_version: 3
103
116
  summary: RVM / Capistrano Integration Gem
104
- test_files:
117
+ test_files:
105
118
  - spec/spec_helper.rb