Comments (4)
Oh, I see now - it is printing to the console because print
is not overridden the way puts
is in https://github.com/opal/opalrb.org/blob/master/source/javascripts/try_opal.rb#L92
Document.ready? do
def $stdout.puts(*strs)
strs.each { |str| TryOpal.instance.print_to_output str }
end
TryOpal.instance.run_code
end
Should this be fixed?
from opal.github.io.
Yes, it needs to be. We should probably make it less hacky, and use the IO methods directly: https://github.com/opal/opal/blob/master/opal/corelib/io.rb#L14-L19 .
Something like:
Document.ready? do
$stdout.write_proc = proc { |str| TryOpal.instance.print_to_output str }
#...
end
from opal.github.io.
👍
from opal.github.io.
@elia @adambeynon I made a new PR to fix this issue based on your feedback and with a clean commit history :)
from opal.github.io.
Related Issues (15)
- Blog homepage shows incorrect title HOT 1
- Add a section with Opal related resources HOT 4
- Example at "/usage" doesn't work as described HOT 22
- Add numbers to docs: "unsupported features" HOT 1
- Getting started considered harmful HOT 2
- JavaScript -> OpalRb HOT 1
- Hash collisions HOT 2
- CDN returns 404 HOT 2
- Update "Try Opal now!", please HOT 2
- Update opalrb.org/libraries page HOT 2
- Use do end in config.ru not work. HOT 3
- https://opalrb.com/try/ uses Opal 0.11.4 ? HOT 1
- can't define own class of User inheriting from other class HOT 3
- Guides have disappear HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opal.github.io.