directory_listing 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cf8138fc74458cee692795f92ea3e8436cb795e
|
4
|
+
data.tar.gz: 10a82b76d2bbdbbb7b98fb379c90c40470ee92d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 050ce306863a84e889bd0caeb1e77736d355b652302c09cd8370d8fce04051cfdc9d48e4878ded09df5079cb72c27c1c27dc903f4229a1f5cb5b4e91a9e06cc8
|
7
|
+
data.tar.gz: 23bfe4fc941b14c4952e2663493d493a3ea65fbcc1985704e41f566fb51dd889a9d548b007cf327ad58a32177d2a5740349897c9a0c0e2f1f4b0b5749b4e0e30
|
@@ -59,8 +59,12 @@ class Resource
|
|
59
59
|
# URI.unescape seems to work best to decode uris.
|
60
60
|
|
61
61
|
file = URI.unescape(file)
|
62
|
-
|
63
|
-
|
62
|
+
file_noext = file.gsub(File.extname(file), "") if @page.should_show_file_exts == false
|
63
|
+
if file_noext
|
64
|
+
file_truncated = file_noext.truncate(@page.filename_truncate_length, '...')
|
65
|
+
else
|
66
|
+
file_truncated = file.truncate(@page.filename_truncate_length, '...')
|
67
|
+
end
|
64
68
|
|
65
69
|
##
|
66
70
|
# If the requested resource is in the root public directory, the link is
|
@@ -66,7 +66,7 @@ class DirectoryListingTest < Test::Unit::TestCase
|
|
66
66
|
|
67
67
|
def test_should_show_file_exts
|
68
68
|
get '/should_show_file_exts'
|
69
|
-
assert
|
69
|
+
assert last_response.body.include?('<a href=\'/should_show_file_exts/test.txt\'>test</a>')
|
70
70
|
end
|
71
71
|
|
72
72
|
##
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: directory_listing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Myers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|