Module: Kamaze::Project::Bundled

Defined in:
lib/kamaze/project/bundled.rb

Overview

Bundled behavior.

Allow to detect bundled execution due to gems.rb and gems.locked files presence, anddevelopment execution (gemspec.tpl file presence).

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/kamaze/project/bundled.rb', line 25

def included(base)
  base.extend(ClassMethods)

  Pathname.new(caller_locations.first.path).dirname.tap do |caller_path|
    (base.__send__(:base_path) || caller_path).tap do |basepath|
      base.__send__(:base_path=, Pathname(basepath).join('..'))
    end
  end
end