Sha256: 61680cda4e21de43ba28c6b7534d0ca43884ddbae0d3a313a06b8d7b8fb28691

Contents?: true

Size: 954 Bytes

Versions: 17

Compression:

Stored size: 954 Bytes

Contents

Given /^the cookbook has a '(.+)' named '(.+)' in the '(.+)' specific directory$/ do |file_type, filename, specificity|
  cookbook_name, recipe_name = recipe.split('::')
  type_dir = file_type == 'file' ? 'files' : 'templates'
  specific_dir = nil
  case specificity
  when "host"
    specific_dir = "host-#{client.node[:fqdn]}"
  when "platform-version"
    specific_dir = "#{client.node[:platform]}-#{client.node[:platform_version]}"
  when "platform"
    specific_dir = client.node[:platform]
  when "default"
    specific_dir = "default"
  end
  new_file_dir = File.expand_path(File.dirname(__FILE__) + "/../data/cookbooks/#{cookbook_name}/#{type_dir}/#{specific_dir}")
  cleanup_dirs << new_file_dir unless new_file_dir =~ /default$/
  system("mkdir -p #{new_file_dir}")
  new_file_name = File.join(new_file_dir, filename)
  cleanup_files << new_file_name
  new_file = File.open(new_file_name, "w")
  new_file.puts(specificity)
  new_file.close
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
cuken-0.1.22 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.21 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.20 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.19 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.18 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.17 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.16 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.15 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.13 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.12 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.11 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.10 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.9 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.8 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.7 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.4 lib/cuken/cucumber/chef/recipe_steps.rb
cuken-0.1.2 lib/cuken/cucumber/chef/recipe_steps.rb