capistrano_ssh 0.2.1 → 0.3.0
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/CHANGELOG.md +24 -0
- data/Capfile +1 -0
- data/Gemfile +2 -0
- data/README.md +4 -0
- data/Rakefile +25 -0
- data/capistrano_ssh.gemspec +2 -0
- data/lib/capistrano_ssh.rb +1 -3
- data/lib/capistrano_ssh/recipes.rb +15 -5
- data/lib/capistrano_ssh/version.rb +3 -0
- data/spec/recipes_spec.rb +28 -0
- data/spec/spec_helper.rb +11 -0
- metadata +54 -15
data/CHANGELOG.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## v0.3.0
|
4
|
+
|
5
|
+
* rescipe refectoring
|
6
|
+
* tests
|
7
|
+
* version file
|
8
|
+
|
9
|
+
## v0.2.1
|
10
|
+
|
11
|
+
* fix a naming bug
|
12
|
+
|
13
|
+
## v0.2.0
|
14
|
+
|
15
|
+
* VERSION Constant
|
16
|
+
* move recipe
|
17
|
+
|
18
|
+
## v0.1.1
|
19
|
+
|
20
|
+
* add Capistrano to dependencies
|
21
|
+
|
22
|
+
## v0.1.0
|
23
|
+
|
24
|
+
* first version
|
data/Capfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "./lib/capistrano_ssh/recipes"
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -1 +1,26 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
require "rspec"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
|
6
|
+
RSpec::Core::RakeTask.new("test:spec") do |spec|
|
7
|
+
spec.pattern = "spec/**/*_spec.rb"
|
8
|
+
end
|
9
|
+
|
10
|
+
namespace :test do
|
11
|
+
desc "Run integration test"
|
12
|
+
task :integration do
|
13
|
+
puts
|
14
|
+
puts "Start integration test"
|
15
|
+
unless `cap -T` =~ /cap\ ssh/
|
16
|
+
puts "Integration test fails!"
|
17
|
+
exit!
|
18
|
+
else
|
19
|
+
puts "Integration test successfully!"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "Run integration tests and specs"
|
25
|
+
task :test => ["test:spec", "test:integration"]
|
26
|
+
task :default => :test
|
data/capistrano_ssh.gemspec
CHANGED
data/lib/capistrano_ssh.rb
CHANGED
@@ -1,9 +1,19 @@
|
|
1
1
|
require "capistrano/configuration"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module CapistranoSSH
|
4
|
+
module Recipes
|
5
|
+
def self.load_into(configuration)
|
6
|
+
configuration.load do
|
7
|
+
desc "Open a ssh connection to one of the remote servers"
|
8
|
+
task :ssh, :roles => :app do
|
9
|
+
hostname = find_servers_for_task(current_task).first
|
10
|
+
run_locally "ssh -l #{user} #{hostname} -p #{port} -t 'cd #{current_path} && bash'"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
8
14
|
end
|
9
15
|
end
|
16
|
+
|
17
|
+
if Capistrano::Configuration.instance
|
18
|
+
CapistranoSSH::Recipes.load_into(Capistrano::Configuration.instance)
|
19
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe CapistranoSSH::Recipes, "loaded into a configuration" do
|
4
|
+
describe "ssh" do
|
5
|
+
before do
|
6
|
+
[:rails_env, :user, :current_path].each do |key|
|
7
|
+
configuration.set key, "#{key}"
|
8
|
+
end
|
9
|
+
configuration.set :port, 22
|
10
|
+
configuration.role :app, "example.com"
|
11
|
+
end
|
12
|
+
|
13
|
+
let :configuration do
|
14
|
+
configuration = Capistrano::Configuration.new
|
15
|
+
described_class.load_into configuration
|
16
|
+
configuration.extend Capistrano::Spec::ConfigurationExtension
|
17
|
+
end
|
18
|
+
|
19
|
+
it "defines rails:console" do
|
20
|
+
configuration.find_task("ssh").should_not be_nil
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should run the remote command" do
|
24
|
+
configuration.find_and_execute_task "ssh"
|
25
|
+
configuration.should have_run_locally "ssh -l user example.com -p 22 -t 'cd current_path && bash'"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require "rspec"
|
2
|
+
require "capistrano"
|
3
|
+
require "capistrano-spec"
|
4
|
+
require "capistrano_ssh/recipes"
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.include Capistrano::Spec::Matchers
|
8
|
+
config.include Capistrano::Spec::Helpers
|
9
|
+
config.filter_run :focus => true
|
10
|
+
config.run_all_when_everything_filtered = true
|
11
|
+
end
|
metadata
CHANGED
@@ -1,48 +1,80 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano_ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
4
5
|
prerelease:
|
5
|
-
version: 0.2.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:
|
12
|
+
date: 2013-01-17 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
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
31
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
32
42
|
requirements:
|
33
43
|
- - ! '>='
|
34
44
|
- !ruby/object:Gem::Version
|
35
45
|
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
36
49
|
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
37
55
|
prerelease: false
|
38
|
-
|
39
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
40
58
|
requirements:
|
41
59
|
- - ! '>='
|
42
60
|
- !ruby/object:Gem::Version
|
43
61
|
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: capistrano-spec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
44
65
|
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
45
70
|
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
46
78
|
description: Open a ssh connection to one of the app servers.
|
47
79
|
email:
|
48
80
|
- timo@schilling.io
|
@@ -51,6 +83,8 @@ extensions: []
|
|
51
83
|
extra_rdoc_files: []
|
52
84
|
files:
|
53
85
|
- .gitignore
|
86
|
+
- CHANGELOG.md
|
87
|
+
- Capfile
|
54
88
|
- Gemfile
|
55
89
|
- LICENSE.txt
|
56
90
|
- README.md
|
@@ -58,6 +92,9 @@ files:
|
|
58
92
|
- capistrano_ssh.gemspec
|
59
93
|
- lib/capistrano_ssh.rb
|
60
94
|
- lib/capistrano_ssh/recipes.rb
|
95
|
+
- lib/capistrano_ssh/version.rb
|
96
|
+
- spec/recipes_spec.rb
|
97
|
+
- spec/spec_helper.rb
|
61
98
|
homepage: http://github.com/timoschilling/capistrano_ssh
|
62
99
|
licenses: []
|
63
100
|
post_install_message:
|
@@ -65,27 +102,29 @@ rdoc_options: []
|
|
65
102
|
require_paths:
|
66
103
|
- lib
|
67
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
68
106
|
requirements:
|
69
107
|
- - ! '>='
|
70
108
|
- !ruby/object:Gem::Version
|
71
109
|
version: '0'
|
72
110
|
segments:
|
73
111
|
- 0
|
74
|
-
hash:
|
75
|
-
none: false
|
112
|
+
hash: 4065223770471092379
|
76
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
77
115
|
requirements:
|
78
116
|
- - ! '>='
|
79
117
|
- !ruby/object:Gem::Version
|
80
118
|
version: '0'
|
81
119
|
segments:
|
82
120
|
- 0
|
83
|
-
hash:
|
84
|
-
none: false
|
121
|
+
hash: 4065223770471092379
|
85
122
|
requirements: []
|
86
123
|
rubyforge_project:
|
87
124
|
rubygems_version: 1.8.24
|
88
125
|
signing_key:
|
89
126
|
specification_version: 3
|
90
127
|
summary: Open a ssh connection to one of the app servers.
|
91
|
-
test_files:
|
128
|
+
test_files:
|
129
|
+
- spec/recipes_spec.rb
|
130
|
+
- spec/spec_helper.rb
|