Skip to content

Commit 4bec5b0

Browse files
committed
3.0.0
1 parent ca38c9d commit 4bec5b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4071
-2332
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.bundle
2+
db/*.sqlite3
3+
log/*.log
4+
tmp/**/*

Gemfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
source 'http://rubygems.org'
2+
3+
gem 'rails', '3.0.0'
4+
5+
# Bundle edge Rails instead:
6+
# gem 'rails', :git => 'git://github.com/rails/rails.git'
7+
8+
gem 'sqlite3-ruby', :require => 'sqlite3'
9+
10+
# Use unicorn as the web server
11+
# gem 'unicorn'
12+
13+
# Deploy with Capistrano
14+
# gem 'capistrano'
15+
16+
# To use debugger
17+
# gem 'ruby-debug'
18+
19+
# Bundle the extra gems:
20+
# gem 'bj'
21+
# gem 'nokogiri'
22+
# gem 'sqlite3-ruby', :require => 'sqlite3'
23+
# gem 'aws-s3', :require => 'aws/s3'
24+
25+
# Bundle gems for the local environment. Make sure to
26+
# put test-only gems in this group so their generators
27+
# and rake tasks are available in development mode:
28+
# group :development, :test do
29+
# gem 'webrat'
30+
# end

README

+142-129
Large diffs are not rendered by default.

Rakefile

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Add your own tasks in files placed in lib/tasks ending in .rake,
22
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
33

4-
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
5-
4+
require File.expand_path('../config/application', __FILE__)
65
require 'rake'
7-
require 'rake/testtask'
8-
require 'rake/rdoctask'
96

10-
require 'tasks/rails'
7+
Railsdiff::Application.load_tasks
+1-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# Filters added to this controller apply to all controllers in the application.
2-
# Likewise, all the methods added will be available for all controllers.
3-
41
class ApplicationController < ActionController::Base
5-
helper :all # include all helpers, all the time
6-
protect_from_forgery # See ActionController::RequestForgeryProtection for details
7-
8-
# Scrub sensitive parameters from your log
9-
# filter_parameter_logging :password
2+
protect_from_forgery
103
end

app/helpers/application_helper.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
# Methods added to this helper will be available to all templates in the application.
21
module ApplicationHelper
32
end
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Railsdiff</title>
5+
<%= stylesheet_link_tag :all %>
6+
<%= javascript_include_tag :defaults %>
7+
<%= csrf_meta_tag %>
8+
</head>
9+
<body>
10+
11+
<%= yield %>
12+
13+
</body>
14+
</html>

config.ru

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This file is used by Rack-based servers to start the application.
2+
3+
require ::File.expand_path('../config/environment', __FILE__)
4+
run Railsdiff::Application

config/application.rb

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
require File.expand_path('../boot', __FILE__)
2+
3+
require 'rails/all'
4+
5+
# If you have a Gemfile, require the gems listed there, including any gems
6+
# you've limited to :test, :development, or :production.
7+
Bundler.require(:default, Rails.env) if defined?(Bundler)
8+
9+
module Railsdiff
10+
class Application < Rails::Application
11+
# Settings in config/environments/* take precedence over those specified here.
12+
# Application configuration should go into files in config/initializers
13+
# -- all .rb files in that directory are automatically loaded.
14+
15+
# Custom directories with classes and modules you want to be autoloadable.
16+
# config.autoload_paths += %W(#{config.root}/extras)
17+
18+
# Only load the plugins named here, in the order given (default is alphabetical).
19+
# :all can be used as a placeholder for all plugins not explicitly named.
20+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21+
22+
# Activate observers that should always be running.
23+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24+
25+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27+
# config.time_zone = 'Central Time (US & Canada)'
28+
29+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31+
# config.i18n.default_locale = :de
32+
33+
# JavaScript files you want as :defaults (application.js is always included).
34+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
35+
36+
# Configure the default encoding used in templates for Ruby 1.9.
37+
config.encoding = "utf-8"
38+
39+
# Configure sensitive parameters which will be filtered from the log file.
40+
config.filter_parameters += [:password]
41+
end
42+
end

config/boot.rb

+13-114
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,13 @@
1-
# Don't change this file!
2-
# Configure your app in config/environment.rb and config/environments/*.rb
3-
4-
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5-
6-
module Rails
7-
class << self
8-
def boot!
9-
unless booted?
10-
preinitialize
11-
pick_boot.run
12-
end
13-
end
14-
15-
def booted?
16-
defined? Rails::Initializer
17-
end
18-
19-
def pick_boot
20-
(vendor_rails? ? VendorBoot : GemBoot).new
21-
end
22-
23-
def vendor_rails?
24-
File.exist?("#{RAILS_ROOT}/vendor/rails")
25-
end
26-
27-
def preinitialize
28-
load(preinitializer_path) if File.exist?(preinitializer_path)
29-
end
30-
31-
def preinitializer_path
32-
"#{RAILS_ROOT}/config/preinitializer.rb"
33-
end
34-
end
35-
36-
class Boot
37-
def run
38-
load_initializer
39-
Rails::Initializer.run(:set_load_path)
40-
end
41-
end
42-
43-
class VendorBoot < Boot
44-
def load_initializer
45-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
46-
Rails::Initializer.run(:install_gem_spec_stubs)
47-
Rails::GemDependency.add_frozen_gem_path
48-
end
49-
end
50-
51-
class GemBoot < Boot
52-
def load_initializer
53-
self.class.load_rubygems
54-
load_rails_gem
55-
require 'initializer'
56-
end
57-
58-
def load_rails_gem
59-
if version = self.class.gem_version
60-
gem 'rails', version
61-
else
62-
gem 'rails'
63-
end
64-
rescue Gem::LoadError => load_error
65-
if load_error.message =~ /Could not find RubyGem rails/
66-
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.)
67-
exit 1
68-
else
69-
raise
70-
end
71-
end
72-
73-
class << self
74-
def rubygems_version
75-
Gem::RubyGemsVersion rescue nil
76-
end
77-
78-
def gem_version
79-
if defined? RAILS_GEM_VERSION
80-
RAILS_GEM_VERSION
81-
elsif ENV.include?('RAILS_GEM_VERSION')
82-
ENV['RAILS_GEM_VERSION']
83-
else
84-
parse_gem_version(read_environment_rb)
85-
end
86-
end
87-
88-
def load_rubygems
89-
min_version = '1.3.2'
90-
require 'rubygems'
91-
unless rubygems_version >= min_version
92-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
93-
exit 1
94-
end
95-
96-
rescue LoadError
97-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
98-
exit 1
99-
end
100-
101-
def parse_gem_version(text)
102-
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
103-
end
104-
105-
private
106-
def read_environment_rb
107-
File.read("#{RAILS_ROOT}/config/environment.rb")
108-
end
109-
end
110-
end
111-
end
112-
113-
# All that for this:
114-
Rails.boot!
1+
require 'rubygems'
2+
3+
# Set up gems listed in the Gemfile.
4+
gemfile = File.expand_path('../../Gemfile', __FILE__)
5+
begin
6+
ENV['BUNDLE_GEMFILE'] = gemfile
7+
require 'bundler'
8+
Bundler.setup
9+
rescue Bundler::GemNotFound => e
10+
STDERR.puts e.message
11+
STDERR.puts "Try running `bundle install`."
12+
exit!
13+
end if File.exist?(gemfile)

config/environment.rb

+4-40
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,5 @@
1-
# Be sure to restart your server when you modify this file
1+
# Load the rails application
2+
require File.expand_path('../application', __FILE__)
23

3-
# Specifies gem version of Rails to use when vendor/rails is not present
4-
RAILS_GEM_VERSION = '2.3.18' unless defined? RAILS_GEM_VERSION
5-
6-
# Bootstrap the Rails environment, frameworks, and default configuration
7-
require File.join(File.dirname(__FILE__), 'boot')
8-
9-
Rails::Initializer.run do |config|
10-
# Settings in config/environments/* take precedence over those specified here.
11-
# Application configuration should go into files in config/initializers
12-
# -- all .rb files in that directory are automatically loaded.
13-
14-
# Add additional load paths for your own custom dirs
15-
# config.autoload_paths += %W( #{RAILS_ROOT}/extras )
16-
17-
# Specify gems that this application depends on and have them installed with rake gems:install
18-
# config.gem "bj"
19-
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
20-
# config.gem "sqlite3-ruby", :lib => "sqlite3"
21-
# config.gem "aws-s3", :lib => "aws/s3"
22-
23-
# Only load the plugins named here, in the order given (default is alphabetical).
24-
# :all can be used as a placeholder for all plugins not explicitly named
25-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26-
27-
# Skip frameworks you're not going to use. To use Rails without a database,
28-
# you must remove the Active Record framework.
29-
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
30-
31-
# Activate observers that should always be running
32-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
33-
34-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
35-
# Run "rake -D time" for a list of tasks for finding time zone names.
36-
config.time_zone = 'UTC'
37-
38-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
39-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
40-
# config.i18n.default_locale = :de
41-
end
4+
# Initialize the rails application
5+
Railsdiff::Application.initialize!

config/environments/development.rb

+22-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
# Settings specified here will take precedence over those in config/environment.rb
1+
Railsdiff::Application.configure do
2+
# Settings specified here will take precedence over those in config/environment.rb
23

3-
# In the development environment your application's code is reloaded on
4-
# every request. This slows down response time but is perfect for development
5-
# since you don't have to restart the webserver when you make code changes.
6-
config.cache_classes = false
4+
# In the development environment your application's code is reloaded on
5+
# every request. This slows down response time but is perfect for development
6+
# since you don't have to restart the webserver when you make code changes.
7+
config.cache_classes = false
78

8-
# Log error messages when you accidentally call methods on nil.
9-
config.whiny_nils = true
9+
# Log error messages when you accidentally call methods on nil.
10+
config.whiny_nils = true
1011

11-
# Show full error reports and disable caching
12-
config.action_controller.consider_all_requests_local = true
13-
config.action_view.debug_rjs = true
14-
config.action_controller.perform_caching = false
12+
# Show full error reports and disable caching
13+
config.consider_all_requests_local = true
14+
config.action_view.debug_rjs = true
15+
config.action_controller.perform_caching = false
16+
17+
# Don't care if the mailer can't send
18+
config.action_mailer.raise_delivery_errors = false
19+
20+
# Print deprecation notices to the Rails logger
21+
config.active_support.deprecation = :log
22+
23+
# Only use best-standards-support built into browsers
24+
config.action_dispatch.best_standards_support = :builtin
25+
end
1526

16-
# Don't care if the mailer can't send
17-
config.action_mailer.raise_delivery_errors = false

0 commit comments

Comments
 (0)