Class: Gem::Resolver::GitSpecification

Inherits:
SpecSpecification show all
Defined in:
lib/rubygems/resolver/git_specification.rb

Overview

A GitSpecification represents a gem that is sourced from a git repository and is being loaded through a gem dependencies file through the git: option.

Instance Attribute Summary

Attributes inherited from Specification

#dependencies, #name, #platform, #set, #source, #spec, #version

Instance Method Summary collapse

Methods inherited from SpecSpecification

#dependencies, #full_name, #initialize, #name, #platform, #version

Methods inherited from Specification

#download, #fetch_development_dependencies, #full_name, #initialize, #installable_platform?, #local?

Constructor Details

This class inherits a constructor from Gem::Resolver::SpecSpecification

Instance Method Details

#==(other) ⇒ Object

:nodoc:


9
10
11
12
13
14
# File 'lib/rubygems/resolver/git_specification.rb', line 9

def ==(other) # :nodoc:
  self.class === other and
    @set  == other.set and
    @spec == other.spec and
    @source == other.source
end

#add_dependency(dependency) ⇒ Object

:nodoc:


16
17
18
# File 'lib/rubygems/resolver/git_specification.rb', line 16

def add_dependency(dependency) # :nodoc:
  spec.dependencies << dependency
end

#install(options = {}) {|installer| ... } ⇒ Object

Installing a git gem only involves building the extensions and generating the executables.

Yields:

  • (installer)

24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rubygems/resolver/git_specification.rb', line 24

def install(options = {})
  require 'rubygems/installer'

  installer = Gem::Installer.for_spec spec, options

  yield installer if block_given?

  installer.run_pre_install_hooks
  installer.build_extensions
  installer.run_post_build_hooks
  installer.generate_bin
  installer.run_post_install_hooks
end

#pretty_print(q) ⇒ Object

:nodoc:


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/rubygems/resolver/git_specification.rb', line 38

def pretty_print(q) # :nodoc:
  q.group 2, '[GitSpecification', ']' do
    q.breakable
    q.text "name: #{name}"

    q.breakable
    q.text "version: #{version}"

    q.breakable
    q.text 'dependencies:'
    q.breakable
    q.pp dependencies

    q.breakable
    q.text "source:"
    q.breakable
    q.pp @source
  end
end