ruhoh 0.3.0 → 1.0.0.alpha
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/Gemfile +1 -0
- data/README.md +0 -33
- data/dash.html +1 -0
- data/history.json +29 -0
- data/lib/ruhoh/client/client.rb +30 -22
- data/lib/ruhoh/client/help.yml +6 -2
- data/lib/ruhoh/compiler.rb +8 -20
- data/lib/ruhoh/compilers/rss.rb +36 -0
- data/lib/ruhoh/compilers/theme.rb +41 -0
- data/lib/ruhoh/config.rb +49 -0
- data/lib/ruhoh/converters/converter.rb +17 -4
- data/lib/ruhoh/converters/markdown.rb +2 -2
- data/lib/ruhoh/db.rb +29 -2
- data/lib/ruhoh/deployers/s3.rb +1 -1
- data/lib/ruhoh/logger.rb +1 -1
- data/lib/ruhoh/page.rb +38 -22
- data/lib/ruhoh/parsers/javascripts.rb +67 -0
- data/lib/ruhoh/parsers/layouts.rb +6 -10
- data/lib/ruhoh/parsers/pages.rb +17 -24
- data/lib/ruhoh/parsers/partials.rb +6 -14
- data/lib/ruhoh/parsers/payload.rb +47 -0
- data/lib/ruhoh/parsers/posts.rb +27 -29
- data/lib/ruhoh/parsers/site.rb +2 -2
- data/lib/ruhoh/parsers/stylesheets.rb +75 -0
- data/lib/ruhoh/parsers/widgets.rb +104 -0
- data/lib/ruhoh/paths.rb +75 -0
- data/lib/ruhoh/previewer.rb +11 -5
- data/lib/ruhoh/program.rb +35 -4
- data/lib/ruhoh/templaters/asset_helpers.rb +66 -0
- data/lib/ruhoh/templaters/base_helpers.rb +143 -0
- data/lib/ruhoh/templaters/helpers.rb +1 -148
- data/lib/ruhoh/templaters/rmustache.rb +45 -4
- data/lib/ruhoh/urls.rb +46 -0
- data/lib/ruhoh/utils.rb +59 -17
- data/lib/ruhoh/version.rb +2 -2
- data/lib/ruhoh/watch.rb +26 -14
- data/lib/ruhoh.rb +38 -96
- data/ruhoh.gemspec +29 -10
- data/scaffolds/draft.html +9 -0
- data/scaffolds/page.html +0 -2
- data/scaffolds/post.html +0 -4
- data/scaffolds/theme/{images → javascripts}/.gitkeep +0 -0
- data/scaffolds/theme/layouts/default.html +2 -4
- data/scaffolds/theme/layouts/page.html +1 -1
- data/scaffolds/theme/layouts/post.html +1 -1
- data/scaffolds/theme/{css/style.css → media/.gitkeep} +0 -0
- data/scaffolds/theme/stylesheets/style.css +0 -0
- data/scaffolds/theme/theme.yml +27 -0
- data/scaffolds/theme/widgets/.gitkeep +0 -0
- data/spec/config_spec.rb +50 -0
- data/spec/db_spec.rb +28 -14
- data/spec/page_spec.rb +24 -35
- data/spec/parsers/layouts_spec.rb +5 -13
- data/spec/parsers/pages_spec.rb +13 -11
- data/spec/parsers/posts_spec.rb +34 -29
- data/spec/parsers/routes_spec.rb +2 -1
- data/spec/parsers/site_spec.rb +6 -5
- data/spec/setup_spec.rb +3 -47
- data/widgets/analytics/config.yml +5 -0
- data/{system_partials/analytics/getclicky → widgets/analytics/layouts/getclicky.html} +2 -2
- data/{system_partials/analytics/google → widgets/analytics/layouts/google.html} +1 -1
- data/widgets/comments/config.yml +12 -0
- data/{system_partials/comments/disqus → widgets/comments/layouts/disqus.html} +2 -2
- data/{system_partials/comments/facebook → widgets/comments/layouts/facebook.html} +1 -1
- data/{system_partials/comments/intensedebate → widgets/comments/layouts/intensedebate.html} +1 -1
- data/{system_partials/comments/livefyre → widgets/comments/layouts/livefyre.html} +1 -1
- data/widgets/google_prettify/config.yml +1 -0
- data/widgets/google_prettify/layouts/google_prettify.html +10 -0
- metadata +54 -31
- data/lib/ruhoh/templaters/base.rb +0 -57
- data/system_partials/syntax/google_prettify +0 -11
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruhoh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0.alpha
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jade Dominguez
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05
|
12
|
+
date: 2012-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
|
-
requirement: &
|
16
|
+
requirement: &70293021804840 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.4'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70293021804840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mustache
|
27
|
-
requirement: &
|
27
|
+
requirement: &70293021804340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.99'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70293021804340
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: directory_watcher
|
38
|
-
requirement: &
|
38
|
+
requirement: &70293021803880 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '1.4'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70293021803880
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: redcarpet
|
49
|
-
requirement: &
|
49
|
+
requirement: &70293021803420 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '2.1'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70293021803420
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: psych
|
60
|
-
requirement: &
|
60
|
+
requirement: &70293021802960 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,18 @@ dependencies:
|
|
65
65
|
version: '1.3'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70293021802960
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: nokogiri
|
71
|
+
requirement: &70293021802500 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.5'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70293021802500
|
69
80
|
description: Ruhoh is a Universal API for your static blog.
|
70
81
|
email: plusjade@gmail.com
|
71
82
|
executables:
|
@@ -83,6 +94,9 @@ files:
|
|
83
94
|
- lib/ruhoh/client/client.rb
|
84
95
|
- lib/ruhoh/client/help.yml
|
85
96
|
- lib/ruhoh/compiler.rb
|
97
|
+
- lib/ruhoh/compilers/rss.rb
|
98
|
+
- lib/ruhoh/compilers/theme.rb
|
99
|
+
- lib/ruhoh/config.rb
|
86
100
|
- lib/ruhoh/converters/converter.rb
|
87
101
|
- lib/ruhoh/converters/markdown.rb
|
88
102
|
- lib/ruhoh/db.rb
|
@@ -90,30 +104,42 @@ files:
|
|
90
104
|
- lib/ruhoh/friend.rb
|
91
105
|
- lib/ruhoh/logger.rb
|
92
106
|
- lib/ruhoh/page.rb
|
107
|
+
- lib/ruhoh/parsers/javascripts.rb
|
93
108
|
- lib/ruhoh/parsers/layouts.rb
|
94
109
|
- lib/ruhoh/parsers/pages.rb
|
95
110
|
- lib/ruhoh/parsers/partials.rb
|
111
|
+
- lib/ruhoh/parsers/payload.rb
|
96
112
|
- lib/ruhoh/parsers/posts.rb
|
97
113
|
- lib/ruhoh/parsers/routes.rb
|
98
114
|
- lib/ruhoh/parsers/site.rb
|
115
|
+
- lib/ruhoh/parsers/stylesheets.rb
|
116
|
+
- lib/ruhoh/parsers/widgets.rb
|
117
|
+
- lib/ruhoh/paths.rb
|
99
118
|
- lib/ruhoh/previewer.rb
|
100
119
|
- lib/ruhoh/program.rb
|
101
|
-
- lib/ruhoh/templaters/
|
120
|
+
- lib/ruhoh/templaters/asset_helpers.rb
|
121
|
+
- lib/ruhoh/templaters/base_helpers.rb
|
102
122
|
- lib/ruhoh/templaters/helpers.rb
|
103
123
|
- lib/ruhoh/templaters/rmustache.rb
|
124
|
+
- lib/ruhoh/urls.rb
|
104
125
|
- lib/ruhoh/utils.rb
|
105
126
|
- lib/ruhoh/version.rb
|
106
127
|
- lib/ruhoh/watch.rb
|
107
128
|
- ruhoh.gemspec
|
129
|
+
- scaffolds/draft.html
|
108
130
|
- scaffolds/layout.html
|
109
131
|
- scaffolds/page.html
|
110
132
|
- scaffolds/post.html
|
111
|
-
- scaffolds/theme/
|
112
|
-
- scaffolds/theme/images/.gitkeep
|
133
|
+
- scaffolds/theme/javascripts/.gitkeep
|
113
134
|
- scaffolds/theme/layouts/default.html
|
114
135
|
- scaffolds/theme/layouts/page.html
|
115
136
|
- scaffolds/theme/layouts/post.html
|
137
|
+
- scaffolds/theme/media/.gitkeep
|
116
138
|
- scaffolds/theme/partials/.gitkeep
|
139
|
+
- scaffolds/theme/stylesheets/style.css
|
140
|
+
- scaffolds/theme/theme.yml
|
141
|
+
- scaffolds/theme/widgets/.gitkeep
|
142
|
+
- spec/config_spec.rb
|
117
143
|
- spec/db_spec.rb
|
118
144
|
- spec/page_spec.rb
|
119
145
|
- spec/parsers/layouts_spec.rb
|
@@ -123,13 +149,16 @@ files:
|
|
123
149
|
- spec/parsers/site_spec.rb
|
124
150
|
- spec/setup_spec.rb
|
125
151
|
- spec/spec_helper.rb
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
152
|
+
- widgets/analytics/config.yml
|
153
|
+
- widgets/analytics/layouts/getclicky.html
|
154
|
+
- widgets/analytics/layouts/google.html
|
155
|
+
- widgets/comments/config.yml
|
156
|
+
- widgets/comments/layouts/disqus.html
|
157
|
+
- widgets/comments/layouts/facebook.html
|
158
|
+
- widgets/comments/layouts/intensedebate.html
|
159
|
+
- widgets/comments/layouts/livefyre.html
|
160
|
+
- widgets/google_prettify/config.yml
|
161
|
+
- widgets/google_prettify/layouts/google_prettify.html
|
133
162
|
homepage: http://github.com/ruhoh/ruhoh.rb
|
134
163
|
licenses:
|
135
164
|
- http://www.opensource.org/licenses/MIT
|
@@ -143,18 +172,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
172
|
- - ! '>='
|
144
173
|
- !ruby/object:Gem::Version
|
145
174
|
version: '0'
|
146
|
-
segments:
|
147
|
-
- 0
|
148
|
-
hash: 90005056232513636
|
149
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
176
|
none: false
|
151
177
|
requirements:
|
152
|
-
- - ! '
|
178
|
+
- - ! '>'
|
153
179
|
- !ruby/object:Gem::Version
|
154
|
-
version:
|
155
|
-
segments:
|
156
|
-
- 0
|
157
|
-
hash: 90005056232513636
|
180
|
+
version: 1.3.1
|
158
181
|
requirements: []
|
159
182
|
rubyforge_project:
|
160
183
|
rubygems_version: 1.8.17
|
@@ -1,57 +0,0 @@
|
|
1
|
-
class Ruhoh
|
2
|
-
|
3
|
-
module Templaters
|
4
|
-
|
5
|
-
module Base
|
6
|
-
|
7
|
-
def self.build_payload(page=nil)
|
8
|
-
{
|
9
|
-
"db" => {
|
10
|
-
"pages" => Ruhoh::DB.pages,
|
11
|
-
"posts" => Ruhoh::DB.posts,
|
12
|
-
},
|
13
|
-
"page" => (page ? page.attributes : {}),
|
14
|
-
"site" => Ruhoh::DB.site,
|
15
|
-
"paths" => {
|
16
|
-
"theme" => Ruhoh.config.theme_path,
|
17
|
-
"syntax" => Ruhoh.config.syntax_path,
|
18
|
-
"media" => Ruhoh.config.media_path
|
19
|
-
}
|
20
|
-
}
|
21
|
-
end
|
22
|
-
|
23
|
-
# Render a given page object.
|
24
|
-
# This is different from parse only in that rendering a page
|
25
|
-
# assumes we use page.content and its layouts as the incoming view.
|
26
|
-
def self.render(page)
|
27
|
-
self.parse(self.expand(page), page)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Parse arbitrary content relative to a given page.
|
31
|
-
def self.parse(output, page)
|
32
|
-
Ruhoh::Templaters::RMustache.render(output, self.build_payload(page))
|
33
|
-
end
|
34
|
-
|
35
|
-
# Expand the page.
|
36
|
-
# Places page content into sub-template then into master template if available.
|
37
|
-
def self.expand(page)
|
38
|
-
if page.sub_layout
|
39
|
-
output = page.sub_layout['content'].gsub(Ruhoh::Utils::ContentRegex, page.content)
|
40
|
-
else
|
41
|
-
output = page.content
|
42
|
-
end
|
43
|
-
|
44
|
-
# An undefined master means the page/post layouts is only one deep.
|
45
|
-
# This means it expects to load directly into a master template.
|
46
|
-
if page.master_layout && page.master_layout['content']
|
47
|
-
output = page.master_layout['content'].gsub(Ruhoh::Utils::ContentRegex, output);
|
48
|
-
end
|
49
|
-
|
50
|
-
output
|
51
|
-
end
|
52
|
-
|
53
|
-
end #Base
|
54
|
-
|
55
|
-
end #Templaters
|
56
|
-
|
57
|
-
end #Ruhoh
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<!-- Google Prettify -->
|
2
|
-
<link rel="stylesheet" href="{{ paths.syntax }}/google_prettify/{{ site.config.syntax.google_prettify.theme }}.css" type="text/css" media="screen" charset="utf-8">
|
3
|
-
<script src="http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js"></script>
|
4
|
-
<script>
|
5
|
-
var pres = document.getElementsByTagName("pre");
|
6
|
-
for (var i=0; i < pres.length; ++i) {
|
7
|
-
pres[i].className = "prettyprint {{# site.config.syntax.google_prettify.linenums }}linenums{{/site.config.syntax.google_prettify.linenums}}";
|
8
|
-
}
|
9
|
-
prettyPrint();
|
10
|
-
</script>
|
11
|
-
<!-- end Google Prettify -->
|