Class Index [+]

Quicksearch

Bundler::SharedHelpers

Attributes

gem_loaded[RW]

Public Instance Methods

default_gemfile() click to toggle source
    # File lib/bundler/shared_helpers.rb, line 20
20:     def default_gemfile
21:       gemfile = find_gemfile
22:       raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
23:       Pathname.new(gemfile)
24:     end
default_lockfile() click to toggle source
    # File lib/bundler/shared_helpers.rb, line 26
26:     def default_lockfile
27:       Pathname.new("#{default_gemfile}.lock")
28:     end
in_bundle?() click to toggle source
    # File lib/bundler/shared_helpers.rb, line 30
30:     def in_bundle?
31:       find_gemfile
32:     end

Private Instance Methods

clean_load_path() click to toggle source
    # File lib/bundler/shared_helpers.rb, line 56
56:     def clean_load_path
57:       # handle 1.9 where system gems are always on the load path
58:       if defined?(::Gem)
59:         me = File.expand_path("../../", __FILE__)
60:         $LOAD_PATH.reject! do |p|
61:           next if File.expand_path(p) =~ /^#{Regexp.escape(me)}/
62:           p != File.dirname(__FILE__) &&
63:             Bundler.rubygems.gem_path.any?{|gp| p =~ /^#{Regexp.escape(gp)}/ }
64:         end
65:         $LOAD_PATH.uniq!
66:       end
67:     end
find_gemfile() click to toggle source
    # File lib/bundler/shared_helpers.rb, line 36
36:     def find_gemfile
37:       given = ENV['BUNDLE_GEMFILE']
38:       return given if given && !given.empty?
39: 
40:       previous = nil
41:       current  = File.expand_path(Dir.pwd)
42: 
43:       until !File.directory?(current) || current == previous
44:         if ENV['BUNDLE_SPEC_RUN']
45:           # avoid stepping above the tmp directory when testing
46:           return nil if File.file?(File.join(current, 'bundler.gemspec'))
47:         end
48: 
49:         # otherwise return the Gemfile if it's there
50:         filename = File.join(current, 'Gemfile')
51:         return filename if File.file?(filename)
52:         current, previous = File.expand_path("..", current), current
53:       end
54:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.