uk_working_days 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/uk_working_days.rb +2 -1
- data/lib/uk_working_days/date_extensions.rb +1 -0
- data/test/test_uk_working_days.rb +10 -0
- metadata +10 -15
- data/.gitignore +0 -21
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/lib/uk_working_days.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'date'
|
2
2
|
require 'active_support/core_ext/date/conversions'
|
3
|
-
require 'active_support/core_ext/
|
3
|
+
require 'active_support/core_ext/date/calculations'
|
4
|
+
require 'active_support/core_ext/date/acts_like'
|
4
5
|
require 'active_support/core_ext/numeric/time'
|
5
6
|
require File.dirname(__FILE__) + '/uk_working_days/easter'
|
6
7
|
require File.dirname(__FILE__) + '/uk_working_days/date_extensions'
|
@@ -45,6 +45,16 @@ class TestUkWorkingDays < Test::Unit::TestCase
|
|
45
45
|
assert_equal Date.new(2010, 3, 31), Date.new(2010, 4, 1).previous_working_day
|
46
46
|
assert_equal Time.local(2010, 3, 31), Time.local(2010, 4, 1).previous_working_day
|
47
47
|
end
|
48
|
+
|
49
|
+
should "return self when passing 0 to #next_working_day or #previous_working_day" do
|
50
|
+
date, time = Date.today, Time.now
|
51
|
+
|
52
|
+
assert_equal date, date.next_working_day(0)
|
53
|
+
assert_equal time, time.next_working_day(0)
|
54
|
+
|
55
|
+
assert_equal date, date.previous_working_day(0)
|
56
|
+
assert_equal time, time.previous_working_day(0)
|
57
|
+
end
|
48
58
|
|
49
59
|
context "Date#new_years_day_holiday" do
|
50
60
|
should "return new year's day if it is a weekday" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uk_working_days
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 19
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Roland Swingler
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-11-16 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: activesupport
|
@@ -57,7 +56,6 @@ extra_rdoc_files:
|
|
57
56
|
- README.rdoc
|
58
57
|
files:
|
59
58
|
- .document
|
60
|
-
- .gitignore
|
61
59
|
- LICENSE
|
62
60
|
- README.rdoc
|
63
61
|
- Rakefile
|
@@ -68,13 +66,12 @@ files:
|
|
68
66
|
- test/helper.rb
|
69
67
|
- test/test_easter.rb
|
70
68
|
- test/test_uk_working_days.rb
|
71
|
-
has_rdoc: true
|
72
69
|
homepage: http://github.com/knaveofdiamonds/uk_working_days
|
73
70
|
licenses: []
|
74
71
|
|
75
72
|
post_install_message:
|
76
|
-
rdoc_options:
|
77
|
-
|
73
|
+
rdoc_options: []
|
74
|
+
|
78
75
|
require_paths:
|
79
76
|
- lib
|
80
77
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -98,11 +95,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
95
|
requirements: []
|
99
96
|
|
100
97
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.
|
98
|
+
rubygems_version: 1.8.6
|
102
99
|
signing_key:
|
103
100
|
specification_version: 3
|
104
101
|
summary: Provide date helpers for UK working days
|
105
|
-
test_files:
|
106
|
-
|
107
|
-
- test/test_easter.rb
|
108
|
-
- test/test_uk_working_days.rb
|
102
|
+
test_files: []
|
103
|
+
|