Class: Flatrack::CLI
- Inherits:
-
Thor
- Object
- Thor
- Flatrack::CLI
- Includes:
- FileUtils, Thor::Actions
- Defined in:
- lib/flatrack/cli.rb
Overview
The command line interface for flatrack
Constant Summary collapse
- SRC_ROOT =
File.join Flatrack.gem_root, 'flatrack/cli/templates'
- KEEP_DIRS =
[ 'assets/stylesheets', 'assets/javascripts', 'assets/images', 'pages', 'layouts', 'partials' ]
- FILES =
{ '.gitignore' => '.gitignore', 'boot.rb' => 'boot.rb', 'Rakefile' => 'Rakefile', 'Gemfile.erb' => 'Gemfile', 'config.ru' => 'config.ru', 'layout.html.erb' => 'layouts/layout.html.erb', 'page.html.erb' => 'pages/index.html.erb', 'stylesheet.css.scss' => 'assets/stylesheets/main.css.scss', 'javascript.js.coffee' => 'assets/javascripts/main.js.coffee' }
- BIN_COPY_FILES =
{ 'logo.png' => 'assets/images/logo.png' }
Instance Method Summary collapse
-
#__default__ ⇒ Object
Info about flatrack.
-
#new(path) ⇒ Object
Create a new app.
-
#start ⇒ Object
Start the app.
Instance Method Details
#__default__ ⇒ Object
Info about flatrack
77 78 79 80 81 82 |
# File 'lib/flatrack/cli.rb', line 77 def __default__ if [:version] puts 'Flatrack ' + Flatrack::VERSION return end end |
#new(path) ⇒ Object
Create a new app
49 50 51 52 53 54 55 56 57 |
# File 'lib/flatrack/cli.rb', line 49 def new(path) mkdir_p path full_path = File. path @name = File.basename(full_path).titleize self.destination_root = full_path write_keeps write_files bundle! end |
#start ⇒ Object
Start the app
64 65 66 67 68 69 70 71 72 |
# File 'lib/flatrack/cli.rb', line 64 def start require './boot' run_opts = {} run_opts[:app] = Flatrack::Site run_opts[:Port] = [:port] run_opts[:Logger] = Logger.new('/dev/null') unless [:verbose] run_opts[:AccessLog] = Logger.new('/dev/null') unless [:verbose] Rack::Server.start run_opts end |