lacerda 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +3 -0
- data/circle.yml +3 -0
- data/lib/lacerda/conversion.rb +12 -6
- data/lib/lacerda/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 322ae1cf280fd1575b67fb9423525245e657b987
|
4
|
+
data.tar.gz: ab9416b4d1a10d2bef1187ae58b9284f753ecde0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c385fe049be72afa341b67ce03b41dea4fb7cc128b0f25827227b4ca56a8927ffa2c054ebd152016e3da10ef485b2aabcfc13074ab9b44320f0a0bae42ddd7
|
7
|
+
data.tar.gz: ddb0ae87136af9aa1e12e444927474cfede888b9866c9e6eb85bbb4dc007e5d957f08cc3abde2497e1c8cef908f7653ce8970fa482962ce0449739440c65f61b
|
data/CHANGELOG.markdown
CHANGED
data/circle.yml
ADDED
data/lib/lacerda/conversion.rb
CHANGED
@@ -3,21 +3,27 @@ require 'open3'
|
|
3
3
|
require 'lacerda/conversion/apiary_to_json_schema'
|
4
4
|
require 'lacerda/conversion/error'
|
5
5
|
require 'redsnow'
|
6
|
+
require 'colorize'
|
6
7
|
|
7
8
|
module Lacerda
|
8
9
|
module Conversion
|
9
|
-
def self.mson_to_json_schema(
|
10
|
+
def self.mson_to_json_schema(options)
|
11
|
+
filename = options.fetch(:filename)
|
10
12
|
begin
|
11
|
-
mson_to_json_schema!(
|
12
|
-
|
13
|
+
mson_to_json_schema!(
|
14
|
+
filename: filename,
|
15
|
+
keep_intermediary_files: options.fetch(:keep_intermediary_files, false)
|
16
|
+
)
|
17
|
+
puts "OK ".green + filename if options.fetch(:verbose, true)
|
13
18
|
true
|
14
19
|
rescue
|
15
|
-
puts "ERROR ".red + filename if verbose
|
20
|
+
puts "ERROR ".red + filename if options.fetch(:verbose, true)
|
16
21
|
false
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
20
|
-
def self.mson_to_json_schema!(
|
25
|
+
def self.mson_to_json_schema!(options)
|
26
|
+
filename = options.fetch(:filename)
|
21
27
|
|
22
28
|
# For now, we'll use the containing directory's name as a scope
|
23
29
|
service_scope = File.dirname(filename).split(File::SEPARATOR).last.underscore
|
@@ -95,7 +101,7 @@ module Lacerda
|
|
95
101
|
File.open(outfile, 'w'){ |f| f.puts JSON.pretty_generate(schema) }
|
96
102
|
|
97
103
|
# Clean up
|
98
|
-
FileUtils.rm_f(ast_file) unless keep_intermediary_files
|
104
|
+
FileUtils.rm_f(ast_file) unless options.fetch(:keep_intermediary_files, false)
|
99
105
|
true
|
100
106
|
end
|
101
107
|
|
data/lib/lacerda/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lacerda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jannis Hermanns
|
@@ -209,6 +209,7 @@ files:
|
|
209
209
|
- Guardfile
|
210
210
|
- README.md
|
211
211
|
- Rakefile
|
212
|
+
- circle.yml
|
212
213
|
- lacerda.gemspec
|
213
214
|
- lib/lacerda.rb
|
214
215
|
- lib/lacerda/compare/json_schema.rb
|