ruby-osc 0.31.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +1153 -0
- data/README.rdoc +2 -0
- data/Rakefile +7 -7
- data/examples/localtest.rb +8 -7
- data/lib/ruby-osc.rb +35 -31
- data/lib/ruby-osc/bundle.rb +29 -22
- data/lib/ruby-osc/client.rb +14 -10
- data/lib/ruby-osc/message.rb +48 -31
- data/lib/ruby-osc/server.rb +13 -12
- data/lib/ruby-osc/version.rb +2 -1
- data/ruby-osc.gemspec +7 -9
- data/spec/bundle_spec.rb +48 -47
- data/spec/message_spec.rb +129 -86
- data/spec/server_spec.rb +2 -1
- data/spec/spec_helper.rb +4 -4
- data/streamscanner_benchmark.rb +40 -0
- metadata +24 -31
data/spec/server_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
|
-
require
|
1
|
+
# encoding: UTF-8
|
2
|
+
require "rspec"
|
3
3
|
|
4
|
-
|
4
|
+
$LOAD_PATH.unshift( File.join( File.dirname( __FILE__), "..", "lib" ) )
|
5
5
|
|
6
|
-
require
|
6
|
+
require "ruby-osc"
|
7
7
|
include OSC
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "benchmark"
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift( File.join( File.dirname( __FILE__), "lib" ) )
|
4
|
+
|
5
|
+
require "ruby-osc/streamscanner"
|
6
|
+
|
7
|
+
@ss = OSC::StreamScanner.new
|
8
|
+
|
9
|
+
count = 10_000
|
10
|
+
|
11
|
+
Benchmark.bm(23) do |x|
|
12
|
+
x.report("add new string") do
|
13
|
+
count.times do
|
14
|
+
@ss << "/bar/foo\000\000\000\000,iiii\000\000\000\000\000\000\004\000\000\000\003\000\000\000\002\000\000\000\001".force_encoding("binary")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
x.report("parse string") do
|
19
|
+
count.times do
|
20
|
+
@ss.tryparse
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
x.report("try parse each message") do
|
26
|
+
count.times do
|
27
|
+
OSC::Message.decode("/bar/foo\000\000\000\000,iiii\000\000\000\000\000\000\004\000\000\000\003\000\000\000\002\000\000\000\001".force_encoding("binary"))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
x.report("parse failure") do
|
32
|
+
count.times do
|
33
|
+
begin
|
34
|
+
@ss.tryparse
|
35
|
+
rescue
|
36
|
+
nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,73 +1,67 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-osc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Macario
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2020-03-29 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: '3.8'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: '3.8'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: bundler
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '1.0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '1.0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: eventmachine
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
47
|
+
version: '1.2'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
description: Concise OSC Ruby implementation
|
54
|
+
version: '1.2'
|
55
|
+
description: Concise OSC Ruby implementation based on EventMachine
|
63
56
|
email:
|
64
57
|
- macarui@gmail.com
|
65
58
|
executables: []
|
66
59
|
extensions: []
|
67
60
|
extra_rdoc_files: []
|
68
61
|
files:
|
69
|
-
- .gitignore
|
70
|
-
- .rspec
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".rubocop.yml"
|
71
65
|
- Gemfile
|
72
66
|
- README.rdoc
|
73
67
|
- Rakefile
|
@@ -83,33 +77,32 @@ files:
|
|
83
77
|
- spec/message_spec.rb
|
84
78
|
- spec/server_spec.rb
|
85
79
|
- spec/spec_helper.rb
|
80
|
+
- streamscanner_benchmark.rb
|
86
81
|
homepage: http://makarius.me
|
87
|
-
licenses:
|
82
|
+
licenses:
|
83
|
+
- MIT
|
84
|
+
metadata: {}
|
88
85
|
post_install_message:
|
89
86
|
rdoc_options: []
|
90
87
|
require_paths:
|
91
88
|
- lib
|
92
89
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
-
none: false
|
94
90
|
requirements:
|
95
|
-
- -
|
91
|
+
- - ">="
|
96
92
|
- !ruby/object:Gem::Version
|
97
93
|
version: '0'
|
98
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
95
|
requirements:
|
101
|
-
- -
|
96
|
+
- - ">="
|
102
97
|
- !ruby/object:Gem::Version
|
103
98
|
version: '0'
|
104
99
|
requirements: []
|
105
|
-
|
106
|
-
rubygems_version: 1.8.24
|
100
|
+
rubygems_version: 3.1.2
|
107
101
|
signing_key:
|
108
|
-
specification_version:
|
102
|
+
specification_version: 4
|
109
103
|
summary: Concise OSC Ruby implementation
|
110
104
|
test_files:
|
111
105
|
- spec/bundle_spec.rb
|
112
106
|
- spec/message_spec.rb
|
113
107
|
- spec/server_spec.rb
|
114
108
|
- spec/spec_helper.rb
|
115
|
-
has_rdoc:
|