bigcartel-theme-fonts 1.4.1 → 1.4.3

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: a20f414c9c5c27e7cb0b6dd8bd31371177fd3766a9fadf2ad7aa9d96fbc84afa
4
- data.tar.gz: c65070787bcff611e1c28bbc7b4349db488ece7ed2e8cff03a6268446a929cdf
3
+ metadata.gz: 94d6e9c61e3d2e86f2a2d6bdf15d950dc0aae7810a417029d1d014db27b454e2
4
+ data.tar.gz: b464678e48913602b566a2196779ab397613a150955ec59ae702b3770e37a0a1
5
5
  SHA512:
6
- metadata.gz: 1ac6858bb15390c5c9966c38f31956d20b75256c5b309544cb5fc21743a855271645c8d7b396ed61d0190d4b335f2cae5df2a0e47222ceb60eb96aa0c4be9425
7
- data.tar.gz: bc6cfdac7180a22fc5e9eb14859d02f73bcae82b36815c9255c309d761bd1e355f6fceeb7ced995e1209ddcbe4367a7a77abfe38a7f17f0bd14f2168c57f7610
6
+ metadata.gz: 57bb8894b5deae3ec2e7891ee6cad9b079952a9ede43836c0982dd9fee07204bed90ea4c9186933904d3d9a1a6ad2617442b182bcbc9dec8486fe97ea8c158fd
7
+ data.tar.gz: 01741df66641569e79fa6d8952a1533ac5d53be45eaf3c875c49e6c23af4e2b69829f4a136b14f4a43c84e38ee340cb228109f1552411dc38e2bcbfac8c0718c
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'bigcartel-theme-fonts'
7
- spec.version = '1.4.1'
7
+ spec.version = '1.4.3'
8
8
  spec.authors = ['Big Cartel']
9
9
  spec.email = ['dev@bigcartel.com']
10
10
  spec.description = %q{A simple class for working with Big Cartel's supported theme fonts.}
@@ -49,7 +49,7 @@ class ThemeFont < Struct.new(:name, :family, :weights, :collection)
49
49
  end
50
50
  end
51
51
 
52
- "//fonts.googleapis.com/css?family=#{ fonts.uniq.map { |font| font.gsub(' ', '+') }.join('|') }"
52
+ "//fonts.googleapis.com/css?family=#{ fonts.uniq.map { |font| font.gsub(' ', '+') }.join('|') }&display=swap"
53
53
  end
54
54
 
55
55
  def google_font_url_for_all_fonts
@@ -73,15 +73,15 @@ describe ThemeFont do
73
73
 
74
74
  describe ".google_font_url_for_fonts" do
75
75
  it "should return a url for a given array of font names" do
76
- ThemeFont.google_font_url_for_fonts(['Oh Hey', 'Buddy', 'Yeah']).should == "//fonts.googleapis.com/css?family=Oh+Hey|Buddy|Yeah"
76
+ ThemeFont.google_font_url_for_fonts(['Oh Hey', 'Buddy', 'Yeah']).should == "//fonts.googleapis.com/css?family=Oh+Hey|Buddy|Yeah&amp;display=swap"
77
77
  end
78
78
 
79
79
  it "should return a url for a singular font in an array" do
80
- ThemeFont.google_font_url_for_fonts(['Oh Hey']).should == "//fonts.googleapis.com/css?family=Oh+Hey"
80
+ ThemeFont.google_font_url_for_fonts(['Oh Hey']).should == "//fonts.googleapis.com/css?family=Oh+Hey&amp;display=swap"
81
81
  end
82
82
 
83
83
  it "should only use unique font names" do
84
- ThemeFont.google_font_url_for_fonts(['Yeah', 'Buddy', 'Yeah']).should == "//fonts.googleapis.com/css?family=Yeah|Buddy"
84
+ ThemeFont.google_font_url_for_fonts(['Yeah', 'Buddy', 'Yeah']).should == "//fonts.googleapis.com/css?family=Yeah|Buddy&amp;display=swap"
85
85
  end
86
86
 
87
87
  context "when the fonts are an array of ThemeFonts" do
@@ -93,7 +93,7 @@ describe ThemeFont do
93
93
  end
94
94
 
95
95
  it "includes font weights in the URL" do
96
- ThemeFont.google_font_url_for_fonts(fonts).should == "//fonts.googleapis.com/css?family=One+Font:400,500|Two+Font:500,700,800"
96
+ ThemeFont.google_font_url_for_fonts(fonts).should == "//fonts.googleapis.com/css?family=One+Font:400,500|Two+Font:500,700,800&amp;display=swap"
97
97
  end
98
98
  end
99
99
  end
@@ -108,7 +108,7 @@ describe ThemeFont do
108
108
  end
109
109
 
110
110
  it "should return a URL for all Google fonts" do
111
- ThemeFont.google_font_url_for_all_fonts.should == "//fonts.googleapis.com/css?family=One+Font|Three:400,600"
111
+ ThemeFont.google_font_url_for_all_fonts.should == "//fonts.googleapis.com/css?family=One+Font|Three:400,600&amp;display=swap"
112
112
  end
113
113
  end
114
114
 
@@ -125,17 +125,17 @@ describe ThemeFont do
125
125
 
126
126
  it "should return a URL if a theme has multiple" do
127
127
  settings = { :header_font => 'One Font', :body_font => 'Two', :paragraph_font => 'Three' }
128
- ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700|Three"
128
+ ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700|Three&amp;display=swap"
129
129
  end
130
130
 
131
131
  it "should return single font name if a theme has one" do
132
132
  settings = { :header_font => 'One Font', :body_font => 'Two' }
133
- ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700"
133
+ ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700&amp;display=swap"
134
134
  end
135
135
 
136
136
  it "should dedup" do
137
137
  settings = { :header_font => 'One Font', :body_font => 'One Font' }
138
- ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700"
138
+ ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700&amp;display=swap"
139
139
  end
140
140
 
141
141
  it "should return nil if a theme has none" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigcartel-theme-fonts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Big Cartel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-29 00:00:00.000000000 Z
11
+ date: 2023-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler