gumdrop 0.8.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. data/.gitignore +3 -0
  2. data/ChangeLog.md +13 -0
  3. data/Gemfile +6 -2
  4. data/Gemfile.lock +43 -3
  5. data/Rakefile +37 -21
  6. data/Readme.md +60 -158
  7. data/bin/gumdrop +2 -1
  8. data/gumdrop.gemspec +11 -4
  9. data/lib/gumdrop/builder.rb +164 -0
  10. data/lib/gumdrop/cli/external.rb +14 -9
  11. data/lib/gumdrop/cli/internal.rb +54 -22
  12. data/lib/gumdrop/cli.rb +21 -0
  13. data/lib/gumdrop/content.rb +195 -132
  14. data/lib/gumdrop/data.rb +185 -0
  15. data/lib/gumdrop/data_providers/csv.rb +18 -0
  16. data/lib/gumdrop/data_providers/pstore.rb +25 -0
  17. data/lib/gumdrop/data_providers/sqlite.rb +43 -0
  18. data/lib/gumdrop/data_providers/xml.rb +15 -0
  19. data/lib/gumdrop/data_providers/yaml_and_json.rb +18 -0
  20. data/lib/gumdrop/data_providers/yamldb.rb +18 -0
  21. data/lib/gumdrop/data_providers/yamldoc.rb +12 -0
  22. data/lib/gumdrop/generator.rb +118 -94
  23. data/lib/gumdrop/renderer.rb +272 -0
  24. data/lib/gumdrop/server.rb +36 -27
  25. data/lib/gumdrop/site.rb +283 -338
  26. data/lib/gumdrop/support/compressor.rb +52 -0
  27. data/lib/gumdrop/support/sprockets.rb +14 -23
  28. data/lib/gumdrop/support/stitch.rb +25 -14
  29. data/lib/gumdrop/support/yaml_doc_template.rb +29 -0
  30. data/lib/gumdrop/util/configurable.rb +44 -0
  31. data/lib/gumdrop/util/core_ex.rb +84 -0
  32. data/lib/gumdrop/util/eventable.rb +35 -0
  33. data/lib/gumdrop/util/hash_object.rb +70 -0
  34. data/lib/gumdrop/util/loggable.rb +44 -0
  35. data/lib/gumdrop/util/pager.rb +51 -0
  36. data/lib/gumdrop/{support → util}/proxy_handler.rb +7 -6
  37. data/lib/gumdrop/util/scanner.rb +47 -0
  38. data/lib/gumdrop/util/site_access.rb +16 -0
  39. data/lib/gumdrop/util/view_helpers.rb +50 -0
  40. data/lib/gumdrop/util/yaml_doc.rb +51 -0
  41. data/lib/gumdrop/version.rb +2 -2
  42. data/lib/gumdrop.rb +40 -77
  43. data/specs/content_spec.rb +83 -73
  44. data/specs/fixtures/expected/data-access/from-csv.html +4 -0
  45. data/specs/fixtures/expected/data-access/from-json.html +6 -0
  46. data/specs/fixtures/expected/data-access/from-sqlite.html +5 -0
  47. data/specs/fixtures/expected/data-access/from-xml.html +4 -0
  48. data/specs/fixtures/expected/data-access/from-yaml.html +5 -0
  49. data/specs/fixtures/expected/data-access/from-yamldb.html +5 -0
  50. data/specs/fixtures/expected/data-access/from-yamldoc.html +2 -0
  51. data/specs/fixtures/expected/gen-with-block/as-file.html +1 -0
  52. data/specs/fixtures/expected/gen-with-block/as-plain.html +1 -0
  53. data/specs/fixtures/expected/gen-with-block/layout-nested.html +1 -0
  54. data/specs/fixtures/expected/gen-with-block/layout-nil.html +1 -0
  55. data/specs/fixtures/expected/gen-with-block/layout-wrap.html +1 -0
  56. data/specs/fixtures/expected/gen-with-inline-render/0-as-file.html +4 -0
  57. data/specs/fixtures/expected/gen-with-inline-render/0-as-plain.html +4 -0
  58. data/specs/fixtures/expected/gen-with-inline-render/0-layout-nil.html +4 -0
  59. data/specs/fixtures/expected/gen-with-inline-render/0-layout-sub.html +4 -0
  60. data/specs/fixtures/expected/gen-with-inline-render/0-layout-wrap.html +4 -0
  61. data/specs/fixtures/expected/gen-with-inline-render/1-as-file.html +4 -0
  62. data/specs/fixtures/expected/gen-with-inline-render/1-as-plain.html +4 -0
  63. data/specs/fixtures/expected/gen-with-inline-render/1-layout-nil.html +4 -0
  64. data/specs/fixtures/expected/gen-with-inline-render/1-layout-sub.html +4 -0
  65. data/specs/fixtures/expected/gen-with-inline-render/1-layout-wrap.html +4 -0
  66. data/specs/fixtures/expected/goodbye.html +1 -0
  67. data/specs/fixtures/expected/hello.html +1 -0
  68. data/specs/fixtures/expected/image.png +0 -0
  69. data/specs/fixtures/expected/index.html +47 -0
  70. data/specs/fixtures/expected/js/sprockets-app.js +7 -0
  71. data/specs/fixtures/expected/js/stitch-app.js +65 -0
  72. data/specs/fixtures/expected/js/stitch-app.min.js +5 -0
  73. data/specs/fixtures/expected/js/stitch-app.min.src.js +65 -0
  74. data/specs/fixtures/expected/js/straight.js +8 -0
  75. data/specs/fixtures/expected/js/test-coffee.js +5 -0
  76. data/specs/fixtures/expected/pages/docs/force-abs.html +2 -0
  77. data/specs/fixtures/expected/pages/docs/index.html +2 -0
  78. data/specs/fixtures/expected/partials/hoisted-data.html +3 -0
  79. data/specs/fixtures/expected/partials/nested.html +7 -0
  80. data/specs/fixtures/expected/partials/params.html +1 -0
  81. data/specs/fixtures/expected/partials/with-layouts.html +1 -0
  82. data/specs/fixtures/expected/robots.txt +1 -0
  83. data/specs/fixtures/expected/test-multi-procs.html +4 -0
  84. data/specs/fixtures/expected/test-nested-layout.html +1 -0
  85. data/specs/fixtures/expected/test-no-layout.html +2 -0
  86. data/specs/fixtures/expected/test-yamldoc.html +1 -0
  87. data/specs/fixtures/expected/test.html +2 -0
  88. data/{templates/backbone → specs/fixtures/source}/Gemfile +8 -4
  89. data/specs/fixtures/source/Gemfile.lock +84 -0
  90. data/specs/fixtures/source/Gumdrop +60 -9
  91. data/specs/fixtures/source/data/csv_data.csv +2 -0
  92. data/specs/fixtures/source/data/json_data.json +13 -0
  93. data/specs/fixtures/source/data/sql_data.sqlite +0 -0
  94. data/specs/fixtures/source/data/xml_data.xml +4 -0
  95. data/specs/fixtures/source/data/yaml_db.yamldb +9 -0
  96. data/specs/fixtures/source/data/yaml_items.yaml +2 -0
  97. data/specs/fixtures/source/data/yamldoc.yamldoc +4 -0
  98. data/specs/fixtures/source/data-access/from-csv.html.erb +4 -0
  99. data/specs/fixtures/source/data-access/from-json.html.erb +6 -0
  100. data/specs/fixtures/source/data-access/from-sqlite.html.erb +5 -0
  101. data/specs/fixtures/source/data-access/from-xml.html.erb +5 -0
  102. data/specs/fixtures/source/data-access/from-yaml.html.erb +5 -0
  103. data/specs/fixtures/source/data-access/from-yamldb.html.erb +5 -0
  104. data/specs/fixtures/source/data-access/from-yamldoc.html.erb +2 -0
  105. data/specs/fixtures/source/gen-with-inline-render.generator +7 -0
  106. data/specs/fixtures/source/goodbye.html.erb +1 -0
  107. data/specs/fixtures/source/hello.html +1 -0
  108. data/specs/fixtures/source/image.png +0 -0
  109. data/specs/fixtures/source/index.html.erb +6 -0
  110. data/specs/fixtures/source/js/sprockets/app.js +2 -0
  111. data/specs/fixtures/source/js/sprockets/view.js.coffee +1 -0
  112. data/specs/fixtures/source/js/stitch/app.js +1 -0
  113. data/specs/fixtures/source/js/stitch/view.js.coffee +1 -0
  114. data/specs/fixtures/source/js/straight.js +8 -0
  115. data/specs/fixtures/source/js/test-coffee.js.coffee +1 -0
  116. data/specs/fixtures/source/layouts/site.layout.erb +1 -0
  117. data/specs/fixtures/source/layouts/sub.layout.erb +1 -0
  118. data/specs/fixtures/source/layouts/wrap.layout.erb +1 -0
  119. data/specs/fixtures/source/pages/_users-nested.html.erb +7 -0
  120. data/specs/fixtures/source/pages/docs/force-abs.html.erb +2 -0
  121. data/specs/fixtures/source/pages/docs/index.html.erb +2 -0
  122. data/specs/fixtures/source/partials/_post_entry.html.erb +4 -0
  123. data/specs/fixtures/source/partials/_provides_name.html.erb +1 -0
  124. data/specs/fixtures/source/partials/_user-params.html.erb +1 -0
  125. data/specs/fixtures/source/partials/_user.html.erb +1 -0
  126. data/specs/fixtures/source/partials/_user_sets_layout.html.erb +1 -0
  127. data/specs/fixtures/source/partials/hoisted-data.html.erb +6 -0
  128. data/specs/fixtures/source/partials/nested.html.erb +1 -0
  129. data/specs/fixtures/source/partials/params.html.erb +1 -0
  130. data/specs/fixtures/source/partials/with-layouts.html.erb +1 -0
  131. data/specs/fixtures/source/test-multi-procs.html.markdown.erb +3 -0
  132. data/specs/fixtures/source/test-nested-layout.html.erb +1 -0
  133. data/specs/fixtures/source/test-no-layout.html.erb +2 -0
  134. data/specs/fixtures/source/test-yamldoc.html.erb.yamldoc +4 -0
  135. data/specs/fixtures/source/test.html.erb +2 -0
  136. data/specs/hash_object_spec.rb +53 -8
  137. data/specs/render_spec.rb +10 -0
  138. data/specs/site_spec.rb +79 -0
  139. data/specs/spec_helper.rb +59 -0
  140. data/templates/blank/Gemfile +0 -4
  141. data/templates/blank/Gumdrop +180 -113
  142. data/templates/default/Gemfile +3 -8
  143. data/templates/default/Gumdrop +166 -95
  144. data/templates/default/ReadMe.md +14 -0
  145. data/templates/default/config.ru +1 -0
  146. data/templates/default/data/news/20120703.yamldoc +14 -0
  147. data/templates/default/data/news/20120704.yamldoc +8 -0
  148. data/templates/{backbone/source/feed.xml.builder.txt → default/source/feed.xml.builder} +4 -4
  149. data/templates/default/source/index.html.erb +10 -1
  150. data/templates/default/source/theme/layout/_sidebar.html +1 -0
  151. data/templates/{backbone/source/theme/templates/site.template.slim → default/source/theme/layout/site.layout.slim} +3 -3
  152. metadata +212 -63
  153. data/lib/gumdrop/context.rb +0 -135
  154. data/lib/gumdrop/data_manager.rb +0 -214
  155. data/lib/gumdrop/support/base_packager.rb +0 -60
  156. data/lib/gumdrop/support/callbacks.rb +0 -30
  157. data/lib/gumdrop/support/hash_object.rb +0 -22
  158. data/lib/gumdrop/view_helpers.rb +0 -25
  159. data/notes.md +0 -347
  160. data/specs/deferred_loader_spec.rb +0 -31
  161. data/specs/fixtures/expected/posts/post1.html +0 -1
  162. data/specs/fixtures/expected/posts/post1.js +0 -14
  163. data/specs/fixtures/expected/posts/post2.html +0 -5
  164. data/specs/fixtures/expected/sub/sub/sub/test.html +0 -5
  165. data/specs/fixtures/expected/sub/sub/sub/test2.html +0 -5
  166. data/specs/fixtures/expected/test.js +0 -14
  167. data/specs/fixtures/source/posts/post1.html.slim +0 -6
  168. data/specs/fixtures/source/posts/post1.js.coffee +0 -3
  169. data/specs/fixtures/source/posts/post2.html.erb +0 -5
  170. data/specs/fixtures/source/sub/sub/sub/test.html +0 -5
  171. data/specs/fixtures/source/sub/sub/sub/test2.html.erb +0 -5
  172. data/specs/fixtures/source/test.js.coffee +0 -4
  173. data/specs/fixtures/source/test.js.erb.coffee +0 -3
  174. data/templates/backbone/Gumdrop +0 -123
  175. data/templates/backbone/Rakefile +0 -38
  176. data/templates/backbone/app/app.js.coffee +0 -49
  177. data/templates/backbone/app/init.js.coffee +0 -10
  178. data/templates/backbone/app/models/.gitkeep +0 -0
  179. data/templates/backbone/app/utils/index.js.coffee +0 -27
  180. data/templates/backbone/app/views/home.js.coffee +0 -17
  181. data/templates/backbone/app/views/styles/home.scss +0 -8
  182. data/templates/backbone/app/views/templates/home.mustache +0 -2
  183. data/templates/backbone/config.ru +0 -20
  184. data/templates/backbone/lib/all.js.coffee +0 -18
  185. data/templates/backbone/lib/backbone.js +0 -1158
  186. data/templates/backbone/lib/hogan.js +0 -509
  187. data/templates/backbone/lib/jquery.js +0 -9266
  188. data/templates/backbone/lib/underscore.js +0 -981
  189. data/templates/backbone/powrc +0 -2
  190. data/templates/backbone/source/default.htaccess.erb +0 -27
  191. data/templates/backbone/source/favicon.ico +0 -0
  192. data/templates/backbone/source/index.html.erb +0 -2
  193. data/templates/backbone/source/theme/screen.css.sass +0 -9
  194. data/templates/backbone/source/theme/scripts/app.js.coffee +0 -4
  195. data/templates/backbone/source/theme/styles/_tools.scss +0 -434
  196. data/templates/backbone/source/theme/templates/app.template.slim +0 -14
  197. data/templates/default/Rakefile +0 -38
  198. data/templates/default/powrc +0 -2
  199. data/templates/default/source/default.htaccess.erb +0 -27
  200. data/templates/default/source/feed.xml.builder.txt +0 -23
  201. data/templates/default/source/theme/templates/site.template.slim +0 -33
metadata CHANGED
@@ -3,10 +3,10 @@ name: gumdrop
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
+ - 1
6
7
  - 0
7
- - 8
8
8
  - 0
9
- version: 0.8.0
9
+ version: 1.0.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matt McCray
@@ -14,11 +14,11 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-06-30 00:00:00 -05:00
17
+ date: 2012-07-04 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: sinatra
21
+ name: thor
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
@@ -57,7 +57,7 @@ dependencies:
57
57
  type: :runtime
58
58
  version_requirements: *id003
59
59
  - !ruby/object:Gem::Dependency
60
- name: listen
60
+ name: onfire
61
61
  prerelease: false
62
62
  requirement: &id004 !ruby/object:Gem::Requirement
63
63
  none: false
@@ -70,7 +70,7 @@ dependencies:
70
70
  type: :runtime
71
71
  version_requirements: *id004
72
72
  - !ruby/object:Gem::Dependency
73
- name: thor
73
+ name: sinatra
74
74
  prerelease: false
75
75
  requirement: &id005 !ruby/object:Gem::Requirement
76
76
  none: false
@@ -83,7 +83,7 @@ dependencies:
83
83
  type: :runtime
84
84
  version_requirements: *id005
85
85
  - !ruby/object:Gem::Dependency
86
- name: i18n
86
+ name: listen
87
87
  prerelease: false
88
88
  requirement: &id006 !ruby/object:Gem::Requirement
89
89
  none: false
@@ -96,7 +96,7 @@ dependencies:
96
96
  type: :runtime
97
97
  version_requirements: *id006
98
98
  - !ruby/object:Gem::Dependency
99
- name: bundle
99
+ name: i18n
100
100
  prerelease: false
101
101
  requirement: &id007 !ruby/object:Gem::Requirement
102
102
  none: false
@@ -108,7 +108,85 @@ dependencies:
108
108
  version: "0"
109
109
  type: :runtime
110
110
  version_requirements: *id007
111
- description: The sweet 'n simple cms/prototyping tool for creating static html websites and webapps.
111
+ - !ruby/object:Gem::Dependency
112
+ name: bundle
113
+ prerelease: false
114
+ requirement: &id008 !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ segments:
120
+ - 0
121
+ version: "0"
122
+ type: :runtime
123
+ version_requirements: *id008
124
+ - !ruby/object:Gem::Dependency
125
+ name: minitest
126
+ prerelease: false
127
+ requirement: &id009 !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ segments:
133
+ - 0
134
+ version: "0"
135
+ type: :development
136
+ version_requirements: *id009
137
+ - !ruby/object:Gem::Dependency
138
+ name: sqlite3
139
+ prerelease: false
140
+ requirement: &id010 !ruby/object:Gem::Requirement
141
+ none: false
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ segments:
146
+ - 0
147
+ version: "0"
148
+ type: :development
149
+ version_requirements: *id010
150
+ - !ruby/object:Gem::Dependency
151
+ name: sprockets
152
+ prerelease: false
153
+ requirement: &id011 !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ segments:
159
+ - 0
160
+ version: "0"
161
+ type: :development
162
+ version_requirements: *id011
163
+ - !ruby/object:Gem::Dependency
164
+ name: stitch
165
+ prerelease: false
166
+ requirement: &id012 !ruby/object:Gem::Requirement
167
+ none: false
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ segments:
172
+ - 0
173
+ version: "0"
174
+ type: :development
175
+ version_requirements: *id012
176
+ - !ruby/object:Gem::Dependency
177
+ name: jsmin
178
+ prerelease: false
179
+ requirement: &id013 !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ segments:
185
+ - 0
186
+ version: "0"
187
+ type: :development
188
+ version_requirements: *id013
189
+ description: The sweet 'n simple cms and prototyping tool for creating static html websites and webapps.
112
190
  email: matt@elucidata.net
113
191
  executables:
114
192
  - gumdrop
@@ -127,81 +205,152 @@ files:
127
205
  - bin/gumdrop
128
206
  - gumdrop.gemspec
129
207
  - lib/gumdrop.rb
208
+ - lib/gumdrop/builder.rb
209
+ - lib/gumdrop/cli.rb
130
210
  - lib/gumdrop/cli/external.rb
131
211
  - lib/gumdrop/cli/internal.rb
132
212
  - lib/gumdrop/content.rb
133
- - lib/gumdrop/context.rb
134
- - lib/gumdrop/data_manager.rb
213
+ - lib/gumdrop/data.rb
214
+ - lib/gumdrop/data_providers/csv.rb
215
+ - lib/gumdrop/data_providers/pstore.rb
216
+ - lib/gumdrop/data_providers/sqlite.rb
217
+ - lib/gumdrop/data_providers/xml.rb
218
+ - lib/gumdrop/data_providers/yaml_and_json.rb
219
+ - lib/gumdrop/data_providers/yamldb.rb
220
+ - lib/gumdrop/data_providers/yamldoc.rb
135
221
  - lib/gumdrop/generator.rb
222
+ - lib/gumdrop/renderer.rb
136
223
  - lib/gumdrop/server.rb
137
224
  - lib/gumdrop/site.rb
138
- - lib/gumdrop/support/base_packager.rb
139
- - lib/gumdrop/support/callbacks.rb
140
- - lib/gumdrop/support/hash_object.rb
141
- - lib/gumdrop/support/proxy_handler.rb
225
+ - lib/gumdrop/support/compressor.rb
142
226
  - lib/gumdrop/support/sprockets.rb
143
227
  - lib/gumdrop/support/stitch.rb
228
+ - lib/gumdrop/support/yaml_doc_template.rb
229
+ - lib/gumdrop/util/configurable.rb
230
+ - lib/gumdrop/util/core_ex.rb
231
+ - lib/gumdrop/util/eventable.rb
232
+ - lib/gumdrop/util/hash_object.rb
233
+ - lib/gumdrop/util/loggable.rb
234
+ - lib/gumdrop/util/pager.rb
235
+ - lib/gumdrop/util/proxy_handler.rb
236
+ - lib/gumdrop/util/scanner.rb
237
+ - lib/gumdrop/util/site_access.rb
238
+ - lib/gumdrop/util/view_helpers.rb
239
+ - lib/gumdrop/util/yaml_doc.rb
144
240
  - lib/gumdrop/version.rb
145
- - lib/gumdrop/view_helpers.rb
146
- - notes.md
147
241
  - specs/content_spec.rb
148
- - specs/deferred_loader_spec.rb
149
- - specs/fixtures/expected/posts/post1.html
150
- - specs/fixtures/expected/posts/post1.js
151
- - specs/fixtures/expected/posts/post2.html
152
- - specs/fixtures/expected/sub/sub/sub/test.html
153
- - specs/fixtures/expected/sub/sub/sub/test2.html
154
- - specs/fixtures/expected/test.js
242
+ - specs/fixtures/expected/data-access/from-csv.html
243
+ - specs/fixtures/expected/data-access/from-json.html
244
+ - specs/fixtures/expected/data-access/from-sqlite.html
245
+ - specs/fixtures/expected/data-access/from-xml.html
246
+ - specs/fixtures/expected/data-access/from-yaml.html
247
+ - specs/fixtures/expected/data-access/from-yamldb.html
248
+ - specs/fixtures/expected/data-access/from-yamldoc.html
249
+ - specs/fixtures/expected/gen-with-block/as-file.html
250
+ - specs/fixtures/expected/gen-with-block/as-plain.html
251
+ - specs/fixtures/expected/gen-with-block/layout-nested.html
252
+ - specs/fixtures/expected/gen-with-block/layout-nil.html
253
+ - specs/fixtures/expected/gen-with-block/layout-wrap.html
254
+ - specs/fixtures/expected/gen-with-inline-render/0-as-file.html
255
+ - specs/fixtures/expected/gen-with-inline-render/0-as-plain.html
256
+ - specs/fixtures/expected/gen-with-inline-render/0-layout-nil.html
257
+ - specs/fixtures/expected/gen-with-inline-render/0-layout-sub.html
258
+ - specs/fixtures/expected/gen-with-inline-render/0-layout-wrap.html
259
+ - specs/fixtures/expected/gen-with-inline-render/1-as-file.html
260
+ - specs/fixtures/expected/gen-with-inline-render/1-as-plain.html
261
+ - specs/fixtures/expected/gen-with-inline-render/1-layout-nil.html
262
+ - specs/fixtures/expected/gen-with-inline-render/1-layout-sub.html
263
+ - specs/fixtures/expected/gen-with-inline-render/1-layout-wrap.html
264
+ - specs/fixtures/expected/goodbye.html
265
+ - specs/fixtures/expected/hello.html
266
+ - specs/fixtures/expected/image.png
267
+ - specs/fixtures/expected/index.html
268
+ - specs/fixtures/expected/js/sprockets-app.js
269
+ - specs/fixtures/expected/js/stitch-app.js
270
+ - specs/fixtures/expected/js/stitch-app.min.js
271
+ - specs/fixtures/expected/js/stitch-app.min.src.js
272
+ - specs/fixtures/expected/js/straight.js
273
+ - specs/fixtures/expected/js/test-coffee.js
274
+ - specs/fixtures/expected/pages/docs/force-abs.html
275
+ - specs/fixtures/expected/pages/docs/index.html
276
+ - specs/fixtures/expected/partials/hoisted-data.html
277
+ - specs/fixtures/expected/partials/nested.html
278
+ - specs/fixtures/expected/partials/params.html
279
+ - specs/fixtures/expected/partials/with-layouts.html
280
+ - specs/fixtures/expected/robots.txt
281
+ - specs/fixtures/expected/test-multi-procs.html
282
+ - specs/fixtures/expected/test-nested-layout.html
283
+ - specs/fixtures/expected/test-no-layout.html
284
+ - specs/fixtures/expected/test-yamldoc.html
285
+ - specs/fixtures/expected/test.html
286
+ - specs/fixtures/source/Gemfile
287
+ - specs/fixtures/source/Gemfile.lock
155
288
  - specs/fixtures/source/Gumdrop
156
- - specs/fixtures/source/posts/post1.html.slim
157
- - specs/fixtures/source/posts/post1.js.coffee
158
- - specs/fixtures/source/posts/post2.html.erb
159
- - specs/fixtures/source/sub/sub/sub/test.html
160
- - specs/fixtures/source/sub/sub/sub/test2.html.erb
161
- - specs/fixtures/source/test.js.coffee
162
- - specs/fixtures/source/test.js.erb.coffee
289
+ - specs/fixtures/source/data-access/from-csv.html.erb
290
+ - specs/fixtures/source/data-access/from-json.html.erb
291
+ - specs/fixtures/source/data-access/from-sqlite.html.erb
292
+ - specs/fixtures/source/data-access/from-xml.html.erb
293
+ - specs/fixtures/source/data-access/from-yaml.html.erb
294
+ - specs/fixtures/source/data-access/from-yamldb.html.erb
295
+ - specs/fixtures/source/data-access/from-yamldoc.html.erb
296
+ - specs/fixtures/source/data/csv_data.csv
297
+ - specs/fixtures/source/data/json_data.json
298
+ - specs/fixtures/source/data/sql_data.sqlite
299
+ - specs/fixtures/source/data/xml_data.xml
300
+ - specs/fixtures/source/data/yaml_db.yamldb
301
+ - specs/fixtures/source/data/yaml_items.yaml
302
+ - specs/fixtures/source/data/yamldoc.yamldoc
303
+ - specs/fixtures/source/gen-with-inline-render.generator
304
+ - specs/fixtures/source/goodbye.html.erb
305
+ - specs/fixtures/source/hello.html
306
+ - specs/fixtures/source/image.png
307
+ - specs/fixtures/source/index.html.erb
308
+ - specs/fixtures/source/js/sprockets/app.js
309
+ - specs/fixtures/source/js/sprockets/view.js.coffee
310
+ - specs/fixtures/source/js/stitch/app.js
311
+ - specs/fixtures/source/js/stitch/view.js.coffee
312
+ - specs/fixtures/source/js/straight.js
313
+ - specs/fixtures/source/js/test-coffee.js.coffee
314
+ - specs/fixtures/source/layouts/site.layout.erb
315
+ - specs/fixtures/source/layouts/sub.layout.erb
316
+ - specs/fixtures/source/layouts/wrap.layout.erb
317
+ - specs/fixtures/source/pages/_users-nested.html.erb
318
+ - specs/fixtures/source/pages/docs/force-abs.html.erb
319
+ - specs/fixtures/source/pages/docs/index.html.erb
320
+ - specs/fixtures/source/partials/_post_entry.html.erb
321
+ - specs/fixtures/source/partials/_provides_name.html.erb
322
+ - specs/fixtures/source/partials/_user-params.html.erb
323
+ - specs/fixtures/source/partials/_user.html.erb
324
+ - specs/fixtures/source/partials/_user_sets_layout.html.erb
325
+ - specs/fixtures/source/partials/hoisted-data.html.erb
326
+ - specs/fixtures/source/partials/nested.html.erb
327
+ - specs/fixtures/source/partials/params.html.erb
328
+ - specs/fixtures/source/partials/with-layouts.html.erb
329
+ - specs/fixtures/source/test-multi-procs.html.markdown.erb
330
+ - specs/fixtures/source/test-nested-layout.html.erb
331
+ - specs/fixtures/source/test-no-layout.html.erb
332
+ - specs/fixtures/source/test-yamldoc.html.erb.yamldoc
333
+ - specs/fixtures/source/test.html.erb
163
334
  - specs/hash_object_spec.rb
164
- - templates/backbone/Gemfile
165
- - templates/backbone/Gumdrop
166
- - templates/backbone/Rakefile
167
- - templates/backbone/app/app.js.coffee
168
- - templates/backbone/app/init.js.coffee
169
- - templates/backbone/app/models/.gitkeep
170
- - templates/backbone/app/utils/index.js.coffee
171
- - templates/backbone/app/views/home.js.coffee
172
- - templates/backbone/app/views/styles/home.scss
173
- - templates/backbone/app/views/templates/home.mustache
174
- - templates/backbone/config.ru
175
- - templates/backbone/lib/all.js.coffee
176
- - templates/backbone/lib/backbone.js
177
- - templates/backbone/lib/hogan.js
178
- - templates/backbone/lib/jquery.js
179
- - templates/backbone/lib/underscore.js
180
- - templates/backbone/powrc
181
- - templates/backbone/source/default.htaccess.erb
182
- - templates/backbone/source/favicon.ico
183
- - templates/backbone/source/feed.xml.builder.txt
184
- - templates/backbone/source/index.html.erb
185
- - templates/backbone/source/theme/screen.css.sass
186
- - templates/backbone/source/theme/scripts/app.js.coffee
187
- - templates/backbone/source/theme/styles/_tools.scss
188
- - templates/backbone/source/theme/templates/app.template.slim
189
- - templates/backbone/source/theme/templates/site.template.slim
335
+ - specs/render_spec.rb
336
+ - specs/site_spec.rb
337
+ - specs/spec_helper.rb
190
338
  - templates/blank/Gemfile
191
339
  - templates/blank/Gumdrop
192
340
  - templates/default/Gemfile
193
341
  - templates/default/Gumdrop
194
- - templates/default/Rakefile
342
+ - templates/default/ReadMe.md
195
343
  - templates/default/config.ru
196
- - templates/default/powrc
197
- - templates/default/source/default.htaccess.erb
344
+ - templates/default/data/news/20120703.yamldoc
345
+ - templates/default/data/news/20120704.yamldoc
198
346
  - templates/default/source/favicon.ico
199
- - templates/default/source/feed.xml.builder.txt
347
+ - templates/default/source/feed.xml.builder
200
348
  - templates/default/source/index.html.erb
349
+ - templates/default/source/theme/layout/_sidebar.html
350
+ - templates/default/source/theme/layout/site.layout.slim
201
351
  - templates/default/source/theme/screen.css.sass
202
352
  - templates/default/source/theme/scripts/app.js.coffee
203
353
  - templates/default/source/theme/styles/_tools.scss
204
- - templates/default/source/theme/templates/site.template.slim
205
354
  has_rdoc: true
206
355
  homepage: https://github.com/darthapo/gumdrop
207
356
  licenses: []
@@ -233,6 +382,6 @@ rubyforge_project: gumdrop
233
382
  rubygems_version: 1.3.7
234
383
  signing_key:
235
384
  specification_version: 3
236
- summary: The sweet 'n simple cms/prototyping tool.
385
+ summary: The sweet 'n simple cms and prototyping tool.
237
386
  test_files: []
238
387
 
@@ -1,135 +0,0 @@
1
-
2
- module Gumdrop
3
-
4
- class Context
5
- include ::Gumdrop::ViewHelpers
6
-
7
- attr_accessor :state
8
-
9
- def initialize(site)
10
- @site= site
11
- # puts "NEW CONTEXT!!!"
12
- end
13
-
14
- def uri(path, opts={})
15
- path= path[1..-1] if path.starts_with?('/') # and path != "/"
16
- uri_string= if !@site.config.relative_paths or force_absolute
17
- "/#{ path }"
18
- else
19
- "#{ path_to_root }#{ path }"
20
- end
21
- if opts[:fresh] and @site.content_hash.has_key?(path)
22
- uri_string += "?v=#{ @site.content_hash[path].mtime.to_i }"
23
- end
24
- uri_string = "/" if uri_string == ""
25
- uri_string
26
- end
27
-
28
- def path_to_root
29
- '../' * @state['current_depth']
30
- end
31
-
32
- def url(path)
33
- path= path[1..-1] if path.starts_with?('/')
34
- "#{@site.config.site_url}/#{path}"
35
- end
36
-
37
- def slug
38
- @state['current_slug']
39
- end
40
-
41
- def get_template
42
- layout= @state['layout']
43
- @state['layout']= nil
44
- unless layout.nil?
45
- @site.layouts["#{layout}.template"]
46
- else
47
- nil
48
- end
49
- end
50
-
51
- def use_template(name)
52
- @state['layout']= name
53
- end
54
- alias_method :use_layout, :use_template
55
-
56
- def render(path, opts={})
57
- page= get_page path
58
- unless page.nil?
59
- #TODO: nested state for an inline rendered page?
60
- old_layout= @state['layout']
61
- content= page.render(nil, true, false, opts)
62
- old_layout= @state['layout']
63
- content
64
- else
65
- ""
66
- end
67
- end
68
-
69
- def data
70
- @site.data
71
- end
72
-
73
- def site
74
- @site
75
- end
76
-
77
- # Access to settings as defined in the configure block
78
- def config
79
- @site.config
80
- end
81
-
82
- def reset_data(preset={})
83
- @state = preset
84
- end
85
-
86
- def method_missing(name, value=nil)
87
- @state= Hash.new {|h,k| h[k]= nil } if @state.nil?
88
- unless value.nil?
89
- @state[name.to_s]= value
90
- else
91
- @state[name.to_s]
92
- end
93
- end
94
-
95
- def params
96
- @content.params
97
- end
98
-
99
- def set_content(content, locals)
100
- @content= content
101
- @state= @state.reverse_merge(content.params).merge(locals)
102
- end
103
-
104
- def content_for(key, &block)
105
- keyname= "_content_#{key}"
106
- if block_given?
107
- @state[keyname]= block
108
- nil
109
- else
110
- if @state.has_key?(keyname)
111
- @state[keyname].call
112
- else
113
- nil
114
- end
115
- end
116
- end
117
-
118
- def content_for?(key)
119
- keyname= "_content_#{key}"
120
- @state.has_key?(keyname)
121
- end
122
-
123
- protected
124
-
125
- def get_page(path)
126
- page= @site.content_hash[path]
127
- page= @site.content_hash["#{path}.html"] if page.nil? # Bit of a hack...
128
- page= @site.partials[path] if page.nil?
129
- page= @site.layouts[path] if page.nil? # ???
130
- page
131
- end
132
-
133
- end
134
-
135
- end