miniphonic 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +34 -0
  5. data/LICENSE +20 -0
  6. data/README.md +145 -0
  7. data/Rakefile +19 -0
  8. data/lib/miniphonic/api_object.rb +96 -0
  9. data/lib/miniphonic/helpers.rb +51 -0
  10. data/lib/miniphonic/info.rb +68 -0
  11. data/lib/miniphonic/preset.rb +17 -0
  12. data/lib/miniphonic/preset_attributes.rb +53 -0
  13. data/lib/miniphonic/production.rb +33 -0
  14. data/lib/miniphonic/production_attributes.rb +66 -0
  15. data/lib/miniphonic/response.rb +5 -0
  16. data/lib/miniphonic/version.rb +3 -0
  17. data/lib/miniphonic.rb +40 -0
  18. data/miniphonic.gemspec +29 -0
  19. data/test/spec/api_object_spec.rb +164 -0
  20. data/test/spec/cassettes/info/algorithms.yml +170 -0
  21. data/test/spec/cassettes/info/info.yml +740 -0
  22. data/test/spec/cassettes/info/output_files.yml +343 -0
  23. data/test/spec/cassettes/info/service_types.yml +263 -0
  24. data/test/spec/cassettes/info/services.yml +125 -0
  25. data/test/spec/cassettes/info/status_codes.yml +70 -0
  26. data/test/spec/cassettes/info/user_info.yml +63 -0
  27. data/test/spec/cassettes/preset/all.yml +795 -0
  28. data/test/spec/cassettes/preset/create.yml +97 -0
  29. data/test/spec/cassettes/preset/delete.yml +142 -0
  30. data/test/spec/cassettes/preset/upload_cover.yml +484 -0
  31. data/test/spec/cassettes/production/all.yml +6764 -0
  32. data/test/spec/cassettes/production/create.yml +118 -0
  33. data/test/spec/cassettes/production/delete.yml +163 -0
  34. data/test/spec/cassettes/production/start.yml +164 -0
  35. data/test/spec/cassettes/production/upload_audio.yml +20047 -0
  36. data/test/spec/cassettes/production/upload_audio_from_service.yml +233 -0
  37. data/test/spec/cassettes/production/upload_cover.yml +526 -0
  38. data/test/spec/data/test.jpg +0 -0
  39. data/test/spec/data/test.m4a +0 -0
  40. data/test/spec/helper.rb +32 -0
  41. data/test/spec/info_spec.rb +137 -0
  42. data/test/spec/preset_spec.rb +115 -0
  43. data/test/spec/production_spec.rb +181 -0
  44. metadata +223 -0
@@ -0,0 +1,118 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://auphonic.com/api/productions.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.8
12
+ Authorization:
13
+ - Basic c2lybWFyY2VsOm5hYy1kaWQtY2lkLXlvZC1qYS1zaGxlai15dWwteQ==
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.2.0
23
+ date:
24
+ - Fri, 18 Oct 2013 22:58:50 GMT
25
+ content-type:
26
+ - application/json; charset=utf-8
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - close
31
+ cache-control:
32
+ - max-age=0
33
+ vary:
34
+ - Authorization
35
+ expires:
36
+ - Fri, 18 Oct 2013 22:58:50 GMT
37
+ last-modified:
38
+ - Fri, 18 Oct 2013 22:58:50 GMT
39
+ access-control-allow-origin:
40
+ - '*'
41
+ access-control-allow-credentials:
42
+ - 'true'
43
+ access-control-allow-headers:
44
+ - Authorization,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
45
+ body:
46
+ encoding: UTF-8
47
+ string: |-
48
+ {
49
+ "status_code": 200,
50
+ "form_errors": {},
51
+ "error_code": null,
52
+ "error_message": "",
53
+ "data": {
54
+ "status_string": "Incomplete Form",
55
+ "image": null,
56
+ "creation_time": "2013-10-18T22:58:50.289Z",
57
+ "chapters": [],
58
+ "edit_page": "https://auphonic.com/engine/upload/edit/pLFRTfvyF8okMVGWyUD8HQ",
59
+ "channels": null,
60
+ "warning_message": "",
61
+ "samplerate": null,
62
+ "output_files": [],
63
+ "uuid": "pLFRTfvyF8okMVGWyUD8HQ",
64
+ "service": null,
65
+ "warning_status": null,
66
+ "has_video": false,
67
+ "error_status": null,
68
+ "thumbnail": null,
69
+ "metadata": {
70
+ "album": "",
71
+ "publisher": "",
72
+ "subtitle": "",
73
+ "license": "",
74
+ "artist": "",
75
+ "track": "",
76
+ "title": "",
77
+ "summary": "",
78
+ "append_chapters": false,
79
+ "url": "",
80
+ "license_url": "",
81
+ "location": {
82
+ "latitude": null,
83
+ "longitude": null
84
+ },
85
+ "year": "",
86
+ "genre": "",
87
+ "tags": [
88
+ ""
89
+ ]
90
+ },
91
+ "status": 9,
92
+ "input_file": "",
93
+ "status_page": "https://auphonic.com/engine/status/pLFRTfvyF8okMVGWyUD8HQ",
94
+ "length_timestring": "",
95
+ "multi_input_files": [],
96
+ "bitrate": null,
97
+ "output_basename": "",
98
+ "outgoing_services": [],
99
+ "change_time": "2013-10-18T22:58:50.289Z",
100
+ "error_message": "",
101
+ "waveform_image": null,
102
+ "length": 0,
103
+ "algorithms": {
104
+ "normloudness": true,
105
+ "loudnesstarget": -16,
106
+ "denoise": false,
107
+ "denoiseamount": 0,
108
+ "hipfilter": true,
109
+ "leveler": true
110
+ },
111
+ "start_allowed": false,
112
+ "change_allowed": true,
113
+ "format": ""
114
+ }
115
+ }
116
+ http_version:
117
+ recorded_at: Fri, 18 Oct 2013 22:58:59 GMT
118
+ recorded_with: VCR 2.6.0
@@ -0,0 +1,163 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://auphonic.com/api/productions.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.8
12
+ Authorization:
13
+ - Basic c2lybWFyY2VsOm5hYy1kaWQtY2lkLXlvZC1qYS1zaGxlai15dWwteQ==
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.2.0
23
+ date:
24
+ - Fri, 18 Oct 2013 23:00:10 GMT
25
+ content-type:
26
+ - application/json; charset=utf-8
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - close
31
+ cache-control:
32
+ - max-age=0
33
+ vary:
34
+ - Authorization
35
+ expires:
36
+ - Fri, 18 Oct 2013 23:00:10 GMT
37
+ last-modified:
38
+ - Fri, 18 Oct 2013 23:00:10 GMT
39
+ access-control-allow-origin:
40
+ - '*'
41
+ access-control-allow-credentials:
42
+ - 'true'
43
+ access-control-allow-headers:
44
+ - Authorization,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
45
+ body:
46
+ encoding: UTF-8
47
+ string: |-
48
+ {
49
+ "status_code": 200,
50
+ "form_errors": {},
51
+ "error_code": null,
52
+ "error_message": "",
53
+ "data": {
54
+ "status_string": "Incomplete Form",
55
+ "image": null,
56
+ "creation_time": "2013-10-18T23:00:10.730Z",
57
+ "chapters": [],
58
+ "edit_page": "https://auphonic.com/engine/upload/edit/a4gX8ESYgSPRNoTodHjniK",
59
+ "channels": null,
60
+ "warning_message": "",
61
+ "samplerate": null,
62
+ "output_files": [],
63
+ "uuid": "a4gX8ESYgSPRNoTodHjniK",
64
+ "service": null,
65
+ "warning_status": null,
66
+ "has_video": false,
67
+ "error_status": null,
68
+ "thumbnail": null,
69
+ "metadata": {
70
+ "album": "",
71
+ "publisher": "",
72
+ "subtitle": "",
73
+ "license": "",
74
+ "artist": "",
75
+ "track": "",
76
+ "title": "",
77
+ "summary": "",
78
+ "append_chapters": false,
79
+ "url": "",
80
+ "license_url": "",
81
+ "location": {
82
+ "latitude": null,
83
+ "longitude": null
84
+ },
85
+ "year": "",
86
+ "genre": "",
87
+ "tags": [
88
+ ""
89
+ ]
90
+ },
91
+ "status": 9,
92
+ "input_file": "",
93
+ "status_page": "https://auphonic.com/engine/status/a4gX8ESYgSPRNoTodHjniK",
94
+ "length_timestring": "",
95
+ "multi_input_files": [],
96
+ "bitrate": null,
97
+ "output_basename": "",
98
+ "outgoing_services": [],
99
+ "change_time": "2013-10-18T23:00:10.730Z",
100
+ "error_message": "",
101
+ "waveform_image": null,
102
+ "length": 0,
103
+ "algorithms": {
104
+ "normloudness": true,
105
+ "loudnesstarget": -16,
106
+ "denoise": false,
107
+ "denoiseamount": 0,
108
+ "hipfilter": true,
109
+ "leveler": true
110
+ },
111
+ "start_allowed": false,
112
+ "change_allowed": true,
113
+ "format": ""
114
+ }
115
+ }
116
+ http_version:
117
+ recorded_at: Fri, 18 Oct 2013 23:00:19 GMT
118
+ - request:
119
+ method: delete
120
+ uri: https://auphonic.com/api/production/a4gX8ESYgSPRNoTodHjniK.json
121
+ body:
122
+ encoding: US-ASCII
123
+ string: ''
124
+ headers:
125
+ User-Agent:
126
+ - Faraday v0.8.8
127
+ Authorization:
128
+ - Basic c2lybWFyY2VsOm5hYy1kaWQtY2lkLXlvZC1qYS1zaGxlai15dWwteQ==
129
+ response:
130
+ status:
131
+ code: 204
132
+ message:
133
+ headers:
134
+ server:
135
+ - nginx/1.2.0
136
+ date:
137
+ - Fri, 18 Oct 2013 23:00:11 GMT
138
+ content-type:
139
+ - application/json; charset=utf-8
140
+ content-length:
141
+ - '0'
142
+ connection:
143
+ - close
144
+ expires:
145
+ - Fri, 18 Oct 2013 23:00:11 GMT
146
+ vary:
147
+ - Authorization
148
+ last-modified:
149
+ - Fri, 18 Oct 2013 23:00:11 GMT
150
+ cache-control:
151
+ - max-age=0
152
+ access-control-allow-origin:
153
+ - '*'
154
+ access-control-allow-credentials:
155
+ - 'true'
156
+ access-control-allow-headers:
157
+ - Authorization,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
158
+ body:
159
+ encoding: US-ASCII
160
+ string: ''
161
+ http_version:
162
+ recorded_at: Fri, 18 Oct 2013 23:00:20 GMT
163
+ recorded_with: VCR 2.6.0
@@ -0,0 +1,164 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://auphonic.com/api/productions.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.8
12
+ Authorization:
13
+ - Basic c2lybWFyY2VsOm5hYy1kaWQtY2lkLXlvZC1qYS1zaGxlai15dWwteQ==
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.2.0
23
+ date:
24
+ - Fri, 18 Oct 2013 22:58:51 GMT
25
+ content-type:
26
+ - application/json; charset=utf-8
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - close
31
+ cache-control:
32
+ - max-age=0
33
+ vary:
34
+ - Authorization
35
+ expires:
36
+ - Fri, 18 Oct 2013 22:58:51 GMT
37
+ last-modified:
38
+ - Fri, 18 Oct 2013 22:58:51 GMT
39
+ access-control-allow-origin:
40
+ - '*'
41
+ access-control-allow-credentials:
42
+ - 'true'
43
+ access-control-allow-headers:
44
+ - Authorization,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
45
+ body:
46
+ encoding: UTF-8
47
+ string: |-
48
+ {
49
+ "status_code": 200,
50
+ "form_errors": {},
51
+ "error_code": null,
52
+ "error_message": "",
53
+ "data": {
54
+ "status_string": "Incomplete Form",
55
+ "image": null,
56
+ "creation_time": "2013-10-18T22:58:51.235Z",
57
+ "chapters": [],
58
+ "edit_page": "https://auphonic.com/engine/upload/edit/uVptnyFksfUuW4wZySN62b",
59
+ "channels": null,
60
+ "warning_message": "",
61
+ "samplerate": null,
62
+ "output_files": [],
63
+ "uuid": "uVptnyFksfUuW4wZySN62b",
64
+ "service": null,
65
+ "warning_status": null,
66
+ "has_video": false,
67
+ "error_status": null,
68
+ "thumbnail": null,
69
+ "metadata": {
70
+ "album": "",
71
+ "publisher": "",
72
+ "subtitle": "",
73
+ "license": "",
74
+ "artist": "",
75
+ "track": "",
76
+ "title": "",
77
+ "summary": "",
78
+ "append_chapters": false,
79
+ "url": "",
80
+ "license_url": "",
81
+ "location": {
82
+ "latitude": null,
83
+ "longitude": null
84
+ },
85
+ "year": "",
86
+ "genre": "",
87
+ "tags": [
88
+ ""
89
+ ]
90
+ },
91
+ "status": 9,
92
+ "input_file": "",
93
+ "status_page": "https://auphonic.com/engine/status/uVptnyFksfUuW4wZySN62b",
94
+ "length_timestring": "",
95
+ "multi_input_files": [],
96
+ "bitrate": null,
97
+ "output_basename": "",
98
+ "outgoing_services": [],
99
+ "change_time": "2013-10-18T22:58:51.235Z",
100
+ "error_message": "",
101
+ "waveform_image": null,
102
+ "length": 0,
103
+ "algorithms": {
104
+ "normloudness": true,
105
+ "loudnesstarget": -16,
106
+ "denoise": false,
107
+ "denoiseamount": 0,
108
+ "hipfilter": true,
109
+ "leveler": true
110
+ },
111
+ "start_allowed": false,
112
+ "change_allowed": true,
113
+ "format": ""
114
+ }
115
+ }
116
+ http_version:
117
+ recorded_at: Fri, 18 Oct 2013 22:59:00 GMT
118
+ - request:
119
+ method: post
120
+ uri: https://auphonic.com/api/production/uVptnyFksfUuW4wZySN62b/start.json
121
+ body:
122
+ encoding: US-ASCII
123
+ string: ''
124
+ headers:
125
+ User-Agent:
126
+ - Faraday v0.8.8
127
+ Authorization:
128
+ - Basic c2lybWFyY2VsOm5hYy1kaWQtY2lkLXlvZC1qYS1zaGxlai15dWwteQ==
129
+ response:
130
+ status:
131
+ code: 400
132
+ message:
133
+ headers:
134
+ server:
135
+ - nginx/1.2.0
136
+ date:
137
+ - Fri, 18 Oct 2013 22:58:51 GMT
138
+ content-type:
139
+ - application/json; charset=utf-8
140
+ transfer-encoding:
141
+ - chunked
142
+ connection:
143
+ - close
144
+ cache-control:
145
+ - max-age=0
146
+ vary:
147
+ - Authorization
148
+ expires:
149
+ - Fri, 18 Oct 2013 22:58:51 GMT
150
+ last-modified:
151
+ - Fri, 18 Oct 2013 22:58:51 GMT
152
+ body:
153
+ encoding: UTF-8
154
+ string: |-
155
+ {
156
+ "status_code": 400,
157
+ "form_errors": {},
158
+ "error_code": null,
159
+ "error_message": "Can't start the production: it is already started or you have to provide more data!",
160
+ "data": null
161
+ }
162
+ http_version:
163
+ recorded_at: Fri, 18 Oct 2013 22:59:00 GMT
164
+ recorded_with: VCR 2.6.0