diff --git a/.rubocop.yml b/.rubocop.yml index b1b0643..a46ee38 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -31,3 +31,23 @@ Layout/FirstHashElementIndentation: Metrics/BlockLength: Exclude: - "spec/github_notifications_agent_spec.rb" +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: true +Layout/SpaceAroundMethodCallOperator: + Enabled: true +Lint/DeprecatedOpenSSLConstant: + Enabled: true +Lint/MixedRegexpCaptureTypes: + Enabled: true +Lint/RaiseException: + Enabled: true +Lint/StructNewOverride: + Enabled: true +Style/ExponentialNotation: + Enabled: true +Style/RedundantRegexpCharacterClass: + Enabled: true +Style/RedundantRegexpEscape: + Enabled: true +Style/SlicingWithRange: + Enabled: true diff --git a/.travis.yml b/.travis.yml index 71b5392..3667f40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,9 @@ env: - DATABASE_ADAPTER=mysql2 - DATABASE_ADAPTER=postgresql DATABASE_USERNAME=postgres rvm: - - 2.4.9 - 2.5.7 - 2.6.5 + - 2.7 jobs: include: - rvm: 2.6.5 diff --git a/Rakefile b/Rakefile index dd2a952..77c0847 100644 --- a/Rakefile +++ b/Rakefile @@ -2,4 +2,4 @@ require 'huginn_agent' -HuginnAgent.load_tasks(branch: 'master', remote: 'https://github.com/cantino/huginn.git') +HuginnAgent.load_tasks(branch: 'fix/mimemagic', remote: 'https://github.com/joenas/huginn.git') diff --git a/huginn_github_notifications_agent.gemspec b/huginn_github_notifications_agent.gemspec index 2aae5c9..60bbebb 100644 --- a/huginn_github_notifications_agent.gemspec +++ b/huginn_github_notifications_agent.gemspec @@ -4,6 +4,7 @@ lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| + spec.required_ruby_version = '>= 2.6' spec.name = 'huginn_github_notifications_agent' spec.version = '0.0.2' spec.authors = ['joenas'] @@ -23,7 +24,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 1.7' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 0.83.0' + spec.add_development_dependency 'rubocop', '~> 1.21.0' spec.add_runtime_dependency 'huginn_agent' spec.add_runtime_dependency 'virtus', '~> 1.0' diff --git a/lib/huginn_github_notifications_agent.rb b/lib/huginn_github_notifications_agent.rb index 58329d0..18cb075 100644 --- a/lib/huginn_github_notifications_agent.rb +++ b/lib/huginn_github_notifications_agent.rb @@ -1,11 +1,8 @@ # frozen_string_literal: true -# rubocop:disable Layout/LineLength - require 'huginn_agent' require 'virtus' require 'huginn_github_notifications_agent/subject' # HuginnAgent.load 'huginn_github_notifications_agent/concerns/my_agent_concern' HuginnAgent.register 'huginn_github_notifications_agent/github_notifications_agent' -# rubocop:enable Layout/LineLength diff --git a/lib/huginn_github_notifications_agent/github_notifications_agent.rb b/lib/huginn_github_notifications_agent/github_notifications_agent.rb index 8b85471..7db5262 100644 --- a/lib/huginn_github_notifications_agent/github_notifications_agent.rb +++ b/lib/huginn_github_notifications_agent/github_notifications_agent.rb @@ -37,9 +37,7 @@ def default_options end def validate_options - unless options['access_token'].present? - errors.add(:base, 'access_token is required ') - end + errors.add(:base, 'access_token is required ') unless options['access_token'].present? # rubocop:disable Style/GuardClause if last_modified.present? && boolify(last_modified).nil? errors.add(:base, 'last_modified must be a boolean value') @@ -108,7 +106,7 @@ def request_options def default_headers { 'User-Agent' => 'Huginn (https://github.com/cantino/huginn)', - 'Authorization' => 'token ' + interpolated['access_token'] + 'Authorization' => "token #{interpolated['access_token']}" } end diff --git a/spec/github_notifications_agent_spec.rb b/spec/github_notifications_agent_spec.rb index f05513b..baff02e 100644 --- a/spec/github_notifications_agent_spec.rb +++ b/spec/github_notifications_agent_spec.rb @@ -81,9 +81,7 @@ }) end - # rubocop:disable Layout/LineLength it 'should generate a correct request options hash on consecutive runs with last_modified == false' do - # rubocop:enable Layout/LineLength @checker.options['last_modified'] = 'false' @checker.memory[:last_modified] = Time.now @checker.save