Commit d388156
Changed files (1)
lib
lib/fake_agent.rb
@@ -1,3 +1,5 @@
+require 'socket'
+
class FakeAgent
attr_reader :id, :endpoint
@@ -49,6 +51,8 @@ class FakeAgent
data: {
fingerprint: fingerprint,
full_path: file,
+ hostname: Socket.gethostname,
+ ip_addresses: ip_addresses,
}
}
}
@@ -65,4 +69,8 @@ class FakeAgent
sha, * = result.split(' ')
sha
end
+
+ def ip_addresses
+ Socket.ip_address_list.find_all { |x| x.ipv4? }.map { |x| x.ip_address }
+ end
end