Object
# File lib/bundler/rubygems_ext.rb, line 72 72: def add_bundler_dependencies(*groups) 73: Bundler.ui.warn "#add_bundler_dependencies is deprecated and will " "be removed in Bundler 1.0. Instead, please use the #gemspec method " "in your Gemfile, which will pull in any dependencies specified in " "your gemspec" 74: 75: groups = [:default] if groups.empty? 76: Bundler.definition.dependencies.each do |dep| 77: if dep.groups.include?(:development) 78: self.add_development_dependency(dep.name, dep.requirement.to_s) 79: elsif (dep.groups & groups).any? 80: self.add_dependency(dep.name, dep.requirement.to_s) 81: end 82: end 83: end
# File lib/bundler/rubygems_ext.rb, line 20 20: def full_gem_path 21: source.respond_to?(:path) ? 22: Pathname.new(loaded_from).dirname.expand_path(Bundler.root).to_s : 23: rg_full_gem_path 24: end
RubyGems 1.8+ used only.
# File lib/bundler/rubygems_ext.rb, line 43 43: def gem_dir 44: full_gem_path 45: end
# File lib/bundler/rubygems_ext.rb, line 51 51: def git_version 52: if @loaded_from && File.exist?(File.join(full_gem_path, ".git")) 53: sha = Dir.chdir(full_gem_path){ `git rev-parse HEAD`.strip } 54: " #{sha[0..6]}" 55: end 56: end
# File lib/bundler/rubygems_ext.rb, line 47 47: def groups 48: @groups ||= [] 49: end
# File lib/bundler/rubygems_ext.rb, line 32 32: def load_paths 33: require_paths.map do |require_path| 34: if require_path.include?(full_gem_path) 35: require_path 36: else 37: File.join(full_gem_path, require_path) 38: end 39: end 40: end
# File lib/bundler/rubygems_ext.rb, line 26 26: def loaded_from 27: relative_loaded_from ? 28: source.path.join(relative_loaded_from).to_s : 29: rg_loaded_from 30: end
# File lib/bundler/rubygems_ext.rb, line 68 68: def nondevelopment_dependencies 69: dependencies - development_dependencies 70: end
# File lib/bundler/resolver.rb, line 11 11: def required_by 12: @required_by ||= [] 13: end
# File lib/bundler/rubygems_ext.rb, line 58 58: def to_gemfile(path = nil) 59: gemfile = "source :gemcutter\n" 60: gemfile << dependencies_to_gemfile(nondevelopment_dependencies) 61: unless development_dependencies.empty? 62: gemfile << "\n" 63: gemfile << dependencies_to_gemfile(development_dependencies, :development) 64: end 65: gemfile 66: end
# File lib/bundler/rubygems_ext.rb, line 90 90: def dependencies_to_gemfile(dependencies, group = nil) 91: gemfile = '' 92: if dependencies.any? 93: gemfile << "group :#{group} do\n" if group 94: dependencies.each do |dependency| 95: gemfile << ' ' if group 96: gemfile << %gem "#{dependency.name}"| 97: req = dependency.requirements_list.first 98: gemfile << %, "#{req}"| if req 99: gemfile << "\n" 100: end 101: gemfile << "end\n" if group 102: end 103: gemfile 104: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.