solr_mapper 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +202 -0
- data/Manifest +21 -0
- data/README.rdoc +95 -0
- data/Rakefile +27 -0
- data/lib/solr_mapper.rb +27 -0
- data/lib/solr_mapper/calculations.rb +26 -0
- data/lib/solr_mapper/locators.rb +25 -0
- data/lib/solr_mapper/relations.rb +175 -0
- data/lib/solr_mapper/solr_document.rb +225 -0
- data/solr_mapper.gemspec +42 -0
- data/spec/base.rb +45 -0
- data/spec/calculations_spec.rb +49 -0
- data/spec/locators_spec.rb +40 -0
- data/spec/misc_spec.rb +34 -0
- data/spec/paginated_spec.rb +100 -0
- data/spec/query_spec.rb +87 -0
- data/spec/relation_spec.rb +193 -0
- data/spec/solr/stuff/config/schema.xml +58 -0
- data/spec/solr/thing/config/schema.xml +64 -0
- data/spec/solr/widget/conf/schema.xml +58 -0
- data/spec/url_spec.rb +36 -0
- metadata +147 -0
data/spec/url_spec.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Copyright 2010 The Skunkworx.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require File.dirname(__FILE__) + '/base'
|
16
|
+
|
17
|
+
include SolrMapper
|
18
|
+
|
19
|
+
describe SolrDocument do
|
20
|
+
it "should build a url with only opts passed in" do
|
21
|
+
Thing.build_qs({:rows => 5, :q => '*'}).should == 'rows=5&q=*'
|
22
|
+
Thing.build_qs({:rows => 5, :start => 10, :q => '*'}).should == 'rows=5&start=10&q=*'
|
23
|
+
Thing.build_qs({:rows => 5, :start => 10, :sort => 'id desc', :q => '*'}).should == 'rows=5&start=10&sort=id desc&q=*'
|
24
|
+
Thing.build_qs({:start => 10, :sort => 'id desc', :q => '*'}).should == 'start=10&sort=id desc&q=*'
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should build a full url with the configured base, path and query string" do
|
28
|
+
Thing.build_url("select", {:rows => 5, :q => '*'}).should == "#{Thing.base_url}/select?rows=5&q=*"
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should build a url without a querystring" do
|
32
|
+
Thing.build_url("update").should == "#{Thing.base_url}/update"
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
metadata
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: solr_mapper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Chris Umbel
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-10-26 00:00:00 +00:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rest-client
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: uuid
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
type: :runtime
|
45
|
+
version_requirements: *id002
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: will_paginate
|
48
|
+
prerelease: false
|
49
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
version: "0"
|
57
|
+
type: :runtime
|
58
|
+
version_requirements: *id003
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: activesupport
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
70
|
+
type: :runtime
|
71
|
+
version_requirements: *id004
|
72
|
+
description: Object Document Mapper for the Apache Foundation's Solr search platform
|
73
|
+
email: chrisu@dvdempire.com
|
74
|
+
executables: []
|
75
|
+
|
76
|
+
extensions: []
|
77
|
+
|
78
|
+
extra_rdoc_files:
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.rdoc
|
81
|
+
- lib/solr_mapper.rb
|
82
|
+
- lib/solr_mapper/calculations.rb
|
83
|
+
- lib/solr_mapper/locators.rb
|
84
|
+
- lib/solr_mapper/relations.rb
|
85
|
+
- lib/solr_mapper/solr_document.rb
|
86
|
+
files:
|
87
|
+
- LICENSE.txt
|
88
|
+
- Manifest
|
89
|
+
- README.rdoc
|
90
|
+
- Rakefile
|
91
|
+
- lib/solr_mapper.rb
|
92
|
+
- lib/solr_mapper/calculations.rb
|
93
|
+
- lib/solr_mapper/locators.rb
|
94
|
+
- lib/solr_mapper/relations.rb
|
95
|
+
- lib/solr_mapper/solr_document.rb
|
96
|
+
- solr_mapper.gemspec
|
97
|
+
- spec/base.rb
|
98
|
+
- spec/calculations_spec.rb
|
99
|
+
- spec/locators_spec.rb
|
100
|
+
- spec/misc_spec.rb
|
101
|
+
- spec/paginated_spec.rb
|
102
|
+
- spec/query_spec.rb
|
103
|
+
- spec/relation_spec.rb
|
104
|
+
- spec/solr/stuff/config/schema.xml
|
105
|
+
- spec/solr/thing/config/schema.xml
|
106
|
+
- spec/solr/widget/conf/schema.xml
|
107
|
+
- spec/url_spec.rb
|
108
|
+
has_rdoc: true
|
109
|
+
homepage: http://github.com/skunkworx/solr_mapper
|
110
|
+
licenses: []
|
111
|
+
|
112
|
+
post_install_message:
|
113
|
+
rdoc_options:
|
114
|
+
- --line-numbers
|
115
|
+
- --inline-source
|
116
|
+
- --title
|
117
|
+
- Solr_mapper
|
118
|
+
- --main
|
119
|
+
- README.rdoc
|
120
|
+
require_paths:
|
121
|
+
- lib
|
122
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
segments:
|
136
|
+
- 1
|
137
|
+
- 2
|
138
|
+
version: "1.2"
|
139
|
+
requirements: []
|
140
|
+
|
141
|
+
rubyforge_project: solr_mapper
|
142
|
+
rubygems_version: 1.3.7
|
143
|
+
signing_key:
|
144
|
+
specification_version: 3
|
145
|
+
summary: Object Document Mapper for the Apache Foundation's Solr search platform
|
146
|
+
test_files: []
|
147
|
+
|