directory_listing 0.6.1 → 0.6.2

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: 35bcac3f956acf23d0bc4c1405ee7078076a8b89
4
- data.tar.gz: 1c9b9fb157c38db682288f905cceecded136e8b0
3
+ metadata.gz: 9692a7377e281b36851d6caf01896f1980307217
4
+ data.tar.gz: abd645f08b3adf7bbd2d22c24cebec1650166388
5
5
  SHA512:
6
- metadata.gz: f811264695c75716c853fff4f6e28fc79f9039257976ef7edbd589c82eeb2c898803447baf6c16ca0e3b615f3eb484d1841dd03deef99f3c4850e138fefc864e
7
- data.tar.gz: 75fd766d03963abfc3d3decdbb68260ef7ddd4c0bf826c6419ef8fa2d6c378d7628c9cbc9ea14d680e89e70bdaf8d3958196efc5284b21780ab84eea1c2b361c
6
+ metadata.gz: 6154b4696475e4a01c0e6c12e9901b3e2d46b784c9aa167f9b7c82358c14788909d05f473de298862ad6a6ff96d3f0816228d2eb2c20332129d5d2c5c21cfdf8
7
+ data.tar.gz: 61e7353073d51b3a2ddfe36a195f190324344f1e5e8e4eaa27df44648fde8051064a20933613946f174a28f1c40b47e399fd86f8c1c6c2510c37fe1ccdc3ef12
data/README.md CHANGED
@@ -65,6 +65,7 @@ Available options:
65
65
 
66
66
  - ```stylesheet``` - a stylesheet to style the generated directory listing with, relative to your ```public_folder```
67
67
  - ```readme``` - an HTML string that will be appended at the footer of the generated directory listing
68
+ - ```favicon``` - URL to a favicon
68
69
  - ```should_list_invisibles``` - whether the directory listing should include invisibles (dotfiles) - true or false, defaults to false
69
70
  - ```should_show_file_exts``` - whether the directory listing should show file extensions - true or false, defaults to true
70
71
  - ```smart_sort``` - whether sorting should ignore "[Tt]he " at the beginning of filenames - true or false, defaults to true
@@ -28,6 +28,7 @@ module Sinatra
28
28
  :last_modified_format => "%Y-%m-%d %H:%M:%S",
29
29
  :filename_truncate_length => 40,
30
30
  :stylesheet => "",
31
+ :favicon => "",
31
32
  :readme => ""
32
33
  }.merge(o)
33
34
 
@@ -46,9 +47,10 @@ module Sinatra
46
47
  page.current_page = URI.unescape(request.path)
47
48
 
48
49
  ##
49
- # Set the readme and stylesheet
50
+ # Set the readme, stylesheet, and favicon
50
51
 
51
52
  page.readme = options[:readme] if options[:readme]
53
+ page.favicon = options[:favicon] if options[:favicon]
52
54
  if options[:stylesheet]
53
55
  page.stylesheet = "<link rel='stylesheet' type='text/css' href='/#{options[:stylesheet].sub(/^[\/]*/,"")}'>"
54
56
  end
@@ -6,6 +6,7 @@ module Sinatra
6
6
  <head>
7
7
  <title>Index of <%= page.current_page %>, sorted <%= page.sort_item_display %> <%= page.sort_direction_display %></title>
8
8
  <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
9
+ <link rel='shortcut icon' href='<%= page.favicon %>'>
9
10
  <%= page.stylesheet %>
10
11
  </head>
11
12
  <body>
@@ -9,6 +9,7 @@ class Page
9
9
  :last_modified_format,
10
10
  :filename_truncate_length,
11
11
  :stylesheet,
12
+ :favicon,
12
13
  :readme,
13
14
  :public_folder,
14
15
  :request_path,
@@ -1,3 +1,3 @@
1
1
  module Directory_listing
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
Binary file
@@ -14,6 +14,12 @@ get '/readme' do
14
14
  })
15
15
  end
16
16
 
17
+ get '/favicon' do
18
+ list({
19
+ :favicon => "/favicon/favicon.ico"
20
+ })
21
+ end
22
+
17
23
  get '/should_list_invisibles' do
18
24
  list({
19
25
  :should_list_invisibles => true
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.6.1
4
+ version: 0.6.2
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-12-29 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -128,6 +128,7 @@ files:
128
128
  - lib/sinatra/directory_listing/resource.rb
129
129
  - lib/sinatra/directory_listing/version.rb
130
130
  - test/public/1234.txt
131
+ - test/public/favicon/favicon.ico
131
132
  - test/public/level1/level2/level3/level 4/test
132
133
  - test/public/level1/level2/level3/test
133
134
  - test/public/level1/level2/test
@@ -167,6 +168,7 @@ specification_version: 4
167
168
  summary: Easy, CSS-styled, Apache-like directory listings for Sinatra.
168
169
  test_files:
169
170
  - test/public/1234.txt
171
+ - test/public/favicon/favicon.ico
170
172
  - test/public/level1/level2/level3/level 4/test
171
173
  - test/public/level1/level2/level3/test
172
174
  - test/public/level1/level2/test