blazing 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +26 -20
- data/CHANGELOG.md +28 -8
- data/Gemfile +0 -1
- data/Guardfile +10 -2
- data/README.md +3 -3
- data/blazing.gemspec +8 -5
- data/lib/blazing/cli.rb +6 -7
- data/lib/blazing/commands.rb +72 -0
- data/lib/blazing/config.rb +5 -0
- data/lib/blazing/hook.rb +85 -0
- data/lib/blazing/logger.rb +1 -0
- data/lib/blazing/recipe.rb +5 -0
- data/lib/blazing/repository.rb +53 -0
- data/lib/blazing/target.rb +35 -91
- data/lib/blazing/templates/config.erb +1 -1
- data/lib/blazing/templates/hook/base.erb +7 -0
- data/lib/blazing/templates/hook/bundler.erb +3 -0
- data/lib/blazing/templates/hook/git-reset.erb +10 -0
- data/lib/blazing/templates/hook/rake.erb +5 -0
- data/lib/blazing/templates/hook/recipes.erb +5 -0
- data/lib/blazing/templates/{hook.erb → hook/rvm.erb} +0 -29
- data/lib/blazing/templates/hook/setup.erb +9 -0
- data/lib/blazing.rb +3 -2
- data/spec/blazing/cli_spec.rb +33 -0
- data/spec/blazing/commands_spec.rb +134 -0
- data/spec/blazing/dsl_setter_spec.rb +29 -0
- data/spec/blazing/hook_spec.rb +148 -0
- data/spec/blazing/integration/deployment_spec.rb +32 -0
- data/spec/blazing/integration/init_spec.rb +3 -4
- data/spec/blazing/integration/list_spec.rb +4 -3
- data/spec/blazing/integration/recipes_spec.rb +2 -2
- data/spec/blazing/integration/setup_spec.rb +2 -2
- data/spec/blazing/integration/update_spec.rb +1 -3
- data/spec/blazing/logger_spec.rb +34 -0
- data/spec/blazing/recipe_spec.rb +1 -1
- data/spec/blazing/repository_spec.rb +41 -0
- data/spec/blazing/shell_spec.rb +19 -0
- data/spec/blazing/target_spec.rb +0 -25
- metadata +66 -35
- data/.rspec +0 -2
- data/lib/blazing/runner.rb +0 -79
- data/lib/blazing/version.rb +0 -7
- data/spec/blazing/runner_spec.rb +0 -24
data/spec/blazing/target_spec.rb
CHANGED
@@ -45,29 +45,4 @@ describe Blazing::Target do
|
|
45
45
|
target.user.should == nil
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
49
|
-
describe '#rake_command' do
|
50
|
-
|
51
|
-
it 'prepends the environment variables specified in the rake call' do
|
52
|
-
config = Blazing::Config.new
|
53
|
-
config.rake :deploy, 'SOMEFUNKYVARIABLE=foobar'
|
54
|
-
target = Blazing::Target.new(:sometarget, '/path', config)
|
55
|
-
target.rake_command.should == 'SOMEFUNKYVARIABLE=foobar bundle exec rake deploy'
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'appends the RAILS_ENV specified as :rails_env option to the target call' do
|
59
|
-
config = Blazing::Config.new
|
60
|
-
config.rake :deploy
|
61
|
-
target = Blazing::Target.new(:sometarget, '/path', config, :rails_env => 'production')
|
62
|
-
target.rake_command.should == ' RAILS_ENV=production bundle exec rake deploy'
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'returns nil when no rake task was specified in config' do
|
66
|
-
config = Blazing::Config.new
|
67
|
-
target = Blazing::Target.new(:sometarget, '/path', config, :rails_env => 'production')
|
68
|
-
target.rake_command.should be nil
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blazing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
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-
|
12
|
+
date: 2012-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdoc
|
16
|
-
requirement: &
|
16
|
+
requirement: &70180177051080 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70180177051080
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70180177049720 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.9.2
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70180177049720
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70180177048600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70180177048600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: guard
|
49
|
-
requirement: &
|
49
|
+
requirement: &70180177047260 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70180177047260
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
|
-
name: guard-
|
60
|
-
requirement: &
|
59
|
+
name: guard-rspec
|
60
|
+
requirement: &70180177045660 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70180177045660
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: ruby_gntp
|
71
|
-
requirement: &
|
71
|
+
requirement: &70180177060180 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70180177060180
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rb-fsevent
|
82
|
-
requirement: &
|
82
|
+
requirement: &70180177057520 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70180177057520
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: pry
|
93
|
-
requirement: &
|
93
|
+
requirement: &70180177053880 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,21 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70180177053880
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: pimpmychangelog
|
104
|
+
requirement: &70180177068640 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: *70180177068640
|
102
113
|
- !ruby/object:Gem::Dependency
|
103
114
|
name: grit
|
104
|
-
requirement: &
|
115
|
+
requirement: &70180177067260 !ruby/object:Gem::Requirement
|
105
116
|
none: false
|
106
117
|
requirements:
|
107
118
|
- - ! '>='
|
@@ -109,10 +120,10 @@ dependencies:
|
|
109
120
|
version: '0'
|
110
121
|
type: :runtime
|
111
122
|
prerelease: false
|
112
|
-
version_requirements: *
|
123
|
+
version_requirements: *70180177067260
|
113
124
|
- !ruby/object:Gem::Dependency
|
114
125
|
name: logging
|
115
|
-
requirement: &
|
126
|
+
requirement: &70180177065760 !ruby/object:Gem::Requirement
|
116
127
|
none: false
|
117
128
|
requirements:
|
118
129
|
- - ! '>='
|
@@ -120,10 +131,10 @@ dependencies:
|
|
120
131
|
version: '0'
|
121
132
|
type: :runtime
|
122
133
|
prerelease: false
|
123
|
-
version_requirements: *
|
134
|
+
version_requirements: *70180177065760
|
124
135
|
- !ruby/object:Gem::Dependency
|
125
136
|
name: thor
|
126
|
-
requirement: &
|
137
|
+
requirement: &70180177064140 !ruby/object:Gem::Requirement
|
127
138
|
none: false
|
128
139
|
requirements:
|
129
140
|
- - ! '>='
|
@@ -131,10 +142,10 @@ dependencies:
|
|
131
142
|
version: '0'
|
132
143
|
type: :runtime
|
133
144
|
prerelease: false
|
134
|
-
version_requirements: *
|
145
|
+
version_requirements: *70180177064140
|
135
146
|
- !ruby/object:Gem::Dependency
|
136
147
|
name: activesupport
|
137
|
-
requirement: &
|
148
|
+
requirement: &70180177061600 !ruby/object:Gem::Requirement
|
138
149
|
none: false
|
139
150
|
requirements:
|
140
151
|
- - ! '>='
|
@@ -142,10 +153,10 @@ dependencies:
|
|
142
153
|
version: '0'
|
143
154
|
type: :runtime
|
144
155
|
prerelease: false
|
145
|
-
version_requirements: *
|
156
|
+
version_requirements: *70180177061600
|
146
157
|
- !ruby/object:Gem::Dependency
|
147
158
|
name: i18n
|
148
|
-
requirement: &
|
159
|
+
requirement: &70180177071100 !ruby/object:Gem::Requirement
|
149
160
|
none: false
|
150
161
|
requirements:
|
151
162
|
- - ! '>='
|
@@ -153,7 +164,7 @@ dependencies:
|
|
153
164
|
version: '0'
|
154
165
|
type: :runtime
|
155
166
|
prerelease: false
|
156
|
-
version_requirements: *
|
167
|
+
version_requirements: *70180177071100
|
157
168
|
description: painless git push deployments for everyone
|
158
169
|
email:
|
159
170
|
- felipekaufmann@gmail.com
|
@@ -163,7 +174,6 @@ extensions: []
|
|
163
174
|
extra_rdoc_files: []
|
164
175
|
files:
|
165
176
|
- .gitignore
|
166
|
-
- .rspec
|
167
177
|
- .rvmrc
|
168
178
|
- .travis.yml
|
169
179
|
- CHANGELOG.md
|
@@ -176,24 +186,38 @@ files:
|
|
176
186
|
- blazing.gemspec
|
177
187
|
- lib/blazing.rb
|
178
188
|
- lib/blazing/cli.rb
|
189
|
+
- lib/blazing/commands.rb
|
179
190
|
- lib/blazing/config.rb
|
180
191
|
- lib/blazing/dsl_setter.rb
|
192
|
+
- lib/blazing/hook.rb
|
181
193
|
- lib/blazing/logger.rb
|
182
194
|
- lib/blazing/recipe.rb
|
183
|
-
- lib/blazing/
|
195
|
+
- lib/blazing/repository.rb
|
184
196
|
- lib/blazing/shell.rb
|
185
197
|
- lib/blazing/target.rb
|
186
198
|
- lib/blazing/templates/config.erb
|
187
|
-
- lib/blazing/templates/hook.erb
|
188
|
-
- lib/blazing/
|
199
|
+
- lib/blazing/templates/hook/base.erb
|
200
|
+
- lib/blazing/templates/hook/bundler.erb
|
201
|
+
- lib/blazing/templates/hook/git-reset.erb
|
202
|
+
- lib/blazing/templates/hook/rake.erb
|
203
|
+
- lib/blazing/templates/hook/recipes.erb
|
204
|
+
- lib/blazing/templates/hook/rvm.erb
|
205
|
+
- lib/blazing/templates/hook/setup.erb
|
206
|
+
- spec/blazing/cli_spec.rb
|
207
|
+
- spec/blazing/commands_spec.rb
|
189
208
|
- spec/blazing/config_spec.rb
|
209
|
+
- spec/blazing/dsl_setter_spec.rb
|
210
|
+
- spec/blazing/hook_spec.rb
|
211
|
+
- spec/blazing/integration/deployment_spec.rb
|
190
212
|
- spec/blazing/integration/init_spec.rb
|
191
213
|
- spec/blazing/integration/list_spec.rb
|
192
214
|
- spec/blazing/integration/recipes_spec.rb
|
193
215
|
- spec/blazing/integration/setup_spec.rb
|
194
216
|
- spec/blazing/integration/update_spec.rb
|
217
|
+
- spec/blazing/logger_spec.rb
|
195
218
|
- spec/blazing/recipe_spec.rb
|
196
|
-
- spec/blazing/
|
219
|
+
- spec/blazing/repository_spec.rb
|
220
|
+
- spec/blazing/shell_spec.rb
|
197
221
|
- spec/blazing/target_spec.rb
|
198
222
|
- spec/spec_helper.rb
|
199
223
|
- spec/support/empty_config.rb
|
@@ -225,14 +249,21 @@ signing_key:
|
|
225
249
|
specification_version: 3
|
226
250
|
summary: git push deployment helper
|
227
251
|
test_files:
|
252
|
+
- spec/blazing/cli_spec.rb
|
253
|
+
- spec/blazing/commands_spec.rb
|
228
254
|
- spec/blazing/config_spec.rb
|
255
|
+
- spec/blazing/dsl_setter_spec.rb
|
256
|
+
- spec/blazing/hook_spec.rb
|
257
|
+
- spec/blazing/integration/deployment_spec.rb
|
229
258
|
- spec/blazing/integration/init_spec.rb
|
230
259
|
- spec/blazing/integration/list_spec.rb
|
231
260
|
- spec/blazing/integration/recipes_spec.rb
|
232
261
|
- spec/blazing/integration/setup_spec.rb
|
233
262
|
- spec/blazing/integration/update_spec.rb
|
263
|
+
- spec/blazing/logger_spec.rb
|
234
264
|
- spec/blazing/recipe_spec.rb
|
235
|
-
- spec/blazing/
|
265
|
+
- spec/blazing/repository_spec.rb
|
266
|
+
- spec/blazing/shell_spec.rb
|
236
267
|
- spec/blazing/target_spec.rb
|
237
268
|
- spec/spec_helper.rb
|
238
269
|
- spec/support/empty_config.rb
|
data/.rspec
DELETED
data/lib/blazing/runner.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
require 'erb'
|
2
|
-
require 'blazing/config'
|
3
|
-
|
4
|
-
class Blazing::Runner
|
5
|
-
|
6
|
-
include Blazing::Logger
|
7
|
-
|
8
|
-
def initialize(target_name, options)
|
9
|
-
prepare_config(target_name, options)
|
10
|
-
end
|
11
|
-
|
12
|
-
#
|
13
|
-
# Parse config and set up options
|
14
|
-
#
|
15
|
-
def prepare_config(target_name, options = {})
|
16
|
-
@config ||= Blazing::Config.parse(options[:file])
|
17
|
-
@targets = []
|
18
|
-
|
19
|
-
if target_name == 'all'
|
20
|
-
@targets = @config.targets
|
21
|
-
else
|
22
|
-
@targets << (@config.targets.find { |t| t.name.to_s == target_name.to_s } || @config.default_target)
|
23
|
-
end
|
24
|
-
|
25
|
-
@targets.compact!
|
26
|
-
|
27
|
-
error 'no target given or found' if @targets.empty?
|
28
|
-
end
|
29
|
-
|
30
|
-
def setup
|
31
|
-
return if @targets.empty?
|
32
|
-
|
33
|
-
@targets.each do |target|
|
34
|
-
target.setup
|
35
|
-
end
|
36
|
-
update
|
37
|
-
end
|
38
|
-
|
39
|
-
def update
|
40
|
-
return if @targets.empty?
|
41
|
-
|
42
|
-
@targets.each do |t|
|
43
|
-
t.setup_git_remote
|
44
|
-
t.apply_hook
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def recipes
|
49
|
-
@config.recipes.each { |recipe| recipe.run }
|
50
|
-
end
|
51
|
-
|
52
|
-
class << self
|
53
|
-
|
54
|
-
include Blazing::Logger
|
55
|
-
|
56
|
-
#
|
57
|
-
# Bootstrap blazing by creating config file
|
58
|
-
#
|
59
|
-
def init
|
60
|
-
info "Creating an example config file in #{Blazing::DEFAULT_CONFIG_LOCATION}"
|
61
|
-
info "Customize it to your needs"
|
62
|
-
|
63
|
-
Dir.mkdir 'config' unless File.exists? 'config'
|
64
|
-
configuration_file = ERB.new(File.read("#{Blazing::TEMPLATE_ROOT}/config.erb")).result
|
65
|
-
|
66
|
-
File.open(Blazing::DEFAULT_CONFIG_LOCATION,"wb") do |f|
|
67
|
-
f.puts configuration_file
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
#
|
72
|
-
# List available blazing recipes
|
73
|
-
#
|
74
|
-
def list
|
75
|
-
Blazing::Recipe.list.each { |r| puts r.to_s.demodulize.underscore }
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
end
|
data/lib/blazing/version.rb
DELETED
data/spec/blazing/runner_spec.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'blazing/runner'
|
3
|
-
require 'blazing/config'
|
4
|
-
|
5
|
-
#
|
6
|
-
# NOTE: More specs for Runner in the integration directory.
|
7
|
-
#
|
8
|
-
|
9
|
-
describe Blazing::Runner do
|
10
|
-
|
11
|
-
before :each do
|
12
|
-
@config = Blazing::Config.new
|
13
|
-
@config.target :sometarget, 'somewhere', :default => true
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '#exec' do
|
17
|
-
|
18
|
-
it 'fails if the command does not exist' do
|
19
|
-
lambda { Blazing::Runner.new(@config).exec('weird_command') }.should raise_error
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|