capistrano-rails-console 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9160f5605b1a062e73f71dbcf4c26b456051c61b
4
- data.tar.gz: 586339286e41d0b55c67bf75d97f33ab70996d3f
3
+ metadata.gz: 12ac4916b3376899cefd7d6fdb4ba4d6e5c72058
4
+ data.tar.gz: 5fa379cd8467643b4e9920f3ff78bdfb27d6d2ad
5
5
  SHA512:
6
- metadata.gz: b5f7c22eedff6e3dbdf1443a129faa6a829a0b294c81d7bd8e8c5ebba0db32a9803bfe0effdf5b3f50122857b039da3a042e829f73e4b9c23fc3319c762b8667
7
- data.tar.gz: 4d0252c719a5c3e388adcee3c53e2904a93e958f2d205750e9bc3f583c1a488c4a3d0036248c7e478ee4aa1e6dc1bb0c3688c987742f90a6381e57bcd415a079
6
+ metadata.gz: e4b191d98a4bf4ed5e31bab04a5318f44e184d6278340a2ff0b4556d5886059915a6d3c4c4970ca538d4cd2ac60a5542f89f81cc8db3de084dcc88e556bc9ddb
7
+ data.tar.gz: 50e3db81860d2c18c81a0b818c098361fa24fc061fd4fb1d51f0b17a8296c54f03cb469ab99f81322f8f39b46e17703d62578736c0b43fd942042d1a5436389b
@@ -1,34 +1,25 @@
1
- def rvm_loaded?
2
- Gem::Specification::find_all_by_name('capistrano-rvm').any?
3
- end
4
-
5
- def rbenv_loaded?
6
- Gem::Specification::find_all_by_name('capistrano-rbenv').any?
7
- end
8
-
9
- def bundler_loaded?
10
- Gem::Specification::find_all_by_name('capistrano-bundler').any?
1
+ namespace :load do
2
+ task :defaults do
3
+ # add rails to rvm_map_bins
4
+ rvm_map_bins = fetch(:rvm_map_bins) || []
5
+ rvm_map_bins << :rails
6
+ set :rvm_map_bins, rvm_map_bins
7
+ end
11
8
  end
12
9
 
13
10
  namespace :rails do
14
11
 
15
- desc 'Access a remote rails console'
12
+ desc "Interact with a remote rails console"
16
13
  task console: ['deploy:set_rails_env'] do
17
- app_server = roles(:app).first
18
-
19
- # RVM support
20
- if rvm_loaded?
21
- Rake::Task['rvm:hook'].invoke
22
- set :rvm_map_bins, ((fetch(:rvm_map_bins) || []) + ['rails'])
23
- end
14
+ on primary :app do |host|
15
+ user_host = [host.user, host.hostname].compact.join('@')
16
+ ssh_cmd = "ssh #{user_host} -p #{host.port || 22}"
24
17
 
25
- command = []
26
- command << "#{fetch(:rvm_path)}/bin/rvm #{fetch(:rvm_ruby_version)} do" if rvm_loaded?
27
- command << "#{ fetch :rbenv_prefix } " if rbenv_loaded?
28
- command << "bundle exec" if bundler_loaded?
29
- command << "rails console #{fetch(:rails_env)}"
18
+ cmd = SSHKit::Command.new(:rails, "console #{fetch :rails_env}", host: host)
19
+ SSHKit.config.output << cmd
30
20
 
31
- exec %Q(ssh #{app_server.netssh_options[:user]}@#{app_server.hostname} -p #{app_server.port || 22} -t "cd #{current_path} && #{command.join(' ')}")
21
+ exec %Q(#{ssh_cmd} -t "cd #{current_path} && (#{cmd.environment_string} #{cmd})")
22
+ end
32
23
  end
33
24
 
34
25
  end
@@ -5,7 +5,7 @@ module Capistrano
5
5
  # Console
6
6
  module Console
7
7
  # gem version
8
- VERSION = '0.2.0'
8
+ VERSION = '0.3.0'
9
9
  end
10
10
  end
11
11
  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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Schwab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-15 00:00:00.000000000 Z
11
+ date: 2014-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.2.2
107
+ rubygems_version: 2.4.3
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Remote rails console for capistrano