surikat 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/surikat.iml +7 -2
- data/.idea/workspace.xml +597 -135
- data/README.md +10 -0
- data/bin/console +0 -4
- data/exe/surikat +3 -0
- data/lib/surikat.rb +5 -4
- data/lib/surikat/base_model.rb +0 -2
- data/lib/surikat/templates/base_spec.rb.tmpl +1 -1
- data/lib/surikat/templates/console.tmpl +1 -1
- data/lib/surikat/version.rb +1 -1
- data/surikat.gemspec +10 -0
- metadata +171 -1
data/README.md
CHANGED
@@ -382,6 +382,16 @@ Example query:
|
|
382
382
|
}
|
383
383
|
```
|
384
384
|
|
385
|
+
## System Dependencies
|
386
|
+
|
387
|
+
For improved performance, Surikat uses a C++ library to parse GraplQL queries, [libgraphqlparser](https://github.com/graphql/libgraphqlparser).
|
388
|
+
|
389
|
+
On Mac OS X, install with Homebrew:
|
390
|
+
|
391
|
+
```bash
|
392
|
+
brew install libgraphqlparser
|
393
|
+
```
|
394
|
+
|
385
395
|
## Development
|
386
396
|
|
387
397
|
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.
|
data/bin/console
CHANGED
data/exe/surikat
CHANGED
@@ -43,6 +43,7 @@ def list_routes
|
|
43
43
|
|
44
44
|
%w(queries mutations).each do |group, queries|
|
45
45
|
puts "\n#{group.capitalize}:\n----------\n"
|
46
|
+
next unless all_queries[group].is_a? Hash
|
46
47
|
all_queries[group].keys.sort.each do |key|
|
47
48
|
input_s = (all_queries[group][key]['arguments'].to_a.map {|t_name, t_type| "#{t_name}: #{t_type}"}).join(', ')
|
48
49
|
puts "Name: #{key}, resolves in #{all_queries[group][key]['class']}##{all_queries[group][key]['method']}, result returned as #{all_queries[group][key]['output_type']}, input arguments: " +
|
@@ -167,6 +168,8 @@ def exemplify(arguments)
|
|
167
168
|
|
168
169
|
route, collection = nil, nil
|
169
170
|
%w(queries mutations).each do |col|
|
171
|
+
next unless all_routes[col].is_a? Hash
|
172
|
+
|
170
173
|
fr = all_routes[col].keys.detect do |r|
|
171
174
|
qr = all_routes[col][r]
|
172
175
|
[qr['class'], qr['method']] == [class_n, method_n]
|
data/lib/surikat.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'surikat/version'
|
2
2
|
|
3
3
|
module Surikat
|
4
|
-
require 'graphql/libgraphqlparser'
|
5
4
|
require 'active_support'
|
5
|
+
require 'graphql/libgraphqlparser'
|
6
|
+
|
6
7
|
require 'surikat/yaml_configurator'
|
7
8
|
|
8
9
|
class << self
|
@@ -22,8 +23,8 @@ module Surikat
|
|
22
23
|
%w(queries models).each do |dir|
|
23
24
|
Dir.glob("#{FileUtils.pwd}/app/#{dir}/*.rb").each {|f| require(f)}
|
24
25
|
end
|
25
|
-
|
26
26
|
require 'surikat/types'
|
27
|
+
|
27
28
|
require 'surikat/routes'
|
28
29
|
require 'surikat/session'
|
29
30
|
|
@@ -250,8 +251,8 @@ module Surikat
|
|
250
251
|
value = variables[expected_var_name]
|
251
252
|
|
252
253
|
expected_var_type_singular = expected_var_type.gsub(/[\[\]]/, '')
|
253
|
-
expected_var_type_simple
|
254
|
-
is_plural
|
254
|
+
expected_var_type_simple = expected_var_type.gsub(/[\[\]\!]/, '')
|
255
|
+
is_plural = [expected_var_type.first, expected_var_type.last] == %w([ ])
|
255
256
|
|
256
257
|
if is_plural
|
257
258
|
unless value.is_a? Array
|
data/lib/surikat/base_model.rb
CHANGED
data/lib/surikat/version.rb
CHANGED
data/surikat.gemspec
CHANGED
@@ -43,5 +43,15 @@ Gem::Specification.new do |spec|
|
|
43
43
|
# spec.add_development_dependency "standalone_migrations", "~> 5.2", ">= 5.2.5"
|
44
44
|
# spec.add_development_dependency "ransack", "~> 1.8", ">= 1.8.2"
|
45
45
|
|
46
|
+
spec.add_runtime_dependency "oj", "~> 3.3"
|
47
|
+
spec.add_runtime_dependency "standalone_migrations", "~> 5.2", '>= 5.2.5 '
|
48
|
+
spec.add_runtime_dependency "sqlite3", "~> 1.3", '>= 1.3.13'
|
49
|
+
spec.add_runtime_dependency "rspec", "~> 3.7", '>= 3.7.0'
|
50
|
+
spec.add_runtime_dependency "graphql-libgraphqlparser", "~> 1.2", ">= 1.2.0"
|
51
|
+
spec.add_runtime_dependency "ransack", "~> 1.8", ">= 1.8.2"
|
52
|
+
spec.add_runtime_dependency "bundler", "~> 1.15"
|
53
|
+
spec.add_runtime_dependency "rake", "~> 10.0"
|
54
|
+
spec.add_runtime_dependency "rack-app", "~> 7.5"
|
55
|
+
spec.add_runtime_dependency "passenger", "~> 5.3"
|
46
56
|
|
47
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: surikat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Deva
|
@@ -112,6 +112,176 @@ dependencies:
|
|
112
112
|
- - ">="
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: 3.3.5
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: oj
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - "~>"
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '3.3'
|
122
|
+
type: :runtime
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - "~>"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '3.3'
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
name: standalone_migrations
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - "~>"
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '5.2'
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 5.2.5
|
139
|
+
type: :runtime
|
140
|
+
prerelease: false
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '5.2'
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: 5.2.5
|
149
|
+
- !ruby/object:Gem::Dependency
|
150
|
+
name: sqlite3
|
151
|
+
requirement: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - "~>"
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '1.3'
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 1.3.13
|
159
|
+
type: :runtime
|
160
|
+
prerelease: false
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '1.3'
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: 1.3.13
|
169
|
+
- !ruby/object:Gem::Dependency
|
170
|
+
name: rspec
|
171
|
+
requirement: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - "~>"
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '3.7'
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: 3.7.0
|
179
|
+
type: :runtime
|
180
|
+
prerelease: false
|
181
|
+
version_requirements: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - "~>"
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '3.7'
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: 3.7.0
|
189
|
+
- !ruby/object:Gem::Dependency
|
190
|
+
name: graphql-libgraphqlparser
|
191
|
+
requirement: !ruby/object:Gem::Requirement
|
192
|
+
requirements:
|
193
|
+
- - "~>"
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: '1.2'
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: 1.2.0
|
199
|
+
type: :runtime
|
200
|
+
prerelease: false
|
201
|
+
version_requirements: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - "~>"
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '1.2'
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 1.2.0
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: ransack
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '1.8'
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: 1.8.2
|
219
|
+
type: :runtime
|
220
|
+
prerelease: false
|
221
|
+
version_requirements: !ruby/object:Gem::Requirement
|
222
|
+
requirements:
|
223
|
+
- - "~>"
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
version: '1.8'
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: 1.8.2
|
229
|
+
- !ruby/object:Gem::Dependency
|
230
|
+
name: bundler
|
231
|
+
requirement: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - "~>"
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: '1.15'
|
236
|
+
type: :runtime
|
237
|
+
prerelease: false
|
238
|
+
version_requirements: !ruby/object:Gem::Requirement
|
239
|
+
requirements:
|
240
|
+
- - "~>"
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
version: '1.15'
|
243
|
+
- !ruby/object:Gem::Dependency
|
244
|
+
name: rake
|
245
|
+
requirement: !ruby/object:Gem::Requirement
|
246
|
+
requirements:
|
247
|
+
- - "~>"
|
248
|
+
- !ruby/object:Gem::Version
|
249
|
+
version: '10.0'
|
250
|
+
type: :runtime
|
251
|
+
prerelease: false
|
252
|
+
version_requirements: !ruby/object:Gem::Requirement
|
253
|
+
requirements:
|
254
|
+
- - "~>"
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
version: '10.0'
|
257
|
+
- !ruby/object:Gem::Dependency
|
258
|
+
name: rack-app
|
259
|
+
requirement: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - "~>"
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: '7.5'
|
264
|
+
type: :runtime
|
265
|
+
prerelease: false
|
266
|
+
version_requirements: !ruby/object:Gem::Requirement
|
267
|
+
requirements:
|
268
|
+
- - "~>"
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: '7.5'
|
271
|
+
- !ruby/object:Gem::Dependency
|
272
|
+
name: passenger
|
273
|
+
requirement: !ruby/object:Gem::Requirement
|
274
|
+
requirements:
|
275
|
+
- - "~>"
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: '5.3'
|
278
|
+
type: :runtime
|
279
|
+
prerelease: false
|
280
|
+
version_requirements: !ruby/object:Gem::Requirement
|
281
|
+
requirements:
|
282
|
+
- - "~>"
|
283
|
+
- !ruby/object:Gem::Version
|
284
|
+
version: '5.3'
|
115
285
|
description: Surikat is a web framework that revolves around GraphQL, offering a lot
|
116
286
|
of ready-made functionality such as CRUD operations, automatic query generation,
|
117
287
|
authentication and performance optimisations.
|