puppet-lint-version_comparison-check 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7c4eab7e52af1a198efeb97db755c83038107b86
4
- data.tar.gz: 3a3e52c79a52e1890d3f6a10abe9fd2274d8a6d0
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MGQ0MDYwNWFiYTc5NDg5ZjkxNjk2ZWZlYjFmYzdlNjQwMmZjNzBmNA==
5
+ data.tar.gz: !binary |-
6
+ ZDAxMGMyZjgyYzJhYmJiODg3OWRhZGNmODVjMDMzYTEyMmRlMTllYQ==
5
7
  SHA512:
6
- metadata.gz: 5f4086179338a88a1cda0524e04c5ff7a2221c65a280bc63a5be0517c69f5f24007919c0528b8cc00cd6173c1326b5c6f71327db2b07a51700f63042bbc0362b
7
- data.tar.gz: 2149ccde623ac44762f3a8e04ba605721e0ca6c532f4b6df2b253eb81911f174614194741d09a585028822a203bfd1d650d4e75bb05da372024d0a78d27f87e3
8
+ metadata.gz: !binary |-
9
+ ZjIwYzk3NWNmODU3NjRmNjNmNTg2YWMwMzMxOWQ2YTA4OTRlNWIzZmNmOWRl
10
+ YTJlMzFlYzZkMzFjZjMzNzI3M2NmODhjNjAyY2ZjYTNmNDYxM2M2MWY2Yjhk
11
+ YmUxYTMyMmQ3MmFjNTMyZDRhYTI4NmVmZmI1NGI2MjI1NzE5MWM=
12
+ data.tar.gz: !binary |-
13
+ ZWEwNjQxMzk5ZjQ2YmZhNWM0NDhmYjMxZjBhZmY3OGFjMzliMDA4NjZmNWI3
14
+ MzQ3ODBkNTYzODBhMDUwZjliMzA4MmY3ZGZiNzJhZjViMmNmYmQyZDViYzUw
15
+ ZThhY2U1OWZlMTU2ZTc3YTIwNDQ4NTQwYmZlODlhYTA2ZTUyMDE=
data/README.md CHANGED
@@ -19,7 +19,7 @@ Not doing so will fail with the future parser starting with Puppet 3.7.4.
19
19
  #### What you have done
20
20
 
21
21
  ```puppet
22
- if $version >= '4' { }
22
+ if $version >= 4 { }
23
23
  ```
24
24
 
25
25
  #### What you should have done
@@ -57,11 +57,11 @@ PuppetLint.new_check(:version_comparison) do
57
57
  value_token.value = 0
58
58
  value_token.type = :NUMBER
59
59
  # Insert ')' after value
60
- tokens.insert(idx+2, space)
61
- tokens.insert(idx+2, rparen)
60
+ tokens.insert(idx+1, rparen)
62
61
  # Insert value as string after comma
63
- tokens.insert(idx+2, value)
62
+ tokens.insert(idx+1, value)
64
63
  # Insert comma after token
64
+ tokens.insert(idx+1, space)
65
65
  tokens.insert(idx+1, comma)
66
66
  # Insert 'versioncmp(' before token
67
67
  tokens.insert(idx, lparen)
@@ -73,11 +73,12 @@ describe 'version_comparison' do
73
73
  if $version <= 1 { }
74
74
  if $some_version < 3 { }
75
75
  if $mod::params::version == 2 { }
76
+ if $::operatingsystemmajrelease<'6' { }
76
77
  EOS
77
78
  end
78
79
 
79
- it 'should detect 4 problems' do
80
- expect(problems).to have(4).problems
80
+ it 'should detect 5 problems' do
81
+ expect(problems).to have(5).problems
81
82
  end
82
83
 
83
84
  it 'should create warnings' do
@@ -85,6 +86,7 @@ describe 'version_comparison' do
85
86
  expect(problems).to contain_fixed(msg).on_line(2).in_column(12)
86
87
  expect(problems).to contain_fixed(msg).on_line(3).in_column(12)
87
88
  expect(problems).to contain_fixed(msg).on_line(4).in_column(12)
89
+ expect(problems).to contain_fixed(msg).on_line(5).in_column(12)
88
90
  end
89
91
 
90
92
  it 'should should use versioncmp' do
@@ -94,6 +96,7 @@ describe 'version_comparison' do
94
96
  if versioncmp($version, '1') <= 0 { }
95
97
  if versioncmp($some_version, '3') < 0 { }
96
98
  if versioncmp($mod::params::version, '2') == 0 { }
99
+ if versioncmp($::operatingsystemmajrelease, '6')<0 { }
97
100
  EOS
98
101
  )
99
102
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,7 @@
1
- require 'coveralls'
2
- Coveralls.wear!
1
+ unless RUBY_VERSION =~ /^1\.8/
2
+ require 'coveralls'
3
+ Coveralls.wear!
4
+ end
3
5
 
4
6
  require 'puppet-lint'
5
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-version_comparison-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camptocamp
@@ -14,102 +14,103 @@ dependencies:
14
14
  name: puppet-lint
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-its
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-collection_matchers
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mime-types
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: coveralls
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0.7'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.7'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ! '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- description: |2
112
- A puppet-lint plugin to check for versions compared as numbers.
111
+ description: ! ' A puppet-lint plugin to check for versions compared as numbers.
112
+
113
+ '
113
114
  email: raphael.pinson@camptocamp.com
114
115
  executables: []
115
116
  extensions: []
@@ -130,20 +131,20 @@ require_paths:
130
131
  - lib
131
132
  required_ruby_version: !ruby/object:Gem::Requirement
132
133
  requirements:
133
- - - ">="
134
+ - - ! '>='
134
135
  - !ruby/object:Gem::Version
135
136
  version: '0'
136
137
  required_rubygems_version: !ruby/object:Gem::Requirement
137
138
  requirements:
138
- - - ">="
139
+ - - ! '>='
139
140
  - !ruby/object:Gem::Version
140
141
  version: '0'
141
142
  requirements: []
142
143
  rubyforge_project:
143
- rubygems_version: 2.2.2
144
+ rubygems_version: 2.4.5
144
145
  signing_key:
145
146
  specification_version: 4
146
147
  summary: A puppet-lint plugin to check for versions compared as numbers.
147
148
  test_files:
148
- - spec/spec_helper.rb
149
149
  - spec/puppet-lint/plugins/check_version_comparison/version_comparison_spec.rb
150
+ - spec/spec_helper.rb