Fixed some YARD documentation issues and changed how the user-agent is built.
authorBob Aman <bobaman@google.com>
Fri, 2 Dec 2011 13:43:55 +0000 (16:43 +0300)
committerBob Aman <bobaman@google.com>
Fri, 2 Dec 2011 13:43:55 +0000 (16:43 +0300)
13 files changed:
lib/google/api_client.rb
lib/google/api_client/discovery/api.rb
lib/google/api_client/discovery/method.rb
lib/google/api_client/discovery/resource.rb
lib/google/api_client/discovery/schema.rb
lib/google/api_client/environment.rb
lib/google/api_client/parser.rb
lib/google/api_client/parsers/json/error_parser.rb
lib/google/api_client/parsers/json/pagination.rb
lib/google/api_client/parsers/json_parser.rb
lib/google/api_client/reference.rb
lib/google/api_client/result.rb
lib/google/api_client/version.rb

index d68f53120a2308cca7dc98dbdbd4aba10a621ee1..f01a8d93ec619b56718ea972a3f9712df4f1fd4d 100644 (file)
@@ -24,6 +24,7 @@ require 'google/api_client/discovery'
 require 'google/api_client/reference'
 require 'google/api_client/result'
 
+
 module Google
   # TODO(bobaman): Document all this stuff.
 
@@ -47,8 +48,9 @@ module Google
     # @option options [String] :host ("www.googleapis.com")
     #   The API hostname used by the client.  This rarely needs to be changed.
     # @option options [String] :application_name
-    #   The name and version of the application using the client. This should
-    #   be given in the form `"{name}/{version}"`.
+    #   The name of the application using the client.
+    # @option options [String] :application_version
+    #   The version number of the application using the client.
     # @option options [String] :user_agent
     #   ("{app_name} google-api-ruby-client/{version} {os_name}/{os_version}")
     #   The user agent used by the client.  Most developers will want to
@@ -63,10 +65,16 @@ module Google
       self.host = options["host"] || 'www.googleapis.com'
       # Most developers will want to leave this value alone and use the
       # application_name option.
+      application_string = (
+        options["application_name"] ? (
+          "#{options["application_name"]}/" +
+          "#{options["application_version"] || '0.0.0'}"
+        ) : ""
+      )
       self.user_agent = options["user_agent"] || (
-        (options["application_name"] || '')
-        'google-api-ruby-client/' + VERSION::STRING +
-        ' ' + ENV::OS_VERSION
+        "#{application_string} " +
+        "google-api-ruby-client/#{VERSION::STRING} " +
+         ENV::OS_VERSION
       ).strip
       # The writer method understands a few Symbols and will generate useful
       # default authentication mechanisms.
@@ -148,7 +156,7 @@ module Google
     ##
     # The application's API key issued by the API console.
     #
-    # @return [String] The API key..
+    # @return [String] The API key.
     attr_accessor :key
 
     ##
index 8abea2d04efce5b548960e978d344cc045712b1e..57ca339bbea493b180f66eed216680253ecefcea 100644 (file)
@@ -19,6 +19,7 @@ require 'google/inflection'
 require 'google/api_client/discovery/resource'
 require 'google/api_client/discovery/method'
 
+
 module Google
   class APIClient
     ##
index 945e4809a7e72bea0e1dee0025fa428c4da54ed5..6c326d60c4538523543608dd1076dd376a495db7 100644 (file)
@@ -18,6 +18,7 @@ require 'addressable/template'
 
 require 'google/api_client/errors'
 
+
 module Google
   class APIClient
     ##
index 649ba3052fc0a95104e37a1a7fb61d829cda323a..ecd94e365004408f2f18287f4f18fe52c59e66a0 100644 (file)
@@ -18,6 +18,7 @@ require 'addressable/uri'
 require 'google/inflection'
 require 'google/api_client/discovery/method'
 
+
 module Google
   class APIClient
     ##
index 86f7ed3970f515954215c3ab6eb64909df580669..9421be1e1ca43b99b3cfa970a0c11e85b4b2c41c 100644 (file)
@@ -23,6 +23,7 @@ require 'addressable/template'
 require 'google/inflection'
 require 'google/api_client/errors'
 
+
 module Google
   class APIClient
     module Schema
index dbdb2d8ebeb53b187a841fcc9e02f9a3c3edf444..e5abe9334517c4bebac6daaf643419617eac6bff 100644 (file)
@@ -1,3 +1,18 @@
+# Copyright 2010 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
 module Google
   class APIClient
     module ENV
index e91351673d5074722cd169908bb03a16c66834a3..c8cb5365df24b8eac1228510633d07982265dcb2 100644 (file)
@@ -15,6 +15,7 @@
 
 require 'json'
 
+
 module Google
   class APIClient
     module Parser
index 719317a398f31924b3b75fd45f9925eb774fdb90..3a8a9256f9ef9212ea83a3e7bdde3504177eb8c2 100644 (file)
@@ -15,6 +15,7 @@
 
 require 'google/api_client/parsers/json_parser'
 
+
 module Google
   class APIClient
     module JSON
index cc4e2aa5a942e266f1eeca4354f05aab1c54085b..69581e2d018f8f93baff76ba67376a71bedcab2b 100644 (file)
@@ -15,6 +15,7 @@
 
 require 'google/api_client/parsers/json_parser'
 
+
 module Google
   class APIClient
     module JSON
index ff828bf33223fd6ebc121d01bab597e69f692605..b7c366ac7a4192ea08c36b1f846e74d93b27b974 100644 (file)
@@ -16,6 +16,7 @@
 require 'json'
 require 'google/api_client/parser'
 
+
 module Google
   class APIClient
     ##
index 572d33ddb3156b9d04a828706ba9129f01c5272f..0a24b0c5930fdab04871252addda73bb4d6f2d9d 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 require 'stringio'
 require 'json'
 require 'addressable/uri'
 require 'google/api_client/discovery'
 
+
 module Google
   class APIClient
     class Reference
index 72c3968814111c1c24d997911f64b98c418b8c1d..0abc1ac67f5a734fadd6bef0bc0cb1fa5dcca7c0 100644 (file)
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 module Google
   class APIClient
     ##
index 7e4890c52958fe3bd24fb96b2bd8296d6a53081f..7b6fae529c74f4c2dfea4d08ce262e88ad7262fd 100644 (file)
@@ -15,6 +15,8 @@
 
 # Used to prevent the class/module from being loaded more than once
 if !defined?(::Google::APIClient::VERSION)
+
+
   module Google
     class APIClient
       module VERSION