Changes
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
def ensure_dir_exists(directory_path)
|
||||
unless Dir.exist?(directory_path)
|
||||
FileUtils.mkdir_p(directory_path)
|
||||
spawn_toast 'Directory Created', %(Poaster created #{directory_path}.), 10
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
def spawn_input_box(title, text)
|
||||
`kdialog --title "#{title}" --inputbox "#{text}"`
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
def spawn_radio_list(title, text, options_arr)
|
||||
command = %(kdialog --title "#{title}" --radiolist "#{text}")
|
||||
options_arr.each_with_index do |option, i|
|
||||
command += %( #{i} "#{option}" off)
|
||||
end
|
||||
`#{command}`
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
def spawn_toast(title, text, seconds)
|
||||
`kdialog --title "#{title}" --passivepopup "#{text}" #{seconds}`
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
def write_file(directory, name, extension, content)
|
||||
post_file = File.new(%(#{directory}/#{name}.#{extension}), 'w+')
|
||||
post_file.syswrite(content)
|
||||
post_file.close
|
||||
end
|
||||
Reference in New Issue
Block a user