faxage 0.1.2 → 0.1.3

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: 5c1512cb5cf142d6b987b7225fb3f203595975b796330ceb9ba2020ce939e0b5
4
- data.tar.gz: 6143a653ef0e6c7f9cd5ff68514be1df5856a5d7dbe41107c50c1762f90a5be6
3
+ metadata.gz: dd31e18b35891cb250ccb07aae95a8ed770cafb932a416b5098791d6e6bd6745
4
+ data.tar.gz: 411dda5041bdec000fc53c0874338fb227b84669b449f955b9c83c67c4497acc
5
5
  SHA512:
6
- metadata.gz: 31069b8d7269bec855b74486c17ef6a773e7e4808c938a00782a9938d4d8cad7408d74e99307cd7a017651400056db2537294a6840d7f934eade76011d3638ce
7
- data.tar.gz: 43a988233dbffca431684b2189f08034f351d946cef00a6ab96ab76f0891dd97e206943d428d3d885831a3c76c256baa58b8f0ce389de68e0514474b622287ca
6
+ metadata.gz: 72ca783e4cae038b68443b62fc8f92909b63f0f76cb2dac08f51d756c9a8a6c1bc853563fe9479b4ca3a1fc28a50f038c44fc89b552f771b4325b722fb63a119
7
+ data.tar.gz: b6a79eeaf114f00137fa837f8b623cb42624991babc5b23ada98f93f08bc89ebbf641cf4b698525dadeef02ed5eb21f0c8db8d398f910c041236f66b83a719f8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- faxage (0.1.2)
4
+ faxage (0.1.3)
5
5
  httparty
6
6
 
7
7
  GEM
@@ -4,6 +4,7 @@ module Faxage
4
4
  class SendFax
5
5
  include HTTParty
6
6
  base_uri "https://api.faxage.com"
7
+ JOB_ID_REGEX = /(?<=JOBID:)\s+\d+/
7
8
 
8
9
  attr_reader :username, # Assigned FAXAGE username
9
10
  :company, # Assigned FAXAGE company credential
@@ -55,7 +56,7 @@ module Faxage
55
56
  response = self.class.post(subdirectory,
56
57
  body: body
57
58
  )
58
- puts response
59
+
59
60
  if response.parsed_response.nil?
60
61
  raise NoResponseError.new("An empty response was returned from Faxage.")
61
62
  elsif response.parsed_response.include?("ERR01: Database connection failed")
@@ -73,7 +74,11 @@ module Faxage
73
74
  elsif response.parsed_response.include?("ERR15: Invalid Job ID")
74
75
  raise InvalidJobIdError.new("Internal FAXAGE error – the job was not properly inserted into our database.")
75
76
  else
76
- return response.parsed_response
77
+ job_id = response.parsed_response.scan(JOB_ID_REGEX)[0].strip.to_i
78
+ data = {
79
+ job_id: job_id
80
+ }
81
+ return data
77
82
  end
78
83
  end
79
84
  end
@@ -1,3 +1,3 @@
1
1
  module Faxage
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faxage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Dias