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:



183
184
185
186
187
188
189
190
191
192
193
# File 'lib/middleman-core/cli/build.rb', line 183

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.



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

def logger
  @logger
end

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

Instance Method Details

#invoke!void

This method returns an undefined value.

Execute the action



197
198
199
200
201
# File 'lib/middleman-core/cli/build.rb', line 197

def invoke!
  queue_current_paths if cleaning?
  execute!
  clean! if cleaning?
end