Sha256: e99bf2c93ca4a6e1366997f26538a5cd8fd8c47cc66b4a8e5c2c0682685928fc

Contents?: true

Size: 1.94 KB

Versions: 14

Compression:

Stored size: 1.94 KB

Contents

################################################################################
#
#      Author: Stephen Nelson-Smith <stephen@atalanta-systems.com>
#      Author: Zachary Patten <zachary@jovelabs.com>
#   Copyright: Copyright (c) 2011-2013 Atalanta Systems Ltd
#     License: Apache License, Version 2.0
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#
################################################################################

module Cucumber::Chef::Helpers::Chef

################################################################################

  def create_data_bag(data_bag, data_bag_path)
    $cc_client.test_lab.knife_cli(%(data bag create "#{data_bag}"), :silence => true)
    $cc_client.test_lab.knife_cli(%(data bag from file "#{data_bag}" "#{data_bag_path}"), :silence => true)
  end

  def delete_data_bag(data_bag)
    $cc_client.test_lab.knife_cli(%(data bag delete "#{data_bag}" --yes), :silence => true)
  end

################################################################################

  def role_from_file(role, role_path)
    if File.extname(role).empty?
      Dir.glob(File.join(role_path, "#{role}.*")).each do |role_file|
        $cc_client.test_lab.knife_cli(%(role from file #{role_file}), :silence => true)
      end
    else
      $cc_client.test_lab.knife_cli(%(role from file #{File.join(role_path, role)}), :silence => true)
    end
  end

end

################################################################################

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
cucumber-chef-3.0.8 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.7 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.6 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.5 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.4 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.3 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.2 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.1 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.0 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.0.rc.5 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.0.rc.4 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.0.rc.3 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.0.rc.2 lib/cucumber/chef/helpers/chef.rb
cucumber-chef-3.0.0.rc.1 lib/cucumber/chef/helpers/chef.rb