ruby-miradore 2.0.0 → 2.0.1

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: eec2d939e922b01de30f68523519793986e7fd8dd514ca1daa53218aca098b03
4
- data.tar.gz: e668247de13d7d7781b130e84e098ebf12c847865205b79e737edf445eff71fa
3
+ metadata.gz: aee58441763bd6760eccd4c63c2465b1cceef3bbc80fc736977880a63d371687
4
+ data.tar.gz: 26c777574bf04298774adf5660adda09173348c5049627dfb8c9a7b650e7cb9a
5
5
  SHA512:
6
- metadata.gz: 133655f2e1fefdd93fd0c77278d82e500d48f189c9cfc60b1a54f26f278df94c0579cf107540c67272e26d000ebca595e6adc5d9dd2b15ce47b9fafb10886a3e
7
- data.tar.gz: a22735ab9d4fa3197c705c1c2c5aa8662224cf574fcdfc2c98159ecacde05fb8ca2c32c826c285fbff519a02b5e82f384f1ac11ce4536f28d4c0aca55dabc030
6
+ metadata.gz: 8e477a9a83c298f5236f0ed32335afd4ff59883a9b5aca3d19fa481c68fb9f0382958b5e41370531874c2247feb10ae392970127d6e8458e3ff6f2219e27888c
7
+ data.tar.gz: 12e942d70dce1860e63cf3c0413f18eb69cb0d5c9e899a23d910ec1187406f208e3b059d153caf9a29826ea386655b50064c7578eee2cf760a50413b8cce2385
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-miradore (2.0.0)
4
+ ruby-miradore (2.0.1)
5
5
  crack (~> 0.4)
6
- finest-builder (~> 0.1)
6
+ finest-builder (~> 1.0)
7
7
  httparty (~> 0.18)
8
8
  rake (~> 13.0)
9
9
  rspec (~> 3.0)
@@ -18,7 +18,7 @@ GEM
18
18
  crack (0.4.5)
19
19
  rexml
20
20
  diff-lcs (1.4.4)
21
- finest-builder (0.1.0)
21
+ finest-builder (1.0.1)
22
22
  hashdiff (1.0.1)
23
23
  httparty (0.18.1)
24
24
  mime-types (~> 3.0)
@@ -48,22 +48,22 @@ GEM
48
48
  diff-lcs (>= 1.2.0, < 2.0)
49
49
  rspec-support (~> 3.10.0)
50
50
  rspec-support (3.10.2)
51
- rubocop (1.18.4)
51
+ rubocop (1.19.0)
52
52
  parallel (~> 1.10)
53
53
  parser (>= 3.0.0.0)
54
54
  rainbow (>= 2.2.2, < 4.0)
55
55
  regexp_parser (>= 1.8, < 3.0)
56
56
  rexml
57
- rubocop-ast (>= 1.8.0, < 2.0)
57
+ rubocop-ast (>= 1.9.1, < 2.0)
58
58
  ruby-progressbar (~> 1.7)
59
59
  unicode-display_width (>= 1.4.0, < 3.0)
60
- rubocop-ast (1.8.0)
60
+ rubocop-ast (1.10.0)
61
61
  parser (>= 3.0.1.1)
62
62
  ruby-progressbar (1.11.0)
63
63
  unicode-display_width (2.0.0)
64
64
  vcr (6.0.0)
65
- webmock (3.13.0)
66
- addressable (>= 2.3.6)
65
+ webmock (3.14.0)
66
+ addressable (>= 2.8.0)
67
67
  crack (>= 0.3.2)
68
68
  hashdiff (>= 0.4.0, < 2.0.0)
69
69
 
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://rzilient.online.miradore.com/API/v2/Device/1/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: 'null'
8
+ string: '{"userEmailAddress":"eduard@rzilient.club"}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -19,22 +19,20 @@ http_interactions:
19
19
  - Ruby
20
20
  response:
21
21
  status:
22
- code: 400
23
- message: Bad Request
22
+ code: 200
23
+ message: OK
24
24
  headers:
25
- Content-Type:
26
- - application/json; charset=utf-8
27
25
  Server:
28
26
  - Microsoft-IIS/10.0
29
27
  X-Frame-Options:
30
28
  - SAMEORIGIN
31
29
  - SAMEORIGIN
32
30
  Date:
33
- - Mon, 16 Aug 2021 14:51:21 GMT
31
+ - Tue, 17 Aug 2021 10:56:34 GMT
34
32
  Content-Length:
35
- - '46'
33
+ - '0'
36
34
  body:
37
35
  encoding: UTF-8
38
- string: '{"":["A non-empty request body is required."]}'
39
- recorded_at: Mon, 16 Aug 2021 14:51:21 GMT
36
+ string: ''
37
+ recorded_at: Tue, 17 Aug 2021 10:56:34 GMT
40
38
  recorded_with: VCR 6.0.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://rzilient.online.miradore.com/API/Device?auth=&filters=(InvDevice.SerialNumber%20eq%20C76TLUEMHG7F)&select=ID,*.*
5
+ uri: https://rzilient.online.miradore.com/API/Device?auth=3_IHBPttQ.ub%5BOG27&filters=(InvDevice.SerialNumber%20eq%20C76TLUEMHG7F)&select=ID,*.*
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -11,8 +11,6 @@ http_interactions:
11
11
  - application/json
12
12
  Accept:
13
13
  - application/json
14
- X-Api-Key:
15
- -
16
14
  Accept-Encoding:
17
15
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
16
  User-Agent:
@@ -39,14 +37,14 @@ http_interactions:
39
37
  X-Frame-Options:
40
38
  - SAMEORIGIN
41
39
  Date:
42
- - Mon, 16 Aug 2021 14:51:20 GMT
40
+ - Tue, 17 Aug 2021 10:56:29 GMT
43
41
  Content-Length:
44
- - '563'
42
+ - '572'
45
43
  body:
46
44
  encoding: ASCII-8BIT
47
- string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="1"><Device><ID>1</ID><User><ID>1</ID></User><Category><ID>1</ID></Category><Enrollment><ID>5</ID><User><ID>2</ID></User></Enrollment><OnlineStatus>Active</OnlineStatus><LastReported>16.08.2021
48
- 14:50:31</LastReported><LastReportedDays>0</LastReportedDays><LastReportedHours>0</LastReportedHours><LastReportedMinutes>1</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><MACAddress>d4:dc:cd:d6:09:be</MACAddress><Platform>iOS</Platform><Client><ID>1</ID></Client><ConfigProfileDeployments><ConfigProfileDeployment><ID>2</ID><ConfigProfile><ID>6</ID></ConfigProfile></ConfigProfileDeployment></ConfigProfileDeployments><OSVersionName>iOS
45
+ string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="1"><Device><ID>1</ID><User><ID>1</ID></User><Category><ID>1</ID></Category><Enrollment><ID>5</ID><User><ID>2</ID></User></Enrollment><OnlineStatus>Active</OnlineStatus><LastReported>17.08.2021
46
+ 08:11:21</LastReported><LastReportedDays>0</LastReportedDays><LastReportedHours>2</LastReportedHours><LastReportedMinutes>165</LastReportedMinutes><IPAddress>31.4.129.74</IPAddress><MACAddress>d4:dc:cd:d6:09:be</MACAddress><Platform>iOS</Platform><Client><ID>1</ID></Client><ConfigProfileDeployments><ConfigProfileDeployment><ID>2</ID><ConfigProfile><ID>6</ID></ConfigProfile></ConfigProfileDeployment></ConfigProfileDeployments><OSVersionName>iOS
49
47
  14.4.2</OSVersionName><Status>AutoGenerated</Status><Created>22.04.2021 06:33:20</Created><Modified>16.08.2021
50
48
  13:54:57</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
51
- recorded_at: Mon, 16 Aug 2021 14:51:21 GMT
49
+ recorded_at: Tue, 17 Aug 2021 10:56:30 GMT
52
50
  recorded_with: VCR 6.0.0
data/lib/ruby/miradore.rb CHANGED
@@ -22,10 +22,14 @@ module Ruby
22
22
  include HTTParty
23
23
  format :json
24
24
 
25
- attr_reader :subdomain
25
+ attr_writer :subdomain, :auth
26
26
 
27
- def initialize(json = nil, args = {})
27
+ def initialize(json = {})
28
28
  super json
29
+ @subdomain ||= json[:subdomain]
30
+ @auth ||= json[:auth]
31
+ remove_instance_variable(:@subdomain) if @subdomain.nil?
32
+ remove_instance_variable(:@auth) if @auth.nil?
29
33
  end
30
34
 
31
35
  #
@@ -59,11 +63,13 @@ module Ruby
59
63
  def transform(res, args = {})
60
64
  instance_name = "Ruby::Miradore::#{res.keys.first.capitalize}"
61
65
  if res.values.first.is_a?(Array)
62
- return res.values.first.map! { |e| Object.const_get(instance_name).new(e.transform_keys(&:downcase), args) }
66
+ return res.values.first.map! do |e|
67
+ Object.const_get(instance_name).new(args.merge(e.transform_keys(&:downcase)))
68
+ end
63
69
  end
64
70
 
65
- Object.const_get(instance_name).new(res.values.first&.transform_keys(&:downcase), args)
66
- rescue
71
+ Object.const_get(instance_name).new(args.merge(res.values.first&.transform_keys(&:downcase)))
72
+ rescue StandardError
67
73
  MiradoreError.new({ error: "#{object_name}(s) not found", status: :not_found })
68
74
  end
69
75
 
@@ -84,15 +90,6 @@ module Ruby
84
90
  headers "Content-Type": "application/json"
85
91
  headers "Accept": "application/json"
86
92
 
87
- attr_writer :subdomain, :auth
88
-
89
- def initialize(json = {} , args = {})
90
- super json
91
- @subdomain = args[:subdomain]
92
- @auth = args[:auth]
93
- remove_instance_variable(:@subdomain) if @subdomain.nil?
94
- end
95
-
96
93
  def lock(**args)
97
94
  http_method(args.merge(method: :post, id: id, action: __method__))
98
95
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ruby
4
4
  module Miradore
5
- VERSION = "2.0.0"
5
+ VERSION = "2.0.1"
6
6
  end
7
7
  end
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  # Uncomment to register a new dependency of your gem
33
33
  # spec.add_dependency "example-gem", "~> 1.0"
34
34
  spec.add_dependency "crack", "~> 0.4"
35
- spec.add_dependency "finest-builder", "~> 0.1"
35
+ spec.add_dependency "finest-builder", "~> 1.0"
36
36
  spec.add_dependency "httparty", "~> 0.18"
37
37
  spec.add_dependency "rake", "~> 13.0"
38
38
  spec.add_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-miradore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduard Garcia Castelló
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-16 00:00:00.000000000 Z
11
+ date: 2021-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crack
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.1'
33
+ version: '1.0'
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.1'
40
+ version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: httparty
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -130,6 +130,11 @@ files:
130
130
  - fixtures/vcr_cassettes/search_by_serial_number.yml
131
131
  - lib/ruby/miradore.rb
132
132
  - lib/ruby/miradore/version.rb
133
+ - ruby-miradore-0.1.2.gem
134
+ - ruby-miradore-0.1.3.gem
135
+ - ruby-miradore-1.1.0.gem
136
+ - ruby-miradore-1.1.1.gem
137
+ - ruby-miradore-1.2.2.gem
133
138
  - ruby-miradore.gemspec
134
139
  homepage: https://github.com/eddygarcas/ruby-miradore
135
140
  licenses:
@@ -139,7 +144,7 @@ metadata:
139
144
  homepage_uri: https://github.com/eddygarcas/ruby-miradore
140
145
  source_code_uri: https://github.com/eddygarcas/ruby-miradore
141
146
  changelog_uri: https://github.com/eddygarcas/ruby-miradore
142
- post_install_message:
147
+ post_install_message:
143
148
  rdoc_options: []
144
149
  require_paths:
145
150
  - lib
@@ -155,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
160
  version: '0'
156
161
  requirements: []
157
162
  rubygems_version: 3.1.6
158
- signing_key:
163
+ signing_key:
159
164
  specification_version: 4
160
165
  summary: Miradore is a MSP providing an API to get devices information as well s perform
161
166
  some security actions.