evostream-event 1.0.3 → 2.0.0.pre.809444619

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -2
  3. data/lib/evostream/cli/option/argument.rb +2 -0
  4. data/lib/evostream/cli/option/search.rb +2 -0
  5. data/lib/evostream/cli/runner.rb +1 -1
  6. data/lib/evostream/event/commands/destroy.rb +1 -1
  7. data/lib/evostream/event/commands/get_stream_info.rb +1 -1
  8. data/lib/evostream/event/commands/list_streams.rb +1 -1
  9. data/lib/evostream/event/commands/push_stream.rb +1 -1
  10. data/lib/evostream/event/commands/set_log_level.rb +1 -1
  11. data/lib/evostream/event/commands.rb +1 -1
  12. data/lib/evostream/event/event/events/in_stream_created.rb +2 -0
  13. data/lib/evostream/event/event/events/out_stream_created.rb +2 -2
  14. data/lib/evostream/event/event/events.rb +2 -2
  15. data/lib/evostream/event/info.rb +2 -2
  16. data/spec/evostream/{action/action_spec.rb → action_spec.rb} +11 -11
  17. data/spec/{cli → evostream/cli}/argument/command_spec.rb +2 -0
  18. data/spec/{cli → evostream/cli}/argument/config_spec.rb +2 -0
  19. data/spec/evostream/cli/argument/help_spec.rb +26 -0
  20. data/spec/{cli → evostream/cli}/argument/host_spec.rb +2 -0
  21. data/spec/{cli → evostream/cli}/argument/port_spec.rb +2 -0
  22. data/spec/{cli → evostream/cli}/argument/search_spec.rb +2 -0
  23. data/spec/{cli → evostream/cli}/argument/version_spec.rb +2 -0
  24. data/spec/evostream/commands/create_dash_spec.rb +3 -3
  25. data/spec/evostream/commands/create_hls_spec.rb +27 -27
  26. data/spec/evostream/commands/create_spec.rb +22 -22
  27. data/spec/evostream/commands/{push_stream_spec.rb → destroy_push_stream_spec.rb} +3 -3
  28. data/spec/evostream/commands/destroy_spec.rb +6 -6
  29. data/spec/evostream/commands/get_stream_info_spec.rb +4 -4
  30. data/spec/evostream/commands/{list_stream_spec.rb → list_streams_spec.rb} +2 -2
  31. data/spec/evostream/commands/set_log_level_spec.rb +3 -3
  32. data/spec/evostream/events/events_spec.rb +1 -1
  33. data/spec/evostream/events/in_stream_closed_spec.rb +82 -0
  34. data/spec/evostream/events/in_stream_created_spec.rb +75 -0
  35. data/spec/evostream/events/{request_out_stream_created_spec.rb → out_stream_created_spec.rb} +61 -67
  36. data/spec/features/push_stream_spec.rb +4 -2
  37. data/spec/features/remove_config_spec.rb +4 -2
  38. data/spec/spec_helper.rb +12 -8
  39. data/spec/support/examples_arguments.rb +5 -0
  40. data/spec/support/fake_evostream.rb +14 -18
  41. metadata +66 -85
  42. data/spec/cli/argument/help_spec.rb +0 -28
  43. data/spec/evostream/event/event_spec.rb +0 -0
  44. data/spec/evostream/events/request_in_stream_closed_spec.rb +0 -82
  45. data/spec/evostream/events/request_in_stream_created_spec.rb +0 -75
@@ -2,8 +2,10 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- feature 'PushStream', type: :response,
6
- name: :pushStream do
5
+ describe 'PushStream', type: :request,
6
+ name: :pushStream do
7
+ before { FakeEvostream.push_stream }
8
+
7
9
  it do
8
10
  uri = URI('http://server_stream.local/pushStream?params=dXJpPXJ0')
9
11
 
@@ -2,8 +2,10 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- feature 'RemoveConfig', type: :response,
6
- name: :removeConfig do
5
+ describe 'RemoveConfig', type: :request,
6
+ name: :removeConfig do
7
+ before { FakeEvostream.remove_config }
8
+
7
9
  it do
8
10
  uri = URI('http://server_stream.local/removeConfig?params=dXJpPXJ0')
9
11
 
data/spec/spec_helper.rb CHANGED
@@ -7,8 +7,12 @@ require 'evostream/event'
7
7
  require 'faker'
8
8
  require 'json'
9
9
  require 'webmock/rspec'
10
- require 'capybara/rspec'
11
10
  require 'active_support/core_ext/hash'
11
+ require 'simplecov'
12
+ require 'simplecov_json_formatter'
13
+
14
+ SimpleCov.start
15
+ SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
12
16
 
13
17
  $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
14
18
 
@@ -24,6 +28,9 @@ RSpec.configure do |config|
24
28
  c.syntax = :expect
25
29
  end
26
30
 
31
+ # Stop when rspec fail
32
+ config.fail_fast = true
33
+
27
34
  # Disable all remote connections
28
35
  WebMock.disable_net_connect!(allow_localhost: true)
29
36
 
@@ -46,17 +53,12 @@ RSpec.configure do |config|
46
53
  # Configure test Net::HTTP
47
54
  config.before(:each, type: :request) do
48
55
  stub_request(:get, /server_stream.local/)
49
- .with(headers: { 'Accept': '*/*', 'User-Agent': 'Ruby' })
56
+ .with(headers: { Accept: '*/*', 'User-Agent': 'Ruby' })
50
57
  .to_return(status: 200, body: '', headers: {})
51
58
  end
52
59
 
53
- config.before(:each, type: :response) do
54
- stub_request(:any, /server_stream.local/).to_rack(FakeEvostream)
55
- end
56
-
57
60
  config.before(:each, type: :cli) do
58
- server = double('server').as_null_object
59
- TCPSocket.stub(:new).and_return(server)
61
+ TCPSocket.stub(:new).and_return(instance_double('server').as_null_object)
60
62
  end
61
63
  end
62
64
 
@@ -68,7 +70,9 @@ class Test
68
70
  end
69
71
 
70
72
  # Class for testing model stream
73
+ # rubocop:disable Lint/EmptyClass
71
74
  class Hls; end
72
75
 
73
76
  # Class for testing model stream
74
77
  class Dash; end
78
+ # rubocop:enable Lint/EmptyClass
@@ -1,5 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ RSpec.shared_examples 'argument help' do
4
+ include_examples 'argument exit'
5
+ include_examples 'argument output'
6
+ end
7
+
3
8
  RSpec.shared_examples 'argument exit' do
4
9
  it { expect { runner.run }.to terminate.with_code(code) }
5
10
  end
@@ -1,30 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'sinatra/base'
3
+ require 'webmock/rspec'
4
4
 
5
5
  # Fake class for testing response to pushCommand
6
- class FakeEvostream < Sinatra::Base
7
- get '/pushStream' do
8
- json_response 200, :push_stream
6
+ class FakeEvostream
7
+ def self.request
8
+ WebMock::API.stub_request(:any, /server_stream.local/)
9
9
  end
10
10
 
11
- get '/createDASHStream' do
12
- json_response 200, :create_dash_stream
11
+ def self.push_stream
12
+ request.to_return(json_response(:push_stream))
13
13
  end
14
14
 
15
- get '/createHLSStream' do
16
- json_response 200, :create_hls_stream
15
+ def self.remove_config
16
+ request.to_return(json_response(:remove_config))
17
17
  end
18
18
 
19
- get '/removeConfig' do
20
- json_response 200, :remove_config
21
- end
22
-
23
- private
24
-
25
- def json_response(response_code, file_name)
26
- content_type :json
27
- status response_code
28
- File.open("#{File.dirname(__FILE__)}/fixtures/#{file_name}.json")
19
+ def self.json_response(file_name)
20
+ {
21
+ status: 200,
22
+ headers: { 'Content-Type': 'application/json' },
23
+ body: File.open("#{File.dirname(__FILE__)}/fixtures/#{file_name}.json")
24
+ }
29
25
  end
30
26
  end
metadata CHANGED
@@ -1,235 +1,217 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evostream-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 2.0.0.pre.809444619
5
5
  platform: ruby
6
6
  authors:
7
7
  - VAILLANT Jeremy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-16 00:00:00.000000000 Z
11
+ date: 2021-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: capybara
14
+ name: faker
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.13'
19
+ version: '2.17'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.13'
26
+ version: '2.17'
27
27
  - !ruby/object:Gem::Dependency
28
- name: faker
28
+ name: pry-byebug
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.7'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 1.7.3
33
+ version: '3.9'
37
34
  type: :development
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '1.7'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 1.7.3
40
+ version: '3.9'
47
41
  - !ruby/object:Gem::Dependency
48
- name: fuubar
42
+ name: rake
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '2.2'
47
+ version: 13.0.3
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '2.2'
54
+ version: 13.0.3
61
55
  - !ruby/object:Gem::Dependency
62
- name: overcommit
56
+ name: reek
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
59
  - - "~>"
66
60
  - !ruby/object:Gem::Version
67
- version: 0.34.2
61
+ version: 6.0.4
68
62
  type: :development
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
66
  - - "~>"
73
67
  - !ruby/object:Gem::Version
74
- version: 0.34.2
68
+ version: 6.0.4
75
69
  - !ruby/object:Gem::Dependency
76
- name: pry-byebug
70
+ name: rspec
77
71
  requirement: !ruby/object:Gem::Requirement
78
72
  requirements:
79
73
  - - "~>"
80
74
  - !ruby/object:Gem::Version
81
- version: '3.4'
75
+ version: '3.10'
82
76
  type: :development
83
77
  prerelease: false
84
78
  version_requirements: !ruby/object:Gem::Requirement
85
79
  requirements:
86
80
  - - "~>"
87
81
  - !ruby/object:Gem::Version
88
- version: '3.4'
82
+ version: '3.10'
89
83
  - !ruby/object:Gem::Dependency
90
- name: rake
84
+ name: rubocop
91
85
  requirement: !ruby/object:Gem::Requirement
92
86
  requirements:
93
87
  - - "~>"
94
88
  - !ruby/object:Gem::Version
95
- version: '10.0'
89
+ version: 1.13.0
96
90
  type: :development
97
91
  prerelease: false
98
92
  version_requirements: !ruby/object:Gem::Requirement
99
93
  requirements:
100
94
  - - "~>"
101
95
  - !ruby/object:Gem::Version
102
- version: '10.0'
96
+ version: 1.13.0
103
97
  - !ruby/object:Gem::Dependency
104
- name: reek
98
+ name: rubocop-faker
105
99
  requirement: !ruby/object:Gem::Requirement
106
100
  requirements:
107
101
  - - "~>"
108
102
  - !ruby/object:Gem::Version
109
- version: '4.8'
103
+ version: '1.1'
110
104
  type: :development
111
105
  prerelease: false
112
106
  version_requirements: !ruby/object:Gem::Requirement
113
107
  requirements:
114
108
  - - "~>"
115
109
  - !ruby/object:Gem::Version
116
- version: '4.8'
110
+ version: '1.1'
117
111
  - !ruby/object:Gem::Dependency
118
- name: rspec
112
+ name: rubocop-performance
119
113
  requirement: !ruby/object:Gem::Requirement
120
114
  requirements:
121
- - - ">="
122
- - !ruby/object:Gem::Version
123
- version: 3.5.0
124
115
  - - "~>"
125
116
  - !ruby/object:Gem::Version
126
- version: '3.5'
117
+ version: '1.11'
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: 1.11.1
127
121
  type: :development
128
122
  prerelease: false
129
123
  version_requirements: !ruby/object:Gem::Requirement
130
124
  requirements:
131
- - - ">="
132
- - !ruby/object:Gem::Version
133
- version: 3.5.0
134
125
  - - "~>"
135
126
  - !ruby/object:Gem::Version
136
- version: '3.5'
127
+ version: '1.11'
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 1.11.1
137
131
  - !ruby/object:Gem::Dependency
138
- name: rubocop
132
+ name: rubocop-rspec
139
133
  requirement: !ruby/object:Gem::Requirement
140
134
  requirements:
141
135
  - - "~>"
142
136
  - !ruby/object:Gem::Version
143
- version: 0.67.2
137
+ version: '2.3'
144
138
  type: :development
145
139
  prerelease: false
146
140
  version_requirements: !ruby/object:Gem::Requirement
147
141
  requirements:
148
142
  - - "~>"
149
143
  - !ruby/object:Gem::Version
150
- version: 0.67.2
144
+ version: '2.3'
151
145
  - !ruby/object:Gem::Dependency
152
- name: sinatra
146
+ name: simplecov
153
147
  requirement: !ruby/object:Gem::Requirement
154
148
  requirements:
155
149
  - - "~>"
156
150
  - !ruby/object:Gem::Version
157
- version: 2.0.1
151
+ version: 0.21.2
158
152
  type: :development
159
153
  prerelease: false
160
154
  version_requirements: !ruby/object:Gem::Requirement
161
155
  requirements:
162
156
  - - "~>"
163
157
  - !ruby/object:Gem::Version
164
- version: 2.0.1
158
+ version: 0.21.2
165
159
  - !ruby/object:Gem::Dependency
166
- name: travis
160
+ name: simplecov_json_formatter
167
161
  requirement: !ruby/object:Gem::Requirement
168
162
  requirements:
169
163
  - - "~>"
170
164
  - !ruby/object:Gem::Version
171
- version: '1.8'
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- version: 1.8.4
165
+ version: 0.1.3
175
166
  type: :development
176
167
  prerelease: false
177
168
  version_requirements: !ruby/object:Gem::Requirement
178
169
  requirements:
179
170
  - - "~>"
180
171
  - !ruby/object:Gem::Version
181
- version: '1.8'
182
- - - ">="
183
- - !ruby/object:Gem::Version
184
- version: 1.8.4
172
+ version: 0.1.3
185
173
  - !ruby/object:Gem::Dependency
186
174
  name: webmock
187
175
  requirement: !ruby/object:Gem::Requirement
188
176
  requirements:
189
177
  - - "~>"
190
178
  - !ruby/object:Gem::Version
191
- version: '2.3'
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: 2.3.2
179
+ version: 3.12.2
195
180
  type: :development
196
181
  prerelease: false
197
182
  version_requirements: !ruby/object:Gem::Requirement
198
183
  requirements:
199
184
  - - "~>"
200
185
  - !ruby/object:Gem::Version
201
- version: '2.3'
202
- - - ">="
203
- - !ruby/object:Gem::Version
204
- version: 2.3.2
186
+ version: 3.12.2
205
187
  - !ruby/object:Gem::Dependency
206
188
  name: yard
207
189
  requirement: !ruby/object:Gem::Requirement
208
190
  requirements:
209
191
  - - "~>"
210
192
  - !ruby/object:Gem::Version
211
- version: 0.9.11
193
+ version: 0.9.26
212
194
  type: :development
213
195
  prerelease: false
214
196
  version_requirements: !ruby/object:Gem::Requirement
215
197
  requirements:
216
198
  - - "~>"
217
199
  - !ruby/object:Gem::Version
218
- version: 0.9.11
200
+ version: 0.9.26
219
201
  - !ruby/object:Gem::Dependency
220
202
  name: activesupport
221
203
  requirement: !ruby/object:Gem::Requirement
222
204
  requirements:
223
205
  - - "~>"
224
206
  - !ruby/object:Gem::Version
225
- version: '4.2'
207
+ version: 6.1.3.1
226
208
  type: :runtime
227
209
  prerelease: false
228
210
  version_requirements: !ruby/object:Gem::Requirement
229
211
  requirements:
230
212
  - - "~>"
231
213
  - !ruby/object:Gem::Version
232
- version: '4.2'
214
+ version: 6.1.3.1
233
215
  - !ruby/object:Gem::Dependency
234
216
  name: colorize
235
217
  requirement: !ruby/object:Gem::Requirement
@@ -294,27 +276,26 @@ files:
294
276
  - lib/evostream/event/response/response.rb
295
277
  - lib/evostream/event/service.rb
296
278
  - lib/generators/evostream/initializer_generator.rb
297
- - spec/cli/argument/command_spec.rb
298
- - spec/cli/argument/config_spec.rb
299
- - spec/cli/argument/help_spec.rb
300
- - spec/cli/argument/host_spec.rb
301
- - spec/cli/argument/port_spec.rb
302
- - spec/cli/argument/search_spec.rb
303
- - spec/cli/argument/version_spec.rb
304
- - spec/evostream/action/action_spec.rb
279
+ - spec/evostream/action_spec.rb
280
+ - spec/evostream/cli/argument/command_spec.rb
281
+ - spec/evostream/cli/argument/config_spec.rb
282
+ - spec/evostream/cli/argument/help_spec.rb
283
+ - spec/evostream/cli/argument/host_spec.rb
284
+ - spec/evostream/cli/argument/port_spec.rb
285
+ - spec/evostream/cli/argument/search_spec.rb
286
+ - spec/evostream/cli/argument/version_spec.rb
305
287
  - spec/evostream/commands/create_dash_spec.rb
306
288
  - spec/evostream/commands/create_hls_spec.rb
307
289
  - spec/evostream/commands/create_spec.rb
290
+ - spec/evostream/commands/destroy_push_stream_spec.rb
308
291
  - spec/evostream/commands/destroy_spec.rb
309
292
  - spec/evostream/commands/get_stream_info_spec.rb
310
- - spec/evostream/commands/list_stream_spec.rb
311
- - spec/evostream/commands/push_stream_spec.rb
293
+ - spec/evostream/commands/list_streams_spec.rb
312
294
  - spec/evostream/commands/set_log_level_spec.rb
313
- - spec/evostream/event/event_spec.rb
314
295
  - spec/evostream/events/events_spec.rb
315
- - spec/evostream/events/request_in_stream_closed_spec.rb
316
- - spec/evostream/events/request_in_stream_created_spec.rb
317
- - spec/evostream/events/request_out_stream_created_spec.rb
296
+ - spec/evostream/events/in_stream_closed_spec.rb
297
+ - spec/evostream/events/in_stream_created_spec.rb
298
+ - spec/evostream/events/out_stream_created_spec.rb
318
299
  - spec/evostream/evostream_event_spec.rb
319
300
  - spec/features/push_stream_spec.rb
320
301
  - spec/features/remove_config_spec.rb
@@ -331,14 +312,14 @@ files:
331
312
  - spec/support/fixtures/remove_config.json
332
313
  - spec/support/fixtures/stream_closed.json
333
314
  - spec/support/fixtures/stream_created.json
334
- homepage: https://github.com/Dev-Crea/evostream-event
315
+ homepage: https://github.com/dazzl-tv/evostream-event
335
316
  licenses:
336
317
  - MIT
337
318
  metadata: {}
338
319
  post_install_message: |-
339
320
  # ====================================================== #
340
321
  # Thanks for installing EvoStream-Event ! #
341
- # https://github.com/Dev-Crea/evostream-event. #
322
+ # https://github.com/dazzl-tv/evostream-event. #
342
323
  # ;;;;;;;;;;;:. #
343
324
  # ;;;;;;;;;;;;;;;;;; #
344
325
  # ;;;;;;;;;;;:;;;;;;;; #
@@ -360,14 +341,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
360
341
  requirements:
361
342
  - - ">="
362
343
  - !ruby/object:Gem::Version
363
- version: 2.4.0
344
+ version: 2.6.0
364
345
  required_rubygems_version: !ruby/object:Gem::Requirement
365
346
  requirements:
366
- - - ">="
347
+ - - ">"
367
348
  - !ruby/object:Gem::Version
368
- version: '0'
349
+ version: 1.3.1
369
350
  requirements: []
370
- rubygems_version: 3.0.3
351
+ rubygems_version: 3.0.3.1
371
352
  signing_key:
372
353
  specification_version: 4
373
354
  summary: EvoStream Event