black_friday 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +2 -0
- data/lib/black_friday/version.rb +1 -1
- data/lib/black_friday.rb +5 -1
- 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: ea12f11a5c0d8be650cc27e5d75d60ffbfc36c285d9a8f2213103f39e506694b
|
4
|
+
data.tar.gz: 5c6061355894c4c599627fc6bba3b92e01e51cacfa70e043396335cdd1f267d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80a4f74fcfabf32d203e24f1e80306f243287622dde2f5186a856b936965df94849850a97e036ac7149b42ae4d0cea6f8d62a74a0d726b861126435e5fa7cb88
|
7
|
+
data.tar.gz: c47e9b57af07d2da3f83107e8e2b42361fe5c96550b218267ddfdc88184fb16bd0d3f531579e424ce4f91caeb85d5037e869c6b945616f84e420563aa849e8a0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [1.0.2] - 2024-11-22
|
4
|
+
|
5
|
+
- Add `BlackFriday.range_for(:name)` to retrieve a range
|
6
|
+
|
7
|
+
## [1.0.1] - 2024-11-22
|
8
|
+
|
9
|
+
- Add support for `ActiveSupport::TimeWithZone` by switching to `cover?`
|
10
|
+
|
11
|
+
## [1.0.0] - 2024-11-22
|
4
12
|
|
5
13
|
- Initial release
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Add Black Friday sales to your Rails app.
|
4
4
|
|
5
|
+
[![Ruby](https://github.com/excid3/black_friday/actions/workflows/main.yml/badge.svg)](https://github.com/excid3/black_friday/actions/workflows/main.yml)
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Install the gem and add to the application's Gemfile by executing:
|
data/lib/black_friday/version.rb
CHANGED
data/lib/black_friday.rb
CHANGED
@@ -34,7 +34,11 @@ module BlackFriday
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def in_range?(range)
|
37
|
-
range.
|
37
|
+
range.cover?(range.first.is_a?(Date) ? Date.today : Time.current)
|
38
|
+
end
|
39
|
+
|
40
|
+
def range_for(sale_name)
|
41
|
+
instance_eval(&sales.fetch(sale_name))
|
38
42
|
end
|
39
43
|
|
40
44
|
# Date helpers
|