diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f14cfb99..7664f6c3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,14 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 15 -# Cop supports --auto-correct. -# Configuration parameters: Include, TreatCommentsAsGroupSeparators. -# Include: **/Gemfile, **/gems.rb -Bundler/OrderedGems: - Exclude: - - 'Gemfile' - # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. @@ -646,16 +638,6 @@ Style/RedundantParentheses: Exclude: - 'app/controllers/admin/base_controller.rb' -# Offense count: 9 -# Cop supports --auto-correct. -# Configuration parameters: AllowMultipleReturnValues. -Style/RedundantReturn: - Exclude: - - 'app/helpers/application_helper.rb' - - 'app/helpers/format_helper.rb' - - 'app/helpers/paths_helper.rb' - - 'app/helpers/users_helper.rb' - # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. @@ -740,10 +722,3 @@ Style/TrailingCommaInLiteral: - 'Guardfile' - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' - 'spec/models/conference_spec.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Style/UnneededInterpolation: - Exclude: - - 'app/helpers/format_helper.rb' - - 'spec/controllers/admin/conferences_controller_spec.rb' diff --git a/Gemfile b/Gemfile index d4e3f517..0806088d 100644 --- a/Gemfile +++ b/Gemfile @@ -27,8 +27,8 @@ gem 'paper_trail' # for upload management gem 'carrierwave' -gem 'mini_magick' gem 'carrierwave-bombshelter' +gem 'mini_magick' # for internationalizing gem 'rails-i18n', '~> 4.0.0' @@ -40,9 +40,9 @@ gem 'devise_ichain_authenticatable' # for openID authentication gem 'omniauth' gem 'omniauth-facebook' -gem 'omniauth-openid' -gem 'omniauth-google-oauth2' gem 'omniauth-github' +gem 'omniauth-google-oauth2' +gem 'omniauth-openid' # Bot-filtering gem 'recaptcha', require: 'recaptcha/rails' @@ -60,8 +60,8 @@ gem 'unobtrusive_flash', '>=3' gem 'transitions', :require => %w( transitions active_record/transitions ) # for comments -gem 'awesome_nested_set', '~> 3.1.3' gem 'acts_as_commentable_with_threading' +gem 'awesome_nested_set', '~> 3.1.3' # as templating language gem 'haml-rails' @@ -73,11 +73,11 @@ gem 'sass-rails', '>= 4.0.2' gem 'uglifier', '>= 1.3.0' # as the front-end framework -gem 'bootstrap-sass', '~> 3.3.4.1' gem 'autoprefixer-rails' -gem 'formtastic-bootstrap' -gem 'formtastic', '~> 3.1.1' +gem 'bootstrap-sass', '~> 3.3.4.1' gem 'cocoon' +gem 'formtastic', '~> 3.1.1' +gem 'formtastic-bootstrap' # as the JavaScript library gem 'jquery-rails' @@ -108,8 +108,8 @@ source 'https://rails-assets.org' do gem 'rails-assets-waypoints' # for markdown editors gem 'rails-assets-bootstrap-markdown' - gem 'rails-assets-to-markdown' gem 'rails-assets-markdown' + gem 'rails-assets-to-markdown' end # as date picker @@ -129,9 +129,9 @@ gem 'gravtastic' gem 'country_select' # as PDF generator +gem 'prawn-qrcode', '~> 0.2.2.1' gem 'prawn_rails' gem 'rqrcode' -gem 'prawn-qrcode', '~> 0.2.2.1' # to render XLS spreadsheets gem 'axlsx', git: 'https://github.com/randym/axlsx.git' @@ -156,13 +156,13 @@ gem 'redcarpet' gem 'rdoc-generator-fivefish' # for visitor tracking -gem 'ahoy_matey' gem 'activeuuid' +gem 'ahoy_matey' gem 'piwik_analytics', '~> 1.0.1' # for recurring jobs -gem 'whenever', :require => false gem 'delayed_job_active_record' +gem 'whenever', :require => false # to run scripts gem 'daemons' @@ -216,8 +216,8 @@ gem 'nokogiri', '>= 1.8.1' group :development do # to launch specs when files are modified gem 'guard-rspec' - gem 'spring-commands-rspec' gem 'haml_lint', '~> 0.24.0' + gem 'spring-commands-rspec' # for static code analisys gem 'rubocop', '~> 0.51.0', require: false # as database @@ -234,11 +234,11 @@ end group :test do # as test framework - gem 'rspec-rails', '~> 3.5', '>= 3.5.2' - gem 'database_cleaner' gem 'capybara' - gem 'poltergeist' + gem 'database_cleaner' gem 'phantomjs', :require => 'phantomjs/poltergeist' + gem 'poltergeist' + gem 'rspec-rails', '~> 3.5', '>= 3.5.2' # for measuring test coverage gem 'coveralls', require: false # for describing models diff --git a/INSTALL.md b/INSTALL.md index 29dc5cec..7da0c52c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -42,7 +42,7 @@ There are two configurations to deploy OSEM with Docker: *evaluation mode* and * If you want to evaluate OSEM to see if it fits your needs, the default configuration in `docker-compose.env` will work perfectly fine for you. For convenience reasons, `docker-compose.yml` already contains a [MailHog](https://github.com/mailhog/MailHog) service configuration. MailHog -is going to catch every email sent by OSEM and displays them on a special web service. Thus, it eliminitates the need to set up an SMTP server just to try out OSEM. +is going to catch every email sent by OSEM and displays them on a special web service. Thus, it eliminates the need to set up an SMTP server just to try out OSEM. Just point your browser to http://localhost:8025 to get access to registration confirmation links etc. Run `docker-compose up --build` to start the services. On first run, it will take a few minutes to initialize the database. Thus, wait a few minutes before you open up diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b5e2892e..b1e249ba 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -66,7 +66,7 @@ module ApplicationHelper else ts = all.join end - return ts + ts end def difficulty_levels(conference) @@ -80,7 +80,7 @@ module ApplicationHelper else ts = all.join end - return ts + ts end def unread_notifications(user) diff --git a/app/helpers/format_helper.rb b/app/helpers/format_helper.rb index 65578ba6..a41c584e 100644 --- a/app/helpers/format_helper.rb +++ b/app/helpers/format_helper.rb @@ -101,17 +101,17 @@ module FormatHelper def icon_for_todo(bool) if bool - return 'fa fa-check' + 'fa fa-check' else - return 'fa fa-times' + 'fa fa-times' end end def class_for_todo(bool) if bool - return 'todolist-ok' + 'todolist-ok' else - return 'todolist-missing' + 'todolist-missing' end end @@ -122,7 +122,7 @@ module FormatHelper plural || singular.pluralize end - "#{word}" + word end # Returns black or white deppending on what of them contrast more with the diff --git a/app/helpers/paths_helper.rb b/app/helpers/paths_helper.rb index df01ab2f..46e82900 100644 --- a/app/helpers/paths_helper.rb +++ b/app/helpers/paths_helper.rb @@ -5,9 +5,9 @@ module PathsHelper def active_nav_li(link) if current_page?(link) - return 'active' + 'active' else - return '' + '' end end end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 50becf0c..763a44c9 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -18,7 +18,7 @@ module UsersHelper providers << provider if !ENV["OSEM_#{provider.upcase}_KEY"].blank? && !ENV["OSEM_#{provider.upcase}_SECRET"].blank? end - return providers.uniq + providers.uniq end # Receives a hash, generated from User model, function get_roles diff --git a/spec/controllers/admin/conferences_controller_spec.rb b/spec/controllers/admin/conferences_controller_spec.rb index 009e40ba..ff9d676b 100644 --- a/spec/controllers/admin/conferences_controller_spec.rb +++ b/spec/controllers/admin/conferences_controller_spec.rb @@ -56,8 +56,8 @@ describe Admin::ConferencesController do conference.reload expect(flash[:error]) .to eq("Updating conference failed. Short title can't be blank.") - expect(conference.title).to eq("#{conference.title}") - expect(conference.short_title).to eq("#{conference.short_title}") + expect(conference.title).to eq(conference.title) + expect(conference.short_title).to eq(conference.short_title) end it 're-renders the #show template' do