[DRE-commits] [ruby-puppet-syntax] 01/03: New upstream version 2.2.0
Gaudenz Steinlin
gaudenz at moszumanska.debian.org
Sat Dec 17 14:40:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
gaudenz pushed a commit to branch master
in repository ruby-puppet-syntax.
commit 8e21efb1976645199e7721dced86ff0802b167f3
Author: Gaudenz Steinlin <gaudenz at debian.org>
Date: Sat Dec 17 15:34:08 2016 +0100
New upstream version 2.2.0
---
CHANGELOG | 8 ++
Gemfile | 3 +
lib/puppet-syntax/manifests.rb | 15 ++-
lib/puppet-syntax/tasks/puppet-syntax.rb | 4 +-
lib/puppet-syntax/templates.rb | 4 +-
lib/puppet-syntax/version.rb | 2 +-
metadata.yml | 165 -------------------------------
spec/puppet-syntax/templates_spec.rb | 8 +-
8 files changed, 30 insertions(+), 179 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index fbd059b..e243e84 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,11 @@
+2016-12-02 Release 2.2.0
+- Replace Puppet.initialize_settings with Puppet::Test::TestHelper. Thanks @domcleal #60
+ This clears out caches on every test so increases runtime.
+
+2016-10-21 Release 2.1.1
+- Use `$stderr.puts` rather than `warn` and `info` (thanks @mmckinst)
+- Allow latest 3.x to validate EPP files (thanks @DavidS)
+
2016-01-18 Release 2.1.0
- Support Puppet 4. Many thanks to @DavidS
- Support validation of EPP templates. Thanks to @trlinkin
diff --git a/Gemfile b/Gemfile
index 9f9b3ca..4243d16 100644
--- a/Gemfile
+++ b/Gemfile
@@ -6,3 +6,6 @@ gemspec
# Override gemspec for CI matrix builds.
puppet_version = ENV['PUPPET_VERSION'] || '>2.7.0'
gem 'puppet', puppet_version
+
+# older version required for ruby 1.9 compat, as it is pulled in as dependency of puppet, this has to be carried by the module
+gem 'json_pure', '<= 2.0.1'
diff --git a/lib/puppet-syntax/manifests.rb b/lib/puppet-syntax/manifests.rb
index 243ab7d..821fc05 100644
--- a/lib/puppet-syntax/manifests.rb
+++ b/lib/puppet-syntax/manifests.rb
@@ -4,27 +4,30 @@ module PuppetSyntax
raise "Expected an array of files" unless filelist.is_a?(Array)
require 'puppet'
require 'puppet/face'
+ require 'puppet/test/test_helper'
output = []
- # FIXME: We shouldn't need to do this. puppet/face should. See:
- # - http://projects.puppetlabs.com/issues/15529
- # - https://groups.google.com/forum/#!topic/puppet-dev/Yk0WC1JZCg8/discussion
- if (Puppet::PUPPETVERSION.to_i >= 3 && !Puppet.settings.app_defaults_initialized?)
- Puppet.initialize_settings
+ if Puppet::Test::TestHelper.respond_to?(:initialize) # 3.1+
+ Puppet::Test::TestHelper.initialize
end
+ Puppet::Test::TestHelper.before_all_tests
+ called_before_all_tests = true
# Catch syntax warnings.
Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(output))
Puppet::Util::Log.level = :warning
filelist.each do |puppet_file|
+ Puppet::Test::TestHelper.before_each_test
begin
validate_manifest(puppet_file)
rescue SystemExit
# Disregard exit(1) from face.
rescue => error
output << error
+ ensure
+ Puppet::Test::TestHelper.after_each_test
end
end
@@ -49,6 +52,8 @@ module PuppetSyntax
has_errors = (output != deprecations)
return output, has_errors
+ ensure
+ Puppet::Test::TestHelper.after_all_tests if called_before_all_tests
end
private
diff --git a/lib/puppet-syntax/tasks/puppet-syntax.rb b/lib/puppet-syntax/tasks/puppet-syntax.rb
index 07100e8..4af27a1 100644
--- a/lib/puppet-syntax/tasks/puppet-syntax.rb
+++ b/lib/puppet-syntax/tasks/puppet-syntax.rb
@@ -20,7 +20,7 @@ module PuppetSyntax
}
if psh_present
- warn <<-EOS
+ $stderr.puts <<-EOS
[WARNING] A conflicting :syntax rake task has been defined by
puppetlabs_spec_helper/rake_tasks. You should either disable this or upgrade
to puppetlabs_spec_helper >= 0.8.0 which now uses puppet-syntax.
@@ -31,7 +31,7 @@ to puppetlabs_spec_helper >= 0.8.0 which now uses puppet-syntax.
desc 'Syntax check Puppet manifests'
task :manifests do |t|
if Puppet::PUPPETVERSION.to_i >= 4 and PuppetSyntax.future_parser
- info <<-EOS
+ $stderr.puts <<-EOS
[INFO] Puppet 4 has been detected and `future_parser` has been set to
'true'. The `future_parser setting will be ignored.
EOS
diff --git a/lib/puppet-syntax/templates.rb b/lib/puppet-syntax/templates.rb
index ad9ddc6..25257b4 100644
--- a/lib/puppet-syntax/templates.rb
+++ b/lib/puppet-syntax/templates.rb
@@ -27,8 +27,8 @@ module PuppetSyntax
end
def validate_epp(filename)
- if Puppet::PUPPETVERSION.to_i < 4
- raise "Cannot validate EPP without Puppet 4"
+ if Puppet::PUPPETVERSION.to_f < 3.7
+ raise "Cannot validate EPP without Puppet 4 or future parser (3.7+)"
end
require 'puppet/pops'
diff --git a/lib/puppet-syntax/version.rb b/lib/puppet-syntax/version.rb
index 3c4c051..d3de70c 100644
--- a/lib/puppet-syntax/version.rb
+++ b/lib/puppet-syntax/version.rb
@@ -1,3 +1,3 @@
module PuppetSyntax
- VERSION = "2.1.0"
+ VERSION = "2.2.0"
end
diff --git a/metadata.yml b/metadata.yml
deleted file mode 100644
index 36767aa..0000000
--- a/metadata.yml
+++ /dev/null
@@ -1,165 +0,0 @@
---- !ruby/object:Gem::Specification
-name: puppet-syntax
-version: !ruby/object:Gem::Version
- version: 2.1.0
- prerelease:
-platform: ruby
-authors:
-- Dan Carley
-autorequire:
-bindir: bin
-cert_chain: []
-date: 2016-01-18 00:00:00.000000000 Z
-dependencies:
-- !ruby/object:Gem::Dependency
- name: rake
- requirement: !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
- type: :runtime
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
-- !ruby/object:Gem::Dependency
- name: rspec
- requirement: !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
-- !ruby/object:Gem::Dependency
- name: gem_publisher
- requirement: !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ~>
- - !ruby/object:Gem::Version
- version: '1.3'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ~>
- - !ruby/object:Gem::Version
- version: '1.3'
-description: Syntax checks for Puppet manifests and templates
-email:
-- dan.carley at gmail.com
-executables: []
-extensions: []
-extra_rdoc_files: []
-files:
-- .gitignore
-- .travis.yml
-- CHANGELOG
-- Gemfile
-- LICENSE.txt
-- README.md
-- Rakefile
-- jenkins.sh
-- lib/puppet-syntax.rb
-- lib/puppet-syntax/hiera.rb
-- lib/puppet-syntax/manifests.rb
-- lib/puppet-syntax/tasks/puppet-syntax.rb
-- lib/puppet-syntax/templates.rb
-- lib/puppet-syntax/version.rb
-- puppet-syntax.gemspec
-- spec/fixtures/hiera/hiera_bad.yaml
-- spec/fixtures/hiera/hiera_bad_18.yaml
-- spec/fixtures/hiera/hiera_good.yaml
-- spec/fixtures/test_module/manifests/deprecation_notice.pp
-- spec/fixtures/test_module/manifests/fail_error.pp
-- spec/fixtures/test_module/manifests/fail_warning.pp
-- spec/fixtures/test_module/manifests/future_syntax.pp
-- spec/fixtures/test_module/manifests/pass.pp
-- spec/fixtures/test_module/manifests/pass_storeconfigs.pp
-- spec/fixtures/test_module/manifests/tag_notice.pp
-- spec/fixtures/test_module/templates/fail_error.epp
-- spec/fixtures/test_module/templates/fail_error.erb
-- spec/fixtures/test_module/templates/fail_error_also.epp
-- spec/fixtures/test_module/templates/fail_warning.erb
-- spec/fixtures/test_module/templates/pass.epp
-- spec/fixtures/test_module/templates/pass.erb
-- spec/fixtures/test_module/templates/pass_also.epp
-- spec/fixtures/test_module/templates/pass_unbound_var.erb
-- spec/fixtures/test_module/templates/typeerror_shouldwin.erb
-- spec/puppet-syntax/hiera_spec.rb
-- spec/puppet-syntax/manifests_spec.rb
-- spec/puppet-syntax/tasks/puppet-syntax_spec.rb
-- spec/puppet-syntax/templates_spec.rb
-- spec/puppet-syntax_spec.rb
-- spec/spec_helper.rb
-homepage: https://github.com/gds-operations/puppet-syntax
-licenses:
-- MIT
-post_install_message:
-rdoc_options: []
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
- segments:
- - 0
- hash: 1512611786751491860
-required_rubygems_version: !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
- segments:
- - 0
- hash: 1512611786751491860
-requirements: []
-rubyforge_project:
-rubygems_version: 1.8.23.2
-signing_key:
-specification_version: 3
-summary: Syntax checks for Puppet manifests, templates, and Hiera YAML
-test_files:
-- spec/fixtures/hiera/hiera_bad.yaml
-- spec/fixtures/hiera/hiera_bad_18.yaml
-- spec/fixtures/hiera/hiera_good.yaml
-- spec/fixtures/test_module/manifests/deprecation_notice.pp
-- spec/fixtures/test_module/manifests/fail_error.pp
-- spec/fixtures/test_module/manifests/fail_warning.pp
-- spec/fixtures/test_module/manifests/future_syntax.pp
-- spec/fixtures/test_module/manifests/pass.pp
-- spec/fixtures/test_module/manifests/pass_storeconfigs.pp
-- spec/fixtures/test_module/manifests/tag_notice.pp
-- spec/fixtures/test_module/templates/fail_error.epp
-- spec/fixtures/test_module/templates/fail_error.erb
-- spec/fixtures/test_module/templates/fail_error_also.epp
-- spec/fixtures/test_module/templates/fail_warning.erb
-- spec/fixtures/test_module/templates/pass.epp
-- spec/fixtures/test_module/templates/pass.erb
-- spec/fixtures/test_module/templates/pass_also.epp
-- spec/fixtures/test_module/templates/pass_unbound_var.erb
-- spec/fixtures/test_module/templates/typeerror_shouldwin.erb
-- spec/puppet-syntax/hiera_spec.rb
-- spec/puppet-syntax/manifests_spec.rb
-- spec/puppet-syntax/tasks/puppet-syntax_spec.rb
-- spec/puppet-syntax/templates_spec.rb
-- spec/puppet-syntax_spec.rb
-- spec/spec_helper.rb
diff --git a/spec/puppet-syntax/templates_spec.rb b/spec/puppet-syntax/templates_spec.rb
index 296c828..ade5d60 100644
--- a/spec/puppet-syntax/templates_spec.rb
+++ b/spec/puppet-syntax/templates_spec.rb
@@ -60,8 +60,8 @@ describe PuppetSyntax::Templates do
expect(res).to match([])
end
- if Puppet::PUPPETVERSION.to_i < 4
- context 'on Puppet < 4.0.0' do
+ if Puppet::PUPPETVERSION.to_f < 3.7
+ context 'on Puppet < 3.7' do
it 'should throw an exception when parsing EPP files' do
file = fixture_templates('pass.epp')
expect{ subject.check(file) }.to raise_error(/Cannot validate EPP without Puppet 4/)
@@ -80,8 +80,8 @@ describe PuppetSyntax::Templates do
end
end
- if Puppet::PUPPETVERSION.to_i >= 4
- context 'on Puppet >= 4.0.0' do
+ if Puppet::PUPPETVERSION.to_f >= 3.7
+ context 'on Puppet >= 3.7' do
it 'should return nothing from a valid file' do
files = fixture_templates('pass.epp')
res = subject.check(files)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-puppet-syntax.git
More information about the Pkg-ruby-extras-commits
mailing list