dbrady-sinfile 0.0.4

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.
Files changed (3) hide show
  1. data/README.txt +8 -0
  2. data/bin/sinfile +16 -0
  3. metadata +62 -0
data/README.txt ADDED
@@ -0,0 +1,8 @@
1
+ = SinFile
2
+
3
+ Sinatra File Server.
4
+
5
+ Just run "sinfile" in the current directory and you're done. Point
6
+ your browser at http://localhost:4567 to see your files.
7
+
8
+ Choose a different port with -p, e.g. "sinfile -p 80".
data/bin/sinfile ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ gem 'sinatra'
5
+ require 'sinatra'
6
+
7
+ Sinatra::Application.default_options.merge!(
8
+ :public => File.expand_path('.')
9
+ )
10
+
11
+
12
+ get '/' do
13
+ dir = File.expand_path('.')
14
+ str = "<ul>" + (Dir[File.join(dir, '**', '*')].reject {|p| File.directory? p }.map {|p| p.sub %r{^#{dir}/}, ""}.map {|p| "<li><a href=\"#{p}\">#{p}</a></li>"} * "\n") + "</ul>"
15
+ "#{dir}<br/>#{str}"
16
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dbrady-sinfile
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ platform: ruby
6
+ authors:
7
+ - David Brady
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-13 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: sinatra
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ description: SinFile - Simple file server using Sinatra
25
+ email: github@shinybit.com
26
+ executables:
27
+ - sinfile
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - README.txt
32
+ files:
33
+ - bin/sinfile
34
+ - README.txt
35
+ has_rdoc: false
36
+ homepage: http://github.com/dbrady/sinfile
37
+ post_install_message:
38
+ rdoc_options: []
39
+
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ version:
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: "0"
53
+ version:
54
+ requirements: []
55
+
56
+ rubyforge_project:
57
+ rubygems_version: 1.2.0
58
+ signing_key:
59
+ specification_version: 2
60
+ summary: Simple file server using Sinatra
61
+ test_files: []
62
+