Skip to content

Commit

Permalink
Merge pull request #10 from dgilperez/master
Browse files Browse the repository at this point in the history
New CIF starting with "J" fix + Test suite
  • Loading branch information
Javier Toledo authored Apr 23, 2017
2 parents 8cf7944 + 97c74fd commit 7694342
Show file tree
Hide file tree
Showing 18 changed files with 599 additions and 28 deletions.
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
sudo: false

cache: bundler

script: 'bundle exec rake'

rvm:
- 1.9.3
- 2.0.0
- 2.1.5
- 2.2.0
- 2.2.4
- 2.3.0

gemfile:
- gemfiles/rails_3.2.gemfile
- gemfiles/rails_4.0.gemfile
- gemfiles/rails_4.1.gemfile
- gemfiles/rails_4.2.gemfile
- gemfiles/rails_5.0.gemfile

matrix:
fast_finish: true
exclude:
- rvm: 1.9.3
gemfile: gemfiles/rails_5.0.gemfile
- rvm: 2.0.0
gemfile: gemfiles/rails_5.0.gemfile
- rvm: 2.1.5
gemfile: gemfiles/rails_5.0.gemfile
- rvm: 2.2.0
gemfile: gemfiles/rails_5.0.gemfile

addons:
code_climate:
repo_token: 3a0f3547e95bcf5828df4c53639a2267fe0d61d9ac816220772e5337120aceeb

after_success:
- bundle exec codeclimate-test-reporter
19 changes: 19 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
appraise "rails-3.2" do
gem 'activemodel', '~> 3.2.0'
end

appraise "rails-4.0" do
gem "activemodel", '~> 4.0.0'
end

appraise "rails-4.1" do
gem "activemodel", '~> 4.1.0'
end

appraise "rails-4.2" do
gem "activemodel", '~> 4.2.0'
end

appraise "rails-5.0" do
gem "activemodel", '~> 5.0.0'
end
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SpanishVatValidators
# SpanishVatValidators [![Build Status](https://travis-ci.org/dgilperez/spanish_vat_validators.svg?branch=master)](https://travis-ci.org/dgilperez/spanish_vat_validators)[![Code Climate](https://codeclimate.com/github/dgilperez/spanish_vat_validators/badges/gpa.svg)](https://codeclimate.com/github/dgilperez/spanish_vat_validators)

I've adapted the code from the ValidateSpanishVAT plugin from https://github.com/lleirborras/ValidateSpanishVAT to be distributed as a gem for ease of use with Rails 3.
I've adapted the code from the ValidateSpanishVAT plugin from https://github.com/lleirborras/ValidateSpanishVAT to be distributed as a gem for ease of use with Rails >= 3.2.

Also added I18n support for error messages, which you can change by adding this to your locale yml:

Expand Down
9 changes: 9 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
#!/usr/bin/env rake
require "bundler/gem_tasks"
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)
task default: :spec

desc "Open an irb session preloaded with this library"
task :console do
sh "irb -Ilib -rspanish_vat_validators"
end
7 changes: 7 additions & 0 deletions gemfiles/rails_3.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activemodel", "~> 3.2.0"

gemspec path: "../"
63 changes: 63 additions & 0 deletions gemfiles/rails_3.2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
PATH
remote: ../
specs:
spanish_vat_validators (0.0.5)
activemodel (>= 3.2.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (3.2.22.4)
activesupport (= 3.2.22.4)
builder (~> 3.0.0)
activesupport (3.2.22.4)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
builder (3.0.4)
codeclimate-test-reporter (1.0.8)
simplecov (<= 0.13)
diff-lcs (1.3)
docile (1.1.5)
i18n (0.7.0)
json (2.1.0)
multi_json (1.12.1)
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
thor (0.19.4)

PLATFORMS
ruby

DEPENDENCIES
activemodel (~> 3.2.0)
appraisal
bundler (~> 1.6)
codeclimate-test-reporter (~> 1.0.0)
rake
rspec
simplecov
spanish_vat_validators!

BUNDLED WITH
1.13.2
7 changes: 7 additions & 0 deletions gemfiles/rails_4.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activemodel", "~> 4.0.0"

gemspec path: "../"
69 changes: 69 additions & 0 deletions gemfiles/rails_4.0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
PATH
remote: ../
specs:
spanish_vat_validators (0.0.5)
activemodel (>= 3.2.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (4.0.13)
activesupport (= 4.0.13)
builder (~> 3.1.0)
activesupport (4.0.13)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
builder (3.1.4)
codeclimate-test-reporter (1.0.8)
simplecov (<= 0.13)
diff-lcs (1.3)
docile (1.1.5)
i18n (0.7.0)
json (2.1.0)
minitest (4.7.5)
multi_json (1.12.1)
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
thor (0.19.4)
thread_safe (0.3.5)
tzinfo (0.3.51)

PLATFORMS
ruby

DEPENDENCIES
activemodel (~> 4.0.0)
appraisal
bundler (~> 1.6)
codeclimate-test-reporter (~> 1.0.0)
rake
rspec
simplecov
spanish_vat_validators!

BUNDLED WITH
1.13.2
7 changes: 7 additions & 0 deletions gemfiles/rails_4.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activemodel", "~> 4.1.0"

gemspec path: "../"
69 changes: 69 additions & 0 deletions gemfiles/rails_4.1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
PATH
remote: ../
specs:
spanish_vat_validators (0.0.5)
activemodel (>= 3.2.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (4.1.16)
activesupport (= 4.1.16)
builder (~> 3.1)
activesupport (4.1.16)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
builder (3.2.2)
codeclimate-test-reporter (1.0.8)
simplecov (<= 0.13)
diff-lcs (1.3)
docile (1.1.5)
i18n (0.7.0)
json (1.8.3)
minitest (5.9.1)
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
thor (0.19.4)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
activemodel (~> 4.1.0)
appraisal
bundler (~> 1.6)
codeclimate-test-reporter (~> 1.0.0)
rake
rspec
simplecov
spanish_vat_validators!

BUNDLED WITH
1.13.2
7 changes: 7 additions & 0 deletions gemfiles/rails_4.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activemodel", "~> 4.2.0"

gemspec path: "../"
69 changes: 69 additions & 0 deletions gemfiles/rails_4.2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
PATH
remote: ../
specs:
spanish_vat_validators (0.0.5)
activemodel (>= 3.2.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (4.2.7.1)
activesupport (= 4.2.7.1)
builder (~> 3.1)
activesupport (4.2.7.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
builder (3.2.2)
codeclimate-test-reporter (1.0.8)
simplecov (<= 0.13)
diff-lcs (1.3)
docile (1.1.5)
i18n (0.7.0)
json (1.8.3)
minitest (5.9.1)
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
thor (0.19.4)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
activemodel (~> 4.2.0)
appraisal
bundler (~> 1.6)
codeclimate-test-reporter (~> 1.0.0)
rake
rspec
simplecov
spanish_vat_validators!

BUNDLED WITH
1.13.2
7 changes: 7 additions & 0 deletions gemfiles/rails_5.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activemodel", "~> 5.0.0"

gemspec path: "../"
Loading

0 comments on commit 7694342

Please sign in to comment.