class Kitchen::Provisioner::ChefGithub

Public Instance Methods

prepare_command() click to toggle source
# File lib/kitchen/provisioner/chef_github.rb, line 13
def prepare_command
  ruby_bin = remote_path_join(config[:ruby_bindir], "ruby")
    .tap { |path| path.concat(".exe") if windows_os? }
  gem_bin = remote_path_join(config[:ruby_bindir], "gem")
    .tap { |path| path.concat(".bat") if windows_os? }
  appbundle_updater_bin = remote_path_join(config[:ruby_bindir], "appbundle-updater")
    # tap { |path| path.concat(".bat") if windows_os? }
  vars = [
    shell_var("refname", config[:refname]),
    shell_var("github_owner", config[:github_owner]),
    shell_var("github_repo", config[:github_repo]),
    shell_var("ohai_refname", config[:ohai_refname]),
    shell_var("ruby", sudo(ruby_bin)),
    shell_var("gem", sudo(gem_bin)),
    shell_var("appbundle_updater", appbundle_updater_bin),
  ].join("\n").concat("\n")

  my_shell_code_from_file(vars, "chef_base_updater")
end

Private Instance Methods

my_shell_code_from_file(vars, file) click to toggle source

need to override and use __FILE__ relative to this plugin

# File lib/kitchen/provisioner/chef_github.rb, line 36
def my_shell_code_from_file(vars, file)
  src_file = File.join(
    File.dirname(__FILE__),
    %w{.. .. .. support},
    file + (powershell_shell? ? ".ps1" : ".sh")
  )

  wrap_shell_code([vars, "", IO.read(src_file)].join("\n"))
end