toto 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -19,6 +19,7 @@ how it works
19
19
 
20
20
  - content is entirely managed trough **git**; you get full fledged version control for free.
21
21
  - articles are stored as _.txt_ files, with embeded metadata (in yaml format).
22
+ - articles are processed through a markdown converter (rdiscount) by default.
22
23
  - templating is done through **ERB**.
23
24
  - toto is built right on top of **Rack**.
24
25
  - comments are handled by disqus:(http://disqus.com)
@@ -70,13 +71,14 @@ Once he finishes writing his beautiful tale, one can push to the git repo, as us
70
71
 
71
72
  Where `remote` is the name of your remote git repository. The article is now published.
72
73
 
73
- ### server
74
+ ### deployment
74
75
 
75
76
  Toto is built on top of **Rack**, and hence has a **rackup** file: _config.ru_.
76
77
 
77
- #### on your own
78
+ #### on your own server
78
79
 
79
- You can run toto with any Rack compliant web server, such as **thin**, **mongrel** or **unicorn**.
80
+ Once you have created the remote git repo, and pushed your changes to it, you can run toto with any Rack compliant web server,
81
+ such as **thin**, **mongrel** or **unicorn**.
80
82
 
81
83
  With thin, you would do something like:
82
84
 
@@ -89,7 +91,8 @@ With unicorn, you can just do:
89
91
  #### on heroku
90
92
 
91
93
  Toto was designed to work well with heroku:(http://heroku.com), it makes the most out of it's state-of-the-art caching,
92
- by setting the _Cache-Control_ and _Etag_ HTTP headers.
94
+ by setting the _Cache-Control_ and _Etag_ HTTP headers. Deploying on Heroku is really easy, just get the heroku gem,
95
+ create a heroku app with `heroku create`, and push with `git push heroku master`.
93
96
 
94
97
  ### configuration
95
98
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -10,23 +10,29 @@ require 'toto'
10
10
  module Riot
11
11
  class Assertion
12
12
  assertion(:includes) do |actual, expected|
13
- actual.include?(expected) || fail("expected #{actual} to include #{expected}")
13
+ actual.include?(expected) ? pass : fail("expected #{actual} to include #{expected}")
14
14
  end
15
15
 
16
16
  assertion(:includes_html) do |actual, expected|
17
17
  doc = Hpricot.parse(actual)
18
18
  expected = expected.to_a.flatten
19
- !(doc/expected.first).empty? || fail("expected #{actual} to contain a <#{expected.first}>")
20
- (doc/expected.first).inner_html.match(expected.last) || fail("expected <#{expected.first}> to contain #{expected.last}")
19
+
20
+ if (doc/expected.first).empty?
21
+ fail("expected #{actual} to contain a <#{expected.first}>")
22
+ elsif !(doc/expected.first).inner_html.match(expected.last)
23
+ fail("expected <#{expected.first}> to contain #{expected.last}")
24
+ else
25
+ pass
26
+ end
21
27
  end
22
28
 
23
29
  assertion(:includes_elements) do |actual, selector, count|
24
30
  doc = Hpricot.parse(actual)
25
- (doc/selector).size == count || fail("expected #{actual} to contain #{count} #{selector}(s)")
31
+ (doc/selector).size == count ? pass : fail("expected #{actual} to contain #{count} #{selector}(s)")
26
32
  end
27
33
 
28
34
  assertion(:within) do |actual, expected|
29
- expected.include?(actual) || fail("expected #{actual} to be within #{expected}")
35
+ expected.include?(actual) ? pass : fail("expected #{actual} to be within #{expected}")
30
36
  end
31
37
  end
32
38
  end
@@ -74,7 +74,7 @@ context Toto do
74
74
  context "creating an article" do
75
75
  setup do
76
76
  @config[:markdown] = true
77
- @config[:date] = lambda {|t| "the time is #{t}" }
77
+ @config[:date] = lambda {|t| "the time is #{t.strftime("%Y/%m/%d %H:%M")}" }
78
78
  @config[:summary] = 50
79
79
  end
80
80
 
@@ -89,7 +89,7 @@ context Toto do
89
89
  should("have a title") { topic.title }.equals "Toto & The Wizard of Oz."
90
90
  should("parse the body as markdown") { topic.body }.equals "<h1>Chapter I</h1>\n\n<p>hello, <em>stranger</em>.</p>\n"
91
91
  should("create an appropriate slug") { topic.slug }.equals "toto-and-the-wizard-of-oz"
92
- should("set the date") { topic.date }.equals "the time is #{Time.now}"
92
+ should("set the date") { topic.date }.equals "the time is #{Time.now.strftime("%Y/%m/%d %H:%M")}"
93
93
  should("create a summary") { topic.summary == topic.body }
94
94
  should("have an author") { topic.author }.equals AUTHOR
95
95
  should("have a path") { topic.path }.equals Time.now.strftime("/%Y/%m/%d/toto-and-the-wizard-of-oz/")
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{toto}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
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{2009-11-24}
12
+ s.date = %q{2009-12-16}
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.2
4
+ version: 0.1.3
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: 2009-11-24 00:00:00 -05:00
12
+ date: 2009-12-16 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency