Class: Gauge::Util
- Inherits:
-
Object
- Object
- Gauge::Util
- Defined in:
- lib/util.rb
Class Method Summary collapse
- .get_file_name(prefix = '', counter = 0) ⇒ Object
- .get_param_name(params, index) ⇒ Object
- .get_step_implementation_dir ⇒ Object
Class Method Details
.get_file_name(prefix = '', counter = 0) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/util.rb', line 30 def self.get_file_name(prefix = '', counter = 0) name = "step_implementation#{prefix}.rb" file_name = File.join(get_step_implementation_dir, name) return file_name unless File.file? file_name counter += 1 get_file_name("_#{counter}", counter) end |
.get_param_name(params, index) ⇒ Object
20 21 22 23 24 |
# File 'lib/util.rb', line 20 def self.get_param_name(params, index) name = "arg_#{index}" return name unless params.include? name get_param_name(params, index + 1) end |
.get_step_implementation_dir ⇒ Object
26 27 28 |
# File 'lib/util.rb', line 26 def self.get_step_implementation_dir return File.join(ENV["GAUGE_PROJECT_ROOT"].gsub(/\\/, "/"), 'step_implementations') end |