Module: AppTester::Utils Abstract

Extended by:
Utils
Includes:
Colours
Included in:
Utils
Defined in:
lib/app-tester/utils.rb,
lib/app-tester/utils/colors.rb,
lib/app-tester/utils/strings.rb

Overview

This module is abstract.

Helper utilities module

Defined Under Namespace

Modules: Colours, Strings

Instance Method Summary collapse

Methods included from Colours

#black, #blue, #brown, #cyan, #dark_gray, #green, #light_blue, #light_cyan, #light_gray, #light_green, #light_purple, #light_red, #purple, #red, #white, #yellow

Instance Method Details

#file_to_array(file) ⇒ Array

Convert a file to an array

Parameters:

  • file (String)

    path to the file

Returns:

  • (Array)

    each entry on the array corresponds to each line on the file



17
18
19
20
21
22
23
24
25
# File 'lib/app-tester/utils.rb', line 17

def file_to_array file
  lines = []
  File.open(file, "r") do |infile|
    while (line = infile.gets)
      lines.push(line.gsub("\n", "").rstrip)
    end
  end
  lines
end