Class: Middleman::Cli::BuildAction
- Inherits:
-
Thor::Actions::EmptyDirectory
- Object
- Thor::Actions::EmptyDirectory
- Middleman::Cli::BuildAction
- Defined in:
- lib/middleman-core/cli/build.rb
Overview
A Thor Action, modular code, which does the majority of the work.
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(base, config = {}) ⇒ BuildAction
constructor
Setup the action.
-
#invoke!
Execute the action.
Constructor Details
#initialize(base, config = {}) ⇒ BuildAction
Setup the action
112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/middleman-core/cli/build.rb', line 112 def initialize(base, config={}) @app = base.class.shared_instance @source_dir = Pathname(@app.source_dir) @build_dir = Pathname(@app.build_dir) @to_clean = Set.new @logger = @app.logger @rack = ::Rack::Test::Session.new(@app.class.to_rack_app) super(base, @build_dir, config) end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
106 107 108 |
# File 'lib/middleman-core/cli/build.rb', line 106 def logger @logger end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
105 106 107 |
# File 'lib/middleman-core/cli/build.rb', line 105 def source @source end |
Instance Method Details
#invoke!
This method returns an undefined value.
Execute the action
126 127 128 129 130 |
# File 'lib/middleman-core/cli/build.rb', line 126 def invoke! queue_current_paths if should_clean? execute! clean! if should_clean? end |