lib/mutx/execution.rb in mutx-0.1.40 vs lib/mutx/execution.rb in mutx-0.1.42
- old
+ new
@@ -2,22 +2,25 @@
module Mutx
class Execution
def self.run! execution_request_data
- if Mutx::Support::Configuration.use_git?
- #Mutx::Support::Git.reset_hard and Mutx::Support::Git.pull
- #Mutx::Support::Log.debug "Git pulled" if Mutx::Support::Log
- end
-
result = Mutx::Results::Result.new(execution_request_data)
Mutx::Support::Log.debug "Result created with id => #{result.id}" if Mutx::Support::Log
+ Dir.mkdir "#{Dir.pwd}/mutx/out" unless Dir.exist? "#{Dir.pwd}/mutx/out"
+ Dir.mkdir "#{Dir.pwd}/mutx/out/#{result.id}/attachment"
+
result.save!
Mutx::Support::Log.debug "Execution type #{result.task_type}" if Mutx::Support::Log
Mutx::Workers::Executor.perform_async(result.id)
Mutx::Support::Log.debug "#{result.task_type.capitalize}(#{result.id}) started" if Mutx::Support::Log
result.id
+ end
+
+ def self.attachment_path
+ id = ARGV.select{|arg| arg.start_with? "_id="}.first.split("=").last
+ "#{Dir.pwd}/mutx/out/#{id}/attachment"
end
end
end
\ No newline at end of file