google-ads-common 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 0.6.2:
2
+ - Requiring Savon as "~>" now.
3
+ - Updates to file headers.
4
+ - Marked all sources as utf-8.
5
+
1
6
  0.6.1:
2
7
  - Support for GZip compression.
3
8
  - Added logging of the response HTTP headers.
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 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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', '= 0.9.7')
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')
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
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 2011, Google Inc. All Rights Reserved.
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.1'
29
+ ADS_COMMON_VERSION = '0.6.2'
30
30
 
31
31
  # Get the available API versions.
32
32
  #
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.sgomes@gmail.com (Sérgio Gomes)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
30
+ # Encoding: utf-8
31
+ #
31
32
  # This is auto-generated code, changes will be overwritten.
32
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
33
- # License:: Licensed under the Apache License,Version 2.0 (the "License").
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
29
+ # Encoding: utf-8
30
+ #
30
31
  # This is auto-generated code, changes will be overwritten.
31
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
32
- # License:: Licensed under the Apache License,Version 2.0 (the "License").
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
 
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- @config = YAML::load_file(filename)
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.sgomes@gmail.com (Sérgio Gomes)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
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.1'
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,3 +1,5 @@
1
+ # Encoding: utf-8
2
+ #
1
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
2
4
  #
3
5
  # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
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
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
@@ -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)
@@ -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
  #
@@ -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
  #
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: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 1
10
- version: 0.6.1
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: 2011-12-23 00:00:00 +04:00
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: