Skip to content

Commit

Permalink
PDK update
Browse files Browse the repository at this point in the history
  • Loading branch information
damonmaria committed Feb 3, 2020
1 parent ad3ba2c commit 4b110dc
Show file tree
Hide file tree
Showing 14 changed files with 546 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.yardwarns
*.iml
/.bundle/
/.idea/workspace.xml
/.idea/
/.vagrant/
/coverage/
/bin/
Expand Down
28 changes: 28 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

456 changes: 456 additions & 0 deletions .idea/dbnavigator.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
require: rubocop-rspec
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Expand All @@ -19,10 +21,13 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down Expand Up @@ -84,6 +89,12 @@ Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
Expand Down
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
dist: trusty
dist: xenial
language: ruby
cache: bundler
before_install:
Expand Down Expand Up @@ -43,12 +43,3 @@ branches:
- /^v\d/
notifications:
email: false
deploy:
provider: puppetforge
user: puppet
password:
secure: ""
on:
tags: true
all_branches: true
condition: "$DEPLOY_TO_FORGE = yes"
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"jpogran.puppet-vscode",
"rebornix.Ruby"
]
}
21 changes: 11 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
14 changes: 12 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
Expand All @@ -14,8 +15,17 @@ end

def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?

returnVal = nil
returnVal ||= begin
metadata_source = JSON.load(File.read('metadata.json'))['source']
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})

metadata_source_match && metadata_source_match[1]
end

raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?

puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
end
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: 1.1.x.{build}
branches:
only:
- master
- release
skip_commits:
message: /^\(?doc\)?.*/
clone_depth: 10
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"version_requirement": ">= 4.10.0 < 5.0.0"
}
],
"pdk-version": "1.10.0",
"template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git#1.10.0",
"template-ref": "1.10.0-0-gbba9ac3"
"pdk-version": "1.15.0",
"template-url": "pdk-default#1.15.0",
"template-ref": "tags/1.15.0-0-g0bc522e"
}
9 changes: 0 additions & 9 deletions nvidia_docker_runtime.iml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
</content>
<orderEntry type="jdk" jdkName="ruby-2.6.2-p47" jdkType="RUBY_SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.0, ruby-2.6.2-p47) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.17.3, ruby-2.6.2-p47) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="facter (v2.5.1, ruby-2.6.2-p47) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="fast_gettext (v1.1.2, ruby-2.6.2-p47) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="hiera (v3.5.0, ruby-2.6.2-p47) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="locale (v2.1.2, ruby-2.6.2-p47) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rake (v12.3.2, ruby-2.6.2-p47) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.0, ruby-2.6.2-p47) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.5.0, ruby-2.6.2-p47) [gem]" level="application" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_FOLDERS">
Expand Down
1 change: 1 addition & 0 deletions spec/default_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
# Facts specified here will override the values provided by rspec-puppet-facts.
---
ipaddress: "172.16.254.254"
ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
end
end

# read default_facts and merge them over what is provided by facterdb
default_facts.each do |fact, value|
add_custom_fact fact, value
end

RSpec.configure do |c|
c.default_facts = default_facts
c.before :each do
Expand All @@ -37,6 +42,8 @@
end
end

# Ensures that a module is defined
# @param module_name Name of the module
def ensure_module_defined(module_name)
module_name.split('::').reduce(Object) do |last_module, next_module|
last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false)
Expand Down

0 comments on commit 4b110dc

Please sign in to comment.