Skip to content

Commit 3e66aa5

Browse files
committed
Merge pull request #199 from jwhitcraft/woff2
Woff2 Support
2 parents 391084e + 412fe0a commit 3e66aa5

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ end
1010
group :test do
1111
gem 'contest'
1212
gem 'rake'
13-
gem 'mocha'
13+
gem 'mocha', '0.14.0'
1414
end
1515

1616
gemspec

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ GEM
3636
metaclass (0.0.1)
3737
mocha (0.14.0)
3838
metaclass (~> 0.0.1)
39-
rack (1.5.2)
39+
rack (1.6.4)
4040
rack-protection (1.5.1)
4141
rack
4242
rack-test (0.6.2)
@@ -69,7 +69,7 @@ DEPENDENCIES
6969
gem-release
7070
haml
7171
less
72-
mocha
72+
mocha (= 0.14.0)
7373
rake
7474
sass
7575
sinatra-assetpack!

lib/sinatra/assetpack.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def self.registered(app)
1010
# Returns a list of formats that can be served.
1111
# Anything not in this list will be rejected.
1212
def self.supported_formats
13-
@supported_formats ||= %w(css js png jpg gif svg otf eot ttf woff htc ico)
13+
@supported_formats ||= %w(css js png jpg gif svg otf eot ttf woff woff2 htc ico)
1414
end
1515

1616
# Returns a map of what MIME format each Tilt type returns.
Binary file not shown.

test/mime_type_test.rb

+5
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,9 @@ class AppTest < UnitTest
5050
get '/fonts/cantarell-regular-webfont.woff'
5151
assert last_response.content_type =~ %r[^application/font-woff]
5252
end
53+
54+
test 'woff2' do
55+
get '/fonts/cantarell-regular-webfont.woff2'
56+
assert last_response.content_type =~ %r[^application/font-woff2]
57+
end
5358
end

0 commit comments

Comments
 (0)