Class: Gem::Specification

### Home Classes Methods

### In Files

- lib/bundler/resolver.rb
- lib/bundler/rubygems_ext.rb

### Parent

Object

### Methods

- #full_gem_path
- #gem_dir
- #git_version
- #groups
- #load_paths
- #loaded_from
- #nondevelopment_dependencies
- #required_by
- #rg_full_gem_path
- #rg_loaded_from
- #to_gemfile

### Included Modules

- Bundler::MatchPlatform

### Files

- bundle
- bundle-config
- bundle-config.txt
- bundle-exec
- bundle-exec.txt
- bundle-install
- bundle-install.txt
- bundle-package
- bundle-package.txt
- bundle-platform
- bundle-platform.txt
- bundle-update
- bundle-update.txt
- bundle.txt
- gemfile.5.txt
- Executable
- Gemfile

### Class/Module Index

Quicksearch

- Bundler
- Bundler::BundlerError
- Bundler::CLI
- Bundler::Definition
- Bundler::DepProxy
- Bundler::Dependency
- Bundler::Deployment
- Bundler::Deprecate
- Bundler::DeprecatedError
- Bundler::Dsl
- Bundler::EndpointSpecification
- Bundler::Env
- Bundler::Environment
- Bundler::Fetcher
- Bundler::Fetcher::CertificateFailureError
- Bundler::Fetcher::FallbackError
- Bundler::Fetcher::SSLError
- Bundler::GemHelper
- Bundler::GemHelpers
- Bundler::GemInstaller
- Bundler::GemNotFound
- Bundler::GemfileError
- Bundler::GemfileNotFound
- Bundler::GemspecError
- Bundler::GitError
- Bundler::Graph
- Bundler::Graph::GraphVizClient
- Bundler::HTTPError
- Bundler::Index
- Bundler::Injector
- Bundler::InstallError
- Bundler::InstallHookError
- Bundler::Installer
- Bundler::InvalidOption
- Bundler::InvalidSpecSet
- Bundler::LazySpecification
- Bundler::LockfileError
- Bundler::LockfileParser
- Bundler::MarshalError
- Bundler::MatchPlatform
- Bundler::PathError
- Bundler::ProductionError
- Bundler::RemoteSpecification
- Bundler::Resolver
- Bundler::Resolver::SpecGroup
- Bundler::RubyDsl
- Bundler::RubyVersion
- Bundler::RubyVersionMismatch
- Bundler::RubygemsIntegration
- Bundler::RubygemsIntegration::AlmostModern
- Bundler::RubygemsIntegration::Ancient
- Bundler::RubygemsIntegration::Future
- Bundler::RubygemsIntegration::Gem
- Bundler::RubygemsIntegration::Gem::SourceIndex
- Bundler::RubygemsIntegration::Legacy
- Bundler::RubygemsIntegration::Modern
- Bundler::RubygemsIntegration::Transitional
- Bundler::Runtime
- Bundler::SecurityError
- Bundler::Settings
- Bundler::SharedHelpers
- Bundler::SimilarityDetector
- Bundler::Source
- Bundler::Source::Git
- Bundler::Source::Git::GitProxy
- Bundler::Source::Path
- Bundler::Source::Path::Installer
- Bundler::Source::Rubygems
- Bundler::SpecSet
- Bundler::SystemRubyVersion
- Bundler::UI
- Bundler::UI::RGProxy
- Bundler::UI::Shell
- Bundler::VersionConflict
- Gem
- Gem::Dependency
- Gem::Platform
- Gem::Requirement
- Gem::Specification
- Object

No matching classes.

# Gem::Specification

### Attributes

location[RW]
relative_loaded_from[RW]
source[RW]

### Public Instance Methods

full_gem_path() click to toggle source

    # File lib/bundler/rubygems_ext.rb, line 21
    def full_gem_path
      source.respond_to?(:path) ?
        Pathname.new(loaded_from).dirname.expand_path(Bundler.root).to_s :
        rg_full_gem_path
    end

Also aliased as: rg_full_gem_path
gem_dir() click to toggle source

    # File lib/bundler/rubygems_ext.rb, line 45
    def gem_dir
      full_gem_path
    end

git_version() click to toggle source

    # File lib/bundler/rubygems_ext.rb, line 53
    def git_version
      if @loaded_from && File.exist?(File.join(full_gem_path, ".git"))
        sha = Dir.chdir(full_gem_path){ `git rev-parse HEAD`.strip }
        " #{sha[0..6]}"
      end
    end

groups() click to toggle source

    # File lib/bundler/rubygems_ext.rb, line 49
    def groups
      @groups ||= []
    end

load_paths() click to toggle source

    # File lib/bundler/rubygems_ext.rb, line 33
    def load_paths
      require_paths.map do |require_path|
        if require_path.include?(full_gem_path)
          require_path
        else
          File.join(full_gem_path, require_path)
        end
      end
    end

loaded_from() click to toggle source

    # File lib/bundler/rubygems_ext.rb, line 27
    def loaded_from
      relative_loaded_from ?
        source.path.join(relative_loaded_from).to_s :
        rg_loaded_from
    end

Also aliased as: rg_loaded_from
nondevelopment_dependencies() click to toggle source

    # File lib/bundler/rubygems_ext.rb, line 70
    def nondevelopment_dependencies
      dependencies - development_dependencies
    end

required_by() click to toggle source

    # File lib/bundler/resolver.rb, line 11
    def required_by
      @required_by ||= []
    end

rg_full_gem_path() click to toggle source
Alias for: full_gem_path
rg_loaded_from() click to toggle source
Alias for: loaded_from
to_gemfile(path = nil) click to toggle source

    # File lib/bundler/rubygems_ext.rb, line 60
    def to_gemfile(path = nil)
      gemfile = "source :gemcutter\n"
      gemfile << dependencies_to_gemfile(nondevelopment_dependencies)
      unless development_dependencies.empty?
        gemfile << "\n"
        gemfile << dependencies_to_gemfile(development_dependencies, :development)
      end
      gemfile
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.