Sha256: 1a66e6242a8d22e2bb457e12c6834c825c13db37937d7589cc4d81c6cd98ed08

Contents?: true

Size: 979 Bytes

Versions: 6

Compression:

Stored size: 979 Bytes

Contents

include LearnChef::Workflow

# directory to write output to.
property :cache, String, required: false, default: nil
# the shell to run the command from. options are :bash and :powershell.
property :shell, Symbol, required: false, default: :bash
# a Hash of environment variables to set before the command is run.
property :environment, Hash, required: false, default: {}

action :set do
  changed_settings = {}
  changed_settings[:cache] = {}
  changed_settings[:shell] = {}
  changed_settings[:environment] = {}

  task_options.each do |key, value|
    changed_settings[key][:old] = value
  end
  changed_settings[:cache][:new] = cache
  changed_settings[:shell][:new] = shell
  changed_settings[:environment][:new] = environment

  changed_settings.keys.sort.each do |key|
    Chef::Log.info("  * #{key}: #{changed_settings[key][:old]} => #{changed_settings[key][:new]}")
  end

  assign_task_options(
    cache: cache,
    shell: shell,
    environment: environment
    )
end

Version data entries

6 entries across 4 versions & 1 rubygems

Version Path
chef-12.11.18-universal-mingw32 acceptance/top-cookbooks/test_run/learn-the-basics-ubuntu/cookbooks/workflow/resources/task_options.rb
chef-12.11.18-universal-mingw32 acceptance/top-cookbooks/test_run/learn-the-basics-windows/cookbooks/workflow/resources/task_options.rb
chef-12.11.18 acceptance/top-cookbooks/test_run/learn-the-basics-ubuntu/cookbooks/workflow/resources/task_options.rb
chef-12.11.18 acceptance/top-cookbooks/test_run/learn-the-basics-windows/cookbooks/workflow/resources/task_options.rb
chef-12.7.2 acceptance/top-cookbooks/test_run/learn-the-basics-windows/cookbooks/workflow/resources/task_options.rb
chef-12.7.2-universal-mingw32 acceptance/top-cookbooks/test_run/learn-the-basics-windows/cookbooks/workflow/resources/task_options.rb