evostream-event 1.0.3.pre.93 → 2.0.0.pre.856441003
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/lib/evostream/cli/option/argument.rb +2 -0
- data/lib/evostream/cli/option/search.rb +2 -0
- data/lib/evostream/cli/runner.rb +1 -1
- data/lib/evostream/event/commands.rb +1 -1
- data/lib/evostream/event/commands/create/dash.rb +1 -1
- data/lib/evostream/event/commands/create/hls.rb +1 -1
- data/lib/evostream/event/commands/destroy.rb +1 -1
- data/lib/evostream/event/commands/get_stream_info.rb +1 -1
- data/lib/evostream/event/commands/list_streams.rb +1 -1
- data/lib/evostream/event/commands/push_stream.rb +1 -1
- data/lib/evostream/event/commands/set_log_level.rb +1 -1
- data/lib/evostream/event/event/events.rb +2 -2
- data/lib/evostream/event/event/events/in_stream_created.rb +2 -0
- data/lib/evostream/event/event/events/out_stream_created.rb +2 -2
- data/lib/evostream/event/info.rb +2 -2
- data/spec/evostream/{action/action_spec.rb → action_spec.rb} +11 -11
- data/spec/{cli → evostream/cli}/argument/command_spec.rb +2 -0
- data/spec/{cli → evostream/cli}/argument/config_spec.rb +2 -0
- data/spec/evostream/cli/argument/help_spec.rb +26 -0
- data/spec/{cli → evostream/cli}/argument/host_spec.rb +2 -0
- data/spec/{cli → evostream/cli}/argument/port_spec.rb +2 -0
- data/spec/{cli → evostream/cli}/argument/search_spec.rb +2 -0
- data/spec/{cli → evostream/cli}/argument/version_spec.rb +2 -0
- data/spec/evostream/commands/create_dash_spec.rb +3 -3
- data/spec/evostream/commands/create_hls_spec.rb +27 -27
- data/spec/evostream/commands/create_spec.rb +22 -22
- data/spec/evostream/commands/{push_stream_spec.rb → destroy_push_stream_spec.rb} +3 -3
- data/spec/evostream/commands/destroy_spec.rb +6 -6
- data/spec/evostream/commands/get_stream_info_spec.rb +4 -4
- data/spec/evostream/commands/{list_stream_spec.rb → list_streams_spec.rb} +2 -2
- data/spec/evostream/commands/set_log_level_spec.rb +3 -3
- data/spec/evostream/events/events_spec.rb +1 -1
- data/spec/evostream/events/in_stream_closed_spec.rb +82 -0
- data/spec/evostream/events/in_stream_created_spec.rb +75 -0
- data/spec/evostream/events/{request_out_stream_created_spec.rb → out_stream_created_spec.rb} +61 -67
- data/spec/features/push_stream_spec.rb +4 -2
- data/spec/features/remove_config_spec.rb +4 -2
- data/spec/spec_helper.rb +8 -8
- data/spec/support/examples_arguments.rb +5 -0
- data/spec/support/fake_evostream.rb +14 -18
- metadata +64 -83
- data/spec/cli/argument/help_spec.rb +0 -28
- data/spec/evostream/event/event_spec.rb +0 -0
- data/spec/evostream/events/request_in_stream_closed_spec.rb +0 -82
- data/spec/evostream/events/request_in_stream_created_spec.rb +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 347597b8e5324d471ec33d299d2071a047697338474a902959fd46b3dca2f1c1
|
4
|
+
data.tar.gz: 2b387bfb6fb0d79b87003e31ee2d8286abb627ac1da97c9cbd4e0438b660e3ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d187be20e1b6049fc36d9b5ca660564e7e62228fcc8b058079e47405ae745497cd62154e3cf773f1713fbabc6b85852e6ab9d20817d618bc355d12c32076dd3f
|
7
|
+
data.tar.gz: 179cf2b11209c63241b86f28ef068ff3d25e61a41e0585833c250ee989c94334c041ec709d474d25c1c0dd52f9aba45d4a02ede6c4ce412a3ba477386c9dbf02
|
data/README.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
# Evostream::Event
|
1
|
+
# Evostream::Event
|
2
|
+
[![RSpec](https://github.com/dazzl-tv/evostream-event/actions/workflows/rspec.yml/badge.svg?branch=develop&event=pull_request)](https://github.com/dazzl-tv/evostream-event/actions/workflows/rspec.yml)
|
3
|
+
[![Linter](https://github.com/dazzl-tv/evostream-event/actions/workflows/linter.yml/badge.svg)](https://github.com/dazzl-tv/evostream-event/actions/workflows/linter.yml)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/evostream-event.svg)](https://badge.fury.io/rb/evostream-event)
|
5
|
+
[![Docs](https://inch-ci.org/github/dazzl-tv/evostream-event.svg)](https://inch-ci.org/github/dazzl-tv/evostream-event)
|
6
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/e3096c50f57e0cb1b83a/maintainability)](https://codeclimate.com/github/dazzl-tv/evostream-event/maintainability)
|
7
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/e3096c50f57e0cb1b83a/test_coverage)](https://codeclimate.com/github/dazzl-tv/evostream-event/test_coverage)
|
8
|
+
[![Known Vulnerabilities](https://snyk.io/test/github/dazzl-tv/evostream-event/badge.svg)](https://snyk.io/test/github/dazzl-tv/evostream-event)
|
2
9
|
|
3
10
|
Evostream Event listen event to Evostream and execute task.
|
4
11
|
|
@@ -116,6 +123,6 @@ git commits and tags, and push the `.gem` file to
|
|
116
123
|
## Contributing
|
117
124
|
|
118
125
|
Bug reports and pull requests are welcome on GitHub at
|
119
|
-
https://github.com/
|
126
|
+
https://github.com/dazzl-tv/evostream-event. This project is intended to be a
|
120
127
|
safe, welcoming space for collaboration, and contributors are expected to adhere
|
121
128
|
to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/lib/evostream/cli/runner.rb
CHANGED
@@ -5,7 +5,6 @@ require 'colorize'
|
|
5
5
|
require 'timeout'
|
6
6
|
require 'socket'
|
7
7
|
require 'yaml'
|
8
|
-
require 'yaml/dbm'
|
9
8
|
|
10
9
|
$LOAD_PATH.unshift(__dir__)
|
11
10
|
require 'option'
|
@@ -20,6 +19,7 @@ require 'event'
|
|
20
19
|
# :reek:TooManyStatements
|
21
20
|
# :reek:DuplicateMethodCall
|
22
21
|
# :reek:NilCheck
|
22
|
+
# :reek:UtilityFunction
|
23
23
|
|
24
24
|
module Evostream
|
25
25
|
# Execute CLI with this gem
|
@@ -12,9 +12,9 @@ module Evostream
|
|
12
12
|
@result = nil
|
13
13
|
end
|
14
14
|
|
15
|
-
def execute(type_flux = %w[hls dash])
|
15
|
+
def execute(type_flux = %w[hls dash], &block)
|
16
16
|
Evostream.logger "Execute action for event #{class_name}"
|
17
|
-
type_flux.each
|
17
|
+
type_flux.each(&block) if block
|
18
18
|
@result
|
19
19
|
end
|
20
20
|
|
@@ -42,8 +42,8 @@ module Evostream
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def ex_flux
|
45
|
-
Evostream::Service.uri_out
|
46
|
-
@request['name']
|
45
|
+
"#{Evostream::Service.uri_out}/#{name_settings['groupName']}" \
|
46
|
+
"/#{@request['name']}/#{name_settings[name_flux]}"
|
47
47
|
end
|
48
48
|
|
49
49
|
def select_key_setting
|
data/lib/evostream/event/info.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# Define constant to gem.
|
7
7
|
module Evostream
|
8
8
|
# Define version to gem
|
9
|
-
VERSION = '
|
9
|
+
VERSION = '2.0.0'
|
10
10
|
|
11
11
|
# Name to gem
|
12
12
|
GEM_NAME = 'evostream-event'
|
@@ -29,7 +29,7 @@ module Evostream
|
|
29
29
|
DESC
|
30
30
|
|
31
31
|
# Define homepage
|
32
|
-
HOMEPAGE = 'https://github.com/
|
32
|
+
HOMEPAGE = 'https://github.com/dazzl-tv/evostream-event'
|
33
33
|
|
34
34
|
# Define a post install message
|
35
35
|
POST_INSTALL = \
|
@@ -3,14 +3,14 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Evostream::Action, type: :request do
|
6
|
-
let(:action) {
|
6
|
+
let(:action) { described_class.new(payload) }
|
7
7
|
let(:payload) { {} }
|
8
8
|
|
9
|
-
it '
|
9
|
+
it 'is a hash' do
|
10
10
|
expect(action.instance_variable_get(:@payload)).to be_kind_of(Hash)
|
11
11
|
end
|
12
12
|
|
13
|
-
describe 'push_stream' do
|
13
|
+
describe 'when push_stream' do
|
14
14
|
let(:action_name) { 'pushStream' }
|
15
15
|
let(:payload) do
|
16
16
|
{
|
@@ -20,27 +20,27 @@ describe Evostream::Action, type: :request do
|
|
20
20
|
}
|
21
21
|
end
|
22
22
|
|
23
|
-
context 'global Evostream variable' do
|
23
|
+
context 'with global Evostream variable' do
|
24
24
|
include_examples 'test request action'
|
25
25
|
end
|
26
26
|
|
27
|
-
context 'local Evostream variable' do
|
28
|
-
let(:action) {
|
27
|
+
context 'with local Evostream variable' do
|
28
|
+
let(:action) { described_class.new(payload, 'evostream.dazzl.local') }
|
29
29
|
|
30
30
|
include_examples 'test request action'
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
describe 'remove_config' do
|
34
|
+
describe 'when remove_config' do
|
35
35
|
let(:action_name) { 'removeConfig' }
|
36
|
-
let(:payload) { { id: Faker::Number.between(1, 999_999) } }
|
36
|
+
let(:payload) { { id: Faker::Number.between(from: 1, to: 999_999) } }
|
37
37
|
|
38
|
-
context 'global Evostream variable' do
|
38
|
+
context 'with global Evostream variable' do
|
39
39
|
include_examples 'test request action'
|
40
40
|
end
|
41
41
|
|
42
|
-
context 'local Evostream variable' do
|
43
|
-
let(:action) {
|
42
|
+
context 'with local Evostream variable' do
|
43
|
+
let(:action) { described_class.new(payload, 'evostream.dazzl.local') }
|
44
44
|
|
45
45
|
include_examples 'test request action'
|
46
46
|
end
|
@@ -9,6 +9,7 @@ describe Evostream::CLI::Argument::Command do
|
|
9
9
|
|
10
10
|
context 'when short argument' do
|
11
11
|
before { ARGV.push('-c') }
|
12
|
+
|
12
13
|
after { ARGV.pop }
|
13
14
|
|
14
15
|
include_examples 'argument exit'
|
@@ -17,6 +18,7 @@ describe Evostream::CLI::Argument::Command do
|
|
17
18
|
|
18
19
|
context 'when long argument' do
|
19
20
|
before { ARGV.push('--commands') }
|
21
|
+
|
20
22
|
after { ARGV.pop }
|
21
23
|
|
22
24
|
include_examples 'argument exit'
|
@@ -4,6 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Evostream::CLI::Argument::Config do
|
6
6
|
before { ARGV.push('--config') }
|
7
|
+
|
7
8
|
after { ARGV.pop }
|
8
9
|
|
9
10
|
let(:runner) { Evostream::Runner.new }
|
@@ -18,6 +19,7 @@ describe Evostream::CLI::Argument::Config do
|
|
18
19
|
|
19
20
|
context 'when argument with exit file', broken: true do
|
20
21
|
before { ARGV.push('.travis/evostream-configuration.yml') }
|
22
|
+
|
21
23
|
after { ARGV.pop }
|
22
24
|
|
23
25
|
let(:out) { /Connection to Evostream REFUSED !!/ }
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Evostream::CLI::Argument::Help do
|
6
|
+
after { ARGV.pop }
|
7
|
+
|
8
|
+
let(:runner) { Evostream::Runner.new }
|
9
|
+
let(:out) do
|
10
|
+
File.read(File.join(__dir__, '..', '..', '..', '..',
|
11
|
+
'lib', 'evostream', 'cli', 'option', 'help'))
|
12
|
+
end
|
13
|
+
let(:code) { 0 }
|
14
|
+
|
15
|
+
context 'when short argument' do
|
16
|
+
before { ARGV.push('-h') }
|
17
|
+
|
18
|
+
include_examples 'argument help'
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when long argument' do
|
22
|
+
before { ARGV.push('--help') }
|
23
|
+
|
24
|
+
include_examples 'argument help'
|
25
|
+
end
|
26
|
+
end
|
@@ -4,6 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Evostream::CLI::Argument::Host, type: :cli do
|
6
6
|
before { ARGV.push('--server') }
|
7
|
+
|
7
8
|
after { ARGV.pop }
|
8
9
|
|
9
10
|
let(:runner) { Evostream::Runner.new }
|
@@ -18,6 +19,7 @@ describe Evostream::CLI::Argument::Host, type: :cli do
|
|
18
19
|
|
19
20
|
context 'when argument with host given', broken: true do
|
20
21
|
before { ARGV.push('127.0.0.1') }
|
22
|
+
|
21
23
|
after { ARGV.pop }
|
22
24
|
|
23
25
|
let(:out) { /Connection to Evostream REFUSED !!/ }
|
@@ -4,6 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Evostream::CLI::Argument::Port, type: :cli do
|
6
6
|
before { ARGV.push('--port') }
|
7
|
+
|
7
8
|
after { ARGV.pop }
|
8
9
|
|
9
10
|
let(:runner) { Evostream::Runner.new }
|
@@ -18,6 +19,7 @@ describe Evostream::CLI::Argument::Port, type: :cli do
|
|
18
19
|
|
19
20
|
context 'when argumentw with port given', broken: true do
|
20
21
|
before { ARGV.push(5489) }
|
22
|
+
|
21
23
|
after { ARGV.pop }
|
22
24
|
|
23
25
|
let(:out) { /No command executed !! No command precise\./ }
|
@@ -7,6 +7,7 @@ describe Evostream::CLI::Argument::Search, broken: true do
|
|
7
7
|
|
8
8
|
context 'when short argument' do
|
9
9
|
before { ARGV.push('--search') }
|
10
|
+
|
10
11
|
after { ARGV.pop }
|
11
12
|
|
12
13
|
context 'when argument with no search data' do
|
@@ -19,6 +20,7 @@ describe Evostream::CLI::Argument::Search, broken: true do
|
|
19
20
|
|
20
21
|
context 'when argument with search data', broken: true do
|
21
22
|
before { ARGV.push('id: 4') }
|
23
|
+
|
22
24
|
after { ARGV.pop }
|
23
25
|
|
24
26
|
let(:out) { /Connection to Evostream REFUSED !!/ }
|
@@ -9,6 +9,7 @@ describe Evostream::CLI::Argument::Version do
|
|
9
9
|
|
10
10
|
context 'when short argument' do
|
11
11
|
before { ARGV.push('-v') }
|
12
|
+
|
12
13
|
after { ARGV.pop }
|
13
14
|
|
14
15
|
include_examples 'argument exit'
|
@@ -17,6 +18,7 @@ describe Evostream::CLI::Argument::Version do
|
|
17
18
|
|
18
19
|
context 'when long argument' do
|
19
20
|
before { ARGV.push('--version') }
|
21
|
+
|
20
22
|
after { ARGV.pop }
|
21
23
|
|
22
24
|
include_examples 'argument exit'
|
@@ -3,9 +3,9 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Evostream::Commands::CreateDASH do
|
6
|
-
let(:command) {
|
6
|
+
let(:command) { described_class }
|
7
7
|
|
8
|
-
context 'manifest_name' do
|
8
|
+
context 'when manifest_name' do
|
9
9
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
10
10
|
let(:argument) { 'manifest_name' }
|
11
11
|
|
@@ -16,7 +16,7 @@ describe Evostream::Commands::CreateDASH do
|
|
16
16
|
let(:cmd) do
|
17
17
|
{
|
18
18
|
local_stream_names: Faker::Games::Pokemon.name,
|
19
|
-
target_folder: Faker::File.file_name('/path/to')
|
19
|
+
target_folder: Faker::File.file_name(dir: '/path/to')
|
20
20
|
}
|
21
21
|
end
|
22
22
|
|
@@ -3,101 +3,101 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Evostream::Commands::CreateHLS do
|
6
|
-
let(:command) {
|
6
|
+
let(:command) { described_class }
|
7
7
|
|
8
|
-
context 'create_master_playlist' do
|
9
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
8
|
+
context 'when create_master_playlist' do
|
9
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
10
10
|
let(:argument) { 'create_master_playlist' }
|
11
11
|
|
12
12
|
include_examples 'command raise'
|
13
13
|
end
|
14
14
|
|
15
|
-
context 'playlist_name' do
|
15
|
+
context 'when playlist_name' do
|
16
16
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
17
17
|
let(:argument) { 'playlist_name' }
|
18
18
|
|
19
19
|
include_examples 'command raise'
|
20
20
|
end
|
21
21
|
|
22
|
-
context 'max_chunk_length' do
|
23
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
22
|
+
context 'when max_chunk_length' do
|
23
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
24
24
|
let(:argument) { 'max_chunk_length' }
|
25
25
|
|
26
26
|
include_examples 'command raise'
|
27
27
|
end
|
28
28
|
|
29
|
-
context 'chunk_base_name' do
|
29
|
+
context 'when chunk_base_name' do
|
30
30
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
31
31
|
let(:argument) { 'chunk_base_name' }
|
32
32
|
|
33
33
|
include_examples 'command raise'
|
34
34
|
end
|
35
35
|
|
36
|
-
context 'drm_type' do
|
36
|
+
context 'when drm_type' do
|
37
37
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
38
38
|
let(:argument) { 'drm_type' }
|
39
39
|
|
40
40
|
include_examples 'command raise'
|
41
41
|
end
|
42
42
|
|
43
|
-
context 'aes_key_count', broken: true do
|
44
|
-
let(:arg_value) { Faker::Number.between(1, 99) }
|
43
|
+
context 'when aes_key_count', broken: true do
|
44
|
+
let(:arg_value) { Faker::Number.between(from: 1, to: 99) }
|
45
45
|
let(:argument) { 'aes_key_count' }
|
46
46
|
|
47
47
|
include_examples 'command raise'
|
48
48
|
end
|
49
49
|
|
50
|
-
context 'audio_only' do
|
51
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
50
|
+
context 'when audio_only' do
|
51
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
52
52
|
let(:argument) { 'audio_only' }
|
53
53
|
|
54
54
|
include_examples 'command raise'
|
55
55
|
end
|
56
56
|
|
57
|
-
context 'hls_resume' do
|
58
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
57
|
+
context 'when hls_resume' do
|
58
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
59
59
|
let(:argument) { 'hls_resume' }
|
60
60
|
|
61
61
|
include_examples 'command raise'
|
62
62
|
end
|
63
63
|
|
64
|
-
context 'cleanup_on_close' do
|
65
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
64
|
+
context 'when cleanup_on_close' do
|
65
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
66
66
|
let(:argument) { 'cleanup_on_close' }
|
67
67
|
|
68
68
|
include_examples 'command raise'
|
69
69
|
end
|
70
70
|
|
71
|
-
context 'use_byte_range' do
|
72
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
71
|
+
context 'when use_byte_range' do
|
72
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
73
73
|
let(:argument) { 'use_byte_range' }
|
74
74
|
|
75
75
|
include_examples 'command raise'
|
76
76
|
end
|
77
77
|
|
78
|
-
context 'file_length' do
|
79
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
78
|
+
context 'when file_length' do
|
79
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
80
80
|
let(:argument) { 'file_length' }
|
81
81
|
|
82
82
|
include_examples 'command raise'
|
83
83
|
end
|
84
84
|
|
85
|
-
context 'use_system_time' do
|
86
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
85
|
+
context 'when use_system_time' do
|
86
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
87
87
|
let(:argument) { 'use_system_time' }
|
88
88
|
|
89
89
|
include_examples 'command raise'
|
90
90
|
end
|
91
91
|
|
92
|
-
context 'offset_time' do
|
93
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
92
|
+
context 'when offset_time' do
|
93
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
94
94
|
let(:argument) { 'offset_time' }
|
95
95
|
|
96
96
|
include_examples 'command raise'
|
97
97
|
end
|
98
98
|
|
99
|
-
context 'start_offset' do
|
100
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
99
|
+
context 'when start_offset' do
|
100
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
101
101
|
let(:argument) { 'start_offset' }
|
102
102
|
|
103
103
|
include_examples 'command raise'
|
@@ -107,7 +107,7 @@ describe Evostream::Commands::CreateHLS do
|
|
107
107
|
let(:cmd) do
|
108
108
|
{
|
109
109
|
local_stream_names: Faker::Games::Pokemon.name,
|
110
|
-
target_folder: Faker::File.file_name('/path/to')
|
110
|
+
target_folder: Faker::File.file_name(dir: '/path/to')
|
111
111
|
}
|
112
112
|
end
|
113
113
|
|