henshin 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/.gitignore +1 -1
  2. data/README.markdown +0 -1
  3. data/Rakefile +4 -1
  4. data/VERSION +1 -1
  5. data/bin/files.rb +46 -0
  6. data/bin/henshin +47 -79
  7. data/henshin.gemspec +37 -14
  8. data/lib/henshin.rb +50 -36
  9. data/lib/henshin/archive.rb +161 -0
  10. data/lib/henshin/categories.rb +6 -1
  11. data/lib/henshin/ext.rb +2 -53
  12. data/lib/henshin/gen.rb +16 -15
  13. data/lib/henshin/plugin.rb +20 -7
  14. data/lib/henshin/plugins/highlight.rb +31 -0
  15. data/lib/henshin/plugins/liquid.rb +48 -14
  16. data/lib/henshin/plugins/maruku.rb +3 -4
  17. data/lib/henshin/plugins/sass.rb +7 -6
  18. data/lib/henshin/plugins/textile.rb +3 -4
  19. data/lib/henshin/post.rb +50 -8
  20. data/lib/henshin/site.rb +60 -34
  21. data/lib/henshin/tags.rb +5 -1
  22. data/test/site/css/{print.sass → includes/reset.sass} +0 -3
  23. data/test/site/css/{screen.css → print.css} +1 -4
  24. data/test/site/css/screen.sass +70 -0
  25. data/test/site/includes/head.html +1 -0
  26. data/test/site/index.html +12 -2
  27. data/test/site/layouts/archive_date.html +19 -0
  28. data/test/site/layouts/archive_month.html +19 -0
  29. data/test/site/layouts/archive_year.html +19 -0
  30. data/test/site/layouts/category_index.html +5 -4
  31. data/test/site/layouts/category_page.html +2 -2
  32. data/test/site/layouts/main.html +1 -36
  33. data/test/site/layouts/post.html +15 -5
  34. data/test/site/layouts/tag_index.html +3 -3
  35. data/test/site/layouts/tag_page.html +2 -2
  36. data/test/site/options.yaml +7 -4
  37. data/test/site/posts/Testing-Stuff.markdown +7 -1
  38. data/test/test_archives.rb +27 -0
  39. data/test/test_categories.rb +0 -0
  40. data/test/test_gens.rb +28 -7
  41. data/test/test_options.rb +4 -2
  42. data/test/test_posts.rb +50 -14
  43. data/test/test_site.rb +55 -7
  44. data/test/test_statics.rb +0 -0
  45. data/test/test_tags.rb +0 -0
  46. data/test/text_exts.rb +0 -0
  47. metadata +86 -17
  48. data/lib/henshin/plugins/pygments.rb +0 -17
@@ -11,13 +11,12 @@ class TestSite < Test::Unit::TestCase
11
11
  remove_site
12
12
  @site.reset
13
13
 
14
- assert_equal @site.posts.length, 0
15
- assert_equal @site.gens.length, 0
16
- assert_equal @site.statics.length, 0
17
- assert_equal @site.archive.length, 0
18
- assert_equal @site.tags.length, 0
19
- assert_equal @site.categories.length, 0
20
- assert_equal @site.layouts.length, 0
14
+ assert_equal 0, @site.posts.length
15
+ assert_equal 0, @site.gens.length
16
+ assert_equal 0, @site.statics.length
17
+ assert_equal 0, @site.tags.length
18
+ assert_equal 0, @site.categories.length
19
+ assert_equal 0, @site.layouts.length
21
20
  end
22
21
 
23
22
  should "read posts" do
@@ -31,6 +30,55 @@ class TestSite < Test::Unit::TestCase
31
30
  l = Dir.glob( File.join(root_dir, 'layouts', '*.*') )
32
31
  assert_equal l.size, @site.layouts.size
33
32
  end
33
+
34
+ should "read static files" do
35
+ @site.read_statics
36
+ # For reference these are the static files:
37
+ # /css/screen.css
38
+ # /static.html
39
+ assert_equal 2, @site.statics.size
40
+ end
41
+
42
+ should "read gens" do
43
+ @site.read_gens
44
+ # For reference these are the gens
45
+ # /css/print.sass
46
+ # /css/includes/reset.sass
47
+ # /index.html
48
+ assert_equal 3, @site.gens.size
49
+ end
50
+
51
+ should "have a payload" do
52
+ assert @site.payload['site'].is_a? Hash
53
+ end
54
+
55
+ should "create tags" do
56
+ @site.read
57
+ @site.process
58
+ # For reference these are the tags:
59
+ # test: lorem-ipsum.markdown, same-date.markdown, Testing-Stuff.markdown, Textile-Test.textile
60
+ # markdown: Testing-Stuff.markdown
61
+ # lorem: lorem-ipsum.markdown, same-date.markdown
62
+ # plugin: Textile-Test.textile
63
+ assert_equal 4, @site.tags.size
64
+ assert_equal 4, @site.tags['test'].posts.size
65
+ end
66
+
67
+ should "create categories" do
68
+ @site.read
69
+ @site.process
70
+ # For reference these are the categories:
71
+ # cat: cat/test.markdown
72
+ # test: Testing-Stuff.markdown
73
+ assert_equal 2, @site.categories.size
74
+ assert_equal 1, @site.categories['cat'].posts.size
75
+ end
76
+
77
+ should "create archives" do
78
+ @site.read
79
+ @site.process
80
+ assert @site.archive.is_a? Henshin::Archive
81
+ end
34
82
 
35
83
  end
36
84
  end
File without changes
File without changes
File without changes
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
8
- - 2
9
- version: 0.2.2
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - hawx
@@ -14,13 +14,69 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-06 00:00:00 +01:00
18
- default_executable: henshin
17
+ date: 2010-06-22 00:00:00 +01:00
18
+ default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: thoughtbot-shoulda
21
+ name: titlecase
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 1
30
+ - 0
31
+ version: 0.1.0
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: directory_watcher
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 3
44
+ - 1
45
+ version: 1.3.1
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: maruku
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ - 6
58
+ - 0
59
+ version: 0.6.0
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: liquid
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 2
71
+ - 0
72
+ - 0
73
+ version: 2.0.0
74
+ type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: thoughtbot-shoulda
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
24
80
  requirements:
25
81
  - - ">="
26
82
  - !ruby/object:Gem::Version
@@ -28,11 +84,11 @@ dependencies:
28
84
  - 0
29
85
  version: "0"
30
86
  type: :development
31
- version_requirements: *id001
87
+ version_requirements: *id005
32
88
  - !ruby/object:Gem::Dependency
33
89
  name: yard
34
90
  prerelease: false
35
- requirement: &id002 !ruby/object:Gem::Requirement
91
+ requirement: &id006 !ruby/object:Gem::Requirement
36
92
  requirements:
37
93
  - - ">="
38
94
  - !ruby/object:Gem::Version
@@ -40,10 +96,11 @@ dependencies:
40
96
  - 0
41
97
  version: "0"
42
98
  type: :development
43
- version_requirements: *id002
99
+ version_requirements: *id006
44
100
  description: Henshin is a static site generator, with a plugin system and more
45
101
  email: m@hawx.me
46
102
  executables:
103
+ - files.rb
47
104
  - henshin
48
105
  extensions: []
49
106
 
@@ -56,16 +113,18 @@ files:
56
113
  - README.markdown
57
114
  - Rakefile
58
115
  - VERSION
116
+ - bin/files.rb
59
117
  - bin/henshin
60
118
  - henshin.gemspec
61
119
  - lib/henshin.rb
120
+ - lib/henshin/archive.rb
62
121
  - lib/henshin/categories.rb
63
122
  - lib/henshin/ext.rb
64
123
  - lib/henshin/gen.rb
65
124
  - lib/henshin/plugin.rb
125
+ - lib/henshin/plugins/highlight.rb
66
126
  - lib/henshin/plugins/liquid.rb
67
127
  - lib/henshin/plugins/maruku.rb
68
- - lib/henshin/plugins/pygments.rb
69
128
  - lib/henshin/plugins/sass.rb
70
129
  - lib/henshin/plugins/textile.rb
71
130
  - lib/henshin/post.rb
@@ -73,14 +132,14 @@ files:
73
132
  - lib/henshin/static.rb
74
133
  - lib/henshin/tags.rb
75
134
  - test/helper.rb
76
- - test/site/_site/2010/10/20-testing-stuff/index.html
77
- - test/site/_site/2010/5/15-lorem-ipsum/index.html
78
- - test/site/_site/css/print.css
79
- - test/site/_site/index.html
80
- - test/site/_site/static.html
81
- - test/site/css/print.sass
82
- - test/site/css/screen.css
135
+ - test/site/css/includes/reset.sass
136
+ - test/site/css/print.css
137
+ - test/site/css/screen.sass
138
+ - test/site/includes/head.html
83
139
  - test/site/index.html
140
+ - test/site/layouts/archive_date.html
141
+ - test/site/layouts/archive_month.html
142
+ - test/site/layouts/archive_year.html
84
143
  - test/site/layouts/category_index.html
85
144
  - test/site/layouts/category_page.html
86
145
  - test/site/layouts/main.html
@@ -95,12 +154,17 @@ files:
95
154
  - test/site/posts/lorem-ipsum.markdown
96
155
  - test/site/posts/same-date.markdown
97
156
  - test/site/static.html
157
+ - test/test_archives.rb
158
+ - test/test_categories.rb
98
159
  - test/test_gens.rb
99
160
  - test/test_henshin.rb
100
161
  - test/test_layouts.rb
101
162
  - test/test_options.rb
102
163
  - test/test_posts.rb
103
164
  - test/test_site.rb
165
+ - test/test_statics.rb
166
+ - test/test_tags.rb
167
+ - test/text_exts.rb
104
168
  has_rdoc: true
105
169
  homepage: http://github.com/hawx/henshin
106
170
  licenses: []
@@ -134,9 +198,14 @@ summary: Henshin is a static site generator
134
198
  test_files:
135
199
  - test/helper.rb
136
200
  - test/site/plugins/test.rb
201
+ - test/test_archives.rb
202
+ - test/test_categories.rb
137
203
  - test/test_gens.rb
138
204
  - test/test_henshin.rb
139
205
  - test/test_layouts.rb
140
206
  - test/test_options.rb
141
207
  - test/test_posts.rb
142
208
  - test/test_site.rb
209
+ - test/test_statics.rb
210
+ - test/test_tags.rb
211
+ - test/text_exts.rb
@@ -1,17 +0,0 @@
1
- require 'henshin/plugin'
2
-
3
- class PygmentsPlugin < Henshin::Generator
4
-
5
- attr_accessor :extensions
6
-
7
- def initialize
8
- @extensions = {:input => [],
9
- :output => ''}
10
- end
11
-
12
- def generate( content )
13
-
14
- end
15
-
16
- Henshin.register! self
17
- end