checkoff 0.180.0 → 0.182.0

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: 8ceda0a224245a150ec0e9a2a5a13bd5977ff985e9b621c3922a839f29b8d8ff
4
- data.tar.gz: 75758cd84def7f935d9fc2b09a281867c60894bab6d9b726bf51bb9eb495e2ee
3
+ metadata.gz: 74302595ea6cb1c68143d35dd18c69db22bde93604613bc7510ff9a28d3cca41
4
+ data.tar.gz: 723c7889c2b34062ced1283f265ff15a93d11ff5fe25f092a96ac1edc28aa324
5
5
  SHA512:
6
- metadata.gz: dd2d5f5cf6b74502ac3392b96842afe53ea239fdfd0598e2dee02d9525a1011b2d204a7d274f59745f2b19fe33bcaceabd27bcdd51dc8c9bd8e439f049c50cda
7
- data.tar.gz: 35bd117de452142c2640cfe0a21e2975047cd8d1355669b55f08b57a724d153043b39d05f50acc796146ff0cecab364c394f5a1f9f62d933f0e4832118a893d5
6
+ metadata.gz: f1d5cba0a7c2f1ba833d863f1937c04a1dba67cc5852fdceece99d86847bd3021d50c5507af8454aebdcbb57ee81510ad12860f21e9a5d780296f6eb8a519751
7
+ data.tar.gz: 356240d49bbcaab5f973774cee928e15a6eb522b750f99fb5ec3c69168051fb83d5661517761267e4b93448b79cc560cdf120d69973c6e6166653517cb1da2f5
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.182.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -40,7 +40,7 @@ module Checkoff
40
40
  filter_matches = filter_matches_asana_event?(filter, asana_event, failures)
41
41
  logger.debug { "Filter #{filter.inspect} matched? #{filter_matches} against event #{asana_event.inspect}" }
42
42
  unless filter_matches
43
- logger.info do
43
+ logger.debug do
44
44
  "Filter #{filter.inspect} failed to match event #{asana_event.inspect} because of #{failures.inspect}"
45
45
  end
46
46
  failures << filter
@@ -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.182.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.182.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-19 00:00:00.000000000 Z
11
+ date: 2024-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport