time_pieces 1.0.1 → 1.0.2

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: e1791332c5f1efc6b713256a97fd44ffe9e1fd34
4
- data.tar.gz: 94b4d44cc871502f3e7393d2763f489cf2f0f73b
3
+ metadata.gz: 7f7098f2d181bb8ebcfc57c72bf7048b173fdd43
4
+ data.tar.gz: c93566156f61614497bd3bff156f6f96b079464d
5
5
  SHA512:
6
- metadata.gz: d7bebe854157d7eb6e5efe58982e169df626cbc310a4ccb4442bd481c89bf3ef817be04f09959b4381d11d68e4253a084efe5589d3ae30df00db5f550f80250d
7
- data.tar.gz: 00c928f1ac5315a40d6cca259b86a9781f6289c1ee1ec3d5a7bb60f8cb32f2b481cfab84884661238083aeb1ea84b3354081d6aad1b264b04e492d353ccc2af6
6
+ metadata.gz: f7b5b6780294f08ba9172072da1de6f0f0564657fb624bea4754c852920a7046538c2b5d9a90de88c91a95276fffdc195f996fa969389ca4488fb2d1b2df2173
7
+ data.tar.gz: 83d42224dd9bc7eaf8d20df5529d19879d85cc360a1f5c437a683f1b16bc5065309636bd6264ecd1e8b167c9378a62b8b4bea89c3f1ad7f6793c48be27913e77
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- time_pieces (1.0.0)
4
+ time_pieces (1.0.1)
5
5
  bundler
6
6
 
7
7
  GEM
@@ -32,6 +32,9 @@ module TimePieces
32
32
  return true if (other_td.end_at_seconds > start_at_seconds) && (other_td.end_at_seconds <= end_at_seconds) && (other_td.start_at_seconds >= start_at_seconds) && (other_td.start_at_seconds < end_at_seconds)
33
33
  return false
34
34
  end
35
+ def inside_of?(other_td)
36
+ return true if (other_td.start_at_seconds < start_at_seconds) && (other_td.end_at_seconds > end_at_seconds)
37
+ end
35
38
  def overlaps_outside?(other_td)
36
39
  return other_td.overlaps_inside?(self)
37
40
  end
@@ -99,11 +102,13 @@ module TimePieces
99
102
  end
100
103
  def -(other_td)
101
104
  ts_ret = TimeSet.new
105
+ return ts_ret if inside_of?(other_td)
102
106
  unless overlaps?(other_td)
103
107
  ts_ret << self
104
108
  return ts_ret
105
109
  end
106
110
  if overlaps?(other_td)
111
+
107
112
  if overlaps_start?(other_td)
108
113
  update_start_seconds_and_end_seconds(other_td.end_at_seconds, end_at_seconds)
109
114
  ts_ret << self
@@ -1,3 +1,3 @@
1
1
  module TimePieces
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_pieces
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant R.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-18 00:00:00.000000000 Z
11
+ date: 2016-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,7 +83,6 @@ files:
83
83
  - lib/time_pieces/simple_duration.rb
84
84
  - lib/time_pieces/time_set.rb
85
85
  - lib/time_pieces/version.rb
86
- - pkg/time_pieces-1.0.0.gem
87
86
  - time_pieces.gemspec
88
87
  homepage: http://github.com/riggleg/time_pieces
89
88
  licenses:
Binary file