checkoff 0.180.0 → 0.182.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/checkoff/internal/asana_event_filter.rb +1 -1
- data/lib/checkoff/timing.rb +19 -0
- data/lib/checkoff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74302595ea6cb1c68143d35dd18c69db22bde93604613bc7510ff9a28d3cca41
|
4
|
+
data.tar.gz: 723c7889c2b34062ced1283f265ff15a93d11ff5fe25f092a96ac1edc28aa324
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1d5cba0a7c2f1ba833d863f1937c04a1dba67cc5852fdceece99d86847bd3021d50c5507af8454aebdcbb57ee81510ad12860f21e9a5d780296f6eb8a519751
|
7
|
+
data.tar.gz: 356240d49bbcaab5f973774cee928e15a6eb522b750f99fb5ec3c69168051fb83d5661517761267e4b93448b79cc560cdf120d69973c6e6166653517cb1da2f5
|
data/Gemfile.lock
CHANGED
@@ -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.
|
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
|
data/lib/checkoff/timing.rb
CHANGED
@@ -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,
|
data/lib/checkoff/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|