class Filesorter::Path

Public Instance Methods

get() click to toggle source
# File lib/filesorter/path.rb, line 20
def get
  settings = "#{Dir.home}/filesorter_settings.json"
  json = File.read(settings)
  JSON.parse(json)
end
set() click to toggle source
# File lib/filesorter/path.rb, line 5
def set
  puts "Enter video path"
  video_path = gets.chomp

  puts "Enter music path"
  music_path = gets.chomp

  puts "Enter picture path"
  picture_path = gets.chomp

  home = Dir.home
  system "echo '{\"video\":\"#{video_path}\",\"picture\":\"#{picture_path}\"
  ,\"music\":\"#{music_path}\"}' > #{home}/filesorter_settings.json"
end