Sha256: c68f798002ddb8a9642456ebc1f1cce804a3ca3a471c7f1cc20e9d6ef791a119

Contents?: true

Size: 892 Bytes

Versions: 24

Compression:

Stored size: 892 Bytes

Contents

require 'bundler'
Bundler.require
require 'asana'

id, secret = ENV['ASANA_CLIENT_ID'], ENV['ASANA_CLIENT_SECRET']
unless id && secret
  abort "Run this program with the env vars ASANA_CLIENT_ID and ASANA_CLIENT_SECRET.\n"  \
    "Refer to https://asana.com/developers/documentation/getting-started/authentication "\
    "to get your credentials." \
    "The redirect URI for your application should be \"urn:ietf:wg:oauth:2.0:oob\"."
end

access_token = Asana::Authentication::OAuth2.offline_flow(client_id: id,
                                                          client_secret: secret)
client = Asana::Client.new do |c|
  c.authentication :oauth2, access_token
end

puts "My Workspaces:"
client.workspaces.find_all.each do |workspace|
  puts "\t* #{workspace.name} - tags:"
  client.tags.find_by_workspace(workspace: workspace.id).each do |tag|
    puts "\t\t- #{tag.name}"
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
asana-2.0.0 examples/cli_app.rb
asana-1.0.0 examples/cli_app.rb
asana-0.10.13 examples/cli_app.rb
asana-0.10.12 examples/cli_app.rb
asana-0.10.3 examples/cli_app.rb
asana-0.10.2 examples/cli_app.rb
asana-0.10.1 examples/cli_app.rb
asana-0.10.0 examples/cli_app.rb
asana-0.9.3 examples/cli_app.rb
asana-0.9.2 examples/cli_app.rb
asana-0.9.1 examples/cli_app.rb
asana-0.9.0 examples/cli_app.rb
asana-0.8.1 examples/cli_app.rb
asana-0.8.0 examples/cli_app.rb
asana-0.6.3 examples/cli_app.rb
asana-0.6.2 examples/cli_app.rb
asana-0.6.0 examples/cli_app.rb
asana-0.5.0 examples/cli_app.rb
asana-0.4.0 examples/cli_app.rb
asana-0.3.0 examples/cli_app.rb