rack-static-if-present 0.2.1 → 0.3.0
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/Gemfile.lock +3 -1
- data/lib/rack-static-if-present.rb +9 -4
- data/lib/rack-static-if-present/version.rb +1 -1
- data/rack-static-if-present.gemspec +3 -0
- data/test/spec_rack-static-if-present.rb +1 -2
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79ba9502b26dfb2b1f7c0de9b24bd6f00d9ee797
|
|
4
|
+
data.tar.gz: b56356ff3ab20ebe6cd541b33723c2705b8049e5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0054d3233fd9706bb03b2ce80ac3bb657b20506591b8283be888d54d63e8124a652585168394eb2ac860da53948a8a4b28c4d38f9302996d05904c4a83008e13
|
|
7
|
+
data.tar.gz: 63c7a2ef8c017cb1ab396e9139aea74fbd6639d2511d96910635d1b31ae763b92d5039a9ed838c302189bc27124e2d2ad9c67144fc906f94e84924cec2714c3b
|
data/Gemfile.lock
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rack-static-if-present (0.
|
|
4
|
+
rack-static-if-present (0.3.0)
|
|
5
5
|
rack (> 1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: http://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
+
bacon (1.2.0)
|
|
10
11
|
rack (1.5.2)
|
|
11
12
|
|
|
12
13
|
PLATFORMS
|
|
13
14
|
ruby
|
|
14
15
|
|
|
15
16
|
DEPENDENCIES
|
|
17
|
+
bacon
|
|
16
18
|
rack-static-if-present!
|
|
@@ -2,10 +2,15 @@ module Rack
|
|
|
2
2
|
class StaticIfPresent
|
|
3
3
|
def initialize(app, options={})
|
|
4
4
|
@app = app
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
options = options.dup
|
|
6
|
+
@urls = options.delete(:urls) || ["/favicon.ico"]
|
|
7
|
+
root = options.delete(:root) || Dir.pwd
|
|
8
|
+
new_options = options.inject({}) do |recased_opts, (k,v)|
|
|
9
|
+
new_key = k.to_s.split("_").collect(&:capitalize).join("-")
|
|
10
|
+
recased_opts[new_key] = v
|
|
11
|
+
recased_opts
|
|
12
|
+
end
|
|
13
|
+
@file_server = Rack::File.new(root, new_options)
|
|
9
14
|
end
|
|
10
15
|
|
|
11
16
|
def call(env)
|
|
@@ -18,6 +18,9 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
20
|
s.require_paths = ["lib"]
|
|
21
|
+
s.license = 'MIT'
|
|
21
22
|
|
|
22
23
|
s.add_dependency 'rack', ['> 1']
|
|
24
|
+
|
|
25
|
+
s.add_development_dependency 'bacon'
|
|
23
26
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__)) + '/../lib/rack-static-if-present'
|
|
2
2
|
require 'rack/mock'
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
class DummyApp
|
|
5
5
|
def call(env)
|
|
6
6
|
[200, {}, ["Hello World"]]
|
|
@@ -27,7 +27,6 @@ describe Rack::StaticIfPresent do
|
|
|
27
27
|
# it "404s if url root is known but it can't find the file" do
|
|
28
28
|
it "calls down the chain if url root is known but it can't find the file" do
|
|
29
29
|
res = @request.get("/cgi/foo")
|
|
30
|
-
# res.should.be.not_found
|
|
31
30
|
res.body.should == "Hello World"
|
|
32
31
|
end
|
|
33
32
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rack-static-if-present
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sam Schenkman-Moore
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - '>'
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: bacon
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - '>='
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - '>='
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
27
41
|
description: Not much to explain. Not a lot of code, but wanted it packaged up for
|
|
28
42
|
easy use/deployment.
|
|
29
43
|
email:
|
|
@@ -49,7 +63,8 @@ files:
|
|
|
49
63
|
- test/helper.rb
|
|
50
64
|
- test/spec_rack-static-if-present.rb
|
|
51
65
|
homepage: http://github.com/samsm/rack-static-if-present
|
|
52
|
-
licenses:
|
|
66
|
+
licenses:
|
|
67
|
+
- MIT
|
|
53
68
|
metadata: {}
|
|
54
69
|
post_install_message:
|
|
55
70
|
rdoc_options: []
|