mongomery 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/mongomery/schema.rb +32 -0
- data/lib/mongomery/version.rb +3 -0
- data/lib/mongomery.rb +349 -0
- data/mongomery.gemspec +31 -0
- metadata +170 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e862b5df5e64ed4977873516cd0057501edae4bc
|
4
|
+
data.tar.gz: ca713bf2fd15517398b7d8d8bb98e199b094d49c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0377c60e2a1fbc507b59ef0d97b01a90e8d147c91747df8ddd1ce2e9018434e612776e0d92ff7d42a548aaf035a34799711edd68704498a8d77f94ec02ad7642
|
7
|
+
data.tar.gz: 7153b7efd91ee3a9f0b32eb6b7695adb4ddb58a71db542aaa8531ec2d89fc5ff49405170957f8833eb5873641e51d282edc0d4c959e207f6751c649ea81396ec
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at kazuki-yoshida@cookpad.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 kazuki-yoshida
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
forked from [miyagawa/mongery](https://github.com/miyagawa/mongery)
|
2
|
+
|
3
|
+
# Mongomery
|
4
|
+
|
5
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mongomery`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
|
+
|
7
|
+
TODO: Delete this and the text above, and describe your gem
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'mongomery'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install mongomery
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
TODO: Write usage instructions here
|
28
|
+
|
29
|
+
## Development
|
30
|
+
|
31
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
32
|
+
|
33
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mongomery. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
38
|
+
|
39
|
+
|
40
|
+
## License
|
41
|
+
|
42
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
43
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "mongomery"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Mongomery
|
2
|
+
class Schema
|
3
|
+
VALID_TYPES = ["array", "boolean", "integer", "number", "null", "object", "string"]
|
4
|
+
|
5
|
+
def initialize(schema)
|
6
|
+
@schema = schema
|
7
|
+
end
|
8
|
+
|
9
|
+
def property(col)
|
10
|
+
@schema.properties[col]
|
11
|
+
end
|
12
|
+
|
13
|
+
def column_type(col)
|
14
|
+
value = type_value(col)
|
15
|
+
if VALID_TYPES.include?(value)
|
16
|
+
value
|
17
|
+
else
|
18
|
+
nil
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def type_value(col)
|
23
|
+
type = property(col).try(:type)
|
24
|
+
case type
|
25
|
+
when Array
|
26
|
+
(type - ["null"]).first
|
27
|
+
else
|
28
|
+
type
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/mongomery.rb
ADDED
@@ -0,0 +1,349 @@
|
|
1
|
+
require "mongomery/version"
|
2
|
+
require "mongomery/schema"
|
3
|
+
require "arel"
|
4
|
+
|
5
|
+
module Mongomery
|
6
|
+
class Builder
|
7
|
+
attr_reader :model, :table, :schema, :mapped_properties
|
8
|
+
attr_accessor :custom_operators
|
9
|
+
|
10
|
+
def initialize(model, engine = ActiveRecord::Base, schema = nil)
|
11
|
+
@model = model
|
12
|
+
@table = Arel::Table.new(model, engine)
|
13
|
+
@schema = Schema.new(schema) if schema
|
14
|
+
@mapped_properties = {}
|
15
|
+
@custom_operators = {}
|
16
|
+
end
|
17
|
+
|
18
|
+
def mapped_properties=(value)
|
19
|
+
case value
|
20
|
+
when Array
|
21
|
+
@mapped_properties = Hash[ value.map { |v| [v.to_s, v] } ]
|
22
|
+
else
|
23
|
+
@mapped_properties = value
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def find(*args)
|
28
|
+
build_query.where(*args)
|
29
|
+
end
|
30
|
+
|
31
|
+
def count(*args)
|
32
|
+
build_query.where(*args).count
|
33
|
+
end
|
34
|
+
|
35
|
+
def insert(*args)
|
36
|
+
build_query.insert(*args)
|
37
|
+
end
|
38
|
+
|
39
|
+
def index(*args)
|
40
|
+
build_query.index(*args)
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def build_query
|
46
|
+
Query.new(table, schema, mapped_properties, custom_operators)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class Query
|
51
|
+
attr_reader :table, :schema, :mapped_properties, :custom_operators
|
52
|
+
|
53
|
+
def initialize(table, schema, mapped_properties, custom_operators)
|
54
|
+
@table = table
|
55
|
+
@schema = schema
|
56
|
+
@mapped_properties = mapped_properties
|
57
|
+
@custom_operators = custom_operators
|
58
|
+
@condition = nil
|
59
|
+
end
|
60
|
+
|
61
|
+
def where(args)
|
62
|
+
@where = args
|
63
|
+
self
|
64
|
+
end
|
65
|
+
|
66
|
+
def arel
|
67
|
+
@arel ||= build_arel
|
68
|
+
end
|
69
|
+
|
70
|
+
def to_arel
|
71
|
+
arel
|
72
|
+
end
|
73
|
+
|
74
|
+
def to_sql
|
75
|
+
to_arel.to_sql
|
76
|
+
end
|
77
|
+
|
78
|
+
def limit(number)
|
79
|
+
arel.take(number)
|
80
|
+
self
|
81
|
+
end
|
82
|
+
|
83
|
+
def skip(number)
|
84
|
+
arel.skip(number)
|
85
|
+
self
|
86
|
+
end
|
87
|
+
|
88
|
+
def sort(params)
|
89
|
+
params.each do |col, val|
|
90
|
+
order = val > 0 ? :asc : :desc
|
91
|
+
case col.to_s
|
92
|
+
when "_id"
|
93
|
+
arel.order(table[:id].send(order))
|
94
|
+
else
|
95
|
+
arel.order(sql_json_path(col).send(order))
|
96
|
+
end
|
97
|
+
end
|
98
|
+
self
|
99
|
+
end
|
100
|
+
|
101
|
+
def sql_json_exp(col)
|
102
|
+
sql_json_path(col)
|
103
|
+
end
|
104
|
+
|
105
|
+
def index(col)
|
106
|
+
Arel.sql(%Q[CREATE INDEX "#{table.name}_#{col}_idx" ON "#{table.name}" ((#{sql_json_exp(col)}))])
|
107
|
+
end
|
108
|
+
|
109
|
+
def mapped_values(args)
|
110
|
+
pairs = []
|
111
|
+
mapped_properties.each do |key, column|
|
112
|
+
pairs.push([table[column], args[key]]) if args.key?(key)
|
113
|
+
end
|
114
|
+
pairs
|
115
|
+
end
|
116
|
+
private :mapped_values
|
117
|
+
|
118
|
+
|
119
|
+
def count
|
120
|
+
table.project('COUNT(*)').tap do |t|
|
121
|
+
t.where(condition) if condition
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def insert(args)
|
126
|
+
Arel::InsertManager.new(table.engine).tap do |manager|
|
127
|
+
manager.into(table)
|
128
|
+
manager.insert(Hash[args.map {|k, v| [table[k], v] }].to_a)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def update(args)
|
133
|
+
Arel::UpdateManager.new(table.engine).tap do |manager|
|
134
|
+
manager.table(table)
|
135
|
+
manager.set(Hash[args.map {|k, v| [table[k], v] }].to_a)
|
136
|
+
manager.where(condition) if condition
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
def delete
|
141
|
+
Arel::DeleteManager.new(table.engine).tap do |manager|
|
142
|
+
manager.from(table)
|
143
|
+
manager.where(condition) if condition
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
private
|
148
|
+
|
149
|
+
def mapped_keys
|
150
|
+
mapped_properties.keys
|
151
|
+
end
|
152
|
+
|
153
|
+
def condition
|
154
|
+
@condition ||= translate(@where)
|
155
|
+
end
|
156
|
+
|
157
|
+
def build_arel
|
158
|
+
table.project(table[:data]).tap do |t|
|
159
|
+
t.where(condition) if condition
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
def translate(query)
|
164
|
+
chain(:and, query.map {|col, value| translate_cv(col, value) })
|
165
|
+
end
|
166
|
+
|
167
|
+
def translate_cv(col, value)
|
168
|
+
case col.to_s
|
169
|
+
when "$or"
|
170
|
+
chain(:or, value.map {|q| translate(q) })
|
171
|
+
when "$and"
|
172
|
+
chain(:and, value.map {|q| translate(q) })
|
173
|
+
when /^\$/
|
174
|
+
raise UnsupportedQuery, "Unsupported operator #{col}"
|
175
|
+
when "_id"
|
176
|
+
translate_value(table[:id], value)
|
177
|
+
when *mapped_keys
|
178
|
+
translate_value(table[mapped_properties[col.to_s]], value)
|
179
|
+
else
|
180
|
+
if schema
|
181
|
+
translate_value_schema(col, sql_json_path(col), value)
|
182
|
+
else
|
183
|
+
translate_value_dynamic(sql_json_path(col), value)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
OPERATOR_MAP = {
|
189
|
+
"$in" => :in, "$eq" => :eq, "$ne" => :not_eq,
|
190
|
+
"$gt" => :gt, "$gte" => :gteq, "$lt" => :lt, "$lte" => :lteq,
|
191
|
+
}
|
192
|
+
|
193
|
+
def translate_value(col, value)
|
194
|
+
case value
|
195
|
+
when Hash
|
196
|
+
if has_operator?(value)
|
197
|
+
chain(:and, value.map {|op, val|
|
198
|
+
if custom_operators[op]
|
199
|
+
operator(col, custom_operators[op], val)
|
200
|
+
elsif OPERATOR_MAP.key?(op)
|
201
|
+
col.send(OPERATOR_MAP[op], val)
|
202
|
+
else
|
203
|
+
raise UnsupportedQuery, "Unknown operator #{op}"
|
204
|
+
end
|
205
|
+
})
|
206
|
+
else
|
207
|
+
col.eq(value.to_json)
|
208
|
+
end
|
209
|
+
else
|
210
|
+
col.eq(value)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
def translate_value_schema(column, col, value)
|
215
|
+
type = schema.column_type(column.to_s)
|
216
|
+
case value
|
217
|
+
when Hash
|
218
|
+
if has_operator?(value)
|
219
|
+
chain(:and, value.map {|op, val|
|
220
|
+
case op
|
221
|
+
when "$in"
|
222
|
+
case type
|
223
|
+
when "array"
|
224
|
+
chain(:or, val.map { |v| col.matches(%Q[%"#{v}"%]) })
|
225
|
+
else
|
226
|
+
compare_schema(col, val, type, :in)
|
227
|
+
end
|
228
|
+
when *(custom_operators.keys)
|
229
|
+
compare_schema(col, val, type, custom_operators[op])
|
230
|
+
when "$eq", "$ne", "$gt", "$gte", "$lt", "$lte"
|
231
|
+
compare_schema(col, val, type, OPERATOR_MAP[op])
|
232
|
+
else
|
233
|
+
raise UnsupportedQuery, "Unknown operator #{op}"
|
234
|
+
end
|
235
|
+
})
|
236
|
+
else
|
237
|
+
col.eq(value.to_json)
|
238
|
+
end
|
239
|
+
when String, Numeric, NilClass
|
240
|
+
compare_schema(col, value, type, :eq)
|
241
|
+
else
|
242
|
+
compare_schema(col, value.to_json, type, :eq)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
def translate_value_dynamic(col, value)
|
247
|
+
case value
|
248
|
+
when String, TrueClass, FalseClass
|
249
|
+
col.eq(value.to_s)
|
250
|
+
when Numeric, NilClass
|
251
|
+
compare(col, value, :eq)
|
252
|
+
when Hash
|
253
|
+
if has_operator?(value)
|
254
|
+
chain(:and, value.map {|op, val|
|
255
|
+
case op
|
256
|
+
when "$in"
|
257
|
+
if val.all? {|v| v.is_a? Numeric }
|
258
|
+
wrap(col, val.first).in(val)
|
259
|
+
else
|
260
|
+
col.in(val.map(&:to_s))
|
261
|
+
end
|
262
|
+
when *(custom_operators.keys)
|
263
|
+
compare(col, val, custom_operators[op])
|
264
|
+
when "$eq", "$ne", "$gt", "$gte", "$lt", "$lte"
|
265
|
+
compare(col, val, OPERATOR_MAP[op])
|
266
|
+
else
|
267
|
+
raise UnsupportedQuery, "Unknown operator #{op}"
|
268
|
+
end
|
269
|
+
})
|
270
|
+
else
|
271
|
+
col.eq(value.to_json)
|
272
|
+
end
|
273
|
+
else
|
274
|
+
col.eq(value.to_json)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
def has_operator?(value)
|
279
|
+
value.keys.any? {|key| key =~ /^\$/ }
|
280
|
+
end
|
281
|
+
|
282
|
+
def compare(col, val, op)
|
283
|
+
operator(wrap(col, val), op, val)
|
284
|
+
end
|
285
|
+
|
286
|
+
def wrap(col, val)
|
287
|
+
case val
|
288
|
+
when NilClass
|
289
|
+
# data#>>'{foo}' IS NULL is invalid
|
290
|
+
# (data#>>'{foo}') IS NULL is valid
|
291
|
+
Arel.sql("(#{col})")
|
292
|
+
else
|
293
|
+
col
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
def numeric?(col)
|
298
|
+
type = schema.column_type(col.to_s)
|
299
|
+
["number", "integer"].include?(type)
|
300
|
+
end
|
301
|
+
|
302
|
+
def compare_schema(col, val, type, op)
|
303
|
+
case type
|
304
|
+
when "string"
|
305
|
+
operator(Arel.sql("(#{col})"), op, val)
|
306
|
+
else
|
307
|
+
case val
|
308
|
+
when Numeric
|
309
|
+
operator(Arel.sql("(#{col})"), op, val.to_s)
|
310
|
+
else
|
311
|
+
operator(Arel.sql("(#{col})"), op, val)
|
312
|
+
end
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
def operator(col, op, val)
|
317
|
+
case op
|
318
|
+
when Symbol
|
319
|
+
col.send(op, val)
|
320
|
+
else
|
321
|
+
op.call(col, val)
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
325
|
+
def sql_json_path(col)
|
326
|
+
Arel.sql("#{col.to_s}")
|
327
|
+
end
|
328
|
+
|
329
|
+
def json_pathize(paths)
|
330
|
+
quote("{#{paths.join(',')}}")
|
331
|
+
end
|
332
|
+
|
333
|
+
def quote(str)
|
334
|
+
# FIXME there should be a better way to do this
|
335
|
+
table.engine.connection.quote(str)
|
336
|
+
end
|
337
|
+
|
338
|
+
def chain(op, conditions)
|
339
|
+
result = nil
|
340
|
+
conditions.each do |cond|
|
341
|
+
result = result ? result.send(op, cond) : cond
|
342
|
+
end
|
343
|
+
result
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
class UnsupportedQuery < StandardError
|
348
|
+
end
|
349
|
+
end
|
data/mongomery.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mongomery/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mongomery"
|
8
|
+
spec.version = Mongomery::VERSION
|
9
|
+
spec.authors = ["kazuki-yoshida"]
|
10
|
+
spec.email = ["kzk.yshd@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Convert MongoDB query to Arel for MySQL. Forked from miyagawa/mongery }
|
13
|
+
spec.description = %q{}
|
14
|
+
spec.homepage = "https://github.com/kazy1991/mongomery"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "arel", ">= 4.0.2"
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
spec.add_development_dependency "activerecord", ">= 4.0.0"
|
28
|
+
spec.add_development_dependency "json_schema"
|
29
|
+
spec.add_development_dependency "pry"
|
30
|
+
spec.add_development_dependency "mysql2"
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mongomery
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- kazuki-yoshida
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-11 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: 4.0.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.2
|
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.11'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.11'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.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: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activerecord
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 4.0.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 4.0.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: json_schema
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: mysql2
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: ''
|
126
|
+
email:
|
127
|
+
- kzk.yshd@gmail.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- .gitignore
|
133
|
+
- .rspec
|
134
|
+
- .travis.yml
|
135
|
+
- CODE_OF_CONDUCT.md
|
136
|
+
- Gemfile
|
137
|
+
- LICENSE.txt
|
138
|
+
- README.md
|
139
|
+
- Rakefile
|
140
|
+
- bin/console
|
141
|
+
- bin/setup
|
142
|
+
- lib/mongomery.rb
|
143
|
+
- lib/mongomery/schema.rb
|
144
|
+
- lib/mongomery/version.rb
|
145
|
+
- mongomery.gemspec
|
146
|
+
homepage: https://github.com/kazy1991/mongomery
|
147
|
+
licenses:
|
148
|
+
- MIT
|
149
|
+
metadata: {}
|
150
|
+
post_install_message:
|
151
|
+
rdoc_options: []
|
152
|
+
require_paths:
|
153
|
+
- lib
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - '>='
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
requirements: []
|
165
|
+
rubyforge_project:
|
166
|
+
rubygems_version: 2.5.2
|
167
|
+
signing_key:
|
168
|
+
specification_version: 4
|
169
|
+
summary: Convert MongoDB query to Arel for MySQL. Forked from miyagawa/mongery
|
170
|
+
test_files: []
|