Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Set up rubocop

  • Loading branch information...
brtjkzl committed Aug 7, 2018
1 parent a11eda9 commit 75065e1a6989256b084e469aac68507c3cf06cc8
@@ -0,0 +1,18 @@
inherit_gem:
rubocop-github:
- config/default.yml
- config/rails.yml

inherit_mode:
merge:
- Exclude

AllCops:
Exclude:
- 'bin/**/*'

Style/FrozenStringLiteralComment:
Enabled: false

Bundler/OrderedGems:
Enabled: false
@@ -0,0 +1,7 @@
{
"ruby.intellisense": false,
"ruby.format": "rubocop",
"ruby.lint": {
"rubocop": true
}
}
34 Gemfile
@@ -1,24 +1,26 @@
source 'https://rubygems.org'
source "https://rubygems.org"

ruby '2.5.1'
ruby "2.5.1"

gem 'rails', '~> 5.2.0'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 3.11'
gem 'webpacker'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'omniauth'
gem 'omniauth-facebook'
gem 'jwt'
gem 'typhoeus'
gem "rails", "~> 5.2.0"
gem "pg", ">= 0.18", "< 2.0"
gem "puma", "~> 3.11"
gem "webpacker"
gem "bootsnap", ">= 1.1.0", require: false
gem "omniauth"
gem "omniauth-facebook"
gem "jwt"
gem "typhoeus"

group :development, :test do
gem 'byebug'
gem "byebug"
end

group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem "web-console", ">= 3.3.0"
gem "listen", ">= 3.0.5", "< 3.2"
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "rubocop", require: false
gem "rubocop-github"
end
@@ -43,6 +43,7 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (9.0.0)
ast (2.4.0)
bindex (0.5.0)
bootsnap (1.3.1)
msgpack (~> 1.0)
@@ -61,6 +62,7 @@ GEM
hashie (3.5.7)
i18n (1.0.1)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.1)
jwt (1.5.6)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
@@ -99,7 +101,11 @@ GEM
omniauth-oauth2 (1.5.0)
oauth2 (~> 1.1)
omniauth (~> 1.2)
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
pg (1.0.0)
powerpack (0.1.2)
puma (3.12.0)
rack (2.0.5)
rack-proxy (0.6.4)
@@ -130,10 +136,22 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rubocop (0.58.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
rubocop-github (0.10.0)
rubocop (~> 0.51)
ruby-progressbar (1.9.0)
ruby_dep (1.5.0)
spring (2.0.2)
activesupport (>= 4.2)
@@ -153,6 +171,7 @@ GEM
ethon (>= 0.9.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.4.0)
web-console (3.6.2)
actionview (>= 5.0)
activemodel (>= 5.0)
@@ -179,6 +198,8 @@ DEPENDENCIES
pg (>= 0.18, < 2.0)
puma (~> 3.11)
rails (~> 5.2.0)
rubocop
rubocop-github
spring
spring-watcher-listen (~> 2.0.0)
typhoeus
@@ -1,6 +1,6 @@
# 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_relative 'config/application'
require_relative "config/application"

Rails.application.load_tasks
@@ -14,6 +14,6 @@ def authenticate
private

def token
request.headers['Authorization']&.split(' ')&.last
request.headers["Authorization"]&.split(" ")&.last
end
end
@@ -16,6 +16,6 @@ def create
private

def auth_hash
request.env['omniauth.auth']
request.env["omniauth.auth"]
end
end
@@ -1,17 +1,17 @@
require 'jwt'
require "jwt"

class User < ApplicationRecord
has_many :games, through: :user_games

def self.authenticate(token)
jwt = JWT.decode(token, Rails.application.credentials.jwt, 'HS256')
jwt = JWT.decode(token, Rails.application.credentials.jwt, "HS256")
User.find(jwt.id)
end

def token
JWT.encode({
id: id,
iat: Time.now.to_i
}, Rails.application.credentials.jwt, 'HS256')
}, Rails.application.credentials.jwt, "HS256")
end
end
@@ -1,6 +1,6 @@
class UserGame < ApplicationRecord
belongs_to :user,
belongs_to :game,
belongs_to :user
belongs_to :game
has_and_belongs_to_many :platforms

enum status: [:wishlist, :backlog, :playing, :completed]
@@ -1,5 +1,5 @@
# This file is used by Rack-based servers to start the application.

require_relative 'config/environment'
require_relative "config/environment"

run Rails.application
@@ -1,4 +1,4 @@
require_relative 'boot'
require_relative "boot"

require "rails"
# Pick the frameworks you want:
@@ -1,4 +1,4 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
@@ -1,5 +1,5 @@
# Load the Rails application.
require_relative 'application'
require_relative "application"

# Initialize the Rails application.
Rails.application.initialize!
@@ -16,12 +16,12 @@

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
if Rails.root.join("tmp", "caching-dev.txt").exist?
config.action_controller.perform_caching = true

config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}"
"Cache-Control" => "public, max-age=#{2.days.to_i}"
}
else
config.action_controller.perform_caching = false
@@ -22,7 +22,7 @@

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?

# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
@@ -42,7 +42,7 @@
config.log_level = :debug

# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]

# Use a different cache store in production.
# config.cache_store = :mem_cache_store
@@ -15,7 +15,7 @@
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
}

# Show full error reports and disable caching.
@@ -8,6 +8,6 @@
resources :scores, only: [:index, :show]
end

get '/auth/:provider/callback', to: 'auth#create'
get "/auth/:provider/callback", to: "auth#create"
root "client#show"
end

0 comments on commit 75065e1

Please sign in to comment.
You can’t perform that action at this time.