business_time 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +15 -3
- data/lib/business_time/business_days.rb +8 -8
- data/lib/business_time/config.rb +59 -23
- data/lib/{extensions → business_time/core_ext}/date.rb +0 -0
- data/lib/{extensions → business_time/core_ext}/fixnum.rb +0 -0
- data/lib/{extensions → business_time/core_ext}/time.rb +65 -21
- data/lib/business_time/version.rb +1 -1
- data/lib/business_time.rb +10 -8
- data/rails_generators/business_time_config/templates/business_time.rb +4 -3
- metadata +82 -110
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 85605515b3dfca0f7d48ed3ff03cabe4d0265930
|
4
|
+
data.tar.gz: f8637bacc2e3c19665a87484ad48c03056ec4a2e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 73a15a3b9fef741d3e095c451871ff3ca51287499a46518bc01c7a4536db5347c9a919c0c4c4bf12b5f98381e1efb8ee675ef3be3e61be9fe44dc68935a47df1
|
7
|
+
data.tar.gz: 2c3c0fb687cf7545e16d8315ed1d10dfe29c2bd3625b99f8c9226108bb22c5b9d693490089a4462b9cee839f28d0484c0e5989250245166e28370ae6352faddf
|
data/README.rdoc
CHANGED
@@ -78,6 +78,16 @@ I needed this, but taking into account business hours/days and holidays.
|
|
78
78
|
thursday_afternoon = Time.parse("July 8th, 2010, 4:50 pm")
|
79
79
|
sunday_morning = 1.business_hour.after(thursday_afternoon)
|
80
80
|
|
81
|
+
# as alternative we also can change the business hours for each work day:
|
82
|
+
BusinessTime::Config.work_hours = {
|
83
|
+
:mon=>["9:00","17:00"],
|
84
|
+
:fri=>["9:00","17:00"],
|
85
|
+
:sat=>["10:00","15:00"]
|
86
|
+
}
|
87
|
+
friday = Time.parse("December 24, 2010 15:00")
|
88
|
+
monday = Time.parse("December 27, 2010 11:00")
|
89
|
+
working_hours = friday.business_time_until(monday) # 9.hours
|
90
|
+
|
81
91
|
# you can also calculate business duration between two dates
|
82
92
|
friday = Date.parse("December 24, 2010")
|
83
93
|
monday = Date.parse("December 27, 2010")
|
@@ -133,10 +143,12 @@ This can lead to some wierd looking effects if, say, you are in the Eastern time
|
|
133
143
|
|
134
144
|
== Integration with the Holidays gem
|
135
145
|
|
136
|
-
Chris Wise wrote up a great article[http://murmurinfo.wordpress.com/2012/01/11/handling-holidays-and-business-hours/] on using the business_time gem with the holidays[https://github.com/
|
146
|
+
Chris Wise wrote up a great article[http://murmurinfo.wordpress.com/2012/01/11/handling-holidays-and-business-hours/] on using the business_time gem with the holidays[https://github.com/alexdunae/holidays] gem. It boils down to this:
|
137
147
|
|
138
148
|
Holidays.between(Date.civil(2011, 1, 1), 2.years.from_now, :ca_on, :o bserved).map{|holiday| BusinessTime::Config.holidays << holiday[:date]}
|
139
149
|
|
150
|
+
== Releases
|
151
|
+
0.6.2 - rchady pointed out that issue #14 didn't appear to be released. This fixes that, as well as confirms that all tests run as expected on Ruby 2.0.0p195
|
140
152
|
|
141
153
|
== Contributors
|
142
154
|
* David Bock http://github.com/bokmann
|
@@ -160,7 +172,7 @@ This can lead to some wierd looking effects if, say, you are in the Eastern time
|
|
160
172
|
== TODO
|
161
173
|
|
162
174
|
* Arild has pointed out that there may be some logical inconsistencies
|
163
|
-
|
175
|
+
regarding the beginning_of_workday and end_of workday times not actually
|
164
176
|
being considered inside of the workday. I'd like to make sure that they
|
165
177
|
work as if the beginning_of_workday is included and the end_of_workday is
|
166
178
|
not included, just like the '...' range operator in Ruby.
|
@@ -177,4 +189,4 @@ This can lead to some wierd looking effects if, say, you are in the Eastern time
|
|
177
189
|
|
178
190
|
== Copyright
|
179
191
|
|
180
|
-
Copyright (c) 2010,2011,2012 bokmann. See LICENSE for details.
|
192
|
+
Copyright (c) 2010,2011,2012,2013 bokmann. See LICENSE for details.
|
@@ -9,10 +9,10 @@ module BusinessTime
|
|
9
9
|
|
10
10
|
def after(time = Time.now)
|
11
11
|
time = Time.zone ? Time.zone.parse(time.to_s) : Time.parse(time.to_s)
|
12
|
-
@days
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
days = @days
|
13
|
+
while days > 0 || !Time.workday?(time)
|
14
|
+
days -= 1 if Time.workday?(time)
|
15
|
+
time = time + 1.day
|
16
16
|
end
|
17
17
|
time
|
18
18
|
end
|
@@ -22,10 +22,10 @@ module BusinessTime
|
|
22
22
|
|
23
23
|
def before(time = Time.now)
|
24
24
|
time = Time.zone ? Time.zone.parse(time.to_s) : Time.parse(time.to_s)
|
25
|
-
@days
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
days = @days
|
26
|
+
while days > 0 || !Time.workday?(time)
|
27
|
+
days -= 1 if Time.workday?(time)
|
28
|
+
time = time - 1.day
|
29
29
|
end
|
30
30
|
time
|
31
31
|
end
|
data/lib/business_time/config.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'active_support/core_ext'
|
2
2
|
|
3
3
|
module BusinessTime
|
4
|
-
|
4
|
+
|
5
5
|
# controls the behavior of this gem. You can change
|
6
6
|
# the beginning_of_workday, end_of_workday, and the list of holidays
|
7
7
|
# manually, or with a yaml file and the load method.
|
@@ -12,51 +12,83 @@ module BusinessTime
|
|
12
12
|
# BusinessTime::Config.beginning_of_workday = "8:30 am"
|
13
13
|
# someplace in the initializers of your application.
|
14
14
|
attr_accessor :beginning_of_workday
|
15
|
-
|
15
|
+
|
16
16
|
# You can set this yourself, either by the load method below, or
|
17
17
|
# by saying
|
18
18
|
# BusinessTime::Config.end_of_workday = "5:30 pm"
|
19
19
|
# someplace in the initializers of your application.
|
20
20
|
attr_accessor :end_of_workday
|
21
|
-
|
21
|
+
|
22
22
|
# You can set this yourself, either by the load method below, or
|
23
23
|
# by saying
|
24
24
|
# BusinessTime::Config.work_week = [:sun, :mon, :tue, :wed, :thu]
|
25
25
|
# someplace in the initializers of your application.
|
26
26
|
attr_accessor :work_week
|
27
|
-
|
27
|
+
|
28
28
|
# You can set this yourself, either by the load method below, or
|
29
29
|
# by saying
|
30
30
|
# BusinessTime::Config.holidays << my_holiday_date_object
|
31
31
|
# someplace in the initializers of your application.
|
32
32
|
attr_accessor :holidays
|
33
33
|
|
34
|
+
# working hours for each day - if not set using global variables :beginning_of_workday
|
35
|
+
# and end_of_workday. Keys will be added ad weekdays.
|
36
|
+
# Example:
|
37
|
+
# {:mon => ["9:00","17:00"],:tue => ["9:00","17:00"].....}
|
38
|
+
attr_accessor :work_hours
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.end_of_workday(day=nil)
|
43
|
+
if day
|
44
|
+
wday = @work_hours[self.int_to_wday(day.wday)]
|
45
|
+
wday ? (wday.last =~ /0{1,2}\:0{1,2}/ ? "23:59:59" : wday.last) : @end_of_workday
|
46
|
+
else
|
47
|
+
@end_of_workday
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.beginning_of_workday(day=nil)
|
52
|
+
if day
|
53
|
+
wday = @work_hours[self.int_to_wday(day.wday)]
|
54
|
+
wday ? wday.first : @beginning_of_workday
|
55
|
+
else
|
56
|
+
@beginning_of_workday
|
57
|
+
end
|
34
58
|
end
|
35
|
-
|
59
|
+
|
36
60
|
def self.work_week=(days)
|
37
61
|
@work_week = days
|
38
62
|
@weekdays = nil
|
39
63
|
end
|
40
|
-
|
64
|
+
|
41
65
|
def self.weekdays
|
42
66
|
return @weekdays unless @weekdays.nil?
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
@weekdays = work_week.each_with_object([]) do |day_name, days|
|
47
|
-
day_num = lowercase_day_names.find_index(day_name.to_s.downcase)
|
67
|
+
|
68
|
+
@weekdays = (!work_hours.empty? ? work_hours.keys : work_week).each_with_object([]) do |day_name, days|
|
69
|
+
day_num = self.wday_to_int(day_name)
|
48
70
|
days << day_num unless day_num.nil?
|
49
71
|
end
|
50
72
|
end
|
51
|
-
|
73
|
+
|
74
|
+
def self.wday_to_int day_name
|
75
|
+
lowercase_day_names = ::Time::RFC2822_DAY_NAME.map(&:downcase)
|
76
|
+
lowercase_day_names.find_index(day_name.to_s.downcase)
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.int_to_wday num
|
80
|
+
::Time::RFC2822_DAY_NAME.map(&:downcase).map(&:to_sym)[num]
|
81
|
+
end
|
82
|
+
|
52
83
|
def self.reset
|
53
84
|
self.holidays = []
|
54
85
|
self.beginning_of_workday = "9:00 am"
|
55
86
|
self.end_of_workday = "5:00 pm"
|
56
87
|
self.work_week = %w[mon tue wed thu fri]
|
88
|
+
self.work_hours = {}
|
57
89
|
@weekdays = nil
|
58
90
|
end
|
59
|
-
|
91
|
+
|
60
92
|
# loads the config data from a yaml file written as:
|
61
93
|
#
|
62
94
|
# business_time:
|
@@ -66,20 +98,24 @@ module BusinessTime
|
|
66
98
|
# - Jan 1st, 2010
|
67
99
|
# - July 4th, 2010
|
68
100
|
# - Dec 25th, 2010
|
69
|
-
def self.load(
|
101
|
+
def self.load(file)
|
70
102
|
self.reset
|
71
|
-
data = YAML::load(File.open(
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
103
|
+
data = YAML::load(file.respond_to?(:read) ? file : File.open(file))
|
104
|
+
config = (data["business_time"] || {})
|
105
|
+
|
106
|
+
# load each config variable from the file, if it's present and valid
|
107
|
+
config_vars = %w(beginning_of_workday end_of_workday work_week work_hours)
|
108
|
+
config_vars.each do |var|
|
109
|
+
send("#{var}=", config[var]) if config[var] && respond_to?("#{var}=")
|
110
|
+
end
|
111
|
+
|
112
|
+
(config["holidays"] || []).each do |holiday|
|
113
|
+
self.holidays << Date.parse(holiday)
|
77
114
|
end
|
78
|
-
|
79
115
|
end
|
80
|
-
|
116
|
+
|
81
117
|
#reset the first time we are loaded.
|
82
118
|
self.reset
|
83
119
|
end
|
84
|
-
|
120
|
+
|
85
121
|
end
|
File without changes
|
File without changes
|
@@ -7,9 +7,8 @@ class Time
|
|
7
7
|
# Note: It pretends that this day is a workday whether or not it really is a
|
8
8
|
# workday.
|
9
9
|
def end_of_workday(day)
|
10
|
-
|
11
|
-
|
12
|
-
Time.parse(day.strftime(format))
|
10
|
+
end_of_workday = Time.parse(BusinessTime::Config.end_of_workday(day))
|
11
|
+
change_time(day,end_of_workday.hour,end_of_workday.min,end_of_workday.sec)
|
13
12
|
end
|
14
13
|
|
15
14
|
# Gives the time at the beginning of the workday, assuming that this time
|
@@ -17,9 +16,8 @@ class Time
|
|
17
16
|
# Note: It pretends that this day is a workday whether or not it really is a
|
18
17
|
# workday.
|
19
18
|
def beginning_of_workday(day)
|
20
|
-
|
21
|
-
|
22
|
-
Time.parse(day.strftime(format))
|
19
|
+
beginning_of_workday = Time.parse(BusinessTime::Config.beginning_of_workday(day))
|
20
|
+
change_time(day,beginning_of_workday.hour,beginning_of_workday.min,beginning_of_workday.sec)
|
23
21
|
end
|
24
22
|
|
25
23
|
# True if this time is on a workday (between 00:00:00 and 23:59:59), even if
|
@@ -35,11 +33,11 @@ class Time
|
|
35
33
|
end
|
36
34
|
|
37
35
|
def before_business_hours?(time)
|
38
|
-
time < beginning_of_workday(time)
|
36
|
+
time.to_i < beginning_of_workday(time).to_i
|
39
37
|
end
|
40
38
|
|
41
39
|
def after_business_hours?(time)
|
42
|
-
time > end_of_workday(time)
|
40
|
+
time.to_i > end_of_workday(time).to_i
|
43
41
|
end
|
44
42
|
|
45
43
|
# Rolls forward to the next beginning_of_workday
|
@@ -48,19 +46,48 @@ class Time
|
|
48
46
|
|
49
47
|
if (Time.before_business_hours?(time) || !Time.workday?(time))
|
50
48
|
next_business_time = Time.beginning_of_workday(time)
|
51
|
-
elsif Time.after_business_hours?(time)
|
52
|
-
next_business_time = Time.beginning_of_workday(time
|
49
|
+
elsif Time.after_business_hours?(time) || Time.end_of_workday(time) == time
|
50
|
+
next_business_time = Time.beginning_of_workday(time + 1.day)
|
53
51
|
else
|
54
52
|
next_business_time = time.clone
|
55
53
|
end
|
56
54
|
|
57
55
|
while !Time.workday?(next_business_time)
|
58
|
-
next_business_time
|
56
|
+
next_business_time = Time.beginning_of_workday(next_business_time + 1.day)
|
59
57
|
end
|
60
58
|
|
61
59
|
next_business_time
|
62
60
|
end
|
63
61
|
|
62
|
+
# Rolls backwards to the previous end_of_workday when the time is outside
|
63
|
+
# of business hours
|
64
|
+
def roll_backward(time)
|
65
|
+
if (Time.before_business_hours?(time) || !Time.workday?(time))
|
66
|
+
prev_business_time = Time.end_of_workday(time) - 1.day
|
67
|
+
elsif Time.after_business_hours?(time)
|
68
|
+
prev_business_time = Time.end_of_workday(time)
|
69
|
+
else
|
70
|
+
prev_business_time = time.clone
|
71
|
+
end
|
72
|
+
|
73
|
+
while !Time.workday?(prev_business_time)
|
74
|
+
prev_business_time -= 1.day
|
75
|
+
end
|
76
|
+
|
77
|
+
prev_business_time
|
78
|
+
end
|
79
|
+
|
80
|
+
private
|
81
|
+
|
82
|
+
def change_time time, hour, min=0, sec=0
|
83
|
+
if Time.zone
|
84
|
+
time.in_time_zone(Time.zone).change(:hour => hour, :min => min, :sec => sec)
|
85
|
+
else
|
86
|
+
time.change(:hour => hour, :min => min, :sec => sec)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
|
64
91
|
end
|
65
92
|
end
|
66
93
|
|
@@ -78,27 +105,44 @@ class Time
|
|
78
105
|
time_b = self
|
79
106
|
direction = -1
|
80
107
|
end
|
81
|
-
|
108
|
+
|
82
109
|
# Align both times to the closest business hours
|
83
110
|
time_a = Time::roll_forward(time_a)
|
84
111
|
time_b = Time::roll_forward(time_b)
|
85
|
-
|
112
|
+
|
86
113
|
# If same date, then calculate difference straight forward
|
87
114
|
if time_a.to_date == time_b.to_date
|
88
115
|
result = time_b - time_a
|
89
116
|
return result *= direction
|
90
117
|
end
|
91
|
-
|
118
|
+
|
92
119
|
# Both times are in different dates
|
93
|
-
result = Time.parse(time_a.strftime('%Y-%m-%d ') + BusinessTime::Config.end_of_workday) - time_a # First day
|
94
|
-
result += time_b - Time.parse(time_b.strftime('%Y-%m-%d ') + BusinessTime::Config.beginning_of_workday) # Last day
|
95
|
-
|
120
|
+
#result = Time.parse(time_a.strftime('%Y-%m-%d ') + BusinessTime::Config.end_of_workday) - time_a # First day
|
121
|
+
#result += time_b - Time.parse(time_b.strftime('%Y-%m-%d ') + BusinessTime::Config.beginning_of_workday) # Last day
|
122
|
+
|
123
|
+
result = 0
|
124
|
+
|
96
125
|
# All days in between
|
97
|
-
|
98
|
-
|
99
|
-
|
126
|
+
time_c = time_a
|
127
|
+
while time_c.to_i < time_b.to_i do
|
128
|
+
end_of_workday = Time.end_of_workday(time_c)
|
129
|
+
if time_c.to_date == time_b.to_date
|
130
|
+
if end_of_workday < time_b
|
131
|
+
result += end_of_workday - time_c
|
132
|
+
break
|
133
|
+
else
|
134
|
+
result += time_b - time_c
|
135
|
+
break
|
136
|
+
end
|
137
|
+
else
|
138
|
+
result += end_of_workday - time_c
|
139
|
+
time_c = Time::roll_forward(end_of_workday)
|
140
|
+
end
|
141
|
+
result += 1 if end_of_workday.to_s =~ /23:59:59/
|
142
|
+
end
|
143
|
+
|
100
144
|
# Make sure that sign is correct
|
101
145
|
result *= direction
|
102
146
|
end
|
103
147
|
|
104
|
-
end
|
148
|
+
end
|
data/lib/business_time.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
require 'thread'
|
2
|
-
require
|
2
|
+
require 'active_support'
|
3
3
|
require 'active_support/time'
|
4
|
-
require
|
5
|
-
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
4
|
+
require 'time'
|
5
|
+
|
6
|
+
require 'business_time/config'
|
7
|
+
require 'business_time/business_hours'
|
8
|
+
require 'business_time/business_days'
|
9
|
+
require 'business_time/core_ext/date'
|
10
|
+
require 'business_time/core_ext/time'
|
11
|
+
require 'business_time/core_ext/fixnum'
|
12
|
+
|
@@ -1,6 +1,7 @@
|
|
1
1
|
BusinessTime::Config.load("#{Rails.root}/config/business_time.yml")
|
2
2
|
|
3
|
-
# or you can configure it manually: look at me! I'm Tim
|
3
|
+
# or you can configure it manually: look at me! I'm Tim Ferriss!
|
4
4
|
# BusinessTime.Config.beginning_of_workday = "10:00 am"
|
5
|
-
# BusinessTime.
|
6
|
-
# BusinessTime.
|
5
|
+
# BusinessTime.Config.end_of_workday = "11:30 am"
|
6
|
+
# BusinessTime.Config.holidays << Date.parse("August 4th, 2010")
|
7
|
+
|
metadata
CHANGED
@@ -1,155 +1,127 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: business_time
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 6
|
9
|
-
- 1
|
10
|
-
version: 0.6.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.2
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- bokmann
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-08-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: activesupport
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 3
|
32
|
-
- 1
|
33
|
-
- 0
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
34
19
|
version: 3.1.0
|
35
20
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: tzinfo
|
39
21
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tzinfo
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
43
31
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 45
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 3
|
49
|
-
- 31
|
32
|
+
- !ruby/object:Gem::Version
|
50
33
|
version: 0.3.31
|
51
34
|
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: rake
|
55
35
|
prerelease: false
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.3.31
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
66
47
|
version: 0.9.2
|
67
48
|
type: :development
|
68
|
-
version_requirements: *id003
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: shoulda
|
71
49
|
prerelease: false
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.9.2
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
81
62
|
type: :development
|
82
|
-
version_requirements: *id004
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rdoc
|
85
63
|
prerelease: false
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rdoc
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
95
76
|
type: :development
|
96
|
-
|
97
|
-
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Have you ever wanted to do things like "6.business_days.from_now" and
|
84
|
+
have weekends and holidays taken into account? Now you can.
|
98
85
|
email: dbock@codesherpas.com
|
99
86
|
executables: []
|
100
|
-
|
101
87
|
extensions: []
|
102
|
-
|
103
88
|
extra_rdoc_files: []
|
104
|
-
|
105
|
-
files:
|
89
|
+
files:
|
106
90
|
- LICENSE
|
107
91
|
- README.rdoc
|
108
92
|
- lib/business_time.rb
|
109
93
|
- lib/business_time/business_days.rb
|
110
94
|
- lib/business_time/business_hours.rb
|
111
95
|
- lib/business_time/config.rb
|
96
|
+
- lib/business_time/core_ext/date.rb
|
97
|
+
- lib/business_time/core_ext/fixnum.rb
|
98
|
+
- lib/business_time/core_ext/time.rb
|
112
99
|
- lib/business_time/version.rb
|
113
|
-
- lib/extensions/date.rb
|
114
|
-
- lib/extensions/fixnum.rb
|
115
|
-
- lib/extensions/time.rb
|
116
100
|
- lib/generators/business_time/config_generator.rb
|
117
101
|
- rails_generators/business_time_config/business_time_config_generator.rb
|
118
102
|
- rails_generators/business_time_config/templates/business_time.rb
|
119
103
|
- rails_generators/business_time_config/templates/business_time.yml
|
120
|
-
has_rdoc: true
|
121
104
|
homepage: http://github.com/bokmann/business_time
|
122
105
|
licenses: []
|
123
|
-
|
106
|
+
metadata: {}
|
124
107
|
post_install_message:
|
125
108
|
rdoc_options: []
|
126
|
-
|
127
|
-
require_paths:
|
109
|
+
require_paths:
|
128
110
|
- lib
|
129
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
none: false
|
140
|
-
requirements:
|
141
|
-
- - ">="
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
hash: 3
|
144
|
-
segments:
|
145
|
-
- 0
|
146
|
-
version: "0"
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - '>='
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
147
121
|
requirements: []
|
148
|
-
|
149
122
|
rubyforge_project:
|
150
|
-
rubygems_version:
|
123
|
+
rubygems_version: 2.0.2
|
151
124
|
signing_key:
|
152
|
-
specification_version:
|
125
|
+
specification_version: 4
|
153
126
|
summary: Support for doing time math in business hours and days
|
154
127
|
test_files: []
|
155
|
-
|