biz 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/biz/configuration.rb +0 -2
- data/lib/biz/core_ext/date.rb +0 -2
- data/lib/biz/core_ext/fixnum.rb +0 -2
- data/lib/biz/core_ext/time.rb +0 -2
- data/lib/biz/day_time.rb +0 -2
- data/lib/biz/periods.rb +2 -18
- data/lib/biz/periods/abstract.rb +2 -2
- data/lib/biz/periods/after.rb +1 -1
- data/lib/biz/periods/before.rb +1 -1
- data/lib/biz/periods/proxy.rb +23 -0
- data/lib/biz/schedule.rb +1 -1
- data/lib/biz/timeline.rb +2 -18
- data/lib/biz/timeline/abstract.rb +1 -1
- data/lib/biz/timeline/backward.rb +1 -1
- data/lib/biz/timeline/forward.rb +1 -1
- data/lib/biz/timeline/proxy.rb +23 -0
- data/lib/biz/version.rb +1 -3
- data/lib/biz/week_time/abstract.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e58755b16da3f9c2c9de70bcc5936254292f7a0b
|
4
|
+
data.tar.gz: 91739dad8b667cdd079e87b4f4cadf67b01f53cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 727209e4febee006be3c79846a4e577f4c14ca2b942cf7cc1e5fcb9cb7fc8e34e4f16fad8128eb8485abd43b5e48db5cb44214d49e616c07272775ff27a3cbfe
|
7
|
+
data.tar.gz: 357bc50b2a8411d2516bbf0bedb5dc3b9535fc9a81677f0d67303a8e276bfa15f9adc738f7c05ecb5f3bf1b68d41ea3640bc984f9673ba49d5ad8d89a098ca4a
|
data/lib/biz/configuration.rb
CHANGED
@@ -53,7 +53,6 @@ module Biz
|
|
53
53
|
|
54
54
|
Raw = Struct.new(:hours, :holidays, :time_zone) do
|
55
55
|
module Default
|
56
|
-
|
57
56
|
HOURS = {
|
58
57
|
mon: {'09:00' => '17:00'},
|
59
58
|
tue: {'09:00' => '17:00'},
|
@@ -63,7 +62,6 @@ module Biz
|
|
63
62
|
}
|
64
63
|
HOLIDAYS = []
|
65
64
|
TIME_ZONE = 'Etc/UTC'
|
66
|
-
|
67
65
|
end
|
68
66
|
|
69
67
|
def initialize(*)
|
data/lib/biz/core_ext/date.rb
CHANGED
data/lib/biz/core_ext/fixnum.rb
CHANGED
data/lib/biz/core_ext/time.rb
CHANGED
data/lib/biz/day_time.rb
CHANGED
data/lib/biz/periods.rb
CHANGED
@@ -1,22 +1,5 @@
|
|
1
1
|
module Biz
|
2
|
-
|
3
|
-
|
4
|
-
def initialize(schedule)
|
5
|
-
@schedule = schedule
|
6
|
-
end
|
7
|
-
|
8
|
-
def after(origin)
|
9
|
-
After.new(schedule, origin)
|
10
|
-
end
|
11
|
-
|
12
|
-
def before(origin)
|
13
|
-
Before.new(schedule, origin)
|
14
|
-
end
|
15
|
-
|
16
|
-
protected
|
17
|
-
|
18
|
-
attr_reader :schedule
|
19
|
-
|
2
|
+
module Periods
|
20
3
|
end
|
21
4
|
end
|
22
5
|
|
@@ -24,3 +7,4 @@ require 'biz/periods/abstract'
|
|
24
7
|
|
25
8
|
require 'biz/periods/after'
|
26
9
|
require 'biz/periods/before'
|
10
|
+
require 'biz/periods/proxy'
|
data/lib/biz/periods/abstract.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Biz
|
2
|
-
|
2
|
+
module Periods
|
3
3
|
class Abstract < Enumerator::Lazy
|
4
4
|
|
5
5
|
extend Forwardable
|
@@ -14,7 +14,7 @@ module Biz
|
|
14
14
|
delegate time_zone: :schedule
|
15
15
|
|
16
16
|
def timeline
|
17
|
-
Timeline.new(self)
|
17
|
+
Timeline::Proxy.new(self)
|
18
18
|
end
|
19
19
|
|
20
20
|
protected
|
data/lib/biz/periods/after.rb
CHANGED
data/lib/biz/periods/before.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Biz
|
2
|
+
module Periods
|
3
|
+
class Proxy
|
4
|
+
|
5
|
+
def initialize(schedule)
|
6
|
+
@schedule = schedule
|
7
|
+
end
|
8
|
+
|
9
|
+
def after(origin)
|
10
|
+
After.new(schedule, origin)
|
11
|
+
end
|
12
|
+
|
13
|
+
def before(origin)
|
14
|
+
Before.new(schedule, origin)
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
attr_reader :schedule
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/biz/schedule.rb
CHANGED
data/lib/biz/timeline.rb
CHANGED
@@ -1,22 +1,5 @@
|
|
1
1
|
module Biz
|
2
|
-
|
3
|
-
|
4
|
-
def initialize(periods)
|
5
|
-
@periods = periods
|
6
|
-
end
|
7
|
-
|
8
|
-
def forward
|
9
|
-
Forward.new(periods)
|
10
|
-
end
|
11
|
-
|
12
|
-
def backward
|
13
|
-
Backward.new(periods)
|
14
|
-
end
|
15
|
-
|
16
|
-
protected
|
17
|
-
|
18
|
-
attr_reader :periods
|
19
|
-
|
2
|
+
module Timeline
|
20
3
|
end
|
21
4
|
end
|
22
5
|
|
@@ -24,3 +7,4 @@ require 'biz/timeline/abstract'
|
|
24
7
|
|
25
8
|
require 'biz/timeline/forward'
|
26
9
|
require 'biz/timeline/backward'
|
10
|
+
require 'biz/timeline/proxy'
|
data/lib/biz/timeline/forward.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Biz
|
2
|
+
module Timeline
|
3
|
+
class Proxy
|
4
|
+
|
5
|
+
def initialize(periods)
|
6
|
+
@periods = periods
|
7
|
+
end
|
8
|
+
|
9
|
+
def forward
|
10
|
+
Forward.new(periods)
|
11
|
+
end
|
12
|
+
|
13
|
+
def backward
|
14
|
+
Backward.new(periods)
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
attr_reader :periods
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/biz/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig Little
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: abstract_type
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- lib/biz/periods/abstract.rb
|
141
141
|
- lib/biz/periods/after.rb
|
142
142
|
- lib/biz/periods/before.rb
|
143
|
+
- lib/biz/periods/proxy.rb
|
143
144
|
- lib/biz/schedule.rb
|
144
145
|
- lib/biz/time.rb
|
145
146
|
- lib/biz/time_segment.rb
|
@@ -147,6 +148,7 @@ files:
|
|
147
148
|
- lib/biz/timeline/abstract.rb
|
148
149
|
- lib/biz/timeline/backward.rb
|
149
150
|
- lib/biz/timeline/forward.rb
|
151
|
+
- lib/biz/timeline/proxy.rb
|
150
152
|
- lib/biz/version.rb
|
151
153
|
- lib/biz/week.rb
|
152
154
|
- lib/biz/week_time.rb
|