Class: Miyano::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/miyano/cli.rb

Instance Method Summary collapse

Instance Method Details

#new(dir) ⇒ Object



15
16
17
18
19
20
# File 'lib/miyano/cli.rb', line 15

def new(dir)
  url = "https://github.com/wuusn/miyano_template.git"
  `git clone --depth 1 #{url} #{dir}`
  `touch #{dir}/post/.compat` if options[:compat]
  `rm -rf #{dir}/.git*`
end

#tryObject



23
24
25
26
27
28
29
# File 'lib/miyano/cli.rb', line 23

def try
  root = "_site"
  server = WEBrick::HTTPServer.new :Port => 8000,
                                   :DocumentRoot => root
  trap "INT" do server.shutdown end
  server.start
end

#versionObject



9
10
11
# File 'lib/miyano/cli.rb', line 9

def version
  puts "Miyano #{Miyano::VERSION}"
end