Sha256: fc0920c69cfeb3d2b03278d889122ef35edbfe85cebb0eac6e989168ec39c23d

Contents?: true

Size: 657 Bytes

Versions: 43

Compression:

Stored size: 657 Bytes

Contents

require 'rake'

namespace :chef_cap do
  desc "Install chefcap JSON and cookbooks for the first time"
  task :install => :environment do
    require "fileutils"
    templates_path = File.join(File.dirname(__FILE__), "..", "generators", "chef_cap", "templates", "chef")

    FileUtils.cp_r File.join(templates_path, "..", "Capfile"), File.join(Rails.root, "Capfile")

    if File.exist?(Rails.root + "chef/node.json") || File.directory?(Rails.root + "chef/cookbooks")
      puts "Already initialized chef_cap?"
    else
      FileUtils.mkdir_p(Rails.root + "chef")
      FileUtils.cp_r Dir.glob(templates_path, "/*"), (Rails.root + "chef")
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
chef_cap-0.3.23 lib/chef_cap/tasks.rb
chef_cap-0.3.22 lib/chef_cap/tasks.rb
chef_cap-0.3.21 lib/chef_cap/tasks.rb
chef_cap-0.3.20 lib/chef_cap/tasks.rb
chef_cap-0.3.19 lib/chef_cap/tasks.rb
chef_cap-0.3.18 lib/chef_cap/tasks.rb
chef_cap-0.3.17 lib/chef_cap/tasks.rb
chef_cap-0.3.16 lib/chef_cap/tasks.rb
chef_cap-0.3.15 lib/chef_cap/tasks.rb
chef_cap-0.3.14 lib/chef_cap/tasks.rb
chef_cap-0.3.13 lib/chef_cap/tasks.rb
chef_cap-0.3.12 lib/chef_cap/tasks.rb
chef_cap-0.3.11 lib/chef_cap/tasks.rb
chef_cap-0.3.10 lib/chef_cap/tasks.rb
chef_cap-0.3.9 lib/chef_cap/tasks.rb
chef_cap-0.3.8 lib/chef_cap/tasks.rb
chef_cap-0.3.7 lib/chef_cap/tasks.rb
chef_cap-0.3.6 lib/chef_cap/tasks.rb
chef_cap-0.3.5 lib/chef_cap/tasks.rb
chef_cap-0.3.4 lib/chef_cap/tasks.rb