Skip to content

Commit

Permalink
Overwrote with Rails 3 files
Browse files Browse the repository at this point in the history
  • Loading branch information
jhannes committed Apr 25, 2011
1 parent 2e812fe commit 898644b
Show file tree
Hide file tree
Showing 8 changed files with 194 additions and 325 deletions.
16 changes: 7 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
#gem install bundler

source :gemcutter
gem 'rails', '= 2.3.8'
gem 'rails', '= 3.0.7'
gem 'paperclip', '~>2.3.4'
gem 'aws-s3', '~>0.6.2'
gem 'aws-s3', :require=>'aws/s3'

group :plugins do
gem 'authlogic', '2.0.11'
gem 'gchartrb'
gem 'prawn', '= 0.6.3'
gem 'prawnto'
end
gem 'authlogic'
gem 'gchartrb'
gem 'prawn', '= 0.6.3'
gem 'prawnto'

group :development do
gem 'faker'
Expand All @@ -26,4 +24,4 @@ group :test do
#gem 'factory_girl'
end

gem 'heroku_s3_backup' #db backup to S3
gem 'heroku_s3_backup' #db backup to S3
129 changes: 85 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,41 +1,67 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.8)
actionpack (= 2.3.8)
actionpack (2.3.8)
activesupport (= 2.3.8)
rack (~> 1.1.0)
activerecord (2.3.8)
activesupport (= 2.3.8)
activeresource (2.3.8)
activesupport (= 2.3.8)
activesupport (2.3.8)
authlogic (2.0.11)
abstract (1.0.0)
actionmailer (3.0.7)
actionpack (= 3.0.7)
mail (~> 2.2.15)
actionpack (3.0.7)
activemodel (= 3.0.7)
activesupport (= 3.0.7)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.7)
activesupport (= 3.0.7)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.7)
activemodel (= 3.0.7)
activesupport (= 3.0.7)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activeresource (3.0.7)
activemodel (= 3.0.7)
activesupport (= 3.0.7)
activesupport (3.0.7)
arel (2.0.9)
authlogic (2.1.6)
activesupport
aws-s3 (0.6.2)
builder
mime-types
xml-simple
builder (3.0.0)
builder (2.1.2)
bullet (2.0.1)
uniform_notifier (~> 1.0.0)
faker (0.3.1)
erubis (2.6.6)
abstract (>= 1.0.0)
faker (0.9.5)
i18n (~> 0.4)
gchartrb (0.8)
heroku_s3_backup (0.0.1)
right_aws (~> 1.10)
json_pure (1.4.6)
i18n (0.5.0)
mail (2.2.17)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mocha (0.9.9)
rake
paperclip (2.3.6)
activerecord
activesupport
mocha (0.9.12)
paperclip (2.3.11)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
polyglot (0.3.1)
prawn (0.6.3)
prawn-core (< 0.7, >= 0.6.3)
prawn-format (< 0.3, >= 0.2.3)
prawn-layout (< 0.4, >= 0.3.2)
prawn-security (< 0.2, >= 0.1.1)
prawn-core (>= 0.6.3, < 0.7)
prawn-format (>= 0.2.3, < 0.3)
prawn-layout (>= 0.3.2, < 0.4)
prawn-security (>= 0.1.1, < 0.2)
prawn-core (0.6.3)
prawn-format (0.2.3)
prawn-core
Expand All @@ -44,43 +70,58 @@ GEM
prawnto (0.0.4)
prawn
rails (>= 2.1)
rack (1.1.0)
rails (2.3.8)
actionmailer (= 2.3.8)
actionpack (= 2.3.8)
activerecord (= 2.3.8)
activeresource (= 2.3.8)
activesupport (= 2.3.8)
rake (>= 0.8.3)
rack (1.2.2)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.7)
actionmailer (= 3.0.7)
actionpack (= 3.0.7)
activerecord (= 3.0.7)
activeresource (= 3.0.7)
activesupport (= 3.0.7)
bundler (~> 1.0)
railties (= 3.0.7)
railties (3.0.7)
actionpack (= 3.0.7)
activesupport (= 3.0.7)
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
rest-client (1.6.1)
mime-types (>= 1.16)
right_aws (1.10.0)
right_http_connection (>= 1.2.4)
right_http_connection (1.2.4)
sequel (3.17.0)
right_http_connection (1.3.0)
sequel (3.20.0)
shoulda (2.11.3)
sinatra (1.0)
rack (>= 1.0)
sqlite3-ruby (1.3.2)
sqlite3-ruby (1.3.2-x86-mingw32)
taps (0.3.14)
json_pure (< 1.5.0, >= 1.2.0)
sqlite3 (1.3.3)
sqlite3 (1.3.3-x86-mingw32)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
taps (0.3.23)
rack (>= 1.0.1)
rest-client (< 1.7.0, >= 1.4.0)
sequel (~> 3.17.0)
rest-client (>= 1.4.0, < 1.7.0)
sequel (~> 3.20.0)
sinatra (~> 1.0.0)
sqlite3-ruby (~> 1.2)
uniform_notifier (1.0.0)
xml-simple (1.0.12)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.26)
uniform_notifier (1.0.1)
xml-simple (1.0.15)

PLATFORMS
ruby
x86-mingw32

DEPENDENCIES
authlogic (= 2.0.11)
aws-s3 (~> 0.6.2)
authlogic
aws-s3
bullet
faker
gchartrb
Expand All @@ -89,7 +130,7 @@ DEPENDENCIES
paperclip (~> 2.3.4)
prawn (= 0.6.3)
prawnto
rails (= 2.3.8)
rails (= 3.0.7)
shoulda
sqlite3-ruby
taps
10 changes: 2 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

# Required for thread handling ActiveSupport::Dependencies::Mutex
require 'thread'

require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'
SmidigConference::Application.load_tasks
133 changes: 4 additions & 129 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,131 +1,6 @@
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
require 'rubygems'

RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'thread' unless defined?(ActiveSupport::Dependencies::Mutex)

module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end

def booted?
defined? Rails::Initializer
end

def pick_boot
(vendor_rails? ? VendorBoot : GemBoot).new
end

def vendor_rails?
File.exist?("#{RAILS_ROOT}/vendor/rails")
end

def preinitialize
load(preinitializer_path) if File.exist?(preinitializer_path)
end

def preinitializer_path
"#{RAILS_ROOT}/config/preinitializer.rb"
end
end

class Boot
def run
load_initializer
Rails::Initializer.run(:set_load_path)
end
end

class VendorBoot < Boot
def load_initializer
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
Rails::Initializer.run(:install_gem_spec_stubs)
Rails::GemDependency.add_frozen_gem_path
end
end

class GemBoot < Boot
def load_initializer
self.class.load_rubygems
load_rails_gem
require 'initializer'
end

def load_rails_gem
if version = self.class.gem_version
gem 'rails', version
else
gem 'rails'
end
rescue Gem::LoadError => load_error
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
exit 1
end

class << self
def rubygems_version
Gem::RubyGemsVersion rescue nil
end

def gem_version
if defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION
elsif ENV.include?('RAILS_GEM_VERSION')
ENV['RAILS_GEM_VERSION']
else
parse_gem_version(read_environment_rb)
end
end

def load_rubygems
require 'rubygems'
min_version = '1.3.1'
unless rubygems_version >= min_version
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
exit 1
end

rescue LoadError
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
exit 1
end

def parse_gem_version(text)
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
end

private
def read_environment_rb
File.read("#{RAILS_ROOT}/config/environment.rb")
end
end
end
end


class Rails::Boot
def run
load_initializer
extend_environment
Rails::Initializer.run(:set_load_path)
end

def extend_environment
Rails::Initializer.class_eval do
old_load = instance_method(:load_environment)
define_method(:load_environment) do
Bundler.require Rails.env, :plugins
old_load.bind(self).call
end
end
end
end

# All that for this:
Rails.boot!
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
Loading

0 comments on commit 898644b

Please sign in to comment.