rufus-jig 0.1.18 → 0.1.19

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/CHANGELOG.txt CHANGED
@@ -2,7 +2,17 @@
2
2
  = rufus-jig CHANGELOG.txt
3
3
 
4
4
 
5
- == rufus-jig - 0.1.17 not yet released
5
+ == rufus-jig - 0.1.19 released 2010/05/14
6
+
7
+ - couch #nuke_design_documents to clean out [old/all] views
8
+
9
+
10
+ == rufus-jig - 0.1.18 released 2010/05/10
11
+
12
+ - couch #on_change to track continuous changes in a CouchDB databases
13
+
14
+
15
+ == rufus-jig - 0.1.17 released 2010/03/21
6
16
 
7
17
  - using a new Patron::Session for each request (yes, they seem GC friendly)
8
18
  - Rufus::Jig::Couch #path and #name methods
@@ -97,7 +97,7 @@ module Rufus::Jig
97
97
 
98
98
  def delete (doc_or_path, rev=nil)
99
99
 
100
- doc, path, rev = if rev
100
+ doc, path = if rev
101
101
  [ { '_id' => doc_or_path, '_rev' => rev }, doc_or_path ]
102
102
  elsif doc_or_path.is_a?(String)
103
103
  [ nil, doc_or_path ]
@@ -270,6 +270,21 @@ module Rufus::Jig
270
270
  on_change(opts, &block) if opts[:reconnect]
271
271
  end
272
272
 
273
+ # A development method. Removes all the design documents in this couch
274
+ # database.
275
+ #
276
+ # Used in tests setup or teardown, when views are subject to frequent
277
+ # changes (rufus-doric and co).
278
+ #
279
+ def nuke_design_documents
280
+
281
+ docs = get('_all_docs')['rows']
282
+
283
+ views = docs.select { |d| d['id'] && d['id'].match(/^\_design\//) }
284
+
285
+ views.each { |v| delete(v['id'], v['value']['rev']) }
286
+ end
287
+
273
288
  protected
274
289
 
275
290
  def adjust (path)
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Rufus
3
3
  module Jig
4
- VERSION = '0.1.18'
4
+ VERSION = '0.1.19'
5
5
  end
6
6
  end
7
7
 
data/rufus-jig.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rufus-jig}
8
- s.version = "0.1.18"
8
+ s.version = "0.1.19"
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", "Kenneth Kalmer"]
12
- s.date = %q{2010-05-11}
12
+ s.date = %q{2010-05-14}
13
13
  s.description = %q{
14
14
  Json Interwebs Get.
15
15
 
@@ -93,5 +93,14 @@ class CtCouchDbViewsTest < Test::Unit::TestCase
93
93
  # p @c.get('_design/my_test_2/_view/my_view?key=%22macchiato%22')
94
94
  # p @c.http.cache.keys
95
95
  #end
96
+
97
+ def test_nuke_design_documents
98
+
99
+ assert_not_nil @c.get('_design/my_test')
100
+
101
+ @c.nuke_design_documents
102
+
103
+ assert_nil @c.get('_design/my_test')
104
+ end
96
105
  end
97
106
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 18
9
- version: 0.1.18
8
+ - 19
9
+ version: 0.1.19
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Mettraux
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-11 00:00:00 +09:00
18
+ date: 2010-05-14 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency