module Sinatra::Hexacta

Constants

GEM_FILE_DIR

Public Instance Methods

copy_all_files(original_path, link_path) click to toggle source
# File lib/sinatra/hexacta.rb, line 22
def copy_all_files(original_path, link_path)
  Dir.foreach("#{gem_path}#{original_path}") do |child|
    copy_file("#{original_path}/#{child}","#{link_path}/#{child}") unless child == '.' || child == '..'
  end
end
copy_dir_structure(original_path, destination_path) click to toggle source
# File lib/sinatra/hexacta.rb, line 32
def copy_dir_structure(original_path, destination_path)
  FileUtils.copy_entry("#{gem_path}#{original_path}", destination_path)
end
copy_file(original_path, link_path) click to toggle source
# File lib/sinatra/hexacta.rb, line 18
def copy_file(original_path, link_path)
  IO.copy_stream("#{gem_path}#{original_path}",link_path) unless File.exist?(link_path) && FileUtils.compare_file("#{gem_path}#{original_path}",link_path)
end
gem_path() click to toggle source
# File lib/sinatra/hexacta.rb, line 14
def gem_path
  File.expand_path("../..",__dir__)
end
setup_dir(path) click to toggle source
# File lib/sinatra/hexacta.rb, line 28
def setup_dir(path)
  FileUtils.mkdir_p path
end