require 'pathname' CWD = Dir.pwd PATH = File.expand_path(__FILE__) DIR = File.dirname(PATH) ROOT = File.expand_path(File.join(DIR, '..', '..')) BASE = Pathname.new(ROOT).relative_path_from(Pathname.new(CWD)).to_s def gem_path *dir Pathname.new(File.join(BASE, *dir)).cleanpath.to_s end def apply_template file, opts template_name, locals = opts[:template], opts[:locals] locals = Bourdain::Helpers::Locals.new(locals).bind unless locals.nil? template_path = gem_path('templates', *template_name) template = ERB.new File.read(template_path) contents = template.result(locals) File.open(file, 'w') { |f| f.puts contents } end require_relative 'helpers/config' require_relative 'helpers/locals' require_relative 'helpers/logger' require_relative 'helpers/parser' require_relative 'helpers/registry' module Bourdain Config = Bourdain::Helpers::Config.new(CONFIG) Registry = Bourdain::Helpers::Registry.new GITLAB_HOST = 'git.bluejeansnet.com' end