fontina-windows 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: e3840e8b3ccceecd13057f7c33b49cde8edd0d50
4
- data.tar.gz: c24db120ac32e1cc3b4a5c51c9f970572a891745
3
+ metadata.gz: 8731e9fabbf93ca7d38a85a1643aedcc29d30a54
4
+ data.tar.gz: 38dfa87bd104dbf29fed3c6bde14a844058f2729
5
5
  SHA512:
6
- metadata.gz: a8ff0b7e6aba299339e31b2182b2c9887cc43a4393a6865e9c19a4fbd0f7ba23992426b5e9da8f02021a674fb0f31db00ffd8ededdbcede2847ab94add79de47
7
- data.tar.gz: 461426af139ca427a61071da79fc86a679ee02175404e46754cc42426e3e6396d3f53b532bab83d3cc6e9c8b670310d1879ee0a89331323a6aea2293073f90ca
6
+ metadata.gz: 6f4717910b49b5ceea9ead854915cf175657b0ba3647712b564efc1f3155416d8661539d1195a389f431c78f535ca06af59d29b29b84b51d9dad384bbdd3bca5
7
+ data.tar.gz: 520124dd4276db71e04c4dcfe4ba6967e6627db2f9816467f9c0655459ecb737a00f21679050db414ccba4e8f1c27240a9529eb90847a0fe27591fa5d98f61e5
@@ -29,17 +29,16 @@ module Fontina
29
29
  def install(force: false)
30
30
  return if installed? unless force
31
31
 
32
- add_times = 1
33
32
  path = Windows.font_registered? registered_name
34
33
 
35
34
  Dir.chdir(Windows.fonts_directory) do
36
- add_times = Windows.remove_font_resource path if path and File.exist? path
35
+ removed_times = Windows.remove_font_resource path if path and File.exist? path
36
+
37
37
  path, = FileUtils.safe_write file.filename, file.content
38
- end
39
38
 
40
- Windows.add_font_resource(path, times: add_times).tap do |count|
41
- unless count == package.fonts.length
42
- fail "Windows reported #{count} fonts added (expected: #{package.fonts.length})"
39
+ font_count = Windows.add_font_resource path, times: [1, removed_times.to_i].max
40
+ unless font_count == package.fonts.length
41
+ fail "Windows reported #{font_count} fonts added (expected: #{package.fonts.length})"
43
42
  end
44
43
  end
45
44
 
@@ -1,7 +1,7 @@
1
1
  module Fontina
2
2
 
3
3
  module Windows
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
6
6
 
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontina-windows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Petter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-23 00:00:00.000000000 Z
11
+ date: 2017-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fontina