xml_errors_parser 0.0.1
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 +15 -0
- data/.cane +3 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/Fudgefile +31 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +80 -0
- data/Rakefile +1 -0
- data/config/locales/en.yml +6 -0
- data/fudge_settings.yml +5 -0
- data/lib/xml_errors_parser.rb +8 -0
- data/lib/xml_errors_parser/error_message_builder.rb +24 -0
- data/lib/xml_errors_parser/errors_regex.rb +23 -0
- data/lib/xml_errors_parser/parser.rb +44 -0
- data/lib/xml_errors_parser/version.rb +4 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/xml_errors_parser/error_message_builder_spec.rb +47 -0
- data/spec/xml_errors_parser/errors_regex_spec.rb +50 -0
- data/spec/xml_errors_parser/parser_spec.rb +31 -0
- data/xml_errors_parser.gemspec +35 -0
- metadata +238 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MjM1NTYwY2Y5ZjUyYzBkY2VmYjhiYjc1NTE0MjUwNDk0Zjk1Y2MxMQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NTdmZjM1ZTZkNjM5YTQ4MWM4NmNhMzE4ZjNmOWQ3YmUwNjY1M2QxNw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YmI2NmNjN2JlZmE4MTBkY2Y0NThmODUyMWFkNWU4NWQ5ZjU1NWVkNWEwMjRk
|
10
|
+
NzZlZDVhNTkzNDE2MDY5ODUzNDI2YTQ1MTRiMzhlNTBiMjAwZDRmZTdkYmQw
|
11
|
+
NTZmNWEyNmMzMjNkMDUxODNhZDgyOGUyMzA2ZDYxZjFlMGVmMzE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjlmMDY4OTgwYzBhNTMwNDA1MzgxOTMzZDFhMWU1ODdkMDRhYjcyODAxN2Q0
|
14
|
+
MGY2NjU3ZGM5ZDI2ZDUzMDY4NGEyZWQ0NDI4NjE4Zjg5NGY2NzA2MzQ4ZmU5
|
15
|
+
YTllODk5OTI4ZmQ5OGQzYjZhNzZjNjc3NjA1NDI4NDQzN2YzMDg=
|
data/.cane
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/Fudgefile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
exclude = '^\.\/(spec)\/'
|
2
|
+
|
3
|
+
task_group :quality_assurance do
|
4
|
+
yard 'stats --list-undoc', :coverage => 100
|
5
|
+
cane :max_width => 140
|
6
|
+
task :flay, :exclude => exclude
|
7
|
+
task :flog, :exclude => exclude, :methods => true
|
8
|
+
end
|
9
|
+
|
10
|
+
task_group :setup_env do
|
11
|
+
clean_bundler_env do
|
12
|
+
shell 'bundle install'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
task_group :rspec do
|
17
|
+
clean_bundler_env do
|
18
|
+
rspec :coverage => 100
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
build :default do
|
23
|
+
task_group :quality_assurance
|
24
|
+
task_group :setup_env
|
25
|
+
task_group :rspec
|
26
|
+
end
|
27
|
+
|
28
|
+
build :specs do
|
29
|
+
task_group :setup_env
|
30
|
+
task_group :rspec
|
31
|
+
end
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Victor D. G. Martins
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# XmlErrorsParser
|
2
|
+
|
3
|
+
When validating XML using a XSD, we get error messages that are not very friendly, for example:
|
4
|
+
|
5
|
+
`Element '{http://www.portalfiscal.inf.br/nfe}infNFe': The attribute 'Id' is required but missing.`
|
6
|
+
|
7
|
+
What this gem does, is that it processes those errors and enable us to use the I18n gem to internationalize them.
|
8
|
+
That way the client/customer can ask/see the error messages in any way they want.
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
gem 'xml_errors_parser'
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install xml_errors_parser
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
### Parsing Errors
|
27
|
+
Imagine that in your application you are using nokogiri to validate the XML:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
schema = Nokogiri::XML::Schema(xsd_string).xsd
|
31
|
+
errors = schema.validate(some_xml) # this will return the original errors
|
32
|
+
```
|
33
|
+
|
34
|
+
Now we can parse them like this:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
pretty_errors = XmlErrorsParser::Parser.new(errors).errors
|
38
|
+
```
|
39
|
+
|
40
|
+
```pretty_errors``` will be an array of errors that can be sent to the flash or to any html page to be presented.
|
41
|
+
|
42
|
+
### Adding new errors to the Gem
|
43
|
+
Not all errors are covered (there are many many possible errors). But the gem makes it pretty easy to add more cases.
|
44
|
+
Please contribute if you do some :)
|
45
|
+
If the Gem receives an error that it does not known, it will output a message with the error code and the original error
|
46
|
+
message. We can use this information to add new errors.
|
47
|
+
|
48
|
+
**To add more errors we do this:**
|
49
|
+
|
50
|
+
1. Edit the /spec/xml_errors_parser/errors_regex_spec.rb and add a new test. Use the code of the error on the
|
51
|
+
description. Then expect to find the tokens that the error provides. For example, the element name.
|
52
|
+
|
53
|
+
2. To make the test pass, edit the file `lib/xml_errors_parser/errors_regex.rb` so that the error code matches a
|
54
|
+
regular expression. Use regular expressions that return tokens, using the `?<token_name>`. Try this until the test passes.
|
55
|
+
|
56
|
+
3. Create a new test here: `spec/xml_errors_parser/error_message_builder_spec.rb`. These test makes sure that if the
|
57
|
+
tokens exist, the right message will be created. Just follow one of the examples.
|
58
|
+
|
59
|
+
4. To make the test pass just add the new error message in: `/config/locales/en.yml`
|
60
|
+
|
61
|
+
5. In the end **always** run `bundle exec fudge build` to validate the build before doing a pull request. This will check
|
62
|
+
specs, code coverage, documentation and code style.
|
63
|
+
|
64
|
+
```
|
65
|
+
en:
|
66
|
+
xsd_errors:
|
67
|
+
'unkown': '[%{error_code}] %{error_msg}.'
|
68
|
+
'1840': 'The Element "%{element}" has the Value "%{value}" but it is not one from the Set: "%{set}".'
|
69
|
+
'1845': 'The Element "%{element}" has no matching global declaration available for the validation root.'
|
70
|
+
'1868': 'The Attribute "%{attribute}" of the Element "%{element}" is mandatory.'
|
71
|
+
```
|
72
|
+
|
73
|
+
## Contributing
|
74
|
+
|
75
|
+
1. Fork it
|
76
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
77
|
+
3. Run `bundle exec fudge build` to see if the build passes
|
78
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
79
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
80
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,6 @@
|
|
1
|
+
en:
|
2
|
+
xsd_errors:
|
3
|
+
'unkown': '[%{error_code}] %{error_msg}.'
|
4
|
+
'1840': 'The Element "%{element}" has the Value "%{value}" but it is not one from the Set: "%{set}".'
|
5
|
+
'1845': 'The Element "%{element}" has no matching global declaration available for the validation root.'
|
6
|
+
'1868': 'The Attribute "%{attribute}" of the Element "%{element}" is mandatory.'
|
data/fudge_settings.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
module XmlErrorsParser
|
2
|
+
require 'I18n'
|
3
|
+
# This class will take the error code and the error tokens and translate them
|
4
|
+
# to a classic I18n message
|
5
|
+
class ErrorMessageBuilder
|
6
|
+
|
7
|
+
# Gets a code and tokens and builds the error message
|
8
|
+
def self.build_message_for code, tokens
|
9
|
+
self.new(code, tokens).build
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize code, tokens
|
13
|
+
@tokens = tokens
|
14
|
+
@code = code
|
15
|
+
end
|
16
|
+
|
17
|
+
# Build error message
|
18
|
+
def build
|
19
|
+
key = "xsd_errors.#{@code}"
|
20
|
+
I18n.t(key, @tokens.merge(default: :'xsd_errors.unkown', error_code: @code))
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module XmlErrorsParser
|
2
|
+
# Module that aggregates the errors regular expressions
|
3
|
+
module ErrorsRegex
|
4
|
+
|
5
|
+
# Regular expressions for each error code
|
6
|
+
ERRORS_REGEX = {
|
7
|
+
'1840' => /(}(?<element>.*?)').*(value.'(?<value>.*)').is.not .*((?<set>{.*}))/,
|
8
|
+
'1845' => /}(?<element>.*?)'/,
|
9
|
+
'1868' => /(}(?<element>.*?)').*(attribute.'(?<attribute>.*)')/
|
10
|
+
}
|
11
|
+
|
12
|
+
# Given a xsd error code returns the respective regular expression.
|
13
|
+
# If the code is unkown, then returns a generic regex
|
14
|
+
def self.find_expression_from_code error_code
|
15
|
+
ERRORS_REGEX[error_code.to_s] || default_error_expression
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
def self.default_error_expression
|
20
|
+
/(?<error_msg>.*)/
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module XmlErrorsParser
|
2
|
+
# This class receives the nokogiri errors and outputs human friendly errors
|
3
|
+
class Parser
|
4
|
+
attr_reader :errors
|
5
|
+
|
6
|
+
def initialize errors
|
7
|
+
@original_errors = errors
|
8
|
+
@errors = []
|
9
|
+
|
10
|
+
parse_errors
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def parse_errors
|
16
|
+
return if @original_errors.empty?
|
17
|
+
|
18
|
+
@original_errors.each do |error|
|
19
|
+
parse_error_msg error
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def parse_error_msg error
|
24
|
+
@message = error.message
|
25
|
+
@code = error.code
|
26
|
+
error_msg = ErrorMessageBuilder.build_message_for(@code, tokens)
|
27
|
+
@errors << error_msg
|
28
|
+
end
|
29
|
+
|
30
|
+
def tokens
|
31
|
+
regex = ErrorsRegex.find_expression_from_code(@code)
|
32
|
+
match_data = regex.match(@message)
|
33
|
+
process_match_data(match_data)
|
34
|
+
end
|
35
|
+
|
36
|
+
def process_match_data(match_data)
|
37
|
+
result = {}
|
38
|
+
match_data.names.each do |name|
|
39
|
+
result[name.to_sym] = match_data[name]
|
40
|
+
end
|
41
|
+
result
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'xml_errors_parser'
|
2
|
+
require 'pry'
|
3
|
+
require 'simplecov'
|
4
|
+
|
5
|
+
SimpleCov.start do
|
6
|
+
add_filter 'spec/'
|
7
|
+
end
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
11
|
+
config.run_all_when_everything_filtered = true
|
12
|
+
config.filter_run :focus
|
13
|
+
config.order = 'random'
|
14
|
+
|
15
|
+
I18n.default_locale = :en
|
16
|
+
I18n.enforce_available_locales = true
|
17
|
+
I18n.load_path = [File.expand_path('../../config/locales/en.yml', __FILE__)]
|
18
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe XmlErrorsParser::ErrorMessageBuilder do
|
4
|
+
describe 'message for code #1868' do
|
5
|
+
it 'should work' do
|
6
|
+
tokens = {
|
7
|
+
element: 'Foo',
|
8
|
+
attribute: 'Bar'
|
9
|
+
}
|
10
|
+
msg = described_class.build_message_for(get_code, tokens)
|
11
|
+
msg.should == 'The Attribute "Bar" of the Element "Foo" is mandatory.'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'message for code #1840' do
|
16
|
+
it 'should work' do
|
17
|
+
tokens = {
|
18
|
+
element: 'Foo',
|
19
|
+
value: '5',
|
20
|
+
set: "{'1','2','3'}"
|
21
|
+
}
|
22
|
+
msg = described_class.build_message_for(get_code, tokens)
|
23
|
+
msg.should == "The Element \"Foo\" has the Value \"5\" but it is not one from the Set: \"{'1','2','3'}\"."
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'message for code #1845' do
|
28
|
+
it 'should work' do
|
29
|
+
tokens = { element: 'XPTo' }
|
30
|
+
msg = described_class.build_message_for(get_code, tokens)
|
31
|
+
msg.should == 'The Element "XPTo" has no matching global declaration available for the validation root.'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'message for code #UNKNOWN' do
|
36
|
+
it 'should return the full message plus the code' do
|
37
|
+
tokens = { error_msg: 'full message'}
|
38
|
+
msg = described_class.build_message_for(get_code, tokens)
|
39
|
+
msg.should == '[UNKNOWN] full message.'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def get_code
|
44
|
+
desc = example.metadata[:example_group][:description_args].first
|
45
|
+
/#(?<code>.*)/.match(desc)[:code]
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe XmlErrorsParser::ErrorsRegex do
|
4
|
+
describe '#find_expression_from_code' do
|
5
|
+
|
6
|
+
let(:regex) { described_class.find_expression_from_code get_code }
|
7
|
+
|
8
|
+
describe 'unkown_code' do
|
9
|
+
it 'should return the original message and error code' do
|
10
|
+
msg = 'Crazy error message !"#$%&/%&/(/&%"'
|
11
|
+
mg = regex.match(msg)
|
12
|
+
mg[:error_msg].should == msg
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '1868' do
|
18
|
+
it 'should work' do
|
19
|
+
msg = "Element '{http://foo.com}infNFe': The attribute 'Id' is required but missing."
|
20
|
+
mg = regex.match(msg)
|
21
|
+
mg[:element].should == 'infNFe'
|
22
|
+
mg[:attribute].should == 'Id'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '1840' do
|
27
|
+
it 'should work' do
|
28
|
+
msg = "Element '{http://www.portalfiscal.inf.br/nfe}orig': [facet 'enumeration'] The value '5' is not an element\
|
29
|
+
of the set {'0', '1', '2'}."
|
30
|
+
mg = regex.match(msg)
|
31
|
+
mg[:element].should == 'orig'
|
32
|
+
mg[:value].should == '5'
|
33
|
+
mg[:set].should == "{'0', '1', '2'}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '1845' do
|
38
|
+
it 'should work' do
|
39
|
+
msg = "Element '{http://www.portalfiscal.inf.br/nfe}NFe': No matching global declaration available for the \
|
40
|
+
validation root."
|
41
|
+
mg = regex.match(msg)
|
42
|
+
mg[:element].should == 'NFe'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def get_code
|
48
|
+
example.metadata[:example_group][:description_args].first
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe XmlErrorsParser::Parser do
|
4
|
+
|
5
|
+
def error_1868_missing_attribute(element, attribute)
|
6
|
+
double :error, {
|
7
|
+
code: '1868',
|
8
|
+
message: "Element '{http://www.portalfiscal.inf.br/nfe}#{element}': The attribute '#{attribute}' is required but missing."
|
9
|
+
}
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should return no errors of no errors are sent' do
|
13
|
+
described_class.new([]).errors.should == []
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should parser missing attributes for elements' do
|
17
|
+
|
18
|
+
errors = [
|
19
|
+
error_1868_missing_attribute('infNFe', 'Id'),
|
20
|
+
error_1868_missing_attribute('Foo', 'Bar')
|
21
|
+
]
|
22
|
+
|
23
|
+
expected_errors = [
|
24
|
+
"The Attribute \"Id\" of the Element \"infNFe\" is mandatory.",
|
25
|
+
"The Attribute \"Bar\" of the Element \"Foo\" is mandatory.",
|
26
|
+
]
|
27
|
+
|
28
|
+
described_class.new(errors).errors.should == expected_errors
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'xml_errors_parser/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "xml_errors_parser"
|
8
|
+
spec.version = XmlErrorsParser::VERSION
|
9
|
+
spec.authors = ["Victor D. G. Martins"]
|
10
|
+
spec.email = ["correio@victormartins.com"]
|
11
|
+
spec.description = 'This makes possible to translate the XML errors generated by the schema using I18n'
|
12
|
+
spec.summary = 'Parser and humanizer of XML schema generated errors'
|
13
|
+
spec.homepage = "https://github.com/victormartins/xml_errors_parser"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
|
17
|
+
spec.files = `git ls-files`.split($/)
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency 'i18n'
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'fudge'
|
27
|
+
spec.add_development_dependency 'rspec'
|
28
|
+
spec.add_development_dependency 'flog'
|
29
|
+
spec.add_development_dependency 'flay'
|
30
|
+
spec.add_development_dependency 'cane'
|
31
|
+
spec.add_development_dependency 'yard'
|
32
|
+
spec.add_development_dependency 'redcarpet'
|
33
|
+
spec.add_development_dependency 'simplecov'
|
34
|
+
spec.add_development_dependency 'pry'
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,238 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xml_errors_parser
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Victor D. G. Martins
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: i18n
|
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'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: fudge
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: flog
|
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'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: flay
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: cane
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: yard
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ! '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: redcarpet
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ! '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: simplecov
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ! '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: pry
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ! '>='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
description: This makes possible to translate the XML errors generated by the schema
|
182
|
+
using I18n
|
183
|
+
email:
|
184
|
+
- correio@victormartins.com
|
185
|
+
executables: []
|
186
|
+
extensions: []
|
187
|
+
extra_rdoc_files: []
|
188
|
+
files:
|
189
|
+
- .cane
|
190
|
+
- .gitignore
|
191
|
+
- .rspec
|
192
|
+
- Fudgefile
|
193
|
+
- Gemfile
|
194
|
+
- LICENSE.txt
|
195
|
+
- README.md
|
196
|
+
- Rakefile
|
197
|
+
- config/locales/en.yml
|
198
|
+
- fudge_settings.yml
|
199
|
+
- lib/xml_errors_parser.rb
|
200
|
+
- lib/xml_errors_parser/error_message_builder.rb
|
201
|
+
- lib/xml_errors_parser/errors_regex.rb
|
202
|
+
- lib/xml_errors_parser/parser.rb
|
203
|
+
- lib/xml_errors_parser/version.rb
|
204
|
+
- spec/spec_helper.rb
|
205
|
+
- spec/xml_errors_parser/error_message_builder_spec.rb
|
206
|
+
- spec/xml_errors_parser/errors_regex_spec.rb
|
207
|
+
- spec/xml_errors_parser/parser_spec.rb
|
208
|
+
- xml_errors_parser.gemspec
|
209
|
+
homepage: https://github.com/victormartins/xml_errors_parser
|
210
|
+
licenses:
|
211
|
+
- MIT
|
212
|
+
metadata: {}
|
213
|
+
post_install_message:
|
214
|
+
rdoc_options: []
|
215
|
+
require_paths:
|
216
|
+
- lib
|
217
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ! '>='
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
222
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
|
+
requirements:
|
224
|
+
- - ! '>='
|
225
|
+
- !ruby/object:Gem::Version
|
226
|
+
version: '0'
|
227
|
+
requirements: []
|
228
|
+
rubyforge_project:
|
229
|
+
rubygems_version: 2.2.2
|
230
|
+
signing_key:
|
231
|
+
specification_version: 4
|
232
|
+
summary: Parser and humanizer of XML schema generated errors
|
233
|
+
test_files:
|
234
|
+
- spec/spec_helper.rb
|
235
|
+
- spec/xml_errors_parser/error_message_builder_spec.rb
|
236
|
+
- spec/xml_errors_parser/errors_regex_spec.rb
|
237
|
+
- spec/xml_errors_parser/parser_spec.rb
|
238
|
+
has_rdoc:
|