Sha256: 13facd231073d654111856db19a59712dc2f74939e040f88a4e6d710b50e2e2d

Contents?: true

Size: 1.31 KB

Versions: 2

Compression:

Stored size: 1.31 KB

Contents

# encoding: utf-8
require 'sinatra/base'
require 'fileutils'
require 'sucker_punch'
require 'rufus-scheduler'

module Sinatra

  module Hexacta
    GEM_FILE_DIR = "sinatra-hexacta"

    def symlink(original_path, link_path)
      File.symlink "#{Gem.loaded_specs["sinatra-hexacta"].gem_dir}#{original_path}", "#{link_path}" unless Gem.loaded_specs["sinatra-hexacta"].nil? || File.exist?("#{link_path}")
    end

    def symlink_all(original_path, link_path)
      Dir.foreach("#{Gem.loaded_specs["sinatra-hexacta"].gem_dir}#{original_path}") do |child|
        symlink("#{original_path}/#{child}","#{link_path}/#{child}") unless child == '.' || child == '..'
      end unless Gem.loaded_specs["sinatra-hexacta"].nil?
    end

    def setup_dir(path)
      unless Gem.loaded_specs["sinatra-hexacta"].nil?
        FileUtils.remove_dir path if Dir.exist? path
        FileUtils.mkdir_p path
      end
    end

    def copy_dir_structure(original_path, destination_path)
      unless Gem.loaded_specs["sinatra-hexacta"].nil?
        FileUtils.remove_dir destination_path if Dir.exist? destination_path
        FileUtils.copy_entry("#{Gem.loaded_specs["sinatra-hexacta"].gem_dir}#{original_path}", destination_path)
      end
    end
  end
end

require_relative 'helpers/init'
require_relative 'handlers/init'
require_relative 'extensions/init'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sinatra-hexacta-0.1.1 lib/sinatra/hexacta.rb
sinatra-hexacta-0.1.0 lib/sinatra/hexacta.rb