Skip to content

Commit

Permalink
Merge pull request #457 from live-codes/fix-ruby
Browse files Browse the repository at this point in the history
fix ruby
  • Loading branch information
hatemhosny authored Oct 19, 2023
2 parents c548aa4 + 4fe950b commit a2c12fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/livecodes/languages/ruby-wasm/lang-ruby-wasm-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ livecodes.rubyWasm.run =
await init(hasImports(code));
const { DefaultRubyVM } = (window as any)['ruby-wasm-wasi'];
const { vm } = await DefaultRubyVM(livecodes.rubyWasm.module);
const patch = code.includes('$0') ? '$0 = __FILE__\\n' : '';
const patch = code.includes('$0') ? '$0 = __FILE__\n' : '';
vm.eval(patch + code);
parent.postMessage({ type: 'loading', payload: false }, '*');
});
Expand Down
2 changes: 1 addition & 1 deletion src/livecodes/languages/ruby/lang-ruby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ruby: LanguageSpecs = {
'ruby',
config,
);
const patch = code.includes('$0') ? '$0 = __FILE__\\n' : '';
const patch = code.includes('$0') ? '$0 = __FILE__\n' : '';
return (self as any).Opal.compile(patch + code, options);
};
},
Expand Down

0 comments on commit a2c12fc

Please sign in to comment.