Skip to content

Commit

Permalink
Rails cruft cleanup, first model.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreeger committed May 17, 2012
1 parent 0a7e26c commit b3798b7
Show file tree
Hide file tree
Showing 26 changed files with 3,994 additions and 295 deletions.
38 changes: 11 additions & 27 deletions Gemfile
@@ -1,38 +1,22 @@
source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'mysql2'
gem 'jquery-rails'
gem 'rabl'
gem 'haml-rails'
gem 'devise'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby

gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'
group :test do
gem 'rspec-rails'
end

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :development, :test do
gem 'debugger'
end
49 changes: 47 additions & 2 deletions Gemfile.lock
Expand Up @@ -29,6 +29,7 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
bcrypt-ruby (3.0.1)
builder (3.0.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
Expand All @@ -37,9 +38,29 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.3.3)
columnize (0.3.6)
debugger (1.1.3)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.1.2)
debugger-linecache (1.1.1)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.2)
devise (2.1.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.7)
railties (~> 3.1)
warden (~> 1.1.1)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.3.2)
multi_json (~> 1.0)
haml (3.1.6)
haml-rails (0.3.4)
actionpack (~> 3.0)
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
Expand All @@ -53,7 +74,12 @@ GEM
treetop (~> 1.4.8)
mime-types (1.18)
multi_json (1.3.5)
mysql2 (0.3.11)
orm_adapter (0.0.7)
polyglot (0.3.3)
rabl (0.6.11)
activesupport (>= 2.3.14)
multi_json (~> 1.0)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
Expand All @@ -79,6 +105,19 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
rspec (2.10.0)
rspec-core (~> 2.10.0)
rspec-expectations (~> 2.10.0)
rspec-mocks (~> 2.10.0)
rspec-core (2.10.0)
rspec-expectations (2.10.0)
diff-lcs (~> 1.1.3)
rspec-mocks (2.10.1)
rspec-rails (2.10.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.10.0)
sass (3.1.18)
sass-rails (3.2.5)
railties (~> 3.2.0)
Expand All @@ -88,7 +127,6 @@ GEM
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
Expand All @@ -98,14 +136,21 @@ GEM
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
warden (1.1.1)
rack (>= 1.0)

PLATFORMS
ruby

DEPENDENCIES
coffee-rails (~> 3.2.1)
debugger
devise
haml-rails
jquery-rails
mysql2
rabl
rails (= 3.2.3)
rspec-rails
sass-rails (~> 3.2.3)
sqlite3
uglifier (>= 1.0.3)
15 changes: 0 additions & 15 deletions app/assets/javascripts/application.js

This file was deleted.

4 changes: 4 additions & 0 deletions app/assets/javascripts/application.js.coffee
@@ -0,0 +1,4 @@
#= require jquery
#= require jquery_ujs
#= require vendor
#= require_tree .
2 changes: 2 additions & 0 deletions app/controllers/home_controller.rb
@@ -0,0 +1,2 @@
class HomeController < ApplicationController
end
3 changes: 3 additions & 0 deletions app/models/task.rb
@@ -0,0 +1,3 @@
class Task < ActiveRecord::Base
attr_accessible :body, :subject
end
46 changes: 3 additions & 43 deletions config/application.rb
@@ -1,65 +1,25 @@
require File.expand_path('../boot', __FILE__)

# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"

if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
Bundler.require(*Rails.groups(assets: %w(development test)))
end

module Potato
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.

# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_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 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]

# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql

# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
config.active_record.whitelist_attributes = true

# Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.generators.stylesheets = false
config.generators.javascripts = false
end
end
3 changes: 0 additions & 3 deletions config/boot.rb
@@ -1,6 +1,3 @@
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'])
20 changes: 6 additions & 14 deletions config/database.yml
@@ -1,25 +1,17 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
adapter: mysql2
database: potato_dev
pool: 5
timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
adapter: mysql2
database: potato_test
pool: 5
timeout: 5000

production:
adapter: sqlite3
database: db/production.sqlite3
adapter: mysql2
database: potato
pool: 5
timeout: 5000
3 changes: 0 additions & 3 deletions config/environment.rb
@@ -1,5 +1,2 @@
# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Potato::Application.initialize!
26 changes: 1 addition & 25 deletions config/environments/development.rb
@@ -1,37 +1,13 @@
Potato::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

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

# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log

# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin

# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict

# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5

# Do not compress assets
config.action_mailer.default_url_options = { host: 'localhost:3000' }
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = true
end

0 comments on commit b3798b7

Please sign in to comment.