rob-murray / ferver Goto Github PK
View Code? Open in Web Editor NEWA Ruby gem to serve files over HTTP, packaged as a Ruby gem
License: MIT License
A Ruby gem to serve files over HTTP, packaged as a Ruby gem
License: MIT License
Hi there,
Are you interested in adding etag support? I was thinking of adding an etag attribute to FoundFile, calculating sha1 hash during initialisation, then adding an etag( @file.etag ) to the controller.
Happy to send a pull request if you're interested.
Cheers,
Dan
How about adding capability of Basic Auth?
By default is off, if a config file is present then take credentials and authenticate URIs with Basic Auth?
We should test that the directory passed exists or not - currently crashes when listing files.
Options:
a) error with description of the problem and halt
b) output error to console and continue use the current directory
Ferver provides links to files with their index in URL, i.e. http://localhost:4567/files/0
It would be nice if a link with filename was also available. It is particularly useful if the files are downloaded by the script or in CLI session (need to rename them after downloading)
I'm not sure what is proper elegant way of adding it.
Hi there,
What do you think about incorporating SSL support? Pass a key / certificate in as an argument?
Cheers,
Dan
Remove the files.html
and files.json
routes and negotiate return content type via Accept request header.
Should it? Seems like a good idea, avoid messy downloads of the source files and fits with the goal to be small, lightweight and easy as possible to use. Lets do it.
I've tried to use ferver, but got this:
/var/lib/gems/1.8/gems/ferver-1.2.0/lib/ferver.rb:1: undefined method `require_relative' for main:Object (NoMethodError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/ferver-1.2.0/bin/ferver:5
from /usr/local/bin/ferver:19:in `load'
from /usr/local/bin/ferver:19
My ruby:
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
My gem list:
*** LOCAL GEMS ***
actionmailer (3.2.19)
actionpack (3.2.19)
activemodel (3.2.19)
activerecord (3.2.19)
activeresource (3.2.19)
activesupport (3.2.19)
arel (3.0.3)
awesome_nested_set (2.1.6)
builder (3.0.0)
bundler (1.6.3)
coderay (1.1.0)
erubis (2.7.0)
fastercsv (1.5.5)
ferver (1.2.0)
hike (1.2.3)
i18n (0.6.11)
journey (1.0.4)
jquery-rails (2.0.3)
json (1.8.1)
json-schema (2.2.2)
kramdown (1.3.3)
mail (2.5.4)
mime-types (1.25.1)
multi_json (1.10.1)
net-ldap (0.3.1)
pg (0.17.1)
polyglot (0.3.5)
rack (1.4.5)
rack-cache (1.2)
rack-openid (1.4.2)
rack-protection (1.5.3)
rack-ssl (1.3.4)
rack-test (0.6.2)
rails (3.2.19)
railties (3.2.19)
rake (10.1.1)
rdoc (3.12.2)
redcarpet (2.3.0)
ruby-openid (2.3.0)
sinatra (1.4.5)
sprockets (2.2.2)
thor (0.19.1)
tilt (1.4.1)
treetop (1.4.15)
tzinfo (0.3.40)
vcard (0.2.12)
Should the Sinatra app be run in production mode when run from gem executable?
Add redirect when requesting http://localhost:4567/
to /files
.
So that we dont have to type it into a browser.
Hi there,
It'd be nice if it would ignore files beginning with a dot. If you're interested, I can branch and submit a pull request, or you could just add :
next if file_name =~ /^./
to lib/ferver/file_list.rb, line 45.
Cheers,
Dan
It would be handy if ferver will show your machine's IP address to quickly copy and paste it and send to another person. Otherwise you need to craft a link by hand.
Allow external configuration of the ferver directory so that no manual hacking of the code is required. Pseudo example below
ruby run_my_ferver -d /path/to/dir
Fall back to DEFAULT if none passed.
When listing files; ignore directories
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.