Class: KnifeSharp::SharpHistory

Inherits:
Chef::Knife
  • Object
show all
Includes:
Common
Defined in:
lib/chef/knife/sharp-history.rb

Instance Method Summary collapse

Methods included from Common

included

Instance Method Details

#runObject



14
15
16
# File 'lib/chef/knife/sharp-history.rb', line 14

def run
  show_logs()
end

#show_logsObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/chef/knife/sharp-history.rb', line 18

def show_logs()
  begin
    fp = File.open(File.expand_path(sharp_config["logging"]["destination"]), "r")
    fp.readlines.each do |line|
      puts line
    end
  rescue Exception => e
    ui.error "oops ! #{e.inspect}"
  end
end