Sha256: 9027e2e3519127f25187b2fd1a9de13be1e5042b7b7d3e8587dbfcbf2c168353

Contents?: true

Size: 796 Bytes

Versions: 2

Compression:

Stored size: 796 Bytes

Contents

Capricorn.runtime_gem('thor', Capricorn::THOR_VERSION)

class Thor
  class << self
    attr_accessor :real_namespace # :nodoc:
  end
  def self.namespace=(value)
    Thor.real_namespace = value
  end
  def self.namespace
    Thor.real_namespace
  end
  self.namespace = nil
end

module Thor::Util # :nodoc:
  class << self
    alias_method :old_constant_to_thor_path, :constant_to_thor_path
    alias_method :old_constant_from_thor_path, :constant_from_thor_path
  end
  
  def self.constant_to_thor_path(*args) # :nodoc:
    path = old_constant_to_thor_path(*args)
    path.sub! /^#{Thor.namespace}:/, '' if Thor.namespace
    path
  end
  
  def self.constant_from_thor_path(path) # :nodoc:
    path = "#{Thor.namespace}:"+path if Thor.namespace
    old_constant_from_thor_path(path)
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
simonmenke-capricorn-0.2.00 lib/capricorn/extentions/thor_extentions.rb
capricorn-0.2.00 lib/capricorn/extentions/thor_extentions.rb