Sha256: eeefeef788deae5337486c5e4fe42e38b26a589b643f1b7471e5db9814e236d9

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

module Hyla
  module Commands
    class Build < Command

      def process(options)
        training = Hyla::Training.new(options)
        build(training, options)
      end

      #
      #
      #
      def build(training, options)
        source = options['source']
        destination = options['destination']
        Hyla.logger2.info "Source: ", source
        Hyla.logger2.info "Destination: ", destination
        print Hyla.logger2.formatted_topic "Generating..."
        self.process_training(training)
        puts "done."
      end

      # Static: Run Training#process and catch errors
      #
      # training - the Hyla::Training object
      #
      # Returns nothing
      def self.process_training(training)
        training.process
      rescue Hyla::FatalException => e
        puts
        Hyla.logger2.error "ERROR:", "YOUR TRAINING COULD NOT BE BUILT:"
        Hyla.logger2.error "", "------------------------------------"
        Hyla.logger2.error "", e.message
        exit(1)
      end

    end # class
  end # module Commands
end # module Hyla

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hyla-1.0.9 lib/hyla/commands/build.rb
hyla-1.0.9.pre.3 lib/hyla/commands/build.rb
hyla-1.0.9.pre.2 lib/hyla/commands/build.rb
hyla-1.0.9.pre.1 lib/hyla/commands/build.rb
hyla-1.0.8 lib/hyla/commands/build.rb
hyla-1.0.7 lib/hyla/commands/build.rb
hyla-1.0.7.pre.9 lib/hyla/commands/build.rb
hyla-1.0.7.pre.8 lib/hyla/commands/build.rb