Class: SysLibDetector::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/sys_lib_detector/cli.rb

Overview

The command-line interface class, responsible for the commands of running the gem’s funcionalities, using Thor’s gem

Instance Method Summary collapse

Instance Method Details

#list_all_gemsObject

Listing the local gems existing in the porject



11
12
13
14
15
16
17
18
# File 'lib/sys_lib_detector/cli.rb', line 11

def list_all_gems
	gems = get_gems
	if gems.empty?
		puts "You don't have any gems installed"
	else
		puts gems
	end
end

#list_sys_libsObject

Retrieving the required system libraries for the project’s local gems via sending the retrieval request to the web-service, and then displaying it in a friendly way using the Displayer class



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/sys_lib_detector/cli.rb', line 24

def list_sys_libs
	gems = get_gems
	os = get_os_name
	begin
		web_service_handler = get_web_service_handler
		response = web_service_handler.retrieve_sys_libraries(gems, os)

		response = clean_response(response)

		Displayer::diplay_list_sys_libs(response, gems)
	rescue Exception::NoInternetConnection
		abort "Please check your internet connectivity"
	end
end