class CLI

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/memo_for_bin/memo, line 5
def initialize(*args)
  super
  @memo_dir = "#{ENV['HOME']}/.Memo"
  FileOP.allocate.is_exist_and_mk_dir(dir_path: @memo_dir)
end

Public Instance Methods

check() click to toggle source
# File lib/memo_for_bin/memo, line 28
def check
  system("ls #{@memo_dir}")
end
new(*args) click to toggle source
# File lib/memo_for_bin/memo, line 12
def new(*args)
  if args.empty?
    puts "WARNING: filename is nothing."
  else
    file_path = "#{@memo_dir}/#{args[0]}.org"
    FileOP.allocate.is_exist_and_mk_file(file_path: "#{file_path}")
    system("emacs #{file_path}")
  end
end
open(*args) click to toggle source
# File lib/memo_for_bin/memo, line 33
def open(*args)
  file_path = "#{@memo_dir}/#{args[0]}.org"
  if File.exists?(file_path)
    puts "open #{file_path}"
    system("emacs #{file_path}")
  else
    puts "#{file_path} is not existed"
  end
end
rm(*args) click to toggle source
# File lib/memo_for_bin/memo, line 23
def rm(*args)
  FileOP.allocate.is_exist_and_rm_file(file_path: "#{@memo_dir}/#{args[0]}.org")
end