evostream-event 0.1.0.pre.42 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ed3dd9e8488443ffb033ecdbcfe392984638e31
4
- data.tar.gz: cd7ff078f7ad253070626a8519a24a6d47b9bc56
3
+ metadata.gz: a9e5b803c4107cf6c2e183546b37136f0cd9e162
4
+ data.tar.gz: 14ef30216559d59c8527cb6b46d6708b3420791c
5
5
  SHA512:
6
- metadata.gz: 040d5b92b53aa6e0ec0a901575d3892193139da1f4237bfaad50cbb1379ffe8975c84a971e395ee5b0008b7a5f49b004feb6fe4167291ecdb6861338964f46eb
7
- data.tar.gz: 84cca0bf13231ea32f5e09c4dbb9dd047499333f45079c84b3f5d1742ec4c956fe080262efa9e85e6a62bf5cc43e6b6a7b6ca1b5bfec79aa63e7f9744be5df09
6
+ metadata.gz: 0bb413120c095c034394a54fdc9f012d135a432059e332189df4aa53c3756af13851419b9446ad16ccb59911739b409d68b6a6103ed2da0f2fd52f726c806c1e
7
+ data.tar.gz: 4343867836d9b24944c0912c7e23cb463cc5640f95e2ceef32e652f9dd6bf5b996138b947494e5c9f9ee2df7a98f95108782ab8b56f68eb1e009dd58254446ff
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in evostream-event.gemspec
data/README.md CHANGED
@@ -1,10 +1,18 @@
1
- # Evostream::Event | [![Build Status](https://travis-ci.org/Dev-Crea/evostream-event.svg?branch=master)](https://travis-ci.org/Dev-Crea/evostream-event)
1
+ # Evostream::Event | [![Build Status](https://travis-ci.org/Dev-Crea/evostream-event.svg?branch=master)](https://travis-ci.org/Dev-Crea/evostream-event) [![Gem Version](https://badge.fury.io/rb/evostream-event.svg)](https://badge.fury.io/rb/evostream-event) [![inline docs](https://inch-ci.org/github/Dev-Crea/evostream-event.svg)](https://inch-ci.org/github/Dev-Crea/evostream-event)
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/evostream/event`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Evostream Event listen event to Evostream and execute task.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ ## Menu
6
6
 
7
- ## Installation
7
+ * [How to use](#how-to-use)
8
+ * [Installation](#installation)
9
+ * [Usage](#usage)
10
+ * [Development](#development)
11
+ * [Contributing](#contributing)
12
+
13
+ ## How to use
14
+
15
+ ### Installation
8
16
 
9
17
  Add this line to your application's Gemfile:
10
18
 
@@ -12,25 +20,48 @@ Add this line to your application's Gemfile:
12
20
  gem 'evostream-event'
13
21
  ```
14
22
 
15
- And then execute:
23
+ And then execute :
24
+
25
+ ```linux
26
+ bundle
27
+ ```
16
28
 
17
- $ bundle
29
+ Or install it yourself as :
18
30
 
19
- Or install it yourself as:
31
+ ```linux
32
+ gem install evostream-event
33
+ ```
20
34
 
21
- $ gem install evostream-event
35
+ ### Usage
22
36
 
23
- ## Usage
37
+ Create initializer :
24
38
 
25
- TODO: Write usage instructions here
39
+ ```linux
40
+ rails generator evostream:initializer
41
+ ```
42
+
43
+ Treatment evostream request :
44
+
45
+ ```ruby
46
+ event = Evostream::Event.new(params[:type], params[:payload].to_unsafe_h)
47
+ event.execute_action
48
+ ```
26
49
 
27
50
  ## Development
28
51
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
52
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
53
+ `rake spec` to run the tests. You can also run `bin/console` for an interactive
54
+ prompt that will allow you to experiment.
30
55
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
56
+ To install this gem onto your local machine, run `bundle exec rake install`. To
57
+ release a new version, update the version number in `version.rb`, and then run
58
+ `bundle exec rake release`, which will create a git tag for the version, push
59
+ git commits and tags, and push the `.gem` file to
60
+ [rubygems.org](https://rubygems.org).
32
61
 
33
62
  ## Contributing
34
63
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/evostream-event. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
-
64
+ Bug reports and pull requests are welcome on GitHub at
65
+ https://github.com/Dev-Crea/evostream-event. This project is intended to be a
66
+ safe, welcoming space for collaboration, and contributors are expected to adhere
67
+ to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -21,16 +21,16 @@ module Evostream
21
21
 
22
22
  attr_reader :config
23
23
 
24
- # rubocop:disable Style/GuardClause
25
24
  def remove_config(flux)
26
- unless @config.empty?
25
+ if @config.empty?
27
26
  {
28
27
  group_name: "#{Evostream::Service.name}#{flux}",
29
28
  remove_hls_hds_files: 1
30
29
  }
30
+ else
31
+ @config
31
32
  end
32
33
  end
33
- # rubocop:enable Style/GuardClause
34
34
  end
35
35
  end
36
36
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Evostream
4
+ module Generators
5
+ # Create a generator for Rails application
6
+ class InitializerGenerator < Rails::Generators::Base
7
+ desc 'Generate a initializer for evostream-event gem.'
8
+ INITIALIZER = <<-INIT
9
+ # frozen_string_literal: true
10
+
11
+ require 'evostream_event'
12
+
13
+ Evostream::Service.configuration do |config|
14
+ config.uri_in = 'http://server_stream.local:80'
15
+ config.uri_out = 'http://server_stream.local:7777'
16
+ config.name = 'srteamming_'
17
+ config.web_root = '/var/www/html'
18
+ config.model = ModelUsedInDatabase
19
+ config.model_id = :idenitfier_used_in_model
20
+ end
21
+ INIT
22
+
23
+ # Create initializer in Rails project
24
+ def copy_initializer
25
+ initializer 'evostream_event.rb', INITIALIZER
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Commands::CreateDASH do
6
+ let(:command) { Evostream::Commands::CreateDASH.new(cmd) }
7
+
8
+ context 'manifest_name' do
9
+ let(:arg_value) { Faker::Pokemon.name }
10
+ let(:argument) { 'manifest_name' }
11
+
12
+ include_examples 'command'
13
+ end
14
+ end
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Commands::CreateHLS do
6
+ let(:command) { Evostream::Commands::CreateHLS.new(cmd) }
7
+
8
+ context 'create_master_playlist' do
9
+ let(:arg_value) { Faker::Number.between(0, 1) }
10
+ let(:argument) { 'create_master_playlist' }
11
+
12
+ include_examples 'command'
13
+ end
14
+
15
+ context 'playlist_name' do
16
+ let(:arg_value) { Faker::Pokemon.name }
17
+ let(:argument) { 'playlist_name' }
18
+
19
+ include_examples 'command'
20
+ end
21
+
22
+ context 'max_chunk_length' do
23
+ let(:arg_value) { Faker::Number.between(0, 1) }
24
+ let(:argument) { 'max_chunk_length' }
25
+
26
+ include_examples 'command'
27
+ end
28
+
29
+ context 'chunk_base_name' do
30
+ let(:arg_value) { Faker::Pokemon.name }
31
+ let(:argument) { 'chunk_base_name' }
32
+
33
+ include_examples 'command'
34
+ end
35
+
36
+ context 'drm_type' do
37
+ let(:arg_value) { Faker::Pokemon.name }
38
+ let(:argument) { 'drm_type' }
39
+
40
+ include_examples 'command'
41
+ end
42
+
43
+ context 'aes_key_count', broken: true do
44
+ let(:arg_value) { Faker::Number.between(1, 99) }
45
+ let(:argument) { 'aes_key_count' }
46
+
47
+ include_examples 'command'
48
+ end
49
+
50
+ context 'audio_only' do
51
+ let(:arg_value) { Faker::Number.between(0, 1) }
52
+ let(:argument) { 'audio_only' }
53
+
54
+ include_examples 'command'
55
+ end
56
+
57
+ context 'hls_resume' do
58
+ let(:arg_value) { Faker::Number.between(0, 1) }
59
+ let(:argument) { 'hls_resume' }
60
+
61
+ include_examples 'command'
62
+ end
63
+
64
+ context 'cleanup_on_close' do
65
+ let(:arg_value) { Faker::Number.between(0, 1) }
66
+ let(:argument) { 'cleanup_on_close' }
67
+
68
+ include_examples 'command'
69
+ end
70
+
71
+ context 'use_byte_range' do
72
+ let(:arg_value) { Faker::Number.between(0, 1) }
73
+ let(:argument) { 'use_byte_range' }
74
+
75
+ include_examples 'command'
76
+ end
77
+
78
+ context 'file_length' do
79
+ let(:arg_value) { Faker::Number.between(0, 1) }
80
+ let(:argument) { 'file_length' }
81
+
82
+ include_examples 'command'
83
+ end
84
+
85
+ context 'use_system_time' do
86
+ let(:arg_value) { Faker::Number.between(0, 1) }
87
+ let(:argument) { 'use_system_time' }
88
+
89
+ include_examples 'command'
90
+ end
91
+
92
+ context 'offset_time' do
93
+ let(:arg_value) { Faker::Number.between(0, 1) }
94
+ let(:argument) { 'offset_time' }
95
+
96
+ include_examples 'command'
97
+ end
98
+
99
+ context 'start_offset' do
100
+ let(:arg_value) { Faker::Number.between(0, 1) }
101
+ let(:argument) { 'start_offset' }
102
+
103
+ include_examples 'command'
104
+ end
105
+ end
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Commands::Create do
6
+ let(:command) { Evostream::Commands::Create.new(cmd) }
7
+
8
+ context 'local_stream_names' do
9
+ let(:arg_value) { Faker::Pokemon.name }
10
+ let(:argument) { 'local_stream_names' }
11
+
12
+ include_examples 'command'
13
+ end
14
+
15
+ context 'target_folder' do
16
+ let(:arg_value) { Faker::Pokemon.name }
17
+ let(:argument) { 'target_folder' }
18
+
19
+ include_examples 'command'
20
+ end
21
+
22
+ context 'bandwidths' do
23
+ let(:arg_value) { Faker::Number.between(1, 99) }
24
+ let(:argument) { 'bandwidths' }
25
+
26
+ include_examples 'command'
27
+ end
28
+
29
+ context 'group_name' do
30
+ let(:arg_value) { Faker::Pokemon.name }
31
+ let(:argument) { 'group_name' }
32
+
33
+ include_examples 'command'
34
+ end
35
+
36
+ context 'playlist_type' do
37
+ let(:arg_value) { %w(appending rolling).sample }
38
+ let(:argument) { 'playlist_type' }
39
+
40
+ include_examples 'command'
41
+ end
42
+
43
+ context 'playlist_length' do
44
+ let(:arg_value) { Faker::Number.between(1, 99) }
45
+ let(:argument) { 'playlist_length' }
46
+
47
+ include_examples 'command'
48
+ end
49
+
50
+ context 'chunk_length' do
51
+ let(:arg_value) { Faker::Number.between(1, 99) }
52
+ let(:argument) { 'chunk_length' }
53
+
54
+ include_examples 'command'
55
+ end
56
+
57
+ context 'chunk_on_idr', broken: true do
58
+ let(:arg_value) { Faker::Number.between(0, 1) }
59
+ let(:argument) { 'chunk_on_idr' }
60
+
61
+ include_examples 'command'
62
+ end
63
+
64
+ context 'keep_alive' do
65
+ let(:arg_value) { Faker::Number.between(0, 1) }
66
+ let(:argument) { 'keep_alive' }
67
+
68
+ include_examples 'command'
69
+ end
70
+
71
+ context 'overwrite_destination' do
72
+ let(:arg_value) { Faker::Number.between(0, 1) }
73
+ let(:argument) { 'overwrite_destination' }
74
+
75
+ include_examples 'command'
76
+ end
77
+
78
+ context 'stale_retention_count' do
79
+ let(:arg_value) { Faker::Number.between(1, 99) }
80
+ let(:argument) { 'stale_retention_count' }
81
+
82
+ include_examples 'command'
83
+ end
84
+
85
+ context 'cleanup_destination' do
86
+ let(:arg_value) { Faker::Number.between(0, 1) }
87
+ let(:argument) { 'cleanup_destination' }
88
+
89
+ include_examples 'command'
90
+ end
91
+
92
+ context 'dynamic_profile' do
93
+ let(:arg_value) { Faker::Number.between(0, 1) }
94
+ let(:argument) { 'dynamic_profile' }
95
+
96
+ include_examples 'command'
97
+ end
98
+ end
@@ -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::Destroy.new(cmd) }
7
+
8
+ context 'id' do
9
+ let(:arg_value) { Faker::Number.between(1, 99) }
10
+ let(:argument) { 'id' }
11
+
12
+ include_examples 'command'
13
+ end
14
+
15
+ context 'remove_hls_hds_files' do
16
+ let(:arg_value) { Faker::Number.between(0, 1) }
17
+ let(:argument) { 'remove_hls_hds_files' }
18
+
19
+ include_examples 'command'
20
+ end
21
+
22
+ context 'group_name' do
23
+ let(:arg_value) { Faker::Pokemon.name }
24
+ let(:argument) { 'group_name' }
25
+
26
+ include_examples 'command'
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream::Events::Event do
6
+ it 'has a three childern class' do
7
+ expect(Evostream::Events::Event.descendants.count).to eql(3)
8
+ end
9
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Evostream do
6
+ it 'has a version number' do
7
+ expect(Evostream::VERSION).not_to be nil
8
+ end
9
+
10
+ it 'has a gem name' do
11
+ expect(Evostream::GEM_NAME).not_to be nil
12
+ end
13
+
14
+ it 'has a authors' do
15
+ expect(Evostream::AUTHORS).not_to be nil
16
+ end
17
+
18
+ it 'has a emails' do
19
+ expect(Evostream::EMAILS).not_to be nil
20
+ end
21
+
22
+ it 'has a license' do
23
+ expect(Evostream::LICENSE).not_to be nil
24
+ end
25
+
26
+ it 'has a summary' do
27
+ expect(Evostream::SUMMARY).not_to be nil
28
+ end
29
+
30
+ it 'has a description' do
31
+ expect(Evostream::DESCRIPTION).not_to be nil
32
+ end
33
+
34
+ it 'has a homepage' do
35
+ expect(Evostream::HOMEPAGE).not_to be nil
36
+ end
37
+
38
+ it 'has a post install message' do
39
+ expect(Evostream::POST_INSTALL).not_to be nil
40
+ end
41
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support'
4
+ require 'evostream_event'
5
+ require 'faker'
6
+
7
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
8
+
9
+ Dir['spec/support/**/*.rb'].each do |f|
10
+ require File.expand_path(f)
11
+ end
12
+
13
+ RSpec.configure do |config|
14
+ config.expect_with :rspec do |c|
15
+ c.syntax = :expect
16
+ end
17
+
18
+ # Exclude spec broken
19
+ config.filter_run_excluding broken: true
20
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/string'
4
+
5
+ RSpec.shared_examples 'command' do
6
+ let(:cmd) { { argument => arg_value } }
7
+ let(:result) { "#{argument.camelize(:lower)}=#{arg_value} " }
8
+
9
+ it { expect(command.instance_variable_get(:@command)[0]).to eql(result) }
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evostream-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.42
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VAILLANT Jeremy
@@ -208,23 +208,8 @@ dependencies:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
210
  version: 1.7.3
211
- - !ruby/object:Gem::Dependency
212
- name: activesupport
213
- requirement: !ruby/object:Gem::Requirement
214
- requirements:
215
- - - "~>"
216
- - !ruby/object:Gem::Version
217
- version: '4.2'
218
- type: :runtime
219
- prerelease: false
220
- version_requirements: !ruby/object:Gem::Requirement
221
- requirements:
222
- - - "~>"
223
- - !ruby/object:Gem::Version
224
- version: '4.2'
225
- description: 'Manage evostream.
226
-
227
- '
211
+ description: |
212
+ Manage evostream.
228
213
  email:
229
214
  - jeremy@dazzl.tv
230
215
  executables: []
@@ -247,6 +232,15 @@ files:
247
232
  - lib/evostream/info.rb
248
233
  - lib/evostream/service.rb
249
234
  - lib/evostream_event.rb
235
+ - lib/generators/evostream/initializer_generator.rb
236
+ - spec/evostream/commands/create_dash_spec.rb
237
+ - spec/evostream/commands/create_hls_spec.rb
238
+ - spec/evostream/commands/create_spec.rb
239
+ - spec/evostream/commands/destroy_spec.rb
240
+ - spec/evostream/events_spec.rb
241
+ - spec/evostream/evostream_event_spec.rb
242
+ - spec/spec_helper.rb
243
+ - spec/support/commands.rb
250
244
  homepage: https://github.com/dazzl-tv/evostream-event
251
245
  licenses:
252
246
  - MIT
@@ -279,12 +273,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
279
273
  version: '0'
280
274
  required_rubygems_version: !ruby/object:Gem::Requirement
281
275
  requirements:
282
- - - ">"
276
+ - - ">="
283
277
  - !ruby/object:Gem::Version
284
- version: 1.3.1
278
+ version: '0'
285
279
  requirements: []
286
280
  rubyforge_project:
287
- rubygems_version: 2.5.1
281
+ rubygems_version: 2.4.5
288
282
  signing_key:
289
283
  specification_version: 4
290
284
  summary: EvoStream Event