Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4 from Shelvak/master

Goodbye Curb
  • Loading branch information...
commit 661052cf27e25d57e9c8faeba71243c95adce737 2 parents ad7d8a4 + 1aa55f0
@miloops authored
Showing with 6 additions and 15 deletions.
  1. +2 −4 Gemfile.lock
  2. +0 −1  bravo.gemspec
  3. +4 −10 lib/bravo/bill.rb
View
6 Gemfile.lock
@@ -3,14 +3,13 @@ PATH
specs:
bravo (0.4.0)
activesupport (>= 3.2)
- curb
savon (~> 2.3.0)
tzinfo
GEM
remote: https://rubygems.org/
specs:
- activesupport (4.0.2)
+ activesupport (4.0.0)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
@@ -20,8 +19,7 @@ GEM
gyoku (>= 0.4.0)
nokogiri (>= 1.4.0)
atomic (1.1.14)
- builder (3.2.2)
- curb (0.8.4)
+ builder (3.1.4)
diff-lcs (1.1.3)
gyoku (1.1.1)
builder (>= 2.1.2)
View
1  bravo.gemspec
@@ -21,7 +21,6 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency('savon', [ '~> 2.3.0' ])
gem.add_runtime_dependency('activesupport', [ '>= 3.2' ])
gem.add_runtime_dependency('tzinfo')
- gem.add_runtime_dependency('curb')
gem.add_development_dependency('rspec', [ '~> 2.12.0' ])
gem.add_development_dependency('rake', ['~> 10.0.3'])
end
View
14 lib/bravo/bill.rb
@@ -1,7 +1,5 @@
module Bravo
class Bill
- require 'curb'
-
attr_reader :client, :base_imp, :total
attr_accessor :net, :doc_num, :iva_cond, :documento, :concepto, :moneda,
:due_date, :aliciva_id, :fch_serv_desde, :fch_serv_hasta,
@@ -120,15 +118,11 @@ def setup_bill
end
def next_bill_number
- begin
- resp = client.call :fe_comp_ultimo_autorizado do |soap|
- soap.message(body.merge({"PtoVta" => Bravo.sale_point, "CbteTipo" => cbte_type}))
- end
-
- resp.to_hash[:fe_comp_ultimo_autorizado_response][:fe_comp_ultimo_autorizado_result][:cbte_nro].to_i + 1
- rescue Curl::Err::GotNothingError, Curl::Err::TimeoutError
- nil
+ resp = client.call :fe_comp_ultimo_autorizado do |soap|
+ soap.message(body.merge({"PtoVta" => Bravo.sale_point, "CbteTipo" => cbte_type}))
end
+
+ resp.to_hash[:fe_comp_ultimo_autorizado_response][:fe_comp_ultimo_autorizado_result][:cbte_nro].to_i + 1
end
def authorized?
Please sign in to comment.
Something went wrong with that request. Please try again.