infogram 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/infogram/infographics.rb +2 -2
- data/lib/infogram/resources.rb +4 -4
- data/lib/infogram/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2fc314a10c19156cbfa1d4b363ced7525009aee
|
4
|
+
data.tar.gz: 527f4a0e19034c78e298558f46506ebbc0de79ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b5f607e11a2425521ab3c51fda59cc18f901393c95c67ecaa84cdd3e0302c2631043c4c637ed7f4e5b636db347f461b30682269361567616bff57923972d456
|
7
|
+
data.tar.gz: 8cafaa88dc62b8d706e1eb454c11523ca456f341131f6ca2bdd0d937d578dda71a210d9f9715115990834ee50a35fd03f72577dd4bdf3e8a0f54dce92bcb8e48
|
data/README.md
CHANGED
@@ -18,15 +18,15 @@ module Infogram
|
|
18
18
|
|
19
19
|
def create(opts = {})
|
20
20
|
opts[:api_key] = @config[:api_key]
|
21
|
-
opts[:api_sig] = signature('POST', 'infographics', opts, @config)
|
22
21
|
opts[:content] = opts[:content].to_json
|
22
|
+
opts[:api_sig] = signature('POST', 'infographics', opts, @config)
|
23
23
|
HTTParty.post("#{@config[:api_url]}/infographics", body: opts)
|
24
24
|
end
|
25
25
|
|
26
26
|
def update(id, opts = {})
|
27
27
|
opts[:api_key] = @config[:api_key]
|
28
|
-
opts[:api_sig] = signature('PUT', "infographics/#{id}", opts, @config)
|
29
28
|
opts[:content] = opts[:content].to_json
|
29
|
+
opts[:api_sig] = signature('PUT', "infographics/#{id}", opts, @config)
|
30
30
|
HTTParty.put("#{@config[:api_url]}/infographics/#{id}", body: opts)
|
31
31
|
end
|
32
32
|
|
data/lib/infogram/resources.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Infogram
|
2
2
|
class Resources
|
3
|
-
def decode_params(params)
|
4
|
-
params.keys.sort.map { |k| "#{k}=#{url_escaping(params[k].to_s)}" }.join('&')
|
5
|
-
end
|
6
|
-
|
7
3
|
def url_escaping(string)
|
8
4
|
CGI.escape(string).gsub('+', '%20')
|
9
5
|
end
|
10
6
|
|
7
|
+
def decode_params(params)
|
8
|
+
params.keys.sort.map { |k| "#{k.to_s}=#{url_escaping(params[k].to_s)}" }.join('&')
|
9
|
+
end
|
10
|
+
|
11
11
|
def signature(method, path, params, config)
|
12
12
|
string_to_sign = [
|
13
13
|
method.upcase,
|
data/lib/infogram/version.rb
CHANGED