Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove support for Ruby 1.8

  • Loading branch information...
commit b3b66d273fd4b8d588b8175e6e3f74df1eb02f8e 1 parent f577984
@sferik authored
View
2  .travis.yml
@@ -2,6 +2,4 @@ before_install: gem install bundler --pre
bundler_args: --without production
language: ruby
rvm:
- - 1.8.7
- - 1.9.2
- 1.9.3
View
15 README.md
@@ -77,20 +77,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.8.7
-* 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  Rakefile
@@ -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.
View
2  app/assets/stylesheets/application.css
@@ -12,4 +12,4 @@
*= require bootstrap
*= require bootstrap-responsive
*= require_tree .
-*/
+ */
View
6 app/controllers/sessions_controller.rb
@@ -3,12 +3,12 @@ class SessionsController < ApplicationController
def create
session[:access_token] = request.env['omniauth.auth']['credentials']['token']
session[:access_secret] = request.env['omniauth.auth']['credentials']['secret']
- redirect_to show_path, :notice => "Signed in"
+ redirect_to show_path, notice: "Signed in"
end
def show
if session['access_token'] && session['access_secret']
- @user = client.user(:include_entities => true)
+ @user = client.user(include_entities: true)
else
redirect_to failure_path
end
@@ -21,7 +21,7 @@ def error
def destroy
reset_session
- redirect_to root_path, :notice => "Signed out"
+ redirect_to root_path, notice: "Signed out"
end
end
View
5 config/application.rb
@@ -6,7 +6,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
@@ -41,6 +41,9 @@ class Application < Rails::Application
# 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
View
7 config/environments/production.rb
@@ -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
View
2  config/initializers/session_store.rb
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.
-SignInWithTwitter::Application.config.session_store :cookie_store, :key => '_sign-in-with-twitter_session'
+SignInWithTwitter::Application.config.session_store :cookie_store, key: '_sign-in-with-twitter_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
View
2  config/initializers/wrap_parameters.rb
@@ -5,7 +5,7 @@
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
- wrap_parameters :format => [:json]
+ wrap_parameters format: [:json]
end
# Disable root element in JSON by default.
View
10 config/routes.rb
@@ -1,7 +1,7 @@
SignInWithTwitter::Application.routes.draw do
- root :to => 'welcome#index'
- get '/auth/twitter/callback', :to => 'sessions#create', :as => 'callback'
- get '/auth/failure', :to => 'sessions#error', :as => 'failure'
- get '/profile', :to => 'sessions#show', :as => 'show'
- delete '/signout', :to => 'sessions#destroy', :as => 'signout'
+ root to: 'welcome#index'
+ get '/auth/twitter/callback', to: 'sessions#create', as: 'callback'
+ get '/auth/failure', to: 'sessions#error', as: 'failure'
+ get '/profile', to: 'sessions#show', as: 'show'
+ delete '/signout', to: 'sessions#destroy', as: 'signout'
end
View
10 test/functional/sessions_controller_test.rb
@@ -7,7 +7,7 @@ class SessionsControllerTest < ActionController::TestCase
result['omniauth.auth']['credentials'] = {}
result['omniauth.auth']['credentials']['token'] = 'abc'
result['omniauth.auth']['credentials']['secret'] = '123'
- request.stubs :env => result
+ request.stubs env: result
get :create
assert_equal 'abc', session[:access_token]
assert_equal '123', session[:access_secret]
@@ -19,11 +19,11 @@ class SessionsControllerTest < ActionController::TestCase
session[:access_token] = 'abc'
session[:access_secret] = '123'
stub_request(:get, 'https://api.twitter.com/1/account/verify_credentials.json').
- with(:query => {"include_entities" => "true"}).
- to_return(:body => File.read(File.expand_path('../../fixtures/user.json', __FILE__)), :status => 200)
+ with(query: {include_entities: "true"}).
+ to_return(body: File.read(File.expand_path('../../fixtures/user.json', __FILE__)))
stub_request(:get, "https://api.twitter.com/1/users/show.json").
- with(:query => {"screen_name" => "sferik"}).
- to_return(:body => File.read(File.expand_path('../../fixtures/user.json', __FILE__)), :status => 200)
+ with(query: {screen_name: "sferik"}).
+ to_return(body: File.read(File.expand_path('../../fixtures/user.json', __FILE__)))
get :show
assert_not_nil assigns :user
assert_response :success
View
4 test/performance/browsing_test.rb
@@ -3,8 +3,8 @@
class BrowsingTest < ActionDispatch::PerformanceTest
# Refer to the documentation for all available options
- # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
- # :output => 'tmp/performance', :formats => [:flat] }
+ # self.profile_options = { runs: 5, metrics: [:wall_time, :memory]
+ # output: 'tmp/performance', formats: [:flat] }
def test_homepage
get '/'
Please sign in to comment.
Something went wrong with that request. Please try again.