Skip to content

Commit

Permalink
thoughtworks#40: Including Bundler by hand. Fixed Gemspec. CC.rb now …
Browse files Browse the repository at this point in the history
…installable and runnable as a gem under Ruby 1.9.2.
  • Loading branch information
bguthrie committed Jul 5, 2011
1 parent 17ca0f8 commit 07be423
Show file tree
Hide file tree
Showing 145 changed files with 18,941 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -3,13 +3,13 @@ source "http://rubygems.org"
gem "rails", "3.0.7"
gem "tzinfo", "0.3.27"
gem "rack", "1.2.3"
gem "bundler", "1.0.12"

gem "httparty", "0.6.1"
gem "api_cache", "0.2.0"
gem "xml-simple", '1.0.16', :require => 'xmlsimple'
gem "rake", "0.8.7"
gem "jquery-rails", '1.0.9'
gem "rake", "0.8.7"
gem "abstract", "1.0.0"

group :development do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -32,6 +32,7 @@ GEM
arel (2.0.10)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
bundler (1.0.12)
crack (0.1.8)
erubis (2.6.6)
abstract (>= 1.0.0)
Expand Down Expand Up @@ -86,6 +87,7 @@ PLATFORMS
DEPENDENCIES
abstract (= 1.0.0)
api_cache (= 0.2.0)
bundler (= 1.0.12)
httparty (= 0.6.1)
jquery-rails (= 1.0.9)
jruby-openssl
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Expand Up @@ -38,7 +38,7 @@ def self.data_root
@data_root ||= Pathname.new( ENV['CRUISE_DATA_ROOT'] || File.join(CruiseControl.home_directory, ".cruise") )
end

class Application < Rails::Application
class Application < Rails::Application
# Add additional load paths for your own custom dirs
config.autoload_paths << Rails.root.join('lib')
config.autoload_paths << Rails.root.join('lib', 'builder_plugins')
Expand Down
9 changes: 6 additions & 3 deletions config/boot.rb
@@ -1,6 +1,9 @@
require 'rubygems'

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'rubygems'

ENV['GEM_PATH'] = File.expand_path('../../vendor/unpacked', __FILE__)
Gem.clear_paths

require 'bundler/setup'
3 changes: 2 additions & 1 deletion cruise
@@ -1,8 +1,9 @@
#!/usr/bin/env ruby

ENV_PATH = File.expand_path("../config/environment", __FILE__)

require File.expand_path("../config/boot", __FILE__)
require File.expand_path("../lib/cruise_control/init", __FILE__)
require File.expand_path('../lib/cruise_control/version', __FILE__)

CruiseControl::Init.new.run
CruiseControl::Init.new.run
3 changes: 2 additions & 1 deletion cruisecontrolrb.gemspec
Expand Up @@ -20,7 +20,7 @@ GEMSPEC = Gem::Specification.new do |s|

s.files = FileList[
'[a-zA-Z0-9]*',
'app/**/*.rb',
'app/**/*',
'bin/**/*',
'config/**/*',
'daemon/**/*',
Expand All @@ -31,6 +31,7 @@ GEMSPEC = Gem::Specification.new do |s|
'server_jar/**/*',
'tasks/**/*',
"vendor/bundle/**/*",
"vendor/unpacked/**/*",
".bundle/*"
]

Expand Down
13 changes: 12 additions & 1 deletion lib/cruise_control/init.rb
Expand Up @@ -29,6 +29,8 @@ def method_for_command(command)
end

def start
require ENV_PATH

unless ARGV.include?('-p') || ARGV.include?('--port')
ARGV << '-p'
ARGV << DEFAULT_PORT.to_s
Expand All @@ -38,13 +40,22 @@ def start
ARGV << '-e'
ARGV << 'production'
end

unless ARGV.include?('-c') || ARGV.include?('--config')
ARGV << '-c'
ARGV << Rails.root.join('config.ru').to_s
end

unless ARGV.include?('-P') || ARGV.include?('--pid')
ARGV << '-P'
ARGV << Rails.root.join('tmp', 'pids', 'server.pid').to_s
end

require File.join(File.dirname(__FILE__), '..', 'platform')
Platform.running_as_daemon = ARGV.include?('-d') || ARGV.include?('--daemon')
require 'rails/commands/server'

Rails::Server.new.tap { |server|
require ENV_PATH
Dir.chdir(Rails.application.root)
server.start
}
Expand Down
19 changes: 19 additions & 0 deletions vendor/unpacked/bin/bundle
@@ -0,0 +1,19 @@
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
ARGV.shift
end

gem 'bundler', version
load Gem.bin_path('bundler', 'bundle', version)
Binary file added vendor/unpacked/cache/bundler-1.0.12.gem
Binary file not shown.
22 changes: 22 additions & 0 deletions vendor/unpacked/gems/bundler-1.0.12/.gitignore
@@ -0,0 +1,22 @@
# system crap
.DS_Store
.*.swp

# files created by running the specs
tmp

# built gems
pkg
*.gem

# rubinius bytecode
*.rbc

# output from ronn
lib/bundler/man

# output from ci_reporter
spec/reports

# Netbeans
nbproject

0 comments on commit 07be423

Please sign in to comment.