soapy_cake 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/api_versions.yml +1 -1
- data/lib/soapy_cake/version.rb +1 -1
- metadata +2 -3
- data/script/update_versions.rb +0 -41
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f5649f1e288a6ca50f2e7cb060b91d729675a2da
|
|
4
|
+
data.tar.gz: c52ffbfb66a242043e53fe834f075b659b886d01
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43914bd6b28c7b831f1284d3a7b938668aae17415e1488a4fce3b5ee7a02ab566847a553b9caa834a85365ecbb654a8f00d9d22f2eb78ced89ae6a759d6d48eb
|
|
7
|
+
data.tar.gz: 00969f89ede5249f845787d4163980601e4fed49d1100b1d72498358aacbc9ab6661027cee64f5a98afa7fc0e1352812d67d9fae80a2195b7e9909acc75b3fcf
|
data/api_versions.yml
CHANGED
data/lib/soapy_cake/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: soapy_cake
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ad2games GmbH
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-12-
|
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -173,7 +173,6 @@ files:
|
|
|
173
173
|
- lib/soapy_cake/client/cake_client.rb
|
|
174
174
|
- lib/soapy_cake/client/http_client.rb
|
|
175
175
|
- lib/soapy_cake/version.rb
|
|
176
|
-
- script/update_versions.rb
|
|
177
176
|
- soapy_cake.gemspec
|
|
178
177
|
- spec/fixtures/vcr_cassettes/client_new_account_statuses.yml
|
|
179
178
|
- spec/fixtures/vcr_cassettes/client_new_advertisers.yml
|
data/script/update_versions.rb
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
SOURCE = 'https://support.getcake.com/hc/en-us/articles/200704900-Admin-API-Version-Tracker'
|
|
4
|
-
|
|
5
|
-
require 'net/https'
|
|
6
|
-
require 'bundler/setup'
|
|
7
|
-
require 'nokogiri'
|
|
8
|
-
require 'active_support/core_ext/string'
|
|
9
|
-
require 'yaml'
|
|
10
|
-
|
|
11
|
-
uri = URI.parse(SOURCE)
|
|
12
|
-
|
|
13
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
|
14
|
-
http.use_ssl = true
|
|
15
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
16
|
-
request = Net::HTTP::Get.new(uri.request_uri)
|
|
17
|
-
response = http.request(request)
|
|
18
|
-
|
|
19
|
-
html = Nokogiri::HTML.parse(response.body)
|
|
20
|
-
versions = {}
|
|
21
|
-
|
|
22
|
-
html.css('div.article-body table').each do |table|
|
|
23
|
-
section_head = table.previous_element
|
|
24
|
-
# Find the section title in the previous elements
|
|
25
|
-
until section_head.text[/\w+/][/^[A-Z]+$/]
|
|
26
|
-
section_head = section_head.previous_element
|
|
27
|
-
end
|
|
28
|
-
section = section_head.text[/\w+/].downcase.to_sym
|
|
29
|
-
versions[section] = {}
|
|
30
|
-
table.css('tr')[1..-1].each do |row|
|
|
31
|
-
version, method = row.css('td').map(&:text)
|
|
32
|
-
method = method[/\w+/]
|
|
33
|
-
next if method.blank?
|
|
34
|
-
method = method.underscore.to_sym
|
|
35
|
-
versions[section][method] = version.to_i
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
yaml = YAML.load_file('api_versions.yml')
|
|
40
|
-
yaml[:admin] = versions
|
|
41
|
-
File.open('api_versions.yml', 'w') { |f| f << YAML.dump(yaml) }
|