bin/ferver in ferver-1.2.1 vs bin/ferver in ferver-1.3.0
- old
+ new
@@ -1,16 +1,20 @@
#!/usr/bin/env ruby
require 'optparse'
-require 'sinatra'
+$:.unshift File.join( File.dirname(__FILE__), "/../lib")
require 'ferver'
options = {}
OptionParser.new do |opts|
opts.banner = 'Ferver: A simple web app to serve files over HTTP. Version: ' + Ferver::VERSION
opts.separator ''
+ opts.on('-a', '--all', 'Serve hidden files') do |a|
+ options[:hidden] = a
+ end
+
opts.on('-d', '--directory [DIRECTORY]', 'Specify the path to the directory to serve files from [optional]') do |directory|
options[:directory] = directory
end
opts.on("-h", "--help", "Displays help") do
@@ -18,9 +22,10 @@
exit
end
end.parse!
Ferver.configure do |config|
+ config.serve_hidden = options[:hidden]
config.directory_path = options[:directory]
end
Ferver::App.set :environment, :production
# run!