ruby-miradore 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/lib/ruby/miradore.rb +7 -2
- data/lib/ruby/miradore/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a2d7224c804d8330fdd5af6a4f59812484057f75b317f11a2d0501a32b7d637
|
4
|
+
data.tar.gz: 4f6f3898d4f2a378e37059172b671d87fb8202cea5955880477c1c293726f866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed281193865b2c9426fac2fab0fa0f3ed82801562d25effc7a81bdbe566f55514b40d3297b66d0af31cdb690d22002e063c599eb94bd92f0e721443b57455481
|
7
|
+
data.tar.gz: ccb8a22f0d3f125ab3c930aa34e635af842d69f14f2b28e3ed5948603ca615dfe35065d1948c7da11e205f792b835652f5b9ecce20ebb4b2c50af47175b230c5
|
data/Gemfile
CHANGED
data/lib/ruby/miradore.rb
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "miradore/version"
|
4
|
+
require 'httparty'
|
5
|
+
require 'json'
|
6
|
+
require 'crack/xml'
|
7
|
+
require 'finest/builder'
|
4
8
|
|
5
9
|
module Ruby
|
6
10
|
module Miradore
|
7
11
|
class Error < StandardError; end
|
8
12
|
|
9
|
-
@@msp_api_key = ENV['MSP_API_KEY']
|
13
|
+
@@msp_api_key = ENV['MSP_API_KEY'] || '3_IHBPttQ.ub[OG27'
|
14
|
+
|
10
15
|
|
11
16
|
def self.api_key
|
12
17
|
@@msp_api_key
|
@@ -30,7 +35,7 @@ module Ruby
|
|
30
35
|
attr_reader :subdomain
|
31
36
|
|
32
37
|
def self.all(subdomain, *args)
|
33
|
-
response = JSON.parse(
|
38
|
+
response = JSON.parse(Crack::XML.parse(get(Miradore::url(:v1, subdomain)).body).to_json, :quirks_mode => true).dig("Content", "Items", "Device")
|
34
39
|
if response.is_a?(Array)
|
35
40
|
response.map! { |e| Device.new(e.transform_keys(&:downcase), subdomain) }
|
36
41
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-miradore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduard
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
|
-
rubygems_version: 3.1.
|
58
|
+
rubygems_version: 3.1.6
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Miradore is a MSP providing an API to get devices information as well s perform
|