normalizy 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/normalizy/filters/date.rb +2 -4
- data/lib/normalizy/version.rb +1 -1
- data/spec/normalizy/filters/date_spec.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 328bb0456c2b8619b62dd267f391e8c5a89091d90d77ae201492f0b3033251ca
|
4
|
+
data.tar.gz: 77702f7ae3b66ddc7fc80cd35356d7ce4b16dc364459ba112f7b997771bba23e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0250c84197262d472c2f0f5b951a2deb09bc31a30832269b620bca1c6703e5d32f68db6e5cd85921bd4bd135f3c3bc03224da9db42df6d4d90b601214461d0d3
|
7
|
+
data.tar.gz: 92f6b33d5d677fafcc38984488758f99411e9a6386a90fe236b58d90b9c3a6b45c2e7701ac04a9af4c80195c83cfd9eb8bb231f830fc022d079fc1b0b87d9250
|
data/CHANGELOG.md
CHANGED
@@ -13,10 +13,8 @@ module Normalizy
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
if [
|
17
|
-
|
18
|
-
input = input.end_of_day if options[:adjust] == :end
|
19
|
-
end
|
16
|
+
input = input.beginning_of_day if options[:adjust] == :begin && input.respond_to?(:beginning_of_day)
|
17
|
+
input = input.end_of_day if options[:adjust] == :end && input.respond_to?(:end_of_day)
|
20
18
|
|
21
19
|
input
|
22
20
|
rescue ArgumentError
|
data/lib/normalizy/version.rb
CHANGED
@@ -15,6 +15,9 @@ RSpec.describe Normalizy::Filters::Date do
|
|
15
15
|
it { expect(subject.call(DateTime.new(1984, 1, 1, 1), adjust: :begin)).to eq DateTime.new(1984) }
|
16
16
|
it { expect(subject.call(DateTime.new(1984), adjust: :end)).to eq DateTime.new(1984).end_of_day }
|
17
17
|
|
18
|
+
it { expect(subject.call(OpenStruct.new(beginning_of_day: :success), adjust: :begin)).to eq :success }
|
19
|
+
it { expect(subject.call(OpenStruct.new(end_of_day: :success), adjust: :end)).to eq :success }
|
20
|
+
|
18
21
|
it do
|
19
22
|
result = subject.call(Date.new(1984, 10, 23), adjust: :end)
|
20
23
|
|