class Gem::Tasks::Project


@api semipublic

def self.directories

Returns:
  • (Hash{String => Project}) -
def self.directories
  @@directories ||= Hash.new do |hash,key|
    hash[key] = new(key)
  end
end

def bundler?

Returns:
  • (Boolean) -
def bundler?
  @bundler
end

def gemspec(name=nil)

Returns:
  • (Gem::Specification) -

Parameters:
  • name (String) -- (@primary_gemspec)
def gemspec(name=nil)
  name ||= @primary_gemspec
  unless @gemspecs.has_key?(name)
    raise(ArgumentError,"unknown gemspec: #{name}")
  end
  return @gemspecs[name]
end

def initialize(root=Dir.pwd)

Parameters:
  • root (String) --
def initialize(root=Dir.pwd)
  @root = root
  @name = File.basename(@root)
  @scm, _ = SCM_DIRS.find do |scm,dir|
              File.directory?(File.join(@root,dir))
            end
  Dir.chdir(@root) do
    @gemspecs = Hash[Dir['*.gemspec'].map { |path|
      [File.basename(path,'.gemspec'), Specification.load(path)]
    }]
  end
  @primary_gemspec = if @gemspecs.has_key?(@name)
                       @name
                     else
                       @gemspecs.keys.sort.first
                     end
  @builds = {}
  @gemspecs.each do |name,gemspec|
    @builds[name] = Hash.new do |packages,format|
      packages[format] = File.join(PKG_DIR,"#{gemspec.full_name}.#{format}")
    end
  end
  @bundler = File.file?(File.join(@root,'Gemfile'))
end