infogram-ruby 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a23c1315dba87443649183c1d56c7131b87a9ec
4
- data.tar.gz: 61fb6428f5166f7bc551bf8c8a8a50558ac54e4b
3
+ metadata.gz: 2e79353bb8588170e94c8015dbada3e12974537f
4
+ data.tar.gz: 3f937f8d21e60415644c38cac3a03b19e2ed79a4
5
5
  SHA512:
6
- metadata.gz: 5c6928409104494f998b9711bb655fc63f5668cb396bb1e7c64ed8a19635c65e7a8ae818abd215f89ff7e0130b1c56ed9c07425ca1f97a4e97e6e43941a1d4f0
7
- data.tar.gz: f6cc7bd51b25d90e05e994e46e276d249755066677486da4540b5129b1134bcf0f2d90c4e148291d6c7f7c2c481424befcb44f7881ad101a5f265604a0a90119
6
+ metadata.gz: 2fc5d03bf63120cb33bf358ecdc1922e40cefa276f82ff6c31dd3da5f551073a3f3ebdf0df2955a501684e99b0ec027014813e31b1e0940551751badc0929dc7
7
+ data.tar.gz: 84e3b6bd735e8b5db959fc0ba108e37c10bdaff71afd8a5b5e6f6a73fd27538de792ab8e01174912be76ef0f08762f1545d8bbeb11fa49005cdd669dfd19bf8d
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'infogram-ruby'
7
- s.version = '0.0.5'
7
+ s.version = '0.0.6'
8
8
  s.authors = ['Maksim Berjoza']
9
9
  s.email = ['torbjon@gmail.com']
10
10
  s.summary = %q{Infogr.am Ruby SDK}
@@ -14,10 +14,7 @@ class Infogram
14
14
  end
15
15
 
16
16
  def decode_params(params)
17
- params.keys.sort.map{ |k|
18
- value = (k.to_s == 'content') ? url_escaping(params[k].to_json) : params[k]
19
- "#{k}=#{value}"
20
- }.join('&')
17
+ params.keys.sort.map{ |k| "#{k}=#{url_escaping(params[k].to_s)}" }.join('&')
21
18
  end
22
19
 
23
20
  def signature(method, path, params)
@@ -52,8 +49,8 @@ class Infogram
52
49
 
53
50
  def create_infographic(opts={})
54
51
  opts[:api_key] = @api_key
55
- opts[:api_sig] = signature('POST', 'infographics', opts)
56
52
  opts[:content] = opts[:content].to_json
53
+ opts[:api_sig] = signature('POST', 'infographics', opts)
57
54
  HTTParty.post("#{@api_url}/infographics", body: opts)
58
55
  end
59
56
  end
@@ -18,7 +18,7 @@ describe 'Infogram' do
18
18
  }
19
19
 
20
20
  context 'Signature' do
21
- let (:encoded_params) { 'api_key=nMECGhmHe9&content=%5B%7B%22type%22%3A%22h1%22%2C%22text%22%3A%22Hello%20infogr.am%22%7D%5D&publish=false&theme_id=45&title=Hello' }
21
+ let (:encoded_params) { 'api_key=nMECGhmHe9&content=%5B%7B%3Atype%3D%3E%22h1%22%2C%20%3Atext%3D%3E%22Hello%20infogr.am%22%7D%5D&publish=false&theme_id=45&title=Hello' }
22
22
 
23
23
  it 'should encode params' do
24
24
  params[:api_key] = api_key
@@ -28,7 +28,7 @@ describe 'Infogram' do
28
28
  it 'should generate signature' do
29
29
  params[:api_key] = api_key
30
30
  signature = client.signature('post', 'infographics', params)
31
- expect(signature).to eq('bqwCqAk1TWDYNy3eqV0BiNuIERQ=')
31
+ expect(signature).to eq('FqGHS3wWJQQn7yxrwhLP5qCxhjQ=')
32
32
  end
33
33
  end
34
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infogram-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maksim Berjoza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-15 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler