checkoff 0.120.0 → 0.122.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: 117e0d119a50af033c6f3b28fd27b12163547a3b236aa9ecc25440bc87f0107f
4
- data.tar.gz: 1764ec654cb5b3d247a597c9630c0df5f5a94cca6614a6a914f5d293ba711ab4
3
+ metadata.gz: f96bd0d9499fdc95b738d1ab17d552691e590338150196470e60c25c6053672e
4
+ data.tar.gz: a30c397667ed31b67503b9c6e62a8e1c4dc045d691a003f521b3c70b8a9ff87f
5
5
  SHA512:
6
- metadata.gz: ee2e30a3963d4ecb2677703a559c1e6452e40db3f55d536852f62a1d668f301df45e4ee584213124308063295628b28e0f10e7eaee9bdfb62846e8bf9d235fac
7
- data.tar.gz: d2af0a7c6242e5a1b2e21582c354fbdc4596d63175aa2c0a59c27736a583c05b9bfeb852c212f7f82a7316908c2524edc20a51dab8566f40deaada016f40e061
6
+ metadata.gz: ff172750747bda515d5f9cc3305dd7f2917f5d2445e5bb08dc2cdb4111e193ec095cfb4a535611ae5c49da0311f724c6b568619dea7b59dce1840ffe265f5141
7
+ data.tar.gz: 9985e199a1357cddec9fc56d25a3f6b9b47d83f0ce124934169a1eb5da3dae7a3c4c58c587c94258c437cb2ade5a781c7d97880c3bff79bcf7a75c1f49abb3be
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.120.0)
15
+ checkoff (0.122.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -60,6 +60,7 @@ module Checkoff
60
60
  # @param [String] workspace_name
61
61
  # @param [String] project_name
62
62
  # @param [Array<String>] extra_fields
63
+ #
63
64
  # @return [Asana::Resources::Project, nil]
64
65
  def project(workspace_name, project_name, extra_fields: [])
65
66
  if project_name.is_a?(Symbol) && project_name.to_s.start_with?('my_tasks')
@@ -76,15 +77,26 @@ module Checkoff
76
77
 
77
78
  # @param workspace_name [String]
78
79
  # @param project_name [String]
80
+ # @param [Array<String>] extra_fields
81
+ #
79
82
  # @return [Asana::Resources::Project]
80
- def project_or_raise(workspace_name, project_name)
81
- p = project(workspace_name, project_name)
83
+ def project_or_raise(workspace_name, project_name, extra_fields: [])
84
+ p = project(workspace_name, project_name, extra_fields: extra_fields)
82
85
  raise "Could not find project #{project_name.inspect} under workspace #{workspace_name}." if p.nil?
83
86
 
84
87
  p
85
88
  end
86
89
  cache_method :project_or_raise, LONG_CACHE_TIME
87
90
 
91
+ # @param gid [String]
92
+ # @param [Array<String>] extra_fields
93
+ #
94
+ # @return [Asana::Resources::Project]
95
+ def project_by_gid(gid, extra_fields: [])
96
+ projects.find_by_id(gid, options: { fields: %w[name] + extra_fields })
97
+ end
98
+ cache_method :project_or_raise, LONG_CACHE_TIME
99
+
88
100
  # find uncompleted tasks in a list
89
101
  # @param [Enumerable<Asana::Resources::Task>] tasks
90
102
  # @return [Enumerable<Asana::Resources::Task>]
@@ -73,7 +73,7 @@ module Checkoff
73
73
  task.memberships.all? do |membership_data|
74
74
  unless limit_to_portfolio_name.nil?
75
75
  project_gid = membership_data.fetch('project').fetch('gid')
76
- next true if limit_to_projects.map(&:gid).include? project_gid
76
+ next true unless limit_to_projects.map(&:gid).include? project_gid
77
77
  end
78
78
  # @type [Hash{String => String}]
79
79
  section_data = membership_data.fetch('section')
@@ -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.120.0'
6
+ VERSION = '0.122.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.120.0
4
+ version: 0.122.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: 2023-11-02 00:00:00.000000000 Z
11
+ date: 2023-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport