brasilfone_api 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 41578249c76b016bda6604ba940bd67b558a2d03
4
- data.tar.gz: 39f1cf13406692058a9f91cee1dff5c17f1f4703
3
+ metadata.gz: 0cd77f420844ded611df635b9021312261e793df
4
+ data.tar.gz: 404b2118e8e74f4e27b326c3c8f1f1fe1ff6774f
5
5
  SHA512:
6
- metadata.gz: 51c7dc953fa3ce45fca14b456a8d20c628707dbe3ee872f308a6b7036aef4a4daf4068921948996ed42db3639c3ac33727f530930a0cf1e707bfb0d1a83f321c
7
- data.tar.gz: e0c4cdf4fe1b6e9016fb757cd78ab284694804cebfa1ff7d7844ee64e5122f89f256e5ea4a40afa310f6b57dccea5ed92aea32735d0edbad6ae8d1a806752ab4
6
+ metadata.gz: f7f07927332d3cc4401643482d6e1bd63e685371495dcb623228547e5decc60bf334c8fc9b2d303104b1d34746e9211c246dfd5a36e87d88bf4dec516ae4afeb
7
+ data.tar.gz: bc75939434fa1eea8d979f81f62bbe3ee44713813b6f20b91d46ef6ea18de24383928f14182b12bcb8c6c402312b12bc4e163bbbd4a771a34d43dcfd901a23ce
@@ -27,11 +27,11 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency "xmlhasher", "~> 1.0.2"
30
+ spec.add_dependency "xmlhasher", "~> 1.0", '>= 1.0.2'
31
31
 
32
32
  spec.add_development_dependency "bundler", "~> 1.11"
33
33
  spec.add_development_dependency "rake", "~> 10.0"
34
34
  spec.add_development_dependency "rspec", "~> 3.0"
35
35
  spec.add_development_dependency "pry", "~> 0.10.3"
36
- spec.add_development_dependency "webmock", "~> 1.24.1"
36
+ spec.add_development_dependency "webmock", "~> 1.24", '>= 1.24.1'
37
37
  end
@@ -0,0 +1,10 @@
1
+ module BrasilfoneAPI
2
+ class PhoneParser
3
+ def self.parse_phone_number(phone_number)
4
+ # Remove non Digits
5
+ phone_number.gsub!(/\D/, '')
6
+ # Remove leading zeros
7
+ phone_number.gsub!(/^0+/, '')
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module BrasilfoneAPI
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'brasilfone_api/version'
2
2
  require 'brasilfone_api/configuration'
3
+ require 'brasilfone_api/phone_parser'
3
4
  require 'brasilfone_api/http_api_handler'
4
5
 
5
6
  module BrasilfoneAPI
@@ -13,9 +14,10 @@ module BrasilfoneAPI
13
14
  end
14
15
 
15
16
  def send_sms(destination, text)
17
+ parsed_phone = BrasilfoneAPI::PhoneParser.parse_phone_number(destination)
16
18
  HttpAPIHandler.send_request_for_service(
17
19
  :SEND_SMS,
18
- destination: destination,
20
+ destination: parsed_phone,
19
21
  text: text
20
22
  )
21
23
  end
metadata CHANGED
@@ -1,20 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brasilfone_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Fonseca
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2016-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xmlhasher
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - ">="
18
21
  - !ruby/object:Gem::Version
19
22
  version: 1.0.2
20
23
  type: :runtime
@@ -22,6 +25,9 @@ dependencies:
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - ">="
25
31
  - !ruby/object:Gem::Version
26
32
  version: 1.0.2
27
33
  - !ruby/object:Gem::Dependency
@@ -85,6 +91,9 @@ dependencies:
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
93
  - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.24'
96
+ - - ">="
88
97
  - !ruby/object:Gem::Version
89
98
  version: 1.24.1
90
99
  type: :development
@@ -92,6 +101,9 @@ dependencies:
92
101
  version_requirements: !ruby/object:Gem::Requirement
93
102
  requirements:
94
103
  - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '1.24'
106
+ - - ">="
95
107
  - !ruby/object:Gem::Version
96
108
  version: 1.24.1
97
109
  description: Used to interface with Brasilfone's web API
@@ -116,6 +128,7 @@ files:
116
128
  - lib/brasilfone_api/http_api_handler.rb
117
129
  - lib/brasilfone_api/http_api_handler/service_uri.rb
118
130
  - lib/brasilfone_api/http_api_handler/uri_constants.rb
131
+ - lib/brasilfone_api/phone_parser.rb
119
132
  - lib/brasilfone_api/version.rb
120
133
  homepage: https://github.com/redealumni/brasilfone_api
121
134
  licenses: