-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LTI-42: Add rubocop and automated test with test with travis to LTI2P… (
#7) * LTI-42: Add rubocop and automated test with test with travis to LTI2Provider gem travis changes gemfile add rubocop bundle install rubocop autocorrect rubocop no offenses add manifest.js file change manifest.js changed travis build from rspec to rails test no db rubocop frozen_string_literal LTI-42: Add rubocop and automated test with test with travis to LTI2Provider gem * Update rails_lti2_provider.gemspec * Updated rubocop changes * update travis ruby version * rubocop in line with broker's Co-authored-by: Jesus Federico <[email protected]>
- Loading branch information
1 parent
840ad41
commit 520e264
Showing
66 changed files
with
560 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
inherit_mode: | ||
merge: | ||
- Exclude | ||
require: | ||
- rubocop-rails | ||
AllCops: | ||
Exclude: | ||
- bin/puma | ||
- bin/pumactl | ||
- bin/setup | ||
- bin/rainbows | ||
- bin/unicorn | ||
- bin/unicorn_rails | ||
- bin/update | ||
- bin/yarn | ||
- vendor/bundle/**/* | ||
TargetRubyVersion: 2.6 | ||
Layout/HashAlignment: | ||
EnforcedHashRocketStyle: [ key, table ] | ||
EnforcedColonStyle: [ key, table ] | ||
Layout/LineLength: | ||
Max: 200 | ||
Metrics: | ||
Enabled: false | ||
Naming/MethodParameterName: | ||
MinNameLength: 2 | ||
Rails: | ||
Enabled: true | ||
Rails/DynamicFindBy: | ||
# The models used in this code aren't actually ActiveRecord | ||
Enabled: false | ||
Style/AsciiComments: | ||
AllowedChars: [ © ] | ||
Style/Documentation: | ||
Enabled: false | ||
Style/DoubleNegation: | ||
Enabled: false | ||
Style/ClassAndModuleChildren: | ||
Enabled: false | ||
Style/MethodCallWithArgsParentheses: | ||
Enabled: true | ||
IgnoredMethods: | ||
- desc | ||
- gem | ||
- include | ||
- require | ||
- require_relative | ||
- ruby | ||
- raise | ||
- source | ||
- throw | ||
Exclude: | ||
- "**/*.xml.builder" | ||
Style/SymbolArray: | ||
MinSize: 6 | ||
Style/TrailingCommaInArrayLiteral: | ||
EnforcedStyleForMultiline: consistent_comma | ||
Style/TrailingCommaInHashLiteral: | ||
EnforcedStyleForMultiline: consistent_comma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
sudo: required | ||
language: ruby | ||
cache: bundler | ||
rvm: | ||
- 2.7.1 | ||
jobs: | ||
include: | ||
- stage: test | ||
name: rubocop | ||
script: bundle install & bundle exec rubocop | ||
if: env(TEST_IGNORE) IS NOT present | ||
- stage: test | ||
name: test | ||
before_script: | ||
- bundle install | ||
script: | ||
- export | ||
- bundle exec rails test | ||
if: env(TEST_IGNORE) IS NOT present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// frozen_string_literal: true | ||
|
||
//= link_tree ../images | ||
//= link_directory ../javascripts .js | ||
//= link_directory ../stylesheets .css |
2 changes: 2 additions & 0 deletions
2
app/controllers/rails_lti2_provider/application_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module RailsLti2Provider | ||
class ApplicationController < ActionController::Base | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module RailsLti2Provider | ||
module ApplicationHelper | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module RailsLti2Provider | ||
module ToolsHelper | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
module RailsLti2Provider | ||
class Registration < ActiveRecord::Base | ||
class Registration < ApplicationRecord | ||
validates :correlation_id, uniqueness: true, allow_nil: true | ||
serialize :tool_proxy_json, JSON | ||
serialize :registration_request_params, JSON | ||
belongs_to :tool, optional: true | ||
|
||
def register | ||
|
||
end | ||
|
||
def register; end | ||
|
||
def registration_request | ||
@registration_request ||= IMS::LTI::Models::Messages::Message.generate(registration_request_params) | ||
end | ||
|
||
def tool_proxy | ||
IMS::LTI::Models::ToolProxy.from_json(self.tool_proxy_json) | ||
IMS::LTI::Models::ToolProxy.from_json(tool_proxy_json) | ||
end | ||
|
||
def tool_consumer_profile | ||
@tool_consumer_profile ||= IMS::LTI::Services::ToolProxyRegistrationService.new(registration_request).tool_consumer_profile | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
module RailsLti2Provider | ||
class Tenant < ApplicationRecord | ||
has_many :tools | ||
has_many :tools, dependent: :restrict_with_exception | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.