Class: Geb::CLI::Commands::Build
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Geb::CLI::Commands::Build
- Defined in:
- lib/geb/commands/build.rb
Overview
Define build command
Instance Method Summary collapse
-
#call(**options) ⇒ Object
Call method for the build command.
Instance Method Details
#call(**options) ⇒ Object
Call method for the build command
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/geb/commands/build.rb', line 29 def call(**) # initialise a new site and load the site from the current directory site = Geb::Site.new site.load(Dir.pwd) # build the pages unless the skip_pages option is set # it is important to build assets first as there may be pages in the assets directory Geb.log "Skipping building pages as told." if [:skip_pages] site.build_pages unless [:skip_pages] # build the assets (images, css, js) unless the skip_assets option is set Geb.log "Skipping building assets as told." if [:skip_assets] site.build_assets unless [:skip_assets] # put a smartarse message to the console if both options are set Geb.log "You told me to skip everything, so I did." if [:skip_assets] && [:skip_pages] rescue Geb::Error => e # print error message puts warn e. end |