Class: Hanami::Assets::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/sprockets/cli.rb

Overview

Since:

  • 0.1.0

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CLI

Returns a new instance of CLI.

Since:

  • 0.1.0



16
17
18
19
20
21
# File 'lib/hanami/sprockets/cli.rb', line 16

def initialize(args)
  @args = args
  @command = nil
  @options = {}
  @root = Pathname.pwd
end

Class Method Details

.start(args) ⇒ Object

Since:

  • 0.1.0



11
12
13
# File 'lib/hanami/sprockets/cli.rb', line 11

def start(args)
  new(args).call
end

Instance Method Details

#callObject

Since:

  • 0.1.0



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/hanami/sprockets/cli.rb', line 23

def call
  parse_options

  case @command
  when "compile"
    compile
  when "watch"
    watch
  else
    show_help
  end
end