semantic_range 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ec6ed6422a8b1100e9b8fa2f556a6353150b8c5
4
- data.tar.gz: 4ce568684c4f9445a11b84da2ad46bf5641eae43
3
+ metadata.gz: 40689a4a60d1676915d3c80166fa016fed599e9e
4
+ data.tar.gz: a6797c03b699280fbb46196f83b6b9d29de102e3
5
5
  SHA512:
6
- metadata.gz: 6d98c96a9411e9ee4887f16ae2d856668cc19f3c296a2316380e60c4e51236afdf3b20a4271a30cfdbd2184dce0f891ab3c4871d58a82a38b0a54d43a90bef7d
7
- data.tar.gz: 9d0d40922cc914d970daa88f7e89e1977d0fe65e83f6872491b31ee80c21324b89856265078690ed195d7e35a895837103b96f73cbf7464ebcfcb736065b96a1
6
+ metadata.gz: 227c788ef4eab62cb0458ce01d21d31e392f17d5b5eba966d9269cd14d2e8a669d5d9df99d9afad7da4c08525f10729768a13a45ee22e6d5ed30f7af68db2da1
7
+ data.tar.gz: 8de84d61c1823fddc13d53ce579e5838289675c7e3f8cac392ab9ea479bdc25b16dd7d79a445e0f956be1ecb94f035ca97e074b1a4e530bf45f55c6aa33682bb
@@ -6,6 +6,7 @@ module SemanticRange
6
6
  @raw = range
7
7
  @loose = loose
8
8
  split = range.split(/\s*\|\|\s*/)
9
+ split = ['', ''] if range == '||'
9
10
  split = [''] if split == []
10
11
  @set = split.map do |range|
11
12
  parse_range(range.strip)
@@ -24,6 +25,10 @@ module SemanticRange
24
25
  @raw
25
26
  end
26
27
 
28
+ def range
29
+ @range
30
+ end
31
+
27
32
  def format
28
33
  @range = @set.map do |comps|
29
34
  comps.join(' ').strip
@@ -1,5 +1,5 @@
1
1
  module SemanticRange
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
 
4
4
  class Version
5
5
  def initialize(version, loose)
@@ -152,7 +152,9 @@ module SemanticRange
152
152
 
153
153
  def self.valid_range(range, loose = false)
154
154
  begin
155
- Range.new(range, loose).range || '*'
155
+ r = Range.new(range, loose).range
156
+ r = '*' if r.nil? || r.empty?
157
+ r
156
158
  rescue
157
159
  nil
158
160
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_range
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt