gir_ffi-pango 0.0.13 → 0.0.14

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: 1496224331989ca48cb1eae2e01816f03df7c86caa9eb4198c7325694ef98c18
4
- data.tar.gz: 4e8daf9f71e915d87666ac32619cabda46535e9c8f235d44059f245ece6a7d8c
3
+ metadata.gz: 73d2b359b99f6d0e7ff0f40e18c04b76604763737be8b06d6d4da93711e2d6e6
4
+ data.tar.gz: fc0deda7db95155a4ffff71e6a8a4a4ef185e1bda884d1a8f99c32f9f770753b
5
5
  SHA512:
6
- metadata.gz: '0283b28a789f94c6a368071c8faa55aaaaf1c58e8699af1b57ee7210d7304febed0567a34fe22d3003445d604628931ac7403f1ed75bdaa0504edc959e1e74bc'
7
- data.tar.gz: 56ec39352479fc5d7d1d172034dc73232743cf43a4174212951ccc9957f9a72dd3e93411ac34fef8f60111089734ae125b9597fa0df1451d3187f0cbcf2587cf
6
+ metadata.gz: d6aa59b2662e087c31c1eaed443c2b5947d48631762eb3c01c3093cf1a0c9da465ab059e6b9918a6a5dbb529a5e254d2133547dc278f022f7be015044cbf7f7a
7
+ data.tar.gz: 79843319d2aade8495e423ba677b829dc2ea4c0348c447c6c1362beaf0201725ed06ac526447887bb6ace0779b812324e0057b2638b670af3a2b7c93a3c56ac6
data/README.md CHANGED
@@ -4,28 +4,33 @@ GirFFI-based bindings for Pango
4
4
 
5
5
  ## Usage
6
6
 
7
- require 'gir_ffi-gtk3'
8
- require 'gir_ffi-pango'
7
+ ```ruby
8
+ require 'gir_ffi-gtk3'
9
+ require 'gir_ffi-pango'
9
10
 
10
- Gtk.init
11
+ Gtk.init
11
12
 
12
- ctx = Gdk.pango_context_get
13
- fontmap = ctx.get_font_map
14
- fd = Pango::FontDescription.new
15
- fd.set_family "Sans"
16
- fnt = fontmap.load_font ctx, fd
17
- puts fnt.describe.to_string
13
+ ctx = Gdk.pango_context_get
14
+ fontmap = ctx.font_map
15
+ fd = Pango::FontDescription.new
16
+ fd.family = "Sans"
17
+ fnt = fontmap.load_font ctx, fd
18
+ puts fnt.describe.to_string
18
19
 
19
- lang = Pango::Language.from_string "en"
20
- puts lang.get_stripts
20
+ lang = Pango::Language.from_string "en"
21
+ puts lang.scripts
22
+ ```
21
23
 
22
24
  ## Install
23
25
 
24
- gem install gir_ffi-pango
26
+ ```bash
27
+ gem install gir_ffi-pango
28
+ ```
25
29
 
26
30
  ## License
27
31
 
28
- Copyright © 2012–2016, 2018, [Matijs van Zuijlen](http://www.matijs.net/)
32
+ Copyright © 2012–2016, 2018–2019,
33
+ [Matijs van Zuijlen](http://www.matijs.net/)
29
34
 
30
35
  GirFFI-Pango is free software, distributed under the terms of the GNU Lesser
31
36
  General Public License, version 2.1 or later. See the file COPYING.LIB for more
@@ -8,6 +8,8 @@ module Pango
8
8
  ptr = Lib.pango_font_get_coverage(self, lang)
9
9
  Pango::Coverage.wrap ptr
10
10
  end
11
+
12
+ alias_method :coverage, :get_coverage
11
13
  end
12
14
 
13
15
  module Lib
@@ -4,20 +4,6 @@ module Pango
4
4
  load_class :Language
5
5
 
6
6
  class Language
7
- setup_instance_method! 'get_scripts'
8
-
9
- def get_scripts_with_override
10
- result = get_scripts_without_override
11
- case result
12
- when GirFFI::SizedArray
13
- result
14
- else
15
- ptr, size = *result
16
- GirFFI::SizedArray.new Pango::Script, size, ptr
17
- end
18
- end
19
-
20
- alias get_scripts_without_override get_scripts
21
- alias get_scripts get_scripts_with_override
7
+ # No overrides are needed currently
22
8
  end
23
9
  end
@@ -7,7 +7,7 @@ describe Pango::Context do
7
7
  it 'returns a descendant from Pango::FontMap' do
8
8
  ctx = Gdk.pango_context_get
9
9
  result = ctx.get_font_map
10
- result.class.ancestors.must_include Pango::FontMap
10
+ _(result.class.ancestors).must_include Pango::FontMap
11
11
  end
12
12
  end
13
13
  end
@@ -16,7 +16,7 @@ describe Pango::Font do
16
16
  clist = 'Hello Pango!'.each_char.map { |ch| cov.get ch[0].ord }
17
17
 
18
18
  clist.uniq.each do |cval|
19
- [:none, :fallback, :approximate, :exact].must_include cval
19
+ _([:none, :fallback, :approximate, :exact]).must_include cval
20
20
  end
21
21
  end
22
22
  end
@@ -5,7 +5,7 @@ require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
5
5
  describe Pango::Font do
6
6
  before do
7
7
  ctx = Gdk.pango_context_get
8
- fontmap = ctx.get_font_map
8
+ fontmap = ctx.font_map
9
9
  fd = Pango::FontDescription.new
10
10
  @fnt = fontmap.load_font ctx, fd
11
11
  end
@@ -17,11 +17,24 @@ describe Pango::Font do
17
17
  end
18
18
 
19
19
  it 'returns an instance of Pango::Coverage' do
20
- @cov.must_be_instance_of Pango::Coverage
20
+ _(@cov).must_be_instance_of Pango::Coverage
21
21
  end
22
22
 
23
23
  it 'returns valid coverage info' do
24
- @cov.get(' '[0].ord).must_equal :exact
24
+ _(@cov.get(' '[0].ord)).must_equal :exact
25
+ end
26
+ end
27
+
28
+ describe '#coverage' do
29
+ let(:lang) { Pango::Language.from_string 'en' }
30
+ let(:cov) { @fnt.coverage lang }
31
+
32
+ it 'returns an instance of Pango::Coverage' do
33
+ _(cov).must_be_instance_of Pango::Coverage
34
+ end
35
+
36
+ it 'returns valid coverage info' do
37
+ _(cov.get(' '[0].ord)).must_equal :exact
25
38
  end
26
39
  end
27
40
  end
@@ -5,25 +5,43 @@ require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
5
5
  describe Pango::Language do
6
6
  it 'creates an instance with .from_string' do
7
7
  lang = Pango::Language.from_string 'en'
8
- lang.wont_be_nil
9
- lang.must_be_instance_of Pango::Language
8
+ _(lang).wont_be_nil
9
+ _(lang).must_be_instance_of Pango::Language
10
10
  end
11
11
 
12
12
  describe '#get_scripts' do
13
13
  it 'returns an enumerable of symbols representing scripts' do
14
14
  lang = Pango::Language.from_string 'ja'
15
15
  scripts = lang.get_scripts
16
- scripts.to_a.must_equal [:han, :katakana, :hiragana]
16
+ _(scripts.to_a).must_equal [:han, :katakana, :hiragana]
17
17
  end
18
18
 
19
19
  it 'can safely be run twice' do
20
20
  lang = Pango::Language.from_string 'en'
21
21
 
22
22
  result = lang.get_scripts
23
- result.to_a.must_equal [:latin]
23
+ _(result.to_a).must_equal [:latin]
24
24
 
25
25
  result = lang.get_scripts
26
- result.to_a.must_equal [:latin]
26
+ _(result.to_a).must_equal [:latin]
27
+ end
28
+ end
29
+
30
+ describe '#scripts' do
31
+ it 'returns an enumerable of symbols representing scripts' do
32
+ lang = Pango::Language.from_string 'ja'
33
+ scripts = lang.scripts
34
+ _(scripts.to_a).must_equal [:han, :katakana, :hiragana]
35
+ end
36
+
37
+ it 'can safely be run twice' do
38
+ lang = Pango::Language.from_string 'en'
39
+
40
+ result = lang.scripts
41
+ _(result.to_a).must_equal [:latin]
42
+
43
+ result = lang.scripts
44
+ _(result.to_a).must_equal [:latin]
27
45
  end
28
46
  end
29
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi-pango
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
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-09-27 00:00:00.000000000 Z
11
+ date: 2019-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gir_ffi
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.0
19
+ version: 0.15.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.14.0
26
+ version: 0.15.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.0'
33
+ version: '5.12'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.0'
40
+ version: '5.12'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '12.0'
47
+ version: '13.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: '12.0'
54
+ version: '13.0'
55
55
  description: Bindings for Pango generated by GirFFI, with an eclectic set of overrides.
56
56
  email:
57
57
  - matijs@matijs.net
@@ -82,15 +82,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 2.2.0
85
+ version: 2.4.0
86
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubyforge_project:
93
- rubygems_version: 2.7.6
92
+ rubygems_version: 3.0.6
94
93
  signing_key:
95
94
  specification_version: 4
96
95
  summary: GirFFI-based bindings for Pango