Skip to content

Commit

Permalink
Fix new rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Oct 9, 2020
1 parent 5ea7425 commit 2dc50b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/potlatch.rb
Expand Up @@ -180,13 +180,13 @@ def self.get_presets
# StringIO.open(txt) do |file|
File.open(Rails.root.join("config/potlatch/presets.txt")) do |file|
file.each_line do |line|
t = line.chomp
if t =~ %r{(\w+)/(\w+)}
case line.chomp
when %r{(\w+)/(\w+)}
presettype = Regexp.last_match(1)
presetcategory = Regexp.last_match(2)
presetmenus[presettype].push(presetcategory)
presetnames[presettype][presetcategory] = ["(no preset)"]
elsif t =~ /^([\w\s]+):\s?(.+)$/
when /^([\w\s]+):\s?(.+)$/
pre = Regexp.last_match(1)
kv = Regexp.last_match(2)
presetnames[presettype][presetcategory].push(pre)
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/api/changesets_controller_test.rb
Expand Up @@ -71,7 +71,7 @@ def test_create
duration = cs.closed_at - cs.created_at
# the difference can either be a rational, or a floating point number
# of seconds, depending on the code path taken :-(
if duration.class == Rational
if duration.instance_of?(Rational)
assert_equal Rational(1, 24), duration, "initial idle timeout should be an hour (#{cs.created_at} -> #{cs.closed_at})"
else
# must be number of seconds...
Expand Down

0 comments on commit 2dc50b4

Please sign in to comment.