Class: Parklife::CLI
- Inherits:
-
Thor
- Object
- Thor
- Parklife::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/parklife/cli.rb
Instance Method Summary collapse
- #build ⇒ Object
- #config ⇒ Object
- #get(path) ⇒ Object
- #init ⇒ Object
- #routes ⇒ Object
- #version ⇒ Object
Instance Method Details
#build ⇒ Object
14 15 16 |
# File 'lib/parklife/cli.rb', line 14 def build application.build end |
#config ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/parklife/cli.rb', line 19 def config reporter = application.config.reporter shell.print_table([ ['app', application.config.app.inspect], ['base', application.config.base.to_s], ['build_dir', application.config.build_dir], ['nested_index', application.config.nested_index], ['on_404', application.config.on_404.inspect], ['parklife-rails', defined?(::Parklife::Rails) ? 'enabled' : '-'], ['parklife/sinatra', defined?(::Parklife::Sinatra) ? 'enabled' : '-'], ['reporter', reporter == $stdout ? '$stdout' : reporter], ]) end |
#get(path) ⇒ Object
35 36 37 |
# File 'lib/parklife/cli.rb', line 35 def get(path) puts application.crawler.get(path).body end |
#init ⇒ Object
43 44 45 46 47 48 |
# File 'lib/parklife/cli.rb', line 43 def init template('Parkfile.erb', 'Parkfile') template('static_build.erb', 'bin/static-build') chmod('bin/static-build', 0755) copy_file('github_pages.yml', '.github/workflows/parklife.yml') if [:github_pages] end |
#routes ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/parklife/cli.rb', line 51 def routes shell.print_table( application.routes.map { |route| [route.path, route.crawl ? "crawl=true" : nil] } ) end |
#version ⇒ Object
61 62 63 |
# File 'lib/parklife/cli.rb', line 61 def version puts Parklife::VERSION end |