fontist 1.8.5 → 1.8.6

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: 4b392969d430a5af69c38a73069d5a98cf90a6ef1c246f8cca215a7cd4c1202c
4
- data.tar.gz: 97ca59729bf50acefa0bfe5ab23b82050eed8fd6ba4782a6d814a77e44939b4b
3
+ metadata.gz: d13c412a0a68cdcf1845948c2f3b96c45187dc27193bae4a581d2ee1f3324201
4
+ data.tar.gz: ed82b44bfc05274b749e4c4b2f2ace5e4ae115343c6ca9f99ac4fc552d71147f
5
5
  SHA512:
6
- metadata.gz: b5911d154187149d2d8ebc81e776b7c4b12e0a8eddf4f2540f3914b41fd29c582a29287b5ed1d3d7cccbe696aeb40908f5039bf350c281e315ac08fffe76e110
7
- data.tar.gz: 49a7e53eff6d6b750248141a608cb3e92c03c19130f75f4ff8806c7e55ca0d478cec376ed9eaa273dedff3e05b31057892c0c47367a48f1a3eadd5599ecaf968
6
+ metadata.gz: d8a08b20f1b2409b34749ad4f4531e2c727b3e39fa9e3b015d564d6ec14365dd9aa43274aa337845b72e4072bfcad50fe26412a69b805e7c83139934b009a6d6
7
+ data.tar.gz: bb20f38a5c4c4e9714dc69b15f249636e10c76942359e10ac38dc08d98eac3cfc1c6efe879bc9e13596d38872bae75c4721ce6d3892e1ca2726bbe7f9cb50b41
@@ -37,8 +37,8 @@ jobs:
37
37
  - uses: actions/cache@v1
38
38
  with:
39
39
  path: vendor/bundle
40
- key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
41
- restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
40
+ key: bundle-v2-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
41
+ restore-keys: bundle-v2-${{ matrix.os }}-${{ matrix.ruby }}
42
42
 
43
43
  - if: matrix.os == 'macos-latest'
44
44
  run: brew install lcdf-typetools
data/lib/fontist/cli.rb CHANGED
@@ -29,12 +29,14 @@ module Fontist
29
29
  desc "install FONT", "Install font"
30
30
  option :force, type: :boolean, aliases: :f,
31
31
  desc: "Install even if it's already installed in system"
32
- option :confirm_license, type: :boolean, desc: "Confirm license agreement"
32
+ option :accept_all_licenses, type: :boolean, aliases: "--confirm-license", desc: "Accept all license agreements"
33
+ option :hide_licenses, type: :boolean, desc: "Hide license texts"
33
34
  def install(font)
34
35
  Fontist::Font.install(
35
36
  font,
36
37
  force: options[:force],
37
- confirmation: options[:confirm_license] ? "yes" : "no"
38
+ confirmation: options[:accept_all_licenses] ? "yes" : "no",
39
+ hide_licenses: options[:hide_licenses]
38
40
  )
39
41
  success
40
42
  rescue Fontist::Errors::GeneralError => e
@@ -89,11 +91,13 @@ module Fontist
89
91
  end
90
92
 
91
93
  desc "manifest-install MANIFEST", "Install fonts from MANIFEST (yaml)"
92
- option :confirm_license, type: :boolean, desc: "Confirm license agreement"
94
+ option :accept_all_licenses, type: :boolean, aliases: "--confirm-license", desc: "Accept all license agreements"
95
+ option :hide_licenses, type: :boolean, desc: "Hide license texts"
93
96
  def manifest_install(manifest)
94
97
  paths = Fontist::Manifest::Install.from_file(
95
98
  manifest,
96
- confirmation: options[:confirm_license] ? "yes" : "no"
99
+ confirmation: options[:accept_all_licenses] ? "yes" : "no",
100
+ hide_licenses: options[:hide_licenses]
97
101
  )
98
102
 
99
103
  print_yaml(paths)
data/lib/fontist/font.rb CHANGED
@@ -6,6 +6,7 @@ module Fontist
6
6
  def initialize(options = {})
7
7
  @name = options[:name]
8
8
  @confirmation = options[:confirmation] || "no"
9
+ @hide_licenses = options[:hide_licenses]
9
10
  @force = options[:force] || false
10
11
 
11
12
  check_or_create_fontist_path!
@@ -19,8 +20,8 @@ module Fontist
19
20
  new(name: name).find
20
21
  end
21
22
 
22
- def self.install(name, confirmation: "no", force: false)
23
- new(name: name, confirmation: confirmation, force: force).install
23
+ def self.install(name, options = {})
24
+ new(options.merge(name: name)).install
24
25
  end
25
26
 
26
27
  def self.uninstall(name)
@@ -119,19 +120,26 @@ module Fontist
119
120
  end
120
121
 
121
122
  def check_and_confirm_required_license(formula)
122
- if formula.license_required && !confirmation.casecmp("yes").zero?
123
- @confirmation = show_license_and_ask_for_input(formula.license)
123
+ if formula.license_required
124
+ show_license(formula.license) unless @hide_licenses
124
125
 
125
- unless confirmation&.casecmp?("yes")
126
- raise Fontist::Errors::LicensingError.new(
127
- "Fontist will not download these fonts unless you accept the terms."
128
- )
126
+ unless confirmation.casecmp?("yes")
127
+ @confirmation = ask_for_agreement
128
+
129
+ unless confirmation&.casecmp?("yes")
130
+ raise Fontist::Errors::LicensingError.new(
131
+ "Fontist will not download these fonts unless you accept the terms."
132
+ )
133
+ end
129
134
  end
130
135
  end
131
136
  end
132
137
 
133
- def show_license_and_ask_for_input(license)
138
+ def show_license(license)
134
139
  Fontist.ui.say(license_agrement_message(license))
140
+ end
141
+
142
+ def ask_for_agreement
135
143
  Fontist.ui.ask(
136
144
  "\nDo you accept all presented font licenses, and want Fontist " \
137
145
  "to download these fonts for you? => TYPE 'Yes' or 'No':"
@@ -3,9 +3,10 @@ require_relative "locations"
3
3
  module Fontist
4
4
  module Manifest
5
5
  class Install < Locations
6
- def initialize(manifest, confirmation: "no")
6
+ def initialize(manifest, confirmation: "no", hide_licenses: false)
7
7
  @manifest = manifest
8
8
  @confirmation = confirmation
9
+ @hide_licenses = hide_licenses
9
10
  end
10
11
 
11
12
  private
@@ -20,7 +21,7 @@ module Fontist
20
21
  end
21
22
 
22
23
  def install_font(font)
23
- Fontist::Font.install(font, force: true, confirmation: @confirmation)
24
+ Fontist::Font.install(font, force: true, confirmation: @confirmation, hide_licenses: @hide_licenses)
24
25
  end
25
26
  end
26
27
  end
@@ -1,3 +1,3 @@
1
1
  module Fontist
2
- VERSION = "1.8.5".freeze
2
+ VERSION = "1.8.6".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.5
4
+ version: 1.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-03 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: arr-pm