-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Axel Liljencrantz
committed
Jun 22, 2010
1 parent
0966be0
commit e29bc68
Showing
27 changed files
with
369 additions
and
475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
source 'http://rubygems.org' | ||
|
||
gem 'rails', '3.0.0.beta3' | ||
|
||
# Bundle edge Rails instead: | ||
# gem 'rails', :git => 'git://github.com/rails/rails.git' | ||
|
||
gem 'pg' | ||
gem 'bundler' | ||
|
||
gem 'json' | ||
|
||
gem "machinist" | ||
gem "faker" | ||
gem "devise", "1.1.rc1" | ||
gem "warden" | ||
gem "declarative_authorization", :git => "http://github.com/stffn/declarative_authorization.git" | ||
|
||
# Use unicorn as the web server | ||
# gem 'unicorn' | ||
|
||
# Deploy with Capistrano | ||
# gem 'capistrano' | ||
|
||
# Bundle the extra gems: | ||
# gem 'bj' | ||
# gem 'nokogiri', '1.4.1' | ||
# gem 'sqlite3-ruby', :require => 'sqlite3' | ||
# gem 'aws-s3', :require => 'aws/s3' | ||
|
||
# Bundle gems for certain environments: | ||
# gem 'rspec', :group => :test | ||
# group :test do | ||
# gem 'webrat' | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
# 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')) | ||
require File.expand_path('../config/application', __FILE__) | ||
|
||
require 'rake' | ||
require 'rake/testtask' | ||
require 'rake/rdoctask' | ||
|
||
require 'tasks/rails' | ||
|
||
Rake::Task["db:test:prepare"].enhance(['db:test:purge', 'db:schema:load']) do | ||
Rake::Task["db:test:prepare"].reenable | ||
Rake::Task["db:test:purge"].reenable | ||
Rake::Task["db:schema:load"].reenable | ||
end | ||
|
||
Rails::Application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This file is used by Rack-based servers to start the application. | ||
|
||
require ::File.expand_path('../config/environment', __FILE__) | ||
run Lodo::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
require File.expand_path('../boot', __FILE__) | ||
|
||
require 'rails/all' | ||
|
||
# If you have a Gemfile, require the gems listed there, including any gems | ||
# you've limited to :test, :development, or :production. | ||
Bundler.require(:default, Rails.env) if defined?(Bundler) | ||
|
||
module Lodo | ||
class Application < Rails::Application | ||
# Settings in config/environments/* take precedence over those specified here. | ||
# Application configuration should go into files in config/initializers | ||
# -- all .rb files in that directory are automatically loaded. | ||
|
||
# Add additional load paths for your own custom dirs | ||
# config.load_paths += %W( #{config.root}/extras ) | ||
|
||
# Only load the plugins named here, in the order given (default is alphabetical). | ||
# :all can be used as a placeholder for all plugins not explicitly named | ||
# config.plugins = [ :exception_notification, :ssl_requirement, :all ] | ||
|
||
# Activate observers that should always be running | ||
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer | ||
|
||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. | ||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. | ||
# config.time_zone = 'Central Time (US & Canada)' | ||
|
||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. | ||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] | ||
# config.i18n.default_locale = :de | ||
|
||
# Configure generators values. Many other options are available, be sure to check the documentation. | ||
# config.generators do |g| | ||
# g.orm :active_record | ||
# g.template_engine :erb | ||
# g.test_framework :test_unit, :fixture => true | ||
# end | ||
|
||
# Configure the default encoding used in templates for Ruby 1.9. | ||
config.encoding = "utf-8" | ||
|
||
# Configure sensitive parameters which will be filtered from the log file. | ||
config.filter_parameters += [:password] | ||
|
||
config.time_zone = 'UTC' | ||
|
||
# The internationalization framework can be changed to have another default locale (standard is :en) or more load paths. | ||
# All files from config/locales/*.rb,yml are added automatically. | ||
# config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')] | ||
# config.i18n.default_locale = :de | ||
config.i18n.default_locale = :nb | ||
|
||
# Your secret key for verifying cookie session data integrity. | ||
# If you change this key, all old sessions will become invalid! | ||
# Make sure the secret is at least 30 characters and all random, | ||
# no regular words or you'll be exposed to dictionary attacks. | ||
config.action_dispatch.session = { | ||
:session_key => '_lodo3_session', | ||
:secret => '29e52c8e64c464b41e52b98c9cceb4e43d1d8870df42124cd96be3c4004179720c0326431b0126f1f27d9c65bd834d1028c8f745ddcc8484e32ff0ac3e7d75fa' | ||
} | ||
|
||
end | ||
end | ||
|
||
|
||
|
||
ActionMailer::Base.delivery_method = :smtp | ||
ActionMailer::Base.smtp_settings = { | ||
:address => "mail.freecodeint.com", | ||
:port => 25, | ||
# :domain => "freecode.no", | ||
# :user_name => "[email protected]", | ||
# :password => "MyPassword", | ||
:authentication => :plain | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,6 @@ | ||
# Don't change this file! | ||
# Configure your app in config/environment.rb and config/environments/*.rb | ||
|
||
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) | ||
|
||
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) | ||
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 | ||
require 'rubygems' | ||
# Set up gems listed in the Gemfile. | ||
if File.exist?(File.expand_path('../../Gemfile', __FILE__)) | ||
require 'bundler' | ||
Bundler.setup | ||
end | ||
|
||
# All that for this: | ||
Rails.boot! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.