anamo 1.1.5 → 1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8710fa69bba9fa27a00b89f0a4f15f2fb5f1dcc23d2b968bb11f6dbecc047501
4
- data.tar.gz: d016007e6d6451f7bdd1457f3fe310f09a38b7d0f012e4bb9af19e89331641c5
3
+ metadata.gz: d31b3a718b2ebff86c2326ff4def5e2a13773760be6a308c286d4628f8af38e6
4
+ data.tar.gz: 5dab5a624a7da18e82dbc7613e46647bce6ecfb81502a2f5040ad982190dd542
5
5
  SHA512:
6
- metadata.gz: 2a060b354356c409f5e145377ad1f4c808b7a5600a27525f6193ca63c7481f27b0e90f42756c02d6b37c0fb2bee37a445efc745295cbce234c66824267aeb050
7
- data.tar.gz: e8ebc708ea75d392b5ce268ad4547d1441d2ffb2beeaaae7d33af7054c38cad8af349983311110296bb17b8cf3ff66e0a1b70d148a81e3ad9916b7a1f66a3e5d
6
+ metadata.gz: 729bb04c281bf3fcc4ab8132bae9abdc2a8f91fc445aac7a850b6358f1d70358d915d591e233b45adb20d6c41b25463801242cbe5dc31ea27c3d223567ea2ffc
7
+ data.tar.gz: 3753c8ecfd7b17d2171360c50ec19a455cf7f9752c9d696fd99a84ba94afb662c70164552c7238237d200bab0889811c891254cbe571532e9f0e34e4dc532cd9
@@ -7,8 +7,8 @@ module Anamo
7
7
 
8
8
  def initialize
9
9
  @api_base_url = 'https://app.anamo.io/api'
10
- @config = YAML.load_file "/etc/anamo.conf.yml"
11
- @client_key = File.exists?("/etc/anamo.client.key") ? File.open("/etc/anamo.client.key", 'rb') { |f| f.read } : nil
10
+ @config = YAML.load_file "/$HOME/anamo.conf.yml"
11
+ @client_key = File.exists?("/$HOME/anamo.client.key") ? File.open("/$HOME/anamo.client.key", 'rb') { |f| f.read } : nil
12
12
  end
13
13
 
14
14
  def make_url path
@@ -1,3 +1,3 @@
1
1
  ---
2
- api_key: 63ITKI8a0CrQQW06rK
2
+ api_key:
3
3
  modules: {}
@@ -37,8 +37,12 @@ module Anamo
37
37
 
38
38
  ret = {}
39
39
 
40
- config = YAML.load_file "/etc/anamo.conf.yml"
40
+ config = YAML.load_file "/$HOME/anamo.conf.yml"
41
+
42
+ #train
41
43
  train = Train.create('local')
44
+ # start or reuse a connection
45
+ conn = train.connection
42
46
 
43
47
  ret['api_key'] = config['api_key']
44
48
  ret['beacon_modules'] = config['modules']
@@ -50,14 +54,14 @@ module Anamo
50
54
  ret['node']['os_release'] = Train.create('local').connection.os[:release]
51
55
 
52
56
  # run a command on Linux/Unix/Mac
53
- ret['node']['cpe'] conn.run_command('hostnamectl | grep "Static hostname: "').stdout
54
- ret['node']['chassis'] conn.run_command('hostnamectl | grep "Chassis: "').stdout
55
- ret['node']['machine_id'] conn.run_command('hostnamectl | grep "Machine ID: "').stdout
56
- ret['node']['boot_id'] conn.run_command('hostnamectl | grep "Boot ID: "').stdout
57
- ret['node']['virtualization'] conn.run_command('hostnamectl | grep "Virtualization: "').stdout
58
- ret['node']['operating_system'] conn.run_command('hostnamectl | grep "Operating System: "').stdout
59
- ret['node']['kernel'] conn.run_command('hostnamectl | grep "Kernel: "').stdout
60
- ret['node']['architecture'] conn.run_command('hostnamectl | grep "Architecture: "').stdout
57
+ ret['node']['cpe'] = conn.run_command('hostnamectl | grep "Static hostname: "').stdout
58
+ ret['node']['chassis'] = conn.run_command('hostnamectl | grep "Chassis: "').stdout
59
+ ret['node']['machine_id'] = conn.run_command('hostnamectl | grep "Machine ID: "').stdout
60
+ ret['node']['boot_id'] = conn.run_command('hostnamectl | grep "Boot ID: "').stdout
61
+ ret['node']['virtualization'] = conn.run_command('hostnamectl | grep "Virtualization: "').stdout
62
+ ret['node']['operating_system'] = conn.run_command('hostnamectl | grep "Operating System: "').stdout
63
+ ret['node']['kernel'] = conn.run_command('hostnamectl | grep "Kernel: "').stdout
64
+ ret['node']['architecture'] = conn.run_command('hostnamectl | grep "Architecture: "').stdout
61
65
 
62
66
  #Uname (General)
63
67
  ret['node']['uname_sysname'] = Uname.sysname # => The operating system name. e.g. "SunOS"
@@ -143,7 +147,7 @@ module Anamo
143
147
  if defined? @config_file_path
144
148
  @config_file_path
145
149
  else
146
- return '/etc/anamo.conf.yml'
150
+ return '/$HOME/anamo.conf.yml'
147
151
  end
148
152
  end
149
153
 
@@ -152,7 +156,7 @@ module Anamo
152
156
  private
153
157
 
154
158
  def key_file
155
- "/etc/anamo.client.key"
159
+ "/$HOME/anamo.client.key"
156
160
  end
157
161
 
158
162
  end
@@ -4,7 +4,7 @@ require 'yaml'
4
4
  if ARGV[0]
5
5
  path = ARGV[0]
6
6
  else
7
- path = '/etc/anamo.conf.yml'
7
+ path = '/$HOME/anamo.conf.yml'
8
8
  end
9
9
 
10
10
  config = YAML.load_file(path)
@@ -1,3 +1,3 @@
1
1
  module Anamo
2
- VERSION = "1.1.5"
2
+ VERSION = "1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anamo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anamo, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-09 00:00:00.000000000 Z
11
+ date: 2020-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor