Last active
May 21, 2019 17:39
-
-
Save alexishida/043b751b9fd8049393f073e88c1479a3 to your computer and use it in GitHub Desktop.
RJB Ruby-Java bridge using Java Native Interface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---------------------------------------- | |
| Setup JAVA_HOME enviromental varible | |
| ---------------------------------------- | |
| Add in Gemfile: | |
| ---------------------------------------- | |
| gem 'rjb' | |
| ---------------------------------------- | |
| Create a service | |
| ---------------------------------------- | |
| class ProdutoService | |
| def consultar_nfe(codigo_barras) | |
| # Rjb::load('.',['-Dfile.encoding=windows-1252']) | |
| Rjb::add_jar "#{Rails.root}/java-lib/services.jar" | |
| contribuinteService = Rjb::import 'empresa.services.ProdutoService' | |
| contribuinteService.consultarnfe(codigo_barras) | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment