gir_ffi-gst 0.0.3 → 0.0.4

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: eb63e861cbd4106f39dcc66c75f1c091ef3417c1
4
- data.tar.gz: e25fbe907c9e4b3d99762f6a2af9f31766c02358
3
+ metadata.gz: eb7d9d7baae4bedf0270eda448b3b7eee067aced
4
+ data.tar.gz: 7b56cc9f8e8adc5cd77449d07bd4a26803b402d3
5
5
  SHA512:
6
- metadata.gz: 486f997a90a3fc1615d987edd02d9c4ae1d00a2ccf1ea90a3fd38b65973d693c0fec7d9d961b02322880ae68386e57b420c3ad58d131613eb4c2d9de0ee805a8
7
- data.tar.gz: 6100388ff22c630a0cbca084acef8fb942da5417baa2ce4854d2dbe3a3e5bcb0b18dfcbe15f90d4ac2313068a0c7a4382a7e22711d53edd49614e96b73b93496
6
+ metadata.gz: 0ac3a92bc6f7f38737f5c68d706e0c999d29e4af6f8ce0fe2f21d7a728bd8c6229de701b2f7116e39eda1d926ced155b282ed4d0babea56cfcfa4771917c880e
7
+ data.tar.gz: f2f314086576b87b822f3bd26ffc03ef7264e02e8b454ef38b4c1ceaf4bb9aa9bf39ba598f6f76203a88859ce6192c5162e9008bd245b01c93fbcf1d19eef819
data/README.md CHANGED
@@ -16,7 +16,7 @@ GirFFI-based bindings for GStreamer
16
16
 
17
17
  ## License
18
18
 
19
- Copyright © 2015, [Matijs van Zuijlen](http://www.matijs.net/)
19
+ Copyright © 2015–2016, [Matijs van Zuijlen](http://www.matijs.net/)
20
20
 
21
21
  GirFFI-Gst is free software, distributed under the terms of the GNU Lesser
22
22
  General Public License, version 2.1 or later. See the file COPYING.LIB for more
@@ -0,0 +1,28 @@
1
+ module GirFFIGst
2
+ # Override init to automatically use ARGV as its argument.
3
+ module AutoArgv
4
+ def self.included(base)
5
+ base.extend ClassMethods
6
+ class << base
7
+ alias_method :init_without_auto_argv, :init
8
+ alias_method :init, :init_with_auto_argv
9
+ end
10
+ end
11
+
12
+ # Implementation of class methods for AutoArgv
13
+ module ClassMethods
14
+ def init_with_auto_argv
15
+ remaining = init_without_auto_argv([$PROGRAM_NAME, *ARGV]).to_a
16
+ remaining.shift
17
+ ARGV.replace remaining
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ # Overrides for Gst module functions
24
+ module Gst
25
+ setup_method 'init'
26
+
27
+ include GirFFIGst::AutoArgv
28
+ end
@@ -7,7 +7,7 @@ module Gst
7
7
  remove_method :get_property
8
8
 
9
9
  def get_property name
10
- pspec = type_class.find_property name
10
+ pspec = object_class.find_property name
11
11
  gvalue = GObject::Value.for_gtype pspec.value_type
12
12
  Gst::Lib.gst_child_proxy_get_property self, name, gvalue
13
13
  gvalue
@@ -4,9 +4,8 @@ module Gst
4
4
  include Enumerable
5
5
 
6
6
  def each
7
- prc = proc { |item, _ud| yield item.get_value }
8
7
  resync
9
- foreach(prc, nil)
8
+ foreach { |item, _ud| yield item.get_value }
10
9
  end
11
10
  end
12
11
  end
data/lib/gir_ffi-gst.rb CHANGED
@@ -2,6 +2,7 @@ require 'gir_ffi'
2
2
 
3
3
  GirFFI.setup :Gst
4
4
 
5
+ require_relative 'gir_ffi-gst/base'
5
6
  require_relative 'gir_ffi-gst/bin'
6
7
  require_relative 'gir_ffi-gst/child_proxy'
7
8
  require_relative 'gir_ffi-gst/element'
data/test/test_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  require 'minitest/autorun'
2
2
 
3
3
  require 'gir_ffi-gst'
4
- Gst.init []
4
+ Gst.init
@@ -0,0 +1,26 @@
1
+ require_relative '../test_helper'
2
+
3
+ describe Gst do
4
+ describe '::init' do
5
+ before do
6
+ module DummyGst
7
+ def self.init arr
8
+ ['baz', 'qux', 'zonk']
9
+ end
10
+
11
+ include GirFFIGst::AutoArgv
12
+ end
13
+ end
14
+
15
+ it 'does not accept any arguments' do
16
+ assert_raises(ArgumentError) { DummyGst.init 1, ['foo'] }
17
+ assert_raises(ArgumentError) { DummyGst.init ['foo'] }
18
+ end
19
+
20
+ it 'replaces ARGV with the tail of the result of the original init function' do
21
+ ARGV.replace ['foo', 'bar']
22
+ DummyGst.init
23
+ assert_equal ['qux', 'zonk'], ARGV.to_a
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi-gst
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-12 00:00:00.000000000 Z
11
+ date: 2016-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gir_ffi
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 0.8.2
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: 0.10.0
19
+ version: 0.9.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 0.8.2
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: 0.10.0
26
+ version: 0.9.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: minitest
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -83,12 +77,14 @@ files:
83
77
  - README.md
84
78
  - Rakefile
85
79
  - lib/gir_ffi-gst.rb
80
+ - lib/gir_ffi-gst/base.rb
86
81
  - lib/gir_ffi-gst/bin.rb
87
82
  - lib/gir_ffi-gst/child_proxy.rb
88
83
  - lib/gir_ffi-gst/element.rb
89
84
  - lib/gir_ffi-gst/iterator.rb
90
85
  - test/end_to_end/bin_test.rb
91
86
  - test/test_helper.rb
87
+ - test/unit/base_test.rb
92
88
  - test/unit/bin_test.rb
93
89
  - test/unit/child_proxy_test.rb
94
90
  - test/unit/element_test.rb
@@ -113,13 +109,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
109
  version: '0'
114
110
  requirements: []
115
111
  rubyforge_project:
116
- rubygems_version: 2.5.0
112
+ rubygems_version: 2.4.5.1
117
113
  signing_key:
118
114
  specification_version: 4
119
115
  summary: GirFFI-based bindings for GStreamer
120
116
  test_files:
121
117
  - test/test_helper.rb
122
118
  - test/unit/element_test.rb
119
+ - test/unit/base_test.rb
123
120
  - test/unit/child_proxy_test.rb
124
121
  - test/unit/bin_test.rb
125
122
  - test/unit/iterator_test.rb