Sha256: 8d6d6d26522d810b3a857ecbe58c064a01843ddbc97bb28777cbfe8624054fcc

Contents?: true

Size: 1011 Bytes

Versions: 4

Compression:

Stored size: 1011 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

4 entries across 2 versions & 1 rubygems

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