soullab 0.0.1 → 0.0.2
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 +4 -4
- data/lib/exceptions/campoInvalido.rb +10 -0
- data/lib/soullab.rb +11 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08aa117a5244f9e69a4f11b21ac6abac7506d8fd
|
4
|
+
data.tar.gz: 783d22d16508e223bb800413c57ed2897f2ea60e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9baf673f1b52ad24bb9f659944f9d3f0ed568f88bbf15f60779436edfaaf0481588057a79976ca5de6253e3e1a1b8f4348fbad266fcaa34f4948ff29112e094f
|
7
|
+
data.tar.gz: 7c6855675d8e7a986dd805c2cbf0113a4120a35123d8e7c3c9937f26631f4b45a8b254733ec462eadf1ba99a7f44f9f54118a1644e3eabd84cd24b8cf2b3f844
|
data/lib/soullab.rb
CHANGED
@@ -4,6 +4,7 @@ require 'date'
|
|
4
4
|
require 'digest/sha1'
|
5
5
|
require 'openssl'
|
6
6
|
require 'base64'
|
7
|
+
require 'exceptions/campoInvalido'
|
7
8
|
|
8
9
|
class Soullab
|
9
10
|
|
@@ -159,18 +160,25 @@ class Soullab
|
|
159
160
|
:accept => :json
|
160
161
|
)
|
161
162
|
|
163
|
+
wsreturn = JSON.parse(response.body)
|
164
|
+
|
165
|
+
begin
|
166
|
+
raise CampoInvalido.new("login","Este parâmetro deve ser alfanumérico") if wsreturn['message'] == "23"
|
167
|
+
rescue CampoInvalido => e
|
168
|
+
puts "campo: #{e.campo}"
|
169
|
+
puts "motivo: #{e.motivo}"
|
170
|
+
end
|
171
|
+
|
162
172
|
return JSON.parse(response.body)
|
163
173
|
end
|
164
174
|
|
165
|
-
def integrarTurma(codigoEscola, codigo,
|
175
|
+
def integrarTurma(codigoEscola, codigo, professor, dataInicio, dataFim, avisos)
|
166
176
|
|
167
177
|
puts "Generating json..." if $DEBUG
|
168
178
|
|
169
179
|
turma = {
|
170
180
|
codigoEscola: codigoEscola,
|
171
181
|
codigo: codigo,
|
172
|
-
anoTurma: anoTurma,
|
173
|
-
periodoAno: periodoAno,
|
174
182
|
professor: professor,
|
175
183
|
dataInicio: dataInicio,
|
176
184
|
dataFim: dataFim,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soullab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Augusto Russo
|
@@ -52,13 +52,14 @@ dependencies:
|
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.2.4
|
55
|
-
description: 'Want to integrate your system with soullab?
|
56
|
-
|
55
|
+
description: 'Want to integrate your system with soullab? This gem provides all you
|
56
|
+
need. Know more about soullab at: www.soullab.com.br'
|
57
57
|
email: augusto.russo@inovaz.com.br
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- lib/exceptions/campoInvalido.rb
|
62
63
|
- lib/soullab.rb
|
63
64
|
homepage: http://www.soullab.com.br
|
64
65
|
licenses:
|