smartgen 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/ChangeLog.md +14 -0
  2. data/Gemfile.lock +2 -2
  3. data/README.md +7 -0
  4. data/lib/smartgen/configuration.rb +1 -49
  5. data/lib/smartgen/engines.rb +1 -0
  6. data/lib/smartgen/engines/base.rb +3 -3
  7. data/lib/smartgen/engines/erb.rb +15 -0
  8. data/lib/smartgen/engines/markdown.rb +1 -1
  9. data/lib/smartgen/engines/textile.rb +1 -1
  10. data/lib/smartgen/generator.rb +29 -17
  11. data/lib/smartgen/markup_file.rb +6 -2
  12. data/lib/smartgen/object_hash.rb +15 -5
  13. data/lib/smartgen/rake_task.rb +21 -5
  14. data/lib/smartgen/renderers/erb.rb +1 -4
  15. data/lib/smartgen/resource.rb +1 -9
  16. data/lib/smartgen/version.rb +1 -1
  17. data/spec/fixtures/expectations/common/another_index.html +13 -0
  18. data/spec/fixtures/expectations/common/index.html +8 -0
  19. data/spec/fixtures/expectations/common/other_index.html +13 -0
  20. data/spec/fixtures/expectations/erb/index.html +15 -0
  21. data/spec/fixtures/expectations/erb/with_layout/index.html +19 -0
  22. data/spec/fixtures/expectations/indexer/index_with_indexer.html +16 -0
  23. data/spec/fixtures/expectations/indexer/index_with_indexer_and_numbered_index.html +16 -0
  24. data/spec/fixtures/expectations/with_layout/index.html +12 -0
  25. data/spec/fixtures/expectations/with_layout/index_with_metadata.html +43 -0
  26. data/spec/fixtures/expectations/with_layout/index_with_specific_metadata.html +44 -0
  27. data/spec/fixtures/src/assets/images/image.gif +0 -0
  28. data/spec/fixtures/src/assets/javascripts/somelib.js +2 -0
  29. data/spec/fixtures/src/assets/stylesheets/style.css +2 -0
  30. data/spec/fixtures/src/common/another_index.md +12 -0
  31. data/spec/fixtures/src/common/index.textile +10 -0
  32. data/spec/fixtures/src/common/other_index.markdown +12 -0
  33. data/spec/fixtures/src/common/somefile +10 -0
  34. data/spec/fixtures/src/erb/index.html.erb +7 -0
  35. data/spec/fixtures/src/erb/with_layout/index.html.erb +7 -0
  36. data/spec/fixtures/src/erb/with_layout/layout.html.erb +5 -0
  37. data/spec/fixtures/src/indexer/index_with_indexer.textile +26 -0
  38. data/spec/fixtures/src/indexer/index_with_indexer_and_numbered_index.textile +26 -0
  39. data/spec/fixtures/src/layout.html.erb +5 -0
  40. data/spec/fixtures/src/layout_with_metadata.html.erb +22 -0
  41. data/spec/fixtures/src/layout_with_specific_metadata.html.erb +23 -0
  42. data/spec/fixtures/src/metadata.yml +43 -0
  43. data/spec/fixtures/src/with_layout/index.textile +10 -0
  44. data/spec/fixtures/src/with_layout/index_with_specific_metadata.textile +10 -0
  45. data/spec/lib/smartgen/configuration_spec.rb +5 -0
  46. data/spec/lib/smartgen/engines/base_spec.rb +73 -0
  47. data/spec/lib/smartgen/engines/erb_spec.rb +37 -0
  48. data/spec/lib/smartgen/engines/markdown_spec.rb +23 -0
  49. data/spec/lib/smartgen/engines/textile_spec.rb +19 -0
  50. data/spec/lib/smartgen/generator_spec.rb +272 -0
  51. data/spec/lib/smartgen/indexer_spec.rb +122 -0
  52. data/spec/lib/smartgen/markup_file_spec.rb +168 -0
  53. data/spec/lib/smartgen/object_hash_spec.rb +91 -0
  54. data/spec/lib/smartgen/renderers/erb_spec.rb +32 -0
  55. data/spec/lib/smartgen/resource_spec.rb +73 -0
  56. data/spec/lib/smartgen/watcher_spec.rb +71 -0
  57. data/spec/lib/smartgen_spec.rb +18 -0
  58. data/spec/sandbox/.gitkeep +0 -0
  59. data/spec/spec_helper.rb +37 -0
  60. metadata +99 -13
File without changes
@@ -0,0 +1,37 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
3
+ require 'rspec'
4
+ require 'smartgen'
5
+
6
+ RSpec.configure do |config|
7
+ def fixture(path)
8
+ File.join(fixtures_dir, path)
9
+ end
10
+
11
+ def fixtures_dir
12
+ File.expand_path('fixtures', File.dirname(__FILE__))
13
+ end
14
+
15
+ def sandbox(path)
16
+ File.join(sandbox_dir, path)
17
+ end
18
+
19
+ def sandbox_dir
20
+ File.expand_path('sandbox', File.dirname(__FILE__))
21
+ end
22
+
23
+ def capture(stream)
24
+ begin
25
+ stream = stream.to_s
26
+ eval "$#{stream} = StringIO.new"
27
+ yield
28
+ result = eval("$#{stream}").string
29
+ ensure
30
+ eval("$#{stream} = #{stream.upcase}")
31
+ end
32
+
33
+ result
34
+ end
35
+
36
+ alias silence capture
37
+ end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 4
7
+ - 5
8
8
  - 0
9
- version: 0.4.0
9
+ version: 0.5.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Vicente Mundim
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-10 00:00:00 -02:00
17
+ date: 2011-02-13 00:00:00 -02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -147,28 +147,72 @@ extensions: []
147
147
  extra_rdoc_files: []
148
148
 
149
149
  files:
150
- - lib/smartgen.rb
150
+ - lib/smartgen/configuration.rb
151
151
  - lib/smartgen/engines/base.rb
152
+ - lib/smartgen/engines/erb.rb
152
153
  - lib/smartgen/engines/markdown.rb
153
154
  - lib/smartgen/engines/textile.rb
154
- - lib/smartgen/renderers.rb
155
155
  - lib/smartgen/engines.rb
156
- - lib/smartgen/renderers/erb.rb
157
- - lib/smartgen/version.rb
158
156
  - lib/smartgen/generator.rb
159
- - lib/smartgen/markup_file.rb
160
157
  - lib/smartgen/indexer.rb
161
- - lib/smartgen/watcher.rb
162
- - lib/smartgen/resource.rb
158
+ - lib/smartgen/markup_file.rb
163
159
  - lib/smartgen/object_hash.rb
164
160
  - lib/smartgen/rake_task.rb
165
- - lib/smartgen/configuration.rb
161
+ - lib/smartgen/renderers/erb.rb
162
+ - lib/smartgen/renderers.rb
163
+ - lib/smartgen/resource.rb
164
+ - lib/smartgen/version.rb
165
+ - lib/smartgen/watcher.rb
166
166
  - lib/smartgen/watcher_rake_task.rb
167
+ - lib/smartgen.rb
167
168
  - Gemfile
168
169
  - Gemfile.lock
169
170
  - Rakefile
170
171
  - README.md
171
172
  - ChangeLog.md
173
+ - spec/fixtures/expectations/common/another_index.html
174
+ - spec/fixtures/expectations/common/index.html
175
+ - spec/fixtures/expectations/common/other_index.html
176
+ - spec/fixtures/expectations/erb/index.html
177
+ - spec/fixtures/expectations/erb/with_layout/index.html
178
+ - spec/fixtures/expectations/indexer/index_with_indexer.html
179
+ - spec/fixtures/expectations/indexer/index_with_indexer_and_numbered_index.html
180
+ - spec/fixtures/expectations/with_layout/index.html
181
+ - spec/fixtures/expectations/with_layout/index_with_metadata.html
182
+ - spec/fixtures/expectations/with_layout/index_with_specific_metadata.html
183
+ - spec/fixtures/src/assets/images/image.gif
184
+ - spec/fixtures/src/assets/javascripts/somelib.js
185
+ - spec/fixtures/src/assets/stylesheets/style.css
186
+ - spec/fixtures/src/common/another_index.md
187
+ - spec/fixtures/src/common/index.textile
188
+ - spec/fixtures/src/common/other_index.markdown
189
+ - spec/fixtures/src/common/somefile
190
+ - spec/fixtures/src/erb/index.html.erb
191
+ - spec/fixtures/src/erb/with_layout/index.html.erb
192
+ - spec/fixtures/src/erb/with_layout/layout.html.erb
193
+ - spec/fixtures/src/indexer/index_with_indexer.textile
194
+ - spec/fixtures/src/indexer/index_with_indexer_and_numbered_index.textile
195
+ - spec/fixtures/src/layout.html.erb
196
+ - spec/fixtures/src/layout_with_metadata.html.erb
197
+ - spec/fixtures/src/layout_with_specific_metadata.html.erb
198
+ - spec/fixtures/src/metadata.yml
199
+ - spec/fixtures/src/with_layout/index.textile
200
+ - spec/fixtures/src/with_layout/index_with_specific_metadata.textile
201
+ - spec/lib/smartgen/configuration_spec.rb
202
+ - spec/lib/smartgen/engines/base_spec.rb
203
+ - spec/lib/smartgen/engines/erb_spec.rb
204
+ - spec/lib/smartgen/engines/markdown_spec.rb
205
+ - spec/lib/smartgen/engines/textile_spec.rb
206
+ - spec/lib/smartgen/generator_spec.rb
207
+ - spec/lib/smartgen/indexer_spec.rb
208
+ - spec/lib/smartgen/markup_file_spec.rb
209
+ - spec/lib/smartgen/object_hash_spec.rb
210
+ - spec/lib/smartgen/renderers/erb_spec.rb
211
+ - spec/lib/smartgen/resource_spec.rb
212
+ - spec/lib/smartgen/watcher_spec.rb
213
+ - spec/lib/smartgen_spec.rb
214
+ - spec/sandbox/.gitkeep
215
+ - spec/spec_helper.rb
172
216
  has_rdoc: true
173
217
  homepage: ""
174
218
  licenses: []
@@ -201,5 +245,47 @@ rubygems_version: 1.3.7
201
245
  signing_key:
202
246
  specification_version: 3
203
247
  summary: A static HTML markup generator
204
- test_files: []
205
-
248
+ test_files:
249
+ - spec/fixtures/expectations/common/another_index.html
250
+ - spec/fixtures/expectations/common/index.html
251
+ - spec/fixtures/expectations/common/other_index.html
252
+ - spec/fixtures/expectations/erb/index.html
253
+ - spec/fixtures/expectations/erb/with_layout/index.html
254
+ - spec/fixtures/expectations/indexer/index_with_indexer.html
255
+ - spec/fixtures/expectations/indexer/index_with_indexer_and_numbered_index.html
256
+ - spec/fixtures/expectations/with_layout/index.html
257
+ - spec/fixtures/expectations/with_layout/index_with_metadata.html
258
+ - spec/fixtures/expectations/with_layout/index_with_specific_metadata.html
259
+ - spec/fixtures/src/assets/images/image.gif
260
+ - spec/fixtures/src/assets/javascripts/somelib.js
261
+ - spec/fixtures/src/assets/stylesheets/style.css
262
+ - spec/fixtures/src/common/another_index.md
263
+ - spec/fixtures/src/common/index.textile
264
+ - spec/fixtures/src/common/other_index.markdown
265
+ - spec/fixtures/src/common/somefile
266
+ - spec/fixtures/src/erb/index.html.erb
267
+ - spec/fixtures/src/erb/with_layout/index.html.erb
268
+ - spec/fixtures/src/erb/with_layout/layout.html.erb
269
+ - spec/fixtures/src/indexer/index_with_indexer.textile
270
+ - spec/fixtures/src/indexer/index_with_indexer_and_numbered_index.textile
271
+ - spec/fixtures/src/layout.html.erb
272
+ - spec/fixtures/src/layout_with_metadata.html.erb
273
+ - spec/fixtures/src/layout_with_specific_metadata.html.erb
274
+ - spec/fixtures/src/metadata.yml
275
+ - spec/fixtures/src/with_layout/index.textile
276
+ - spec/fixtures/src/with_layout/index_with_specific_metadata.textile
277
+ - spec/lib/smartgen/configuration_spec.rb
278
+ - spec/lib/smartgen/engines/base_spec.rb
279
+ - spec/lib/smartgen/engines/erb_spec.rb
280
+ - spec/lib/smartgen/engines/markdown_spec.rb
281
+ - spec/lib/smartgen/engines/textile_spec.rb
282
+ - spec/lib/smartgen/generator_spec.rb
283
+ - spec/lib/smartgen/indexer_spec.rb
284
+ - spec/lib/smartgen/markup_file_spec.rb
285
+ - spec/lib/smartgen/object_hash_spec.rb
286
+ - spec/lib/smartgen/renderers/erb_spec.rb
287
+ - spec/lib/smartgen/resource_spec.rb
288
+ - spec/lib/smartgen/watcher_spec.rb
289
+ - spec/lib/smartgen_spec.rb
290
+ - spec/sandbox/.gitkeep
291
+ - spec/spec_helper.rb