toto 0.3.2 → 0.3.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 +1 -1
- data/VERSION +1 -1
- data/lib/toto.rb +7 -8
- data/toto.gemspec +2 -2
- metadata +2 -2
data/README.md
CHANGED
|
@@ -6,7 +6,7 @@ the tiniest blogging engine in Oz!
|
|
|
6
6
|
introduction
|
|
7
7
|
------------
|
|
8
8
|
|
|
9
|
-
toto is a git-powered, minimalist blog engine for the hackers of Oz. The engine
|
|
9
|
+
toto is a git-powered, minimalist blog engine for the hackers of Oz. The engine weighs around ~300 sloc at its worse.
|
|
10
10
|
There is no toto client, at least for now; everything goes through git.
|
|
11
11
|
|
|
12
12
|
blog in 10 seconds
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.3
|
data/lib/toto.rb
CHANGED
|
@@ -69,11 +69,11 @@ module Toto
|
|
|
69
69
|
case type
|
|
70
70
|
when :html
|
|
71
71
|
{:articles => self.articles.reverse.map do |article|
|
|
72
|
-
Article.new
|
|
72
|
+
Article.new article, @config
|
|
73
73
|
end }.merge archives
|
|
74
74
|
when :xml, :json
|
|
75
75
|
return :articles => self.articles.map do |article|
|
|
76
|
-
Article.new
|
|
76
|
+
Article.new article, @config
|
|
77
77
|
end
|
|
78
78
|
else return {}
|
|
79
79
|
end
|
|
@@ -84,14 +84,14 @@ module Toto
|
|
|
84
84
|
self.articles.select do |a|
|
|
85
85
|
filter !~ /^\d{4}/ || File.basename(a) =~ /^#{filter}/
|
|
86
86
|
end.reverse.map do |article|
|
|
87
|
-
Article.new
|
|
87
|
+
Article.new article, @config
|
|
88
88
|
end : []
|
|
89
89
|
|
|
90
90
|
return :archives => Archives.new(entries)
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
def article route
|
|
94
|
-
Article.new(
|
|
94
|
+
Article.new("#{Paths[:articles]}/#{route.join('-')}.#{self[:ext]}", @config).load
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
def /
|
|
@@ -152,7 +152,7 @@ module Toto
|
|
|
152
152
|
def initialize ctx = {}, config = {}, path = "/"
|
|
153
153
|
@config, @context, @path = config, ctx, path
|
|
154
154
|
@articles = Site.articles(@config[:ext]).reverse.map do |a|
|
|
155
|
-
Article.new(
|
|
155
|
+
Article.new(a, @config)
|
|
156
156
|
end
|
|
157
157
|
|
|
158
158
|
ctx.each do |k, v|
|
|
@@ -221,9 +221,8 @@ module Toto
|
|
|
221
221
|
end
|
|
222
222
|
|
|
223
223
|
def load
|
|
224
|
-
data = if @obj.is_a?
|
|
225
|
-
meta, self[:body] = @obj.
|
|
226
|
-
@obj.close
|
|
224
|
+
data = if @obj.is_a? String
|
|
225
|
+
meta, self[:body] = File.read(@obj).split(/\n\n/, 2)
|
|
227
226
|
YAML.load(meta)
|
|
228
227
|
elsif @obj.is_a? Hash
|
|
229
228
|
@obj
|
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.3.
|
|
8
|
+
s.version = "0.3.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{2010-02-
|
|
12
|
+
s.date = %q{2010-02-12}
|
|
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.3.
|
|
4
|
+
version: 0.3.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: 2010-02-
|
|
12
|
+
date: 2010-02-12 00:00:00 -05:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|