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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97b598c2448cc5371fb1d2dd91d0f5706473ea3657e5494e4e72edb53a304792
4
- data.tar.gz: 4f42caff68f07f17e841119111b013dd40be2cda9b321bb8e7bdafa4509ddb2e
3
+ metadata.gz: cd31453fcbcb3a4c917dca77ca0b8e3952407d4f1036891658ac6e8c071c1ee9
4
+ data.tar.gz: 8f33c69d556fe07454632c5149d7e775bf1604e02795d52d986474dc6d8385f3
5
5
  SHA512:
6
- metadata.gz: 2b09f25a918672f487011f79861441f96b650625f1fc9cf0db213a9204b8cfab9f78b1d883b3ed76da5ba0d6b47d6bd1d52710c0cb902e386cffc0f625f76c13
7
- data.tar.gz: fe2cfb46546cf8438b325e2a676e28792d2ff585a13ac75304af2a3079a2401f72acbb7c00c7af2f5fe3a2748a799d622f204dec1442b025215f96ccfd38239b
6
+ metadata.gz: ecd1839c1260f125c896598035175c5ce6c3b3b159e128bea7594c1842aadfd633b8c870012eb16c081e355784bfdf4d644120234562a6e9748a9c80733f88bf
7
+ data.tar.gz: 8bd005c31bc2b26fec505235d640a64af90f4db62ea4f1a3cf3f54c6e0d2d3aaa947c955e52088c312146b59700a8fff5da45cf7d5f8b0d1df1186d6b097971a
@@ -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
- [![Gem Version](https://badge.fury.io/rb/sms_traffic.svg)](https://badge.fury.io/rb/sms_traffic)
3
+ [![Gem Version](https://badge.fury.io/rb/sms_traffic_sdk.svg)](https://badge.fury.io/rb/sms_traffic_sdk)
4
4
  [![Maintainability](https://api.codeclimate.com/v1/badges/bb4795be5024dd81d927/maintainability)](https://codeclimate.com/github/golifox/sms_traffic/maintainability)
5
5
  [![Coverage](https://codecov.io/github/golifox/sms_traffic/graph/badge.svg?token=74C0YBJP3F)](https://codecov.io/github/golifox/sms_traffic)
6
6
  [![CI](https://github.com/golifox/sms_traffic/actions/workflows/ci.yml/badge.svg?branch=main)](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
- ## Development
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 source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
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 = default_configuration[:debug]
12
- self.logger = default_configuration[:logger]
13
- self.xml_parser = default_configuration[: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: nil,
50
- password: nil,
51
- host: nil,
52
- originator: nil,
53
- debug: false,
54
- logger: $stdout,
55
- xml_parser: default_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
 
@@ -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
- unless phone.to_s =~ /^[0-9]{11}$/
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
 
@@ -1,3 +1,3 @@
1
1
  module SmsTraffic
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.2'.freeze
3
3
  end
@@ -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 = 'Send sms via SmsTraffic service.'
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.1
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-07-15 00:00:00.000000000 Z
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: Send sms via SmsTraffic service.
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: []