wsdl_validator 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e61229620248d68120457e216e9bf637a668f173
4
- data.tar.gz: 11248c53b4e99f0b9390738e19713f15b69716e7
3
+ metadata.gz: 9961bec661ee4694a60380405b01bde5eda2a839
4
+ data.tar.gz: b1a9280dc26806fd4c2fd5e313679f7959dcf696
5
5
  SHA512:
6
- metadata.gz: eddd3f7e6bd2c42e26fb448bcad7b22d71fd8aafcc731d7b564e9f158cfb4fee3940b7b972685f5f91a96fc85f6f38ff9251cc6e9a54d703407679d58e2ff06a
7
- data.tar.gz: 2514dd49a99e037ad0eceb47bd0edfb9f0c94e647809d9f30b172fe9de33e2a83f872ad4eb0106b32712a8dae217572d7e5f62bd1c4df008b38e604079595b56
6
+ metadata.gz: de6d8ae3431d9ef649f547b06d53dcf24afddb76fd19ea343ca62609dec9cecbf20f6fc5b400b41b90b0560ea85c1dbb8abce31cbbf78abf95c67ba61d4a6d1d
7
+ data.tar.gz: 4e2aecefd02a9edb07fe135280764a8bba6603450cdc9da5bdce1a694b05013649c5d1a16d6f980f1cc6bb35b779ce9a63409fb0266d31206fec4a6f0c5c026e
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A simple gem to aid with validator a SOAP message according to a WSDL.
4
4
 
5
- [![Build Status](https://gitlab.com/samuel-garratt/wsdl_validator/badges/master/build.svg)](https://gitlab.com/samuel-garratt/soaspec/pipelines)
5
+ [![Build Status](https://gitlab.com/samuel-garratt/wsdl_validator/badges/master/build.svg)](https://gitlab.com/samuel-garratt/wsdl_validator/pipelines)
6
6
 
7
7
  This is a work in progress
8
8
 
@@ -31,7 +31,6 @@ wsdl.valid? xml_message
31
31
  => Returns true or false
32
32
 
33
33
  # TODO
34
- * Exception returned for invalid xsd
35
34
  * Look up schemas that need to be imported
36
35
  * Basic authentication for reading schemas
37
36
 
@@ -0,0 +1,8 @@
1
+ class WsdlValidator
2
+ # Raised to represent an error occurred when parsing an WSDL
3
+ class Error < StandardError
4
+ def initialize(msg = 'Invalid Wsdl')
5
+ super
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  class WsdlValidator
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
@@ -1,3 +1,5 @@
1
+ require_relative 'error'
2
+
1
3
  # Helps to validate xml against schemas contained in a WSDL
2
4
  class WsdlValidator
3
5
  # @param [String] wsdl_url URL to where WSDL is stored
@@ -25,8 +27,8 @@ class WsdlValidator
25
27
  xml_under_test = extract_root_from_soap(soap_envelope) if soap_envelope
26
28
  xsd = Nokogiri::XML::Schema(@schemas)
27
29
  validator = xsd.validate(xml_under_test)
28
- validator.each { |error| puts error.message }
29
- return false unless validator.empty?
30
+ # validator.each { |error| puts error.message }
31
+ raise WsdlValidator::Error, validator.join unless validator.empty?
30
32
  true
31
33
  end
32
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wsdl_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Garratt
@@ -117,8 +117,6 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
119
  - ".gitlab-ci.yml"
120
- - ".idea/markdown-navigator/profiles_settings.xml"
121
- - ".idea/modules.xml"
122
120
  - ".rspec"
123
121
  - CODE_OF_CONDUCT.md
124
122
  - Gemfile
@@ -128,6 +126,7 @@ files:
128
126
  - bin/console
129
127
  - bin/setup
130
128
  - lib/wsdl_validator.rb
129
+ - lib/wsdl_validator/error.rb
131
130
  - lib/wsdl_validator/version.rb
132
131
  - lib/wsdl_validator/wsdl_validator.rb
133
132
  - wsdl_validator.gemspec
@@ -1,3 +0,0 @@
1
- <component name="MarkdownNavigator.ProfileManager">
2
- <settings default="" pdf-export="" />
3
- </component>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/wsdl_validator.iml" filepath="$PROJECT_DIR$/.idea/wsdl_validator.iml" />
6
- </modules>
7
- </component>
8
- </project>