Class: DynamicSprites::Runner
- Inherits:
-
Object
- Object
- DynamicSprites::Runner
- Defined in:
- lib/dynamic-sprites/runner.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(command, path, options = {}) ⇒ Runner
constructor
A new instance of Runner.
-
#run! ⇒ Object
Runs dynamic-sprites command.
Constructor Details
#initialize(command, path, options = {}) ⇒ Runner
Returns a new instance of Runner.
9 10 11 12 13 14 15 16 |
# File 'lib/dynamic-sprites/runner.rb', line 9 def initialize(command, path, = {}) @interface = Interface.new @command = command @path = Pathname.new(path) unless path.nil? @path ||= File.join(sass_directory, 'dynamic-sprites.sass') unless command.nil? @options = @options[:output] ||= "#{@path}.png" end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
4 5 6 |
# File 'lib/dynamic-sprites/runner.rb', line 4 def command @command end |
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
7 8 9 |
# File 'lib/dynamic-sprites/runner.rb', line 7 def interface @interface end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/dynamic-sprites/runner.rb', line 6 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/dynamic-sprites/runner.rb', line 5 def path @path end |
Instance Method Details
#run! ⇒ Object
Runs dynamic-sprites command.
20 21 22 23 24 25 26 27 |
# File 'lib/dynamic-sprites/runner.rb', line 20 def run! case command when 'init' generate_mixin! when 'generate' generate_sprite! end end |