ruby-slippers 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.rvmrc +2 -0
  2. data/Gemfile +16 -0
  3. data/Gemfile.lock +90 -0
  4. data/Guardfile +16 -0
  5. data/LICENSE +20 -0
  6. data/README.md +114 -0
  7. data/Rakefile +5 -0
  8. data/VERSION +1 -0
  9. data/lib/ext/ext.rb +57 -0
  10. data/lib/ruby_slippers/app.rb +41 -0
  11. data/lib/ruby_slippers/archives.rb +22 -0
  12. data/lib/ruby_slippers/article.rb +84 -0
  13. data/lib/ruby_slippers/config.rb +35 -0
  14. data/lib/ruby_slippers/context.rb +38 -0
  15. data/lib/ruby_slippers/engine.rb +21 -0
  16. data/lib/ruby_slippers/repo.rb +21 -0
  17. data/lib/ruby_slippers/site.rb +103 -0
  18. data/lib/ruby_slippers/template.rb +28 -0
  19. data/lib/ruby_slippers.rb +28 -0
  20. data/lib/tasks/gemspec.rake +24 -0
  21. data/lib/tasks/test.rake +17 -0
  22. data/test/fixtures/articles/2010-05-17-the-wonderful-wizard-of-oz.txt +6 -0
  23. data/test/fixtures/articles/2010-05-18-the-marvelous-land-of-oz.txt +6 -0
  24. data/test/fixtures/articles/2010-05-20-dorothy-and-the-wizard-of-oz.txt +6 -0
  25. data/test/fixtures/articles/2011-05-18-ozma-of-oz.txt +8 -0
  26. data/test/fixtures/images/ozma.png +0 -0
  27. data/test/fixtures/pages/about.rhtml +1 -0
  28. data/test/fixtures/pages/archives.rhtml +5 -0
  29. data/test/fixtures/pages/article.rhtml +4 -0
  30. data/test/fixtures/pages/index.rhtml +13 -0
  31. data/test/fixtures/pages/tagged.rhtml +9 -0
  32. data/test/fixtures/templates/index.builder +21 -0
  33. data/test/fixtures/templates/layout.rhtml +4 -0
  34. data/test/fixtures/templates/repo.rhtml +1 -0
  35. data/test/integration/article_test.rb +44 -0
  36. data/test/integration/atom_test.rb +19 -0
  37. data/test/integration/ruby_slippers_test.rb +77 -0
  38. data/test/support/test_helper.rb +46 -0
  39. data/test/unit/archives_test.rb +8 -0
  40. data/test/unit/article_test.rb +118 -0
  41. data/test/unit/ruby_slippers_test.rb +75 -0
  42. metadata +318 -0
@@ -0,0 +1,75 @@
1
+ require 'support/test_helper'
2
+ require 'date'
3
+
4
+ context RubySlippers::Engine do
5
+ setup do
6
+ @config = RubySlippers::Engine::Config.new(:markdown => true, :author => AUTHOR, :url => URL)
7
+ @ruby_slippers = Rack::MockRequest.new(RubySlippers::Engine::App.new(@config))
8
+ RubySlippers::Engine::Paths[:articles] = "test/fixtures/articles"
9
+ RubySlippers::Engine::Paths[:pages] = "test/fixtures/pages"
10
+ RubySlippers::Engine::Paths[:templates] = "test/fixtures/templates"
11
+ end
12
+
13
+ context "GET to a repo name" do
14
+ setup do
15
+ class RubySlippers::Engine::Repo
16
+ def readme() "#{self[:name]}'s README" end
17
+ end
18
+ end
19
+
20
+ context "when the repo is in the :repos array" do
21
+ setup do
22
+ @config[:github] = {:user => "dreamr", :repos => ['repo']}
23
+ @ruby_slippers.get('/repo')
24
+ end
25
+ should("return repo's README") { topic.body }.includes("repo's README")
26
+ end
27
+
28
+ context "when the repo is not in the :repos array" do
29
+ setup do
30
+ @config[:github] = {:user => "dreamr", :repos => []}
31
+ @ruby_slippers.get('/repo')
32
+ end
33
+ should("return a 404") { topic.status }.equals 404
34
+ end
35
+ end
36
+
37
+ context "using Config#set with a hash" do
38
+ setup do
39
+ conf = RubySlippers::Engine::Config.new({})
40
+ conf.set(:summary, {:delim => /%/})
41
+ conf
42
+ end
43
+
44
+ should("set summary[:delim] to /%/") { topic[:summary][:delim].source }.equals "%"
45
+ should("leave the :max intact") { topic[:summary][:max] }.equals 150
46
+ end
47
+
48
+ context "using Config#set with a block" do
49
+ setup do
50
+ conf = RubySlippers::Engine::Config.new({})
51
+ conf.set(:to_html) {|path, p, _| path + p }
52
+ conf
53
+ end
54
+
55
+ should("set the value to a proc") { topic[:to_html] }.respond_to :call
56
+ end
57
+
58
+ context "testing individual configuration parameters" do
59
+ context "generate error pages" do
60
+ setup do
61
+ conf = RubySlippers::Engine::Config.new({})
62
+ conf.set(:error) {|code| "error code #{code}" }
63
+ conf
64
+ end
65
+
66
+ should("create an error page") { topic[:error].call(400) }.equals "error code 400"
67
+ end
68
+ end
69
+
70
+ context "extensions to the core Ruby library" do
71
+ should("respond to iso8601") { Date.today }.respond_to?(:iso8601)
72
+ end
73
+ end
74
+
75
+
metadata ADDED
@@ -0,0 +1,318 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-slippers
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - dreamr
14
+ - cloudhead
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2011-06-21 00:00:00 -07:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ type: :runtime
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ prerelease: false
34
+ name: rake
35
+ requirement: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ type: :runtime
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ prerelease: false
48
+ name: rack
49
+ requirement: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ type: :runtime
52
+ version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ prerelease: false
62
+ name: hpricot
63
+ requirement: *id003
64
+ - !ruby/object:Gem::Dependency
65
+ type: :runtime
66
+ version_requirements: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ prerelease: false
76
+ name: builder
77
+ requirement: *id004
78
+ - !ruby/object:Gem::Dependency
79
+ type: :runtime
80
+ version_requirements: &id005 !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ hash: 3
86
+ segments:
87
+ - 0
88
+ version: "0"
89
+ prerelease: false
90
+ name: rdiscount
91
+ requirement: *id005
92
+ - !ruby/object:Gem::Dependency
93
+ type: :runtime
94
+ version_requirements: &id006 !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ hash: 3
100
+ segments:
101
+ - 0
102
+ version: "0"
103
+ prerelease: false
104
+ name: maruku
105
+ requirement: *id006
106
+ - !ruby/object:Gem::Dependency
107
+ type: :development
108
+ version_requirements: &id007 !ruby/object:Gem::Requirement
109
+ none: false
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ hash: 3
114
+ segments:
115
+ - 0
116
+ version: "0"
117
+ prerelease: false
118
+ name: guard
119
+ requirement: *id007
120
+ - !ruby/object:Gem::Dependency
121
+ type: :development
122
+ version_requirements: &id008 !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ hash: 3
128
+ segments:
129
+ - 0
130
+ version: "0"
131
+ prerelease: false
132
+ name: guard-bundler
133
+ requirement: *id008
134
+ - !ruby/object:Gem::Dependency
135
+ type: :development
136
+ version_requirements: &id009 !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ hash: 3
142
+ segments:
143
+ - 0
144
+ version: "0"
145
+ prerelease: false
146
+ name: guard-test
147
+ requirement: *id009
148
+ - !ruby/object:Gem::Dependency
149
+ type: :development
150
+ version_requirements: &id010 !ruby/object:Gem::Requirement
151
+ none: false
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ hash: 3
156
+ segments:
157
+ - 0
158
+ version: "0"
159
+ prerelease: false
160
+ name: riot
161
+ requirement: *id010
162
+ - !ruby/object:Gem::Dependency
163
+ type: :development
164
+ version_requirements: &id011 !ruby/object:Gem::Requirement
165
+ none: false
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ hash: 3
170
+ segments:
171
+ - 0
172
+ version: "0"
173
+ prerelease: false
174
+ name: jeweler
175
+ requirement: *id011
176
+ - !ruby/object:Gem::Dependency
177
+ type: :development
178
+ version_requirements: &id012 !ruby/object:Gem::Requirement
179
+ none: false
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ hash: 3
184
+ segments:
185
+ - 0
186
+ version: "0"
187
+ prerelease: false
188
+ name: riot
189
+ requirement: *id012
190
+ - !ruby/object:Gem::Dependency
191
+ type: :runtime
192
+ version_requirements: &id013 !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ">="
196
+ - !ruby/object:Gem::Version
197
+ hash: 3
198
+ segments:
199
+ - 0
200
+ version: "0"
201
+ prerelease: false
202
+ name: builder
203
+ requirement: *id013
204
+ - !ruby/object:Gem::Dependency
205
+ type: :runtime
206
+ version_requirements: &id014 !ruby/object:Gem::Requirement
207
+ none: false
208
+ requirements:
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ hash: 3
212
+ segments:
213
+ - 0
214
+ version: "0"
215
+ prerelease: false
216
+ name: rack
217
+ requirement: *id014
218
+ - !ruby/object:Gem::Dependency
219
+ type: :runtime
220
+ version_requirements: &id015 !ruby/object:Gem::Requirement
221
+ none: false
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ hash: 3
226
+ segments:
227
+ - 0
228
+ version: "0"
229
+ prerelease: false
230
+ name: rdiscount
231
+ requirement: *id015
232
+ description: A ruby and rack based blog engine for heroku
233
+ email: james@rubyloves.me
234
+ executables: []
235
+
236
+ extensions: []
237
+
238
+ extra_rdoc_files:
239
+ - LICENSE
240
+ - README.md
241
+ files:
242
+ - .rvmrc
243
+ - Gemfile
244
+ - Gemfile.lock
245
+ - Guardfile
246
+ - LICENSE
247
+ - README.md
248
+ - Rakefile
249
+ - VERSION
250
+ - lib/ext/ext.rb
251
+ - lib/ruby_slippers.rb
252
+ - lib/ruby_slippers/app.rb
253
+ - lib/ruby_slippers/archives.rb
254
+ - lib/ruby_slippers/article.rb
255
+ - lib/ruby_slippers/config.rb
256
+ - lib/ruby_slippers/context.rb
257
+ - lib/ruby_slippers/engine.rb
258
+ - lib/ruby_slippers/repo.rb
259
+ - lib/ruby_slippers/site.rb
260
+ - lib/ruby_slippers/template.rb
261
+ - lib/tasks/gemspec.rake
262
+ - lib/tasks/test.rake
263
+ - test/fixtures/articles/2010-05-17-the-wonderful-wizard-of-oz.txt
264
+ - test/fixtures/articles/2010-05-18-the-marvelous-land-of-oz.txt
265
+ - test/fixtures/articles/2010-05-20-dorothy-and-the-wizard-of-oz.txt
266
+ - test/fixtures/articles/2011-05-18-ozma-of-oz.txt
267
+ - test/fixtures/images/ozma.png
268
+ - test/fixtures/pages/about.rhtml
269
+ - test/fixtures/pages/archives.rhtml
270
+ - test/fixtures/pages/article.rhtml
271
+ - test/fixtures/pages/index.rhtml
272
+ - test/fixtures/pages/tagged.rhtml
273
+ - test/fixtures/templates/index.builder
274
+ - test/fixtures/templates/layout.rhtml
275
+ - test/fixtures/templates/repo.rhtml
276
+ - test/integration/article_test.rb
277
+ - test/integration/atom_test.rb
278
+ - test/integration/ruby_slippers_test.rb
279
+ - test/support/test_helper.rb
280
+ - test/unit/archives_test.rb
281
+ - test/unit/article_test.rb
282
+ - test/unit/ruby_slippers_test.rb
283
+ has_rdoc: true
284
+ homepage: http://github.com/dreamr/ruby_slippers
285
+ licenses: []
286
+
287
+ post_install_message:
288
+ rdoc_options: []
289
+
290
+ require_paths:
291
+ - lib
292
+ required_ruby_version: !ruby/object:Gem::Requirement
293
+ none: false
294
+ requirements:
295
+ - - ">="
296
+ - !ruby/object:Gem::Version
297
+ hash: 3
298
+ segments:
299
+ - 0
300
+ version: "0"
301
+ required_rubygems_version: !ruby/object:Gem::Requirement
302
+ none: false
303
+ requirements:
304
+ - - ">="
305
+ - !ruby/object:Gem::Version
306
+ hash: 3
307
+ segments:
308
+ - 0
309
+ version: "0"
310
+ requirements: []
311
+
312
+ rubyforge_project:
313
+ rubygems_version: 1.3.7
314
+ signing_key:
315
+ specification_version: 3
316
+ summary: the smartest blog-engine in all of Oz
317
+ test_files: []
318
+