Skip to content

Commit 81e0f48

Browse files
author
tphoney
committed
Exec functionality
1 parent 9947348 commit 81e0f48

33 files changed

+984
-2
lines changed

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#This file is generated by ModuleSync, do not edit.
2+
*.rb eol=lf
3+
*.erb eol=lf
4+
*.pp eol=lf
5+
*.sh eol=lf

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+

.pmtignore

+20
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/

.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDiscription>
3+
<name>puppetlabs-exec</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.puppetlabs.geppetto.pp.dsl.ui.modulefileBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>com.puppetlabs.geppetto.pp.dsl.ui.puppetNature</nature>
21+
<nature>com.eclipse.xtext.ui.shared.xtextNature</nature>
22+
</natures>
23+
</projectDescription>

.rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--format documentation

.rubocop.yml

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

.rubocop_todo.yml

Whitespace-only changes.

.travis.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#This file is generated by ModuleSync, do not edit.
2+
---
3+
sudo: false
4+
language: ruby
5+
cache: bundler
6+
script: "bundle exec rake release_checks"
7+
#Inserting below due to the following issue: https://github.com/travis-ci/travis-ci/issues/3531#issuecomment-88311203
8+
before_install:
9+
- gem update bundler
10+
matrix:
11+
fast_finish: true
12+
include:
13+
- rvm: 2.3.1
14+
dist: trusty
15+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04
16+
script: bundle exec rake beaker
17+
services: docker
18+
sudo: required
19+
- rvm: 2.3.1
20+
dist: trusty
21+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7
22+
script: bundle exec rake beaker
23+
services: docker
24+
sudo: required
25+
- rvm: 2.4.0
26+
bundler_args: --without system_tests
27+
env: PUPPET_GEM_VERSION="~> 5.0"
28+
- rvm: 2.1.9
29+
bundler_args: --without system_tests
30+
env: PUPPET_GEM_VERSION="~> 4.0"
31+
notifications:
32+
email: false

.yardopts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--markup markdown
2+
--output-dir docs/

CHANGELOG.md

+11
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

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
#This file is generated by ModuleSync, do not edit.
2+
3+
source ENV['GEM_SOURCE'] || "https://rubygems.org"
4+
5+
# Determines what type of gem is requested based on place_or_version.
6+
def gem_type(place_or_version)
7+
if place_or_version =~ /^git:/
8+
:git
9+
elsif place_or_version =~ /^file:/
10+
:file
11+
else
12+
:gem
13+
end
14+
end
15+
16+
# Find a location or specific version for a gem. place_or_version can be a
17+
# version, which is most often used. It can also be git, which is specified as
18+
# `git://somewhere.git#branch`. You can also use a file source location, which
19+
# is specified as `file://some/location/on/disk`.
20+
def location_for(place_or_version, fake_version = nil)
21+
if place_or_version =~ /^(git[:@][^#]*)#(.*)/
22+
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
23+
elsif place_or_version =~ /^file:\/\/(.*)/
24+
['>= 0', { :path => File.expand_path($1), :require => false }]
25+
else
26+
[place_or_version, { :require => false }]
27+
end
28+
end
29+
30+
# Used for gem conditionals
31+
supports_windows = true
32+
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
33+
minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}"
34+
35+
# The following gems are not included by default as they require DevKit on Windows.
36+
# You should probably include them in a Gemfile.local or a ~/.gemfile
37+
#gem 'pry' #this may already be included in the gemfile
38+
#gem 'pry-stack_explorer', :require => false
39+
#if RUBY_VERSION =~ /^2/
40+
# gem 'pry-byebug'
41+
#else
42+
# gem 'pry-debugger'
43+
#end
44+
45+
group :development do
46+
gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby"
47+
gem "puppet-module-win-default-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
48+
gem "puppet-module-posix-dev-r#{minor_version}", :require => false, :platforms => "ruby"
49+
gem "puppet-module-win-dev-r#{minor_version}", '0.0.7', :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
50+
gem "json_pure", '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
51+
gem "fast_gettext", '1.1.0', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
52+
gem "fast_gettext", :require => false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
53+
end
54+
55+
group :system_tests do
56+
gem "puppet-module-posix-system-r#{minor_version}", :require => false, :platforms => "ruby"
57+
gem "puppet-module-win-system-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
58+
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3')
59+
gem "beaker-pe", :require => false
60+
gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION'])
61+
gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'])
62+
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
63+
gem "puppet-blacksmith", '~> 3.4', :require => false
64+
end
65+
66+
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
67+
68+
# Only explicitly specify Facter/Hiera if a version has been specified.
69+
# Otherwise it can lead to strange bundler behavior. If you are seeing weird
70+
# gem resolution behavior, try setting `DEBUG_RESOLVER` environment variable
71+
# to `1` and then run bundle install.
72+
gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION']
73+
gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION']
74+
75+
# For Windows dependencies, these could be required based on the version of
76+
# Puppet you are requiring. Anything greater than v3.5.0 is going to have
77+
# Windows-specific dependencies dictated by the gem itself. The other scenario
78+
# is when you are faking out Puppet to use a local file path / git path.
79+
explicitly_require_windows_gems = false
80+
puppet_gem_location = gem_type(ENV['PUPPET_GEM_VERSION'])
81+
# This is not a perfect answer to the version check
82+
if puppet_gem_location != :gem || (ENV['PUPPET_GEM_VERSION'] && Gem::Version.correct?(ENV['PUPPET_GEM_VERSION']) && Gem::Requirement.new('< 3.5.0').satisfied_by?(Gem::Version.new(ENV['PUPPET_GEM_VERSION'].dup)))
83+
if Gem::Platform.local.os == 'mingw32'
84+
explicitly_require_windows_gems = true
85+
end
86+
if puppet_gem_location == :gem
87+
# If facterversion hasn't been specified and we are
88+
# looking for a Puppet Gem version less than 3.5.0, we
89+
# need to ensure we get a good Facter for specs.
90+
gem "facter",">= 1.6.11","<= 1.7.5",:require => false unless ENV['FACTER_GEM_VERSION']
91+
# If hieraversion hasn't been specified and we are
92+
# looking for a Puppet Gem version less than 3.5.0, we
93+
# need to ensure we get a good Hiera for specs.
94+
gem "hiera",">= 1.0.0","<= 1.3.0",:require => false unless ENV['HIERA_GEM_VERSION']
95+
end
96+
end
97+
98+
if explicitly_require_windows_gems
99+
# This also means Puppet Gem less than 3.5.0 - this has been tested back
100+
# to 3.0.0. Any further back is likely not supported.
101+
if puppet_gem_location == :gem
102+
gem "ffi", "1.9.0", :require => false
103+
gem "win32-eventlog", "0.5.3","<= 0.6.5", :require => false
104+
gem "win32-process", "0.6.5","<= 0.7.5", :require => false
105+
gem "win32-security", "~> 0.1.2","<= 0.2.5", :require => false
106+
gem "win32-service", "0.7.2","<= 0.8.8", :require => false
107+
gem "minitar", "0.5.4", :require => false
108+
else
109+
gem "ffi", "~> 1.9.0", :require => false
110+
gem "win32-eventlog", "~> 0.5","<= 0.6.5", :require => false
111+
gem "win32-process", "~> 0.6","<= 0.7.5", :require => false
112+
gem "win32-security", "~> 0.1","<= 0.2.5", :require => false
113+
gem "win32-service", "~> 0.7","<= 0.8.8", :require => false
114+
gem "minitar", "~> 0.5.4", :require => false
115+
end
116+
117+
gem "win32-dir", "~> 0.3","<= 0.4.9", :require => false
118+
gem "win32console", "1.3.2", :require => false if RUBY_VERSION =~ /^1\./
119+
120+
# sys-admin was removed in Puppet 3.7.0+, and doesn't compile
121+
# under Ruby 2.3 - so restrict it to Ruby 1.x
122+
gem "sys-admin", "1.5.6", :require => false if RUBY_VERSION =~ /^1\./
123+
124+
# Puppet less than 3.7.0 requires these.
125+
# Puppet 3.5.0+ will control the actual requirements.
126+
# These are listed in formats that work with all versions of
127+
# Puppet from 3.0.0 to 3.6.x. After that, these were no longer used.
128+
# We do not want to allow newer versions than what came out after
129+
# 3.6.x to be used as they constitute some risk in breaking older
130+
# functionality. So we set these to exact versions.
131+
gem "win32-api", "1.4.8", :require => false
132+
gem "win32-taskscheduler", "0.2.2", :require => false
133+
gem "windows-api", "0.4.3", :require => false
134+
gem "windows-pr", "1.2.3", :require => false
135+
else
136+
if Gem::Platform.local.os == 'mingw32'
137+
# If we're using a Puppet gem on windows, which handles its own win32-xxx gem dependencies (Pup 3.5.0 and above), set maximum versions
138+
# Required due to PUP-6445
139+
gem "win32-dir", "<= 0.4.9", :require => false
140+
gem "win32-eventlog", "<= 0.6.5", :require => false
141+
gem "win32-process", "<= 0.7.5", :require => false
142+
gem "win32-security", "<= 0.2.5", :require => false
143+
gem "win32-service", "<= 0.8.8", :require => false
144+
end
145+
end
146+
147+
# Evaluate Gemfile.local if it exists
148+
if File.exists? "#{__FILE__}.local"
149+
eval(File.read("#{__FILE__}.local"), binding)
150+
end
151+
152+
# Evaluate ~/.gemfile if it exists
153+
if File.exists?(File.join(Dir.home, '.gemfile'))
154+
eval(File.read(File.join(Dir.home, '.gemfile')), binding)
155+
end
156+
157+
# vim:ft=ruby

0 commit comments

Comments
 (0)