capistrano-fanfare 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/capistrano/fanfare/info.rb +34 -0
- data/lib/capistrano/fanfare/version.rb +1 -1
- data/spec/info_spec.rb +36 -0
- metadata +19 -16
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'capistrano'
|
2
|
+
|
3
|
+
##
|
4
|
+
# Based on the wicked awesome code from AF83 info capistrano recipe:
|
5
|
+
# https://github.com/AF83/capistrano-af83/blob/master/lib/capistrano/af83/info.rb
|
6
|
+
|
7
|
+
module Capistrano::Fanfare::Info
|
8
|
+
def self.load_into(configuration)
|
9
|
+
configuration.load do
|
10
|
+
set :info_variables, [ :application, :repository, :branch, :deploy_env,
|
11
|
+
:user, :deploy_to, :rails_env ]
|
12
|
+
|
13
|
+
|
14
|
+
# =========================================================================
|
15
|
+
# These are the tasks that are available to help with deploying web apps,
|
16
|
+
# and specifically, Rails applications. You can have cap give you a summary
|
17
|
+
# of them with `cap -T'.
|
18
|
+
# =========================================================================
|
19
|
+
|
20
|
+
desc <<-DESC
|
21
|
+
DESC
|
22
|
+
task :info, :roles => :app, :except => { :no_release => true } do
|
23
|
+
logger.important "Configuration:"
|
24
|
+
fetch(:info_variables, []).each do |var|
|
25
|
+
logger.important %{* #{var}: "#{fetch(var, "<undefined>")}"}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
if Capistrano::Configuration.instance
|
33
|
+
Capistrano::Fanfare::Info.load_into(Capistrano::Configuration.instance)
|
34
|
+
end
|
data/spec/info_spec.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'minitest/capistrano'
|
3
|
+
require 'capistrano/fanfare'
|
4
|
+
require 'capistrano/fanfare/info'
|
5
|
+
|
6
|
+
describe Capistrano::Fanfare::Info do
|
7
|
+
before do
|
8
|
+
@config = Capistrano::Configuration.new
|
9
|
+
Capistrano::Fanfare::Info.load_into(@config)
|
10
|
+
@config.extend(MiniTest::Capistrano::ConfigurationExtension)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "for variables" do
|
14
|
+
it "sets :info_variables to a known default" do
|
15
|
+
@config.fetch(:info_variables).must_equal [
|
16
|
+
:application, :repository, :branch, :deploy_env,
|
17
|
+
:user, :deploy_to, :rails_env
|
18
|
+
]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
it "prints the configuration information" do
|
23
|
+
@config.set :application, "foogle"
|
24
|
+
@config.set :repository, "git@example.com:foogle.git"
|
25
|
+
@config.set :info_variables, [:application, :repository]
|
26
|
+
io = StringIO.new
|
27
|
+
@config.logger = Capistrano::Logger.new(:output => io)
|
28
|
+
@config.find_and_execute_task("info")
|
29
|
+
|
30
|
+
io.string.must_equal [
|
31
|
+
%{*** Configuration:},
|
32
|
+
%{*** * application: "foogle"},
|
33
|
+
%{*** * repository: "git@example.com:foogle.git"}
|
34
|
+
].join("\n").concat("\n")
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-fanfare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
16
|
-
requirement: &
|
16
|
+
requirement: &70169709900660 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.10.0.pre
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70169709900660
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: capistrano_colors
|
27
|
-
requirement: &
|
27
|
+
requirement: &70169709898980 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.5'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70169709898980
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sushi
|
38
|
-
requirement: &
|
38
|
+
requirement: &70169709897720 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.0.2
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70169709897720
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: minitest
|
49
|
-
requirement: &
|
49
|
+
requirement: &70169709896800 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.10.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70169709896800
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: minitest-capistrano
|
60
|
-
requirement: &
|
60
|
+
requirement: &70169709895300 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0.0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70169709895300
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: timecop
|
71
|
-
requirement: &
|
71
|
+
requirement: &70169709888100 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0.3'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70169709888100
|
80
80
|
description: Capistrano recipes (with full test suite) for fanfare application deployment
|
81
81
|
framework
|
82
82
|
email:
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- lib/capistrano/fanfare/foreman/strategy/base.rb
|
108
108
|
- lib/capistrano/fanfare/foreman/strategy/runit.rb
|
109
109
|
- lib/capistrano/fanfare/git_style.rb
|
110
|
+
- lib/capistrano/fanfare/info.rb
|
110
111
|
- lib/capistrano/fanfare/multistage.rb
|
111
112
|
- lib/capistrano/fanfare/ssh.rb
|
112
113
|
- lib/capistrano/fanfare/version.rb
|
@@ -127,6 +128,7 @@ files:
|
|
127
128
|
- spec/foreman_spec.rb
|
128
129
|
- spec/git_style_spec.rb
|
129
130
|
- spec/git_style_strategy_spec.rb
|
131
|
+
- spec/info_spec.rb
|
130
132
|
- spec/loading_spec.rb
|
131
133
|
- spec/multistage_spec.rb
|
132
134
|
- spec/ssh_spec.rb
|
@@ -144,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
146
|
version: '0'
|
145
147
|
segments:
|
146
148
|
- 0
|
147
|
-
hash:
|
149
|
+
hash: 4147383710922983477
|
148
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
151
|
none: false
|
150
152
|
requirements:
|
@@ -153,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
155
|
version: '0'
|
154
156
|
segments:
|
155
157
|
- 0
|
156
|
-
hash:
|
158
|
+
hash: 4147383710922983477
|
157
159
|
requirements: []
|
158
160
|
rubyforge_project:
|
159
161
|
rubygems_version: 1.8.10
|
@@ -178,6 +180,7 @@ test_files:
|
|
178
180
|
- spec/foreman_spec.rb
|
179
181
|
- spec/git_style_spec.rb
|
180
182
|
- spec/git_style_strategy_spec.rb
|
183
|
+
- spec/info_spec.rb
|
181
184
|
- spec/loading_spec.rb
|
182
185
|
- spec/multistage_spec.rb
|
183
186
|
- spec/ssh_spec.rb
|