cg 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.mkd +8 -1
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/cg.gemspec +9 -5
- data/lib/cg/convert.rb +0 -0
- data/lib/cg/rebuild.rb +0 -0
- data/lib/cg/server.rb +24 -0
- data/skel/templates/html.rb +2 -2
- metadata +30 -15
data/README.mkd
CHANGED
@@ -9,6 +9,7 @@ cg is A Ruby based HTML "contents generator".
|
|
9
9
|
|
10
10
|
### Required RubyGems
|
11
11
|
|
12
|
+
- rack
|
12
13
|
- rake
|
13
14
|
- jeweler
|
14
15
|
- tilt
|
@@ -51,6 +52,12 @@ cg is A Ruby based HTML "contents generator".
|
|
51
52
|
$ cd cg.example.com/markdown/
|
52
53
|
$ cg convert markdown_file
|
53
54
|
|
55
|
+
4. Server
|
56
|
+
|
57
|
+
$ cg server
|
58
|
+
|
59
|
+
Access to [http://localhost:9292](http://localhost:9292)
|
60
|
+
|
54
61
|
|
55
62
|
### Tips
|
56
63
|
|
@@ -59,7 +66,7 @@ cg is A Ruby based HTML "contents generator".
|
|
59
66
|
$ vi .vimrc
|
60
67
|
> autocmd BufWritePost *.mkd :silent !cg convert % > /dev/null
|
61
68
|
|
62
|
-
2. After save
|
69
|
+
2. After save hook for Emacs
|
63
70
|
|
64
71
|
|
65
72
|
### Note on Patches/Pull Requests
|
data/Rakefile
CHANGED
@@ -5,11 +5,12 @@ begin
|
|
5
5
|
require 'jeweler'
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = 'cg'
|
8
|
-
gem.summary = '
|
8
|
+
gem.summary = 'HTML5 Contents Generator'
|
9
9
|
gem.description = 'cg is A Ruby based contents generator'
|
10
10
|
gem.email = "tomohiro.t+github@gmail.com"
|
11
11
|
gem.homepage = 'http://rubygems.org/gems/cg'
|
12
12
|
gem.authors = ["Tomohiro, TAIRA"]
|
13
|
+
gem.add_dependency 'rack', '>= 1.1.0'
|
13
14
|
gem.add_dependency 'tilt', '>= 0.9'
|
14
15
|
gem.add_dependency 'erubis', '>= 2.6.5'
|
15
16
|
gem.add_dependency 'nokogiri', '>= 1.4.1'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/cg.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cg}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tomohiro, TAIRA"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-05-13}
|
13
13
|
s.default_executable = %q{cg}
|
14
14
|
s.description = %q{cg is A Ruby based contents generator}
|
15
15
|
s.email = %q{tomohiro.t+github@gmail.com}
|
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
"lib/cg/convert.rb",
|
32
32
|
"lib/cg/rebuild.rb",
|
33
33
|
"lib/cg/scratch.rb",
|
34
|
+
"lib/cg/server.rb",
|
34
35
|
"lib/contents_generator.rb",
|
35
36
|
"skel/.exclude",
|
36
37
|
"skel/images/please_puts_image_here",
|
@@ -54,10 +55,10 @@ Gem::Specification.new do |s|
|
|
54
55
|
s.rdoc_options = ["--charset=UTF-8"]
|
55
56
|
s.require_paths = ["lib"]
|
56
57
|
s.rubygems_version = %q{1.3.6}
|
57
|
-
s.summary = %q{
|
58
|
+
s.summary = %q{HTML5 Contents Generator}
|
58
59
|
s.test_files = [
|
59
|
-
"spec/
|
60
|
-
"spec/
|
60
|
+
"spec/cg_spec.rb",
|
61
|
+
"spec/spec_helper.rb"
|
61
62
|
]
|
62
63
|
|
63
64
|
if s.respond_to? :specification_version then
|
@@ -65,12 +66,14 @@ Gem::Specification.new do |s|
|
|
65
66
|
s.specification_version = 3
|
66
67
|
|
67
68
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
69
|
+
s.add_runtime_dependency(%q<rack>, [">= 1.1.0"])
|
68
70
|
s.add_runtime_dependency(%q<tilt>, [">= 0.9"])
|
69
71
|
s.add_runtime_dependency(%q<erubis>, [">= 2.6.5"])
|
70
72
|
s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.1"])
|
71
73
|
s.add_runtime_dependency(%q<rdiscount>, [">= 1.6.3.1"])
|
72
74
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
73
75
|
else
|
76
|
+
s.add_dependency(%q<rack>, [">= 1.1.0"])
|
74
77
|
s.add_dependency(%q<tilt>, [">= 0.9"])
|
75
78
|
s.add_dependency(%q<erubis>, [">= 2.6.5"])
|
76
79
|
s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
|
@@ -78,6 +81,7 @@ Gem::Specification.new do |s|
|
|
78
81
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
79
82
|
end
|
80
83
|
else
|
84
|
+
s.add_dependency(%q<rack>, [">= 1.1.0"])
|
81
85
|
s.add_dependency(%q<tilt>, [">= 0.9"])
|
82
86
|
s.add_dependency(%q<erubis>, [">= 2.6.5"])
|
83
87
|
s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
|
data/lib/cg/convert.rb
CHANGED
File without changes
|
data/lib/cg/rebuild.rb
CHANGED
File without changes
|
data/lib/cg/server.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rack'
|
5
|
+
|
6
|
+
module CG
|
7
|
+
class Server
|
8
|
+
def initialize
|
9
|
+
@file_server = Rack::File.new('.')
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(env)
|
13
|
+
env['PATH_INFO'] = '/index.html' if env['PATH_INFO'] == '/'
|
14
|
+
puts env['PATH_INFO']
|
15
|
+
|
16
|
+
@file_server.call(env)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
if __FILE__ == $0
|
22
|
+
puts "[#{Time.now.strftime('%Y-%m-%d %H:%m')}] cg server start. http://localhost:9292"
|
23
|
+
Rack::Handler::default.run CG::Server.new, :Port => 9292
|
24
|
+
end
|
data/skel/templates/html.rb
CHANGED
@@ -33,8 +33,8 @@
|
|
33
33
|
</article>
|
34
34
|
|
35
35
|
<footer>
|
36
|
-
<p>Copyright © <%= Date.today.year %> <a href="
|
37
|
-
<p>Powerd by <a href="http://
|
36
|
+
<p>Copyright © <%= Date.today.year %> <a href="http://tomohiro.github.com">Tomohiro</a> All rights reserved.</p>
|
37
|
+
<p>Powerd by <a href="http://rubygems.org/gems/cg" title="cg - A Ruby based contents generator">cg - A Ruby based contents generator</a></p>
|
38
38
|
</footer>
|
39
39
|
</body>
|
40
40
|
</html>
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 6
|
9
|
+
version: 0.0.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Tomohiro, TAIRA
|
@@ -14,13 +14,27 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-13 00:00:00 +09:00
|
18
18
|
default_executable: cg
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
21
|
+
name: rack
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 1
|
30
|
+
- 0
|
31
|
+
version: 1.1.0
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: tilt
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
24
38
|
requirements:
|
25
39
|
- - ">="
|
26
40
|
- !ruby/object:Gem::Version
|
@@ -29,11 +43,11 @@ dependencies:
|
|
29
43
|
- 9
|
30
44
|
version: "0.9"
|
31
45
|
type: :runtime
|
32
|
-
version_requirements: *
|
46
|
+
version_requirements: *id002
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: erubis
|
35
49
|
prerelease: false
|
36
|
-
requirement: &
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
@@ -43,11 +57,11 @@ dependencies:
|
|
43
57
|
- 5
|
44
58
|
version: 2.6.5
|
45
59
|
type: :runtime
|
46
|
-
version_requirements: *
|
60
|
+
version_requirements: *id003
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: nokogiri
|
49
63
|
prerelease: false
|
50
|
-
requirement: &
|
64
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
@@ -57,11 +71,11 @@ dependencies:
|
|
57
71
|
- 1
|
58
72
|
version: 1.4.1
|
59
73
|
type: :runtime
|
60
|
-
version_requirements: *
|
74
|
+
version_requirements: *id004
|
61
75
|
- !ruby/object:Gem::Dependency
|
62
76
|
name: rdiscount
|
63
77
|
prerelease: false
|
64
|
-
requirement: &
|
78
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
@@ -72,11 +86,11 @@ dependencies:
|
|
72
86
|
- 1
|
73
87
|
version: 1.6.3.1
|
74
88
|
type: :runtime
|
75
|
-
version_requirements: *
|
89
|
+
version_requirements: *id005
|
76
90
|
- !ruby/object:Gem::Dependency
|
77
91
|
name: rspec
|
78
92
|
prerelease: false
|
79
|
-
requirement: &
|
93
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
80
94
|
requirements:
|
81
95
|
- - ">="
|
82
96
|
- !ruby/object:Gem::Version
|
@@ -86,7 +100,7 @@ dependencies:
|
|
86
100
|
- 9
|
87
101
|
version: 1.2.9
|
88
102
|
type: :development
|
89
|
-
version_requirements: *
|
103
|
+
version_requirements: *id006
|
90
104
|
description: cg is A Ruby based contents generator
|
91
105
|
email: tomohiro.t+github@gmail.com
|
92
106
|
executables:
|
@@ -109,6 +123,7 @@ files:
|
|
109
123
|
- lib/cg/convert.rb
|
110
124
|
- lib/cg/rebuild.rb
|
111
125
|
- lib/cg/scratch.rb
|
126
|
+
- lib/cg/server.rb
|
112
127
|
- lib/contents_generator.rb
|
113
128
|
- skel/.exclude
|
114
129
|
- skel/images/please_puts_image_here
|
@@ -157,7 +172,7 @@ rubyforge_project:
|
|
157
172
|
rubygems_version: 1.3.6
|
158
173
|
signing_key:
|
159
174
|
specification_version: 3
|
160
|
-
summary:
|
175
|
+
summary: HTML5 Contents Generator
|
161
176
|
test_files:
|
162
|
-
- spec/spec_helper.rb
|
163
177
|
- spec/cg_spec.rb
|
178
|
+
- spec/spec_helper.rb
|