lib/henry/container.rb in henry-container-0.0.47 vs lib/henry/container.rb in henry-container-0.0.48

- old
+ new

@@ -68,10 +68,17 @@ # # @return [String] the task hints file path. def hints_file_path "#{@opts[:"hints-dir"]}/#{@opts[:hints]}" end + + # Returns the task hints patched file path based on the given options. + # + # @return [String] the task hints file path. + def hints_file_patched_path + "#{@opts[:"in-dir"]}/#{@opts[:hints]}" + end # Executes required validations before execution. def before_execution unless File.exists?('henry-context.yml') @@ -130,9 +137,14 @@ # Loads and parses the @opts[:hints] params, if they exists. # # @return [Hash] the hints:w def load_hints + # To be removed once that the Worker starts using the --hints-path + if File.exists?(self.hints_file_patched_path) + return JSON.parse(File.read(self.hints_file_patched_path)) + end + return {} unless File.exists?(self.hints_file_path) JSON.parse(File.read(self.hints_file_path)) end