rufus-doric 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -2,7 +2,14 @@
2
2
  = rufus-doric CHANGELOG.txt
3
3
 
4
4
 
5
- == rufus-doric - 0.1.10 not yet released
5
+ == rufus-doric - 0.1.11 released 2010/05/17
6
+
7
+ - model : issue with nil attachments, fixed
8
+ - model.db.nuke_design_documents available
9
+ - custom views x(key) and by_x(x) are both OK
10
+
11
+
12
+ == rufus-doric - 0.1.10 released 2010/05/14
6
13
 
7
14
  - model attachment :x for properties like attachments (#att and #att=(x))
8
15
  - model#read(attachment_name)
data/Rakefile CHANGED
@@ -36,7 +36,7 @@ something at the intersection of Rails3, CouchDB and rufus-jig
36
36
  gem.test_file = 'test/test.rb'
37
37
 
38
38
  gem.add_dependency 'activerecord', '~> 3.0.0.beta3'
39
- gem.add_dependency 'rufus-jig', '>= 0.1.18'
39
+ gem.add_dependency 'rufus-jig', '>= 0.1.19'
40
40
  gem.add_dependency 'mime-types', '>= 1.16'
41
41
  gem.add_development_dependency 'rake'
42
42
  gem.add_development_dependency 'yard'
@@ -167,6 +167,9 @@ module Doric
167
167
  k = { key => func }
168
168
 
169
169
  instance_eval %{
170
+ def by_#{key} (val, opts={})
171
+ by(#{k.inspect}, val, opts)
172
+ end
170
173
  def #{key} (val, opts={})
171
174
  by(#{k.inspect}, val, opts)
172
175
  end
@@ -312,6 +315,8 @@ module Doric
312
315
  extname = File.extname(attname)
313
316
  attname = attachments.find { |a| a.match(/^#{attname}/) } if extname == ''
314
317
 
318
+ return nil if attname == nil
319
+
315
320
  db.get("#{@h['_id']}/#{attname}")
316
321
  end
317
322
 
@@ -38,7 +38,6 @@ module Doric
38
38
 
39
39
  def self.escape (o)
40
40
 
41
- #"%22#{o}%22"
42
41
  CGI.escape(Rufus::Json.encode(o))
43
42
  end
44
43
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Rufus
3
3
  module Doric
4
- VERSION = '0.1.10'
4
+ VERSION = '0.1.11'
5
5
  end
6
6
  end
7
7
 
data/rufus-doric.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rufus-doric}
8
- s.version = "0.1.10"
8
+ s.version = "0.1.11"
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"]
12
- s.date = %q{2010-05-14}
12
+ s.date = %q{2010-05-17}
13
13
  s.description = %q{
14
14
  something at the intersection of Rails3, CouchDB and rufus-jig
15
15
  }
@@ -81,14 +81,14 @@ something at the intersection of Rails3, CouchDB and rufus-jig
81
81
 
82
82
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
83
83
  s.add_runtime_dependency(%q<activerecord>, ["~> 3.0.0.beta3"])
84
- s.add_runtime_dependency(%q<rufus-jig>, [">= 0.1.18"])
84
+ s.add_runtime_dependency(%q<rufus-jig>, [">= 0.1.19"])
85
85
  s.add_runtime_dependency(%q<mime-types>, [">= 1.16"])
86
86
  s.add_development_dependency(%q<rake>, [">= 0"])
87
87
  s.add_development_dependency(%q<yard>, [">= 0"])
88
88
  s.add_development_dependency(%q<jeweler>, [">= 0"])
89
89
  else
90
90
  s.add_dependency(%q<activerecord>, ["~> 3.0.0.beta3"])
91
- s.add_dependency(%q<rufus-jig>, [">= 0.1.18"])
91
+ s.add_dependency(%q<rufus-jig>, [">= 0.1.19"])
92
92
  s.add_dependency(%q<mime-types>, [">= 1.16"])
93
93
  s.add_dependency(%q<rake>, [">= 0"])
94
94
  s.add_dependency(%q<yard>, [">= 0"])
@@ -96,7 +96,7 @@ something at the intersection of Rails3, CouchDB and rufus-jig
96
96
  end
97
97
  else
98
98
  s.add_dependency(%q<activerecord>, ["~> 3.0.0.beta3"])
99
- s.add_dependency(%q<rufus-jig>, [">= 0.1.18"])
99
+ s.add_dependency(%q<rufus-jig>, [">= 0.1.19"])
100
100
  s.add_dependency(%q<mime-types>, [">= 1.16"])
101
101
  s.add_dependency(%q<rake>, [">= 0"])
102
102
  s.add_dependency(%q<yard>, [">= 0"])
@@ -70,6 +70,8 @@ class UtModelCustomViewTest < Test::Unit::TestCase
70
70
  assert_equal 1, Team.tysec('rifle__b').size
71
71
 
72
72
  assert_equal 2, Team.tysec2(%w[ rifle a ]).size
73
+
74
+ assert_equal 1, Team.by_tysec('rifle__b').size
73
75
  end
74
76
  end
75
77
 
@@ -182,6 +182,16 @@ class UtModelAndAttachmentsTest < Test::Unit::TestCase
182
182
  assert_equal [ 'icon.txt' ], f.attachments
183
183
  end
184
184
 
185
+ def test_missing_attachment
186
+
187
+ f = Folder.new('name' => 'spring')
188
+ f.save!
189
+
190
+ f = Folder.find('spring')
191
+
192
+ assert_nil f.icon
193
+ end
194
+
185
195
  protected
186
196
 
187
197
  def path_to (local_item)
@@ -73,5 +73,16 @@ class UtModelViewTest < Test::Unit::TestCase
73
73
  Nada::Thing.by_colour('blue').size
74
74
  end
75
75
  end
76
+
77
+ def test_nuke_design_documents
78
+
79
+ assert_nil Nada::Thing.db.get('_design/doric_nada__thing')
80
+
81
+ assert_equal [], Nada::Thing.by_colour('blue')
82
+
83
+ Nada::Thing.db.nuke_design_documents
84
+
85
+ assert_nil Nada::Thing.db.get('_design/doric_nada__thing')
86
+ end
76
87
  end
77
88
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 10
9
- version: 0.1.10
8
+ - 11
9
+ version: 0.1.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Mettraux
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-14 00:00:00 +09:00
17
+ date: 2010-05-17 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -42,8 +42,8 @@ dependencies:
42
42
  segments:
43
43
  - 0
44
44
  - 1
45
- - 18
46
- version: 0.1.18
45
+ - 19
46
+ version: 0.1.19
47
47
  type: :runtime
48
48
  version_requirements: *id002
49
49
  - !ruby/object:Gem::Dependency