hostlist_expression 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hostlist_expression.rb +2 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80ed12d4cf8f0d716de3c766de55a1cb052da4ce
|
4
|
+
data.tar.gz: ba61a29b097eae918d2623207d5e6824b7227211
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f92ce87db337993ab0dc0cc298bc9da0e2cb43dd2f44381c3d4890a4aac77e45756f953f5d77c713993acf983629f5c86de1db0e073bb7b21889f0e936e32db6
|
7
|
+
data.tar.gz: 64c2e257fc51eaa15d4095b9e73c604fc260f90339d6676e9122751d666b37de932c3a93a1997454e1c52130ca98b3f01b8b94ece8a93010822b32eaa7fd030a
|
data/lib/hostlist_expression.rb
CHANGED
@@ -5,10 +5,9 @@
|
|
5
5
|
# Expand hostlist expression
|
6
6
|
#
|
7
7
|
# @param [ String ] expression A host list expression.
|
8
|
-
# @param [ String, Array<String> ] separator - Character(s) for separating ranges
|
8
|
+
# @param [ String, Array<String> ] separator - Character(s) for separating ranges.
|
9
9
|
#
|
10
10
|
# @example
|
11
|
-
#
|
12
11
|
# hostlist_expression("your-host-[1-3].com")
|
13
12
|
# # => ["your-host-1.com", "your-host-2.com", "your-host-3.com"]
|
14
13
|
#
|
@@ -55,7 +54,7 @@ def hostlist_expression(expression, separator = [":", "-"])
|
|
55
54
|
end
|
56
55
|
|
57
56
|
# Get lower and higher value of range
|
58
|
-
if range_items[0]
|
57
|
+
if range_items[0] < range_items[1]
|
59
58
|
from = range_items[0]
|
60
59
|
to = range_items[1]
|
61
60
|
else
|