foodcritic-rackspace-rules 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["martin@mbs3.org"]
11
11
  spec.summary = %q{Foodcritic rules for rackops cookbooks or stacks}
12
12
  spec.description = %q{See README.md}
13
- spec.homepage = "https://github.com/AutomationSupport/foodcritic-rackspace-rules"
13
+ spec.homepage = "https://github.com/racker/foodcritic-rackspace-rules"
14
14
  spec.license = "Apache-2.0"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -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_development_dependency "bundler", "~> 1.6"
22
- spec.add_development_dependency "rake"
21
+ spec.add_runtime_dependency 'bundler', '~> 1.6'
22
+ spec.add_runtime_dependency 'rake'
23
+ spec.add_runtime_dependency 'foodcritic'
23
24
  end
@@ -1,7 +1,7 @@
1
1
  module Foodcritic
2
2
  module Rackspace
3
3
  module Rules
4
- VERSION = "1.0.3"
4
+ VERSION = "1.1.0"
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,5 @@
1
1
  require 'yaml' # included in ruby
2
+ require 'foodcritic/chef'
2
3
 
3
4
  rule 'RACK001', 'Missing "# Copyright" declaration' do
4
5
  tags %w(style rackspace)
@@ -123,3 +124,21 @@ rule 'RACK004', 'Cookbook is missing a default test suite' do
123
124
  matches
124
125
  end # cookbook
125
126
  end # rule
127
+
128
+ rack005_required_fields = {
129
+ 'maintainer' => 'Rackspace',
130
+ 'maintainer_email' => 'rackspace-cookbooks@rackspace.com',
131
+ 'license' => 'Apache 2.0'
132
+ }
133
+ req_fields = StringIO.new
134
+ rack005_required_fields.each do |k, v|
135
+ req_fields << " #{k}='#{v}'"
136
+ end
137
+ rule 'RACK005', "Cookbook metadata must have#{req_fields.string}" do
138
+ tags %w(style rackspace)
139
+ metadata do |ast, filename|
140
+ rack005_required_fields.map do |field, value|
141
+ ast.xpath(%Q(//command[ident/@value='#{field}']/descendant::tstring_content[@value!='#{value}']))
142
+ end
143
+ end # cookbook
144
+ end # rule
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foodcritic-rackspace-rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-15 00:00:00.000000000 Z
12
+ date: 2014-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -19,7 +19,7 @@ dependencies:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
21
  version: '1.6'
22
- type: :development
22
+ type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
@@ -35,7 +35,23 @@ dependencies:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
- type: :development
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: foodcritic
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
39
55
  prerelease: false
40
56
  version_requirements: !ruby/object:Gem::Requirement
41
57
  none: false
@@ -57,7 +73,7 @@ files:
57
73
  - foodcritic-rackspace-rules.gemspec
58
74
  - lib/foodcritic/rackspace/rules/version.rb
59
75
  - lib/foodcritic/rules/rules.rb
60
- homepage: https://github.com/AutomationSupport/foodcritic-rackspace-rules
76
+ homepage: https://github.com/racker/foodcritic-rackspace-rules
61
77
  licenses:
62
78
  - Apache-2.0
63
79
  post_install_message: