pokapoka 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/pokapoka/version.rb +1 -1
- data/lib/pokapoka.rb +10 -1
- data/pokapoka.gemspec +1 -0
- metadata +25 -17
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f11a6962746dfa2bd6fe51220f6b4b0ff8922438
|
4
|
+
data.tar.gz: 810931512ae7fee91cc42b37708429628f6875bb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 688da02e5d021a20ca16f874d79508962573bbf2ddeaae887dc091533e0ee27d6f7a65acce6c7928db1cbb88554a063789cdf6da91cdc0c72af31d053a667071
|
7
|
+
data.tar.gz: 295e892e9100a9d8d136e624d31357501ad238acbfdce03e68a7a0dcc08f978a51ca668fe5719f24a7c8231aaa2414bde7cc7cc945a5d2eb46db6063b38d43c0
|
data/lib/pokapoka/version.rb
CHANGED
data/lib/pokapoka.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "pokapoka/version"
|
2
2
|
require "github/markdown"
|
3
3
|
require 'rack'
|
4
|
+
require "launchy"
|
4
5
|
|
5
6
|
module Pokapoka
|
6
7
|
def self.app
|
@@ -15,15 +16,23 @@ module Pokapoka
|
|
15
16
|
app = Proc.new do |env|
|
16
17
|
path = env["REQUEST_URI"].sub("/", "").strip
|
17
18
|
path = path == "" ? "README.md" : path
|
19
|
+
|
20
|
+
path = File.join(Dir.pwd, path)
|
21
|
+
|
18
22
|
if File.exist?(path)
|
19
23
|
[200, {"Content-type" => "text/html"}, tpl.gsub("BODY", GitHub::Markdown.render_gfm(File.read(path))).each_line]
|
20
24
|
else
|
21
|
-
[404, {}, "
|
25
|
+
[404, {}, "File #{path} not found".each_line]
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
25
29
|
|
26
30
|
def self.run!
|
31
|
+
Thread.new do
|
32
|
+
sleep 2
|
33
|
+
Launchy.open("http://localhost:9999")
|
34
|
+
end
|
35
|
+
|
27
36
|
::Rack::Handler.default.run app, :Port => 9999
|
28
37
|
end
|
29
38
|
end
|
data/pokapoka.gemspec
CHANGED
metadata
CHANGED
@@ -1,46 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pokapoka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tymon Tobolski
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-03-24 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rack
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: github-markdown
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: launchy
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
44
53
|
- !ruby/object:Gem::Version
|
45
54
|
version: '0'
|
46
55
|
description: Show .md files
|
@@ -62,27 +71,26 @@ files:
|
|
62
71
|
- pokapoka.gemspec
|
63
72
|
homepage: ''
|
64
73
|
licenses: []
|
74
|
+
metadata: {}
|
65
75
|
post_install_message:
|
66
76
|
rdoc_options: []
|
67
77
|
require_paths:
|
68
78
|
- lib
|
69
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
80
|
requirements:
|
72
|
-
- -
|
81
|
+
- - '>='
|
73
82
|
- !ruby/object:Gem::Version
|
74
83
|
version: '0'
|
75
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
85
|
requirements:
|
78
|
-
- -
|
86
|
+
- - '>='
|
79
87
|
- !ruby/object:Gem::Version
|
80
88
|
version: '0'
|
81
89
|
requirements: []
|
82
90
|
rubyforge_project:
|
83
|
-
rubygems_version:
|
91
|
+
rubygems_version: 2.0.0
|
84
92
|
signing_key:
|
85
|
-
specification_version:
|
93
|
+
specification_version: 4
|
86
94
|
summary: Show .md files
|
87
95
|
test_files: []
|
88
96
|
has_rdoc:
|