checkoff 0.186.0 → 0.187.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 +3 -3
- data/fix.sh +10 -3
- data/lib/checkoff/attachments.rb +6 -8
- data/lib/checkoff/internal/selector_classes/task.rb +20 -0
- data/lib/checkoff/tasks.rb +21 -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: 662bb742d6b627b5b1e95d376e0565392ecc56ea54d4dea8f76c5e5198093d6d
|
4
|
+
data.tar.gz: '01859381f83d92867afc1319a0d43fc860a6505970cce641c76565b5a99e5d13'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f6a49cf14421028d42869e8436b5cc917e584aee545b0645487efc64fcda10ee35db189890970c9fb71349ad8498d4fe7ad548b177f140c4feb82edf3bc1df3
|
7
|
+
data.tar.gz: 26763f804929cbbcfb4af6faaed2ff14d01dd9736b465c830a5e9e9479c8428c8d14114e12b7fa6fda9e7cc9aa3fb6896d043fcea099b1678d60849b12b6420f
|
data/Gemfile.lock
CHANGED
@@ -12,7 +12,7 @@ GIT
|
|
12
12
|
PATH
|
13
13
|
remote: .
|
14
14
|
specs:
|
15
|
-
checkoff (0.
|
15
|
+
checkoff (0.187.0)
|
16
16
|
activesupport
|
17
17
|
asana (> 0.10.0)
|
18
18
|
cache_method
|
@@ -180,7 +180,7 @@ GEM
|
|
180
180
|
unicode-display_width (>= 2.4.0, < 3.0)
|
181
181
|
rubocop-ast (1.30.0)
|
182
182
|
parser (>= 3.2.1.0)
|
183
|
-
rubocop-minitest (0.34.
|
183
|
+
rubocop-minitest (0.34.5)
|
184
184
|
rubocop (>= 1.39, < 2.0)
|
185
185
|
rubocop-ast (>= 1.30.0, < 2.0)
|
186
186
|
rubocop-rake (0.6.0)
|
@@ -262,4 +262,4 @@ DEPENDENCIES
|
|
262
262
|
yard
|
263
263
|
|
264
264
|
BUNDLED WITH
|
265
|
-
2.
|
265
|
+
2.5.5
|
data/fix.sh
CHANGED
@@ -152,22 +152,29 @@ ensure_bundle() {
|
|
152
152
|
need_better_bundler=true
|
153
153
|
elif [ "${bundler_version_major}" -eq 2 ]
|
154
154
|
then
|
155
|
-
if [ "${bundler_version_minor}" -lt
|
155
|
+
if [ "${bundler_version_minor}" -lt 5 ]
|
156
156
|
then
|
157
157
|
need_better_bundler=true
|
158
|
-
elif [ "${bundler_version_minor}" -eq
|
158
|
+
elif [ "${bundler_version_minor}" -eq 5 ]
|
159
159
|
then
|
160
|
-
if [ "${bundler_version_patch}" -lt
|
160
|
+
if [ "${bundler_version_patch}" -lt 5 ]
|
161
161
|
then
|
162
162
|
need_better_bundler=true
|
163
163
|
fi
|
164
164
|
fi
|
165
165
|
fi
|
166
|
+
echo "Bundler version: ${bundler_version}"
|
167
|
+
echo "Need better bundler: ${need_better_bundler}"
|
166
168
|
if [ "${need_better_bundler}" = true ]
|
167
169
|
then
|
168
170
|
# need to do this first before 'bundle update --bundler' will work
|
169
171
|
make bundle_install
|
172
|
+
set -x
|
170
173
|
bundle update --bundler
|
174
|
+
gem install bundler:2.5.5
|
175
|
+
set +x
|
176
|
+
echo "After updating bundler:"
|
177
|
+
echo "Bundler version: ${bundler_version}"
|
171
178
|
# ensure next step installs fresh bundle
|
172
179
|
rm -f Gemfile.lock.installed
|
173
180
|
fi
|
data/lib/checkoff/attachments.rb
CHANGED
@@ -75,25 +75,23 @@ module Checkoff
|
|
75
75
|
# not succesful
|
76
76
|
#
|
77
77
|
# @param uri [URI]
|
78
|
+
# @param verify_mode [OpenSSL::SSL::VERIFY_NONE,OpenSSL::SSL::VERIFY_PEER]
|
78
79
|
#
|
79
80
|
# @return [Object]
|
80
81
|
# @sg-ignore
|
81
|
-
def download_uri(uri, &block)
|
82
|
+
def download_uri(uri, verify_mode: OpenSSL::SSL::VERIFY_PEER, &block)
|
82
83
|
out = nil
|
83
|
-
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
84
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https', verify_mode: verify_mode) do |http|
|
84
85
|
# @sg-ignore
|
85
|
-
request
|
86
|
-
http.request(request) do |response|
|
87
|
-
# use a block to ensure the file is closed after we're done with it
|
86
|
+
http.request(Net::HTTP::Get.new(uri)) do |response|
|
88
87
|
raise("Unexpected response code: #{response.code}") unless response.code == '200'
|
89
88
|
|
90
|
-
write_tempfile_from_response(response)
|
91
|
-
out = block.yield tempfile
|
92
|
-
end
|
89
|
+
write_tempfile_from_response(response) { |tempfile| out = block.yield tempfile }
|
93
90
|
end
|
94
91
|
end
|
95
92
|
out
|
96
93
|
rescue StandardError => e
|
94
|
+
debug { e }
|
97
95
|
raise "Error downloading #{uri}: #{e}"
|
98
96
|
end
|
99
97
|
|
@@ -100,6 +100,26 @@ module Checkoff
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
+
# :in_portfolio_more_than_once? function
|
104
|
+
class InPortfolioMoreThanOncePFunctionEvaluator < FunctionEvaluator
|
105
|
+
def matches?
|
106
|
+
fn?(selector, :in_portfolio_more_than_once?)
|
107
|
+
end
|
108
|
+
|
109
|
+
# @param _index [Integer]
|
110
|
+
def evaluate_arg?(_index)
|
111
|
+
false
|
112
|
+
end
|
113
|
+
|
114
|
+
# @sg-ignore
|
115
|
+
# @param task [Asana::Resources::Task]
|
116
|
+
# @param portfolio_name [String]
|
117
|
+
# @return [Boolean]
|
118
|
+
def evaluate(task, portfolio_name)
|
119
|
+
@tasks.in_portfolio_more_than_once?(task, portfolio_name)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
103
123
|
# :tag? function
|
104
124
|
class TagPFunctionEvaluator < FunctionEvaluator
|
105
125
|
def matches?
|
data/lib/checkoff/tasks.rb
CHANGED
@@ -292,6 +292,27 @@ module Checkoff
|
|
292
292
|
end
|
293
293
|
end
|
294
294
|
|
295
|
+
# True if the task is in a project which is in the given portfolio
|
296
|
+
#
|
297
|
+
# @param task [Asana::Resources::Task]
|
298
|
+
# @param portfolio_name [String]
|
299
|
+
# @param workspace_name [String]
|
300
|
+
def in_portfolio_more_than_once?(task,
|
301
|
+
portfolio_name,
|
302
|
+
workspace_name: @workspaces.default_workspace.name)
|
303
|
+
portfolio_projects = @portfolios.projects_in_portfolio(workspace_name, portfolio_name)
|
304
|
+
portfolio_project_gids = portfolio_projects.map(&:gid)
|
305
|
+
seen = false
|
306
|
+
task.memberships.each do |membership|
|
307
|
+
project_gid = membership.fetch('project').fetch('gid')
|
308
|
+
next unless portfolio_project_gids.include?(project_gid)
|
309
|
+
return true if seen
|
310
|
+
|
311
|
+
seen = true
|
312
|
+
end
|
313
|
+
false
|
314
|
+
end
|
315
|
+
|
295
316
|
# @return [Hash]
|
296
317
|
def as_cache_key
|
297
318
|
{}
|
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.187.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-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|