toto 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/toto.rb +4 -3
- data/test/articles/1900-05-17-the-wonderful-wizard-of-oz.txt +1 -1
- data/test/toto_test.rb +2 -2
- data/toto.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/lib/toto.rb
CHANGED
@@ -121,8 +121,10 @@ module Toto
|
|
121
121
|
include Template
|
122
122
|
|
123
123
|
def initialize ctx = {}, config = {}
|
124
|
-
@config = config
|
125
|
-
ctx.each
|
124
|
+
@config, @ctx = config, ctx
|
125
|
+
ctx.each do |k, v|
|
126
|
+
meta_def(k) { ctx.instance_of?(Hash) ? v : ctx.send(k) }
|
127
|
+
end
|
126
128
|
end
|
127
129
|
|
128
130
|
def title
|
@@ -182,7 +184,6 @@ module Toto
|
|
182
184
|
super
|
183
185
|
end
|
184
186
|
|
185
|
-
|
186
187
|
def slug
|
187
188
|
self[:slug] ||
|
188
189
|
self[:title].downcase.gsub(/&/, 'and').gsub(/\s+/, '-').gsub(/[^a-z0-9-]/, '')
|
data/test/toto_test.rb
CHANGED
@@ -5,7 +5,7 @@ AUTHOR = "toto"
|
|
5
5
|
|
6
6
|
context Toto do
|
7
7
|
setup do
|
8
|
-
@config = Toto::Config.new(:author => AUTHOR, :url => URL)
|
8
|
+
@config = Toto::Config.new(:markdown => true, :author => AUTHOR, :url => URL)
|
9
9
|
@toto = Rack::MockRequest.new(Toto::Server.new(@config))
|
10
10
|
Toto::Paths[:articles] = "test/articles"
|
11
11
|
Toto::Paths[:pages] = "test/templates"
|
@@ -33,7 +33,7 @@ context Toto do
|
|
33
33
|
setup { @toto.get("/1900/05/17/the-wonderful-wizard-of-oz") }
|
34
34
|
asserts("returns a 200") { topic.status }.equals 200
|
35
35
|
asserts("content type is set properly") { topic.content_type }.equals "text/html"
|
36
|
-
should("contain the article") { topic.body }.includes_html("p" =>
|
36
|
+
should("contain the article") { topic.body }.includes_html("p" => /<em>Once upon a time<\/em>/)
|
37
37
|
end
|
38
38
|
|
39
39
|
context "GET to the archive" do
|
data/toto.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{toto}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["cloudhead"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-17}
|
13
13
|
s.description = %q{the tiniest blog-engine in Oz.}
|
14
14
|
s.email = %q{self@cloudhead.net}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cloudhead
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-17 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|