Sha256: 3761efd9334bcef9adfbce6d80011598c27867cdae342e349b0ca4c67da21bf1
Contents?: true
Size: 980 Bytes
Versions: 8
Compression:
Stored size: 980 Bytes
Contents
module DesignShellServer class Core attr_reader :context def initialize(aContext) @context = aContext end def make_command(aLine) command_name = aLine.scan(/^[A-Z0-9_]+/).pop.to_nil return nil unless command_name && DesignShellServer::Command.instance_methods.include?(command_name) return DesignShellServer::Command.new(self,aLine,command_name) end def run if line = ENV['SSH_ORIGINAL_COMMAND'] command = make_command(line) command.execute else @context.stdout.print "\n>" @context.stdin.each_line do |line| line.chomp! "\n" command = make_command(line) command.execute @context.stdout.print "\n>" end end end def cache_dir @cache_dir ||= MiscUtils.append_slash(@context.credentials[:cache_dir] || MiscUtils.make_temp_dir('DesignShellServer')) end def working_dir_from_site(aSite) return nil unless aSite aSite.gsub!(/[^a-zA-Z0-9.\-_]/,'_') File.join(cache_dir,aSite) end end end
Version data entries
8 entries across 8 versions & 1 rubygems