Class: Pantry::Chef::UploadDataBag

Inherits:
Pantry::Commands::UploadFile
  • Object
show all
Defined in:
lib/pantry/chef/upload_data_bag.rb

Overview

Upload a data bag file to the server

Instance Method Summary collapse

Instance Method Details

#prepare_message(options) ⇒ Object



28
29
30
31
32
# File 'lib/pantry/chef/upload_data_bag.rb', line 28

def prepare_message(options)
  options[:type] ||= File.basename(File.dirname(file_to_upload))
  Pantry.ui.say("Uploading data bag #{File.basename(file_to_upload)}...")
  super
end

#required_optionsObject



20
21
22
# File 'lib/pantry/chef/upload_data_bag.rb', line 20

def required_options
  %i(application)
end

#upload_directory(options) ⇒ Object



24
25
26
# File 'lib/pantry/chef/upload_data_bag.rb', line 24

def upload_directory(options)
  Pantry.root.join("applications", options[:application], "chef", "data_bags", options[:type])
end