puppet-syntax 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ require 'rake'
1
2
  require 'puppet'
2
3
  require 'puppet/face'
3
4
 
@@ -13,14 +13,16 @@ module PuppetSyntax
13
13
 
14
14
  namespace :syntax do
15
15
  desc 'Syntax check Puppet manifests'
16
- task :manifests do
16
+ task :manifests do |t|
17
+ $stderr.puts "---> #{t.name}"
17
18
  c = PuppetSyntax::Manifests.new
18
19
  errors = c.check
19
20
  fail errors.join("\n") unless errors.empty?
20
21
  end
21
22
 
22
23
  desc 'Syntax check Puppet templates'
23
- task :templates do
24
+ task :templates do |t|
25
+ $stderr.puts "---> #{t.name}"
24
26
  c = PuppetSyntax::Templates.new
25
27
  errors = c.check
26
28
  fail errors.join("\n") unless errors.empty?
@@ -1,3 +1,4 @@
1
+ require 'rake'
1
2
  require 'erb'
2
3
  require 'stringio'
3
4
 
@@ -9,7 +10,7 @@ module PuppetSyntax
9
10
  errors = []
10
11
 
11
12
  # Templates don't have to have a .erb extension
12
- matched_files = FileList["*/templates/**/*"].exclude(*PuppetSyntax.exclude_paths)
13
+ matched_files = FileList["**/templates/**/*"].exclude(*PuppetSyntax.exclude_paths)
13
14
  matched_files.reject! { |f| File.directory?(f) }
14
15
  matched_files.each do |erb_file|
15
16
  begin
@@ -1,3 +1,3 @@
1
1
  module PuppetSyntax
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency "rake"
21
22
  spec.add_dependency "puppet", ">= 2.7.0"
22
23
 
23
24
  spec.add_development_dependency "bundler", "~> 1.3"
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe PuppetSyntax::Manifests do
4
+ it 'should return nothing from a valid file' do
5
+ pending
6
+ end
7
+
8
+ it 'should return an error from an invalid file' do
9
+ pending
10
+ end
11
+
12
+ it 'should return a warning from an invalid file' do
13
+ # "Unrecognised escape sequence \[\]"
14
+ pending
15
+ end
16
+
17
+ it 'should ignore warnings about storeconfigs' do
18
+ # @@notify { 'foo': }
19
+ pending
20
+ end
21
+
22
+ it 'should read more than one valid file' do
23
+ pending
24
+ end
25
+
26
+ it 'should continue after finding an error in the first file' do
27
+ pending
28
+ end
29
+ end
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe PuppetSyntax::Templates do
4
+ it 'should return nothing from a valid file' do
5
+ pending
6
+ end
7
+
8
+ it 'should ignore NameErrors from unbound variables' do
9
+ pending
10
+ end
11
+
12
+ it 'should catch StandardError' do
13
+ pending
14
+ end
15
+
16
+ it 'should catch SyntaxError' do
17
+ pending
18
+ end
19
+
20
+ it 'should catch Ruby warnings' do
21
+ # <%= if true -%>
22
+ pending
23
+ end
24
+
25
+ it 'should read more than one valid file' do
26
+ pending
27
+ end
28
+
29
+ it 'should continue after finding an error in the first file' do
30
+ pending
31
+ end
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-syntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-10 00:00:00.000000000 Z
12
+ date: 2013-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: puppet
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +110,8 @@ files:
94
110
  - lib/puppet-syntax/templates.rb
95
111
  - lib/puppet-syntax/version.rb
96
112
  - puppet-syntax.gemspec
113
+ - spec/puppet-syntax/manifests_spec.rb
114
+ - spec/puppet-syntax/templates_spec.rb
97
115
  - spec/puppet-syntax_spec.rb
98
116
  - spec/spec_helper.rb
99
117
  homepage: ''
@@ -111,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
129
  version: '0'
112
130
  segments:
113
131
  - 0
114
- hash: -3818885258485933453
132
+ hash: -906493839268766
115
133
  required_rubygems_version: !ruby/object:Gem::Requirement
116
134
  none: false
117
135
  requirements:
@@ -120,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
138
  version: '0'
121
139
  segments:
122
140
  - 0
123
- hash: -3818885258485933453
141
+ hash: -906493839268766
124
142
  requirements: []
125
143
  rubyforge_project:
126
144
  rubygems_version: 1.8.23
@@ -128,5 +146,7 @@ signing_key:
128
146
  specification_version: 3
129
147
  summary: ''
130
148
  test_files:
149
+ - spec/puppet-syntax/manifests_spec.rb
150
+ - spec/puppet-syntax/templates_spec.rb
131
151
  - spec/puppet-syntax_spec.rb
132
152
  - spec/spec_helper.rb