zzot-zzot-semi-static 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/History.txt +6 -0
  2. data/Manifest.txt +30 -0
  3. data/README.markdown +84 -0
  4. data/VERSION.yml +4 -0
  5. data/bin/semi +6 -0
  6. data/lib/semi-static.rb +30 -0
  7. data/lib/semi-static/base.rb +74 -0
  8. data/lib/semi-static/categories.rb +74 -0
  9. data/lib/semi-static/cli.rb +126 -0
  10. data/lib/semi-static/convertable.rb +94 -0
  11. data/lib/semi-static/core_ext/hash.rb +19 -0
  12. data/lib/semi-static/index.rb +12 -0
  13. data/lib/semi-static/layout.rb +14 -0
  14. data/lib/semi-static/page.rb +58 -0
  15. data/lib/semi-static/post.rb +133 -0
  16. data/lib/semi-static/posts.rb +110 -0
  17. data/lib/semi-static/pygmentize.rb +54 -0
  18. data/lib/semi-static/site.rb +232 -0
  19. data/lib/semi-static/snippet.rb +12 -0
  20. data/lib/semi-static/statistics.rb +45 -0
  21. data/lib/semi-static/stylesheet.rb +33 -0
  22. data/test/helper.rb +111 -0
  23. data/test/ref/test_layout/default_layout.html +35 -0
  24. data/test/ref/test_layout/post_layout.html +85 -0
  25. data/test/ref/test_output/2005-03-27.html +5 -0
  26. data/test/ref/test_output/2005-03.html +4 -0
  27. data/test/ref/test_output/2005.html +5 -0
  28. data/test/ref/test_output/2008-11-24.html +5 -0
  29. data/test/ref/test_output/2008-11-26.html +5 -0
  30. data/test/ref/test_output/2008-11.html +5 -0
  31. data/test/ref/test_output/2008-12-04.html +5 -0
  32. data/test/ref/test_output/2008-12.html +4 -0
  33. data/test/ref/test_output/2008.html +6 -0
  34. data/test/ref/test_page/about.html +47 -0
  35. data/test/ref/test_page/colophon.html +45 -0
  36. data/test/ref/test_post/impressions.html +102 -0
  37. data/test/ref/test_post/lighting-up.html +102 -0
  38. data/test/ref/test_post/the-working-mans-typeface.html +88 -0
  39. data/test/source/indices/day.erb +7 -0
  40. data/test/source/indices/month.erb +10 -0
  41. data/test/source/indices/year.erb +10 -0
  42. data/test/source/layouts/default.haml +25 -0
  43. data/test/source/layouts/post.erb +36 -0
  44. data/test/source/pages/about.md +38 -0
  45. data/test/source/pages/colophon.md +36 -0
  46. data/test/source/pages/feed.xml.erb +26 -0
  47. data/test/source/posts/2005-03-27-a-bash-script-to-mess-with-the-containing-terminalapp-window.markdown +38 -0
  48. data/test/source/posts/2008-11-24-lighting-up.markdown +41 -0
  49. data/test/source/posts/2008-11-26-impressions.md +42 -0
  50. data/test/source/posts/2008-12-04-the-working-mans-typeface.html +15 -0
  51. data/test/source/scripts/jquery-1.3.js +4241 -0
  52. data/test/source/scripts/jquery-1.3.min.js +19 -0
  53. data/test/source/semi.yml +5 -0
  54. data/test/source/snippets/comment-links.html +17 -0
  55. data/test/source/snippets/comments.html +4 -0
  56. data/test/source/stylesheets/layout.sass +115 -0
  57. data/test/source/stylesheets/post.sass +21 -0
  58. data/test/source/stylesheets/screen.sass +11 -0
  59. data/test/source/stylesheets/syntax.css +60 -0
  60. data/test/source/stylesheets/text.sass +25 -0
  61. data/test/test_layout.rb +51 -0
  62. data/test/test_output.rb +61 -0
  63. data/test/test_page.rb +68 -0
  64. data/test/test_post.rb +96 -0
  65. metadata +183 -0
@@ -0,0 +1,96 @@
1
+ require "#{File.dirname __FILE__}/helper"
2
+
3
+ class TestPost < Test::Unit::TestCase
4
+ def test_post_list
5
+ with_test_site do |site|
6
+ assert_not_nil site
7
+ assert_not_nil site.posts
8
+ assert_equal 4, site.posts.length
9
+ assert_not_nil site.posts['2005-03-27-a-bash-script-to-mess-with-the-containing-terminalapp-window']
10
+ assert_not_nil site.posts['2008-12-04-the-working-mans-typeface']
11
+ assert_not_nil site.posts['2008-11-26-impressions']
12
+ assert_not_nil site.posts['2008-11-24-lighting-up']
13
+ end
14
+ end
15
+
16
+ def test_post_categories
17
+ with_test_site do |site|
18
+ assert_not_nil site
19
+ assert_not_nil site.categories
20
+ assert_equal [ :applescript, :life, :raves ], site.categories.slugs
21
+ assert_equal [ 'AppleScript', 'Life', 'Raves' ], site.categories.names
22
+ end
23
+ end
24
+
25
+ def test_post_tags
26
+ with_test_site do |site|
27
+ assert_not_nil site
28
+ assert_not_nil site.tags
29
+ assert_equal [ :'auto-show', :'catching-up', :'colbert-report',
30
+ :'comedy-central', :iphone, :rss, :travel,
31
+ :typography, :work ],
32
+ site.tags.slugs
33
+ end
34
+ end
35
+
36
+ def test_post_lighting_up
37
+ with_test_site_post('2008-11-24-lighting-up') do |site,post|
38
+ # Make sure we got what we asked for
39
+ assert_equal '2008-11-24-lighting-up', post.name
40
+
41
+ # Test the various path/uri attributes
42
+ assert_equal '2008-11-24-lighting-up.markdown', post.source_path
43
+ assert_equal '2008/11/24', post.output_dir
44
+ assert_equal '2008/11/24/lighting-up.html', post.output_path
45
+ assert_equal '/2008/11/24/lighting-up.html', post.uri
46
+
47
+ # Test that the metadata was processed correctly
48
+ assert_equal 'Lighting Up', post.title
49
+ assert_equal :post, post.layout_name
50
+ assert_equal site.categories['Life'], post.category
51
+
52
+ assert_render_equal_ref 'test_post/lighting-up.html', post
53
+ end
54
+ end
55
+
56
+ def test_post_impressions
57
+ # with_test_site { |site| fail site.posts.to_yaml }
58
+ with_test_site_post('2008-11-26-impressions') do |site,post|
59
+ # Make sure we got what we asked for
60
+ assert_equal '2008-11-26-impressions', post.name
61
+
62
+ # Test the various path/uri attributes
63
+ assert_equal '2008-11-26-impressions.md', post.source_path
64
+ assert_equal '2008/11/26', post.output_dir
65
+ assert_equal '2008/11/26/impressions.html', post.output_path
66
+ assert_equal '/2008/11/26/impressions.html', post.uri
67
+
68
+ # Test that the metadata was processed correctly
69
+ assert_equal 'Impressions', post.title
70
+ assert_equal :post, post.layout_name
71
+ assert_equal site.categories['Life'], post.category
72
+
73
+ assert_render_equal_ref 'test_post/impressions.html', post
74
+ end
75
+ end
76
+
77
+ def test_post_working_mans_typeface
78
+ with_test_site_post('2008-12-04-the-working-mans-typeface') do |site,post|
79
+ # Make sure we got what we asked for
80
+ assert_equal '2008-12-04-the-working-mans-typeface', post.name
81
+
82
+ # Test the various path/uri attributes
83
+ assert_equal '2008-12-04-the-working-mans-typeface.html', post.source_path
84
+ assert_equal '2008/12/04', post.output_dir
85
+ assert_equal '2008/12/04/the-working-mans-typeface.html', post.output_path
86
+ assert_equal '/2008/12/04/the-working-mans-typeface.html', post.uri
87
+
88
+ # Test that the metadata was processed correctly
89
+ assert_equal 'The Working Man\'s Typeface', post.title
90
+ assert_equal :post, post.layout_name
91
+ assert_equal site.categories['Raves'], post.category
92
+
93
+ assert_render_equal_ref 'test_post/the-working-mans-typeface.html', post
94
+ end
95
+ end
96
+ end
metadata ADDED
@@ -0,0 +1,183 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zzot-zzot-semi-static
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Josh Dady
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-25 00:00:00 -08:00
13
+ default_executable: semi
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: maruku
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.5.9
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: haml
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.6
34
+ version:
35
+ description: Semi-Static is yet another static site generator.
36
+ email: projects@zzot.net
37
+ executables:
38
+ - semi
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - History.txt
45
+ - Manifest.txt
46
+ - README.markdown
47
+ - VERSION.yml
48
+ - bin/semi
49
+ - lib/semi-static
50
+ - lib/semi-static/base.rb
51
+ - lib/semi-static/categories.rb
52
+ - lib/semi-static/cli.rb
53
+ - lib/semi-static/convertable.rb
54
+ - lib/semi-static/core_ext
55
+ - lib/semi-static/core_ext/hash.rb
56
+ - lib/semi-static/index.rb
57
+ - lib/semi-static/layout.rb
58
+ - lib/semi-static/page.rb
59
+ - lib/semi-static/post.rb
60
+ - lib/semi-static/posts.rb
61
+ - lib/semi-static/pygmentize.rb
62
+ - lib/semi-static/site.rb
63
+ - lib/semi-static/snippet.rb
64
+ - lib/semi-static/statistics.rb
65
+ - lib/semi-static/stylesheet.rb
66
+ - lib/semi-static.rb
67
+ - test/helper.rb
68
+ - test/output
69
+ - test/output/2005
70
+ - test/output/2005/03
71
+ - test/output/2005/03/27
72
+ - test/output/2005/03/27/a-bash-script-to-mess-with-the-containing-terminalapp-window.html
73
+ - test/output/2005/03/27/index.html
74
+ - test/output/2005/03/index.html
75
+ - test/output/2005/index.html
76
+ - test/output/2008
77
+ - test/output/2008/11
78
+ - test/output/2008/11/24
79
+ - test/output/2008/11/24/index.html
80
+ - test/output/2008/11/24/lighting-up.html
81
+ - test/output/2008/11/26
82
+ - test/output/2008/11/26/impressions.html
83
+ - test/output/2008/11/26/index.html
84
+ - test/output/2008/11/index.html
85
+ - test/output/2008/12
86
+ - test/output/2008/12/04
87
+ - test/output/2008/12/04/index.html
88
+ - test/output/2008/12/04/the-working-mans-typeface.html
89
+ - test/output/2008/12/index.html
90
+ - test/output/2008/index.html
91
+ - test/output/about.html
92
+ - test/output/colophon.html
93
+ - test/output/css
94
+ - test/output/css/screen.css
95
+ - test/output/css/syntax.css
96
+ - test/output/feed.xml
97
+ - test/output/scripts
98
+ - test/output/scripts/jquery-1.3.js
99
+ - test/output/scripts/jquery-1.3.min.js
100
+ - test/ref
101
+ - test/ref/test_layout
102
+ - test/ref/test_layout/default_layout.html
103
+ - test/ref/test_layout/post_layout.html
104
+ - test/ref/test_output
105
+ - test/ref/test_output/2005-03-27.html
106
+ - test/ref/test_output/2005-03.html
107
+ - test/ref/test_output/2005.html
108
+ - test/ref/test_output/2008-11-24.html
109
+ - test/ref/test_output/2008-11-26.html
110
+ - test/ref/test_output/2008-11.html
111
+ - test/ref/test_output/2008-12-04.html
112
+ - test/ref/test_output/2008-12.html
113
+ - test/ref/test_output/2008.html
114
+ - test/ref/test_page
115
+ - test/ref/test_page/about.html
116
+ - test/ref/test_page/colophon.html
117
+ - test/ref/test_post
118
+ - test/ref/test_post/impressions.html
119
+ - test/ref/test_post/lighting-up.html
120
+ - test/ref/test_post/the-working-mans-typeface.html
121
+ - test/source
122
+ - test/source/indices
123
+ - test/source/indices/day.erb
124
+ - test/source/indices/month.erb
125
+ - test/source/indices/year.erb
126
+ - test/source/layouts
127
+ - test/source/layouts/default.haml
128
+ - test/source/layouts/post.erb
129
+ - test/source/pages
130
+ - test/source/pages/about.md
131
+ - test/source/pages/colophon.md
132
+ - test/source/pages/feed.xml.erb
133
+ - test/source/posts
134
+ - test/source/posts/2005-03-27-a-bash-script-to-mess-with-the-containing-terminalapp-window.markdown
135
+ - test/source/posts/2008-11-24-lighting-up.markdown
136
+ - test/source/posts/2008-11-26-impressions.md
137
+ - test/source/posts/2008-12-04-the-working-mans-typeface.html
138
+ - test/source/scripts
139
+ - test/source/scripts/jquery-1.3.js
140
+ - test/source/scripts/jquery-1.3.min.js
141
+ - test/source/semi.yml
142
+ - test/source/snippets
143
+ - test/source/snippets/comment-links.html
144
+ - test/source/snippets/comments.html
145
+ - test/source/stylesheets
146
+ - test/source/stylesheets/layout.sass
147
+ - test/source/stylesheets/post.sass
148
+ - test/source/stylesheets/screen.sass
149
+ - test/source/stylesheets/syntax.css
150
+ - test/source/stylesheets/text.sass
151
+ - test/test_layout.rb
152
+ - test/test_output.rb
153
+ - test/test_page.rb
154
+ - test/test_post.rb
155
+ has_rdoc: true
156
+ homepage: http://github.com/zzot/semi-static
157
+ post_install_message:
158
+ rdoc_options:
159
+ - --inline-source
160
+ - --charset=UTF-8
161
+ require_paths:
162
+ - lib
163
+ required_ruby_version: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: "0"
168
+ version:
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: "0"
174
+ version:
175
+ requirements: []
176
+
177
+ rubyforge_project:
178
+ rubygems_version: 1.2.0
179
+ signing_key:
180
+ specification_version: 2
181
+ summary: Semi-Static is yet another static site generator.
182
+ test_files: []
183
+