beginnings of file handling

This commit is contained in:
reimage 2019-06-11 16:26:03 -07:00
parent 44028f86d2
commit 68e301a00b

View file

@ -1,30 +1,37 @@
# frozen_string_literal: true # frozen_string_literal: true
class DirTermine class DirTermine
attr_accessor :save_dir, :source_dir
def initialize def initialize
@save_dir = save_dir @save_dir = save_dir
@to_resize = to_resize @source_dir = source_dir
end end
def destination_dir def destination_dir
puts 'Please enter desired save directory (Leave blank for ~/Pictures/stickerized)' puts 'Please enter desired save directory (Leave blank for ~/Pictures/stickerized)'
dir = gets.chomp dir = gets.chomp
'~/Pictures/stickerized' if dir.empty?
end end
def origin_dir def origin_dir
puts 'Please enter directory containing pictures to stickerize (Leave blank for current directory)' puts 'Please enter directory containing pictures to stickerize (Leave blank for current directory)'
dir = gets.chomp dir = gets.chomp
Dir.getwd if dir.empty?
end end
def dir_check(path) def establish_dirs
if Dir.exists?(File.expand_path(path)) @source_dir = File.expand_path(origin_dir)
@save_dir = File.expand_path(destination_dir)
end
else def dbug
puts @source_dir
end puts @save_dir
end end
end end
testr = DirTermine.new testr = DirTermine.new
testr.save_dir testr.establish_dirs
testr.dbug