Skip to content

Commit

Permalink
implemented Storage#purge_type!(t)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Jan 6, 2010
1 parent dbd6c3c commit 3ea5c5a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -3,6 +3,7 @@

== ruote - 2.1.4 not yet released

- implemented Storage#purge_type!(t)
- Engine#add_service now returning just bound service


Expand Down
2 changes: 1 addition & 1 deletion TODO.txt
Expand Up @@ -169,6 +169,7 @@
[o] add_branches : pass message to concurrent_iterator like a command expression
[o] clean up persists present in #apply
[o] maybe cancel should have a safely / redo_reply thing
[o] implement Storage#clear!(type)

[ ] exp : exp (restricted form of eval ?)
[ ] exp : case (is it necessary ?)
Expand Down Expand Up @@ -286,5 +287,4 @@

[ ] shell ? irb ? Shell.new(storage)
[ ] focus on fulldup or json.dup (via fulldup ?)
[ ] implement Storage#clear!(type)

5 changes: 5 additions & 0 deletions lib/ruote/storage/fs_storage.rb
Expand Up @@ -82,6 +82,11 @@ def purge!
def add_type (type)
end

def purge_type! (type)

@cloche.purge_type!(type)
end

def dump (type)

s = "=== #{type} ===\n"
Expand Down
5 changes: 5 additions & 0 deletions lib/ruote/storage/hash_storage.rb
Expand Up @@ -154,6 +154,11 @@ def add_type (type)
@h[type] = {}
end

def purge_type! (type)

@h[type] = {}
end

def dump (type)

s = "=== #{type} ===\n"
Expand Down
7 changes: 7 additions & 0 deletions test/unit/ut_17_storage.rb
Expand Up @@ -134,5 +134,12 @@ def test_put_gone

assert_equal true, @s.put(h)
end

def test_purge_type

@s.purge_type!('dogfood')

assert_equal 0, @s.get_many('dogfood').size
end
end

0 comments on commit 3ea5c5a

Please sign in to comment.