Skip to content

Commit

Permalink
Merge pull request #13 from G5/upgrading
Browse files Browse the repository at this point in the history
rails and ruby upgrade effort
  • Loading branch information
Matt-Bishop authored Aug 27, 2021
2 parents 1306737 + 03803dc commit 860c343
Show file tree
Hide file tree
Showing 19 changed files with 303 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.3.1
ruby-2.7.2
20 changes: 12 additions & 8 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
appraise "rails-4.1" do
gem "rails", "~> 4.1"
end
# appraise "rails-4.1" do
# gem "rails", "~> 4.1"
# end

appraise "rails-4.2" do
gem "rails", "~> 4.2"
end
# appraise "rails-4.2" do
# gem "rails", "~> 4.2"
# end

# appraise "rails-5.1" do
# gem "rails", "~> 5.1"
# end

appraise "rails-5.1" do
gem "rails", "~> 5.1"
appraise "rails-6.1" do
gem "rails", "~> 6.1"
end
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [1.3.1] - rails 6 compatible

## [1.3.0] - 2021-03-24
### Added [#14](http://github.com/G5/asyncapi-server/pull/10)
Expand Down
3 changes: 3 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
1 change: 1 addition & 0 deletions app/controllers/asyncapi/server/v1/jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Asyncapi
module Server
module V1
class JobsController < ApplicationController # TODO: Asyncapi::Server.parent_controller
include ActiveModelSerializersFix
include Rails::Pagination

protect_from_forgery with: :null_session
Expand Down
10 changes: 10 additions & 0 deletions app/controllers/concerns/active_model_serializers_fix.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module ActiveModelSerializersFix
def namespace_for_serializer
@namespace_for_serializer ||=
if Module.method_defined?(:parent)
self.class.parent unless self.class.parent == Object
else
self.class.module_parent unless self.class.module_parent == Object
end
end
end
2 changes: 1 addition & 1 deletion app/workers/asyncapi/server/job_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def perform(job_id, retries=0)
raise e
ensure
if job
job.update_attributes(status: job_status)
job.update(status: job_status)
report_job_status(job, job_message)
else
# For some reason "ActiveRecord::Base.after_transaction",
Expand Down
12 changes: 6 additions & 6 deletions asyncapi_server.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ Gem::Specification.new do |s|
s.add_dependency "kaminari"
s.add_dependency "api-pagination"
s.add_dependency "rails", ">= 4"
s.add_dependency "active_model_serializers", "~> 0.9.0"
s.add_dependency "active_model_serializers", "~> 0.9.7"
s.add_dependency "typhoeus"
s.add_dependency "sidekiq"
s.add_dependency "responders"
s.add_dependency "ar_after_transaction"

s.add_development_dependency "sqlite3", "~> 1.3.10"
s.add_development_dependency "rspec-rails", "~> 3.5.0"
s.add_development_dependency "rspec-its", "~> 1.1.0"
s.add_development_dependency "sqlite3", ">= 1.4"
s.add_development_dependency "rspec-rails"
s.add_development_dependency "rspec-its"
s.add_development_dependency "rspec-sidekiq"
s.add_development_dependency "pry", "~> 0.10.1"
s.add_development_dependency "pry"
s.add_development_dependency "factory_girl_rails", "~> 4.4.0"
s.add_development_dependency "database_cleaner", "~> 1.3.0"
s.add_development_dependency "database_cleaner"
s.add_development_dependency "timecop"
end
2 changes: 1 addition & 1 deletion gemfiles/rails_4.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ source "https://rubygems.org"
gem "appraisal"
gem "rails", "~> 4.1"

gemspec :path => "../"
gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/rails_4.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ source "https://rubygems.org"
gem "appraisal"
gem "rails", "~> 4.2"

gemspec :path => "../"
gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/rails_5.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ source "https://rubygems.org"
gem "appraisal"
gem "rails", "~> 5.1"

gemspec :path => "../"
gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "rails", "~> 6.1"

gemspec path: "../"
240 changes: 240 additions & 0 deletions gemfiles/rails_6.1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
PATH
remote: ..
specs:
asyncapi-server (1.2.0)
active_model_serializers (= 0.9.7)
api-pagination
ar_after_transaction
kaminari
rails (>= 4)
responders
sidekiq
typhoeus

GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.3)
actionpack (= 6.1.3)
activesupport (= 6.1.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.3)
actionpack (= 6.1.3)
activejob (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
mail (>= 2.7.1)
actionmailer (6.1.3)
actionpack (= 6.1.3)
actionview (= 6.1.3)
activejob (= 6.1.3)
activesupport (= 6.1.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.3)
actionview (= 6.1.3)
activesupport (= 6.1.3)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.3)
actionpack (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
nokogiri (>= 1.8.5)
actionview (6.1.3)
activesupport (= 6.1.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.9.7)
activemodel (>= 3.2)
concurrent-ruby (~> 1.0)
activejob (6.1.3)
activesupport (= 6.1.3)
globalid (>= 0.3.6)
activemodel (6.1.3)
activesupport (= 6.1.3)
activerecord (6.1.3)
activemodel (= 6.1.3)
activesupport (= 6.1.3)
activestorage (6.1.3)
actionpack (= 6.1.3)
activejob (= 6.1.3)
activerecord (= 6.1.3)
activesupport (= 6.1.3)
marcel (~> 0.3.1)
mimemagic (~> 0.3.2)
activesupport (6.1.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
api-pagination (4.8.2)
appraisal (2.4.0)
bundler
rake
thor (>= 0.14.0)
ar_after_transaction (0.7.0)
activerecord (>= 4.2.0, < 6.2)
builder (3.2.4)
coderay (1.1.3)
concurrent-ruby (1.1.8)
connection_pool (2.2.3)
crass (1.0.6)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
database_cleaner-active_record (2.0.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
diff-lcs (1.4.4)
erubi (1.10.0)
ethon (0.12.0)
ffi (>= 1.3.0)
factory_girl (4.4.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.1)
factory_girl (~> 4.4.0)
railties (>= 3.0.0)
ffi (1.14.2)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.8.9)
concurrent-ruby (~> 1.0)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
kaminari-activerecord (= 1.2.1)
kaminari-core (= 1.2.1)
kaminari-actionview (1.2.1)
actionview
kaminari-core (= 1.2.1)
kaminari-activerecord (1.2.1)
activerecord
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
loofah (2.9.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
mimemagic (0.3.5)
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.4)
nio4r (2.5.5)
nokogiri (1.11.1)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
racc (1.5.2)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.3)
actioncable (= 6.1.3)
actionmailbox (= 6.1.3)
actionmailer (= 6.1.3)
actionpack (= 6.1.3)
actiontext (= 6.1.3)
actionview (= 6.1.3)
activejob (= 6.1.3)
activemodel (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
bundler (>= 1.15.0)
railties (= 6.1.3)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.1.3)
actionpack (= 6.1.3)
activesupport (= 6.1.3)
method_source
rake (>= 0.8.7)
thor (~> 1.0)
rake (13.0.3)
redis (4.2.5)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-rails (3.8.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-sidekiq (3.1.0)
rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0)
rspec-support (3.8.2)
sidekiq (6.1.3)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
thor (1.1.0)
timecop (0.9.4)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.4.2)

PLATFORMS
ruby

DEPENDENCIES
appraisal
asyncapi-server!
database_cleaner
factory_girl_rails (~> 4.4.0)
pry
rails (~> 6.1)
rspec-its
rspec-rails
rspec-sidekiq
sqlite3 (>= 1.4)
timecop

BUNDLED WITH
1.17.3
2 changes: 1 addition & 1 deletion lib/asyncapi/server/rails_ext/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module Asyncapi
module Server
module RailsExt
module Controller

extend ActiveSupport::Concern

module ClassMethods

def async(method_name, klass)
define_method(method_name) do
job = Job.create(job_params_with(klass.name))
Expand Down
2 changes: 1 addition & 1 deletion lib/asyncapi/server/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Asyncapi
module Server
VERSION = "1.3.0"
VERSION = "1.3.1"
end
end
3 changes: 3 additions & 0 deletions spec/dummy/app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
1 change: 1 addition & 0 deletions spec/dummy/app/controllers/tests_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class TestsController < ApplicationController
include ActiveModelSerializersFix

async :create, Runner

Expand Down
Loading

0 comments on commit 860c343

Please sign in to comment.