ruby_sms 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +3 -0
- data/lib/gateway/sms77.rb +3 -3
- data/ruby_sms.gemspec +1 -1
- metadata +2 -3
- data/rubysms.gemspec +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eedb10387b5cc915537fc10ee7006ba21cd26e38
|
4
|
+
data.tar.gz: 057b61931d8bc9938153e877aa4ad0bc248770e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2394c4a44f5c96c8959e2feb8f32bb09ae71f20e507d00be6ada4b13962ed3b99094ee30f3f9859c71b119bd96ff621f5bb6535ebcbb26908c37e7717de35a23
|
7
|
+
data.tar.gz: 77506e91820040b71b3130eeac439020ddffda7f54f622b97d1bb8c785e9410c81501ea4885c2577e39b7a08aeca3ba9bf4b8a9d51cea397fe6c344682600f9c
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
simple way to send sms using sms77 or any other short message api provider
|
3
3
|
A Ruby client library for [Sms77][more to come].
|
4
4
|
|
5
|
+
**You will need a valid account with an api key to access the api endpoints**
|
6
|
+
|
7
|
+
|
5
8
|
## Getting started
|
6
9
|
|
7
10
|
To install **ruby_sms**, run the following command:
|
data/lib/gateway/sms77.rb
CHANGED
@@ -21,7 +21,7 @@ module RubySms
|
|
21
21
|
|
22
22
|
def send(options)
|
23
23
|
response = Sms77Response.new
|
24
|
-
(response.add_error(:empty_options)
|
24
|
+
(response.add_error(:empty_options) and (return response)) if options.nil?
|
25
25
|
code = post_request(options)
|
26
26
|
return response if code == SUCCESS_CODE
|
27
27
|
response.add_error(code)
|
@@ -31,10 +31,10 @@ module RubySms
|
|
31
31
|
# generate a simple random 4 digits pin
|
32
32
|
def send_pin(options)
|
33
33
|
response = Sms77Response.new
|
34
|
-
(response.add_error(:empty_options)
|
34
|
+
(response.add_error(:empty_options) and (return response)) if options.nil?
|
35
35
|
# we may use SecureRandom.hex(size) if you need a more secure pin
|
36
36
|
response.pin = rand.to_s[2..(DEFAULT_PIN_SIZE + 1)]
|
37
|
-
options[:text].gsub
|
37
|
+
options[:text] = options[:text].gsub('%PIN%', response.pin)
|
38
38
|
code = post_request(options)
|
39
39
|
return response if code == SUCCESS_CODE
|
40
40
|
response.add_error(code)
|
data/ruby_sms.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_sms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mohamed Elassadi
|
@@ -23,7 +23,6 @@ files:
|
|
23
23
|
- lib/gateway/sms77.rb
|
24
24
|
- lib/ruby_sms.rb
|
25
25
|
- ruby_sms.gemspec
|
26
|
-
- rubysms.gemspec
|
27
26
|
homepage: https://github.com/carnifun/ruby_sms
|
28
27
|
licenses:
|
29
28
|
- MIT
|
@@ -44,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
44
43
|
version: '0'
|
45
44
|
requirements: []
|
46
45
|
rubyforge_project:
|
47
|
-
rubygems_version: 2.6.
|
46
|
+
rubygems_version: 2.6.12
|
48
47
|
signing_key:
|
49
48
|
specification_version: 4
|
50
49
|
summary: A simple Sms client
|
data/rubysms.gemspec
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = 'ruby_sms'
|
3
|
-
s.version = '1.0.0'
|
4
|
-
s.date = '2017-07-12'
|
5
|
-
s.summary = "A simple Sms client "
|
6
|
-
s.description = "simple way to send sms using sms77 or any other short message api provider"
|
7
|
-
s.authors = ["Mohamed Elassadi"]
|
8
|
-
s.email = 'mohamed.elassadi@gmail.com'
|
9
|
-
s.files = `git ls-files`.split($/)
|
10
|
-
s.homepage = 'https://github.com/carnifun/ruby_sms'
|
11
|
-
s.license = 'MIT'
|
12
|
-
|
13
|
-
end
|