infogram 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06d4d238d852eaad9bf81cb702b933f72048113b
4
- data.tar.gz: d2db6c1127370ee6c6c915677a35d311371201a2
3
+ metadata.gz: d2fc314a10c19156cbfa1d4b363ced7525009aee
4
+ data.tar.gz: 527f4a0e19034c78e298558f46506ebbc0de79ef
5
5
  SHA512:
6
- metadata.gz: 934617a4f0bfa4678fe31e63c9fbc16f330610b74823ebdf230bce593a5c5fed2a250049441d16e7cf594513216c32b75d7696734b011b5a767b1534a23354fc
7
- data.tar.gz: 099841292e7646ebf8e30848814e9b94ee9a74b9ac50f95910ec15fc2efe0161cca355568270b6b014ab3cec428e7681f9e5ec3d377b38df9a07764c9291e92a
6
+ metadata.gz: 7b5f607e11a2425521ab3c51fda59cc18f901393c95c67ecaa84cdd3e0302c2631043c4c637ed7f4e5b636db347f461b30682269361567616bff57923972d456
7
+ data.tar.gz: 8cafaa88dc62b8d706e1eb454c11523ca456f341131f6ca2bdd0d937d578dda71a210d9f9715115990834ee50a35fd03f72577dd4bdf3e8a0f54dce92bcb8e48
data/README.md CHANGED
@@ -10,7 +10,7 @@ Ruby library for Infogr.am
10
10
  ```ruby
11
11
  require 'infogram'
12
12
 
13
- client = Infogram.new('API_KEY', 'API_SECRET')
13
+ client = Infogram::Client.new('API_KEY', 'API_SECRET')
14
14
  infogram.themes.list
15
15
  ```
16
16
 
@@ -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
 
@@ -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,
@@ -1,3 +1,3 @@
1
1
  module Infogram
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infogram
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maksim Berjoza