Module: RComp::Env

Extended by:
Actions, Env
Included in:
Env
Defined in:
lib/rcomp/env.rb

Constant Summary collapse

@@conf =
Conf.instance

Instance Method Summary collapse

Methods included from Actions

mkdir, mkpath, mkpath_to, rm, rm_rf, touch

Instance Method Details

#command_exists?Boolean

Checks for the existance of a command to test with

Returns a boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/rcomp/env.rb', line 41

def command_exists?
  @@conf.command
end

#guard_initializedObject

Emit error unless RComp is not fully initialized

Returns nothing



21
22
23
24
25
26
# File 'lib/rcomp/env.rb', line 21

def guard_initialized
  if initialized?
    puts "RComp already initialized"
    exit 1
  end
end

#guard_uninitializedObject

Emit error unless RComp is fully initialized

Returns nothing



12
13
14
15
16
# File 'lib/rcomp/env.rb', line 12

def guard_uninitialized
  guard_command_exists
  guard_root_dir_exists
  guard_root_subdirs_exist
end

#initialize_directoriesObject

Create RComp directories if they don’t already exist

Returns nothing



31
32
33
34
35
36
# File 'lib/rcomp/env.rb', line 31

def initialize_directories
  mkpath @@conf.root
  mkdir @@conf.test_root
  mkdir @@conf.expected_root
  mkdir @@conf.result_root
end