Sha256: deb58c57e59af248da0e259837692221b11e601a453025728335b31c4cd7f362

Contents?: true

Size: 969 Bytes

Versions: 6

Compression:

Stored size: 969 Bytes

Contents

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bourdain-1.2.18 lib/bourdain/helpers.rb
bourdain-1.2.17 lib/bourdain/helpers.rb
bourdain-1.2.16 lib/bourdain/helpers.rb
bourdain-1.2.15 lib/bourdain/helpers.rb
bourdain-1.2.14 lib/bourdain/helpers.rb
bourdain-1.2.13 lib/bourdain/helpers.rb