Top Level Namespace

Defined Under Namespace

Modules: Libsessho Classes: Array, Numeric, String

Instance Method Summary collapse

Instance Method Details

#backtrack_callObject

Raises:

  • (NotImplementedError)


90
91
92
# File 'lib/libsessho.rb', line 90

def backtrack_call
	raise NotImplementedError
end

#localIPObject



94
95
96
97
# File 'lib/libsessho.rb', line 94

def localIP
	require 'socket'
	Socket.ip_address_list.map{|i|i.inspect.split(" ")[-1].split(">")[0]}.select{|i|i.match(/^\d{,3}\.\d{,3}\.\d{,3}.\d{,3}$/)}.select{|i|i!="127.0.0.1"}[0]
end

#publicIPObject



80
81
82
83
# File 'lib/libsessho.rb', line 80

def publicIP
	require 'net/http'
	return Net::HTTP.get(URI('https://api.ipify.org'))
end

#publicIPv6Object



85
86
87
88
# File 'lib/libsessho.rb', line 85

def publicIPv6
	require 'net/http'
	Net::HTTP.get(URI("http://whatismyip.org")).match(/\h{,4}:\h{,4}:\h{,4}:\h{,4}:\h{,4}:\h{,4}:\h{,4}:\h{,4}/).to_s
end

#warning_msg(msg) ⇒ Object



19
20
21
# File 'lib/libsessho.rb', line 19

def warning_msg(msg)
	puts "\e[31m#{msg}\e[39m"
end