README.md in todoist-ruby-0.2.2 vs README.md in todoist-ruby-0.2.3

- old
+ new

@@ -75,11 +75,11 @@ @client = Todoist::Client.create_client_by_login("hello@example.com", "123") ``` #### Token -New tokens can be generated at the [Todoist App Management portal](https://developer.todoist.com/appconsole.html). Once a token has been acquired you can create a client by calling: +New tokens can be generated at the [Todoist App Management portal](https://developer.todoist.com/appconsole.html) or [General API token](https://todoist.com/prefs/integrations). Once a token has been acquired you can create a client by calling: ```ruby @client = Todoist::Client.create_client_by_token("my token") ``` @@ -94,13 +94,13 @@ 1. ```collection```: Calling collection forces the library to sync with the Todoist server to retrieve the latest. This method stores an internal in-memory copy of the result for incremental syncs but the caller should store a copy of the result in its own variable for query purposes. The following call syncs all items and returns a collection of the items: ```@client.sync_items.collection```. 2. ```sync```: Calling the sync method on the client object forces a sync which can be called like ```@client.sync``` When objects are called using the ```add``` methods, a shallow object is created with a temporary id accessible by sending an ```id``` message. Once any of the above synchronization methods are called above, the ids are updated via a callback with their actual ids so they can be used in subsequent calls. -#### Creating an item +#### Creating an item -```ruby +```ruby update_item = @client.sync_items.add({content: "Item3"}) ## At this time update_item has a temporary id update_item.priority = 2 result = @client.sync_items.update(update_item) @@ -114,11 +114,11 @@ @client.sync_items.delete([update_item]) # As is the case with other side-effects, issuing the call does not send the request immediately. @client.sync -# Manually calling sync deletes the item +# Manually calling sync deletes the item ``` For more detailed examples, please review the unit tests located in the ```spec``` directory. ### Other APIs @@ -145,20 +145,20 @@ #### HTTP 429 Protection If an ```HTTP 429 Too Many Requests``` is received, the library can wait for a period of time and then retry with an exponential backoff. To configure this parameter: ```ruby -Todoist::Util::Config.retry_time = 40 +Todoist::Config.retry_time = 40 # Default is 20s, adds a 40s delay ``` #### Delay between sync requests To set an artifical delay between sync requests: ```ruby -Todoist::Util::Config.delay_between_requests = 2 +Todoist::Config.delay_between_requests = 2 # Default is 0, adds a 2s delay ``` ## Development @@ -191,11 +191,11 @@ ### Authentication Instead of: ``` -Todoist::Util::Config.token = "my token" +Todoist::Config.token = "my token" ``` Use: ``` @@ -230,10 +230,11 @@ @client.sync ``` ## Version History +* 0.2.3: Updated to v8 endpoints * 0.2.2: For some code paths, it seems OpenSSL does not get loaded. Added require 'openssl' to network helper * 0.2.1: Major refactoring of library to support implementations that require multi-user support in a concurrent environment (e.g. Rails app). The previous implementation relied heavily on class singletons. Internally, the code has been cleaned up significantly. Due to the scale of changes, 0.2.1 is not compatible 0.1.x versions of the library. * 0.1.3: Changed ```Todoist::Sync``` managers so that the update method uses a hash instead of an OpenStruct. The OpenStruct creates errors when an OpenStruct passed from a previous call is used. The hash helps the caller make fewer mistakes. * 0.1.2: Renamed method ```Todoist::Util::ParseHelper.make_objects_as_array``` to ```Todoist::Util::ParseHelper.make_objects_as_hash``` to reflect the fact that it was actually returning hashes. Added the aforementioned deleted method to return arrays and finally altered ```Todoist::Misc::Completed``` to return objects as arrays instead of hashes due to the fact that recurring completed items were being de-duped unintentionally and data was being lost as a result. * 0.1.1: Initial release. @@ -244,6 +245,5 @@ ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). -