bearcat 1.5.40 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +0 -0
- data/bearcat.gemspec +1 -1
- data/lib/badgrcat/api_array.rb +0 -0
- data/lib/badgrcat/version.rb +0 -0
- data/lib/bearcat/client/account_reports.rb +0 -0
- data/lib/bearcat/client/accounts.rb +0 -0
- data/lib/bearcat/client/analytics.rb +0 -0
- data/lib/bearcat/client/assignment_groups.rb +0 -0
- data/lib/bearcat/client/assignments.rb +0 -0
- data/lib/bearcat/client/blueprint_courses.rb +0 -0
- data/lib/bearcat/client/calendar_events.rb +0 -0
- data/lib/bearcat/client/canvas_files.rb +0 -0
- data/lib/bearcat/client/conferences.rb +0 -0
- data/lib/bearcat/client/content_exports.rb +0 -0
- data/lib/bearcat/client/content_migrations.rb +0 -0
- data/lib/bearcat/client/conversations.rb +0 -0
- data/lib/bearcat/client/custom_gradebook_columns.rb +0 -0
- data/lib/bearcat/client/discussions.rb +0 -0
- data/lib/bearcat/client/enrollments.rb +0 -0
- data/lib/bearcat/client/external_tools.rb +0 -0
- data/lib/bearcat/client/file_helper.rb +0 -0
- data/lib/bearcat/client/files.rb +0 -0
- data/lib/bearcat/client/folders.rb +0 -0
- data/lib/bearcat/client/group_categories.rb +0 -0
- data/lib/bearcat/client/group_memberships.rb +0 -0
- data/lib/bearcat/client/groups.rb +0 -0
- data/lib/bearcat/client/learning_outcomes.rb +0 -0
- data/lib/bearcat/client/logins.rb +0 -0
- data/lib/bearcat/client/module_items.rb +0 -0
- data/lib/bearcat/client/modules.rb +0 -0
- data/lib/bearcat/client/o_auth2.rb +0 -0
- data/lib/bearcat/client/outcome_groups.rb +0 -0
- data/lib/bearcat/client/outcome_imports.rb +0 -0
- data/lib/bearcat/client/outcomes.rb +0 -0
- data/lib/bearcat/client/pages.rb +0 -0
- data/lib/bearcat/client/progresses.rb +0 -0
- data/lib/bearcat/client/quizzes.rb +0 -0
- data/lib/bearcat/client/reports.rb +0 -2
- data/lib/bearcat/client/roles.rb +0 -0
- data/lib/bearcat/client/rubric.rb +0 -0
- data/lib/bearcat/client/rubric_assessment.rb +0 -0
- data/lib/bearcat/client/rubric_association.rb +0 -0
- data/lib/bearcat/client/search.rb +0 -0
- data/lib/bearcat/client/sections.rb +0 -0
- data/lib/bearcat/client/sis_imports.rb +0 -0
- data/lib/bearcat/client/submissions.rb +0 -1
- data/lib/bearcat/client/tabs.rb +0 -0
- data/lib/bearcat/client.rb +0 -1
- data/lib/bearcat/client_module.rb +0 -0
- data/lib/bearcat/rate_limiting/functions.lua +11 -0
- data/lib/bearcat/rate_limiting/increment_bucket.lua +0 -0
- data/lib/bearcat/rate_limiting/redis_script.rb +0 -0
- data/lib/bearcat/rate_limiting.rb +0 -0
- data/lib/bearcat/version.rb +1 -1
- data/lib/bearcat.rb +4 -8
- data/lib/catalogcat/api_array.rb +0 -0
- data/lib/catalogcat/client/catalogs.rb +0 -0
- data/lib/catalogcat/client/certificates.rb +0 -0
- data/lib/catalogcat/client/courses.rb +0 -0
- data/lib/catalogcat/client/email_domain_sets.rb +0 -0
- data/lib/catalogcat/client/enrollments.rb +0 -0
- data/lib/catalogcat/client/orders.rb +0 -0
- data/lib/catalogcat/client/user_registrations.rb +0 -0
- data/lib/catalogcat/client.rb +0 -0
- data/lib/catalogcat/version.rb +0 -0
- data/lib/catalogcat.rb +0 -0
- data/spec/bearcat/api_array_spec.rb +0 -0
- data/spec/bearcat/client/accounts_spec.rb +0 -0
- data/spec/bearcat/client/analytics_spec.rb +0 -0
- data/spec/bearcat/client/assignment_groups_spec.rb +0 -0
- data/spec/bearcat/client/assignments_spec.rb +0 -0
- data/spec/bearcat/client/blueprint_courses_spec.rb +0 -0
- data/spec/bearcat/client/calendar_events_spec.rb +0 -0
- data/spec/bearcat/client/canvas_files_spec.rb +0 -0
- data/spec/bearcat/client/conferences_spec.rb +0 -0
- data/spec/bearcat/client/content_exports_spec.rb +0 -0
- data/spec/bearcat/client/content_migrations_spec.rb +0 -0
- data/spec/bearcat/client/conversations_spec.rb +0 -0
- data/spec/bearcat/client/courses_spec.rb +0 -0
- data/spec/bearcat/client/custom_gradebook_columns_spec.rb +0 -0
- data/spec/bearcat/client/discussions_spec.rb +0 -0
- data/spec/bearcat/client/enrollments_spec.rb +0 -0
- data/spec/bearcat/client/external_tools_spec.rb +0 -0
- data/spec/bearcat/client/files_spec.rb +0 -0
- data/spec/bearcat/client/folders_spec.rb +0 -0
- data/spec/bearcat/client/graph_ql_spec.rb +0 -0
- data/spec/bearcat/client/group_categories_spec.rb +0 -0
- data/spec/bearcat/client/group_membership_spec.rb +0 -0
- data/spec/bearcat/client/group_memberships_spec.rb +0 -0
- data/spec/bearcat/client/groups_spec.rb +0 -0
- data/spec/bearcat/client/learning_outcomes_spec.rb +0 -0
- data/spec/bearcat/client/module_items_spec.rb +0 -0
- data/spec/bearcat/client/modules_spec.rb +0 -0
- data/spec/bearcat/client/o_auth2_spec.rb +0 -0
- data/spec/bearcat/client/outcome_groups_spec.rb +0 -0
- data/spec/bearcat/client/outcomes_spec.rb +0 -0
- data/spec/bearcat/client/pages_spec.rb +0 -0
- data/spec/bearcat/client/quizzes_spec.rb +0 -0
- data/spec/bearcat/client/reports_spec.rb +0 -0
- data/spec/bearcat/client/roles_spec.rb +0 -0
- data/spec/bearcat/client/rubric_assessment_spec.rb +0 -0
- data/spec/bearcat/client/rubric_association_spec.rb +0 -0
- data/spec/bearcat/client/rubric_spec.rb +0 -0
- data/spec/bearcat/client/search_spec.rb +0 -0
- data/spec/bearcat/client/sections_spec.rb +0 -0
- data/spec/bearcat/client/submissions_spec.rb +0 -0
- data/spec/bearcat/client/users_spec.rb +0 -0
- data/spec/bearcat/client_spec.rb +0 -0
- data/spec/bearcat/rate_limiting_spec.rb +0 -0
- data/spec/bearcat/stub_bearcat_spec.rb +0 -0
- data/spec/bearcat_spec.rb +0 -0
- data/spec/fixtures/access_token.json +0 -0
- data/spec/fixtures/account_admin_create.json +0 -0
- data/spec/fixtures/account_admin_delete.json +0 -0
- data/spec/fixtures/account_admins.json +0 -0
- data/spec/fixtures/account_courses.json +0 -0
- data/spec/fixtures/account_grading_standards.json +0 -0
- data/spec/fixtures/account_groups.json +0 -0
- data/spec/fixtures/account_reports.json +0 -0
- data/spec/fixtures/account_reports_index.json +0 -0
- data/spec/fixtures/account_reports_result_success.json +0 -0
- data/spec/fixtures/account_reports_start_result.json +0 -0
- data/spec/fixtures/account_role.json +0 -0
- data/spec/fixtures/account_roles.json +0 -0
- data/spec/fixtures/account_sis_imports.json +0 -0
- data/spec/fixtures/account_sub_accounts.json +0 -0
- data/spec/fixtures/account_user.json +0 -0
- data/spec/fixtures/account_users.json +0 -0
- data/spec/fixtures/accounts.json +0 -0
- data/spec/fixtures/add_custom_user_data.json +0 -0
- data/spec/fixtures/add_user.json +0 -0
- data/spec/fixtures/assignment.json +0 -0
- data/spec/fixtures/assignment_group.json +0 -0
- data/spec/fixtures/assignment_groups.json +0 -0
- data/spec/fixtures/assignment_section_override.json +0 -0
- data/spec/fixtures/assignments.json +0 -0
- data/spec/fixtures/bearcat.jpg +0 -0
- data/spec/fixtures/blueprint_migration.json +0 -0
- data/spec/fixtures/blueprint_subscriptions.json +0 -0
- data/spec/fixtures/blueprint_template.json +0 -0
- data/spec/fixtures/blueprint_update_assocations_success.json +0 -0
- data/spec/fixtures/calendar_event.json +0 -0
- data/spec/fixtures/calendar_events.json +0 -0
- data/spec/fixtures/canvas_files/declare_file.json +0 -0
- data/spec/fixtures/canvas_files/upload_success.json +0 -0
- data/spec/fixtures/cc.imscc +0 -0
- data/spec/fixtures/communication_channels.json +0 -0
- data/spec/fixtures/conclude_enrollment.json +0 -0
- data/spec/fixtures/content_export.json +0 -0
- data/spec/fixtures/content_migration_files/content_migration.json +0 -0
- data/spec/fixtures/content_migration_files/response.json +0 -0
- data/spec/fixtures/content_migration_files/upload_success.json +0 -0
- data/spec/fixtures/conversation.json +0 -0
- data/spec/fixtures/course.json +0 -0
- data/spec/fixtures/course_conferences.json +0 -0
- data/spec/fixtures/course_copy.json +0 -0
- data/spec/fixtures/course_enrollments.json +0 -0
- data/spec/fixtures/course_files.json +0 -0
- data/spec/fixtures/course_folder.json +0 -0
- data/spec/fixtures/course_folders.json +0 -0
- data/spec/fixtures/course_grading_standards.json +0 -0
- data/spec/fixtures/course_groups.json +0 -0
- data/spec/fixtures/course_sections.json +0 -0
- data/spec/fixtures/course_settings.json +0 -0
- data/spec/fixtures/course_students.json +0 -0
- data/spec/fixtures/create_course_discussion.json +0 -0
- data/spec/fixtures/create_group_discussion.json +0 -0
- data/spec/fixtures/create_outcome_in_group.json +0 -0
- data/spec/fixtures/create_section.json +0 -0
- data/spec/fixtures/created_assignment.json +0 -0
- data/spec/fixtures/created_course.json +0 -0
- data/spec/fixtures/created_group.json +0 -0
- data/spec/fixtures/created_group_category.json +0 -0
- data/spec/fixtures/created_group_membership.json +0 -0
- data/spec/fixtures/created_module.json +0 -0
- data/spec/fixtures/custom_data.json +0 -0
- data/spec/fixtures/custom_food_data.json +0 -0
- data/spec/fixtures/custom_gradebook_columns/column_data.json +0 -0
- data/spec/fixtures/custom_gradebook_columns/custom_gradebook_column.json +0 -0
- data/spec/fixtures/custom_gradebook_columns/custom_gradebook_columns.json +0 -0
- data/spec/fixtures/custom_gradebook_columns/gradebook_column_progress.json +0 -0
- data/spec/fixtures/dashboard.json +0 -0
- data/spec/fixtures/delete_course.json +0 -0
- data/spec/fixtures/delete_custom_data_scope.json +0 -0
- data/spec/fixtures/delete_group_category.json +0 -0
- data/spec/fixtures/delete_section.json +0 -0
- data/spec/fixtures/deleted_conversation.json +0 -0
- data/spec/fixtures/deleted_group.json +0 -0
- data/spec/fixtures/department_level_participation.json +0 -0
- data/spec/fixtures/department_level_statistics.json +0 -0
- data/spec/fixtures/discussion_entries.json +0 -0
- data/spec/fixtures/discussion_entry_replies.json +0 -0
- data/spec/fixtures/discussion_topic.json +0 -0
- data/spec/fixtures/discussion_topics.json +0 -0
- data/spec/fixtures/edited_group.json +0 -0
- data/spec/fixtures/edited_group_category.json +0 -0
- data/spec/fixtures/enroll_student.json +0 -0
- data/spec/fixtures/enrollment_terms.json +0 -0
- data/spec/fixtures/external_tool.json +0 -0
- data/spec/fixtures/external_tools.json +0 -0
- data/spec/fixtures/file.csv +0 -0
- data/spec/fixtures/gradebook_history.json +0 -0
- data/spec/fixtures/graph_ql_scores.json +0 -0
- data/spec/fixtures/group.json +0 -0
- data/spec/fixtures/group_categories.json +0 -0
- data/spec/fixtures/group_category.json +0 -0
- data/spec/fixtures/group_category_groups.json +0 -0
- data/spec/fixtures/group_conferences.json +0 -0
- data/spec/fixtures/group_membership.json +0 -0
- data/spec/fixtures/learning_outcome.json +0 -0
- data/spec/fixtures/link_unlink_outcome.json +0 -0
- data/spec/fixtures/merge_user.json +0 -0
- data/spec/fixtures/module.json +0 -0
- data/spec/fixtures/module_item.json +0 -0
- data/spec/fixtures/module_item_sequence.json +0 -0
- data/spec/fixtures/module_items.json +0 -0
- data/spec/fixtures/modules.json +0 -0
- data/spec/fixtures/no_custom_data.json +0 -0
- data/spec/fixtures/ok.json +0 -0
- data/spec/fixtures/outcome_group_import.json +0 -0
- data/spec/fixtures/outcome_groups.json +0 -0
- data/spec/fixtures/outcome_result.json +0 -0
- data/spec/fixtures/outcome_subgroup.json +0 -0
- data/spec/fixtures/outcome_subgroups.json +0 -0
- data/spec/fixtures/outcomes.json +0 -0
- data/spec/fixtures/paged_body.json +0 -0
- data/spec/fixtures/pages.json +0 -0
- data/spec/fixtures/progress.json +0 -0
- data/spec/fixtures/quizzes/course_quiz.json +0 -0
- data/spec/fixtures/quizzes/course_quiz_questions.json +0 -0
- data/spec/fixtures/quizzes/course_quizzes.json +0 -0
- data/spec/fixtures/quizzes/quiz_assignment_override.json +0 -0
- data/spec/fixtures/quizzes/quiz_extension.json +0 -0
- data/spec/fixtures/reactivate_enrollment.json +0 -0
- data/spec/fixtures/report_history.json +0 -0
- data/spec/fixtures/report_list.json +0 -0
- data/spec/fixtures/report_status.json +0 -0
- data/spec/fixtures/rubric.json +0 -0
- data/spec/fixtures/rubric_assessment.json +0 -0
- data/spec/fixtures/rubric_association.json +0 -0
- data/spec/fixtures/search_find_recipients.json +0 -0
- data/spec/fixtures/section.json +0 -0
- data/spec/fixtures/section_enrollments.json +0 -0
- data/spec/fixtures/single_account.json +0 -0
- data/spec/fixtures/start_report.json +0 -0
- data/spec/fixtures/submissions/submission.json +0 -0
- data/spec/fixtures/update_outcome.json +0 -0
- data/spec/fixtures/update_outcome_group.json +0 -0
- data/spec/fixtures/update_section.json +0 -0
- data/spec/fixtures/updated_course.json +0 -0
- data/spec/fixtures/user_avatars.json +0 -0
- data/spec/fixtures/user_details.json +0 -0
- data/spec/fixtures/user_enrollments.json +0 -0
- data/spec/fixtures/user_logins.json +0 -0
- data/spec/fixtures/user_page_views.json +0 -0
- data/spec/fixtures/user_profile.json +0 -0
- data/spec/helper.rb +1 -0
- metadata +12 -18
- data/lib/bearcat/redis_connection.rb +0 -106
data/spec/fixtures/group.json
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/fixtures/module.json
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/fixtures/modules.json
CHANGED
File without changes
|
File without changes
|
data/spec/fixtures/ok.json
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/fixtures/outcomes.json
CHANGED
File without changes
|
File without changes
|
data/spec/fixtures/pages.json
CHANGED
File without changes
|
data/spec/fixtures/progress.json
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/fixtures/rubric.json
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/fixtures/section.json
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bearcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure CustomDev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -137,25 +137,19 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.2.2
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: rediconn
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: 2.2.0
|
146
|
-
- - "<"
|
143
|
+
- - "~>"
|
147
144
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
145
|
+
version: 0.1.0
|
149
146
|
type: :runtime
|
150
147
|
prerelease: false
|
151
148
|
version_requirements: !ruby/object:Gem::Requirement
|
152
149
|
requirements:
|
153
|
-
- - "
|
154
|
-
- !ruby/object:Gem::Version
|
155
|
-
version: 2.2.0
|
156
|
-
- - "<"
|
150
|
+
- - "~>"
|
157
151
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
152
|
+
version: 0.1.0
|
159
153
|
description: Ruby interface for interacting with the canvas API
|
160
154
|
email:
|
161
155
|
- pseng@instructure.com
|
@@ -221,9 +215,9 @@ files:
|
|
221
215
|
- lib/bearcat/client/users.rb
|
222
216
|
- lib/bearcat/client_module.rb
|
223
217
|
- lib/bearcat/rate_limiting.rb
|
218
|
+
- lib/bearcat/rate_limiting/functions.lua
|
224
219
|
- lib/bearcat/rate_limiting/increment_bucket.lua
|
225
220
|
- lib/bearcat/rate_limiting/redis_script.rb
|
226
|
-
- lib/bearcat/redis_connection.rb
|
227
221
|
- lib/bearcat/spec_helpers.rb
|
228
222
|
- lib/bearcat/version.rb
|
229
223
|
- lib/catalogcat.rb
|
@@ -428,10 +422,10 @@ files:
|
|
428
422
|
- spec/fixtures/user_page_views.json
|
429
423
|
- spec/fixtures/user_profile.json
|
430
424
|
- spec/helper.rb
|
431
|
-
homepage:
|
425
|
+
homepage:
|
432
426
|
licenses: []
|
433
427
|
metadata: {}
|
434
|
-
post_install_message:
|
428
|
+
post_install_message:
|
435
429
|
rdoc_options: []
|
436
430
|
require_paths:
|
437
431
|
- lib
|
@@ -447,7 +441,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
447
441
|
version: '0'
|
448
442
|
requirements: []
|
449
443
|
rubygems_version: 3.1.6
|
450
|
-
signing_key:
|
444
|
+
signing_key:
|
451
445
|
specification_version: 4
|
452
446
|
summary: Canvas API
|
453
447
|
test_files:
|
@@ -1,106 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "connection_pool"
|
4
|
-
require "redis"
|
5
|
-
require "uri"
|
6
|
-
|
7
|
-
# Adapted from Sidekiq 6.x Implementation
|
8
|
-
|
9
|
-
module Bearcat
|
10
|
-
module RedisConnection
|
11
|
-
KNOWN_REDIS_URL_ENVS = %w[REDIS_URL REDISTOGO_URL REDISCLOUD_URL].freeze
|
12
|
-
|
13
|
-
class << self
|
14
|
-
def configured?(prefix, explicit: false)
|
15
|
-
determine_redis_provider(prefix: prefix, explicit: true)
|
16
|
-
end
|
17
|
-
|
18
|
-
def create(options = {})
|
19
|
-
symbolized_options = options.transform_keys(&:to_sym)
|
20
|
-
|
21
|
-
if !symbolized_options[:url] && (u = determine_redis_provider(prefix: options[:env_prefix]))
|
22
|
-
symbolized_options[:url] = u
|
23
|
-
end
|
24
|
-
|
25
|
-
size = if symbolized_options[:size]
|
26
|
-
symbolized_options[:size]
|
27
|
-
elsif symbolized_options[:env_prefix] && (v = ENV["#{symbolized_options[:env_prefix]}_REDIS_POOL_SIZE"])
|
28
|
-
Integer(v)
|
29
|
-
elsif ENV["RAILS_MAX_THREADS"]
|
30
|
-
Integer(ENV["RAILS_MAX_THREADS"])
|
31
|
-
else
|
32
|
-
5
|
33
|
-
end
|
34
|
-
|
35
|
-
pool_timeout = symbolized_options[:pool_timeout] || 1
|
36
|
-
|
37
|
-
ConnectionPool.new(timeout: pool_timeout, size: size) do
|
38
|
-
namespace = symbolized_options[:namespace]
|
39
|
-
client = Redis.new client_opts(symbolized_options)
|
40
|
-
|
41
|
-
if namespace
|
42
|
-
begin
|
43
|
-
require "redis/namespace"
|
44
|
-
Redis::Namespace.new(namespace, redis: client)
|
45
|
-
rescue LoadError
|
46
|
-
Rails.logger.error("Your Redis configuration uses the namespace '#{namespace}' but the redis-namespace gem is not included in the Gemfile." \
|
47
|
-
"Add the gem to your Gemfile to continue using a namespace. Otherwise, remove the namespace parameter.")
|
48
|
-
exit(-127)
|
49
|
-
end
|
50
|
-
else
|
51
|
-
client
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def client_opts(options)
|
59
|
-
opts = options.dup
|
60
|
-
if opts[:namespace]
|
61
|
-
opts.delete(:namespace)
|
62
|
-
end
|
63
|
-
|
64
|
-
opts.delete(:size)
|
65
|
-
opts.delete(:env_prefix)
|
66
|
-
|
67
|
-
if opts[:network_timeout]
|
68
|
-
opts[:timeout] = opts[:network_timeout]
|
69
|
-
opts.delete(:network_timeout)
|
70
|
-
end
|
71
|
-
|
72
|
-
opts[:reconnect_attempts] ||= 1
|
73
|
-
|
74
|
-
opts
|
75
|
-
end
|
76
|
-
|
77
|
-
def determine_redis_provider(prefix: nil, explicit: false)
|
78
|
-
vars = []
|
79
|
-
|
80
|
-
if prefix.present?
|
81
|
-
if (ptr = ENV["#{prefix}_REDIS_PROVIDER"]).present?
|
82
|
-
return ENV[ptr]
|
83
|
-
else
|
84
|
-
vars.push(*KNOWN_REDIS_URL_ENVS.map { |e| ENV["#{prefix}_#{e}"] })
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
if !explicit || !prefix.present?
|
89
|
-
if (ptr = ENV["REDIS_PROVIDER"]).present?
|
90
|
-
vars << ptr # Intentionally not a return
|
91
|
-
else
|
92
|
-
vars.push(*KNOWN_REDIS_URL_ENVS)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
vars.select!(&:present?)
|
97
|
-
|
98
|
-
vars.each do |e|
|
99
|
-
return ENV[e] if ENV[e].present?
|
100
|
-
end
|
101
|
-
|
102
|
-
nil
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|