Class: CypressOnRails::CommandExecutor
- Inherits:
-
Object
- Object
- CypressOnRails::CommandExecutor
- Defined in:
- lib/cypress_on_rails/command_executor.rb
Overview
loads and evals the command files
Class Method Summary collapse
- .configuration ⇒ Object
- .load(file, command_options = nil) ⇒ Object
- .load_cypress_helper ⇒ Object
- .logger ⇒ Object
Class Method Details
.configuration ⇒ Object
29 30 31 |
# File 'lib/cypress_on_rails/command_executor.rb', line 29 def self.configuration CypressOnRails.configuration end |
.load(file, command_options = nil) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/cypress_on_rails/command_executor.rb', line 6 def self.load(file, = nil) load_cypress_helper file_data = File.read(file) eval file_data rescue => e logger.error("fail to execute #{file}: #{e.}") logger.error(e.backtrace.join("\n")) raise e end |
.load_cypress_helper ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/cypress_on_rails/command_executor.rb', line 16 def self.load_cypress_helper cypress_helper_file = "#{configuration.cypress_folder}/cypress_helper" if File.exist?("#{cypress_helper_file}.rb") Kernel.require cypress_helper_file else logger.warn "could not find #{cypress_helper_file}.rb" end end |
.logger ⇒ Object
25 26 27 |
# File 'lib/cypress_on_rails/command_executor.rb', line 25 def self.logger configuration.logger end |