Skip to content

Commit

Permalink
chore: Fix linting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraichen committed Aug 5, 2024
1 parent 15ec4ba commit 54f6d6b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 25 deletions.
13 changes: 11 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
inherit_from: .rubocop_todo.yml

inherit_gem:
rubocop-config: default.yml

AllCops:
TargetRubyVersion: 2.7
SuggestExtensions: False

Naming/FileName:
Exclude:
- lib/rails-timeago.rb

RSpec/NestedGroups:
Enabled: False

RSpec/SpecFilePathFormat:
Exclude:
- spec/timeago/helper_spec.rb
19 changes: 0 additions & 19 deletions .rubocop_todo.yml

This file was deleted.

5 changes: 3 additions & 2 deletions lib/rails-timeago.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ class Engine < ::Rails::Engine # :nodoc:
def self.default_options(opts = nil)
@defaults ||= option_hash
if opts
@defaults.merge! \
opts.extract!(*@defaults.keys.select {|k| opts.include?(k) })
@defaults.merge!(
opts.extract!(*@defaults.keys.select {|k| opts.include?(k) }),
)
else
@defaults
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/stub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def call_render
end

def call_asset
if (file = find_asset(@request.path[8..-1]))
if (file = find_asset(@request.path[8..]))
[200, {'Content-Type' => 'text/javascript'}, [file.read]]
else
[404, {}, []]
Expand Down
2 changes: 1 addition & 1 deletion spec/timeago_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper'

RSpec.describe 'rails-timeago', js: true, type: :feature do
RSpec.describe 'rails-timeago', :js, type: :feature do
subject(:element) { find 'body > time' }

let(:time) { 2.days.ago }
Expand Down

0 comments on commit 54f6d6b

Please sign in to comment.