br_boleto 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/Gemfile +0 -0
  4. data/Gemfile.lock +2 -2
  5. data/History.txt +0 -0
  6. data/LICENSE +0 -0
  7. data/Rakefile +0 -0
  8. data/br_boleto.gemspec +1 -1
  9. data/lib/br_boleto/active_model_base.rb +0 -0
  10. data/lib/br_boleto/association/have_pagamentos.rb +0 -0
  11. data/lib/br_boleto/boleto/sicoob.rb +0 -0
  12. data/lib/br_boleto/calculos/digitos.rb +0 -0
  13. data/lib/br_boleto/calculos/fator_vencimento.rb +0 -0
  14. data/lib/br_boleto/calculos/fatores_de_multiplicacao.rb +0 -0
  15. data/lib/br_boleto/calculos/linha_digitavel.rb +0 -0
  16. data/lib/br_boleto/calculos/modulo10.rb +0 -0
  17. data/lib/br_boleto/calculos/modulo11.rb +0 -0
  18. data/lib/br_boleto/calculos/modulo11_fator3197.rb +0 -0
  19. data/lib/br_boleto/calculos/modulo11_fator_de2a7.rb +0 -0
  20. data/lib/br_boleto/calculos/modulo11_fator_de2a9.rb +0 -0
  21. data/lib/br_boleto/calculos/modulo11_fator_de2a9_resto_zero.rb +0 -0
  22. data/lib/br_boleto/calculos/modulo11_fator_de9a2.rb +0 -0
  23. data/lib/br_boleto/calculos/modulo11_fator_de9a2_resto_x.rb +0 -0
  24. data/lib/br_boleto/calculos/modulo_numero_de_controle.rb +0 -0
  25. data/lib/br_boleto/helper/cpf_cnpj.rb +0 -0
  26. data/lib/br_boleto/helper/format_value.rb +0 -0
  27. data/lib/br_boleto/helper/number.rb +0 -0
  28. data/lib/br_boleto/remessa/cnab240/helper/header_arquivo.rb +0 -0
  29. data/lib/br_boleto/remessa/cnab240/helper/header_lote.rb +0 -0
  30. data/lib/br_boleto/remessa/cnab240/helper/trailer_arquivo.rb +0 -0
  31. data/lib/br_boleto/remessa/cnab240/helper/trailer_lote.rb +0 -0
  32. data/lib/br_boleto/remessa/cnab400/helper/header.rb +0 -0
  33. data/lib/br_boleto/remessa/cnab400/helper/trailer.rb +0 -0
  34. data/lib/br_boleto/remessa/lote.rb +0 -0
  35. data/lib/br_boleto/remessa/pagamento.rb +6 -1
  36. data/lib/br_boleto/string_methods.rb +0 -0
  37. data/lib/br_boleto/validations.rb +0 -0
  38. data/lib/br_boleto/version.rb +1 -1
  39. data/test/br_boleto/association/have_conta_test.rb +0 -0
  40. data/test/br_boleto/association/have_pagamentos_test.rb +0 -0
  41. data/test/br_boleto/boleto/sicoob_test.rb +0 -0
  42. data/test/br_boleto/calculos/digitos_test.rb +0 -0
  43. data/test/br_boleto/calculos/fator_vencimento_test.rb +0 -0
  44. data/test/br_boleto/calculos/fatores_de_multiplicacao_test.rb +0 -0
  45. data/test/br_boleto/calculos/linha_digitavel_test.rb +0 -0
  46. data/test/br_boleto/calculos/modulo10_test.rb +0 -0
  47. data/test/br_boleto/calculos/modulo11_fator3197_test.rb +0 -0
  48. data/test/br_boleto/calculos/modulo11_fator_de2a7_test.rb +0 -0
  49. data/test/br_boleto/calculos/modulo11_fator_de2a9_resto_zero_test.rb +0 -0
  50. data/test/br_boleto/calculos/modulo11_fator_de2a9_test.rb +0 -0
  51. data/test/br_boleto/calculos/modulo11_fator_de9a2_resto_x_test.rb +0 -0
  52. data/test/br_boleto/calculos/modulo11_fator_de9a2_test.rb +0 -0
  53. data/test/br_boleto/calculos/modulo11_test.rb +0 -0
  54. data/test/br_boleto/calculos/modulo_numero_de_controle_test.rb +0 -0
  55. data/test/br_boleto/helper/number_test.rb +0 -0
  56. data/test/br_boleto/remessa/base_test.rb +0 -0
  57. data/test/br_boleto/remessa/cnab240/helper/header_arquivo_test.rb +0 -0
  58. data/test/br_boleto/remessa/cnab240/helper/header_lote_test.rb +0 -0
  59. data/test/br_boleto/remessa/cnab240/helper/trailer_arquivo_test.rb +0 -0
  60. data/test/br_boleto/remessa/cnab240/helper/trailer_lote_test.rb +0 -0
  61. data/test/br_boleto/remessa/lote_test.rb +0 -0
  62. data/test/br_boleto/remessa/pagamento_test.rb +10 -3
  63. data/test/br_boleto/retorno/base_test.rb +0 -0
  64. data/test/factories/boleto/base.rb +0 -0
  65. data/test/factories/boleto/boleto_caixa.rb +0 -0
  66. data/test/factories/boleto/boleto_sicoob.rb +0 -0
  67. data/test/factories/conta/base.rb +0 -0
  68. data/test/factories/pagador.rb +0 -0
  69. data/test/factories/remessa/base.rb +0 -0
  70. data/test/factories/remessa/cnab240/base.rb +0 -0
  71. data/test/factories/remessa/cnab240/caixa.rb +0 -0
  72. data/test/factories/remessa/cnab240/sicoob.rb +0 -0
  73. data/test/factories/remessa/cnab400/base.rb +0 -0
  74. data/test/factories/remessa/cnab400/sicoob.rb +0 -0
  75. data/test/factories/remessa/lote.rb +0 -0
  76. data/test/factories/retorno/pagamento.rb +0 -0
  77. data/test/fixtures/retorno/cnab240/caixa.ret +0 -0
  78. data/test/fixtures/retorno/cnab240/padrao240.ret +0 -0
  79. data/test/fixtures/retorno/cnab400/sicoob.ret +0 -0
  80. data/test/inheritance/boleto_test.rb +0 -0
  81. data/test/inheritance/sicoob_test.rb +0 -0
  82. data/test/test_helper.rb +0 -0
  83. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05cd136fdc280d0b850eeaa28d6005620d448a7b
4
- data.tar.gz: 9b6ad1b838faa5e35ec6836121ad7fc3bb8791e3
3
+ metadata.gz: 821f1c29e52c955ce6bd1b053f7d775a190e79e3
4
+ data.tar.gz: 37fa7feec7becf3ff2dd10117c0c63f8cc62d814
5
5
  SHA512:
6
- metadata.gz: d636ab8f752bee300f7445abbdbdeb85f88627de89b2a72e4e212656bf0694385924ea5c148fab528ef65fdf46a1545d2a3d7b9b2e38472247e93cb4d1c8eb2e
7
- data.tar.gz: 8a360c1dfd33ad1a9ea42165121b32ba70c9467f0c91042c18af06e676a733a7e663ba085eb2ffce4bb8019570feafa8608f8cae5e49e6519f9ec970bb49add6
6
+ metadata.gz: c5256bb0859e09c6bddca1482268eafc410f591e28a2be4902f893f3af62255556febefe844e1aad8ca3b9e7d5d6a2de912cab575e55bb1fb5c495abdfb787b9
7
+ data.tar.gz: 30db9fe04f7603a67cd9ef7cb113eac391793fe75b10efdb7fe318b59307d3bd26e194c20b1b6613362d5323ad87916a72b1aaddf49f0a816d452bc7ccc9c7a4
data/.gitignore CHANGED
@@ -4,4 +4,4 @@ coverage/
4
4
  **/*.~lock.*
5
5
  dev_load_data*.rb
6
6
  saida.rem
7
- br_boleto*.gem
7
+ /br_boleto*.gem
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- br_boleto (2.2.4)
4
+ br_boleto (2.2.5)
5
5
  activemodel (~> 4.2)
6
6
  activesupport (~> 4.2)
7
7
  rake (>= 0.8.7)
@@ -155,4 +155,4 @@ DEPENDENCIES
155
155
  simplecov
156
156
 
157
157
  BUNDLED WITH
158
- 1.12.5
158
+ 1.15.1
data/History.txt CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/Rakefile CHANGED
File without changes
data/br_boleto.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.homepage = "https://github.com/Brunomm/br_boleto"
14
14
 
15
15
  gem.files = `git ls-files`.split("\n").reject{|fil|
16
- fil.include?('documentacoes_boletos/')
16
+ fil.include?('documentacoes_boletos/') || fil.include?('gemfiles/')
17
17
  }
18
18
  gem.test_files = `git ls-files -- test`.split("\n")
19
19
  # gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -307,8 +307,13 @@ module BrBoleto
307
307
  @parcela
308
308
  end
309
309
 
310
+ # Nosso número deve retornar apenas letras e números
311
+ # Ex: self.nosso_numero = '0100245-P'
312
+ # self.nosso_numero
313
+ # ~> '0100245P'
314
+ #
310
315
  def nosso_numero
311
- "#{@nosso_numero}".gsub(/[^0-9]/, "")
316
+ "#{@nosso_numero}".remove(/[^\d\w]/i)
312
317
  end
313
318
 
314
319
  validates :nosso_numero, :data_vencimento, :valor_documento, presence: true
File without changes
File without changes
@@ -2,7 +2,7 @@ module BrBoleto
2
2
  module Version
3
3
  MAJOR = 2 #inclui alterações de API e pode quebrar compatibilidade com versões anteriores
4
4
  MINOR = 2 #inclui novas funcionalidades, sem quebrar APIs existentes
5
- PATCH = 4 #corrige bugs ou traz melhorias em implementações já existentes
5
+ PATCH = 5 #corrige bugs ou traz melhorias em implementações já existentes
6
6
  CURRENT = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -184,11 +184,18 @@ describe BrBoleto::Remessa::Pagamento do
184
184
  subject.parcela.must_equal '1'
185
185
  end
186
186
 
187
- it "nosso_numero deve retornar apenas numeros" do
188
- subject.nosso_numero = 'A1!@#$%*()-234vc.,;-56789o0'
189
- subject.nosso_numero.must_equal '1234567890'
187
+ describe '#nosso_numero' do
188
+ it "deve retornar apenas numeros e letras" do
189
+ subject.nosso_numero = 'A1!@#$%*()-234vc.,;-56789o0'
190
+ subject.nosso_numero.must_equal 'A1234vc56789o0'
191
+ end
192
+ it "deve retornar corretamente o nosso_numero quando o DV é uma letra" do
193
+ subject.nosso_numero = '001240002-P'
194
+ subject.nosso_numero.must_equal '001240002P'
195
+ end
190
196
  end
191
197
 
198
+
192
199
  describe "default_values" do
193
200
  let(:object) { subject.class.new() }
194
201
  it "for data_emissao" do object.data_emissao.must_equal Date.today end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/test/test_helper.rb CHANGED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_boleto
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno M. Mergen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-10 00:00:00.000000000 Z
11
+ date: 2017-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -352,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
352
352
  version: '0'
353
353
  requirements: []
354
354
  rubyforge_project:
355
- rubygems_version: 2.5.1
355
+ rubygems_version: 2.6.10
356
356
  signing_key:
357
357
  specification_version: 4
358
358
  summary: Emissão de Boletos Bancários em Ruby