shadow_puppet 0.8.0 → 0.8.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZTU1M2MwNzEwYzNkOTEwM2ViNjBhOWJiZDE2ZmU0NGZhM2I1MTI2NA==
5
- data.tar.gz: !binary |-
6
- OWI3OTE1ZTkzOGQ1MjY4ODRkOGZiYTFiOGRlOWQzNzNlYThiOGJiMg==
2
+ SHA1:
3
+ metadata.gz: 0a863e35bf8a6a7e04f70a41c7083c3afdc2b86b
4
+ data.tar.gz: 8a54957000fb239797e4425eb2391174661ea317
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjQ1NTFhZDQ0YTY4Y2QwZmZmYjg4MWVkZDY0OThlMWYzMGM1OThmODI5Zjky
10
- NjJlN2Y3ZGEyYTE3MjlhZDRiMzVkNTFjZDRmOGNhNGQzNzA4YTMzNGI1NDVk
11
- NWJlY2U0ZTNhNmRhMmMyY2JlMjMxZWE5OWU1MGQ4NDQ4NDViOTE=
12
- data.tar.gz: !binary |-
13
- NmNhNzNjYWI4ZTdmNjhmYTU3YjcyOTY0MmY5YzJmNGFmODgxMjQ3MjMyZTQy
14
- MzlmMzg4MzdlYmU1YzhmZDc3MmQ0NjFmNDI5YTFkMjU2OTA2NWVhMGY2YWE3
15
- YmY0MzJlZjAxZThiMmI5Nzg3NzZmYzA0NjI3YjhiODE4MDI2MTA=
6
+ metadata.gz: 7cd48ab47ac2d5c2d9cffdcd99d0be9de6ab3859215f6ad639e50c5342a77dd312a47e7110072be9da4c745b75c017e987a6a815a92d3d18afc470c05d661cfc
7
+ data.tar.gz: 052647933bdfdab2f176165b6a822828e5f479dce260d5b8c94105b5904f4e3e868ef2ffa09cd947e3e9ebc80a987d7bdc6cb30f6bc7313adf4e17d657e2b09b
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ *.gem
2
+ doc
3
+ tmp
4
+ Gemfile.lock
5
+ .rvmrc
6
+ .ruby-version
7
+ .ruby-gemset
data/.rubocop.yml ADDED
@@ -0,0 +1 @@
1
+ inherit_from: rubocop-todo.yml
@@ -1,16 +1,16 @@
1
- = ShadowPuppet
1
+ # ShadowPuppet
2
2
 
3
3
  ShadowPuppet is a Ruby DSL for Puppet, extracted out of the work we at Rails
4
- Machine are doing on Moonshine[http://blog.railsmachine.com/articles/2009/01/16/moonshine-configuration-management-and-deployment/].
4
+ Machine are doing on [Moonshine](http://blog.railsmachine.com/articles/2009/01/16/moonshine-configuration-management-and-deployment/).
5
5
 
6
6
  ShadowPuppet provides a DSL for creating collections ("manifests") of Puppet
7
7
  Resources in Ruby. For documentation on writing these manifests, please see
8
8
  ShadowPuppet::Manifest.
9
9
 
10
- A binary[http://railsmachine.github.com/shadow_puppet/files/bin/shadow_puppet.html] is provided to parse and execute a
10
+ A [binary](http://railsmachine.github.com/shadow_puppet/files/bin/shadow_puppet.html) is provided to parse and execute a
11
11
  ShadowPuppet::Manifest.
12
12
 
13
- == Running the Test Suite
13
+ ## Running the Test Suite
14
14
 
15
15
  First time:
16
16
 
@@ -26,3 +26,8 @@ Run against all versions of activesupport:
26
26
  Run against a specific one, ie 3.2:
27
27
 
28
28
  $ bundle exec rake appraisal:3.2 spec
29
+
30
+
31
+ ***
32
+
33
+ All content copyright © 2014, [Rails Machine, LLC](http://railsmachine.com)
data/Rakefile CHANGED
@@ -1,96 +1,8 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- Bundler.setup(:default, :development)
4
- require 'appraisal'
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require "rubocop/rake_task"
5
4
 
6
- require 'jeweler'
7
- Jeweler::Tasks.new do |gem|
8
- gem.name = "shadow_puppet"
9
- gem.summary = %Q{A Ruby Puppet DSL}
10
- gem.description = %Q{A Ruby Puppet DSL}
11
- gem.email = "will@railsmachine.com"
12
- gem.homepage = "http://railsmachine.github.com/shadow_puppet"
13
- gem.rubyforge_project = "moonshine"
14
- gem.authors = ["Jesse Newland", "Josh Nichols", "Eric Lindvall", "Lee Jones", "Will Farrington", "dreamcat4", "Patrick Schless", "Ches Martin", "Rob Lingle", "Scott Fleckenstein"]
5
+ RSpec::Core::RakeTask.new
6
+ Rubocop::RakeTask.new
15
7
 
16
- gem.version = "0.8.0"
17
-
18
- gem.rdoc_options << '--inline-source' << '--webcvs=http://github.com/railsmachine/shadow_puppet/tree/master/'
19
-
20
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
21
- end
22
- Jeweler::GemcutterTasks.new
23
-
24
-
25
- require 'rdoc/task'
26
- Rake::RDocTask.new(:rdoc) do |rdoc|
27
- rdoc.rdoc_files.include('lib/shadow_puppet/*.rb')
28
- rdoc.rdoc_files.include('bin/shadow_puppet')
29
- rdoc.rdoc_files.include('README.rdoc')
30
-
31
- rdoc.main = "README.rdoc" # page to start on
32
- rdoc.title = "ShadowPuppet documentation"
33
-
34
- rdoc.rdoc_dir = 'doc' # rdoc output folder
35
- rdoc.options << '--webcvs=http://github.com/railsmachine/shadow_puppet/tree/master/'
36
- end
37
-
38
- require 'rspec/core/rake_task'
39
-
40
- desc 'Default: run specs.'
41
- task :default => :spec
42
-
43
- desc "Run specs"
44
- RSpec::Core::RakeTask.new do |t|
45
- t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
46
- # Put spec opts in a file named .rspec in root
47
- end
48
-
49
- task :build => :cleanup do
50
- system "gem build *.gemspec"
51
- end
52
-
53
- task :install => :build do
54
- system "sudo gem install *.gem"
55
- end
56
-
57
- task :uninstall do
58
- system "sudo gem uninstall *.gem"
59
- end
60
-
61
- task :cleanup do
62
- system "rm *.gem"
63
- end
64
-
65
- task :pull do
66
- system "git pull origin master"
67
- system "git pull github master"
68
- end
69
-
70
- task :_push do
71
- system "git push origin master"
72
- system "git push github master"
73
- end
74
-
75
- task :push => [:redoc, :pull, :spec, :_push]
76
-
77
- task :redoc do
78
- #clean
79
- system "git checkout gh-pages && git pull origin gh-pages && git pull github gh-pages"
80
- system "rm -rf doc"
81
- system "git checkout master"
82
- system "rm -rf doc"
83
-
84
- #doc
85
- Rake::Task['rdoc'].invoke
86
-
87
- #switch branch
88
- system "git checkout gh-pages"
89
-
90
- #move it all to the root
91
- system "cp -r doc/* . && rm -rf doc"
92
-
93
- #commit and push
94
- system "git commit -am 'regenerate rdocs' && git push origin gh-pages && git push github gh-pages"
95
- system "git checkout master"
96
- end
8
+ task :default => [:spec, :rubocop]
data/bin/shadow_puppet CHANGED
@@ -28,6 +28,7 @@
28
28
  #expected to contain a class named Foo that inherits from
29
29
  #ShadowPuppet::Manifest. An instance of this class is created, and the
30
30
  #<tt>execute</tt> method is called. All output is printed to the console.
31
+ require 'bundler'
31
32
 
32
33
  def unindent(string)
33
34
  indentation = string[/\A\s*/]
@@ -36,6 +37,7 @@ end
36
37
 
37
38
  begin
38
39
  require 'optparse'
40
+ require 'shadow_puppet/version'
39
41
 
40
42
  ShadowPuppetOptions = Struct.new(:graph, :noop, :ignore)
41
43
  options = ShadowPuppetOptions.new
@@ -45,6 +47,7 @@ begin
45
47
 
46
48
  opts.separator ""
47
49
  opts.separator "Specific options:"
50
+ opts.version = ShadowPuppet::VERSION
48
51
 
49
52
  opts.on("--tutorial", "A simple tutorial for usage") do
50
53
  puts unindent(<<-EOF)
@@ -112,8 +112,8 @@ module ShadowPuppet
112
112
  # calls to recipe.
113
113
  def self.recipe(*methods)
114
114
  return nil if methods.nil? || methods == [] # TODO can probably replace with if methods.blank?
115
- options = methods.extract_options!
116
115
  methods.each do |meth|
116
+ options = methods.extract_options!
117
117
  options = configuration[meth.to_sym] if options == {} # TODO can probably be replaced with options.blank?
118
118
  options ||= {}
119
119
  recipes << [meth.to_sym, options]
@@ -0,0 +1,3 @@
1
+ module ShadowPuppet
2
+ VERSION = "0.8.1.beta1"
3
+ end
data/lib/shadow_puppet.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'shadow_puppet/core_ext'
2
+ require 'shadow_puppet/version'
2
3
 
3
4
  # Silence puppet's dependencies warnings like:
4
5
  # racc/parser.rb:27: warning: already initialized constant Racc_Runtime_Version
data/rubocop-todo.yml ADDED
@@ -0,0 +1,275 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2014-04-30 16:54:22 -0400 using RuboCop version 0.21.0.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # Offense count: 2
9
+ # Cop supports --auto-correct.
10
+ Alias:
11
+ Enabled: false
12
+
13
+ # Offense count: 12
14
+ # Cop supports --auto-correct.
15
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
16
+ AlignParameters:
17
+ Enabled: false
18
+
19
+ # Offense count: 1
20
+ AmbiguousOperator:
21
+ Enabled: false
22
+
23
+ # Offense count: 3
24
+ # Cop supports --auto-correct.
25
+ AndOr:
26
+ Enabled: false
27
+
28
+ # Offense count: 2
29
+ # Configuration parameters: AllowSafeAssignment.
30
+ AssignmentInCondition:
31
+ Enabled: false
32
+
33
+ # Offense count: 1
34
+ BlockAlignment:
35
+ Enabled: false
36
+
37
+ # Offense count: 3
38
+ # Cop supports --auto-correct.
39
+ Blocks:
40
+ Enabled: false
41
+
42
+ # Offense count: 9
43
+ # Cop supports --auto-correct.
44
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
45
+ BracesAroundHashParameters:
46
+ Enabled: false
47
+
48
+ # Offense count: 1
49
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
50
+ ClassAndModuleChildren:
51
+ Enabled: false
52
+
53
+ # Offense count: 1
54
+ # Configuration parameters: CountComments.
55
+ ClassLength:
56
+ Max: 162
57
+
58
+ # Offense count: 4
59
+ # Cop supports --auto-correct.
60
+ # Configuration parameters: PreferredMethods.
61
+ CollectionMethods:
62
+ Enabled: false
63
+
64
+ # Offense count: 2
65
+ # Configuration parameters: Keywords.
66
+ CommentAnnotation:
67
+ Enabled: false
68
+
69
+ # Offense count: 1
70
+ # Cop supports --auto-correct.
71
+ DefWithParentheses:
72
+ Enabled: false
73
+
74
+ # Offense count: 18
75
+ Documentation:
76
+ Enabled: false
77
+
78
+ # Offense count: 1
79
+ # Cop supports --auto-correct.
80
+ EmptyLines:
81
+ Enabled: false
82
+
83
+ # Offense count: 1
84
+ EmptyLinesAroundAccessModifier:
85
+ Enabled: false
86
+
87
+ # Offense count: 7
88
+ # Cop supports --auto-correct.
89
+ EmptyLinesAroundBody:
90
+ Enabled: false
91
+
92
+ # Offense count: 1
93
+ # Cop supports --auto-correct.
94
+ EmptyLiteral:
95
+ Enabled: false
96
+
97
+ # Offense count: 88
98
+ # Cop supports --auto-correct.
99
+ # Configuration parameters: SupportedStyles.
100
+ HashSyntax:
101
+ EnforcedStyle: hash_rockets
102
+
103
+ # Offense count: 1
104
+ # Configuration parameters: MaxLineLength.
105
+ IfUnlessModifier:
106
+ Enabled: false
107
+
108
+ # Offense count: 1
109
+ # Cop supports --auto-correct.
110
+ # Configuration parameters: SupportedStyles.
111
+ IndentHash:
112
+ EnforcedStyle: consistent
113
+
114
+ # Offense count: 4
115
+ # Cop supports --auto-correct.
116
+ IndentationConsistency:
117
+ Enabled: false
118
+
119
+ # Offense count: 1
120
+ # Cop supports --auto-correct.
121
+ IndentationWidth:
122
+ Enabled: false
123
+
124
+ # Offense count: 17
125
+ # Cop supports --auto-correct.
126
+ LeadingCommentSpace:
127
+ Enabled: false
128
+
129
+ # Offense count: 73
130
+ LineLength:
131
+ Max: 134
132
+
133
+ # Offense count: 1
134
+ # Cop supports --auto-correct.
135
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
136
+ MethodDefParentheses:
137
+ Enabled: false
138
+
139
+ # Offense count: 7
140
+ # Configuration parameters: CountComments.
141
+ MethodLength:
142
+ Max: 18
143
+
144
+ # Offense count: 2
145
+ # Cop supports --auto-correct.
146
+ Not:
147
+ Enabled: false
148
+
149
+ # Offense count: 2
150
+ # Cop supports --auto-correct.
151
+ # Configuration parameters: PreferredDelimiters.
152
+ PercentLiteralDelimiters:
153
+ Enabled: false
154
+
155
+ # Offense count: 2
156
+ # Cop supports --auto-correct.
157
+ PerlBackrefs:
158
+ Enabled: false
159
+
160
+ # Offense count: 3
161
+ # Cop supports --auto-correct.
162
+ RedundantSelf:
163
+ Enabled: false
164
+
165
+ # Offense count: 2
166
+ # Configuration parameters: MaxSlashes.
167
+ RegexpLiteral:
168
+ Enabled: false
169
+
170
+ # Offense count: 3
171
+ # Cop supports --auto-correct.
172
+ RescueException:
173
+ Enabled: false
174
+
175
+ # Offense count: 3
176
+ RescueModifier:
177
+ Enabled: false
178
+
179
+ # Offense count: 1
180
+ # Cop supports --auto-correct.
181
+ # Configuration parameters: AllowAsExpressionSeparator.
182
+ Semicolon:
183
+ Enabled: false
184
+
185
+ # Offense count: 1
186
+ ShadowingOuterLocalVariable:
187
+ Enabled: false
188
+
189
+ # Offense count: 6
190
+ # Cop supports --auto-correct.
191
+ SpaceAfterComma:
192
+ Enabled: false
193
+
194
+ # Offense count: 2
195
+ # Cop supports --auto-correct.
196
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
197
+ SpaceAroundEqualsInParameterDefault:
198
+ Enabled: false
199
+
200
+ # Offense count: 2
201
+ # Cop supports --auto-correct.
202
+ SpaceAroundOperators:
203
+ Enabled: false
204
+
205
+ # Offense count: 4
206
+ # Cop supports --auto-correct.
207
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
208
+ SpaceBeforeBlockBraces:
209
+ Enabled: false
210
+
211
+ # Offense count: 4
212
+ # Cop supports --auto-correct.
213
+ # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
214
+ SpaceInsideBlockBraces:
215
+ Enabled: true
216
+
217
+ # Offense count: 2
218
+ # Cop supports --auto-correct.
219
+ SpaceInsideBrackets:
220
+ Enabled: false
221
+
222
+ # Offense count: 18
223
+ # Cop supports --auto-correct.
224
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
225
+ SpaceInsideHashLiteralBraces:
226
+ Enabled: false
227
+
228
+ # Offense count: 1
229
+ # Cop supports --auto-correct.
230
+ SpecialGlobalVars:
231
+ Enabled: false
232
+
233
+ # Offense count: 138
234
+ # Cop supports --auto-correct.
235
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
236
+ StringLiterals:
237
+ Enabled: false
238
+
239
+ # Offense count: 3
240
+ # Cop supports --auto-correct.
241
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
242
+ TrailingBlankLines:
243
+ Enabled: false
244
+
245
+ # Offense count: 10
246
+ # Cop supports --auto-correct.
247
+ TrailingWhitespace:
248
+ Enabled: false
249
+
250
+ # Offense count: 1
251
+ # Cop supports --auto-correct.
252
+ # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
253
+ TrivialAccessors:
254
+ Enabled: false
255
+
256
+ # Offense count: 4
257
+ UnusedBlockArgument:
258
+ Enabled: false
259
+
260
+ # Offense count: 4
261
+ UnusedMethodArgument:
262
+ Enabled: false
263
+
264
+ # Offense count: 3
265
+ UselessAssignment:
266
+ Enabled: false
267
+
268
+ # Offense count: 13
269
+ Void:
270
+ Enabled: false
271
+
272
+ # Offense count: 1
273
+ # Cop supports --auto-correct.
274
+ WordArray:
275
+ MinSize: 2
@@ -1,115 +1,30 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'shadow_puppet/version'
5
5
 
6
- Gem::Specification.new do |s|
7
- s.name = "shadow_puppet"
8
- s.version = "0.8.0"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "shadow_puppet"
8
+ spec.version = ShadowPuppet::VERSION
9
+ spec.authors = ["Jesse Newland", "Josh Nichols", "Eric Lindvall", "Lee Jones", "Will Farrington", "dreamcat4", "Patrick Schless", "Ches Martin", "Rob Lingle", "Scott Fleckenstein", "Bryan Traywick"]
10
+ spec.email = ["bryan@railsmachine.com"]
11
+ spec.description = %q{A Ruby Puppet DSL}
12
+ spec.summary = %q{A Ruby Puppet DSL}
13
+ spec.homepage = "https://github.com/railsmachine/shadow_puppet/"
14
+ spec.license = "LGPL"
9
15
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Jesse Newland", "Josh Nichols", "Eric Lindvall", "Lee Jones", "Will Farrington", "dreamcat4", "Patrick Schless", "Ches Martin", "Rob Lingle", "Scott Fleckenstein"]
12
- s.date = "2014-04-18"
13
- s.description = "A Ruby Puppet DSL"
14
- s.email = "will@railsmachine.com"
15
- s.executables = ["shadow_puppet"]
16
- s.extra_rdoc_files = [
17
- "LICENSE",
18
- "README.rdoc"
19
- ]
20
- s.files = [
21
- ".gitmodules",
22
- ".rspec",
23
- ".travis.yml",
24
- "Appraisals",
25
- "Gemfile",
26
- "LICENSE",
27
- "README.rdoc",
28
- "Rakefile",
29
- "bin/shadow_puppet",
30
- "examples/foo.rb",
31
- "gemfiles/2.1.gemfile.lock",
32
- "gemfiles/2.2.gemfile",
33
- "gemfiles/2.2.gemfile.lock",
34
- "gemfiles/2.3.11.gemfile.lock",
35
- "gemfiles/2.3.gemfile",
36
- "gemfiles/2.3.gemfile.lock",
37
- "gemfiles/3.0.gemfile",
38
- "gemfiles/3.0.gemfile.lock",
39
- "gemfiles/3.1.gemfile",
40
- "gemfiles/3.1.gemfile.lock",
41
- "gemfiles/3.2.gemfile",
42
- "gemfiles/3.2.gemfile.lock",
43
- "lib/shadow_puppet.rb",
44
- "lib/shadow_puppet/core_ext.rb",
45
- "lib/shadow_puppet/manifest.rb",
46
- "lib/shadow_puppet/test.rb",
47
- "shadow_puppet.gemspec",
48
- "spec/cli_spec.rb",
49
- "spec/core_ext_spec.rb",
50
- "spec/fixtures/cli_spec_manifest.rb",
51
- "spec/fixtures/manifests.rb",
52
- "spec/manifest_spec.rb",
53
- "spec/spec_helper.rb",
54
- "spec/test_spec.rb",
55
- "spec/type_spec.rb"
56
- ]
57
- s.homepage = "http://railsmachine.github.com/shadow_puppet"
58
- s.rdoc_options = ["--inline-source", "--webcvs=http://github.com/railsmachine/shadow_puppet/tree/master/"]
59
- s.require_paths = ["lib"]
60
- s.rubyforge_project = "moonshine"
61
- s.rubygems_version = "1.8.15"
62
- s.summary = "A Ruby Puppet DSL"
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
63
20
 
64
- if s.respond_to? :specification_version then
65
- s.specification_version = 3
21
+ spec.add_runtime_dependency "puppet", "~> 3.5.1"
22
+ spec.add_runtime_dependency "facter", ["< 2", "> 1.6"]
23
+ spec.add_runtime_dependency "activesupport", ">= 2.2.0"
66
24
 
67
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
68
- s.add_runtime_dependency(%q<puppet>, ["~> 3.5.1"])
69
- s.add_runtime_dependency(%q<facter>, ["< 2", "> 1.6"])
70
- s.add_runtime_dependency(%q<highline>, [">= 1.5.0"])
71
- s.add_runtime_dependency(%q<builder>, [">= 2.1.2"])
72
- s.add_runtime_dependency(%q<activesupport>, [">= 2.2.0"])
73
- s.add_runtime_dependency(%q<i18n>, [">= 0.5.0"])
74
- s.add_development_dependency(%q<rake>, [">= 0"])
75
- s.add_development_dependency(%q<appraisal>, [">= 0"])
76
- s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
77
- s.add_development_dependency(%q<rspec-core>, ["~> 2.8.0"])
78
- s.add_development_dependency(%q<test-unit>, [">= 0"])
79
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
80
- s.add_development_dependency(%q<rdoc>, [">= 0"])
81
- s.add_development_dependency(%q<pry>, [">= 0"])
82
- else
83
- s.add_dependency(%q<puppet>, ["~> 3.5.1"])
84
- s.add_dependency(%q<facter>, ["< 2", "> 1.6"])
85
- s.add_dependency(%q<highline>, [">= 1.5.0"])
86
- s.add_dependency(%q<builder>, [">= 2.1.2"])
87
- s.add_dependency(%q<activesupport>, [">= 2.2.0"])
88
- s.add_dependency(%q<i18n>, [">= 0.5.0"])
89
- s.add_dependency(%q<rake>, [">= 0"])
90
- s.add_dependency(%q<appraisal>, [">= 0"])
91
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
92
- s.add_dependency(%q<rspec-core>, ["~> 2.8.0"])
93
- s.add_dependency(%q<test-unit>, [">= 0"])
94
- s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
95
- s.add_dependency(%q<rdoc>, [">= 0"])
96
- s.add_dependency(%q<pry>, [">= 0"])
97
- end
98
- else
99
- s.add_dependency(%q<puppet>, ["~> 3.5.1"])
100
- s.add_dependency(%q<facter>, ["< 2", "> 1.6"])
101
- s.add_dependency(%q<highline>, [">= 1.5.0"])
102
- s.add_dependency(%q<builder>, [">= 2.1.2"])
103
- s.add_dependency(%q<activesupport>, [">= 2.2.0"])
104
- s.add_dependency(%q<i18n>, [">= 0.5.0"])
105
- s.add_dependency(%q<rake>, [">= 0"])
106
- s.add_dependency(%q<appraisal>, [">= 0"])
107
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
108
- s.add_dependency(%q<rspec-core>, ["~> 2.8.0"])
109
- s.add_dependency(%q<test-unit>, [">= 0"])
110
- s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
111
- s.add_dependency(%q<rdoc>, [">= 0"])
112
- s.add_dependency(%q<pry>, [">= 0"])
113
- end
25
+ spec.add_development_dependency "bundler", "~> 1.3"
26
+ spec.add_development_dependency "rake"
27
+ spec.add_development_dependency "rspec", "~> 2.8.0"
28
+ spec.add_development_dependency "rspec-core", "~> 2.8.0"
29
+ spec.add_development_dependency "rubocop"
114
30
  end
115
-
@@ -58,7 +58,7 @@ class RequiresMetViaRecipeFromClassOfInstance < ShadowPuppet::Manifest
58
58
  def bar
59
59
  # other recipe stuff
60
60
  end
61
-
61
+
62
62
  def foo
63
63
  recipe :bar
64
64
  end
@@ -184,7 +184,7 @@ class CwdCoercionTest < ShadowPuppet::Manifest
184
184
  tmp = Pathname.new('/tmp')
185
185
  exec 'true',
186
186
  :cwd => tmp
187
- file tmp + '/foo',
187
+ file tmp.join('foo'),
188
188
  :ensure => :present
189
189
  end
190
190
  recipe :test
@@ -202,3 +202,19 @@ class DuplicateResourceTest < ShadowPuppet::Manifest
202
202
  :logoutput => true
203
203
  end
204
204
  end
205
+
206
+ class MultipleRecipeConfigurationTest < ShadowPuppet::Manifest
207
+ configure({
208
+ :foo => {:man => 'chu'},
209
+ :bar => {:food => 'yummy'}
210
+ })
211
+ recipe :foo, :bar
212
+
213
+ def foo(options = {})
214
+ exec 'foo', :command => 'true'
215
+ end
216
+
217
+ def bar(options = {})
218
+ exec 'bar', :command => 'true'
219
+ end
220
+ end
@@ -161,8 +161,8 @@ describe "A manifest" do
161
161
  describe "when executed" do
162
162
 
163
163
  it "calls evaluate_recipes and apply" do
164
- @manifest.should_receive(:evaluate_recipes)
165
- @manifest.should_receive(:apply)
164
+ @manifest.should_receive(:evaluate_recipes, &@manifest.method(:evaluate_recipes))
165
+ @manifest.should_receive(:apply, &@manifest.method(:apply))
166
166
  @manifest.execute
167
167
  end
168
168
 
@@ -321,4 +321,20 @@ describe "A manifest" do
321
321
  @manifest.execute!
322
322
  end
323
323
  end
324
+
325
+ describe "when configure is used to configure multiple recipes" do
326
+ before(:each) do
327
+ @manifest = MultipleRecipeConfigurationTest.new
328
+ end
329
+
330
+ it "passes the appropriate options to each recipe" do
331
+ @manifest.should_receive(:foo).with({'man' => 'chu'})
332
+ @manifest.should_receive(:bar).with({'food' => 'yummy'})
333
+ @manifest.send(:evaluate_recipes)
334
+ end
335
+
336
+ it "returns true when executed" do
337
+ @manifest.execute!.should be_true
338
+ end
339
+ end
324
340
  end
data/spec/test_spec.rb CHANGED
@@ -1,21 +1,21 @@
1
1
  describe "ShadowPuppet's test helpers" do
2
2
 
3
3
  it "should be created when register_puppet_types_for_testing is called" do
4
- Puppet::Type.newtype(:dummy){ }
5
- Puppet::Type.type(:dummy).provide(:generic){ }
6
-
4
+ Puppet::Type.newtype(:dummy) {}
5
+ Puppet::Type.type(:dummy).provide(:generic) {}
6
+
7
7
  BlankManifest.new.respond_to?(:dummies).should == false
8
8
  ShadowPuppet::Manifest.register_puppet_types_for_testing
9
9
  BlankManifest.new.respond_to?(:dummies).should == true
10
10
  end
11
-
11
+
12
12
  describe "when used in tests" do
13
13
 
14
14
  before do
15
15
  @manifest = TestHelpers.new
16
16
  @manifest.foo
17
17
  end
18
-
18
+
19
19
  it "should allow simple resource lookup" do
20
20
  @manifest.execs.keys.should == ['foo']
21
21
  @manifest.packages.keys.should == ['bar']
@@ -23,8 +23,8 @@ describe "ShadowPuppet's test helpers" do
23
23
  @manifest.crons.keys.should == []
24
24
  end
25
25
 
26
- # making sure that properties such as, e.g the :onlyif condition of Exec[foo]
27
- # can be accessed simply as manifest.execs['foo'].onlyif rather than via the
26
+ # making sure that properties such as, e.g the :onlyif condition of Exec[foo]
27
+ # can be accessed simply as manifest.execs['foo'].onlyif rather than via the
28
28
  # param hash
29
29
  it "should allow referencing params directly" do
30
30
  @manifest.execs['foo'].command.should == 'true'
data/spec/type_spec.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  describe "ShadowPuppet's type loading mechanism" do
2
2
  it "should create a new type helper methods when register_puppet_types is called" do
3
- Puppet::Type.newtype(:dummy_1){ }
4
- Puppet::Type.type(:dummy_1).provide(:generic){ }
5
-
3
+ Puppet::Type.newtype(:dummy_1) {}
4
+ Puppet::Type.type(:dummy_1).provide(:generic) {}
5
+
6
6
  BlankManifest.new.respond_to?(:dummy_1).should == false
7
7
  ShadowPuppet::Manifest.register_puppet_types
8
8
  BlankManifest.new.respond_to?(:dummy_1).should == true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shadow_puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Newland
@@ -14,10 +14,11 @@ authors:
14
14
  - Ches Martin
15
15
  - Rob Lingle
16
16
  - Scott Fleckenstein
17
+ - Bryan Traywick
17
18
  autorequire:
18
19
  bindir: bin
19
20
  cert_chain: []
20
- date: 2014-04-18 00:00:00.000000000 Z
21
+ date: 2014-04-30 00:00:00.000000000 Z
21
22
  dependencies:
22
23
  - !ruby/object:Gem::Dependency
23
24
  name: puppet
@@ -40,7 +41,7 @@ dependencies:
40
41
  - - <
41
42
  - !ruby/object:Gem::Version
42
43
  version: '2'
43
- - - ! '>'
44
+ - - '>'
44
45
  - !ruby/object:Gem::Version
45
46
  version: '1.6'
46
47
  type: :runtime
@@ -50,91 +51,49 @@ dependencies:
50
51
  - - <
51
52
  - !ruby/object:Gem::Version
52
53
  version: '2'
53
- - - ! '>'
54
+ - - '>'
54
55
  - !ruby/object:Gem::Version
55
56
  version: '1.6'
56
- - !ruby/object:Gem::Dependency
57
- name: highline
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: 1.5.0
63
- type: :runtime
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: 1.5.0
70
- - !ruby/object:Gem::Dependency
71
- name: builder
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: 2.1.2
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ! '>='
82
- - !ruby/object:Gem::Version
83
- version: 2.1.2
84
57
  - !ruby/object:Gem::Dependency
85
58
  name: activesupport
86
59
  requirement: !ruby/object:Gem::Requirement
87
60
  requirements:
88
- - - ! '>='
61
+ - - '>='
89
62
  - !ruby/object:Gem::Version
90
63
  version: 2.2.0
91
64
  type: :runtime
92
65
  prerelease: false
93
66
  version_requirements: !ruby/object:Gem::Requirement
94
67
  requirements:
95
- - - ! '>='
68
+ - - '>='
96
69
  - !ruby/object:Gem::Version
97
70
  version: 2.2.0
98
71
  - !ruby/object:Gem::Dependency
99
- name: i18n
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ! '>='
103
- - !ruby/object:Gem::Version
104
- version: 0.5.0
105
- type: :runtime
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ! '>='
110
- - !ruby/object:Gem::Version
111
- version: 0.5.0
112
- - !ruby/object:Gem::Dependency
113
- name: rake
72
+ name: bundler
114
73
  requirement: !ruby/object:Gem::Requirement
115
74
  requirements:
116
- - - ! '>='
75
+ - - ~>
117
76
  - !ruby/object:Gem::Version
118
- version: '0'
77
+ version: '1.3'
119
78
  type: :development
120
79
  prerelease: false
121
80
  version_requirements: !ruby/object:Gem::Requirement
122
81
  requirements:
123
- - - ! '>='
82
+ - - ~>
124
83
  - !ruby/object:Gem::Version
125
- version: '0'
84
+ version: '1.3'
126
85
  - !ruby/object:Gem::Dependency
127
- name: appraisal
86
+ name: rake
128
87
  requirement: !ruby/object:Gem::Requirement
129
88
  requirements:
130
- - - ! '>='
89
+ - - '>='
131
90
  - !ruby/object:Gem::Version
132
91
  version: '0'
133
92
  type: :development
134
93
  prerelease: false
135
94
  version_requirements: !ruby/object:Gem::Requirement
136
95
  requirements:
137
- - - ! '>='
96
+ - - '>='
138
97
  - !ruby/object:Gem::Version
139
98
  version: '0'
140
99
  - !ruby/object:Gem::Dependency
@@ -166,77 +125,36 @@ dependencies:
166
125
  - !ruby/object:Gem::Version
167
126
  version: 2.8.0
168
127
  - !ruby/object:Gem::Dependency
169
- name: test-unit
170
- requirement: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - ! '>='
173
- - !ruby/object:Gem::Version
174
- version: '0'
175
- type: :development
176
- prerelease: false
177
- version_requirements: !ruby/object:Gem::Requirement
178
- requirements:
179
- - - ! '>='
180
- - !ruby/object:Gem::Version
181
- version: '0'
182
- - !ruby/object:Gem::Dependency
183
- name: jeweler
184
- requirement: !ruby/object:Gem::Requirement
185
- requirements:
186
- - - ~>
187
- - !ruby/object:Gem::Version
188
- version: 1.6.2
189
- type: :development
190
- prerelease: false
191
- version_requirements: !ruby/object:Gem::Requirement
192
- requirements:
193
- - - ~>
194
- - !ruby/object:Gem::Version
195
- version: 1.6.2
196
- - !ruby/object:Gem::Dependency
197
- name: rdoc
198
- requirement: !ruby/object:Gem::Requirement
199
- requirements:
200
- - - ! '>='
201
- - !ruby/object:Gem::Version
202
- version: '0'
203
- type: :development
204
- prerelease: false
205
- version_requirements: !ruby/object:Gem::Requirement
206
- requirements:
207
- - - ! '>='
208
- - !ruby/object:Gem::Version
209
- version: '0'
210
- - !ruby/object:Gem::Dependency
211
- name: pry
128
+ name: rubocop
212
129
  requirement: !ruby/object:Gem::Requirement
213
130
  requirements:
214
- - - ! '>='
131
+ - - '>='
215
132
  - !ruby/object:Gem::Version
216
133
  version: '0'
217
134
  type: :development
218
135
  prerelease: false
219
136
  version_requirements: !ruby/object:Gem::Requirement
220
137
  requirements:
221
- - - ! '>='
138
+ - - '>='
222
139
  - !ruby/object:Gem::Version
223
140
  version: '0'
224
141
  description: A Ruby Puppet DSL
225
- email: will@railsmachine.com
142
+ email:
143
+ - bryan@railsmachine.com
226
144
  executables:
227
145
  - shadow_puppet
228
146
  extensions: []
229
- extra_rdoc_files:
230
- - LICENSE
231
- - README.rdoc
147
+ extra_rdoc_files: []
232
148
  files:
149
+ - .gitignore
233
150
  - .gitmodules
234
151
  - .rspec
152
+ - .rubocop.yml
235
153
  - .travis.yml
236
154
  - Appraisals
237
155
  - Gemfile
238
156
  - LICENSE
239
- - README.rdoc
157
+ - README.md
240
158
  - Rakefile
241
159
  - bin/shadow_puppet
242
160
  - examples/foo.rb
@@ -256,6 +174,8 @@ files:
256
174
  - lib/shadow_puppet/core_ext.rb
257
175
  - lib/shadow_puppet/manifest.rb
258
176
  - lib/shadow_puppet/test.rb
177
+ - lib/shadow_puppet/version.rb
178
+ - rubocop-todo.yml
259
179
  - shadow_puppet.gemspec
260
180
  - spec/cli_spec.rb
261
181
  - spec/core_ext_spec.rb
@@ -265,29 +185,36 @@ files:
265
185
  - spec/spec_helper.rb
266
186
  - spec/test_spec.rb
267
187
  - spec/type_spec.rb
268
- homepage: http://railsmachine.github.com/shadow_puppet
269
- licenses: []
188
+ homepage: https://github.com/railsmachine/shadow_puppet/
189
+ licenses:
190
+ - LGPL
270
191
  metadata: {}
271
192
  post_install_message:
272
- rdoc_options:
273
- - --inline-source
274
- - --webcvs=http://github.com/railsmachine/shadow_puppet/tree/master/
193
+ rdoc_options: []
275
194
  require_paths:
276
195
  - lib
277
196
  required_ruby_version: !ruby/object:Gem::Requirement
278
197
  requirements:
279
- - - ! '>='
198
+ - - '>='
280
199
  - !ruby/object:Gem::Version
281
200
  version: '0'
282
201
  required_rubygems_version: !ruby/object:Gem::Requirement
283
202
  requirements:
284
- - - ! '>='
203
+ - - '>'
285
204
  - !ruby/object:Gem::Version
286
- version: '0'
205
+ version: 1.3.1
287
206
  requirements: []
288
- rubyforge_project: moonshine
207
+ rubyforge_project:
289
208
  rubygems_version: 2.2.2
290
209
  signing_key:
291
- specification_version: 3
210
+ specification_version: 4
292
211
  summary: A Ruby Puppet DSL
293
- test_files: []
212
+ test_files:
213
+ - spec/cli_spec.rb
214
+ - spec/core_ext_spec.rb
215
+ - spec/fixtures/cli_spec_manifest.rb
216
+ - spec/fixtures/manifests.rb
217
+ - spec/manifest_spec.rb
218
+ - spec/spec_helper.rb
219
+ - spec/test_spec.rb
220
+ - spec/type_spec.rb