evostream-event 0.1.0.pre.10 → 0.1.0.pre.14

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: 65902b95cbc8deb339672408cf842f01424ead1b
4
- data.tar.gz: cdcb37d0756be0ea4e03d6ef7205feabad0623eb
3
+ metadata.gz: a1f6db5f1d1bddbabe8b9b14bfad68d9921c5802
4
+ data.tar.gz: 36a9bea96a7137a0b2ac1e41d55dee87dab79cbe
5
5
  SHA512:
6
- metadata.gz: cc31f0fc79d3ea0dada5b8e8ffbad1adc2c5c305c4680ff62696dc0949bf7d00b64770856e2d567080b3e6556a5f56f437d66c21cd9d1fe604a12ac26f4c18d0
7
- data.tar.gz: 8acb25ed4981ffc1d95a62d051b310b44e0f862a60a866141c20b97e61a4baab837e323628f6dd4c1d4da78c0c0e37492074df95dc22641156acd03439dfd38a
6
+ metadata.gz: aa72fe8cc8e4a8899dd3e8569d7618731bc7cfd19cd6c094db27bded7fca791d763297ab46f9c9141462b28a90b8ff69c9fd87212df82fd659d3e77e89f60882
7
+ data.tar.gz: 2b048d0ed36cd4dadb3b67bb682e2917527ad585ee91c6a7dd04bcbb1060bada80400b94985baa6fc42e3da492bab6241425e22793efa5db047278c8b29ae8d6
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in evostream-event.gemspec
data/README.md CHANGED
@@ -34,7 +34,18 @@ gem install evostream-event
34
34
 
35
35
  ### Usage
36
36
 
37
- TODO: Write usage instructions here
37
+ Create initializer :
38
+
39
+ ```linux
40
+ rails generator evostream:initializer
41
+ ```
42
+
43
+ Treatment evostream request :
44
+
45
+ ```ruby
46
+ event = Evostream::Event.new(params[:type], params[:payload].to_unsafe_h)
47
+ event.execute_action
48
+ ```
38
49
 
39
50
  ## Development
40
51
 
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Evostream
4
+ module Generators
5
+ # Create a generator for Rails application
6
+ class InitializerGenerator < Rails::Generators::Base
7
+ desc 'Generate a initializer for evostream-event gem.'
8
+ INITIALIZER = <<-INIT
9
+ # frozen_string_literal: true
10
+
11
+ require 'evostream_event'
12
+
13
+ Evostream::Service.configuration do |config|
14
+ config.uri_in = 'http://server_stream.local:80'
15
+ config.uri_out = 'http://server_stream.local:7777'
16
+ config.name = 'srteamming_'
17
+ config.web_root = '/var/www/html'
18
+ config.model = ModelUsedInDatabase
19
+ config.model_id = :idenitfier_used_in_model
20
+ end
21
+ INIT
22
+
23
+ # Create initializer in Rails project
24
+ def copy_initializer
25
+ initializer 'evostream_event.rb', INITIALIZER
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Commands::CreateDASH do
6
+ let(:command) { Evostream::Commands::CreateDASH.new(cmd) }
7
+
8
+ context 'manifest_name' do
9
+ let(:arg_value) { Faker::Pokemon.name }
10
+ let(:argument) { 'manifest_name' }
11
+
12
+ include_examples 'command'
13
+ end
14
+ end
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Commands::CreateHLS do
6
+ let(:command) { Evostream::Commands::CreateHLS.new(cmd) }
7
+
8
+ context 'create_master_playlist' do
9
+ let(:arg_value) { Faker::Number.between(0, 1) }
10
+ let(:argument) { 'create_master_playlist' }
11
+
12
+ include_examples 'command'
13
+ end
14
+
15
+ context 'playlist_name' do
16
+ let(:arg_value) { Faker::Pokemon.name }
17
+ let(:argument) { 'playlist_name' }
18
+
19
+ include_examples 'command'
20
+ end
21
+
22
+ context 'max_chunk_length' do
23
+ let(:arg_value) { Faker::Number.between(0, 1) }
24
+ let(:argument) { 'max_chunk_length' }
25
+
26
+ include_examples 'command'
27
+ end
28
+
29
+ context 'chunk_base_name' do
30
+ let(:arg_value) { Faker::Pokemon.name }
31
+ let(:argument) { 'chunk_base_name' }
32
+
33
+ include_examples 'command'
34
+ end
35
+
36
+ context 'drm_type' do
37
+ let(:arg_value) { Faker::Pokemon.name }
38
+ let(:argument) { 'drm_type' }
39
+
40
+ include_examples 'command'
41
+ end
42
+
43
+ context 'aes_key_count', broken: true do
44
+ let(:arg_value) { Faker::Number.between(1, 99) }
45
+ let(:argument) { 'aes_key_count' }
46
+
47
+ include_examples 'command'
48
+ end
49
+
50
+ context 'audio_only' do
51
+ let(:arg_value) { Faker::Number.between(0, 1) }
52
+ let(:argument) { 'audio_only' }
53
+
54
+ include_examples 'command'
55
+ end
56
+
57
+ context 'hls_resume' do
58
+ let(:arg_value) { Faker::Number.between(0, 1) }
59
+ let(:argument) { 'hls_resume' }
60
+
61
+ include_examples 'command'
62
+ end
63
+
64
+ context 'cleanup_on_close' do
65
+ let(:arg_value) { Faker::Number.between(0, 1) }
66
+ let(:argument) { 'cleanup_on_close' }
67
+
68
+ include_examples 'command'
69
+ end
70
+
71
+ context 'use_byte_range' do
72
+ let(:arg_value) { Faker::Number.between(0, 1) }
73
+ let(:argument) { 'use_byte_range' }
74
+
75
+ include_examples 'command'
76
+ end
77
+
78
+ context 'file_length' do
79
+ let(:arg_value) { Faker::Number.between(0, 1) }
80
+ let(:argument) { 'file_length' }
81
+
82
+ include_examples 'command'
83
+ end
84
+
85
+ context 'use_system_time' do
86
+ let(:arg_value) { Faker::Number.between(0, 1) }
87
+ let(:argument) { 'use_system_time' }
88
+
89
+ include_examples 'command'
90
+ end
91
+
92
+ context 'offset_time' do
93
+ let(:arg_value) { Faker::Number.between(0, 1) }
94
+ let(:argument) { 'offset_time' }
95
+
96
+ include_examples 'command'
97
+ end
98
+
99
+ context 'start_offset' do
100
+ let(:arg_value) { Faker::Number.between(0, 1) }
101
+ let(:argument) { 'start_offset' }
102
+
103
+ include_examples 'command'
104
+ end
105
+ end
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Commands::Create do
6
+ let(:command) { Evostream::Commands::Create.new(cmd) }
7
+
8
+ context 'local_stream_names' do
9
+ let(:arg_value) { Faker::Pokemon.name }
10
+ let(:argument) { 'local_stream_names' }
11
+
12
+ include_examples 'command'
13
+ end
14
+
15
+ context 'target_folder' do
16
+ let(:arg_value) { Faker::Pokemon.name }
17
+ let(:argument) { 'target_folder' }
18
+
19
+ include_examples 'command'
20
+ end
21
+
22
+ context 'bandwidths' do
23
+ let(:arg_value) { Faker::Number.between(1, 99) }
24
+ let(:argument) { 'bandwidths' }
25
+
26
+ include_examples 'command'
27
+ end
28
+
29
+ context 'group_name' do
30
+ let(:arg_value) { Faker::Pokemon.name }
31
+ let(:argument) { 'group_name' }
32
+
33
+ include_examples 'command'
34
+ end
35
+
36
+ context 'playlist_type' do
37
+ let(:arg_value) { %w(appending rolling).sample }
38
+ let(:argument) { 'playlist_type' }
39
+
40
+ include_examples 'command'
41
+ end
42
+
43
+ context 'playlist_length' do
44
+ let(:arg_value) { Faker::Number.between(1, 99) }
45
+ let(:argument) { 'playlist_length' }
46
+
47
+ include_examples 'command'
48
+ end
49
+
50
+ context 'chunk_length' do
51
+ let(:arg_value) { Faker::Number.between(1, 99) }
52
+ let(:argument) { 'chunk_length' }
53
+
54
+ include_examples 'command'
55
+ end
56
+
57
+ context 'chunk_on_idr', broken: true do
58
+ let(:arg_value) { Faker::Number.between(0, 1) }
59
+ let(:argument) { 'chunk_on_idr' }
60
+
61
+ include_examples 'command'
62
+ end
63
+
64
+ context 'keep_alive' do
65
+ let(:arg_value) { Faker::Number.between(0, 1) }
66
+ let(:argument) { 'keep_alive' }
67
+
68
+ include_examples 'command'
69
+ end
70
+
71
+ context 'overwrite_destination' do
72
+ let(:arg_value) { Faker::Number.between(0, 1) }
73
+ let(:argument) { 'overwrite_destination' }
74
+
75
+ include_examples 'command'
76
+ end
77
+
78
+ context 'stale_retention_count' do
79
+ let(:arg_value) { Faker::Number.between(1, 99) }
80
+ let(:argument) { 'stale_retention_count' }
81
+
82
+ include_examples 'command'
83
+ end
84
+
85
+ context 'cleanup_destination' do
86
+ let(:arg_value) { Faker::Number.between(0, 1) }
87
+ let(:argument) { 'cleanup_destination' }
88
+
89
+ include_examples 'command'
90
+ end
91
+
92
+ context 'dynamic_profile' do
93
+ let(:arg_value) { Faker::Number.between(0, 1) }
94
+ let(:argument) { 'dynamic_profile' }
95
+
96
+ include_examples 'command'
97
+ end
98
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Commands::Destroy do
6
+ let(:command) { Evostream::Commands::Destroy.new(cmd) }
7
+
8
+ context 'id' do
9
+ let(:arg_value) { Faker::Number.between(1, 99) }
10
+ let(:argument) { 'id' }
11
+
12
+ include_examples 'command'
13
+ end
14
+
15
+ context 'remove_hls_hds_files' do
16
+ let(:arg_value) { Faker::Number.between(0, 1) }
17
+ let(:argument) { 'remove_hls_hds_files' }
18
+
19
+ include_examples 'command'
20
+ end
21
+
22
+ context 'group_name' do
23
+ let(:arg_value) { Faker::Pokemon.name }
24
+ let(:argument) { 'group_name' }
25
+
26
+ include_examples 'command'
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Events::Event do
6
+ it 'has a three childern class' do
7
+ expect(Evostream::Events::Event.descendants.count).to eql(3)
8
+ end
9
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream do
6
+ it 'has a version number' do
7
+ expect(Evostream::VERSION).not_to be nil
8
+ end
9
+
10
+ it 'has a gem name' do
11
+ expect(Evostream::GEM_NAME).not_to be nil
12
+ end
13
+
14
+ it 'has a authors' do
15
+ expect(Evostream::AUTHORS).not_to be nil
16
+ end
17
+
18
+ it 'has a emails' do
19
+ expect(Evostream::EMAILS).not_to be nil
20
+ end
21
+
22
+ it 'has a license' do
23
+ expect(Evostream::LICENSE).not_to be nil
24
+ end
25
+
26
+ it 'has a summary' do
27
+ expect(Evostream::SUMMARY).not_to be nil
28
+ end
29
+
30
+ it 'has a description' do
31
+ expect(Evostream::DESCRIPTION).not_to be nil
32
+ end
33
+
34
+ it 'has a homepage' do
35
+ expect(Evostream::HOMEPAGE).not_to be nil
36
+ end
37
+
38
+ it 'has a post install message' do
39
+ expect(Evostream::POST_INSTALL).not_to be nil
40
+ end
41
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support'
4
+ require 'evostream_event'
5
+ require 'faker'
6
+
7
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
8
+
9
+ Dir['spec/support/**/*.rb'].each do |f|
10
+ require File.expand_path(f)
11
+ end
12
+
13
+ RSpec.configure do |config|
14
+ config.expect_with :rspec do |c|
15
+ c.syntax = :expect
16
+ end
17
+
18
+ # Exclude spec broken
19
+ config.filter_run_excluding broken: true
20
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/string'
4
+
5
+ RSpec.shared_examples 'command' do
6
+ let(:cmd) { { argument => arg_value } }
7
+ let(:result) { "#{argument.camelize(:lower)}=#{arg_value} " }
8
+
9
+ it { expect(command.instance_variable_get(:@command)[0]).to eql(result) }
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evostream-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.10
4
+ version: 0.1.0.pre.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - VAILLANT Jeremy
@@ -208,20 +208,6 @@ dependencies:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
210
  version: 1.7.3
211
- - !ruby/object:Gem::Dependency
212
- name: activesupport
213
- requirement: !ruby/object:Gem::Requirement
214
- requirements:
215
- - - "~>"
216
- - !ruby/object:Gem::Version
217
- version: '4.2'
218
- type: :runtime
219
- prerelease: false
220
- version_requirements: !ruby/object:Gem::Requirement
221
- requirements:
222
- - - "~>"
223
- - !ruby/object:Gem::Version
224
- version: '4.2'
225
211
  description: |
226
212
  Manage evostream.
227
213
  email:
@@ -246,6 +232,15 @@ files:
246
232
  - lib/evostream/info.rb
247
233
  - lib/evostream/service.rb
248
234
  - lib/evostream_event.rb
235
+ - lib/generators/evostream/initializer_generator.rb
236
+ - spec/evostream/commands/create_dash_spec.rb
237
+ - spec/evostream/commands/create_hls_spec.rb
238
+ - spec/evostream/commands/create_spec.rb
239
+ - spec/evostream/commands/destroy_spec.rb
240
+ - spec/evostream/events_spec.rb
241
+ - spec/evostream/evostream_event_spec.rb
242
+ - spec/spec_helper.rb
243
+ - spec/support/commands.rb
249
244
  homepage: https://github.com/dazzl-tv/evostream-event
250
245
  licenses:
251
246
  - MIT