fontist 1.8.5 → 1.8.6
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 +4 -4
 - data/.github/workflows/rspec.yml +2 -2
 - data/lib/fontist/cli.rb +8 -4
 - data/lib/fontist/font.rb +17 -9
 - data/lib/fontist/manifest/install.rb +3 -2
 - data/lib/fontist/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d13c412a0a68cdcf1845948c2f3b96c45187dc27193bae4a581d2ee1f3324201
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ed82b44bfc05274b749e4c4b2f2ace5e4ae115343c6ca9f99ac4fc552d71147f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: d8a08b20f1b2409b34749ad4f4531e2c727b3e39fa9e3b015d564d6ec14365dd9aa43274aa337845b72e4072bfcad50fe26412a69b805e7c83139934b009a6d6
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: bb20f38a5c4c4e9714dc69b15f249636e10c76942359e10ac38dc08d98eac3cfc1c6efe879bc9e13596d38872bae75c4721ce6d3892e1ca2726bbe7f9cb50b41
         
     | 
    
        data/.github/workflows/rspec.yml
    CHANGED
    
    | 
         @@ -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 : 
     | 
| 
      
 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[: 
     | 
| 
      
 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 : 
     | 
| 
      
 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[: 
     | 
| 
      
 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,  
     | 
| 
       23 
     | 
    
         
            -
                  new(name: name 
     | 
| 
      
 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 
     | 
| 
       123 
     | 
    
         
            -
                     
     | 
| 
      
 123 
     | 
    
         
            +
                  if formula.license_required
         
     | 
| 
      
 124 
     | 
    
         
            +
                    show_license(formula.license) unless @hide_licenses
         
     | 
| 
       124 
125 
     | 
    
         | 
| 
       125 
     | 
    
         
            -
                    unless confirmation 
     | 
| 
       126 
     | 
    
         
            -
                       
     | 
| 
       127 
     | 
    
         
            -
             
     | 
| 
       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  
     | 
| 
      
 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
         
     | 
    
        data/lib/fontist/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-02-05 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: arr-pm
         
     |