Class: TexturePacker::Cli::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/texture_packer/cli/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Options

Returns a new instance of Options.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/texture_packer/cli/options.rb', line 9

def initialize(argv)
  OptionParser.new do |opts|
    opts.on('-v', '--version', 'show the version number') do
      @hook_run = ->{ puts(TexturePacker::VERSION) }
    end

    opts.on('-h', '--help', 'Prints this help') do
      @hook_run = ->{ puts(opts) }
    end

    opts.on('-pPATH', '--project_dir=PATH', 'Copy the generated scss files / images to specified project') do |val|
      @project_dir = val
    end
  end.parse!(argv)
end

Instance Attribute Details

#hook_runObject (readonly)

Returns the value of attribute hook_run.



6
7
8
# File 'lib/texture_packer/cli/options.rb', line 6

def hook_run
  @hook_run
end

#project_dirObject (readonly)

Returns the value of attribute project_dir.



7
8
9
# File 'lib/texture_packer/cli/options.rb', line 7

def project_dir
  @project_dir
end