diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml
index f2bd4b3464..b05c9807c9 100644
--- a/.github/workflows/eslint.yml
+++ b/.github/workflows/eslint.yml
@@ -8,9 +8,19 @@ jobs:
runs-on: ubuntu-latest
steps:
+ # Checkout the repo
- uses: actions/checkout@v2
- # Will run ES Lint checks on javascript files
+ # Install Node
+ - uses: actions/setup-node@v2
+ with:
+ cache: 'yarn'
+
+ # Run yarn install for JS dependencies
+ - name: 'Yarn Install'
+ run: yarn install
+
+ # Run the ES Lint checks on javascript files
# https://github.com/marketplace/actions/run-eslint
- name: 'ES Lint checks'
uses: stefanoeb/eslint-action@1.0.0
diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml
index 740bd53d1f..6c6a4395fb 100644
--- a/.github/workflows/mysql.yml
+++ b/.github/workflows/mysql.yml
@@ -6,6 +6,7 @@ jobs:
mysql:
runs-on: ubuntu-latest
+ # Define environment variables for MySQL and Rails
env:
DB_ADAPTER: mysql2
MYSQL_PWD: root
@@ -14,94 +15,59 @@ jobs:
steps:
# Checkout the repo
- uses: actions/checkout@v2
- with:
- fetch-depth: 1
-
- - name: 'Install MySQL Packages'
- run: |
- sudo apt-get update
- sudo apt-get install -y mysql-client libmysqlclient-dev
- - name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
- run: |
- echo "RUBY_VERSION=`cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
- echo "BUNDLER_VERSION=`cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
+ # Install Ruby and run bundler
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: 2.6.3
+ bundler-cache: true
- - name: 'Install Ruby'
- uses: actions/setup-ruby@v1
+ # Install Node
+ - uses: actions/setup-node@v2
with:
- ruby-version: ${{ env.RUBY_VERSION }}
+ cache: 'yarn'
# Copy all of the example configs over
- name: 'Setup Default Configuration'
run: |
- # Make copies of all the example config files
cp config/database.yml.sample config/database.yml
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
- # Try to retrieve the gems from the cache
- - name: 'Cache Gems'
- uses: actions/cache@v2.1.5
- with:
- path: vendor/bundle
- key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
- restore-keys: |
- ${{ runner.os }}-gem-
-
- - name: 'Bundle Install'
- run: |
- gem install bundler -v ${{ env.BUNDLER_VERSION }}
- bundle config path vendor/bundle
- bundle install --jobs 4 --retry 3 --without pgsql rollbar aws
-
+ # Stub out the Rails credentials file so that we can start the Rails app
- name: 'Setup Credentials'
- run: |
- # generate a default credential file and key
- EDITOR='echo "$(cat config/credentials.yml.example)" >' bundle exec rails credentials:edit
-
- # Try to retrieve the yarn JS dependencies from the cache
- - name: 'Cache Yarn Packages'
- uses: actions/cache@v2.1.5
- with:
- path: node_modules/
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-yarn-
- ${{ runner.os }}-
+ run: EDITOR='echo "$(cat config/credentials.yml.example)" >' bundle exec rails credentials:edit
+ # Set the path to the wkhtmltopdf executable
- name: 'Determine wkhtmltopdf location'
run: echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV
+ # Run yarn install for JS dependencies
- name: 'Yarn Install'
- run: |
- yarn install
+ run: yarn install
+ # Start the DB server and initialize the DB
- name: 'Start MySQL'
- run: sudo systemctl start mysql
-
- - name: 'Setup Test DB'
- run: bin/rails db:setup RAILS_ENV=test
-
- - name: 'Migrate DB'
- run: bin/rails db:migrate RAILS_ENV=test
-
- - name: 'Compile Assets'
run: |
- bin/rails webpacker:compile
- bin/rails assets:precompile
+ sudo systemctl start mysql
+ bin/rails db:setup RAILS_ENV=test
+ bin/rails db:migrate RAILS_ENV=test
+
+ # Prebuild the CSS, JS and image assets
+ - name: 'Precompile all of the Assets'
+ run: bin/rails assets:precompile
+ # Run the JS tests
- name: 'Run Karma Tests'
run: yarn test
+ # Run the unit and functional tests
- name: 'Run Rspec Unit and Functional Tests'
run: |
bin/bundle exec rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bin/bundle exec rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bin/bundle exec rspec spec/mixins/
- # Only run Integration tests if the PR or Push is to master or development branches
+ # Run the time consuming integration tests (using Chrome headless browser)
- name: 'Run Rspec Integration Tests'
run: bin/bundle exec rspec spec/features/
diff --git a/.github/workflows/postgres.yml b/.github/workflows/postgres.yml
index 5681a97364..504983a12a 100644
--- a/.github/workflows/postgres.yml
+++ b/.github/workflows/postgres.yml
@@ -23,6 +23,7 @@ jobs:
--health-timeout 5s
--health-retries 5
+ # Define environment variables for Postgres and Rails
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:@localhost:5432/roadmap_test
@@ -30,92 +31,67 @@ jobs:
steps:
# Checkout the repo
- uses: actions/checkout@v2
+
+ # Install Ruby and run bundler
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: 2.6.3
+ bundler-cache: true
+
+ # Install Node
+ - uses: actions/setup-node@v2
with:
- fetch-depth: 1
+ cache: 'yarn'
+ # Install the Postgres developer packages
- name: 'Install Postgresql Packages'
run: |
sudo apt-get update
sudo apt-get install libpq-dev
- - name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
- run: |
- echo "RUBY_VERSION=`cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
- echo "BUNDLER_VERSION=`cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
-
- # Install Ruby - using the version found in the Gemfile.lock
- - name: 'Install Ruby'
- uses: actions/setup-ruby@v1
- with:
- ruby-version: ${{ env.RUBY_VERSION }}
-
# Copy all of the example configs over
- name: 'Setup Default Configuration'
run: |
- # Make copies of all the example config files
cp config/database.yml.sample config/database.yml
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
- # Try to retrieve the gems from the cache
- - name: 'Cache Gems'
- uses: actions/cache@v2.1.5
- with:
- path: vendor/bundle
- key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
- restore-keys: |
- ${{ runner.os }}-gem-
-
- - name: 'Bundle Install'
- run: |
- gem install bundler -v ${{ env.BUNDLER_VERSION }}
- bundle config path vendor/bundle
- bundle install --jobs 4 --retry 3 --without mysql rollbar aws
-
+ # Stub out the Rails credentials file so that we can start the Rails app
- name: 'Setup Credentials'
run: |
# generate a default credential file and key
EDITOR='echo "$(cat config/credentials.yml.example)" >' bundle exec rails credentials:edit
- # Try to retrieve the yarn JS dependencies from the cache
- - name: 'Cache Yarn Packages'
- uses: actions/cache@v2.1.5
- with:
- path: node_modules/
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-yarn-
- ${{ runner.os }}-
-
+ # Set the path to the wkhtmltopdf executable
- name: 'Determine wkhtmltopdf location'
run: echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV
+ # Run yarn install for JS dependencies
- name: 'Yarn Install'
run: |
yarn install
+ # Initialize the DB
- name: 'Setup Test DB'
- run: bin/rails db:setup RAILS_ENV=test
-
- - name: 'Migrate DB'
- run: bin/rails db:migrate RAILS_ENV=test
+ run: |
+ bin/rails db:setup RAILS_ENV=test
+ bin/rails db:migrate RAILS_ENV=test
+ # Prebuild the CSS, JS and image assets
- name: 'Compile Assets'
- run: |
- bin/rails webpacker:compile
- bin/rails assets:precompile
+ run: bin/rails assets:precompile
+ # Run the JS tests
- name: 'Run Karma Tests'
run: yarn test
+ # Run the unit and functional tests
- name: 'Run Rspec Unit and Functional Tests'
run: |
bin/rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bin/rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bin/rspec spec/mixins/
- # Integration Tests are only run if PR or Push is to master or development branches
+ # Run the time consuming integration tests (using Chrome headless browser)
- name: 'Run Integration Tests'
run: bin/rspec spec/features/
diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml
index 085bbb0183..0fd54b1cc4 100644
--- a/.github/workflows/rubocop.yml
+++ b/.github/workflows/rubocop.yml
@@ -7,24 +7,15 @@ jobs:
runs-on: ubuntu-latest
steps:
+ # Checkout the repo
- uses: actions/checkout@v2
- - name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
- run: |
- echo "RUBY_VERSION=`cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
- echo "BUNDLER_VERSION=`cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
-
- # Install Ruby - using the version found in the Gemfile.lock
- - name: 'Install Ruby'
- uses: actions/setup-ruby@v1
+ # Install Ruby and run bundler
+ - uses: ruby/setup-ruby@v1
with:
- ruby-version: ${{ env.RUBY_VERSION }}
-
- - name: 'Bundle Install'
- run: |
- gem install bundler -v ${{ env.BUNDLER_VERSION }}
- bundle config path vendor/bundle
- bundle install --jobs 4 --retry 3 --without pgsql rollbar aws
+ ruby-version: 2.6.3
+ bundler-cache: true
+ # Run the Rubocop linter checks
- name: 'Run Rubocop'
run: bin/rubocop
diff --git a/.rubocop.yml b/.rubocop.yml
index af6bbac1ba..5a9465c8f2 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,179 +1,186 @@
+# ----------------
+# - INSTRUCTIONS -
+# ----------------
+# The DMPRoadmap codebase tries to follow the latest Ruby/Rails style guidelines as defined
+# by the community via the Rubocop gem.
+#
+# Before submitting a PR, please run `bin/rubocop` from the project root.
+# Note that you can specify individual files or folders e.g.: `bin/rubocop app/mailers`
+# Note you can let Rubocop auto-correct many issues with the `-a` flag
+#
+# New versions of Rubocop typically include new Cops (Cops are inidivual Rubocop rules).
+# If you see a message like the following when you run `bin/rubocop`:
+#
+# "The following cops were added to RuboCop, but are not configured. Please set Enabled
+# to either `true` or `false` in your `.rubocop.yml` file."
+#
+# You should copy and paste the specified Cops into this file. You can review what the
+# Cop will do by Googling the name of the rule e.g.: "rubocop Layout/SpaceBeforeBrackets"
+#
+# After you review the rule, you can either Enable it or Disable it in this file. The
+# Rubocop documentation for the Cop may also give you additional options that can be
+# configured.
+#
+# Try to place any new Cops under their relevant section and in alphabetical order
+
AllCops:
- # Cache the results for faster processing
- UseCache: true
# Show the name of the cops being voilated in the feedback
DisplayCopNames: true
DisplayStyleGuide: true
+
+ # Rubocop will skip checking the following directories
Exclude:
- 'bin/**/*'
- 'db/**/*'
- 'vendor/**/*'
- 'node_modules/**/*'
- - 'test/**/*'
- - 'lib/tasks/*'
+ - 'scripts/**/*'
-# Force no empty lines at the start or end of a block's body. Ignore specs, since this
-# improves readability within the RSpec blocks.
-Layout/EmptyLinesAroundBlockBody:
- Exclude:
- - 'spec/**/*'
+ # Automatically add any new Cops to this file and enable them
+ NewCops: enable
-# Force a single blank line around a class's body. Adding this whitespace makes code
-# a bit easier to read.
-Layout/EmptyLinesAroundClassBody:
- Enabled: true
- EnforcedStyle: empty_lines
-
-# Force a single blank line around a module's body. Adding this whitespace makes code
-# a bit easier to read.
-Layout/EmptyLinesAroundModuleBody:
- Enabled: true
- EnforcedStyle: empty_lines
+ # Cache the results for faster processing
+ UseCache: true
-# Ignore this cop. The Rubocop default is sensible, but the rubocop-rails gem modifies
-# this to position end keywords awkwardly.
-Layout/EndAlignment:
+# -----------
+# - GEMSPEC -
+# -----------
+Gemspec/DateAssignment: # new in 1.10
Enabled: true
- EnforcedStyleAlignWith: keyword
-
-# The difference between `rails` and `normal` is that the `rails` style
-# prescribes that in classes and modules the `protected` and `private`
-# modifier keywords shall be indented the same as public methods and that
-# protected and private members shall be indented one step more than the
-# modifiers. Other than that, both styles mean that entities on the same
-# logical depth shall have the same indentation.
-Layout/IndentationConsistency:
- Description: 'Keep indentation straight.'
- StyleGuide: '#spaces-indentation'
- Enabled: true
- EnforcedStyle: normal
-Layout/IndentationWidth:
- Description: 'Use 2 spaces for indentation.'
- StyleGuide: '#spaces-indentation'
+# ----------
+# - LAYOUT -
+# ----------
+Layout/LineEndStringConcatenationIndentation: # new in 1.18
Enabled: true
-
-# Restrict the length of each line of code to 90 characters. Enforcing this is important
-# as many developers are working on smaller screens, or split screens. Having to scroll
-# to read a full line of code makes code harder to read and more frustrating to work with.
-Layout/LineLength:
- # I've found that 90 is a suitable limit. Many developers balk at the 80 character
- # default.
- Max: 100
-
-Layout/EmptyLinesAroundAttributeAccessor:
+Layout/SpaceBeforeBrackets: # new in 1.7
Enabled: true
-Layout/SpaceAroundMethodCallOperator:
+# --------
+# - LINT -
+# --------
+Lint/AmbiguousAssignment: # new in 1.7
Enabled: true
-
-# Enforce this in the main code but ignore it in specs since the Rspec core methods
-# are defined as potentially ambiguous blocks
Lint/AmbiguousBlockAssociation:
Exclude:
- 'spec/**/*'
-
-Lint/DeprecatedOpenSSLConstant:
+Lint/AmbiguousOperatorPrecedence: # new in 1.21
Enabled: true
-
-Lint/MixedRegexpCaptureTypes:
+Lint/AmbiguousRange: # new in 1.19
Enabled: true
-
-Lint/RaiseException:
+Lint/DeprecatedConstants: # new in 1.8
Enabled: true
-
-Lint/StructNewOverride:
+Lint/DuplicateBranch: # new in 1.3
+ Enabled: true
+Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
+ Enabled: true
+Lint/EmptyBlock: # new in 1.1
+ Enabled: true
+Lint/EmptyClass: # new in 1.3
+ Enabled: true
+Lint/EmptyInPattern: # new in 1.16
+ Enabled: true
+Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
+ Enabled: true
+Lint/LambdaWithoutLiteralBlock: # new in 1.8
+ Enabled: true
+Lint/NoReturnInBeginEndBlocks: # new in 1.2
+ Enabled: true
+Lint/NumberedParameterAssignment: # new in 1.9
+ Enabled: true
+Lint/OrAssignmentToConstant: # new in 1.9
+ Enabled: true
+Lint/RedundantDirGlobSort: # new in 1.8
+ Enabled: true
+Lint/RequireRelativeSelfPath: # new in 1.22
+ Enabled: true
+Lint/SymbolConversion: # new in 1.9
+ Enabled: true
+Lint/ToEnumArguments: # new in 1.1
+ Enabled: true
+Lint/TripleQuotes: # new in 1.9
+ Enabled: true
+Lint/UnexpectedBlockArity: # new in 1.5
+ Enabled: true
+Lint/UnmodifiedReduceAccumulator: # new in 1.1
Enabled: true
-# Bumping the default AbcSize so we don't need to refactor everything
-Metrics/AbcSize:
- Max: 25
-
-# Restrict the number of lines of code that may be within a block of code. This should
-# force developers to break their code into smaller discrete methods or objects.
-Metrics/BlockLength:
- # Exclude specs, since those are defined as large blocks of code
- Exclude:
- - 'spec/**/*'
-
-# Bumping the default ClassLength so we don't need to refactor everything
+# -----------
+# - METRICS -
+# -----------
+# briley Oct. 4th 2021
+# Default is 100 lines. Most of our controllers, models, etc. violate this
+# Cop, so setting it to 300 since we do not have time to refactor everything
Metrics/ClassLength:
Max: 300
-
-# Bumping the default CyclomaticComplexity so we don't need to refactor everything
-Metrics/CyclomaticComplexity:
- Max: 25
-
-# Bumping the default MethodLength so we don't need to refactor everything
+# briley Oct. 4th 2021
+# Default is 10 lines which feels very restrictive but would also require us to do
+# too much refactoring at this point.
Metrics/MethodLength:
- Max: 25
-
-# Bumping the default PerceivedComplexity so we don't need to refactor everything
-Metrics/PerceivedComplexity:
- Max: 25
+ Max: 20
-# This cop enforces the use of boolean and/or "&&" and "||" over "and" "or".
-# Sometimes using "and"/"or" is preferrable, when these are used as control flow.
-#
-# For example:
-#
-# render text: "Hello world" and return
-#
-Style/AndOr:
- Enabled: false
-
-# This cop enforces how modules and classes are nested within another module or class.
-# In Rails code (e.g. models and controllers) nesting with a colon is preferrable (e.g.
-# User::Session).
-Style/ClassAndModuleChildren:
+# mnicholson Oct. 6th 2021
+# Default lenght for block is 25 lines, which it would be very restrictive for
+# the Rspec views methods. So I'll just exclude some files.
+Metrics/BlockLength:
Exclude:
- - 'app/**/*'
+ - 'lib/tasks/*.rake'
+ - 'lib/tasks/utils/*.rake'
+ - 'spec/**/*'
-# This cop enforces each class to have documentation at the top. That's not always
-# practical or necessary in Rails apps (e.g. the purpose of helpers is self evident).
-Style/Documentation:
- Enabled: false
+ IgnoredMethods: ['describe', 'context', 'task', 'namespace']
-# Enforce empty methods to be written across two lines, like any normal method would be.
-# This allows for easy modification of the method in future.
-Style/EmptyMethod:
+# ------------
+# - SECURITY -
+# ------------
+Security/IoMethods: # new in 1.22
Enabled: true
- EnforcedStyle: expanded
-# Leave the string formatting style as `"some text %{value}" % { value: "text" }`
-# since we're uncertain what effect `format` and `sprintf` may have on the Fastgetext
-# markup `_("text")`
-Style/FormatString:
- EnforcedStyle: percent
-
-# Prefer the use of `"some %{token} text"` instead of `some % text` or
-# `some %token text` since it would invalidate many of our translation strings
-Style/FormatStringToken:
- EnforcedStyle: template
-
-# Enforce double quotes. Don't allow single quotes. This is preferred since double
-# quotes are more useful (they support escaping characters, and interpolation).
-Style/StringLiterals:
+# ---------
+# - STYLE -
+# ---------
+Style/ArgumentsForwarding: # new in 1.1
Enabled: true
- EnforcedStyle: double_quotes
-
-Style/ExponentialNotation:
+Style/CollectionCompact: # new in 1.2
Enabled: true
-
-Style/HashEachMethods:
+Style/DocumentDynamicEvalDefinition: # new in 1.1
Enabled: true
-
-Style/HashTransformKeys:
+Style/EndlessMethod: # new in 1.8
Enabled: true
-
-Style/HashTransformValues:
+Style/HashConversion: # new in 1.10
Enabled: true
-
-Style/RedundantRegexpCharacterClass:
+Style/HashExcept: # new in 1.7
Enabled: true
-
-Style/RedundantRegexpEscape:
+Style/IfWithBooleanLiteralBranches: # new in 1.9
Enabled: true
-
-Style/SlicingWithRange:
+Style/InPatternThen: # new in 1.16
+ Enabled: true
+Style/MultilineInPatternThen: # new in 1.16
+ Enabled: true
+Style/NegatedIfElseCondition: # new in 1.2
+ Enabled: true
+Style/NilLambda: # new in 1.3
+ Enabled: true
+Style/NumberedParameters: # new in 1.22
+ Enabled: true
+Style/NumberedParametersLimit: # new in 1.22
+ Enabled: true
+Style/OpenStructUse:
+ Enabled: false # used heavily in API so needs a lot of work to refactor
+Style/QuotedSymbols: # new in 1.16
+ Enabled: true
+Style/RedundantArgument: # new in 1.4
+ Enabled: true
+Style/RedundantSelfAssignmentBranch: # new in 1.19
+ Enabled: true
+Style/SelectByRegexp: # new in 1.22
+ Enabled: true
+Style/StringChars: # new in 1.12
+ Enabled: true
+Style/StringLiterals:
+ Enabled: true
+ Exclude:
+ - 'app/views/**/*'
+ - 'config/**/*'
+Style/SwapValues: # new in 1.1
Enabled: true
diff --git a/Gemfile b/Gemfile
index 63820fd17c..ce079fdbaa 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,39 +1,39 @@
# frozen_string_literal: true
-source "https://rubygems.org"
+source 'https://rubygems.org'
-ruby ">= 2.6.3"
+ruby '>= 2.6.3'
# ===========#
# CORE RAILS #
# ===========#
# Full-stack web application framework. (http://rubyonrails.org)
-gem "rails", "~> 5.2"
+gem 'rails', '~> 5.2'
# TODO: Remove this once Rails addresses the issue with its dependency on mimemagic. Mimemagic had
# an MIT license but was using some incompatible GPL license code.
# Versions of mimemagic that were yanked: https://rubygems.org/gems/mimemagic/versions
# Analysis of the issue: https://www.theregister.com/2021/03/25/ruby_rails_code/
-gem "mimemagic", "~> 0.3.7"
+gem 'mimemagic', '~> 0.3.7'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
-gem "puma", group: :puma, require: false
+gem 'puma', group: :puma, require: false
# Use SCSS for stylesheets
-gem "sass-rails"
+gem 'sass-rails'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
-gem "webpacker"
+gem 'webpacker'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
-gem "turbolinks"
+gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
-gem "jbuilder"
+gem 'jbuilder'
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
@@ -44,7 +44,7 @@ gem "jbuilder"
# gem "image_processing", "~> 1.2"
# Reduces boot times through caching; required in config/boot.rb
-gem "bootsnap", require: false
+gem 'bootsnap', require: false
# GEMS ADDED TO HELP HANDLE RAILS MIGRATION FROM 3.x to 4.2
# THESE GEMS HELP SUPPORT DEPRACATED FUNCTIONALITY AND WILL LOSE SUPPORT IN
@@ -60,7 +60,7 @@ gem "bootsnap", require: false
# Rollbar-gem is the SDK for Ruby apps and includes support for apps using
# Rails, Sinatra, Rack, plain Ruby, and other frameworks.
-gem "rollbar", group: :rollbar, require: false
+gem 'rollbar', group: :rollbar, require: false
# ======== #
# DATABASE #
@@ -68,14 +68,14 @@ gem "rollbar", group: :rollbar, require: false
# A simple, fast Mysql library for Ruby, binding to libmysql
# (http://github.com/brianmario/mysql2)
-gem "mysql2", group: :mysql, require: false
+gem 'mysql2', group: :mysql, require: false
# Pg is the Ruby interface to the {PostgreSQL
# RDBMS}[http://www.postgresql.org/](https://bitbucket.org/ged/ruby-pg)
-gem "pg", group: :pgsql, require: false
+gem 'pg', group: :pgsql, require: false
# Bit fields for ActiveRecord (https://github.com/pboling/flag_shih_tzu)
-gem "flag_shih_tzu" # , "~> 0.3.23"
+gem 'flag_shih_tzu' # , "~> 0.3.23"
# ======== #
# SECURITY #
@@ -83,35 +83,35 @@ gem "flag_shih_tzu" # , "~> 0.3.23"
# Flexible authentication solution for Rails with Warden
# (https://github.com/plataformatec/devise)
-gem "devise"
+gem 'devise'
# An invitation strategy for Devise (https://github.com/scambra/devise_invitable)
-gem "devise_invitable"
+gem 'devise_invitable'
# A generalized Rack framework for multiple-provider authentication.
# (https://github.com/omniauth/omniauth)
-gem "omniauth"
+gem 'omniauth'
# OmniAuth Shibboleth strategies for OmniAuth 1.x
-gem "omniauth-shibboleth"
+gem 'omniauth-shibboleth'
# ORCID OAuth 2.0 Strategy for OmniAuth 1.0
# (https://github.com/datacite/omniauth-orcid)
-gem "omniauth-orcid"
+gem 'omniauth-orcid'
# This gem provides a mitigation against CVE-2015-9284 (Cross-Site Request
# Forgery on the request phase when using OmniAuth gem with a Ruby on Rails
# application) by implementing a CSRF token verifier that directly uses
# ActionController::RequestForgeryProtection code from Rails.
# https://nvd.nist.gov/vuln/detail/CVE-2015-9284
-gem "omniauth-rails_csrf_protection"
+gem 'omniauth-rails_csrf_protection'
# A ruby implementation of the RFC 7519 OAuth JSON Web Token (JWT) standard.
-gem "jwt"
+gem 'jwt'
# Gems for repository integration
# OO authorization for Rails (https://github.com/elabs/pundit)
-gem "pundit"
+gem 'pundit'
# ========== #
# UI / VIEWS #
@@ -120,22 +120,22 @@ gem "pundit"
# Ruby gem to handle settings for ActiveRecord instances by storing them as
# serialized Hash in a separate database table. Namespaces and defaults
# included. (https://github.com/ledermann/rails-settings)
-gem "ledermann-rails-settings"
+gem 'ledermann-rails-settings'
# Gem providing simple Contact Us functionality with a Rails 3+ Engine.
# (https://github.com/jdutil/contact_us)
-gem "contact_us" # COULD BE EASILY REPLACED WITH OUR OWN CODE
+gem 'contact_us' # COULD BE EASILY REPLACED WITH OUR OWN CODE
# Helpers for the reCAPTCHA API (http://github.com/ambethia/recaptcha)
-gem "recaptcha"
+gem 'recaptcha'
# Ideal gem for handling attachments in Rails, Sinatra and Rack applications.
# (http://github.com/markevans/dragonfly)
-gem "dragonfly"
+gem 'dragonfly'
group :aws do
# Amazon AWS S3 data store for use with the Dragonfly gem.
- gem "dragonfly-s3_data_store"
+ gem 'dragonfly-s3_data_store'
end
# ========== #
@@ -144,21 +144,21 @@ end
# A pagination engine plugin for Rails 4+ and other modern frameworks
# (https://github.com/kaminari/kaminari)
-gem "kaminari"
+gem 'kaminari'
# Paginate in your headers, not in your response body. This follows the
# proposed RFC-8288 standard for Web linking.
-gem "api-pagination"
+gem 'api-pagination'
# =========== #
# STYLESHEETS #
# =========== #
# Integrate SassC-Ruby into Rails. (https://github.com/sass/sassc-rails)
-gem "sassc-rails"
+gem 'sassc-rails'
# Font-Awesome SASS (https://github.com/FortAwesome/font-awesome-sass)
-gem "font-awesome-sass", "~> 5.13.0"
+gem 'font-awesome-sass', '~> 5.13.0'
# Use webpack to manage app-like JavaScript modules in Rails
# (https://github.com/rails/webpacker)
@@ -166,7 +166,7 @@ gem "font-awesome-sass", "~> 5.13.0"
# Parse CSS and add vendor prefixes to CSS rules using values from the Can
# I Use website. (https://github.com/ai/autoprefixer-rails)
-gem "autoprefixer-rails"
+gem 'autoprefixer-rails'
# Minimal embedded v8 for Ruby (https://github.com/discourse/mini_racer)
# gem "mini_racer"
@@ -176,27 +176,27 @@ gem "autoprefixer-rails"
# ========= #
# Provides binaries for WKHTMLTOPDF project in an easily accessible package.
-gem "wkhtmltopdf-binary"
+gem 'wkhtmltopdf-binary'
# PDF generator (from HTML) gem for Ruby on Rails
# (https://github.com/mileszs/wicked_pdf)
-gem "wicked_pdf"
+gem 'wicked_pdf'
# This simple gem allows you to create MS Word docx documents from simple
# html documents. This makes it easy to create dynamic reports and forms
# that can be downloaded by your users as simple MS Word docx files.
# (http://github.com/karnov/htmltoword)
-gem "htmltoword"
+gem 'htmltoword'
# Filename sanitization for Ruby. This is useful when you generate filenames for
# downloads from user input
-gem "zaru"
+gem 'zaru'
# ==================== #
# INTERNATIONALIZATION #
# ==================== #
-gem "translation"
+gem 'translation'
# ========= #
# UTILITIES #
@@ -205,13 +205,13 @@ gem "translation"
# Run any code in parallel Processes(> use all CPUs) or Threads(> speedup
# blocking operations). Best suited for map-reduce or e.g. parallel downloads/uploads.
# TODO: Replace use of this with ActiveJob where possible
-gem "parallel"
+gem 'parallel'
# Makes http fun again! Wrapper to simplify the native Net::HTTP libraries
-gem "httparty"
+gem 'httparty'
# Autoload dotenv in Rails. (https://github.com/bkeepers/dotenv)
-gem "dotenv-rails"
+gem 'dotenv-rails'
# ================================= #
# ENVIRONMENT SPECIFIC DEPENDENCIES #
@@ -219,139 +219,159 @@ gem "dotenv-rails"
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
- gem "byebug", platforms: %i[mri mingw x64_mingw]
+ gem 'byebug', platforms: %i[mri mingw x64_mingw]
end
group :test do
# RSpec for Rails (https://github.com/rspec/rspec-rails)
- gem "rspec-rails"
+ gem 'rspec-rails'
# factory_bot_rails provides integration between factory_bot and rails 3
# or newer (http://github.com/thoughtbot/factory_bot_rails)
- gem "factory_bot_rails"
+ gem 'factory_bot_rails'
# Easily generate fake data (https://github.com/stympy/faker)
- gem "faker"
+ gem 'faker'
# the instafailing RSpec progress bar formatter
# (https://github.com/thekompanee/fuubar)
- gem "fuubar"
+ gem 'fuubar'
# Guard keeps an eye on your file modifications (http://guardgem.org)
- gem "guard"
+ gem 'guard'
# Guard gem for RSpec (https://github.com/guard/guard-rspec)
- gem "guard-rspec"
+ gem 'guard-rspec'
# Library for stubbing HTTP requests in Ruby.
# (http://github.com/bblimke/webmock)
- gem "webmock"
+ gem 'webmock'
# Code coverage for Ruby 1.9+ with a powerful configuration library and
# automatic merging of coverage across test suites
# (http://github.com/colszowka/simplecov)
- gem "simplecov", require: false
+ # gem 'simplecov', require: false
# Strategies for cleaning databases. Can be used to ensure a clean state
# for testing. (http://github.com/DatabaseCleaner/database_cleaner)
- gem "database_cleaner", require: false
+ gem 'database_cleaner', require: false
# Making tests easy on the fingers and eyes
# (https://github.com/thoughtbot/shoulda)
- gem "shoulda", require: false
+ gem 'shoulda', require: false
# Mocking and stubbing library (http://gofreerange.com/mocha/docs)
- gem "mocha", require: false
+ gem 'mocha', require: false
# Adds support for Capybara system testing and selenium driver
- gem "capybara"
- gem "selenium-webdriver"
+ gem 'capybara'
+ gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
- gem "webdrivers"
+ gem 'webdrivers'
# Automatically create snapshots when Cucumber steps fail with Capybara
# and Rails (http://github.com/mattheworiordan/capybara-screenshot)
- gem "capybara-screenshot"
+ gem 'capybara-screenshot'
# Browser integration tests are expensive. We can mock external requests
# in our tests, but once a browser is involved, we lose control.
- gem "capybara-webmock"
+ gem 'capybara-webmock'
# RSpec::CollectionMatchers lets you express expected outcomes on
# collections of an object in an example.
- gem "rspec-collection_matchers"
+ gem 'rspec-collection_matchers'
# A set of RSpec matchers for testing Pundit authorisation policies.
- gem "pundit-matchers"
+ gem 'pundit-matchers'
# This gem brings back assigns to your controller tests as well as assert_template
# to both controller and integration tests.
- gem "rails-controller-testing"
+ gem 'rails-controller-testing'
end
group :ci, :development do
# Security vulnerability scanner for Ruby on Rails.
# (http://brakemanscanner.org)
- gem "brakeman"
-
- # Automatic Ruby code style checking tool.
- # (https://github.com/rubocop-hq/rubocop)
- # Rubocop style checks for DMP Roadmap projects.
- # (https://github.com/DMPRoadmap/rubocop-DMP_Roadmap)
- gem "rubocop-dmp_roadmap"
+ gem 'brakeman'
# Helper gem to require bundler-audit
# (http://github.com/stewartmckee/bundle-audit)
- gem "bundle-audit"
+ gem 'bundle-audit'
+
+ # RuboCop is a Ruby code style checking and code formatting tool. It aims to enforce
+ # the community-driven Ruby Style Guide.
+ gem 'rubocop'
+
+ # RuboCop rules for detecting and autocorrecting undecorated strings for i18n
+ # (gettext and rails-i18n)
+ gem 'rubocop-i18n'
+
+ # A collection of RuboCop cops to check for performance optimizations in Ruby code.
+ gem 'rubocop-performance'
+
+ # Automatic Rails code style checking tool. A RuboCop extension focused on enforcing
+ # Rails best practices and coding conventions.
+ gem 'rubocop-rails'
+
+ # A RuboCop plugin for Rake tasks
+ gem 'rubocop-rake'
+
+ # Code style checking for RSpec files. A plugin for the RuboCop code style enforcing
+ # & linting tool.
+ gem 'rubocop-rspec'
+
+ # Thread-safety checks via static analysis. A plugin for the RuboCop code style
+ # enforcing & linting tool.
+ gem 'rubocop-thread_safety'
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
- gem "listen"
- gem "web-console"
+ gem 'listen'
+ gem 'web-console'
# Spring speeds up development by keeping your application running in the background.
# Read more: https://github.com/rails/spring
- gem "spring"
- gem "spring-watcher-listen"
+ gem 'spring'
+ gem 'spring-watcher-listen'
# Simple Progress Bar for output to a terminal
# (http://github.com/paul/progress_bar)
- gem "progress_bar", require: false
+ gem 'progress_bar', require: false
# A collection of text algorithms (http://github.com/threedaymonk/text)
- gem "text", require: false
+ gem 'text', require: false
# Better error page for Rails and other Rack apps
# (https://github.com/charliesome/better_errors)
- gem "better_errors"
+ gem 'better_errors'
# Retrieve the binding of a method's caller. Can also retrieve bindings
# even further up the stack. (http://github.com/banister/binding_of_caller)
- gem "binding_of_caller"
+ gem 'binding_of_caller'
# rspec command for spring
# (https://github.com/jonleighton/spring-commands-rspec)
- gem "spring-commands-rspec"
+ gem 'spring-commands-rspec'
# Profiles loading speed for rack applications. (http://miniprofiler.com)
- gem "rack-mini-profiler"
+ gem 'rack-mini-profiler'
# Annotates Rails Models, routes, fixtures, and others based on the
# database schema. (http://github.com/ctran/annotate_models)
- gem "annotate"
+ gem 'annotate'
# Add comments to your Gemfile with each dependency's description.
# (https://github.com/ivantsepp/annotate_gem)
- gem "annotate_gem"
+ gem 'annotate_gem'
# help to kill N+1 queries and unused eager loading.
# (https://github.com/flyerhzm/bullet)
- gem "bullet"
+ gem 'bullet'
# Documentation tool for consistent and usable documentation in Ruby.
# (http://yardoc.org)
- gem "yard"
+ gem 'yard'
# TomDoc for YARD (http://rubyworks.github.com/yard-tomdoc)
- gem "yard-tomdoc"
+ gem 'yard-tomdoc'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index b9d51ac32d..c0e95e3b9b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -52,7 +52,7 @@ GEM
api-pagination (4.8.2)
arel (9.0.0)
ast (2.4.2)
- autoprefixer-rails (10.3.3.0)
+ autoprefixer-rails (10.4.2.0)
execjs (~> 2)
bcrypt (3.1.16)
better_errors (2.9.1)
@@ -62,11 +62,11 @@ GEM
bindex (0.8.1)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
- bootsnap (1.9.1)
- msgpack (~> 1.0)
- brakeman (5.1.1)
+ bootsnap (1.10.2)
+ msgpack (~> 1.2)
+ brakeman (5.2.0)
builder (3.2.4)
- bullet (6.1.5)
+ bullet (7.0.1)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
bundle-audit (0.1.0)
@@ -75,15 +75,16 @@ GEM
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
byebug (11.1.3)
- capybara (3.35.3)
+ capybara (3.36.0)
addressable
+ matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
- capybara-screenshot (1.0.25)
+ capybara-screenshot (1.0.26)
capybara (>= 1.0, < 4)
launchy
capybara-webmock (0.6.0)
@@ -108,17 +109,16 @@ GEM
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
debug_inspector (1.1.0)
- devise (4.8.0)
+ devise (4.8.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
- devise_invitable (2.0.5)
+ devise_invitable (2.0.6)
actionmailer (>= 5.0)
devise (>= 4.6)
- diff-lcs (1.4.4)
- docile (1.4.0)
+ diff-lcs (1.5.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
@@ -131,7 +131,7 @@ GEM
dragonfly (~> 1.0)
fog-aws
erubi (1.10.0)
- excon (0.86.0)
+ excon (0.90.0)
execjs (2.8.1)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
@@ -140,26 +140,30 @@ GEM
railties (>= 5.0.0)
faker (2.19.0)
i18n (>= 1.6, < 2)
- faraday (1.8.0)
+ faraday (1.9.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
- faraday-httpclient (~> 1.0.1)
+ faraday-httpclient (~> 1.0)
+ faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
- faraday-net_http_persistent (~> 1.1)
+ faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
- multipart-post (>= 1.2, < 3)
+ faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
+ faraday-multipart (1.0.3)
+ multipart-post (>= 1.2, < 3)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
- ffi (1.15.4)
+ faraday-retry (1.0.3)
+ ffi (1.15.5)
flag_shih_tzu (0.3.23)
fog-aws (3.12.0)
fog-core (~> 2.1)
@@ -180,13 +184,15 @@ GEM
font-awesome-sass (5.13.1)
sassc (>= 1.11)
formatador (0.3.0)
+ forwardable (1.3.2)
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
- gettext (3.3.7)
+ gettext (3.4.2)
locale (>= 2.0.5)
+ prime
text (>= 1.3.0)
- globalid (0.5.2)
+ globalid (1.0.0)
activesupport (>= 5.0)
guard (2.18.0)
formatador (>= 0.2.4)
@@ -203,7 +209,7 @@ GEM
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
hashdiff (1.0.1)
- hashie (4.1.0)
+ hashie (5.0.0)
highline (2.0.3)
htmltoword (1.1.1)
actionpack
@@ -212,60 +218,64 @@ GEM
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
- i18n (1.8.10)
+ i18n (1.8.11)
concurrent-ruby (~> 1.0)
ipaddress (0.8.3)
- jbuilder (2.11.2)
+ jbuilder (2.11.5)
+ actionview (>= 5.0.0)
activesupport (>= 5.0.0)
- json (2.5.1)
- jwt (2.2.3)
- kaminari (1.2.1)
+ json (2.6.1)
+ jwt (2.3.0)
+ kaminari (1.2.2)
activesupport (>= 4.1.0)
- kaminari-actionview (= 1.2.1)
- kaminari-activerecord (= 1.2.1)
- kaminari-core (= 1.2.1)
- kaminari-actionview (1.2.1)
+ kaminari-actionview (= 1.2.2)
+ kaminari-activerecord (= 1.2.2)
+ kaminari-core (= 1.2.2)
+ kaminari-actionview (1.2.2)
actionview
- kaminari-core (= 1.2.1)
- kaminari-activerecord (1.2.1)
+ kaminari-core (= 1.2.2)
+ kaminari-activerecord (1.2.2)
activerecord
- kaminari-core (= 1.2.1)
- kaminari-core (1.2.1)
+ kaminari-core (= 1.2.2)
+ kaminari-core (1.2.2)
launchy (2.5.0)
addressable (~> 2.7)
ledermann-rails-settings (2.5.0)
activerecord (>= 4.2)
- listen (3.7.0)
+ listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
locale (2.1.3)
- loofah (2.12.0)
+ loofah (2.13.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.2.8)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
+ matrix (0.4.2)
method_source (1.0.0)
- mime-types (3.3.1)
+ mime-types (3.4.1)
mime-types-data (~> 3.2015)
- mime-types-data (3.2021.0901)
+ mime-types-data (3.2022.0105)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
- mini_mime (1.1.1)
- mini_portile2 (2.6.1)
- minitest (5.14.4)
+ mini_mime (1.1.2)
+ mini_portile2 (2.7.1)
+ minitest (5.15.0)
mocha (1.13.0)
- msgpack (1.4.2)
+ msgpack (1.4.4)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
mysql2 (0.5.3)
nenv (0.3.0)
nio4r (2.5.8)
- nokogiri (1.12.5)
- mini_portile2 (~> 2.6.1)
+ nokogiri (1.13.1)
+ mini_portile2 (~> 2.7.0)
+ racc (~> 1.4)
+ nokogiri (1.13.1-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
@@ -280,7 +290,7 @@ GEM
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
rack-protection
- omniauth-oauth2 (1.7.1)
+ omniauth-oauth2 (1.7.2)
oauth2 (~> 1.4)
omniauth (>= 1.9, < 3)
omniauth-orcid (2.1.1)
@@ -294,9 +304,12 @@ GEM
options (2.3.2)
orm_adapter (0.5.0)
parallel (1.21.0)
- parser (3.0.2.0)
+ parser (3.1.0.0)
ast (~> 2.4.1)
- pg (1.2.3)
+ pg (1.3.0)
+ prime (0.1.2)
+ forwardable
+ singleton
progress_bar (1.3.3)
highline (>= 1.6, < 3)
options (~> 2.3.0)
@@ -304,19 +317,19 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
- puma (5.5.0)
+ puma (5.6.0)
nio4r (~> 2.0)
pundit (2.1.1)
activesupport (>= 3.0.0)
pundit-matchers (1.7.0)
rspec-rails (>= 3.0.0)
- racc (1.5.2)
+ racc (1.6.0)
rack (2.2.3)
rack-mini-profiler (2.3.3)
rack (>= 1.2.0)
rack-protection (2.1.0)
rack
- rack-proxy (0.7.0)
+ rack-proxy (0.7.2)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
@@ -348,19 +361,19 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
- rainbow (3.0.0)
+ rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
recaptcha (5.8.1)
json
- regexp_parser (2.1.1)
+ regexp_parser (2.2.0)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.5)
- rollbar (3.2.0)
+ rollbar (3.3.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
@@ -369,13 +382,13 @@ GEM
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
- rspec-expectations (3.10.1)
+ rspec-expectations (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
- rspec-rails (5.0.2)
+ rspec-rails (5.1.0)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
@@ -383,43 +396,33 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
- rspec-support (3.10.2)
- rubocop (1.22.0)
+ rspec-support (3.10.3)
+ rubocop (1.25.0)
parallel (~> 1.10)
- parser (>= 3.0.0.0)
+ parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
- rubocop-ast (>= 1.12.0, < 2.0)
+ rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
- rubocop-ast (1.12.0)
+ rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
- rubocop-dmp_roadmap (1.1.2)
- rubocop (>= 0.58.2)
- rubocop-rails_config (>= 0.2.2)
- rubocop-rspec (>= 1.27.0)
- rubocop-minitest (0.15.1)
- rubocop (>= 0.90, < 2.0)
- rubocop-packaging (0.5.1)
- rubocop (>= 0.89, < 2.0)
- rubocop-performance (1.11.5)
+ rubocop-i18n (3.0.0)
+ rubocop (~> 1.0)
+ rubocop-performance (1.13.2)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
- rubocop-rails (2.12.2)
+ rubocop-rails (2.13.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
- rubocop-rails_config (1.7.3)
- railties (>= 5.0)
- rubocop (>= 1.19)
- rubocop-ast (>= 1.0.1)
- rubocop-minitest (~> 0.15)
- rubocop-packaging (~> 0.5)
- rubocop-performance (~> 1.11)
- rubocop-rails (~> 2.0)
- rubocop-rspec (2.5.0)
+ rubocop-rake (0.6.0)
+ rubocop (~> 1.0)
+ rubocop-rspec (2.8.0)
rubocop (~> 1.19)
+ rubocop-thread_safety (0.4.4)
+ rubocop (>= 0.53.0)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
ruby_dig (0.0.2)
@@ -445,12 +448,7 @@ GEM
shoulda-context (2.0.0)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
- simplecov (0.21.2)
- docile (~> 1.1)
- simplecov-html (~> 0.11)
- simplecov_json_formatter (~> 0.1)
- simplecov-html (0.12.3)
- simplecov_json_formatter (0.1.3)
+ singleton (0.1.1)
spring (2.1.1)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
@@ -460,17 +458,17 @@ GEM
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
- sprockets-rails (3.2.2)
- actionpack (>= 4.0)
- activesupport (>= 4.0)
+ sprockets-rails (3.4.2)
+ actionpack (>= 5.2)
+ activesupport (>= 5.2)
sprockets (>= 3.0.0)
text (1.3.1)
- thor (1.1.0)
+ thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.10)
tomparse (0.4.2)
- translation (1.26)
- gettext (~> 3.2, >= 3.2.5, <= 3.3.7)
+ translation (1.28)
+ gettext (~> 3.2, >= 3.2.5, <= 3.4.2)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
@@ -485,10 +483,10 @@ GEM
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
- webdrivers (4.6.1)
+ webdrivers (4.7.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
- selenium-webdriver (>= 3.0, < 4.0)
+ selenium-webdriver (> 3.141, < 5.0)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
@@ -507,7 +505,8 @@ GEM
wkhtmltopdf-binary (0.12.6.5)
xpath (3.2.0)
nokogiri (~> 1.8)
- yard (0.9.26)
+ yard (0.9.27)
+ webrick (~> 1.7.0)
yard-tomdoc (0.7.1)
tomparse (>= 0.4.0)
yard
@@ -515,6 +514,7 @@ GEM
PLATFORMS
ruby
+ x86_64-linux
DEPENDENCIES
annotate
@@ -572,12 +572,17 @@ DEPENDENCIES
rollbar
rspec-collection_matchers
rspec-rails
- rubocop-dmp_roadmap
+ rubocop
+ rubocop-i18n
+ rubocop-performance
+ rubocop-rails
+ rubocop-rake
+ rubocop-rspec
+ rubocop-thread_safety
sass-rails
sassc-rails
selenium-webdriver
shoulda
- simplecov
spring
spring-commands-rspec
spring-watcher-listen
@@ -598,4 +603,4 @@ RUBY VERSION
ruby 2.6.3p62
BUNDLED WITH
- 2.1.4
+ 2.2.33
diff --git a/Rakefile b/Rakefile
index 700a8a33cf..42f9525d64 100755
--- a/Rakefile
+++ b/Rakefile
@@ -10,7 +10,7 @@
# task default: :test
-require_relative "config/application"
+require_relative 'config/application'
DMPRoadmap::Application.load_tasks
diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb
index fa6ee697da..9aec230539 100644
--- a/app/channels/application_cable/channel.rb
+++ b/app/channels/application_cable/channel.rb
@@ -1,9 +1,6 @@
# frozen_string_literal: true
module ApplicationCable
-
class Channel < ActionCable::Channel::Base
-
end
-
end
diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb
index b08f85080a..8d6c2a1bf4 100644
--- a/app/channels/application_cable/connection.rb
+++ b/app/channels/application_cable/connection.rb
@@ -1,9 +1,6 @@
# frozen_string_literal: true
module ApplicationCable
-
class Connection < ActionCable::Connection::Base
-
end
-
end
diff --git a/app/controllers/answers_controller.rb b/app/controllers/answers_controller.rb
index 48980290bf..9e089bd5d4 100644
--- a/app/controllers/answers_controller.rb
+++ b/app/controllers/answers_controller.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
+# Controller that handles Answers to DMP questions
class AnswersController < ApplicationController
-
respond_to :html
include ConditionsHelper
@@ -12,6 +12,7 @@ class AnswersController < ApplicationController
# `remote: true` in the
")
end
def feedback_constant_to_text(text, user, plan, org)
- _(text.to_s) % { application_name: ApplicationService.application_name,
- user_name: user.name(false),
- plan_name: plan.title,
- organisation_email: org.contact_email }
+ format(_(text.to_s), application_name: ApplicationService.application_name, user_name: user.name(false),
+ plan_name: plan.title, organisation_email: org.contact_email)
end
-
end
diff --git a/app/helpers/identifier_helper.rb b/app/helpers/identifier_helper.rb
index 300b43a50e..fa61ee0e7c 100644
--- a/app/helpers/identifier_helper.rb
+++ b/app/helpers/identifier_helper.rb
@@ -1,15 +1,14 @@
# frozen_string_literal: true
+# Helper methods for displaying Identifiers
module IdentifierHelper
-
def id_for_display(id:, with_scheme_name: true)
- return _("None defined") if id.new_record? || id.value.blank?
+ return _('None defined') if id.new_record? || id.value.blank?
without = id.value_without_scheme_prefix
- prefix = with_scheme_name ? id.identifier_scheme.description + ": " : ""
- return prefix + id.value unless without != id.value && !without.starts_with?("http")
+ prefix = with_scheme_name ? "#{id.identifier_scheme.description}: " : ''
+ return prefix + id.value unless without != id.value && !without.starts_with?('http')
- link_to "#{prefix} #{without}", id.value, class: "has-new-window-popup-info"
+ link_to "#{prefix} #{without}", id.value, class: 'has-new-window-popup-info'
end
-
end
diff --git a/app/helpers/languages_helper.rb b/app/helpers/languages_helper.rb
index d0f3715ac5..db15cf24f5 100644
--- a/app/helpers/languages_helper.rb
+++ b/app/helpers/languages_helper.rb
@@ -1,9 +1,8 @@
# frozen_string_literal: true
+# Helper methods for Languages
module LanguagesHelper
-
def languages
- Rails.cache.fetch("languages", expires_in: 1.hour) { Language.sorted_by_abbreviation }
+ Rails.cache.fetch('languages', expires_in: 1.hour) { Language.sorted_by_abbreviation }
end
-
end
diff --git a/app/helpers/mailer_helper.rb b/app/helpers/mailer_helper.rb
index 4fa8934371..7824d66081 100644
--- a/app/helpers/mailer_helper.rb
+++ b/app/helpers/mailer_helper.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
+# Helper methods for Emails
module MailerHelper
-
include PermsHelper
def tool_name
@@ -14,37 +14,36 @@ def helpdesk_email
# Returns an unordered HTML list with the permissions associated to the user passed
def privileges_list(user)
- return "" unless user.respond_to?(:perms) && user.perms.respond_to?(:each)
+ return '' unless user.respond_to?(:perms) && user.perms.respond_to?(:each)
names = name_and_text
- r = ""
+ r = ''
user.perms.each do |p|
r += "- #{names[p.name.to_sym]}
" if names.key?(p.name.to_sym)
end
- r += "
"
+ r += '
'
end
# Returns the messaging for the specified role
def role_text(role)
if role.administrator?
{
- type: _("co-owner"),
- placeholder1: _("write and edit the plan in a collaborative manner."),
- placeholder2: _("You can also grant rights to other collaborators.")
+ type: _('co-owner'),
+ placeholder1: _('write and edit the plan in a collaborative manner.'),
+ placeholder2: _('You can also grant rights to other collaborators.')
}
elsif role.editor?
{
- type: _("editor"),
- placeholder1: _("write and edit the plan in a collaborative manner."),
+ type: _('editor'),
+ placeholder1: _('write and edit the plan in a collaborative manner.'),
placeholder2: nil
}
else
{
- type: _("read-only"),
- placeholder1: _("read the plan and leave comments."),
+ type: _('read-only'),
+ placeholder1: _('read the plan and leave comments.'),
placeholder2: nil
}
end
end
-
end
diff --git a/app/helpers/manifests_helper.rb b/app/helpers/manifests_helper.rb
index ba841a99cb..0e75dc90ec 100644
--- a/app/helpers/manifests_helper.rb
+++ b/app/helpers/manifests_helper.rb
@@ -39,10 +39,10 @@
#
# config.action_view.stylesheet_manifest_resolver = MyCustomResolver.new
#
+# Helper methods for JS
module ManifestsHelper
-
# The name of the default asset manifest files.
- DEFAULT = "application"
+ DEFAULT = 'application'
# The name of the javascript manifest file to load. Defaults to application.js
#
@@ -65,5 +65,4 @@ def stylesheet_manifest_file
DEFAULT
end
end
-
end
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb
index 0ccaba62af..feebd82668 100644
--- a/app/helpers/notifications_helper.rb
+++ b/app/helpers/notifications_helper.rb
@@ -1,19 +1,18 @@
# frozen_string_literal: true
+# Helper methods for Global notifications and Flash messages
module NotificationsHelper
-
# FA html class depending on Notification level
#
# Returns String
def fa_classes(notification)
case notification.level
- when "warning"
- "fa-exclamation-circle"
- when "danger"
- "fa-times-circle"
+ when 'warning'
+ 'fa-exclamation-circle'
+ when 'danger'
+ 'fa-times-circle'
else
- "fa-info-circle"
+ 'fa-info-circle'
end
end
-
end
diff --git a/app/helpers/orgs_helper.rb b/app/helpers/orgs_helper.rb
index 2910e7d801..cfbc4eff61 100644
--- a/app/helpers/orgs_helper.rb
+++ b/app/helpers/orgs_helper.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
+# Helper methods for Orgs
module OrgsHelper
-
- EMAIL_PLACEHOLDER = "[Organisation Contact Email Placeholder]"
+ EMAIL_PLACEHOLDER = '[Organisation Contact Email Placeholder]'
# Sample message for Org feedback form.
#
@@ -11,22 +11,18 @@ module OrgsHelper
# Returns String
def sample_message_for_org_feedback_form(org)
email = org.contact_email || EMAIL_PLACEHOLDER
- _("A data librarian from %{org_name} will respond to your request within 48
+ format(_("
A data librarian from %s will respond to your request within 48
hours. If you have questions pertaining to this action please contact us
- at %{organisation_email}.
") % {
- organisation_email: email,
- org_name: org.name
- }
+ at %s."), organisation_email: email, org_name: org.name)
end
# The preferred logo url for the current configuration. If DRAGONFLY_AWS is true, return
# the remote_url, otherwise return the url
def logo_url_for_org(org)
- if ENV["DRAGONFLY_AWS"] == "true"
+ if ENV['DRAGONFLY_AWS'] == 'true'
org.logo.remote_url
else
org.logo.url
end
end
-
end
diff --git a/app/helpers/paginable_helper.rb b/app/helpers/paginable_helper.rb
index b0c06e73d6..9939d96b3e 100644
--- a/app/helpers/paginable_helper.rb
+++ b/app/helpers/paginable_helper.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
+# Helper methods for Paginable tables
module PaginableHelper
-
include Paginable
-
end
diff --git a/app/helpers/perms_helper.rb b/app/helpers/perms_helper.rb
index 2b7cf006b7..e9f38b27b0 100644
--- a/app/helpers/perms_helper.rb
+++ b/app/helpers/perms_helper.rb
@@ -1,21 +1,20 @@
# frozen_string_literal: true
+# Helper methods for User permissions
module PermsHelper
-
# Returns a hash whose keys are the names associated to Perms and values are
# the text to be displayed to the end user
def name_and_text
{
- add_organisations: _("Add organisations"),
- change_org_affiliation: _("Change affiliation"),
- grant_permissions: _("Manage user privileges"),
- modify_templates: _("Manage templates"),
- modify_guidance: _("Manage guidance"),
- use_api: _("API rights"),
- change_org_details: _("Manage organisation details"),
- grant_api_to_orgs: _("Grant API to organisations"),
- review_org_plans: _("")
+ add_organisations: _('Add organisations'),
+ change_org_affiliation: _('Change affiliation'),
+ grant_permissions: _('Manage user privileges'),
+ modify_templates: _('Manage templates'),
+ modify_guidance: _('Manage guidance'),
+ use_api: _('API rights'),
+ change_org_details: _('Manage organisation details'),
+ grant_api_to_orgs: _('Grant API to organisations'),
+ review_org_plans: _('')
}
end
-
end
diff --git a/app/helpers/plans_helper.rb b/app/helpers/plans_helper.rb
index 5e27d40dae..0b824e366d 100644
--- a/app/helpers/plans_helper.rb
+++ b/app/helpers/plans_helper.rb
@@ -1,28 +1,28 @@
# frozen_string_literal: true
+# Helper methods for Plans
module PlansHelper
-
# display the role of the user for a given plan
def display_role(role)
if role.creator?
- _("Owner")
+ _('Owner')
elsif role.administrator?
- _("Co-owner")
+ _('Co-owner')
elsif role.editor?
- _("Editor")
+ _('Editor')
elsif role.commenter?
- _("Read only")
+ _('Read only')
end
end
# display the visibility of the plan
def display_visibility(val)
case val
- when "organisationally_visible"
+ when 'organisationally_visible'
"#{_('Organisation')}"
- when "publicly_visible"
+ when 'publicly_visible'
"#{_('Public')}"
- when "privately_visible"
+ when 'privately_visible'
"#{_('Private')}"
else
"#{_('Private')}" # Test Plans
@@ -31,12 +31,12 @@ def display_visibility(val)
def visibility_tooltip(val)
case val
- when "organisationally_visible"
- _("Organisation: anyone at my organisation can view.")
- when "publicly_visible"
- _("Public: anyone can view.")
+ when 'organisationally_visible'
+ _('Organisation: anyone at my organisation can view.')
+ when 'publicly_visible'
+ _('Public: anyone can view.')
else
- _("Private: restricted to me and people I invite.")
+ _('Private: restricted to me and people I invite.')
end
end
@@ -51,5 +51,4 @@ def display_section?(customization, section, show_custom_sections)
display ||= customization && section[:modifiable] && show_custom_sections
display
end
-
end
diff --git a/app/helpers/sections_helper.rb b/app/helpers/sections_helper.rb
index e3bd8e9beb..90fe7b2d9d 100644
--- a/app/helpers/sections_helper.rb
+++ b/app/helpers/sections_helper.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
+# Helper methods for Template Sections
module SectionsHelper
-
# HREF attribute value for headers in the section partials. If the section
# is modifiable, returns the section path, otherwise the edit section path.
#
@@ -25,5 +25,4 @@ def header_path_for_section(section, phase, template)
def draggable_for_section?(section)
section.template.latest? && section.modifiable?
end
-
end
diff --git a/app/helpers/settings_template_helper.rb b/app/helpers/settings_template_helper.rb
index 0dab8e5682..f1061b0e77 100644
--- a/app/helpers/settings_template_helper.rb
+++ b/app/helpers/settings_template_helper.rb
@@ -1,22 +1,22 @@
# frozen_string_literal: true
+# Helper methods for Settings
module SettingsTemplateHelper
-
# Retrieves an msgstr for a given admin_field
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def admin_field_t(admin_field)
- return _("Unknown column name.") if Settings::Template::VALID_ADMIN_FIELDS.include?(admin_field)
- return _("Plan Name") if admin_field == "project_name"
- return _("Plan ID") if admin_field == "project_identifier"
- return _("Grant number") if admin_field == "grant_title"
- return _("Principal Investigator / Researcher") if admin_field == "principal_investigator"
- return _("Plan Data Contact") if admin_field == "project_data_contact"
- return _("Plan Description") if admin_field == "project_description"
- return _("Funder") if admin_field == "funder"
- return _("Organisation") if admin_field == "institution"
- return _("Your ORCID") if admin_field == "orcid"
+ return _('Unknown column name.') if Settings::Template::VALID_ADMIN_FIELDS.include?(admin_field)
+ return _('Plan Name') if admin_field == 'project_name'
+ return _('Plan ID') if admin_field == 'project_identifier'
+ return _('Grant number') if admin_field == 'grant_title'
+ return _('Principal Investigator / Researcher') if admin_field == 'principal_investigator'
+ return _('Plan Data Contact') if admin_field == 'project_data_contact'
+ return _('Plan Description') if admin_field == 'project_description'
+ return _('Funder') if admin_field == 'funder'
+ return _('Organisation') if admin_field == 'institution'
+ return _('Your ORCID') if admin_field == 'orcid'
- _("Unknown column name.")
+ _('Unknown column name.')
end
- # rubocop:enable
-
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
end
diff --git a/app/helpers/super_admin/orgs/merge_helper.rb b/app/helpers/super_admin/orgs/merge_helper.rb
index 1c2051fdda..35e7f737f0 100644
--- a/app/helpers/super_admin/orgs/merge_helper.rb
+++ b/app/helpers/super_admin/orgs/merge_helper.rb
@@ -1,15 +1,13 @@
# frozen_string_literal: true
module SuperAdmin
-
module Orgs
-
+ # Helper methods for Merging Orgs
module MergeHelper
-
def org_column_content(attributes:)
- return "No mergeable attributes" unless attributes.present? && attributes.keys.any?
+ return 'No mergeable attributes' unless attributes.present? && attributes.keys.any?
- html = "