checkoff 0.129.0 → 0.130.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: 1c9d07ad7181d5b4c1dcf0df6542f92e5468a4ffef70231dc2c4a35f03f9fd45
4
- data.tar.gz: fff0a9a8e7663a71e4c5a257b709fcebe57e712d4536d12b1890834c1dd75be5
3
+ metadata.gz: 671e124a1d07f8449c10381cdaf97619ae58cd56dda7adcf2672396c8cae1c07
4
+ data.tar.gz: fd7c3e0b5f1dd48e7a6281a807c92a7f6d7614d8d71e27bdf45895e1f98246d7
5
5
  SHA512:
6
- metadata.gz: ddebe33692c02e9798a4ffa65b9ba105c1a3a62c7f6482fccbf9fd2ca4ba9cce443680a26f4b488f40d3a8316baf70b9acfaa811e79cf552bc1fc900d62da48f
7
- data.tar.gz: 1b49aeddc864873a270b08076d2d6ba9b107b25a8113714fd9e7a2e14b19e38ea59d143d33f6d75f6e1be23444230d25fdfcaf10bd0f8d82552f7b333a907a0e
6
+ metadata.gz: ee30df69be122ddcc9cfe7cfe5a72bab8ab53df71ddc0abbd81cab05767f25cea01047f2da2c6652831c4b5558ca23e126f02a0343c6f9963166c8047b93a634
7
+ data.tar.gz: 85e37bfc18623f783b70ab4724d1b19e3bfdf27c67c130e9c3a23d8b85faf938bdac54f15210d9b073641ec2d7fdcdca0b0a41630e4b660edb3b973c7c2a75ea
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.129.0)
15
+ checkoff (0.130.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'asana'
4
+
5
+ # Monkeypatches Asana::Resources::Resource so that Ruby marshalling and
6
+ # unmarshalling works on Asana resource classes. Currently, it will
7
+ # work unless you call an accessor method, which triggers Asana's
8
+ # client library Resource class' method_missing() to "cache" the
9
+ # result by creating a singleton method. Unfortunately, singleton
10
+ # methods break marshalling, which is not smart enough to know that it
11
+ # is not necessary to marshall them as they will simply be recreated
12
+ # when needed.
13
+
14
+ module Asana
15
+ # Monkeypatches:
16
+ #
17
+ # https://github.com/Asana/ruby-asana/blob/master/lib/asana
18
+ module Resources
19
+ # Public: The base resource class which provides some sugar over common
20
+ # resource functionality.
21
+ class Resource
22
+ # @return [Hash]
23
+ def marshal_dump
24
+ { 'data' => @_data }
25
+ end
26
+
27
+ # @param data [Hash]
28
+ #
29
+ # @return [void]
30
+ def marshal_load(data)
31
+ # @sg-ignore
32
+ # @type [Hash]
33
+ @_data = data.fetch('data')
34
+ @_data.each do |k, v|
35
+ if respond_to?(k)
36
+ variable = :"@#{k}"
37
+ instance_variable_set(variable, v)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -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.129.0'
6
+ VERSION = '0.130.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.129.0
4
+ version: 0.130.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
@@ -157,6 +157,7 @@ files:
157
157
  - lib/checkoff/internal/task_hashes.rb
158
158
  - lib/checkoff/internal/task_selector_evaluator.rb
159
159
  - lib/checkoff/internal/task_timing.rb
160
+ - lib/checkoff/monkeypatches/resource_marshalling.rb
160
161
  - lib/checkoff/my_tasks.rb
161
162
  - lib/checkoff/portfolios.rb
162
163
  - lib/checkoff/project_selectors.rb