simp-rake-helpers 1.1.3 → 1.2.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 +8 -8
- data/README.md +14 -9
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/rake/pupmod/helpers.rb +99 -0
- data/spec/lib/simp/rake/pupmod/helpers_spec.rb +15 -0
- metadata +60 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzA4NWMyMDVjNWRkY2RiOWRkMzIwN2NiYmNhNzA3ZDZkOWY0N2IzYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmU0NmExYzI4YmE4ZTEwMzRhZWE2ZWU4OTBlOTkyNDliOGQ1MTRhNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjUwYjYzYmNmMGFlMDFmMGE5N2FmOTA4MGE5NmI0NzAwYTZmM2JhMGQ4MTI1
|
10
|
+
YzNlNjI2NmI3MTY4OWQ1OWI1NTk3Nzg3YmZlYjBjZTRmMzY4NjkxNjk2MTE4
|
11
|
+
ZDRkMmQ3YWE4OTdmNDQ1M2ZkNWVlYWUxZWI3ZmFlNDM2ZjgxMzk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzQ5MGRhZWI3Y2I0MzQ2ZTNjMTk4MGM0ZTM5YWZlZTJhYjQzODU4ZTU4OWNl
|
14
|
+
MjA2OGMxNjE0ZWRjZGYxYjFjMjU4MjJmMmViZmFiMWQ3OGJlOTAwM2NhZDAx
|
15
|
+
ODMzNGU2OWViNGE4ZTM3M2E2ZDVhNWI5NTk5YTQwYzg4NjZlNWM=
|
data/README.md
CHANGED
@@ -1,14 +1,6 @@
|
|
1
1
|
# simp-rake-helpers
|
2
2
|
[](http://www.apache.org/licenses/LICENSE-2.0.html) [](https://travis-ci.org/simp/rubygems-simp-rake-helpers)
|
3
3
|
|
4
|
-
|
5
|
-
## Work in Progress
|
6
|
-
|
7
|
-
Please excuse us as we transition this code into the public domain.
|
8
|
-
|
9
|
-
Downloads, discussion, and patches are still welcome!
|
10
|
-
Common helper methods for SIMP Rakefiles
|
11
|
-
|
12
4
|
#### Table of Contents
|
13
5
|
|
14
6
|
1. [Overview](#overview)
|
@@ -16,6 +8,8 @@ Common helper methods for SIMP Rakefiles
|
|
16
8
|
* [Features](#features)
|
17
9
|
2. [Setup - The basics of getting started with iptables](#setup)
|
18
10
|
3. [Usage - Configuration options and additional functionality](#usage)
|
11
|
+
* [In a Puppet Module](#in-a-puppet-module)
|
12
|
+
* [In a Ruby Gem](#in-a-ruby-gem)
|
19
13
|
4. [Reference - An under-the-hood peek at what the gem is doing and how](#reference)
|
20
14
|
5. [Limitations - OS compatibility, etc.](#limitations)
|
21
15
|
6. [Development - Guide for contributing to the module](#development)
|
@@ -45,7 +39,18 @@ gem 'simp-rake-helpers'
|
|
45
39
|
|
46
40
|
|
47
41
|
## Usage
|
48
|
-
### In a
|
42
|
+
### In a Puppet module
|
43
|
+
Within the project's Rakefile:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
require 'simp/rake/pupmod/helpers'
|
47
|
+
|
48
|
+
Simp::Rake::Pupmod::Helpers.new(File.dirname(__FILE__))
|
49
|
+
```
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
### In a Ruby Gem
|
49
54
|
Within the project's Rakefile:
|
50
55
|
|
51
56
|
```ruby
|
@@ -0,0 +1,99 @@
|
|
1
|
+
require 'puppetlabs_spec_helper/rake_tasks'
|
2
|
+
require 'puppet/version'
|
3
|
+
require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6
|
4
|
+
require 'puppet-syntax/tasks/puppet-syntax'
|
5
|
+
require 'puppet-lint/tasks/puppet-lint'
|
6
|
+
require 'simp/rake/pkg'
|
7
|
+
require 'simp/rake/beaker'
|
8
|
+
require 'parallel_tests/cli'
|
9
|
+
|
10
|
+
module Simp; end
|
11
|
+
module Simp::Rake; end
|
12
|
+
module Simp::Rake::Pupmod; end
|
13
|
+
|
14
|
+
# Rake tasks for SIMP Puppet modules
|
15
|
+
class Simp::Rake::Pupmod::Helpers < ::Rake::TaskLib
|
16
|
+
def initialize( base_dir = Dir.pwd )
|
17
|
+
@base_dir = base_dir
|
18
|
+
Dir[ File.join(File.dirname(__FILE__),'*.rb') ].each do |rake_file|
|
19
|
+
next if rake_file == __FILE__
|
20
|
+
require rake_file
|
21
|
+
end
|
22
|
+
define_tasks
|
23
|
+
end
|
24
|
+
|
25
|
+
def define_tasks
|
26
|
+
# These gems aren't always present, for instance
|
27
|
+
# on Travis with --without development
|
28
|
+
begin
|
29
|
+
require 'puppet_blacksmith/rake_tasks'
|
30
|
+
rescue LoadError
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
# Lint & Syntax exclusions
|
35
|
+
exclude_paths = [
|
36
|
+
"bundle/**/*",
|
37
|
+
"pkg/**/*",
|
38
|
+
"dist/**/*",
|
39
|
+
"vendor/**/*",
|
40
|
+
"spec/**/*",
|
41
|
+
]
|
42
|
+
PuppetSyntax.exclude_paths = exclude_paths
|
43
|
+
|
44
|
+
# See: https://github.com/rodjek/puppet-lint/pull/397
|
45
|
+
Rake::Task[:lint].clear
|
46
|
+
PuppetLint.configuration.ignore_paths = exclude_paths
|
47
|
+
PuppetLint::RakeTask.new :lint do |config|
|
48
|
+
config.ignore_paths = PuppetLint.configuration.ignore_paths
|
49
|
+
end
|
50
|
+
|
51
|
+
Simp::Rake::Pkg.new( @base_dir ) do | t |
|
52
|
+
t.clean_list << "#{t.base_dir}/spec/fixtures/hieradata/hiera.yaml"
|
53
|
+
end
|
54
|
+
|
55
|
+
Simp::Rake::Beaker.new( @base_dir )
|
56
|
+
|
57
|
+
desc "Run acceptance tests"
|
58
|
+
RSpec::Core::RakeTask.new(:acceptance) do |t|
|
59
|
+
t.pattern = 'spec/acceptance'
|
60
|
+
end
|
61
|
+
|
62
|
+
desc 'Populate CONTRIBUTORS file'
|
63
|
+
task :contributors do
|
64
|
+
system("git log --format='%aN' | sort -u > CONTRIBUTORS")
|
65
|
+
end
|
66
|
+
|
67
|
+
desc 'lint metadata.json'
|
68
|
+
task :metadata do
|
69
|
+
sh "metadata-json-lint metadata.json"
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
desc "Run syntax, lint, and spec tests."
|
74
|
+
task :test => [
|
75
|
+
:syntax,
|
76
|
+
:lint,
|
77
|
+
:spec_parallel,
|
78
|
+
:metadata,
|
79
|
+
]
|
80
|
+
|
81
|
+
desc <<-EOM
|
82
|
+
Run parallel spec tests.
|
83
|
+
This will NOT run acceptance tests.
|
84
|
+
Use env var `SPEC_clean=yes` to run `:spec_clean` after tests
|
85
|
+
EOM
|
86
|
+
task :spec_parallel do
|
87
|
+
test_targets = ['spec/classes', 'spec/defines', 'spec/unit', 'spec/functions']
|
88
|
+
if ENV['SIMP_PARALLEL_TARGETS']
|
89
|
+
test_targets += ENV['SIMP_PARALLEL_TARGETS'].split
|
90
|
+
end
|
91
|
+
test_targets.delete_if{|dir| !File.directory?(dir)}
|
92
|
+
Rake::Task[:spec_prep].invoke
|
93
|
+
ParallelTests::CLI.new.run('--type test -t rspec'.split + test_targets)
|
94
|
+
if ENV.fetch('SPEC_clean', 'no') == 'yes'
|
95
|
+
Rake::Task[:spec_clean].invoke
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'simp/rake/pupmod/helpers'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Simp::Rake::Pupmod::Helpers do
|
5
|
+
before :each do
|
6
|
+
@obj = Simp::Rake::Pupmod::Helpers.new( File.dirname(__FILE__) )
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "#initialize" do
|
10
|
+
it "initialized (smoke test)" do
|
11
|
+
expect( @obj.class ).to eq Simp::Rake::Pupmod::Helpers
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simp-rake-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Tessmer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-03-
|
12
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -109,6 +109,62 @@ dependencies:
|
|
109
109
|
- - ~>
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '1'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: simp-rspec-puppet-facts
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ~>
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1.0'
|
119
|
+
type: :runtime
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '1.0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: puppet-blacksmith
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ~>
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '3.3'
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ~>
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '3.3'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: simp-beaker-helpers
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ~>
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '1.0'
|
147
|
+
type: :runtime
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ~>
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '1.0'
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: parallel_tests
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ~>
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '2.4'
|
161
|
+
type: :runtime
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ~>
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '2.4'
|
112
168
|
- !ruby/object:Gem::Dependency
|
113
169
|
name: gitlog-md
|
114
170
|
requirement: !ruby/object:Gem::Requirement
|
@@ -307,6 +363,7 @@ files:
|
|
307
363
|
- lib/simp/rake/helpers.rb
|
308
364
|
- lib/simp/rake/helpers/version.rb
|
309
365
|
- lib/simp/rake/pkg.rb
|
366
|
+
- lib/simp/rake/pupmod/helpers.rb
|
310
367
|
- lib/simp/rake/rubygem.rb
|
311
368
|
- lib/simp/rpm.rb
|
312
369
|
- spec/acceptance/files/testpackage/Rakefile
|
@@ -319,6 +376,7 @@ files:
|
|
319
376
|
- spec/lib/simp/files/testpackage.spec
|
320
377
|
- spec/lib/simp/rake/helpers_spec.rb
|
321
378
|
- spec/lib/simp/rake/pkg_spec.rb
|
379
|
+
- spec/lib/simp/rake/pupmod/helpers_spec.rb
|
322
380
|
- spec/lib/simp/rake_spec.rb
|
323
381
|
- spec/lib/simp/rpm_spec.rb
|
324
382
|
- spec/spec_helper.rb
|