pulsar 0.3.2 → 0.3.3
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/lib/pulsar/commands/list.rb
CHANGED
data/lib/pulsar/commands/main.rb
CHANGED
data/lib/pulsar/helpers/clamp.rb
CHANGED
@@ -42,6 +42,10 @@ module Pulsar
|
|
42
42
|
touch(capfile_path, :verbose => verbose?)
|
43
43
|
end
|
44
44
|
|
45
|
+
def create_tmp_dir
|
46
|
+
run_cmd("mkdir -p #{tmp_dir}", :verbose => verbose?)
|
47
|
+
end
|
48
|
+
|
45
49
|
def each_app
|
46
50
|
Dir["#{config_apps_path}/*"].each do |path|
|
47
51
|
yield(File.basename(path)) if File.directory?(path)
|
@@ -88,11 +92,7 @@ module Pulsar
|
|
88
92
|
recipes_dir = config_app_recipes_path(app)
|
89
93
|
stage_recipes_dir = config_app_stage_recipes_path(app, stage)
|
90
94
|
|
91
|
-
Dir
|
92
|
-
run_cmd("cat #{recipe} >> #{capfile_path}", :verbose => verbose?)
|
93
|
-
end
|
94
|
-
|
95
|
-
Dir.glob("#{stage_recipes_dir}/*.rb").each do |recipe|
|
95
|
+
Dir["#{recipes_dir}/*.rb", "#{stage_recipes_dir}/*.rb"].each do |recipe|
|
96
96
|
run_cmd("cat #{recipe} >> #{capfile_path}", :verbose => verbose?)
|
97
97
|
end
|
98
98
|
end
|
@@ -174,8 +174,8 @@ module Pulsar
|
|
174
174
|
def validate(app, stage)
|
175
175
|
app_path = config_app_path(app)
|
176
176
|
stage_path = config_stage_path(app, stage)
|
177
|
-
|
178
|
-
raise(ArgumentError
|
177
|
+
valid_paths = File.exists?(app_path) && File.exists?(stage_path)
|
178
|
+
raise(ArgumentError, "no pulsar config available for app=#{app}, stage=#{stage}") unless valid_paths
|
179
179
|
end
|
180
180
|
end
|
181
181
|
end
|
data/lib/pulsar/version.rb
CHANGED
@@ -107,6 +107,12 @@ describe Pulsar::ListCommand do
|
|
107
107
|
it "is supported" do
|
108
108
|
expect { pulsar.parse(base_args + %w(--tmp-dir dummy_tmp)) }.to_not raise_error(Clamp::UsageError)
|
109
109
|
end
|
110
|
+
|
111
|
+
it "creates the tmp directory if it doesn't exist" do
|
112
|
+
run_options = base_args + [ "--tmp-dir", tmp_path("tmp/non_existent") ]
|
113
|
+
|
114
|
+
expect { pulsar.run(run_options) }.not_to raise_error
|
115
|
+
end
|
110
116
|
end
|
111
117
|
|
112
118
|
context "--keep-capfile option" do
|
@@ -102,11 +102,11 @@ describe Pulsar::MainCommand do
|
|
102
102
|
end
|
103
103
|
|
104
104
|
it "errors out if application does not exist in configuration repository" do
|
105
|
-
expect { pulsar.run(full_cap_args + %w(
|
105
|
+
expect { pulsar.run(full_cap_args + %w(non_existent_app production)) }.to raise_error(ArgumentError)
|
106
106
|
end
|
107
107
|
|
108
108
|
it "errors out if stage does not exist in configuration repository" do
|
109
|
-
expect { pulsar.run(full_cap_args + dummy_app(:
|
109
|
+
expect { pulsar.run(full_cap_args + dummy_app(:non_existent_stage)) }.to raise_error(ArgumentError)
|
110
110
|
end
|
111
111
|
|
112
112
|
context "Capfile" do
|
@@ -225,6 +225,12 @@ describe Pulsar::MainCommand do
|
|
225
225
|
it "is supported" do
|
226
226
|
expect { pulsar.parse(base_args + %w(--tmp-dir dummy_tmp) + dummy_app) }.to_not raise_error(Clamp::UsageError)
|
227
227
|
end
|
228
|
+
|
229
|
+
it "creates the tmp directory if it doesn't exist" do
|
230
|
+
run_options = base_args + [ "--tmp-dir", tmp_path("tmp/non_existent"), "--skip-cap-run" ] + dummy_app
|
231
|
+
|
232
|
+
expect { pulsar.run(run_options) }.not_to raise_error
|
233
|
+
end
|
228
234
|
end
|
229
235
|
|
230
236
|
context "--keep-capfile option" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pulsar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-08-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: clamp
|