Sha256: d6c6258ce21d988682ab71ff84ae25e24a47bb251ed0b981eb4052b3677b9210
Contents?: true
Size: 1.1 KB
Versions: 3
Compression:
Stored size: 1.1 KB
Contents
require 'socket' require 'delegate' module AsProject # TODO: Add new task as a clean dependency # That will call the fcshs and tell it to release # all in-memory compilations class FCSH < MXMLC attr_accessor :ip, :port def initialize(name=:fcsh, ip=nil, port=nil) @ip = (ip.nil?) ? "127.0.0.1" : ip @port = (port.nil?) ? 20569 : port super(name) end def execute(cmd, args, retries=0) retries = retries+1 if(retries > 3) puts "fcsh task was unable to connect to fcshs, please try starting this service by opening a new terminal and typing 'fcshs' (without quotes)" return end begin @socket = TCPSocket.open(@ip, @port) do |s| s.puts Dir.pwd s.puts "#{cmd} #{args}" s.close_write while(line = s.gets) if(line.match(/^0xE/)) s.close break end puts line end end rescue StandardError # IO.popen("fcshs &", "a+") # execute(cmd, args, retries) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
asproject-0.1.118 | lib/tasks/fcsh.rb |
asproject-0.1.89 | lib/tasks/fcsh.rb |
asproject-0.1.92 | lib/tasks/fcsh.rb |