panda_pal 5.8.0 → 5.8.2

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
  SHA256:
3
- metadata.gz: 35907d0726df7ab474a251eedff8ff28a5d96fbf4996566454c777e20443d90d
4
- data.tar.gz: 4f883c646c445d4a0a8ad918c669308c17a2a8392818e4645a5d9efdce5ee0e2
3
+ metadata.gz: e48b08205aab332114679529d8efcb01f2af51ef1d913f4aed97c15e3c58a44d
4
+ data.tar.gz: 9159e76227ba1447a6e3a989bf06bc484db681599a8be5f96d979edc71747271
5
5
  SHA512:
6
- metadata.gz: 4f259a0c7c5928892748bd08f88b259adc5e7bb41f90f7f71e90a6c7c5e37e7a243ad426d34a4ad6b59857891e2430a7f7860cbd15938f11eaae0f74f6571247
7
- data.tar.gz: 10a665a5f0d00604f623a863255435c4f85b850de0e175dc1ef29417a83a0263c41d3ff6a7016bda9e74b2abe558da18ebb9ee87b21503aeb8920fada15c1b91
6
+ metadata.gz: 790743e7d2524f5fce5e675852ac0c219b7936f88d9e6e8e094e57bc3b9dfd4025c6435b708e6b175a461ed5fc89345d8aa9dc8bcac91fea8790908dd1c12b10
7
+ data.tar.gz: 152ba84e0ea76a8e0844b2a9374ed0d9af8c512c5e755cd64a41cdd1bc59f1d83d95bdac2d01bd62b167cd4fff98db63da91c4b4c212faf2fba19ba5486b752e
data/README.md CHANGED
@@ -27,7 +27,7 @@ As of version 5.5.0, LTIs can be installed into Canvas via the console:
27
27
  org.install_lti(
28
28
  host: "https://your_lti.herokuapp.com",
29
29
  context: "account/self", # (Optional) Or "account/3", "course/1", etc
30
- exists: :error, # (Optional) Action to take if an LTI with the same Key already exists. Options are :error, :replace, :duplicate
30
+ exists: :error, # (Optional) Action to take if an LTI with the same Key already exists. Options are :error, :replace, :duplicate, :update
31
31
  version: "v1p3", # (Optional, default `v1p3`) LTI Version. Accepts `v1p0` or `v1p3`.
32
32
  dedicated_deployment: false, # (Optional) If true, the Organization will be updated to link to a single deployment rather then to the general LTI Key. (experimental, LTI 1.3 only)
33
33
  )
@@ -74,9 +74,16 @@ module PandaPal
74
74
  [ctype, cid]
75
75
  end
76
76
 
77
- def install_lti(host: nil, context: :root_account, version: 'v1p3', exists: :error, dedicated_deployment: false)
77
+ def install_lti(host: nil, context: :root_account, version: nil, exists: :error, dedicated_deployment: false)
78
78
  raise "Automatically installing this LTI requires Bearcat." unless defined?(Bearcat)
79
79
 
80
+ version = version || PandaPal.lti_options[:lti_spec_version] || 'v1p0'
81
+ version = version.to_s
82
+
83
+ if (vs = version.split(".")).count > 1
84
+ version = "v#{vs[0]}p#{vs[0]}"
85
+ end
86
+
80
87
  run_callbacks :lti_install do
81
88
  ctype, cid = _parse_lti_context(context)
82
89
 
@@ -3,6 +3,8 @@ require 'ims/lti'
3
3
  require 'attr_encrypted'
4
4
  require 'secure_headers'
5
5
 
6
+ require_relative './helpers/console_helpers'
7
+
6
8
  module PandaPal
7
9
  class Engine < ::Rails::Engine
8
10
  config.autoload_once_paths += Dir["#{config.root}/lib/**/"]
@@ -39,16 +41,11 @@ module PandaPal
39
41
 
40
42
  initializer 'Sidekiq Scheduler Hooks' do
41
43
  ActiveSupport.on_load(:active_record) do
42
- if defined?(Sidekiq) && Sidekiq.server? # && PandaPal::Organization.respond_to?(:sync_schedules)
44
+ if defined?(Sidekiq) && Sidekiq.server?
43
45
 
44
46
  Rails.application.reloader.to_prepare do
45
47
  PandaPal::Organization.sync_schedules if PandaPal::Organization.respond_to?(:sync_schedules)
46
48
  end
47
- # PandaPal::Organization.sync_schedules
48
-
49
- # ActiveSupport::Reloader.to_prepare do
50
- # PandaPal::Organization.sync_schedules
51
- # end
52
49
  end
53
50
  end
54
51
  end
@@ -90,22 +87,22 @@ module PandaPal
90
87
  env = ENV["SENTRY_CURRENT_ENV"].presence || "PROD"
91
88
 
92
89
  if env.downcase.include?("prod")
93
- Pry::Helpers::Text.red(env)
90
+ PandaPal::ConsoleHelpers.red(env)
94
91
  else
95
- Pry::Helpers::Text.cyan(env)
92
+ PandaPal::ConsoleHelpers.cyan(env)
96
93
  end
97
94
  elsif Rails.env.development?
98
- Pry::Helpers::Text.cyan("dev")
95
+ PandaPal::ConsoleHelpers.cyan("dev")
99
96
  elsif Rails.env.test?
100
- Pry::Helpers::Text.cyan("test")
97
+ PandaPal::ConsoleHelpers.cyan("test")
101
98
  end
102
99
  end
103
100
 
104
101
  def _panda_pal_console_prefix
105
102
  pfx = [
106
- Pry::Helpers::Text.cyan(_panda_pal_short_console_app_name),
103
+ PandaPal::ConsoleHelpers.cyan(_panda_pal_short_console_app_name),
107
104
  _panda_pal_console_env,
108
- Pry::Helpers::Text.cyan(Apartment::Tenant.current),
105
+ PandaPal::ConsoleHelpers.cyan(Apartment::Tenant.current),
109
106
  ].compact.join('-')
110
107
  pfx
111
108
  end
@@ -0,0 +1,27 @@
1
+ module PandaPal
2
+ module ConsoleHelpers
3
+ extend self
4
+
5
+ COLORS = {
6
+ "black" => 0,
7
+ "red" => 1,
8
+ "green" => 2,
9
+ "yellow" => 3,
10
+ "blue" => 4,
11
+ "purple" => 5,
12
+ "magenta" => 5,
13
+ "cyan" => 6,
14
+ "white" => 7
15
+ }.freeze
16
+
17
+ COLORS.each_pair do |color, value|
18
+ define_method color do |text|
19
+ "\033[0;#{30 + value}m#{text}\033[0m"
20
+ end
21
+
22
+ define_method "bright_#{color}" do |text|
23
+ "\033[1;#{30 + value}m#{text}\033[0m"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.8.0"
2
+ VERSION = "5.8.2"
3
3
  end
data/panda_pal.gemspec CHANGED
@@ -11,7 +11,7 @@ end
11
11
  Gem::Specification.new do |s|
12
12
  s.name = "panda_pal"
13
13
  s.version = version
14
- s.authors = ["Instructure ProServe"]
14
+ s.authors = ["Instructure CustomDev"]
15
15
  s.email = ["pseng@instructure.com"]
16
16
  s.homepage = "http://instructure.com"
17
17
  s.summary = "LTI mountable engine"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.8.0
4
+ version: 5.8.2
5
5
  platform: ruby
6
6
  authors:
7
- - Instructure ProServe
7
+ - Instructure CustomDev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-11 00:00:00.000000000 Z
11
+ date: 2023-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -334,6 +334,7 @@ files:
334
334
  - lib/panda_pal.rb
335
335
  - lib/panda_pal/engine.rb
336
336
  - lib/panda_pal/helpers.rb
337
+ - lib/panda_pal/helpers/console_helpers.rb
337
338
  - lib/panda_pal/helpers/controller_helper.rb
338
339
  - lib/panda_pal/helpers/misc_helper.rb
339
340
  - lib/panda_pal/helpers/route_helper.rb