gir_ffi-pango 0.0.10 → 0.0.11

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
  SHA256:
3
- metadata.gz: 6fa7d7fc5188f67fbf2da4c975c3eee96601dfe53ec260676efa1fdd8aa6c047
4
- data.tar.gz: 52c77c5edddad0fed60655cb3c53d78a5cda930881bee10051421f16580e5476
3
+ metadata.gz: 5b6da05be9fc728d8657aaa69a34477df3464478d2edb60068ef5ec6864ac3af
4
+ data.tar.gz: b7aadbf4380b6027406c0fb760725bcc3c9ba99c72b5a0bda075f5d504d261e7
5
5
  SHA512:
6
- metadata.gz: fca55028da11ce535a0abb6c47b63c5ad554afa1b30729cccd47cc1961d4a4edf59053ddac7fa5ecac717a6739b36475b2a5fb3689c9966c4f99e9978b403232
7
- data.tar.gz: 656e870b89c4cb26c07fc65bd165b6df9ee2cf297b6da460aa022adec1dd48ea989dc610eb0e179b6bcab89532242964aee7ee87daee2850179b4672c5a04262
6
+ metadata.gz: 708cb6026a04690d9fda8c40e9a6e6460d12f2236096685945006d17744f267cdc99208214355ed7994f811f8a2713283241c47038e7818d1a72e20834414f11
7
+ data.tar.gz: 2720d2cf56dd733a02c1982151c4fc33a9c6c5829ddb5f1ad128fe9af8fcc6099e9b5b15144ac23e0424abbb3ce3ef6be073c68b70c24843b39b3b11ba929d28
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake/testtask'
2
4
  require 'bundler/gem_helper'
3
5
 
@@ -16,9 +18,9 @@ namespace :test do
16
18
  t.warning = true
17
19
  end
18
20
 
19
- task :all => [:unit, :end_to_end]
21
+ task all: [:unit, :end_to_end]
20
22
  end
21
23
 
22
- task :test => 'test:all'
24
+ task test: 'test:all'
23
25
 
24
- task :default => 'test'
26
+ task default: 'test'
data/lib/gir_ffi-pango.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'gir_ffi'
2
4
 
3
5
  GirFFI.setup :Pango
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Pango
2
4
  load_class :Font
3
5
 
4
6
  class Font
5
- def get_coverage lang
7
+ def get_coverage(lang)
6
8
  ptr = Lib.pango_font_get_coverage(self, lang)
7
9
  Pango::Coverage.wrap ptr
8
10
  end
@@ -1,12 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Pango
2
4
  load_class :Language
3
5
 
4
6
  class Language
5
- setup_instance_method "get_scripts"
7
+ setup_instance_method 'get_scripts'
6
8
 
7
9
  def get_scripts_with_override
8
- result = self.get_scripts_without_override
9
- if GirFFI::SizedArray === result
10
+ result = get_scripts_without_override
11
+ case result
12
+ when GirFFI::SizedArray
10
13
  result
11
14
  else
12
15
  ptr, size = *result
@@ -18,4 +21,3 @@ module Pango
18
21
  alias get_scripts get_scripts_with_override
19
22
  end
20
23
  end
21
-
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
4
 
3
5
  describe Pango::Context do
4
- describe "#get_font_map" do
5
- it "returns a descendant from Pango::FontMap" do
6
+ describe '#get_font_map' do
7
+ it 'returns a descendant from Pango::FontMap' do
6
8
  ctx = Gdk.pango_context_get
7
9
  result = ctx.get_font_map
8
10
  result.class.ancestors.must_include Pango::FontMap
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
4
 
3
5
  describe Pango::Font do
4
- it "allows retrieval of coverage information" do
6
+ it 'allows retrieval of coverage information' do
5
7
  ctx = Gdk.pango_context_get
6
8
 
7
9
  fontmap = ctx.get_font_map
@@ -11,11 +13,10 @@ describe Pango::Font do
11
13
  lang = Pango::Language.from_string 'en'
12
14
  cov = fnt.get_coverage lang
13
15
 
14
- clist = "Hello Pango!".each_char.map {|ch| cov.get ch[0].ord}
16
+ clist = 'Hello Pango!'.each_char.map { |ch| cov.get ch[0].ord }
15
17
 
16
18
  clist.uniq.each do |cval|
17
19
  [:none, :fallback, :approximate, :exact].must_include cval
18
20
  end
19
21
  end
20
22
  end
21
-
data/test/test_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'minitest/autorun'
2
4
 
3
5
  require 'gir_ffi-pango'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
4
 
3
5
  describe Pango::Font do
@@ -8,18 +10,18 @@ describe Pango::Font do
8
10
  @fnt = fontmap.load_font ctx, fd
9
11
  end
10
12
 
11
- describe "#get_coverage" do
13
+ describe '#get_coverage' do
12
14
  before do
13
15
  lang = Pango::Language.from_string 'en'
14
16
  @cov = @fnt.get_coverage lang
15
17
  end
16
18
 
17
- it "returns an instance of Pango::Coverage" do
19
+ it 'returns an instance of Pango::Coverage' do
18
20
  @cov.must_be_instance_of Pango::Coverage
19
21
  end
20
22
 
21
- it "returns valid coverage info" do
22
- @cov.get(" "[0].ord).must_equal :exact
23
+ it 'returns valid coverage info' do
24
+ @cov.get(' '[0].ord).must_equal :exact
23
25
  end
24
26
  end
25
27
  end
@@ -1,20 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
4
 
3
5
  describe Pango::Language do
4
- it "creates an instance with .from_string" do
6
+ it 'creates an instance with .from_string' do
5
7
  lang = Pango::Language.from_string 'en'
6
8
  lang.wont_be_nil
7
9
  lang.must_be_instance_of Pango::Language
8
10
  end
9
11
 
10
- describe "#get_scripts" do
11
- it "returns an enumerable of symbols representing scripts" do
12
+ describe '#get_scripts' do
13
+ it 'returns an enumerable of symbols representing scripts' do
12
14
  lang = Pango::Language.from_string 'ja'
13
15
  scripts = lang.get_scripts
14
16
  scripts.to_a.must_equal [:han, :katakana, :hiragana]
15
17
  end
16
18
 
17
- it "can safely be run twice" do
19
+ it 'can safely be run twice' do
18
20
  lang = Pango::Language.from_string 'en'
19
21
 
20
22
  result = lang.get_scripts
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.10
4
+ version: 0.0.11
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-03-25 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gir_ffi