wsdl_validator 0.1.0 → 0.1.1

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: 3a3ec5420b60241a3a89a013ef5ffa5d274b0d02
4
- data.tar.gz: c93389a3b17fbaec16b63b31c13bad7b7713e428
3
+ metadata.gz: 4fce125f29936513df4aef2ecc504d0386bedb78
4
+ data.tar.gz: 8b482814d8c1f22c2ba4169619ac3c41aa4556db
5
5
  SHA512:
6
- metadata.gz: a28250becefdeaa1c4e1206aafdebdd3dc1b4bf276402d5377b7a2592d2960cc0470bcbf727a118052176a330b4d155ff6d9d59774599dd7143607870b16a01b
7
- data.tar.gz: e11fba09313ddeb9fc82fd77a65b5939caaad20bd635fd0e54f258d30784d9c6fd0d08f7d7f702802d82ae6068577f1b7f81ac77fc661f396632c863ce965632
6
+ metadata.gz: 3b5324da1ab553af1853eaa330632f0a906010688010082c17985a33e2e627d13c97abe26970a8ec0fecaf5f1776098acf3d171fe16f2bbf06e8b386d2c0e302
7
+ data.tar.gz: ccafaf8061ee57ed137094e9e625e6e45a2985534c761b7196aebdc11db17fd91f69d318dc36a3176eb6537680311431784c3ec50865ce3502d7f511d09cfbba
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,27 @@
1
+ before_script:
2
+ - apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs
3
+ - ruby -v
4
+ - which ruby
5
+ - gem install bundler rake --no-ri --no-rdoc
6
+ - bundle install --jobs $(nproc) "${FLAGS[@]}"
7
+
8
+ rspec:
9
+ stage: test
10
+ script:
11
+ - bundle exec rake spec
12
+ artifacts:
13
+ paths:
14
+ - coverage/
15
+
16
+ pages:
17
+ stage: deploy
18
+ dependencies:
19
+ - rspec
20
+ script:
21
+ - mv coverage/ public/
22
+ artifacts:
23
+ paths:
24
+ - public
25
+ expire_in: 30 days
26
+ only:
27
+ - master
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # WsdlValidator
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/wsdl_validator`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ A simple gem to aid with validator a SOAP message according to a WSDL.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ [![Build Status](https://gitlab.com/samuel-garratt/wsdl_validator/badges/master/build.svg)](https://gitlab.com/samuel-garratt/soaspec/pipelines)
6
+
7
+ This is a work in progress
6
8
 
7
9
  ## Installation
8
10
 
@@ -22,7 +24,11 @@ Or install it yourself as:
22
24
 
23
25
  ## Usage
24
26
 
25
- TODO: Write usage instructions here
27
+ ```ruby
28
+ wsdl = WsdlValidator.new('http://localhost:3333/single_schema?wsdl')
29
+ wsdl.valid? xml_message
30
+ ```
31
+ => Returns true or false
26
32
 
27
33
  ## Development
28
34
 
@@ -32,7 +38,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
38
 
33
39
  ## Contributing
34
40
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/wsdl_validator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
41
+ Bug reports and pull requests are welcome on GitHub at https://gitlab.com/samuel-garratt/wsdl_validator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
42
 
37
43
  ## License
38
44
 
@@ -1,3 +1,3 @@
1
1
  class WsdlValidator
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -1,16 +1,15 @@
1
1
  class WsdlValidator
2
2
  def initialize(wsdl_url)
3
- @doc = Wasabi.document wsdl_url # File.read(File.join('spec', 'single_schema.wsdl'))
3
+ @doc = Wasabi.document wsdl_url
4
4
  end
5
5
 
6
6
  def valid?(xml_string)
7
- schemas = @doc.parser.schemas
8
- schemas.each do |schema|
9
- xsd = Nokogiri::XML::Schema(schema.to_s)
10
- validator = xsd.validate(xml_string)
11
- validator.each { |error| puts error.message }
12
- return false unless validator.empty?
13
- end
7
+ schemas = @doc.parser.schemas.collect(&:to_s).join
8
+ xml = Nokogiri::XML(xml_string)
9
+ xsd = Nokogiri::XML::Schema(schemas)
10
+ validator = xsd.validate(xml)
11
+ validator.each { |error| puts error.message }
12
+ return false unless validator.empty?
14
13
  true
15
14
  end
16
15
  end
@@ -22,10 +22,12 @@ Gem::Specification.new do |spec|
22
22
  spec.bindir = 'exe'
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
+ spec.add_dependency 'nokogiri'
25
26
  spec.add_dependency 'wasabi'
26
27
 
27
28
  spec.add_development_dependency 'bundler', '~> 1.16'
28
29
  spec.add_development_dependency 'rake', '~> 10.0'
29
30
  spec.add_development_dependency 'rspec', '~> 3.0'
31
+ spec.add_development_dependency 'simplecov'
30
32
  spec.add_development_dependency 'sinatra'
31
33
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wsdl_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Garratt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-20 00:00:00.000000000 Z
11
+ date: 2018-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nokogiri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: wasabi
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: sinatra
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +116,7 @@ extensions: []
88
116
  extra_rdoc_files: []
89
117
  files:
90
118
  - ".gitignore"
119
+ - ".gitlab-ci.yml"
91
120
  - ".idea/markdown-navigator/profiles_settings.xml"
92
121
  - ".idea/modules.xml"
93
122
  - ".rspec"