gir_ffi-pango 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,9 +5,13 @@ module Pango
5
5
  setup_instance_method "get_scripts"
6
6
 
7
7
  def get_scripts_with_override
8
- ptr, num = self.get_scripts_without_override
9
- vals = GirFFI::ArgHelper.ptr_to_typed_array :gint32, ptr, num
10
- vals.map {|val| Pango::Script[val]}
8
+ result = self.get_scripts_without_override
9
+ if GLib::SizedArray === result
10
+ result
11
+ else
12
+ ptr, size = *result
13
+ GLib::SizedArray.new Pango::Script, size, ptr
14
+ end
11
15
  end
12
16
 
13
17
  alias get_scripts_without_override get_scripts
data/test/test_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'minitest/spec'
2
1
  require 'minitest/autorun'
3
2
 
4
3
  require 'gir_ffi-pango'
@@ -8,20 +8,20 @@ describe Pango::Language do
8
8
  end
9
9
 
10
10
  describe "#get_scripts" do
11
- it "returns an array of symbols representing scripts" do
11
+ it "returns an enumerable of symbols representing scripts" do
12
12
  lang = Pango::Language.from_string 'ja'
13
13
  scripts = lang.get_scripts
14
- scripts.must_equal [:han, :katakana, :hiragana]
14
+ scripts.to_a.must_equal [:han, :katakana, :hiragana]
15
15
  end
16
16
 
17
17
  it "can safely be run twice" do
18
18
  lang = Pango::Language.from_string 'en'
19
19
 
20
20
  result = lang.get_scripts
21
- result.must_equal [:latin]
21
+ result.to_a.must_equal [:latin]
22
22
 
23
23
  result = lang.get_scripts
24
- result.must_equal [:latin]
24
+ result.to_a.must_equal [:latin]
25
25
  end
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi-pango
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-19 00:00:00.000000000 Z
12
+ date: 2013-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gir_ffi
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.5.0
21
+ version: 0.6.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.5.0
29
+ version: 0.6.2
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: minitest
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 3.2.0
37
+ version: '5.0'
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 3.2.0
45
+ version: '5.0'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rake
48
48
  requirement: !ruby/object:Gem::Requirement