Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Rename gemfile back to bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Lerche committed Jan 26, 2010
1 parent 63e4af6 commit 152a50a
Show file tree
Hide file tree
Showing 52 changed files with 59 additions and 87 deletions.
2 changes: 1 addition & 1 deletion README
@@ -1,4 +1,4 @@
gemfile is a replacement for bundler.
This is a rewrite of bundler to offer more bundling power

It currently lacks output and good exception handling for common cases. This is coming very soon. We wanted to open this so people could take a look at it.

Expand Down
12 changes: 6 additions & 6 deletions Rakefile
Expand Up @@ -2,22 +2,22 @@ $:.unshift File.expand_path("../lib", __FILE__)

require 'rubygems'
require 'rubygems/specification'
require 'gemfile'
require 'bundler'

spec = Gem::Specification.new do |s|
s.name = "gemfile"
s.version = Gemfile::VERSION
s.name = "bundler"
s.version = Bundler::VERSION
s.authors = ["Carl Lerche", "Yehuda Katz"]
s.email = ["carlhuda@engineyard.com"]
s.homepage = "http://github.com/carlhuda/gemfile"
s.summary = "Gemfiles are fun"
s.homepage = "http://github.com/carlhuda/bundler"
s.summary = "Bundles are fun"

s.platform = Gem::Platform::RUBY

s.required_rubygems_version = ">= 1.3.5"

s.files = Dir.glob("{bin,lib}/**/*") + %w(LICENSE README)
s.executables = ['gemfile']
s.executables = ['bundle']
s.require_path = 'lib'
end

Expand Down
3 changes: 3 additions & 0 deletions bin/bundle
@@ -0,0 +1,3 @@
require 'bundler/cli'

Bundler::CLI.start
3 changes: 0 additions & 3 deletions bin/gemfile

This file was deleted.

28 changes: 0 additions & 28 deletions gemfile.gemspec

This file was deleted.

24 changes: 12 additions & 12 deletions lib/gemfile.rb → lib/bundler.rb
@@ -1,21 +1,21 @@
require 'fileutils'
require 'pathname'
require 'yaml'
require 'gemfile/rubygems'
require 'bundler/rubygems'

module Gemfile
module Bundler
VERSION = "0.9.0.pre"

autoload :Definition, 'gemfile/definition'
autoload :Dependency, 'gemfile/dependency'
autoload :Dsl, 'gemfile/dsl'
autoload :Environment, 'gemfile/environment'
autoload :Index, 'gemfile/index'
autoload :Installer, 'gemfile/installer'
autoload :RemoteSpecification, 'gemfile/remote_specification'
autoload :Resolver, 'gemfile/resolver'
autoload :Source, 'gemfile/source'
autoload :Specification, 'gemfile/specification'
autoload :Definition, 'bundler/definition'
autoload :Dependency, 'bundler/dependency'
autoload :Dsl, 'bundler/dsl'
autoload :Environment, 'bundler/environment'
autoload :Index, 'bundler/index'
autoload :Installer, 'bundler/installer'
autoload :RemoteSpecification, 'bundler/remote_specification'
autoload :Resolver, 'bundler/resolver'
autoload :Source, 'bundler/source'
autoload :Specification, 'bundler/specification'

class GemfileNotFound < StandardError; end
class GemNotFound < StandardError; end
Expand Down
12 changes: 6 additions & 6 deletions lib/gemfile/cli.rb → lib/bundler/cli.rb
@@ -1,12 +1,12 @@
$:.unshift File.expand_path('../vendor', __FILE__)
require 'thor'
require 'gemfile'
require 'bundler'
require 'rubygems/config_file'

# Work around a RubyGems bug
Gem.configuration

module Gemfile
module Bundler
class CLI < Thor
def self.banner(task)
task.formatted_usage(self, false)
Expand All @@ -25,7 +25,7 @@ def init
desc "check", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
def check
with_rescue do
env = Gemfile.load
env = Bundler.load
# Check top level dependencies
missing = env.dependencies.select { |d| env.index.search(d).empty? }
if missing.any?
Expand All @@ -44,18 +44,18 @@ def check

desc "install", "Install the current environment to the system"
def install
Installer.install(Gemfile.root, Gemfile.definition)
Installer.install(Bundler.root, Bundler.definition)
end

desc "lock", "Locks a resolve"
def lock
environment = Gemfile.load
environment = Bundler.load
environment.lock
end

desc "pack", "Packs all the gems to vendor/cache"
def pack
environment = Gemfile.load
environment = Bundler.load
environment.pack
end

Expand Down
4 changes: 2 additions & 2 deletions lib/gemfile/definition.rb → lib/bundler/definition.rb
@@ -1,4 +1,4 @@
module Gemfile
module Bundler
class Definition
def self.from_gemfile(gemfile)
gemfile = Pathname.new(gemfile).expand_path
Expand Down Expand Up @@ -56,7 +56,7 @@ def initialize(details)
def sources
@sources ||= @details["sources"].map do |args|
name, options = args.to_a.flatten
Gemfile::Source.const_get(name).new(options)
Bundler::Source.const_get(name).new(options)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/gemfile/dependency.rb → lib/bundler/dependency.rb
@@ -1,6 +1,6 @@
require 'rubygems/dependency'

module Gemfile
module Bundler
class Dependency < Gem::Dependency
attr_accessor :source

Expand Down
2 changes: 1 addition & 1 deletion lib/gemfile/dsl.rb → lib/bundler/dsl.rb
@@ -1,4 +1,4 @@
module Gemfile
module Bundler
class DslError < StandardError; end

class Dsl
Expand Down
2 changes: 1 addition & 1 deletion lib/gemfile/environment.rb → lib/bundler/environment.rb
@@ -1,4 +1,4 @@
module Gemfile
module Bundler
class Environment
attr_reader :root

Expand Down
2 changes: 1 addition & 1 deletion lib/gemfile/index.rb → lib/bundler/index.rb
@@ -1,4 +1,4 @@
module Gemfile
module Bundler
class Index
def self.from_installed_gems
# TODO: Why can't we memoize this? It is being mutated somewhere
Expand Down
2 changes: 1 addition & 1 deletion lib/gemfile/installer.rb → lib/bundler/installer.rb
@@ -1,6 +1,6 @@
require 'rubygems/dependency_installer'

module Gemfile
module Bundler
class Installer
def self.install(root, definition)
new(root, definition).run
Expand Down
@@ -1,4 +1,4 @@
module Gemfile
module Bundler
# Represents a lazily loaded gem specification, where the full specification
# is on the source server in rubygems' "quick" index. The proxy object is to
# be seeded with what we're given from the source's abbreviated index - the
Expand Down
2 changes: 1 addition & 1 deletion lib/gemfile/resolver.rb → lib/bundler/resolver.rb
Expand Up @@ -19,7 +19,7 @@ def required_by
end
end

module Gemfile
module Bundler
class Resolver

attr_reader :errors
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions lib/gemfile/source.rb → lib/bundler/source.rb
Expand Up @@ -2,7 +2,7 @@
require "rubygems/format"
require "digest/sha1"

module Gemfile
module Bundler
module Source
class Rubygems
attr_reader :uri, :options
Expand Down Expand Up @@ -131,7 +131,7 @@ def options
end

def path
Gemfile.install_path.join("#{base_name}-#{uri_hash}-#{ref}")
Bundler.install_path.join("#{base_name}-#{uri_hash}-#{ref}")
end

def specs
Expand Down Expand Up @@ -188,7 +188,7 @@ def uri_hash
end

def cache_path
@cache_path ||= Gemfile.cache.join("git", "#{base_name}-#{uri_hash}")
@cache_path ||= Bundler.cache.join("git", "#{base_name}-#{uri_hash}")
end

def cache
Expand Down
@@ -1,4 +1,4 @@
module Gemfile
module Bundler
class Specification < Gem::Specification
attr_accessor :relative_loaded_from

Expand Down
File renamed without changes.
@@ -1,5 +1,5 @@
# DO NOT MODIFY THIS FILE
module Gemfile
module Bundler
<% load_paths.each do |path| -%>
$LOAD_PATH.unshift "<%= path %>"
<% end -%>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions spec/runtime/load_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path('../../spec_helper', __FILE__)

describe "Gemfile.load" do
describe "Bundler.load" do

before :each do
in_app_root
Expand All @@ -13,7 +13,7 @@
gem "rack"
G

env = Gemfile.load
env = Bundler.load
env.dependencies.should have_dep("rack", ">= 0")
end

Expand All @@ -24,20 +24,20 @@
gem "rack"
G

env = Gemfile.load
env = Bundler.load
env.gems.should have_gem("rack-1.0.0")
end

it "raises an exception if the default gemfile is not found" do
lambda {
Gemfile.load
}.should raise_error(Gemfile::GemfileNotFound, /default/)
Bundler.load
}.should raise_error(Bundler::GemfileNotFound, /default/)
end

it "raises an exception if a specified gemfile is not found" do
lambda {
Gemfile.load("omg.rb")
}.should raise_error(Gemfile::GemfileNotFound, /omg\.rb/)
Bundler.load("omg.rb")
}.should raise_error(Bundler::GemfileNotFound, /omg\.rb/)
end

describe "when locked" do
Expand All @@ -60,7 +60,7 @@
gem "activerecord"
G

lambda { Gemfile.load }.should raise_error(Gemfile::GemfileError)
lambda { Bundler.load }.should raise_error(Bundler::GemfileError)
end

it "raises an exception if the Gemfile removes a dependency" do
Expand All @@ -77,7 +77,7 @@
gem "rack"
G

lambda { Gemfile.load }.should raise_error(Gemfile::GemfileError)
lambda { Bundler.load }.should raise_error(Bundler::GemfileError)
end

it "raises an exception if the Gemfile changes a dependency in an incompatible way" do
Expand All @@ -95,7 +95,7 @@
gem "activerecord", "2.3.1"
G

lambda { Gemfile.load }.should raise_error(Gemfile::GemfileError)
lambda { Bundler.load }.should raise_error(Bundler::GemfileError)
end

it "raises an exception if the Gemfile replaces a root with a child dep of the root" do
Expand All @@ -113,7 +113,7 @@
gem "activesupport"
G

lambda { Gemfile.load }.should raise_error(Gemfile::GemfileError)
lambda { Bundler.load }.should raise_error(Bundler::GemfileError)
end

it "works if the Gemfile changes in a compatible way" do
Expand All @@ -131,7 +131,7 @@
gem "activerecord", ">= 2.0.0"
G

lambda { Gemfile.load }.should_not raise_error(Gemfile::GemfileError)
lambda { Bundler.load }.should_not raise_error(Bundler::GemfileError)
end
end
end
2 changes: 1 addition & 1 deletion spec/runtime/setup_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path('../../spec_helper', __FILE__)

describe "Gemfile.setup" do
describe "Bundler.setup" do

before :each do
in_app_root
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -3,7 +3,7 @@

require 'fileutils'
require 'rubygems'
require 'gemfile'
require 'bundler'

Dir["#{File.expand_path('../support', __FILE__)}/*.rb"].each do |file|
require file
Expand Down
4 changes: 2 additions & 2 deletions spec/support/helpers.rb
Expand Up @@ -28,7 +28,7 @@ def run_in_context(cmd)
end

def run(cmd)
setup = "require 'rubygems' ; require 'gemfile' ; Gemfile.setup\n"
setup = "require 'rubygems' ; require 'bundler' ; Bundler.setup\n"
@out = ruby(setup + cmd)
end

Expand All @@ -37,7 +37,7 @@ def lib
end

def bbl(cmd)
gemfile = File.expand_path('../../../bin/gemfile', __FILE__)
gemfile = File.expand_path('../../../bin/bundle', __FILE__)
@out = %x{#{Gem.ruby} -I#{lib} #{gemfile} #{cmd}}.strip
end

Expand Down
2 changes: 1 addition & 1 deletion spec/support/matchers.rb
Expand Up @@ -2,7 +2,7 @@ module Spec
module Matchers
def have_dep(*args)
simple_matcher "have dependency" do |given, matcher|
dep = Gemfile::Dependency.new(*args)
dep = Bundler::Dependency.new(*args)

# given.length == args.length / 2
given.length == 1 && given.all? { |d| d == dep }
Expand Down

0 comments on commit 152a50a

Please sign in to comment.