jimmy 0.4.4 → 0.4.5
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 +4 -4
- data/lib/jimmy/domain.rb +4 -4
- data/lib/jimmy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f652069943cf8ded7610304ef3053d0260c3fdf8
|
4
|
+
data.tar.gz: fa7c2a51e59cf67867ece774924d5bb0b7a81553
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8565852915935b93e0b184457e54b4f50257fb9dab2e615ad0a8ec582497bf3332a9df977b46dedca74c050c84bb4d2950a3d10b8314428d59eccbf7f7a9c7a
|
7
|
+
data.tar.gz: 7b95a43c73126cb6cf7a749b566f56108b7487931b74e7674e3629ac2ceef954c050ec3126262b843cc579b67a66909fb07706d5c6bd3aa55053bd55a865ca0e
|
data/lib/jimmy/domain.rb
CHANGED
@@ -58,12 +58,12 @@ module Jimmy
|
|
58
58
|
@schemas[schema_name.to_s]
|
59
59
|
end
|
60
60
|
|
61
|
-
def export(path = nil)
|
61
|
+
def export(path = nil, &serializer)
|
62
62
|
path = Pathname(path) if path.is_a? String
|
63
63
|
raise 'Please specify an export directory' unless path.is_a?(Pathname) && (path.directory? || !path.exist?)
|
64
64
|
path.mkpath
|
65
|
-
@schemas.each { |name, schema| export_schema schema, path +
|
66
|
-
@types.each { |name, schema| export_schema schema, path + 'types' + "#{name.to_s}.json" }
|
65
|
+
@schemas.each { |name, schema| export_schema schema, path + "#{name.to_s}.json", &serializer }
|
66
|
+
@types.each { |name, schema| export_schema schema, path + 'types' + "#{name.to_s}.json", &serializer }
|
67
67
|
end
|
68
68
|
|
69
69
|
def uri_for(name)
|
@@ -98,7 +98,7 @@ module Jimmy
|
|
98
98
|
|
99
99
|
def export_schema(schema, target_path)
|
100
100
|
target_path.parent.mkpath
|
101
|
-
target_path.write JSON.pretty_generate(schema.to_h)
|
101
|
+
target_path.write block_given? ? yield(schema.to_h) : JSON.pretty_generate(schema.to_h)
|
102
102
|
end
|
103
103
|
|
104
104
|
SchemaCreation.apply_to self
|
data/lib/jimmy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jimmy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil E. Pearson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|