rangeset 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ed783ca49b175b361e22d258fb1faa670c32d9d6
4
+ data.tar.gz: a023dad49f6a5ab51f0c85a9669f9c2968d88e22
5
+ SHA512:
6
+ metadata.gz: ffebc1315952fa74cc38b8031b337d39a35259b16ed63e8a989dd4bc336c86a0bc03335167a7eb7f2cf5ed2f28165a6eb1f747cba837191383dc52ddf2484515
7
+ data.tar.gz: 2efdc59c2fbec5e933f393a870b8207383d9b03b3be097cba5226f7cf49b647b1c55b18ce95e8c4671d8aaf15b55e46f600d6eafdcd2de40d16c99988084c949
@@ -15,6 +15,7 @@ class Range
15
15
  class << self
16
16
  # [only in left, in both, only in right]
17
17
  def diff(left, right)
18
+ return [left, nil, nil] unless right
18
19
  if left.is_a? RangeSet or right.is_a? RangeSet
19
20
  return RangeSet.diff left, right
20
21
  end
@@ -1,3 +1,3 @@
1
1
  class RangeSet
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -22,6 +22,12 @@ describe Range do
22
22
  describe '#diff' do
23
23
  subject { 30..40 }
24
24
 
25
+ context 'diff with nill' do
26
+ it do
27
+ subject.diff(nil).should == [30..40, nil, nil]
28
+ end
29
+ end
30
+
25
31
  context 'partial overlap' do
26
32
  let(:other) { 35..140 }
27
33
  it do
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rangeset
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.1.2
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Darrick Wiebe
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-19 00:00:00.000000000 Z
11
+ date: 2013-08-16 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Set operations on ranges and range sets
15
14
  email:
@@ -33,29 +32,26 @@ files:
33
32
  - spec/spec_helper.rb
34
33
  homepage: ''
35
34
  licenses: []
35
+ metadata: {}
36
36
  post_install_message:
37
37
  rdoc_options: []
38
38
  require_paths:
39
39
  - lib
40
40
  required_ruby_version: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ! '>='
42
+ - - '>='
43
43
  - !ruby/object:Gem::Version
44
- version: !binary |-
45
- MA==
46
- none: false
44
+ version: '0'
47
45
  required_rubygems_version: !ruby/object:Gem::Requirement
48
46
  requirements:
49
- - - ! '>='
47
+ - - '>='
50
48
  - !ruby/object:Gem::Version
51
- version: !binary |-
52
- MA==
53
- none: false
49
+ version: '0'
54
50
  requirements: []
55
51
  rubyforge_project:
56
- rubygems_version: 1.8.24
52
+ rubygems_version: 2.0.3
57
53
  signing_key:
58
- specification_version: 3
54
+ specification_version: 4
59
55
  summary: Set operations on ranges and range sets
60
56
  test_files:
61
57
  - spec/rangeset/range_set_spec.rb