henshin 0.0.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/VERSION +1 -1
- data/bin/henshin +7 -1
- data/henshin.gemspec +6 -149
- data/lib/henshin.rb +22 -6
- data/lib/henshin/categories.rb +19 -0
- data/lib/henshin/ext.rb +47 -2
- data/lib/henshin/gen.rb +8 -11
- data/lib/henshin/plugin.rb +9 -0
- data/lib/henshin/plugins/liquid.rb +1 -1
- data/lib/henshin/post.rb +38 -14
- data/lib/henshin/site.rb +68 -29
- data/lib/henshin/tags.rb +19 -0
- data/test/site/_site/2010/10/20-testing-stuff/index.html +14 -6
- data/test/site/_site/2010/5/15-lorem-ipsum/index.html +14 -6
- data/test/site/_site/css/print.css +10 -24
- data/test/site/_site/index.html +82 -1
- data/test/site/index.html +2 -0
- data/test/site/layouts/main.html +35 -1
- data/test/site/layouts/post.html +7 -5
- data/test/site/options.yaml +5 -2
- data/test/site/plugins/test.rb +11 -0
- data/test/site/posts/Testing-Stuff.markdown +1 -0
- metadata +7 -150
- data/.yardoc/checksums +0 -10
- data/.yardoc/objects/Hash.dat +0 -0
- data/.yardoc/objects/Hash/to_options_i.dat +0 -0
- data/.yardoc/objects/Henshin.dat +0 -0
- data/.yardoc/objects/Henshin/CSSGenerator.dat +0 -0
- data/.yardoc/objects/Henshin/CSSGenerator/generate_i.dat +0 -0
- data/.yardoc/objects/Henshin/Defaults.dat +0 -0
- data/.yardoc/objects/Henshin/Gen.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/config_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/config_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/content_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/content_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/date_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/date_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/extension_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/extension_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/initialize_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/layout_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/layout_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/override_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/path_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/path_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/payload_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/process_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/read_yaml_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/render_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/site_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/site_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/title_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/title_i.dat +0 -0
- data/.yardoc/objects/Henshin/Gen/write_i.dat +0 -0
- data/.yardoc/objects/Henshin/HTMLGenerator.dat +0 -0
- data/.yardoc/objects/Henshin/HTMLGenerator/generate_i.dat +0 -0
- data/.yardoc/objects/Henshin/JSGenerator.dat +0 -0
- data/.yardoc/objects/Henshin/JSGenerator/generate_i.dat +0 -0
- data/.yardoc/objects/Henshin/LayoutParser.dat +0 -0
- data/.yardoc/objects/Henshin/LayoutParser/generate_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post.dat +0 -0
- data/.yardoc/objects/Henshin/Post/author_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/author_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/category_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/category_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/date_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/date_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/initialize_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/override_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/payload_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/permalink_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/process_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/read_name_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/read_yaml_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/tags_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/tags_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/title_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/title_i.dat +0 -0
- data/.yardoc/objects/Henshin/Post/write_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site.dat +0 -0
- data/.yardoc/objects/Henshin/Site/archives_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/archives_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/categories_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/categories_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/config_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/config_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/gens_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/gens_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/initialize_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/layouts_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/layouts_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/payload_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/plugins_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/plugins_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/posts_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/posts_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/process_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/read_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/read_layouts_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/read_others_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/read_posts_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/render_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/reset_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/statics_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/statics_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/tags_3D_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/tags_i.dat +0 -0
- data/.yardoc/objects/Henshin/Site/write_i.dat +0 -0
- data/.yardoc/objects/Henshin/StandardPlugin.dat +0 -0
- data/.yardoc/objects/Henshin/configure_c.dat +0 -0
- data/.yardoc/objects/Henshin/extensions_c.dat +0 -0
- data/.yardoc/objects/Henshin/load_plugins_c.dat +0 -0
- data/.yardoc/objects/LiquidPlugin.dat +0 -0
- data/.yardoc/objects/LiquidPlugin/extensions_3D_i.dat +0 -0
- data/.yardoc/objects/LiquidPlugin/extensions_i.dat +0 -0
- data/.yardoc/objects/LiquidPlugin/generate_i.dat +0 -0
- data/.yardoc/objects/LiquidPlugin/initialize_i.dat +0 -0
- data/.yardoc/objects/LiquidPlugin/read_i.dat +0 -0
- data/.yardoc/objects/MarukuPlugin.dat +0 -0
- data/.yardoc/objects/MarukuPlugin/extensions_3D_i.dat +0 -0
- data/.yardoc/objects/MarukuPlugin/extensions_i.dat +0 -0
- data/.yardoc/objects/MarukuPlugin/generate_i.dat +0 -0
- data/.yardoc/objects/MarukuPlugin/initialize_i.dat +0 -0
- data/.yardoc/objects/PygmentsPlugin.dat +0 -0
- data/.yardoc/objects/PygmentsPlugin/extensions_3D_i.dat +0 -0
- data/.yardoc/objects/PygmentsPlugin/extensions_i.dat +0 -0
- data/.yardoc/objects/PygmentsPlugin/generate_i.dat +0 -0
- data/.yardoc/objects/PygmentsPlugin/initialize_i.dat +0 -0
- data/.yardoc/objects/SassPlugin.dat +0 -0
- data/.yardoc/objects/SassPlugin/extensions_3D_i.dat +0 -0
- data/.yardoc/objects/SassPlugin/extensions_i.dat +0 -0
- data/.yardoc/objects/SassPlugin/generate_i.dat +0 -0
- data/.yardoc/objects/SassPlugin/initialize_i.dat +0 -0
- data/.yardoc/objects/String.dat +0 -0
- data/.yardoc/objects/String/directory_i.dat +0 -0
- data/.yardoc/objects/String/extension_i.dat +0 -0
- data/.yardoc/objects/String/file_name_i.dat +0 -0
- data/.yardoc/objects/String/slugify_i.dat +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -2
- data/doc/Hash.html +0 -179
- data/doc/Henshin.html +0 -479
- data/doc/Henshin/CSSGenerator.html +0 -186
- data/doc/Henshin/Gen.html +0 -1225
- data/doc/Henshin/HTMLGenerator.html +0 -186
- data/doc/Henshin/JSGenerator.html +0 -182
- data/doc/Henshin/LayoutParser.html +0 -186
- data/doc/Henshin/Post.html +0 -1159
- data/doc/Henshin/Site.html +0 -1462
- data/doc/Henshin/StandardPlugin.html +0 -99
- data/doc/LiquidPlugin.html +0 -399
- data/doc/MarukuPlugin.html +0 -325
- data/doc/PygmentsPlugin.html +0 -325
- data/doc/SassPlugin.html +0 -325
- data/doc/String.html +0 -371
- data/doc/_index.html +0 -239
- data/doc/class_list.html +0 -36
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -50
- data/doc/css/style.css +0 -273
- data/doc/file.README.html +0 -133
- data/doc/file_list.html +0 -38
- data/doc/frames.html +0 -13
- data/doc/index.html +0 -133
- data/doc/js/app.js +0 -111
- data/doc/js/full_list.js +0 -117
- data/doc/js/jquery.js +0 -19
- data/doc/method_list.html +0 -611
- data/doc/top-level-namespace.html +0 -89
- data/test/site/_site/css/screen.css +0 -15
data/.gitignore
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.1.2
|
data/bin/henshin
CHANGED
@@ -25,7 +25,13 @@ end
|
|
25
25
|
config = Henshin.configure(override)
|
26
26
|
site = Henshin::Site.new(config)
|
27
27
|
|
28
|
+
puts "Reading files..."
|
28
29
|
site.read
|
30
|
+
|
29
31
|
site.process
|
30
32
|
site.render
|
31
|
-
|
33
|
+
|
34
|
+
puts "Writing files..."
|
35
|
+
site.write
|
36
|
+
|
37
|
+
puts "Site created in #{config[:target]}"
|
data/henshin.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{henshin}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["hawx"]
|
12
|
-
s.date = %q{2010-05-
|
12
|
+
s.date = %q{2010-05-26}
|
13
13
|
s.default_executable = %q{henshin}
|
14
14
|
s.description = %q{Henshin is a static site generator, with a plugin system and more}
|
15
15
|
s.email = %q{m@hawx.me}
|
@@ -20,159 +20,14 @@ Gem::Specification.new do |s|
|
|
20
20
|
]
|
21
21
|
s.files = [
|
22
22
|
".gitignore",
|
23
|
-
".yardoc/checksums",
|
24
|
-
".yardoc/objects/Hash.dat",
|
25
|
-
".yardoc/objects/Hash/to_options_i.dat",
|
26
|
-
".yardoc/objects/Henshin.dat",
|
27
|
-
".yardoc/objects/Henshin/CSSGenerator.dat",
|
28
|
-
".yardoc/objects/Henshin/CSSGenerator/generate_i.dat",
|
29
|
-
".yardoc/objects/Henshin/Defaults.dat",
|
30
|
-
".yardoc/objects/Henshin/Gen.dat",
|
31
|
-
".yardoc/objects/Henshin/Gen/config_3D_i.dat",
|
32
|
-
".yardoc/objects/Henshin/Gen/config_i.dat",
|
33
|
-
".yardoc/objects/Henshin/Gen/content_3D_i.dat",
|
34
|
-
".yardoc/objects/Henshin/Gen/content_i.dat",
|
35
|
-
".yardoc/objects/Henshin/Gen/date_3D_i.dat",
|
36
|
-
".yardoc/objects/Henshin/Gen/date_i.dat",
|
37
|
-
".yardoc/objects/Henshin/Gen/extension_3D_i.dat",
|
38
|
-
".yardoc/objects/Henshin/Gen/extension_i.dat",
|
39
|
-
".yardoc/objects/Henshin/Gen/initialize_i.dat",
|
40
|
-
".yardoc/objects/Henshin/Gen/layout_3D_i.dat",
|
41
|
-
".yardoc/objects/Henshin/Gen/layout_i.dat",
|
42
|
-
".yardoc/objects/Henshin/Gen/override_i.dat",
|
43
|
-
".yardoc/objects/Henshin/Gen/path_3D_i.dat",
|
44
|
-
".yardoc/objects/Henshin/Gen/path_i.dat",
|
45
|
-
".yardoc/objects/Henshin/Gen/payload_i.dat",
|
46
|
-
".yardoc/objects/Henshin/Gen/process_i.dat",
|
47
|
-
".yardoc/objects/Henshin/Gen/read_yaml_i.dat",
|
48
|
-
".yardoc/objects/Henshin/Gen/render_i.dat",
|
49
|
-
".yardoc/objects/Henshin/Gen/site_3D_i.dat",
|
50
|
-
".yardoc/objects/Henshin/Gen/site_i.dat",
|
51
|
-
".yardoc/objects/Henshin/Gen/title_3D_i.dat",
|
52
|
-
".yardoc/objects/Henshin/Gen/title_i.dat",
|
53
|
-
".yardoc/objects/Henshin/Gen/write_i.dat",
|
54
|
-
".yardoc/objects/Henshin/HTMLGenerator.dat",
|
55
|
-
".yardoc/objects/Henshin/HTMLGenerator/generate_i.dat",
|
56
|
-
".yardoc/objects/Henshin/JSGenerator.dat",
|
57
|
-
".yardoc/objects/Henshin/JSGenerator/generate_i.dat",
|
58
|
-
".yardoc/objects/Henshin/LayoutParser.dat",
|
59
|
-
".yardoc/objects/Henshin/LayoutParser/generate_i.dat",
|
60
|
-
".yardoc/objects/Henshin/Post.dat",
|
61
|
-
".yardoc/objects/Henshin/Post/author_3D_i.dat",
|
62
|
-
".yardoc/objects/Henshin/Post/author_i.dat",
|
63
|
-
".yardoc/objects/Henshin/Post/category_3D_i.dat",
|
64
|
-
".yardoc/objects/Henshin/Post/category_i.dat",
|
65
|
-
".yardoc/objects/Henshin/Post/date_3D_i.dat",
|
66
|
-
".yardoc/objects/Henshin/Post/date_i.dat",
|
67
|
-
".yardoc/objects/Henshin/Post/initialize_i.dat",
|
68
|
-
".yardoc/objects/Henshin/Post/override_i.dat",
|
69
|
-
".yardoc/objects/Henshin/Post/payload_i.dat",
|
70
|
-
".yardoc/objects/Henshin/Post/permalink_i.dat",
|
71
|
-
".yardoc/objects/Henshin/Post/process_i.dat",
|
72
|
-
".yardoc/objects/Henshin/Post/read_name_i.dat",
|
73
|
-
".yardoc/objects/Henshin/Post/read_yaml_i.dat",
|
74
|
-
".yardoc/objects/Henshin/Post/tags_3D_i.dat",
|
75
|
-
".yardoc/objects/Henshin/Post/tags_i.dat",
|
76
|
-
".yardoc/objects/Henshin/Post/title_3D_i.dat",
|
77
|
-
".yardoc/objects/Henshin/Post/title_i.dat",
|
78
|
-
".yardoc/objects/Henshin/Post/write_i.dat",
|
79
|
-
".yardoc/objects/Henshin/Site.dat",
|
80
|
-
".yardoc/objects/Henshin/Site/archives_3D_i.dat",
|
81
|
-
".yardoc/objects/Henshin/Site/archives_i.dat",
|
82
|
-
".yardoc/objects/Henshin/Site/categories_3D_i.dat",
|
83
|
-
".yardoc/objects/Henshin/Site/categories_i.dat",
|
84
|
-
".yardoc/objects/Henshin/Site/config_3D_i.dat",
|
85
|
-
".yardoc/objects/Henshin/Site/config_i.dat",
|
86
|
-
".yardoc/objects/Henshin/Site/gens_3D_i.dat",
|
87
|
-
".yardoc/objects/Henshin/Site/gens_i.dat",
|
88
|
-
".yardoc/objects/Henshin/Site/initialize_i.dat",
|
89
|
-
".yardoc/objects/Henshin/Site/layouts_3D_i.dat",
|
90
|
-
".yardoc/objects/Henshin/Site/layouts_i.dat",
|
91
|
-
".yardoc/objects/Henshin/Site/payload_i.dat",
|
92
|
-
".yardoc/objects/Henshin/Site/plugins_3D_i.dat",
|
93
|
-
".yardoc/objects/Henshin/Site/plugins_i.dat",
|
94
|
-
".yardoc/objects/Henshin/Site/posts_3D_i.dat",
|
95
|
-
".yardoc/objects/Henshin/Site/posts_i.dat",
|
96
|
-
".yardoc/objects/Henshin/Site/process_i.dat",
|
97
|
-
".yardoc/objects/Henshin/Site/read_i.dat",
|
98
|
-
".yardoc/objects/Henshin/Site/read_layouts_i.dat",
|
99
|
-
".yardoc/objects/Henshin/Site/read_others_i.dat",
|
100
|
-
".yardoc/objects/Henshin/Site/read_posts_i.dat",
|
101
|
-
".yardoc/objects/Henshin/Site/render_i.dat",
|
102
|
-
".yardoc/objects/Henshin/Site/reset_i.dat",
|
103
|
-
".yardoc/objects/Henshin/Site/statics_3D_i.dat",
|
104
|
-
".yardoc/objects/Henshin/Site/statics_i.dat",
|
105
|
-
".yardoc/objects/Henshin/Site/tags_3D_i.dat",
|
106
|
-
".yardoc/objects/Henshin/Site/tags_i.dat",
|
107
|
-
".yardoc/objects/Henshin/Site/write_i.dat",
|
108
|
-
".yardoc/objects/Henshin/StandardPlugin.dat",
|
109
|
-
".yardoc/objects/Henshin/configure_c.dat",
|
110
|
-
".yardoc/objects/Henshin/extensions_c.dat",
|
111
|
-
".yardoc/objects/Henshin/load_plugins_c.dat",
|
112
|
-
".yardoc/objects/LiquidPlugin.dat",
|
113
|
-
".yardoc/objects/LiquidPlugin/extensions_3D_i.dat",
|
114
|
-
".yardoc/objects/LiquidPlugin/extensions_i.dat",
|
115
|
-
".yardoc/objects/LiquidPlugin/generate_i.dat",
|
116
|
-
".yardoc/objects/LiquidPlugin/initialize_i.dat",
|
117
|
-
".yardoc/objects/LiquidPlugin/read_i.dat",
|
118
|
-
".yardoc/objects/MarukuPlugin.dat",
|
119
|
-
".yardoc/objects/MarukuPlugin/extensions_3D_i.dat",
|
120
|
-
".yardoc/objects/MarukuPlugin/extensions_i.dat",
|
121
|
-
".yardoc/objects/MarukuPlugin/generate_i.dat",
|
122
|
-
".yardoc/objects/MarukuPlugin/initialize_i.dat",
|
123
|
-
".yardoc/objects/PygmentsPlugin.dat",
|
124
|
-
".yardoc/objects/PygmentsPlugin/extensions_3D_i.dat",
|
125
|
-
".yardoc/objects/PygmentsPlugin/extensions_i.dat",
|
126
|
-
".yardoc/objects/PygmentsPlugin/generate_i.dat",
|
127
|
-
".yardoc/objects/PygmentsPlugin/initialize_i.dat",
|
128
|
-
".yardoc/objects/SassPlugin.dat",
|
129
|
-
".yardoc/objects/SassPlugin/extensions_3D_i.dat",
|
130
|
-
".yardoc/objects/SassPlugin/extensions_i.dat",
|
131
|
-
".yardoc/objects/SassPlugin/generate_i.dat",
|
132
|
-
".yardoc/objects/SassPlugin/initialize_i.dat",
|
133
|
-
".yardoc/objects/String.dat",
|
134
|
-
".yardoc/objects/String/directory_i.dat",
|
135
|
-
".yardoc/objects/String/extension_i.dat",
|
136
|
-
".yardoc/objects/String/file_name_i.dat",
|
137
|
-
".yardoc/objects/String/slugify_i.dat",
|
138
|
-
".yardoc/objects/root.dat",
|
139
|
-
".yardoc/proxy_types",
|
140
23
|
"LICENSE",
|
141
24
|
"README.markdown",
|
142
25
|
"Rakefile",
|
143
26
|
"VERSION",
|
144
27
|
"bin/henshin",
|
145
|
-
"doc/Hash.html",
|
146
|
-
"doc/Henshin.html",
|
147
|
-
"doc/Henshin/CSSGenerator.html",
|
148
|
-
"doc/Henshin/Gen.html",
|
149
|
-
"doc/Henshin/HTMLGenerator.html",
|
150
|
-
"doc/Henshin/JSGenerator.html",
|
151
|
-
"doc/Henshin/LayoutParser.html",
|
152
|
-
"doc/Henshin/Post.html",
|
153
|
-
"doc/Henshin/Site.html",
|
154
|
-
"doc/Henshin/StandardPlugin.html",
|
155
|
-
"doc/LiquidPlugin.html",
|
156
|
-
"doc/MarukuPlugin.html",
|
157
|
-
"doc/PygmentsPlugin.html",
|
158
|
-
"doc/SassPlugin.html",
|
159
|
-
"doc/String.html",
|
160
|
-
"doc/_index.html",
|
161
|
-
"doc/class_list.html",
|
162
|
-
"doc/css/common.css",
|
163
|
-
"doc/css/full_list.css",
|
164
|
-
"doc/css/style.css",
|
165
|
-
"doc/file.README.html",
|
166
|
-
"doc/file_list.html",
|
167
|
-
"doc/frames.html",
|
168
|
-
"doc/index.html",
|
169
|
-
"doc/js/app.js",
|
170
|
-
"doc/js/full_list.js",
|
171
|
-
"doc/js/jquery.js",
|
172
|
-
"doc/method_list.html",
|
173
|
-
"doc/top-level-namespace.html",
|
174
28
|
"henshin.gemspec",
|
175
29
|
"lib/henshin.rb",
|
30
|
+
"lib/henshin/categories.rb",
|
176
31
|
"lib/henshin/ext.rb",
|
177
32
|
"lib/henshin/gen.rb",
|
178
33
|
"lib/henshin/plugin.rb",
|
@@ -183,11 +38,11 @@ Gem::Specification.new do |s|
|
|
183
38
|
"lib/henshin/post.rb",
|
184
39
|
"lib/henshin/site.rb",
|
185
40
|
"lib/henshin/static.rb",
|
41
|
+
"lib/henshin/tags.rb",
|
186
42
|
"test/helper.rb",
|
187
43
|
"test/site/_site/2010/10/20-testing-stuff/index.html",
|
188
44
|
"test/site/_site/2010/5/15-lorem-ipsum/index.html",
|
189
45
|
"test/site/_site/css/print.css",
|
190
|
-
"test/site/_site/css/screen.css",
|
191
46
|
"test/site/_site/index.html",
|
192
47
|
"test/site/_site/static.html",
|
193
48
|
"test/site/css/screen.css",
|
@@ -195,6 +50,7 @@ Gem::Specification.new do |s|
|
|
195
50
|
"test/site/layouts/main.html",
|
196
51
|
"test/site/layouts/post.html",
|
197
52
|
"test/site/options.yaml",
|
53
|
+
"test/site/plugins/test.rb",
|
198
54
|
"test/site/posts/Testing-Stuff.markdown",
|
199
55
|
"test/site/posts/lorem-ipsum.markdown",
|
200
56
|
"test/site/sass/print.sass",
|
@@ -208,6 +64,7 @@ Gem::Specification.new do |s|
|
|
208
64
|
s.summary = %q{Henshin is a static site generator}
|
209
65
|
s.test_files = [
|
210
66
|
"test/helper.rb",
|
67
|
+
"test/site/plugins/test.rb",
|
211
68
|
"test/test_henshin.rb"
|
212
69
|
]
|
213
70
|
|
data/lib/henshin.rb
CHANGED
@@ -12,6 +12,8 @@ require 'henshin/gen'
|
|
12
12
|
require 'henshin/post'
|
13
13
|
require 'henshin/static'
|
14
14
|
|
15
|
+
require 'henshin/tags'
|
16
|
+
require 'henshin/categories'
|
15
17
|
require 'henshin/ext'
|
16
18
|
|
17
19
|
|
@@ -27,19 +29,28 @@ module Henshin
|
|
27
29
|
:permalink => '/{year}/{month}/{date}/{title}.html',
|
28
30
|
:plugins => ['maraku', 'liquid'],
|
29
31
|
:root => '.',
|
30
|
-
:target => '_site'
|
32
|
+
:target => '_site',
|
33
|
+
:plugin_options => {},
|
34
|
+
:exclude => [] }
|
31
35
|
|
32
36
|
|
33
37
|
# Creates the configuration hash by merging defaults, supplied options and options read from the 'options.yaml' file. Then loads the plugins
|
34
38
|
#
|
35
39
|
# @param [Hash] override to override other set options
|
36
40
|
# @return [Hash] the merged configuration hash
|
37
|
-
def self.configure( override={} )
|
41
|
+
def self.configure( override={} )
|
38
42
|
config_file = (override[:root] || Defaults[:root]) + '/options.yaml'
|
39
43
|
config = YAML.load_file( config_file ).to_options
|
40
44
|
|
41
45
|
settings = Defaults.merge(config).merge(override)
|
42
|
-
|
46
|
+
|
47
|
+
settings.each do |k, v|
|
48
|
+
if settings[:plugins].include? k.to_s
|
49
|
+
settings[:plugin_options][k] = v.to_options
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
settings[:plugins] = Henshin.load_plugins( settings[:plugins], settings[:root], settings[:plugin_options] )
|
43
54
|
settings[:extensions] = Henshin.extensions( settings[:plugins] )
|
44
55
|
settings
|
45
56
|
end
|
@@ -49,11 +60,16 @@ module Henshin
|
|
49
60
|
#
|
50
61
|
# @param [Array] plugins list of plugins to load
|
51
62
|
# @return [Array] list of loaded plugin instances
|
52
|
-
def self.load_plugins( to_load )
|
63
|
+
def self.load_plugins( to_load, root, options )
|
53
64
|
plugins = []
|
54
65
|
to_load.each do |l|
|
55
|
-
|
56
|
-
|
66
|
+
p
|
67
|
+
begin
|
68
|
+
require 'henshin/plugins/' + l
|
69
|
+
rescue LoadError
|
70
|
+
require File.join(root, 'plugins/', l)
|
71
|
+
end
|
72
|
+
plugins << eval("#{l.capitalize}Plugin.new( #{options[l.to_sym]} )")
|
57
73
|
end
|
58
74
|
plugins
|
59
75
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Henshin
|
2
|
+
class Category
|
3
|
+
|
4
|
+
attr_accessor :name, :posts
|
5
|
+
|
6
|
+
def initialize( name )
|
7
|
+
@name = name
|
8
|
+
@posts = []
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_hash
|
12
|
+
hash = {
|
13
|
+
'name' => @name,
|
14
|
+
'posts' => @posts.collect {|i| i.to_hash}
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
data/lib/henshin/ext.rb
CHANGED
@@ -1,4 +1,37 @@
|
|
1
|
+
require 'thread'
|
2
|
+
|
3
|
+
module Enumerable
|
4
|
+
|
5
|
+
# Like an each loop but runs each task in parallel
|
6
|
+
# Which will probably be very useful for writing and rendering
|
7
|
+
# from http://t-a-w.blogspot.com/2010/05/very-simple-parallelization-with-ruby.html
|
8
|
+
def each_parallel( n=10 )
|
9
|
+
todo = Queue.new
|
10
|
+
ts = (1..n).map do
|
11
|
+
Thread.new do
|
12
|
+
while x = todo.deq
|
13
|
+
Exception.ignoring_exceptions { yield(x[0]) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
each {|x| todo << [x] }
|
18
|
+
n.times { todo << nil }
|
19
|
+
ts.each {|t| t.join }
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
def Exception.ignoring_exceptions
|
25
|
+
begin
|
26
|
+
yield
|
27
|
+
rescue Exception => e
|
28
|
+
STDERR.puts e.message
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
1
33
|
class Hash
|
34
|
+
|
2
35
|
# stripped straight out of rails
|
3
36
|
# converts string keys to symbol keys
|
4
37
|
# from http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Keys.html
|
@@ -8,8 +41,10 @@ class Hash
|
|
8
41
|
options
|
9
42
|
end
|
10
43
|
end
|
44
|
+
|
11
45
|
end
|
12
46
|
|
47
|
+
|
13
48
|
class String
|
14
49
|
|
15
50
|
# Turns the string to a slug
|
@@ -23,14 +58,24 @@ class String
|
|
23
58
|
slug
|
24
59
|
end
|
25
60
|
|
61
|
+
# Capitalizes the string using Gruber's guidelines
|
62
|
+
def titlize
|
63
|
+
self
|
64
|
+
end
|
65
|
+
|
26
66
|
# Gets the extension from a string
|
27
67
|
def extension
|
28
|
-
self.split('.')
|
68
|
+
parts = self.split('.')
|
69
|
+
if parts.size == 2
|
70
|
+
return parts[1]
|
71
|
+
elsif parts.size == 3
|
72
|
+
return parts[2]
|
73
|
+
end
|
29
74
|
end
|
30
75
|
|
31
76
|
# Gets the directory from a string
|
32
77
|
def directory
|
33
|
-
self =~ /((
|
78
|
+
self =~ /((\.?\/?[a-zA-Z0-9 _-]+\/)+)/
|
34
79
|
$1
|
35
80
|
end
|
36
81
|
|
data/lib/henshin/gen.rb
CHANGED
@@ -11,7 +11,6 @@ module Henshin
|
|
11
11
|
@site = site
|
12
12
|
@config = site.config
|
13
13
|
@extension = path.extension
|
14
|
-
@layout = site.layouts[ site.config[:layout] ]
|
15
14
|
end
|
16
15
|
|
17
16
|
|
@@ -53,14 +52,14 @@ module Henshin
|
|
53
52
|
@renderer = plugin
|
54
53
|
end
|
55
54
|
end
|
55
|
+
@renderer ||= StandardPlugin.new
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
57
|
+
@layout ||= site.layouts[ site.config[:layout] ]
|
58
|
+
unless @renderer.config[:ignore_layouts]
|
59
|
+
# do the layout
|
60
|
+
config[:plugins].each do |plugin|
|
61
|
+
if plugin.is_a?( LayoutParser )
|
62
|
+
@content = plugin.generate( @layout, self.payload )
|
64
63
|
end
|
65
64
|
end
|
66
65
|
end
|
@@ -94,9 +93,7 @@ module Henshin
|
|
94
93
|
# files should have different extension
|
95
94
|
write_path.gsub!(".#{@extension}", ".#{render_type}")
|
96
95
|
end
|
97
|
-
|
98
|
-
p write_path
|
99
|
-
|
96
|
+
|
100
97
|
FileUtils.mkdir_p File.join( write_path.directory )
|
101
98
|
file = File.new( File.join( write_path ), "w" )
|
102
99
|
file.puts( @content )
|
data/lib/henshin/plugin.rb
CHANGED
@@ -5,6 +5,15 @@ module Henshin
|
|
5
5
|
# class MyPlugin < NoName::StandardPlugin
|
6
6
|
#
|
7
7
|
# or it can inherit a subclass from below
|
8
|
+
|
9
|
+
# This is quite useful if a dummy plugin is needed
|
10
|
+
|
11
|
+
attr_accessor :extensions, :config
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
@extensions = []
|
15
|
+
@config = {}
|
16
|
+
end
|
8
17
|
end
|
9
18
|
|
10
19
|
class HTMLGenerator < StandardPlugin
|