pokapoka 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pokapoka.rb +10 -5
- data/lib/pokapoka/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4bd821c3acd88a84efe79df0d2fbc10926b5f18
|
4
|
+
data.tar.gz: 66842b9975b583c1708f8f3f1bebd6e2c39570f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffac04c88d2d064b60837993b2d66b7f200607f0fa27ed4053a309be54eb061665416aab5d164f3d7e4321fd6644388c1c2c7173f0ab423d212ccac20d03ece7
|
7
|
+
data.tar.gz: 353554526e26243e9714e7c2c173fe3adaa00c60c60e1c332a7441467cbf0c61696176728285a412b8c160bf7a12713c3b61e7c1bf431e1af9d20432ed54e051
|
data/lib/pokapoka.rb
CHANGED
@@ -7,7 +7,7 @@ module Pokapoka
|
|
7
7
|
def self.app
|
8
8
|
tpl = '<html>
|
9
9
|
<head>
|
10
|
-
<link href="https://gist.github.com/assets/application-
|
10
|
+
<link href="https://gist.github.com/assets/application-6ee6749e63e8ef98c7d45e7877a8c777.css" media="screen, print" rel="stylesheet" />
|
11
11
|
<style type="text/css">article{max-width:900px;margin:auto;padding:50px;border:1px solid #ccc;border-top:0;}</style>
|
12
12
|
</head>
|
13
13
|
<body><article class="markdown-body">BODY</atricle></body>
|
@@ -15,12 +15,17 @@ module Pokapoka
|
|
15
15
|
|
16
16
|
app = Proc.new do |env|
|
17
17
|
path = env["PATH_INFO"].sub("/", "").strip
|
18
|
-
path = path == "" ? "README.md" : path
|
19
18
|
|
20
|
-
|
19
|
+
candidates = if path == ""
|
20
|
+
["README.md", "README.mkdwn", "README.markdown"]
|
21
|
+
else
|
22
|
+
[path]
|
23
|
+
end
|
24
|
+
|
25
|
+
file = candidates.map {|f| File.join(Dir.pwd, f) }.find {|f| File.exists?(f) }
|
21
26
|
|
22
|
-
if
|
23
|
-
[200, {"Content-type" => "text/html"}, tpl.gsub("BODY", GitHub::Markdown.render_gfm(File.read(
|
27
|
+
if file
|
28
|
+
[200, {"Content-type" => "text/html"}, tpl.gsub("BODY", GitHub::Markdown.render_gfm(File.read(file))).each_line]
|
24
29
|
else
|
25
30
|
[404, {}, "File #{path} not found".each_line]
|
26
31
|
end
|
data/lib/pokapoka/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pokapoka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tymon Tobolski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -88,9 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.1.11
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Show .md files
|
95
95
|
test_files: []
|
96
|
-
has_rdoc:
|