amara 0.1.1 → 0.2.0
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 +4 -4
- data/README.md +2 -0
- data/lib/amara.rb +1 -0
- data/lib/amara/connection.rb +2 -4
- data/lib/amara/version.rb +1 -1
- data/test/teams_test.rb +1 -1
- data/test/videos_test.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8510ef4c28f4fe621d93af3e766474f0cfae1059
|
|
4
|
+
data.tar.gz: 5fb1800d65cbd59a5b1b51b34b6793cfb6ead749
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1517cbc3df344f5ec6dd0f7a5485bd75f183d54b785f10fbcd576ad286daf6f4e562e5d6682fe5b3e3c1dda422464da133569b03b01eb160d0a404b61620604
|
|
7
|
+
data.tar.gz: 7e0bd035c547bc960283bb145d02eadaa3aa5fccc8a56ff51b19402a9c2f1e53047c26fda13faaf745da1be0f597d964984327a47c12bf2b51357e24cd77b7e4
|
data/README.md
CHANGED
data/lib/amara.rb
CHANGED
data/lib/amara/connection.rb
CHANGED
|
@@ -28,13 +28,12 @@ module Amara
|
|
|
28
28
|
).merge(opts)
|
|
29
29
|
options[:headers] = options[:headers].merge(headers)
|
|
30
30
|
Amara::HEADERS.each{|k,v| options[:headers][v] = options.delete(k) if options.key?(k)}
|
|
31
|
-
options
|
|
31
|
+
options.slice(*ALLOWED_OPTIONS)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def connection(options={})
|
|
35
35
|
opts = merge_default_options(options)
|
|
36
|
-
|
|
37
|
-
Faraday::Connection.new(opts) do |connection|
|
|
36
|
+
Faraday.new(opts) do |connection|
|
|
38
37
|
connection.request :url_encoded
|
|
39
38
|
|
|
40
39
|
connection.response :mashify
|
|
@@ -43,7 +42,6 @@ module Amara
|
|
|
43
42
|
|
|
44
43
|
connection.adapter(adapter)
|
|
45
44
|
end
|
|
46
|
-
|
|
47
45
|
end
|
|
48
46
|
end
|
|
49
47
|
end
|
data/lib/amara/version.rb
CHANGED
data/test/teams_test.rb
CHANGED
|
@@ -53,7 +53,7 @@ describe Amara::Teams do
|
|
|
53
53
|
|
|
54
54
|
stub_request(:post, "https://www.amara.org/api2/partners/teams/").
|
|
55
55
|
with(:body => "{\"slug\":\"prx-test-1\",\"name\":\"prx test 1\"}",
|
|
56
|
-
:headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'Host'=>'www.amara.org:443', '
|
|
56
|
+
:headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'Host'=>'www.amara.org:443', 'X-Api-Username'=>'test_user', 'X-Apikey'=>'thisisakey'}).
|
|
57
57
|
to_return(:status => 200, :body => create_response, :headers => {})
|
|
58
58
|
|
|
59
59
|
|
data/test/videos_test.rb
CHANGED
|
@@ -66,7 +66,7 @@ describe Amara::Videos do
|
|
|
66
66
|
|
|
67
67
|
stub_request(:post, "https://www.amara.org/api2/partners/videos/").
|
|
68
68
|
with(:body => "{\"team\":\"test-team\",\"title\":\"title\",\"video_url\":\"https://archive.org/download/1-test-mp3.JRiaC2.popuparchive.org/test.ogg\",\"primary_audio_language_code\":\"en\"}",
|
|
69
|
-
:headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'Host'=>'www.amara.org:443', '
|
|
69
|
+
:headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'Host'=>'www.amara.org:443', 'X-Api-Username'=>'test_user', 'X-Apikey'=>'thisisakey'}).
|
|
70
70
|
to_return(:status => 200, :body => response, :headers => {})
|
|
71
71
|
|
|
72
72
|
videos = Amara::Videos.new(api_key: 'thisisakey', api_username: 'test_user')
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: amara
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kuklewicz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-06-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
212
212
|
version: '0'
|
|
213
213
|
requirements: []
|
|
214
214
|
rubyforge_project:
|
|
215
|
-
rubygems_version: 2.
|
|
215
|
+
rubygems_version: 2.0.14
|
|
216
216
|
signing_key:
|
|
217
217
|
specification_version: 4
|
|
218
218
|
summary: Works with API v1.2, http://amara.readthedocs.org/en/latest/api.html
|