Skip to content

Commit 3b4ad24

Browse files
committed
First commit
0 parents  commit 3b4ad24

22 files changed

+821
-0
lines changed

.fixtures.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file can be used to install module dependencies for unit testing
2+
# See https://github.com/puppetlabs/puppetlabs_spec_helper#using-fixtures for details
3+
---
4+
fixtures:
5+
forge_modules:
6+
# stdlib: "puppetlabs/stdlib"

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.rb eol=lf
2+
*.erb eol=lf
3+
*.pp eol=lf
4+
*.sh eol=lf

.gitignore

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

.gitlab-ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
stages:
3+
- syntax
4+
- unit
5+
6+
cache:
7+
paths:
8+
- vendor/bundle
9+
10+
before_script:
11+
- bundle -v
12+
- rm Gemfile.lock || true
13+
- gem update --system
14+
- gem --version
15+
- bundle -v
16+
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)
17+
18+
parallel_spec-Ruby 2.1.9-Puppet ~> 4.0:
19+
stage: syntax
20+
image: ruby:2.1.9
21+
script:
22+
- bundle exec rake parallel_spec
23+
variables:
24+
PUPPET_GEM_VERSION: '~> 4.0'
25+
26+
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.4.4-Puppet ~> 5.5:
27+
stage: syntax
28+
image: ruby:2.4.4
29+
script:
30+
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
31+
variables:
32+
PUPPET_GEM_VERSION: '~> 5.5'
33+
34+
parallel_spec-Ruby 2.4.4-Puppet ~> 5.5:
35+
stage: syntax
36+
image: ruby:2.4.4
37+
script:
38+
- bundle exec rake parallel_spec
39+
variables:
40+
PUPPET_GEM_VERSION: '~> 5.5'
41+

.pdkignore

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

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

.sync.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
Gemfile:
3+
optional:
4+
':development':
5+
- gem: 'puppet-resource_api'
6+
spec/spec_helper.rb:
7+
mock_with: ':rspec'

.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 -f Gemfile.lock
9+
- gem update --system
10+
- gem --version
11+
- bundle -v
12+
script:
13+
- 'bundle exec rake $CHECK'
14+
bundler_args: --without system_tests
15+
rvm:
16+
- 2.4.4
17+
env:
18+
global:
19+
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
20+
matrix:
21+
fast_finish: true
22+
include:
23+
-
24+
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
25+
-
26+
env: CHECK=parallel_spec
27+
-
28+
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
29+
rvm: 2.1.9
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--markup markdown

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## Release 0.1.0
6+
7+
**Features**
8+
9+
**Bugfixes**
10+
11+
**Known Issues**

Gemfile

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
32+
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
33+
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
34+
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
35+
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
36+
gem "puppet-resource_api", require: false
37+
end
38+
39+
puppet_version = ENV['PUPPET_GEM_VERSION']
40+
puppet_type = gem_type(puppet_version)
41+
facter_version = ENV['FACTER_GEM_VERSION']
42+
hiera_version = ENV['HIERA_GEM_VERSION']
43+
44+
gems = {}
45+
46+
gems['puppet'] = location_for(puppet_version)
47+
48+
# If facter or hiera versions have been specified via the environment
49+
# variables
50+
51+
gems['facter'] = location_for(facter_version) if facter_version
52+
gems['hiera'] = location_for(hiera_version) if hiera_version
53+
54+
if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
55+
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
56+
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
57+
gems['win32-dir'] = ['<= 0.4.9', require: false]
58+
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
59+
gems['win32-process'] = ['<= 0.7.5', require: false]
60+
gems['win32-security'] = ['<= 0.2.5', require: false]
61+
gems['win32-service'] = ['0.8.8', require: false]
62+
end
63+
64+
gems.each do |gem_name, gem_params|
65+
gem gem_name, *gem_params
66+
end
67+
68+
# Evaluate Gemfile.local and ~/.gemfile if they exist
69+
extra_gemfiles = [
70+
"#{__FILE__}.local",
71+
File.join(Dir.home, '.gemfile'),
72+
]
73+
74+
extra_gemfiles.each do |gemfile|
75+
if File.file?(gemfile) && File.readable?(gemfile)
76+
eval(File.read(gemfile), binding)
77+
end
78+
end
79+
# vim: syntax=ruby

0 commit comments

Comments
 (0)