gfm-preview 1.0.1 → 1.0.2

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.
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ gfm-preview
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p448
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ghm-previw
1
+ # gfm-previw
2
2
 
3
3
  GFM (Github Flavored Markdown) preview server.
4
4
 
@@ -9,11 +9,7 @@ module GfmPreview
9
9
  def start(path, address, port)
10
10
  @server = WEBrick::HTTPServer.new({:BindAddress => address, :Port => port})
11
11
  @server.mount_proc('/') do|req, res|
12
- if req.path == '/'
13
- WEBrick::HTTPServlet::FileHandler.new(@server, path, {:FancyIndexing => true}).service(req, res)
14
- elsif req.path =~ /\.(css|ico)$/
15
- WEBrick::HTTPServlet::FileHandler.new(@server, File.join(File.dirname(__FILE__), '..', 'public')).service(req, res)
16
- else
12
+ if req.path =~ /\.(md|markdown)$/
17
13
  file_path = path + req.path
18
14
  file_name = File.basename(file_path)
19
15
  content = GitHub::Markup.render(file_path)
@@ -23,6 +19,11 @@ module GfmPreview
23
19
  res.body = body
24
20
  res.content_type = 'text/html; charset=uft-8'
25
21
  }
22
+ elsif req.path == '/bootstrap-combined.min.css' or
23
+ req.path == '/markdown-body.css'
24
+ WEBrick::HTTPServlet::FileHandler.new(@server, File.join(File.dirname(__FILE__), '..', 'public')).service(req, res)
25
+ else
26
+ WEBrick::HTTPServlet::FileHandler.new(@server, path, {:FancyIndexing => true}).service(req, res)
26
27
  end
27
28
  end
28
29
  @server.start
@@ -1,3 +1,3 @@
1
1
  module GfmPreview
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gfm-preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
12
+ date: 2013-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: github-markup
@@ -52,7 +52,8 @@ extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
54
  - .gitignore
55
- - .rvmrc
55
+ - .ruby-gemset
56
+ - .ruby-version
56
57
  - Gemfile
57
58
  - LICENSE.txt
58
59
  - README.md
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  version: '0'
88
89
  requirements: []
89
90
  rubyforge_project:
90
- rubygems_version: 1.8.24
91
+ rubygems_version: 1.8.25
91
92
  signing_key:
92
93
  specification_version: 3
93
94
  summary: GFM Preview Server
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 1.9.3@gfm-preview