Sha256: 00e230de07058d7d0ec79d0670083cd3cd0b108d068f1c6583962b639dd74434

Contents?: true

Size: 976 Bytes

Versions: 7

Compression:

Stored size: 976 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).strip
  File.open(file, 'w') { |f| f.write 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

7 entries across 7 versions & 1 rubygems

Version Path
bourdain-1.3.2 lib/bourdain/helpers.rb
bourdain-1.3.1 lib/bourdain/helpers.rb
bourdain-1.3.0 lib/bourdain/helpers.rb
bourdain-1.2.22 lib/bourdain/helpers.rb
bourdain-1.2.21 lib/bourdain/helpers.rb
bourdain-1.2.20 lib/bourdain/helpers.rb
bourdain-1.2.19 lib/bourdain/helpers.rb