bs2 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 807e398d374f47dd9dbbaf9b3846541ce23ab5d87fa4fb4aaa5ad82605f8e640
4
- data.tar.gz: b120f0b40bec65084a7bed921fde8fc61cf24d1f31cc2d3d56fdb077dafa7fb1
3
+ metadata.gz: fc1fec8361a5732235cdb719ec75fb26e3c5a95bc3bd464d71832a0340019974
4
+ data.tar.gz: 41916656e628d6fe2bc8e261aa5829ea91a91a95ce1bf01c81de2670dd31e02d
5
5
  SHA512:
6
- metadata.gz: 4f718fa861c3ace6662235aa7165553f6e42f0a88a784f19951d5208a070e12ba04c18d9071b897a98263d535e372855f9b413c53a433b0bf2b8e6cd5385e69b
7
- data.tar.gz: 1f6d0f3ae1a081c927187eebae653e048b5914b016030509c680d601a88f92284f58d797bcfa258f9e24364d9c10f7ffe78d937f005ca776b29ea5b230af605e
6
+ metadata.gz: 0062d5435e28bfd71bc27b21e87467c5eba724b1859ffa80fd09513ce778ecba0aa201cbd72e0cc61b0095caefda6bee15504228525edcb59688c4b3303e6653
7
+ data.tar.gz: d5f3a982d1d4b037ac71baea54a8b6bcc732a3a26aea3faa6b07df830ba5c2011afd16cceee2b7906aadb23901f0ef9701d55637db90b214efe2aa127d751c6c
@@ -1,10 +1,9 @@
1
- name: Ruby Gem
1
+ name: Publish
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master ]
6
- pull_request:
7
- branches: [ master ]
5
+ paths:
6
+ - lib/bs2/version.rb
8
7
 
9
8
  jobs:
10
9
  build:
@@ -17,6 +16,13 @@ jobs:
17
16
  uses: actions/setup-ruby@v1
18
17
  with:
19
18
  ruby-version: 2.6.x
19
+ - name: Bundle
20
+ run: |
21
+ gem install bundler:2.2.4
22
+ bundle
23
+
24
+ - name: Test
25
+ run: bundle exec rake test
20
26
 
21
27
  - name: Publish to RubyGems
22
28
  run: |
@@ -0,0 +1,26 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+ name: Build + Test
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - name: Set up Ruby 2.6
17
+ uses: actions/setup-ruby@v1
18
+ with:
19
+ ruby-version: 2.6.x
20
+ - name: Bundle
21
+ run: |
22
+ gem install bundler:2.2.4
23
+ bundle
24
+
25
+ - name: Test
26
+ run: bundle exec rake test
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bs2 (0.1.0)
4
+ bs2 (0.2.0)
5
5
  faraday_middleware
6
6
 
7
7
  GEM
@@ -32,6 +32,7 @@ GEM
32
32
  hashdiff (>= 0.4.0, < 2.0.0)
33
33
 
34
34
  PLATFORMS
35
+ ruby
35
36
  x86_64-linux
36
37
 
37
38
  DEPENDENCIES
data/lib/bs2.rb CHANGED
@@ -53,12 +53,14 @@ module BS2
53
53
  end
54
54
  end
55
55
 
56
- def generate_pdf(id, filename)
56
+ def generate_pdf(id)
57
57
  connector = create_connector(false)
58
58
 
59
59
  response = connector.get("/pj/forintegration/cobranca/v1/boletos/#{id}/imprimivel")
60
60
 
61
- File.open(filename, 'wb') { |fp| fp.write(response.body) }
61
+ return false unless response.success?
62
+
63
+ response.body
62
64
  end
63
65
 
64
66
  def fetch_billet(id)
@@ -86,6 +88,8 @@ module BS2
86
88
 
87
89
  resp = connector.post("/pj/forintegration/cobranca/v1/boletos/simplificado", data)
88
90
 
91
+ return false unless resp.success?
92
+
89
93
  resp.body
90
94
  end
91
95
 
data/lib/bs2/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BS2
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bs2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emerson Almeida
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-18 00:00:00.000000000 Z
11
+ date: 2021-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday_middleware
@@ -31,7 +31,8 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - ".github/workflows/gem-push.yml"
34
+ - ".github/workflows/publish.yml"
35
+ - ".github/workflows/test.yml"
35
36
  - ".gitignore"
36
37
  - ".travis.yml"
37
38
  - CODE_OF_CONDUCT.md