gir_ffi-gtk 0.12.1 → 0.13.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
  SHA256:
3
- metadata.gz: 4f0d5f7430949ba713199b08645cfa3e7acfad712b98fd56e0819b376b4d6a0f
4
- data.tar.gz: dcab574ec9e415212c93ff70233c5c05f5c040f35da17780ea6680270d426fae
3
+ metadata.gz: 3e84a1c1fb530cf07ca0c685de398c075279e5f0aad37d5b99d1cb1828baec9c
4
+ data.tar.gz: 92bb036950992713f0fe8ae0a46f0cffa9ec294581597f2eae19cfb19a85aa63
5
5
  SHA512:
6
- metadata.gz: 821b899f98a3f04f939f1de5a17eeaa4b1d02729a9816524b71d920a2fc755de2a9619ad0ed7e21d53d3d92a9a6051d29724d350c9c12ccbd27951170a7f2158
7
- data.tar.gz: '09bd5f273f0edac01f2072fec7053c27994efc3d4e1e55befe456a177f7888c864c229b75709ee2d915f8896a903b9b521bb5745078608dc8bd175c7e9b0a3ed'
6
+ metadata.gz: df68feccf33c8cba1025cd92448b3dd33535364c1abcbdec3b79cb9341d02aa14f8d165a3702f675d180631d013fa7385df374999957a480fbdfb7cd3f9cd444
7
+ data.tar.gz: 39e23cb92615d3bd685474147843540dc9cbaf25d2c4a127e939a00d773205696bdaefcbe01cbc86174c99c94a3d3ccb8fecde8766c98a424fc4f54e13345302
@@ -3,6 +3,11 @@
3
3
  All notable changes to this project will be documented in this file. See the
4
4
  Git log for all changes.
5
5
 
6
+ ## 0.13.0 / 2018-09-08
7
+
8
+ * Drop support for Ruby 2.1
9
+ * Depend on GirFFI 0.13.0
10
+
6
11
  ## 0.12.1 / 2018-05-31
7
12
 
8
13
  * Restore support for Ruby 2.1 and 2.2
@@ -24,21 +29,21 @@ Git log for all changes.
24
29
 
25
30
  * Propagate exceptions from callbacks during event loops
26
31
  * Add new overrides:
27
- * for Gtk::Container
28
- * for Gtk::TreeViewColumn
29
- * for Gtk::TreeStore
30
- * for Gtk::ListStore
31
- * for Gtk::TargetEntry.new
32
- * for GtkBuilder#connect_signals
32
+ * for `Gtk::Container`
33
+ * for `Gtk::TreeViewColumn`
34
+ * for `Gtk::TreeStore`
35
+ * for `Gtk::ListStore`
36
+ * for `Gtk::TargetEntry.new`
37
+ * for `GtkBuilder#connect_signals`
33
38
  * Depend on GirFFI 0.9.0
34
39
  * Use GirFFI's new way of handling callback parameters and user data and
35
40
  destroy notifier handling
36
41
 
37
42
  ## 0.8.1 / 2015-12-02
38
43
 
39
- * Add override for Gtk::RadioAction#set_group
40
- * Add Gtk::Application example (thanks, cedlemo)
41
- * Add and update WebKit examples
44
+ * Add override for `Gtk::RadioAction#set_group`
45
+ * Add `Gtk::Application` example (thanks, cedlemo)
46
+ * Add and update `WebKit` examples
42
47
 
43
48
  ## 0.8.0 / 2015-09-20
44
49
 
@@ -48,18 +53,18 @@ Git log for all changes.
48
53
  ## 0.7.2 / 2014-09-22
49
54
 
50
55
  * Require at least Ruby 1.9.3
51
- * Add overrides for Gtk::TreePath
52
- * Add overrides for Gtk::MessageDialog.new
53
- * Make other Ruby threads run during Gtk.main loop
56
+ * Add overrides for `Gtk::TreePath`
57
+ * Add overrides for `Gtk::MessageDialog.new`
58
+ * Make other Ruby threads run during `Gtk.main` loop
54
59
  * Update dependencies
55
60
  * Update examples
56
61
 
57
62
  ## 0.7.1 / 2014-03-25
58
63
 
59
- * Fix Gtk::Builder#connect_signals_full by updating dependency on GirFFI
60
- * Only override Gtk::Menu#popup if needed
64
+ * Fix `Gtk::Builder#connect_signals_full` by updating dependency on GirFFI
65
+ * Only override `Gtk::Menu#popup` if needed
61
66
  * Test both Gtk+ 2 and 3
62
- * Provide constructors for Gtk::RadioButton if needed
67
+ * Provide constructors for `Gtk::RadioButton` if needed
63
68
 
64
69
  ## 0.7.0 / 2014-01-11
65
70
 
@@ -75,8 +80,8 @@ Git log for all changes.
75
80
 
76
81
  ## 0.4.1 / 2012-09-22
77
82
 
78
- * New TreeView example (thanks, Kasper Johansen)
79
- * Implement Gtk::Menu#popup
83
+ * New `TreeView` example (thanks, Kasper Johansen)
84
+ * Implement `Gtk::Menu#popup`
80
85
  * Update dependency on GirFFI so interfaces can wrap pointers
81
86
 
82
87
  ## 0.4.0 / 2012-08-24
@@ -57,8 +57,8 @@ end
57
57
 
58
58
  # Overrides for Gtk module functions
59
59
  module Gtk
60
- setup_method 'init'
61
- setup_method 'main'
60
+ setup_method! 'init'
61
+ setup_method! 'main'
62
62
 
63
63
  include GirFFIGtk::AutoArgv
64
64
  include GirFFIGtk::MainLoopOverride
@@ -4,7 +4,7 @@ Gtk.load_class :Builder
4
4
  module Gtk
5
5
  # Overrides for GtkBuilder
6
6
  class Builder
7
- setup_instance_method :add_from_string
7
+ setup_instance_method! :add_from_string
8
8
 
9
9
  def add_from_string_with_auto_length(buffer)
10
10
  add_from_string_without_auto_length buffer, buffer.length
@@ -13,7 +13,7 @@ module Gtk
13
13
  alias add_from_string_without_auto_length add_from_string
14
14
  alias add_from_string add_from_string_with_auto_length
15
15
 
16
- setup_instance_method :connect_signals_full
16
+ setup_instance_method! :connect_signals_full
17
17
  remove_method :connect_signals
18
18
 
19
19
  AFTER_FLAG = GObject::ConnectFlags[:after]
@@ -11,13 +11,13 @@ module Gtk
11
11
  end
12
12
  end
13
13
 
14
- setup_instance_method :child_get_property
14
+ setup_instance_method! :child_get_property
15
15
 
16
16
  def child_get_property_with_override(widget, property_name)
17
17
  param_spec = object_class.find_child_property property_name
18
18
  unless param_spec
19
- raise ArgumentError,
20
- "child property named '#{property_name}' not found in #{self.class}"
19
+ raise(ArgumentError,
20
+ "child property named '#{property_name}' not found in #{self.class}")
21
21
  end
22
22
  gtype = param_spec.value_type
23
23
  gvalue = GObject::Value.for_gtype gtype
@@ -4,8 +4,8 @@ Gtk.load_class :ListStore
4
4
  module Gtk
5
5
  # Overrides for GtkListStore
6
6
  class ListStore
7
- setup_method :newv
8
- setup_instance_method :set_valuesv
7
+ setup_method! :newv
8
+ setup_instance_method! :set_valuesv
9
9
 
10
10
  alias old_initialize initialize
11
11
  alias initialize initializev
@@ -4,9 +4,9 @@ Gtk.load_class :TreeStore
4
4
  module Gtk
5
5
  # Overrides for GtkTreeStore
6
6
  class TreeStore
7
- setup_method :newv
8
- setup_instance_method :set_valuesv
9
- setup_instance_method :insert_with_valuesv
7
+ setup_method! :newv
8
+ setup_instance_method! :set_valuesv
9
+ setup_instance_method! :insert_with_valuesv
10
10
 
11
11
  alias old_initialize initialize
12
12
  alias initialize initializev
@@ -4,7 +4,7 @@ Gtk.load_class :TargetEntry
4
4
  module Gtk
5
5
  # Overrides for GtkTargetEntry
6
6
  class TargetEntry
7
- setup_method :new
7
+ setup_method! :new
8
8
 
9
9
  def initialize_with_flags_conversion(target, flags, info)
10
10
  native_flags = Gtk::TargetFlags.to_native flags, nil
@@ -4,11 +4,11 @@ Gtk.load_class :ListStore
4
4
  module Gtk
5
5
  # Overrides for GtkListStore
6
6
  class ListStore
7
- setup_instance_method :insert_with_valuesv
7
+ setup_instance_method! :insert_with_valuesv
8
8
 
9
9
  alias insert_with_values insert_with_valuesv
10
10
 
11
- setup_instance_method :set_value
11
+ setup_instance_method! :set_value
12
12
 
13
13
  def set_value_with_value_conversion(iter, column, value)
14
14
  value = GObject::Value.for_gtype get_column_type(column) if value.nil?
@@ -26,7 +26,7 @@ module Gtk
26
26
  end
27
27
 
28
28
  if Gtk::MAJOR_VERSION == 2
29
- setup_instance_method 'get_indices'
29
+ setup_instance_method! 'get_indices'
30
30
  remove_method :get_indices
31
31
 
32
32
  def get_indices
@@ -4,7 +4,7 @@ Gtk.load_class :TreeViewColumn
4
4
  module Gtk
5
5
  # Overrides for Gtk::TreeViewColumn
6
6
  class TreeViewColumn
7
- setup_method :new
7
+ setup_method! :new
8
8
 
9
9
  def self.new_with_attributes(*args)
10
10
  obj = allocate
@@ -2,26 +2,26 @@ require 'test_helper'
2
2
 
3
3
  class CallbackTestException < RuntimeError; end
4
4
 
5
- describe "An exception in a callback" do
6
- describe "for signals" do
5
+ describe 'An exception in a callback' do
6
+ describe 'for signals' do
7
7
  let(:object) { Gtk::Window.new :toplevel }
8
8
 
9
9
  before do
10
- object.signal_connect "destroy" do
11
- raise CallbackTestException, "Boom"
10
+ object.signal_connect 'destroy' do
11
+ raise CallbackTestException, 'Boom'
12
12
  end
13
13
  end
14
14
 
15
- describe "when the signal is emitted synchronously" do
16
- it "raises an error" do
17
- lambda { GObject.signal_emit object, "destroy" }.must_raise CallbackTestException
15
+ describe 'when the signal is emitted synchronously' do
16
+ it 'raises an error' do
17
+ -> { GObject.signal_emit object, 'destroy' }.must_raise CallbackTestException
18
18
  end
19
19
  end
20
20
 
21
- describe "when the signal is emitted during an event loop" do
22
- it "causes loop run to be terminated with an exception" do
21
+ describe 'when the signal is emitted during an event loop' do
22
+ it 'causes loop run to be terminated with an exception' do
23
23
  GLib.timeout_add GLib::PRIORITY_DEFAULT, 1 do
24
- GObject.signal_emit object, "destroy"
24
+ GObject.signal_emit object, 'destroy'
25
25
  false
26
26
  end
27
27
  # Guard against runaway loop
@@ -37,11 +37,11 @@ describe "An exception in a callback" do
37
37
  end
38
38
  end
39
39
 
40
- describe "for other callbacks" do
41
- describe "when the callback occurs during an event loop" do
42
- it "causes loop run to be terminated with an exception" do
40
+ describe 'for other callbacks' do
41
+ describe 'when the callback occurs during an event loop' do
42
+ it 'causes loop run to be terminated with an exception' do
43
43
  GLib.timeout_add GLib::PRIORITY_DEFAULT, 1 do
44
- raise CallbackTestException, "Boom"
44
+ raise CallbackTestException, 'Boom'
45
45
  end
46
46
  # Guard against runaway loop
47
47
  @guard = GLib.timeout_add(GLib::PRIORITY_DEFAULT, 1000) { Gtk.main_quit }
@@ -56,4 +56,3 @@ describe "An exception in a callback" do
56
56
  end
57
57
  end
58
58
  end
59
-
@@ -1,47 +1,47 @@
1
1
  require 'test_helper'
2
2
 
3
3
  describe Gtk do
4
- describe "::init" do
4
+ describe '::init' do
5
5
  before do
6
6
  module DummyGtk
7
- def self.init arr
8
- ["baz", "qux", "zonk"]
7
+ def self.init(_arr)
8
+ %w(baz qux zonk)
9
9
  end
10
10
 
11
11
  include GirFFIGtk::AutoArgv
12
12
  end
13
13
  end
14
14
 
15
- it "does not take any arguments" do
16
- assert_raises(ArgumentError) { DummyGtk.init 1, ["foo"] }
17
- assert_raises(ArgumentError) { DummyGtk.init ["foo"] }
15
+ it 'does not take any arguments' do
16
+ assert_raises(ArgumentError) { DummyGtk.init 1, ['foo'] }
17
+ assert_raises(ArgumentError) { DummyGtk.init ['foo'] }
18
18
  assert_nothing_raised { DummyGtk.init }
19
19
  end
20
20
 
21
- it "replaces ARGV with the tail of the result of the original init function" do
22
- ARGV.replace ["foo", "bar"]
21
+ it 'replaces ARGV with the tail of the result of the original init function' do
22
+ ARGV.replace %w(foo bar)
23
23
  DummyGtk.init
24
- assert_equal ["qux", "zonk"], ARGV.to_a
24
+ assert_equal %w(qux zonk), ARGV.to_a
25
25
  end
26
26
  end
27
27
 
28
- describe "::main" do
29
- it "allows other threads to run" do
28
+ describe '::main' do
29
+ it 'allows other threads to run' do
30
30
  a = []
31
31
  GLib.timeout_add(GLib::PRIORITY_DEFAULT, 150) { Gtk.main_quit }
32
32
 
33
33
  slow_thread = Thread.new do
34
34
  sleep 0.005
35
- a << "During run"
35
+ a << 'During run'
36
36
  end
37
37
 
38
- a << "Before run"
38
+ a << 'Before run'
39
39
  Gtk.main
40
- a << "After run"
40
+ a << 'After run'
41
41
 
42
42
  slow_thread.join
43
43
 
44
- a.last.must_equal "After run"
44
+ a.last.must_equal 'After run'
45
45
  end
46
46
  end
47
47
  end
@@ -3,23 +3,23 @@ require 'test_helper'
3
3
  describe Gtk::Builder do
4
4
  let(:builder) { Gtk::Builder.new }
5
5
  let(:spec) do
6
- <<-EOS
6
+ <<-XML
7
7
  <interface>
8
8
  <object class="GtkButton" id="foo">
9
9
  <signal handler="on_button_clicked" name="clicked"/>
10
10
  </object>
11
11
  </interface>
12
- EOS
12
+ XML
13
13
  end
14
14
 
15
- describe "#add_from_string" do
15
+ describe '#add_from_string' do
16
16
  it 'takes one string as argument' do
17
17
  builder.add_from_string spec
18
18
  pass
19
19
  end
20
20
  end
21
21
 
22
- describe "#connect_signals" do
22
+ describe '#connect_signals' do
23
23
  before do
24
24
  builder.add_from_string spec
25
25
  end
@@ -46,14 +46,14 @@ describe Gtk::Builder do
46
46
 
47
47
  describe 'with a signal with after flag' do
48
48
  let(:spec) do
49
- <<-EOS
49
+ <<-XML
50
50
  <interface>
51
51
  <object class="GtkButton" id="foo">
52
52
  <signal handler="handler_after" name="clicked" after="true"/>
53
53
  <signal handler="handler_before" name="clicked"/>
54
54
  </object>
55
55
  </interface>
56
- EOS
56
+ XML
57
57
  end
58
58
 
59
59
  it 'connects the handlers in the right order' do
@@ -6,7 +6,7 @@ describe Gtk::Container do
6
6
 
7
7
  describe '#add_with_properties' do
8
8
  before do
9
- container.add_with_properties widget, :'left-attach' => 1
9
+ container.add_with_properties widget, 'left-attach': 1
10
10
  end
11
11
 
12
12
  it 'adds the widget to the container' do
@@ -1,8 +1,8 @@
1
1
  require 'test_helper'
2
2
 
3
3
  # Tests generated methods and functions in the Gtk namespace.
4
- describe "In the generated Gtk module" do
5
- describe "a Gtk::Builder instance" do
4
+ describe 'In the generated Gtk module' do
5
+ describe 'a Gtk::Builder instance' do
6
6
  before do
7
7
  @builder = Gtk::Builder.new
8
8
  @spec = '
@@ -14,31 +14,31 @@ describe "In the generated Gtk module" do
14
14
  '
15
15
  end
16
16
 
17
- it "loads the interface spec" do
17
+ it 'loads the interface spec' do
18
18
  assert_nothing_raised { @builder.add_from_string @spec }
19
19
  end
20
20
 
21
- describe "its #get_object method" do
22
- it "returns objects of the proper class" do
21
+ describe 'its #get_object method' do
22
+ it 'returns objects of the proper class' do
23
23
  @builder.add_from_string @spec
24
- o = @builder.get_object "foo"
24
+ o = @builder.get_object 'foo'
25
25
  assert_instance_of Gtk::Button, o
26
26
  end
27
27
  end
28
28
 
29
- describe "its #connect_signals_full method" do
29
+ describe 'its #connect_signals_full method' do
30
30
  before do
31
31
  @builder.add_from_string @spec
32
32
  end
33
- it "passes arguments correctly" do
33
+ it 'passes arguments correctly' do
34
34
  aa = nil
35
- @builder.connect_signals_full {|*args| aa = args}
35
+ @builder.connect_signals_full { |*args| aa = args }
36
36
  b, o, sn, hn, co, f, ud = aa
37
37
  assert_instance_of Gtk::Builder, b
38
38
  assert_equal b.to_ptr, @builder.to_ptr
39
39
  assert_instance_of Gtk::Button, o
40
- assert_equal "clicked", sn
41
- assert_equal "on_button_clicked", hn
40
+ assert_equal 'clicked', sn
41
+ assert_equal 'on_button_clicked', hn
42
42
  co.must_be_nil
43
43
  assert_equal 0, f
44
44
  ud.wont_be_nil
@@ -46,12 +46,12 @@ describe "In the generated Gtk module" do
46
46
  end
47
47
  end
48
48
 
49
- describe "a Gtk::Window instance" do
49
+ describe 'a Gtk::Window instance' do
50
50
  before do
51
51
  @w = Gtk::Window.new :toplevel
52
52
  end
53
53
 
54
- it "starts with a refcount of 2 (one for us, one for GTK+)" do
54
+ it 'starts with a refcount of 2 (one for us, one for GTK+)' do
55
55
  assert_equal 2, ref_count(@w)
56
56
  end
57
57
  end
@@ -1,18 +1,20 @@
1
1
  require 'test_helper'
2
2
 
3
3
  describe Gtk::Menu do
4
- unless GObjectIntrospection::IRepository.default.find_by_name('Gtk', 'Menu').find_method('popup')
5
- describe "#popup" do
6
- it "delegates to popup_for_device" do
7
- mnu = Gtk::Menu.new
8
- mock(mnu).popup_for_device(nil,
9
- 'parent_menu_shell', 'parent_menu_item',
10
- 'func', 'data',
11
- nil,
12
- 'button', 'activate_time')
13
- mnu.popup('parent_menu_shell', 'parent_menu_item', 'func', 'data',
14
- 'button', 'activate_time')
15
- end
4
+ describe '#popup' do
5
+ it 'delegates to popup_for_device' do
6
+ default_method = GObjectIntrospection::IRepository.default.
7
+ find_by_name('Gtk', 'Menu').
8
+ find_method('popup')
9
+ skip 'No overrided needed for Gtk::Menu#popup' if default_method
10
+ mnu = Gtk::Menu.new
11
+ mock(mnu).popup_for_device(nil,
12
+ 'parent_menu_shell', 'parent_menu_item',
13
+ 'func', 'data',
14
+ nil,
15
+ 'button', 'activate_time')
16
+ mnu.popup('parent_menu_shell', 'parent_menu_item', 'func', 'data',
17
+ 'button', 'activate_time')
16
18
  end
17
19
  end
18
20
  end
@@ -1,16 +1,15 @@
1
1
  require 'test_helper'
2
2
 
3
3
  describe Gtk::MessageDialog do
4
- describe ".new" do
5
- it "creates a Gtk::MessageDialog with the right text" do
4
+ describe '.new' do
5
+ it 'creates a Gtk::MessageDialog with the right text' do
6
6
  dialog = Gtk::MessageDialog.new nil, :modal, :info, :close, 'Foo'
7
7
  dialog.text.must_equal 'Foo'
8
8
  end
9
9
 
10
- it "handles all % characters in the message as literals" do
10
+ it 'handles all % characters in the message as literals' do
11
11
  dialog = Gtk::MessageDialog.new nil, :modal, :info, :close, 'Foo %'
12
12
  dialog.text.must_equal 'Foo %'
13
13
  end
14
14
  end
15
15
  end
16
-
@@ -1,25 +1,26 @@
1
1
  require 'test_helper'
2
2
 
3
3
  describe Gtk::RadioAction do
4
- describe "#get_group" do
5
- it "returns a GLib::SList object" do
4
+ describe '#get_group' do
5
+ it 'returns a GLib::SList object' do
6
6
  action = Gtk::RadioAction.new 'name', 'label', 'tooltip', nil, 1
7
7
  grp = action.get_group
8
8
  grp.must_be_instance_of GLib::SList
9
9
  end
10
10
  end
11
11
 
12
- describe "#set_group" do
12
+ describe '#set_group' do
13
13
  let(:action) { Gtk::RadioAction.new 'name', 'label', 'tooltip', nil, 1 }
14
14
 
15
- it "accepts nil" do
15
+ it 'accepts nil' do
16
16
  action.set_group nil
17
17
  pass
18
18
  end
19
19
 
20
- it "accepts a GLib::SList object" do
20
+ it 'accepts a GLib::SList object' do
21
21
  grp = action.get_group
22
- other_action = Gtk::RadioAction.new 'other-name', 'other-label', 'other-tooltip', nil, 2
22
+ other_action = Gtk::RadioAction.new('other-name', 'other-label',
23
+ 'other-tooltip', nil, 2)
23
24
  other_action.set_group grp
24
25
  pass
25
26
  end
@@ -1,34 +1,34 @@
1
1
  require 'test_helper'
2
2
 
3
3
  describe Gtk::RadioButton do
4
- describe ".new_from_widget" do
5
- it "works when called with nil" do
4
+ describe '.new_from_widget' do
5
+ it 'works when called with nil' do
6
6
  result = Gtk::RadioButton.new_from_widget(nil)
7
7
  result.must_be_instance_of Gtk::RadioButton
8
8
  end
9
9
 
10
- it "works when called with another radio button" do
10
+ it 'works when called with another radio button' do
11
11
  btn = Gtk::RadioButton.new_from_widget nil
12
12
  result = Gtk::RadioButton.new_from_widget btn
13
13
  result.must_be_instance_of Gtk::RadioButton
14
14
  end
15
15
  end
16
16
 
17
- describe "#get_group" do
18
- it "returns a GLib::SList object" do
17
+ describe '#get_group' do
18
+ it 'returns a GLib::SList object' do
19
19
  btn = Gtk::RadioButton.new_from_widget nil
20
20
  grp = btn.get_group
21
21
  assert_instance_of GLib::SList, grp
22
22
  end
23
23
  end
24
24
 
25
- describe ".new" do
26
- it "works when called with nil" do
25
+ describe '.new' do
26
+ it 'works when called with nil' do
27
27
  result = Gtk::RadioButton.new nil
28
28
  result.must_be_instance_of Gtk::RadioButton
29
29
  end
30
30
 
31
- it "works when called with the result of #get_group" do
31
+ it 'works when called with the result of #get_group' do
32
32
  btn = Gtk::RadioButton.new_from_widget nil
33
33
  result = Gtk::RadioButton.new btn.get_group
34
34
  result.must_be_instance_of Gtk::RadioButton
@@ -1,15 +1,15 @@
1
1
  require 'test_helper'
2
2
 
3
3
  describe Gtk::TreePath do
4
- describe "#get_indices" do
4
+ describe '#get_indices' do
5
5
  it "returns an enumerable of the TreePath's indices" do
6
- tree_path = Gtk::TreePath.new_from_string "1:2:3"
6
+ tree_path = Gtk::TreePath.new_from_string '1:2:3'
7
7
  tree_path.get_indices.to_a.must_equal [1, 2, 3]
8
8
  end
9
9
  end
10
10
 
11
- describe ".new_from_indices" do
12
- it "creates a Gtk::TreePath with the right indices" do
11
+ describe '.new_from_indices' do
12
+ it 'creates a Gtk::TreePath with the right indices' do
13
13
  tree_path = Gtk::TreePath.new_from_indices [1, 2, 3]
14
14
  tree_path.get_indices.to_a.must_equal [1, 2, 3]
15
15
  end
@@ -3,9 +3,11 @@ require 'test_helper'
3
3
  describe Gtk::TreeViewColumn do
4
4
  describe '.new_with_attributes' do
5
5
  let(:renderer) { Gtk::CellRendererText.new }
6
- let(:column) { Gtk::TreeViewColumn.new_with_attributes('foo-title',
7
- renderer,
8
- text: 1) }
6
+ let(:column) do
7
+ Gtk::TreeViewColumn.new_with_attributes('foo-title',
8
+ renderer,
9
+ text: 1)
10
+ end
9
11
  let(:list_store) { Gtk::ListStore.new([GObject::TYPE_INT, GObject::TYPE_STRING]) }
10
12
 
11
13
  it "sets the column's title" do
@@ -16,7 +18,7 @@ describe Gtk::TreeViewColumn do
16
18
  column.get_cells.to_a.must_equal [renderer]
17
19
  end
18
20
 
19
- it "adds the attribute mapping for the renderer" do
21
+ it 'adds the attribute mapping for the renderer' do
20
22
  row = list_store.append
21
23
  list_store.set_value(row, 1, 'foo-value')
22
24
  column.cell_set_cell_data(list_store, row, false, false)
@@ -39,7 +41,7 @@ describe Gtk::TreeViewColumn do
39
41
  column.set_attributes(renderer, text: 1)
40
42
  end
41
43
 
42
- it "adds the attribute mapping for the renderer" do
44
+ it 'adds the attribute mapping for the renderer' do
43
45
  row = list_store.append
44
46
  list_store.set_value(row, 1, 'foo-value')
45
47
  column.cell_set_cell_data(list_store, row, false, false)
@@ -1,13 +1,12 @@
1
- if RUBY_PLATFORM == 'java'
2
- require 'rubygems'
3
- end
1
+ require 'rubygems' if RUBY_PLATFORM == 'java'
4
2
 
5
3
  begin
6
4
  require 'simplecov'
7
5
  SimpleCov.start do
8
- add_filter "/test/"
6
+ add_filter '/test/'
9
7
  end
10
8
  rescue LoadError
9
+ nil # SimpleCov not available
11
10
  end
12
11
 
13
12
  require 'minitest/autorun'
@@ -21,15 +20,17 @@ else
21
20
  require 'gir_ffi-gtk3'
22
21
  end
23
22
 
24
- class Minitest::Test
23
+ module BaseTestExtensions
25
24
  def assert_nothing_raised
26
25
  yield
27
26
  assert true
28
27
  end
29
28
 
30
- def ref_count object
29
+ def ref_count(object)
31
30
  GObject::Object::Struct.new(object.to_ptr)[:ref_count]
32
31
  end
33
32
  end
34
33
 
34
+ Minitest::Test.send :include, BaseTestExtensions
35
+
35
36
  Gtk.init
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi-gtk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.13.0
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: 2018-05-31 00:00:00.000000000 Z
11
+ date: 2018-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gir_ffi
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.12.0
19
+ version: 0.13.0
20
20
  type: :runtime
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: 0.12.0
26
+ version: 0.13.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,33 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '5.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rr
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.1'
47
+ version: '12.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.1'
54
+ version: '12.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: rr
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '12.0'
61
+ version: '1.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '12.0'
68
+ version: '1.1'
69
69
  description: Bindings for Gtk+ 2 and 3, generated by GirFFI, with overrides.
70
70
  email:
71
71
  - matijs@matijs.net
@@ -132,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - ">="
134
134
  - !ruby/object:Gem::Version
135
- version: 2.1.0
135
+ version: 2.2.0
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - ">="