evostream-event 0.2.0.pre.22 → 0.2.1.pre.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/evostream/event.rb +3 -5
- data/lib/evostream/event/commands/destroy.rb +3 -0
- data/lib/evostream/event/commands/push_stream.rb +4 -0
- data/lib/evostream/event/info.rb +1 -1
- data/spec/evostream/commands/push_stream_spec.rb +28 -0
- data/spec/evostream/evostream_event_action_spec.rb +32 -0
- data/spec/evostream/evostream_event_event_spec.rb +0 -0
- data/spec/evostream/evostream_event_method_spec.rb +0 -0
- data/spec/support/examples_actions.rb +7 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09ddbacb69c0e6f8aee31a54a5863b9fc93bbfad
|
4
|
+
data.tar.gz: 4407bd52ef32bb40909e1475a34846574eb59c17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 384523a3f1f1a01d89dfe0448b66ac4b2c19bc9470fd5e5372c66856159fea330a2fa97f4e033b7ff3cae59cd6e676d21d69e8faedd56c6eeb3a09cb6f60e662
|
7
|
+
data.tar.gz: d172ce9185021aa3a4921f927872082060806db40eaf84e3dba880d68c5a7c2984937812ed530aee762ddf374c3398b1665034546775c917201afa87d530fdcc
|
data/lib/evostream/event.rb
CHANGED
@@ -10,11 +10,9 @@ require 'net/http'
|
|
10
10
|
# Primary command to gem
|
11
11
|
module Evostream
|
12
12
|
def self.send_command(cmd)
|
13
|
-
uri = URI.parse(Evostream::Service.uri_in)
|
13
|
+
uri = URI.parse("#{Evostream::Service.uri_in}/#{cmd}")
|
14
14
|
http = Net::HTTP.new(uri.host, uri.port)
|
15
|
-
|
16
|
-
Evostream.logger "Command : #{command_launch}"
|
17
|
-
http.request(Net::HTTP::Get.new(command_launch))
|
15
|
+
http.request(Net::HTTP::Get.new(uri))
|
18
16
|
end
|
19
17
|
|
20
18
|
def self.logger(message)
|
@@ -30,7 +28,7 @@ module Evostream
|
|
30
28
|
def execute_action(command_name)
|
31
29
|
cmd = command_name.sub(/^(\w)/, &:capitalize)
|
32
30
|
klass = "Evostream::Commands::#{cmd}".constantize
|
33
|
-
Evostream.send_command(klass.new(@payload))
|
31
|
+
Evostream.send_command(klass.new(@payload).cmd)
|
34
32
|
end
|
35
33
|
end
|
36
34
|
|
data/lib/evostream/event/info.rb
CHANGED
@@ -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::PushStream.new(cmd) }
|
7
|
+
|
8
|
+
context 'uri' do
|
9
|
+
let(:arg_value) { 'rtmp://de.pscp.tv:80/x/31' }
|
10
|
+
let(:argument) { 'uri' }
|
11
|
+
|
12
|
+
include_examples 'command'
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'local_stream_name' do
|
16
|
+
let(:arg_value) { Faker::Pokemon.name }
|
17
|
+
let(:argument) { 'local_stream_name' }
|
18
|
+
|
19
|
+
include_examples 'command'
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'target_stream_name' do
|
23
|
+
let(:arg_value) { Faker::Pokemon.name }
|
24
|
+
let(:argument) { 'target_stream_name' }
|
25
|
+
|
26
|
+
include_examples 'command'
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Evostream::Action, type: :request do
|
6
|
+
let(:action) { Evostream::Action.new(payload) }
|
7
|
+
let(:payload) { {} }
|
8
|
+
|
9
|
+
it 'should be a hash' do
|
10
|
+
expect(action.instance_variable_get(:@payload)).to be_kind_of(Hash)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'push_stream' do
|
14
|
+
let(:action_name) { 'pushStream' }
|
15
|
+
let(:payload) do
|
16
|
+
{
|
17
|
+
uri: 'rtmp://rtmp-api.facebook.com:80/rtmp',
|
18
|
+
target_stream_name: '151146928743762?ds=1&s_l=1&a=AThF12FC86-ffgS5',
|
19
|
+
local_stream_name: 'top'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
include_examples 'test request action'
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'remove_config' do
|
27
|
+
let(:action_name) { 'removeConfig' }
|
28
|
+
let(:payload) { { id: Faker::Number.between(1, 999_999) } }
|
29
|
+
|
30
|
+
include_examples 'test request action'
|
31
|
+
end
|
32
|
+
end
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evostream-event
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1.pre.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VAILLANT Jeremy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -258,12 +258,17 @@ files:
|
|
258
258
|
- spec/evostream/commands/create_hls_spec.rb
|
259
259
|
- spec/evostream/commands/create_spec.rb
|
260
260
|
- spec/evostream/commands/destroy_spec.rb
|
261
|
+
- spec/evostream/commands/push_stream_spec.rb
|
261
262
|
- spec/evostream/events/events_spec.rb
|
262
263
|
- spec/evostream/events/request_in_stream_closed_spec.rb
|
263
264
|
- spec/evostream/events/request_in_stream_created_spec.rb
|
264
265
|
- spec/evostream/events/request_out_stream_created_spec.rb
|
266
|
+
- spec/evostream/evostream_event_action_spec.rb
|
267
|
+
- spec/evostream/evostream_event_event_spec.rb
|
268
|
+
- spec/evostream/evostream_event_method_spec.rb
|
265
269
|
- spec/evostream/evostream_event_spec.rb
|
266
270
|
- spec/spec_helper.rb
|
271
|
+
- spec/support/examples_actions.rb
|
267
272
|
- spec/support/examples_commands.rb
|
268
273
|
- spec/support/examples_events.rb
|
269
274
|
homepage: https://github.com/Dev-Crea/evostream-event
|