Skip to content

Commit 7694cf4

Browse files
committed
new files after conversion to standardized pdk 1.3
1 parent 1c0f951 commit 7694cf4

32 files changed

Lines changed: 3154 additions & 0 deletions

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.*.sw[op]
2+
.metadata
3+
.yardoc
4+
.yardwarns
5+
*.iml
6+
/.bundle/
7+
/.idea/
8+
/.vagrant/
9+
/coverage/
10+
/bin/
11+
/doc/
12+
/Gemfile.local
13+
/Gemfile.lock
14+
/junit/
15+
/log/
16+
/log/
17+
/pkg/
18+
/spec/fixtures/manifests/
19+
/spec/fixtures/modules/
20+
/tmp/
21+
/vendor/
22+
/convert_report.txt
23+

.gitlab-ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
stages:
3+
- test_2.4.1
4+
- test_2.1.9
5+
6+
before_script:
7+
- bundle -v
8+
- rm Gemfile.lock || true
9+
- gem update --system
10+
- gem update bundler
11+
- gem --version
12+
- bundle -v
13+
- bundle install --without system_tests
14+
15+
rubocop-2.4.1:
16+
stage: test_2.4.1
17+
image: ruby:2.4.1
18+
script:
19+
- bundle exec rake rubocop
20+
21+
syntax-2.4.1:
22+
stage: test_2.4.1
23+
image: ruby:2.4.1
24+
script:
25+
- bundle exec rake syntax lint
26+
27+
metadata-2.4.1:
28+
stage: test_2.4.1
29+
image: ruby:2.4.1
30+
script:
31+
- bundle exec rake metadata_lint
32+
33+
rspec-puppet-2.4.1:
34+
stage: test_2.4.1
35+
image: ruby:2.4.1
36+
variables:
37+
PUPPET_GEM_VERSION: ~> 4.0
38+
CHECK: spec
39+
script:
40+
- bundle update
41+
- bundle exec rake $CHECK
42+
43+
rubocop-2.1.9:
44+
stage: test_2.1.9
45+
image: ruby:2.1.9
46+
script:
47+
- bundle exec rake rubocop
48+
49+
syntax-2.1.9:
50+
stage: test_2.1.9
51+
image: ruby:2.1.9
52+
script:
53+
- bundle exec rake syntax lint
54+
55+
metadata-2.1.9:
56+
stage: test_2.1.9
57+
image: ruby:2.1.9
58+
script:
59+
- bundle exec rake metadata_lint
60+
61+
rspec-puppet-2.1.9:
62+
stage: test_2.1.9
63+
image: ruby:2.1.9
64+
variables:
65+
PUPPET_GEM_VERSION: ~> 4.0
66+
CHECK: spec
67+
script:
68+
- bundle update
69+
- bundle exec rake $CHECK
70+

.pmtignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
docs/
2+
pkg/
3+
Gemfile.lock
4+
Gemfile.local
5+
vendor/
6+
.vendor/
7+
spec/fixtures/manifests/
8+
spec/fixtures/modules/
9+
.vagrant/
10+
.bundle/
11+
.ruby-version
12+
coverage/
13+
log/
14+
.idea/
15+
.dependencies/
16+
.librarian/
17+
Puppetfile.lock
18+
*.iml
19+
.*.sw?
20+
.yardoc/

.rspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--format documentation

.rubocop.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
require: rubocop-rspec
3+
AllCops:
4+
DisplayCopNames: true
5+
TargetRubyVersion: '2.1'
6+
Include:
7+
- "./**/*.rb"
8+
Exclude:
9+
- bin/*
10+
- ".vendor/**/*"
11+
- Gemfile
12+
- Rakefile
13+
- pkg/**/*
14+
- spec/fixtures/**/*
15+
- vendor/**/*
16+
Metrics/LineLength:
17+
Description: People have wide screens, use them.
18+
Max: 200
19+
RSpec/BeforeAfterAll:
20+
Description: Beware of using after(:all) as it may cause state to leak between tests.
21+
A necessary evil in acceptance testing.
22+
Exclude:
23+
- spec/acceptance/**/*.rb
24+
RSpec/HookArgument:
25+
Description: Prefer explicit :each argument, matching existing module's style
26+
EnforcedStyle: each
27+
Style/BlockDelimiters:
28+
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
29+
be consistent then.
30+
EnforcedStyle: braces_for_chaining
31+
Style/ClassAndModuleChildren:
32+
Description: Compact style reduces the required amount of indentation.
33+
EnforcedStyle: compact
34+
Style/EmptyElse:
35+
Description: Enforce against empty else clauses, but allow `nil` for clarity.
36+
EnforcedStyle: empty
37+
Style/FormatString:
38+
Description: Following the main puppet project's style, prefer the % format format.
39+
EnforcedStyle: percent
40+
Style/FormatStringToken:
41+
Description: Following the main puppet project's style, prefer the simpler template
42+
tokens over annotated ones.
43+
EnforcedStyle: template
44+
Style/Lambda:
45+
Description: Prefer the keyword for easier discoverability.
46+
EnforcedStyle: literal
47+
Style/RegexpLiteral:
48+
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
49+
EnforcedStyle: percent_r
50+
Style/TernaryParentheses:
51+
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
52+
on complex expressions for better readability, but seriously consider breaking
53+
it up.
54+
EnforcedStyle: require_parentheses_when_complex
55+
Style/TrailingCommaInArguments:
56+
Description: Prefer always trailing comma on multiline argument lists. This makes
57+
diffs, and re-ordering nicer.
58+
EnforcedStyleForMultiline: comma
59+
Style/TrailingCommaInLiteral:
60+
Description: Prefer always trailing comma on multiline literals. This makes diffs,
61+
and re-ordering nicer.
62+
EnforcedStyleForMultiline: comma
63+
Style/SymbolArray:
64+
Description: Using percent style obscures symbolic intent of array's contents.
65+
EnforcedStyle: brackets
66+
Style/CollectionMethods:
67+
Enabled: true
68+
Style/MethodCalledOnDoEndBlock:
69+
Enabled: true
70+
Style/StringMethods:
71+
Enabled: true
72+
Layout/EndOfLine:
73+
Enabled: false
74+
Metrics/AbcSize:
75+
Enabled: false
76+
Metrics/BlockLength:
77+
Enabled: false
78+
Metrics/ClassLength:
79+
Enabled: false
80+
Metrics/CyclomaticComplexity:
81+
Enabled: false
82+
Metrics/MethodLength:
83+
Enabled: false
84+
Metrics/ModuleLength:
85+
Enabled: false
86+
Metrics/ParameterLists:
87+
Enabled: false
88+
Metrics/PerceivedComplexity:
89+
Enabled: false
90+
RSpec/DescribeClass:
91+
Enabled: false
92+
RSpec/ExampleLength:
93+
Enabled: false
94+
RSpec/MessageExpectation:
95+
Enabled: false
96+
RSpec/MultipleExpectations:
97+
Enabled: false
98+
RSpec/NestedGroups:
99+
Enabled: false
100+
Style/AsciiComments:
101+
Enabled: false
102+
Style/IfUnlessModifier:
103+
Enabled: false
104+
Style/SymbolProc:
105+
Enabled: false

.travis.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sudo: false
3+
dist: trusty
4+
language: ruby
5+
cache: bundler
6+
before_install:
7+
- bundle -v
8+
- rm Gemfile.lock || true
9+
- gem update --system
10+
- gem update bundler
11+
- gem --version
12+
- bundle -v
13+
script:
14+
- 'bundle exec rake $CHECK'
15+
bundler_args: --without system_tests
16+
rvm:
17+
- 2.4.1
18+
- 2.1.9
19+
env:
20+
- PUPPET_GEM_VERSION="~> 4.0" CHECK=spec
21+
matrix:
22+
fast_finish: true
23+
include:
24+
-
25+
env: CHECK=rubocop
26+
-
27+
env: CHECK="syntax lint"
28+
-
29+
env: CHECK=metadata_lint
30+
branches:
31+
only:
32+
- master
33+
- /^v\d/
34+
notifications:
35+
email: false
36+
deploy:
37+
provider: puppetforge
38+
user: puppet
39+
password:
40+
secure: ""
41+
on:
42+
tags: true
43+
all_branches: true
44+
condition: "$DEPLOY_TO_FORGE = yes"

.yardopts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--markup markdown
2+
--output-dir docs/

Gemfile

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2+
3+
def location_for(place_or_version, fake_version = nil)
4+
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
5+
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
6+
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
7+
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
8+
else
9+
[place_or_version, { require: false }]
10+
end
11+
end
12+
13+
def gem_type(place_or_version)
14+
if place_or_version =~ %r{\Agit[:@]}
15+
:git
16+
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
17+
:file
18+
else
19+
:gem
20+
end
21+
end
22+
23+
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
24+
minor_version = ruby_version_segments[0..1].join('.')
25+
26+
group :development do
27+
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
28+
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
29+
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
30+
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
31+
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
32+
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
33+
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
34+
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
35+
end
36+
37+
puppet_version = ENV['PUPPET_GEM_VERSION']
38+
puppet_type = gem_type(puppet_version)
39+
facter_version = ENV['FACTER_GEM_VERSION']
40+
hiera_version = ENV['HIERA_GEM_VERSION']
41+
42+
def puppet_older_than?(version)
43+
puppet_version = ENV['PUPPET_GEM_VERSION']
44+
!puppet_version.nil? &&
45+
Gem::Version.correct?(puppet_version) &&
46+
Gem::Requirement.new("< #{version}").satisfied_by?(Gem::Version.new(puppet_version.dup))
47+
end
48+
49+
gems = {}
50+
51+
gems['puppet'] = location_for(puppet_version)
52+
53+
# If facter or hiera versions have been specified via the environment
54+
# variables, use those versions. If not, and if the puppet version is < 3.5.0,
55+
# use known good versions of both for puppet < 3.5.0.
56+
if facter_version
57+
gems['facter'] = location_for(facter_version)
58+
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
59+
gems['facter'] = ['>= 1.6.11', '<= 1.7.5', require: false]
60+
end
61+
62+
if hiera_version
63+
gems['hiera'] = location_for(ENV['HIERA_GEM_VERSION'])
64+
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
65+
gems['hiera'] = ['>= 1.0.0', '<= 1.3.0', require: false]
66+
end
67+
68+
if Gem.win_platform? && (puppet_type != :gem || puppet_older_than?('3.5.0'))
69+
# For Puppet gems < 3.5.0 (tested as far back as 3.0.0) on Windows
70+
if puppet_type == :gem
71+
gems['ffi'] = ['1.9.0', require: false]
72+
gems['minitar'] = ['0.5.4', require: false]
73+
gems['win32-eventlog'] = ['0.5.3', '<= 0.6.5', require: false]
74+
gems['win32-process'] = ['0.6.5', '<= 0.7.5', require: false]
75+
gems['win32-security'] = ['~> 0.1.2', '<= 0.2.5', require: false]
76+
gems['win32-service'] = ['0.7.2', '<= 0.8.8', require: false]
77+
else
78+
gems['ffi'] = ['~> 1.9.0', require: false]
79+
gems['minitar'] = ['~> 0.5.4', require: false]
80+
gems['win32-eventlog'] = ['~> 0.5', '<= 0.6.5', require: false]
81+
gems['win32-process'] = ['~> 0.6', '<= 0.7.5', require: false]
82+
gems['win32-security'] = ['~> 0.1', '<= 0.2.5', require: false]
83+
gems['win32-service'] = ['~> 0.7', '<= 0.8.8', require: false]
84+
end
85+
86+
gems['win32-dir'] = ['~> 0.3', '<= 0.4.9', require: false]
87+
88+
if RUBY_VERSION.start_with?('1.')
89+
gems['win32console'] = ['1.3.2', require: false]
90+
# sys-admin was removed in Puppet 3.7.0 and doesn't compile under Ruby 2.x
91+
gems['sys-admin'] = ['1.5.6', require: false]
92+
end
93+
94+
# Puppet < 3.7.0 requires these.
95+
# Puppet >= 3.5.0 gem includes these as requirements.
96+
# The following versions are tested to work with 3.0.0 <= puppet < 3.7.0.
97+
gems['win32-api'] = ['1.4.8', require: false]
98+
gems['win32-taskscheduler'] = ['0.2.2', require: false]
99+
gems['windows-api'] = ['0.4.3', require: false]
100+
gems['windows-pr'] = ['1.2.3', require: false]
101+
elsif Gem.win_platform?
102+
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
103+
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
104+
gems['win32-dir'] = ['<= 0.4.9', require: false]
105+
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
106+
gems['win32-process'] = ['<= 0.7.5', require: false]
107+
gems['win32-security'] = ['<= 0.2.5', require: false]
108+
gems['win32-service'] = ['<= 0.8.8', require: false]
109+
end
110+
111+
gems.each do |gem_name, gem_params|
112+
gem gem_name, *gem_params
113+
end
114+
115+
# Evaluate Gemfile.local and ~/.gemfile if they exist
116+
extra_gemfiles = [
117+
"#{__FILE__}.local",
118+
File.join(Dir.home, '.gemfile'),
119+
]
120+
121+
extra_gemfiles.each do |gemfile|
122+
if File.file?(gemfile) && File.readable?(gemfile)
123+
eval(File.read(gemfile), binding)
124+
end
125+
end
126+
# vim: syntax=ruby

0 commit comments

Comments
 (0)