locasms 0.5.0 → 1.0.0

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: 39596e51a28908193ac0455bf97fb1c703becaedc33c569fe509e1ce450a6e70
4
- data.tar.gz: f4a5d880167d667f952ebd75f68116b4dcfda9da03579d9a2b4bca87f735b1ac
3
+ metadata.gz: 5a896107539a5ae0494a02442c4792ac2da61b58956f4961fdf2472547843ff4
4
+ data.tar.gz: '0618f45850fe8085139fc79d34fae365c33cf39c0435773da59ff8cd21f470c4'
5
5
  SHA512:
6
- metadata.gz: '028885bb02e34a3f5bb918e805795e24e62a1f7d9bd18acc81bafb53e824502b263128b159c75af90d06d5764b210cd0fc01968d865cfed31a89bf1041fbdbd6'
7
- data.tar.gz: 56ca283b83035314141fadcf0b48cedbf875176822c5ca159c99c7a70857260cfe9c3a8284f0ddcd8fe9b147edd4f4a3f91542df4107c683a1f1d2e1a87f3422
6
+ metadata.gz: 9ea9b109f0a76a9b76fc0e8fa3d9387bf2e2eca0a2c6ed20fdfc501c7ec6d216b78797e09ae00d66a1ff8069eef41d8b88b574a6c0a72960f076b313da0988fe
7
+ data.tar.gz: 355ef466313280c2f6f6c234c3c712f8dd0967a861dbe719de44c68e48cb2b4ee191ee1d1e07e4663a712b8578a502381b5cf47064d1f806ec2bff9bbc16b6cb
@@ -0,0 +1,27 @@
1
+ name: test
2
+ on: [pull_request]
3
+
4
+ jobs:
5
+ lint:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v2
9
+ - uses: ruby/setup-ruby@v1
10
+ with:
11
+ ruby-version: 2.7
12
+ bundler-cache: true
13
+ - run: bundle exec rubocop
14
+
15
+ test:
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [2.5, 2.6, 2.7, '3.0', jruby, jruby-head]
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: ${{ matrix.ruby }}
26
+ bundler-cache: true
27
+ - run: bundle exec rspec
data/.rubocop.yml CHANGED
@@ -1,6 +1,10 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
- require: rubocop-rspec
3
+ require:
4
+ - rubocop-performance
5
+ - rubocop-rake
6
+ - rubocop-rspec
4
7
 
5
8
  AllCops:
9
+ TargetRubyVersion: 2.5
6
10
  NewCops: enable
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # locasms
2
- [![Gem Version](https://badge.fury.io/rb/locasms.svg)](http://badge.fury.io/rb/locasms) [![Build Status](https://travis-ci.org/mcorp/locasms.png?branch=master)](https://travis-ci.org/mcorp/locasms) [![Code Climate](https://api.codeclimate.com/v1/badges/4187ea939aabd3b66bf7/maintainability)](https://codeclimate.com/github/mcorp/locasms) [![CC Coverage](https://api.codeclimate.com/v1/badges/4187ea939aabd3b66bf7/test_coverage)](https://codeclimate.com/github/mcorp/locasms/test_coverage) [![Inline docs](http://inch-ci.org/github/mcorp/locasms.svg?branch=master)](http://inch-ci.org/github/mcorp/locasms)
2
+ [![Gem Version](https://badge.fury.io/rb/locasms.svg)](http://badge.fury.io/rb/locasms) [![Code Climate](https://api.codeclimate.com/v1/badges/4187ea939aabd3b66bf7/maintainability)](https://codeclimate.com/github/mcorp/locasms) [![CC Coverage](https://api.codeclimate.com/v1/badges/4187ea939aabd3b66bf7/test_coverage)](https://codeclimate.com/github/mcorp/locasms/test_coverage) [![Inline docs](http://inch-ci.org/github/mcorp/locasms.svg?branch=master)](http://inch-ci.org/github/mcorp/locasms)
3
3
 
4
4
  > :warning: After `February, 10, 2018` the base IP of the service will change as noticed on this [issue](https://github.com/mcorp/locasms/issues/21). If you don't upgrade to version `0.3.1` your app will stop delivering SMS.
5
5
 
@@ -36,7 +36,7 @@ module LocaSMS
36
36
  # # => ['14/03/1977', '14:12']
37
37
  #
38
38
  def self.split(date)
39
- parse(date).strftime('%d/%m/%Y %H:%M').split(' ')
39
+ parse(date).strftime('%d/%m/%Y %H:%M').split
40
40
  end
41
41
  end
42
42
  end
@@ -75,7 +75,7 @@ module LocaSMS
75
75
  # @raise [LocaSMS::InvalidOperation] when asked for an invalid operation
76
76
  # @raise [LocaSMS::InvalidLogin] when the given credentials are invalid
77
77
  def parse_response(action, response)
78
- raise InvalidOperation.new(action: action) if response =~ /^0:OPERACAO INVALIDA$/i
78
+ raise InvalidOperation.new(action: action) if response.match?(/^0:OPERACAO INVALIDA$/i)
79
79
 
80
80
  j = begin
81
81
  MultiJson.load(response)
@@ -85,7 +85,7 @@ module LocaSMS
85
85
 
86
86
  return j if (j['status'] == 1) || (action == :getstatus)
87
87
 
88
- raise InvalidLogin.new(action: action) if j['msg'] =~ /^falha ao realizar login$/i
88
+ raise InvalidLogin.new(action: action) if j['msg'].match?(/^falha ao realizar login$/i)
89
89
 
90
90
  raise LocaSMS::Exception.new(message: j['msg'], raw: response, action: action)
91
91
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LocaSMS
4
- VERSION = '0.5.0'
4
+ VERSION = '1.0.0'
5
5
  end
data/locasms.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.required_ruby_version = '~> 2.4'
23
+ spec.required_ruby_version = '>= 2.5'
24
24
 
25
25
  spec.add_dependency 'multi_json', '~> 1.13'
26
26
 
@@ -32,13 +32,14 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'timecop', '~> 0.9'
33
33
 
34
34
  # for documentation
35
- spec.add_development_dependency 'redcarpet', '~> 3.5'
36
35
  spec.add_development_dependency 'yard', '~> 0.9'
37
36
 
38
37
  # for code coverage
39
38
  spec.add_development_dependency 'simplecov', '~> 0.18'
40
39
 
41
40
  # for code quality
42
- spec.add_development_dependency 'rubocop', '~> 0.93'
43
- spec.add_development_dependency 'rubocop-rspec', '~> 1.43'
41
+ spec.add_development_dependency 'rubocop', '~> 1.22'
42
+ spec.add_development_dependency 'rubocop-performance', '~> 1.11'
43
+ spec.add_development_dependency 'rubocop-rake', '~> 0.6'
44
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.5'
44
45
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locasms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adilson Carvalho
8
8
  - Leonardo Saraiva
9
9
  - Marco Carvalho
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-10-29 00:00:00.000000000 Z
13
+ date: 2021-10-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -83,75 +83,89 @@ dependencies:
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0.9'
85
85
  - !ruby/object:Gem::Dependency
86
- name: redcarpet
86
+ name: yard
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: '3.5'
91
+ version: '0.9'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: '3.5'
98
+ version: '0.9'
99
99
  - !ruby/object:Gem::Dependency
100
- name: yard
100
+ name: simplecov
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: '0.9'
105
+ version: '0.18'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: '0.9'
112
+ version: '0.18'
113
113
  - !ruby/object:Gem::Dependency
114
- name: simplecov
114
+ name: rubocop
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '0.18'
119
+ version: '1.22'
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
- version: '0.18'
126
+ version: '1.22'
127
127
  - !ruby/object:Gem::Dependency
128
- name: rubocop
128
+ name: rubocop-performance
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - "~>"
132
132
  - !ruby/object:Gem::Version
133
- version: '0.93'
133
+ version: '1.11'
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - "~>"
139
139
  - !ruby/object:Gem::Version
140
- version: '0.93'
140
+ version: '1.11'
141
+ - !ruby/object:Gem::Dependency
142
+ name: rubocop-rake
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - "~>"
146
+ - !ruby/object:Gem::Version
147
+ version: '0.6'
148
+ type: :development
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - "~>"
153
+ - !ruby/object:Gem::Version
154
+ version: '0.6'
141
155
  - !ruby/object:Gem::Dependency
142
156
  name: rubocop-rspec
143
157
  requirement: !ruby/object:Gem::Requirement
144
158
  requirements:
145
159
  - - "~>"
146
160
  - !ruby/object:Gem::Version
147
- version: '1.43'
161
+ version: '2.5'
148
162
  type: :development
149
163
  prerelease: false
150
164
  version_requirements: !ruby/object:Gem::Requirement
151
165
  requirements:
152
166
  - - "~>"
153
167
  - !ruby/object:Gem::Version
154
- version: '1.43'
168
+ version: '2.5'
155
169
  description: |-
156
170
  Cliente para o serviço de disparo de SMS da LocaSMS e de sua
157
171
  versão para Short Code SMS (SMS Plataforma)
@@ -164,10 +178,10 @@ executables:
164
178
  extensions: []
165
179
  extra_rdoc_files: []
166
180
  files:
181
+ - ".github/workflows/test.yml"
167
182
  - ".gitignore"
168
183
  - ".rubocop.yml"
169
184
  - ".rubocop_todo.yml"
170
- - ".travis.yml"
171
185
  - ".yardopts"
172
186
  - Gemfile
173
187
  - Guardfile
@@ -193,23 +207,23 @@ homepage: https://github.com/mcorp/locasms
193
207
  licenses:
194
208
  - MIT
195
209
  metadata: {}
196
- post_install_message:
210
+ post_install_message:
197
211
  rdoc_options: []
198
212
  require_paths:
199
213
  - lib
200
214
  required_ruby_version: !ruby/object:Gem::Requirement
201
215
  requirements:
202
- - - "~>"
216
+ - - ">="
203
217
  - !ruby/object:Gem::Version
204
- version: '2.4'
218
+ version: '2.5'
205
219
  required_rubygems_version: !ruby/object:Gem::Requirement
206
220
  requirements:
207
221
  - - ">="
208
222
  - !ruby/object:Gem::Version
209
223
  version: '0'
210
224
  requirements: []
211
- rubygems_version: 3.0.3
212
- signing_key:
225
+ rubygems_version: 3.2.22
226
+ signing_key:
213
227
  specification_version: 4
214
228
  summary: Cliente para disparo de SMS, regular e Short Code, através da LocaSMS/SMS
215
229
  Plataforma
data/.travis.yml DELETED
@@ -1,17 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.7
4
- - 2.6
5
- - 2.5
6
- - 2.4
7
- env:
8
- - TRAVIS=true
9
- before_script:
10
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
- - chmod +x ./cc-test-reporter
12
- - ./cc-test-reporter before-build
13
- script:
14
- - bundle exec rspec
15
- - bundle exec rubocop
16
- after_script:
17
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT