module Tacape

Constants

ROOT

Public Class Methods

config(root_dir = nil) click to toggle source
# File lib/tacape.rb, line 33
def self.config(root_dir = nil)
  root_dir ||= Pathname.new(Dir.pwd)
  path = root_dir.join("config/tacape.yml")

  raise "Invalid Tacape directory; couldn't found config/tacape.yml file." unless File.file?(path)
  content = File.read(path)
  erb = ERB.new(content).result
  YAML.load(erb).with_indifferent_access
end
locale() click to toggle source
# File lib/tacape.rb, line 43
def self.locale
  I18n.load_path = Dir['config/locales/*.yml']
  I18n.load_path += Dir["#{Tacape::Belt.current_os.tool_folder}/*/locales/*.yml"]
  I18n.backend.load_translations
  
  @locale ||= Belt.current_os.locale
  #this switch/case must be inside the Belt
  case @locale
  when 'pt_BR'
    I18n.locale = :"pt-BR"
  else
    I18n.locale = :en
  end
  return @locale
end
logger() click to toggle source
# File lib/tacape.rb, line 60
def self.logger
  @logger ||= Logger.new(File.open("/tmp/tacape.log", "a"))
end