Permalink
Browse files

Remove support for Ruby 1.8

  • Loading branch information...
1 parent af08da6 commit 6b2c541f4546f6df34c4f6c63c87778224385f85 @sferik sferik committed Jun 18, 2012
Showing with 13,511 additions and 13,469 deletions.
  1. +0 −1 .travis.yml
  2. +4 −10 README.md
  3. +1 −0 Rakefile
  4. +2 −3 app/assets/javascripts/main.js.erb
  5. +1 −1 app/assets/stylesheets/application.css
  6. +1 −1 app/controllers/addresses_controller.rb
  7. +6 −6 app/controllers/passwords_controller.rb
  8. +3 −2 app/controllers/reminders_controller.rb
  9. +4 −4 app/controllers/sessions_controller.rb
  10. +2 −2 app/controllers/things_controller.rb
  11. +7 −7 app/controllers/users_controller.rb
  12. +3 −3 app/mailers/thing_mailer.rb
  13. +3 −2 app/models/reminder.rb
  14. +2 −1 app/models/thing.rb
  15. +9 −6 app/models/user.rb
  16. +6 −3 config/application.rb
  17. +8 −13 config/environments/production.rb
  18. +21 −5 config/initializers/devise.rb
  19. +1 −1 config/initializers/rails_admin.rb
  20. +1 −1 config/initializers/session_store.rb
  21. +0 −8 config/initializers/smtp_settings.rb
  22. +1 −1 config/initializers/wrap_parameters.rb
  23. +5 −4 config/locales/devise.en.yml
  24. +12 −12 config/routes.rb
  25. +20 −0 db/migrate/00000000000001_create_users.rb
  26. +0 −20 db/migrate/00000000000001_devise_create_users.rb
  27. +53 −0 db/migrate/00000000000002_add_devise_to_users.rb
  28. +3 −3 db/migrate/{00000000000002_create_things.rb → 00000000000003_create_things.rb}
  29. +0 −14 db/migrate/00000000000004_create_rails_admin_histories_table.rb
  30. +4 −4 db/migrate/{00000000000003_create_reminders.rb → 00000000000004_create_reminders.rb}
  31. +0 −9 db/migrate/00000000000005_add_address_to_users.rb
  32. +15 −0 db/migrate/00000000000005_create_rails_admin_histories_table.rb
  33. +0 −11 db/migrate/00000000000006_add_remember_password_sent_at_to_users.rb
  34. +21 −22 db/schema.rb
  35. +13,253 −13,253 db/seeds.rb
  36. +5 −5 test/functional/addresses_controller_test.rb
  37. +4 −4 test/functional/info_window_controller_test.rb
  38. +8 −8 test/functional/passwords_controller_test.rb
  39. +6 −3 test/functional/reminders_controller_test.rb
  40. +2 −2 test/functional/sessions_controller_test.rb
  41. +1 −1 test/functional/sitemaps_controller_test.rb
  42. +2 −2 test/functional/things_controller_test.rb
  43. +9 −9 test/functional/users_controller_test.rb
  44. +2 −2 test/performance/browsing_test.rb
  45. 0 vendor/assets/javascripts/.gitkeep
  46. 0 vendor/assets/stylesheets/.gitkeep
  47. 0 vendor/plugins/.gitkeep
View
@@ -3,5 +3,4 @@ before_script: bundle exec rake db:create db:schema:load
bundler_args: --without assets:development:production
language: ruby
rvm:
- - 1.9.2
- 1.9.3
View
@@ -80,19 +80,13 @@ Ideally, a bug report should include a pull request with failing specs.
[branch]: http://learn.github.com/p/branching.html
[pr]: http://help.github.com/send-pull-requests/
-## Supported Ruby Versions
-This library aims to support and is [tested against][travis] the following Ruby
-implementations:
+## Supported Ruby Version
+This library aims to support and is [tested against][travis] Ruby version 1.9.3.
-* Ruby 1.9.2
-* Ruby 1.9.3
-
-If something doesn't work on one of these interpreters, it should be considered
-a bug.
+If something doesn't work on this version, it should be considered a bug.
This library may inadvertently work (or seem to work) on other Ruby
-implementations, however support will only be provided for the versions listed
-above.
+implementations, however support will only be provided for the version above.
If you would like this library to support another Ruby version, you may
volunteer to be a maintainer. Being a maintainer entails making sure all tests
View
@@ -1,3 +1,4 @@
+#!/usr/bin/env rake
# 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.
@@ -399,7 +399,7 @@ $(function() {
data: {
'thing_id': activeThingId,
'flash': {
- 'notice': "<%= I18n.t("notices.adopted", :thing => I18n.t("defaults.thing")) %>"
+ 'notice': "<%= I18n.t("notices.adopted", thing: I18n.t("defaults.thing")) %>"
}
},
success: function(data) {
@@ -442,7 +442,7 @@ $(function() {
data: {
'thing_id': activeThingId,
'flash': {
- 'warning': "<%= I18n.t("notices.abandoned", :thing => I18n.t("defaults.thing").capitalize) %>"
+ 'warning': "<%= I18n.t("notices.abandoned", thing: I18n.t("defaults.thing").capitalize) %>"
}
},
success: function(data) {
@@ -664,7 +664,6 @@ $(function() {
'utf8': '✓',
'authenticity_token': $('#reminder_form input[name="authenticity_token"]').val(),
'reminder': {
- 'from_user_id': $('#reminder_from_user_id').val(),
'to_user_id': $('#reminder_to_user_id').val(),
'thing_id': activeThingId
}
@@ -10,4 +10,4 @@
*
*= require_self
*= require_tree .
-*/
+ */
@@ -6,7 +6,7 @@ def show
unless @address.blank?
respond_with @address
else
- render(:json => {"errors" => {"address" => [t("errors.not_found", :thing => t("defaults.address"))]}}, :status => 404)
+ render(json: {errors: {address: [t("errors.not_found", thing: t("defaults.address"))]}}, status: 404)
end
end
end
@@ -1,21 +1,21 @@
class PasswordsController < Devise::PasswordsController
def create
- self.resource = resource_class.send_reset_password_instructions(params[resource_name])
+ self.resource = resource_class.send_reset_password_instructions(resource_params)
if resource.errors.empty?
- render(:json => {"success" => true})
+ render(json: {success: true})
else
- render(:json => {"errors" => resource.errors}, :status => 500)
+ render(json: {errors: resource.errors}, status: 500)
end
end
def edit
self.resource = resource_class.new
resource.reset_password_token = params[:reset_password_token]
- render("edit", :layout => "info_window")
+ render("edit", layout: "info_window")
end
def update
- self.resource = resource_class.reset_password_by_token(params[resource_name])
- redirect_to(:controller => "main", :action => "index")
+ self.resource = resource_class.reset_password_by_token(resource_params)
+ redirect_to(controller: "main", action: "index")
end
end
@@ -3,12 +3,13 @@ class RemindersController < ApplicationController
def create
@reminder = Reminder.new(params[:reminder])
+ @reminder.from_user = current_user
if @reminder.save
ThingMailer.reminder(@reminder.thing).deliver
@reminder.update_attribute(:sent, true)
- render(:json => @reminder)
+ render(json: @reminder)
else
- render(:json => {"errors" => @reminder.errors}, :status => 500)
+ render(json: {errors: @reminder.errors}, status: 500)
end
end
end
@@ -1,21 +1,21 @@
class SessionsController < Devise::SessionsController
def new
- redirect_to root_path
+ redirect_to(root_path)
end
def create
resource = warden.authenticate(:scope => resource_name)
if resource
sign_in(resource_name, resource)
- render(:json => resource)
+ render(json: resource)
else
- render(:json => {"errors" => {:password => [t("errors.password")]}}, :status => 401)
+ render(json: {errors: {password: [t("errors.password")]}}, status: 401)
end
end
def destroy
signed_in = signed_in?(resource_name)
sign_out(resource_name) if signed_in
- render(:json => {"success" => signed_in})
+ render(json: {success: signed_in})
end
end
@@ -6,7 +6,7 @@ def show
unless @things.blank?
respond_with @things
else
- render(:json => {"errors" => {"address" => [t("errors.not_found", :thing => t("defaults.thing"))]}}, :status => 404)
+ render(json: {errors: {address: [t("errors.not_found", thing: t("defaults.thing"))]}}, status: 404)
end
end
@@ -15,7 +15,7 @@ def update
if @thing.update_attributes(params[:thing])
respond_with @thing
else
- render(:json => {"errors" => @thing.errors}, :status => 500)
+ render(json: {errors: @thing.errors}, status: 500)
end
end
end
@@ -1,27 +1,27 @@
class UsersController < Devise::RegistrationsController
def edit
- render("sidebar/edit_profile", :layout => "sidebar")
+ render("sidebar/edit_profile", layout: "sidebar")
end
def update
- if resource.update_with_password(params[resource_name])
- sign_in(resource_name, resource, :bypass => true)
+ if resource.update_with_password(resource_params)
+ sign_in(resource_name, resource, bypass: true)
flash[:notice] = "Profile updated!"
- redirect_to(:controller => "sidebar", :action => "search")
+ redirect_to(controller: "sidebar", action: "search")
else
clean_up_passwords(resource)
- render(:json => {"errors" => resource.errors}, :status => 500)
+ render(json: {errors: resource.errors}, status: 500)
end
end
def create
build_resource
if resource.save
sign_in(resource_name, resource)
- render(:json => resource)
+ render(json: resource)
else
clean_up_passwords(resource)
- render(:json => {"errors" => resource.errors}, :status => 500)
+ render(json: {errors: resource.errors}, status: 500)
end
end
end
@@ -1,13 +1,13 @@
class ThingMailer < ActionMailer::Base
- default :from => "adoptahydrant@cityofboston.gov"
+ default from: "adoptahydrant@cityofboston.gov"
def reminder(thing)
@thing = thing
@user = thing.user
mail(
{
- :to => thing.user.email,
- :subject => ["Remember to shovel", thing.name].compact.join(' '),
+ to: thing.user.email,
+ subject: ["Remember to shovel", thing.name].compact.join(' '),
}
)
end
View
@@ -1,6 +1,7 @@
class Reminder < ActiveRecord::Base
+ attr_accessible :thing_id, :to_user_id
validates_presence_of :from_user, :to_user, :thing
- belongs_to :from_user, :class_name => "User"
- belongs_to :to_user, :class_name => "User"
+ belongs_to :from_user, class_name: "User"
+ belongs_to :to_user, class_name: "User"
belongs_to :thing
end
View
@@ -1,6 +1,7 @@
class Thing < ActiveRecord::Base
include Geokit::Geocoders
- validates_uniqueness_of :city_id, :allow_nil => true
+ attr_accessible :name
+ validates_uniqueness_of :city_id, allow_nil: true
validates_presence_of :lat, :lng
belongs_to :user
has_many :reminders
View
@@ -1,16 +1,19 @@
class User < ActiveRecord::Base
+ # Include default devise modules. Others available are:
+ # :token_authenticatable, :confirmable,
+ # :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, :recoverable, :rememberable,
:trackable, :validatable
attr_accessible :address_1, :address_2, :city, :email, :name, :organization,
:password, :password_confirmation, :remember_me, :sms_number, :state,
:voice_number, :zip
- validates_formatting_of :email, :using => :email
- validates_formatting_of :sms_number, :using => :us_phone, :allow_blank => true
- validates_formatting_of :voice_number, :using => :us_phone, :allow_blank => true
- validates_formatting_of :zip, :using => :us_zip, :allow_blank => true
+ validates_formatting_of :email, using: :email
+ validates_formatting_of :sms_number, using: :us_phone, allow_blank: true
+ validates_formatting_of :voice_number, using: :us_phone, allow_blank: true
+ validates_formatting_of :zip, using: :us_zip, allow_blank: true
validates_presence_of :name
- has_many :reminders_to, :class_name => "Reminder", :foreign_key => "to_user_id"
- has_many :reminders_from, :class_name => "Reminder", :foreign_key => "from_user_id"
+ has_many :reminders_to, class_name: "Reminder", foreign_key: "to_user_id"
+ has_many :reminders_from, class_name: "Reminder", foreign_key: "from_user_id"
has_many :things
before_validation :remove_non_digits_from_phone_numbers
def remove_non_digits_from_phone_numbers
View
@@ -4,7 +4,7 @@
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
- Bundler.require(*Rails.groups(:assets => %w(development test)))
+ 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)
end
@@ -31,14 +31,17 @@ class Application < Rails::Application
# 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 = :en
+ # 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]
+ # Enable escaping HTML in JSON.
+ config.active_support.escape_html_entities_in_json = true
+
# 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
@@ -48,7 +51,7 @@ class Application < Rails::Application
# 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
+ config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
@@ -15,15 +15,12 @@
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
- # config.assets.compile = false
-
- # Fallback to assets pipeline if a precompiled asset is missed
- config.assets.compile = true
+ config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
- # Defaults to Rails.root.join("public/assets")
+ # Defaults to nil and saved in location specified by config.assets.prefix
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
@@ -51,8 +48,6 @@
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
- # Disable delivery errors, bad email addresses will be ignored
- # config.action_mailer.raise_delivery_errors = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = {:host => 'adoptahydrant.org'}
@@ -73,10 +68,10 @@
end
ActionMailer::Base.smtp_settings = {
- :address => "smtp.sendgrid.net",
- :port => "25",
- :authentication => :plain,
- :user_name => ENV['SENDGRID_USERNAME'],
- :password => ENV['SENDGRID_PASSWORD'],
- :domain => ENV['SENDGRID_DOMAIN'],
+ address: "smtp.sendgrid.net",
+ port: "25",
+ authentication: :plain,
+ user_name: ENV['SENDGRID_USERNAME'],
+ password: ENV['SENDGRID_PASSWORD'],
+ domain: ENV['SENDGRID_DOMAIN'],
}
Oops, something went wrong.

0 comments on commit 6b2c541

Please sign in to comment.