telestream_cloud 1.1.0 → 2.0.0.1
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/.gitignore +2 -0
- data/README.md +16 -354
- data/flip/.gitignore +39 -0
- data/flip/.rspec +2 -0
- data/flip/.swagger-codegen-ignore +23 -0
- data/flip/.swagger-codegen/VERSION +1 -0
- data/flip/Gemfile +7 -0
- data/flip/README.md +130 -0
- data/flip/Rakefile +8 -0
- data/flip/docs/CanceledResponse.md +8 -0
- data/flip/docs/CloudNotificationSettings.md +11 -0
- data/flip/docs/CloudNotificationSettingsEvents.md +11 -0
- data/flip/docs/CopyProfileBody.md +9 -0
- data/flip/docs/CountResponse.md +8 -0
- data/flip/docs/CreateEncodingBody.md +10 -0
- data/flip/docs/CreateVideoBody.md +12 -0
- data/flip/docs/DeletedResponse.md +8 -0
- data/flip/docs/Encoding.md +38 -0
- data/flip/docs/EncodingSignedUrl.md +8 -0
- data/flip/docs/EncodingSignedUrls.md +8 -0
- data/flip/docs/Error.md +9 -0
- data/flip/docs/ExtraFile.md +10 -0
- data/flip/docs/Factory.md +25 -0
- data/flip/docs/FactoryBody.md +23 -0
- data/flip/docs/FactoryBodyStorageCredentialAttributes.md +11 -0
- data/flip/docs/FactorySync.md +8 -0
- data/flip/docs/FactorySyncBody.md +8 -0
- data/flip/docs/FlipApi.md +2179 -0
- data/flip/docs/PaginatedEncodingsCollection.md +11 -0
- data/flip/docs/PaginatedFactoryCollection.md +11 -0
- data/flip/docs/PaginatedProfilesCollection.md +11 -0
- data/flip/docs/PaginatedVideoCollection.md +11 -0
- data/flip/docs/PaginatedWorkflowsCollection.md +11 -0
- data/flip/docs/Profile.md +135 -0
- data/flip/docs/ProfileBody.md +137 -0
- data/flip/docs/ResubmitVideoBody.md +8 -0
- data/flip/docs/RetriedResponse.md +8 -0
- data/flip/docs/SignedVideoUrl.md +8 -0
- data/flip/docs/UpdateEncodingBody.md +9 -0
- data/flip/docs/UploadSession.md +13 -0
- data/flip/docs/Video.md +31 -0
- data/flip/docs/VideoMetadata.md +7 -0
- data/flip/docs/VideoUploadBody.md +24 -0
- data/flip/git_push.sh +55 -0
- data/flip/lib/telestream_cloud_flip.rb +79 -0
- data/flip/lib/telestream_cloud_flip/api/flip_api.rb +2385 -0
- data/flip/lib/telestream_cloud_flip/api_client.rb +389 -0
- data/flip/lib/telestream_cloud_flip/api_error.rb +38 -0
- data/flip/lib/telestream_cloud_flip/configuration.rb +209 -0
- data/flip/lib/telestream_cloud_flip/models/canceled_response.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/cloud_notification_settings.rb +237 -0
- data/flip/lib/telestream_cloud_flip/models/cloud_notification_settings_events.rb +239 -0
- data/flip/lib/telestream_cloud_flip/models/copy_profile_body.rb +209 -0
- data/flip/lib/telestream_cloud_flip/models/count_response.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/create_encoding_body.rb +214 -0
- data/flip/lib/telestream_cloud_flip/models/create_video_body.rb +231 -0
- data/flip/lib/telestream_cloud_flip/models/deleted_response.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/encoding.rb +486 -0
- data/flip/lib/telestream_cloud_flip/models/encoding_signed_url.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/encoding_signed_urls.rb +191 -0
- data/flip/lib/telestream_cloud_flip/models/error.rb +199 -0
- data/flip/lib/telestream_cloud_flip/models/extra_file.rb +221 -0
- data/flip/lib/telestream_cloud_flip/models/factory.rb +388 -0
- data/flip/lib/telestream_cloud_flip/models/factory_body.rb +374 -0
- data/flip/lib/telestream_cloud_flip/models/factory_body_storage_credential_attributes.rb +215 -0
- data/flip/lib/telestream_cloud_flip/models/factory_sync.rb +222 -0
- data/flip/lib/telestream_cloud_flip/models/factory_sync_body.rb +227 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_encodings_collection.rb +240 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_factory_collection.rb +220 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_profiles_collection.rb +220 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_video_collection.rb +220 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_workflows_collection.rb +220 -0
- data/flip/lib/telestream_cloud_flip/models/profile.rb +1777 -0
- data/flip/lib/telestream_cloud_flip/models/profile_body.rb +1762 -0
- data/flip/lib/telestream_cloud_flip/models/resubmit_video_body.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/retried_response.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/signed_video_url.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/update_encoding_body.rb +199 -0
- data/flip/lib/telestream_cloud_flip/models/upload_session.rb +249 -0
- data/flip/lib/telestream_cloud_flip/models/video.rb +418 -0
- data/flip/lib/telestream_cloud_flip/models/video_metadata.rb +179 -0
- data/flip/lib/telestream_cloud_flip/models/video_upload_body.rb +362 -0
- data/flip/lib/telestream_cloud_flip/uploader.rb +244 -0
- data/flip/lib/telestream_cloud_flip/version.rb +18 -0
- data/flip/spec/api/flip_api_spec.rb +550 -0
- data/flip/spec/api_client_spec.rb +226 -0
- data/flip/spec/configuration_spec.rb +42 -0
- data/flip/spec/models/canceled_response_spec.rb +42 -0
- data/flip/spec/models/cloud_notification_settings_events_spec.rb +60 -0
- data/flip/spec/models/cloud_notification_settings_spec.rb +60 -0
- data/flip/spec/models/copy_profile_body_spec.rb +48 -0
- data/flip/spec/models/count_response_spec.rb +42 -0
- data/flip/spec/models/create_encoding_body_spec.rb +54 -0
- data/flip/spec/models/create_video_body_spec.rb +66 -0
- data/flip/spec/models/deleted_response_spec.rb +42 -0
- data/flip/spec/models/encoding_signed_url_spec.rb +42 -0
- data/flip/spec/models/encoding_signed_urls_spec.rb +42 -0
- data/flip/spec/models/encoding_spec.rb +222 -0
- data/flip/spec/models/error_spec.rb +48 -0
- data/flip/spec/models/extra_file_spec.rb +54 -0
- data/flip/spec/models/factory_body_spec.rb +136 -0
- data/flip/spec/models/factory_body_storage_credential_attributes_spec.rb +60 -0
- data/flip/spec/models/factory_spec.rb +148 -0
- data/flip/spec/models/factory_sync_body_spec.rb +46 -0
- data/flip/spec/models/factory_sync_spec.rb +46 -0
- data/flip/spec/models/paginated_encodings_collection_spec.rb +60 -0
- data/flip/spec/models/paginated_factory_collection_spec.rb +60 -0
- data/flip/spec/models/paginated_profiles_collection_spec.rb +60 -0
- data/flip/spec/models/paginated_video_collection_spec.rb +60 -0
- data/flip/spec/models/paginated_workflows_collection_spec.rb +60 -0
- data/flip/spec/models/profile_body_spec.rb +916 -0
- data/flip/spec/models/profile_spec.rb +916 -0
- data/flip/spec/models/resubmit_video_body_spec.rb +42 -0
- data/flip/spec/models/retried_response_spec.rb +42 -0
- data/flip/spec/models/signed_video_url_spec.rb +42 -0
- data/flip/spec/models/update_encoding_body_spec.rb +48 -0
- data/flip/spec/models/upload_session_spec.rb +72 -0
- data/flip/spec/models/video_metadata_spec.rb +36 -0
- data/flip/spec/models/video_spec.rb +180 -0
- data/flip/spec/models/video_upload_body_spec.rb +138 -0
- data/flip/spec/spec_helper.rb +111 -0
- data/flip/telestream_cloud_flip.gemspec +47 -0
- data/lib/telestream_cloud.rb +0 -31
- data/lib/telestream_cloud/flip.rb +1 -9
- data/lib/telestream_cloud/qc.rb +1 -0
- data/lib/telestream_cloud/tts.rb +1 -0
- data/lib/telestream_cloud/version.rb +1 -1
- data/qc/.gitignore +39 -0
- data/qc/.rspec +2 -0
- data/qc/.swagger-codegen-ignore +23 -0
- data/qc/.swagger-codegen/VERSION +1 -0
- data/qc/Gemfile +7 -0
- data/qc/README.md +58 -0
- data/qc/Rakefile +8 -0
- data/qc/docs/Alert.md +13 -0
- data/qc/docs/AudioStream.md +13 -0
- data/qc/docs/Container.md +9 -0
- data/qc/docs/Data.md +10 -0
- data/qc/docs/Data1.md +9 -0
- data/qc/docs/ExtraFile.md +10 -0
- data/qc/docs/Job.md +12 -0
- data/qc/docs/JobData.md +9 -0
- data/qc/docs/JobDetails.md +9 -0
- data/qc/docs/JobDetailsResult.md +8 -0
- data/qc/docs/JobsCollection.md +12 -0
- data/qc/docs/Media.md +10 -0
- data/qc/docs/Options.md +7 -0
- data/qc/docs/Project.md +12 -0
- data/qc/docs/Proxy.md +12 -0
- data/qc/docs/QcApi.md +719 -0
- data/qc/docs/UploadSession.md +13 -0
- data/qc/docs/VideoStream.md +13 -0
- data/qc/docs/VideoUploadBody.md +12 -0
- data/qc/git_push.sh +55 -0
- data/qc/lib/telestream_cloud_qc.rb +64 -0
- data/qc/lib/telestream_cloud_qc/api/qc_api.rb +781 -0
- data/qc/lib/telestream_cloud_qc/api_client.rb +389 -0
- data/qc/lib/telestream_cloud_qc/api_error.rb +38 -0
- data/qc/lib/telestream_cloud_qc/configuration.rb +209 -0
- data/qc/lib/telestream_cloud_qc/models/alert.rb +236 -0
- data/qc/lib/telestream_cloud_qc/models/audio_stream.rb +238 -0
- data/qc/lib/telestream_cloud_qc/models/container.rb +198 -0
- data/qc/lib/telestream_cloud_qc/models/data.rb +208 -0
- data/qc/lib/telestream_cloud_qc/models/data_1.rb +197 -0
- data/qc/lib/telestream_cloud_qc/models/extra_file.rb +221 -0
- data/qc/lib/telestream_cloud_qc/models/job.rb +269 -0
- data/qc/lib/telestream_cloud_qc/models/job_data.rb +197 -0
- data/qc/lib/telestream_cloud_qc/models/job_details.rb +199 -0
- data/qc/lib/telestream_cloud_qc/models/job_details_result.rb +190 -0
- data/qc/lib/telestream_cloud_qc/models/jobs_collection.rb +230 -0
- data/qc/lib/telestream_cloud_qc/models/media.rb +210 -0
- data/qc/lib/telestream_cloud_qc/models/options.rb +179 -0
- data/qc/lib/telestream_cloud_qc/models/project.rb +262 -0
- data/qc/lib/telestream_cloud_qc/models/proxy.rb +224 -0
- data/qc/lib/telestream_cloud_qc/models/upload_session.rb +249 -0
- data/qc/lib/telestream_cloud_qc/models/video_stream.rb +235 -0
- data/qc/lib/telestream_cloud_qc/models/video_upload_body.rb +242 -0
- data/qc/lib/telestream_cloud_qc/uploader.rb +244 -0
- data/qc/lib/telestream_cloud_qc/version.rb +18 -0
- data/qc/spec/api/qc_api_spec.rb +202 -0
- data/qc/spec/api_client_spec.rb +226 -0
- data/qc/spec/configuration_spec.rb +42 -0
- data/qc/spec/models/alert_spec.rb +72 -0
- data/qc/spec/models/audio_stream_spec.rb +72 -0
- data/qc/spec/models/container_spec.rb +48 -0
- data/qc/spec/models/data_1_spec.rb +48 -0
- data/qc/spec/models/data_spec.rb +54 -0
- data/qc/spec/models/extra_file_spec.rb +54 -0
- data/qc/spec/models/job_data_spec.rb +48 -0
- data/qc/spec/models/job_details_result_spec.rb +42 -0
- data/qc/spec/models/job_details_spec.rb +48 -0
- data/qc/spec/models/job_spec.rb +74 -0
- data/qc/spec/models/jobs_collection_spec.rb +66 -0
- data/qc/spec/models/media_spec.rb +54 -0
- data/qc/spec/models/options_spec.rb +36 -0
- data/qc/spec/models/project_spec.rb +70 -0
- data/qc/spec/models/proxy_spec.rb +66 -0
- data/qc/spec/models/upload_session_spec.rb +72 -0
- data/qc/spec/models/video_stream_spec.rb +72 -0
- data/qc/spec/models/video_upload_body_spec.rb +66 -0
- data/qc/spec/spec_helper.rb +111 -0
- data/qc/telestream_cloud_qc.gemspec +47 -0
- data/telestream_cloud.gemspec +7 -12
- data/tts/.gitignore +39 -0
- data/tts/.rspec +2 -0
- data/tts/.swagger-codegen-ignore +23 -0
- data/tts/.swagger-codegen/VERSION +1 -0
- data/tts/Gemfile +7 -0
- data/tts/README.md +92 -0
- data/tts/Rakefile +8 -0
- data/tts/docs/CorporaCollection.md +8 -0
- data/tts/docs/Corpus.md +9 -0
- data/tts/docs/ErrorResponse.md +7 -0
- data/tts/docs/ExtraFile.md +10 -0
- data/tts/docs/Fragment.md +10 -0
- data/tts/docs/FragmentVariant.md +9 -0
- data/tts/docs/Job.md +23 -0
- data/tts/docs/JobResult.md +8 -0
- data/tts/docs/JobsCollection.md +12 -0
- data/tts/docs/Project.md +18 -0
- data/tts/docs/ProjectsCollection.md +12 -0
- data/tts/docs/Result.md +12 -0
- data/tts/docs/TtsApi.md +902 -0
- data/tts/docs/UploadSession.md +13 -0
- data/tts/docs/VideoUploadBody.md +12 -0
- data/tts/git_push.sh +55 -0
- data/tts/lib/telestream_cloud_tts.rb +60 -0
- data/tts/lib/telestream_cloud_tts/api/tts_api.rb +946 -0
- data/tts/lib/telestream_cloud_tts/api_client.rb +389 -0
- data/tts/lib/telestream_cloud_tts/api_error.rb +38 -0
- data/tts/lib/telestream_cloud_tts/configuration.rb +209 -0
- data/tts/lib/telestream_cloud_tts/models/corpora_collection.rb +191 -0
- data/tts/lib/telestream_cloud_tts/models/corpus.rb +199 -0
- data/tts/lib/telestream_cloud_tts/models/error_response.rb +179 -0
- data/tts/lib/telestream_cloud_tts/models/extra_file.rb +221 -0
- data/tts/lib/telestream_cloud_tts/models/fragment.rb +211 -0
- data/tts/lib/telestream_cloud_tts/models/fragment_variant.rb +199 -0
- data/tts/lib/telestream_cloud_tts/models/job.rb +372 -0
- data/tts/lib/telestream_cloud_tts/models/job_result.rb +191 -0
- data/tts/lib/telestream_cloud_tts/models/jobs_collection.rb +230 -0
- data/tts/lib/telestream_cloud_tts/models/project.rb +322 -0
- data/tts/lib/telestream_cloud_tts/models/projects_collection.rb +230 -0
- data/tts/lib/telestream_cloud_tts/models/result.rb +230 -0
- data/tts/lib/telestream_cloud_tts/models/upload_session.rb +249 -0
- data/tts/lib/telestream_cloud_tts/models/video_upload_body.rb +241 -0
- data/tts/lib/telestream_cloud_tts/uploader.rb +244 -0
- data/tts/lib/telestream_cloud_tts/version.rb +18 -0
- data/tts/spec/api/tts_api_spec.rb +236 -0
- data/tts/spec/api_client_spec.rb +226 -0
- data/tts/spec/configuration_spec.rb +42 -0
- data/tts/spec/models/corpora_collection_spec.rb +42 -0
- data/tts/spec/models/corpus_spec.rb +48 -0
- data/tts/spec/models/error_response_spec.rb +36 -0
- data/tts/spec/models/extra_file_spec.rb +54 -0
- data/tts/spec/models/fragment_spec.rb +54 -0
- data/tts/spec/models/fragment_variant_spec.rb +48 -0
- data/tts/spec/models/job_result_spec.rb +42 -0
- data/tts/spec/models/job_spec.rb +136 -0
- data/tts/spec/models/jobs_collection_spec.rb +66 -0
- data/tts/spec/models/project_spec.rb +106 -0
- data/tts/spec/models/projects_collection_spec.rb +66 -0
- data/tts/spec/models/result_spec.rb +66 -0
- data/tts/spec/models/upload_session_spec.rb +72 -0
- data/tts/spec/models/video_upload_body_spec.rb +66 -0
- data/tts/spec/spec_helper.rb +111 -0
- data/tts/telestream_cloud_tts.gemspec +47 -0
- metadata +281 -123
- data/Gemfile +0 -2
- data/lib/telestream_cloud/api_authentication.rb +0 -66
- data/lib/telestream_cloud/base.rb +0 -111
- data/lib/telestream_cloud/config.rb +0 -87
- data/lib/telestream_cloud/connection.rb +0 -101
- data/lib/telestream_cloud/errors.rb +0 -17
- data/lib/telestream_cloud/faraday.rb +0 -84
- data/lib/telestream_cloud/modules/associations.rb +0 -55
- data/lib/telestream_cloud/modules/builders.rb +0 -45
- data/lib/telestream_cloud/modules/destroyers.rb +0 -25
- data/lib/telestream_cloud/modules/factory_connection.rb +0 -7
- data/lib/telestream_cloud/modules/finders.rb +0 -68
- data/lib/telestream_cloud/modules/router.rb +0 -62
- data/lib/telestream_cloud/modules/updatable.rb +0 -31
- data/lib/telestream_cloud/modules/video_state.rb +0 -16
- data/lib/telestream_cloud/parallel_uploader.rb +0 -52
- data/lib/telestream_cloud/proxies/encoding_scope.rb +0 -56
- data/lib/telestream_cloud/proxies/profile_scope.rb +0 -7
- data/lib/telestream_cloud/proxies/proxy.rb +0 -27
- data/lib/telestream_cloud/proxies/scope.rb +0 -94
- data/lib/telestream_cloud/proxies/video_scope.rb +0 -28
- data/lib/telestream_cloud/resources/encoding.rb +0 -47
- data/lib/telestream_cloud/resources/factory.rb +0 -72
- data/lib/telestream_cloud/resources/profile.rb +0 -22
- data/lib/telestream_cloud/resources/resource.rb +0 -48
- data/lib/telestream_cloud/resources/video.rb +0 -39
- data/lib/telestream_cloud/telestream_cloud.rb +0 -69
- data/lib/telestream_cloud/upload_session.rb +0 -40
- data/lib/telestream_cloud/uploader.rb +0 -123
- data/lib/telestream_cloud/uploader/file_reader.rb +0 -27
- data/spec/cloud_spec.rb +0 -132
- data/spec/encoding_spec.rb +0 -260
- data/spec/heroku_spec.rb +0 -32
- data/spec/panda_spec.rb +0 -206
- data/spec/profile_spec.rb +0 -117
- data/spec/spec_helper.rb +0 -18
- data/spec/uploader_spec.rb +0 -143
- data/spec/video_spec.rb +0 -399
@@ -1,123 +0,0 @@
|
|
1
|
-
require 'pathname'
|
2
|
-
require 'json'
|
3
|
-
|
4
|
-
module TelestreamCloud
|
5
|
-
class Uploader
|
6
|
-
class UploadError < StandardError; end
|
7
|
-
class MissingPartError < StandardError; end
|
8
|
-
|
9
|
-
attr_reader :reader, :video, :status, :error
|
10
|
-
|
11
|
-
def self.upload(options)
|
12
|
-
retries = options.delete(:retries)
|
13
|
-
new(options).tap { |x| x.upload(*[retries].compact) }.video
|
14
|
-
end
|
15
|
-
|
16
|
-
def initialize(options)
|
17
|
-
file = options.delete(:file) { |key| fail KeyError, "key not found: #{key}" }
|
18
|
-
|
19
|
-
@reader = FileReader.new(file)
|
20
|
-
|
21
|
-
defaults = {
|
22
|
-
file_size: reader.size,
|
23
|
-
file_name: reader.name,
|
24
|
-
multi_chunk: true
|
25
|
-
}
|
26
|
-
|
27
|
-
@params = defaults.merge(options)
|
28
|
-
@status = :ready
|
29
|
-
end
|
30
|
-
|
31
|
-
def upload(retries = 5)
|
32
|
-
count = 0
|
33
|
-
begin
|
34
|
-
count += 1
|
35
|
-
upload!
|
36
|
-
fail MissingPartError unless success?
|
37
|
-
rescue => e
|
38
|
-
@error = e
|
39
|
-
retry if count < retries
|
40
|
-
self.status = :failed
|
41
|
-
end
|
42
|
-
|
43
|
-
success?
|
44
|
-
end
|
45
|
-
|
46
|
-
def success?
|
47
|
-
status == :success
|
48
|
-
end
|
49
|
-
|
50
|
-
private
|
51
|
-
|
52
|
-
def upload!
|
53
|
-
self.status = :uploading
|
54
|
-
upload_chunks(missing_parts)
|
55
|
-
end
|
56
|
-
|
57
|
-
def upload_chunks(ids)
|
58
|
-
ids.each(&method(:send_chunk))
|
59
|
-
end
|
60
|
-
|
61
|
-
def missing_parts
|
62
|
-
return (0...parts).to_a unless @session
|
63
|
-
upload_status['missing_parts']
|
64
|
-
end
|
65
|
-
|
66
|
-
def send_chunk(index)
|
67
|
-
range = (index * part_size...[(index + 1) * part_size, reader.size].min)
|
68
|
-
|
69
|
-
# TODO: remove when 1.9 dropped
|
70
|
-
unless range.respond_to?(:size)
|
71
|
-
def range.size; self.end - self.begin + (exclude_end? ? 0 : 1); end
|
72
|
-
end
|
73
|
-
|
74
|
-
response = http.put do |request|
|
75
|
-
request.headers['Content-Type'] = 'application/octet-stream'
|
76
|
-
request.headers['X-Part'] = "#{index}"
|
77
|
-
request.headers['Content-Length'] = "#{range.size}"
|
78
|
-
request.body = reader[range]
|
79
|
-
end
|
80
|
-
|
81
|
-
set_video(response)
|
82
|
-
response
|
83
|
-
end
|
84
|
-
|
85
|
-
def set_video(response)
|
86
|
-
return if response.status != 200 || response.body.empty?
|
87
|
-
@video = Video.new(JSON.parse(response.body))
|
88
|
-
self.status = :success
|
89
|
-
end
|
90
|
-
|
91
|
-
def status=(status)
|
92
|
-
@status = status
|
93
|
-
@error = nil if success?
|
94
|
-
@status
|
95
|
-
end
|
96
|
-
|
97
|
-
def http
|
98
|
-
@http ||= ::Faraday.new(url: URI(session['location'])) do |builder|
|
99
|
-
builder.request :multipart
|
100
|
-
builder.request :url_encoded
|
101
|
-
builder.adapter TelestreamCloud.default_adapter
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
def upload_status
|
106
|
-
JSON.parse(http.get.body)
|
107
|
-
end
|
108
|
-
|
109
|
-
def parts; session['parts'].to_i; end
|
110
|
-
def part_size; session['part_size'].to_i; end
|
111
|
-
def max_connections; session['max_connections'].to_i; end
|
112
|
-
|
113
|
-
def session
|
114
|
-
@session ||= TelestreamCloud.post('/videos/upload.json', @params)
|
115
|
-
|
116
|
-
if !@session || @session['error']
|
117
|
-
fail UploadError, @session && @session.values_at('error', 'message')
|
118
|
-
end
|
119
|
-
|
120
|
-
@session
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
class Uploader
|
3
|
-
class FileReader
|
4
|
-
attr_reader :file
|
5
|
-
|
6
|
-
def initialize(file)
|
7
|
-
@file = file
|
8
|
-
@mutex = Mutex.new
|
9
|
-
end
|
10
|
-
|
11
|
-
def [](range)
|
12
|
-
@mutex.synchronize do
|
13
|
-
file.seek(range.begin)
|
14
|
-
file.read(range.size)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def size
|
19
|
-
@size ||= file.size
|
20
|
-
end
|
21
|
-
|
22
|
-
def name
|
23
|
-
Pathname.new(file.path).basename
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/spec/cloud_spec.rb
DELETED
@@ -1,132 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe TelestreamCloud::Factory do
|
4
|
-
|
5
|
-
describe "region" do
|
6
|
-
it "should tell the region" do
|
7
|
-
TelestreamCloud.configure do
|
8
|
-
access_key "my_access_key"
|
9
|
-
secret_key "my_secret_key"
|
10
|
-
api_host "api.pandastream.com"
|
11
|
-
factory_id 'my_cloud_id'
|
12
|
-
api_port 85
|
13
|
-
end
|
14
|
-
|
15
|
-
TelestreamCloud.factory.region.should == "us"
|
16
|
-
TelestreamCloud.factory.us?.should == true
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should tell the region" do
|
20
|
-
TelestreamCloud.configure do
|
21
|
-
access_key "my_access_key"
|
22
|
-
secret_key "my_secret_key"
|
23
|
-
api_host "api-eu.pandastream.com"
|
24
|
-
factory_id 'my_cloud_id'
|
25
|
-
api_port 85
|
26
|
-
end
|
27
|
-
|
28
|
-
TelestreamCloud.factory.region.should == "eu"
|
29
|
-
TelestreamCloud.factory.eu?.should == true
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
describe "Using configure bloc" do
|
38
|
-
before(:each) do
|
39
|
-
TelestreamCloud.configure do
|
40
|
-
access_key "my_access_key"
|
41
|
-
secret_key "my_secret_key"
|
42
|
-
api_host "api.example.com"
|
43
|
-
factory_id 'my_cloud_id'
|
44
|
-
api_port 85
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe "using a cloud" do
|
49
|
-
before(:each) do
|
50
|
-
cloud_json = "{\"s3_videos_bucket\":\"my_bucket1\",\"id\":\"cloud1\"}"
|
51
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/factories\/cloud1.json/).
|
52
|
-
to_return(:body => cloud_json)
|
53
|
-
@factory = TelestreamCloud::Factory.find "cloud1"
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should find all videos" do
|
57
|
-
videos_json = "[{\"source_url\":\"my_source_url\",\"id\":\"123\"}]"
|
58
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos.json/).
|
59
|
-
with{|r| r.uri.query =~ /factory_id=cloud1/}.
|
60
|
-
to_return(:body => videos_json)
|
61
|
-
|
62
|
-
@factory.videos.first.id.should == "123"
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should find all videos with params" do
|
66
|
-
videos_json = "[{\"source_url\":\"my_source_url\",\"id\":\"134\"}]"
|
67
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos.json/).
|
68
|
-
with{|r| r.uri.query =~ /status=success/ && r.uri.query =~ /factory_id=cloud1/}.
|
69
|
-
to_return(:body => videos_json)
|
70
|
-
videos = @factory.videos.all(:status => "success")
|
71
|
-
videos.first.id.should == "134"
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should find a video by id" do
|
75
|
-
video_json = "{\"source_url\":\"my_source_url\",\"id\":\"123\"}"
|
76
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123.json/).
|
77
|
-
with{|r| r.uri.query =~ /factory_id=cloud1/}.
|
78
|
-
to_return(:body => video_json)
|
79
|
-
|
80
|
-
video = @factory.videos.find "123"
|
81
|
-
video.id.should == "123"
|
82
|
-
end
|
83
|
-
|
84
|
-
it "should create a video using cloud" do
|
85
|
-
videos_json = "{\"source_url\":\"my_source_url\",\"id\":\"123\"}"
|
86
|
-
stub_http_request(:post, /api.example.com:85\/v3.0\/videos.json/).
|
87
|
-
with{|r| r.body =~ /factory_id=cloud1/}.
|
88
|
-
to_return(:body => videos_json)
|
89
|
-
@factory.videos.create(:source_url => "my_source_url")
|
90
|
-
end
|
91
|
-
|
92
|
-
it "should find return all cloud" do
|
93
|
-
clouds_json = "[{\"s3_videos_bucket\":\"my_bucket1\",\"id\":\"cloud1\"},{\"s3_videos_bucket\":\"my_bucket2\",\"id\":\"cloud2\"}]"
|
94
|
-
|
95
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/factories.json/).to_return(:body => clouds_json)
|
96
|
-
|
97
|
-
factory = TelestreamCloud::Factory.all
|
98
|
-
factory.first.id.should == 'cloud1'
|
99
|
-
factory.first.s3_videos_bucket.should == "my_bucket1"
|
100
|
-
factory.size.should == 2
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
|
105
|
-
it "should create a cloud" do
|
106
|
-
cloud_json = "{\"s3_videos_bucket\":\"videobucket\",\"id\":\"my_cloud_id\"}"
|
107
|
-
stub_http_request(:post, /http:\/\/api.example.com:85\/v3.0\/factories.json/).
|
108
|
-
with{|r| r.body =~ /s3_videos_bucket=videobucket/ && r.body =~ /user_aws_key=myaccesskey/ && r.body =~ /user_aws_secret=mysecretkey/ }.
|
109
|
-
to_return(:body => cloud_json)
|
110
|
-
|
111
|
-
@cloud = TelestreamCloud::Factory.create(:s3_videos_bucket => 'videobucket', :user_aws_key => 'myaccesskey', :user_aws_secret => 'mysecretkey')
|
112
|
-
@cloud.s3_videos_bucket.should == "videobucket"
|
113
|
-
end
|
114
|
-
|
115
|
-
|
116
|
-
it "should create a cloud and reload" do
|
117
|
-
cloud_json = "{\"s3_videos_bucket\":\"videobucket\",\"id\":\"my_new_cloud_id\"}"
|
118
|
-
stub_http_request(:post, /http:\/\/api.example.com:85\/v3.0\/factories.json/).
|
119
|
-
to_return(:body => cloud_json)
|
120
|
-
|
121
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/factories\/my_new_cloud_id.json/).
|
122
|
-
to_return(:body => cloud_json)
|
123
|
-
|
124
|
-
@cloud = TelestreamCloud::Factory.create(:s3_videos_bucket => 'videobucket', :user_aws_key => 'myaccesskey', :user_aws_secret => 'mysecretkey')
|
125
|
-
@cloud.reload.should == @cloud
|
126
|
-
end
|
127
|
-
|
128
|
-
end
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
end
|
data/spec/encoding_spec.rb
DELETED
@@ -1,260 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe TelestreamCloud::Encoding do
|
4
|
-
before(:each) do
|
5
|
-
|
6
|
-
TelestreamCloud.configure do
|
7
|
-
access_key "my_access_key"
|
8
|
-
secret_key "my_secret_key"
|
9
|
-
api_host "api.example.com"
|
10
|
-
factory_id 'my_cloud_id'
|
11
|
-
api_port 85
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should find by video_id" do
|
17
|
-
encoding_json = "[{\"abc\":\"efg\",\"id\":456}]"
|
18
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123\/encodings.json/).
|
19
|
-
to_return(:body => encoding_json)
|
20
|
-
TelestreamCloud::Encoding.find_all_by_video_id("123").first.id.should == 456
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should create an encoding using instance method" do
|
24
|
-
encoding_json = "{\"source_url\":\"my_source_url\",\"id\":\"456\"}"
|
25
|
-
stub_http_request(:post, /api.example.com:85\/v3.0\/encodings.json/).
|
26
|
-
with(:body => /source_url=my_source_url/).
|
27
|
-
to_return(:body => encoding_json)
|
28
|
-
|
29
|
-
encoding = TelestreamCloud::Encoding.new(:source_url => "my_source_url", :video_id => "123")
|
30
|
-
encoding.create.should == true
|
31
|
-
encoding.id.should == "456"
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should find by encoding_id" do
|
35
|
-
encoding_json = "{\"abc\":\"efg\",\"id\":\"456\"}"
|
36
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/encodings\/456.json/).
|
37
|
-
to_return(:body => encoding_json)
|
38
|
-
encoding = TelestreamCloud::Encoding.find("456")
|
39
|
-
encoding.id.should == "456"
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should find by the video through the association" do
|
43
|
-
video_json = "{\"source_url\":\"my_source_url\",\"id\":\"123\"}"
|
44
|
-
encoding_json = "{\"abc\":\"efg\",\"id\":\"456\", \"video_id\":\"123\"}"
|
45
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/encodings\/456.json/).
|
46
|
-
to_return(:body => encoding_json)
|
47
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123.json/).
|
48
|
-
to_return(:body => video_json)
|
49
|
-
encoding = TelestreamCloud::Encoding.find("456")
|
50
|
-
encoding.video.id.should == "123"
|
51
|
-
encoding.id.should == "456"
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should filter on find" do
|
55
|
-
encoding_json = "[{\"source_url\":\"my_source_url\",\"id\":\"456\"}]"
|
56
|
-
|
57
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/encodings.json/).
|
58
|
-
with{|r| r.uri.query =~ /profile_name=my_profile/ && r.uri.query =~ /video_id=123/ }.
|
59
|
-
to_return(:body => encoding_json)
|
60
|
-
|
61
|
-
encodings = TelestreamCloud::Encoding.all(:video_id => "123", :profile_name => "my_profile")
|
62
|
-
encodings.first.id.should == "456"
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should return the encoding url" do
|
66
|
-
cloud_json = "{\"s3_videos_bucket\":\"my_bucket\",\"id\":\"my_cloud_id\", \"url\":\"http://my-bucket.s3.amazonaws.com/\"}"
|
67
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/factories\/my_cloud_id.json/).
|
68
|
-
to_return(:body => cloud_json)
|
69
|
-
|
70
|
-
encoding = TelestreamCloud::Encoding.new({:id => "456", :extname => ".ext", :path => "abc/panda", "files" => ["abc/panda.ext"], :status => 'success'})
|
71
|
-
encoding.url.should == "http://my-bucket.s3.amazonaws.com/abc/panda.ext"
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should return the secure encoding url" do
|
75
|
-
cloud_json = "{\"s3_videos_bucket\":\"my_bucket\",\"id\":\"my_cloud_id\", \"url\":\"http://my-bucket.s3.amazonaws.com/\"}"
|
76
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/factories\/my_cloud_id.json/).
|
77
|
-
to_return(:body => cloud_json)
|
78
|
-
|
79
|
-
encoding = TelestreamCloud::Encoding.new({:id => "456", :extname => ".ext", :path => "abc/panda", "files" => ["abc/panda.ext"], :status => 'success'})
|
80
|
-
encoding.url(:https => true).should == "https://my-bucket.s3.amazonaws.com/abc/panda.ext"
|
81
|
-
end
|
82
|
-
|
83
|
-
it "should generate a screenshot array" do
|
84
|
-
cloud_json = "{\"s3_videos_bucket\":\"my_bucket\",\"id\":\"my_cloud_id\", \"url\":\"http://my-bucket.s3.amazonaws.com/\"}"
|
85
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/factories\/my_cloud_id.json/).
|
86
|
-
to_return(:body => cloud_json)
|
87
|
-
|
88
|
-
encoding = TelestreamCloud::Encoding.new({:id => "456", :extname => ".ext", :status => "success", :path => "abc/panda"})
|
89
|
-
encoding.screenshots[0].should == "http://my-bucket.s3.amazonaws.com/abc/panda_1.jpg"
|
90
|
-
end
|
91
|
-
|
92
|
-
it "should generate a screenshot array" do
|
93
|
-
encoding = TelestreamCloud::Encoding.new({:id => "456", :extname => ".ext", :status => "fail"})
|
94
|
-
encoding.screenshots.should == []
|
95
|
-
end
|
96
|
-
|
97
|
-
|
98
|
-
it "should create an encoding through the association" do
|
99
|
-
video_json = "{\"source_url\":\"my_source_url\",\"id\":\"123\"}"
|
100
|
-
encoding_json = "{\"abc\":\"efg\",\"id\":\"456\", \"video_id\":\"123\", \"profile_id\":\"901\"}"
|
101
|
-
|
102
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123.json/).
|
103
|
-
to_return(:body => video_json)
|
104
|
-
|
105
|
-
stub_http_request(:post, /api.example.com:85\/v3.0\/encodings.json/).
|
106
|
-
with{|r| r.body =~ /video_id=123/ && r.body =~ /profile_id=901/}.
|
107
|
-
to_return(:body => encoding_json)
|
108
|
-
|
109
|
-
video = TelestreamCloud::Video.find("123")
|
110
|
-
|
111
|
-
encoding = video.encodings.create(:profile_id => "901")
|
112
|
-
encoding.id.should == "456"
|
113
|
-
encoding.profile_id.should == "901"
|
114
|
-
end
|
115
|
-
|
116
|
-
it "should create an encoding through the association" do
|
117
|
-
video_json = "{\"source_url\":\"my_source_url\",\"id\":\"123\"}"
|
118
|
-
encoding_json = "{\"abc\":\"efg\",\"id\":\"456\", \"video_id\":\"123\", \"profile_id\":\"901\"}"
|
119
|
-
|
120
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123.json/).
|
121
|
-
to_return(:body => video_json)
|
122
|
-
|
123
|
-
stub_http_request(:post, /api.example.com:85\/v3.0\/encodings.json/).
|
124
|
-
with{|r| r.body =~ /video_id=123/ && r.body =~ /profile_id=901/}.
|
125
|
-
to_return(:body => encoding_json)
|
126
|
-
|
127
|
-
video = TelestreamCloud::Video.find("123")
|
128
|
-
|
129
|
-
encoding = video.encodings.create!(:profile_id => "901")
|
130
|
-
encoding.id.should == "456"
|
131
|
-
encoding.profile_id.should == "901"
|
132
|
-
end
|
133
|
-
|
134
|
-
|
135
|
-
it "should filter the profile name after triggering the request" do
|
136
|
-
video_json = "{\"source_url\":\"my_source_url\",\"id\":\"123\"}"
|
137
|
-
encodings_1_json = "[{\"id\":\"456\", \"video_id\":\"123\", \"profile_name\":\"h264\"}]"
|
138
|
-
encodings_2_json = "[{\"id\":\"789\", \"video_id\":\"123\", \"profile_name\":\"ogg\"}]"
|
139
|
-
|
140
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123.json/).
|
141
|
-
to_return(:body => video_json)
|
142
|
-
|
143
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123\/encodings.json/).
|
144
|
-
with{|r| r.uri.query =~ /profile_name=h264/ }.
|
145
|
-
to_return(:body => encodings_1_json)
|
146
|
-
|
147
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123\/encodings.json/).
|
148
|
-
with{|r| r.uri.query =~ /profile_name=ogg/ }.
|
149
|
-
to_return(:body => encodings_2_json)
|
150
|
-
|
151
|
-
video = TelestreamCloud::Video.find("123")
|
152
|
-
video.encodings.find_by_profile_name("h264").id.should == "456"
|
153
|
-
video.encodings.find_by_profile_name("ogg").id.should == "789"
|
154
|
-
end
|
155
|
-
|
156
|
-
it "should create an encoding through the association" do
|
157
|
-
video_json = "{\"source_url\":\"my_source_url\",\"id\":\"123\"}"
|
158
|
-
encodings_json = "[{\"abc\":\"efg\",\"id\":\"456\", \"video_id\":\"123\", \"profile_id\":\"901\"}]"
|
159
|
-
|
160
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123.json/).
|
161
|
-
to_return(:body => video_json)
|
162
|
-
|
163
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123\/encodings.json/).
|
164
|
-
with{|r| r.uri.query =~ /profile_id=901/}.
|
165
|
-
to_return(:body => encodings_json)
|
166
|
-
|
167
|
-
video = TelestreamCloud::Video.find("123")
|
168
|
-
encodings = video.encodings.all(:profile_id => "901")
|
169
|
-
encodings.first.id = "456"
|
170
|
-
end
|
171
|
-
|
172
|
-
it "should create an encoding through the association" do
|
173
|
-
video_json = "{\"source_url\":\"my_source_url\",\"id\":\"123\"}"
|
174
|
-
encodings_json = "[{\"abc\":\"efg\",\"id\":\"456\", \"video_id\":\"123\", \"profile_id\":\"901\"}]"
|
175
|
-
|
176
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123.json/).
|
177
|
-
to_return(:body => video_json)
|
178
|
-
|
179
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/videos\/123\/encodings.json/).
|
180
|
-
with{|r| r.uri.query =~ /profile_id=901/}.
|
181
|
-
to_return(:body => encodings_json)
|
182
|
-
|
183
|
-
video = TelestreamCloud::Video.find("123")
|
184
|
-
encodings = video.encodings.profile("901")
|
185
|
-
encodings.first.id = "456"
|
186
|
-
end
|
187
|
-
|
188
|
-
it "should filter encodings specifying video and status as a method" do
|
189
|
-
encoding_json = "[{\"source_url\":\"my_source_url\",\"id\":\"456\"}]"
|
190
|
-
|
191
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/encodings.json/).
|
192
|
-
with{|r| r.uri.query =~ /status=success/ && r.uri.query =~ /video_id=123/ }.
|
193
|
-
to_return(:body => encoding_json)
|
194
|
-
|
195
|
-
encodings = TelestreamCloud::Encoding.video(123).status("success").all
|
196
|
-
encodings.first.id.should == "456"
|
197
|
-
end
|
198
|
-
|
199
|
-
it "should filter encodings specifying video and status as a method" do
|
200
|
-
encoding_json = "[{\"source_url\":\"my_source_url\",\"id\":\"456\"}]"
|
201
|
-
|
202
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/encodings.json/).
|
203
|
-
with{|r| r.uri.query =~ /profile_id=prof_1/ && r.uri.query =~ /video_id=123/ }.
|
204
|
-
to_return(:body => encoding_json)
|
205
|
-
|
206
|
-
encodings = TelestreamCloud::Encoding.video(123).profile("prof_1").all
|
207
|
-
encodings.first.id.should == "456"
|
208
|
-
end
|
209
|
-
|
210
|
-
it "should filter encodings specifying video and profile id as a method" do
|
211
|
-
encoding_json = "[{\"source_url\":\"my_source_url\",\"id\":\"456\"}]"
|
212
|
-
|
213
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/encodings.json/).
|
214
|
-
with{|r| r.uri.query =~ /profile_name=prof_name/ && r.uri.query =~ /video_id=123/ }.
|
215
|
-
to_return(:body => encoding_json)
|
216
|
-
|
217
|
-
encodings = TelestreamCloud::Encoding.video(123).profile_name("prof_name").all
|
218
|
-
encodings.first.id.should == "456"
|
219
|
-
end
|
220
|
-
|
221
|
-
it "should find an encoding" do
|
222
|
-
encoding_json = "[{\"source_url\":\"my_source_url\",\"id\":\"456\"}]"
|
223
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/encodings\/456.json/).
|
224
|
-
to_return(:body => encoding_json)
|
225
|
-
|
226
|
-
TelestreamCloud::Encoding.find("456")
|
227
|
-
end
|
228
|
-
|
229
|
-
it "should tell if the encoding is success" do
|
230
|
-
encoding = TelestreamCloud::Encoding.new({:status => "success"})
|
231
|
-
encoding.success?.should == true
|
232
|
-
encoding.processing?.should == false
|
233
|
-
end
|
234
|
-
|
235
|
-
it "should tell if the encoding is success" do
|
236
|
-
encoding = TelestreamCloud::Encoding.new({:status => "processing"})
|
237
|
-
encoding.success?.should == false
|
238
|
-
encoding.processing?.should == true
|
239
|
-
end
|
240
|
-
|
241
|
-
it "should tell if the encoding is success" do
|
242
|
-
encoding = TelestreamCloud::Encoding.new({:status => "fail"})
|
243
|
-
encoding.success?.should == false
|
244
|
-
encoding.fail?.should == true
|
245
|
-
end
|
246
|
-
|
247
|
-
it "should return the most recent updated encoding" do
|
248
|
-
video_json = "[{\"source_url\":\"url_panda.mp4\",\"id\":\"123\"}]"
|
249
|
-
stub_http_request(:get, /api.example.com:85\/v3.0\/encodings.json/).
|
250
|
-
with{|r| r.uri.query =~ /per_page=1/ }.
|
251
|
-
to_return(:body => video_json)
|
252
|
-
TelestreamCloud::Encoding.first
|
253
|
-
end
|
254
|
-
|
255
|
-
it "should not delegate scope if the method do not really exist in the scope" do
|
256
|
-
lambda {TelestreamCloud::Encoding.reload}.should raise_error(NoMethodError)
|
257
|
-
lambda {TelestreamCloud::Encoding.each}.should raise_error(NoMethodError)
|
258
|
-
lambda {TelestreamCloud::Encoding.size}.should raise_error(NoMethodError)
|
259
|
-
end
|
260
|
-
end
|