httpit 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- httpit (0.4.5)
4
+ httpit (0.4.6)
5
5
  RedCloth (~> 4.2.9)
6
6
  haml (~> 4.0.2)
7
7
  sass (~> 3.2.8)
data/bin/httpit CHANGED
@@ -53,7 +53,8 @@ class HttpIt < Sinatra::Base
53
53
  end
54
54
 
55
55
  def file_url(path, file)
56
- "#{path}/#{CGI::escape(file)}"
56
+ path = "#{path}/#{file}"
57
+ path.split("/").map {|p| CGI::escape(p) }.join('/')
57
58
  end
58
59
  end
59
60
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "httpit"
3
- s.version = "0.4.5"
3
+ s.version = "0.4.6"
4
4
  s.summary = "Web server for static files"
5
5
  s.description = "Just go to folder and run `httpit` to make it avaliable as web-server"
6
6
  s.author = "Pavel Evstigneev"
@@ -55,8 +55,8 @@
55
55
  %a{:href => file_url(@path, file[0])}= file[0]
56
56
 
57
57
  - if %w{.jpg .jpeg .png .gif}.include?(File.extname(file[0]).downcase)
58
- %a{:href => "/__img_preview?file=#{@path}/#{file[0]}", :class => "preview_link"} #1024
58
+ %a{:href => "/__img_preview?file=#{file_url(@path, file[0])}", :class => "preview_link"} #1024
59
59
  - if file[2]
60
- %a{:href => "/__view?file=#{@path}/#{file[0]}", :class => "preview_link"} view
60
+ %a{:href => "/__view?file=#{file_url(@path, file[0])}", :class => "preview_link"} view
61
61
 
62
62
  %script{:type => "text/javascript"}= GEM_ROOT.join('views/utils.js').read
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: