deplomat 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/deplomat.gemspec +2 -2
- data/lib/deplomat/exceptions.rb +0 -1
- data/lib/deplomat/node.rb +7 -4
- data/spec/node_spec.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43328e335e9506ceea77f8c16bf79ff2d43f8eda9f863ab5949ea430f04a15c4
|
4
|
+
data.tar.gz: 3aa4d9092fdac50217c7e388d02cc22ff2ff36cc411fbe0968ed1948f935b04b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d54530453a2d651269219623230bd728e35818c0aa8c7f8c1b7979de7146adec40b1374537451af6a05de97363c7c49b3688b24fb91ea4ef117cb58f1048c66
|
7
|
+
data.tar.gz: 5e7fb76963666596ceff2c07c40c01bea03bc498269b04203844ac1541bdbf86698bdf5287d96f0a932d10c75e1a4301d298f61b2d732f275d28570d851afd6b
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/deplomat.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: deplomat 0.2.
|
5
|
+
# stub: deplomat 0.2.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "deplomat".freeze
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
data/lib/deplomat/exceptions.rb
CHANGED
data/lib/deplomat/node.rb
CHANGED
@@ -9,6 +9,7 @@ module Deplomat
|
|
9
9
|
@log_to = log_to
|
10
10
|
@logfile = logfile
|
11
11
|
@raise_exceptions = raise_exceptions
|
12
|
+
@current_path = path
|
12
13
|
self.cd(path) if path
|
13
14
|
end
|
14
15
|
|
@@ -128,8 +129,9 @@ module Deplomat
|
|
128
129
|
def update_requisite_number!(n, counter_file_path: "#{@current_path}/.deployment_requisites_counter")
|
129
130
|
current_number = current_requisite_number(counter_file_path)
|
130
131
|
if n <= current_number
|
131
|
-
|
132
|
-
|
132
|
+
log "New requisite number (#{n}) is below or equals the current one (#{current_number}). " +
|
133
|
+
"Something must have gone wrong.", color: "red"
|
134
|
+
exit 1
|
133
135
|
else
|
134
136
|
File.open(counter_file_path, "w") { |f| f.puts n }
|
135
137
|
end
|
@@ -139,8 +141,9 @@ module Deplomat
|
|
139
141
|
if file_exists?(fn)
|
140
142
|
return File.readlines(fn).first.to_i
|
141
143
|
else
|
142
|
-
|
143
|
-
|
144
|
+
log "Requisite counter file `#{fn}` doesn't exist. " +
|
145
|
+
"Please create it manually and symlink it in the deployment script if necessary.", color: "red"
|
146
|
+
exit 1
|
144
147
|
end
|
145
148
|
end
|
146
149
|
|
data/spec/node_spec.rb
CHANGED
@@ -45,6 +45,7 @@ describe Deplomat::Node do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it "updates requisite counter" do
|
48
|
+
@node.log_to = []
|
48
49
|
|
49
50
|
requisites_counter_fn = "#{Dir.pwd}/spec/.deployment_requisites_counter"
|
50
51
|
@node.cd Dir.pwd + "/spec"
|
@@ -53,10 +54,10 @@ describe Deplomat::Node do
|
|
53
54
|
@node.update_requisite_number!(2)
|
54
55
|
expect(File.readlines(requisites_counter_fn).first.to_i).to eq(2)
|
55
56
|
|
56
|
-
expect(-> { @node.update_requisite_number!(1) }).to raise_exception(
|
57
|
+
expect(-> { @node.update_requisite_number!(1) }).to raise_exception(SystemExit)
|
57
58
|
|
58
59
|
File.unlink(requisites_counter_fn)
|
59
|
-
expect(-> { @node.update_requisite_number!(3) }).to raise_exception(
|
60
|
+
expect(-> { @node.update_requisite_number!(3) }).to raise_exception(SystemExit)
|
60
61
|
end
|
61
62
|
|
62
63
|
end
|