rufus-cloche 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -2,6 +2,16 @@
2
2
  = rufus-cloche CHANGELOG.txt
3
3
 
4
4
 
5
+ == rufus-cloche - 0.1.12 released 2010/01/06
6
+
7
+ - implemented Cloche#purge_type!(t)
8
+
9
+
10
+ == rufus-cloche - 0.1.11 released 2010/01/06
11
+
12
+ - test/con to test/conc, thanks gauched
13
+
14
+
5
15
  == rufus-cloche - 0.1.10 released 2010/01/03
6
16
 
7
17
  - increased mutex coverage (though flock matters more)
data/lib/rufus/cloche.rb CHANGED
@@ -43,7 +43,7 @@ module Rufus
43
43
  #
44
44
  class Cloche
45
45
 
46
- VERSION = '0.1.11'
46
+ VERSION = '0.1.12'
47
47
 
48
48
  attr_reader :dir
49
49
 
@@ -192,6 +192,13 @@ module Rufus
192
192
  docs
193
193
  end
194
194
 
195
+ # Removes entirely documents of a given type.
196
+ #
197
+ def purge_type! (type)
198
+
199
+ FileUtils.rm_rf(dir_for(type))
200
+ end
201
+
195
202
  protected
196
203
 
197
204
  def self.neutralize (s)
data/rufus-cloche.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rufus-cloche}
8
- s.version = "0.1.11"
8
+ s.version = "0.1.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John Mettraux"]
data/test/test.rb CHANGED
@@ -186,6 +186,19 @@ class ClocheTest < Test::Unit::TestCase
186
186
  assert_equal 1, @c.get_many('nothing').size
187
187
  end
188
188
 
189
+ def test_purge_type
190
+
191
+ @c.put({ '_id' => 'thing.0', 'type' => 'unthing', 'color' => 'blue' })
192
+ @c.put({ '_id' => 'thing.1', 'type' => 'unthing', 'color' => 'blue' })
193
+ @c.put({ '_id' => 'thing.2', 'type' => 'unthing', 'color' => 'blue' })
194
+
195
+ assert_equal 3, @c.get_many('unthing').size
196
+
197
+ @c.purge_type!('unthing')
198
+
199
+ assert_equal 0, @c.get_many('unthing').size
200
+ end
201
+
189
202
  protected
190
203
 
191
204
  def load_people
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-cloche
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux