infogram-ruby 0.0.6 → 0.1.0

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: 2e79353bb8588170e94c8015dbada3e12974537f
4
- data.tar.gz: 3f937f8d21e60415644c38cac3a03b19e2ed79a4
3
+ metadata.gz: 937e18bf0229411775ba74a2cc21692b91ebb9e1
4
+ data.tar.gz: 24af4d1379603b9648ee449c2cab04b53485db45
5
5
  SHA512:
6
- metadata.gz: 2fc5d03bf63120cb33bf358ecdc1922e40cefa276f82ff6c31dd3da5f551073a3f3ebdf0df2955a501684e99b0ec027014813e31b1e0940551751badc0929dc7
7
- data.tar.gz: 84e3b6bd735e8b5db959fc0ba108e37c10bdaff71afd8a5b5e6f6a73fd27538de792ab8e01174912be76ef0f08762f1545d8bbeb11fa49005cdd669dfd19bf8d
6
+ metadata.gz: 22b5e53feaaa3aa0b7cc299d06ed9f3ea78f99eb9116426a0fef4496ba901380b2fe57268473361b1c2fd4df4ff6a0dedcd9bc4cbce3075ba2ea3ec182127c90
7
+ data.tar.gz: 64e0a6730d136688c88c01acc52b58089e2fc2a33979f14126cfa601946c492ce29e6219d11a591de68d858971796caba3ec76bb015398e86625b9e4e5540696
@@ -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.6'
7
+ s.version = '0.1.0'
8
8
  s.authors = ['Maksim Berjoza']
9
9
  s.email = ['torbjon@gmail.com']
10
10
  s.summary = %q{Infogr.am Ruby SDK}
data/lib/infogram-ruby.rb CHANGED
@@ -14,7 +14,7 @@ class Infogram
14
14
  end
15
15
 
16
16
  def decode_params(params)
17
- params.keys.sort.map{ |k| "#{k}=#{url_escaping(params[k].to_s)}" }.join('&')
17
+ params.keys.sort.map{ |k| "#{k.to_s}=#{url_escaping(params[k].to_s)}" }.join('&')
18
18
  end
19
19
 
20
20
  def signature(method, path, params)
@@ -18,17 +18,19 @@ describe 'Infogram' do
18
18
  }
19
19
 
20
20
  context 'Signature' do
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' }
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' }
22
22
 
23
23
  it 'should encode params' do
24
24
  params[:api_key] = api_key
25
+ params[:content] = params[:content].to_json
25
26
  expect(client.decode_params(params)).to eq(encoded_params)
26
27
  end
27
28
 
28
29
  it 'should generate signature' do
29
30
  params[:api_key] = api_key
31
+ params[:content] = params[:content].to_json
30
32
  signature = client.signature('post', 'infographics', params)
31
- expect(signature).to eq('FqGHS3wWJQQn7yxrwhLP5qCxhjQ=')
33
+ expect(signature).to eq('bqwCqAk1TWDYNy3eqV0BiNuIERQ=')
32
34
  end
33
35
  end
34
36
 
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.6
4
+ version: 0.1.0
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-28 00:00:00.000000000 Z
11
+ date: 2015-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler