Sha256: 23b9867594188b6d1dc295a549ef4435385250f7f67bb14873becc64f7a9b2bd
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true require_relative 'dsl' require_relative '../../report/table' require_relative '../../report/report_dsl' class Task::Context include Task::DSL include TableDSL include ReportDSL attr_accessor :name def config @task.config end def logger @task.logger end def done? @done end def initialize task, name, path @task = task @name = name @done = false source_code = File.readlines(path).map { |line| " #{line}" }.join('') full_code = "define_singleton_method :execute do\n" + " begin\n" + " #{source_code}\n" + " Status::status nil, 'DONE'\n" + " rescue Exception => e\n" + " error \"\#{e.inspect}\"\n" + " error \"\#{e.backtrace.join(\"\\n\\t\")}\"\n" + " Status::status nil, 'ERROR : ' + e.inspect\n" + " rescue\n" + " error 'Unknown error!'\n" + " Status::status nil, 'ERROR'\n" + " end\n" + " @done = true\n" + "end" self.instance_eval full_code end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
inat-get-0.8.0.12 | lib/inat/app/task/context.rb |