Class: ZAssets::CLI
- Inherits:
-
Object
- Object
- ZAssets::CLI
- Defined in:
- lib/zassets/cli.rb
Constant Summary collapse
- ACTIONS =
%w(build serve)
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #builder ⇒ Object
- #config ⇒ Object
-
#initialize(args, stdout = $stdout) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
- #server ⇒ Object
Constructor Details
#initialize(args, stdout = $stdout) ⇒ CLI
Returns a new instance of CLI.
9 10 11 12 13 |
# File 'lib/zassets/cli.rb', line 9 def initialize(args, stdout = $stdout) @stdout = stdout @action = :build args_parse! args end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
7 8 9 |
# File 'lib/zassets/cli.rb', line 7 def action @action end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/zassets/cli.rb', line 7 def @options end |
Instance Method Details
#builder ⇒ Object
28 29 30 |
# File 'lib/zassets/cli.rb', line 28 def builder @builder ||= Builder.new config end |
#config ⇒ Object
15 16 17 |
# File 'lib/zassets/cli.rb', line 15 def config @config ||= Config.new @options end |
#run ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/zassets/cli.rb', line 19 def run case @action when :serve server.run when :build builder.build end end |