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:



173
174
175
176
177
178
179
180
181
182
183
# File 'lib/middleman-core/cli/build.rb', line 173

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.



167
168
169
# File 'lib/middleman-core/cli/build.rb', line 167

def logger
  @logger
end

#sourceObject (readonly)

Returns the value of attribute source.



166
167
168
# File 'lib/middleman-core/cli/build.rb', line 166

def source
  @source
end

Instance Method Details

#invoke!void

This method returns an undefined value.

Execute the action



187
188
189
190
191
# File 'lib/middleman-core/cli/build.rb', line 187

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