Class: Plate::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/plate/cli.rb

Constant Summary collapse

DEPENDENCIES =

:nocov:

%w(
  bootstrap
  font-awesome
  jquery
  google-code-prettify
  vue
)

Instance Method Summary collapse

Instance Method Details

#compile(source) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/plate/cli.rb', line 26

def compile(source)
  output = options[:o]
  skeleton = File.expand_path('../../../skeleton/app', __FILE__)
  vendor = File.expand_path('../../../skeleton/vendor', __FILE__)

  plt, dir = read_plt(source)

  compiler = Compiler.new
  compiler.compile(plt)

  directory(skeleton, output)
  DEPENDENCIES.each do |d|
    directory(File.join(vendor, d), File.join(output, 'vendor', d))
  end

  build_html(output, compiler)
  build_js(output, compiler)
  build_css(output, compiler, vendor)

  if dir
    directory(File.join(Dir.pwd, source), output)
    remove_file(File.join(Dir.pwd, output, 'index.plt'))
  end

end

#versionObject

:nocov:



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

def version
  say "Plate version #{Plate::VERSION}"
end