capistrano-rails-console 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +8 -7
- data/lib/capistrano/rails/console/tasks/remote.cap +10 -11
- data/lib/capistrano/rails/console/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8e03e9c997a1447dd97fdc4ec188de36432abee
|
4
|
+
data.tar.gz: 310d77fb78f42ad3885062c95d908b32e457ead5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6036ec91e01217908e465edccdc037b810d667f9b1f8045d56cd5dd7ada681844d7446e16ebb3fd1d20c4e312d7784ac8e3bb974f10f34d94ff643c934298de
|
7
|
+
data.tar.gz: 94ee4ef297c6e703eef9e136d65dd9436fd42d03a91d7387187548f92f3c5f1977beb5150e7041ba9e78c28427061359dde620cb6458c5c1fb87d95253e19350
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
[![Gem Version](https://img.shields.io/gem/v/capistrano-rails-console.svg)](https://rubygems.org/gems/capistrano-rails-console)
|
2
|
+
[![Dependencies](https://img.shields.io/gemnasium/ydkn/capistrano-rails-console.svg)](https://gemnasium.com/ydkn/capistrano-rails-console)
|
3
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/ydkn/capistrano-rails-console.svg)](https://codeclimate.com/github/ydkn/capistrano-rails-console)
|
4
|
+
|
1
5
|
# Capistrano::Rails::Console
|
2
6
|
|
3
7
|
Remote rails console for capistrano
|
@@ -30,6 +34,10 @@ This will add a task `rails:console`:
|
|
30
34
|
|
31
35
|
$ cap production rails:console
|
32
36
|
|
37
|
+
You can also start a sandbox session:
|
38
|
+
|
39
|
+
$ cap production rails:console sandbox=1
|
40
|
+
|
33
41
|
## Contributing
|
34
42
|
|
35
43
|
1. Fork it
|
@@ -37,10 +45,3 @@ This will add a task `rails:console`:
|
|
37
45
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
46
|
4. Push to the branch (`git push origin my-new-feature`)
|
39
47
|
5. Create new Pull Request
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
[![Gem Version](https://img.shields.io/gem/v/capistrano-rails-console.svg)](https://rubygems.org/gems/capistrano-rails-console)
|
45
|
-
[![Dependencies](https://img.shields.io/gemnasium/ydkn/capistrano-rails-console.svg)](https://gemnasium.com/ydkn/capistrano-rails-console)
|
46
|
-
[![Code Climate](https://img.shields.io/codeclimate/github/ydkn/capistrano-rails-console.svg)](https://codeclimate.com/github/ydkn/capistrano-rails-console)
|
@@ -1,34 +1,33 @@
|
|
1
1
|
namespace :load do
|
2
2
|
task :defaults do
|
3
3
|
# add rails to rvm_map_bins
|
4
|
-
rvm_map_bins
|
5
|
-
rvm_map_bins << :rails
|
6
|
-
set(:rvm_map_bins, rvm_map_bins)
|
4
|
+
set :rvm_map_bins, fetch(:rvm_map_bins, []).push(:rails)
|
7
5
|
end
|
8
6
|
end
|
9
7
|
|
10
8
|
namespace :rails do
|
11
|
-
|
12
9
|
desc "Interact with a remote rails console"
|
13
10
|
task console: ['deploy:set_rails_env'] do
|
14
11
|
on primary :app do |host|
|
15
|
-
|
12
|
+
test(:true) # initialize ssh_options on host
|
13
|
+
|
14
|
+
ssh_cmd_options = []
|
15
|
+
rails_console_args = []
|
16
16
|
|
17
17
|
if host.ssh_options && host.ssh_options[:proxy]
|
18
18
|
template = host.ssh_options[:proxy].command_line_template
|
19
19
|
ssh_cmd_options << "-o ProxyCommand=\"#{template}\""
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
user_host = [host.user, host.hostname].compact.join('@')
|
24
|
-
ssh_cmd = "ssh #{ssh_cmd_options_str} #{user_host} -p #{host.port || 22}"
|
22
|
+
rails_console_args << '--sandbox' if ENV.key?('sandbox') || ENV.key?('s')
|
25
23
|
|
26
|
-
|
27
|
-
cmd = SSHKit::Command.new(:rails, "console #{fetch(:rails_env)} #{sandbox_arg}", host: host)
|
24
|
+
cmd = SSHKit::Command.new(:rails, "console #{fetch(:rails_env)} #{rails_console_args.join(' ')}", host: host)
|
28
25
|
SSHKit.config.output << cmd
|
29
26
|
|
27
|
+
user_host = [host.user, host.hostname].compact.join('@')
|
28
|
+
ssh_cmd = "ssh #{ssh_cmd_options.join(' ')} #{user_host} -p #{host.port || 22}"
|
29
|
+
|
30
30
|
exec(%Q(#{ssh_cmd} -t "cd #{current_path} && (#{cmd.environment_string} #{cmd})"))
|
31
31
|
end
|
32
32
|
end
|
33
|
-
|
34
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-rails-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Schwab
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -80,6 +80,7 @@ extensions: []
|
|
80
80
|
extra_rdoc_files: []
|
81
81
|
files:
|
82
82
|
- ".gitignore"
|
83
|
+
- CHANGELOG.md
|
83
84
|
- Gemfile
|
84
85
|
- LICENSE.txt
|
85
86
|
- README.md
|