cequens 0.0.7 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f11166fbdbe9870dc4ca38824b06c4bf8f508b9949f8722fe92cad32d527b25e
4
- data.tar.gz: c6b5eb0a9c544b27922643e42fa87d864614ea2d5d5cd0593f687080980e3d13
3
+ metadata.gz: 455804f997fa50d285447be2a167523931da2ec545a8483a7d8d6cdf8b582376
4
+ data.tar.gz: 6908f384a27e1d86757a4da608f003820198ea44509bbab4e32baef200b61a88
5
5
  SHA512:
6
- metadata.gz: 8588a8033b78e4bbe046297c18bf56c0d399b0603e918ea3d9ff21b0ee4669fbb73d4b5cfca862ceda6c6c2f11f39f512a0126c48b377efe629aecc93fb699e8
7
- data.tar.gz: 6feb98cdd452e20c471bd8cbec09161defe58bdc2d66238a9847064af5b9f5aa61645a3daca27bba61c71ad255cffc34437fb7d40e5565cf00475b3dbc19dac9
6
+ metadata.gz: 215ce899ff06a9e83d9590e1e540b8e24f8136eff7390781daaca7a430deebf144175583bbcb16fa8eefe4ccfc7d306118cfab328afe7fc24c8df9f4f3d5e453
7
+ data.tar.gz: 678b309966a4073588171d3b6e614d874d845c8b6912b33a3116abd8c4573b2e6405656d2067247d3d90c291151b69c3319aca02facfbfb7e6b5f25dda1ef0ef
@@ -12,11 +12,16 @@ jobs:
12
12
  - name: Set up Ruby
13
13
  uses: ruby/setup-ruby@v1
14
14
  with:
15
- ruby-version: 2.6
15
+ ruby-version: 2.7
16
16
  - name: Install dependencies
17
17
  run: bundle install
18
18
  - name: Rubocop
19
19
  run: rubocop
20
20
  - name: Run tests
21
21
  run: bundle exec rake spec
22
+ - name: Brakeman action
23
+ uses: artplan1/brakeman-action@v1.2.1
24
+ with:
25
+ flags: "--force"
26
+
22
27
 
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.6
2
+ TargetRubyVersion: 2.7
3
3
  Metrics/LineLength:
4
4
  Max: 120
5
5
  Metrics/BlockLength:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.6
1
+ 2.7.6
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cequens (0.0.6)
4
+ cequens (0.0.8)
5
5
  dry-validation (~> 1.6)
6
- faraday (~> 0.17)
6
+ faraday (~> 1.8)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -67,36 +67,35 @@ GEM
67
67
  minitest (>= 5.1)
68
68
  tzinfo (~> 2.0)
69
69
  zeitwerk (~> 2.3)
70
- addressable (2.7.0)
70
+ addressable (2.8.0)
71
71
  public_suffix (>= 2.0.2, < 5.0)
72
72
  ast (2.4.2)
73
+ brakeman (5.0.0)
73
74
  builder (3.2.4)
74
75
  byebug (11.1.3)
75
- concurrent-ruby (1.1.8)
76
+ concurrent-ruby (1.1.10)
76
77
  crack (0.4.5)
77
78
  rexml
78
79
  crass (1.0.6)
79
80
  diff-lcs (1.4.4)
80
- dry-configurable (0.12.1)
81
+ dry-configurable (0.15.0)
81
82
  concurrent-ruby (~> 1.0)
82
- dry-core (~> 0.5, >= 0.5.0)
83
- dry-container (0.7.2)
83
+ dry-core (~> 0.6)
84
+ dry-container (0.11.0)
84
85
  concurrent-ruby (~> 1.0)
85
- dry-configurable (~> 0.1, >= 0.1.3)
86
- dry-core (0.5.0)
86
+ dry-core (0.8.1)
87
87
  concurrent-ruby (~> 1.0)
88
- dry-equalizer (0.3.0)
89
- dry-inflector (0.2.0)
90
- dry-initializer (3.0.4)
91
- dry-logic (1.1.0)
88
+ dry-inflector (0.3.0)
89
+ dry-initializer (3.1.1)
90
+ dry-logic (1.2.0)
92
91
  concurrent-ruby (~> 1.0)
93
92
  dry-core (~> 0.5, >= 0.5)
94
- dry-schema (1.6.1)
93
+ dry-schema (1.10.6)
95
94
  concurrent-ruby (~> 1.0)
96
- dry-configurable (~> 0.8, >= 0.8.3)
95
+ dry-configurable (~> 0.13, >= 0.13.0)
97
96
  dry-core (~> 0.5, >= 0.5)
98
97
  dry-initializer (~> 3.0)
99
- dry-logic (~> 1.0)
98
+ dry-logic (~> 1.2)
100
99
  dry-types (~> 1.5)
101
100
  dry-types (1.5.1)
102
101
  concurrent-ruby (~> 1.0)
@@ -104,22 +103,42 @@ GEM
104
103
  dry-core (~> 0.5, >= 0.5)
105
104
  dry-inflector (~> 0.1, >= 0.1.2)
106
105
  dry-logic (~> 1.0, >= 1.0.2)
107
- dry-validation (1.6.0)
106
+ dry-validation (1.8.1)
108
107
  concurrent-ruby (~> 1.0)
109
108
  dry-container (~> 0.7, >= 0.7.1)
110
- dry-core (~> 0.4)
111
- dry-equalizer (~> 0.2)
109
+ dry-core (~> 0.5, >= 0.5)
112
110
  dry-initializer (~> 3.0)
113
- dry-schema (~> 1.5, >= 1.5.2)
111
+ dry-schema (~> 1.8, >= 1.8.0)
114
112
  erubi (1.10.0)
115
- faraday (0.17.4)
116
- multipart-post (>= 1.2, < 3)
117
- globalid (0.4.2)
118
- activesupport (>= 4.2.0)
113
+ faraday (1.10.2)
114
+ faraday-em_http (~> 1.0)
115
+ faraday-em_synchrony (~> 1.0)
116
+ faraday-excon (~> 1.1)
117
+ faraday-httpclient (~> 1.0)
118
+ faraday-multipart (~> 1.0)
119
+ faraday-net_http (~> 1.0)
120
+ faraday-net_http_persistent (~> 1.0)
121
+ faraday-patron (~> 1.0)
122
+ faraday-rack (~> 1.0)
123
+ faraday-retry (~> 1.0)
124
+ ruby2_keywords (>= 0.0.4)
125
+ faraday-em_http (1.0.0)
126
+ faraday-em_synchrony (1.0.0)
127
+ faraday-excon (1.1.0)
128
+ faraday-httpclient (1.0.1)
129
+ faraday-multipart (1.0.4)
130
+ multipart-post (~> 2)
131
+ faraday-net_http (1.0.1)
132
+ faraday-net_http_persistent (1.2.0)
133
+ faraday-patron (1.0.0)
134
+ faraday-rack (1.0.0)
135
+ faraday-retry (1.0.3)
136
+ globalid (1.0.1)
137
+ activesupport (>= 5.0)
119
138
  hashdiff (1.0.1)
120
- i18n (1.8.9)
139
+ i18n (1.12.0)
121
140
  concurrent-ruby (~> 1.0)
122
- loofah (2.9.0)
141
+ loofah (2.19.1)
123
142
  crass (~> 1.0.2)
124
143
  nokogiri (>= 1.5.9)
125
144
  mail (2.7.1)
@@ -127,21 +146,23 @@ GEM
127
146
  marcel (0.3.3)
128
147
  mimemagic (~> 0.3.2)
129
148
  method_source (1.0.0)
130
- mimemagic (0.3.5)
149
+ mimemagic (0.3.10)
150
+ nokogiri (~> 1)
151
+ rake
131
152
  mini_mime (1.0.2)
132
- mini_portile2 (2.5.0)
133
- minitest (5.14.3)
134
- multipart-post (2.1.1)
153
+ mini_portile2 (2.8.2)
154
+ minitest (5.17.0)
155
+ multipart-post (2.2.3)
135
156
  nio4r (2.5.5)
136
- nokogiri (1.11.1)
137
- mini_portile2 (~> 2.5.0)
157
+ nokogiri (1.15.2)
158
+ mini_portile2 (~> 2.8.2)
138
159
  racc (~> 1.4)
139
160
  parallel (1.20.1)
140
161
  parser (3.0.0.0)
141
162
  ast (~> 2.4.1)
142
163
  public_suffix (4.0.6)
143
- racc (1.5.2)
144
- rack (2.2.3)
164
+ racc (1.6.1)
165
+ rack (2.2.7)
145
166
  rack-test (1.1.0)
146
167
  rack (>= 1.0, < 3)
147
168
  rails (6.1.2.1)
@@ -162,8 +183,8 @@ GEM
162
183
  rails-dom-testing (2.0.3)
163
184
  activesupport (>= 4.2.0)
164
185
  nokogiri (>= 1.6)
165
- rails-html-sanitizer (1.3.0)
166
- loofah (~> 2.3)
186
+ rails-html-sanitizer (1.4.4)
187
+ loofah (~> 2.19, >= 2.19.1)
167
188
  railties (6.1.2.1)
168
189
  actionpack (= 6.1.2.1)
169
190
  activesupport (= 6.1.2.1)
@@ -173,7 +194,7 @@ GEM
173
194
  rainbow (3.0.0)
174
195
  rake (13.0.3)
175
196
  regexp_parser (2.0.3)
176
- rexml (3.2.4)
197
+ rexml (3.2.5)
177
198
  rspec (3.10.0)
178
199
  rspec-core (~> 3.10.0)
179
200
  rspec-expectations (~> 3.10.0)
@@ -201,6 +222,7 @@ GEM
201
222
  rubocop-ast (1.4.1)
202
223
  parser (>= 2.7.1.5)
203
224
  ruby-progressbar (1.11.0)
225
+ ruby2_keywords (0.0.5)
204
226
  sprockets (4.0.2)
205
227
  concurrent-ruby (~> 1.0)
206
228
  rack (> 1, < 3)
@@ -209,7 +231,7 @@ GEM
209
231
  activesupport (>= 4.0)
210
232
  sprockets (>= 3.0.0)
211
233
  thor (1.1.0)
212
- tzinfo (2.0.4)
234
+ tzinfo (2.0.5)
213
235
  concurrent-ruby (~> 1.0)
214
236
  unicode-display_width (2.0.0)
215
237
  webmock (3.11.2)
@@ -219,12 +241,13 @@ GEM
219
241
  websocket-driver (0.7.3)
220
242
  websocket-extensions (>= 0.1.0)
221
243
  websocket-extensions (0.1.5)
222
- zeitwerk (2.4.2)
244
+ zeitwerk (2.6.6)
223
245
 
224
246
  PLATFORMS
225
247
  ruby
226
248
 
227
249
  DEPENDENCIES
250
+ brakeman (~> 5.0)
228
251
  bundler (~> 2.0)
229
252
  byebug (~> 11.1)
230
253
  cequens!
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Cequens
2
2
 
3
- **Disclaimer:** we are not officially affilated with Cequens company.
3
+ **Disclaimer:** we are not officially affilated with [Cequens](https://developer.cequens.com) company.
4
4
 
5
5
  A plug-and-play library that make it easier to use Cequens SMS APIs
6
6
 
@@ -29,6 +29,7 @@ configure access token as:
29
29
  Cequens.config do |c|
30
30
  # c.access_token = token # add your access token not api token
31
31
  # access_token is what you get when you login
32
+ # c.sender_name = sender_name
32
33
  end
33
34
 
34
35
  ### Send SMS
data/cequens.gemspec CHANGED
@@ -23,10 +23,11 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.required_ruby_version = '~> 2.6'
26
+ spec.required_ruby_version = '>= 2.7'
27
27
  spec.add_dependency 'dry-validation', '~> 1.6'
28
- spec.add_dependency 'faraday', '~> 0.17'
28
+ spec.add_dependency 'faraday', '~> 1.8'
29
29
 
30
+ spec.add_development_dependency 'brakeman', '~> 5.0'
30
31
  spec.add_development_dependency 'bundler', '~> 2.0'
31
32
  spec.add_development_dependency 'byebug', '~> 11.1'
32
33
  spec.add_development_dependency 'rails', '~> 6.1'
@@ -10,8 +10,8 @@ module Cequens
10
10
  params do
11
11
  required(:recipients).value(:string)
12
12
  required(:messageText).value(:string)
13
- required(:senderName).value(:string)
14
13
  required(:messageType).value(included_in?: MESSAGE_TYPE)
14
+ optional(:senderName).value(:string)
15
15
  optional(:validityPeriod).value(:string)
16
16
  optional(:clientMessageId).value(:integer)
17
17
  optional(:acknowledgement).value(included_in?: KEYS)
@@ -32,7 +32,7 @@ module Cequens
32
32
  def request_transformed_params
33
33
  {
34
34
  messageText: request_params[:messageText],
35
- senderName: request_params[:senderName],
35
+ senderName: sender_name,
36
36
  messageType: request_params[:messageType],
37
37
  recipients: request_params[:recipients],
38
38
  clientMessageId: request_params[:clientMessageId],
@@ -48,6 +48,15 @@ module Cequens
48
48
  }.compact
49
49
  end
50
50
 
51
+ def sender_name
52
+ if request_params[:sender_name].nil?
53
+ request_params[:sender_name] =
54
+ Cequens.sender_name
55
+ else
56
+ request_params[:sender_name]
57
+ end
58
+ end
59
+
51
60
  # rubocop:enable Metrics/AbcSize
52
61
  # rubocop:enable Metrics/MethodLength
53
62
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cequens
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.9'
5
5
  end
data/lib/cequens.rb CHANGED
@@ -14,7 +14,7 @@ require 'byebug'
14
14
 
15
15
  module Cequens
16
16
  class << self
17
- attr_accessor :access_token
17
+ attr_accessor :access_token, :sender_name
18
18
 
19
19
  def config
20
20
  yield self
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Cequens.config do |c|
4
- # c.access_token = token
4
+ c.access_token = 'your_token'
5
+ # replace sender id with yours
6
+ c.sender_name = 'Cequens'
5
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cequens
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmed Ali
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-18 00:00:00.000000000 Z
11
+ date: 2023-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-validation
@@ -30,14 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.17'
33
+ version: '1.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.17'
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: brakeman
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +164,7 @@ dependencies:
150
164
  - - "~>"
151
165
  - !ruby/object:Gem::Version
152
166
  version: '3.11'
153
- description:
167
+ description:
154
168
  email:
155
169
  - ahmed.saraya90@gmail.com
156
170
  executables: []
@@ -181,29 +195,29 @@ files:
181
195
  - lib/cequens/version.rb
182
196
  - lib/generators/cequens/config_generator.rb
183
197
  - lib/generators/cequens/templates/cequens_config.rb
184
- homepage:
198
+ homepage:
185
199
  licenses:
186
200
  - MIT
187
201
  metadata:
188
202
  homepage_uri: https://github.com/AhmedAliIbrahim/cequens
189
203
  source_code_uri: https://github.com/AhmedAliIbrahim/cequens
190
- post_install_message:
204
+ post_install_message:
191
205
  rdoc_options: []
192
206
  require_paths:
193
207
  - lib
194
208
  required_ruby_version: !ruby/object:Gem::Requirement
195
209
  requirements:
196
- - - "~>"
210
+ - - ">="
197
211
  - !ruby/object:Gem::Version
198
- version: '2.6'
212
+ version: '2.7'
199
213
  required_rubygems_version: !ruby/object:Gem::Requirement
200
214
  requirements:
201
215
  - - ">="
202
216
  - !ruby/object:Gem::Version
203
217
  version: '0'
204
218
  requirements: []
205
- rubygems_version: 3.0.3
206
- signing_key:
219
+ rubygems_version: 3.1.6
220
+ signing_key:
207
221
  specification_version: 4
208
222
  summary: A library to interface with Cequens SMS gateway API.
209
223
  test_files: []