black_friday 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e679dd4cfca531e409eef4065b42bb7d057724366cdee2828749191f908547b
4
- data.tar.gz: 606472c6b02891eb1cac69679c07823ba5a6c082f8973fb66a7051cf80be76c2
3
+ metadata.gz: ea12f11a5c0d8be650cc27e5d75d60ffbfc36c285d9a8f2213103f39e506694b
4
+ data.tar.gz: 5c6061355894c4c599627fc6bba3b92e01e51cacfa70e043396335cdd1f267d3
5
5
  SHA512:
6
- metadata.gz: ce90f9beccdc0eb519ec21b1663dd180afd585c057ae0b075a16156467931fea49808ab25aadeccd5adec4036306215353034d8d2f9a0fa74d2fe17c0f3736b8
7
- data.tar.gz: 0eaf8488af278d3858040b27fb08f798032982355eb93558378b617a9891cad207ae95a26b2aa6fbc3e0d000dad74f0269369e10cc23f1fd9cccbc2af037468a
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.1"
4
+ VERSION = "1.0.2"
5
5
  end
data/lib/black_friday.rb CHANGED
@@ -37,6 +37,10 @@ module BlackFriday
37
37
  range.cover?(range.first.is_a?(Date) ? Date.today : Time.current)
38
38
  end
39
39
 
40
+ def range_for(sale_name)
41
+ instance_eval(&sales.fetch(sale_name))
42
+ end
43
+
40
44
  # Date helpers
41
45
 
42
46
  def thanksgiving(year = Date.today.year)
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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver