Class: Utils::RegularFileConverter

Inherits:
Converter
  • Object
show all
Defined in:
lib/bujo/utils/converter.rb

Instance Method Summary collapse

Methods inherited from Converter

for

Instance Method Details

#convertObject



25
26
27
28
29
30
# File 'lib/bujo/utils/converter.rb', line 25

def convert
  source_relative_path = Pathname.new(File.expand_path(@source_path)).relative_path_from(Pathname.new(Configuration::Structure.sources_path))
  target_path = File.join(Configuration::Structure.targets_path, source_relative_path.to_s)
  puts "Converting #{@source_path} to #{target_path}..." if Configuration::Globals.verbose
  FileUtils.copy_file(@source_path, target_path)
end