checkoff 0.15.0 → 0.15.1

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: 73dc8e8ee25d08cf3457dac6284c7a7ab5476db7d3e1fadbe66d75a1f0546297
4
- data.tar.gz: 623ea9cd3331007bb831d72d14e063d9f92751eda5b1819270e69edb4ff7ca2e
3
+ metadata.gz: 1f76aad85729841bb8aae082caf52fe536536ea1fe9c633161b24e6a6a1ed0bc
4
+ data.tar.gz: fcfd8fab426da094602e01072361853746d24543628cf86bf61962fcc5868aab
5
5
  SHA512:
6
- metadata.gz: dd1155bea5724f05e4b1b6f12c172358ccb49d000bf1c22e77663df3b1239d442730c5879d116b4cca411a3a57f4acbf09fee5fa8b9b33c0537179e31601a8b3
7
- data.tar.gz: d5e1f8a9aadaffbaf9cd18d8ba976d368b1eec6edd1e829bfa5b42780ee34cddbf661207c3554a9665eec07bce553db9b7a2c19e1e899f7e34df82efd9d7a64d
6
+ metadata.gz: b45c61fb70079f118ab185d1ba6d0f6a36cde05cbb991c70af694168fba992871c05a75866b63387fe2fb3ea59ac1a5afd54d5fc66a8653cd067db63f8c8fc70
7
+ data.tar.gz: 409861138d0df6b7f854a9769c141d55945e5b05ddb510c7b6a620888efd9b0297bfea7f57195ab0f9f8b1b7913e690c3e8c2d012a609df34e16dd6e344f99d1
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.15.0)
15
+ checkoff (0.15.1)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
data/lib/checkoff/cli.rb CHANGED
@@ -211,7 +211,7 @@ module Checkoff
211
211
  end
212
212
 
213
213
  def run
214
- workspace = @workspaces.workspace_by_name(workspace_name)
214
+ workspace = @workspaces.workspace_or_raise(workspace_name)
215
215
  @tasks.add_task(task_name,
216
216
  workspace_gid: workspace.gid)
217
217
  end
@@ -48,7 +48,7 @@ module Checkoff
48
48
  cache_method :${underscored_singular_name}_or_raise, LONG_CACHE_TIME
49
49
 
50
50
  def ${underscored_singular_name}(workspace_name, ${underscored_singular_name}_name)
51
- workspace = workspaces.workspace_by_name(workspace_name)
51
+ workspace = workspaces.workspace_or_raise(workspace_name)
52
52
  ${underscored_plural_name} = client.${underscored_plural_name}.get_${underscored_plural_name}_for_workspace(workspace_gid: workspace.gid)
53
53
  ${underscored_plural_name}.find { |${underscored_singular_name}| ${underscored_singular_name}.name == ${underscored_singular_name}_name }
54
54
  end
@@ -37,7 +37,7 @@ module Checkoff
37
37
  cache_method :custom_field_or_raise, LONG_CACHE_TIME
38
38
 
39
39
  def custom_field(workspace_name, custom_field_name)
40
- workspace = workspaces.workspace_by_name(workspace_name)
40
+ workspace = workspaces.workspace_or_raise(workspace_name)
41
41
  custom_fields = client.custom_fields.get_custom_fields_for_workspace(workspace_gid: workspace.gid)
42
42
  custom_fields.find { |custom_field| custom_field.name == custom_field_name }
43
43
  end
@@ -89,14 +89,14 @@ module Checkoff
89
89
  cache_method :projects, LONG_CACHE_TIME
90
90
 
91
91
  def projects_by_workspace_name(workspace_name)
92
- workspace = @workspaces.workspace_by_name(workspace_name)
92
+ workspace = @workspaces.workspace_or_raise(workspace_name)
93
93
  raise "Could not find workspace named #{workspace_name}" unless workspace
94
94
 
95
95
  projects.find_by_workspace(workspace: workspace.gid)
96
96
  end
97
97
 
98
98
  def my_tasks(workspace_name)
99
- workspace = @workspaces.workspace_by_name(workspace_name)
99
+ workspace = @workspaces.workspace_or_raise(workspace_name)
100
100
  result = client.user_task_lists.get_user_task_list_for_user(user_gid: 'me',
101
101
  workspace: workspace.gid)
102
102
  gid = result.gid
data/lib/checkoff/tags.rb CHANGED
@@ -37,7 +37,7 @@ module Checkoff
37
37
  cache_method :tag_or_raise, LONG_CACHE_TIME
38
38
 
39
39
  def tag(workspace_name, tag_name)
40
- workspace = workspaces.workspace_by_name(workspace_name)
40
+ workspace = workspaces.workspace_or_raise(workspace_name)
41
41
  tags = client.tags.get_tags_for_workspace(workspace_gid: workspace.gid)
42
42
  tags.find { |tag| tag.name == tag_name }
43
43
  end
@@ -16,12 +16,15 @@ module Checkoff
16
16
 
17
17
  def initialize(config: Checkoff::ConfigLoader.load(:asana),
18
18
  sections: Checkoff::Sections.new(config: config),
19
+ clients: Checkoff::Clients.new(config: config),
20
+ client: clients.client,
19
21
  time_class: Time,
20
22
  asana_task: Asana::Resources::Task)
21
23
  @config = config
22
24
  @sections = sections
23
25
  @time_class = time_class
24
26
  @asana_task = asana_task
27
+ @client = client
25
28
  end
26
29
 
27
30
  def task_ready?(task)
@@ -64,9 +67,7 @@ module Checkoff
64
67
 
65
68
  private
66
69
 
67
- def client
68
- @sections.client
69
- end
70
+ attr_reader :client
70
71
 
71
72
  def projects
72
73
  @projects ||= @sections.projects
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Checkoff
4
4
  # Version of library
5
- VERSION = '0.15.0'
5
+ VERSION = '0.15.1'
6
6
  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.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-17 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport