Skip to content

Commit

Permalink
Bundle update and autocorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Sep 19, 2018
1 parent 06787a2 commit 58fe410
Show file tree
Hide file tree
Showing 28 changed files with 177 additions and 184 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -3,4 +3,4 @@ source 'https://rubygems.org'
gemspec

gem 'rails', '~> 5.2.0.rc'
eval File.read(File.expand_path('../Gemfile-dev', __FILE__)), nil, "Gemfile-dev"
eval File.read(File.expand_path('Gemfile-dev', __dir__)), nil, 'Gemfile-dev'
138 changes: 69 additions & 69 deletions Gemfile.lock
Expand Up @@ -8,51 +8,51 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.0.rc1)
actionpack (= 5.2.0.rc1)
actioncable (5.2.1)
actionpack (= 5.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.0.rc1)
actionpack (= 5.2.0.rc1)
actionview (= 5.2.0.rc1)
activejob (= 5.2.0.rc1)
actionmailer (5.2.1)
actionpack (= 5.2.1)
actionview (= 5.2.1)
activejob (= 5.2.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.0.rc1)
actionview (= 5.2.0.rc1)
activesupport (= 5.2.0.rc1)
actionpack (5.2.1)
actionview (= 5.2.1)
activesupport (= 5.2.1)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.0.rc1)
activesupport (= 5.2.0.rc1)
actionview (5.2.1)
activesupport (= 5.2.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.0.rc1)
activesupport (= 5.2.0.rc1)
activejob (5.2.1)
activesupport (= 5.2.1)
globalid (>= 0.3.6)
activemodel (5.2.0.rc1)
activesupport (= 5.2.0.rc1)
activerecord (5.2.0.rc1)
activemodel (= 5.2.0.rc1)
activesupport (= 5.2.0.rc1)
activemodel (5.2.1)
activesupport (= 5.2.1)
activerecord (5.2.1)
activemodel (= 5.2.1)
activesupport (= 5.2.1)
arel (>= 9.0)
activestorage (5.2.0.rc1)
actionpack (= 5.2.0.rc1)
activerecord (= 5.2.0.rc1)
activestorage (5.2.1)
actionpack (= 5.2.1)
activerecord (= 5.2.1)
marcel (~> 0.3.1)
activesupport (5.2.0.rc1)
activesupport (5.2.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (9.0.0)
autoprefixer-rails (8.0.0)
autoprefixer-rails (9.1.4)
execjs
bcrypt (3.1.11)
bcrypt (3.1.12)
bootstrap (4.0.0)
autoprefixer-rails (>= 6.0.3)
popper_js (>= 1.12.9, < 2)
Expand All @@ -70,24 +70,24 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
crass (1.0.3)
devise (4.4.1)
crass (1.0.4)
devise (4.5.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.2)
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
docile (1.1.5)
erubi (1.7.0)
docile (1.3.1)
erubi (1.7.1)
execjs (2.7.0)
factory_bot (4.8.2)
factory_bot (4.11.1)
activesupport (>= 3.0.0)
ffi (1.9.22)
ffi (1.9.25)
globalid (0.4.1)
activesupport (>= 4.2.0)
i18n (0.9.5)
i18n (1.1.0)
concurrent-ruby (~> 1.0)
jquery-rails (4.3.1)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
Expand All @@ -104,60 +104,60 @@ GEM
activerecord
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
loofah (2.2.0)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mini_mime (>= 0.1.1)
marcel (0.3.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.0)
mimemagic (0.3.2)
mini_mime (1.0.0)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
mysql2 (0.4.10)
nio4r (2.2.0)
nokogiri (1.8.2)
mysql2 (0.5.2)
nio4r (2.3.1)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
orm_adapter (0.5.0)
popper_js (1.12.9)
puma (3.11.2)
rack (2.0.4)
rack-test (0.8.2)
popper_js (1.14.3)
puma (3.12.0)
rack (2.0.5)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.0.rc1)
actioncable (= 5.2.0.rc1)
actionmailer (= 5.2.0.rc1)
actionpack (= 5.2.0.rc1)
actionview (= 5.2.0.rc1)
activejob (= 5.2.0.rc1)
activemodel (= 5.2.0.rc1)
activerecord (= 5.2.0.rc1)
activestorage (= 5.2.0.rc1)
activesupport (= 5.2.0.rc1)
rails (5.2.1)
actioncable (= 5.2.1)
actionmailer (= 5.2.1)
actionpack (= 5.2.1)
actionview (= 5.2.1)
activejob (= 5.2.1)
activemodel (= 5.2.1)
activerecord (= 5.2.1)
activestorage (= 5.2.1)
activesupport (= 5.2.1)
bundler (>= 1.3.0)
railties (= 5.2.0.rc1)
railties (= 5.2.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.2.0.rc1)
actionpack (= 5.2.0.rc1)
activesupport (= 5.2.0.rc1)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.2.1)
actionpack (= 5.2.1)
activesupport (= 5.2.1)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.3.0)
rb-fsevent (0.10.2)
thor (>= 0.19.0, < 2.0)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
sass (3.5.5)
sass (3.5.7)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -168,12 +168,12 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
simplecov (0.15.1)
docile (~> 1.1.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sprockets (3.7.1)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
Expand All @@ -185,7 +185,7 @@ GEM
tilt (2.0.8)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.6)
uglifier (4.1.19)
execjs (>= 0.3.0, < 3)
url (0.3.2)
warden (1.2.7)
Expand Down Expand Up @@ -214,4 +214,4 @@ DEPENDENCIES
uglifier

BUNDLED WITH
1.16.1
1.16.2
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -4,7 +4,7 @@ rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end

APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)

load 'rails/tasks/engine.rake'
load 'rails/tasks/statistics.rake'
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/notifications/notifications_controller.rb
Expand Up @@ -17,7 +17,7 @@ def clean
private

def notifications
raise "You need reqiure user login for /notifications page." unless current_user
raise 'You need reqiure user login for /notifications page.' unless current_user
Notification.where(user_id: current_user.id)
end
end
Expand Down
6 changes: 3 additions & 3 deletions bin/rails
@@ -1,11 +1,11 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.

ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/notifications/engine', __FILE__)
ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../lib/notifications/engine', __dir__)

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

require 'rails/all'
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20160328045436_create_notifications.rb
Expand Up @@ -15,7 +15,7 @@ def change
t.timestamps null: false
end

add_index :notifications, [:user_id, :notify_type]
add_index :notifications, %i[user_id notify_type]
add_index :notifications, [:user_id]
end
end
4 changes: 2 additions & 2 deletions lib/generators/notifications/controllers_generator.rb
Expand Up @@ -2,11 +2,11 @@
module Notifications
module Generators
class ControllersGenerator < Rails::Generators::Base #:nodoc:
source_root File.expand_path('../../../../app/controllers', __FILE__)
source_root File.expand_path('../../../app/controllers', __dir__)
desc "Used to copy Notifications's controllers to your application's controllers."

def copy_controllers
%w(notifications).each do |fname|
%w[notifications].each do |fname|
path = "#{Rails.root}/app/controllers/notifications/#{fname}_controller.rb"
if File.exist?(path)
puts "Skipping notifications/#{fname}_controller.rb creation, as file already exists!"
Expand Down
4 changes: 2 additions & 2 deletions lib/generators/notifications/i18n_generator.rb
Expand Up @@ -3,10 +3,10 @@ module Notifications
module Generators
class I18nGenerator < Rails::Generators::Base
desc "Create Notifications's default I18n files"
source_root File.expand_path('../../../../', __FILE__)
source_root File.expand_path('../../..', __dir__)

def add_locales
%w(en.yml zh-CN.yml).each do |fname|
%w[en.yml zh-CN.yml].each do |fname|
path = "#{Rails.root}/config/locales/notifications.#{fname}"
if File.exist?(path)
puts "Skipping config/locales/notifications.#{fname} creation, as file already exists!"
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/notifications/install_generator.rb
Expand Up @@ -3,7 +3,7 @@ module Notifications
module Generators
class InstallGenerator < Rails::Generators::Base
desc "Create Notifications's base files"
source_root File.expand_path('../../../../', __FILE__)
source_root File.expand_path('../../..', __dir__)

def add_initializer
path = "#{Rails.root}/config/initializers/notifications.rb"
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/notifications/views_generator.rb
Expand Up @@ -2,7 +2,7 @@
module Notifications
module Generators
class ViewsGenerator < Rails::Generators::Base #:nodoc:
source_root File.expand_path('../../../../', __FILE__)
source_root File.expand_path('../../..', __dir__)
desc "Used to copy Notifications's views to your application's views."

def copy_views
Expand Down
4 changes: 2 additions & 2 deletions notifications.gemspec
@@ -1,4 +1,4 @@
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
$LOAD_PATH.push File.expand_path('lib', __dir__)

# Maintain your gem's version:
require 'notifications/version'
Expand All @@ -16,6 +16,6 @@ Gem::Specification.new do |s|

s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md']

s.add_dependency 'rails', '~> 5'
s.add_dependency 'kaminari', '>= 0.15'
s.add_dependency 'rails', '~> 5'
end
2 changes: 1 addition & 1 deletion test/dummy/Rakefile
@@ -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 File.expand_path('../config/application', __FILE__)
require File.expand_path('config/application', __dir__)

Rails.application.load_tasks
25 changes: 12 additions & 13 deletions test/dummy/app/controllers/comments_controller.rb
@@ -1,24 +1,22 @@
class CommentsController < ApplicationController
before_action :authenticate_user!
before_action :set_comment, only: [:show, :edit, :update, :destroy]
before_action :set_comment, only: %i[show edit update destroy]

# GET /comments
def index
@comments = Comment.all
end

# GET /comments/1
def show
end
def show; end

# GET /comments/new
def new
@comment = Comment.new
end

# GET /comments/1/edit
def edit
end
def edit; end

# POST /comments
def create
Expand Down Expand Up @@ -48,13 +46,14 @@ def destroy
end

private
# Use callbacks to share common setup or constraints between actions.
def set_comment
@comment = Comment.find(params[:id])
end

# Only allow a trusted parameter "white list" through.
def comment_params
params.require(:comment).permit(:topic_id, :user_id, :body)
end
# Use callbacks to share common setup or constraints between actions.
def set_comment
@comment = Comment.find(params[:id])
end

# Only allow a trusted parameter "white list" through.
def comment_params
params.require(:comment).permit(:topic_id, :user_id, :body)
end
end

0 comments on commit 58fe410

Please sign in to comment.