black_friday 1.0.0 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7966bbf57ee41cf2517eb0dec3ca6195cb6b64f524cc6a7a05b2b5ffa38c666f
4
- data.tar.gz: eb327004e46a88dbbd45ad513142ff790ce5bf85abe287ef5e0537eab6afc042
3
+ metadata.gz: ea12f11a5c0d8be650cc27e5d75d60ffbfc36c285d9a8f2213103f39e506694b
4
+ data.tar.gz: 5c6061355894c4c599627fc6bba3b92e01e51cacfa70e043396335cdd1f267d3
5
5
  SHA512:
6
- metadata.gz: 49b2d7aa8c84b5c01e0fb451fb72e3c1e2d467fc82bf80a17a44a6281374da6f19d4eb6df0ec10dccb39aac2341680a38d1bdc428e88ef1afb75c648ab122f3d
7
- data.tar.gz: 477c1820b56c6d7cb13de244299b81b3aed8cea4c7eb812b57a905f18f0831fd9a2e35a1b8c4ff2032488f683bb5da94d6c6a115019f650238a45f16928e0a4b
6
+ metadata.gz: 80a4f74fcfabf32d203e24f1e80306f243287622dde2f5186a856b936965df94849850a97e036ac7149b42ae4d0cea6f8d62a74a0d726b861126435e5fa7cb88
7
+ data.tar.gz: c47e9b57af07d2da3f83107e8e2b42361fe5c96550b218267ddfdc88184fb16bd0d3f531579e424ce4f91caeb85d5037e869c6b945616f84e420563aa849e8a0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2024-11-21
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:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BlackFriday
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.2"
5
5
  end
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.include?(range.first.is_a?(Date) ? Date.today : Time.current)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: black_friday
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver