test_joska 1.0.6 → 1.0.8

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: 167d82045de090e54bf4d22262404a77412d66ab6c232afed644c95ea145ae73
4
- data.tar.gz: d8db4398d986f6da6d237637c79d33f9908cd7cf1a1f70936e5f35925b809bc2
3
+ metadata.gz: 52e9d7e407c75796701be26159208426df74e70d06dacd3d2cea98719ec14392
4
+ data.tar.gz: b31b8f067351ca5343a311547c35458fe10c9764c79ccf6a3bcc699b65f9b886
5
5
  SHA512:
6
- metadata.gz: 4d6ad98de629069ff818479a472028ef430f9e70e77c4f0b845aaf46f35e811458e99590b52b6ebcdde50479bc41424a06a4b1e2188cdeda0d506bd7777fb878
7
- data.tar.gz: 38f7fa1564334f01c22d9534b828b2af0b44eab595985f6f72987487805e4aed21af5c0765ed23d993ba62c6ced7ecdef87f29c58552115e66e8996be5da6f6b
6
+ metadata.gz: ded54b55b7d4c951fc3a612c176ff3b060c011a6233e22f29a8b06033bfc26b527fb3cc9cba42b6cbef05576eae3b89b022ec809e8bc4b02c7ff1bafc610ccd7
7
+ data.tar.gz: 40d4b8b1deb7b860bdb88d4f6cdf978e2470f65ebd3dd8605fb436189ef9293cad26395ff4eca694f71fae8029766ca5b99bf4ec9d04a38d96b01e6b246a4d09
data/.gitignore CHANGED
@@ -9,4 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
- *.gem
12
+ *.gem
13
+ upload.sh
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- test_joska (1.0.6)
4
+ test_joska (1.0.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,22 +1,34 @@
1
1
  module TestJoska
2
2
 
3
+ @@raise_on_error = false
4
+
5
+ @@output_url = false
6
+
7
+ @@URL = {}
8
+
9
+ @@HEAD = {}
10
+
11
+ @@standard_endpoint = ""
12
+
13
+ @@standard_environment = ""
14
+
3
15
  @@internal_log = "log"
4
16
 
5
- # def initialize(options)
17
+ def jsk_setup(options)
6
18
 
7
- # @raise_on_error = options["raise_on_error"]
19
+ @@raise_on_error = options["raise_on_error"]
8
20
 
9
- # @output_url = options["output_url"]
21
+ @@output_url = options["output_url"]
10
22
 
11
- # @URL = options["url_parts"]
23
+ @@URL = options["url_parts"]
12
24
 
13
- # @HEAD = options["headers"]
25
+ @@HEAD = options["headers"]
14
26
 
15
- # @standard_endpoint = options["standard_endpoint"]
27
+ @@standard_endpoint = options["standard_endpoint"]
16
28
 
17
- # @standard_environment = options["standard_environment"]
29
+ @@standard_environment = options["standard_environment"]
18
30
 
19
- # end
31
+ end
20
32
 
21
33
  def jsk_get_log
22
34
 
@@ -38,23 +50,23 @@ module TestJoska
38
50
 
39
51
  def jsk_get_url_log
40
52
 
41
- return @url_log
53
+ return @@url_log
42
54
 
43
55
  end
44
56
 
45
57
  def jsk_clear_url_log
46
58
 
47
- @url_log = ""
59
+ @@url_log = ""
48
60
 
49
61
  end
50
62
 
51
63
  def request(method, product, type, details=nil, payload=nil, header_type=nil, endpoint=nil, env=nil)
52
64
 
53
- endpoint = endpoint ? endpoint : @standard_endpoint
65
+ endpoint = endpoint ? endpoint : @@standard_endpoint
54
66
 
55
67
  url = urlBuilder(product, type, details, endpoint, env)
56
68
 
57
- header_type ? header = @HEAD[header_type] : header = @HEAD[endpoint]
69
+ header_type ? header = @@HEAD[header_type] : header = @@HEAD[endpoint]
58
70
 
59
71
  payload = payload.to_json if payload
60
72
 
@@ -62,9 +74,9 @@ module TestJoska
62
74
 
63
75
  p url
64
76
 
65
- @url_log = "#{@url_log}\n#{method} #{type}: #{url}"
77
+ @@url_log = "#{@@url_log}\n#{method} #{type}: #{url}"
66
78
 
67
- @url_log = "#{@url_log}\nPayload: #{payload}" if payload && type != "login"
79
+ @@url_log = "#{@@url_log}\nPayload: #{payload}" if payload && type != "login"
68
80
 
69
81
  RestClient::Request.execute(method: method, url: url, headers: header, payload: payload, timeout: 90) do |response|
70
82
 
@@ -102,23 +114,23 @@ module TestJoska
102
114
 
103
115
  def urlBuilder(product, type, details, endpoint, env=nil)
104
116
 
105
- env = env ? env : @standard_environment
117
+ env = env ? env : @@standard_environment
106
118
 
107
119
  details = "" if !details
108
120
 
109
121
  details = [details] if !details.kind_of?(Array)
110
122
 
111
- url = @URL[product]["base"]["#{env}_#{endpoint}"]
123
+ url = @@URL[product]["base"]["#{env}_#{endpoint}"]
112
124
 
113
- if !@URL[product]["path"][type].kind_of?(Array)
125
+ if !@@URL[product]["path"][type].kind_of?(Array)
114
126
 
115
- return "#{url}#{@URL[product]["path"][type]}#{details[0]}"
127
+ return "#{url}#{@@URL[product]["path"][type]}#{details[0]}"
116
128
 
117
129
  else
118
130
 
119
131
  query_pos = 0
120
132
 
121
- @URL[product]["path"][type].each do |query|
133
+ @@URL[product]["path"][type].each do |query|
122
134
 
123
135
  if details[query_pos] && details[query_pos] != ""
124
136
 
@@ -1,3 +1,3 @@
1
1
  module TestJoska
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_joska
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Diogo Dovas