timecop 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/timecop/time_extensions.rb +6 -4
- data/lib/timecop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da2c45ae95e5db0d2b37d8467be294faf165334f
|
4
|
+
data.tar.gz: 6648ca56344418873cc163be099ef7d99dccee0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74a8f41e10d1dcd912fee6875528d4e7d6fef6ff50751c599e9c018331f16beb16b624b996eee2d9101f13845434ddd3b9a0c8c25bfbd01568d064a7b8a1e73c
|
7
|
+
data.tar.gz: b6bb77bf3a3123568eb4fa97ff6aaccf16ba0af4d92212b850ef4993c31a8abdac5ec1bbf29bdc12001d067f6248f7ceed8ac9dbab3486759347658c5492555c
|
@@ -64,13 +64,14 @@ class Date #:nodoc:
|
|
64
64
|
|
65
65
|
alias_method :strptime, :strptime_with_mock_date
|
66
66
|
|
67
|
-
def parse_with_mock_date(
|
67
|
+
def parse_with_mock_date(*args)
|
68
|
+
str = args.first
|
68
69
|
if WEEKDAYS.keys.include?(str.downcase)
|
69
70
|
offset = WEEKDAYS[str.downcase] - Date.today.wday
|
70
71
|
|
71
72
|
Date.today + offset
|
72
73
|
else
|
73
|
-
parse_without_mock_date(
|
74
|
+
parse_without_mock_date(*args)
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
@@ -95,7 +96,8 @@ class DateTime #:nodoc:
|
|
95
96
|
|
96
97
|
alias_method :now, :now_with_mock_time
|
97
98
|
|
98
|
-
def parse_with_mock_date(
|
99
|
+
def parse_with_mock_date(*args)
|
100
|
+
str = args.first
|
99
101
|
if Date::WEEKDAYS.keys.include?(str.downcase)
|
100
102
|
offset = Date::WEEKDAYS[str.downcase] - DateTime.now.wday
|
101
103
|
|
@@ -103,7 +105,7 @@ class DateTime #:nodoc:
|
|
103
105
|
|
104
106
|
DateTime.new(parsed_weekday.year, parsed_weekday.month, parsed_weekday.day, 0, 0, 0, 0)
|
105
107
|
else
|
106
|
-
parse_without_mock_date(
|
108
|
+
parse_without_mock_date(*args)
|
107
109
|
end
|
108
110
|
end
|
109
111
|
|
data/lib/timecop/version.rb
CHANGED