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 +4 -4
- data/infogram-ruby.gemspec +1 -1
- data/lib/infogram-ruby.rb +1 -1
- data/spec/infogram-ruby_spec.rb +4 -2
- 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: 937e18bf0229411775ba74a2cc21692b91ebb9e1
|
4
|
+
data.tar.gz: 24af4d1379603b9648ee449c2cab04b53485db45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22b5e53feaaa3aa0b7cc299d06ed9f3ea78f99eb9116426a0fef4496ba901380b2fe57268473361b1c2fd4df4ff6a0dedcd9bc4cbce3075ba2ea3ec182127c90
|
7
|
+
data.tar.gz: 64e0a6730d136688c88c01acc52b58089e2fc2a33979f14126cfa601946c492ce29e6219d11a591de68d858971796caba3ec76bb015398e86625b9e4e5540696
|
data/infogram-ruby.gemspec
CHANGED
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)
|
data/spec/infogram-ruby_spec.rb
CHANGED
@@ -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%
|
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('
|
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
|
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-
|
11
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|