anamo 0.9.2 → 0.9.5

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
  SHA1:
3
- metadata.gz: 504309d5a14cbe13c3b572643afb38c3e960b423
4
- data.tar.gz: 09b8f9233c8d961164c53aedead7a42cb68dad62
3
+ metadata.gz: 6782a1663dd02fa4b2aa92ba9afff401e62bd8a8
4
+ data.tar.gz: 857923855bb5f77b1b344022b119fc3b15ed4ddc
5
5
  SHA512:
6
- metadata.gz: 08b1b18913fa75be9774a94604cc3e92d4476e8f0d5b4ef06716f9545af6a00e3b1a3354c07347514c1889ca637069a6da6fb00d756faef073c586ea52766d0f
7
- data.tar.gz: 74dd5c4e06451d488a49a0534a6cd268c7a28e673c2a73b35ab6cf346782f7ff1bb56c94530a24f995f20a0f76186be471139b72346c68fa38c6f8e866eb6abd
6
+ metadata.gz: 74643deb59e6752718f9f94cbd01a37eda1811067e4979757e260b1903b4e7bb5ca0003a4a57a3e07df35919e2861463e96b630b800fbcb5994ef3547f443ce1
7
+ data.tar.gz: 7fbe9b4536325852966f918a6bf5808b231041d66e849643359e99af593332df41241f2c07b4c4516ac55cafe774284e31ffdc0176d42232b370d89b37fb7dd6
@@ -1,6 +1,7 @@
1
1
  require 'thor'
2
2
  require 'benchmark'
3
3
  require 'zlib'
4
+ require 'csv'
4
5
  require 'fileutils'
5
6
  require 'anamo/api'
6
7
 
@@ -38,7 +39,7 @@ module Anamo
38
39
  def add_row row
39
40
  reinit_handle if @row_count > 0 && @row_count % @files_per_file == 0
40
41
  [0,2,3,4,5].each { |i| row[i] = '' if @previous_row[i] == row[i] } if @previous_row
41
- @handle.write "#{row.join(',')}\n"
42
+ @handle.write row.to_csv
42
43
  @row_count = @row_count + 1
43
44
  @previous_row = row
44
45
  end
@@ -81,7 +82,6 @@ module Anamo
81
82
  stat = nil
82
83
  end
83
84
 
84
- # TODO: escape base name!!!!
85
85
  data = [depth, File.basename(path)]
86
86
 
87
87
  open_as_directory = false
@@ -64,6 +64,29 @@ module Anamo
64
64
  configuration['api_key'] = ask "What is your Anamo API key?\n", :bold
65
65
  end
66
66
 
67
+ configuration['modules'] = {}
68
+
69
+ if ['y','yes'].include? ask("Would you like to configure send frequencies? (y/n)\n", :bold).downcase
70
+ freq = ask "How often should filesystem data be sent to server? (in seconds -- default: 240 seconds)\n", :bold
71
+ if freq.strip.length > 0
72
+ configuration['modules']['fstree'] = {
73
+ 'frequency' => freq
74
+ }
75
+ end
76
+ freq = ask "How often should package data be sent to server? (in seconds -- default: 60 seconds)\n", :bold
77
+ if freq.strip.length > 0
78
+ configuration['modules']['pkgver'] = {
79
+ 'frequency' => freq
80
+ }
81
+ end
82
+ freq = ask "How often should port data be sent to server? (in seconds -- default: 60 seconds)\n", :bold
83
+ if freq.strip.length > 0
84
+ configuration['modules']['ports'] = {
85
+ 'frequency' => freq
86
+ }
87
+ end
88
+ end
89
+
67
90
  say "\nYour configuration file:\n\n", [:green, :bold]
68
91
 
69
92
  configuration_yaml = YAML.dump configuration
@@ -59,16 +59,20 @@ module Anamo
59
59
  end
60
60
 
61
61
  gem_packages = []
62
- begin
63
- Gem::Specification.all = nil # TODO: fix for Debian (can't use all=)
64
- Gem::Specification.each do |a|
65
- gem_packages << {
66
- 'n' => a.name,
67
- 'v' => a.version.to_s
68
- }
62
+ status, stdout, stderr = systemu "gem list -l"
63
+ if status.success?
64
+ stdout.split("\n").each do |package|
65
+ if package.strip.length > 0 and package[0,1] != '*'
66
+ if match = /(.*) \((?:default\: )?(.*)\)/.match(package)
67
+ gem_packages << {
68
+ 'n' => match[1],
69
+ 'v' => match[2]
70
+ }
71
+ end
72
+ end
69
73
  end
70
- Gem::Specification.reset
71
- rescue
74
+ else
75
+ gem_packages = nil
72
76
  end
73
77
 
74
78
  npm_packages = nil
@@ -1,3 +1,3 @@
1
1
  module Anamo
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.5"
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: 0.9.2
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - US ProTech
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-13 00:00:00.000000000 Z
11
+ date: 2018-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.5.1
139
+ rubygems_version: 2.6.14
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: This gem provides a beacon that collects system telemetry for a client and