checkoff 0.180.0 → 0.181.0

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: 8ceda0a224245a150ec0e9a2a5a13bd5977ff985e9b621c3922a839f29b8d8ff
4
- data.tar.gz: 75758cd84def7f935d9fc2b09a281867c60894bab6d9b726bf51bb9eb495e2ee
3
+ metadata.gz: 4375c2b0377fc7ccfb25e724d4d5dfcaba964c9abb6080a46f4948a6cb58d5a9
4
+ data.tar.gz: 799f7950940dd1c9be03f6521dd876667b6935c02171cd88d23044172b80fa6e
5
5
  SHA512:
6
- metadata.gz: dd2d5f5cf6b74502ac3392b96842afe53ea239fdfd0598e2dee02d9525a1011b2d204a7d274f59745f2b19fe33bcaceabd27bcdd51dc8c9bd8e439f049c50cda
7
- data.tar.gz: 35bd117de452142c2640cfe0a21e2975047cd8d1355669b55f08b57a724d153043b39d05f50acc796146ff0cecab364c394f5a1f9f62d933f0e4832118a893d5
6
+ metadata.gz: ee8b4f82321e18945ed5327263d172c5dbc9de9ee092504076d90918f865dfb1ba1ae6fe1e0b6a9a6f128755557c6ac22d97d93d2ce13d7ca601f23db977fe0e
7
+ data.tar.gz: 293b79d78064763fd18a4d012cc301f2283857efea170c01cd2ce1beb27b852f0f0013c59a3c4188ce81a0e94aa274e83f80bb6ad21500343af97a1b63155b01
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.180.0)
15
+ checkoff (0.181.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -40,6 +40,8 @@ module Checkoff
40
40
  def in_period?(date_or_time, period)
41
41
  return this_week?(date_or_time) if period == :this_week
42
42
 
43
+ return next_week?(date_or_time) if period == :next_week
44
+
43
45
  return day_of_week?(date_or_time, period) if %i[monday tuesday wednesday thursday friday saturday
44
46
  sunday].include?(period)
45
47
 
@@ -120,6 +122,23 @@ module Checkoff
120
122
  date >= beginning_of_week && date <= end_of_week
121
123
  end
122
124
 
125
+ # @param date_or_time [Date,Time,nil]
126
+ def next_week?(date_or_time)
127
+ return false if date_or_time.nil?
128
+
129
+ today = @today_getter.today
130
+
131
+ # Beginning of next week (assuming week starts on Sunday)
132
+ beginning_of_week = today - today.wday + 7
133
+
134
+ # End of this week (assuming week ends on Saturday)
135
+ end_of_week = beginning_of_week + 6
136
+
137
+ date = date_or_time.to_date
138
+
139
+ date >= beginning_of_week && date <= end_of_week
140
+ end
141
+
123
142
  # @type [Hash<Symbol,Integer>]
124
143
  WDAY_FROM_DAY_OF_WEEK = {
125
144
  monday: 1,
@@ -3,5 +3,5 @@
3
3
  # Command-line and gem client for Asana (unofficial)
4
4
  module Checkoff
5
5
  # Version of library
6
- VERSION = '0.180.0'
6
+ VERSION = '0.181.0'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.180.0
4
+ version: 0.181.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz