Class: TexturePacker::Cli::Options
- Inherits:
-
Object
- Object
- TexturePacker::Cli::Options
- Defined in:
- lib/texture_packer/cli/options.rb
Instance Attribute Summary collapse
-
#hook_run ⇒ Object
readonly
Returns the value of attribute hook_run.
-
#project_dir ⇒ Object
readonly
Returns the value of attribute project_dir.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Options
constructor
A new instance of Options.
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_run ⇒ Object (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_dir ⇒ Object (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 |