smsapipl 0.2.0 → 0.2.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: 8da986da8c572fcd77cfb8127cca2a99b7d194c22952aa44ce6926f7d5338799
4
- data.tar.gz: e7a773a4adc5834d7765c0d55c087850673b9f48e36973a0fd388cc77a6cc5db
3
+ metadata.gz: 3e0d75cc5fe7f65b239d96fcd1203195e6dcc91a4e110ea9104a1636922ca6c2
4
+ data.tar.gz: 760a1f789f7534b3e426d606e3224e75dad676eff830bd843f9fdc313c4bcb75
5
5
  SHA512:
6
- metadata.gz: 6dd091708fc2d73db19a7e845dcb0011c1c62aadc82eed6331deab6a228791ddc279cb45c9dd59d863cda14b0e9da4e0e72ee3b43b5cf872836e57619e28b031
7
- data.tar.gz: 0a2d920c556422a12ee77531c75c5bc93f3c973fffedb1cfd8da178fbb1913a2c0e628e6ba5b9611c3c6e5bb8eb247edf338602676bb5f63ff6c2443ca47e6d4
6
+ metadata.gz: 5c1b7cbaa4598b6cedbb0d9f2f0d24bbe6d752beda5d8e01e41cef2cac2c4c5d70e702320ab77fcf469ebf50920d5a650dc78263d7caaa978bf367e2e0be048c
7
+ data.tar.gz: b54f8a835cd80967c7ef89b69312272f7ab513a41e3295c08fffa6ab36f9dce8ffd213a7054c9a13b658d7fe90689dab3094f189531152799c932780b9a140b5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.2.1
2
+ - Fix FrozenError on Ruby 3.2+ (cached Net::HTTP connection caused frozen SSL context after first request)
3
+ - Fix SSL verification (VERIFY_NONE → VERIFY_PEER)
4
+ - Fix homepage URL in gemspec
5
+
6
+ # 0.2.0
7
+ - SMS Templates support
8
+
1
9
  # 0.1.0
2
10
  - Server connection
3
11
  - Simple SMS
data/README.md CHANGED
@@ -1,6 +1,38 @@
1
+ Simple Gem Wrapper for SMSAPI.pl
2
+
3
+ Cuurent supported version of API - 3.1
4
+
5
+ # Usage
6
+
7
+ Smsapipl.configure do |config|
8
+ config.token = 'XYZ' # You need to get it from SMSAPI.pl portal
9
+ config.from = 'NAME' # You need to define it in SMSAPI.pl portal
10
+ end
11
+
12
+
13
+ ## Profile
14
+ profile = Smsapipl::Profile.check ## Returns unparsed JSON
15
+ points = Smsapipl::Profile.points ## Returns float with points remaining
16
+
17
+ ## SMS
18
+
19
+ ### Single SMS
20
+ sms = Smsapipl::Sms.send(message: 'Lorem ipsum', to: 'PHONE-NUMBER', optional\_params: {date: '1577878200'})
21
+ sms -> "OK:677AE5C334633117B60A49A6:0.155"
22
+
23
+
24
+ ### Template SMS
25
+ sms = Smsapipl::SmsTemplate.send(template: 'TEMPLATE-NAME', to: 'PHONE-NUMBER', template\_params: {param1: 'A', param2: 'B'})
26
+ sms -> "OK:677AE5C334633117B60A49A6:0.155"
27
+ You need to define template in SMSAPI.pl portal. Params only allowed in form paramX where X-> (1..4)
28
+
29
+
30
+ # Build
31
+
1
32
  BUILD
2
33
  gem build *.gemspec -o pkg/smsapipl.gem
3
34
 
4
35
 
5
36
  INSTALL
6
37
  gem install pkg/*.gem
38
+
@@ -28,7 +28,7 @@ module Smsapipl
28
28
  end
29
29
 
30
30
  def connection
31
- @connection ||= Smsapipl::Connection.new(api[:uri], api[:port]).connection
31
+ Smsapipl::Connection.new(api[:uri], api[:port]).connection
32
32
  end
33
33
 
34
34
  def get(path:, params:)
@@ -25,7 +25,8 @@ module Smsapipl
25
25
  def default_params
26
26
  {
27
27
  test: '0',
28
- encoding: 'utf-8'
28
+ encoding: 'utf-8',
29
+ format: 'json'
29
30
  }
30
31
  end
31
32
  end
@@ -15,7 +15,7 @@ module Smsapipl
15
15
  def connection
16
16
  connection = Net::HTTP.new(uri, port)
17
17
  connection.use_ssl = true
18
- connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
18
+ connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
19
19
 
20
20
  connection
21
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Smsapipl
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
data/smsapipl.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
 
14
14
  spec.summary = 'SMSAPI.pl Ruby client - version 2025'
15
15
  spec.description = 'Wrapper for SMSAPI.pl.'
16
- spec.homepage = 'https://github.com/Poltrax.live/smsapipl'
16
+ spec.homepage = 'https://github.com/Poltrax-live/smsapipl'
17
17
  spec.license = 'MIT'
18
18
 
19
19
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smsapipl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Staszek Zawadzki
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-01-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -70,11 +69,10 @@ files:
70
69
  - lib/smsapipl/sms_template.rb
71
70
  - lib/smsapipl/version.rb
72
71
  - smsapipl.gemspec
73
- homepage: https://github.com/Poltrax.live/smsapipl
72
+ homepage: https://github.com/Poltrax-live/smsapipl
74
73
  licenses:
75
74
  - MIT
76
75
  metadata: {}
77
- post_install_message:
78
76
  rdoc_options: []
79
77
  require_paths:
80
78
  - lib
@@ -89,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
87
  - !ruby/object:Gem::Version
90
88
  version: '0'
91
89
  requirements: []
92
- rubygems_version: 3.5.18
93
- signing_key:
90
+ rubygems_version: 3.6.9
94
91
  specification_version: 4
95
92
  summary: SMSAPI.pl Ruby client - version 2025
96
93
  test_files: []