business_time 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/business_time.rb +1 -0
- data/lib/business_time/config.rb +3 -3
- data/lib/business_time/version.rb +1 -1
- metadata +4 -4
data/lib/business_time.rb
CHANGED
data/lib/business_time/config.rb
CHANGED
@@ -20,11 +20,11 @@ module BusinessTime
|
|
20
20
|
private
|
21
21
|
|
22
22
|
def config
|
23
|
-
Thread.
|
23
|
+
Thread.main[:business_time_config] ||= default_config
|
24
24
|
end
|
25
25
|
|
26
26
|
def config=(config)
|
27
|
-
Thread.
|
27
|
+
Thread.main[:business_time_config] = config
|
28
28
|
end
|
29
29
|
|
30
30
|
def threadsafe_cattr_accessor(name)
|
@@ -76,7 +76,7 @@ module BusinessTime
|
|
76
76
|
def end_of_workday(day=nil)
|
77
77
|
if day
|
78
78
|
wday = work_hours[int_to_wday(day.wday)]
|
79
|
-
wday ? (wday.last =~
|
79
|
+
wday ? (wday.last =~ /^0{1,2}\:0{1,2}$/ ? "23:59:59" : wday.last) : config[:end_of_workday]
|
80
80
|
else
|
81
81
|
config[:end_of_workday]
|
82
82
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: business_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -145,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
segments:
|
147
147
|
- 0
|
148
|
-
hash:
|
148
|
+
hash: -1720097037897540308
|
149
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
segments:
|
156
156
|
- 0
|
157
|
-
hash:
|
157
|
+
hash: -1720097037897540308
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
160
|
rubygems_version: 1.8.23
|