font_assets 0.1.1 → 0.1.2
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.
- data/README.md +8 -0
 - data/lib/font_assets/railtie.rb +1 -1
 - data/lib/font_assets/version.rb +1 -1
 - data/spec/middleware_spec.rb +8 -8
 - metadata +17 -7
 
    
        data/README.md
    CHANGED
    
    | 
         @@ -101,3 +101,11 @@ License 
     | 
|
| 
       101 
101 
     | 
    
         
             
            -------
         
     | 
| 
       102 
102 
     | 
    
         | 
| 
       103 
103 
     | 
    
         
             
            Font Assets is released under the MIT license.
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
            Contributors
         
     | 
| 
      
 106 
     | 
    
         
            +
            ------------
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
            * [Nathanial Bibler](https://github.com/nbibler)
         
     | 
| 
      
 109 
     | 
    
         
            +
            * [Eric Allam](https://github.com/rubymaverick)
         
     | 
| 
      
 110 
     | 
    
         
            +
            * [Ryan Montgomery](https://github.com/rmontgomery429)
         
     | 
| 
      
 111 
     | 
    
         
            +
            * [Jack Foy](https://github.com/jfoy)
         
     | 
    
        data/lib/font_assets/railtie.rb
    CHANGED
    
    | 
         @@ -7,7 +7,7 @@ module FontAssets 
     | 
|
| 
       7 
7 
     | 
    
         
             
                initializer "font_assets.configure_rails_initialization" do |app|
         
     | 
| 
       8 
8 
     | 
    
         
             
                  config.font_assets.origin ||= "*"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
                  app.middleware.insert_before ' 
     | 
| 
      
 10 
     | 
    
         
            +
                  app.middleware.insert_before 'Rack::Lock', FontAssets::Middleware, config.font_assets.origin
         
     | 
| 
       11 
11 
     | 
    
         
             
                end
         
     | 
| 
       12 
12 
     | 
    
         
             
              end
         
     | 
| 
       13 
13 
     | 
    
         
             
            end
         
     | 
    
        data/lib/font_assets/version.rb
    CHANGED
    
    
    
        data/spec/middleware_spec.rb
    CHANGED
    
    | 
         @@ -3,17 +3,17 @@ require 'font_assets/middleware' 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            describe FontAssets::Middleware do
         
     | 
| 
       5 
5 
     | 
    
         
             
              it 'passes all Rack::Lint checks' do
         
     | 
| 
       6 
     | 
    
         
            -
                app = Rack::Lint.new( 
     | 
| 
      
 6 
     | 
    
         
            +
                app = Rack::Lint.new(load_app)
         
     | 
| 
       7 
7 
     | 
    
         
             
                request app, '/'
         
     | 
| 
       8 
8 
     | 
    
         
             
              end
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              context 'for GET requests' do
         
     | 
| 
       11 
11 
     | 
    
         
             
                context 'to font assets' do
         
     | 
| 
       12 
12 
     | 
    
         
             
                  let(:app) { load_app 'http://test.origin' }
         
     | 
| 
       13 
     | 
    
         
            -
                  let(: 
     | 
| 
      
 13 
     | 
    
         
            +
                  let(:response) { request app, '/test.ttf' }
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
                  context 'the response headers' do
         
     | 
| 
       16 
     | 
    
         
            -
                    subject {  
     | 
| 
      
 16 
     | 
    
         
            +
                    subject { response[1] }
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
                    its(["Access-Control-Allow-Headers"]) { should == "x-requested-with" }
         
     | 
| 
       19 
19 
     | 
    
         
             
                    its(["Access-Control-Max-Age"]) { should == "3628800" }
         
     | 
| 
         @@ -25,10 +25,10 @@ describe FontAssets::Middleware do 
     | 
|
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
                context 'to non-font assets' do
         
     | 
| 
       27 
27 
     | 
    
         
             
                  let(:app) { load_app }
         
     | 
| 
       28 
     | 
    
         
            -
                  let(: 
     | 
| 
      
 28 
     | 
    
         
            +
                  let(:response) { request app, '/' }
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
                  context 'the response headers' do
         
     | 
| 
       31 
     | 
    
         
            -
                    subject {  
     | 
| 
      
 31 
     | 
    
         
            +
                    subject { response[1] }
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                    its(["Access-Control-Allow-Headers"]) { should be_nil }
         
     | 
| 
       34 
34 
     | 
    
         
             
                    its(["Access-Control-Max-Age"]) { should be_nil }
         
     | 
| 
         @@ -41,10 +41,10 @@ describe FontAssets::Middleware do 
     | 
|
| 
       41 
41 
     | 
    
         | 
| 
       42 
42 
     | 
    
         
             
              context 'for OPTIONS requests' do
         
     | 
| 
       43 
43 
     | 
    
         
             
                let(:app) { load_app 'http://test.options' }
         
     | 
| 
       44 
     | 
    
         
            -
                let(: 
     | 
| 
      
 44 
     | 
    
         
            +
                let(:response) { request app, '/test.ttf', :method => 'OPTIONS' }
         
     | 
| 
       45 
45 
     | 
    
         | 
| 
       46 
46 
     | 
    
         
             
                context 'the response headers' do
         
     | 
| 
       47 
     | 
    
         
            -
                  subject {  
     | 
| 
      
 47 
     | 
    
         
            +
                  subject { response[1] }
         
     | 
| 
       48 
48 
     | 
    
         | 
| 
       49 
49 
     | 
    
         
             
                  its(["Access-Control-Allow-Headers"]) { should == "x-requested-with" }
         
     | 
| 
       50 
50 
     | 
    
         
             
                  its(["Access-Control-Max-Age"]) { should == "3628800" }
         
     | 
| 
         @@ -57,7 +57,7 @@ describe FontAssets::Middleware do 
     | 
|
| 
       57 
57 
     | 
    
         
             
                end
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
59 
     | 
    
         
             
                context 'the response body' do
         
     | 
| 
       60 
     | 
    
         
            -
                  subject {  
     | 
| 
      
 60 
     | 
    
         
            +
                  subject { response[2] }
         
     | 
| 
       61 
61 
     | 
    
         
             
                  it { should be_empty }
         
     | 
| 
       62 
62 
     | 
    
         
             
                end
         
     | 
| 
       63 
63 
     | 
    
         
             
              end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: font_assets
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.2
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,11 +9,11 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2012- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-08-18 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: rack
         
     | 
| 
       16 
     | 
    
         
            -
              requirement:  
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       17 
17 
     | 
    
         
             
                none: false
         
     | 
| 
       18 
18 
     | 
    
         
             
                requirements:
         
     | 
| 
       19 
19 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -21,10 +21,15 @@ dependencies: 
     | 
|
| 
       21 
21 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       22 
22 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       23 
23 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       24 
     | 
    
         
            -
              version_requirements:  
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 25 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 26 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 27 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 29 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       25 
30 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       26 
31 
     | 
    
         
             
              name: rspec
         
     | 
| 
       27 
     | 
    
         
            -
              requirement:  
     | 
| 
      
 32 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       28 
33 
     | 
    
         
             
                none: false
         
     | 
| 
       29 
34 
     | 
    
         
             
                requirements:
         
     | 
| 
       30 
35 
     | 
    
         
             
                - - ~>
         
     | 
| 
         @@ -32,7 +37,12 @@ dependencies: 
     | 
|
| 
       32 
37 
     | 
    
         
             
                    version: '2.0'
         
     | 
| 
       33 
38 
     | 
    
         
             
              type: :development
         
     | 
| 
       34 
39 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       35 
     | 
    
         
            -
              version_requirements:  
     | 
| 
      
 40 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 41 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 42 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 43 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 44 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 45 
     | 
    
         
            +
                    version: '2.0'
         
     | 
| 
       36 
46 
     | 
    
         
             
            description: Improve font serving in Rails 3.1
         
     | 
| 
       37 
47 
     | 
    
         
             
            email:
         
     | 
| 
       38 
48 
     | 
    
         
             
            - rubymaverick@gmail.com
         
     | 
| 
         @@ -75,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       75 
85 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       76 
86 
     | 
    
         
             
            requirements: []
         
     | 
| 
       77 
87 
     | 
    
         
             
            rubyforge_project: font_assets
         
     | 
| 
       78 
     | 
    
         
            -
            rubygems_version: 1.8. 
     | 
| 
      
 88 
     | 
    
         
            +
            rubygems_version: 1.8.23
         
     | 
| 
       79 
89 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       80 
90 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       81 
91 
     | 
    
         
             
            summary: Improve font serving in Rails 3.1
         
     |