lib/fakes3/cli.rb in fakes3-0.1.5 vs lib/fakes3/cli.rb in fakes3-0.1.5.2
- old
+ new
@@ -7,10 +7,11 @@
default_task("server")
desc "server", "Run a server on a particular hostname"
method_option :root, :type => :string, :aliases => '-r', :required => true
method_option :port, :type => :numeric, :aliases => '-p', :required => true
+ method_option :address, :type => :string, :aliases => '-a', :required => false, :desc => "Bind to this address. Defaults to 0.0.0.0"
method_option :hostname, :type => :string, :aliases => '-h', :desc => "The root name of the host. Defaults to s3.amazonaws.com."
method_option :limit, :aliases => '-l', :type => :string, :desc => 'Rate limit for serving (ie. 50K, 1.0M)'
def server
store = nil
if options[:root]
@@ -40,11 +41,13 @@
puts $!.message
exit(-1)
end
end
+ address = options[:address] || '0.0.0.0'
+
puts "Loading FakeS3 with #{root} on port #{options[:port]} with hostname #{hostname}"
- server = FakeS3::Server.new(options[:port],store,hostname)
+ server = FakeS3::Server.new(address,options[:port],store,hostname)
server.serve
end
desc "version", "Report the current fakes3 version"
def version