smartgen 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/Gemfile.lock +12 -12
  2. data/README.md +3 -2
  3. data/lib/smartgen/engines/base.rb +10 -10
  4. data/lib/smartgen/generator.rb +36 -33
  5. data/lib/smartgen/markup_file.rb +22 -21
  6. data/lib/smartgen/version.rb +1 -1
  7. metadata +14 -98
  8. data/spec/fixtures/expectations/common/another_index.html +0 -13
  9. data/spec/fixtures/expectations/common/index.html +0 -8
  10. data/spec/fixtures/expectations/common/other_index.html +0 -13
  11. data/spec/fixtures/expectations/indexer/index_with_indexer.html +0 -16
  12. data/spec/fixtures/expectations/indexer/index_with_indexer_and_numbered_index.html +0 -16
  13. data/spec/fixtures/expectations/with_layout/index.html +0 -12
  14. data/spec/fixtures/expectations/with_layout/index_with_metadata.html +0 -43
  15. data/spec/fixtures/expectations/with_layout/index_with_specific_metadata.html +0 -44
  16. data/spec/fixtures/src/assets/images/image.gif +0 -0
  17. data/spec/fixtures/src/assets/javascripts/somelib.js +0 -2
  18. data/spec/fixtures/src/assets/stylesheets/style.css +0 -2
  19. data/spec/fixtures/src/common/another_index.md +0 -12
  20. data/spec/fixtures/src/common/index.textile +0 -10
  21. data/spec/fixtures/src/common/other_index.markdown +0 -12
  22. data/spec/fixtures/src/common/somefile +0 -10
  23. data/spec/fixtures/src/indexer/index_with_indexer.textile +0 -26
  24. data/spec/fixtures/src/indexer/index_with_indexer_and_numbered_index.textile +0 -26
  25. data/spec/fixtures/src/layout.html.erb +0 -5
  26. data/spec/fixtures/src/layout_with_metadata.html.erb +0 -22
  27. data/spec/fixtures/src/layout_with_specific_metadata.html.erb +0 -23
  28. data/spec/fixtures/src/metadata.yml +0 -43
  29. data/spec/fixtures/src/with_layout/index.textile +0 -10
  30. data/spec/fixtures/src/with_layout/index_with_specific_metadata.textile +0 -10
  31. data/spec/lib/smartgen/configuration_spec.rb +0 -38
  32. data/spec/lib/smartgen/engines/base_spec.rb +0 -71
  33. data/spec/lib/smartgen/engines/markdown_spec.rb +0 -23
  34. data/spec/lib/smartgen/engines/textile_spec.rb +0 -19
  35. data/spec/lib/smartgen/generator_spec.rb +0 -226
  36. data/spec/lib/smartgen/indexer_spec.rb +0 -122
  37. data/spec/lib/smartgen/markup_file_spec.rb +0 -148
  38. data/spec/lib/smartgen/object_hash_spec.rb +0 -64
  39. data/spec/lib/smartgen/renderers/erb_spec.rb +0 -32
  40. data/spec/lib/smartgen/resource_spec.rb +0 -60
  41. data/spec/lib/smartgen/watcher_spec.rb +0 -71
  42. data/spec/lib/smartgen_spec.rb +0 -18
  43. data/spec/sandbox/.gitkeep +0 -0
  44. data/spec/spec_helper.rb +0 -37
@@ -1,13 +0,0 @@
1
- <h1>Here is some header</h1>
2
-
3
- <p>And here is a paragraph</p>
4
-
5
- <ul>
6
- <li>some bullet lists with <strong>style</strong></li>
7
- <li>some bullet lists with <em>style</em></li>
8
- </ul>
9
-
10
-
11
- <h2>Another header</h2>
12
-
13
- <p>With some text</p>
@@ -1,8 +0,0 @@
1
- <h1>Here is some header</h1>
2
- <p>And here is a paragraph</p>
3
- <ul>
4
- <li>some bullet lists with <strong>style</strong></li>
5
- <li>some bullet lists with <em>style</em></li>
6
- </ul>
7
- <h2>Another header</h2>
8
- <p>With some text</p>
@@ -1,13 +0,0 @@
1
- <h1>Here is some header</h1>
2
-
3
- <p>And here is a paragraph</p>
4
-
5
- <ul>
6
- <li>some bullet lists with <strong>style</strong></li>
7
- <li>some bullet lists with <em>style</em></li>
8
- </ul>
9
-
10
-
11
- <h2>Another header</h2>
12
-
13
- <p>With some text</p>
@@ -1,16 +0,0 @@
1
- <h1 id="here-is-some-header">Here is some header</h1>
2
- <p>And here is a paragraph</p>
3
- <ul>
4
- <li>some bullet lists with <strong>style</strong></li>
5
- <li>some bullet lists with <em>style</em></li>
6
- </ul>
7
- <h2 id="another-header">Another header</h2>
8
- <p>With some text</p>
9
- <h3 id="another-minor-header">Another minor header</h3>
10
- <p>With some other text</p>
11
- <h4 id="yet-another-smaller-header">Yet another smaller header</h4>
12
- <p>Again some text</p>
13
- <h3 id="a-minor-header">A minor header</h3>
14
- <p>Something</p>
15
- <h2 id="a-header">A header</h2>
16
- <p>With something</p>
@@ -1,16 +0,0 @@
1
- <h1 id="here-is-some-header">1 Here is some header</h1>
2
- <p>And here is a paragraph</p>
3
- <ul>
4
- <li>some bullet lists with <strong>style</strong></li>
5
- <li>some bullet lists with <em>style</em></li>
6
- </ul>
7
- <h2 id="another-header">1.1 Another header</h2>
8
- <p>With some text</p>
9
- <h3 id="another-minor-header">1.1.1 Another minor header</h3>
10
- <p>With some other text</p>
11
- <h4 id="yet-another-smaller-header">1.1.1.1 Yet another smaller header</h4>
12
- <p>Again some text</p>
13
- <h3 id="a-minor-header">1.1.2 A minor header</h3>
14
- <p>Something</p>
15
- <h2 id="a-header">1.2 A header</h2>
16
- <p>With something</p>
@@ -1,12 +0,0 @@
1
- <html>
2
- <body>
3
- <h1>Here is some header</h1>
4
- <p>And here is a paragraph</p>
5
- <ul>
6
- <li>some bullet lists with <strong>style</strong></li>
7
- <li>some bullet lists with <em>style</em></li>
8
- </ul>
9
- <h2>Another header</h2>
10
- <p>With some text</p>
11
- </body>
12
- </html>
@@ -1,43 +0,0 @@
1
- <html>
2
- <head>
3
- <title>Common title</title>
4
- </head>
5
- <body>
6
- <section id="menu">
7
- <dl>
8
-
9
- <dt>Common pages</dt>
10
-
11
- <dd><a href="http://link.com" title="Some description of page">Some page</a></dd>
12
-
13
- <dd><a href="http://index.com" title="Description for index page">Index Page</a></dd>
14
-
15
- <dd><a href="http://other_link.com" title="Some description of other page">Some other page</a></dd>
16
-
17
- <dd><a href="http://another_link.com" title="Some description of another page">Another page</a></dd>
18
-
19
- <hr/>
20
-
21
- <dt>Sample pages</dt>
22
-
23
- <dd><a href="http://sample.com" title="Some description of sample page">Sample page</a></dd>
24
-
25
- <dd><a href="http://sample_link.com" title="Some description of some sample page">Some sample page</a></dd>
26
-
27
-
28
-
29
- </dl>
30
- </section>
31
-
32
- <section id="contents">
33
- <h1>Here is some header</h1>
34
- <p>And here is a paragraph</p>
35
- <ul>
36
- <li>some bullet lists with <strong>style</strong></li>
37
- <li>some bullet lists with <em>style</em></li>
38
- </ul>
39
- <h2>Another header</h2>
40
- <p>With some text</p>
41
- </section>
42
- </body>
43
- </html>
@@ -1,44 +0,0 @@
1
- <html>
2
- <head>
3
- <title>Index Page :: Common title</title>
4
- <meta name="description" content="Description for index page"/>
5
- </head>
6
- <body>
7
- <section id="menu">
8
- <dl>
9
-
10
- <dt>Common pages</dt>
11
-
12
- <dd><a href="http://link.com" title="Some description of page">Some page</a></dd>
13
-
14
- <dd><a href="http://index.com" title="Description for index page">Index Page</a></dd>
15
-
16
- <dd><a href="http://other_link.com" title="Some description of other page">Some other page</a></dd>
17
-
18
- <dd><a href="http://another_link.com" title="Some description of another page">Another page</a></dd>
19
-
20
- <hr/>
21
-
22
- <dt>Sample pages</dt>
23
-
24
- <dd><a href="http://sample.com" title="Some description of sample page">Sample page</a></dd>
25
-
26
- <dd><a href="http://sample_link.com" title="Some description of some sample page">Some sample page</a></dd>
27
-
28
-
29
-
30
- </dl>
31
- </section>
32
-
33
- <section id="contents">
34
- <h1>Here is some header</h1>
35
- <p>And here is a paragraph</p>
36
- <ul>
37
- <li>some bullet lists with <strong>style</strong></li>
38
- <li>some bullet lists with <em>style</em></li>
39
- </ul>
40
- <h2>Another header</h2>
41
- <p>With some text</p>
42
- </section>
43
- </body>
44
- </html>
@@ -1,2 +0,0 @@
1
- // Some javascript file
2
- var x = 0;
@@ -1,2 +0,0 @@
1
- #some-id { color: #fff; }
2
- .some-class { color: #000; }
@@ -1,12 +0,0 @@
1
- Here is some header
2
- ===================
3
-
4
- And here is a paragraph
5
-
6
- * some bullet lists with **style**
7
- * some bullet lists with _style_
8
-
9
- Another header
10
- --------------
11
-
12
- With some text
@@ -1,10 +0,0 @@
1
- h1. Here is some header
2
-
3
- And here is a paragraph
4
-
5
- * some bullet lists with *style*
6
- * some bullet lists with _style_
7
-
8
- h2. Another header
9
-
10
- With some text
@@ -1,12 +0,0 @@
1
- Here is some header
2
- ===================
3
-
4
- And here is a paragraph
5
-
6
- * some bullet lists with **style**
7
- * some bullet lists with _style_
8
-
9
- Another header
10
- --------------
11
-
12
- With some text
@@ -1,10 +0,0 @@
1
- h1. Here is some header
2
-
3
- And here is a paragraph
4
-
5
- * some bullet lists with *style*
6
- * some bullet lists with _style_
7
-
8
- h2. Another header
9
-
10
- With some text
@@ -1,26 +0,0 @@
1
- h1. Here is some header
2
-
3
- And here is a paragraph
4
-
5
- * some bullet lists with *style*
6
- * some bullet lists with _style_
7
-
8
- h2. Another header
9
-
10
- With some text
11
-
12
- h3. Another minor header
13
-
14
- With some other text
15
-
16
- h4. Yet another smaller header
17
-
18
- Again some text
19
-
20
- h3. A minor header
21
-
22
- Something
23
-
24
- h2. A header
25
-
26
- With something
@@ -1,26 +0,0 @@
1
- h1. Here is some header
2
-
3
- And here is a paragraph
4
-
5
- * some bullet lists with *style*
6
- * some bullet lists with _style_
7
-
8
- h2. Another header
9
-
10
- With some text
11
-
12
- h3. Another minor header
13
-
14
- With some other text
15
-
16
- h4. Yet another smaller header
17
-
18
- Again some text
19
-
20
- h3. A minor header
21
-
22
- Something
23
-
24
- h2. A header
25
-
26
- With something
@@ -1,5 +0,0 @@
1
- <html>
2
- <body>
3
- <%= markup_file.contents %>
4
- </body>
5
- </html>
@@ -1,22 +0,0 @@
1
- <html>
2
- <head>
3
- <title><%= metadata.title %></title>
4
- </head>
5
- <body>
6
- <section id="menu">
7
- <dl>
8
- <% metadata.menu.each do |entry| %>
9
- <dt><%= entry.category %></dt>
10
- <% entry.pages.each do |page| %>
11
- <dd><a href="<%= page.link %>" title="<%= page.description %>"><%= page.title %></a></dd>
12
- <% end %>
13
- <% unless metadata.menu.last == entry %><hr/><% end %>
14
- <% end %>
15
- </dl>
16
- </section>
17
-
18
- <section id="contents">
19
- <%= markup_file.contents %>
20
- </section>
21
- </body>
22
- </html>
@@ -1,23 +0,0 @@
1
- <html>
2
- <head>
3
- <title><%= metadata.current_page.title %> :: <%= metadata.title %></title>
4
- <meta name="description" content="<%= metadata.current_page.description %>"/>
5
- </head>
6
- <body>
7
- <section id="menu">
8
- <dl>
9
- <% metadata.menu.each do |entry| %>
10
- <dt><%= entry.category %></dt>
11
- <% entry.pages.each do |page| %>
12
- <dd><a href="<%= page.link %>" title="<%= page.description %>"><%= page.title %></a></dd>
13
- <% end %>
14
- <% unless metadata.menu.last == entry %><hr/><% end %>
15
- <% end %>
16
- </dl>
17
- </section>
18
-
19
- <section id="contents">
20
- <%= markup_file.contents %>
21
- </section>
22
- </body>
23
- </html>
@@ -1,43 +0,0 @@
1
- title: Common title
2
- pages:
3
- - &index
4
- file: index_with_specific_metadata
5
- title: Index Page
6
- description: Description for index page
7
- link: http://index.com
8
- menu:
9
- - {
10
- category: Common pages,
11
- pages:
12
- [{
13
- title: Some page,
14
- description: Some description of page,
15
- link: http://link.com
16
- },
17
- *index,
18
- {
19
- title: Some other page,
20
- description: Some description of other page,
21
- link: http://other_link.com
22
- },
23
- {
24
- title: Another page,
25
- description: Some description of another page,
26
- link: http://another_link.com
27
- }]
28
- }
29
- - {
30
- category: Sample pages,
31
- pages:
32
- [{
33
- title: Sample page,
34
- description: Some description of sample page,
35
- link: http://sample.com
36
- },
37
- {
38
- title: Some sample page,
39
- description: Some description of some sample page,
40
- link: http://sample_link.com
41
- }]
42
- }
43
-
@@ -1,10 +0,0 @@
1
- h1. Here is some header
2
-
3
- And here is a paragraph
4
-
5
- * some bullet lists with *style*
6
- * some bullet lists with _style_
7
-
8
- h2. Another header
9
-
10
- With some text
@@ -1,10 +0,0 @@
1
- h1. Here is some header
2
-
3
- And here is a paragraph
4
-
5
- * some bullet lists with *style*
6
- * some bullet lists with _style_
7
-
8
- h2. Another header
9
-
10
- With some text
@@ -1,38 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Smartgen::Configuration do
4
- matcher :be_an_empty_array do
5
- match { |actual| actual.instance_of?(Array) && actual.empty? }
6
- end
7
-
8
- describe "defaults" do
9
- it "should initialize src_files to an empty array" do
10
- subject.src_files.should be_an_empty_array
11
- subject.src_files.should be_empty
12
- end
13
-
14
- it "should initialize output folder to nil" do
15
- subject.output_folder.should be_nil
16
- end
17
-
18
- it "should initialize layout to nil" do
19
- subject.layout.should be_nil
20
- end
21
-
22
- it "should initialize assets to an empty array" do
23
- subject.assets.should be_an_empty_array
24
- end
25
-
26
- it "should initialize metadata_file to nil" do
27
- subject.metadata_file.should be_nil
28
- end
29
-
30
- it "should initialize use_indexer to false" do
31
- subject.use_indexer.should be_false
32
- end
33
-
34
- it "should initialize numbered_index to false" do
35
- subject.numbered_index.should be_false
36
- end
37
- end
38
- end