sms_traffic_sdk 0.0.1 → 0.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/.github/workflows/ci.yml +1 -4
- data/README.md +28 -5
- data/lib/sms_traffic/configuration.rb +13 -11
- data/lib/sms_traffic/sms.rb +2 -2
- data/lib/sms_traffic/version.rb +1 -1
- data/sms_traffic_sdk.gemspec +3 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd31453fcbcb3a4c917dca77ca0b8e3952407d4f1036891658ac6e8c071c1ee9
|
4
|
+
data.tar.gz: 8f33c69d556fe07454632c5149d7e775bf1604e02795d52d986474dc6d8385f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecd1839c1260f125c896598035175c5ce6c3b3b159e128bea7594c1842aadfd633b8c870012eb16c081e355784bfdf4d644120234562a6e9748a9c80733f88bf
|
7
|
+
data.tar.gz: 8bd005c31bc2b26fec505235d640a64af90f4db62ea4f1a3cf3f54c6e0d2d3aaa947c955e52088c312146b59700a8fff5da45cf7d5f8b0d1df1186d6b097971a
|
data/.github/workflows/ci.yml
CHANGED
@@ -7,10 +7,6 @@ on:
|
|
7
7
|
branches: [ main ]
|
8
8
|
release:
|
9
9
|
types: [created]
|
10
|
-
on:
|
11
|
-
push:
|
12
|
-
tags:
|
13
|
-
- 'v*'
|
14
10
|
|
15
11
|
jobs:
|
16
12
|
build:
|
@@ -51,6 +47,7 @@ jobs:
|
|
51
47
|
publish:
|
52
48
|
needs: build
|
53
49
|
runs-on: ubuntu-latest
|
50
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
54
51
|
steps:
|
55
52
|
- uses: actions/checkout@v2
|
56
53
|
|
data/README.md
CHANGED
@@ -1,10 +1,21 @@
|
|
1
1
|
# SmsTraffic
|
2
2
|
|
3
|
-
[](https://badge.fury.io/rb/sms_traffic_sdk)
|
4
4
|
[](https://codeclimate.com/github/golifox/sms_traffic/maintainability)
|
5
5
|
[](https://codecov.io/github/golifox/sms_traffic)
|
6
6
|
[](https://github.com/golifox/sms_traffic/actions/workflows/ci.yml)
|
7
7
|
|
8
|
+
Ruby Gem as a software development kit (SDK) that facilitates interaction with the SMS Traffic HTTP API (smstraffic.ru/api).
|
9
|
+
This gem provides a convenient wrapper to integrate SMS Traffic services within Ruby applications, allowing for easy
|
10
|
+
sending of SMS messages and checking delivery statuses.
|
11
|
+
|
12
|
+
## Features
|
13
|
+
|
14
|
+
- Send SMS messages to single or multiple recipients.
|
15
|
+
- Check the delivery status of sent messages.
|
16
|
+
- **TODO:** Support for various message formats and encodings.
|
17
|
+
|
18
|
+
|
8
19
|
## Installation
|
9
20
|
|
10
21
|
Add this line to your application's Gemfile:
|
@@ -23,7 +34,6 @@ Or install it yourself as:
|
|
23
34
|
|
24
35
|
## Usage
|
25
36
|
|
26
|
-
|
27
37
|
Define settings:
|
28
38
|
|
29
39
|
```ruby
|
@@ -81,13 +91,26 @@ reply.hash
|
|
81
91
|
|
82
92
|
```
|
83
93
|
|
84
|
-
|
94
|
+
# Contributing
|
95
|
+
|
96
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/golifox/sms_traffic_sdk.
|
85
97
|
|
86
98
|
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.
|
87
99
|
|
88
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
100
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
89
101
|
|
90
102
|
## License
|
91
103
|
|
92
|
-
The gem is available as open
|
104
|
+
The gem is available as open-source under the terms of the [MIT License](LICENSE).
|
105
|
+
|
106
|
+
## Contact
|
107
|
+
|
108
|
+
If you have any questions or feedback regarding SMS Traffic SDK, please feel free to contact us via GitHub issues or directly by email at i@golifox.ru.
|
109
|
+
|
110
|
+
## Acknowledgments
|
111
|
+
|
112
|
+
- Thanks to the SMS Traffic team for providing the API that this gem is based upon.
|
113
|
+
- Anyone who contributes to this project is greatly appreciated.
|
114
|
+
|
115
|
+
For more information please visit [SMS Traffic API docs](http://smstraffic.ru/api).
|
93
116
|
|
@@ -5,12 +5,13 @@ module SmsTraffic
|
|
5
5
|
class Configuration
|
6
6
|
include Singleton
|
7
7
|
|
8
|
-
attr_accessor :login, :password, :host, :originator, :debug, :logger, :xml_parser
|
8
|
+
attr_accessor :login, :password, :host, :originator, :debug, :logger, :xml_parser, :validate_phone
|
9
9
|
|
10
10
|
def initialize
|
11
|
-
self.debug
|
12
|
-
self.logger
|
13
|
-
self.xml_parser
|
11
|
+
self.debug = default_configuration[:debug]
|
12
|
+
self.logger = default_configuration[:logger]
|
13
|
+
self.xml_parser = default_configuration[:xml_parser]
|
14
|
+
self.validate_phone = default_configuration[:validate_phone]
|
14
15
|
super
|
15
16
|
end
|
16
17
|
|
@@ -46,13 +47,14 @@ module SmsTraffic
|
|
46
47
|
|
47
48
|
def default_configuration
|
48
49
|
{
|
49
|
-
login:
|
50
|
-
password:
|
51
|
-
host:
|
52
|
-
originator:
|
53
|
-
debug:
|
54
|
-
logger:
|
55
|
-
xml_parser:
|
50
|
+
login: nil,
|
51
|
+
password: nil,
|
52
|
+
host: nil,
|
53
|
+
originator: nil,
|
54
|
+
debug: false,
|
55
|
+
logger: $stdout,
|
56
|
+
xml_parser: default_xml_parser,
|
57
|
+
validate_phone: true
|
56
58
|
}
|
57
59
|
end
|
58
60
|
|
data/lib/sms_traffic/sms.rb
CHANGED
@@ -45,10 +45,10 @@ module SmsTraffic
|
|
45
45
|
|
46
46
|
private
|
47
47
|
|
48
|
-
def validate!
|
48
|
+
def validate! # rubocop:disable Metrics/ AbcSize
|
49
49
|
raise ArgumentError, "Phone should be assigned to #{self.class}." if phone.nil?
|
50
50
|
|
51
|
-
|
51
|
+
if SmsTraffic.configuration.validate_phone && phone.to_s !~ /^[0-9]{11,}$/
|
52
52
|
raise ArgumentError, 'Phone number should contain only numbers. Minimum length is 11.'
|
53
53
|
end
|
54
54
|
|
data/lib/sms_traffic/version.rb
CHANGED
data/sms_traffic_sdk.gemspec
CHANGED
@@ -10,7 +10,9 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['i@golifox.ru']
|
11
11
|
|
12
12
|
spec.summary = 'Send sms via SmsTraffic service.'
|
13
|
-
spec.description = '
|
13
|
+
spec.description = 'Ruby Gem as a SDK for interacting with the SMS Traffic HTTP API (smstraffic.ru/api).
|
14
|
+
This gem provides a convenient way to integrate SMS Traffic services into Ruby applications,
|
15
|
+
enabling tasks such as sending SMS messages, checking delivery status, and others.'
|
14
16
|
spec.homepage = 'https://github.com/golifox/sms_traffic'
|
15
17
|
spec.license = 'MIT'
|
16
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sms_traffic_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rybolovlev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -52,7 +52,10 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.5'
|
55
|
-
description:
|
55
|
+
description: |-
|
56
|
+
Ruby Gem as a SDK for interacting with the SMS Traffic HTTP API (smstraffic.ru/api).
|
57
|
+
This gem provides a convenient way to integrate SMS Traffic services into Ruby applications,
|
58
|
+
enabling tasks such as sending SMS messages, checking delivery status, and others.
|
56
59
|
email:
|
57
60
|
- i@golifox.ru
|
58
61
|
executables:
|
@@ -89,7 +92,7 @@ licenses:
|
|
89
92
|
- MIT
|
90
93
|
metadata:
|
91
94
|
rubygems_mfa_required: 'true'
|
92
|
-
post_install_message:
|
95
|
+
post_install_message:
|
93
96
|
rdoc_options: []
|
94
97
|
require_paths:
|
95
98
|
- lib
|
@@ -105,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
108
|
version: '0'
|
106
109
|
requirements: []
|
107
110
|
rubygems_version: 3.5.11
|
108
|
-
signing_key:
|
111
|
+
signing_key:
|
109
112
|
specification_version: 4
|
110
113
|
summary: Send sms via SmsTraffic service.
|
111
114
|
test_files: []
|