0.0
No commit activity in last 3 years
No release in over 3 years
BoaVistaStubs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.0.12
= 0.6.11
~> 1.2.0
~> 3.2.22
= 0.9.2.2
 Project Readme

BoaVistaStubs Build Status Gem Version Code Climate Coverage Status

Rails Engine to generate stub requests for BoaVista (SCPC)

Features:

  • Dead-simple to use
  • Tested

Installation:

Add this to your Gemfile.

gem 'boa_vista_stubs'

and run:

$ bundle install in the console to install the gem in your rails project.

Getting Started

Configuration:

Create an config/initializers/boa_vista_stubs.rb file with the following content:

BoaVistaStubs.configure do |config|
  config.valid_cpf = /^3/
  config.valid_cnpn = /^4/
  config.timeout_document = /^6/
end

The BoaVistaStubs will evaluate the document number informed in the query string to allow or deny according this configuration. It also cause to return an timeout if the document number matches with the config file.

Usage:

Mount the engine in yout config/routes.rb file and you are ready to go.

Example:

mount BoaVistaStubs::Engine => '/boa_vista_stubs'

At this point you can now point to the following url: http://localhost:3000/boa_vista_stubs/stub/consulta=YOUR_QUERY_STRING_HEREinstead of use the url informed in the BoaVista documentation.

So, depending on your query string it will return an CPF layout document or an CNPJ layout document.

As expected if you inform an invalid document number an error layout will be returned.

Contributors