Hi all,
Steps 1-3 accomplished for a straight A+ :)
Step 4 is where things start falling apart :/
So I try it again - this time using the IRB like this (so I can document it here -- with the functions mentioned in the quickstart code alreade done ):
irb(main):050:0> APPLICATION_NAME = 'SDSGDS'
=> "SDSGDS"
irb(main):051:0> client = Google::APIClient.new(:application_name => APPLICATION_NAME)
=> #<Google::APIClient:0x007fcd4bf4dda8 @host="www.googleapis.com", @port=443, @discovery_path="/discovery/v1", @user_agent="SDSGDS/0.0.0 google-api-ruby-client/0.8.6 Mac OS X/10.10.5\n (gzip)", @authorization=#<Signet::OAuth2::Client:0x007fcd4bf4d790 @authorization_uri=#<Addressable::URI:0x3fe6a5fa6a24 URI:https://accounts.google.com/o/oauth2/auth>, @client_id=nil, @client_secret=nil, @code=nil, @expires_at=nil, @expires_in=nil, @issued_at=nil, @issuer=nil, @password=nil, @principal=nil, @redirect_uri=nil, @scope=nil, @state=nil, @token_credential_uri=#<Addressable::URI:0x3fe6a5fa67a4 URI:https://accounts.google.com/o/oauth2/token>, @username=nil, @expiry=60, @extension_parameters={}, @additional_parameters={}>, @auto_refresh_token=true, @key=nil, @user_ip=nil, @retries=0, @expired_auth_retry=true, @discovery_uris={}, @discovery_documents={}, @discovered_apis={}, @connection=#<Faraday::Connection:0x007fcd4bf4c9f8 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v0.9.1"}, @params={}, @options=#<Faraday::RequestOptions params_encoder=Faraday::FlatParamsEncoder>, @ssl=#<Faraday::SSLOptions verify=true, ca_file="/Users/walther/.rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/cacerts.pem">, @default_parallel_manager=nil, @builder=#<Faraday::RackBuilder:0x007fcd4bf4c5c0 @handlers=[Google::APIClient::Gzip, Faraday::Adapter::NetHttp]>, @url_prefix=#<URI::HTTP http:/>, @proxy=nil>>
irb(main):052:0> client.authorization = authorize
=> #<Signet::OAuth2::Client:0x007fcd4bf6e3f0 @authorization_uri=#<Addressable::URI:0x3fe6a5fb6fdc URI:https://accounts.google.com/o/oauth2/auth>, @client_id="39859237962-806r48ec7o66mckai0d82449la0pb6da.apps.googleusercontent.com", @client_secret="r0jMWdTlrp-kN0RoOqLu28QW", @code=nil, @expires_at=nil, @expires_in=3600, @issued_at=2015-09-18 14:36:35 +0200, @issuer=nil, @password=nil, @principal=nil, @redirect_uri=nil, @scope=nil, @state=nil, @token_credential_uri=#<Addressable::URI:0x3fe6a5fb6d0c URI:https://accounts.google.com/o/oauth2/token>, @username=nil, @expiry=60, @extension_parameters={}, @additional_parameters={}, @access_token="ya29.8gH3jZD4Q8yroUAqDFDBJQH9xvPa89m435UNknOKPvkUna2yNQUDmydWLBu2pE0dWwTmdg", @refresh_token="1/O1LDDoiFEr1bfLHzEaqpeiMZTCzmI1sADdPFfElz-YdIgOrJDtdun6zK6XiATCKT">
irb(main):053:0> directory_api = client.discovered_api('admin', 'directory_v1')
=> #<Google::APIClient::API:0x3fe6a5feff94 ID:admin:directory_v1>
irb(main):054:0> client.execute! api_method: directory_api.users.list, parameters: { maxResults: 10, viewType: 'domain_public', domain: 'ttfriskole.dk'} Google::APIClient::ClientError: Not Authorized to access this resource/api
from /Users/walther/.rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client.rb:662:in `block (2 levels) in execute!'
from /Users/walther/.rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/retriable-1.4.1/lib/retriable/retry.rb:27:in `perform'
from /Users/walther/.rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/retriable-1.4.1/lib/retriable.rb:15:in `retriable'
from /Users/walther/.rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client.rb:645:in `block in execute!'
from /Users/walther/.rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/retriable-1.4.1/lib/retriable/retry.rb:27:in `perform'
from /Users/walther/.rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/retriable-1.4.1/lib/retriable.rb:15:in `retriable'
from /Users/walther/.rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client.rb:636:in `execute!'
from (irb):54
from /Users/walther/.rbenv/versions/2.2.1/bin/irb:11:in `<main>'
Does this mean anything to anyone of you?
Like the quickstart says, on my first attempt I was prompted (calling ruby sdsgds.rb from my Terminal) in my browser to accept the permissions - which I obviously did; and closed the browser window.
Everything went just as predicted in the quickstart - until the client.execute!
any thoughts, hints, ideas are very welcome -
bonus info: my ruby (and rails) 'fu is not warrior-grade but I do make kind of a living off of it ;)
cheers,
Walther