puppet-lint-template_file_extension-check 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c386f651f5d324b4ef4ee45599cca5e7d12349fe
4
- data.tar.gz: 6f3677dfabf9e6a8dd418c8ccba30bafc4791a92
3
+ metadata.gz: ed1fc7b6dbe9b2dada9167beb0fd4031173a3636
4
+ data.tar.gz: 50c2a6bf683352e51518834475a13e792cb3e529
5
5
  SHA512:
6
- metadata.gz: 358d8b7f6b3877b178061d4914d69cd9fd2cc540f2d2dc382c13f1f1216244833a4d940071ada74569f55afeed4a4e3e67084c023050fd1d6a536aa59651dc30
7
- data.tar.gz: cc413fe0da5d88b9008cca8012d7162ae6fb2d54ac4608a1b1e1e404631dac435619c0ca9a0cc2b9157eb43fde1f1c4569ca243074ac6d162c871fe81b6a9b78
6
+ metadata.gz: 094fa6fb18f119a87be96d7977a1f328705772c8c97d1da39c547ef7ac8f867d74e1dee38372e5f8f76a6399202695acf979f8255f860716af6e8e5959be8b0b
7
+ data.tar.gz: 0cbb0f81f7abc8ce8dd5456ad0bc4156dd39da21ef0aa4405e2d5bf1292b4dd0be763cb0b24c0d09411509b3c26044f95e9c8f9122d826539be7287c63bbd2fb
@@ -21,7 +21,7 @@ PuppetLint.new_check(:template_file_extension) do
21
21
  current_token = value_token.next_token
22
22
 
23
23
  # iterate over all the code tokens until we hit the closing ')'
24
- until current_token.type == :RPAREN
24
+ until current_token.type == :RPAREN || current_token.type == :LBRACE
25
25
  current_token = current_token.next_code_token
26
26
 
27
27
  if current_token.type == :SSTRING && !current_token.value.end_with?(extension)
@@ -38,6 +38,21 @@ describe 'template_file_extension' do
38
38
  end
39
39
  end
40
40
 
41
+ context 'epp function with one valid file name and parameters' do
42
+ let(:code) do
43
+ <<-EOS
44
+ class valid_epp_template_filename {
45
+ file { '/tmp/templated':
46
+ content => epp('mymodule/single_file.epp', {'key' => 'val'}),
47
+ }
48
+ }
49
+ EOS
50
+ end
51
+
52
+ it 'should not detect any problems' do
53
+ expect(problems).to have(0).problems
54
+ end
55
+ end
41
56
 
42
57
  ##########################
43
58
  # Invalid examples
@@ -72,7 +87,7 @@ describe 'template_file_extension' do
72
87
  <<-EOS
73
88
  class epp_multi_templated_file {
74
89
  file { '/tmp/templated':
75
- content => epp('mymodule/first_file.epp', 'mymodule/second_file.conf'),
90
+ content => epp('mymodule/first_file', {'key' => 'val'}),
76
91
  }
77
92
  }
78
93
  EOS
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-template_file_extension-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Wilson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-06 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -114,6 +114,20 @@ dependencies:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: '1.4'
117
+ - !ruby/object:Gem::Dependency
118
+ name: simplecov
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: 0.15.0
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: 0.15.0
117
131
  description: |2
118
132
  Extends puppet-lint to ensure all filenames used in template and epp functions
119
133
  end with the string '.erb' or '.epp' respectively
@@ -147,11 +161,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
161
  version: '0'
148
162
  requirements: []
149
163
  rubyforge_project:
150
- rubygems_version: 2.5.2
164
+ rubygems_version: 2.5.1
151
165
  signing_key:
152
166
  specification_version: 4
153
167
  summary: puppet-lint template_file_extension check
154
168
  test_files:
155
- - spec/puppet-lint/plugins/puppet-lint-template_file_extension_spec.rb
156
169
  - spec/spec_helper.rb
157
- has_rdoc:
170
+ - spec/puppet-lint/plugins/puppet-lint-template_file_extension_spec.rb