Git Product home page Git Product logo

Comments (7)

adambeynon avatar adambeynon commented on May 20, 2024

Hey. How are you compiling the code (ruby tools? altjs.org?)? Also, can you paste the code that it is generating?

from opal.

pmros avatar pmros commented on May 20, 2024

I compile browser.rb with this command:
opal compile browser.rb > browser.js

I've updated my browser.js file: https://gist.github.com/1020856

Of course, I use opal edge version (git clone).

Thank you again. Great piece of work!

from opal.

pmros avatar pmros commented on May 20, 2024

Ooooops! I closed this issue by mistake!

from opal.

adambeynon avatar adambeynon commented on May 20, 2024

Ahhhhh, it seems that the compile command misses out a little piece of code. Basically that outputted code should be inside a function which defines the $runtime variable. I'll go fix that and update you here once its all working again.

from opal.

adambeynon avatar adambeynon commented on May 20, 2024

So I've just committed a fix for this at 102a979. You need to pull the latest changes, regenerate opal.js or opal.dev.js (either will do) and recompile your file with that same command you used before. The generated code is now properly wrapped and will be run directly. Let me know if this solves the issue.

from opal.

pmros avatar pmros commented on May 20, 2024

Great!
Now it works OK.

Opal rocks! Thank you!

from opal.

adambeynon avatar adambeynon commented on May 20, 2024

Glad Its working. Just as a follow up, I've just pushed b1f5a1f to master which adds some more build options to the compile command. In your use case, it has the same effect except that the generated code will now be written directly to the output file which it assumes from your input filename, so the following should work for you:

bin/opal compile browser.rb

Which outputs the code to browser.js.

from opal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.