Class: Middleman::Cli::GlobAction

Inherits:
Thor::Actions::EmptyDirectory
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(base, config = {}) ⇒ GlobAction

Setup the action

Parameters:



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.expand_path(base.find_in_source_paths(source.to_s))

  @logger = Middleman::Cli::Build.shared_instance.logger

  super(base, @destination, config)
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



176
177
178
# File 'lib/middleman-core/cli/build.rb', line 176

def logger
  @logger
end

#sourceObject (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