google-ads-common 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +5 -0
- data/README +2 -3
- data/Rakefile +3 -3
- data/lib/ads_common/api.rb +2 -2
- data/lib/ads_common/api_config.rb +3 -3
- data/lib/ads_common/auth/base_handler.rb +2 -2
- data/lib/ads_common/auth/client_login_handler.rb +2 -2
- data/lib/ads_common/auth/oauth_handler.rb +1 -1
- data/lib/ads_common/build/savon_abstract_generator.rb +2 -2
- data/lib/ads_common/build/savon_generator.rb +2 -2
- data/lib/ads_common/build/savon_registry.rb +1 -1
- data/lib/ads_common/build/savon_registry_generator.rb +7 -5
- data/lib/ads_common/build/savon_service_generator.rb +7 -5
- data/lib/ads_common/config.rb +11 -4
- data/lib/ads_common/credential_handler.rb +2 -2
- data/lib/ads_common/errors.rb +2 -2
- data/lib/ads_common/http.rb +2 -2
- data/lib/ads_common/parameters_validator.rb +1 -1
- data/lib/ads_common/savon_headers/base_header_handler.rb +2 -2
- data/lib/ads_common/savon_headers/httpi_request_proxy.rb +2 -0
- data/lib/ads_common/savon_headers/oauth_header_handler.rb +1 -1
- data/lib/ads_common/savon_headers/simple_header_handler.rb +2 -2
- data/lib/ads_common/savon_service.rb +1 -1
- data/test/test_config.rb +10 -1
- data/test/test_parameters_validator.rb +2 -1
- data/test/test_savon_service.rb +2 -1
- metadata +5 -5
data/ChangeLog
CHANGED
data/README
CHANGED
|
@@ -17,10 +17,9 @@ Install it using the gem install command.
|
|
|
17
17
|
$ gem install --local google-ads-common-VERSION.gem
|
|
18
18
|
|
|
19
19
|
The following gem libraries are required:
|
|
20
|
-
- savon v0.9.7;
|
|
20
|
+
- savon v0.9.7 or greater;
|
|
21
21
|
- httpi v0.9.3 or greater;
|
|
22
22
|
- httpclient v2.2.3 or greater.
|
|
23
|
-
- psych-1.2.2 or greater (for ruby-1.9.2 and later only).
|
|
24
23
|
|
|
25
24
|
= Docs for Developers
|
|
26
25
|
|
|
@@ -46,7 +45,7 @@ to run unit tests on the library
|
|
|
46
45
|
|
|
47
46
|
= Copyright/License Info
|
|
48
47
|
|
|
49
|
-
Copyright
|
|
48
|
+
Copyright 2010-2012, Google Inc. All Rights Reserved.
|
|
50
49
|
|
|
51
50
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
52
51
|
you may not use this file except in compliance with the License.
|
data/Rakefile
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -47,7 +47,7 @@ spec = Gem::Specification.new do |s|
|
|
|
47
47
|
s.test_files = tests
|
|
48
48
|
s.has_rdoc = true
|
|
49
49
|
s.extra_rdoc_files = docs
|
|
50
|
-
s.add_dependency('savon', '
|
|
50
|
+
s.add_dependency('savon', '~> 0.9.7')
|
|
51
51
|
s.add_dependency('httpclient', '~> 2.2.3')
|
|
52
52
|
s.add_dependency('httpi', '~> 0.9.3')
|
|
53
53
|
s.add_dependency('oauth', '~> 0.4.5')
|
data/lib/ads_common/api.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.sgomes@gmail.com (Sérgio Gomes)
|
|
4
4
|
# api.dklimkin@gmail.com (Danial Klimkin)
|
|
5
5
|
#
|
|
6
|
-
# Copyright:: Copyright
|
|
6
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
7
7
|
#
|
|
8
8
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
9
|
# you may not use this file except in compliance with the License.
|
|
@@ -26,7 +26,7 @@ module AdsCommon
|
|
|
26
26
|
# Contains helper methods for loading and managing the available services.
|
|
27
27
|
# This module is meant to be imported into API-specific modules.
|
|
28
28
|
module ApiConfig
|
|
29
|
-
ADS_COMMON_VERSION = '0.6.
|
|
29
|
+
ADS_COMMON_VERSION = '0.6.2'
|
|
30
30
|
|
|
31
31
|
# Get the available API versions.
|
|
32
32
|
#
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.sgomes@gmail.com (Sérgio Gomes)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -27,10 +27,12 @@ module AdsCommon
|
|
|
27
27
|
module Build
|
|
28
28
|
class SavonRegistryGenerator < SavonAbstractGenerator
|
|
29
29
|
REGISTRY_TEMPLATE = %q{<% %>
|
|
30
|
-
|
|
30
|
+
# Encoding: utf-8
|
|
31
|
+
#
|
|
31
32
|
# This is auto-generated code, changes will be overwritten.
|
|
32
|
-
#
|
|
33
|
-
#
|
|
33
|
+
#
|
|
34
|
+
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
|
35
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
|
34
36
|
#
|
|
35
37
|
# <%= @generator_stamp %>
|
|
36
38
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -26,10 +26,12 @@ module AdsCommon
|
|
|
26
26
|
module Build
|
|
27
27
|
class SavonServiceGenerator < SavonAbstractGenerator
|
|
28
28
|
SERVICE_TEMPLATE = %q{<% %>
|
|
29
|
-
|
|
29
|
+
# Encoding: utf-8
|
|
30
|
+
#
|
|
30
31
|
# This is auto-generated code, changes will be overwritten.
|
|
31
|
-
#
|
|
32
|
-
#
|
|
32
|
+
#
|
|
33
|
+
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
|
34
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
|
33
35
|
#
|
|
34
36
|
# <%= @generator_stamp %>
|
|
35
37
|
|
data/lib/ads_common/config.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
# rewrite it in memory.
|
|
22
22
|
|
|
23
23
|
require 'rubygems'
|
|
24
|
-
require 'psych' if RUBY_VERSION >= "1.9.2"
|
|
25
24
|
require 'yaml'
|
|
26
25
|
|
|
26
|
+
require 'ads_common/errors'
|
|
27
|
+
|
|
27
28
|
module AdsCommon
|
|
28
29
|
class Config
|
|
29
30
|
|
|
@@ -79,7 +80,13 @@ module AdsCommon
|
|
|
79
80
|
# - <b>Errno::ENOENT</b> if the file does not exist.
|
|
80
81
|
#
|
|
81
82
|
def load(filename)
|
|
82
|
-
|
|
83
|
+
new_config = YAML::load_file(filename)
|
|
84
|
+
if new_config.kind_of?(Hash)
|
|
85
|
+
@config = new_config
|
|
86
|
+
else
|
|
87
|
+
raise AdsCommon::Errors::Error,
|
|
88
|
+
"Incorrect configuration file: %s" % filename
|
|
89
|
+
end
|
|
83
90
|
return nil
|
|
84
91
|
end
|
|
85
92
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.sgomes@gmail.com (Sérgio Gomes)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
data/lib/ads_common/errors.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
data/lib/ads_common/http.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
@@ -89,7 +89,7 @@ module AdsCommon
|
|
|
89
89
|
app_name = credentials[:userAgent] || credentials[:useragent]
|
|
90
90
|
# We don't know the library version here. A breaking change needs to be
|
|
91
91
|
# introduced. This is scheduled for 0.7.0, using Common version for now.
|
|
92
|
-
lib_version = '0.6.
|
|
92
|
+
lib_version = '0.6.2'
|
|
93
93
|
soap_user_agent = "Common-Ruby-%s; %s" % [lib_version, app_name]
|
|
94
94
|
user_agent = "Savon/%s (%s)" % [Savon::Version, soap_user_agent]
|
|
95
95
|
user_agent += ' (gzip)' if @config.read('connection.enable_gzip', false)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Encoding: utf-8
|
|
2
2
|
#
|
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright
|
|
5
|
+
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
data/test/test_config.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/ruby
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# Encoding: utf-8
|
|
2
3
|
#
|
|
3
4
|
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
5
|
#
|
|
@@ -61,6 +62,14 @@ class TestConfig < Test::Unit::TestCase
|
|
|
61
62
|
assert_nil(config.read('unexisting.entry'))
|
|
62
63
|
end
|
|
63
64
|
|
|
65
|
+
# Test initializer with an incorrect existing file.
|
|
66
|
+
def test_initialize_filename
|
|
67
|
+
assert_raises (AdsCommon::Errors::Error) do
|
|
68
|
+
config = AdsCommon::Config.new('/dev/null')
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
|
|
64
73
|
# Test default result.
|
|
65
74
|
def test_read_default_result
|
|
66
75
|
config = AdsCommon::Config.new(DEFAULT_CONFIG_HASH)
|
data/test/test_savon_service.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-ads-common
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 3
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 6
|
|
9
|
-
-
|
|
10
|
-
version: 0.6.
|
|
9
|
+
- 2
|
|
10
|
+
version: 0.6.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Sergio Gomes
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date:
|
|
19
|
+
date: 2012-01-16 00:00:00 +04:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|
|
@@ -25,7 +25,7 @@ dependencies:
|
|
|
25
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
|
26
26
|
none: false
|
|
27
27
|
requirements:
|
|
28
|
-
- -
|
|
28
|
+
- - ~>
|
|
29
29
|
- !ruby/object:Gem::Version
|
|
30
30
|
hash: 53
|
|
31
31
|
segments:
|