00:19
GitHub157 has joined #opal
00:19
GitHub157 has left #opal [#opal]
00:19
<
GitHub157 >
opal/master 09f7778 Elia Schito: Added support for more #defined? args
00:21
travis-ci has joined #opal
00:21
travis-ci has left #opal [#opal]
00:21
<
travis-ci >
[travis-ci] opal/opal#1097 (master - 09f7778 : Elia Schito): The build passed.
01:16
elia has quit [Quit: Computer has gone to sleep.]
02:13
meh` has quit [Ping timeout: 240 seconds]
06:02
fntzr has joined #opal
08:02
fkchang has quit [Remote host closed the connection]
08:17
adambeynon has joined #opal
08:53
GitHub155 has joined #opal
08:53
<
GitHub155 >
opal/master d4d68fc Adam Beynon: Improve Module#constants etc by manually storing constants in scopes
08:53
GitHub155 has left #opal [#opal]
08:55
travis-ci has joined #opal
08:55
<
travis-ci >
[travis-ci] opal/opal#1098 (master - d4d68fc : Adam Beynon): The build passed.
08:55
travis-ci has left #opal [#opal]
09:19
elia has joined #opal
09:34
kludge` has quit [Ping timeout: 264 seconds]
09:39
kludge` has joined #opal
09:39
kludge` has quit [Changing host]
09:39
kludge` has joined #opal
09:41
<
Kilo`byte >
are there bindings for jquery websocket?
09:48
<
elia >
Kilo`byte, dont think so
09:48
<
Kilo`byte >
gonna make own ones then
09:48
<
Kilo`byte >
should i distribute them seperately or pull-request them in?
10:05
<
elia >
Kilo`byte, id PR it, but without adding a require inside 'opal-jquery' (just as stdlib vs corelib)
10:07
<
Kilo`byte >
explain?
10:07
<
Kilo`byte >
in existing file?
10:07
<
Kilo`byte >
elia: ^
10:10
<
adambeynon >
Kilo`byte: I think elia is suggesting adding it in as opal-jquery/websocket.rb
10:10
<
adambeynon >
but make it optional
10:11
<
adambeynon >
i.e. people have to require() it
10:11
<
adambeynon >
but, it would definately be really useful :)
10:11
<
Kilo`byte >
ruby hashes are directly mapped to javascript objects
10:12
<
Kilo`byte >
so this would be true:
10:12
<
Kilo`byte >
{test: 'hello'} == `{'test': 'hello'}`
10:13
<
adambeynon >
Kilo`byte: nope, hashes are implemented as a real class, but they do use a javascript object internally
10:13
<
Kilo`byte >
so, if i want to pass a hash to some native function that needs an js object, how can i do that
10:15
<
adambeynon >
my_ruby_hash.to_n
10:15
<
adambeynon >
to_n is an opal convention for converting ruby objects to js objects
10:15
<
Kilo`byte >
ah, thanks :)
10:15
<
Kilo`byte >
yeah, makes sense
10:16
<
adambeynon >
(thinks like string, array, numeric etc are already their native js counterparts)
10:26
<
elia >
adambeynon, well interpreted :)
10:26
<
elia >
(sorry, was putting the baby to sleep)
10:31
<
Kilo`byte >
kinda weird to me though
10:31
<
Kilo`byte >
12:31 noon here
10:31
<
Kilo`byte >
(GMT+2)
10:36
elia` has joined #opal
10:36
elia` is now known as elia_
10:38
<
elia_ >
i'm in the same tz, but the baby is 5months old :)
10:38
elia_ has quit [Remote host closed the connection]
10:41
elia_ has joined #opal
10:41
elia_ has quit [Remote host closed the connection]
10:42
<
elia >
Kilo`byte, you really got haml to work yesterday?
10:43
<
Kilo`byte >
didn't try yet
10:43
<
Kilo`byte >
was just a thought
10:43
<
Kilo`byte >
can do after i finish websockets
10:44
<
elia >
elia, was surprised because IIRC haml code is quite complex (and messy)
10:45
<
elia >
ouch, talking to myself :D
10:45
<
elia >
Kilo`byte, ^^^
10:45
<
Kilo`byte >
ye, saw
10:48
GitHub185 has joined #opal
10:48
<
GitHub185 >
opal/elia/defined-super-wip 8f4424f Elia Schito: WIP [skip ci]
10:48
GitHub185 has left #opal [#opal]
10:52
<
elia >
adambeynon, pushed my WIP on defined? super ^^^^^
10:52
<
elia >
adambeynon, I'm not good enough at parser.rb ;)
10:58
elia has quit [Quit: Computer has gone to sleep.]
11:00
elia_ has joined #opal
11:00
<
Kilo`byte >
elia_: short question
11:01
elia_ has quit [Remote host closed the connection]
11:05
<
Kilo`byte >
adambeynon: how to pass a ruby block as javascript callback?
11:09
<
Kilo`byte >
ah, k found out
11:09
<
Kilo`byte >
block.to_n :P
11:10
<
Kilo`byte >
ok, inspired by rails respond_to do |format| blocks, i made the events here
11:43
meh` has joined #opal
11:50
<
adambeynon >
Kilo`byte: looking good. might also be worth looking at what work meh` has done on websockets. if we have websockets for jquery and opal-browser, maybe abstracting it into a common library is a good idea
11:50
<
meh` >
opal-browser does have functioning websockets
11:50
<
meh` >
but opal-browser is cherry-pickable enough
11:51
<
meh` >
you could just use opal-browser for websockets
12:15
<
Kilo`byte >
meh`: do you support them the jquery way?
12:15
<
Kilo`byte >
as in, serialize a data structure
12:16
<
Kilo`byte >
adambeynon: also, question
12:16
<
Kilo`byte >
how can i convert a javascript object into a hash
12:17
<
adambeynon >
Kilo`byte: Hash.new(`{"a": 100, "b": 200}`)
12:17
<
adambeynon >
just pass it straight into Hash.new
12:17
<
Kilo`byte >
oh, nice
12:27
GitHub58 has joined #opal
12:27
GitHub58 has left #opal [#opal]
12:27
<
GitHub58 >
opal/master c7a1b52 Adam Beynon: Subclasses should inherit contants from superclasses, and modules should...
12:29
travis-ci has joined #opal
12:29
<
travis-ci >
[travis-ci] opal/opal#1099 (master - c7a1b52 : Adam Beynon): The build passed.
12:29
travis-ci has left #opal [#opal]
12:32
<
Kilo`byte >
meh`: well, i prefer the jquery ones
12:32
<
Kilo`byte >
in javascript:
12:34
<
Kilo`byte >
$.websocket('ws://localhost:8080/', {'event': {'alert': function(e) {alert(e.data.text);}}});
12:35
<
Kilo`byte >
to alert the webbrowser now, send "{'type': 'alert', 'text': '<message>'}"
12:35
<
Kilo`byte >
meh`: ^
12:38
<
meh` >
Kilo`byte, I don't see much difference from how I did it
12:39
<
Kilo`byte >
well, i mean, can you pass serialized hashes through yours
12:39
<
meh` >
Kilo`byte, the Socket is a Socket, just that, it sends what you pass it
12:39
<
meh` >
you can inherit from it and implement your own event dispatching thing
12:39
<
meh` >
the way jquery doesn't fit in all cases
12:39
<
Kilo`byte >
but thats exactly the main aim of jquery itself
12:40
<
meh` >
in fact I don't like jquery
12:40
<
Kilo`byte >
i don't say my thing is better. both have their applications
12:40
<
meh` >
as soon as you diverge from the jquery way of doing things, you either are left alone or have to hack your way through it
12:40
<
Kilo`byte >
however i may not PR it in since you already have one... we'll see
12:41
<
Kilo`byte >
and especially with dom manipulation jQuery makes it quite easy
12:42
<
meh` >
Kilo`byte, how so?
12:42
<
Kilo`byte >
lets say we want to add class 'someclass' to all p elements
12:43
<
Kilo`byte >
$('p').addClass('someclass');
12:43
<
Kilo`byte >
in the ruby port:
12:43
<
Kilo`byte >
Element.find('p').add_class('someclass');
12:43
<
Kilo`byte >
without ;
12:44
<
Kilo`byte >
well, it doesn't matter anyways
12:47
<
meh` >
in opal-browser $document.css('p').each { |e| e.add_class('someclass') }
12:48
<
Kilo`byte >
eww $document :P
12:48
<
Kilo`byte >
not too bad either :P
12:48
<
meh` >
that's how it is, there may be more documents
12:49
<
Kilo`byte >
in fact, support for $document will be removed afaik
12:49
<
meh` >
and that's the ruby way of doing things
12:51
<
Kilo`byte >
in fact
12:51
<
Kilo`byte >
that might be jQuery thing
12:52
<
Kilo`byte >
ah, yes
12:52
<
Kilo`byte >
nvm then
12:53
<
Kilo`byte >
meh`: variables starting with $ are global, right?
13:50
<
adambeynon >
meh`: btw, I think that constant issue is now resolved
13:50
GitHub126 has joined #opal
13:50
<
GitHub126 >
opal-rspec/master 1c56529 Adam Beynon: Modules now donate constants on include, so remove temp fix
13:50
GitHub126 has left #opal [#opal]
13:50
<
adambeynon >
a class accessing constants defined in a superclass
14:09
fntzr has quit [Ping timeout: 240 seconds]
14:17
<
meh` >
adambeynon, nice
14:33
elia has joined #opal
14:58
GitHub166 has joined #opal
14:58
GitHub166 has left #opal [#opal]
15:57
<
Kilo`byte >
trying to get the rails module working
15:57
<
Kilo`byte >
rails keeps crashing with
15:57
<
Kilo`byte >
gem is installed and in the Gemfile (and bundle is updated)
15:58
<
Kilo`byte >
no ides whats wrong
15:58
<
meh` >
Kilo`byte, what gem?
15:58
<
Kilo`byte >
opal-rails
15:58
<
meh` >
did you read the error to the end? :)
15:58
<
meh` >
it uses execjs, it's up to you to choose the proper runtime
15:58
<
meh` >
add therubyracer
15:59
<
Kilo`byte >
as gem, rite?
16:01
* Kilo`byte
feels stupid
16:04
ryanstout has joined #opal
16:47
<
Kilo`byte >
just wondering, how does the code conversion work
16:47
<
Kilo`byte >
and especially in which files
16:47
<
meh` >
Kilo`byte, what code conversion?
16:48
<
Kilo`byte >
ruby -> js
16:49
<
Kilo`byte >
meh`: ^
16:49
<
meh` >
Kilo`byte, it gets parsed into s-exps, then the result s-exps are processed and js is generated
16:51
<
Kilo`byte >
and that happens in which files?
16:52
<
Kilo`byte >
meh`: ^
16:53
<
meh` >
parser.rb and grammar.y
17:26
travis-ci has joined #opal
17:26
<
travis-ci >
[travis-ci] elia/opal#23 (fix-defined - 95af177 : Elia Schito): The build failed.
17:26
travis-ci has left #opal [#opal]
17:28
elia has quit [Quit: Computer has gone to sleep.]
17:29
ryanstout has quit [Quit: ryanstout]
17:38
elia has joined #opal
17:48
GitHub24 has joined #opal
17:48
<
GitHub24 >
opal/master 290f9cb Elia Schito: Fix some ternary operators inside #process_defined
17:48
GitHub24 has left #opal [#opal]
17:49
elia has quit [Quit: Computer has gone to sleep.]
17:51
travis-ci has joined #opal
17:51
<
travis-ci >
[travis-ci] opal/opal#1100 (master - 290f9cb : Elia Schito): The build passed.
17:51
travis-ci has left #opal [#opal]
20:52
<
Kilo`byte >
can i use yaml in opal?
21:15
DouweM has quit [Ping timeout: 245 seconds]
21:24
adambeynon has joined #opal
23:05
<
Kilo`byte >
is the compiled runtime in the repo?
23:06
<
meh` >
I don't think so
23:06
* Kilo`byte
compiles it
23:06
<
meh` >
and unless there's some pure ruby YAML implementation, no, you can't
23:08
<
Kilo`byte >
well, that was my question indirectly
23:08
<
Kilo`byte >
if the yaml implementation was native :P
23:08
<
meh` >
the one in Ruby is
23:09
<
Kilo`byte >
i personally use java a lot too. On java most stuff isn't native if possible (there are exceptions)
23:10
<
Kilo`byte >
/home/kilobyte/.rvm/gems/ruby-2.0.0-p247/gems/opal-0.4.4/lib/opal/cli.rb:18:in `initialize': wrong number of arguments (1 for 2) (ArgumentError) <-- woot
23:10
<
Kilo`byte >
everyone loves errors :D
23:11
<
Kilo`byte >
meh`: ^
23:11
<
meh` >
never touched that code
23:11
<
Kilo`byte >
tracking it down atm
23:13
<
Kilo`byte >
@filename = options[:filename] <-- the code
23:13
<
Kilo`byte >
i wonder
23:15
<
Kilo`byte >
opal-repl works
23:20
<
Kilo`byte >
meh`: can't compile D:
23:20
<
Kilo`byte >
>> File.write('opal.js', Opal::Builder.build('opal'))
23:20
<
Kilo`byte >
undefined method `build_str' for #<Opal::Builder:0x00000000b3bc30>
23:29
<
meh` >
dunno, never used the builder alone
23:30
<
Kilo`byte >
i wonder
23:30
<
Kilo`byte >
it seems to load the gem opal
23:30
<
Kilo`byte >
not the git one which i use
23:32
<
Kilo`byte >
meh`: how else would i build the runtime?
23:32
<
meh` >
Kilo`byte, I really don't know, I always used opal-sprockets to do its magic