prism-cli 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/prism +1 -1
  3. data/wasm-server.js +7 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0218ebb7dce432192080abe5363572f90c165fe5973b5ccafc331114d623bac
4
- data.tar.gz: 71c1f38bce33cef73884c67a692fc2f75adf688a973499d74e37f216b21d75b2
3
+ metadata.gz: 4e7a243f950f778fcad1038af5d129e2ff685e2172bfc26424ce1f16d29f4ffa
4
+ data.tar.gz: bf138cc012d2c8d6c05db2879663fbd5849c95bfeacb1c1af59bcdacdac5bebd
5
5
  SHA512:
6
- metadata.gz: ed762dc2a2f25993499303bcbef0eba3af8e644d330761a36c2344bdfeb7ab47c0f0096302a02760600852dc947fed3bcb32f071407f007d0510e2c4c949330d
7
- data.tar.gz: dc9e250cca5874922cf1a664aa1f81ec4fb42cf63c9852868708fb5299179d66fd85f2841da8c5b20bc5a90dcc1e03e380d2277aaa0cec9c80dcf25bf05e09e8
6
+ metadata.gz: 4746c18c3c6d1f20c9374e867da7ec921fcdec51484032f6dc1c3c191a3e9a281feb54f85cc8866264c58e74908b4219c0ca3c9f4dd12e20c6c76bbcf5a57f8e
7
+ data.tar.gz: ec5a76c3d1a00f1e92b967de992c6bf4f2c0c81a580dd91050e11e041d8b55fef64b09a259364a4bfb2660ae986d4aa5ac576c08a6bfbf545714bde811ea8b11
data/bin/prism CHANGED
@@ -80,7 +80,7 @@ def build(files)
80
80
  `
81
81
 
82
82
  `cp #{__dir__}/../dist/prism.js ./prism.js`
83
- File.write("./index.html", HTML_TEMPLATE) # TODO - there's a race condition here where the file is created between the previous statement and this one
83
+ File.write("./index.html", HTML_TEMPLATE) unless File.exists?("./index.html")
84
84
  `rm bundle.c bundle.rb main.c`
85
85
  puts "Compiled to build/"
86
86
  end
data/wasm-server.js CHANGED
@@ -3,8 +3,11 @@ const fs = require('fs');
3
3
  const path = require('path');
4
4
 
5
5
  const proxy = http.createServer((req, res) => {
6
- console.log(req.url);
7
- const p = path.join('.', req.url);
6
+ let p = path.join('.', req.url);
7
+
8
+ if (req.url === '/') {
9
+ p = path.join('.', 'index.html');
10
+ }
8
11
 
9
12
  try {
10
13
  if (p.endsWith('.wasm')) {
@@ -20,4 +23,5 @@ const proxy = http.createServer((req, res) => {
20
23
  res.end();
21
24
  });
22
25
 
23
- proxy.listen(1337, '127.0.0.1');
26
+ proxy.listen(3042, '127.0.0.1');
27
+ console.log("Listening on localhost:3042");
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prism-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Johnstone