arel-ltree 0.0.1
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.
- checksums.yaml +15 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.travis.yml +11 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +60 -0
- data/Rakefile +6 -0
- data/arel-ltree.gemspec +24 -0
- data/lib/arel-ltree.rb +6 -0
- data/lib/arel-ltree/attributes.rb +23 -0
- data/lib/arel-ltree/ltree/nodes.rb +14 -0
- data/lib/arel-ltree/ltree/predications.rb +49 -0
- data/lib/arel-ltree/ltree/version.rb +5 -0
- data/lib/arel-ltree/ltree/visitors.rb +32 -0
- data/spec/arel-ltree/ltree/nodes_spec.rb +9 -0
- data/spec/arel-ltree/ltree/visitiors_spec.rb +88 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/support/fake_record.rb +123 -0
- metadata +122 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTRhNjY0ZTk0NTk3YTE1ZDM5NzVkMjZhYWY4OWY0ODAwNGZiODQ4Nw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzU3ZmY2ZTNlZDIwMmQ4NzZkZmY0MmYxZThkNzRiZDIxNmQ1ZGNhMQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZGQxYjQyZmU2NmUwZTlmYWM0ZTRkYWM4NTk4ODZmMmMzOWQ0ZjBhZDJmMjAy
|
10
|
+
MGQ0NzIzMjRlYjQxY2FhNDZlMTlmNmYyNTU5OTk1MDNlZWIzNDllM2I1ZjE2
|
11
|
+
YzRiZmYyNDY3ODRmMzM4OGExMDIwM2U4NTBiZDkxMWYwM2Q2MDY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YTA3YjM4OGFlM2Y2MzlhYmExMzVjMjA5ZjliMGZjNGU1MDY0Mzg0NzVhZDk0
|
14
|
+
ZDBlZjhmNWRmYmE5MTQyYTE1YjgzYmEwNjZjOTQwZTRlNWUxYzA4NzhmMzMx
|
15
|
+
OTIwZWM2YzQ5NmE4ZGYyOTk3YzU5NTg4MzJlNWM0YzIxMDJkYzM=
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Andrew Slotin
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
[](https://travis-ci.org/andrewslotin/arel-ltree) [](https://gemnasium.com/andrewslotin/arel-ltree)
|
2
|
+
|
3
|
+
# arel-ltree
|
4
|
+
|
5
|
+
Arel extension for PostgreSQL [ltree](http://www.postgresql.org/docs/9.2/static/ltree.html) type.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'arel-ltree'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install arel-ltree
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Select all parent nodes:
|
24
|
+
```ruby
|
25
|
+
Node.where(Node.arel_table[:path].ancestor_of('root.subtree.node')).to_sql
|
26
|
+
# => SELECT * FROM nodes WHERE "nodes"."path" @> 'root.subtree.node'::ltree;
|
27
|
+
```
|
28
|
+
|
29
|
+
Select all children nodes:
|
30
|
+
```ruby
|
31
|
+
Node.where(Node.arel_table[:path].descendant_of('root.subtree')).to_sql
|
32
|
+
# => SELECT * FROM nodes WHERE "nodes"."path" <@ 'root.subtree'::ltree;
|
33
|
+
|
34
|
+
Match against ltree:
|
35
|
+
```ruby
|
36
|
+
Node.where(Node.arel_table[:path].matches.ltree('root.subtree')).to_sql
|
37
|
+
# => SELECT * FROM nodes WHERE "nodes"."path" ~ 'root.subtree'::ltree;
|
38
|
+
|
39
|
+
ltree = Arel::Attributes::Ltree.new('root.subtree')
|
40
|
+
Node.where(Node.arel_table[:path].matches(ltree).to_sql
|
41
|
+
# => SELECT * FROM nodes WHERE "nodes"."path" ~ 'root.subtree'::ltree;
|
42
|
+
```
|
43
|
+
|
44
|
+
Match against lquery (simple regex for ltree):
|
45
|
+
```ruby
|
46
|
+
Node.where(Node.arel_table[:path].matches.lquery('root.*{1}.node')).to_sql
|
47
|
+
# => SELECT * FROM nodes WHERE "nodes"."path" <@ 'root.*{1}.node'::lquery;
|
48
|
+
|
49
|
+
lquery = Arel::Attributes::Lquery.new('root.*{1}.node')
|
50
|
+
Node.where(Node.arel_table[:path].matches(lquery).to_sql
|
51
|
+
# => SELECT * FROM nodes WHERE "nodes"."path" <@ 'root.*{1}.node'::lquery;
|
52
|
+
```
|
53
|
+
|
54
|
+
## Contributing
|
55
|
+
|
56
|
+
1. Fork it
|
57
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
58
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
59
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
60
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/arel-ltree.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'arel-ltree/ltree/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "arel-ltree"
|
8
|
+
spec.version = Arel::Ltree::VERSION
|
9
|
+
spec.authors = ["Andrew Slotin"]
|
10
|
+
spec.email = ["andrew.slotin@gmail.com"]
|
11
|
+
spec.description = %q{Arel extension for PostgreSQL ltree type}
|
12
|
+
spec.summary = %q{Adds support for ltree operatos to Arel}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency "arel", ">= 3.0"
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
end
|
data/lib/arel-ltree.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Arel
|
2
|
+
module Attributes
|
3
|
+
class Ltree < Struct.new(:query)
|
4
|
+
include ::Arel::Ltree::Predications
|
5
|
+
|
6
|
+
def method_missing(name, *args)
|
7
|
+
if query.respond_to?(name)
|
8
|
+
query.send(name, *args)
|
9
|
+
else
|
10
|
+
super
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_s
|
15
|
+
query
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Lquery < Ltree; end
|
20
|
+
|
21
|
+
Attribute.send :include, Arel::Ltree::Predications
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Arel
|
2
|
+
module Ltree
|
3
|
+
module Nodes
|
4
|
+
class AncestorOf < ::Arel::Nodes::Binary; end
|
5
|
+
class DescendantOf < ::Arel::Nodes::Binary; end
|
6
|
+
|
7
|
+
class Matches < Arel::Nodes::Binary
|
8
|
+
def initialize(left, right = nil)
|
9
|
+
super
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Arel
|
2
|
+
module Ltree
|
3
|
+
module Predications
|
4
|
+
def ancestor_of(other)
|
5
|
+
Arel::Ltree::Nodes::AncestorOf.new(self, other)
|
6
|
+
end
|
7
|
+
|
8
|
+
def descendant_of(other)
|
9
|
+
Arel::Ltree::Nodes::DescendantOf.new(self, other)
|
10
|
+
end
|
11
|
+
|
12
|
+
def matches(*args)
|
13
|
+
case args[0]
|
14
|
+
when Attributes::Lquery, Attributes::Ltree
|
15
|
+
Arel::Ltree::Nodes::Matches.new(self, args[0])
|
16
|
+
when nil
|
17
|
+
Arel::Ltree::Nodes::Matches.new(self)
|
18
|
+
else
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module MatchesPredications
|
25
|
+
def lquery(other)
|
26
|
+
ltree_matches_node(other, Attributes::Lquery)
|
27
|
+
end
|
28
|
+
|
29
|
+
def ltree(other)
|
30
|
+
ltree_matches_node(other, Attributes::Ltree)
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def ltree_matches_node(other, rop_node_klass)
|
36
|
+
case other
|
37
|
+
when String
|
38
|
+
Arel::Ltree::Nodes::Matches.new(self.left, rop_node_klass.new(other))
|
39
|
+
when Array
|
40
|
+
Arel::Ltree::Nodes::Matches.new(self.left, other.map { |o| rop_node_klass.new(o) })
|
41
|
+
else
|
42
|
+
Arel::Ltree::Nodes::Matches.new(self.left, other)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
Nodes::Matches.send :include, MatchesPredications
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Arel
|
2
|
+
module Ltree
|
3
|
+
module Visitors
|
4
|
+
private
|
5
|
+
|
6
|
+
def visit_Arel_Ltree_Nodes_AncestorOf(o)
|
7
|
+
"#{visit o.left} @> #{visit o.right}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def visit_Arel_Ltree_Nodes_DescendantOf(o)
|
11
|
+
"#{visit o.left} <@ #{visit o.right}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def visit_Arel_Ltree_Nodes_Matches(o)
|
15
|
+
raise ArgumentError.new("Missing right operand for MATCH") unless o.right
|
16
|
+
"#{visit o.left} ~ #{visit o.right}"
|
17
|
+
end
|
18
|
+
|
19
|
+
def visit_Arel_Attributes_Ltree(o)
|
20
|
+
"'#{o}'::ltree"
|
21
|
+
end
|
22
|
+
|
23
|
+
def visit_Arel_Attributes_Lquery(o)
|
24
|
+
"'#{o}'::lquery"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
module Visitors
|
30
|
+
PostgreSQL.send :include, Ltree::Visitors
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Arel::Ltree::Nodes do
|
4
|
+
%w{AncestorOf DescendantOf Matches}.each do |klass_name|
|
5
|
+
it "defines a binary operation #{klass_name}" do
|
6
|
+
expect(Arel::Ltree::Nodes.const_get(klass_name).superclass).to be Arel::Nodes::Binary
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Arel
|
4
|
+
module Ltree
|
5
|
+
describe Visitors do
|
6
|
+
subject { Arel::Visitors::PostgreSQL.new(Arel::Table.engine.connection) }
|
7
|
+
let(:parent_ltree) { Arel::Attributes::Ltree.new('1.2') }
|
8
|
+
let(:child_ltree) { Arel::Attributes::Ltree.new('1.2.3') }
|
9
|
+
let(:lquery) { Arel::Attributes::Lquery.new('*.a{2}.b') }
|
10
|
+
|
11
|
+
it 'visit_Arel_Attributes_Ltree' do
|
12
|
+
expect(subject.accept(parent_ltree)).to eq "'1.2'::ltree"
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'visit_Arel_Attributes_Lquery' do
|
16
|
+
expect(subject.accept(lquery)).to eq "'*.a{2}.b'::lquery"
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'supports ancestor_of operator' do
|
20
|
+
node = Nodes::AncestorOf.new(parent_ltree, child_ltree)
|
21
|
+
expect(subject.accept(node)).to eq "'1.2'::ltree @> '1.2.3'::ltree"
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'supports descendant_of operator' do
|
25
|
+
node = Nodes::DescendantOf.new(child_ltree, parent_ltree)
|
26
|
+
expect(subject.accept(node)).to eq "'1.2.3'::ltree <@ '1.2'::ltree"
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'supports matching against the lquery' do
|
30
|
+
node = Nodes::Matches.new(child_ltree, lquery)
|
31
|
+
expect(subject.accept(node)).to eq "'1.2.3'::ltree ~ '*.a{2}.b'::lquery"
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'supports matching against the ltree' do
|
35
|
+
node = Nodes::Matches.new(child_ltree, parent_ltree)
|
36
|
+
expect(subject.accept(node)).to eq "'1.2.3'::ltree ~ '1.2'::ltree"
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'with attribute as a left parameter' do
|
40
|
+
let(:table) { Table.new(:nodes) }
|
41
|
+
let(:attr) { table[:path] }
|
42
|
+
let(:ltree) { parent_ltree }
|
43
|
+
|
44
|
+
it 'supports ancestor_of operator' do
|
45
|
+
node = attr.ancestor_of(ltree)
|
46
|
+
expect(subject.accept(node)).to eq %q{"nodes"."path" @> '1.2'::ltree}
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'supports descendant_of operator' do
|
50
|
+
node = attr.descendant_of(ltree)
|
51
|
+
expect(subject.accept(node)).to eq %q{"nodes"."path" <@ '1.2'::ltree}
|
52
|
+
end
|
53
|
+
|
54
|
+
describe ".matches" do
|
55
|
+
it 'supports matching against the lquery' do
|
56
|
+
node = attr.matches.lquery(lquery)
|
57
|
+
expect(subject.accept(node)).to eq %q{"nodes"."path" ~ '*.a{2}.b'::lquery}
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'supports matching against the ltree' do
|
61
|
+
node = attr.matches.ltree(ltree)
|
62
|
+
expect(subject.accept(node)).to eq %q{"nodes"."path" ~ '1.2'::ltree}
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'supports matching against the lquery given lquery as an argument' do
|
66
|
+
node = attr.matches(lquery)
|
67
|
+
expect(subject.accept(node)).to eq %q{"nodes"."path" ~ '*.a{2}.b'::lquery}
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'supports matching against the ltree given ltree as an argument' do
|
71
|
+
node = attr.matches(ltree)
|
72
|
+
expect(subject.accept(node)).to eq %q{"nodes"."path" ~ '1.2'::ltree}
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'raises an ArgumentError when .match is called without arguments' do
|
76
|
+
node = attr.matches
|
77
|
+
expect { subject.accept(node) }.to raise_error ArgumentError
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'uses LIKE match given a string' do
|
81
|
+
node = attr.matches("123")
|
82
|
+
expect(subject.accept(node)).to eq %q{"nodes"."path" ILIKE '123'}
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
module FakeRecord
|
2
|
+
class Column < Struct.new(:name, :type)
|
3
|
+
end
|
4
|
+
|
5
|
+
class Connection
|
6
|
+
attr_reader :tables
|
7
|
+
attr_accessor :visitor
|
8
|
+
|
9
|
+
def initialize(visitor = nil)
|
10
|
+
@tables = %w{ users photos developers products}
|
11
|
+
@columns = {
|
12
|
+
'users' => [
|
13
|
+
Column.new('id', :integer),
|
14
|
+
Column.new('name', :string),
|
15
|
+
Column.new('bool', :boolean),
|
16
|
+
Column.new('created_at', :date)
|
17
|
+
],
|
18
|
+
'products' => [
|
19
|
+
Column.new('id', :integer),
|
20
|
+
Column.new('price', :decimal)
|
21
|
+
]
|
22
|
+
}
|
23
|
+
@columns_hash = {
|
24
|
+
'users' => Hash[@columns['users'].map { |x| [x.name, x] }],
|
25
|
+
'products' => Hash[@columns['products'].map { |x| [x.name, x] }]
|
26
|
+
}
|
27
|
+
@primary_keys = {
|
28
|
+
'users' => 'id',
|
29
|
+
'products' => 'id'
|
30
|
+
}
|
31
|
+
@visitor = visitor
|
32
|
+
end
|
33
|
+
|
34
|
+
def columns_hash table_name
|
35
|
+
@columns_hash[table_name]
|
36
|
+
end
|
37
|
+
|
38
|
+
def primary_key name
|
39
|
+
@primary_keys[name.to_s]
|
40
|
+
end
|
41
|
+
|
42
|
+
def table_exists? name
|
43
|
+
@tables.include? name.to_s
|
44
|
+
end
|
45
|
+
|
46
|
+
def columns name, message = nil
|
47
|
+
@columns[name.to_s]
|
48
|
+
end
|
49
|
+
|
50
|
+
def quote_table_name name
|
51
|
+
"\"#{name.to_s}\""
|
52
|
+
end
|
53
|
+
|
54
|
+
def quote_column_name name
|
55
|
+
"\"#{name.to_s}\""
|
56
|
+
end
|
57
|
+
|
58
|
+
def schema_cache
|
59
|
+
self
|
60
|
+
end
|
61
|
+
|
62
|
+
def quote thing, column = nil
|
63
|
+
if column && column.type == :integer
|
64
|
+
return 'NULL' if thing.nil?
|
65
|
+
return thing.to_i
|
66
|
+
end
|
67
|
+
|
68
|
+
case thing
|
69
|
+
when true
|
70
|
+
"'t'"
|
71
|
+
when false
|
72
|
+
"'f'"
|
73
|
+
when nil
|
74
|
+
'NULL'
|
75
|
+
when Numeric
|
76
|
+
thing
|
77
|
+
else
|
78
|
+
"'#{thing}'"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
class ConnectionPool
|
84
|
+
class Spec < Struct.new(:config)
|
85
|
+
end
|
86
|
+
|
87
|
+
attr_reader :spec, :connection
|
88
|
+
|
89
|
+
def initialize
|
90
|
+
@spec = Spec.new(:adapter => 'america')
|
91
|
+
@connection = Connection.new
|
92
|
+
@connection.visitor = Arel::Visitors::ToSql.new(connection)
|
93
|
+
end
|
94
|
+
|
95
|
+
def with_connection
|
96
|
+
yield connection
|
97
|
+
end
|
98
|
+
|
99
|
+
def table_exists? name
|
100
|
+
connection.tables.include? name.to_s
|
101
|
+
end
|
102
|
+
|
103
|
+
def columns_hash
|
104
|
+
connection.columns_hash
|
105
|
+
end
|
106
|
+
|
107
|
+
def schema_cache
|
108
|
+
connection
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
class Base
|
113
|
+
attr_accessor :connection_pool
|
114
|
+
|
115
|
+
def initialize
|
116
|
+
@connection_pool = ConnectionPool.new
|
117
|
+
end
|
118
|
+
|
119
|
+
def connection
|
120
|
+
connection_pool.connection
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: arel-ltree
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrew Slotin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: arel
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Arel extension for PostgreSQL ltree type
|
70
|
+
email:
|
71
|
+
- andrew.slotin@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- .rspec
|
78
|
+
- .travis.yml
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- arel-ltree.gemspec
|
84
|
+
- lib/arel-ltree.rb
|
85
|
+
- lib/arel-ltree/attributes.rb
|
86
|
+
- lib/arel-ltree/ltree/nodes.rb
|
87
|
+
- lib/arel-ltree/ltree/predications.rb
|
88
|
+
- lib/arel-ltree/ltree/version.rb
|
89
|
+
- lib/arel-ltree/ltree/visitors.rb
|
90
|
+
- spec/arel-ltree/ltree/nodes_spec.rb
|
91
|
+
- spec/arel-ltree/ltree/visitiors_spec.rb
|
92
|
+
- spec/spec_helper.rb
|
93
|
+
- spec/support/fake_record.rb
|
94
|
+
homepage: ''
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ! '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
requirements: []
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 2.1.4
|
115
|
+
signing_key:
|
116
|
+
specification_version: 4
|
117
|
+
summary: Adds support for ltree operatos to Arel
|
118
|
+
test_files:
|
119
|
+
- spec/arel-ltree/ltree/nodes_spec.rb
|
120
|
+
- spec/arel-ltree/ltree/visitiors_spec.rb
|
121
|
+
- spec/spec_helper.rb
|
122
|
+
- spec/support/fake_record.rb
|