Class: Chef::Knife::RoleFromFile

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/knife/chop/role_from_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv = []) ⇒ RoleFromFile


Create a new instance of the current class configured for the given arguments and options



11
12
13
14
15
# File 'lib/chef/knife/chop/role_from_file.rb', line 11

def initialize(argv=[])
  super(argv)
  @rsrctype = 'role'
  @location = 'roles'
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/chef/knife/chop/role_from_file.rb', line 17

def run
  @name_args.each do |arg|
    updated = loader.load_from("roles", arg)

    updated.save

    output(format_for_display(updated)) if config[:print_after]

    ui.info("Updated Role #{updated.name}!")
  end
end