nose 0.1.0pre2 → 0.1.0pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nose/serialize.rb +11 -0
- metadata +22 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5d876fa7ea09cd84c7165f6f867c0d822f46f7a
|
4
|
+
data.tar.gz: 4eb66bcdca8928d7dba3a73471f338b9de7ee20e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78cdb08aefc50f84dead0fc9d9908f10fa3257877e1ee4f9d4e401c121cd015fbc02b9ce53ecc33fbc3e5c7280ffc254d3eb7e70d343242ecb8381e0285bf398
|
7
|
+
data.tar.gz: e6254fc691d4b32d79f0937aecdc0992cb1d6e18d3b74e33d8c79c03308fa672782fcd2207febc3336ae88e0f6e481dae31a6b47fa3c69b535e1bd4fafeb9c48
|
data/lib/nose/serialize.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'json-schema'
|
3
4
|
require 'representable'
|
4
5
|
require 'representable/json'
|
5
6
|
require 'representable/yaml'
|
@@ -21,6 +22,16 @@ end
|
|
21
22
|
module NoSE
|
22
23
|
# Serialization of workloads and statement execution plans
|
23
24
|
module Serialize
|
25
|
+
# Validate a string of JSON based on the schema
|
26
|
+
def validate_json(json)
|
27
|
+
schema_file = File.join File.dirname(__FILE__), '..', '..',
|
28
|
+
'data', 'nose', 'nose-schema.json'
|
29
|
+
schema = JSON.parse File.read(schema_file)
|
30
|
+
|
31
|
+
data = JSON.parse json
|
32
|
+
JSON::Validator.validate(schema, data)
|
33
|
+
end
|
34
|
+
|
24
35
|
# Construct a field from a parsed hash
|
25
36
|
class FieldBuilder
|
26
37
|
include Uber::Callable
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.0pre3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Mior
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faker
|
@@ -44,6 +44,26 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 0.2.5
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: json-schema
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.7.0
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 2.7.0
|
57
|
+
type: :runtime
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 2.7.0
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 2.7.0
|
47
67
|
- !ruby/object:Gem::Dependency
|
48
68
|
name: logging
|
49
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -334,26 +354,6 @@ dependencies:
|
|
334
354
|
- - "~>"
|
335
355
|
- !ruby/object:Gem::Version
|
336
356
|
version: 0.10.0
|
337
|
-
- !ruby/object:Gem::Dependency
|
338
|
-
name: json-schema
|
339
|
-
requirement: !ruby/object:Gem::Requirement
|
340
|
-
requirements:
|
341
|
-
- - "~>"
|
342
|
-
- !ruby/object:Gem::Version
|
343
|
-
version: 2.7.0
|
344
|
-
- - ">="
|
345
|
-
- !ruby/object:Gem::Version
|
346
|
-
version: 2.7.0
|
347
|
-
type: :development
|
348
|
-
prerelease: false
|
349
|
-
version_requirements: !ruby/object:Gem::Requirement
|
350
|
-
requirements:
|
351
|
-
- - "~>"
|
352
|
-
- !ruby/object:Gem::Version
|
353
|
-
version: 2.7.0
|
354
|
-
- - ">="
|
355
|
-
- !ruby/object:Gem::Version
|
356
|
-
version: 2.7.0
|
357
357
|
- !ruby/object:Gem::Dependency
|
358
358
|
name: memory_profiler
|
359
359
|
requirement: !ruby/object:Gem::Requirement
|