capistrano_rails_console 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
|
|
1
|
+
module CapistranoRailsConsole
|
2
|
+
module Rails
|
3
|
+
def self.version
|
4
|
+
begin
|
5
|
+
require "rails/version"
|
6
|
+
::Rails::VERSION::MAJOR
|
7
|
+
rescue
|
8
|
+
raise "can not detect rails version"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.console_command
|
13
|
+
if version == 2
|
14
|
+
"./script/console %s"
|
15
|
+
else
|
16
|
+
"rails console %s"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "capistrano/configuration"
|
2
|
+
require "capistrano_rails_console/rails"
|
2
3
|
|
3
4
|
Capistrano::Configuration.instance(:must_exist).load do
|
4
5
|
namespace :rails do
|
@@ -6,12 +7,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
6
7
|
task :console, :roles => :app do
|
7
8
|
hostname = find_servers_for_task(current_task).first
|
8
9
|
|
9
|
-
console_command =
|
10
|
-
when 2
|
11
|
-
"./script/console #{rails_env}"
|
12
|
-
else
|
13
|
-
"rails console #{rails_env}"
|
14
|
-
end
|
10
|
+
console_command = CapistranoRailsConsole::Rails.console_command % rails_env
|
15
11
|
exec "ssh -l #{user} #{hostname} -p #{port} -t 'cd #{current_path} && #{console_command}'"
|
16
12
|
end
|
17
13
|
end
|
metadata
CHANGED
@@ -1,48 +1,48 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano_rails_console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
4
5
|
prerelease:
|
5
|
-
version: 0.3.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Timo Schilling
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
15
|
+
name: capistrano
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '2'
|
20
|
-
|
22
|
+
type: :runtime
|
21
23
|
prerelease: false
|
22
|
-
|
23
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ~>
|
26
28
|
- !ruby/object:Gem::Version
|
27
29
|
version: '2'
|
28
|
-
none: false
|
29
|
-
type: :runtime
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
32
34
|
requirements:
|
33
35
|
- - ! '>='
|
34
36
|
- !ruby/object:Gem::Version
|
35
37
|
version: '0'
|
36
|
-
|
38
|
+
type: :development
|
37
39
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
40
42
|
requirements:
|
41
43
|
- - ! '>='
|
42
44
|
- !ruby/object:Gem::Version
|
43
45
|
version: '0'
|
44
|
-
none: false
|
45
|
-
type: :development
|
46
46
|
description: Open a rails console the first app server.
|
47
47
|
email:
|
48
48
|
- timo@schilling.io
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- Rakefile
|
58
58
|
- capistrano_rails_console.gemspec
|
59
59
|
- lib/capistrano_rails_console.rb
|
60
|
+
- lib/capistrano_rails_console/rails.rb
|
60
61
|
- lib/capistrano_rails_console/recipes.rb
|
61
62
|
homepage: http://github.com/timoschilling/capistrano_rails_console
|
62
63
|
licenses: []
|
@@ -65,23 +66,23 @@ rdoc_options: []
|
|
65
66
|
require_paths:
|
66
67
|
- lib
|
67
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
68
70
|
requirements:
|
69
71
|
- - ! '>='
|
70
72
|
- !ruby/object:Gem::Version
|
71
73
|
version: '0'
|
72
74
|
segments:
|
73
75
|
- 0
|
74
|
-
hash:
|
75
|
-
none: false
|
76
|
+
hash: -505841522537028888
|
76
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
77
79
|
requirements:
|
78
80
|
- - ! '>='
|
79
81
|
- !ruby/object:Gem::Version
|
80
82
|
version: '0'
|
81
83
|
segments:
|
82
84
|
- 0
|
83
|
-
hash:
|
84
|
-
none: false
|
85
|
+
hash: -505841522537028888
|
85
86
|
requirements: []
|
86
87
|
rubyforge_project:
|
87
88
|
rubygems_version: 1.8.24
|