rubocop: fix miscelleneuos violations in prep of bumping rubocop
Change-Id: I9d37303737f00d6e022cb8fc08726e293a7336ab Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315166 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jacob Burroughs <jburroughs@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
2082e77a77
commit
1d3d9ed499
|
@ -622,9 +622,7 @@ class AssignmentsController < ApplicationController
|
|||
set_tutorial_js_env
|
||||
|
||||
log_asset_access(["syllabus", @context], "syllabus", "other")
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
respond_to(&:html)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -458,9 +458,9 @@ class DiscussionTopicsController < ApplicationController
|
|||
end
|
||||
|
||||
InstStatsd::Statsd.increment("discussion_topic.index.visit")
|
||||
InstStatsd::Statsd.count("discussion_topic.index.visit.pinned", @topics&.select { |dt| dt.pinned }&.count)
|
||||
InstStatsd::Statsd.count("discussion_topic.index.visit.pinned", @topics&.select(&:pinned)&.count)
|
||||
InstStatsd::Statsd.count("discussion_topic.index.visit.discussions", @topics&.length)
|
||||
InstStatsd::Statsd.count("discussion_topic.index.visit.closed_for_comments", @topics&.select { |dt| dt.locked }&.count)
|
||||
InstStatsd::Statsd.count("discussion_topic.index.visit.closed_for_comments", @topics&.select(&:locked)&.count)
|
||||
|
||||
format.json do
|
||||
log_api_asset_access(["topics", @context], "topics", "other")
|
||||
|
|
|
@ -51,7 +51,7 @@ class MessagesController < ApplicationController
|
|||
def html_message
|
||||
message = @context.messages.find(params[:message_id])
|
||||
if message.html_body.present?
|
||||
render inline: message.html_body, layout: false
|
||||
render inline: message.html_body, layout: false # rubocop:disable Rails/RenderInline
|
||||
else
|
||||
render layout: false
|
||||
end
|
||||
|
|
|
@ -34,7 +34,7 @@ module RollupScoreAggregatorHelper
|
|||
private
|
||||
|
||||
def present_scores
|
||||
score_sets.pluck(:score).reject(&:nil?)
|
||||
score_sets.pluck(:score).compact
|
||||
end
|
||||
|
||||
def latest_result
|
||||
|
|
|
@ -1582,7 +1582,7 @@ class Assignment < ActiveRecord::Base
|
|||
# the time zone that was active during editing
|
||||
time_zone = tz || (ActiveSupport::TimeZone.new(time_zone_edited) rescue nil) || Time.zone
|
||||
self.all_day, self.all_day_date = Assignment.all_day_interpretation(
|
||||
due_at: due_at ? due_at.in_time_zone(time_zone) : nil,
|
||||
due_at: due_at&.in_time_zone(time_zone),
|
||||
due_at_was: due_at_was,
|
||||
all_day_was: all_day_was,
|
||||
all_day_date_was: all_day_date_was
|
||||
|
|
|
@ -415,11 +415,12 @@ class Collaboration < ActiveRecord::Base
|
|||
end
|
||||
private :add_users_to_collaborators
|
||||
|
||||
class InvalidCollaborationType < StandardError; end
|
||||
protected
|
||||
|
||||
# Internal: Get the authorized_service_user_id for a user.
|
||||
# May be overridden by other collaboration types.
|
||||
protected def authorized_service_user_id_for(user)
|
||||
def authorized_service_user_id_for(user)
|
||||
user.gmail
|
||||
end
|
||||
|
||||
class InvalidCollaborationType < StandardError; end
|
||||
end
|
||||
|
|
|
@ -1154,7 +1154,7 @@ class ContentMigration < ActiveRecord::Base
|
|||
|
||||
key = Context.api_type_name(klass)
|
||||
context.shard.activate do
|
||||
scope = (klass.column_names.include? "assignment_id") ? klass.select(:id, :assignment_id, :migration_id) : klass.select(:id, :migration_id)
|
||||
scope = klass.column_names.include?("assignment_id") ? klass.select(:id, :assignment_id, :migration_id) : klass.select(:id, :migration_id)
|
||||
scope = scope.where(context: context).where.not(migration_id: nil)
|
||||
scope = scope.only_discussion_topics if asset_type == "DiscussionTopic"
|
||||
end
|
||||
|
|
|
@ -205,7 +205,7 @@ module Importers
|
|||
|
||||
item.body = description
|
||||
allow_save = false if description.blank?
|
||||
elsif hash[:page_type] == "module_toc"
|
||||
# elsif hash[:page_type] == "module_toc"
|
||||
elsif hash[:topics]
|
||||
item.title = t("title_for_topics_category", "%{category} Topics", category: hash[:category_name])
|
||||
description = (hash[:category_description]).to_s
|
||||
|
|
|
@ -112,7 +112,7 @@ class Lti::LineItem < ApplicationRecord
|
|||
return if resource_link.blank?
|
||||
|
||||
ids = resource_link.line_items.pluck(:assignment_id)
|
||||
return if ids.size.zero?
|
||||
return if ids.empty?
|
||||
return if ids.uniq.size == 1 && ids.first == assignment_id
|
||||
|
||||
errors.add(:assignment, "does not match ltiLink")
|
||||
|
|
|
@ -38,7 +38,7 @@ class NotificationFinder
|
|||
|
||||
def refresh_cache(notifications = Notification.all_cached)
|
||||
@notifications = notifications.index_by(&:name)
|
||||
@notifications.values.each(&:freeze)
|
||||
@notifications.each_value(&:freeze)
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -193,7 +193,7 @@ class Rubric < ActiveRecord::Base
|
|||
# I know.
|
||||
def destroy_for(context, current_user: nil)
|
||||
ras = rubric_associations.where(context_id: context, context_type: context.class.to_s)
|
||||
if context.class.to_s == "Course"
|
||||
if context.instance_of?(Course)
|
||||
# if rubric is removed at the course level, we want to destroy any
|
||||
# assignment associations found in the context of the course
|
||||
ras.each do |association|
|
||||
|
|
|
@ -115,7 +115,7 @@ class SisBatch < ActiveRecord::Base
|
|||
# Progress is calculated on the number of jobs remaining.
|
||||
num_jobs, min_rows, max_rows = Setting.get("sis_batch_rows_for_parallel",
|
||||
"99,100,1000").split(",").map(&:to_i)
|
||||
[[(rows / num_jobs.to_f).ceil, min_rows].max, max_rows].min
|
||||
(rows / num_jobs.to_f).ceil.clamp(min_rows, max_rows)
|
||||
end
|
||||
|
||||
workflow do
|
||||
|
|
|
@ -84,7 +84,7 @@ class GradeSummaryAssignmentPresenter
|
|||
end
|
||||
|
||||
def is_assignment?
|
||||
assignment.class.to_s == "Assignment"
|
||||
assignment.instance_of?(Assignment)
|
||||
end
|
||||
|
||||
def has_no_group_weight?
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'byebug/core'
|
||||
require 'tmpdir'
|
||||
require "byebug/core"
|
||||
require "tmpdir"
|
||||
|
||||
def byebug_port_file
|
||||
File.join(Dir.tmpdir, 'byebug.port')
|
||||
File.join(Dir.tmpdir, "byebug.port")
|
||||
end
|
||||
|
||||
def byebug_port
|
||||
|
@ -15,17 +15,16 @@ def byebug_port
|
|||
end
|
||||
|
||||
def connect
|
||||
begin
|
||||
while !byebug_port do
|
||||
puts "Waiting for byebug port..."
|
||||
sleep 0.5
|
||||
end
|
||||
|
||||
Byebug.start_client('localhost', byebug_port)
|
||||
rescue Errno::ECONNREFUSED
|
||||
until byebug_port do
|
||||
puts "Waiting for byebug port..."
|
||||
sleep 0.5
|
||||
end
|
||||
|
||||
Byebug.start_client("localhost", byebug_port)
|
||||
rescue Errno::ECONNREFUSED
|
||||
nil
|
||||
end
|
||||
|
||||
while !connect do
|
||||
until connect do
|
||||
sleep 0.5
|
||||
end
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require 'pathname'
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path('dress_code', 'dress_code')
|
||||
load Gem.bin_path("dress_code", "dress_code")
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
begin
|
||||
load File.expand_path("../spring", __FILE__)
|
||||
load File.expand_path("spring", __dir__)
|
||||
rescue LoadError => e
|
||||
raise unless e.message.include?('spring')
|
||||
raise unless e.message.include?("spring")
|
||||
end
|
||||
require 'bundler/setup'
|
||||
load Gem.bin_path('flakey_spec_catcher', 'flakey_spec_catcher')
|
||||
require "bundler/setup"
|
||||
load Gem.bin_path("flakey_spec_catcher", "flakey_spec_catcher")
|
||||
|
|
11
bin/rails
11
bin/rails
|
@ -2,15 +2,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
begin
|
||||
load File.expand_path("../spring", __FILE__)
|
||||
load File.expand_path("spring", __dir__)
|
||||
rescue LoadError
|
||||
nil
|
||||
end
|
||||
|
||||
# added by instructure:
|
||||
# resolve any symlinks in the file path, to avoid double-require issues
|
||||
require 'pathname'
|
||||
require "pathname"
|
||||
expanded_path = Pathname.new(__FILE__).realpath
|
||||
|
||||
APP_PATH = File.expand_path('../../config/application', expanded_path)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
||||
APP_PATH = File.expand_path("../../config/application", expanded_path)
|
||||
require_relative "../config/boot"
|
||||
require "rails/commands"
|
||||
|
|
7
bin/rake
7
bin/rake
|
@ -2,8 +2,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
begin
|
||||
load File.expand_path("../spring", __FILE__)
|
||||
load File.expand_path("spring", __dir__)
|
||||
rescue LoadError
|
||||
nil
|
||||
end
|
||||
require 'bundler/setup'
|
||||
load Gem.bin_path('rake', 'rake')
|
||||
require "bundler/setup"
|
||||
load Gem.bin_path("rake", "rake")
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
require "ruby-debug-ide"
|
||||
|
||||
Debugger::QuitCommand.prepend(
|
||||
Module.new {
|
||||
Module.new do
|
||||
def execute
|
||||
# NOTE: We must ensure that all breakpoints are cleared before disconnecting sessions,
|
||||
# or you'll face a `closed stream` error.
|
||||
Debugger.breakpoints.clear
|
||||
@printer.print_msg("finished")
|
||||
end
|
||||
}
|
||||
end
|
||||
)
|
||||
|
||||
load Gem.bin_path("ruby-debug-ide", "rdebug-ide")
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
begin
|
||||
load File.expand_path("../spring", __FILE__)
|
||||
load File.expand_path("spring", __dir__)
|
||||
rescue LoadError
|
||||
nil
|
||||
end
|
||||
require 'bundler/setup'
|
||||
load Gem.bin_path('rspec-core', 'rspec')
|
||||
require "bundler/setup"
|
||||
load Gem.bin_path("rspec-core", "rspec")
|
||||
|
|
|
@ -14,10 +14,10 @@ Dir.chdir(File.expand_path("..", __dir__)) do
|
|||
# be tricksy and use a tiny subset of the gemfile so that
|
||||
# it will be very quick
|
||||
gemfile do
|
||||
source 'https://rubygems.org/'
|
||||
source "https://rubygems.org/"
|
||||
|
||||
gemfile = File.expand_path("../Gemfile.d/rubocop.rb", __dir__)
|
||||
eval(File.read(gemfile))
|
||||
eval(File.read(gemfile)) # rubocop:disable Security/Eval
|
||||
end
|
||||
end
|
||||
|
||||
|
|
12
bin/spring
12
bin/spring
|
@ -5,19 +5,19 @@
|
|||
# It gets overwritten when you run the `spring binstub` command.
|
||||
|
||||
unless defined?(Spring)
|
||||
require 'rubygems'
|
||||
require 'bundler'
|
||||
require "rubygems"
|
||||
require "bundler"
|
||||
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
lockfile_name = Dir.glob(Bundler.default_lockfile.dirname + "Gemfile.rails*.lock").first
|
||||
|
||||
raise "no valid lockfile found" unless lockfile_name
|
||||
|
||||
lockfile = Bundler::LockfileParser.new(Pathname.new(lockfile_name).read)
|
||||
spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
|
||||
spring = lockfile.specs.detect { |spec| spec.name == "spring" }
|
||||
if spring
|
||||
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
||||
gem 'spring', spring.version
|
||||
require 'spring/binstub'
|
||||
gem "spring", spring.version
|
||||
require "spring/binstub"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ class HostUrlContainer
|
|||
mattr_accessor :host_url
|
||||
def self.===(host)
|
||||
# rubocop:disable Style/CaseEquality
|
||||
host_url.===(host)
|
||||
host_url === (host)
|
||||
# rubocop:enable Style/CaseEquality
|
||||
end
|
||||
end
|
||||
|
|
|
@ -445,7 +445,7 @@ class ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.rank_hash(ary)
|
||||
ary.each_with_index.each_with_object(Hash.new(ary.size + 1)) do |(values, i), hash|
|
||||
ary.each_with_index.with_object(Hash.new(ary.size + 1)) do |(values, i), hash|
|
||||
Array(values).each { |value| hash[value] = i + 1 }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[LICENSE.txt Rakefile README.md test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport", ">= 3.2", "< 7.1"
|
||||
|
|
|
@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*")
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "rails", ">= 3.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile README.md test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "rails", ">= 3.2"
|
||||
|
|
|
@ -12,7 +12,6 @@ Gem::Specification.new do |s|
|
|||
s.summary = "Instructure-maintained fork of attachment_fu"
|
||||
|
||||
s.files = Dir["{app,config,db,lib}/**/*"]
|
||||
s.test_files = Dir["spec_canvas/**/*"]
|
||||
|
||||
s.add_dependency "rails", ">= 3.2"
|
||||
end
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib|spec}/**/*")
|
||||
spec.require_paths = ["lib"]
|
||||
spec.test_files = spec.files.grep(%r{^spec/})
|
||||
|
||||
spec.required_ruby_version = ">= 2.0"
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib}/**/*") + %w[Rakefile]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "folio-pagination", "~> 0.0.12"
|
||||
|
|
|
@ -12,7 +12,6 @@ Gem::Specification.new do |s|
|
|||
s.summary = "Notification management for ActiveRecord models in Canvas"
|
||||
|
||||
s.files = Dir["{lib}/**/*"]
|
||||
s.test_files = Dir["spec_canvas/**/*"]
|
||||
|
||||
s.add_dependency "activesupport"
|
||||
s.add_dependency "after_transaction_commit"
|
||||
|
|
|
@ -7,7 +7,6 @@ Gem::Specification.new do |spec|
|
|||
spec.summary = "Support Multiple Lockfiles"
|
||||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[plugins.rb]
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "rspec", "~> 3.9.0"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[LICENSE.txt README.md test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "config_file"
|
||||
|
|
|
@ -395,7 +395,7 @@ module CanvasCache
|
|||
|
||||
::Sentry.register_patch do
|
||||
patch = ::Sentry::Redis::Client
|
||||
::Redis::Client.prepend(patch) unless ::Redis::Client <= patch
|
||||
::Redis::Client.prepend(patch) unless ::Redis::Client <= patch # rubocop:disable Style/YodaCondition
|
||||
end
|
||||
|
||||
::Redis::Client.prepend(::CanvasCache::Redis::Client)
|
||||
|
|
|
@ -77,6 +77,7 @@ RSpec.shared_context "caching_helpers", shared_context: :metadata do
|
|||
attr_reader :captured_message_stack
|
||||
|
||||
def initialize
|
||||
super(nil)
|
||||
@captured_message_stack = []
|
||||
end
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "cassandra-cql", "~> 1.2.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,test}/**/*")
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 2.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib}/**/*") + %w[LICENSE.txt README.md Rakefile]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 2.2"
|
||||
|
|
|
@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_runtime_dependency "aws-sdk-applicationautoscaling", "~> 1.26"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport", ">= 3.2"
|
||||
|
|
|
@ -31,11 +31,7 @@ module CanvasExt
|
|||
raise e if viewed_class_names.include?(class_name)
|
||||
|
||||
viewed_class_names << class_name
|
||||
begin
|
||||
retry if class_name.constantize
|
||||
rescue
|
||||
raise
|
||||
end
|
||||
retry if class_name.constantize
|
||||
else
|
||||
raise
|
||||
end
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "multipart"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "canvas_http"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[LICENSE.txt Rakefile README.md test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 2.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "canvas_http"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
spec.email = ["ahmad@instructure.com"]
|
||||
spec.summary = "PostgreSQL partitioning manager and helper."
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Gemfile LICENSE.txt README.md]
|
||||
spec.test_files = spec.files.grep(/spec/)
|
||||
spec.require_paths = ["lib"]
|
||||
spec.license = "AGPL"
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
spec.email = ["ahmad@instructure.com"]
|
||||
spec.summary = "Bundle of statistics generators for quizzes and quiz questions."
|
||||
spec.files = Dir.glob("lib/**/*") + %w[LICENSE.txt README.md Rakefile]
|
||||
spec.test_files = spec.files.grep(/spec/)
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib}/**/*") + %w[Rakefile README.md]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "sanitize", "~> 6.0"
|
||||
|
|
|
@ -4,9 +4,11 @@ source "https://rubygems.org"
|
|||
|
||||
gemspec
|
||||
|
||||
# rubocop:disable Gemspec/DevelopmentDependencies
|
||||
path ".." do
|
||||
gem "canvas_cache"
|
||||
gem "canvas_errors"
|
||||
gem "config_file"
|
||||
gem "dynamic_settings"
|
||||
end
|
||||
# rubocop:enable Gemspec/DevelopmentDependencies
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "canvas_cache"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,test}/**/*") + %w[Rakefile]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", ">= 1.5", "< 3"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 2.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,test}/**/*") + %w[LICENSE.txt Rakefile README.rdoc test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "rails", ">= 3.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "i18n"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "tzinfo"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,test}/**/*") + %w[Rakefile]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "rails", ">= 5.0"
|
||||
|
|
|
@ -10,7 +10,6 @@ Gem::Specification.new do |spec|
|
|||
spec.summary = "Generate CSV diffs"
|
||||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "sqlite3"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "nokogiri"
|
||||
|
|
|
@ -8,7 +8,6 @@ Gem::Specification.new do |spec|
|
|||
spec.summary = "Run linters only on the git diff."
|
||||
|
||||
spec.files = Dir.glob("{lib,spec,bin}/**/*")
|
||||
spec.test_files = spec.files.grep(%r{^spec/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "gergich", "2.1.1"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport", ">= 5.0"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "bookmarked_collection"
|
||||
|
|
|
@ -40,7 +40,7 @@ describe EventStream::AttrConfig do
|
|||
value = double("value")
|
||||
obj = @class.new
|
||||
obj.field(value)
|
||||
obj.field.== value
|
||||
obj.field == value
|
||||
end
|
||||
|
||||
it "errors on accessor with > 1 args" do
|
||||
|
@ -55,7 +55,7 @@ describe EventStream::AttrConfig do
|
|||
value = double("value")
|
||||
@class.attr_config :field, default: value
|
||||
obj = @class.new
|
||||
obj.field.== value
|
||||
obj.field == value
|
||||
end
|
||||
|
||||
it "casts values with type String" do
|
||||
|
@ -64,7 +64,7 @@ describe EventStream::AttrConfig do
|
|||
value = double(to_s: string)
|
||||
obj = @class.new
|
||||
obj.field(value)
|
||||
obj.field.== string
|
||||
obj.field == string
|
||||
end
|
||||
|
||||
it "casts values with type Integer" do
|
||||
|
@ -73,7 +73,7 @@ describe EventStream::AttrConfig do
|
|||
value = double(to_i: integer)
|
||||
obj = @class.new
|
||||
obj.field(value)
|
||||
obj.field.== integer
|
||||
obj.field == integer
|
||||
end
|
||||
|
||||
it "casts values with type Proc" do
|
||||
|
@ -81,7 +81,7 @@ describe EventStream::AttrConfig do
|
|||
value = -> { "value" }
|
||||
obj = @class.new
|
||||
obj.field(value)
|
||||
obj.field.== value
|
||||
obj.field == value
|
||||
end
|
||||
|
||||
it "errors when expecting a Proc" do
|
||||
|
@ -113,7 +113,7 @@ describe EventStream::AttrConfig do
|
|||
value = double("value")
|
||||
obj = @class.new
|
||||
obj.field(value)
|
||||
obj.field.== value
|
||||
obj.field == value
|
||||
end
|
||||
|
||||
it "casts defaults with type" do
|
||||
|
@ -121,14 +121,14 @@ describe EventStream::AttrConfig do
|
|||
value = double(to_s: string)
|
||||
@class.attr_config :field, type: String, default: value
|
||||
obj = @class.new
|
||||
obj.field.== string
|
||||
obj.field == string
|
||||
end
|
||||
|
||||
it "does not cast defaults with unknown type" do
|
||||
value = double("value")
|
||||
@class.attr_config :field, type: double("unknown"), default: value
|
||||
obj = @class.new
|
||||
obj.field.== value
|
||||
obj.field == value
|
||||
end
|
||||
|
||||
it "requires setting non-defaulted fields before validation" do
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "rails", ">= 3.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "canvas_text_helper"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport", ">= 3.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport", ">= 6"
|
||||
|
|
|
@ -58,7 +58,7 @@ describe I18nTasks::Extract do
|
|||
|
||||
it "removes Proc-like values" do
|
||||
expect(
|
||||
subject(rb: { date: { nth: proc { |v| "1st" } } })
|
||||
subject(rb: { date: { nth: proc { "1st" } } })
|
||||
).to eq({ "date" => {} })
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport", ">= 3.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib}/**/*") + %w[Rakefile]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "json"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "nokogiri"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport"
|
||||
|
|
|
@ -71,9 +71,9 @@ module LtiAdvantage::Serializers
|
|||
"#{IMS_CLAIM_PREFIX}#{key}"
|
||||
elsif DEEP_LINKING_CLAIMS.include?(key)
|
||||
"#{DL_CLAIM_PREFIX}#{key}"
|
||||
elsif NAMES_AND_ROLES_SERVICE_CLAIM == key
|
||||
elsif key == NAMES_AND_ROLES_SERVICE_CLAIM
|
||||
NRPS_CLAIM_URL
|
||||
elsif ASSIGNMENT_AND_GRADE_SERVICE_CLAIM == key
|
||||
elsif key == ASSIGNMENT_AND_GRADE_SERVICE_CLAIM
|
||||
AGS_CLAIM_URL
|
||||
else
|
||||
key
|
||||
|
|
|
@ -37,7 +37,7 @@ module LtiOutbound
|
|||
value = value.call
|
||||
instance_variable_set(variable_name, value)
|
||||
end
|
||||
return value
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[LICENSE.txt Rakefile README.md test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "canvas_slug"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib}/**/*") + %w[Rakefile]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "folio-pagination", "~> 0.0.12"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
spec.summary = "Academic Benchmark outcome importer"
|
||||
|
||||
spec.files = Dir["{app,config,db,lib}/**/*"]
|
||||
spec.test_files = Dir["spec_canvas/**/*"]
|
||||
|
||||
spec.add_dependency "academic_benchmarks", "~> 1.1.0"
|
||||
spec.add_dependency "rails", ">= 3.2"
|
||||
|
|
|
@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
|
|||
spec.summary = "Account Level Reports"
|
||||
|
||||
spec.files = Dir["{app,config,db,lib}/**/*"]
|
||||
spec.test_files = Dir["spec_canvas/**/*"]
|
||||
|
||||
spec.add_dependency "rails", ">= 3.2"
|
||||
end
|
||||
|
|
|
@ -384,7 +384,7 @@ module AccountReports::ReportHelper
|
|||
|
||||
def number_of_items_per_runner(item_count, min: 25, max: 1000)
|
||||
# use 100 jobs for the report, but no fewer than 25, and no more than 1000 per job
|
||||
[[item_count / 99.to_f.round(0), min].max, max].min
|
||||
(item_count / 99.to_f).round(0).clamp(min, max)
|
||||
end
|
||||
|
||||
def create_report_runners(ids, total, min: 25, max: 1000)
|
||||
|
|
|
@ -13,7 +13,6 @@ Gem::Specification.new do |s|
|
|||
s.description = "This enables importing Moodle 1.9 and 2.x .zip/.mbz files to Canvas."
|
||||
|
||||
s.files = Dir["{lib}/**/*"]
|
||||
s.test_files = Dir["spec_canvas/**/*"]
|
||||
|
||||
s.add_dependency "moodle2cc", "0.2.41"
|
||||
s.add_dependency "rails", ">= 3.2"
|
||||
|
|
|
@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
|
|||
spec.summary = "QTI Exporter"
|
||||
|
||||
spec.files = Dir["{app,lib}/**/*"]
|
||||
spec.test_files = Dir["spec_canvas/**/*"]
|
||||
|
||||
spec.add_dependency "rails", ">= 3.2"
|
||||
end
|
||||
|
|
|
@ -12,7 +12,6 @@ Gem::Specification.new do |s|
|
|||
s.summary = "SOAP Endpoint for Respondus QTI uploads"
|
||||
|
||||
s.files = Dir["{app,config,db,lib}/**/*"]
|
||||
s.test_files = Dir["spec_canvas/**/*"]
|
||||
|
||||
s.add_dependency "rails", ">= 3.2"
|
||||
s.add_dependency "soap4r-middleware", "0.8.7"
|
||||
|
|
|
@ -12,7 +12,6 @@ Gem::Specification.new do |s|
|
|||
s.summary = "Instructure-maintained fork of simply_versioned"
|
||||
|
||||
s.files = Dir["{app,config,db,lib}/**/*"]
|
||||
s.test_files = Dir["spec_canvas/**/*"]
|
||||
|
||||
s.add_dependency "rails", ">= 3.2"
|
||||
end
|
||||
|
|
|
@ -4,9 +4,11 @@ source "https://rubygems.org"
|
|||
|
||||
gemspec
|
||||
|
||||
# rubocop:disable Gemspec/DevelopmentDependencies
|
||||
path ".." do
|
||||
gem "canvas_cache"
|
||||
gem "canvas_security"
|
||||
gem "config_file"
|
||||
gem "dynamic_settings"
|
||||
end
|
||||
# rubocop:enable Gemspec/DevelopmentDependencies
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "actionpack"
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
# You should have received a copy of the GNU Affero General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module RuboCop
|
||||
module Cop
|
||||
module Specs
|
||||
|
|
|
@ -22,7 +22,7 @@ module RuboCop
|
|||
module Style
|
||||
module ConcatArrayLiteralsWithIgnoredReceivers
|
||||
def on_send(node)
|
||||
return if node.receiver.type == :const && node.receiver.short_name == :BookmarkedCollection
|
||||
return if node.receiver&.type == :const && node.receiver.short_name == :BookmarkedCollection
|
||||
|
||||
super
|
||||
end
|
||||
|
|
|
@ -10,7 +10,6 @@ Gem::Specification.new do |spec|
|
|||
spec.summary = "custom cops for canvas"
|
||||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "activesupport", ">= 6.0"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib}/**/*")
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 2.2"
|
||||
|
|
|
@ -21,7 +21,6 @@ require_relative "./shared_constants"
|
|||
require_relative "./shared_linter_examples"
|
||||
# pp required for to make fakefs happy, see:
|
||||
# github.com/fakefs/fakefs#fakefs-----typeerror-superclass-mismatch-for-class-file
|
||||
require "pp"
|
||||
require "fakefs/safe"
|
||||
require "timecop"
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ Gem::Specification.new do |spec|
|
|||
spec.summary = "Commit level linting."
|
||||
|
||||
spec.files = Dir.glob("{lib,spec,bin}/**/*")
|
||||
spec.test_files = spec.files.grep(%r{^spec/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "fakefs", "~> 1.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "html_text_helper"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile test.sh]
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 2.2"
|
||||
|
|
|
@ -9,7 +9,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.files = Dir.glob("{lib}/**/*")
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_dependency "rails", ">= 3.2"
|
||||
|
|
|
@ -383,7 +383,7 @@ module Api
|
|||
action = "#{controller.params[:controller]}##{controller.params[:action]}"
|
||||
per_page_requested = controller.params[:per_page] || options[:default] || per_page(action)
|
||||
max = options[:max] || max_per_page(action)
|
||||
[[per_page_requested.to_i, 1].max, max.to_i].min
|
||||
per_page_requested.to_i.clamp(1, max.to_i)
|
||||
end
|
||||
|
||||
# Add [link HTTP Headers](http://www.w3.org/Protocols/9707-link-header.html) for pagination
|
||||
|
|
|
@ -43,7 +43,9 @@ module Api::V1::EnrollmentTerm
|
|||
enrollment_terms.map { |t| enrollment_term_json(t, user, session, enrollments, includes, course_counts) }
|
||||
end
|
||||
|
||||
protected def date_overrides_json(term)
|
||||
protected
|
||||
|
||||
def date_overrides_json(term)
|
||||
term.enrollment_dates_overrides.select { |o| o.start_at || o.end_at }.each_with_object({}) do |override, json|
|
||||
json[override.enrollment_type] = override.attributes.slice("start_at", "end_at")
|
||||
end
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue