checkoff 0.151.0 → 0.153.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: 814abd2292e805c48daa1ab1fbfafd5f48930f0690a40f0ec4f09ccf4236b2ab
4
- data.tar.gz: fc4237862cf34cc1541bf025a982115d10d727733f4146d6dcfe2ad6d6222302
3
+ metadata.gz: f7e51a414e4d6bf0451ff81ace5951718f32a115ac61b1d5fc3930b3f82d3fd4
4
+ data.tar.gz: 6b89e1f7a6cf317309ebed700279a375c568afee782c5ae8cf4e18bd7dc2b3f6
5
5
  SHA512:
6
- metadata.gz: bcbe6b9ec7e0b8c74bbb80a3493b8a223c4d9f4e6151068eb9fefaf5bf6f6db9babc158b69c59fff799f80f5841f59317ad5043daa8b12fa3c248a89f80b6b0c
7
- data.tar.gz: e5af723e0c0877b78e4a546bbe511f2132439be39c3923033c59a4cfb640c5bd3616e735518db90e2fb0d3234bb6d971b9ba1e7374ffdd6aae5eccbad8b22064
6
+ metadata.gz: 1bfd9fe45ba1b913d636edf8c5f0d403f3e63a553e28f98230328b50acf62002452221ec368106bbe70a3daff97c3c215e3566e7d864235ad64ab88d5a04793e
7
+ data.tar.gz: 94f52681e4fe654b96d899351b9248918bbf4b39643a0c74d4210e5dd4d90564300afa179e9eabd3ea1d3d682240c1f8adff94610754efa63e2c6054d8e1c698
data/Gemfile CHANGED
@@ -26,7 +26,7 @@ gem 'rubocop-rake'
26
26
  # ensure version with branch coverage
27
27
  gem 'simplecov', ['>=0.18.0']
28
28
  gem 'simplecov-lcov'
29
- gem 'solargraph', ['>=0.49.0']
29
+ gem 'solargraph', ['>=0.50.0']
30
30
  gem 'undercover'
31
31
  gem 'webmock'
32
32
  gem 'yard'
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.151.0)
15
+ checkoff (0.153.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -96,7 +96,7 @@ GEM
96
96
  parser (>= 2.5, != 2.5.1.1)
97
97
  iniparse (1.5.0)
98
98
  jaro_winkler (1.5.6)
99
- json (2.6.3)
99
+ json (2.7.1)
100
100
  jwt (2.7.1)
101
101
  kramdown (2.4.0)
102
102
  rexml
@@ -159,11 +159,11 @@ GEM
159
159
  rainbow (3.1.1)
160
160
  rake (13.1.0)
161
161
  rbs (2.8.4)
162
- regexp_parser (2.8.2)
162
+ regexp_parser (2.8.3)
163
163
  reverse_markdown (2.1.1)
164
164
  nokogiri
165
165
  rexml (3.2.6)
166
- rubocop (1.57.2)
166
+ rubocop (1.58.0)
167
167
  json (~> 2.3)
168
168
  language_server-protocol (>= 3.17.0)
169
169
  parallel (~> 1.10)
@@ -171,7 +171,7 @@ GEM
171
171
  rainbow (>= 2.2.2, < 4.0)
172
172
  regexp_parser (>= 1.8, < 3.0)
173
173
  rexml (>= 3.2.5, < 4.0)
174
- rubocop-ast (>= 1.28.1, < 2.0)
174
+ rubocop-ast (>= 1.30.0, < 2.0)
175
175
  ruby-progressbar (~> 1.7)
176
176
  unicode-display_width (>= 2.4.0, < 3.0)
177
177
  rubocop-ast (1.30.0)
@@ -190,7 +190,7 @@ GEM
190
190
  simplecov-html (0.12.3)
191
191
  simplecov-lcov (0.8.0)
192
192
  simplecov_json_formatter (0.1.4)
193
- solargraph (0.49.0)
193
+ solargraph (0.50.0)
194
194
  backport (~> 1.2)
195
195
  benchmark
196
196
  bundler (~> 2.0)
@@ -249,10 +249,10 @@ DEPENDENCIES
249
249
  rubocop-rake
250
250
  simplecov (>= 0.18.0)
251
251
  simplecov-lcov
252
- solargraph (>= 0.49.0)
252
+ solargraph (>= 0.50.0)
253
253
  undercover
254
254
  webmock
255
255
  yard
256
256
 
257
257
  BUNDLED WITH
258
- 2.2.33
258
+ 2.4.22
@@ -40,6 +40,9 @@ 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 day_of_week?(date_or_time, period) if %i[monday tuesday wednesday thursday friday saturday
44
+ sunday].include?(period)
45
+
43
46
  return true if period == :indefinite
44
47
 
45
48
  return now_or_before?(date_or_time) if period == :now_or_before
@@ -117,6 +120,28 @@ module Checkoff
117
120
  date >= beginning_of_week && date <= end_of_week
118
121
  end
119
122
 
123
+ # @type [Hash<Symbol,Integer>]
124
+ WDAY_FROM_DAY_OF_WEEK = {
125
+ monday: 1,
126
+ tuesday: 2,
127
+ wednesday: 3,
128
+ thursday: 4,
129
+ friday: 5,
130
+ saturday: 6,
131
+ sunday: 0,
132
+ }.freeze
133
+
134
+ # @param date_or_time [Date,Time,nil]
135
+ # @param day_of_week [Symbol]
136
+ def day_of_week?(date_or_time, day_of_week)
137
+ return false if date_or_time.nil?
138
+
139
+ wday = WDAY_FROM_DAY_OF_WEEK.fetch(day_of_week)
140
+ today = @today_getter.today
141
+ date = date_or_time.to_date
142
+ date_or_time.wday == wday && date >= today && date < today + 7
143
+ end
144
+
120
145
  # @param date_or_time [Date,Time,nil]
121
146
  def now_or_before?(date_or_time)
122
147
  return true if date_or_time.nil?
@@ -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.151.0'
6
+ VERSION = '0.153.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.151.0
4
+ version: 0.153.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz