Class: Blender::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/blender/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/blender/cli.rb', line 24

def self.exit_on_failure?
  true
end

Instance Method Details

#from_file(*args) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/blender/cli.rb', line 57

def from_file(*args)
  Configuration[:noop] = options[:noop]
  Configuration[:arguments] = args
  des = File.read(options[:file])
  $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(options[:file]), 'lib')))
  scheduler_options = {
    config_file: options[:config_file],
    no_doc: options[:quiet]
  }
  Blender.blend(options[:file], scheduler_options) do |sch|
    sch.instance_eval(des, __FILE__, __LINE__)
  end
end

#scheduleObject



76
77
78
79
80
81
# File 'lib/blender/cli.rb', line 76

def schedule
  sched = Blender::Timer.new
  des = File.read(options[:schedule])
  sched.instance_eval(des, __FILE__, __LINE__)
  sched.join
end