Class: Henry::Environment
- Inherits:
-
Object
- Object
- Henry::Environment
- Defined in:
- lib/henry/environment.rb
Overview
Henry Environmet. To be used as proxy to access the Task execution params from the tests
Constant Summary collapse
- DEFAULT_OUTPUT_DIRECTORY =
The path to the default file export directory
".output"
Class Method Summary collapse
- .config ⇒ Object
-
.export_file(path) ⇒ Object
Copies the file from the given path to the default export directory.
-
.logger ⇒ Logger
Gets the Task Logger instance vis DBr.
-
.output_path ⇒ Object
Returns the current output path for attachments.
-
.params ⇒ Hash
Imports and returs the Task execution parameters.
Class Method Details
.config ⇒ Object
21 22 23 |
# File 'lib/henry/environment.rb', line 21 def self.config @@config ||= Henry::Config.import!.params end |
.export_file(path) ⇒ Object
Copies the file from the given path to the default export directory
43 44 45 46 |
# File 'lib/henry/environment.rb', line 43 def self.export_file(path) FileUtils.mkdir_p(Henry::Environment.output_path) FileUtils.copy_file(path, "#{Henry::Environment.output_path}/#{File.basename(path)}") end |
.logger ⇒ Logger
Gets the Task Logger instance vis DBr.
35 36 37 38 |
# File 'lib/henry/environment.rb', line 35 def self.logger Logger.new #return DRbObject.new_with_uri(LoggerService::DRB_URI) end |
.output_path ⇒ Object
Returns the current output path for attachments.
51 52 53 |
# File 'lib/henry/environment.rb', line 51 def self.output_path "#{Henry::Environment.config['output_directory']}/output" || DEFAULT_OUTPUT_DIRECTORY end |