Sha256: a8e58732b22d5f464e1539b4f44b95bb1dd237e33adfa763e836b271f6e9a9d7

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

require 'thor'
require 'valise'
require 'rhet-butler/configuration'
require 'rhet-butler/file-manager'

module RhetButler
  class CommandLine < ::Thor
    def self.shared_options
      method_option :sources, :type => :array
      method_option :root_slide, :type => :string
    end

    desc "static", "Builds a static version of the presentation"
    method_option :target, :type => :string
    shared_options
    def static
      require 'rhet-butler/static-generator'

      file_manager = FileManager.new(options)
      generator = StaticGenerator.new(file_manager)

      generator.go!
    end

    desc "check", "Load slide set to check syntax"
    shared_options
    def check
      require 'rhet-butler/web/main-app'

      file_manager = FileManager.new(options)
      app = Web::MainApp.new(file_manager)

      say "Slides loaded and parsed"
      say "  #{app.viewer_app.slides.length} slides loaded"
      say "  Serving slides and assets found in: #{app.slides}"
    end

    desc "serve", "Run the presentation server"
    shared_options
    def serve
      require 'rhet-butler/web/main-app'

      file_manager = FileManager.new(options)
      app = Web::MainApp.new(file_manager)
      app.check
      app.start
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhet-butler-0.5.0 lib/rhet-butler/command-line.rb