sms_traffic_sdk 0.0.8 → 0.2.0

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.
@@ -1,72 +0,0 @@
1
- name: Ruby Gem CI/CD
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- pull_request:
7
- branches: [ main ]
8
- release:
9
- types: [created]
10
-
11
- jobs:
12
- build:
13
- runs-on: ubuntu-latest
14
- strategy:
15
- matrix:
16
- ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3']
17
-
18
- steps:
19
- - uses: actions/checkout@v2
20
-
21
- - name: Set up Ruby
22
- uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby-version }}
25
-
26
- - name: Install Bundler for Ruby < 3.0
27
- if: ${{ matrix.ruby-version < '3.0' }}
28
- run: gem install bundler -v 2.4.22 --no-document
29
-
30
- - name: Install Bundler for Ruby >= 3.0
31
- if: ${{ matrix.ruby-version >= '3.0' }}
32
- run: gem install bundler -v '~> 2.5' --no-document
33
-
34
- - name: Install dependencies
35
- run: bundle install --jobs 4 --retry 3
36
-
37
- - name: Run tests and linting
38
- run: bundle exec rake
39
-
40
- - name: Upload coverage reports to Codecov
41
- uses: codecov/codecov-action@v4.0.1
42
- with:
43
- token: ${{ secrets.CODECOV_TOKEN }}
44
- file: ./coverage/.resultset.json
45
- fail_ci_if_error: false
46
-
47
- publish:
48
- needs: build
49
- runs-on: ubuntu-latest
50
- if: startsWith(github.ref, 'refs/tags/v')
51
- steps:
52
- - uses: actions/checkout@v2
53
-
54
- - name: Set up Ruby for publish
55
- uses: ruby/setup-ruby@v1
56
- with:
57
- ruby-version: '3.3'
58
-
59
- - name: Install dependencies
60
- run: |
61
- gem install bundler --no-document
62
- bundle install --jobs 4 --retry 3
63
-
64
- - name: Build gem
65
- run: |
66
- gem build *.gemspec
67
-
68
- - name: Push gem to RubyGems
69
- run: |
70
- gem push *.gem
71
- env:
72
- GEM_HOST_API_KEY: ${{secrets.GEM_HOST_API_KEY}}
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- .idea/
11
- .rspec_status
12
- .env
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --require spec_helper
2
- --color
data/.rubocop.yml DELETED
@@ -1,20 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.7.4
3
- NewCops: enable
4
- SuggestExtensions: false
5
- Exclude:
6
- - 'bin/**/*'
7
-
8
- Style/Documentation:
9
- Enabled: false
10
-
11
- Style/FrozenStringLiteralComment:
12
- EnforcedStyle: 'never'
13
-
14
- Layout/HashAlignment:
15
- EnforcedHashRocketStyle: table
16
- EnforcedColonStyle: table
17
-
18
- Metrics/BlockLength:
19
- Exclude:
20
- - 'spec/**/*'
data/.tool-versions DELETED
@@ -1 +0,0 @@
1
- ruby 3.3.3
data/Gemfile DELETED
@@ -1,17 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- group :development, :test do
6
- gem 'dotenv', '~> 2.7'
7
- gem 'fasterer', '~> 0.9'
8
- gem 'rack', '~> 3.1.7'
9
- gem 'rake', '~> 13.2'
10
- gem 'rspec', '~> 3.10'
11
- gem 'rspec-mocks', '~> 3.10'
12
- gem 'rubocop', '~> 1.18'
13
- gem 'rubocop-performance', '~> 1.11'
14
- gem 'rubocop-rspec', '~> 2.11'
15
- gem 'simplecov', '~> 0.22'
16
- gem 'webmock', '~> 3.14'
17
- end
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- require 'rubocop/rake_task'
7
-
8
- RuboCop::RakeTask.new
9
-
10
- task default: %i[spec rubocop]
data/bin/console DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'bundler/setup'
4
- require 'dotenv'
5
- require 'sms_traffic'
6
-
7
- Dotenv.load('.env')
8
-
9
- SmsTraffic.configure do |config|
10
- config.host = ENV['SMS_TRAFFIC_HOST']
11
- config.login = ENV['SMS_TRAFFIC_LOGIN']
12
- config.password = ENV['SMS_TRAFFIC_PASSWORD']
13
- config.originator = ENV['SMS_TRAFFIC_ORIGINATOR']
14
- end
15
-
16
-
17
- require 'irb'
18
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here
data/exe/konsierge-sms.rb DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'konsierge/sms_traffic'
@@ -1,39 +0,0 @@
1
- require_relative 'deliver_reply'
2
- require_relative 'status_reply'
3
-
4
- module SmsTraffic
5
- class Client
6
- class Response
7
- attr_reader :origin, :reply, :code, :body, :message
8
-
9
- REPLY_HASH_MAP = {
10
- :status => StatusReply,
11
- :deliver => DeliverReply,
12
- nil => Reply
13
- }.freeze
14
-
15
- def initialize(response, type: nil)
16
- @origin = response
17
- @code = response.code.to_i
18
- @body = response.body
19
- @message = response.message
20
-
21
- return unless success?
22
-
23
- @reply = REPLY_HASH_MAP[type].new(body)
24
- end
25
-
26
- def success?
27
- code == 200
28
- end
29
-
30
- def failure?
31
- !success?
32
- end
33
-
34
- def error_description
35
- "#{code}: #{message}" if failure?
36
- end
37
- end
38
- end
39
- end
@@ -1,31 +0,0 @@
1
- lib = File.expand_path('lib', __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
-
4
- require_relative 'lib/sms_traffic/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'sms_traffic_sdk'
8
- spec.version = SmsTraffic::VERSION
9
- spec.authors = ['David Rybolovlev']
10
- spec.email = ['i@golifox.ru']
11
-
12
- spec.summary = '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.'
16
- spec.homepage = 'https://github.com/golifox/sms_traffic'
17
- spec.license = 'MIT'
18
-
19
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
- spec.bindir = 'exe'
21
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
- spec.require_paths = ['lib']
23
-
24
- spec.required_ruby_version = '>= 2.7.0'
25
-
26
- spec.add_dependency 'nokogiri', '~> 1.12'
27
- spec.add_dependency 'nori', '~> 2.6'
28
- spec.add_dependency 'zeitwerk', '~> 2.5'
29
-
30
- spec.metadata['rubygems_mfa_required'] = 'true'
31
- end