soaspec 0.0.13 → 0.0.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eeb96e8acb8549f09c9b3b11592a6d1642c0ce16
4
- data.tar.gz: caee64c3c1c13dc5853c909aae35f4916ebe99ca
3
+ metadata.gz: 6202f11ed3bac43b110dbf5069cad49325550bf6
4
+ data.tar.gz: 417b06d2b9ae9ac557e0e0b3e225bb7113aa3816
5
5
  SHA512:
6
- metadata.gz: a110b3ac2c135c9d8d72fe11feffe991394242c95de3f32f59396d1bb8b50789e6c8d52fb158b3142d1a91c5320705c494a81a80b82da11383abd99b0d252465
7
- data.tar.gz: 7a411ac7056a140ed6287184a07d4c43851256cfe71039ce08c65517b2bdfeb3b03b156c302dc29b4c56986fd5e3f2783f4e1cfbf7bb00ac9ec59b13125be7f3
6
+ metadata.gz: 630bdfc3d10e149b8923b22263614004896dab904b10cf12cef923cc2d717ade508fea859d8775b0c4e40dd7c138e0565b552197f3329ca2e49347ee3e0dc4e2
7
+ data.tar.gz: 7bcccfe2739045f4cfcaccb021786299be0c780b59f36e5d6ad09a47d5503c0a692c285feb6badb974216ef017717ced9e8ce31a74d54544492ceea9148f0a89
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Version 0.0.14 / 2018-1-23
2
+ * Fixes
3
+ * Updated 'xml_to_yaml_file' exe to clean up YAML more. No more array for Hash value. Indenting needs work though.
4
+ Now it's more like something you can read and pass into Savon request.
5
+
1
6
  Version 0.0.13 / 2018-1-23
2
7
  * Enhancements
3
8
  * Executable to create xml file from yaml
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soaspec (0.0.12)
4
+ soaspec (0.0.13)
5
5
  rest-client (>= 2.0)
6
6
  rspec (~> 3.0)
7
7
  rspec-its (>= 1.2.0)
@@ -46,11 +46,19 @@ def convert_hash_keys(value)
46
46
  end
47
47
  end
48
48
 
49
+ # Remove arrays created as another string
50
+ def clean_up_yaml(yaml_string)
51
+ yaml_string = yaml_string.gsub(/\R+(\s*)-/, '').gsub(/{}/, "''") # Remove arrays, {} -> ''
52
+ # Insert new line where there are 2 ':' on 1 line. Issue from first gsub
53
+ yaml_string.gsub(/:(\s)(\w*):/){|s| s.insert(1, "\n")}
54
+ end
55
+
49
56
  if ARGV[0]
50
57
  warn "Using '#{default_output_file}' as default output file since no 2nd argument passed" unless ARGV[1]
51
58
  hash = XmlSimple.xml_in(ARGV[0])
52
59
  converted = convert_hash_keys hash
53
- create_file(filename: ARGV[1] || default_output_file, content: converted.to_yaml)
60
+ yaml_file = clean_up_yaml(converted.to_yaml)
61
+ create_file(filename: ARGV[1] || default_output_file, content: yaml_file)
54
62
  else
55
63
  puts 'usage: xml_to_yaml_file [input.xml] [output.yml] '
56
64
  end
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.13'
2
+ VERSION = '0.0.14'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soaspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA