class Kamaze::Project::Tools::Packager

Provides a packager

Packager is intended to provide basic packaging operations @abstract

Attributes

fs[R]

Get filesystem

@return [Kamaze::Project::Tools::Packager::Filesystem]

Public Class Methods

new() { |self| ... } click to toggle source
Calls superclass method Kamaze::Project::Tools::BaseTool::new
# File lib/kamaze/project/tools/packager.rb, line 31
def initialize
  @initialized = false
  # fs mutable attributes are accessibles during initialization
  # @see method_missing
  @fs = Filesystem.new

  yield self if block_given?

  super

  @initialized = true
end

Public Instance Methods

initialized?() click to toggle source

Denote class is initialized

@return [Boolean]

# File lib/kamaze/project/tools/packager.rb, line 47
def initialized?
  @initialized
end
method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/kamaze/project/tools/packager.rb, line 51
def method_missing(method, *args, &block)
  if respond_to_missing?(method)
    unless initialized?
      mutable = fs.mutable_attribute?(method)

      return fs.__send__(method, *args, &block) if mutable
    end

    return fs.public_send(method, *args, &block)
  end

  super
end
respond_to_missing?(method, include_private = false) click to toggle source
Calls superclass method
# File lib/kamaze/project/tools/packager.rb, line 65
def respond_to_missing?(method, include_private = false)
  if method.to_s[-1] == '='
    unless initialized?
      return true if fs.mutable_attribute?(method)
    end
  end

  return true if fs.respond_to?(method, include_private)

  super(method, include_private)
end