todoist_rest_client 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 599001423d712e315184e5ce3b5bad778d95c9b4ea7cbd16e867f040eaadcc1a
4
- data.tar.gz: eb3fbdbd38a3b8d7a080aaf36119375f22c10db8158147e250c59d96ed965ffd
3
+ metadata.gz: f9053a04fab8a5890b10de9b37681f848b892ba2132f30a4f68b81e12f88f5f2
4
+ data.tar.gz: 1976dc9af72392441a8944bee9eb48707027f15d9c30bf184a8c2e51da1b3eb2
5
5
  SHA512:
6
- metadata.gz: 4f136159a0b8814302c469e0fe0d99e075d83a78a9749ea1abf3395ffc2f48877a34ff81837af83c2c38cb8c95459a37a666c8d48960570f85f2e9ce7fbe0361
7
- data.tar.gz: c6890c8bf08ea4852141a437da075885abe1706c75afa9da522f25cc871fc4238c6d22411a795851d74a8efbb06f1e68dfd31231b2130b54e906a2d465311851
6
+ metadata.gz: b5141d557dca9870608f99d0695afa31399aba01e95d5c57bc5983d26f8a049ed479f4025633d163e5501228a5ffa36f314e395530e6b7300b76c0c20df22dbb
7
+ data.tar.gz: 6df7a07b1c3d85e9a20ef0dbbda2b2d3b72ab466f1ce574ee7edc57a5038b1feb6aa9730b67f53afb59af53432a21f7e5fd49010a549729ded6ed233d7797cbc
data/lib/todoist/due.rb CHANGED
@@ -30,12 +30,12 @@ class Todoist
30
30
 
31
31
  def bump
32
32
  if string.blank?
33
- TodoistClient.logger.error { "You can only bump recurring tasks" }
33
+ TodoistRestClient.logger.error { "You can only bump recurring tasks" }
34
34
  return nil
35
35
  end
36
36
  mm = string.match(RECURRING_REGEX)
37
37
  unless mm
38
- TodoistClient.logger.error { "Cannot parse the string of this due obj: #{string}" }
38
+ TodoistRestClient.logger.error { "Cannot parse the string of this due obj: #{string}" }
39
39
  return nil
40
40
  end
41
41
  hours = mm[1].to_i * HOURS_PER_UNIT.fetch(mm[2].downcase)
data/lib/todoist/task.rb CHANGED
@@ -57,7 +57,9 @@ class Todoist
57
57
  args[:jsw_properties] = {}
58
58
  if (jsw_properties_match = args["description"].match(/(.*)```\s*~~~begin_yaml~~~\s*(.*)\s*~~~end_yaml~~~\s*```(.*)/m))
59
59
  @desc = [jsw_properties_match[1], jsw_properties_match[3]]
60
- args[:jsw_properties] = YAML.safe_load(jsw_properties_match[2])
60
+ # properties_string writes jsw_properties with symbol keys (and values like Time),
61
+ # so reading them back needs those classes permitted.
62
+ args[:jsw_properties] = YAML.safe_load(jsw_properties_match[2], permitted_classes: [Symbol, Time, Date], aliases: true)
61
63
  if args[:jsw_properties].is_a?(Hash)
62
64
  args[:jsw_properties].deep_symbolize_keys!
63
65
  end
@@ -0,0 +1,3 @@
1
+ class TodoistRestClient
2
+ VERSION = "0.2.1"
3
+ end
@@ -7,7 +7,7 @@ require "date"
7
7
  require "time"
8
8
  require "rest_requestor"
9
9
 
10
- require_relative "todoist_client/version"
10
+ require_relative "todoist_rest_client/version"
11
11
  require_relative "todoist/current_time"
12
12
  require_relative "todoist/struct_cleanup"
13
13
  require_relative "todoist/due"
@@ -21,7 +21,7 @@ require_relative "todoist/sync"
21
21
  require_relative "todoist/date_parser"
22
22
  require_relative "todoist/utilities"
23
23
 
24
- class TodoistClient
24
+ class TodoistRestClient
25
25
  DAYS = %i[sun mon tue wed thu fri sat].freeze
26
26
  BASE = {
27
27
  rest: {v1: "https://api.todoist.com/api/v1/", legacy: "https://api.todoist.com/rest/v2/"},
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: todoist_rest_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Wright
@@ -129,9 +129,9 @@ files:
129
129
  - lib/todoist/sync.rb
130
130
  - lib/todoist/task.rb
131
131
  - lib/todoist/utilities.rb
132
- - lib/todoist_client.rb
133
- - lib/todoist_client/version.rb
134
- homepage: https://codeberg.org/jswright61/todoist_client
132
+ - lib/todoist_rest_client.rb
133
+ - lib/todoist_rest_client/version.rb
134
+ homepage: https://codeberg.org/jswright61/todoist_rest_client
135
135
  licenses:
136
136
  - MIT
137
137
  metadata: {}
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubygems_version: 4.0.16
152
+ rubygems_version: 4.0.20
153
153
  specification_version: 4
154
154
  summary: A Ruby client for the Todoist API
155
155
  test_files: []
@@ -1,3 +0,0 @@
1
- class TodoistClient
2
- VERSION = "0.1.0"
3
- end