rbsrt 0.1.1 → 0.1.2
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/Rakefile +4 -1
- data/ext/rbsrt/extconf.rb +14 -14
- data/lib/rbsrt/rbsrt.bundle +0 -0
- data/lib/rbsrt/streamid_components.rb +17 -0
- data/lib/rbsrt/version.rb +1 -1
- data/test/rbsrt/streamid_components_test.rb +36 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0da76924878f6409bea03b2a05c5e97c27e9c070ae628d28b5048570ba0186ca
|
4
|
+
data.tar.gz: 8110b5167ea390acc8b6ae80a69cc300e20791e9ddd3ed0bd16a3e9f4fa724ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec80de0f349a045e02957118dd5cddd49041c96843f485df1f106c615278783462dd48901bcb1fbad2c73362b9fc82527edfca4e1f6cd197d0dd6443fa1af4ea
|
7
|
+
data.tar.gz: bbdeda3540c5e88c6ab5c4926bea4d5f70777351fcf2cfe630efcb69ba11c37d792131d0e30cd5a736852891a2b9137bdb84968920d20ec208c4af503a042d9e
|
data/Rakefile
CHANGED
@@ -16,7 +16,10 @@ task :default => :test
|
|
16
16
|
# sh "make"
|
17
17
|
# end
|
18
18
|
|
19
|
-
|
19
|
+
desc "Open an irb session with rbsrt library"
|
20
|
+
task :console do
|
21
|
+
sh "irb -r ./lib/rbsrt.rb"
|
22
|
+
end
|
20
23
|
|
21
24
|
Rake::ExtensionTask.new 'rbsrt' do |ext|
|
22
25
|
ext.lib_dir = "lib/rbsrt"
|
data/ext/rbsrt/extconf.rb
CHANGED
@@ -2,24 +2,24 @@ require 'mkmf'
|
|
2
2
|
|
3
3
|
extension_name = 'rbsrt/rbsrt'
|
4
4
|
|
5
|
-
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
5
|
+
# RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
LIBDIR = CONFIG['libdir']
|
8
|
+
INCLUDEDIR = CONFIG['includedir']
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
HEADER_DIRS = []
|
11
|
+
HEADER_DIRS << '/opt/local/include' if File.directory?('/opt/local/include')
|
12
|
+
HEADER_DIRS << '/usr/local/include' if File.directory?('/usr/local/include')
|
13
|
+
HEADER_DIRS << INCLUDEDIR
|
14
|
+
HEADER_DIRS << '/usr/include' if File.directory?('/usr/include')
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
LIB_DIRS = []
|
17
|
+
LIB_DIRS << '/opt/local/lib' if File.directory?('/opt/local/lib')
|
18
|
+
LIB_DIRS << '/usr/local/lib' if File.directory?('/usr/local/lib')
|
19
|
+
LIB_DIRS << LIBDIR
|
20
|
+
LIB_DIRS << '/usr/lib' if File.directory?('/usr/lib')
|
21
21
|
|
22
|
-
dir_config('srt')
|
22
|
+
dir_config('srt', HEADER_DIRS, LIB_DIRS)
|
23
23
|
# dir_config('srt', HEADER_DIRS, LIB_DIRS)
|
24
24
|
# dir_config('c++', HEADER_DIRS, LIB_DIRS)
|
25
25
|
|
data/lib/rbsrt/rbsrt.bundle
CHANGED
Binary file
|
@@ -58,6 +58,23 @@ module SRT
|
|
58
58
|
streamid + vars.join(",")
|
59
59
|
end
|
60
60
|
|
61
|
+
def to_h
|
62
|
+
h = {}
|
63
|
+
|
64
|
+
@extra.each do |key, value|
|
65
|
+
h[key] = value
|
66
|
+
end
|
67
|
+
|
68
|
+
h[:resource_name] = resource_name if resource_name
|
69
|
+
h[:user_name] = user_name if user_name
|
70
|
+
h[:mode] = mode if mode
|
71
|
+
h[:host_name] = host_name if host_name
|
72
|
+
h[:type] = type if type
|
73
|
+
h[:sessionid] = sessionid if sessionid
|
74
|
+
|
75
|
+
return h
|
76
|
+
end
|
77
|
+
|
61
78
|
def method_missing(name, *args)
|
62
79
|
return extra[name.to_s] if extra.key? name.to_s
|
63
80
|
match = name.to_s.match(/^(.*?)(=?)$/)
|
data/lib/rbsrt/version.rb
CHANGED
@@ -277,5 +277,41 @@ describe SRT::StreamIDComponents do
|
|
277
277
|
s.baz.must_equal "bar"
|
278
278
|
end
|
279
279
|
end
|
280
|
+
|
281
|
+
describe "#to_h" do
|
282
|
+
let(:streamid) { "#!::r=foobar,u=admin,h=stream.recce.nl,s=12345,t=stream,m=publish,foo=bar" }
|
283
|
+
|
284
|
+
let(:parser) {
|
285
|
+
SRT::StreamIDComponents.new(streamid)
|
286
|
+
}
|
287
|
+
|
288
|
+
it "stores the 'r' as the :resource_name" do
|
289
|
+
parser.to_h[:resource_name].must_equal "foobar"
|
290
|
+
end
|
291
|
+
|
292
|
+
it "stores the 'u' var to :user_name" do
|
293
|
+
parser.to_h[:user_name].must_equal "admin"
|
294
|
+
end
|
295
|
+
|
296
|
+
it "stores the 'm' var to :mode" do
|
297
|
+
parser.to_h[:mode].must_equal :publish
|
298
|
+
end
|
299
|
+
|
300
|
+
it "stores the 'h' to :host_name" do
|
301
|
+
parser.to_h[:host_name].must_equal "stream.recce.nl"
|
302
|
+
end
|
303
|
+
|
304
|
+
it "stores the 't' var to :type" do
|
305
|
+
parser.to_h[:type].must_equal :stream
|
306
|
+
end
|
307
|
+
|
308
|
+
it "stores the 's' var to :sessionid" do
|
309
|
+
parser.to_h[:sessionid].must_equal "12345"
|
310
|
+
end
|
311
|
+
|
312
|
+
it "stores extra attributes when available" do
|
313
|
+
parser.to_h["foo"].must_equal "bar"
|
314
|
+
end
|
315
|
+
end
|
280
316
|
end
|
281
317
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbsrt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Klaas Speller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|