black_friday 1.0.2 → 1.0.3

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: ea12f11a5c0d8be650cc27e5d75d60ffbfc36c285d9a8f2213103f39e506694b
4
- data.tar.gz: 5c6061355894c4c599627fc6bba3b92e01e51cacfa70e043396335cdd1f267d3
3
+ metadata.gz: 7ffbcf76eea0862cddaa63f91a21a19eb41e666eb9321eb3115a8846a39c95ca
4
+ data.tar.gz: 942723a966fc7e783c3a3f5e39847c8b98dd5fca44acdde11c6e9f209f222250
5
5
  SHA512:
6
- metadata.gz: 80a4f74fcfabf32d203e24f1e80306f243287622dde2f5186a856b936965df94849850a97e036ac7149b42ae4d0cea6f8d62a74a0d726b861126435e5fa7cb88
7
- data.tar.gz: c47e9b57af07d2da3f83107e8e2b42361fe5c96550b218267ddfdc88184fb16bd0d3f531579e424ce4f91caeb85d5037e869c6b945616f84e420563aa849e8a0
6
+ metadata.gz: 9572cb6a4739e4ac926f133783a88af828a8c571862f5430b52b8d693dc50ea035cfde6e56f31279dea77b7eaf97f34f622d67ecc7515e4645020b070f24bff0
7
+ data.tar.gz: aa148f4b131fded46ea48a28827723104f51687e9261e9e01554b7925ea68baac1d936e91f41bd5a6a7832e11cff256c1930c196dcd5be718a6733c9d284c4b4
data/README.md CHANGED
@@ -56,6 +56,12 @@ BlackFriday.active?(:black_friday, :labor_day)
56
56
  #=> true/false
57
57
  ```
58
58
 
59
+ Render a banner when a sale is active:
60
+
61
+ ```erb
62
+ <%= render "banners/black_friday" if BlackFriday.active?(:black_friday) %>
63
+ ```
64
+
59
65
  To check the active sales:
60
66
 
61
67
  ```ruby
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BlackFriday
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
data/lib/black_friday.rb CHANGED
@@ -49,6 +49,12 @@ module BlackFriday
49
49
  first_thursday + 3.weeks
50
50
  end
51
51
 
52
+ def canadian_thanksgiving(year = Date.today.year)
53
+ oct_1st = Date.new(year, 10, 1)
54
+ first_monday = oct_1st.monday? ? oct_1st : oct_1st.next_occurring(:monday)
55
+ first_monday + 1.weeks
56
+ end
57
+
52
58
  def black_friday(year = Date.today.year)
53
59
  thanksgiving(year) + 1.day
54
60
  end
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.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver