puppet-ci-testing 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60a555bfc11e077ffc1a8f8f4baee3c22f350e70
4
- data.tar.gz: e65edadaf0ca0b8bb538c196902d6e31b52cfd5d
3
+ metadata.gz: 3d9c843949f048de64d28da8773c54f5ee2adb08
4
+ data.tar.gz: 67afbacdd7801509864a8bd49e46d887de878d94
5
5
  SHA512:
6
- metadata.gz: 52f0cd8ff310dc0fb4de9c64aef6b1da62dee02b90a38fd7ee26bf4815d4391a194a92cdea5fbfd01e9f315a8719969c20c9ce46f432663aeebececa5b9974d5
7
- data.tar.gz: f55079f2a88fc62fed7a01a510bbab6774eb50da39c1241b4306769693c8dfd51d9bf2f506c5220b7c06a80bcee3ed3093af1a7b67ddb11e4d6b42f8ab7d724f
6
+ metadata.gz: 5848da4fc76f141175026427fde9414d46fd261e17dadfeb72fdde42f142a5c07bc0b7aa8f093a017aa0c75e032cfa9e015adba6e6b421d5b6a859c157f54a55
7
+ data.tar.gz: f8fd7b67d8d3aa1f8eb3996c3b1d5da0cac009cbb2cb6d14049a9f32315e75d2888e3bd8a85da4172d1a2cc48ec9cebd346c5140805432b760a7fba2f7fb2248
@@ -58,6 +58,34 @@ EOH
58
58
  opts.on('--git-hook', '-g', 'Execute as a Git pre-commit hook') do
59
59
  options[:git_hook] = true
60
60
  end
61
+
62
+ opts.on('--initialize', '--init', '-I', 'Setup Git pre-commit hook') do
63
+ # insure that we see the .git directory
64
+ unless Dir.exists? '.git'
65
+ puts "Not able to locate Git hooks directory."
66
+ puts "Please rerun the command at the top of the Git directory tree."
67
+ exit 1
68
+ end
69
+
70
+ # insure that the hooks directory exists
71
+ unless Dir.exists? '.git/hooks'
72
+ FileUtils.mkdir '.git/hooks', :mode => 0755
73
+ end
74
+
75
+ # Now create the pre-commit file unless it exists
76
+ if File.exists? '.git/hooks/pre-commit'
77
+ puts "The Git pre-commit hook already exists (.git/hooks/pre-commit)."
78
+ puts "Please remove this file and rerun the command to create the pre-commit hook."
79
+ exit 1
80
+ end
81
+
82
+ open('.git/hooks/pre-commit', 'w') do |fp|
83
+ fp.puts "check_file_syntax --git-hook || (echo "puppet-ci-testing gem is not installed" && exit 1)"
84
+ end
85
+ FileUtils.chmod 0755, '.git/hooks/pre-commit'
86
+ exit 0
87
+ end
88
+
61
89
  end.parse!
62
90
 
63
91
  # check for an optional directory to
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require 'check_file_syntax'
3
3
 
4
- describe 'CheckFileSyntax' do
4
+ describe CheckFileSyntax do
5
5
 
6
6
  { :json => '.json',
7
7
  :yaml => ['.yaml','.yml'],
@@ -67,5 +67,4 @@ describe 'CheckFileSyntax' do
67
67
  end
68
68
  end
69
69
 
70
-
71
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-ci-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerard Hickey
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '1.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: fakefs
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.10.0
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 0.10.0
167
181
  description: ''
168
182
  email: hickey@kinetic-compute.com
169
183
  executables: