Module: DataPipe

Defined in:
lib/WWW.rb,
lib/Host.rb,
lib/Jobs.rb,
lib/DataPipe.rb,
lib/helper_functions.rb

Defined Under Namespace

Classes: DataPipelineError, EnvironmentVariableNotFoundError, Host, Job, Jobs, WWW

Class Method Summary collapse

Class Method Details

.getEnvVar(name) ⇒ Object



20
21
22
23
24
# File 'lib/helper_functions.rb', line 20

def DataPipe.getEnvVar( name )
	raise EnvironmentVariableNotFoundError.new( name ) if ENV[name].nil?

	return ENV[name]
end

.getFluidDb(env_name) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/helper_functions.rb', line 27

def DataPipe.getFluidDb( env_name )
	e = "_#{env_name}"

	uri_string = getEnvVar(env_name)
	log "uri: #{uri_string}", true
	return FluidDb::Db( uri_string )

end

.log(string, verbose = false) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/helper_functions.rb', line 6

def DataPipe.log( string, verbose=false )
        type = verbose ? "VERB" : "INFO"
        if !ENV["VERBOSE"].nil? || !verbose then
            timestamp = Time.new.strftime( "%Y-%m-%d %H:%M:%S" )
            puts "[#{type}] #{timestamp} :: #{string}"
        end
end

.log_dsl(name, string, verbose = false) ⇒ Object



15
16
17
# File 'lib/helper_functions.rb', line 15

def DataPipe.log_dsl( name, string, verbose=false )
	log "name: #{name}, #{string}", verbose
end