panda_pal 1.0.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1164ef591f74187ec2470b392262e36ff6b91ff3
4
- data.tar.gz: 2f2c732c8b6df412444fa77a5fbd1ba51c611be3
3
+ metadata.gz: 3ab758dc4994760c0c91ba55bce063fc48ea21f1
4
+ data.tar.gz: f78acd01750b1da73ab02f6afda4bf519d86833b
5
5
  SHA512:
6
- metadata.gz: c6236a460d0d220ce7f8218d7c3b3c7baaf2cfdfc0b788c137299957e1e1a6dcf2afedbd5bc14d45c5dafa024f344891c1076c695950c40a9c3a44e0df90b23f
7
- data.tar.gz: c3958f07c9e2536f3cacb67cd49fd049e00421c37213611b03b7540ebb3cd65f699df065b7b25e926e09cb6bdf00c979bf495431f6b10c17a80d32f31afaa1be
6
+ metadata.gz: 20edbe332ee651b90b28b4fc3e31a9f419d8ab8fe4d524bd06c740cd317891904a78325e3b08da626ec14c067c7f9b15566457b87c145d427eed47a55106941b
7
+ data.tar.gz: 29ff89b6b555eeec77c8ec749d56e587b34dd2417a399a9188660f3c8aea10a9174bde3471d6808254611947e5640d18938c99e21c02ff04935a1e7efd0929a0
@@ -38,7 +38,7 @@ module PandaPal
38
38
  #strip the launch url
39
39
  xml = tc.to_xml
40
40
  xml = xml.sub(/<blti:launch_url>.*<\/blti:launch_url>/, '') if lti_options[:launch_route].blank?
41
- render :xml => xml
41
+ render xml: xml
42
42
  end
43
43
 
44
44
  def ext_params(options)
@@ -1,6 +1,6 @@
1
1
  module PandaPal
2
2
  class Session < ActiveRecord::Base
3
- belongs_to :panda_pal_organization
3
+ belongs_to :panda_pal_organization, class_name: 'PandaPal::Organization'
4
4
 
5
5
  validates :panda_pal_organization_id, presence: true
6
6
 
@@ -1,7 +1,7 @@
1
1
  require 'apartment/elevators/generic'
2
2
 
3
3
  Apartment.configure do |config|
4
- config.excluded_models = ['PandaPal::Organization', 'PandaPal::Session', 'Delayed::Job']
4
+ config.excluded_models = ['PandaPal::Organization', 'PandaPal::Session']
5
5
 
6
6
  config.tenant_names = lambda {
7
7
  PandaPal::Organization.pluck(:name)
@@ -1,4 +1,4 @@
1
- class CreatePandaPalOrganizations < ActiveRecord::Migration
1
+ class CreatePandaPalOrganizations < ActiveRecord::Migration[5.1]
2
2
  def change
3
3
  create_table :panda_pal_organizations do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreatePandaPalSessions < ActiveRecord::Migration
1
+ class CreatePandaPalSessions < ActiveRecord::Migration[5.1]
2
2
  def change
3
3
  create_table :panda_pal_sessions do |t|
4
4
  t.string :session_key
@@ -1,4 +1,4 @@
1
- class AddPandaPalOrganizationToSession < ActiveRecord::Migration
1
+ class AddPandaPalOrganizationToSession < ActiveRecord::Migration[5.1]
2
2
  def change
3
3
  add_column :panda_pal_sessions, :panda_pal_organization_id, :integer
4
4
  add_index :panda_pal_sessions, :panda_pal_organization_id
@@ -1,4 +1,4 @@
1
- class AddSalesforceIdToOrganizations < ActiveRecord::Migration
1
+ class AddSalesforceIdToOrganizations < ActiveRecord::Migration[5.1]
2
2
  def change
3
3
  add_column :panda_pal_organizations, :salesforce_id, :string, unique: true
4
4
  end
@@ -1,5 +1,4 @@
1
1
  require 'apartment'
2
- require 'delayed_job_active_record'
3
2
  require 'ims/lti'
4
3
 
5
4
  module PandaPal
@@ -1,3 +1,3 @@
1
1
  module PandaPal::Plugins
2
- require_relative 'plugins/apartment_delayed_jobs_plugin'
2
+
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "1.0.5"
2
+ VERSION = "2.0.0"
3
3
  end
data/panda_pal.gemspec CHANGED
@@ -6,8 +6,8 @@ require "panda_pal/version"
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "panda_pal"
8
8
  s.version = PandaPal::VERSION
9
- s.authors = ["Ben Young"]
10
- s.email = ["byoung@instructure.com"]
9
+ s.authors = ["Ben Young", "Cody Tanner"]
10
+ s.email = ["byoung@instructure.com", "ctanner@instructure.com"]
11
11
  s.homepage = "http://instructure.com"
12
12
  s.summary = "LTI mountable engine"
13
13
  s.license = "MIT"
@@ -15,13 +15,11 @@ Gem::Specification.new do |s|
15
15
  s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc", "panda_pal.gemspec"]
16
16
  s.test_files = Dir["spec/**/*"]
17
17
 
18
- s.add_dependency "rails", ">= 4.2.0"
19
- s.add_dependency "pg", '~> 0.18.4'
18
+ s.add_dependency "rails", ">= 5.1.0"
19
+ s.add_dependency "pg", '~> 0.20'
20
20
  s.add_dependency 'apartment', '~> 1.2.0'
21
- s.add_dependency 'delayed_job_active_record'
22
21
  s.add_dependency 'ims-lti', '~> 2.1.0'
23
22
 
24
- s.add_development_dependency 'sqlite3'
25
23
  s.add_development_dependency 'rspec-rails'
26
24
  s.add_development_dependency 'factory_girl_rails'
27
25
  s.add_development_dependency 'test_after_commit'
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Young
8
+ - Cody Tanner
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
12
+ date: 2017-05-12 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rails
@@ -16,28 +17,28 @@ dependencies:
16
17
  requirements:
17
18
  - - ">="
18
19
  - !ruby/object:Gem::Version
19
- version: 4.2.0
20
+ version: 5.1.0
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
25
  - - ">="
25
26
  - !ruby/object:Gem::Version
26
- version: 4.2.0
27
+ version: 5.1.0
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: pg
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: 0.18.4
34
+ version: '0.20'
34
35
  type: :runtime
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
39
  - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: 0.18.4
41
+ version: '0.20'
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: apartment
43
44
  requirement: !ruby/object:Gem::Requirement
@@ -52,20 +53,6 @@ dependencies:
52
53
  - - "~>"
53
54
  - !ruby/object:Gem::Version
54
55
  version: 1.2.0
55
- - !ruby/object:Gem::Dependency
56
- name: delayed_job_active_record
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
56
  - !ruby/object:Gem::Dependency
70
57
  name: ims-lti
71
58
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +67,6 @@ dependencies:
80
67
  - - "~>"
81
68
  - !ruby/object:Gem::Version
82
69
  version: 2.1.0
83
- - !ruby/object:Gem::Dependency
84
- name: sqlite3
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
70
  - !ruby/object:Gem::Dependency
98
71
  name: rspec-rails
99
72
  requirement: !ruby/object:Gem::Requirement
@@ -139,6 +112,7 @@ dependencies:
139
112
  description:
140
113
  email:
141
114
  - byoung@instructure.com
115
+ - ctanner@instructure.com
142
116
  executables: []
143
117
  extensions: []
144
118
  extra_rdoc_files: []
@@ -157,10 +131,8 @@ files:
157
131
  - app/views/layouts/panda_pal/application.html.erb
158
132
  - app/views/panda_pal/lti/launch.html.erb
159
133
  - config/initializers/apartment.rb
160
- - config/initializers/delayed_job.rb
161
134
  - config/routes.rb
162
135
  - db/migrate/20160412205931_create_panda_pal_organizations.rb
163
- - db/migrate/20160413132229_create_delayed_jobs.rb
164
136
  - db/migrate/20160413135653_create_panda_pal_sessions.rb
165
137
  - db/migrate/20160425130344_add_panda_pal_organization_to_session.rb
166
138
  - db/migrate/20170106165533_add_salesforce_id_to_organizations.rb
@@ -170,7 +142,6 @@ files:
170
142
  - lib/panda_pal/helpers/controller_helper.rb
171
143
  - lib/panda_pal/helpers/route_helper.rb
172
144
  - lib/panda_pal/plugins.rb
173
- - lib/panda_pal/plugins/apartment_delayed_jobs_plugin.rb
174
145
  - lib/panda_pal/version.rb
175
146
  - lib/tasks/panda_pal_tasks.rake
176
147
  - panda_pal.gemspec
@@ -238,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
209
  version: '0'
239
210
  requirements: []
240
211
  rubyforge_project:
241
- rubygems_version: 2.4.5
212
+ rubygems_version: 2.5.2
242
213
  signing_key:
243
214
  specification_version: 4
244
215
  summary: LTI mountable engine
@@ -287,4 +258,3 @@ test_files:
287
258
  - spec/models/panda_pal/session_spec.rb
288
259
  - spec/rails_helper.rb
289
260
  - spec/spec_helper.rb
290
- has_rdoc:
@@ -1 +0,0 @@
1
- Delayed::Worker.plugins << PandaPal::Plugins::ApartmentDelayedJobsPlugin
@@ -1,23 +0,0 @@
1
- class CreateDelayedJobs < ActiveRecord::Migration
2
- def self.up
3
- create_table :delayed_jobs, force: true do |table|
4
- table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue
5
- table.integer :attempts, default: 0, null: false # Provides for retries, but still fail eventually.
6
- table.text :handler, null: false # YAML-encoded string of the object that will do work
7
- table.text :last_error # reason for last failure (See Note below)
8
- table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
9
- table.datetime :locked_at # Set when a client is working on this object
10
- table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
11
- table.string :locked_by # Who is working on this object (if locked)
12
- table.string :queue # The name of the queue this job is in
13
- table.string :tenant
14
- table.timestamps null: true
15
- end
16
-
17
- add_index :delayed_jobs, [:priority, :run_at], name: "delayed_jobs_priority"
18
- end
19
-
20
- def self.down
21
- drop_table :delayed_jobs
22
- end
23
- end
@@ -1,43 +0,0 @@
1
- module PandaPal::Plugins
2
- class ApartmentDelayedJobsPlugin < ::Delayed::Plugin
3
- callbacks do |lifecycle|
4
- lifecycle.around(:enqueue) do |job, *args, &block|
5
- current_tenant = Apartment::Tenant.current
6
-
7
- #make sure enqueue on public tenant unless we are testing since delayed job is set to run immediately
8
- Apartment::Tenant.switch!('public') unless Rails.env.test?
9
- job.tenant = current_tenant
10
- begin
11
- block.call(job, *args)
12
- rescue Exception => e
13
- Rails.logger.error("Error enqueing job #{job.to_s} - #{e.backtrace}")
14
- ensure
15
- #switch back to prev tenant
16
- Apartment::Tenant.switch!(current_tenant)
17
- end
18
- end
19
-
20
-
21
- lifecycle.before(:perform) do |worker, *args, &block|
22
- tenant = args.first.tenant
23
- Apartment::Tenant.switch!(tenant) if tenant.present?
24
- Rails.logger.debug("Running job with tenant #{Apartment::Tenant.current}")
25
- end
26
-
27
- lifecycle.around(:invoke_job) do |job, *args, &block|
28
- begin
29
- block.call(job, *args)
30
- ensure
31
- Apartment::Tenant.switch!('public')
32
- Rails.logger.debug("Resetting Tenant back to: #{Apartment::Tenant.current}")
33
- end
34
- end
35
-
36
- lifecycle.after(:failure) do |job, *args|
37
- Rails.logger.error("Job failed on tenant: #{Apartment::Tenant.current}")
38
- end
39
-
40
-
41
- end
42
- end
43
- end