smsaero_api 1.0 → 1.1

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: 9558d4ef3ba027cfb57899bd1c945bafdbaf4a172edc37893547ba08e2213dd2
4
- data.tar.gz: 404136062f07eff8c3d6f8e2b93be2178fcdfa3082f3be4b70179ef871b8cab2
3
+ metadata.gz: de34fedc8f84e313efe1b8c098d371bb6f87fbe75b9e4f3c45dff5bd3053aee0
4
+ data.tar.gz: 254f86f7b61885facf90e1e9144c8f3315454da45bc017ea4a13efeaa6aaec45
5
5
  SHA512:
6
- metadata.gz: 4c79a8d2b999148a53ce9d73d011829b7a163f4d502c67f8971fa69ec3b3634b30f6f02b045cd2b8431a527b716705daefa7b1e036bb7984356c80701d8ef612
7
- data.tar.gz: b8d3ea6b8afb6d53b6dceb473d77c090c0b7a290417645d024b087fed3e7c5a0ed8ea3ebe7cd66a57597bf44331e67a3aeb8a0e12f192472bd39f47da85f8354
6
+ metadata.gz: 6644c8568b9cb98502d0b0da18c0f4299004d62afe4702d8072703bcc1ae90a2f359413dedc54af55c3a4078842475d16216476a6051ec21d60898e7c054e049
7
+ data.tar.gz: b174dcd339976bae0a9842219351cfce1a3debfe9f83549af8856dfdfa11e0ffba54f951c412cac16d664c786529040d0368b9a20d368d6febee91adf0498164
data/.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.homepage = "https://smsaero.ru/integration/class/ruby"
14
14
  s.metadata = { "source_code_uri" => "https://github.com/smsaero/smsaero_ruby" }
15
15
 
16
- s.required_ruby_version = '>= 2.6.0'
16
+ s.required_ruby_version = '>= 2.5.0'
17
17
 
18
18
  s.files = `git ls-files`.split("\n")
19
19
  s.require_paths = ["lib"]
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 SmsAero
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -18,11 +18,20 @@ SMSAERO_API_KEY = 'your api key'
18
18
 
19
19
  api = SmsAeroApi::SmsAero.new(SMSAERO_EMAIL, SMSAERO_API_KEY)
20
20
 
21
+ # Send SMS message
21
22
  begin
22
23
  puts api.send('70000000000', 'Hello, World!')
23
24
  rescue => e
24
25
  puts "Error: #{e.message}"
25
26
  end
27
+
28
+ # Send Telegram code
29
+ begin
30
+ result = api.send_telegram('70000000000', 1234, 'SMS Aero', 'Ваш код 1234')
31
+ puts "Telegram sent: #{result}"
32
+ rescue => e
33
+ puts "Error: #{e.message}"
34
+ end
26
35
  ```
27
36
 
28
37
 
@@ -1,3 +1,3 @@
1
1
  module SmsAeroApi
2
- VERSION = '1.0'
2
+ VERSION = '1.1'
3
3
  end
data/lib/smsaero_api.rb CHANGED
@@ -21,7 +21,6 @@ module SmsAeroApi
21
21
  '@gate.smsaero.ru/v2/',
22
22
  '@gate.smsaero.org/v2/',
23
23
  '@gate.smsaero.net/v2/',
24
- '@gate.smsaero.uz/v2/'
25
24
  ]
26
25
  SIGNATURE = 'SMS Aero'
27
26
  TYPE_SEND = 2
@@ -59,6 +58,23 @@ module SmsAeroApi
59
58
  request('sms/status', { 'id' => sms_id })
60
59
  end
61
60
 
61
+ def send_telegram(number, code, sign = nil, text = nil)
62
+ num, number = get_num(number)
63
+ data = {
64
+ num => number,
65
+ 'code' => code.to_i
66
+ }
67
+
68
+ data['sign'] = sign if sign
69
+ data['text'] = text if text
70
+
71
+ request('telegram/send', data)
72
+ end
73
+
74
+ def telegram_status(telegram_id)
75
+ request('telegram/status', { 'id' => telegram_id.to_i })
76
+ end
77
+
62
78
  def sms_list(number = nil, text = nil, page = nil)
63
79
  data = {}
64
80
  if number
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smsaero_api
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - SmsAero
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-06-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Send SMS/HLR/Viber via smsaero.ru gate
14
13
  email:
@@ -20,6 +19,7 @@ files:
20
19
  - ".gemspec"
21
20
  - ".gitignore"
22
21
  - Gemfile
22
+ - LICENSE
23
23
  - README.md
24
24
  - Rakefile
25
25
  - lib/smsaero_api.rb
@@ -29,7 +29,6 @@ licenses:
29
29
  - MIT
30
30
  metadata:
31
31
  source_code_uri: https://github.com/smsaero/smsaero_ruby
32
- post_install_message:
33
32
  rdoc_options: []
34
33
  require_paths:
35
34
  - lib
@@ -37,15 +36,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: 2.6.0
39
+ version: 2.5.0
41
40
  required_rubygems_version: !ruby/object:Gem::Requirement
42
41
  requirements:
43
42
  - - ">="
44
43
  - !ruby/object:Gem::Version
45
44
  version: '0'
46
45
  requirements: []
47
- rubygems_version: 3.5.11
48
- signing_key:
46
+ rubygems_version: 3.6.9
49
47
  specification_version: 4
50
48
  summary: Send SMS via smsaero.ru gate
51
49
  test_files: []