Module: KnifeBriefcase::Knife
- Included in:
- Chef::Knife::BriefcaseDelete, Chef::Knife::BriefcaseGet, Chef::Knife::BriefcaseList, Chef::Knife::BriefcasePut, Chef::Knife::BriefcaseReload
- Defined in:
- lib/knife-briefcase/knife.rb
Class Method Summary collapse
Instance Method Summary collapse
- #data_bag_name ⇒ Object
- #file ⇒ Object
- #highline ⇒ Object
- #item_name ⇒ Object
- #recipients ⇒ Object
- #signers ⇒ Object
Class Method Details
.deps ⇒ Object
5 6 7 8 9 |
# File 'lib/knife-briefcase/knife.rb', line 5 def self.deps super do yield if block_given? end end |
.inherited(c) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/knife-briefcase/knife.rb', line 11 def self.inherited(c) super c.class_eval do deps do require 'chef/data_bag' require 'chef/data_bag_item' require 'gpgme' require 'highline' end category 'briefcase' option :data_bag, :long => '--data-bag DATA_BAG_NAME', :description => 'Name of the data bag' end end |
Instance Method Details
#data_bag_name ⇒ Object
29 30 31 |
# File 'lib/knife-briefcase/knife.rb', line 29 def data_bag_name config[:data_bag] || Chef::Config[:briefcase_data_bag] || 'briefcase' end |
#file ⇒ Object
51 52 53 54 |
# File 'lib/knife-briefcase/knife.rb', line 51 def file rv = @name_args[1] rv == '-' ? nil : rv end |
#highline ⇒ Object
45 46 47 48 49 |
# File 'lib/knife-briefcase/knife.rb', line 45 def highline super rescue NameError @highline ||= HighLine.new end |
#item_name ⇒ Object
41 42 43 |
# File 'lib/knife-briefcase/knife.rb', line 41 def item_name @name_args.first end |
#recipients ⇒ Object
37 38 39 |
# File 'lib/knife-briefcase/knife.rb', line 37 def recipients Chef::Config[:briefcase_holders] end |
#signers ⇒ Object
33 34 35 |
# File 'lib/knife-briefcase/knife.rb', line 33 def signers Chef::Config[:briefcase_signers] end |