librarian-puppet-simple 0.0.3 → 0.0.4
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/LICENSE +13 -1
- data/lib/librarian/puppet/simple/cli.rb +8 -8
- data/lib/librarian/puppet/simple/iterator.rb +8 -8
- data/lib/librarian/puppet/simple/version.rb +1 -1
- data/spec/functional/install_spec.rb +3 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f58631425b926315afa614b8ce03aa0b7624cf2c
|
4
|
+
data.tar.gz: 1cef5b57b773f3144f45023135f1e377f9da5ab6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4faf4128ef7afee2111b8d55808ea4eec47a5238e1d312fdcacfc3229dd9f9226e31ed2fe97db7fd9dd44ad9e16b7b9e3a5067bf49218cfccb6f2d452e55833d
|
7
|
+
data.tar.gz: 87072db0e6f498cc160c422eada82136bc6297aac4e35edbbd59ddc54779fd92dadbd0f0e327cf388b428d45fd71962cd6a7a0f17273b1736ba803f31f3ea298
|
data/LICENSE
CHANGED
@@ -1 +1,13 @@
|
|
1
|
-
|
1
|
+
Copyright 2013-2014 Dan Bode
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
@@ -44,16 +44,16 @@ module Librarian
|
|
44
44
|
eval(File.read(File.expand_path(options[:puppetfile])))
|
45
45
|
each_module_of_type(:git) do |repo|
|
46
46
|
Dir.chdir(File.join(module_path, repo[:name])) do
|
47
|
+
remote = repo[:git]
|
47
48
|
# if no ref is given, assume master
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
else
|
52
|
-
checkout_ref = repo[:ref]
|
53
|
-
remote_branch = repo[:ref].gsub(/^origin\//, '')
|
49
|
+
branch = repo[:ref] || 'master'
|
50
|
+
if branch =~ /^origin\/(.*)$/
|
51
|
+
branch = $1
|
54
52
|
end
|
55
|
-
|
56
|
-
|
53
|
+
co_cmd = 'git checkout FETCH_HEAD'
|
54
|
+
update_cmd = "git fetch #{repo[:git]} #{branch} && #{co_cmd}"
|
55
|
+
print_verbose "\n\n#{repo[:name]} -- #{update_cmd}"
|
56
|
+
git_pull_cmd = system_cmd(update_cmd)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -13,14 +13,14 @@ module Librarian
|
|
13
13
|
|
14
14
|
case
|
15
15
|
when options[:git]
|
16
|
-
@modules[:git] ||=
|
17
|
-
@modules[:git]
|
16
|
+
@modules[:git] ||= {}
|
17
|
+
@modules[:git][module_name] = options.merge(:name => module_name, :full_name => full_name)
|
18
18
|
when options[:tarball]
|
19
|
-
@modules[:tarball] ||=
|
20
|
-
@modules[:tarball]
|
19
|
+
@modules[:tarball] ||= {}
|
20
|
+
@modules[:tarball][module_name] = options.merge(:name => module_name, :full_name => full_name)
|
21
21
|
else
|
22
|
-
@modules[:forge] ||=
|
23
|
-
@modules[:forge]
|
22
|
+
@modules[:forge] ||= {}
|
23
|
+
@modules[:forge][module_name] = options.merge(:name => module_name, :full_name => full_name)
|
24
24
|
#abort('only the :git and :tarball providers are currently supported')
|
25
25
|
end
|
26
26
|
end
|
@@ -36,7 +36,7 @@ module Librarian
|
|
36
36
|
# iterate through all modules
|
37
37
|
def each_module(&block)
|
38
38
|
(@modules || {}).each do |type, repos|
|
39
|
-
(repos ||
|
39
|
+
(repos || {}).values.each do |repo|
|
40
40
|
yield repo
|
41
41
|
end
|
42
42
|
end
|
@@ -45,7 +45,7 @@ module Librarian
|
|
45
45
|
# loop over each module of a certain type
|
46
46
|
def each_module_of_type(type, &block)
|
47
47
|
abort("undefined type #{type}") unless [:git, :tarball].include?(type)
|
48
|
-
((@modules || {})[type] ||
|
48
|
+
((@modules || {})[type] || {}).values.each do |repo|
|
49
49
|
yield repo
|
50
50
|
end
|
51
51
|
end
|
@@ -35,14 +35,14 @@ describe "Functional - Install" do
|
|
35
35
|
output, status = execute_captured("bin/librarian-puppet install --path=#{temp_directory} --puppetfile=spec/fixtures/Puppetfile")
|
36
36
|
|
37
37
|
status.should == 0
|
38
|
-
Dir.entries(temp_directory).should =~
|
38
|
+
Dir.entries(temp_directory).should =~ %w|. .. apache ntp trashfile dnsclient testlps|
|
39
39
|
end
|
40
40
|
|
41
41
|
it "with --clean it cleans the directory before installing the modules in a temp directory" do
|
42
42
|
output, status = execute_captured("bin/librarian-puppet install --clean --path=#{temp_directory} --puppetfile=spec/fixtures/Puppetfile")
|
43
43
|
|
44
44
|
status.should == 0
|
45
|
-
Dir.entries(temp_directory).should =~
|
45
|
+
Dir.entries(temp_directory).should =~ %w|. .. apache ntp dnsclient testlps|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "with --verbose it outputs progress messages" do
|
@@ -66,9 +66,8 @@ describe "Functional - Install" do
|
|
66
66
|
output, status = execute_captured("bin/librarian-puppet install --verbose --path=#{temp_directory} --puppetfile=spec/fixtures/Puppetfile")
|
67
67
|
status.should == 0
|
68
68
|
output.should include('Module apache already installed')
|
69
|
-
Dir.entries(temp_directory).should =~
|
69
|
+
Dir.entries(temp_directory).should =~ %w|. .. apache ntp dnsclient testlps|
|
70
70
|
end
|
71
|
-
|
72
71
|
end
|
73
72
|
end
|
74
73
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librarian-puppet-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Bode
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.
|
87
|
+
rubygems_version: 2.4.3
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Bundler for your Puppet modules
|