ruby-miradore 2.1.3 → 2.2.6

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: 9708b4915cc1b9a6900ff54ae3fa26d92d365ce079607aa7f294f297558f959b
4
- data.tar.gz: 313ae6dfbb71b590bbf34e588621eb2f872f50bb61ed0cee6db2e3f7ac8fb60a
3
+ metadata.gz: 97151079f196820b698900c24e99ef9347ddb0af5ed6898954d0e7648e4d821d
4
+ data.tar.gz: 0d387e3d389ec3109d0e7b56ff0272d3a32018f0e784f3cf5abb7f79a5532c77
5
5
  SHA512:
6
- metadata.gz: ef22dcf40a3187c628efeba8f817a57c0f1093867f9481958c65eea9bafc40ba56da7b71776849e932eae81308c0dcd7a14726ad232f70c033085aa709c94784
7
- data.tar.gz: 116cdeef15344550bacb0175f806e8bbfc4a5306438726326961e5b9e9a76ad07e3301070706dbd766cc9873d8373739fb09018a89e6dc70dfad748209b184a2
6
+ metadata.gz: d64b7a84e53d415388a8899bc230340e77ecf0b2e139aea618b7f9fe22f8d852ca0b5d4a12d41cdd7e6dd05afd308d799ae427f7c847a3655ac010745a5149cf
7
+ data.tar.gz: ad1a881e39d0f0f608524f2d13f348fd79d9cd2a7cd5ad852a1f1a1e6901bc446947fff1c7bb1881e9fbd9efa11cc3a672312b18685d575d5dc167698da99189
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  /.idea/
13
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-miradore (2.1.3)
4
+ ruby-miradore (2.2.6)
5
5
  activesupport (~> 6.1)
6
- builder (~> 2.0)
6
+ builder (~> 3.1)
7
7
  crack (~> 0.4)
8
8
  finest-builder (~> 1.0)
9
9
  httparty (~> 0.18)
@@ -23,7 +23,7 @@ GEM
23
23
  addressable (2.8.0)
24
24
  public_suffix (>= 2.0.2, < 5.0)
25
25
  ast (2.4.2)
26
- builder (2.1.2)
26
+ builder (3.2.4)
27
27
  concurrent-ruby (1.1.9)
28
28
  crack (0.4.5)
29
29
  rexml
@@ -33,7 +33,7 @@ GEM
33
33
  httparty (0.20.0)
34
34
  mime-types (~> 3.0)
35
35
  multi_xml (>= 0.5.2)
36
- i18n (1.8.10)
36
+ i18n (1.8.11)
37
37
  concurrent-ruby (~> 1.0)
38
38
  mime-types (3.3.1)
39
39
  mime-types-data (~> 3.2015)
@@ -60,7 +60,7 @@ GEM
60
60
  rspec-mocks (3.10.2)
61
61
  diff-lcs (>= 1.2.0, < 2.0)
62
62
  rspec-support (~> 3.10.0)
63
- rspec-support (3.10.2)
63
+ rspec-support (3.10.3)
64
64
  rubocop (1.22.3)
65
65
  parallel (~> 1.10)
66
66
  parser (>= 3.0.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/v2/Device/1/location
5
+ uri: https://test634.online.miradore.com/API/v2/Device/13/location
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: "{}"
@@ -30,11 +30,11 @@ http_interactions:
30
30
  - SAMEORIGIN
31
31
  - SAMEORIGIN
32
32
  Date:
33
- - Fri, 29 Oct 2021 13:37:42 GMT
33
+ - Wed, 03 Nov 2021 10:37:03 GMT
34
34
  Content-Length:
35
- - '172'
35
+ - '173'
36
36
  body:
37
37
  encoding: UTF-8
38
- string: '{"assetID":1,"latitude":"41.37585082964286","longitude":"2.1679796580995383","fixTime":"2021-10-22T16:37:22","streetAddress":null,"zipCode":null,"city":null,"country":null}'
39
- recorded_at: Fri, 29 Oct 2021 13:37:40 GMT
38
+ string: '{"assetID":13,"latitude":"41.37582201297043","longitude":"2.1679371917816916","fixTime":"2021-11-03T10:26:09","streetAddress":null,"zipCode":null,"city":null,"country":null}'
39
+ recorded_at: Wed, 03 Nov 2021 10:37:04 GMT
40
40
  recorded_with: VCR 6.0.0
@@ -0,0 +1,41 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test634.online.miradore.com/API/v2/Device//
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"category":"Screens","manufacturer":"Apple","model":"AirPods Max","identifier":"34FGH45942FKL6","friendlyName":"airpod","userEmailAddress":"eduard@rzilient.club","ownership":"Unknown","ownershipStartDate":"2021-11-03
9
+ 09:19:04 +0100","organization":["Rzilient"],"location":["Barcelona"],"tags":["Accessories"],"customAttributes":{"contact":"Eduard"}}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept:
14
+ - application/json
15
+ X-Api-Key:
16
+ -
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ User-Agent:
20
+ - Ruby
21
+ response:
22
+ status:
23
+ code: 201
24
+ message: Created
25
+ headers:
26
+ Content-Type:
27
+ - application/json; charset=utf-8
28
+ Server:
29
+ - Microsoft-IIS/10.0
30
+ X-Frame-Options:
31
+ - SAMEORIGIN
32
+ - SAMEORIGIN
33
+ Date:
34
+ - Wed, 03 Nov 2021 08:19:05 GMT
35
+ Content-Length:
36
+ - '2'
37
+ body:
38
+ encoding: UTF-8
39
+ string: '12'
40
+ recorded_at: Wed, 03 Nov 2021 08:19:05 GMT
41
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://test634.online.miradore.com/API/Device?auth=&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&select=*,*
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ X-Api-Key:
15
+ - ''
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Cache-Control:
26
+ - no-cache
27
+ Pragma:
28
+ - no-cache
29
+ Content-Type:
30
+ - text/xml
31
+ Expires:
32
+ - "-1"
33
+ Vary:
34
+ - Accept-Encoding
35
+ Server:
36
+ - Microsoft-IIS/10.0
37
+ X-Aspnet-Version:
38
+ - 4.0.30319
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ Date:
42
+ - Wed, 03 Nov 2021 09:25:17 GMT
43
+ Content-Length:
44
+ - '995'
45
+ body:
46
+ encoding: ASCII-8BIT
47
+ string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="4"><Device><ID>2</ID><User><ID>1</ID></User><Enrollment><ID>6</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>04.10.2021
48
+ 10:00:00</LastReported><LastReportedDays>30</LastReportedDays><LastReportedHours>719</LastReportedHours><LastReportedMinutes>43165</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.13</LocalIPAddress><MACAddress>D4:81:D7:F8:52:85</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
49
+ 10 Pro (20H2)</OSVersionName><Client><ID>2</ID></Client><ConfigProfileDeployments
50
+ /><Status>Deleted</Status><Created>13.08.2021 13:19:37</Created><Modified>04.10.2021
51
+ 09:58:05</Modified><Source>MiradoreOnline</Source></Device><Device><ID>3</ID><Enrollment><ID>13</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>04.10.2021
52
+ 10:10:00</LastReported><LastReportedDays>30</LastReportedDays><LastReportedHours>719</LastReportedHours><LastReportedMinutes>43155</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.13</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
53
+ 10 Professionnel (20H2)</OSVersionName><Client><ID>3</ID></Client><ConfigProfileDeployments
54
+ /><Status>Deleted</Status><Created>04.10.2021 10:07:03</Created><Modified>05.10.2021
55
+ 16:16:52</Modified><Source>MiradoreOnline</Source></Device><Device><ID>4</ID><Enrollment><ID>17</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>12.10.2021
56
+ 10:51:10</LastReported><LastReportedDays>22</LastReportedDays><LastReportedHours>527</LastReportedHours><LastReportedMinutes>31594</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.16</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
57
+ 10 Pro (20H2)</OSVersionName><Client><ID>4</ID></Client><ConfigProfileDeployments
58
+ /><Status>Deleted</Status><Created>04.10.2021 10:26:25</Created><Modified>12.10.2021
59
+ 10:50:17</Modified><Source>MiradoreOnline</Source></Device><Device><ID>9</ID><User><ID>2</ID></User><Location><ID>1</ID></Location><Category><ID>3</ID></Category><Enrollment><ID>36</ID></Enrollment><OnlineStatus>Active</OnlineStatus><LastReported>02.11.2021
60
+ 13:40:06</LastReported><LastReportedDays>1</LastReportedDays><LastReportedHours>20</LastReportedHours><LastReportedMinutes>1185</LastReportedMinutes><IPAddress>185.212.21.34</IPAddress><LocalIPAddress>172.18.193.32</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><PurchaseDate>03.11.2021
61
+ 00:00:00</PurchaseDate><OSVersionName>Windows 10 Pro (20H2)</OSVersionName><Client><ID>9</ID></Client><ConfigProfileDeployments><ConfigProfileDeployment><ID>1</ID><ConfigProfile><ID>7</ID></ConfigProfile></ConfigProfileDeployment></ConfigProfileDeployments><Status>Active</Status><Created>27.10.2021
62
+ 08:10:37</Created><Modified>03.11.2021 09:16:54</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
63
+ recorded_at: Wed, 03 Nov 2021 09:25:18 GMT
64
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,62 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://test634.online.miradore.com/API/Device?auth=1_8,Yo-TV8QyCiBUF&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&select=*,*
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - no-cache
25
+ Pragma:
26
+ - no-cache
27
+ Content-Type:
28
+ - text/xml
29
+ Expires:
30
+ - "-1"
31
+ Vary:
32
+ - Accept-Encoding
33
+ Server:
34
+ - Microsoft-IIS/10.0
35
+ X-Aspnet-Version:
36
+ - 4.0.30319
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ Date:
40
+ - Wed, 03 Nov 2021 13:29:28 GMT
41
+ Content-Length:
42
+ - '979'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: <?xml version="1.0" encoding="utf-8"?><Content><Items count="4"><Device><ID>2</ID><User><ID>1</ID></User><Enrollment><ID>6</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>04.10.2021
46
+ 10:00:00</LastReported><LastReportedDays>30</LastReportedDays><LastReportedHours>723</LastReportedHours><LastReportedMinutes>43409</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.13</LocalIPAddress><MACAddress>D4:81:D7:F8:52:85</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
47
+ 10 Pro (20H2)</OSVersionName><Client><ID>2</ID></Client><ConfigProfileDeployments
48
+ /><Status>Deleted</Status><Created>13.08.2021 13:19:37</Created><Modified>04.10.2021
49
+ 09:58:05</Modified><Source>MiradoreOnline</Source></Device><Device><ID>3</ID><Enrollment><ID>13</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>04.10.2021
50
+ 10:10:00</LastReported><LastReportedDays>30</LastReportedDays><LastReportedHours>723</LastReportedHours><LastReportedMinutes>43399</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.13</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
51
+ 10 Professionnel (20H2)</OSVersionName><Client><ID>3</ID></Client><ConfigProfileDeployments
52
+ /><Status>Deleted</Status><Created>04.10.2021 10:07:03</Created><Modified>05.10.2021
53
+ 16:16:52</Modified><Source>MiradoreOnline</Source></Device><Device><ID>4</ID><Enrollment><ID>17</ID></Enrollment><OnlineStatus>Unmanaged</OnlineStatus><LastReported>12.10.2021
54
+ 10:51:10</LastReported><LastReportedDays>22</LastReportedDays><LastReportedHours>531</LastReportedHours><LastReportedMinutes>31838</LastReportedMinutes><IPAddress>185.212.21.63</IPAddress><LocalIPAddress>172.18.254.16</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><OSVersionName>Windows
55
+ 10 Pro (20H2)</OSVersionName><Client><ID>4</ID></Client><ConfigProfileDeployments
56
+ /><Status>Deleted</Status><Created>04.10.2021 10:26:25</Created><Modified>12.10.2021
57
+ 10:50:17</Modified><Source>MiradoreOnline</Source></Device><Device><ID>9</ID><User><ID>4</ID></User><Location><ID>1</ID></Location><Category><ID>3</ID></Category><Enrollment><ID>36</ID></Enrollment><OnlineStatus>Active</OnlineStatus><LastReported>03.11.2021
58
+ 11:04:00</LastReported><LastReportedDays>0</LastReportedDays><LastReportedHours>2</LastReportedHours><LastReportedMinutes>145</LastReportedMinutes><IPAddress>185.212.21.34</IPAddress><LocalIPAddress>172.18.193.32</LocalIPAddress><MACAddress>F8:59:71:86:81:CF</MACAddress><Platform>WindowsDesktop</Platform><PurchaseDate>03.11.2021
59
+ 00:00:00</PurchaseDate><OSVersionName>Windows 10 Pro (20H2)</OSVersionName><Client><ID>9</ID></Client><ConfigProfileDeployments><ConfigProfileDeployment><ID>1</ID><ConfigProfile><ID>7</ID></ConfigProfile></ConfigProfileDeployment></ConfigProfileDeployments><Status>Active</Status><Created>27.10.2021
60
+ 08:10:37</Created><Modified>03.11.2021 11:09:57</Modified><Source>MiradoreOnline</Source></Device></Items></Content>
61
+ recorded_at: Wed, 03 Nov 2021 13:29:28 GMT
62
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,39 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: patch
5
+ uri: https://test634.online.miradore.com/API/v2/Device/9/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"category":"Laptops","friendlyname":"Eduard personal","userEmailAddress":"eduard@rzilient.club","location":["Barcelona"],"tags":["Personal"],"ownershipStartDate":"2021-11-03
9
+ 10:25:18 +0100"}'
10
+ headers:
11
+ Content-Type:
12
+ - application/json
13
+ Accept:
14
+ - application/json
15
+ X-Api-Key:
16
+ -
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ User-Agent:
20
+ - Ruby
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - Microsoft-IIS/10.0
28
+ X-Frame-Options:
29
+ - SAMEORIGIN
30
+ - SAMEORIGIN
31
+ Date:
32
+ - Wed, 03 Nov 2021 09:25:18 GMT
33
+ Content-Length:
34
+ - '0'
35
+ body:
36
+ encoding: UTF-8
37
+ string: ''
38
+ recorded_at: Wed, 03 Nov 2021 09:25:19 GMT
39
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://test634.online.miradore.com/API/v2/Device/9/category
6
+ body:
7
+ encoding: UTF-8
8
+ string: '"Laptops"'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ X-Api-Key:
15
+ -
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/10.0
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ - SAMEORIGIN
32
+ Date:
33
+ - Wed, 03 Nov 2021 10:48:33 GMT
34
+ Content-Length:
35
+ - '81'
36
+ body:
37
+ encoding: UTF-8
38
+ string: '{"categoryID":3,"name":"Laptops","description":null,"deviceCount":2,"image":null}'
39
+ recorded_at: Wed, 03 Nov 2021 10:48:34 GMT
40
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://test634.online.miradore.com/API/v2/Device/9/model
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"model":"test"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ X-Api-Key:
15
+ - 1_8,Yo-TV8QyCiBUF
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 400
23
+ message: Bad Request
24
+ headers:
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/10.0
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ - SAMEORIGIN
32
+ Date:
33
+ - Wed, 03 Nov 2021 13:30:26 GMT
34
+ Content-Length:
35
+ - '2'
36
+ body:
37
+ encoding: UTF-8
38
+ string: "{}"
39
+ recorded_at: Wed, 03 Nov 2021 13:30:27 GMT
40
+ recorded_with: VCR 6.0.0
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ruby
4
4
  module Miradore
5
- VERSION = "2.1.3"
5
+ VERSION = "2.2.6"
6
6
  end
7
7
  end
data/lib/ruby/miradore.rb CHANGED
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "miradore/version"
4
+ require "active_support/core_ext/hash/conversions"
4
5
  require "httparty"
5
6
  require "json"
6
7
  require "crack/xml"
7
- require "active_support/core_ext/hash/conversions"
8
8
  require "finest/builder"
9
9
 
10
+
10
11
  module Ruby
11
12
  module Miradore
12
13
 
@@ -48,11 +49,11 @@ module Ruby
48
49
  )
49
50
  end
50
51
 
51
- def add(**args)
52
+ def call(**args)
52
53
  transform(
53
54
  Crack::XML.parse(
54
- http_method(args.merge(method: :post, attribute: "ID")).body
55
- )
55
+ http_method(args.merge( attribute: "ID")).body
56
+ )["Content"]
56
57
  )
57
58
  end
58
59
 
@@ -60,12 +61,12 @@ module Ruby
60
61
 
61
62
  def http_method(**args)
62
63
  url = Miradore.url[version] % args.merge(
63
- item: to_s.demodulize,
64
+ item: to_s.split("::").last,
64
65
  attribute: args.fetch(:attribute, "*"),
65
66
  auth: args.fetch(:auth, nil),
66
67
  filter: args.fetch(:filter, nil)
67
68
  )
68
- method(args.fetch(:method, :get)).call(url, body: args.fetch(:body, nil)&.to_xml(root: "Content"))
69
+ method(args.fetch(:method, :get)).call(url, body: args.fetch(:body, nil)&.to_xml(root: "Content", skip_types: true))
69
70
  end
70
71
 
71
72
  private
@@ -78,7 +79,7 @@ module Ruby
78
79
  end
79
80
  const_get(to_s).new(args.merge(res.values.first&.transform_keys(&:downcase)))
80
81
  rescue StandardError
81
- { error: "#{to_s.demodulize}(s) not found", status: :not_found }
82
+ { error: "#{to_s.split("::").last}(s) not found", status: :not_found }
82
83
  end
83
84
 
84
85
  def version
@@ -119,8 +120,12 @@ module Ruby
119
120
  http_method(args.merge(method: :get, action: __method__))
120
121
  end
121
122
 
122
- def patch(**args)
123
- http_method(args.merge(method: :patch))
123
+ def family(**args)
124
+ http_method(args.merge(method: :put, action: :category))
125
+ end
126
+
127
+ def model(**args)
128
+ http_method(args.merge(method: :put, action: __method__))
124
129
  end
125
130
 
126
131
  def device_serial_number
@@ -139,6 +144,14 @@ module Ruby
139
144
  !!invdevice&.imei
140
145
  end
141
146
 
147
+ def patch(**args)
148
+ http_method(args.merge(method: __method__))
149
+ end
150
+
151
+ def post(**args)
152
+ http_method(args.merge(method: __method__))
153
+ end
154
+
142
155
  private
143
156
 
144
157
  def http_method(**args)
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 "activesupport", "~> 6.1"
35
- spec.add_dependency 'builder', '~> 2.0'
35
+ spec.add_dependency 'builder', '~> 3.1'
36
36
  spec.add_dependency "crack", "~> 0.4"
37
37
  spec.add_dependency "finest-builder", "~> 1.0"
38
38
  spec.add_dependency "httparty", "~> 0.18"
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.1.3
4
+ version: 2.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduard Garcia Castelló
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-02 00:00:00.000000000 Z
11
+ date: 2021-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
33
+ version: '3.1'
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: '2.0'
40
+ version: '3.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: crack
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -150,16 +150,25 @@ files:
150
150
  - fixtures/vcr_cassettes/Get__Mobile_Device.yml
151
151
  - fixtures/vcr_cassettes/InvDevice.yml
152
152
  - fixtures/vcr_cassettes/LockDevice_all.yml
153
+ - fixtures/vcr_cassettes/add_new_other_device.yml
153
154
  - fixtures/vcr_cassettes/all_criteria.yml
154
155
  - fixtures/vcr_cassettes/auth_not_found.yml
155
156
  - fixtures/vcr_cassettes/error_by_serial_number.yml
156
157
  - fixtures/vcr_cassettes/full_list_and_details.yml
158
+ - fixtures/vcr_cassettes/get_computer_device_to_update.yml
159
+ - fixtures/vcr_cassettes/get_computer_device_to_update_2.yml
157
160
  - fixtures/vcr_cassettes/get_location.yml
158
161
  - fixtures/vcr_cassettes/get_user_from_miradore.yml
159
162
  - fixtures/vcr_cassettes/search_by_serial_number.yml
163
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device.yml
164
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device_v2.yml
165
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device_v2_2.yml
160
166
  - fixtures/vcr_cassettes/user_alredy_exist_in_miradore.yml
161
167
  - lib/ruby/miradore.rb
162
168
  - lib/ruby/miradore/version.rb
169
+ - ruby-miradore-2.0.1.gem
170
+ - ruby-miradore-2.0.2.gem
171
+ - ruby-miradore-2.1.2.gem
163
172
  - ruby-miradore.gemspec
164
173
  homepage: https://github.com/eddygarcas/ruby-miradore
165
174
  licenses: