These are chat archives for opal/opal

11th
Aug 2015
Jikku Jose
@JikkuJose
Aug 11 2015 02:27
@fkchang oh cool; do you have an idea to an approximate timeline?
Elia Schito
@elia
Aug 11 2015 07:01
@dfyx try with new (window.Phaser.Plugin.Isometric)() the problem could be that each of the modules define a closure variable with the name of the module shadowing the originals.
Bernhard Weichel
@bwl21
Aug 11 2015 07:03
Is there a simple method to serialize any object to string. I tried .to_json (does not serialize class instances by default); I also tried to_yaml which did not work at all. I get undefined method.
Elia Schito
@elia
Aug 11 2015 07:05
Unfortunately there's no serialization support to date
Bernhard Weichel
@bwl21
Aug 11 2015 07:24
to_json works somehow, at least with Array , Hash etc. I will try to implement something for me using instance_variables. But it seems that opal generates some Instance variables like @constructor
Elia Schito
@elia
Aug 11 2015 07:25
Those are unaviodable afaik as they come from JavaScript
Bernhard Weichel
@bwl21
Aug 11 2015 07:29
I am starting some refactorings in my application and want to compare the result of the current implementation with the result of the new implementation. In particular I am integrating a new parser for abc and need to implement a transformer to my music model which shall provide exactly the same result. Maybe there is is something on the js - level I could use for that.
what happens if the application has an instance-variable called @constructor?
Elia Schito
@elia
Aug 11 2015 07:30
not sure but it migth be translated to this.constructor$
if it's not it should :)
Bernhard Weichel
@bwl21
Aug 11 2015 07:32
This message was deleted
i see
This message was deleted
  def initialize(name)
    @name = name
    @constructor = "foo"
  end
compiles to in http://opalrb.org/try/#
    def.$initialize = function(name) {
      var self = this;

      self.name = name;
      return self.constructor = "foo";
    };
Elia Schito
@elia
Aug 11 2015 07:38
@bwl21 would you mind opening an issue for this?
George Plymale II
@ylluminarious
Aug 11 2015 15:12
@dfyx interestingly enough, Phaser.Plugin.Isometric does not seem to work out of the box even in regular js: http://jsbin.com/lafacefobu/edit?html,js,console.
btw, if you'd like, you can chat about this at http://gitter.im/orbitalimpact/opal-phaser
Christian Käser
@dfyx
Aug 11 2015 15:12
@ylluminarious I got it working. It was a problem somewhere else
George Plymale II
@ylluminarious
Aug 11 2015 15:13
ah, ok, great :)
Forrest Chang
@fkchang
Aug 11 2015 16:09
@JikkuJose not really, I wrapped rails gem that included some coffeescript frontend to google maps, I call the coffeescript, but am likely to make a more ruby-ified interface in pure opal
Mitch VanDuyn
@catmando
Aug 11 2015 16:18
Anybody know why after upgrading to rails 4, and latest opal, opal-rails, etc. Opal rspecs don't run? I can browse opal-spec and the test links are there and the code is there all mapped. But nothing happens.
Jared White
@jaredcwhite
Aug 11 2015 20:29
Any news etc. I should link to for tomorrow's Opalist issue?
Mitch VanDuyn
@catmando
Aug 11 2015 20:51

still not getting why rspec won't run...

#spec-opal/test_spec.rb
require 'opal'
require 'opal-rspec'

describe 'a spec' do
  puts "defining stuff"
  it 'has successful examples' do
    puts "running the test"
    'I run'.should =~ /run/
  end
end

prints "defining stuff" to the console, but never runs the tests...
rails-4.2.3
opal-rails-0.8.0
opal-rspec-0.4.3

any clues anybody?

Mitch VanDuyn
@catmando
Aug 11 2015 21:06
Just tried a clean rails-4.2.3 app, added opal-rails, and the above test_spec, same result...
test loads, puts defining stuff, but the test itself never runs.
If I do a bundle exec rake opal:spec everything is fine.
Mitch VanDuyn
@catmando
Aug 11 2015 21:20
Moving back to opal-rails 7.0 and everything seems good again... is opal-rspec... seems like there might be some missing instructions in the opal-rails 8.0 instructions??? @elia any ideas?
Mitch VanDuyn
@catmando
Aug 11 2015 21:34
@elia seems like the instructions are missing the fact that you need to call autorun in your example (or more typically in your spec_helper file)... Shall I do a PR on the doc for this?
Forrest Chang
@fkchang
Aug 11 2015 22:12
@jaredcwhite will submit my article soon
@catmando taking from your last post you figured it out?
Mitch VanDuyn
@catmando
Aug 11 2015 22:12
@fkchang - assuming I am correct and its a wee documentation bug
Forrest Chang
@fkchang
Aug 11 2015 23:08
@jaredcwhite submitted
Jared White
@jaredcwhite
Aug 11 2015 23:08
@fkchang Eeeeeexcellent!
Mitch VanDuyn
@catmando
Aug 11 2015 23:33
I remember a conversation about speeding up things in development mode by turning off/on something... it was in the last week or so, but I can't find it.