Class: Middleman::Cli::GlobAction
- Inherits:
-
Thor::Actions::EmptyDirectory
- Object
- Thor::Actions::EmptyDirectory
- Middleman::Cli::GlobAction
- 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 = {}) ⇒ GlobAction
constructor
Setup the action.
-
#invoke! ⇒ void
Execute the action.
Constructor Details
#initialize(base, config = {}) ⇒ GlobAction
Setup the action
182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/middleman-core/cli/build.rb', line 182 def initialize(base, config={}) @app = base.class.shared_instance source = @app.source @destination = @app.build_dir @source = File.(base.find_in_source_paths(source.to_s)) @logger = Middleman::Cli::Build.shared_instance.logger super(base, @destination, config) end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
176 177 178 |
# File 'lib/middleman-core/cli/build.rb', line 176 def logger @logger end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
175 176 177 |
# File 'lib/middleman-core/cli/build.rb', line 175 def source @source end |
Instance Method Details
#invoke! ⇒ void
This method returns an undefined value.
Execute the action
196 197 198 199 200 |
# File 'lib/middleman-core/cli/build.rb', line 196 def invoke! queue_current_paths if cleaning? execute! clean! if cleaning? end |