librarian-puppet 0.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/.gitignore +1 -0
  2. data/LICENSE +20 -0
  3. data/README.md +0 -0
  4. data/bin/librarian-puppet +9 -0
  5. data/lib/librarian/puppet.rb +7 -0
  6. data/lib/librarian/puppet/cli.rb +30 -0
  7. data/lib/librarian/puppet/dsl.rb +14 -0
  8. data/lib/librarian/puppet/environment.rb +18 -0
  9. data/lib/librarian/puppet/extension.rb +9 -0
  10. data/lib/librarian/puppet/source.rb +2 -0
  11. data/lib/librarian/puppet/source/git.rb +12 -0
  12. data/lib/librarian/puppet/source/local.rb +46 -0
  13. data/lib/librarian/puppet/source/path.rb +12 -0
  14. data/lib/librarian/puppet/templates/Puppetfile +6 -0
  15. data/librarian-puppet.gemspec +126 -0
  16. data/vendor/librarian/.rspec +1 -0
  17. data/vendor/librarian/.travis.yml +6 -0
  18. data/vendor/librarian/CHANGELOG.md +168 -0
  19. data/vendor/librarian/Gemfile +4 -0
  20. data/vendor/librarian/MIT-LICENSE +20 -0
  21. data/vendor/librarian/README.md +318 -0
  22. data/vendor/librarian/Rakefile +34 -0
  23. data/vendor/librarian/bin/librarian-chef +7 -0
  24. data/vendor/librarian/bin/librarian-mock +7 -0
  25. data/vendor/librarian/config/cucumber.yaml +1 -0
  26. data/vendor/librarian/features/chef/cli/init.feature +10 -0
  27. data/vendor/librarian/features/chef/cli/install.feature +64 -0
  28. data/vendor/librarian/features/chef/cli/show.feature +65 -0
  29. data/vendor/librarian/features/chef/cli/version.feature +11 -0
  30. data/vendor/librarian/features/support/env.rb +9 -0
  31. data/vendor/librarian/lib/librarian.rb +19 -0
  32. data/vendor/librarian/lib/librarian/action.rb +5 -0
  33. data/vendor/librarian/lib/librarian/action/base.rb +22 -0
  34. data/vendor/librarian/lib/librarian/action/clean.rb +44 -0
  35. data/vendor/librarian/lib/librarian/action/ensure.rb +24 -0
  36. data/vendor/librarian/lib/librarian/action/install.rb +95 -0
  37. data/vendor/librarian/lib/librarian/action/resolve.rb +81 -0
  38. data/vendor/librarian/lib/librarian/action/update.rb +78 -0
  39. data/vendor/librarian/lib/librarian/chef.rb +1 -0
  40. data/vendor/librarian/lib/librarian/chef/cli.rb +27 -0
  41. data/vendor/librarian/lib/librarian/chef/dsl.rb +15 -0
  42. data/vendor/librarian/lib/librarian/chef/environment.rb +19 -0
  43. data/vendor/librarian/lib/librarian/chef/extension.rb +9 -0
  44. data/vendor/librarian/lib/librarian/chef/integration/knife.rb +42 -0
  45. data/vendor/librarian/lib/librarian/chef/manifest_reader.rb +47 -0
  46. data/vendor/librarian/lib/librarian/chef/source.rb +3 -0
  47. data/vendor/librarian/lib/librarian/chef/source/git.rb +12 -0
  48. data/vendor/librarian/lib/librarian/chef/source/local.rb +63 -0
  49. data/vendor/librarian/lib/librarian/chef/source/path.rb +12 -0
  50. data/vendor/librarian/lib/librarian/chef/source/site.rb +434 -0
  51. data/vendor/librarian/lib/librarian/chef/templates/Cheffile +15 -0
  52. data/vendor/librarian/lib/librarian/cli.rb +175 -0
  53. data/vendor/librarian/lib/librarian/cli/manifest_presenter.rb +79 -0
  54. data/vendor/librarian/lib/librarian/dependency.rb +95 -0
  55. data/vendor/librarian/lib/librarian/dsl.rb +105 -0
  56. data/vendor/librarian/lib/librarian/dsl/receiver.rb +48 -0
  57. data/vendor/librarian/lib/librarian/dsl/target.rb +176 -0
  58. data/vendor/librarian/lib/librarian/environment.rb +129 -0
  59. data/vendor/librarian/lib/librarian/error.rb +4 -0
  60. data/vendor/librarian/lib/librarian/helpers.rb +13 -0
  61. data/vendor/librarian/lib/librarian/helpers/debug.rb +35 -0
  62. data/vendor/librarian/lib/librarian/lockfile.rb +33 -0
  63. data/vendor/librarian/lib/librarian/lockfile/compiler.rb +70 -0
  64. data/vendor/librarian/lib/librarian/lockfile/parser.rb +104 -0
  65. data/vendor/librarian/lib/librarian/manifest.rb +140 -0
  66. data/vendor/librarian/lib/librarian/manifest_set.rb +153 -0
  67. data/vendor/librarian/lib/librarian/mock.rb +1 -0
  68. data/vendor/librarian/lib/librarian/mock/cli.rb +19 -0
  69. data/vendor/librarian/lib/librarian/mock/dsl.rb +15 -0
  70. data/vendor/librarian/lib/librarian/mock/environment.rb +24 -0
  71. data/vendor/librarian/lib/librarian/mock/extension.rb +9 -0
  72. data/vendor/librarian/lib/librarian/mock/source.rb +1 -0
  73. data/vendor/librarian/lib/librarian/mock/source/mock.rb +97 -0
  74. data/vendor/librarian/lib/librarian/mock/source/mock/registry.rb +83 -0
  75. data/vendor/librarian/lib/librarian/resolution.rb +44 -0
  76. data/vendor/librarian/lib/librarian/resolver.rb +73 -0
  77. data/vendor/librarian/lib/librarian/resolver/implementation.rb +122 -0
  78. data/vendor/librarian/lib/librarian/source.rb +2 -0
  79. data/vendor/librarian/lib/librarian/source/git.rb +150 -0
  80. data/vendor/librarian/lib/librarian/source/git/repository.rb +213 -0
  81. data/vendor/librarian/lib/librarian/source/local.rb +51 -0
  82. data/vendor/librarian/lib/librarian/source/path.rb +74 -0
  83. data/vendor/librarian/lib/librarian/spec.rb +13 -0
  84. data/vendor/librarian/lib/librarian/spec_change_set.rb +170 -0
  85. data/vendor/librarian/lib/librarian/specfile.rb +22 -0
  86. data/vendor/librarian/lib/librarian/support/abstract_method.rb +21 -0
  87. data/vendor/librarian/lib/librarian/ui.rb +64 -0
  88. data/vendor/librarian/lib/librarian/version.rb +3 -0
  89. data/vendor/librarian/librarian.gemspec +33 -0
  90. data/vendor/librarian/spec/functional/chef/source/git_spec.rb +432 -0
  91. data/vendor/librarian/spec/functional/chef/source/site_spec.rb +215 -0
  92. data/vendor/librarian/spec/unit/action/base_spec.rb +18 -0
  93. data/vendor/librarian/spec/unit/action/clean_spec.rb +102 -0
  94. data/vendor/librarian/spec/unit/action/ensure_spec.rb +37 -0
  95. data/vendor/librarian/spec/unit/action/install_spec.rb +111 -0
  96. data/vendor/librarian/spec/unit/dependency_spec.rb +30 -0
  97. data/vendor/librarian/spec/unit/dsl_spec.rb +194 -0
  98. data/vendor/librarian/spec/unit/environment_spec.rb +9 -0
  99. data/vendor/librarian/spec/unit/lockfile/parser_spec.rb +162 -0
  100. data/vendor/librarian/spec/unit/lockfile_spec.rb +65 -0
  101. data/vendor/librarian/spec/unit/manifest_set_spec.rb +202 -0
  102. data/vendor/librarian/spec/unit/manifest_spec.rb +30 -0
  103. data/vendor/librarian/spec/unit/mock/source/mock_spec.rb +22 -0
  104. data/vendor/librarian/spec/unit/resolver_spec.rb +192 -0
  105. data/vendor/librarian/spec/unit/source/git_spec.rb +29 -0
  106. data/vendor/librarian/spec/unit/spec_change_set_spec.rb +169 -0
  107. metadata +163 -0
@@ -0,0 +1,169 @@
1
+ require 'librarian'
2
+ require 'librarian/spec_change_set'
3
+ require 'librarian/mock'
4
+
5
+ module Librarian
6
+ describe SpecChangeSet do
7
+
8
+ let(:env) { Mock::Environment.new }
9
+ let(:resolver) { env.resolver }
10
+
11
+ context "a simple root removal" do
12
+
13
+ it "should work" do
14
+ env.registry :clear => true do
15
+ source 'source-1' do
16
+ spec 'butter', '1.0'
17
+ spec 'jam', '1.0'
18
+ end
19
+ end
20
+ spec = env.dsl do
21
+ src 'source-1'
22
+ dep 'butter'
23
+ dep 'jam'
24
+ end
25
+ lock = resolver.resolve(spec)
26
+ lock.should be_correct
27
+
28
+ spec = env.dsl do
29
+ src 'source-1'
30
+ dep 'jam'
31
+ end
32
+ changes = described_class.new(env, spec, lock)
33
+ changes.should_not be_same
34
+
35
+ manifests = ManifestSet.new(changes.analyze).to_hash
36
+ manifests.should have_key('jam')
37
+ manifests.should_not have_key('butter')
38
+ end
39
+
40
+ end
41
+
42
+ context "a simple root add" do
43
+
44
+ it "should work" do
45
+ env.registry :clear => true do
46
+ source 'source-1' do
47
+ spec 'butter', '1.0'
48
+ spec 'jam', '1.0'
49
+ end
50
+ end
51
+ spec = env.dsl do
52
+ src 'source-1'
53
+ dep 'jam'
54
+ end
55
+ lock = resolver.resolve(spec)
56
+ lock.should be_correct
57
+
58
+ spec = env.dsl do
59
+ src 'source-1'
60
+ dep 'butter'
61
+ dep 'jam'
62
+ end
63
+ changes = described_class.new(env, spec, lock)
64
+ changes.should_not be_same
65
+ manifests = ManifestSet.new(changes.analyze).to_hash
66
+ manifests.should have_key('jam')
67
+ manifests.should_not have_key('butter')
68
+ end
69
+
70
+ end
71
+
72
+ context "a simple root change" do
73
+
74
+ context "when the change is consistent" do
75
+
76
+ it "should work" do
77
+ env.registry :clear => true do
78
+ source 'source-1' do
79
+ spec 'butter', '1.0'
80
+ spec 'jam', '1.0'
81
+ spec 'jam', '1.1'
82
+ end
83
+ end
84
+ spec = env.dsl do
85
+ src 'source-1'
86
+ dep 'butter'
87
+ dep 'jam', '= 1.1'
88
+ end
89
+ lock = resolver.resolve(spec)
90
+ lock.should be_correct
91
+
92
+ spec = env.dsl do
93
+ src 'source-1'
94
+ dep 'butter'
95
+ dep 'jam', '>= 1.0'
96
+ end
97
+ changes = described_class.new(env, spec, lock)
98
+ changes.should_not be_same
99
+ manifests = ManifestSet.new(changes.analyze).to_hash
100
+ manifests.should have_key('butter')
101
+ manifests.should have_key('jam')
102
+ end
103
+
104
+ end
105
+
106
+ context "when the change is inconsistent" do
107
+
108
+ it "should work" do
109
+ env.registry :clear => true do
110
+ source 'source-1' do
111
+ spec 'butter', '1.0'
112
+ spec 'jam', '1.0'
113
+ spec 'jam', '1.1'
114
+ end
115
+ end
116
+ spec = env.dsl do
117
+ src 'source-1'
118
+ dep 'butter'
119
+ dep 'jam', '= 1.0'
120
+ end
121
+ lock = resolver.resolve(spec)
122
+ lock.should be_correct
123
+
124
+ spec = env.dsl do
125
+ src 'source-1'
126
+ dep 'butter'
127
+ dep 'jam', '>= 1.1'
128
+ end
129
+ changes = described_class.new(env, spec, lock)
130
+ changes.should_not be_same
131
+ manifests = ManifestSet.new(changes.analyze).to_hash
132
+ manifests.should have_key('butter')
133
+ manifests.should_not have_key('jam')
134
+ end
135
+
136
+ end
137
+
138
+ end
139
+
140
+ context "a simple root source change" do
141
+ it "should work" do
142
+ env.registry :clear => true do
143
+ source 'source-1' do
144
+ spec 'butter', '1.0'
145
+ end
146
+ source 'source-2' do
147
+ spec 'butter', '1.0'
148
+ end
149
+ end
150
+ spec = env.dsl do
151
+ src 'source-1'
152
+ dep 'butter'
153
+ end
154
+ lock = resolver.resolve(spec)
155
+ lock.should be_correct
156
+
157
+ spec = env.dsl do
158
+ src 'source-1'
159
+ dep 'butter', :src => 'source-2'
160
+ end
161
+ changes = described_class.new(env, spec, lock)
162
+ changes.should_not be_same
163
+ manifests = ManifestSet.new(changes.analyze).to_hash
164
+ manifests.should_not have_key('butter')
165
+ end
166
+ end
167
+
168
+ end
169
+ end
metadata ADDED
@@ -0,0 +1,163 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: librarian-puppet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.pre
5
+ prerelease: 6
6
+ platform: ruby
7
+ authors:
8
+ - Tim Sharpe
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-06-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: &70331391132760 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '0.15'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70331391132760
25
+ description: another placeholder!
26
+ email:
27
+ - tim@sharpe.id.au
28
+ executables:
29
+ - librarian-puppet
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - .gitignore
34
+ - LICENSE
35
+ - README.md
36
+ - bin/librarian-puppet
37
+ - lib/librarian/puppet.rb
38
+ - lib/librarian/puppet/cli.rb
39
+ - lib/librarian/puppet/dsl.rb
40
+ - lib/librarian/puppet/environment.rb
41
+ - lib/librarian/puppet/extension.rb
42
+ - lib/librarian/puppet/source.rb
43
+ - lib/librarian/puppet/source/git.rb
44
+ - lib/librarian/puppet/source/local.rb
45
+ - lib/librarian/puppet/source/path.rb
46
+ - lib/librarian/puppet/templates/Puppetfile
47
+ - librarian-puppet.gemspec
48
+ - vendor/librarian/.rspec
49
+ - vendor/librarian/.travis.yml
50
+ - vendor/librarian/CHANGELOG.md
51
+ - vendor/librarian/Gemfile
52
+ - vendor/librarian/MIT-LICENSE
53
+ - vendor/librarian/README.md
54
+ - vendor/librarian/Rakefile
55
+ - vendor/librarian/bin/librarian-chef
56
+ - vendor/librarian/bin/librarian-mock
57
+ - vendor/librarian/config/cucumber.yaml
58
+ - vendor/librarian/features/chef/cli/init.feature
59
+ - vendor/librarian/features/chef/cli/install.feature
60
+ - vendor/librarian/features/chef/cli/show.feature
61
+ - vendor/librarian/features/chef/cli/version.feature
62
+ - vendor/librarian/features/support/env.rb
63
+ - vendor/librarian/lib/librarian.rb
64
+ - vendor/librarian/lib/librarian/action.rb
65
+ - vendor/librarian/lib/librarian/action/base.rb
66
+ - vendor/librarian/lib/librarian/action/clean.rb
67
+ - vendor/librarian/lib/librarian/action/ensure.rb
68
+ - vendor/librarian/lib/librarian/action/install.rb
69
+ - vendor/librarian/lib/librarian/action/resolve.rb
70
+ - vendor/librarian/lib/librarian/action/update.rb
71
+ - vendor/librarian/lib/librarian/chef.rb
72
+ - vendor/librarian/lib/librarian/chef/cli.rb
73
+ - vendor/librarian/lib/librarian/chef/dsl.rb
74
+ - vendor/librarian/lib/librarian/chef/environment.rb
75
+ - vendor/librarian/lib/librarian/chef/extension.rb
76
+ - vendor/librarian/lib/librarian/chef/integration/knife.rb
77
+ - vendor/librarian/lib/librarian/chef/manifest_reader.rb
78
+ - vendor/librarian/lib/librarian/chef/source.rb
79
+ - vendor/librarian/lib/librarian/chef/source/git.rb
80
+ - vendor/librarian/lib/librarian/chef/source/local.rb
81
+ - vendor/librarian/lib/librarian/chef/source/path.rb
82
+ - vendor/librarian/lib/librarian/chef/source/site.rb
83
+ - vendor/librarian/lib/librarian/chef/templates/Cheffile
84
+ - vendor/librarian/lib/librarian/cli.rb
85
+ - vendor/librarian/lib/librarian/cli/manifest_presenter.rb
86
+ - vendor/librarian/lib/librarian/dependency.rb
87
+ - vendor/librarian/lib/librarian/dsl.rb
88
+ - vendor/librarian/lib/librarian/dsl/receiver.rb
89
+ - vendor/librarian/lib/librarian/dsl/target.rb
90
+ - vendor/librarian/lib/librarian/environment.rb
91
+ - vendor/librarian/lib/librarian/error.rb
92
+ - vendor/librarian/lib/librarian/helpers.rb
93
+ - vendor/librarian/lib/librarian/helpers/debug.rb
94
+ - vendor/librarian/lib/librarian/lockfile.rb
95
+ - vendor/librarian/lib/librarian/lockfile/compiler.rb
96
+ - vendor/librarian/lib/librarian/lockfile/parser.rb
97
+ - vendor/librarian/lib/librarian/manifest.rb
98
+ - vendor/librarian/lib/librarian/manifest_set.rb
99
+ - vendor/librarian/lib/librarian/mock.rb
100
+ - vendor/librarian/lib/librarian/mock/cli.rb
101
+ - vendor/librarian/lib/librarian/mock/dsl.rb
102
+ - vendor/librarian/lib/librarian/mock/environment.rb
103
+ - vendor/librarian/lib/librarian/mock/extension.rb
104
+ - vendor/librarian/lib/librarian/mock/source.rb
105
+ - vendor/librarian/lib/librarian/mock/source/mock.rb
106
+ - vendor/librarian/lib/librarian/mock/source/mock/registry.rb
107
+ - vendor/librarian/lib/librarian/resolution.rb
108
+ - vendor/librarian/lib/librarian/resolver.rb
109
+ - vendor/librarian/lib/librarian/resolver/implementation.rb
110
+ - vendor/librarian/lib/librarian/source.rb
111
+ - vendor/librarian/lib/librarian/source/git.rb
112
+ - vendor/librarian/lib/librarian/source/git/repository.rb
113
+ - vendor/librarian/lib/librarian/source/local.rb
114
+ - vendor/librarian/lib/librarian/source/path.rb
115
+ - vendor/librarian/lib/librarian/spec.rb
116
+ - vendor/librarian/lib/librarian/spec_change_set.rb
117
+ - vendor/librarian/lib/librarian/specfile.rb
118
+ - vendor/librarian/lib/librarian/support/abstract_method.rb
119
+ - vendor/librarian/lib/librarian/ui.rb
120
+ - vendor/librarian/lib/librarian/version.rb
121
+ - vendor/librarian/librarian.gemspec
122
+ - vendor/librarian/spec/functional/chef/source/git_spec.rb
123
+ - vendor/librarian/spec/functional/chef/source/site_spec.rb
124
+ - vendor/librarian/spec/unit/action/base_spec.rb
125
+ - vendor/librarian/spec/unit/action/clean_spec.rb
126
+ - vendor/librarian/spec/unit/action/ensure_spec.rb
127
+ - vendor/librarian/spec/unit/action/install_spec.rb
128
+ - vendor/librarian/spec/unit/dependency_spec.rb
129
+ - vendor/librarian/spec/unit/dsl_spec.rb
130
+ - vendor/librarian/spec/unit/environment_spec.rb
131
+ - vendor/librarian/spec/unit/lockfile/parser_spec.rb
132
+ - vendor/librarian/spec/unit/lockfile_spec.rb
133
+ - vendor/librarian/spec/unit/manifest_set_spec.rb
134
+ - vendor/librarian/spec/unit/manifest_spec.rb
135
+ - vendor/librarian/spec/unit/mock/source/mock_spec.rb
136
+ - vendor/librarian/spec/unit/resolver_spec.rb
137
+ - vendor/librarian/spec/unit/source/git_spec.rb
138
+ - vendor/librarian/spec/unit/spec_change_set_spec.rb
139
+ homepage: https://github.com/rodjek/librarian-puppet
140
+ licenses: []
141
+ post_install_message:
142
+ rdoc_options: []
143
+ require_paths:
144
+ - lib
145
+ required_ruby_version: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ! '>='
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ! '>'
155
+ - !ruby/object:Gem::Version
156
+ version: 1.3.1
157
+ requirements: []
158
+ rubyforge_project:
159
+ rubygems_version: 1.8.11
160
+ signing_key:
161
+ specification_version: 3
162
+ summary: placeholder
163
+ test_files: []