business_time 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +7 -0
- data/lib/business_time/config.rb +19 -7
- data/lib/business_time/version.rb +1 -1
- metadata +8 -8
data/README.rdoc
CHANGED
@@ -142,6 +142,13 @@ I'm hoping Arild and I write some good blog entries on the subject at http://blo
|
|
142
142
|
end
|
143
143
|
|
144
144
|
== Releases
|
145
|
+
|
146
|
+
0.7.1 - fixing a multithreaded issue, upgrading some dependencies, loosening the dependency on TZInfo
|
147
|
+
|
148
|
+
0.7.0 - major maintenance upgrade on the process of constructing the gem, testing the gem, and updating dependencies.
|
149
|
+
the api has not changed.
|
150
|
+
|
151
|
+
|
145
152
|
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
|
146
153
|
|
147
154
|
== Contributors
|
data/lib/business_time/config.rb
CHANGED
@@ -6,11 +6,20 @@ module BusinessTime
|
|
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.
|
8
8
|
class Config
|
9
|
+
DEFAULT_CONFIG = {
|
10
|
+
holidays: [],
|
11
|
+
beginning_of_workday: '9:00 am',
|
12
|
+
end_of_workday: '5:00 pm',
|
13
|
+
work_week: %w(mon tue wed thu fri),
|
14
|
+
work_hours: {},
|
15
|
+
_weekdays: nil,
|
16
|
+
}
|
17
|
+
|
9
18
|
class << self
|
10
19
|
private
|
11
20
|
|
12
21
|
def config
|
13
|
-
Thread.current[:business_time_config] ||=
|
22
|
+
Thread.current[:business_time_config] ||= default_config
|
14
23
|
end
|
15
24
|
|
16
25
|
def config=(config)
|
@@ -125,6 +134,10 @@ module BusinessTime
|
|
125
134
|
self.config = old
|
126
135
|
end
|
127
136
|
|
137
|
+
def default_config
|
138
|
+
deep_dup(DEFAULT_CONFIG)
|
139
|
+
end
|
140
|
+
|
128
141
|
private
|
129
142
|
|
130
143
|
def wday_to_int day_name
|
@@ -137,12 +150,11 @@ module BusinessTime
|
|
137
150
|
end
|
138
151
|
|
139
152
|
def reset
|
140
|
-
self.
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
self._weekdays = nil
|
153
|
+
self.config = default_config
|
154
|
+
end
|
155
|
+
|
156
|
+
def deep_dup(object)
|
157
|
+
Marshal.load(Marshal.dump(object))
|
146
158
|
end
|
147
159
|
end
|
148
160
|
|
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.1
|
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-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -32,17 +32,17 @@ dependencies:
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: '0'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: '0'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: rake
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
segments:
|
145
145
|
- 0
|
146
|
-
hash:
|
146
|
+
hash: -4140664876774747293
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
none: false
|
149
149
|
requirements:
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
segments:
|
154
154
|
- 0
|
155
|
-
hash:
|
155
|
+
hash: -4140664876774747293
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
158
|
rubygems_version: 1.8.23
|