Compare commits

..

4 Commits

Author SHA1 Message Date
bootstraponline 4aeb9af8a7 Release 2.4.15 2013-06-18 22:19:34 -04:00
dekimsey b37acb8bc6 Merge pull request #711 from cpence/master
Add support for file streaming
2013-06-18 19:15:57 -07:00
Charles Pence 433865e927 Require newer gollum-lib. 2013-06-18 22:10:02 -04:00
Charles Pence 5428161e0f Add support for on-disk file streaming. 2013-06-18 21:49:38 -04:00
4 changed files with 17 additions and 7 deletions
+3 -3
View File
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 1.8.7"
s.name = 'gollum'
s.version = '2.4.14'
s.date = '2013-06-15'
s.version = '2.4.15'
s.date = '2013-06-18'
s.rubyforge_project = 'gollum'
s.license = 'MIT'
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.extra_rdoc_files = %w[README.md LICENSE]
s.add_dependency 'gollum-lib', '~> 1.0.2'
s.add_dependency 'gollum-lib', '~> 1.0.3'
s.add_dependency 'sinatra', '~> 1.4.2'
s.add_dependency 'mustache', ['>= 0.99.4', '< 1.0.0']
s.add_dependency 'useragent', '~> 0.6.0'
+1 -1
View File
@@ -17,7 +17,7 @@ require File.expand_path('../gollum/uri_encode_component', __FILE__)
$KCODE = 'U' if RUBY_VERSION[0,3] == '1.8'
module Gollum
VERSION = '2.4.14'
VERSION = '2.4.15'
def self.assets_path
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
+7 -3
View File
@@ -403,9 +403,13 @@ module Precious
@bar_side = wiki.bar_side
mustache :page
elsif file = wiki.file(fullpath)
content_type file.mime_type
file.raw_data
elsif file = wiki.file(fullpath, wiki.ref, true)
if file.on_disk?
send_file file.on_disk_path, :disposition => 'inline'
else
content_type file.mime_type
file.raw_data
end
else
page_path = [path, name].compact.join('/')
redirect to("/create/#{clean_url(encodeURIComponent(page_path))}")
+6
View File
@@ -578,6 +578,12 @@ context "Frontend with lotr" do
assert_match /Bilbo Baggins/, last_response.body
end
test "streaming files to browser" do
get "/Data.csv"
assert last_response.ok?
assert last_response.headers.include? 'Content-Disposition'
end
# base path requires 'map' in a config.ru to work correctly.
test "create pages within sub-directories using base path" do
Precious::App.set(:wiki_options, { :base_path => 'wiki' })