You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
945 B
40 lines
945 B
#!/usr/bin/env ruby
|
|
|
|
LANGUAGES = [
|
|
"ruby",
|
|
"c++",
|
|
"py"
|
|
]
|
|
|
|
def main()
|
|
user_name = ARGV[0]
|
|
puts "Hello my catgirl #{user_name}! \nWhat is your love language?"
|
|
LANGUAGES.each { |language| puts "#{language}", " " }
|
|
|
|
user_lang = STDIN.gets.chomp
|
|
case user_lang
|
|
when "ruby"
|
|
puts "Подлиза \n"
|
|
when "c++"
|
|
puts "MATLAB скушал? \n"
|
|
when "TS/JS"
|
|
puts "Фронтендер, Фууу! \n"
|
|
when "py"
|
|
puts "Девопсер, иди ДАГИ писать \n"
|
|
end
|
|
|
|
puts "Введите команду на языке Ruby для выполнения:"
|
|
ruby_command = STDIN.gets.chomp
|
|
begin
|
|
eval(ruby_command)
|
|
rescue Exception => e
|
|
puts "Ошибка выполнения команды Ruby: #{e.message}"
|
|
end
|
|
|
|
puts "Введите команду операционной системы для выполнения:"
|
|
os_command = STDIN.gets.chomp
|
|
system(os_command)
|
|
end
|
|
|
|
main()
|