toto 0.4.0 → 0.4.1
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 +2 -2
- data/test/toto_test.rb +10 -0
- data/toto.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/toto.rb
CHANGED
@@ -299,11 +299,11 @@ module Toto
|
|
299
299
|
self.update obj
|
300
300
|
end
|
301
301
|
|
302
|
-
def set key, val
|
302
|
+
def set key, val = nil, &blk
|
303
303
|
if val.is_a? Hash
|
304
304
|
self[key].update val
|
305
305
|
else
|
306
|
-
self[key] = val
|
306
|
+
self[key] = block_given?? blk : val
|
307
307
|
end
|
308
308
|
end
|
309
309
|
end
|
data/test/toto_test.rb
CHANGED
@@ -195,6 +195,16 @@ context Toto do
|
|
195
195
|
should("set summary[:delim] to /%/") { topic[:summary][:delim].source }.equals "%"
|
196
196
|
should("leave the :max intact") { topic[:summary][:max] }.equals 150
|
197
197
|
end
|
198
|
+
|
199
|
+
context "using Config#set with a block" do
|
200
|
+
setup do
|
201
|
+
conf = Toto::Config.new({})
|
202
|
+
conf.set(:to_html) {|path, p, _| path + p }
|
203
|
+
conf
|
204
|
+
end
|
205
|
+
|
206
|
+
should("set the value to a proc") { topic[:to_html] }.respond_to :call
|
207
|
+
end
|
198
208
|
end
|
199
209
|
|
200
210
|
|
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.4.
|
8
|
+
s.version = "0.4.1"
|
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-18}
|
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.4.
|
4
|
+
version: 0.4.1
|
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-18 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|