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.
@@ -2,6 +2,7 @@ require 'thread'
2
2
  require 'active_support'
3
3
  require 'active_support/time'
4
4
  require 'time'
5
+ require 'yaml'
5
6
 
6
7
  require 'business_time/config'
7
8
  require 'business_time/business_hours'
@@ -20,11 +20,11 @@ module BusinessTime
20
20
  private
21
21
 
22
22
  def config
23
- Thread.current[:business_time_config] ||= default_config
23
+ Thread.main[:business_time_config] ||= default_config
24
24
  end
25
25
 
26
26
  def config=(config)
27
- Thread.current[:business_time_config] = config
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 =~ /0{1,2}\:0{1,2}/ ? "23:59:59" : wday.last) : config[:end_of_workday]
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
@@ -1,3 +1,3 @@
1
1
  module BusinessTime
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  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.2
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-03-26 00:00:00.000000000 Z
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: 2725720830618277021
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: 2725720830618277021
157
+ hash: -1720097037897540308
158
158
  requirements: []
159
159
  rubyforge_project:
160
160
  rubygems_version: 1.8.23