diff --git a/menu.json b/menu.json index 31f3c1fe..be8aac56 100644 --- a/menu.json +++ b/menu.json @@ -8,7 +8,6 @@ "HTTP SERVER", "HTTP CLIENT", "WEBSOCKETS", - "HTML STREAM", "DUPLEXER", "DUPLEXER REDUX", "COMBINER", diff --git a/package.json b/package.json index 753311dd..7855118f 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "tar": "~0.1.17", "terminal-menu": "~2.1.1", "through2": "^0.6.3", - "trumpet": "^1.7.0", "tuple-stream": "~0.0.2", "websocket-stream": "^1.3.2", "wordwrap": "~0.0.2", diff --git a/problems/html_stream/expected.html b/problems/html_stream/expected.html deleted file mode 100644 index 586a7d13..00000000 --- a/problems/html_stream/expected.html +++ /dev/null @@ -1,21 +0,0 @@ -<html> - <head> - <title>beep boop</title> - </head> - <body> - <p> - Four score and several years ago, our fathers bought four swiss - continents, a new vacation, covered in liberty. - And predicated to the preposition that tall men created a - sequel. - </p> - - <p> - How we are offstage in a great livermore, testing weather stations, or any - station so conceived in altogether fitting and little note, nor long - remember, they who fought here and take increased devoation, - that <span class="loud">GOVERNMENT LOVE THE PEOPLE, BESIDE THE PEOPLE, - FOUR OF THE PEOPLE, SHALL NOT PERISH FROM THIS EARTH.</span> - </p> - </body> -</html> diff --git a/problems/html_stream/index.js b/problems/html_stream/index.js deleted file mode 100644 index 11938530..00000000 --- a/problems/html_stream/index.js +++ /dev/null @@ -1,38 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var verify = require('adventure-verify'); -var concat = require('concat-stream'); -var spawn = require('child_process').spawn; - -exports.problem = fs.createReadStream(path.join(__dirname, 'problem.txt')); -exports.solution = fs.createReadStream(path.join(__dirname, 'solution.js')); - -exports.verify = verify({ modeReset: true }, function (args, t) { - t.plan(4); - t.equal(args.length, 1, 'stream-adventure verify YOURFILE.js'); - - var ps = spawn(process.execPath, args); - - fs.createReadStream(__dirname + '/input.html').pipe(ps.stdin); - ps.stderr.pipe(process.stderr); - ps.once('exit', function (code) { - t.equal(code, 0, 'successful exit code'); - }); - - fs.readFile(__dirname + '/expected.html', 'utf8', function (err, expected) { - t.ifError(err); - ps.stdout.pipe(concat(function (body) { - t.equal(body.toString('utf8'), expected); - })); - }); -}); - -exports.run = function (args) { - var ps = spawn(process.execPath, args); - fs.createReadStream(__dirname + '/input.html').pipe(ps.stdin); - ps.stderr.pipe(process.stderr); - ps.stdout.pipe(process.stdout); - ps.once('exit', function (code) { - if (code) process.exit(code); - }); -}; diff --git a/problems/html_stream/input.html b/problems/html_stream/input.html deleted file mode 100644 index af23e560..00000000 --- a/problems/html_stream/input.html +++ /dev/null @@ -1,21 +0,0 @@ -<html> - <head> - <title>beep boop</title> - </head> - <body> - <p> - Four score and several years ago, our fathers bought four swiss - continents, a new vacation, covered in liberty. - And predicated to the preposition that tall men created a - sequel. - </p> - - <p> - How we are offstage in a great livermore, testing weather stations, or any - station so conceived in altogether fitting and little note, nor long - remember, they who fought here and take increased devoation, - that <span class="loud">government love the people, beside the people, - four of the people, shall not perish from this earth.</span> - </p> - </body> -</html> diff --git a/problems/html_stream/problem.txt b/problems/html_stream/problem.txt deleted file mode 100644 index ce8f5b5b..00000000 --- a/problems/html_stream/problem.txt +++ /dev/null @@ -1,20 +0,0 @@ -Your program will get some html written to stdin. Convert all the inner html to -upper-case for elements with a class name of "loud", -and pipe all the html to stdout. - -You can use `trumpet` and `through` to solve this adventure. - -With `trumpet` you can create a transform stream from a css selector: - - var trumpet = require('trumpet'); - var fs = require('fs'); - var tr = trumpet(); - fs.createReadStream('input.html').pipe(tr); - - var stream = tr.select('.beep').createStream(); - -Now `stream` outputs all the inner html content at `'.beep'` and the data you -write to `stream` will appear as the new inner html content. - -Make sure to `npm install trumpet through` in the directory where your solution -file lives. diff --git a/problems/html_stream/solution.js b/problems/html_stream/solution.js deleted file mode 100644 index a8594dc6..00000000 --- a/problems/html_stream/solution.js +++ /dev/null @@ -1,13 +0,0 @@ -// Here's the reference solution: - - var trumpet = require('trumpet'); - var through = require('through2'); - var tr = trumpet(); - - var loud = tr.select('.loud').createStream(); - loud.pipe(through(function (buf, _, next) { - this.push(buf.toString().toUpperCase()); - next(); - })).pipe(loud); - - process.stdin.pipe(tr).pipe(process.stdout); diff --git a/test/solutions/html_stream.js b/test/solutions/html_stream.js deleted file mode 100644 index d697fdf6..00000000 --- a/test/solutions/html_stream.js +++ /dev/null @@ -1,11 +0,0 @@ -var trumpet = require('trumpet'); -var through = require('through2'); -var tr = trumpet(); - -var loud = tr.select('.loud').createStream(); -loud.pipe(through(function (buf, _, next) { - this.push(buf.toString().toUpperCase()); - next(); -})).pipe(loud); - -process.stdin.pipe(tr).pipe(process.stdout);