AndroidStringResourcesValidator
Validates an Android strings.xml resource file against the specification at http://developer.android.com/guide/topics/resources/string-resource.html
Installation
Add this line to your application’s Gemfile:
gem 'android_string_resources_validator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install android_string_resources_validator
Usage
```ruby strings_xml = %qname="hello">It\'s all right validator = AndroidStringResourcesValidator.new(strings_xml) validator.valid? # => true
strings_xml = %qname="hello">It's no good validator = AndroidStringResourcesValidator.new(strings_xml) validator.valid? # => false validator.errors # => [“Apostrophes must be escaped”]
strings_xml = %qname="string_name">text_string validator = AndroidStringResourcesValidator.new(strings_xml) validator.valid? # => false validator.errors # => [“Not a string resource document”]
strings_xml = %q<foo> validator = AndroidStringResourcesValidator.new(strings_xml) validator.valid? # => false validator.errors # => ["Not a valid XML document"] ```
Contributing
- Fork it ( http://github.com/magplus/android_string_resources_validator/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request