mirror of
				https://github.com/coolaj86/fizzbuzz.git
				synced 2024-11-16 17:29:04 +00:00 
			
		
		
		
	removed excess code
This commit is contained in:
		
							parent
							
								
									8eebc915a2
								
							
						
					
					
						commit
						c499bbc883
					
				@ -79,24 +79,6 @@
 | 
			
		||||
    return head;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function readFile(file) {
 | 
			
		||||
    var promise = require('futures').promise(),
 | 
			
		||||
      stream,
 | 
			
		||||
      data = new Buffer('');
 | 
			
		||||
 | 
			
		||||
    stream = fs.createReadStream(file, { flags: 'r', encoding: 'utf8' });
 | 
			
		||||
    stream.on('error', function (err) {
 | 
			
		||||
      promise.fulfill(err, stream, data);
 | 
			
		||||
    });
 | 
			
		||||
    stream.on('data', function (chunk) {
 | 
			
		||||
      data += chunk;
 | 
			
		||||
    });
 | 
			
		||||
    stream.on('end', function () {
 | 
			
		||||
      promise.fulfill(undefined, stream, data);
 | 
			
		||||
    });
 | 
			
		||||
    return promise;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Queries
 | 
			
		||||
 | 
			
		||||
  // Average height of Heads of Household
 | 
			
		||||
@ -167,6 +149,10 @@
 | 
			
		||||
 | 
			
		||||
  var data = '';
 | 
			
		||||
  function parseData(err, x, chunk, end) {
 | 
			
		||||
    if (err) {
 | 
			
		||||
      usage();
 | 
			
		||||
      throw err;
 | 
			
		||||
    }
 | 
			
		||||
    if (!end) {
 | 
			
		||||
      data += chunk.toString();
 | 
			
		||||
      return;
 | 
			
		||||
@ -193,13 +179,6 @@
 | 
			
		||||
    }
 | 
			
		||||
      
 | 
			
		||||
    request.get(fulluri, undefined, { stream: true }).when(parseData);
 | 
			
		||||
 | 
			
		||||
    //if ('file' !== uri.protocol && '' === uri.protocol || uri.protocol.match(/^http[s]?:$/)) {
 | 
			
		||||
    //  request.get(fulluri, undefined, { stream: true}).when(parseData);
 | 
			
		||||
    //} else {
 | 
			
		||||
    //  usage();
 | 
			
		||||
    //  return;
 | 
			
		||||
    //}
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  main();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user