simplevoc-open 1.8.0
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/.document +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +26 -0
- data/LICENSE.txt +202 -0
- data/README.md +152 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/config.yml.sample +4 -0
- data/lib/simplevoc-open.rb +16 -0
- data/lib/simplevoc/open/base.rb +68 -0
- data/lib/simplevoc/open/client.rb +225 -0
- data/lib/simplevoc/open/configuration.rb +24 -0
- data/lib/simplevoc/open/exceptions.rb +40 -0
- data/lib/simplevoc/open/hash.rb +68 -0
- data/simplevoc-open.gemspec +88 -0
- data/test/config.yml +5 -0
- data/test/helper.rb +18 -0
- data/test/test_client.rb +240 -0
- data/test/test_hash.rb +37 -0
- data/test/test_non_strict_client.rb +102 -0
- data/test/test_simplevoc.rb +54 -0
- metadata +216 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'helper'
|
2
|
+
require "ftools"
|
3
|
+
|
4
|
+
class TestSimplevoc < Test::Unit::TestCase
|
5
|
+
should "initialize configuration" do
|
6
|
+
client = Simplevoc::Open::Client.new('protocol' => 'http', 'host' => 'localhost', 'port' => '12345',
|
7
|
+
'log_level' => Logger::DEBUG, 'strict_mode' => true)
|
8
|
+
assert_not_nil client
|
9
|
+
assert_not_nil client.configuration
|
10
|
+
assert_not_nil client.configuration.options
|
11
|
+
assert_not_nil client.logger
|
12
|
+
|
13
|
+
assert_equal client.configuration.options['protocol'], 'http'
|
14
|
+
assert_equal client.configuration.options['host'], 'localhost'
|
15
|
+
assert_equal client.configuration.options['port'], '12345'
|
16
|
+
assert_equal client.configuration.options['log_level'], Logger::DEBUG
|
17
|
+
assert client.configuration.options['strict_mode']
|
18
|
+
end
|
19
|
+
|
20
|
+
should "return correct server base url based on configuration" do
|
21
|
+
client = Simplevoc::Open::Client.new('host' => 'localhost', 'port' => '12345')
|
22
|
+
assert_equal client.send(:base_url), 'http://localhost:12345'
|
23
|
+
|
24
|
+
client2 = Simplevoc::Open::Client.new('protocol' => 'https', 'host' => 'localhost', 'port' => '8080')
|
25
|
+
assert_equal client2.send(:base_url), 'https://localhost:8080'
|
26
|
+
end
|
27
|
+
|
28
|
+
should 'initialize configuration from yml file from current directory' do
|
29
|
+
client = Simplevoc::Open::Client.new
|
30
|
+
assert_equal client.configuration.options['protocol'], 'http'
|
31
|
+
assert_equal client.configuration.options['host'], 'localhost'
|
32
|
+
assert_equal client.configuration.options['port'], '12345'
|
33
|
+
assert client.configuration.options['strict_mode']
|
34
|
+
end
|
35
|
+
|
36
|
+
should "read configuration" do
|
37
|
+
assert_not_nil (client = Simplevoc::Open::Client.new)
|
38
|
+
File.copy('test/config.yml', './config.yml')
|
39
|
+
client.send(:read_configuration)
|
40
|
+
assert_not_nil client.configuration
|
41
|
+
File.delete('./config.yml')
|
42
|
+
end
|
43
|
+
|
44
|
+
should "set the strict mode" do
|
45
|
+
client = Simplevoc::Open::Client.new('host' => 'localhost', 'port' => '12345', 'strict_mode' => true)
|
46
|
+
assert client.send(:use_strict_mode?)
|
47
|
+
client = Simplevoc::Open::Client.new('host' => 'localhost', 'port' => '12345', 'strict_mode' => false)
|
48
|
+
assert !client.send(:use_strict_mode?)
|
49
|
+
end
|
50
|
+
|
51
|
+
should 'return client version' do
|
52
|
+
assert_equal Simplevoc::Open::Client::VERSION, '1.8.0'
|
53
|
+
end
|
54
|
+
end
|
metadata
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simplevoc-open
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 55
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 8
|
9
|
+
- 0
|
10
|
+
version: 1.8.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- triAGENS GmbH
|
14
|
+
- Oliver Kiessler
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2011-03-08 00:00:00 +01:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
|
+
name: httparty
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 11
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 7
|
33
|
+
- 4
|
34
|
+
version: 0.7.4
|
35
|
+
prerelease: false
|
36
|
+
type: :runtime
|
37
|
+
requirement: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: json
|
40
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 11
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 4
|
49
|
+
- 6
|
50
|
+
version: 1.4.6
|
51
|
+
prerelease: false
|
52
|
+
type: :runtime
|
53
|
+
requirement: *id002
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: shoulda
|
56
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 3
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
version: "0"
|
65
|
+
prerelease: false
|
66
|
+
type: :development
|
67
|
+
requirement: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: bundler
|
70
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 23
|
76
|
+
segments:
|
77
|
+
- 1
|
78
|
+
- 0
|
79
|
+
- 0
|
80
|
+
version: 1.0.0
|
81
|
+
prerelease: false
|
82
|
+
type: :development
|
83
|
+
requirement: *id004
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: jeweler
|
86
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ~>
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 7
|
92
|
+
segments:
|
93
|
+
- 1
|
94
|
+
- 5
|
95
|
+
- 2
|
96
|
+
version: 1.5.2
|
97
|
+
prerelease: false
|
98
|
+
type: :development
|
99
|
+
requirement: *id005
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: rcov
|
102
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
hash: 3
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
version: "0"
|
111
|
+
prerelease: false
|
112
|
+
type: :development
|
113
|
+
requirement: *id006
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: httparty
|
116
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
hash: 11
|
122
|
+
segments:
|
123
|
+
- 0
|
124
|
+
- 7
|
125
|
+
- 4
|
126
|
+
version: 0.7.4
|
127
|
+
prerelease: false
|
128
|
+
type: :runtime
|
129
|
+
requirement: *id007
|
130
|
+
- !ruby/object:Gem::Dependency
|
131
|
+
name: json
|
132
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
hash: 11
|
138
|
+
segments:
|
139
|
+
- 1
|
140
|
+
- 4
|
141
|
+
- 6
|
142
|
+
version: 1.4.6
|
143
|
+
prerelease: false
|
144
|
+
type: :runtime
|
145
|
+
requirement: *id008
|
146
|
+
description: Easy installation, easy administration and simple to use is the focus of the SimpleVOC. It is a pure in-memory key/value store with a REST interface. Unlike other key/value stores the SimpleVOC provides a prefix search!
|
147
|
+
email: kiessler@inceedo.com
|
148
|
+
executables: []
|
149
|
+
|
150
|
+
extensions: []
|
151
|
+
|
152
|
+
extra_rdoc_files:
|
153
|
+
- LICENSE.txt
|
154
|
+
- README.md
|
155
|
+
files:
|
156
|
+
- .document
|
157
|
+
- Gemfile
|
158
|
+
- Gemfile.lock
|
159
|
+
- LICENSE.txt
|
160
|
+
- README.md
|
161
|
+
- Rakefile
|
162
|
+
- VERSION
|
163
|
+
- config.yml.sample
|
164
|
+
- lib/simplevoc-open.rb
|
165
|
+
- lib/simplevoc/open/base.rb
|
166
|
+
- lib/simplevoc/open/client.rb
|
167
|
+
- lib/simplevoc/open/configuration.rb
|
168
|
+
- lib/simplevoc/open/exceptions.rb
|
169
|
+
- lib/simplevoc/open/hash.rb
|
170
|
+
- simplevoc-open.gemspec
|
171
|
+
- test/config.yml
|
172
|
+
- test/helper.rb
|
173
|
+
- test/test_client.rb
|
174
|
+
- test/test_hash.rb
|
175
|
+
- test/test_non_strict_client.rb
|
176
|
+
- test/test_simplevoc.rb
|
177
|
+
has_rdoc: true
|
178
|
+
homepage: http://www.worldofvoc.com/products/simplevoc/summary/
|
179
|
+
licenses:
|
180
|
+
- Apache License Version 2.0, January 2004
|
181
|
+
post_install_message:
|
182
|
+
rdoc_options: []
|
183
|
+
|
184
|
+
require_paths:
|
185
|
+
- lib
|
186
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
187
|
+
none: false
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
hash: 3
|
192
|
+
segments:
|
193
|
+
- 0
|
194
|
+
version: "0"
|
195
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
|
+
none: false
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
hash: 3
|
201
|
+
segments:
|
202
|
+
- 0
|
203
|
+
version: "0"
|
204
|
+
requirements: []
|
205
|
+
|
206
|
+
rubyforge_project:
|
207
|
+
rubygems_version: 1.5.2
|
208
|
+
signing_key:
|
209
|
+
specification_version: 3
|
210
|
+
summary: A pure in-memory key/value store with a REST interface
|
211
|
+
test_files:
|
212
|
+
- test/helper.rb
|
213
|
+
- test/test_client.rb
|
214
|
+
- test/test_hash.rb
|
215
|
+
- test/test_non_strict_client.rb
|
216
|
+
- test/test_simplevoc.rb
|