couchrest 0.35 → 0.36

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.
@@ -20,10 +20,10 @@ class Article < CouchRest::ExtendedDocument
20
20
  return sum(values);
21
21
  }"
22
22
 
23
- property :date
23
+ property :date, :type => 'Date'
24
24
  property :slug, :read_only => true
25
25
  property :title
26
- property :tags
26
+ property :tags, :type => ['String']
27
27
 
28
28
  timestamps!
29
29
 
@@ -4,11 +4,19 @@ require File.join(FIXTURE_PATH, 'more', 'person')
4
4
  class Course < CouchRest::ExtendedDocument
5
5
  use_database TEST_SERVER.default_database
6
6
 
7
- property :title
8
- property :questions, :cast_as => ['Question']
9
- property :professor, :cast_as => 'Person'
10
- property :final_test_at, :cast_as => 'Time'
7
+ property :title, :cast_as => 'String'
8
+ property :questions, :cast_as => ['Question']
9
+ property :professor, :cast_as => 'Person'
10
+ property :participants, :type => ['Object']
11
+ property :ends_at, :type => 'Time'
12
+ property :estimate, :type => 'Float'
13
+ property :hours, :type => 'Integer'
14
+ property :profit, :type => 'BigDecimal'
15
+ property :started_on, :type => 'Date'
16
+ property :updated_at, :type => 'DateTime'
17
+ property :active, :type => 'Boolean'
18
+ property :klass, :type => 'Class'
11
19
 
12
20
  view_by :title
13
21
  view_by :dept, :ducktype => true
14
- end
22
+ end
@@ -5,5 +5,4 @@ class Event < CouchRest::ExtendedDocument
5
5
  property :occurs_at, :cast_as => 'Time', :init_method => 'parse'
6
6
  property :end_date, :cast_as => 'Date', :init_method => 'parse'
7
7
 
8
-
9
- end
8
+ end
@@ -1,7 +1,7 @@
1
1
  class Person < Hash
2
2
  include ::CouchRest::CastedModel
3
- property :name
4
3
  property :pet, :cast_as => 'Cat'
4
+ property :name, :type => ['String']
5
5
 
6
6
  def last_name
7
7
  name.last
@@ -2,5 +2,5 @@ class Question < Hash
2
2
  include ::CouchRest::CastedModel
3
3
 
4
4
  property :q
5
- property :a
5
+ property :a, :type => 'Object'
6
6
  end
@@ -7,6 +7,6 @@ class Service < CouchRest::ExtendedDocument
7
7
 
8
8
  # Official Schema
9
9
  property :name, :length => 4...20
10
- property :price, :type => Integer
10
+ property :price, :type => 'Integer'
11
11
 
12
12
  end
@@ -10,6 +10,7 @@ unless defined?(FIXTURE_PATH)
10
10
 
11
11
  COUCHHOST = "http://127.0.0.1:5984"
12
12
  TESTDB = 'couchrest-test'
13
+ REPLICATIONDB = 'couchrest-test-replication'
13
14
  TEST_SERVER = CouchRest.new
14
15
  TEST_SERVER.default_database = TESTDB
15
16
  DB = TEST_SERVER.database(TESTDB)
@@ -34,4 +35,15 @@ Spec::Runner.configure do |config|
34
35
  cr.database(db).delete! rescue nil
35
36
  end
36
37
  end
37
- end
38
+ end
39
+
40
+ def couchdb_lucene_available?
41
+ lucene_path = "http://localhost:5985/"
42
+ url = URI.parse(lucene_path)
43
+ req = Net::HTTP::Get.new(url.path)
44
+ res = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }
45
+ true
46
+ rescue Exception => e
47
+ false
48
+ end
49
+
metadata CHANGED
@@ -1,39 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchrest
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.35"
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 36
8
+ version: "0.36"
5
9
  platform: ruby
6
10
  authors:
7
11
  - J. Chris Anderson
8
12
  - Matt Aimonetti
9
13
  - Marcos Tapajos
14
+ - Will Leinweber
10
15
  autorequire:
11
16
  bindir: bin
12
17
  cert_chain: []
13
18
 
14
- date: 2010-02-27 00:00:00 -03:00
19
+ date: 2010-03-30 00:00:00 -03:00
15
20
  default_executable:
16
21
  dependencies:
17
22
  - !ruby/object:Gem::Dependency
18
23
  name: rest-client
19
- type: :runtime
20
- version_requirement:
21
- version_requirements: !ruby/object:Gem::Requirement
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
22
26
  requirements:
23
27
  - - ">="
24
28
  - !ruby/object:Gem::Version
29
+ segments:
30
+ - 0
31
+ - 5
25
32
  version: "0.5"
26
- version:
33
+ type: :runtime
34
+ version_requirements: *id001
27
35
  - !ruby/object:Gem::Dependency
28
36
  name: mime-types
29
- type: :runtime
30
- version_requirement:
31
- version_requirements: !ruby/object:Gem::Requirement
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
32
39
  requirements:
33
40
  - - ">="
34
41
  - !ruby/object:Gem::Version
42
+ segments:
43
+ - 1
44
+ - 15
35
45
  version: "1.15"
36
- version:
46
+ type: :runtime
47
+ version_requirements: *id002
37
48
  description: CouchRest provides a simple interface on top of CouchDB's RESTful HTTP API, as well as including some utility scripts for managing views and attachments.
38
49
  email: jchris@apache.org
39
50
  executables: []
@@ -94,6 +105,7 @@ files:
94
105
  - lib/couchrest/more/casted_model.rb
95
106
  - lib/couchrest/more/extended_document.rb
96
107
  - lib/couchrest/more/property.rb
108
+ - lib/couchrest/more/typecast.rb
97
109
  - lib/couchrest/support/blank.rb
98
110
  - lib/couchrest/support/class.rb
99
111
  - lib/couchrest/support/rails.rb
@@ -161,18 +173,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
173
  requirements:
162
174
  - - ">="
163
175
  - !ruby/object:Gem::Version
176
+ segments:
177
+ - 0
164
178
  version: "0"
165
- version:
166
179
  required_rubygems_version: !ruby/object:Gem::Requirement
167
180
  requirements:
168
181
  - - ">="
169
182
  - !ruby/object:Gem::Version
183
+ segments:
184
+ - 0
170
185
  version: "0"
171
- version:
172
186
  requirements: []
173
187
 
174
188
  rubyforge_project:
175
- rubygems_version: 1.3.5
189
+ rubygems_version: 1.3.6
176
190
  signing_key:
177
191
  specification_version: 3
178
192
  summary: Lean and RESTful interface to CouchDB.