lib/slideshow/cli/runner.rb in slideshow-1.2.4 vs lib/slideshow/cli/runner.rb in slideshow-1.2.5
- old
+ new
@@ -1,21 +1,24 @@
module Slideshow
class Runner
+ include LogUtils::Logging
+
include PluginHelper
- def initialize
- @logger = Logger.new(STDOUT)
- @logger.level = Logger::INFO
+ def initialize
@opts = Opts.new
- @config = Config.new( @logger, @opts )
+ @config = Config.new( @opts )
@headers = Headers.new( @config )
+
+ ## todo/fix: move into slideshow loader script - why? why not?
+ LogUtils::Logger.root.level = :info
end
- attr_reader :logger, :opts, :config, :headers
+ attr_reader :opts, :config, :headers
def find_file_with_known_extension( fn )
dirname = File.dirname( fn )
basename = File.basename( fn, '.*' )
@@ -122,11 +125,11 @@
cmd.on( "-h", "--help", "Show this message" ) do
puts <<EOS
-Slide Show (S9) is a free web alternative to PowerPoint or KeyNote in Ruby
+Slide Show (S9) is a free web alternative to PowerPoint or Keynote in Ruby
#{cmd.help}
Examples:
slideshow microformats
@@ -142,12 +145,12 @@
slideshow -l # List installed slide show templates
slideshow -f s5blank # Fetch (install) S5 blank starter template from internet
slideshow -t s5blank microformats # Use your own slide show templates (e.g. s5blank)
Further information:
- http://slideshow.rubyforge.org
-
+ http://slideshow-s9.github.io
+
EOS
exit
end
cmd.on( '-p', '--plugins', '(Debug) List Plugin Scripts in Load Path' ) { opts.plugins = true }
@@ -189,47 +192,47 @@
exit
end
cmd.on( "--verbose", "(Debug) Show debug trace" ) do
- logger.datetime_format = "%H:%H:%S"
- logger.level = Logger::DEBUG
+ LogUtils::Logger.root.level = :debug
+ opts.verbose = true
end
-
+
end
opt.parse!( args )
puts Slideshow.generator
- if logger.level == Logger::DEBUG
+ if opts.verbose?
# dump Slideshow settings
config.dump
puts
# dump Markdown settings
Markdown.dump
puts
end
if opts.list?
- List.new( logger, opts, config ).run ### todo: remove opts (merge access into config)
+ List.new( opts, config ).run ### todo: remove opts (merge access into config)
elsif opts.plugins?
- Plugins.new( logger, opts, config ).run ### todo: remove opts (merge access into config)
+ Plugins.new( opts, config ).run ### todo: remove opts (merge access into config)
elsif opts.generate?
- GenTemplates.new( logger, opts, config ).run ### todo: remove opts
+ GenTemplates.new( opts, config ).run ### todo: remove opts
elsif opts.quick?
- Quick.new( logger, opts, config ).run ### todo: remove opts
+ Quick.new( opts, config ).run ### todo: remove opts
elsif opts.fetch? || opts.fetch_all?
- Fetch.new( logger, opts, config ).run ### todo: remove opts
+ Fetch.new( opts, config ).run ### todo: remove opts
else
load_plugins # check for optional plugins/extension in ./lib folder
args.each do |arg|
files = find_files( arg )
files.each do |file|
### fix/todo: reset/clean headers
- Gen.new( logger, opts, config, headers ).create_slideshow( file )
+ Gen.new( opts, config, headers ).create_slideshow( file )
end
end
end
end
\ No newline at end of file