beginnings of file handling
This commit is contained in:
parent
44028f86d2
commit
68e301a00b
23
file_nav.rb
23
file_nav.rb
|
@ -1,30 +1,37 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DirTermine
|
||||
|
||||
attr_accessor :save_dir, :source_dir
|
||||
|
||||
def initialize
|
||||
@save_dir = save_dir
|
||||
@to_resize = to_resize
|
||||
@source_dir = source_dir
|
||||
end
|
||||
|
||||
def destination_dir
|
||||
puts 'Please enter desired save directory (Leave blank for ~/Pictures/stickerized)'
|
||||
dir = gets.chomp
|
||||
|
||||
'~/Pictures/stickerized' if dir.empty?
|
||||
end
|
||||
|
||||
def origin_dir
|
||||
puts 'Please enter directory containing pictures to stickerize (Leave blank for current directory)'
|
||||
dir = gets.chomp
|
||||
Dir.getwd if dir.empty?
|
||||
end
|
||||
|
||||
def dir_check(path)
|
||||
if Dir.exists?(File.expand_path(path))
|
||||
def establish_dirs
|
||||
@source_dir = File.expand_path(origin_dir)
|
||||
@save_dir = File.expand_path(destination_dir)
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
end
|
||||
def dbug
|
||||
puts @source_dir
|
||||
puts @save_dir
|
||||
end
|
||||
end
|
||||
|
||||
testr = DirTermine.new
|
||||
testr.save_dir
|
||||
testr.establish_dirs
|
||||
testr.dbug
|
||||
|
|
Loading…
Reference in a new issue