diff --git a/README b/README index 14201c3..19b01ad 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ invoicing. * Running project & tasks overview * Timeline overview of registered time -* Management customer information +* Management customer information * Administration of running and billed projects/task with * fixed cost, or * hourly rates @@ -28,7 +28,6 @@ The following Ruby libraries are required: * ActionPack (>= 2.3) for ActionView * ActiveSupport (>= 2.3) -* MIME-Types * Rack (for deployment using Apache/Rackup) * SASS @@ -88,7 +87,7 @@ Use the following basic configuration: XSendFile on - + Now, restart Apache and visit http://some.domain.tld/. @@ -103,10 +102,10 @@ serving files under +/path/to/document_root+, i.e. something like: - + Then, add a symlink from the +public+ subdirectory of to the document -root, e.g. +root, e.g. ln -s /path/to/stoptime/public /path/to/document_root/stoptime diff --git a/stoptime.rb b/stoptime.rb index 93b21d8..2caf31e 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -14,7 +14,6 @@ require "action_view" require "active_support" require "camping" require "markaby" -require "mime/types" require "pathname" require "sass/plugin/rack" @@ -986,10 +985,10 @@ module StopTime::Controllers # Sets the headers such that the web server will fetch and offer # the file identified by the _path_ relative to the +public/+ subdirectory. def get(path) - mime_type = MIME::Types.type_for(path).first - @headers['Content-Type'] = mime_type.nil? ? "text/plain" : mime_type.to_s unless path.include? ".." - @headers['X-Sendfile'] = (PUBLIC_DIR + path).to_s + full_path = PUBLIC_DIR + path + @headers['Content-Type'] = Rack::Mime.mime_type(full_path.extname) + @headers['X-Sendfile'] = full_path.to_s else @status = "403" "Error 403: Invalid path: #{path}" @@ -1051,9 +1050,8 @@ module StopTime::Views if @tasks.empty? p do - text "No customers, projects or tasks found! Set them up " - a "here", :href => R(CustomersNew) - text "." + "No customers, projects or tasks found! Set them up " + + "#{a "here", :href => R(CustomersNew)}." end else @tasks.keys.sort_by { |c| c.name }.each do |customer|