Sha256: e5d85b3451a73d9a7680f8f861ab92a208467dd986134fef38ccb7083a1be8ef
Contents?: true
Size: 734 Bytes
Versions: 17
Compression:
Stored size: 734 Bytes
Contents
require 'puppetfactory' class Puppetfactory::Plugins::Logs < Puppetfactory::Plugins def initialize(options) super(options) return unless options[:puppetfactory] @logfile = options[:logfile] server = options[:puppetfactory] # Add a web route to the puppetfactory server. Must happen in the initializer server.get '/logs' do protected! erb :logs end server.get '/logs/data' do protected! plugin(:Logs, :data) end end def tabs(privileged = false) return unless privileged # only show this tab to admin users # url path => display title { 'logs' => 'Logs' } end def data File.read(@logfile) rescue "Cannot read logfile #{@logfile}" end end
Version data entries
17 entries across 17 versions & 1 rubygems