Skip to content
Snippets Groups Projects
Commit 10ba09f5 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Upgrade to Rails 5.0.0.1

parent ff2cbc07
No related branches found
No related tags found
No related merge requests found
Showing
with 233 additions and 198 deletions
source 'https://rubygems.org'
gem 'rails', '4.2.5.2'
gem 'rails', '5.0.0.1'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
......@@ -15,7 +15,6 @@ gem 'pg'
gem 'dotenv-rails'
gem 'font-awesome-rails'
gem 'paranoia', '~> 2.0'
gem 'paperclip', '~> 4.3'
gem 'http'
......@@ -34,15 +33,14 @@ gem 'fast_blank'
gem 'htmlentities'
gem 'onebox'
gem 'simple_form'
gem 'will_paginate', '~> 3.0.6'
gem 'will_paginate'
gem 'rack-attack'
gem 'turbolinks', '~> 5.0.0.beta'
gem 'turbolinks'
gem 'sidekiq'
gem 'sinatra', :require => nil
gem 'sinatra', require: nil, github: 'sinatra'
group :development, :test do
gem 'rspec-rails'
gem 'quiet_assets'
gem 'pry-rails'
gem 'fuubar'
gem 'fabrication'
......@@ -55,7 +53,6 @@ group :test do
end
group :development do
gem 'web-console', '~> 2.0'
gem 'rubocop', require: false
gem 'better_errors'
gem 'binding_of_caller'
......
GIT
remote: git://github.com/sinatra/sinatra.git
revision: 6b5a0ef3a4598366138fefe3f2b696ddeb371f3c
specs:
rack-protection (2.0.0)
rack
sinatra (2.0.0.pre.alpha)
mustermann (~> 0.4)
rack (~> 2.0)
rack-protection (~> 2.0)
tilt (~> 2.0)
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.5.2)
actionpack (= 4.2.5.2)
actionview (= 4.2.5.2)
activejob (= 4.2.5.2)
actioncable (5.0.0.1)
actionpack (= 5.0.0.1)
nio4r (~> 1.2)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0.1)
actionpack (= 5.0.0.1)
actionview (= 5.0.0.1)
activejob (= 5.0.0.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.5.2)
actionview (= 4.2.5.2)
activesupport (= 4.2.5.2)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-dom-testing (~> 2.0)
actionpack (5.0.0.1)
actionview (= 5.0.0.1)
activesupport (= 5.0.0.1)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.5.2)
activesupport (= 4.2.5.2)
actionview (5.0.0.1)
activesupport (= 5.0.0.1)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.5.2)
activesupport (= 4.2.5.2)
globalid (>= 0.3.0)
activemodel (4.2.5.2)
activesupport (= 4.2.5.2)
builder (~> 3.1)
activerecord (4.2.5.2)
activemodel (= 4.2.5.2)
activesupport (= 4.2.5.2)
arel (~> 6.0)
activesupport (4.2.5.2)
activejob (5.0.0.1)
activesupport (= 5.0.0.1)
globalid (>= 0.3.6)
activemodel (5.0.0.1)
activesupport (= 5.0.0.1)
activerecord (5.0.0.1)
activemodel (= 5.0.0.1)
activesupport (= 5.0.0.1)
arel (~> 7.0)
activesupport (5.0.0.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
arel (6.0.3)
ast (2.2.0)
arel (7.1.1)
ast (2.3.0)
bcrypt (3.1.11)
better_errors (2.1.1)
coderay (>= 1.0.0)
......@@ -47,9 +61,9 @@ GEM
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
bullet (5.0.0)
bullet (5.3.0)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.9.0)
uniform_notifier (~> 1.10.0)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.8)
......@@ -62,38 +76,37 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.1)
concurrent-ruby (1.0.2)
connection_pool (2.2.0)
crack (0.4.3)
safe_yaml (~> 1.0.0)
debug_inspector (0.0.2)
devise (3.5.6)
devise (4.2.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
railties (>= 4.1.0, < 5.1)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.20160310)
domain_name (0.5.20160615)
unf (>= 0.0.5, < 1.0.0)
doorkeeper (3.1.0)
railties (>= 3.2)
dotenv (2.1.0)
dotenv-rails (2.1.0)
dotenv (= 2.1.0)
doorkeeper (4.1.0)
railties (>= 4.2)
dotenv (2.1.1)
dotenv-rails (2.1.1)
dotenv (= 2.1.1)
railties (>= 4.0, < 5.1)
erubis (2.7.0)
execjs (2.6.0)
fabrication (2.15.0)
execjs (2.7.0)
fabrication (2.15.2)
fast_blank (1.0.0)
font-awesome-rails (4.5.0.1)
font-awesome-rails (4.6.3.1)
railties (>= 3.2, < 5.1)
fuubar (2.0.0)
fuubar (2.1.1)
rspec (~> 3.0)
ruby-progressbar (~> 1.4)
globalid (0.3.6)
globalid (0.3.7)
activesupport (>= 4.1.0)
goldfinger (1.0.2)
addressable (~> 2.4)
......@@ -125,7 +138,7 @@ GEM
http-form_data (1.0.1)
http_parser.rb (0.6.0)
i18n (0.7.0)
jbuilder (2.4.1)
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.1.1)
......@@ -137,24 +150,30 @@ GEM
addressable (~> 2.3)
letter_opener (1.4.1)
launchy (~> 2.2)
libv8 (3.16.14.13)
libv8 (3.16.14.15)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mail (2.6.4)
mime-types (>= 1.16, < 4)
memory_profiler (0.9.6)
method_source (0.8.2)
mime-types (2.99.1)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.0)
mini_portile2 (2.0.0)
minitest (5.8.4)
mini_portile2 (2.1.0)
minitest (5.9.0)
moneta (0.8.0)
multi_json (1.11.2)
mustache (1.0.2)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
oj (2.14.6)
onebox (1.5.35)
multi_json (1.12.1)
mustache (1.0.3)
mustermann (0.4.0)
tool (~> 0.2)
nio4r (1.2.1)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
oj (2.17.3)
onebox (1.5.48)
htmlentities (~> 4.3.4)
moneta (~> 0.8)
multi_json (~> 1.11)
......@@ -165,55 +184,48 @@ GEM
addressable (~> 2.4)
http (~> 1.0)
nokogiri (~> 1.6)
paperclip (4.3.6)
paperclip (4.3.7)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
cocaine (~> 0.5.5)
mime-types
mimemagic (= 0.3.0)
paranoia (2.1.5)
activerecord (~> 4.0)
parser (2.3.0.6)
parser (2.3.1.2)
ast (~> 2.2)
pg (0.18.4)
pkg-config (1.1.7)
powerpack (0.1.1)
pry (0.10.3)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-rails (0.3.4)
pry (>= 0.9.10)
puma (3.2.0)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rabl (0.12.0)
puma (3.6.0)
rabl (0.13.0)
activesupport (>= 2.3.14)
rack (1.6.4)
rack-attack (4.4.1)
rack (2.0.1)
rack-attack (5.0.1)
rack
rack-mini-profiler (0.9.9.2)
rack-mini-profiler (0.10.1)
rack (>= 1.2.0)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.5.2)
actionmailer (= 4.2.5.2)
actionpack (= 4.2.5.2)
actionview (= 4.2.5.2)
activejob (= 4.2.5.2)
activemodel (= 4.2.5.2)
activerecord (= 4.2.5.2)
activesupport (= 4.2.5.2)
rails (5.0.0.1)
actioncable (= 5.0.0.1)
actionmailer (= 5.0.0.1)
actionpack (= 5.0.0.1)
actionview (= 5.0.0.1)
activejob (= 5.0.0.1)
activemodel (= 5.0.0.1)
activerecord (= 5.0.0.1)
activesupport (= 5.0.0.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.5.2)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
railties (= 5.0.0.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.1)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_12factor (0.0.3)
......@@ -222,57 +234,58 @@ GEM
rails_autolink (1.1.6)
rails (> 3.1)
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.4)
railties (4.2.5.2)
actionpack (= 4.2.5.2)
activesupport (= 4.2.5.2)
rails_stdout_logging (0.0.5)
railties (5.0.0.1)
actionpack (= 5.0.0.1)
activesupport (= 5.0.0.1)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.1.0)
rake (11.1.1)
rake (11.2.2)
rdoc (4.2.2)
json (~> 1.4)
redis (3.2.2)
redis (3.3.1)
ref (2.0.0)
responders (2.1.1)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.2)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-rails (3.4.2)
actionpack (>= 3.0, < 4.3)
activesupport (>= 3.0, < 4.3)
railties (>= 3.0, < 4.3)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-support (~> 3.4.0)
rspec-support (~> 3.5.0)
rspec-rails (3.5.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-sidekiq (2.2.0)
rspec (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0)
rspec-support (3.4.1)
rubocop (0.38.0)
parser (>= 2.3.0.6, < 3.0)
rspec-support (3.5.0)
rubocop (0.42.0)
parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.7.5)
ruby_parser (3.8.1)
ruby-progressbar (1.8.1)
ruby_parser (3.8.2)
sexp_processor (~> 4.1)
safe_yaml (1.0.4)
sass (3.4.21)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
sass (3.4.22)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
......@@ -281,27 +294,23 @@ GEM
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
sexp_processor (4.7.0)
sidekiq (4.1.1)
sidekiq (4.1.2)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
redis (~> 3.2, >= 3.2.1)
simple_form (3.2.1)
actionpack (> 4, < 5.1)
activemodel (> 4, < 5.1)
simplecov (0.11.2)
simplecov (0.12.0)
docile (~> 1.1.0)
json (~> 1.8)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sinatra (1.4.7)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slop (3.6.0)
sprockets (3.5.2)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.0.4)
sprockets-rails (3.1.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
......@@ -310,32 +319,30 @@ GEM
ref
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.2)
turbolinks (5.0.0.beta2)
turbolinks-source
turbolinks-source (5.0.0.beta3)
tilt (2.0.5)
tool (0.2.3)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
uglifier (3.0.1)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unicode-display_width (1.0.2)
uniform_notifier (1.9.0)
unicode-display_width (1.1.0)
uniform_notifier (1.10.0)
warden (1.2.6)
rack (>= 1.0)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
webmock (1.24.2)
webmock (2.1.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
will_paginate (3.0.7)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.1.0)
PLATFORMS
ruby
......@@ -367,15 +374,13 @@ DEPENDENCIES
onebox
ostatus2
paperclip (~> 4.3)
paranoia (~> 2.0)
pg
pry-rails
puma
quiet_assets
rabl
rack-attack
rack-mini-profiler
rails (= 4.2.5.2)
rails (= 5.0.0.1)
rails_12factor
rails_autolink
redis (~> 3.2)
......@@ -387,13 +392,12 @@ DEPENDENCIES
sidekiq
simple_form
simplecov
sinatra
sinatra!
therubyracer
turbolinks (~> 5.0.0.beta)
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)
webmock
will_paginate (~> 3.0.6)
will_paginate
BUNDLED WITH
1.11.2
1.12.5
......@@ -4,7 +4,7 @@ class Api::SalmonController < ApiController
def update
ProcessInteractionService.new.(request.body.read, @account)
render nothing: true, status: 201
head 201
end
private
......
......@@ -4,9 +4,9 @@ class Api::SubscriptionsController < ApiController
def show
if @account.subscription(api_subscription_url(@account.id)).valid?(params['hub.topic'], params['hub.verify_token'])
render text: HTMLEntities.new.encode(params['hub.challenge']), status: 200
render plain: HTMLEntities.new.encode(params['hub.challenge']), status: 200
else
render nothing: true, status: 404
head 404
end
end
......@@ -15,9 +15,9 @@ class Api::SubscriptionsController < ApiController
if @account.subscription(api_subscription_url(@account.id)).verify(body, request.headers['HTTP_X_HUB_SIGNATURE'])
ProcessFeedService.new.(body, @account)
render nothing: true, status: 201
head 201
else
render nothing: true, status: 202
head 202
end
end
......
class ApiController < ApplicationController
protect_from_forgery with: :null_session
skip_before_filter :verify_authenticity_token
skip_before_action :verify_authenticity_token
protected
......
......@@ -11,8 +11,8 @@ class Auth::RegistrationsController < Devise::RegistrationsController
end
def configure_sign_up_params
devise_parameter_sanitizer.for(:sign_up) do |u|
u.permit(:email, :password, :password_confirmation, account_attributes: [:username])
devise_parameter_sanitizer.permit(:sign_up) do |u|
u.permit({ account_attributes: [:username] }, :email, :password, :password_confirmation)
end
end
......
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
before_filter :authenticate_user!
before_action :authenticate_user!
def index
@applications = current_user.oauth_applications
......
class XrdController < ApplicationController
before_filter :set_format
before_action :set_format
def host_meta
@webfinger_template = "#{webfinger_url}?resource={uri}"
......@@ -10,7 +10,7 @@ class XrdController < ApplicationController
@canonical_account_uri = "acct:#{@account.username}@#{Rails.configuration.x.local_domain}"
@magic_key = pem_to_magic_key(@account.keypair.public_key)
rescue ActiveRecord::RecordNotFound
render nothing: true, status: 404
head 404
end
private
......
class Account < ActiveRecord::Base
class Account < ApplicationRecord
include Targetable
# Local users
has_one :user, inverse_of: :account
validates :username, uniqueness: { scope: :domain, case_sensitive: false }, if: 'local?'
validates :username, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?'
validates :username, presence: true, uniqueness: { scope: :domain, case_sensitive: false }, if: 'local?'
validates :username, presence: true, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?'
# Avatar upload
has_attached_file :avatar, styles: { large: '300x300#', medium: '96x96#', small: '48x48#' }, default_url: 'avatars/missing.png'
......
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
class Favourite < ActiveRecord::Base
class Favourite < ApplicationRecord
include Streamable
belongs_to :account, inverse_of: :favourites
......
class Follow < ActiveRecord::Base
class Follow < ApplicationRecord
include Streamable
belongs_to :account
......
class Mention < ActiveRecord::Base
class Mention < ApplicationRecord
belongs_to :account, inverse_of: :mentions
belongs_to :status
......
class Status < ActiveRecord::Base
class Status < ApplicationRecord
include Paginable
include Streamable
......
class StreamEntry < ActiveRecord::Base
class StreamEntry < ApplicationRecord
include Paginable
belongs_to :account, inverse_of: :stream_entries
......
class User < ActiveRecord::Base
class User < ApplicationRecord
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
belongs_to :account, inverse_of: :user
......
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
# Add necessary setup steps to this file.
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
# end
puts "\n== Preparing database =="
system "bin/rake db:setup"
system! 'bin/rails db:setup'
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
system! 'bin/rails restart'
end
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
chdir APP_ROOT do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
puts "\n== Updating database =="
system! 'bin/rails db:migrate'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end
require File.expand_path('../boot', __FILE__)
require_relative 'boot'
require 'rails/all'
......@@ -22,9 +22,6 @@ module Mastodon
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment