lanyon 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/lanyon/router.rb +10 -7
- data/lib/lanyon/version.rb +2 -2
- data/test/source/with blank.md +4 -0
- data/test/source/with+plus.md +4 -0
- data/test/test_integration.rb +19 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c84c1a698fbc54f0d0a02297957a8622036aa30
|
4
|
+
data.tar.gz: 9188437aeac7bc69af55b9e2030f81adc083e0dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba31536e3c4b1ef74fc1f54acda3c4500788f9dbc0f384ab63e32dad6956d57f74d32100f3c26ccd97fb8fe32e9a43dd02289455ce4a7f6689b2b30a4963a4ac
|
7
|
+
data.tar.gz: c0ba43239bf3ab0026ae81b56054f6a88ae5a8eb18288898a8dfd26e5dce329c79e4c23b89853a70e87fd21c0d457aff32c7a94a0ea5a4a36eac96b66f6639fa
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2015 Marcus Stollsteimer
|
3
|
+
Copyright (c) 2015-2016 Marcus Stollsteimer
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -93,7 +93,7 @@ Lanyon was inspired by [rack-jekyll][rack-jekyll] and written as a replacement.
|
|
93
93
|
|
94
94
|
## License
|
95
95
|
|
96
|
-
Copyright © 2015 Marcus Stollsteimer
|
96
|
+
Copyright © 2015-2016 Marcus Stollsteimer
|
97
97
|
|
98
98
|
Lanyon is licensed under the [MIT License][MIT].
|
99
99
|
See also the included `LICENSE` file for more information.
|
data/lib/lanyon/router.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "rack/utils"
|
2
|
+
require "uri"
|
2
3
|
|
3
4
|
|
4
5
|
module Lanyon
|
@@ -47,14 +48,16 @@ module Lanyon
|
|
47
48
|
!fullpath.end_with?("/") && FileTest.file?(fullpath + "/index.html")
|
48
49
|
end
|
49
50
|
|
50
|
-
def
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
def unescape_path(path) # :nodoc:
|
52
|
+
URI::Parser.new.unescape(path)
|
53
|
+
end
|
54
|
+
|
55
|
+
def normalize_path_info(path_info) # :nodoc:
|
56
|
+
path = unescape_path(path_info)
|
57
|
+
|
58
|
+
path << "index.html" if path.end_with?("/")
|
56
59
|
|
57
|
-
Rack::Utils.clean_path_info(
|
60
|
+
Rack::Utils.clean_path_info(path)
|
58
61
|
end
|
59
62
|
end
|
60
63
|
end
|
data/lib/lanyon/version.rb
CHANGED
data/test/test_integration.rb
CHANGED
@@ -272,6 +272,25 @@ describe "when handling requests" do
|
|
272
272
|
end
|
273
273
|
|
274
274
|
|
275
|
+
describe "when URL contains special characters" do
|
276
|
+
|
277
|
+
it "returns status 200 for URL with escapes" do
|
278
|
+
@response = @request.get("%2F2015%2F11%2F05%2Fhello-world.html")
|
279
|
+
@response.status.must_equal 200
|
280
|
+
end
|
281
|
+
|
282
|
+
it "returns status 200 for resource name with blank" do
|
283
|
+
@response = @request.get("with%20blank.html")
|
284
|
+
@response.status.must_equal 200
|
285
|
+
end
|
286
|
+
|
287
|
+
it "returns status 200 for resource name with plus" do
|
288
|
+
@response = @request.get("with+plus.html")
|
289
|
+
@response.status.must_equal 200
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
|
275
294
|
describe "when handling If-Modified-Since requests" do
|
276
295
|
|
277
296
|
before do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lanyon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Stollsteimer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -104,6 +104,8 @@ files:
|
|
104
104
|
- test/source/index.md
|
105
105
|
- test/source/js/test.min.js
|
106
106
|
- test/source/no-extension
|
107
|
+
- test/source/with blank.md
|
108
|
+
- test/source/with+plus.md
|
107
109
|
- test/test_build.rb
|
108
110
|
- test/test_configuration.rb
|
109
111
|
- test/test_integration.rb
|
@@ -130,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
132
|
version: '0'
|
131
133
|
requirements: []
|
132
134
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.5.1
|
134
136
|
signing_key:
|
135
137
|
specification_version: 4
|
136
138
|
summary: Lanyon serves your Jekyll site as a Rack application.
|