ruby-miradore 2.1.4 → 2.2.4

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: 67c958b4edfb47eaded9bd961ccda1d2611e68bbd4f3c4a64cf31c549da5ec58
4
- data.tar.gz: 1638439010818c0d5ddef7aac0d3ae4ab8dd098bf8578b239059a2f8e3f68dc0
3
+ metadata.gz: 76c58bc3692818bc8bcbb9bd67bd4a13fb5d5f2bd81d09bbb6cc6af547db532a
4
+ data.tar.gz: 8233914b10e2a5b349f0e0ee78966e48da2d83b28a42da349f4a0eecd5415ca5
5
5
  SHA512:
6
- metadata.gz: 5fca5b899740608d97377df42d0b2e36e6a6eb6606fc5284f6f44a0037eccfb5dcd73c43a6a824615985da2fea0bcb6af8e9367d46a8008c5953f77d1e2f07d3
7
- data.tar.gz: 30961cd5edab5e80416084d2ca51f227ad8a9fe173cbd41b13531ba8b4076265e75e30e7c34f9b7334eeab7c04b29e816e6f31ea0127f9d679a1d1353f36287e
6
+ metadata.gz: '09dbe42515b0cc45fe6b6d648b45e385f525d51173e81b0025944b148a48ad88ef87573e76463ddb478d9a0bef49a8270fb9c187822b9dd039ffc0abe676b50f'
7
+ data.tar.gz: 5a91f7947287e92e247b4753e8a652b6e06c8f96a81ec532483fa4a823a3a39d5fe00a584c4afb402344b2ffb07d5bdab17df5e1122e1441968862ec3d14f0ca
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,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-miradore (2.1.3)
5
- activesupport (~> 6.1)
6
- builder (~> 3.1)
4
+ ruby-miradore (2.2.4)
7
5
  crack (~> 0.4)
8
6
  finest-builder (~> 1.0)
9
7
  httparty (~> 0.18)
@@ -14,17 +12,9 @@ PATH
14
12
  GEM
15
13
  remote: https://rubygems.org/
16
14
  specs:
17
- activesupport (6.1.4.1)
18
- concurrent-ruby (~> 1.0, >= 1.0.2)
19
- i18n (>= 1.6, < 2)
20
- minitest (>= 5.1)
21
- tzinfo (~> 2.0)
22
- zeitwerk (~> 2.3)
23
15
  addressable (2.8.0)
24
16
  public_suffix (>= 2.0.2, < 5.0)
25
17
  ast (2.4.2)
26
- builder (3.2.4)
27
- concurrent-ruby (1.1.9)
28
18
  crack (0.4.5)
29
19
  rexml
30
20
  diff-lcs (1.4.4)
@@ -33,12 +23,9 @@ GEM
33
23
  httparty (0.20.0)
34
24
  mime-types (~> 3.0)
35
25
  multi_xml (>= 0.5.2)
36
- i18n (1.8.10)
37
- concurrent-ruby (~> 1.0)
38
26
  mime-types (3.3.1)
39
27
  mime-types-data (~> 3.2015)
40
28
  mime-types-data (3.2021.0901)
41
- minitest (5.14.4)
42
29
  multi_xml (0.6.0)
43
30
  parallel (1.21.0)
44
31
  parser (3.0.2.0)
@@ -60,7 +47,7 @@ GEM
60
47
  rspec-mocks (3.10.2)
61
48
  diff-lcs (>= 1.2.0, < 2.0)
62
49
  rspec-support (~> 3.10.0)
63
- rspec-support (3.10.2)
50
+ rspec-support (3.10.3)
64
51
  rubocop (1.22.3)
65
52
  parallel (~> 1.10)
66
53
  parser (>= 3.0.0.0)
@@ -73,15 +60,12 @@ GEM
73
60
  rubocop-ast (1.12.0)
74
61
  parser (>= 3.0.1.1)
75
62
  ruby-progressbar (1.11.0)
76
- tzinfo (2.0.4)
77
- concurrent-ruby (~> 1.0)
78
63
  unicode-display_width (2.1.0)
79
64
  vcr (6.0.0)
80
65
  webmock (3.14.0)
81
66
  addressable (>= 2.8.0)
82
67
  crack (>= 0.3.2)
83
68
  hashdiff (>= 0.4.0, < 2.0.0)
84
- zeitwerk (2.5.1)
85
69
 
86
70
  PLATFORMS
87
71
  x86_64-darwin-20
@@ -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.4"
5
+ VERSION = "2.2.4"
6
6
  end
7
7
  end
data/lib/ruby/miradore.rb CHANGED
@@ -4,7 +4,6 @@ require_relative "miradore/version"
4
4
  require "httparty"
5
5
  require "json"
6
6
  require "crack/xml"
7
- require "active_support/core_ext/hash/conversions"
8
7
  require "finest/builder"
9
8
 
10
9
  module Ruby
@@ -52,7 +51,7 @@ module Ruby
52
51
  transform(
53
52
  Crack::XML.parse(
54
53
  http_method(args.merge(method: :post, attribute: "ID")).body
55
- )
54
+ )["Content"]
56
55
  )
57
56
  end
58
57
 
@@ -60,12 +59,12 @@ module Ruby
60
59
 
61
60
  def http_method(**args)
62
61
  url = Miradore.url[version] % args.merge(
63
- item: to_s.demodulize,
62
+ item: to_s.split("::").last,
64
63
  attribute: args.fetch(:attribute, "*"),
65
64
  auth: args.fetch(:auth, nil),
66
65
  filter: args.fetch(:filter, nil)
67
66
  )
68
- method(args.fetch(:method, :get)).call(url, body: args.fetch(:body, nil)&.to_xml(root: "Content"))
67
+ method(args.fetch(:method, :get)).call(url, body: args.fetch(:body, nil))
69
68
  end
70
69
 
71
70
  private
@@ -78,7 +77,7 @@ module Ruby
78
77
  end
79
78
  const_get(to_s).new(args.merge(res.values.first&.transform_keys(&:downcase)))
80
79
  rescue StandardError
81
- { error: "#{to_s.demodulize}(s) not found", status: :not_found }
80
+ { error: "#{to_s.split("::").last}(s) not found", status: :not_found }
82
81
  end
83
82
 
84
83
  def version
@@ -119,8 +118,12 @@ module Ruby
119
118
  http_method(args.merge(method: :get, action: __method__))
120
119
  end
121
120
 
122
- def patch(**args)
123
- http_method(args.merge(method: :patch))
121
+ def family(**args)
122
+ http_method(args.merge(method: :put, action: :category))
123
+ end
124
+
125
+ def model(**args)
126
+ http_method(args.merge(method: :put, action: __method__))
124
127
  end
125
128
 
126
129
  def device_serial_number
@@ -139,6 +142,14 @@ module Ruby
139
142
  !!invdevice&.imei
140
143
  end
141
144
 
145
+ def patch(**args)
146
+ http_method(args.merge(method: __method__))
147
+ end
148
+
149
+ def post(**args)
150
+ http_method(args.merge(method: __method__))
151
+ end
152
+
142
153
  private
143
154
 
144
155
  def http_method(**args)
Binary file
Binary file
Binary file
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  # Uncomment to register a new dependency of your gem
33
33
  # spec.add_dependency "example-gem", "~> 1.0"
34
- spec.add_dependency "activesupport", "~> 6.1"
35
- spec.add_dependency 'builder', '~> 3.1'
34
+ #spec.add_dependency "activesupport", "~> 6.1"
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,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-miradore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.2.4
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-03 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '6.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '6.1'
27
- - !ruby/object:Gem::Dependency
28
- name: builder
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3.1'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.1'
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: crack
43
15
  requirement: !ruby/object:Gem::Requirement
@@ -150,16 +122,25 @@ files:
150
122
  - fixtures/vcr_cassettes/Get__Mobile_Device.yml
151
123
  - fixtures/vcr_cassettes/InvDevice.yml
152
124
  - fixtures/vcr_cassettes/LockDevice_all.yml
125
+ - fixtures/vcr_cassettes/add_new_other_device.yml
153
126
  - fixtures/vcr_cassettes/all_criteria.yml
154
127
  - fixtures/vcr_cassettes/auth_not_found.yml
155
128
  - fixtures/vcr_cassettes/error_by_serial_number.yml
156
129
  - fixtures/vcr_cassettes/full_list_and_details.yml
130
+ - fixtures/vcr_cassettes/get_computer_device_to_update.yml
131
+ - fixtures/vcr_cassettes/get_computer_device_to_update_2.yml
157
132
  - fixtures/vcr_cassettes/get_location.yml
158
133
  - fixtures/vcr_cassettes/get_user_from_miradore.yml
159
134
  - fixtures/vcr_cassettes/search_by_serial_number.yml
135
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device.yml
136
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device_v2.yml
137
+ - fixtures/vcr_cassettes/update_model_of_a_computer_device_v2_2.yml
160
138
  - fixtures/vcr_cassettes/user_alredy_exist_in_miradore.yml
161
139
  - lib/ruby/miradore.rb
162
140
  - lib/ruby/miradore/version.rb
141
+ - ruby-miradore-2.0.1.gem
142
+ - ruby-miradore-2.0.2.gem
143
+ - ruby-miradore-2.1.2.gem
163
144
  - ruby-miradore.gemspec
164
145
  homepage: https://github.com/eddygarcas/ruby-miradore
165
146
  licenses: