Skip to content

Commit

Permalink
Upgrading easy gems
Browse files Browse the repository at this point in the history
Fixing new rubocop rules
  • Loading branch information
hugocorbucci committed Mar 24, 2018
1 parent 327be32 commit 60267fe
Show file tree
Hide file tree
Showing 43 changed files with 111 additions and 37 deletions.
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# frozen_string_literal: true

source 'https://rubygems.org'
ruby '2.4.3'

def linux_only(require_as)
RbConfig::CONFIG['host_os'] =~ /linux/ ? require_as : false
RbConfig::CONFIG['host_os'].match?(/linux/) ? require_as : false
end

# Mac OS X
def darwin_only(require_as)
RbConfig::CONFIG['host_os'] =~ /darwin/ ? require_as : false
RbConfig::CONFIG['host_os'].match?(/darwin/) ? require_as : false
end

gem 'attribute_normalizer'
Expand Down
50 changes: 25 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ GEM
arel (8.0.0)
ast (2.4.0)
attribute_normalizer (1.2.0)
autoprefixer-rails (8.0.0)
autoprefixer-rails (8.2.0)
execjs
aws-ses (0.6.0)
builder
Expand All @@ -55,20 +55,20 @@ GEM
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
brakeman (4.1.1)
brakeman (4.2.1)
builder (3.2.3)
bullet (5.7.3)
bullet (5.7.5)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11.0)
byebug (10.0.0)
byebug (10.0.1)
capybara (2.18.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (>= 2.0, < 4.0)
childprocess (0.8.0)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
cliver (0.3.2)
codeclimate-test-reporter (1.0.8)
Expand All @@ -83,17 +83,17 @@ GEM
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
crass (1.0.3)
devise (4.4.1)
devise (4.4.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.2)
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
devise-i18n (1.6.0)
devise-i18n (1.6.1)
devise (>= 4.4)
diff-lcs (1.3)
docile (1.1.5)
doorkeeper (4.2.6)
doorkeeper (4.3.1)
railties (>= 4.2)
doorkeeper-i18n (4.0.0)
dotenv (2.2.1)
Expand All @@ -107,7 +107,7 @@ GEM
htmlentities (~> 4.3.3)
launchy (~> 2.1)
mail (~> 2.6)
erubi (1.7.0)
erubi (1.7.1)
eventmachine (1.2.5)
execjs (2.7.0)
factory_bot (4.8.2)
Expand All @@ -117,7 +117,7 @@ GEM
railties (>= 3.0.0)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.21)
ffi (1.9.23)
foreman (0.84.0)
thor (~> 0.19.1)
formatador (0.2.5)
Expand Down Expand Up @@ -168,11 +168,11 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
lol_dba (2.1.4)
lol_dba (2.1.5)
actionpack (>= 3.0)
activerecord (>= 3.0)
railties (>= 3.0)
loofah (2.2.0)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.0.12)
Expand All @@ -190,7 +190,7 @@ GEM
multipart-post (2.0.0)
nenv (0.3.0)
newrelic_rpm (4.8.0.341)
nio4r (2.2.0)
nio4r (2.3.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
notiffany (0.1.1)
Expand Down Expand Up @@ -219,7 +219,7 @@ GEM
rack
orm_adapter (0.5.0)
parallel (1.12.1)
parser (2.5.0.0)
parser (2.5.0.5)
ast (~> 2.4.0)
pg (1.0.0)
poltergeist (1.17.0)
Expand All @@ -236,7 +236,7 @@ GEM
rack (2.0.4)
rack-livereload (0.3.16)
rack
rack-test (0.8.2)
rack-test (0.8.3)
rack (>= 1.0, < 3)
rails (5.1.5)
actioncable (= 5.1.5)
Expand All @@ -253,8 +253,8 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
Expand All @@ -267,8 +267,8 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
rake (12.3.0)
rb-fsevent (0.10.2)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
ref (2.0.0)
Expand Down Expand Up @@ -301,17 +301,17 @@ GEM
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
rubocop (0.52.1)
rubocop (0.54.0)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
ruby_dep (1.5.0)
rubyzip (1.2.1)
sass (3.5.5)
sass (3.5.6)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -322,7 +322,7 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (3.9.0)
selenium-webdriver (3.11.0)
childprocess (~> 0.5)
rubyzip (~> 1.2)
shellany (0.0.1)
Expand Down Expand Up @@ -358,7 +358,7 @@ GEM
turbolinks-source (5.1.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.6)
uglifier (4.1.8)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.3.0)
uniform_notifier (1.11.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3f57e0c51571501c3ee7313ad9868c1d
d7aab15d5fc3a42422ea804c5a66ad78
2 changes: 2 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

Expand Down
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

# 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.expand_path('../config/application', __FILE__)
require File.expand_path('config/application', __dir__)

Rails.application.load_tasks
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Base controller with common actions/methods
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/users/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Users
# Callback controller to handle omniauth returns with token
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Controller to list users and show a specific one
class UsersController < ApplicationController
def index; end
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Basic helper for the whole application
module ApplicationHelper
end
2 changes: 2 additions & 0 deletions app/helpers/layout_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Helper regarding to layout. Any method needed in the application layout.
module LayoutHelper
def title(page_title, show_title = true)
Expand Down
2 changes: 2 additions & 0 deletions app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# ApplicationRecord is an extra layer of indirection to ActiveRecord::Base
# which allows us to customize its behavior per application without monkey
# patching
Expand Down
2 changes: 2 additions & 0 deletions app/models/authentication.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Represents an authentication coming from OAuth
class Authentication < ApplicationRecord
belongs_to :user
Expand Down
5 changes: 2 additions & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# frozen_string_literal: true
# encoding: UTF-8

# Represents a user in the system
class User < ApplicationRecord
AUTH_PROVIDERS = Rails.application.secrets.omniauth.keys
SESSION_DATA_KEY = 'devise.omniauth_data'.freeze
SESSION_DATA_KEY = 'devise.omniauth_data'
devise :database_authenticatable, :registerable, :recoverable,
:trackable, :rememberable, :validatable, :omniauthable,
:confirmable,
Expand All @@ -30,7 +29,7 @@ class User < ApplicationRecord
validates :email, length: { within: 6..100 }

before_validation do |user|
if user.twitter_username =~ /\A@/
if user.twitter_username&.match?(/\A@/)
user.twitter_username = user.twitter_username[1..-1]
end
user.state = nil unless in_brazil?
Expand Down
2 changes: 2 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
Expand Down
4 changes: 3 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require File.expand_path('../boot', __FILE__)
# frozen_string_literal: true

require File.expand_path('boot', __dir__)

require 'rails/all'

Expand Down
4 changes: 3 additions & 1 deletion config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
# frozen_string_literal: true

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
4 changes: 3 additions & 1 deletion config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Load the Rails application.
require File.expand_path('../application', __FILE__)
require File.expand_path('application', __dir__)

# Initialize the Rails application.
Rails.application.initialize!
2 changes: 2 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Rails.application.configure do
# Settings specified here will take precedence over those in
# config/application.rb.
Expand Down
2 changes: 2 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Rails.application.configure do
# Settings specified here will take precedence over those in
# config/application.rb.
Expand Down
2 changes: 2 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Rails.application.configure do
# Settings specified here will take precedence over those in
# config/application.rb.
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/amazon_ses.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

ActionMailer::Base.add_delivery_method(
:ses, AWS::SES::Base,
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/backtrace_silencers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# You can add backtrace silencers for libraries that you're using but don't
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/cookies_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

Rails.application.config.action_dispatch.cookies_serializer = :json
2 changes: 2 additions & 0 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/doorkeeper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Doorkeeper.configure do
# Change the ORM that doorkeeper will use (needs plugins)
orm :active_record
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Configure sensitive parameters which will be filtered from the log file.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/inflections.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Add new inflection rules using the following format. Inflections
Expand Down
1 change: 1 addition & 0 deletions config/initializers/mime_types.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Add new mime types for use in respond_to blocks:
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: '_identity_session'
2 changes: 2 additions & 0 deletions config/initializers/wrap_parameters.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# This file contains settings for ActionController::ParamsWrapper which
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Rails.application.routes.draw do
use_doorkeeper

Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20150121044347_create_users.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/BlockLength
Expand Down
Loading

0 comments on commit 60267fe

Please sign in to comment.