Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,10 @@ end

desc 'Build for Puppet'
task :build_module do
# Ready for module building
content = "require 'puppet/util/feature'\n\nPuppet.features.add(:ruby_pwsh, :libs => ['ruby-pwsh'])\n"
feature_path = 'lib/puppet/feature/ruby_pwsh.rb'
unless File.exist?(feature_path) ? File.read(feature_path) == content : false
FileUtils.mkdir_p(File.dirname(feature_path))
File.open(feature_path, 'wb') { |file| file.write(content) }
end
actual_readme_content = File.read('README.md')
FileUtils.copy_file('pwshlib.md', 'README.md')
# Build
run_local_command('pdk build --force')
# Cleanup
File.open('README.md', 'wb') { |file| file.write(actual_readme_content) }
FileUtils.rm_r('lib/puppet') if File.exist?('lib/puppet')
end
6 changes: 5 additions & 1 deletion pwshlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ Include `puppetlabs-pwshlib` as a dependency in your module and you can leverage

```ruby
require 'puppet/resource_api/simple_provider'
require 'ruby-pwsh'
begin
require 'ruby-pwsh'
rescue LoadError
raise 'Could not load the "ruby-pwsh" library; is the dependency module puppetlabs-pwshlib installed in this environment?'
end

# Implementation for the foo type using the Resource API.
class Puppet::Provider::Foo::Foo < Puppet::ResourceApi::SimpleProvider
Expand Down