Class: Sprite::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/sprite/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Runner

Returns a new instance of Runner.



5
6
7
# File 'lib/sprite/runner.rb', line 5

def initialize(args)
  self.options = set_options(args)
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/sprite/runner.rb', line 4

def options
  @options
end

Instance Method Details

#run!Object

run sprite creator



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/sprite/runner.rb', line 19

def run!
  begin
    Sprite::Builder.from_config(options[:path]).build
  # rescue Exception => e
  #   # catch errors
  #   puts "ERROR"
  #   puts e
  #   return 1
  end
  0
end

#set_options(args) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/sprite/runner.rb', line 9

def set_options(args)
  opts = {}
  # TODO
  # edit options with passed in args
  opts[:path] = args.first if args.any?

  opts
end