statcounter 1.0.3 → 1.0.4
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/lib/statcounter/client.rb +6 -4
- data/lib/statcounter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d83af47b9df2f2bdd79bf08101b284554e275068
|
|
4
|
+
data.tar.gz: 4c55a665d85376d5d1666fe7a8b2bb741625a6ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6647972911e9b5f99d6ef4237486e4859483bb2d2e6257751742130e793c223ed527535f37a9533f08aa1dc335001aa21063eda28702e4fde64608f2afdfef79
|
|
7
|
+
data.tar.gz: a0e66f9b26f08ad902bf84f40d08f7a29e041d7701c558022d9fbd03fc9fa5b9f8b43e528176fb13b2d327aa2668872bbbebd963e5455789ac36b2262f59291a
|
data/lib/statcounter/client.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Statcounter
|
|
|
6
6
|
STATUS_FAIL = 'fail'.freeze
|
|
7
7
|
|
|
8
8
|
def get(path, params: {}, credentials: nil)
|
|
9
|
-
response =
|
|
9
|
+
response = connections[credentials].get(path, params)
|
|
10
10
|
body = JSON.parse(response.body, symbolize_names: true)
|
|
11
11
|
|
|
12
12
|
if body[:@attributes][:status] == STATUS_FAIL
|
|
@@ -14,14 +14,16 @@ module Statcounter
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
body
|
|
17
|
-
rescue Faraday::ClientError
|
|
17
|
+
rescue Faraday::ClientError
|
|
18
18
|
raise Error, 'Server could not process your request'
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
|
-
def
|
|
24
|
-
@
|
|
23
|
+
def connections
|
|
24
|
+
@connections ||= Hash.new do |connections, credentials|
|
|
25
|
+
connections[credentials] = build_connection(credentials)
|
|
26
|
+
end
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
def build_connection(credentials)
|
data/lib/statcounter/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: statcounter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- "Šarūnas Kūjalis"
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-06-
|
|
11
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|