Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Charles Lowell
    @cowboyd
    you don’t call the file, you call objects
    you say ruby sample1.rb
    Srikanth Kuppuswamy
    @Hospira-MedNet
    i will tell my problem exactly..
    i have some ruby class which has some functions already written
    now i am writing protractor tests which is .JS file..
    now i need to call these available ruby methods in my .js file to reuse..
    Charles Lowell
    @cowboyd
    ah, in that case, you cannot use therubyracer because your process is a node process, not a ruby process :(
    Srikanth Kuppuswamy
    @Hospira-MedNet
    so how i can do this
    Charles Lowell
    @cowboyd
    you would need to embed a ruby interpreter into your node process. The Ruby Racer embeds javascript into a ruby process
    I’m not sure, you might want to try opalrb http://opalrb.org/
    It’s compiles ruby down to javascript, which you would then be able to call from your protractor tests.
    Srikanth Kuppuswamy
    @Hospira-MedNet
    i checked this one also
    i have a doubt where can u click this link - http://opalrb.org/docs/compiled_ruby/
    i know i am bugging u.. but plzz can u give me few mins of ur time plzz
    if u come down to section here - Ruby from Javascript
    where similarly u have a class foo .. which i stored in a ruby file
    now how i shd i make my call in .JS file?
    Charles Lowell
    @cowboyd
    I’m not an Opal expert, so I’d recommend asking inside the opal community, but from what I can tell, you have to compile your ruby using the opal compiler. That will produce some javascript. Eval that javascript, and then you can use the Opal.Foo.$new().$bar() syntax.
    Ghost
    @ghost~5377c1e9048862e761fa1c25
    Hi - I'm researching integration of Ruby and JS. I've asked around for how people are using The Ruby Racer, and mostly I've heard about asset pipelines. Is there anyone else using JS with more integration? So running snippets of JS in the middle of their Ruby app?
    Charles Lowell
    @cowboyd
    @chrisseaton I know the folks at discourse use it quite extensively, you might want to ask them.
    I’m actually thinking about using it as a JSON parser, and perhaps for doing static analysis on javascript code.
    Ghost
    @ghost~5377c1e9048862e761fa1c25
    @cowboyd yeah we were thinking about JSON parsing - thanks
    Bryan Wood
    @bryan-wood
    This message was deleted
    Charles Lowell
    @cowboyd
    This message was deleted
    Tenzin Chemi
    @imechemi
    Hi, I am facing problem with installing therubyracer gem. what is the compiler requirement for the v8 by rubyracer?
    I am on mac
    Tenzin Chemi
    @imechemi
    :worried: chatroom is inactive since oct 22
    Ghost
    @ghost~5377c1e9048862e761fa1c25
    Can you gist your error output
    Tenzin Chemi
    @imechemi
    sorry @chrisseaton I didn’t receive any notification and missed your response. I can’t track what happened before, but right now I got it fixed