orange_sms 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.ruby-version +1 -0
- data/.travis.yml +18 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +21 -0
- data/README.md +117 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/generators/orange_sms/USAGE +8 -0
- data/lib/generators/orange_sms/install_generator.rb +15 -0
- data/lib/generators/orange_sms/templates/orange_sms.rb +24 -0
- data/lib/orange_sms.rb +34 -0
- data/lib/orange_sms/client.rb +77 -0
- data/lib/orange_sms/error.rb +58 -0
- data/lib/orange_sms/version.rb +3 -0
- data/orange_sms.gemspec +32 -0
- data/script/travis.sh +15 -0
- metadata +164 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 358e2176de12b80c6213c01ea53cab1870db84cee14affe6fff40c5aa9e80157
|
4
|
+
data.tar.gz: fe30e2f9f8d949752bfa8a7a7dd1e585c824ff8fb3854b458cf6d294177e8a81
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 924a972fe3198e375a22d676cad0a1a373e0d5248db4c435709608e0d5f5798732277be0e1bad345c27570fed7ad78c2f8feecd592d3f886958084b9585f0a2f
|
7
|
+
data.tar.gz: 4813a5d5e92f9608057d02afe91c8df1a6a6bec2ef101d1364cc8f0a2b034a031f9c36d7ce29e6f854c213baf5b1dd33308b994fe21ccef3c925504a28afe916
|
data/.gitignore
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.0
|
data/.travis.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
language: ruby
|
3
|
+
cache: bundler
|
4
|
+
rvm:
|
5
|
+
- 2.3.0
|
6
|
+
before_install: gem install bundler -v 2.1.4
|
7
|
+
matrix:
|
8
|
+
fast_finish: true
|
9
|
+
script:
|
10
|
+
- sh script/travis.sh
|
11
|
+
deploy:
|
12
|
+
provider: pages
|
13
|
+
skip-cleanup: true
|
14
|
+
github-token: $GITHUB_TOKEN
|
15
|
+
keep-history: true
|
16
|
+
verbose: true
|
17
|
+
on:
|
18
|
+
branch: master
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 TODO: Write your name
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
# OrangeSms
|
2
|
+
![Build Status](https://travis-ci.com/bayevels/orange-sms-ruby.svg?branch=master)
|
3
|
+
[![Coverage](https://bayevels.github.io/orange-sms-ruby/badges/coverage_badge_total.svg)](https://bayevels.github.io/orange-sms-ruby/coverage/index.html)
|
4
|
+
> Orange Sms Ruby is a client library that allow you to send sms from a RoR app using the [Orange Sms API](https://developer.orange.com/apis/sms-sn/overview)
|
5
|
+
|
6
|
+
## Disclaimer
|
7
|
+
This gem is not an official client of Orange, in order to use the client you need to create a [Orange Sms API](https://developer.orange.com/apis/sms-sn/overview) and to register an app in the developer dashboard that orange provide to you. After registering your app you can ask for sms integration approval (this process can take time :)).
|
8
|
+
The registration process is detailed [here](https://developer.orange.com/apis/sms-sn/overview)
|
9
|
+
## Motivation
|
10
|
+
Instead of reading and trying to understand once again how the Orange Sms API work this gem aims to let you quickly send sms from a ruby app (mainly RoR) using the [Orange Sms API](https://developer.orange.com/apis/sms-sn/overview).
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
# default receiver country is Senegal (:sen)
|
14
|
+
client = OrangeSms::Client.new
|
15
|
+
client.send_sms('776879809', 'Simple comme bonjour !')
|
16
|
+
# Or specify the country code when sending
|
17
|
+
client = OrangeSms::Client.new(:civ) # Ivory coast code
|
18
|
+
client.send_sms('776879809', 'Simple comme bonjour !')
|
19
|
+
```
|
20
|
+
## Getting Started
|
21
|
+
|
22
|
+
### Setup
|
23
|
+
Add this line to your application's Gemfile:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
gem 'orange_sms'
|
27
|
+
```
|
28
|
+
Then run `bundle install`
|
29
|
+
|
30
|
+
Next, you need to run the generator:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
rails generate orange_sms:install
|
34
|
+
```
|
35
|
+
The generator will create an initializer file `/config/initializers/orange_sms.rb`.
|
36
|
+
You can setup, your app information there.
|
37
|
+
```ruby
|
38
|
+
OrangeSms.setup do |config|
|
39
|
+
# Sender Name
|
40
|
+
# config.sender_name = 'GITHUB'
|
41
|
+
config.sender_name = 'put your coporate name here'
|
42
|
+
|
43
|
+
# Sender Phone
|
44
|
+
config.sender_phone = 'put your phone number here'
|
45
|
+
|
46
|
+
# Sender country code. Follow ISO-3166 alpha 3 country codes. Default country value is :sen (Senegal)
|
47
|
+
# You can find supported countries by Orange Api in the folllowing link https://developer.orange.com/apis/sms-sn/getting-started
|
48
|
+
# config.sender_country_code = :sen
|
49
|
+
|
50
|
+
# Follow ISO-3166 alpha 3 country codes. Default country value is :sen (Senegal)
|
51
|
+
# Use the country code of your receivers. You can find supported countries by Orange Api in the folllowing link https://developer.orange.com/apis/sms-sn/getting-started
|
52
|
+
# config.default_receiver_country_code = :sen
|
53
|
+
|
54
|
+
# Authorization Header you can find the Authorization header in your app dashboard https://developer.orange.com/myapps
|
55
|
+
config.authorization = 'put your Authorization Header here !'
|
56
|
+
|
57
|
+
# Generate the access token with the interactive console
|
58
|
+
# --> client = OrangeSms::Client.new
|
59
|
+
# --> client.fetch_access_token => 'CeppeLvEUgWK4o0r2WW2IzBrMQEn'
|
60
|
+
config.access_token = 'put your access_token here !'
|
61
|
+
end
|
62
|
+
```
|
63
|
+
### Generate Access token
|
64
|
+
in order to fetch the access token you need first to get the Authorization header from your Orange developer dashboard and to add it to your configuration file
|
65
|
+
```ruby
|
66
|
+
config.authorization = 'Basic NktSSHljksdj7P...Jjndb6UdnlrT2lOaA=='
|
67
|
+
```
|
68
|
+
You can now get your access token using the rails console. Run in your terminal `rails console` and next
|
69
|
+
```ruby
|
70
|
+
client = OrangeSms::Client.new
|
71
|
+
client.fetch_access_token ==> i6m2iIcY0SodWSe...L3ojAXXrH
|
72
|
+
```
|
73
|
+
Copy it and paste it into your initializer file, and add it to the initializer file `/config/initializers/orange_sms.rb`
|
74
|
+
```ruby
|
75
|
+
config.access_token = 'i6m2iIcY0SodWSe...L3ojAXXrH' # You may use ENV variables
|
76
|
+
```
|
77
|
+
:warning: The access token will last 7776000 seconds, i.e. 90 days. After this period, you'll get an error and should request another token.
|
78
|
+
|
79
|
+
### Test it :sunglasses:
|
80
|
+
you can test the integration in the rails console, open up the console `rails console` next run the code down below
|
81
|
+
```ruby
|
82
|
+
# default receiver country is Senegal (:sen)
|
83
|
+
client = OrangeSms::Client.new
|
84
|
+
client.send_test_sms # Will send sms to the sender_phone that you have specified inside `/config/initializers/orange_sms.rb`.
|
85
|
+
```
|
86
|
+
### Send Sms
|
87
|
+
```ruby
|
88
|
+
# default receiver country is Senegal (:sen)
|
89
|
+
client = OrangeSms::Client.new
|
90
|
+
client.send_sms('776879809', 'Simple comme bonjour !')
|
91
|
+
# Or specify the country code when sending
|
92
|
+
client = OrangeSms::Client.new(:civ) # Ivory coast code
|
93
|
+
client.send_sms('776879809', 'Simple comme bonjour !')
|
94
|
+
```
|
95
|
+
### Handling Errors
|
96
|
+
```ruby
|
97
|
+
begin
|
98
|
+
client = OrangeSms::Client.new
|
99
|
+
client.send_sms('776879809', 'Simple comme bonjour !')
|
100
|
+
rescue OrangeSms::Error::ApiError => e
|
101
|
+
puts e.message
|
102
|
+
end
|
103
|
+
```
|
104
|
+
## Development
|
105
|
+
|
106
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
107
|
+
|
108
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
109
|
+
|
110
|
+
## Contributing
|
111
|
+
|
112
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bayevels/orange_sms.
|
113
|
+
|
114
|
+
|
115
|
+
## License
|
116
|
+
|
117
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "orange_sms"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/base'
|
4
|
+
|
5
|
+
module OrangeSms
|
6
|
+
module Generators
|
7
|
+
class InstallGenerator < Rails::Generators::Base
|
8
|
+
source_root File.expand_path('./templates', __dir__)
|
9
|
+
|
10
|
+
def copy_initializer
|
11
|
+
copy_file 'orange_sms.rb', 'config/initializers/orange_sms.rb'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
OrangeSms.setup do |config|
|
2
|
+
# Sender Name
|
3
|
+
# config.sender_name = 'GITHUB'
|
4
|
+
config.sender_name = 'put your coporate name here'
|
5
|
+
|
6
|
+
# Sender Phone
|
7
|
+
config.sender_phone = 'put your phone number here'
|
8
|
+
|
9
|
+
# Sender country code. Follow ISO-3166 alpha 3 country codes. Default country value is :sen (Senegal)
|
10
|
+
# You can find supported countries by Orange Api in the folllowing link https://developer.orange.com/apis/sms-sn/getting-started
|
11
|
+
# config.sender_country_code = :sen
|
12
|
+
|
13
|
+
# Follow ISO-3166 alpha 3 country codes. Default country value is :sen (Senegal)
|
14
|
+
# Use the country code of your receivers. You can find supported countries by Orange Api in the folllowing link https://developer.orange.com/apis/sms-sn/getting-started
|
15
|
+
# config.default_receiver_country_code = :sen
|
16
|
+
|
17
|
+
# Authorization Header you can find the Authorization header in your app dashboard https://developer.orange.com/myapps
|
18
|
+
config.authorization = 'put your Authorization Header here !'
|
19
|
+
|
20
|
+
# Generate the access token with the interactive console
|
21
|
+
# --> client = OrangeSms::Client.new
|
22
|
+
# --> client.fetch_access_token => 'CeppeLvEUgWK4o0r2WW2IzBrMQEn'
|
23
|
+
config.access_token = 'put your access_token here !'
|
24
|
+
end
|
data/lib/orange_sms.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'orange_sms/version'
|
4
|
+
require 'orange_sms/client'
|
5
|
+
require 'orange_sms/error'
|
6
|
+
require 'active_support/core_ext/module/attribute_accessors'
|
7
|
+
|
8
|
+
module OrangeSms
|
9
|
+
mattr_accessor :sender_name
|
10
|
+
@@sender_name = nil
|
11
|
+
|
12
|
+
mattr_accessor :sender_phone
|
13
|
+
@@sender_phone = nil
|
14
|
+
|
15
|
+
mattr_accessor :sender_country_code
|
16
|
+
@@sender_country_code = :sen
|
17
|
+
|
18
|
+
mattr_accessor :authorization
|
19
|
+
@@authorization = nil
|
20
|
+
|
21
|
+
mattr_accessor :default_receiver_country_code
|
22
|
+
@@default_receiver_country_code = :sen
|
23
|
+
|
24
|
+
mattr_accessor :access_token
|
25
|
+
@@access_token = nil
|
26
|
+
|
27
|
+
mattr_reader :base_url
|
28
|
+
@@base_url = 'https://api.orange.com'
|
29
|
+
|
30
|
+
# Setup the Gem
|
31
|
+
def self.setup
|
32
|
+
yield self
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
module OrangeSms
|
4
|
+
# Orange Api Client used to send http request to the Orange Backend
|
5
|
+
class Client
|
6
|
+
attr_reader :country_code, :country, :sender_phone
|
7
|
+
|
8
|
+
SUPPORTED_COUNTRIES = {
|
9
|
+
sen: { country: 'Senegal', code: 'SEN', prefix: 'tel:+221' },
|
10
|
+
mli: { country: 'Mali', code: 'MLI', prefix: 'tel:+223' },
|
11
|
+
bwa: { country: 'Botswana', code: 'BWA', prefix: 'tel:+267' },
|
12
|
+
bfa: { country: 'Burkina Faso', code: 'BFA', prefix: 'tel:+226' },
|
13
|
+
cod: { country: 'DR Congo', code: 'COD', prefix: 'tel:+243' },
|
14
|
+
civ: { country: "Côte d'Ivoire / Ivory Coast", code: 'CIV', prefix: 'tel:+225' },
|
15
|
+
egy: { country: 'Egypt', code: 'EGY', prefix: 'tel:+200' },
|
16
|
+
jor: { country: 'Jordan', code: 'JOR', prefix: 'tel:+962' },
|
17
|
+
gin: { country: 'Guinea Conakry', code: 'GIN', prefix: 'tel:+224' },
|
18
|
+
ner: { country: 'Niger', code: 'NER', prefix: 'tel:+227' },
|
19
|
+
tun: { country: 'Tunisia', code: 'TUN', prefix: 'tel:+216' },
|
20
|
+
cmr: { country: 'Cameroon', code: 'CMR', prefix: 'tel:+237' }
|
21
|
+
}.freeze
|
22
|
+
|
23
|
+
def initialize(country_code = nil)
|
24
|
+
@country_code = country_code.nil? ? OrangeSms.default_receiver_country_code : country_code
|
25
|
+
@country = SUPPORTED_COUNTRIES[@country_code]
|
26
|
+
@sender_country = SUPPORTED_COUNTRIES[OrangeSms.sender_country_code]
|
27
|
+
@sender_phone = @sender_country[:prefix] + OrangeSms.sender_phone
|
28
|
+
end
|
29
|
+
|
30
|
+
# Fetch the access token directly from your code
|
31
|
+
def fetch_access_token
|
32
|
+
response = send_request('/oauth/v2/token',
|
33
|
+
'grant_type=client_credentials',
|
34
|
+
OrangeSms.authorization,
|
35
|
+
'application/x-www-form-urlencoded')
|
36
|
+
raise OrangeSms::Error::AuthenticationError.new('Unable to fetch access token', response) if response.status != 200
|
37
|
+
|
38
|
+
JSON.parse(response.body).fetch('access_token', nil)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Ask Orange backend to send test message to the sender_phone defined in the /config/initializer/orange_sms.rb
|
42
|
+
def send_test_sms
|
43
|
+
send_sms(OrangeSms.sender_phone, "Yes ! it's working")
|
44
|
+
end
|
45
|
+
|
46
|
+
# Ask Orange backend to send Sms to some number
|
47
|
+
def send_sms(receiver_phone, message)
|
48
|
+
response = send_request("/smsmessaging/v1/outbound/#{sender_phone}/requests",
|
49
|
+
build_sms_payload(receiver_phone, message),
|
50
|
+
"Bearer #{OrangeSms.access_token}", 'application/json')
|
51
|
+
raise OrangeSms::Error::ApiError.new('Unable to Send message', response) if response.status != 201
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
# Send a request
|
57
|
+
def send_request(partial_url, payload, authorization_header, content_type)
|
58
|
+
Faraday.post(OrangeSms.base_url + partial_url,
|
59
|
+
payload,
|
60
|
+
{ 'Authorization' => authorization_header, 'Content-type' => content_type })
|
61
|
+
end
|
62
|
+
|
63
|
+
# Build the payload that gonna be sended
|
64
|
+
def build_sms_payload(receiver_phone, message)
|
65
|
+
{
|
66
|
+
outboundSMSMessageRequest: {
|
67
|
+
address: country[:prefix] + receiver_phone,
|
68
|
+
senderName: OrangeSms.sender_name,
|
69
|
+
senderAddress: sender_phone,
|
70
|
+
outboundSMSTextMessage: {
|
71
|
+
message: message
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}.to_json
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module OrangeSms
|
2
|
+
module Error
|
3
|
+
class AuthenticationError < StandardError
|
4
|
+
attr_reader :message, :response, :status, :more_info, :error_message
|
5
|
+
|
6
|
+
def initialize(message, response)
|
7
|
+
@status = response.status
|
8
|
+
body = JSON.parse(response.body)
|
9
|
+
@error_message = body.fetch('error', nil)
|
10
|
+
@more_info = body.fetch('error_description', nil)
|
11
|
+
@message = format_message(message)
|
12
|
+
@response = response
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
message
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def format_message(initial_message)
|
22
|
+
message = "[HTTP #{status}] #{initial_message}"
|
23
|
+
message += "\n#{error_message}" if error_message
|
24
|
+
message += "\n#{more_info}" if more_info
|
25
|
+
message += '\n For more details on Orange Authentication errors see https://developer.orange.com/tech_guide/2-legged-oauth/'
|
26
|
+
message + "\n\n"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class ApiError < StandardError
|
31
|
+
attr_reader :code, :message, :response, :status, :error_message, :description
|
32
|
+
|
33
|
+
def initialize(message, response)
|
34
|
+
@status = response.status
|
35
|
+
body = JSON.parse(response.body)
|
36
|
+
@code = body.fetch('code', nil)
|
37
|
+
@error_message = body.fetch('message', nil)
|
38
|
+
@description = body.fetch('description', nil)
|
39
|
+
@message = format_message(message)
|
40
|
+
@response = response
|
41
|
+
end
|
42
|
+
|
43
|
+
def to_s
|
44
|
+
message
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def format_message(initial_message)
|
50
|
+
message = "[HTTP #{status}] #{code} : #{initial_message}"
|
51
|
+
message += "\n#{error_message}" if error_message
|
52
|
+
message += "\n#{description}" if description
|
53
|
+
message += '\n For more details on Orange Api errors see https://developer.orange.com/apis/sms-sn/api-reference'
|
54
|
+
message + "\n\n"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/orange_sms.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
require 'orange_sms/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'orange_sms'
|
8
|
+
spec.version = OrangeSms::VERSION
|
9
|
+
spec.authors = ['Serigne Mouhamadou Bassirou Diaby']
|
10
|
+
|
11
|
+
spec.summary = 'ruby client that allows to send sms via the orange api'
|
12
|
+
spec.homepage = 'https://github.com/bayevels/orange-sms-ruby'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
15
|
+
|
16
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
17
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
end
|
19
|
+
spec.bindir = 'exe'
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_dependency 'faraday', '>= 0.9', '< 2.0'
|
24
|
+
|
25
|
+
# Development dependencies
|
26
|
+
spec.add_development_dependency 'minitest', '~> 5.0'
|
27
|
+
spec.add_development_dependency 'rails', '~> 5.2.0'
|
28
|
+
spec.add_development_dependency 'simplecov'
|
29
|
+
spec.add_development_dependency 'simplecov-small-badge'
|
30
|
+
spec.add_development_dependency 'sprockets', '3.7.2'
|
31
|
+
spec.add_development_dependency 'webmock'
|
32
|
+
end
|
data/script/travis.sh
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
set -e
|
3
|
+
QUICK=${QUICK:-}
|
4
|
+
|
5
|
+
if [ -z "$QUICK" ]; then
|
6
|
+
gem install bundler-audit && bundle-audit update && bundle-audit check
|
7
|
+
bundle exec rake
|
8
|
+
# only move to the gh-pages if not a PR or branch is master
|
9
|
+
if [ "$TRAVIS_PULL_REQUEST" = "false" ] || [ "$TRAVIS_BRANCH" = "master" ]; then
|
10
|
+
echo "Pushing badges upstream"
|
11
|
+
[ -d badges ] || mkdir badges
|
12
|
+
cp coverage/coverage_badge* badges/ 2>/dev/null || true
|
13
|
+
fi
|
14
|
+
|
15
|
+
fi
|
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: orange_sms
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Serigne Mouhamadou Bassirou Diaby
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-08-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.9'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.9'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: minitest
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '5.0'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '5.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rails
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 5.2.0
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 5.2.0
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: simplecov
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: simplecov-small-badge
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: sprockets
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - '='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 3.7.2
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - '='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 3.7.2
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: webmock
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
description:
|
118
|
+
email:
|
119
|
+
executables: []
|
120
|
+
extensions: []
|
121
|
+
extra_rdoc_files: []
|
122
|
+
files:
|
123
|
+
- ".gitignore"
|
124
|
+
- ".ruby-version"
|
125
|
+
- ".travis.yml"
|
126
|
+
- Gemfile
|
127
|
+
- LICENSE.txt
|
128
|
+
- README.md
|
129
|
+
- Rakefile
|
130
|
+
- bin/console
|
131
|
+
- bin/setup
|
132
|
+
- lib/generators/orange_sms/USAGE
|
133
|
+
- lib/generators/orange_sms/install_generator.rb
|
134
|
+
- lib/generators/orange_sms/templates/orange_sms.rb
|
135
|
+
- lib/orange_sms.rb
|
136
|
+
- lib/orange_sms/client.rb
|
137
|
+
- lib/orange_sms/error.rb
|
138
|
+
- lib/orange_sms/version.rb
|
139
|
+
- orange_sms.gemspec
|
140
|
+
- script/travis.sh
|
141
|
+
homepage: https://github.com/bayevels/orange-sms-ruby
|
142
|
+
licenses:
|
143
|
+
- MIT
|
144
|
+
metadata: {}
|
145
|
+
post_install_message:
|
146
|
+
rdoc_options: []
|
147
|
+
require_paths:
|
148
|
+
- lib
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 2.3.0
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
requirements: []
|
160
|
+
rubygems_version: 3.1.4
|
161
|
+
signing_key:
|
162
|
+
specification_version: 4
|
163
|
+
summary: ruby client that allows to send sms via the orange api
|
164
|
+
test_files: []
|