Sha256: f4a1ae4fd87e53b439cb2128e415e9af57ea05aece220f9194fa97d9fefb11f4
Contents?: true
Size: 997 Bytes
Versions: 178
Compression:
Stored size: 997 Bytes
Contents
puts __FILE__ if defined?(DEBUG) class History attr_accessor :dev def initialize dev=nil @dev=dev @dev=Dev.new if @dev.nil? end # .0. for 0 exit codes # .X. for non 0 exit codes # project name is contained in directory name def get_commands pattern commands=Array.new Dir.chdir(@dev.log_dir) do Dir.glob("*#{pattern.gsub('/','-')}*.*").each{|logfile| commands << Command.new(JSON.parse(IO.read(logfile))) } end commands end def add_command command code="0" code="X" if command[:exit_code] !=0 directory=command[:directory].gsub(@dev.root_dir,'').gsub('/','-') name="#{command[:input]}.#{code}.#{directory}.json" filename="#{@dev.log_dir}/#{name}" puts "add command #{filename}" if @dev.debug? File.open(filename,'w'){|f|f.write(command.to_json)} end def get_wrk_command project_fullname commands=get_commands("#{project_fullname}".gsub('/','-')) return commands[0] if commands.length > 0 nil end end
Version data entries
178 entries across 178 versions & 1 rubygems