puppet-blacksmith 2.2.0 → 2.3.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 +8 -8
- data/lib/puppet_blacksmith/git.rb +3 -2
- data/lib/puppet_blacksmith/version.rb +1 -1
- data/spec/puppet_blacksmith/git_spec.rb +17 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDg2NDI3YmNhMzc0YjllYWFlOGI3Y2NiZDhiMzNlZTZmMGRhNmVhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTljZGQ1N2IyZjA4NjI2YTIwODEzMjhjNDA5ZmIwMzRhZjU5NjZmOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzAwZDI5Yjg2ODRhMjk0MzJlMDZmNjgzOGQwODk2MTQ2ZTU4N2VlYmZhZjNj
|
10
|
+
NmViMTNmM2ZlZTFjZmMwNmYyNWZkNWM4MDEwYjRhODhhYWMwNTg5ZjE0NzQw
|
11
|
+
YjAzMzk5NjI1NjJhNjFjZTRiOTFjOTk1OGEyYTFkNDMxZTIzMzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTRkYmE0MDQ2ZDRlNmJkYWJiMzg1ZTcyMTBmNDI5MmVmZmFjMWNjMjAxMTRi
|
14
|
+
MGUzN2I5ODRiNGU4OTA2NzAyNTkwN2ZmYTdkYTdhMGNiNTA2ODIwZjg2YzE0
|
15
|
+
ZjhhZjJhMDVjMTU1N2UzNWJhMGM0OTI1MTMxM2ExYzQ2MGEzMTY=
|
@@ -14,7 +14,8 @@ module Blacksmith
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def commit_modulefile!
|
17
|
-
|
17
|
+
files = Blacksmith::Modulefile::FILES.select {|f| File.exists?(File.join(@path,f))}
|
18
|
+
s = exec_git "add #{files.join(" ")}"
|
18
19
|
s += exec_git "commit -m '[blacksmith] Bump version'"
|
19
20
|
s
|
20
21
|
end
|
@@ -43,7 +44,7 @@ module Blacksmith
|
|
43
44
|
if exit_status.nil?
|
44
45
|
raise Blacksmith::Error, err unless err.empty?
|
45
46
|
elsif !exit_status.success?
|
46
|
-
raise Blacksmith::Error, err.empty? ? "Command #{new_cmd} failed with exit status #{exit_status}" : err
|
47
|
+
raise Blacksmith::Error, err.empty? ? "Command #{new_cmd} failed with exit status #{exit_status}#{"\n#{out}" unless out.empty?}" : err
|
47
48
|
end
|
48
49
|
return out
|
49
50
|
end
|
@@ -5,11 +5,14 @@ describe 'Blacksmith::Git' do
|
|
5
5
|
subject { Blacksmith::Git.new(path) }
|
6
6
|
let(:path) { File.join(File.dirname(__FILE__), '../../tmp/git_test') }
|
7
7
|
let(:version) { '1.0.0' }
|
8
|
+
let(:metadata_file) { "metadata.json" }
|
8
9
|
|
9
10
|
before do
|
10
11
|
FileUtils.rm_rf path
|
11
12
|
FileUtils.mkdir_p(path)
|
12
13
|
`git init #{path}`
|
14
|
+
FileUtils.touch(File.join(path, metadata_file))
|
15
|
+
`cd #{path} && git add #{metadata_file} && git commit -am "Init"`
|
13
16
|
end
|
14
17
|
|
15
18
|
shared_examples_for :git do
|
@@ -21,6 +24,18 @@ describe 'Blacksmith::Git' do
|
|
21
24
|
end
|
22
25
|
end
|
23
26
|
|
27
|
+
describe 'commit_modulefile' do
|
28
|
+
before do
|
29
|
+
open(File.join(subject.path, metadata_file), 'a') { |f|
|
30
|
+
f.puts "more text"
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should commit the metadata file" do
|
35
|
+
expect(subject.commit_modulefile!).to match(/\[blacksmith\] Bump version/)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
24
39
|
describe 'exec_git' do
|
25
40
|
let(:cmd) { 'log' }
|
26
41
|
let(:stdin) { nil }
|
@@ -52,7 +67,7 @@ describe 'Blacksmith::Git' do
|
|
52
67
|
# this spec fails on jruby, can't detect exit code of script
|
53
68
|
context 'when stderr is empty' do
|
54
69
|
let(:cmd) { "git" } # exits with 1
|
55
|
-
it { expect { subject.exec_git(cmd) }.to raise_error(Blacksmith::Error, /^Command .* failed with exit status.*1
|
70
|
+
it { expect { subject.exec_git(cmd) }.to raise_error(Blacksmith::Error, /^Command .* failed with exit status.*1.*$/) }
|
56
71
|
end
|
57
72
|
|
58
73
|
context 'when stderr is not empty' do
|
@@ -64,18 +79,11 @@ describe 'Blacksmith::Git' do
|
|
64
79
|
end
|
65
80
|
|
66
81
|
context "Using Modulefile" do
|
67
|
-
|
68
|
-
FileUtils.touch(File.join(path, "Modulefile"))
|
69
|
-
`cd #{path} && git add Modulefile && git commit -am "Init"`
|
70
|
-
end
|
82
|
+
let(:metadata_file) { "Modulefile" }
|
71
83
|
it_behaves_like :git
|
72
84
|
end
|
73
85
|
|
74
86
|
context "Using metadata.json" do
|
75
|
-
before do
|
76
|
-
FileUtils.touch(File.join(path, "metadata.json"))
|
77
|
-
`cd #{path} && git add metadata.json && git commit -am "Init"`
|
78
|
-
end
|
79
87
|
it_behaves_like :git
|
80
88
|
end
|
81
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-blacksmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MaestroDev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|