Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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')
3 changes: 2 additions & 1 deletion huginn_github_notifications_agent.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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'
Expand Down
3 changes: 0 additions & 3 deletions lib/huginn_github_notifications_agent.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions spec/github_notifications_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down