README.md in asana-2.0.0 vs README.md in asana-2.0.1

- old
+ new

@@ -39,11 +39,11 @@ client = Asana::Client.new do |c| c.authentication :access_token, 'personal_access_token' end -client.workspaces.find_all.first +client.workspaces.get_workspaces.first ``` A full-blown customized client using OAuth2 wih a previously obtained refresh token, Typhoeus as a Faraday adapter, a custom user agent and custom Faraday middleware: @@ -59,11 +59,11 @@ redirect_uri: 'http://example.org/auth' c.faraday_adapter :typhoeus c.configure_faraday { |conn| conn.use SomeFaradayMiddleware } end -workspace = client.workspaces.find_by_id(12) +workspace = client.workspaces.get_workspace(12) workspace.users # => #<Asana::Collection<User> ...> client.tags.create_in_workspace(workspace: workspace.id, name: 'foo') # => #<Asana::Tag id: ..., name: "foo"> ``` @@ -150,11 +150,11 @@ client_secret: ...) client = Asana::Client.new do |c| c.authentication :oauth2, access_token end -client.tasks.find_by_id(12) +client.tasks.get_task(12) ``` This will print an authorization URL on STDOUT, and block until you paste in the authorization code, which you can get by visiting that URL and granting the necessary permissions. @@ -164,11 +164,11 @@ Whenever you ask for a collection of resources, you can provide a number of results per page to fetch, between 1 and 100. If you don't provide any, it defaults to 20. ```ruby -my_tasks = client.tasks.find_by_tag(tag: tag_id, per_page: 5) +my_tasks = client.tasks.get_tasks_for_tag(tag: tag_id, per_page: 5) # => #<Asana::Collection<Task> ...> ``` An `Asana::Collection` is a paginated collection -- it holds the first `per_page` results, and a reference to the next page if any. @@ -224,20 +224,20 @@ All requests (except `DELETE`) accept extra I/O options [as documented in the API docs][io]. Just pass an extra `options` hash to any request: ```ruby -client.tasks.find_by_id(12, options: { expand: ['workspace'] }) +client.tasks.get_task(12, options: { expand: ['workspace'] }) ``` ### Attachment uploading To attach a file to a task or a project, you just need its absolute path on your filesystem and its MIME type, and the file will be uploaded for you: ```ruby -task = client.tasks.find_by_id(12) +task = client.tasks.get_task(12) attachment = task.attach(filename: '/absolute/path/to/my/file.png', mime: 'image/png') attachment.name # => 'file.png' ``` @@ -245,11 +245,11 @@ To subscribe to an event stream of a task or a project, just call `#events` on it: ```ruby -task = client.tasks.find_by_id(12) +task = client.tasks.get_task(12) task.events # => #<Asana::Events ...> # You can do the same with only the task id: events = client.events.for(task.id) ``` @@ -270,11 +270,11 @@ #### Subscribe to the event stream with a callback, polling every 2 seconds ```ruby # Run this in another thread so that we don't block forever -events = client.tasks.find_by_id(12).events(wait: 2) +events = client.tasks.get_task(12).events(wait: 2) Thread.new do events.each do |event| notify_someone "New event arrived! #{event}" end end @@ -284,11 +284,11 @@ To do that we need to call `#lazy` on the `Events` instance, just like with any other `Enumerable`. ```ruby -events = client.tasks.find_by_id(12).events +events = client.tasks.get_task(12).events only_change_events = events.lazy.select { |event| event.action == 'changed' } Thread.new do only_change_events.each do |event| notify_someone "New change event arrived! #{event}" end @@ -314,11 +314,11 @@ c.log_asana_change_warnings false ## Development -You'll need Ruby 2.5+ and Node v0.10.26+ / NPM 1.4.3+ installed. +You'll need Ruby 2.7+ and Node v0.10.26+ / NPM 1.4.3+ installed. After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment. Run the build with `rake`. This is equivalent to: @@ -327,10 +327,20 @@ To install this gem onto your local machine, run `bundle exec rake install`. ## Releasing a new version -To release a new version, run either of these commands: +Prerequisite: Before deployment, make sure you have Ruby version `2.7` installed + +### Automatic Deployment + +First, install dependencies: + +``` +bundle install +``` + +Then, to release a new version, run one of these commands: rake bump:patch rake bump:minor rake bump:major