raja_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 +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +44 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/faraday_middleware/raise_http_exception.rb +57 -0
- data/lib/raja_sms.rb +20 -0
- data/lib/raja_sms/client.rb +98 -0
- data/lib/raja_sms/configuration.rb +10 -0
- data/lib/raja_sms/entities/balance.rb +15 -0
- data/lib/raja_sms/entities/base.rb +9 -0
- data/lib/raja_sms/error.rb +56 -0
- data/lib/raja_sms/version.rb +3 -0
- data/raja_sms.gemspec +41 -0
- metadata +148 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 984846d9b6de00852ade7669430cda6bec9d3de6
|
4
|
+
data.tar.gz: 81e7c8a1610a18e1452a1a1b3b8cf5f242d69227
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d80681338cd225dd6cf5260523e62b1173761879c2dcc7b7fb946c67dd833c8b0c8dff04b0e9a1b7640a16bf8531cccd5aecca6fd47f638df20b26cf01bcb59d
|
7
|
+
data.tar.gz: 4b814c22772ae641d2dfb7f96c5bb671abeb1ed6cdc17fad0f3898bcbb3beaef1eff7487a39ff86438485d5682d87368a13a08a7de5409c8c50039f48ac8cf1c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at mr.andymarthin@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
raja_sms (0.1.0)
|
5
|
+
faraday (~> 0.15.4)
|
6
|
+
faraday_middleware (~> 0.13.1)
|
7
|
+
model_attribute (~> 3.2.0)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
diff-lcs (1.3)
|
13
|
+
faraday (0.15.4)
|
14
|
+
multipart-post (>= 1.2, < 3)
|
15
|
+
faraday_middleware (0.13.1)
|
16
|
+
faraday (>= 0.7.4, < 1.0)
|
17
|
+
model_attribute (3.2.0)
|
18
|
+
multipart-post (2.0.0)
|
19
|
+
rake (10.5.0)
|
20
|
+
rspec (3.8.0)
|
21
|
+
rspec-core (~> 3.8.0)
|
22
|
+
rspec-expectations (~> 3.8.0)
|
23
|
+
rspec-mocks (~> 3.8.0)
|
24
|
+
rspec-core (3.8.0)
|
25
|
+
rspec-support (~> 3.8.0)
|
26
|
+
rspec-expectations (3.8.2)
|
27
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
+
rspec-support (~> 3.8.0)
|
29
|
+
rspec-mocks (3.8.0)
|
30
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
+
rspec-support (~> 3.8.0)
|
32
|
+
rspec-support (3.8.0)
|
33
|
+
|
34
|
+
PLATFORMS
|
35
|
+
ruby
|
36
|
+
|
37
|
+
DEPENDENCIES
|
38
|
+
bundler (~> 1.16)
|
39
|
+
raja_sms!
|
40
|
+
rake (~> 10.0)
|
41
|
+
rspec (~> 3.0)
|
42
|
+
|
43
|
+
BUNDLED WITH
|
44
|
+
1.16.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Andy Marthin
|
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,43 @@
|
|
1
|
+
# RajaSms
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/raja_sms`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'raja_sms'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install raja_sms
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/andymarthin/raja_sms. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the RajaSms project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/raja_sms/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "raja_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,57 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
module FaradayMiddleware
|
4
|
+
class RaiseHttpException < Faraday::Middleware
|
5
|
+
def call(env)
|
6
|
+
@app.call(env).on_complete do |response|
|
7
|
+
case response[:status].to_i
|
8
|
+
when 400
|
9
|
+
raise RajaSms::BadRequest, error_message_400(response)
|
10
|
+
when 401
|
11
|
+
raise RajaSms::Unauthorized, error_message_400(response)
|
12
|
+
when 403
|
13
|
+
raise RajaSms::Forbidden, error_message_400(response)
|
14
|
+
when 404
|
15
|
+
raise RajaSms::NotFound, error_message_400(response)
|
16
|
+
when 500
|
17
|
+
raise RajaSms::InternalServerError, error_message_500(response, "Something is technically wrong.")
|
18
|
+
when 502
|
19
|
+
raise RajaSms::BadGateway, error_message_500(response, "The server returned an invalid or incomplete response.")
|
20
|
+
when 504
|
21
|
+
raise RajaSms::GatewayTimeout, error_message_500(response, "504 Gateway Time-out")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def initialize(app)
|
27
|
+
super app
|
28
|
+
@parser = nil
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def error_message_400(response)
|
34
|
+
"#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:status]}#{error_body(response[:body])}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def error_body(body)
|
38
|
+
# body gets passed as a string, not sure if it is passed as something else from other spots?
|
39
|
+
if not body.nil? and not body.empty? and body.kind_of?(String)
|
40
|
+
# removed multi_json thanks to wesnolte's commit
|
41
|
+
body = ::JSON.parse(body)
|
42
|
+
end
|
43
|
+
|
44
|
+
if body.nil?
|
45
|
+
nil
|
46
|
+
elsif body['meta'] and body['meta']['error_message'] and not body['meta']['error_message'].empty?
|
47
|
+
": #{body['meta']['error_message']}"
|
48
|
+
elsif body['error_message'] and not body['error_message'].empty?
|
49
|
+
": #{body['error_type']}: #{body['error_message']}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def error_message_500(response, body=nil)
|
54
|
+
"#{response[:method].to_s.upcase} #{response[:url].to_s}: #{[response[:status].to_s + ':', body].compact.join(' ')}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/raja_sms.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "raja_sms/version"
|
2
|
+
require "raja_sms/configuration"
|
3
|
+
|
4
|
+
module RajaSms
|
5
|
+
class << self
|
6
|
+
attr_accessor :configuration
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.configuration
|
10
|
+
@configuration ||= Configuration.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.reset
|
14
|
+
@configuration = Configuration.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.configure
|
18
|
+
yield(configuration)
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require "faraday_middleware"
|
3
|
+
require "json"
|
4
|
+
require "ostruct"
|
5
|
+
|
6
|
+
module RajaSms
|
7
|
+
class Client
|
8
|
+
|
9
|
+
def initialize(host = nil, api_key = nil)
|
10
|
+
@host = host || RajaSms.configuration.host
|
11
|
+
@api_key = api_key || RajaSms.configuration.api_key
|
12
|
+
|
13
|
+
raise RajaSms::InvalidHostError if @host.nil?
|
14
|
+
raise RajaSms::InvalidApiKeyError if @api_key.nil?
|
15
|
+
|
16
|
+
@connection ||= setup_connection
|
17
|
+
end
|
18
|
+
|
19
|
+
def regular(phone_number, message)
|
20
|
+
path = '/sms/api_sms_reguler_send_json.php'
|
21
|
+
payload = make_payload(phone_number, message)
|
22
|
+
response = make_request(path, 'post', payload)
|
23
|
+
|
24
|
+
json_parsed(response.body)
|
25
|
+
end
|
26
|
+
|
27
|
+
def masking(phone_number, message, sending_time = '')
|
28
|
+
path = "/sms/api_sms_masking_send_json.php"
|
29
|
+
payload = make_payload(phone_number, message)
|
30
|
+
payload[:datapacket].first.merge!({sendingdatetime: sending_time})
|
31
|
+
response = make_request(path, 'post', payload)
|
32
|
+
json_parsed(response.body)
|
33
|
+
end
|
34
|
+
|
35
|
+
def otp(phone_number, message)
|
36
|
+
payload = make_payload(phone_number, message)
|
37
|
+
path = "/sms/api_sms_otp_send_json.php"
|
38
|
+
response = make_request(path, 'post', payload)
|
39
|
+
|
40
|
+
json_parsed(response.body)
|
41
|
+
end
|
42
|
+
|
43
|
+
def balance
|
44
|
+
path = "/sms/api_sms_reguler_balance_json.php"
|
45
|
+
payload = {apikey: @api_key}
|
46
|
+
response = make_request(path, 'post', payload)
|
47
|
+
body = json_parsed(response.body)
|
48
|
+
|
49
|
+
attribute = {
|
50
|
+
amount: body.Balance,
|
51
|
+
expired: body.Expired
|
52
|
+
}
|
53
|
+
RajaSms::Entities::Balance.new(attribute)
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def make_payload(phone_number, message)
|
59
|
+
raise RajaSms::InvalidPhoneNumberError if phone_number.empty?
|
60
|
+
raise RajaSms::InvalidMessageError if message.empty?
|
61
|
+
{
|
62
|
+
apikey: @api_key,
|
63
|
+
callbackurl: '',
|
64
|
+
datapacket: [
|
65
|
+
{
|
66
|
+
number: phone_number,
|
67
|
+
message: message
|
68
|
+
}
|
69
|
+
]
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
def setup_connection
|
74
|
+
# start setting up connections
|
75
|
+
Faraday.new(url: @host) do |faraday|
|
76
|
+
faraday.use FaradayMiddleware::RaiseHttpException
|
77
|
+
faraday.response :logger # log requests to STDOUT
|
78
|
+
faraday.request :url_encoded
|
79
|
+
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def make_request(endpoint, method, payload = {}, headers = {})
|
84
|
+
# make a request to raja sms
|
85
|
+
return @connection.post(endpoint, payload.to_json, headers) if method == 'post'
|
86
|
+
|
87
|
+
@connection.get endpoint
|
88
|
+
end
|
89
|
+
|
90
|
+
def json_parsed(body)
|
91
|
+
body_parsed = JSON.parse(body, object_class: OpenStruct)
|
92
|
+
response = body_parsed.sending_respon.nil? ? body_parsed.balance_respon.first : body_parsed.sending_respon.first
|
93
|
+
status = response.globalstatus.to_s
|
94
|
+
raise RajaSms::ResponseError, response.globalstatustext if status != "10"
|
95
|
+
response
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module RajaSms
|
2
|
+
# Custom error class for rescuing from all Raja Sms API errors
|
3
|
+
class Error < StandardError; end
|
4
|
+
|
5
|
+
# Raised when Raja Sms API returns the HTTP status code 400
|
6
|
+
class BadRequest < Error; end
|
7
|
+
|
8
|
+
# Raised when Raja Sms API returns the HTTP status code 401
|
9
|
+
class Unauthorized < Error; end
|
10
|
+
|
11
|
+
# Raised when Raja Sms API returns the HTTP status code 403
|
12
|
+
class Forbidden < Error; end
|
13
|
+
|
14
|
+
# Raised when Raja Sms API returns the HTTP status code 404
|
15
|
+
class NotFound < Error; end
|
16
|
+
|
17
|
+
# Raised when Raja Sms API returns the HTTP status code 500
|
18
|
+
class InternalServerError < Error; end
|
19
|
+
|
20
|
+
# Raised when Raja Sms API returns the HTTP status code 502
|
21
|
+
class BadGateway < Error; end
|
22
|
+
|
23
|
+
# Raised when Raja Sms API returns the HTTP status code 504
|
24
|
+
class GatewayTimeout < Error; end
|
25
|
+
|
26
|
+
# Raised when invalid phone number
|
27
|
+
class InvalidPhoneNumberError < Error
|
28
|
+
def initialize(msg = "Invalid Phone Number Error")
|
29
|
+
super
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Raised when invalid message
|
34
|
+
class InvalidMessageError < Error
|
35
|
+
def initialize(msg = "Invalid Message Error")
|
36
|
+
super
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Raised when host invalid
|
41
|
+
class InvalidHostError < Error
|
42
|
+
def initialize(msg = "Invalid Host End Point Error")
|
43
|
+
super
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# Raised when api key invalid
|
48
|
+
class InvalidApiKeyError < Error
|
49
|
+
def initialize(msg= "Invalid Api Key Error")
|
50
|
+
super
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Raised when api return global status not 10
|
55
|
+
class ResponseError < Error; end
|
56
|
+
end
|
data/raja_sms.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "raja_sms/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "raja_sms"
|
8
|
+
spec.version = RajaSms::VERSION
|
9
|
+
spec.authors = ["Andy Marthin"]
|
10
|
+
spec.email = ["mr.andymarthin@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{ Gem for integrate with Raja Sms}
|
13
|
+
spec.homepage = "https://github.com/andymarthin/raja_sms"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
+
# if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
# else
|
21
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
22
|
+
# "public gem pushes."
|
23
|
+
# end
|
24
|
+
|
25
|
+
# Specify which files should be added to the gem when it is released.
|
26
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
28
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
29
|
+
end
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
35
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
37
|
+
|
38
|
+
spec.add_dependency 'model_attribute', "~> 3.2.0"
|
39
|
+
spec.add_dependency 'faraday', '~> 0.15.4'
|
40
|
+
spec.add_dependency 'faraday_middleware', '~> 0.13.1'
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: raja_sms
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andy Marthin
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-04-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: model_attribute
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.2.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.2.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faraday
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.15.4
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.15.4
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faraday_middleware
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.13.1
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.13.1
|
97
|
+
description:
|
98
|
+
email:
|
99
|
+
- mr.andymarthin@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
107
|
+
- CODE_OF_CONDUCT.md
|
108
|
+
- Gemfile
|
109
|
+
- Gemfile.lock
|
110
|
+
- LICENSE.txt
|
111
|
+
- README.md
|
112
|
+
- Rakefile
|
113
|
+
- bin/console
|
114
|
+
- bin/setup
|
115
|
+
- lib/faraday_middleware/raise_http_exception.rb
|
116
|
+
- lib/raja_sms.rb
|
117
|
+
- lib/raja_sms/client.rb
|
118
|
+
- lib/raja_sms/configuration.rb
|
119
|
+
- lib/raja_sms/entities/balance.rb
|
120
|
+
- lib/raja_sms/entities/base.rb
|
121
|
+
- lib/raja_sms/error.rb
|
122
|
+
- lib/raja_sms/version.rb
|
123
|
+
- raja_sms.gemspec
|
124
|
+
homepage: https://github.com/andymarthin/raja_sms
|
125
|
+
licenses:
|
126
|
+
- MIT
|
127
|
+
metadata: {}
|
128
|
+
post_install_message:
|
129
|
+
rdoc_options: []
|
130
|
+
require_paths:
|
131
|
+
- lib
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - ">="
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
requirements: []
|
143
|
+
rubyforge_project:
|
144
|
+
rubygems_version: 2.6.13
|
145
|
+
signing_key:
|
146
|
+
specification_version: 4
|
147
|
+
summary: Gem for integrate with Raja Sms
|
148
|
+
test_files: []
|