relaxo-query-server 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -3
- data/lib/relaxo/query_server/library.rb +7 -5
- data/lib/relaxo/query_server/version.rb +1 -1
- data/rakefile.rb +9 -0
- data/test/{context_test.rb → helper.rb} +5 -1
- data/test/test_filters.rb +2 -2
- data/test/test_libraries.rb +7 -4
- data/test/test_lists.rb +2 -2
- data/test/test_map.rb +2 -2
- data/test/test_reduce.rb +2 -2
- data/test/test_shows.rb +2 -2
- data/test/test_updates.rb +2 -2
- data/test/test_validations.rb +2 -2
- data/test/test_views.rb +2 -2
- metadata +62 -52
data/README.md
CHANGED
@@ -7,8 +7,6 @@ Relaxo Query Server
|
|
7
7
|
|
8
8
|
The Relaxo Query Server implements the CouchDB Query Server protocol for CouchDB 1.1.0+. It provides a comprehensive Ruby-style view server along with full support for Design Document based processing.
|
9
9
|
|
10
|
-
*This software is currently under development and not ready for stable production usage.*
|
11
|
-
|
12
10
|
Installation
|
13
11
|
------------
|
14
12
|
|
@@ -118,7 +116,7 @@ To Do
|
|
118
116
|
License
|
119
117
|
-------
|
120
118
|
|
121
|
-
Copyright (c) 2010,
|
119
|
+
Copyright (c) 2010, 2012 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
|
122
120
|
|
123
121
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
124
122
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -55,14 +55,16 @@ module Relaxo
|
|
55
55
|
def instance
|
56
56
|
unless @klass
|
57
57
|
@klass = Class.new
|
58
|
+
@klass.const_set(:ROOT, @root)
|
58
59
|
|
59
60
|
# Not sure if this is the best way to implement the `load` function
|
60
|
-
@klass.
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
@klass.class_eval do
|
62
|
+
def self.root
|
63
|
+
self.const_get(:ROOT)
|
64
|
+
end
|
65
|
+
|
64
66
|
def self.load(path)
|
65
|
-
Library.for(
|
67
|
+
Library.for(root, path)
|
66
68
|
end
|
67
69
|
|
68
70
|
def load(path)
|
data/rakefile.rb
ADDED
@@ -1,12 +1,16 @@
|
|
1
1
|
|
2
2
|
$LOAD_PATH.unshift File.expand_path("../../lib/", __FILE__)
|
3
3
|
|
4
|
+
require 'rubygems'
|
4
5
|
require 'test/unit'
|
5
6
|
require 'stringio'
|
6
7
|
|
8
|
+
require "relaxo/json"
|
7
9
|
require "relaxo/query_server"
|
8
10
|
|
9
|
-
class
|
11
|
+
class ContextualTestCase < Test::Unit::TestCase
|
12
|
+
undef_method :default_test
|
13
|
+
|
10
14
|
def setup_context(options)
|
11
15
|
@shell = Relaxo::QueryServer::MockShell.new
|
12
16
|
@context = Relaxo::QueryServer::Context.new(@shell, options)
|
data/test/test_filters.rb
CHANGED
data/test/test_libraries.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
|
2
|
-
require '
|
2
|
+
require 'helper'
|
3
3
|
require 'relaxo/query_server/library'
|
4
4
|
|
5
|
-
|
5
|
+
require 'bigdecimal'
|
6
|
+
require 'bigdecimal/util'
|
7
|
+
|
8
|
+
class LibrariesTest < ContextualTestCase
|
6
9
|
def test_libraries
|
7
10
|
root = {
|
8
11
|
'lib' => {
|
@@ -14,7 +17,7 @@ class LibrariesTest < ContextTest
|
|
14
17
|
load('lib/all')
|
15
18
|
|
16
19
|
def bar
|
17
|
-
10.to_d
|
20
|
+
"10".to_d
|
18
21
|
end
|
19
22
|
}
|
20
23
|
}
|
@@ -25,7 +28,7 @@ class LibrariesTest < ContextTest
|
|
25
28
|
assert_not_nil object
|
26
29
|
assert object.respond_to? :bar
|
27
30
|
|
28
|
-
assert_equal 10.to_d, object.bar
|
31
|
+
assert_equal "10".to_d, object.bar
|
29
32
|
|
30
33
|
# For efficiency, the same object is returned both times
|
31
34
|
same_object = Relaxo::QueryServer::Library.for(root, 'lib/bar')
|
data/test/test_lists.rb
CHANGED
data/test/test_map.rb
CHANGED
data/test/test_reduce.rb
CHANGED
data/test/test_shows.rb
CHANGED
data/test/test_updates.rb
CHANGED
data/test/test_validations.rb
CHANGED
data/test/test_views.rb
CHANGED
metadata
CHANGED
@@ -1,55 +1,59 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaxo-query-server
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Samuel Williams
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2012-10-14 00:00:00 +13:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: relaxo
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.3.1
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.3.1
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: json
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
35
25
|
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 4
|
30
|
+
- 0
|
31
|
+
version: 0.4.0
|
38
32
|
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: json
|
39
36
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
requirements:
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
43
39
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 7
|
44
|
+
- 3
|
45
45
|
version: 1.7.3
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
46
48
|
description:
|
47
49
|
email: samuel.williams@oriontransfer.co.nz
|
48
|
-
executables:
|
50
|
+
executables:
|
49
51
|
- relaxo-query-server
|
50
52
|
extensions: []
|
53
|
+
|
51
54
|
extra_rdoc_files: []
|
52
|
-
|
55
|
+
|
56
|
+
files:
|
53
57
|
- bin/relaxo-query-server
|
54
58
|
- lib/relaxo/query_server/context.rb
|
55
59
|
- lib/relaxo/query_server/designer.rb
|
@@ -60,7 +64,7 @@ files:
|
|
60
64
|
- lib/relaxo/query_server/shell.rb
|
61
65
|
- lib/relaxo/query_server/version.rb
|
62
66
|
- lib/relaxo/query_server.rb
|
63
|
-
- test/
|
67
|
+
- test/helper.rb
|
64
68
|
- test/test_filters.rb
|
65
69
|
- test/test_libraries.rb
|
66
70
|
- test/test_lists.rb
|
@@ -70,31 +74,37 @@ files:
|
|
70
74
|
- test/test_updates.rb
|
71
75
|
- test/test_validations.rb
|
72
76
|
- test/test_views.rb
|
77
|
+
- rakefile.rb
|
73
78
|
- README.md
|
79
|
+
has_rdoc: true
|
74
80
|
homepage: http://www.oriontransfer.co.nz/gems/relaxo
|
75
81
|
licenses: []
|
82
|
+
|
76
83
|
post_install_message:
|
77
84
|
rdoc_options: []
|
78
|
-
|
85
|
+
|
86
|
+
require_paths:
|
79
87
|
- lib
|
80
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
requirements:
|
89
|
-
- -
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
92
102
|
requirements: []
|
103
|
+
|
93
104
|
rubyforge_project:
|
94
|
-
rubygems_version: 1.
|
105
|
+
rubygems_version: 1.3.6
|
95
106
|
signing_key:
|
96
107
|
specification_version: 3
|
97
|
-
summary: Relaxo Query Server provides support for executing CouchDB functions using
|
98
|
-
Ruby.
|
108
|
+
summary: Relaxo Query Server provides support for executing CouchDB functions using Ruby.
|
99
109
|
test_files: []
|
100
|
-
|
110
|
+
|