module DataPipe2
Don't buffer stdout
DataPipe2
Helpers
Doc
Public Class Methods
get_env_var(name)
click to toggle source
# File lib/helper_functions.rb, line 17 def self.get_env_var(name) fail EnvironmentVariableNotFoundError, name if ENV[name].nil? ENV[name] end
get_fluid_db(env_name)
click to toggle source
# File lib/helper_functions.rb, line 22 def self.get_fluid_db(env_name) uri_string = get_env_var(env_name) log "uri: #{uri_string}", true FluidDb::Db(uri_string) end
log(string, verbose = false)
click to toggle source
# File lib/helper_functions.rb, line 5 def self.log(string, verbose = false) type = verbose ? 'VERB' : 'INFO' if !ENV['VERBOSE'].nil? || !verbose timestamp = Time.new.strftime('%Y-%m-%d %H:%M:%S') puts "[#{type}] #{timestamp} :: #{string}" end end
log_dsl(name, string, verbose = false)
click to toggle source
# File lib/helper_functions.rb, line 13 def self.log_dsl(name, string, verbose = false) log "name: #{name}, #{string}", verbose end