bitmovin-ruby 0.8.1 → 0.9.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 990f40c9e63eb7c4aa70d05c10f0e12ac03b49df
4
- data.tar.gz: 179c524a4a9da6125a26916914d73fc7759eb6a2
3
+ metadata.gz: c7e7c96a8da24343b8ede740f706e42839075e9b
4
+ data.tar.gz: 546d38ea2aee86c1924a92fef236d45a29819e2e
5
5
  SHA512:
6
- metadata.gz: c6be1145f2647573a68a20430c3bc1c6bed9f0f122dab32d33006cbf41874de5bffa1f7b85d81dd13a2a479ef838d1bce5274496c6e0bb2424716d5fd6b4be04
7
- data.tar.gz: 20bdb16e8a9bd40825adeff5874664a9f9c7e3ea0b53e3e3b122ae77332d6d142a16eb841a6e7208a5f1d89785cb54ae9817ca99a3e92ffdd0bc5a43a6a9189b
6
+ metadata.gz: b1099f19e81c0280f155026a2dd5bc8545d779fac06394baffb8ebc56ac6cfd800df5a9a5faa9c3aa4ea033715266e5b9695d2474d194a48e093da85f576de4f
7
+ data.tar.gz: 458c436ee2795b0cdbb5c20bdaa0550cc95e3429cd78d6a18cc22abbc56fb14efa1b150ccf94342001adc0fe5940e2d132a82affef1b8d1cbaa96bc0bf493d6a
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/
9
10
  test.rb
10
11
  test-manifest.rb
11
12
  test_encoding.rb
data/.travis.yml CHANGED
@@ -2,4 +2,4 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.3.0
5
- before_install: gem install bundler -v 1.13.6
5
+ before_install: gem install bundler -v 2.2.11
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitmovin-ruby (0.8.1)
4
+ bitmovin-ruby (0.9.0)
5
5
  activesupport (>= 4.0.0)
6
6
  faraday (~> 0.11.0)
7
7
  faraday_middleware (~> 0.11.0)
@@ -18,16 +18,17 @@ GEM
18
18
  tzinfo (~> 1.1)
19
19
  addressable (2.6.0)
20
20
  public_suffix (>= 2.0.2, < 4.0)
21
- codecov (0.1.14)
21
+ codecov (0.2.5)
22
+ colorize
22
23
  json
23
24
  simplecov
24
- url
25
25
  coderay (1.1.2)
26
+ colorize (0.8.1)
26
27
  concurrent-ruby (1.1.5)
27
28
  crack (0.4.3)
28
29
  safe_yaml (~> 1.0.0)
29
30
  diff-lcs (1.3)
30
- docile (1.3.2)
31
+ docile (1.3.5)
31
32
  faraday (0.11.0)
32
33
  multipart-post (>= 1.2, < 3)
33
34
  faraday_middleware (0.11.0.1)
@@ -69,7 +70,7 @@ GEM
69
70
  coderay (~> 1.1.0)
70
71
  method_source (~> 0.9.0)
71
72
  public_suffix (3.1.1)
72
- rake (10.5.0)
73
+ rake (13.0.1)
73
74
  rb-fsevent (0.10.3)
74
75
  rb-inotify (0.10.0)
75
76
  ffi (~> 1.0)
@@ -91,7 +92,7 @@ GEM
91
92
  ruby_dep (1.5.0)
92
93
  safe_yaml (1.0.5)
93
94
  shellany (0.0.1)
94
- simplecov (0.17.0)
95
+ simplecov (0.17.1)
95
96
  docile (~> 1.1)
96
97
  json (>= 1.8, < 3)
97
98
  simplecov-html (~> 0.10.0)
@@ -100,7 +101,6 @@ GEM
100
101
  thread_safe (0.3.6)
101
102
  tzinfo (1.2.5)
102
103
  thread_safe (~> 0.1)
103
- url (0.3.2)
104
104
  webmock (3.6.2)
105
105
  addressable (>= 2.3.6)
106
106
  crack (>= 0.3.2)
@@ -112,15 +112,15 @@ PLATFORMS
112
112
  DEPENDENCIES
113
113
  activesupport (= 4.2.0)
114
114
  bitmovin-ruby!
115
- bundler (~> 1.13)
115
+ bundler (~> 2.2.11)
116
116
  codecov
117
117
  guard-rspec
118
118
  pry
119
- rake (~> 10.0)
119
+ rake (~> 13.0)
120
120
  rspec (~> 3.0)
121
121
  rspec-collection_matchers
122
122
  simplecov
123
123
  webmock
124
124
 
125
125
  BUNDLED WITH
126
- 1.17.3
126
+ 2.2.11
data/README.md CHANGED
@@ -29,7 +29,7 @@ Please check out our examples at [examples](https://github.com/bitmovin/bitmovin
29
29
 
30
30
  ## Development
31
31
 
32
- 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.
32
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
33
33
 
34
34
  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).
35
35
 
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency "httpclient", "~> 2.8.3", ">= 2.8.3"
26
26
  spec.add_dependency "activesupport", ">= 4.0.0"
27
27
  spec.add_dependency "faraday_middleware", "~> 0.11.0"
28
- spec.add_development_dependency "bundler", "~> 1.13"
29
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "bundler", "~> 2.2.11"
29
+ spec.add_development_dependency "rake", "~> 13.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
31
31
  end
@@ -11,7 +11,8 @@ require 'bitmovin/encoding/encodings/stream_input'
11
11
  require 'bitmovin/encoding/encodings/encoding_task'
12
12
  require 'bitmovin/encoding/encodings/list'
13
13
  require 'bitmovin/encoding/encodings/stream_list'
14
- require 'bitmovin/encoding/encodings/stream_list'
14
+ require 'bitmovin/encoding/encodings/input_streams/ingest'
15
+ require 'bitmovin/encoding/encodings/input_streams/trimming/time_based'
15
16
  require 'bitmovin/encoding/encodings/muxing_list'
16
17
  require 'bitmovin/encoding/encodings/muxings/muxing_resource'
17
18
  require 'bitmovin/encoding/encodings/muxings/fmp4_muxing'
@@ -0,0 +1,44 @@
1
+ module Bitmovin::Encoding::Encodings::InputStreams
2
+ class Ingest < Bitmovin::Resource
3
+ attr_accessor :encoding_id, :input_id, :input_path, :selection_mode, :position,
4
+ :name, :description, :created_at, :modified_at, :errors
5
+
6
+ def initialize(encoding_id, hash = {})
7
+ hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
8
+ @encoding_id = encoding_id
9
+
10
+ init_instance(File.join("/v1/encoding/encodings/", encoding_id, "input-streams/ingest"))
11
+ super(hash)
12
+
13
+ @input_id = hash[:input_id]
14
+ @input_path = hash[:input_path]
15
+ @selection_mode = hash[:selection_mode]
16
+ @position = hash[:position]
17
+
18
+ @errors = []
19
+ end
20
+
21
+ def valid?
22
+ validate!
23
+ @errors.empty?
24
+ end
25
+
26
+ def invalid?
27
+ !valid?
28
+ end
29
+
30
+ def errors
31
+ @errors
32
+ end
33
+
34
+ def validate!
35
+ @errors << "input_id cannot be blank" if @input_id.blank?
36
+ @errors << "input_path cannot be blank" if @input_path.blank?
37
+ @errors << "selection_mode cannot be blank" if @selection_mode.blank?
38
+
39
+ if @position.blank? && @selection_mode != "AUTO"
40
+ @errors << "position cannot be blank if selection_mode is not AUTO"
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,48 @@
1
+ module Bitmovin::Encoding::Encodings
2
+ module InputStreams
3
+ module Trimming
4
+ class TimeBased < Bitmovin::Resource
5
+ attr_accessor :encoding_id, :input_stream_id, :offset, :duration,
6
+ :name, :description, :created_at, :modified_at, :errors
7
+
8
+ def initialize(encoding_id, hash = {})
9
+ hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
10
+ @encoding_id = encoding_id
11
+
12
+ init_instance(File.join("/v1/encoding/encodings/", encoding_id, "input-streams/trimming/time-based"))
13
+ super(hash)
14
+
15
+ @offset = hash[:offset]
16
+ @duration = hash[:duration]
17
+ @input_stream_id = hash[:input_stream_id]
18
+
19
+ @errors = []
20
+ end
21
+
22
+ def save!
23
+ super if valid?
24
+ end
25
+
26
+ def invalid?
27
+ !valid?
28
+ end
29
+
30
+ def valid?
31
+ validate!
32
+ @errors.empty?
33
+ end
34
+
35
+ def validate!
36
+ @errors = []
37
+
38
+ @errors << "Input Stream Id must be set" unless @input_stream_id
39
+ @errors << "Offset must be set" unless @offset
40
+ @errors << "Duration must be set" unless @duration
41
+ @errors << "Duration must be greater than zero" if @duration.to_i <= 0
42
+
43
+ @errors.flatten!
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -10,7 +10,7 @@ module Bitmovin::Encoding::Encodings
10
10
  end
11
11
 
12
12
  attr_accessor :encoding_id, :stream_id
13
- attr_accessor :input_id, :input_path, :selection_mode, :position
13
+ attr_accessor :input_id, :input_path, :selection_mode, :position, :input_stream_id
14
14
 
15
15
  def valid?
16
16
  validate!
@@ -29,10 +29,10 @@ module Bitmovin::Encoding::Encodings
29
29
  collect_attributes.to_json(args)
30
30
  end
31
31
 
32
- private
32
+ private
33
33
  def collect_attributes
34
34
  val = Hash.new
35
- [:input_id, :input_path, :selection_mode, :position].each do |name|
35
+ [:input_id, :input_path, :selection_mode, :position, :input_stream_id].each do |name|
36
36
  json_name = ActiveSupport::Inflector.camelize(name.to_s, false)
37
37
  value = instance_variable_get("@#{name}")
38
38
  if (!value.nil?)
@@ -42,6 +42,8 @@ module Bitmovin::Encoding::Encodings
42
42
  val
43
43
  end
44
44
  def validate!
45
+ return unless @input_stream_id.blank?
46
+
45
47
  @errors << "input_id cannot be blank" if @input_id.blank?
46
48
  @errors << "input_path cannot be blank" if @input_path.blank?
47
49
  @errors << "selection_mode cannot be blank" if @selection_mode.blank?
@@ -1,3 +1,3 @@
1
1
  module Bitmovin
2
- VERSION = "0.8.1"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitmovin-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Hoelbling-Inzko
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2021-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -78,28 +78,28 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.13'
81
+ version: 2.2.11
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.13'
88
+ version: 2.2.11
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: rake
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '10.0'
95
+ version: '13.0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '10.0'
102
+ version: '13.0'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rspec
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -147,6 +147,8 @@ files:
147
147
  - lib/bitmovin/encoding/codec_configurations/vp9_configuration.rb
148
148
  - lib/bitmovin/encoding/encodings.rb
149
149
  - lib/bitmovin/encoding/encodings/encoding_task.rb
150
+ - lib/bitmovin/encoding/encodings/input_streams/ingest.rb
151
+ - lib/bitmovin/encoding/encodings/input_streams/trimming/time_based.rb
150
152
  - lib/bitmovin/encoding/encodings/list.rb
151
153
  - lib/bitmovin/encoding/encodings/muxing_list.rb
152
154
  - lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb
@@ -213,7 +215,7 @@ homepage: https://github.com/bitmovin/bitmovin-ruby
213
215
  licenses:
214
216
  - MIT
215
217
  metadata: {}
216
- post_install_message:
218
+ post_install_message:
217
219
  rdoc_options: []
218
220
  require_paths:
219
221
  - lib
@@ -228,9 +230,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
230
  - !ruby/object:Gem::Version
229
231
  version: '0'
230
232
  requirements: []
231
- rubyforge_project:
233
+ rubyforge_project:
232
234
  rubygems_version: 2.5.2.3
233
- signing_key:
235
+ signing_key:
234
236
  specification_version: 4
235
237
  summary: Api Client for the Bitmovin API
236
238
  test_files: []