Skip to content

Commit

Permalink
Adjust nocov markings
Browse files Browse the repository at this point in the history
Also, only set TEXT_END in a single place.
  • Loading branch information
jeremyevans committed Nov 13, 2020
1 parent 16ca175 commit 78a1306
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/erubi.rb
Expand Up @@ -4,19 +4,18 @@ module Erubi
VERSION = '1.9.0'
RANGE_ALL = 0..-1

# :nocov:
if RUBY_VERSION >= '1.9'
RANGE_FIRST = 0
RANGE_LAST = -1
TEXT_END = RUBY_VERSION >= '2.1' ? "'.freeze;" : "';"
else
# :nocov:
RANGE_FIRST = 0..0
RANGE_LAST = -1..-1
TEXT_END = "';"
# :nocov:
end

TEXT_END = RUBY_VERSION >= '2.1' ? "'.freeze;" : "';"
MATCH_METHOD = RUBY_VERSION >= '2.4' ? :match? : :match
# :nocov:

begin
require 'cgi/escape'
Expand Down

0 comments on commit 78a1306

Please sign in to comment.