These are chat archives for opal/opal

10th
Nov 2015
Qqwy / Wiebe-Marten
@Qqwy
Nov 10 2015 10:01

I'm building a webapp with Rails, and I want to use Opal.

For some end-to-end encryption things, I need to use the ruby-ecdsa and digest-sha3 gems, both on the server-side and the client-side. Both of these gems do not have any external dependencies, so I think they should be able to interace with Opal.

How can I get Opal/opal-rails to compile these gems so they can be used in the client-side code?

Ilya Bylich
@iliabylich
Nov 10 2015 12:16
Does opal-rspec support let?
Qqwy / Wiebe-Marten
@Qqwy
Nov 10 2015 12:36
Ilya Bylich
@iliabylich
Nov 10 2015 12:39
@Qqwy It's opal-rspec 0.5.0.beta2, I don't think that opal master uses it :( Thank you
@elia Do specs in /spec/opal use mspec inside?
Ilya Bylich
@iliabylich
Nov 10 2015 12:45
sure, that's why there's no let :smile:
Elia Schito
@elia
Nov 10 2015 13:16
@iliabylich you're right opal uses mspec in js-land
@Qqwy Opal.use_gem will properly add the lib dir of those gems to Opal.paths, eg. Opal.use_gem("ruby-ecsda")
Qqwy / Wiebe-Marten
@Qqwy
Nov 10 2015 16:22

@elia: Thank you for your help!

I tried using Opal.use_gem. It seems to do what it says on the tin. However, because the Ruby stdlib Digest and OpenSSL classes are not (yet) rewritten for Opal, I've hit a dead end there.

But nevertheless, thank you for your help
Elia Schito
@elia
Nov 10 2015 16:24
my pleasure, do you plan to implement any of Digest or OpenSSL for opal?
Qqwy / Wiebe-Marten
@Qqwy
Nov 10 2015 16:26
I fear that my mathematical expertise is too limited to be of use to implement a cryptographic library directly
Although there are some great javascript-native libraries out there that implement SHA1, SHA2, SHA3(/Keccak), MD5 and the likes that Opal might be able to tap in to.
Elia Schito
@elia
Nov 10 2015 16:28
yeah, reusing JS stuff sounds like the best option here