Class: Prebundler::PathGemRef

Inherits:
GemRef
  • Object
show all
Defined in:
lib/prebundler/path_gem_ref.rb

Constant Summary

Constants inherited from GemRef

GemRef::DEFAULT_SOURCE, GemRef::REF_TYPES

Instance Attribute Summary collapse

Attributes inherited from GemRef

#bundle_path, #dependencies, #groups, #name, #prefix, #spec

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GemRef

#add_to_tar, create, #executables, #extension_dir, #id, #install, #install_dir, #install_from_tar, #install_path, #relative_extension_dir, #relative_gem_dir, #relative_gemspec_files, #spec_path, #tar_file, #to_gem, #version

Constructor Details

#initialize(name, bundle_path, options = {}) ⇒ PathGemRef

Returns a new instance of PathGemRef.



11
12
13
14
15
16
17
18
# File 'lib/prebundler/path_gem_ref.rb', line 11

def initialize(name, bundle_path, options = {})
  super

  # @TODO: Individual gem calls can also specify a path, which
  # we don't currently handle. For now just use the gem's name
  # to complete the path.
  @path = File.join(options[:path], name)
end

Instance Attribute Details

#pathObject (readonly) Also known as: source

Returns the value of attribute path.



9
10
11
# File 'lib/prebundler/path_gem_ref.rb', line 9

def path
  @path
end

Class Method Details

.accepts?(options) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/prebundler/path_gem_ref.rb', line 4

def accepts?(options)
  !!options[:path]
end

Instance Method Details

#gemspecsObject



28
29
30
31
32
33
34
# File 'lib/prebundler/path_gem_ref.rb', line 28

def gemspecs
  @gemspecs ||= gemspec_files.map do |gemspec_file|
    Dir.chdir(File.dirname(gemspec_file)) do
      Bundler.load_gemspec(File.basename(gemspec_file))
    end
  end
end

#installable?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/prebundler/path_gem_ref.rb', line 20

def installable?
  false
end

#storable?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/prebundler/path_gem_ref.rb', line 24

def storable?
  false
end