Module: Cucumber::Chef::Utility::ChefHelper

Included in:
Cucumber::Chef::Utility
Defined in:
lib/cucumber/chef/utility/chef_helper.rb

Instance Method Summary collapse

Instance Method Details

#chef_identityObject



45
46
47
48
49
# File 'lib/cucumber/chef/utility/chef_helper.rb', line 45

def chef_identity
  result = File.join(provider_dir, "#{chef_user}.pem")
  ensure_directory(result)
  result
end

#chef_pre_11Object



28
29
30
31
# File 'lib/cucumber/chef/utility/chef_helper.rb', line 28

def chef_pre_11
  return false if (Cucumber::Chef::Config.chef[:version].downcase == "latest")
  (Cucumber::Chef::Config.chef[:version].to_f < 11.0)
end

#chef_repoObject



33
34
35
# File 'lib/cucumber/chef/utility/chef_helper.rb', line 33

def chef_repo
  (Cucumber::Chef.locate_parent(".chef") rescue nil)
end

#chef_userObject



41
42
43
# File 'lib/cucumber/chef/utility/chef_helper.rb', line 41

def chef_user
  Cucumber::Chef::Config.user
end

#in_chef_repo?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/cucumber/chef/utility/chef_helper.rb', line 37

def in_chef_repo?
  ((chef_repo && File.exists?(chef_repo) && File.directory?(chef_repo)) ? true : false)
end