Class: Chef::Knife::RoleToruby

Inherits:
Chef::Knife show all
Defined in:
lib/chef/knife/role_toruby.rb

Overview

Captialization has to be this way to make toruby one word in the command

Instance Method Summary collapse

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/chef/knife/role_toruby.rb', line 11

def run
  
  #Get Arguments
  if @name_args.size != 1
    ui.info("Please specify a role name")
    show_usage
    exit 1
  end

  role_name = @name_args.first

  role = Chef::Role.load(role_name)

  output(Chef::RubyCompat.to_ruby(role))

end