Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit b80df12

Browse files
Merge pull request #1423 from ellisju/master
Fixes earlier attempt to add the functionality to work with additional jsdom versions
2 parents 5260301 + 7e51ea1 commit b80df12

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/scripts/http-info.coffee

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,21 @@ module.exports = (robot) ->
5454
else if title
5555
msg.send "#{title}"
5656

57+
versionCompare = (v1, v2, comparison) ->
58+
v1parts = v1.split('.')
59+
v2parts = v2.split('.')
60+
61+
for value1, i in v1parts
62+
value1 = parseInt(value1, 10)
63+
value2 = parseInt(v2parts[i], 10)
64+
if comparison == '<' and value1 < value2
65+
return 1
66+
if comparison == '>' and value1 > value2
67+
return 1
68+
return 0
69+
5770
unless ignore
58-
if jsdom.version < '0.7.0'
71+
if versionCompare jsdom.version, '0.7.0', '<'
5972
jsdom.env
6073
html: url
6174
scripts: [ jquery ]

0 commit comments

Comments
 (0)