rvm-capistrano 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Manifest.yml CHANGED
@@ -4,6 +4,7 @@
4
4
  - Rakefile
5
5
  - LICENSE
6
6
  - lib/rvm/capistrano.rb
7
+ - lib/rvm/capistrano/alias_and_wrapp.rb
7
8
  - lib/rvm/capistrano/base.rb
8
9
  - lib/rvm/capistrano/create_gemset.rb
9
10
  - lib/rvm/capistrano/empty_gemset.rb
data/README.md CHANGED
@@ -40,6 +40,7 @@ modules which allow selecting which parts of it should be included.
40
40
  - `install_pkgs` - adds task `rvm:install_pkgs` - **deprecated** (you should try `autolibs` first)
41
41
  - `gem_install_uninstall` - adds tasks `rvm:install_gem` / `rvm:uninstall_gem`
42
42
  - `gemset_import_export` - adds tasks `rvm:import_gemset` / `rvm:export_gemset`
43
+ - `alias_and_wrapp` - adds tasks `rvm:create_alias` / `rvm:create_wrappers` / `rvm:show_alias_path`
43
44
 
44
45
  By default `rvm/capistrano` loads: `selector`, `install_rvm`, `install_ruby`, `create_gemset`.
45
46
 
@@ -87,6 +88,37 @@ before 'deploy', 'rvm:install_rvm' # update RVM
87
88
  before 'deploy', 'rvm:install_ruby' # install Ruby and create gemset (both if missing)
88
89
  ```
89
90
 
91
+ ### Create application alias and wrappers
92
+
93
+ For server scripts and configuration the easiest is to use wrappers from aliased path.
94
+
95
+ ```ruby
96
+ require "rvm/capistrano/alias_and_wrapp"
97
+ before 'deploy', 'rvm:create_alias'
98
+ before 'deploy', 'rvm:create_wrappers'
99
+ ```
100
+ To see the path to be used in scripts use:
101
+ ```bash
102
+ cap rvm:show_alias_path
103
+ ```
104
+ It will show either that the path does not exist yet:
105
+ ```ruby
106
+ *** [err :: niczsoft.com] ls: cannot access /home/ad/.rvm//wrappers/ad/*: No such file or directory
107
+ ```
108
+ or in case it exist it will list all available wrappers:
109
+ ```
110
+ ...
111
+ ** [out :: niczsoft.com] /home/ad/.rvm//wrappers/ad/ruby
112
+ ...
113
+ ```
114
+ This will to use clean scripts where proper rvm settings are automatically loaded
115
+ from the aliased wrappers. For example configuring
116
+ [PassengerRuby](http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerRuby)
117
+ with `/home/ad/.rvm//wrappers/ad/ruby`, this way there is no need for changing scripts
118
+ when the application ruby changes. In the seem spirit you can use wrapper for `bundle`
119
+ in **cron** or **init.d** scripts with `/home/ad/.rvm//wrappers/ad/bundle exec [command]` -
120
+ it will automatically load proper configuration for the application, no need for any tricks.
121
+
90
122
  ### To use the ruby version currently active locally
91
123
 
92
124
  ```ruby
@@ -184,6 +216,9 @@ cap rvm:install_pkgs # Install RVM packages to the server.
184
216
  cap rvm:install_gem GEM=my_gem # Install gem {my_gem} on the server using selected ruby.
185
217
  # Use `ENV['GEM'] = "bundler"` in script to specify gems.
186
218
  cap rvm:uninstall_gem GEM=my_gem # Uninstall gem {my_gem} from the server selected ruby.
219
+ cap rvm:create_alias # create #{application} alias
220
+ cap rvm:create_wrappers # create wrappers for gem executables
221
+ cap rvm:show_alias_path # show path to aliased path with wrappers
187
222
  ```
188
223
 
189
224
  ## Development
@@ -0,0 +1,23 @@
1
+ require 'rvm/capistrano/base'
2
+ require 'rvm/capistrano/helpers/with_rvm_group'
3
+
4
+ rvm_with_capistrano do
5
+ namespace :rvm do
6
+
7
+ desc "Create application alias"
8
+ rvm_task :create_alias do
9
+ run_rvm("alias create #{application} #{rvm_ruby_string_evaluated}", :with_rvm_group => true)
10
+ end
11
+
12
+ desc "Show application alias path to wrappers"
13
+ rvm_task :show_alias_path do
14
+ run("ls #{rvm_path}/wrappers/#{application}/*")
15
+ end
16
+
17
+ desc "Create application wrappers"
18
+ rvm_task :create_wrappers do
19
+ run_rvm("wrapper #{rvm_ruby_string_evaluated} --no-prefix --all", :with_rvm_group => true)
20
+ end
21
+
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
1
  module RVM
2
2
  class Capistrano
3
- VERSION="1.4.0"
3
+ VERSION="1.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvm-capistrano
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 0
10
- version: 1.4.0
9
+ - 1
10
+ version: 1.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Wayne E. Seguin
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-07-09 00:00:00 Z
19
+ date: 2013-07-12 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: capistrano
@@ -79,6 +79,7 @@ files:
79
79
  - Rakefile
80
80
  - LICENSE
81
81
  - lib/rvm/capistrano.rb
82
+ - lib/rvm/capistrano/alias_and_wrapp.rb
82
83
  - lib/rvm/capistrano/base.rb
83
84
  - lib/rvm/capistrano/create_gemset.rb
84
85
  - lib/rvm/capistrano/empty_gemset.rb