time_clock 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/time_clock/business_time_until.rb +15 -0
- data/lib/time_clock/core_ext/time.rb +2 -14
- data/lib/time_clock/core_ext/time_with_zone.rb +3 -0
- data/lib/time_clock/version.rb +1 -1
- data/lib/time_clock.rb +2 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a39c9a2a4373b615a534f862ca1ac2da09124c2a
|
4
|
+
data.tar.gz: d0b2c40de9287b35f4aeed267fdb0c40f3bb73ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c26555cb8e3cfc1fc800e727115cfb41d840bf5784783a1d3d0a1485f79614906172aff8b61c8c0ca16ffd35aa759160e6c0e4c80df50355cc97243d016a9f6d
|
7
|
+
data.tar.gz: 01edb495fd7e2f6833210c6be9fecb5c275a8d45db457dd18785c777762f314b507435d9b09a8f0fceb5d16abeab0bfb13af03d62cf93634160111f89687eb61
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module TimeClock
|
2
|
+
module BusinessTimeUntil
|
3
|
+
def business_seconds_until(time)
|
4
|
+
TimeClock::Comparison.new(self, time).seconds.to_i
|
5
|
+
end
|
6
|
+
|
7
|
+
def business_minutes_until(time)
|
8
|
+
(business_seconds_until(time).to_f / 60).ceil
|
9
|
+
end
|
10
|
+
|
11
|
+
def business_hours_until(time)
|
12
|
+
(business_seconds_until(time).to_f / 3600).ceil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,15 +1,3 @@
|
|
1
1
|
class Time
|
2
|
-
|
3
|
-
|
4
|
-
TimeClock::Comparison.new(self.to_time, time).seconds.to_i
|
5
|
-
end
|
6
|
-
|
7
|
-
def business_minutes_until(time)
|
8
|
-
(business_seconds_until(time).to_f / 60).ceil
|
9
|
-
end
|
10
|
-
|
11
|
-
def business_hours_until(time)
|
12
|
-
(business_seconds_until(time).to_f / 3600).ceil
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
2
|
+
include TimeClock::BusinessTimeUntil
|
3
|
+
end
|
data/lib/time_clock/version.rb
CHANGED
data/lib/time_clock.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time_clock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- barelyknown
|
@@ -123,9 +123,11 @@ files:
|
|
123
123
|
- README.md
|
124
124
|
- Rakefile
|
125
125
|
- lib/time_clock.rb
|
126
|
+
- lib/time_clock/business_time_until.rb
|
126
127
|
- lib/time_clock/calendar.rb
|
127
128
|
- lib/time_clock/comparison.rb
|
128
129
|
- lib/time_clock/core_ext/time.rb
|
130
|
+
- lib/time_clock/core_ext/time_with_zone.rb
|
129
131
|
- lib/time_clock/shift.rb
|
130
132
|
- lib/time_clock/version.rb
|
131
133
|
- spec/lib/time_clock/calendar_spec.rb
|