json_world 0.2.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +10 -0
- data/Gemfile +3 -0
- data/json_world.gemspec +0 -3
- data/lib/json_world/dsl.rb +4 -4
- data/lib/json_world/property_definition.rb +6 -4
- data/lib/json_world/version.rb +1 -1
- metadata +7 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a60728ee88d0ed4bb5b0a3d6a0e4eb1c3db9a6ddde0ed4d0274d9a69493c1336
|
4
|
+
data.tar.gz: ce4db51b613cfdea0491c597a4a69e8d33d04e9e32e52c3621188206be607ed7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16e9c12e1e0a13775ef90daf8cbb0021a2f4e3e2459cc0a76250ce4b0927e3ab23948f89b11e1e08e3467e6b80b7f589937a40c0043da3cb9a32c265e4491482
|
7
|
+
data.tar.gz: 228c00fb45aae14408bab73c4401c0819bb0515b51356821dc1966edac11f83fc68ae36da4e85a254fdec15b964fcbc23db31b3ee82f093dfe0d123e8906b97a
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/json_world.gemspec
CHANGED
@@ -15,7 +15,4 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.require_paths = ["lib"]
|
16
16
|
|
17
17
|
spec.add_dependency "activesupport"
|
18
|
-
spec.add_development_dependency "bundler", "~> 1.9"
|
19
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
20
|
-
spec.add_development_dependency "rspec", "3.2.0"
|
21
18
|
end
|
data/lib/json_world/dsl.rb
CHANGED
@@ -52,9 +52,9 @@ module JsonWorld
|
|
52
52
|
# @param [Hash{Symbol => Object}] options
|
53
53
|
def link(link_name, options = {})
|
54
54
|
link_definitions << JsonWorld::LinkDefinition.new(
|
55
|
-
|
55
|
+
link_name: link_name,
|
56
|
+
**options.merge(
|
56
57
|
parent: self,
|
57
|
-
link_name: link_name,
|
58
58
|
),
|
59
59
|
)
|
60
60
|
end
|
@@ -68,9 +68,9 @@ module JsonWorld
|
|
68
68
|
# @param [Hash{Symbol => Object}] options
|
69
69
|
def property(property_name, options = {})
|
70
70
|
property_definitions << JsonWorld::PropertyDefinition.new(
|
71
|
-
|
71
|
+
property_name: property_name,
|
72
|
+
**options.merge(
|
72
73
|
parent: self,
|
73
|
-
property_name: property_name,
|
74
74
|
)
|
75
75
|
)
|
76
76
|
end
|
@@ -2,6 +2,9 @@ require "active_support/core_ext/object/try"
|
|
2
2
|
|
3
3
|
module JsonWorld
|
4
4
|
class PropertyDefinition
|
5
|
+
# @return [Hash{Symbol => Object}]
|
6
|
+
attr_reader :options
|
7
|
+
|
5
8
|
# @return [Symbol]
|
6
9
|
attr_reader :property_name
|
7
10
|
|
@@ -83,7 +86,7 @@ module JsonWorld
|
|
83
86
|
# @return [Array<Hash>, nil]
|
84
87
|
def items_as_json_schema
|
85
88
|
if @options[:items]
|
86
|
-
JsonWorld::PropertyDefinition.new(
|
89
|
+
JsonWorld::PropertyDefinition.new(**@options[:items]).as_json_schema
|
87
90
|
end
|
88
91
|
end
|
89
92
|
|
@@ -112,9 +115,8 @@ module JsonWorld
|
|
112
115
|
if @options[:properties]
|
113
116
|
@options[:properties].map do |property_name, options|
|
114
117
|
JsonWorld::PropertyDefinition.new(
|
115
|
-
|
116
|
-
|
117
|
-
)
|
118
|
+
property_name: property_name,
|
119
|
+
**options
|
118
120
|
)
|
119
121
|
end
|
120
122
|
end
|
data/lib/json_world/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_world
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,49 +24,7 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.9'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.9'
|
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.2.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.2.0
|
69
|
-
description:
|
27
|
+
description:
|
70
28
|
email:
|
71
29
|
- r7kamura@gmail.com
|
72
30
|
executables: []
|
@@ -92,7 +50,7 @@ homepage: https://github.com/r7kamura/json_world
|
|
92
50
|
licenses:
|
93
51
|
- MIT
|
94
52
|
metadata: {}
|
95
|
-
post_install_message:
|
53
|
+
post_install_message:
|
96
54
|
rdoc_options: []
|
97
55
|
require_paths:
|
98
56
|
- lib
|
@@ -107,9 +65,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
65
|
- !ruby/object:Gem::Version
|
108
66
|
version: '0'
|
109
67
|
requirements: []
|
110
|
-
|
111
|
-
|
112
|
-
signing_key:
|
68
|
+
rubygems_version: 3.3.7
|
69
|
+
signing_key:
|
113
70
|
specification_version: 4
|
114
71
|
summary: Provides DSL to define JSON Schema representation of your class.
|
115
72
|
test_files: []
|