librarian-puppet-maestrodev 0.9.7.5 → 0.9.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/README.md +3 -3
  2. data/bin/librarian-puppet +0 -2
  3. data/lib/librarian/puppet.rb +10 -1
  4. data/lib/librarian/puppet/extension.rb +68 -11
  5. data/lib/librarian/puppet/requirement.rb +39 -0
  6. data/lib/librarian/puppet/source.rb +1 -0
  7. data/lib/librarian/puppet/source/forge.rb +8 -1
  8. data/lib/librarian/puppet/source/git.rb +2 -0
  9. data/lib/librarian/puppet/source/githubtarball.rb +16 -1
  10. data/lib/librarian/puppet/version.rb +1 -1
  11. metadata +33 -112
  12. data/vendor/librarian/CHANGELOG.md +0 -185
  13. data/vendor/librarian/Gemfile +0 -6
  14. data/vendor/librarian/MIT-LICENSE +0 -20
  15. data/vendor/librarian/README.md +0 -403
  16. data/vendor/librarian/Rakefile +0 -34
  17. data/vendor/librarian/bin/librarian-chef +0 -7
  18. data/vendor/librarian/bin/librarian-mock +0 -7
  19. data/vendor/librarian/config/cucumber.yaml +0 -1
  20. data/vendor/librarian/features/chef/cli/init.feature +0 -11
  21. data/vendor/librarian/features/chef/cli/install.feature +0 -64
  22. data/vendor/librarian/features/chef/cli/show.feature +0 -77
  23. data/vendor/librarian/features/chef/cli/version.feature +0 -11
  24. data/vendor/librarian/features/support/env.rb +0 -9
  25. data/vendor/librarian/lib/librarian.rb +0 -19
  26. data/vendor/librarian/lib/librarian/action.rb +0 -5
  27. data/vendor/librarian/lib/librarian/action/base.rb +0 -24
  28. data/vendor/librarian/lib/librarian/action/clean.rb +0 -44
  29. data/vendor/librarian/lib/librarian/action/ensure.rb +0 -24
  30. data/vendor/librarian/lib/librarian/action/install.rb +0 -99
  31. data/vendor/librarian/lib/librarian/action/resolve.rb +0 -81
  32. data/vendor/librarian/lib/librarian/action/update.rb +0 -78
  33. data/vendor/librarian/lib/librarian/chef.rb +0 -1
  34. data/vendor/librarian/lib/librarian/chef/cli.rb +0 -48
  35. data/vendor/librarian/lib/librarian/chef/dsl.rb +0 -15
  36. data/vendor/librarian/lib/librarian/chef/environment.rb +0 -27
  37. data/vendor/librarian/lib/librarian/chef/extension.rb +0 -9
  38. data/vendor/librarian/lib/librarian/chef/integration/knife.rb +0 -42
  39. data/vendor/librarian/lib/librarian/chef/manifest_reader.rb +0 -59
  40. data/vendor/librarian/lib/librarian/chef/source.rb +0 -3
  41. data/vendor/librarian/lib/librarian/chef/source/git.rb +0 -25
  42. data/vendor/librarian/lib/librarian/chef/source/local.rb +0 -69
  43. data/vendor/librarian/lib/librarian/chef/source/path.rb +0 -12
  44. data/vendor/librarian/lib/librarian/chef/source/site.rb +0 -446
  45. data/vendor/librarian/lib/librarian/chef/templates/Cheffile +0 -15
  46. data/vendor/librarian/lib/librarian/cli.rb +0 -205
  47. data/vendor/librarian/lib/librarian/cli/manifest_presenter.rb +0 -79
  48. data/vendor/librarian/lib/librarian/config.rb +0 -7
  49. data/vendor/librarian/lib/librarian/config/database.rb +0 -205
  50. data/vendor/librarian/lib/librarian/config/file_source.rb +0 -47
  51. data/vendor/librarian/lib/librarian/config/hash_source.rb +0 -33
  52. data/vendor/librarian/lib/librarian/config/source.rb +0 -149
  53. data/vendor/librarian/lib/librarian/dependency.rb +0 -91
  54. data/vendor/librarian/lib/librarian/dsl.rb +0 -108
  55. data/vendor/librarian/lib/librarian/dsl/receiver.rb +0 -48
  56. data/vendor/librarian/lib/librarian/dsl/target.rb +0 -172
  57. data/vendor/librarian/lib/librarian/environment.rb +0 -134
  58. data/vendor/librarian/lib/librarian/error.rb +0 -4
  59. data/vendor/librarian/lib/librarian/helpers.rb +0 -13
  60. data/vendor/librarian/lib/librarian/lockfile.rb +0 -29
  61. data/vendor/librarian/lib/librarian/lockfile/compiler.rb +0 -66
  62. data/vendor/librarian/lib/librarian/lockfile/parser.rb +0 -100
  63. data/vendor/librarian/lib/librarian/logger.rb +0 -46
  64. data/vendor/librarian/lib/librarian/manifest.rb +0 -132
  65. data/vendor/librarian/lib/librarian/manifest_set.rb +0 -154
  66. data/vendor/librarian/lib/librarian/mock.rb +0 -1
  67. data/vendor/librarian/lib/librarian/mock/cli.rb +0 -19
  68. data/vendor/librarian/lib/librarian/mock/dsl.rb +0 -15
  69. data/vendor/librarian/lib/librarian/mock/environment.rb +0 -24
  70. data/vendor/librarian/lib/librarian/mock/extension.rb +0 -9
  71. data/vendor/librarian/lib/librarian/mock/source.rb +0 -1
  72. data/vendor/librarian/lib/librarian/mock/source/mock.rb +0 -97
  73. data/vendor/librarian/lib/librarian/mock/source/mock/registry.rb +0 -83
  74. data/vendor/librarian/lib/librarian/resolution.rb +0 -44
  75. data/vendor/librarian/lib/librarian/resolver.rb +0 -78
  76. data/vendor/librarian/lib/librarian/resolver/implementation.rb +0 -118
  77. data/vendor/librarian/lib/librarian/source.rb +0 -2
  78. data/vendor/librarian/lib/librarian/source/git.rb +0 -150
  79. data/vendor/librarian/lib/librarian/source/git/repository.rb +0 -217
  80. data/vendor/librarian/lib/librarian/source/local.rb +0 -61
  81. data/vendor/librarian/lib/librarian/source/path.rb +0 -74
  82. data/vendor/librarian/lib/librarian/spec.rb +0 -13
  83. data/vendor/librarian/lib/librarian/spec_change_set.rb +0 -173
  84. data/vendor/librarian/lib/librarian/specfile.rb +0 -18
  85. data/vendor/librarian/lib/librarian/support/abstract_method.rb +0 -21
  86. data/vendor/librarian/lib/librarian/ui.rb +0 -64
  87. data/vendor/librarian/lib/librarian/version.rb +0 -3
  88. data/vendor/librarian/librarian.gemspec +0 -34
  89. data/vendor/librarian/spec/functional/chef/source/git_spec.rb +0 -432
  90. data/vendor/librarian/spec/functional/chef/source/site_spec.rb +0 -215
  91. data/vendor/librarian/spec/functional/source/git/repository_spec.rb +0 -149
  92. data/vendor/librarian/spec/unit/action/base_spec.rb +0 -18
  93. data/vendor/librarian/spec/unit/action/clean_spec.rb +0 -102
  94. data/vendor/librarian/spec/unit/action/ensure_spec.rb +0 -37
  95. data/vendor/librarian/spec/unit/action/install_spec.rb +0 -111
  96. data/vendor/librarian/spec/unit/config/database_spec.rb +0 -319
  97. data/vendor/librarian/spec/unit/dependency_spec.rb +0 -36
  98. data/vendor/librarian/spec/unit/dsl_spec.rb +0 -194
  99. data/vendor/librarian/spec/unit/environment_spec.rb +0 -9
  100. data/vendor/librarian/spec/unit/lockfile/parser_spec.rb +0 -162
  101. data/vendor/librarian/spec/unit/lockfile_spec.rb +0 -65
  102. data/vendor/librarian/spec/unit/manifest_set_spec.rb +0 -202
  103. data/vendor/librarian/spec/unit/manifest_spec.rb +0 -36
  104. data/vendor/librarian/spec/unit/mock/source/mock_spec.rb +0 -22
  105. data/vendor/librarian/spec/unit/resolver_spec.rb +0 -192
  106. data/vendor/librarian/spec/unit/source/git_spec.rb +0 -29
  107. data/vendor/librarian/spec/unit/spec_change_set_spec.rb +0 -169
@@ -1,202 +0,0 @@
1
- require 'librarian'
2
-
3
- module Librarian
4
- describe ManifestSet do
5
-
6
- describe ".new" do
7
- let(:jelly) { double(:name => "jelly") }
8
- let(:butter) { double(:name => "butter") }
9
- let(:jam) { double(:name => "jam") }
10
-
11
- let(:array) { [jelly, butter, jam] }
12
- let(:hash) { {"jelly" => jelly, "butter" => butter, "jam" => jam} }
13
-
14
- context "with an array" do
15
- let(:set) { described_class.new(array) }
16
-
17
- it "should give back the array" do
18
- set.to_a.should =~ array
19
- end
20
-
21
- it "should give back the hash" do
22
- set.to_hash.should == hash
23
- end
24
- end
25
-
26
- context "with a hash" do
27
- let(:set) { described_class.new(hash) }
28
-
29
- it "should give back the array" do
30
- set.to_a.should =~ array
31
- end
32
-
33
- it "should give back the hash" do
34
- set.to_hash.should == hash
35
- end
36
- end
37
- end
38
-
39
- # Does not trace dependencies.
40
- # That's why it's "shallow".
41
- describe "#shallow_strip!" do
42
- let(:jelly) { double(:name => "jelly") }
43
- let(:butter) { double(:name => "butter") }
44
- let(:jam) { double(:name => "jam") }
45
-
46
- let(:set) { described_class.new([jelly, butter, jam]) }
47
-
48
- it "should not do anything when given no names" do
49
- set.shallow_strip!([])
50
-
51
- set.to_a.should =~ [jelly, butter, jam]
52
- end
53
-
54
- it "should remove only the named elements" do
55
- set.shallow_strip!(["butter", "jam"])
56
-
57
- set.to_a.should =~ [jelly]
58
- end
59
-
60
- it "should allow removing all the elements" do
61
- set.shallow_strip!(["jelly", "butter", "jam"])
62
-
63
- set.to_a.should =~ []
64
- end
65
- end
66
-
67
- # Does not trace dependencies.
68
- # That's why it's "shallow".
69
- describe "#shallow_keep!" do
70
- let(:jelly) { double(:name => "jelly") }
71
- let(:butter) { double(:name => "butter") }
72
- let(:jam) { double(:name => "jam") }
73
-
74
- let(:set) { described_class.new([jelly, butter, jam]) }
75
-
76
- it "should empty the set when given no names" do
77
- set.shallow_keep!([])
78
-
79
- set.to_a.should =~ []
80
- end
81
-
82
- it "should keep only the named elements" do
83
- set.shallow_keep!(["butter", "jam"])
84
-
85
- set.to_a.should =~ [butter, jam]
86
- end
87
-
88
- it "should allow keeping all the elements" do
89
- set.shallow_keep!(["jelly", "butter", "jam"])
90
-
91
- set.to_a.should =~ [jelly, butter, jam]
92
- end
93
- end
94
-
95
- describe "#deep_strip!" do
96
- def man(o)
97
- k, v = o.keys.first, o.values.first
98
- double(k, :name => k, :dependencies => deps(v))
99
- end
100
-
101
- def deps(names)
102
- names.map{|n| double(:name => n)}
103
- end
104
-
105
- let(:a) { man("a" => %w[b c]) }
106
- let(:b) { man("b" => %w[c d]) }
107
- let(:c) { man("c" => %w[ ]) }
108
- let(:d) { man("d" => %w[ ]) }
109
-
110
- let(:e) { man("e" => %w[f g]) }
111
- let(:f) { man("f" => %w[g h]) }
112
- let(:g) { man("g" => %w[ ]) }
113
- let(:h) { man("h" => %w[ ]) }
114
-
115
- let(:set) { described_class.new([a, b, c, d, e, f, g, h]) }
116
-
117
- it "should not do anything when given no names" do
118
- set.deep_strip!([])
119
-
120
- set.to_a.should =~ [a, b, c, d, e, f, g, h]
121
- end
122
-
123
- it "should remove just the named elements if they have no dependencies" do
124
- set.deep_strip!(["c", "h"])
125
-
126
- set.to_a.should =~ [a, b, d, e, f, g]
127
- end
128
-
129
- it "should remove the named elements and all their dependencies" do
130
- set.deep_strip!(["b"])
131
-
132
- set.to_a.should =~ [a, e, f, g, h]
133
- end
134
-
135
- it "should remove an entire tree of dependencies" do
136
- set.deep_strip!(["e"])
137
-
138
- set.to_a.should =~ [a, b, c, d]
139
- end
140
-
141
- it "should allow removing all the elements" do
142
- set.deep_strip!(["a", "e"])
143
-
144
- set.to_a.should =~ []
145
- end
146
- end
147
-
148
- describe "#deep_keep!" do
149
- def man(o)
150
- k, v = o.keys.first, o.values.first
151
- double(k, :name => k, :dependencies => deps(v))
152
- end
153
-
154
- def deps(names)
155
- names.map{|n| double(:name => n)}
156
- end
157
-
158
- let(:a) { man("a" => %w[b c]) }
159
- let(:b) { man("b" => %w[c d]) }
160
- let(:c) { man("c" => %w[ ]) }
161
- let(:d) { man("d" => %w[ ]) }
162
-
163
- let(:e) { man("e" => %w[f g]) }
164
- let(:f) { man("f" => %w[g h]) }
165
- let(:g) { man("g" => %w[ ]) }
166
- let(:h) { man("h" => %w[ ]) }
167
-
168
- let(:set) { described_class.new([a, b, c, d, e, f, g, h]) }
169
-
170
- it "should remove all the elements when given no names" do
171
- set.deep_keep!([])
172
-
173
- set.to_a.should =~ []
174
- end
175
-
176
- it "should keep just the named elements if they have no dependencies" do
177
- set.deep_keep!(["c", "h"])
178
-
179
- set.to_a.should =~ [c, h]
180
- end
181
-
182
- it "should keep the named elements and all their dependencies" do
183
- set.deep_keep!(["b"])
184
-
185
- set.to_a.should =~ [b, c, d]
186
- end
187
-
188
- it "should keep an entire tree of dependencies" do
189
- set.deep_keep!(["e"])
190
-
191
- set.to_a.should =~ [e, f, g, h]
192
- end
193
-
194
- it "should allow keeping all the elements" do
195
- set.deep_keep!(["a", "e"])
196
-
197
- set.to_a.should =~ [a, b, c, d, e, f, g, h]
198
- end
199
- end
200
-
201
- end
202
- end
@@ -1,36 +0,0 @@
1
- require "librarian/manifest"
2
-
3
- describe Librarian::Manifest do
4
-
5
- describe "validations" do
6
-
7
- context "when the name is blank" do
8
- it "raises" do
9
- expect { described_class.new(nil, "") }.
10
- to raise_error(ArgumentError, %{name ("") must be sensible})
11
- end
12
- end
13
-
14
- context "when the name has leading whitespace" do
15
- it "raises" do
16
- expect { described_class.new(nil, " the-name") }.
17
- to raise_error(ArgumentError, %{name (" the-name") must be sensible})
18
- end
19
- end
20
-
21
- context "when the name has trailing whitespace" do
22
- it "raises" do
23
- expect { described_class.new(nil, "the-name ") }.
24
- to raise_error(ArgumentError, %{name ("the-name ") must be sensible})
25
- end
26
- end
27
-
28
- context "when the name is a single character" do
29
- it "passes" do
30
- described_class.new(nil, "R")
31
- end
32
- end
33
-
34
- end
35
-
36
- end
@@ -1,22 +0,0 @@
1
- require "librarian/mock"
2
-
3
- module Librarian
4
- module Mock
5
- module Source
6
- describe Mock do
7
-
8
- let(:env) { Librarian::Mock::Environment.new }
9
-
10
- describe ".new" do
11
-
12
- let(:source) { described_class.new(env, "source-a", {}) }
13
- subject { source }
14
-
15
- its(:environment) { should_not be_nil }
16
-
17
- end
18
-
19
- end
20
- end
21
- end
22
- end
@@ -1,192 +0,0 @@
1
- require 'librarian/resolver'
2
- require 'librarian/spec_change_set'
3
- require 'librarian/mock'
4
-
5
- module Librarian
6
- describe Resolver do
7
-
8
- let(:env) { Mock::Environment.new }
9
- let(:resolver) { env.resolver }
10
-
11
- context "a simple specfile" do
12
-
13
- before do
14
- env.registry :clear => true do
15
- source 'source-1' do
16
- spec 'butter', '1.1'
17
- end
18
- end
19
- end
20
-
21
- let(:spec) do
22
- env.dsl do
23
- src 'source-1'
24
- dep 'butter'
25
- end
26
- end
27
-
28
- let(:resolution) { resolver.resolve(spec) }
29
-
30
- specify { resolution.should be_correct }
31
-
32
- end
33
-
34
- context "a specfile with a dep from one src depending on a dep from another src" do
35
-
36
- before do
37
- env.registry :clear => true do
38
- source 'source-1' do
39
- spec 'butter', '1.1'
40
- end
41
- source 'source-2' do
42
- spec 'jam', '1.2' do
43
- dependency 'butter', '>= 1.0'
44
- end
45
- end
46
- end
47
- end
48
-
49
- let(:spec) do
50
- env.dsl do
51
- src 'source-1'
52
- src 'source-2' do
53
- dep 'jam'
54
- end
55
- end
56
- end
57
-
58
- let(:resolution) { resolver.resolve(spec) }
59
-
60
- specify { resolution.should be_correct }
61
-
62
- end
63
-
64
- context "a specfile with a dep depending on a nonexistent dep" do
65
-
66
- before do
67
- env.registry :clear => true do
68
- source 'source-1' do
69
- spec 'jam', '1.2' do
70
- dependency 'butter', '>= 1.0'
71
- end
72
- end
73
- end
74
- end
75
-
76
- let(:spec) do
77
- env.dsl do
78
- src 'source-1'
79
- dep 'jam'
80
- end
81
- end
82
-
83
- let(:resolution) { resolver.resolve(spec) }
84
-
85
- specify { resolution.should_not be_correct }
86
-
87
- end
88
-
89
- context "a specfile with conflicting constraints" do
90
-
91
- before do
92
- env.registry :clear => true do
93
- source 'source-1' do
94
- spec 'butter', '1.0'
95
- spec 'butter', '1.1'
96
- spec 'jam', '1.2' do
97
- dependency 'butter', '1.1'
98
- end
99
- end
100
- end
101
- end
102
-
103
- let(:spec) do
104
- env.dsl do
105
- src 'source-1'
106
- dep 'butter', '1.0'
107
- dep 'jam'
108
- end
109
- end
110
-
111
- let(:resolution) { resolver.resolve(spec) }
112
-
113
- specify { resolution.should_not be_correct }
114
-
115
- end
116
-
117
- context "updating" do
118
-
119
- it "should not work" do
120
- env.registry :clear => true do
121
- source 'source-1' do
122
- spec 'butter', '1.0'
123
- spec 'butter', '1.1'
124
- spec 'jam', '1.2' do
125
- dependency 'butter'
126
- end
127
- end
128
- end
129
- first_spec = env.dsl do
130
- src 'source-1'
131
- dep 'butter', '1.1'
132
- dep 'jam'
133
- end
134
- first_resolution = resolver.resolve(first_spec)
135
- first_resolution.should be_correct
136
- first_manifests = first_resolution.manifests
137
- first_manifests_index = Hash[first_manifests.map{|m| [m.name, m]}]
138
- first_manifests_index['butter'].version.to_s.should == '1.1'
139
-
140
- second_spec = env.dsl do
141
- src 'source-1'
142
- dep 'butter', '1.0'
143
- dep 'jam'
144
- end
145
- locked_manifests = ManifestSet.deep_strip(first_manifests, ['butter'])
146
- second_resolution =resolver.resolve(second_spec, locked_manifests)
147
- second_resolution.should be_correct
148
- second_manifests = second_resolution.manifests
149
- second_manifests_index = Hash[second_manifests.map{|m| [m.name, m]}]
150
- second_manifests_index['butter'].version.to_s.should == '1.0'
151
- end
152
-
153
- end
154
-
155
- context "a change to the spec" do
156
-
157
- it "should work" do
158
- env.registry :clear => true do
159
- source 'source-1' do
160
- spec 'butter', '1.0'
161
- end
162
- source 'source-2' do
163
- spec 'butter', '1.0'
164
- end
165
- end
166
- spec = env.dsl do
167
- src 'source-1'
168
- dep 'butter'
169
- end
170
- lock = resolver.resolve(spec)
171
- lock.should be_correct
172
-
173
- spec = env.dsl do
174
- src 'source-1'
175
- dep 'butter', :src => 'source-2'
176
- end
177
- changes = SpecChangeSet.new(env, spec, lock)
178
- changes.should_not be_same
179
- manifests = ManifestSet.new(changes.analyze).to_hash
180
- manifests.should_not have_key('butter')
181
- lock = resolver.resolve(spec, changes.analyze)
182
- lock.should be_correct
183
- lock.manifests.map{|m| m.name}.should include('butter')
184
- manifest = lock.manifests.find{|m| m.name == 'butter'}
185
- manifest.should_not be_nil
186
- manifest.source.name.should == 'source-2'
187
- end
188
-
189
- end
190
-
191
- end
192
- end