Class: OnlyofficeFileHelper::LinuxHelper
- Inherits:
-
Object
- Object
- OnlyofficeFileHelper::LinuxHelper
show all
- Extended by:
- XdotoolHelper
- Defined in:
- lib/onlyoffice_file_helper/linux_helper.rb
Overview
class for using Linux stuff
Class Method Summary
collapse
find_window_id, send_button_to_window
Class Method Details
.clipboard_content ⇒ Object
40
41
42
|
# File 'lib/onlyoffice_file_helper/linux_helper.rb', line 40
def self.clipboard_content
`xclip -o`
end
|
.computer_name ⇒ Object
32
33
34
35
36
|
# File 'lib/onlyoffice_file_helper/linux_helper.rb', line 32
def self.computer_name
computer_name = Socket.gethostname
OnlyofficeLoggerHelper.log("`LinuxHelper.get_computer_name` # #{computer_name}")
computer_name
end
|
.download_file(link, full_name_file) ⇒ Object
11
12
13
|
# File 'lib/onlyoffice_file_helper/linux_helper.rb', line 11
def self.download_file(link, full_name_file)
`wget -O #{full_name_file} #{link}`
end
|
.kill_all(process) ⇒ Object
15
16
17
18
|
# File 'lib/onlyoffice_file_helper/linux_helper.rb', line 15
def self.kill_all(process)
OnlyofficeLoggerHelper.log("killall -9 #{process} 2>&1")
`killall -9 #{process} 2>&1`
end
|
.kill_all_browsers ⇒ Object
20
21
22
23
24
|
# File 'lib/onlyoffice_file_helper/linux_helper.rb', line 20
def self.kill_all_browsers
kill_all('firefox')
kill_all('chrome')
kill_all('opera')
end
|
.my_external_ip ⇒ Object
53
54
55
|
# File 'lib/onlyoffice_file_helper/linux_helper.rb', line 53
def self.my_external_ip
`curl "http://myexternalip.com/raw"`.chomp
end
|
.user_dir(name) ⇒ String
Get user dirs specified by ‘xdg-user-dir`
49
50
51
|
# File 'lib/onlyoffice_file_helper/linux_helper.rb', line 49
def self.user_dir(name)
`xdg-user-dir #{name.to_s.upcase}`.strip
end
|
.user_name ⇒ Object
26
27
28
|
# File 'lib/onlyoffice_file_helper/linux_helper.rb', line 26
def self.user_name
`id -u -n`
end
|