adapi 0.1.5 → 0.2.0
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/README.md +77 -75
 - data/adapi.gemspec +5 -0
 - data/examples/add_invalid_keywords.rb +4 -9
 - data/examples/add_invalid_text_ad.rb +4 -13
 - data/examples/delete_ad_group.rb +1 -1
 - data/examples/log_to_specific_account.rb +6 -2
 - data/examples/update_text_ad.rb +1 -1
 - data/lib/adapi.rb +1 -1
 - data/lib/adapi/api.rb +25 -3
 - data/lib/adapi/campaign.rb +1 -1
 - data/lib/adapi/version.rb +8 -36
 - data/test/fixtures/adapi.yml +12 -21
 - data/test/integration/create_ad_group_test.rb +1 -0
 - data/test/integration/create_campaign_test.rb +1 -0
 - data/test/integration/find_location_test.rb +1 -0
 - data/test/integration_test_helper.rb +11 -0
 - data/test/test_helper.rb +6 -0
 - data/test/unit/ad_group_test.rb +0 -5
 - data/test/unit/config_test.rb +1 -14
 - metadata +51 -32
 - data/examples/custom_settings.yml +0 -30
 - data/examples/customize_configuration.rb +0 -18
 - data/test/fixtures/adwords_api.yml +0 -14
 - data/test/unit/ad_test.rb +0 -14
 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,7 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Adapi [](https://codeclimate.com/github/lstejskal/adapi)
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            *NEWS:* new version with support for AdWords API v201209 and test accounts will be released before the end of February 2013.
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
3 
     | 
    
         
             
            ## Description
         
     | 
| 
       6 
4 
     | 
    
         | 
| 
       7 
5 
     | 
    
         
             
            Adapi (ADwords API) is a Ruby library for easy and painless work with Google
         
     | 
| 
         @@ -23,7 +21,7 @@ come from there, but adapi takes it several steps further: 
     | 
|
| 
       23 
21 
     | 
    
         
             
            Adapi is *still in development* and not nearly done yet! Version 1.0.0 should
         
     | 
| 
       24 
22 
     | 
    
         
             
            have all planned functionality.
         
     | 
| 
       25 
23 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
            Adapi supports the latest version of AdWords API: * 
     | 
| 
      
 24 
     | 
    
         
            +
            Adapi supports the latest version of AdWords API: *v201209*. 
         
     | 
| 
       27 
25 
     | 
    
         | 
| 
       28 
26 
     | 
    
         
             
            ## Installation
         
     | 
| 
       29 
27 
     | 
    
         | 
| 
         @@ -40,34 +38,38 @@ rake install 
     | 
|
| 
       40 
38 
     | 
    
         | 
| 
       41 
39 
     | 
    
         
             
            ## Configuration
         
     | 
| 
       42 
40 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
            This section explains how to connect to specific AdWords account and client.
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
            #### Configuration by adwords_api.yml
         
     | 
| 
      
 41 
     | 
    
         
            +
            This section explains how to connect to specific AdWords account and client. The configuration
         
     | 
| 
      
 42 
     | 
    
         
            +
            structure is quite similar to the configuration of `google-adwords-api` gem.
         
     | 
| 
       47 
43 
     | 
    
         | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
            the same configuration will also work for adapi: `~/adwords_api.yml`
         
     | 
| 
      
 44 
     | 
    
         
            +
            There are several options to choose from:
         
     | 
| 
       50 
45 
     | 
    
         | 
| 
       51 
46 
     | 
    
         
             
            #### Single account set directly in code
         
     | 
| 
       52 
47 
     | 
    
         | 
| 
       53 
48 
     | 
    
         
             
            ```ruby
         
     | 
| 
       54 
     | 
    
         
            -
            Adapi::Config.load_settings(: 
     | 
| 
       55 
     | 
    
         
            -
              : 
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
                    : 
     | 
| 
       62 
     | 
    
         
            -
                    : 
     | 
| 
      
 49 
     | 
    
         
            +
            Adapi::Config.load_settings( in_hash: {
         
     | 
| 
      
 50 
     | 
    
         
            +
              production: {
         
     | 
| 
      
 51 
     | 
    
         
            +
                authentication: {
         
     | 
| 
      
 52 
     | 
    
         
            +
                  method:                 "OAuth2",
         
     | 
| 
      
 53 
     | 
    
         
            +
                  oauth2_client_id:       "abc",
         
     | 
| 
      
 54 
     | 
    
         
            +
                  oauth2_client_secret:   "def",
         
     | 
| 
      
 55 
     | 
    
         
            +
                  oauth2_token: {
         
     | 
| 
      
 56 
     | 
    
         
            +
                    access_token:         "123",
         
     | 
| 
      
 57 
     | 
    
         
            +
                    refresh_token:        "456",
         
     | 
| 
      
 58 
     | 
    
         
            +
                    issued_at:            "2013-03-03 13:33:39.734203841 +01:00",
         
     | 
| 
      
 59 
     | 
    
         
            +
                    expires_in:           3600,
         
     | 
| 
      
 60 
     | 
    
         
            +
                    id_token:             nil
         
     | 
| 
       63 
61 
     | 
    
         
             
                  },
         
     | 
| 
       64 
     | 
    
         
            -
                  : 
     | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
       66 
     | 
    
         
            -
                   
     | 
| 
      
 62 
     | 
    
         
            +
                  developer_token:        "789",
         
     | 
| 
      
 63 
     | 
    
         
            +
                  user_agent:             "My Adwords API Client",
         
     | 
| 
      
 64 
     | 
    
         
            +
                  client_customer_id:     "555-666-7777"
         
     | 
| 
      
 65 
     | 
    
         
            +
                },
         
     | 
| 
      
 66 
     | 
    
         
            +
                service: {
         
     | 
| 
      
 67 
     | 
    
         
            +
                  environment: "PRODUCTION"
         
     | 
| 
      
 68 
     | 
    
         
            +
                }
         
     | 
| 
       67 
69 
     | 
    
         
             
              }
         
     | 
| 
       68 
70 
     | 
    
         
             
            })
         
     | 
| 
       69 
71 
     | 
    
         | 
| 
       70 
     | 
    
         
            -
            Adapi::Config.set(: 
     | 
| 
      
 72 
     | 
    
         
            +
            Adapi::Config.set(:production)
         
     | 
| 
       71 
73 
     | 
    
         
             
            ```
         
     | 
| 
       72 
74 
     | 
    
         | 
| 
       73 
75 
     | 
    
         
             
            #### Multiple accounts set directly in code
         
     | 
| 
         @@ -76,31 +78,9 @@ You can set many AdWords accounts to connect to and switch between while running 
     | 
|
| 
       76 
78 
     | 
    
         
             
            the application. You can even update single values of the settings on-the-fly.
         
     | 
| 
       77 
79 
     | 
    
         | 
| 
       78 
80 
     | 
    
         
             
            ```ruby 
         
     | 
| 
       79 
     | 
    
         
            -
            Adapi::Config.load_settings(: 
     | 
| 
       80 
     | 
    
         
            -
              : 
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
                  :method => 'ClientLogin',
         
     | 
| 
       83 
     | 
    
         
            -
                  :email => 'coca_cola_email@gmail.com',
         
     | 
| 
       84 
     | 
    
         
            -
                  :password => 'coca_cola_password',
         
     | 
| 
       85 
     | 
    
         
            -
                  :developer_token => 'coca_cola_developer_token',
         
     | 
| 
       86 
     | 
    
         
            -
                  :user_agent => 'Coca-Cola Adwords API Test'
         
     | 
| 
       87 
     | 
    
         
            -
                },
         
     | 
| 
       88 
     | 
    
         
            -
                :service => {
         
     | 
| 
       89 
     | 
    
         
            -
                  :environment => 'SANDBOX'
         
     | 
| 
       90 
     | 
    
         
            -
                }
         
     | 
| 
       91 
     | 
    
         
            -
              },
         
     | 
| 
       92 
     | 
    
         
            -
             :pepsi => {
         
     | 
| 
       93 
     | 
    
         
            -
                :authentication => {
         
     | 
| 
       94 
     | 
    
         
            -
                  :method => 'ClientLogin',
         
     | 
| 
       95 
     | 
    
         
            -
                  :email => 'pepsi_email@gmail.com',
         
     | 
| 
       96 
     | 
    
         
            -
                  :password => 'pepsi_password',
         
     | 
| 
       97 
     | 
    
         
            -
                  :developer_token => 'pepsi_developer_token',
         
     | 
| 
       98 
     | 
    
         
            -
                  :user_agent => 'Pepsi Adwords API Test'
         
     | 
| 
       99 
     | 
    
         
            -
                },
         
     | 
| 
       100 
     | 
    
         
            -
                :service => {
         
     | 
| 
       101 
     | 
    
         
            -
                  :environment => 'SANDBOX'
         
     | 
| 
       102 
     | 
    
         
            -
                }
         
     | 
| 
       103 
     | 
    
         
            -
              }
         
     | 
| 
      
 81 
     | 
    
         
            +
            Adapi::Config.load_settings( in_hash: {
         
     | 
| 
      
 82 
     | 
    
         
            +
              coca_cola:  config_hash_for_coca_cola,
         
     | 
| 
      
 83 
     | 
    
         
            +
              pepsi:      config_hash_for_pepsi
         
     | 
| 
       104 
84 
     | 
    
         
             
            })
         
     | 
| 
       105 
85 
     | 
    
         | 
| 
       106 
86 
     | 
    
         
             
            # set to pepsi and specific client       
         
     | 
| 
         @@ -120,54 +100,76 @@ Stored in `~/adapi.yml`. Supports multiple accounts, which are identifed by 
     | 
|
| 
       120 
100 
     | 
    
         
             
            aliases. Example:
         
     | 
| 
       121 
101 
     | 
    
         | 
| 
       122 
102 
     | 
    
         
             
            ```
         
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
       123 
104 
     | 
    
         
             
            :default:
         
     | 
| 
       124 
105 
     | 
    
         
             
              :authentication:
         
     | 
| 
       125 
     | 
    
         
            -
                :method:  
     | 
| 
       126 
     | 
    
         
            -
                : 
     | 
| 
       127 
     | 
    
         
            -
                : 
     | 
| 
       128 
     | 
    
         
            -
                : 
     | 
| 
       129 
     | 
    
         
            -
             
     | 
| 
      
 106 
     | 
    
         
            +
                :method: OAuth2
         
     | 
| 
      
 107 
     | 
    
         
            +
                :oauth2_client_id: "abc"
         
     | 
| 
      
 108 
     | 
    
         
            +
                :oauth2_client_secret: "def"
         
     | 
| 
      
 109 
     | 
    
         
            +
                :oauth2_token:
         
     | 
| 
      
 110 
     | 
    
         
            +
                    :access_token: "123"
         
     | 
| 
      
 111 
     | 
    
         
            +
                    :refresh_token: "456"
         
     | 
| 
      
 112 
     | 
    
         
            +
                    :issued_at: 2013-03-03 13:33:39.734203841 +01:00
         
     | 
| 
      
 113 
     | 
    
         
            +
                    :expires_in: 3600
         
     | 
| 
      
 114 
     | 
    
         
            +
                    :id_token:
         
     | 
| 
      
 115 
     | 
    
         
            +
                :developer_token: "789"
         
     | 
| 
       130 
116 
     | 
    
         
             
                :user_agent: My Adwords API Client
         
     | 
| 
      
 117 
     | 
    
         
            +
                :client_customer_id: 555-666-7777
         
     | 
| 
       131 
118 
     | 
    
         
             
              :service:
         
     | 
| 
       132 
119 
     | 
    
         
             
                :environment: PRODUCTION
         
     | 
| 
      
 120 
     | 
    
         
            +
              :library:
         
     | 
| 
      
 121 
     | 
    
         
            +
                :log_level: WARN
         
     | 
| 
      
 122 
     | 
    
         
            +
                :log_path: /tmp/adapi.log
         
     | 
| 
      
 123 
     | 
    
         
            +
                :log_pretty_format: true
         
     | 
| 
       133 
124 
     | 
    
         | 
| 
       134 
     | 
    
         
            -
            :sandbox:
         
     | 
| 
       135 
     | 
    
         
            -
              :authentication:
         
     | 
| 
       136 
     | 
    
         
            -
                :method: ClientLogin
         
     | 
| 
       137 
     | 
    
         
            -
                :email: sandbox_email@gmail.com
         
     | 
| 
       138 
     | 
    
         
            -
                :password: sandbox_password
         
     | 
| 
       139 
     | 
    
         
            -
                :developer_token: sandbox_token
         
     | 
| 
       140 
     | 
    
         
            -
                :client_customer_id: 555-666-7777
         
     | 
| 
       141 
     | 
    
         
            -
                :user_agent: Adwords API Test
         
     | 
| 
       142 
     | 
    
         
            -
              :service:
         
     | 
| 
       143 
     | 
    
         
            -
                :environment: SANDBOX
         
     | 
| 
       144 
125 
     | 
    
         
             
            ```
         
     | 
| 
       145 
126 
     | 
    
         | 
| 
       146 
127 
     | 
    
         
             
            To tell adapi which account to use:
         
     | 
| 
       147 
128 
     | 
    
         | 
| 
       148 
129 
     | 
    
         
             
            ```ruby
         
     | 
| 
       149 
     | 
    
         
            -
            Adapi::Config.set(: 
     | 
| 
      
 130 
     | 
    
         
            +
            Adapi::Config.set(:production)
         
     | 
| 
       150 
131 
     | 
    
         
             
            ```
         
     | 
| 
       151 
132 
     | 
    
         | 
| 
       152 
133 
     | 
    
         
             
            `:default` account is, as name implies, used by default. If you don't have
         
     | 
| 
       153 
134 
     | 
    
         
             
            `:default` account available, you have to manually set account alias to
         
     | 
| 
       154 
135 
     | 
    
         
             
            `Adapi::Config`.
         
     | 
| 
       155 
136 
     | 
    
         | 
| 
       156 
     | 
    
         
            -
            ###  
     | 
| 
      
 137 
     | 
    
         
            +
            ### How to get OAuth2 token
         
     | 
| 
      
 138 
     | 
    
         
            +
             
     | 
| 
      
 139 
     | 
    
         
            +
            * get `oauth2_client_id` and `oauth2_client_secret`: [https://code.google.com/p/google-api-ads-ruby/wiki/OAuth2][https://code.google.com/p/google-api-ads-ruby/wiki/OAuth2]
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
            * put them into adapi configuration file
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
            * run following script:
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 146 
     | 
    
         
            +
            require 'adapi'
         
     | 
| 
      
 147 
     | 
    
         
            +
            require 'yaml'
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
            adapi_object = Adapi::Location.new() # load any adapi object
         
     | 
| 
      
 150 
     | 
    
         
            +
            adwords_api = adapi_object.adwords # get adwords object
         
     | 
| 
      
 151 
     | 
    
         
            +
             
     | 
| 
      
 152 
     | 
    
         
            +
            # got to url and paste verification code to the script
         
     | 
| 
      
 153 
     | 
    
         
            +
            oauth2_token = adwords.authorize() do |auth_url|
         
     | 
| 
      
 154 
     | 
    
         
            +
              puts "Go to URL:\n\t%s" % auth_url
         
     | 
| 
      
 155 
     | 
    
         
            +
              print 'log in and type the verification code: '
         
     | 
| 
      
 156 
     | 
    
         
            +
              gets.chomp
         
     | 
| 
      
 157 
     | 
    
         
            +
            end
         
     | 
| 
      
 158 
     | 
    
         
            +
             
     | 
| 
      
 159 
     | 
    
         
            +
            puts oauth2_token.to_yaml 
         
     | 
| 
      
 160 
     | 
    
         
            +
            ```
         
     | 
| 
      
 161 
     | 
    
         
            +
             
     | 
| 
      
 162 
     | 
    
         
            +
            * put `oauth2_token` hash adapi configuration file
         
     | 
| 
       157 
163 
     | 
    
         | 
| 
       158 
     | 
    
         
            -
             
     | 
| 
       159 
     | 
    
         
            -
            * if `~/adapi.yml`doesn't exist, try to load configuration from
         
     | 
| 
       160 
     | 
    
         
            -
              `~/adwords_api.yml` (used by adwords-api gem)
         
     | 
| 
       161 
     | 
    
         
            -
            * if there are no configuration files available, set configuration directly to
         
     | 
| 
       162 
     | 
    
         
            -
              `Adapi::Config` (overrides previous settings)
         
     | 
| 
      
 164 
     | 
    
         
            +
            Code taken from this google-adwords-api example: [https://code.google.com/p/google-api-ads-ruby/source/browse/adwords_api/examples/v201209/misc/use_oauth2.rb][https://code.google.com/p/google-api-ads-ruby/source/browse/adwords_api/examples/v201209/misc/use_oauth2.rb]
         
     | 
| 
       163 
165 
     | 
    
         | 
| 
       164 
166 
     | 
    
         
             
            ## API Version Support
         
     | 
| 
       165 
167 
     | 
    
         | 
| 
       166 
     | 
    
         
            -
            Adapi supports the latest version of AdWords API: * 
     | 
| 
      
 168 
     | 
    
         
            +
            Adapi supports the latest version of AdWords API: *v201209*. 
         
     | 
| 
       167 
169 
     | 
    
         | 
| 
       168 
170 
     | 
    
         
             
            For support of earlier versions of AdWords API, downgrade to earlier 
         
     | 
| 
       169 
     | 
    
         
            -
            versions of adapi: 0.0.9 for *v201109_1*, 0.07 for *v201109*. 
         
     | 
| 
       170 
     | 
    
         
            -
            (You shoudn't need it though,  
     | 
| 
      
 171 
     | 
    
         
            +
            versions of adapi: 0.1.5 for *v201206*, 0.0.9 for *v201109_1*, 0.07 for *v201109*. 
         
     | 
| 
      
 172 
     | 
    
         
            +
            (You shoudn't need it though, older versions of AdWords API are 
         
     | 
| 
       171 
173 
     | 
    
         
             
            eventually shut down.) Latest revision for specific AdWords API version 
         
     | 
| 
       172 
174 
     | 
    
         
             
            is also marked by a tag.
         
     | 
| 
       173 
175 
     | 
    
         | 
| 
         @@ -178,8 +180,8 @@ and update your code accordingly. Adapi won't accept obsolete attributes etc. 
     | 
|
| 
       178 
180 
     | 
    
         | 
| 
       179 
181 
     | 
    
         
             
            ## Unsupported AdWords services
         
     | 
| 
       180 
182 
     | 
    
         | 
| 
       181 
     | 
    
         
            -
            Following AdWords services are not supported by adapi at the moment 
     | 
| 
       182 
     | 
    
         
            -
             
     | 
| 
      
 183 
     | 
    
         
            +
            Following AdWords services are not supported by adapi at the moment, and exist
         
     | 
| 
      
 184 
     | 
    
         
            +
            only on my TODO list:
         
     | 
| 
       183 
185 
     | 
    
         | 
| 
       184 
186 
     | 
    
         
             
            * Campaign Data Management
         
     | 
| 
       185 
187 
     | 
    
         
             
              * ConversionTrackerService
         
     | 
| 
         @@ -433,5 +435,5 @@ Example of logger configuration: 
     | 
|
| 
       433 
435 
     | 
    
         | 
| 
       434 
436 
     | 
    
         
             
            ## Author
         
     | 
| 
       435 
437 
     | 
    
         | 
| 
       436 
     | 
    
         
            -
            2011- 
     | 
| 
      
 438 
     | 
    
         
            +
            2011-2013 Lukas Stejskal, Ataxo Interactive, a.s.
         
     | 
| 
       437 
439 
     | 
    
         | 
    
        data/adapi.gemspec
    CHANGED
    
    | 
         @@ -37,9 +37,14 @@ Gem::Specification.new do |s| 
     | 
|
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
              s.add_development_dependency "yard", "~> 0.8"
         
     | 
| 
       39 
39 
     | 
    
         
             
              s.add_development_dependency "turn", "~> 0.9.6"
         
     | 
| 
      
 40 
     | 
    
         
            +
              # if this breaks budnle, run: bundle update shoulda-matchers
         
     | 
| 
      
 41 
     | 
    
         
            +
              # this is a HOTFIX, can be removed when this bug is resolved:
         
     | 
| 
      
 42 
     | 
    
         
            +
              # https://github.com/thoughtbot/shoulda-matchers/issues/235
         
     | 
| 
      
 43 
     | 
    
         
            +
              s.add_development_dependency "shoulda-matchers", "1.4.1"
         
     | 
| 
       40 
44 
     | 
    
         
             
              s.add_development_dependency "shoulda", "~> 3.1"
         
     | 
| 
       41 
45 
     | 
    
         
             
              s.add_development_dependency "fakeweb", "~> 1.3"
         
     | 
| 
       42 
46 
     | 
    
         
             
              s.add_development_dependency "factory_girl", "~> 3.3"
         
     | 
| 
       43 
47 
     | 
    
         
             
              s.add_development_dependency "minitest", "~> 3.3"
         
     | 
| 
      
 48 
     | 
    
         
            +
              s.add_development_dependency('mocha', '~> 0.13.3')
         
     | 
| 
       44 
49 
     | 
    
         | 
| 
       45 
50 
     | 
    
         
             
            end
         
     | 
| 
         @@ -2,15 +2,10 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            require 'adapi'
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
            #  
     | 
| 
       6 
     | 
    
         
            -
            #
         
     | 
| 
       7 
     | 
    
         
            -
            #  
     | 
| 
       8 
     | 
    
         
            -
            #  
     | 
| 
       9 
     | 
    
         
            -
            #
         
     | 
| 
       10 
     | 
    
         
            -
            #Adapi::Config.load_settings
         
     | 
| 
       11 
     | 
    
         
            -
            #Adapi::Config.set(:production_settings)
         
     | 
| 
       12 
     | 
    
         
            -
            #
         
     | 
| 
       13 
     | 
    
         
            -
            #pp "Running in #{Adapi::Config.read[:service][:environment]}"
         
     | 
| 
      
 5 
     | 
    
         
            +
            # Example work-flow:
         
     | 
| 
      
 6 
     | 
    
         
            +
            # * try to add keywords which will trigger policy violation errors (PolicyViolationError)
         
     | 
| 
      
 7 
     | 
    
         
            +
            # * adapi will perform exemption requests (check the adapi log for more details)
         
     | 
| 
      
 8 
     | 
    
         
            +
            # * if keyword errors are exemptable, they will be eventually added
         
     | 
| 
       14 
9 
     | 
    
         | 
| 
       15 
10 
     | 
    
         
             
            # create ad group
         
     | 
| 
       16 
11 
     | 
    
         
             
            require_relative 'add_bare_ad_group'
         
     | 
| 
         @@ -1,21 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         | 
| 
       2 
2 
     | 
    
         
             
            require 'adapi'
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
            # PolicyViolations will appear only in production, not in sandbox
         
     | 
| 
       5 
     | 
    
         
            -
            #
         
     | 
| 
       6 
     | 
    
         
            -
            # Adapi performs exemption requests on receiving policy violation errors.
         
     | 
| 
       7 
     | 
    
         
            -
            # If text_ad errors are exemptable, they will eventually pass.
         
     | 
| 
       8 
     | 
    
         
            -
            #
         
     | 
| 
       9 
     | 
    
         
            -
            #Adapi::Config.load_settings
         
     | 
| 
       10 
     | 
    
         
            -
            #Adapi::Config.set(:production_settings)
         
     | 
| 
       11 
     | 
    
         
            -
            #
         
     | 
| 
       12 
     | 
    
         
            -
            #pp "Running in #{Adapi::Config.read[:service][:environment]}"
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
4 
     | 
    
         
             
            require_relative 'add_bare_ad_group'
         
     | 
| 
       15 
5 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
            #  
     | 
| 
       17 
     | 
    
         
            -
            #  
     | 
| 
       18 
     | 
    
         
            -
            #
         
     | 
| 
      
 6 
     | 
    
         
            +
            # Example workflow:
         
     | 
| 
      
 7 
     | 
    
         
            +
            # * "ho", which is suspicious word in English, will trigger exemptable PolicyViolationError
         
     | 
| 
      
 8 
     | 
    
         
            +
            # * adapi performs exemption request(s) and text_ad will eventually pass
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
       19 
10 
     | 
    
         
             
            $ad = Adapi::Ad::TextAd.create(
         
     | 
| 
       20 
11 
     | 
    
         
             
              :ad_group_id => $ad_group[:id],
         
     | 
| 
       21 
12 
     | 
    
         
             
              :headline => "Neo Blog - poznej ho",
         
     | 
    
        data/examples/delete_ad_group.rb
    CHANGED
    
    
| 
         @@ -12,7 +12,7 @@ Adapi::Config.load_settings(:in_hash => { 
     | 
|
| 
       12 
12 
     | 
    
         
             
                  :user_agent => 'Coca-Cola Adwords API Test'
         
     | 
| 
       13 
13 
     | 
    
         
             
                },
         
     | 
| 
       14 
14 
     | 
    
         
             
                :service => {
         
     | 
| 
       15 
     | 
    
         
            -
                  :environment => ' 
     | 
| 
      
 15 
     | 
    
         
            +
                  :environment => 'PRODUCTION'
         
     | 
| 
       16 
16 
     | 
    
         
             
                }
         
     | 
| 
       17 
17 
     | 
    
         
             
              },
         
     | 
| 
       18 
18 
     | 
    
         
             
             :pepsi => {
         
     | 
| 
         @@ -24,11 +24,15 @@ Adapi::Config.load_settings(:in_hash => { 
     | 
|
| 
       24 
24 
     | 
    
         
             
                  :user_agent => 'Pepsi Adwords API Test'
         
     | 
| 
       25 
25 
     | 
    
         
             
                },
         
     | 
| 
       26 
26 
     | 
    
         
             
                :service => {
         
     | 
| 
       27 
     | 
    
         
            -
                  :environment => ' 
     | 
| 
      
 27 
     | 
    
         
            +
                  :environment => 'PRODUCTION'
         
     | 
| 
       28 
28 
     | 
    
         
             
                }
         
     | 
| 
       29 
29 
     | 
    
         
             
              }
         
     | 
| 
       30 
30 
     | 
    
         
             
            })
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
            Adapi::Config.set(:pepsi, :client_customer_id => '555-666-7777')
         
     | 
| 
      
 33 
     | 
    
         
            +
            p "PEPSI"
         
     | 
| 
      
 34 
     | 
    
         
            +
            p Adapi::Config.read
         
     | 
| 
       33 
35 
     | 
    
         | 
| 
      
 36 
     | 
    
         
            +
            Adapi::Config.set(:coca_cola, :client_customer_id => '111-222-3333')
         
     | 
| 
      
 37 
     | 
    
         
            +
            p "COCA_COLA"
         
     | 
| 
       34 
38 
     | 
    
         
             
            p Adapi::Config.read
         
     | 
    
        data/examples/update_text_ad.rb
    CHANGED
    
    
    
        data/lib/adapi.rb
    CHANGED
    
    
    
        data/lib/adapi/api.rb
    CHANGED
    
    | 
         @@ -44,9 +44,31 @@ module Adapi 
     | 
|
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
                  raise "Missing Service Name" unless params[:service_name]
         
     | 
| 
       46 
46 
     | 
    
         | 
| 
       47 
     | 
    
         
            -
                   
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
                   
     | 
| 
      
 47 
     | 
    
         
            +
                  @adwords = params[:adwords_api_instance]
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                  # REFACTOR
         
     | 
| 
      
 50 
     | 
    
         
            +
                  unless @adwords
         
     | 
| 
      
 51 
     | 
    
         
            +
                    @adwords = AdwordsApi::Api.new(Adapi::Config.read)
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                    authentication_method = Adapi::Config.read[:authentication][:method].to_s.upcase
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                    case authentication_method
         
     | 
| 
      
 56 
     | 
    
         
            +
                    when "CLIENTLOGIN", "OAUTH"
         
     | 
| 
      
 57 
     | 
    
         
            +
                      warn "#{authentication_method} is nearly obsolete, please update to OAuth2"
         
     | 
| 
      
 58 
     | 
    
         
            +
                    when "OAUTH2_JWT"
         
     | 
| 
      
 59 
     | 
    
         
            +
                      raise "OAUTH2_JWT is not yet implemented, please use OAUTH2 instead"
         
     | 
| 
      
 60 
     | 
    
         
            +
                    # authorize to oauth2
         
     | 
| 
      
 61 
     | 
    
         
            +
                    when "OAUTH2"
         
     | 
| 
      
 62 
     | 
    
         
            +
                      oauth2_token = Adapi::Config.read[:authentication][:oauth2_token]
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                      if oauth2_token.nil? || oauth2_token.class != Hash 
         
     | 
| 
      
 65 
     | 
    
         
            +
                        raise "Missing or invalid OAuth2 token"
         
     | 
| 
      
 66 
     | 
    
         
            +
                      end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                      @adwords.authorize({:oauth2_verification_code => $token})
         
     | 
| 
      
 69 
     | 
    
         
            +
                    end
         
     | 
| 
      
 70 
     | 
    
         
            +
                  end
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
       50 
72 
     | 
    
         
             
                  @adwords.logger = LOGGER if LOGGER
         
     | 
| 
       51 
73 
     | 
    
         
             
                  @version = API_VERSION
         
     | 
| 
       52 
74 
     | 
    
         
             
                  @service = @adwords.service(params[:service_name].to_sym, @version)
         
     | 
    
        data/lib/adapi/campaign.rb
    CHANGED
    
    | 
         @@ -8,7 +8,7 @@ module Adapi 
     | 
|
| 
       8 
8 
     | 
    
         
             
              class Campaign < Api
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
                NETWORK_SETTING_KEYS = [ :target_google_search, :target_search_network, 
         
     | 
| 
       11 
     | 
    
         
            -
                  :target_content_network, : 
     | 
| 
      
 11 
     | 
    
         
            +
                  :target_content_network, :target_partner_search_network ]
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                ATTRIBUTES = [ :name, :status, :serving_status, :start_date, :end_date, :budget,
         
     | 
| 
       14 
14 
     | 
    
         
             
                  :bidding_strategy, :network_setting, :campaign_stats, :criteria, :ad_groups,
         
     | 
    
        data/lib/adapi/version.rb
    CHANGED
    
    | 
         @@ -1,10 +1,17 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # encoding: utf-8
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module Adapi
         
     | 
| 
       4 
     | 
    
         
            -
              VERSION = "0. 
     | 
| 
      
 4 
     | 
    
         
            +
              VERSION = "0.2.0"
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
              # CHANGELOG:
         
     | 
| 
       7 
7 
     | 
    
         
             
              #
         
     | 
| 
      
 8 
     | 
    
         
            +
              # 0.2.0
         
     | 
| 
      
 9 
     | 
    
         
            +
              # updated to AdWords API version v201209
         
     | 
| 
      
 10 
     | 
    
         
            +
              # switched authentication to OAuth2
         
     | 
| 
      
 11 
     | 
    
         
            +
              # updated README
         
     | 
| 
      
 12 
     | 
    
         
            +
              # updated tests and examples 
         
     | 
| 
      
 13 
     | 
    
         
            +
              # removed compatibility of config setting with adwords-api
         
     | 
| 
      
 14 
     | 
    
         
            +
              #
         
     | 
| 
       8 
15 
     | 
    
         
             
              # 0.1.5
         
     | 
| 
       9 
16 
     | 
    
         
             
              # updated gems - second try to fix the "bundle install" infinite loop
         
     | 
| 
       10 
17 
     | 
    
         
             
              #
         
     | 
| 
         @@ -44,39 +51,4 @@ module Adapi 
     | 
|
| 
       44 
51 
     | 
    
         
             
              # added conversion of legacy province_code to province_name in location search
         
     | 
| 
       45 
52 
     | 
    
         
             
              # added tests for Campaign, CampaignCriterion and Location service
         
     | 
| 
       46 
53 
     | 
    
         
             
              # added Getting Started section to README
         
     | 
| 
       47 
     | 
    
         
            -
              #
         
     | 
| 
       48 
     | 
    
         
            -
              # 0.0.7
         
     | 
| 
       49 
     | 
    
         
            -
              # fix Location search by country code
         
     | 
| 
       50 
     | 
    
         
            -
              # hotfix OAuth
         
     | 
| 
       51 
     | 
    
         
            -
              #
         
     | 
| 
       52 
     | 
    
         
            -
              # 0.0.6
         
     | 
| 
       53 
     | 
    
         
            -
              # updated to latest adwords-api and ads-common gems, which fix many issues with AdWords API version v201109
         
     | 
| 
       54 
     | 
    
         
            -
              # fix CampaignCriterion service
         
     | 
| 
       55 
     | 
    
         
            -
              # fix examples
         
     | 
| 
       56 
     | 
    
         
            -
              #
         
     | 
| 
       57 
     | 
    
         
            -
              # 0.0.5
         
     | 
| 
       58 
     | 
    
         
            -
              # converted to AdWords API version v201109
         
     | 
| 
       59 
     | 
    
         
            -
              #   moved from CampaignTarget to CampaignCriterion
         
     | 
| 
       60 
     | 
    
         
            -
              #   implemented Location and Language finders
         
     | 
| 
       61 
     | 
    
         
            -
              # started writing integration tests
         
     | 
| 
       62 
     | 
    
         
            -
              # added logging of SOAP requests
         
     | 
| 
       63 
     | 
    
         
            -
              #
         
     | 
| 
       64 
     | 
    
         
            -
              # 0.0.4
         
     | 
| 
       65 
     | 
    
         
            -
              # changed README to markdown format
         
     | 
| 
       66 
     | 
    
         
            -
              # updated DSL for creating campaign and campaign target
         
     | 
| 
       67 
     | 
    
         
            -
              # implemented find methods for campaigns and ad groups
         
     | 
| 
       68 
     | 
    
         
            -
              # implemented getting complete campaigns (in one hash with targets, ad groups, keywords and ads)
         
     | 
| 
       69 
     | 
    
         
            -
              #
         
     | 
| 
       70 
     | 
    
         
            -
              # 0.0.3
         
     | 
| 
       71 
     | 
    
         
            -
              # converted to ActiveModel
         
     | 
| 
       72 
     | 
    
         
            -
              # moved common functionality to Api class
         
     | 
| 
       73 
     | 
    
         
            -
              # changed http client to curb and hotfix ssl authentication bug in HTTPI
         
     | 
| 
       74 
     | 
    
         
            -
              # added basic error handling
         
     | 
| 
       75 
     | 
    
         
            -
              # changed DSL for Campaign attributes
         
     | 
| 
       76 
     | 
    
         
            -
              # changed Ad model to general Ad model and moved TextAd to separate model
         
     | 
| 
       77 
     | 
    
         
            -
              # added support for more target types and changed DSL for CampaignTarget
         
     | 
| 
       78 
     | 
    
         
            -
              # converted to Ruby 1.9.2 (should work in Ruby 1.8.7 as well)
         
     | 
| 
       79 
     | 
    
         
            -
              #
         
     | 
| 
       80 
     | 
    
         
            -
              # 0.0.2
         
     | 
| 
       81 
     | 
    
         
            -
              # [FIX] switched google gem dependencies from edge to stable release
         
     | 
| 
       82 
54 
     | 
    
         
             
            end
         
     | 
    
        data/test/fixtures/adapi.yml
    CHANGED
    
    | 
         @@ -1,30 +1,21 @@ 
     | 
|
| 
       1 
1 
     | 
    
         | 
| 
       2 
2 
     | 
    
         
             
            :default:
         
     | 
| 
       3 
3 
     | 
    
         
             
              :authentication:
         
     | 
| 
       4 
     | 
    
         
            -
                :method:  
     | 
| 
       5 
     | 
    
         
            -
                : 
     | 
| 
       6 
     | 
    
         
            -
                : 
     | 
| 
       7 
     | 
    
         
            -
                : 
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
      
 4 
     | 
    
         
            +
                :method: OAuth2
         
     | 
| 
      
 5 
     | 
    
         
            +
                :oauth2_client_id: "abc"
         
     | 
| 
      
 6 
     | 
    
         
            +
                :oauth2_client_secret: "def"
         
     | 
| 
      
 7 
     | 
    
         
            +
                :oauth2_token:
         
     | 
| 
      
 8 
     | 
    
         
            +
                    :access_token: "123"
         
     | 
| 
      
 9 
     | 
    
         
            +
                    :refresh_token: "456"
         
     | 
| 
      
 10 
     | 
    
         
            +
                    :issued_at: 2013-03-03 13:33:39.734203841 +01:00
         
     | 
| 
      
 11 
     | 
    
         
            +
                    :expires_in: 3600
         
     | 
| 
      
 12 
     | 
    
         
            +
                    :id_token:
         
     | 
| 
      
 13 
     | 
    
         
            +
                :developer_token: "789"
         
     | 
| 
       9 
14 
     | 
    
         
             
                :user_agent: My Adwords API Client
         
     | 
| 
      
 15 
     | 
    
         
            +
                :client_customer_id: 555-666-7777
         
     | 
| 
       10 
16 
     | 
    
         
             
              :service:
         
     | 
| 
       11 
17 
     | 
    
         
             
                :environment: PRODUCTION
         
     | 
| 
       12 
18 
     | 
    
         
             
              :library:
         
     | 
| 
       13 
19 
     | 
    
         
             
                :log_level: WARN
         
     | 
| 
       14 
     | 
    
         
            -
                :log_path: /tmp/ 
     | 
| 
       15 
     | 
    
         
            -
            #   :log_pretty_format is set to :false by default
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
            :sandbox:
         
     | 
| 
       18 
     | 
    
         
            -
              :authentication:
         
     | 
| 
       19 
     | 
    
         
            -
                :method: ClientLogin
         
     | 
| 
       20 
     | 
    
         
            -
                :email: sandbox_email@gmail.com
         
     | 
| 
       21 
     | 
    
         
            -
                :password: sandbox_password
         
     | 
| 
       22 
     | 
    
         
            -
                :developer_token: sandbox_token
         
     | 
| 
       23 
     | 
    
         
            -
                :client_customer_id: 555-666-7777
         
     | 
| 
       24 
     | 
    
         
            -
                :user_agent: Adwords API Test
         
     | 
| 
       25 
     | 
    
         
            -
              :service:
         
     | 
| 
       26 
     | 
    
         
            -
                :environment: SANDBOX
         
     | 
| 
       27 
     | 
    
         
            -
              :library:
         
     | 
| 
       28 
     | 
    
         
            -
                :log_level: DEBUG
         
     | 
| 
       29 
     | 
    
         
            -
                :log_path: /tmp/adapi_sandbox.log
         
     | 
| 
      
 20 
     | 
    
         
            +
                :log_path: /tmp/adapi.log
         
     | 
| 
       30 
21 
     | 
    
         
             
                :log_pretty_format: true
         
     | 
    
        data/test/test_helper.rb
    CHANGED
    
    | 
         @@ -9,6 +9,7 @@ require 'turn' 
     | 
|
| 
       9 
9 
     | 
    
         
             
            require 'shoulda'
         
     | 
| 
       10 
10 
     | 
    
         
             
            require 'fakeweb'
         
     | 
| 
       11 
11 
     | 
    
         
             
            require 'factory_girl'
         
     | 
| 
      
 12 
     | 
    
         
            +
            require 'mocha/setup'
         
     | 
| 
       12 
13 
     | 
    
         | 
| 
       13 
14 
     | 
    
         
             
            # always test the latest version of the gem
         
     | 
| 
       14 
15 
     | 
    
         
             
            # TODO make it an option only through ENV variable switch
         
     | 
| 
         @@ -20,6 +21,11 @@ Dir[ File.join(File.dirname(__FILE__), 'factories', '*.rb') ].each { |f| require 
     | 
|
| 
       20 
21 
     | 
    
         
             
            class Test::Unit::TestCase
         
     | 
| 
       21 
22 
     | 
    
         
             
              FakeWeb.allow_net_connect = false
         
     | 
| 
       22 
23 
     | 
    
         | 
| 
      
 24 
     | 
    
         
            +
              def setup
         
     | 
| 
      
 25 
     | 
    
         
            +
                # omit OAuth2 authorization for tests
         
     | 
| 
      
 26 
     | 
    
         
            +
                AdwordsApi::Api.any_instance.stubs(:authorize).returns(nil)
         
     | 
| 
      
 27 
     | 
    
         
            +
              end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
       23 
29 
     | 
    
         
             
              # many integration tests need to use campaign or ad group
         
     | 
| 
       24 
30 
     | 
    
         
             
              # instead of creating them in every test, we do it here  
         
     | 
| 
       25 
31 
     | 
    
         
             
              #
         
     | 
    
        data/test/unit/ad_group_test.rb
    CHANGED
    
    
    
        data/test/unit/config_test.rb
    CHANGED
    
    | 
         @@ -12,20 +12,7 @@ module Adapi 
     | 
|
| 
       12 
12 
     | 
    
         
             
                    @settings                     = Adapi::Config.settings(true)
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
                    assert_equal '555-666-7777', @settings[:default][:authentication][:client_customer_id]
         
     | 
| 
       15 
     | 
    
         
            -
                     
     | 
| 
       16 
     | 
    
         
            -
                    assert_equal 'sandbox_email@gmail.com', @settings[:sandbox][:authentication][:email]
         
     | 
| 
       17 
     | 
    
         
            -
                  end
         
     | 
| 
       18 
     | 
    
         
            -
                end
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
                context "Loading adwords_api.yml" do
         
     | 
| 
       21 
     | 
    
         
            -
                  should "loads the configuration" do
         
     | 
| 
       22 
     | 
    
         
            -
                    Adapi::Config.dir             = 'test/fixtures'
         
     | 
| 
       23 
     | 
    
         
            -
                    Adapi::Config.filename        = 'adwords_api.yml'
         
     | 
| 
       24 
     | 
    
         
            -
                    @settings                     = Adapi::Config.settings(true)
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
                    assert_equal '555-666-7777', @settings[:default][:authentication][:client_customer_id]
         
     | 
| 
       27 
     | 
    
         
            -
                    assert_equal 'default_email@gmail.com', @settings[:default][:authentication][:email]
         
     | 
| 
       28 
     | 
    
         
            -
                    assert_nil @settings[:sandbox]
         
     | 
| 
      
 15 
     | 
    
         
            +
                    assert_instance_of Hash, @settings[:default][:authentication][:oauth2_token]
         
     | 
| 
       29 
16 
     | 
    
         
             
                  end
         
     | 
| 
       30 
17 
     | 
    
         
             
                end
         
     | 
| 
       31 
18 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: adapi
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,11 +9,11 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2013- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2013-03-26 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: google-ads-common
         
     | 
| 
       16 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: &6871560 !ruby/object:Gem::Requirement
         
     | 
| 
       17 
17 
     | 
    
         
             
                none: false
         
     | 
| 
       18 
18 
     | 
    
         
             
                requirements:
         
     | 
| 
       19 
19 
     | 
    
         
             
                - - =
         
     | 
| 
         @@ -21,10 +21,10 @@ dependencies: 
     | 
|
| 
       21 
21 
     | 
    
         
             
                    version: 0.9.2
         
     | 
| 
       22 
22 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       23 
23 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       24 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: *6871560
         
     | 
| 
       25 
25 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       26 
26 
     | 
    
         
             
              name: google-adwords-api
         
     | 
| 
       27 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 27 
     | 
    
         
            +
              requirement: &6884860 !ruby/object:Gem::Requirement
         
     | 
| 
       28 
28 
     | 
    
         
             
                none: false
         
     | 
| 
       29 
29 
     | 
    
         
             
                requirements:
         
     | 
| 
       30 
30 
     | 
    
         
             
                - - =
         
     | 
| 
         @@ -32,10 +32,10 @@ dependencies: 
     | 
|
| 
       32 
32 
     | 
    
         
             
                    version: 0.8.1
         
     | 
| 
       33 
33 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       34 
34 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       35 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 35 
     | 
    
         
            +
              version_requirements: *6884860
         
     | 
| 
       36 
36 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       37 
37 
     | 
    
         
             
              name: activemodel
         
     | 
| 
       38 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 38 
     | 
    
         
            +
              requirement: &6878440 !ruby/object:Gem::Requirement
         
     | 
| 
       39 
39 
     | 
    
         
             
                none: false
         
     | 
| 
       40 
40 
     | 
    
         
             
                requirements:
         
     | 
| 
       41 
41 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -43,10 +43,10 @@ dependencies: 
     | 
|
| 
       43 
43 
     | 
    
         
             
                    version: 3.2.12
         
     | 
| 
       44 
44 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       45 
45 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       46 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 46 
     | 
    
         
            +
              version_requirements: *6878440
         
     | 
| 
       47 
47 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       48 
48 
     | 
    
         
             
              name: activesupport
         
     | 
| 
       49 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 49 
     | 
    
         
            +
              requirement: &6891600 !ruby/object:Gem::Requirement
         
     | 
| 
       50 
50 
     | 
    
         
             
                none: false
         
     | 
| 
       51 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
52 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -54,10 +54,10 @@ dependencies: 
     | 
|
| 
       54 
54 
     | 
    
         
             
                    version: 3.2.12
         
     | 
| 
       55 
55 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       56 
56 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       57 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 57 
     | 
    
         
            +
              version_requirements: *6891600
         
     | 
| 
       58 
58 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       59 
59 
     | 
    
         
             
              name: rake
         
     | 
| 
       60 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 60 
     | 
    
         
            +
              requirement: &6897540 !ruby/object:Gem::Requirement
         
     | 
| 
       61 
61 
     | 
    
         
             
                none: false
         
     | 
| 
       62 
62 
     | 
    
         
             
                requirements:
         
     | 
| 
       63 
63 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -65,10 +65,10 @@ dependencies: 
     | 
|
| 
       65 
65 
     | 
    
         
             
                    version: 0.9.6
         
     | 
| 
       66 
66 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       67 
67 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       68 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 68 
     | 
    
         
            +
              version_requirements: *6897540
         
     | 
| 
       69 
69 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       70 
70 
     | 
    
         
             
              name: curb
         
     | 
| 
       71 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 71 
     | 
    
         
            +
              requirement: &6908740 !ruby/object:Gem::Requirement
         
     | 
| 
       72 
72 
     | 
    
         
             
                none: false
         
     | 
| 
       73 
73 
     | 
    
         
             
                requirements:
         
     | 
| 
       74 
74 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -76,10 +76,10 @@ dependencies: 
     | 
|
| 
       76 
76 
     | 
    
         
             
                    version: 0.8.3
         
     | 
| 
       77 
77 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       78 
78 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       79 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 79 
     | 
    
         
            +
              version_requirements: *6908740
         
     | 
| 
       80 
80 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       81 
81 
     | 
    
         
             
              name: yard
         
     | 
| 
       82 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 82 
     | 
    
         
            +
              requirement: &6905520 !ruby/object:Gem::Requirement
         
     | 
| 
       83 
83 
     | 
    
         
             
                none: false
         
     | 
| 
       84 
84 
     | 
    
         
             
                requirements:
         
     | 
| 
       85 
85 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -87,10 +87,10 @@ dependencies: 
     | 
|
| 
       87 
87 
     | 
    
         
             
                    version: '0.8'
         
     | 
| 
       88 
88 
     | 
    
         
             
              type: :development
         
     | 
| 
       89 
89 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       90 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 90 
     | 
    
         
            +
              version_requirements: *6905520
         
     | 
| 
       91 
91 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       92 
92 
     | 
    
         
             
              name: turn
         
     | 
| 
       93 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 93 
     | 
    
         
            +
              requirement: &6903680 !ruby/object:Gem::Requirement
         
     | 
| 
       94 
94 
     | 
    
         
             
                none: false
         
     | 
| 
       95 
95 
     | 
    
         
             
                requirements:
         
     | 
| 
       96 
96 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -98,10 +98,21 @@ dependencies: 
     | 
|
| 
       98 
98 
     | 
    
         
             
                    version: 0.9.6
         
     | 
| 
       99 
99 
     | 
    
         
             
              type: :development
         
     | 
| 
       100 
100 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       101 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 101 
     | 
    
         
            +
              version_requirements: *6903680
         
     | 
| 
      
 102 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 103 
     | 
    
         
            +
              name: shoulda-matchers
         
     | 
| 
      
 104 
     | 
    
         
            +
              requirement: &6912040 !ruby/object:Gem::Requirement
         
     | 
| 
      
 105 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 106 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 107 
     | 
    
         
            +
                - - =
         
     | 
| 
      
 108 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 109 
     | 
    
         
            +
                    version: 1.4.1
         
     | 
| 
      
 110 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 111 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 112 
     | 
    
         
            +
              version_requirements: *6912040
         
     | 
| 
       102 
113 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       103 
114 
     | 
    
         
             
              name: shoulda
         
     | 
| 
       104 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 115 
     | 
    
         
            +
              requirement: &6924660 !ruby/object:Gem::Requirement
         
     | 
| 
       105 
116 
     | 
    
         
             
                none: false
         
     | 
| 
       106 
117 
     | 
    
         
             
                requirements:
         
     | 
| 
       107 
118 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -109,10 +120,10 @@ dependencies: 
     | 
|
| 
       109 
120 
     | 
    
         
             
                    version: '3.1'
         
     | 
| 
       110 
121 
     | 
    
         
             
              type: :development
         
     | 
| 
       111 
122 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       112 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 123 
     | 
    
         
            +
              version_requirements: *6924660
         
     | 
| 
       113 
124 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       114 
125 
     | 
    
         
             
              name: fakeweb
         
     | 
| 
       115 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 126 
     | 
    
         
            +
              requirement: &6922840 !ruby/object:Gem::Requirement
         
     | 
| 
       116 
127 
     | 
    
         
             
                none: false
         
     | 
| 
       117 
128 
     | 
    
         
             
                requirements:
         
     | 
| 
       118 
129 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -120,10 +131,10 @@ dependencies: 
     | 
|
| 
       120 
131 
     | 
    
         
             
                    version: '1.3'
         
     | 
| 
       121 
132 
     | 
    
         
             
              type: :development
         
     | 
| 
       122 
133 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       123 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 134 
     | 
    
         
            +
              version_requirements: *6922840
         
     | 
| 
       124 
135 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       125 
136 
     | 
    
         
             
              name: factory_girl
         
     | 
| 
       126 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 137 
     | 
    
         
            +
              requirement: &6935460 !ruby/object:Gem::Requirement
         
     | 
| 
       127 
138 
     | 
    
         
             
                none: false
         
     | 
| 
       128 
139 
     | 
    
         
             
                requirements:
         
     | 
| 
       129 
140 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -131,10 +142,10 @@ dependencies: 
     | 
|
| 
       131 
142 
     | 
    
         
             
                    version: '3.3'
         
     | 
| 
       132 
143 
     | 
    
         
             
              type: :development
         
     | 
| 
       133 
144 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       134 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 145 
     | 
    
         
            +
              version_requirements: *6935460
         
     | 
| 
       135 
146 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       136 
147 
     | 
    
         
             
              name: minitest
         
     | 
| 
       137 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 148 
     | 
    
         
            +
              requirement: &6934660 !ruby/object:Gem::Requirement
         
     | 
| 
       138 
149 
     | 
    
         
             
                none: false
         
     | 
| 
       139 
150 
     | 
    
         
             
                requirements:
         
     | 
| 
       140 
151 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -142,7 +153,18 @@ dependencies: 
     | 
|
| 
       142 
153 
     | 
    
         
             
                    version: '3.3'
         
     | 
| 
       143 
154 
     | 
    
         
             
              type: :development
         
     | 
| 
       144 
155 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       145 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 156 
     | 
    
         
            +
              version_requirements: *6934660
         
     | 
| 
      
 157 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 158 
     | 
    
         
            +
              name: mocha
         
     | 
| 
      
 159 
     | 
    
         
            +
              requirement: &6934040 !ruby/object:Gem::Requirement
         
     | 
| 
      
 160 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 161 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 162 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 163 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 164 
     | 
    
         
            +
                    version: 0.13.3
         
     | 
| 
      
 165 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 166 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 167 
     | 
    
         
            +
              version_requirements: *6934040
         
     | 
| 
       146 
168 
     | 
    
         
             
            description: This gem provides user-friendly interface to Google Adwords API.
         
     | 
| 
       147 
169 
     | 
    
         
             
            email:
         
     | 
| 
       148 
170 
     | 
    
         
             
            - lucastej@gmail.com
         
     | 
| 
         @@ -169,8 +191,6 @@ files: 
     | 
|
| 
       169 
191 
     | 
    
         
             
            - examples/add_negative_campaign_criteria.rb
         
     | 
| 
       170 
192 
     | 
    
         
             
            - examples/add_text_ad.rb
         
     | 
| 
       171 
193 
     | 
    
         
             
            - examples/add_text_ads.rb
         
     | 
| 
       172 
     | 
    
         
            -
            - examples/custom_settings.yml
         
     | 
| 
       173 
     | 
    
         
            -
            - examples/customize_configuration.rb
         
     | 
| 
       174 
194 
     | 
    
         
             
            - examples/delete_ad_group.rb
         
     | 
| 
       175 
195 
     | 
    
         
             
            - examples/delete_keyword.rb
         
     | 
| 
       176 
196 
     | 
    
         
             
            - examples/delete_text_ad.rb
         
     | 
| 
         @@ -216,15 +236,14 @@ files: 
     | 
|
| 
       216 
236 
     | 
    
         
             
            - test/factories/ad_text_factory.rb
         
     | 
| 
       217 
237 
     | 
    
         
             
            - test/factories/campaign_factory.rb
         
     | 
| 
       218 
238 
     | 
    
         
             
            - test/fixtures/adapi.yml
         
     | 
| 
       219 
     | 
    
         
            -
            - test/fixtures/adwords_api.yml
         
     | 
| 
       220 
239 
     | 
    
         
             
            - test/integration/create_ad_group_test.rb
         
     | 
| 
       221 
240 
     | 
    
         
             
            - test/integration/create_campaign_test.rb
         
     | 
| 
       222 
241 
     | 
    
         
             
            - test/integration/find_location_test.rb
         
     | 
| 
      
 242 
     | 
    
         
            +
            - test/integration_test_helper.rb
         
     | 
| 
       223 
243 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       224 
244 
     | 
    
         
             
            - test/unit/.gitignore
         
     | 
| 
       225 
245 
     | 
    
         
             
            - test/unit/ad/ad_text_test.rb
         
     | 
| 
       226 
246 
     | 
    
         
             
            - test/unit/ad_group_test.rb
         
     | 
| 
       227 
     | 
    
         
            -
            - test/unit/ad_test.rb
         
     | 
| 
       228 
247 
     | 
    
         
             
            - test/unit/campaign_criterion_test.rb
         
     | 
| 
       229 
248 
     | 
    
         
             
            - test/unit/campaign_test.rb
         
     | 
| 
       230 
249 
     | 
    
         
             
            - test/unit/config_test.rb
         
     | 
| 
         @@ -243,7 +262,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       243 
262 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       244 
263 
     | 
    
         
             
                  segments:
         
     | 
| 
       245 
264 
     | 
    
         
             
                  - 0
         
     | 
| 
       246 
     | 
    
         
            -
                  hash:  
     | 
| 
      
 265 
     | 
    
         
            +
                  hash: 153566960593043723
         
     | 
| 
       247 
266 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       248 
267 
     | 
    
         
             
              none: false
         
     | 
| 
       249 
268 
     | 
    
         
             
              requirements:
         
     | 
| 
         @@ -252,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       252 
271 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       253 
272 
     | 
    
         
             
                  segments:
         
     | 
| 
       254 
273 
     | 
    
         
             
                  - 0
         
     | 
| 
       255 
     | 
    
         
            -
                  hash:  
     | 
| 
      
 274 
     | 
    
         
            +
                  hash: 153566960593043723
         
     | 
| 
       256 
275 
     | 
    
         
             
            requirements: []
         
     | 
| 
       257 
276 
     | 
    
         
             
            rubyforge_project: adapi
         
     | 
| 
       258 
277 
     | 
    
         
             
            rubygems_version: 1.8.15
         
     | 
| 
         @@ -1,30 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
            :default:
         
     | 
| 
       3 
     | 
    
         
            -
              :authentication:
         
     | 
| 
       4 
     | 
    
         
            -
                :method: ClientLogin
         
     | 
| 
       5 
     | 
    
         
            -
                :email: default_email@gmail.com
         
     | 
| 
       6 
     | 
    
         
            -
                :password: default_password
         
     | 
| 
       7 
     | 
    
         
            -
                :developer_token: default_token
         
     | 
| 
       8 
     | 
    
         
            -
                :client_customer_id: 555-666-7777
         
     | 
| 
       9 
     | 
    
         
            -
                :user_agent: My Adwords API Client
         
     | 
| 
       10 
     | 
    
         
            -
              :service:
         
     | 
| 
       11 
     | 
    
         
            -
                :environment: PRODUCTION
         
     | 
| 
       12 
     | 
    
         
            -
              :library:
         
     | 
| 
       13 
     | 
    
         
            -
                :log_level: WARN
         
     | 
| 
       14 
     | 
    
         
            -
                :log_path: /tmp/adapi_production.log
         
     | 
| 
       15 
     | 
    
         
            -
            #   :log_pretty_format is set to :false by default
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
            :sandbox:
         
     | 
| 
       18 
     | 
    
         
            -
              :authentication:
         
     | 
| 
       19 
     | 
    
         
            -
                :method: ClientLogin
         
     | 
| 
       20 
     | 
    
         
            -
                :email: sandbox_email@gmail.com
         
     | 
| 
       21 
     | 
    
         
            -
                :password: sandbox_password
         
     | 
| 
       22 
     | 
    
         
            -
                :developer_token: sandbox_token
         
     | 
| 
       23 
     | 
    
         
            -
                :client_customer_id: 555-666-7777
         
     | 
| 
       24 
     | 
    
         
            -
                :user_agent: Adwords API Test
         
     | 
| 
       25 
     | 
    
         
            -
              :service:
         
     | 
| 
       26 
     | 
    
         
            -
                :environment: SANDBOX
         
     | 
| 
       27 
     | 
    
         
            -
              :library:
         
     | 
| 
       28 
     | 
    
         
            -
                :log_level: DEBUG
         
     | 
| 
       29 
     | 
    
         
            -
                :log_path: /tmp/adapi_sandbox.log
         
     | 
| 
       30 
     | 
    
         
            -
                :log_pretty_format: true
         
     | 
| 
         @@ -1,18 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # encoding: utf-8
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            require 'adapi'
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            # this example shows how to load custom settings
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            Adapi::Config.load_settings(
         
     | 
| 
       8 
     | 
    
         
            -
              :dir => File.expand_path(File.dirname(__FILE__)),
         
     | 
| 
       9 
     | 
    
         
            -
              :filename => 'custom_settings.yml'
         
     | 
| 
       10 
     | 
    
         
            -
            )
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            # :default account is set automatically
         
     | 
| 
       13 
     | 
    
         
            -
            p "Default settings:"
         
     | 
| 
       14 
     | 
    
         
            -
            p Adapi::Config.read[:authentication][:email]
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            Adapi::Config.set(:sandbox)
         
     | 
| 
       17 
     | 
    
         
            -
            p "Set :sandbox account:"
         
     | 
| 
       18 
     | 
    
         
            -
            p Adapi::Config.read[:authentication][:email]
         
     | 
| 
         @@ -1,14 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
            :authentication:
         
     | 
| 
       3 
     | 
    
         
            -
              :method: ClientLogin
         
     | 
| 
       4 
     | 
    
         
            -
              :email: default_email@gmail.com
         
     | 
| 
       5 
     | 
    
         
            -
              :password: default_password
         
     | 
| 
       6 
     | 
    
         
            -
              :developer_token: default_token
         
     | 
| 
       7 
     | 
    
         
            -
              :client_customer_id: 555-666-7777
         
     | 
| 
       8 
     | 
    
         
            -
              :user_agent: My Adwords API Client
         
     | 
| 
       9 
     | 
    
         
            -
            :service:
         
     | 
| 
       10 
     | 
    
         
            -
              :environment: PRODUCTION
         
     | 
| 
       11 
     | 
    
         
            -
            :library:
         
     | 
| 
       12 
     | 
    
         
            -
              :log_level: WARN
         
     | 
| 
       13 
     | 
    
         
            -
              :log_path: /tmp/adapi_production.log
         
     | 
| 
       14 
     | 
    
         
            -
            #   :log_pretty_format is set to :false by default
         
     |