Class: EhbrsRubyUtils::Vg::Nds::Organizer::BaseFile

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/vg/nds/organizer/base_file.rb

Direct Known Subclasses

PubFile, RomFile, SaveFile

Instance Method Summary collapse

Instance Method Details

#change?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/ehbrs_ruby_utils/vg/nds/organizer/base_file.rb', line 19

def change?
  source_path != target_path
end

#idObject



23
24
25
# File 'lib/ehbrs_ruby_utils/vg/nds/organizer/base_file.rb', line 23

def id
  source_path.basename_noext.to_path
end

#performObject



27
28
29
30
31
# File 'lib/ehbrs_ruby_utils/vg/nds/organizer/base_file.rb', line 27

def perform
  return unless change?

  ::FileUtils.mv(source_path, target_path.assert_parent)
end

#showObject



33
34
35
# File 'lib/ehbrs_ruby_utils/vg/nds/organizer/base_file.rb', line 33

def show
  puts "#{format_path(target_path, :green)} <= #{format_path(source_path, :yellow)}"
end