Class: Middleman::Presentation::Cli::ServePresentation
- Inherits:
-
BaseGroup
- Object
- Thor::Group
- BaseGroup
- Middleman::Presentation::Cli::ServePresentation
- Includes:
- Thor::Actions
- Defined in:
- lib/middleman-presentation-core/cli/serve_presentation.rb
Overview
This class provides an ‘build presentation’ command for the middleman CLI.
Instance Method Summary collapse
Methods included from Shared
#assets_loader, #bower_path, #enable_debug_mode, included, #open_in_editor
Instance Method Details
#build_presentation ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/middleman-presentation-core/cli/serve_presentation.rb', line 17 def build_presentation Middleman::Presentation.logger.info Middleman::Presentation.t( 'views.presentation.serve.headline', title: Middleman::Presentation.config.title ) Launchy.open(Addressable::URI.parse("http://#{[:hostname]}:#{[:network_port]}")) if [:open_in_browser] cmd = [] cmd << 'middleman server' cmd << "-p #{[:network_port]}" cmd << "-h #{[:hostname]}" unless [:hostname].nil? || [:hostname].empty? cmd << '--verbose' if [:debug_mode] run(cmd.join(' ')) end |
#initialize_generator ⇒ Object
13 14 15 |
# File 'lib/middleman-presentation-core/cli/serve_presentation.rb', line 13 def initialize_generator enable_debug_mode end |