bigcartel-theme-fonts 1.8.2 → 1.8.3
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/bigcartel-theme-fonts.gemspec +1 -1
- data/lib/bigcartel/theme/fonts/theme_font.rb +4 -1
- data/spec/theme_font_spec.rb +33 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2baed7db194a686348bf4ef821d7a0f139e4f4d7b2c400d7bb2afc1d3719c3b2
|
4
|
+
data.tar.gz: 2d406ddecc9e86a422261d71fc4bed68722872e65e7a6b55602904335ef2f626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d376e3f0da72ed79e202c0fdb3a79fe90acd8acb5fb87179768c15845470e95b2535b51509266bbfbe3f0d6558804a9a1a409e0081648e35d84d71f032b11d45
|
7
|
+
data.tar.gz: 1f9ab812bdedc4a77b3a5a591088b2e97687fad43ffd4707d111c88317879e88cf6f803183578a117600a3ded7d62580c22f6c2c405bde06f9ec8c32f12c3936
|
@@ -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.8.
|
7
|
+
spec.version = '1.8.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.}
|
@@ -81,7 +81,10 @@ class ThemeFont < Struct.new(:name, :family, :weights, :collection)
|
|
81
81
|
return {} if font.nil? || font.collection != 'google'
|
82
82
|
|
83
83
|
{
|
84
|
-
"primary_text_font" =>
|
84
|
+
"primary_text_font" => {
|
85
|
+
"name" => font.name,
|
86
|
+
"url" => "https://fonts.googleapis.com/css?family=#{font.name.gsub(' ', '+')}"
|
87
|
+
}
|
85
88
|
}
|
86
89
|
end
|
87
90
|
|
data/spec/theme_font_spec.rb
CHANGED
@@ -161,7 +161,10 @@ describe ThemeFont do
|
|
161
161
|
stub(account_theme).settings { { primary_font: "One Font" } }
|
162
162
|
result = ThemeFont.google_font_url_for_theme_json(account_theme)
|
163
163
|
result.should == {
|
164
|
-
"primary_text_font" =>
|
164
|
+
"primary_text_font" => {
|
165
|
+
"name" => "One Font",
|
166
|
+
"url" => "https://fonts.googleapis.com/css?family=One+Font"
|
167
|
+
}
|
165
168
|
}
|
166
169
|
end
|
167
170
|
|
@@ -170,7 +173,10 @@ describe ThemeFont do
|
|
170
173
|
stub(account_theme).settings { { text_font: "Three" } }
|
171
174
|
result = ThemeFont.google_font_url_for_theme_json(account_theme)
|
172
175
|
result.should == {
|
173
|
-
"primary_text_font" =>
|
176
|
+
"primary_text_font" => {
|
177
|
+
"name" => "Three",
|
178
|
+
"url" => "https://fonts.googleapis.com/css?family=Three"
|
179
|
+
}
|
174
180
|
}
|
175
181
|
end
|
176
182
|
|
@@ -178,15 +184,21 @@ describe ThemeFont do
|
|
178
184
|
stub(account_theme).settings { { font: "One Font" } }
|
179
185
|
result = ThemeFont.google_font_url_for_theme_json(account_theme)
|
180
186
|
result.should == {
|
181
|
-
"primary_text_font" =>
|
187
|
+
"primary_text_font" => {
|
188
|
+
"name" => "One Font",
|
189
|
+
"url" => "https://fonts.googleapis.com/css?family=One+Font"
|
190
|
+
}
|
182
191
|
}
|
183
192
|
end
|
184
193
|
|
185
194
|
it "falls back to serif_font when all others are absent" do
|
186
|
-
stub(account_theme).settings { { serif_font:"Three" } }
|
195
|
+
stub(account_theme).settings { { serif_font: "Three" } }
|
187
196
|
result = ThemeFont.google_font_url_for_theme_json(account_theme)
|
188
197
|
result.should == {
|
189
|
-
"primary_text_font" =>
|
198
|
+
"primary_text_font" => {
|
199
|
+
"name" => "Three",
|
200
|
+
"url" => "https://fonts.googleapis.com/css?family=Three"
|
201
|
+
}
|
190
202
|
}
|
191
203
|
end
|
192
204
|
|
@@ -199,7 +211,10 @@ describe ThemeFont do
|
|
199
211
|
} }
|
200
212
|
result = ThemeFont.google_font_url_for_theme_json(account_theme)
|
201
213
|
result.should == {
|
202
|
-
"primary_text_font" =>
|
214
|
+
"primary_text_font" => {
|
215
|
+
"name" => "One Font",
|
216
|
+
"url" => "https://fonts.googleapis.com/css?family=One+Font"
|
217
|
+
}
|
203
218
|
}
|
204
219
|
end
|
205
220
|
end
|
@@ -224,7 +239,10 @@ describe ThemeFont do
|
|
224
239
|
stub(account_theme).settings { { secondary_font: "Three" } }
|
225
240
|
result = ThemeFont.google_font_url_for_theme_json(account_theme)
|
226
241
|
result.should == {
|
227
|
-
"primary_text_font" =>
|
242
|
+
"primary_text_font" => {
|
243
|
+
"name" => "Three",
|
244
|
+
"url" => "https://fonts.googleapis.com/css?family=Three"
|
245
|
+
}
|
228
246
|
}
|
229
247
|
end
|
230
248
|
|
@@ -235,7 +253,10 @@ describe ThemeFont do
|
|
235
253
|
} }
|
236
254
|
result = ThemeFont.google_font_url_for_theme_json(account_theme)
|
237
255
|
result.should == {
|
238
|
-
"primary_text_font" =>
|
256
|
+
"primary_text_font" => {
|
257
|
+
"name" => "Three",
|
258
|
+
"url" => "https://fonts.googleapis.com/css?family=Three"
|
259
|
+
}
|
239
260
|
}
|
240
261
|
end
|
241
262
|
end
|
@@ -247,7 +268,10 @@ describe ThemeFont do
|
|
247
268
|
stub(account_theme).settings { { secondary_font: "One Font" } }
|
248
269
|
result = ThemeFont.google_font_url_for_theme_json(account_theme)
|
249
270
|
result.should == {
|
250
|
-
"primary_text_font" =>
|
271
|
+
"primary_text_font" => {
|
272
|
+
"name" => "One Font",
|
273
|
+
"url" => "https://fonts.googleapis.com/css?family=One+Font"
|
274
|
+
}
|
251
275
|
}
|
252
276
|
end
|
253
277
|
end
|