havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
lalitmee has joined #ruby
lalitmee has quit [Remote host closed the connection]
lalitmee has joined #ruby
oncall-pokemon has quit [Quit: Connection closed for inactivity]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phenom has quit [Quit: See ya! Wouldn't want to blah blah..]
phenom has joined #ruby
phenom has quit [Client Quit]
phenom has joined #ruby
zacts has quit [Quit: WeeChat 2.7.1]
zacts has joined #ruby
TCZ has quit [Quit: Leaving]
greypack has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
gix has quit [Disconnected by services]
zacts has quit [Quit: WeeChat 2.7.1]
jetchisel has quit [Ping timeout: 250 seconds]
zacts has joined #ruby
kickr has joined #ruby
kickr has quit [Client Quit]
kickr has joined #ruby
chalkmonster has joined #ruby
zacts has quit [Quit: WeeChat 2.7.1]
kristian_on_linu has quit [Remote host closed the connection]
jetchisel has joined #ruby
kickr has quit [Quit: going to sleep...]
kickr has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
greypack has quit [Quit: All your IRC are belong to ZNC]
imode has joined #ruby
<imode> hi there! I'm currently working on a project that involves running an untrusted scripting language on multiple worker nodes. the original spec was drafted for TypeScript, but I'm wondering if this could be migrated to something like Ruby. I've seen therubyracer mini_racer as JavaScript interpreters (though they seem to be a bit unmaintained), and fragments of Lua bindings. are there any gems that are
<imode> well-maintained and are able to run sandboxed scripting languages?
zacts has joined #ruby
greypack has joined #ruby
zacts has quit [Client Quit]
zacts has joined #ruby
phenom has quit [Quit: See ya! Wouldn't want to blah blah..]
phenom has joined #ruby
greypack has quit [Ping timeout: 264 seconds]
kickr has quit [Quit: going to sleep...]
kickr has joined #ruby
greypack has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.5 - https://znc.in]
jmcgnh has joined #ruby
kickr has quit [Quit: going to sleep...]
hays is now known as s
s is now known as Guest1550
Guest1550 is now known as s_
s_ is now known as h
h is now known as s_
gavlee_ has quit []
kickr has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
ChmEarl has quit [Quit: Leaving]
mr_rich101 has quit [Quit: ZNC - http://znc.in]
mr_rich101 has joined #ruby
bkuhlmann has joined #ruby
bkuhlmann has quit [Ping timeout: 256 seconds]
bkuhlmann has joined #ruby
bkuhlmann has quit [Ping timeout: 256 seconds]
s2013 has joined #ruby
zacts has quit [Quit: WeeChat 2.7.1]
zacts has joined #ruby
darkstardev13 has quit [Ping timeout: 260 seconds]
darkstardevx has joined #ruby
bkuhlmann has joined #ruby
golevka has quit [Read error: Connection reset by peer]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MadLamb has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
sergioro has quit [Quit: leaving]
s2013 has joined #ruby
sergioro has joined #ruby
s2013 has quit [Ping timeout: 260 seconds]
<MadLamb> is there a way that I can easily create an object with the values from rails ActionController::Parameters?
<phaul> what do you mean by object? It must already be an object... Do you mean a hash?
rmnull has quit [Quit: WeeChat 2.8]
<MadLamb> phaul, I have this model, and I want to fill the model with the data from that
<MadLamb> phaul, I can do it manually @object.a = param['a']
<phaul> can you do @object.assign_attributes(param) ?
lalit has joined #ruby
<phaul> you also need to call permit on param with the attributes you want to white-list https://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html
lalitmee has quit [Ping timeout: 260 seconds]
zacts has quit [Quit: WeeChat 2.7.1]
<MadLamb> phaul, that worked, thanks
kickr has quit [Quit: going to sleep...]
<phaul> yw
d3bug has quit [Quit: Connection closed for inactivity]
<kayront> havenwood: thanks for the suggestion. in this case it then complains that it can't find it: "Could not find bcrypt_pbkdf-1.0.0 in any of the sources"
<kayront> but the directory is there? ./vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.0
jintseng has joined #ruby
jintseng has quit [Client Quit]
<kayront> i'm using --path vendor/bundle because I didn't want to install any of this system wide
<kayront> but it shouldn't matter in this case
Esa__ has quit [Remote host closed the connection]
ur5us has joined #ruby
xco has joined #ruby
<xco> sharing a gem/CLI i created to track COVID-19 in your terminal: https://github.com/siaw23/kovid
<xco> for those who haven't seen it
<xco> :)
ur5us has quit [Ping timeout: 260 seconds]
imode has quit [Ping timeout: 265 seconds]
r3m has quit [Quit: WeeChat 2.9-dev]
r3m has joined #ruby
ur5us has joined #ruby
TCZ has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
giorgian has joined #ruby
alfiemax has joined #ruby
kristian_on_linu has joined #ruby
alfiemax has quit [Ping timeout: 265 seconds]
claudiuinberlin has joined #ruby
giorgian has quit [Ping timeout: 256 seconds]
cd has quit [Quit: cd]
jeromelanteri has joined #ruby
sergioro has quit [Quit: leaving]
ur5us has quit [Ping timeout: 260 seconds]
kickr has joined #ruby
giorgian has joined #ruby
ellcs has joined #ruby
gix has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
giorgian has quit [Ping timeout: 258 seconds]
zapata has quit [Ping timeout: 265 seconds]
kickr has quit [Quit: going to sleep...]
schne1der has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zapata has joined #ruby
zapata has quit [Ping timeout: 272 seconds]
darkstardevx has quit [Ping timeout: 265 seconds]
xco has joined #ruby
TCZ has quit [Quit: Leaving]
zapata has joined #ruby
extrowerk has left #ruby [#ruby]
troulouliou_div2 has quit [Ping timeout: 240 seconds]
giorgian has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
troulouliou_div2 has joined #ruby
bkuhlmann has quit [Remote host closed the connection]
bkuhlmann has joined #ruby
lalitmee has joined #ruby
lalitmee has quit [Max SendQ exceeded]
lalitmee has joined #ruby
lalitmee has quit [Max SendQ exceeded]
lalit has quit [Ping timeout: 256 seconds]
lalitmee has joined #ruby
lalitmee has quit [Max SendQ exceeded]
lalitmee has joined #ruby
lalitmee has quit [Max SendQ exceeded]
lalitmee has joined #ruby
infinityfye has joined #ruby
troulouliou_div2 has quit [Ping timeout: 240 seconds]
giorgian has quit [Ping timeout: 256 seconds]
caterfxo has quit [Quit: leaving]
troulouliou_div2 has joined #ruby
caterfxo has joined #ruby
TCZ has joined #ruby
markopasha has joined #ruby
lalitmee has quit [Quit: Leaving]
markopasha has quit [Max SendQ exceeded]
TCZ has quit [Quit: Leaving]
davispuh has joined #ruby
travonted has joined #ruby
bkuhlmann has quit [Ping timeout: 240 seconds]
gfawcett has joined #ruby
ldepandis has joined #ruby
postmodern has quit [Quit: Leaving]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkuhlmann has joined #ruby
<akem> What should i use to encode a regular string with spaces, comas or accents, to an URL with %20, %2C etc? Looks like URI.encode is obsolete and i think it does not encode all sign for some reason like "," or "'"?
chalkmonster has joined #ruby
<akem> URI.encode_www_form_component() I think it's this one.
giorgian has joined #ruby
roadie has quit [Ping timeout: 264 seconds]
giorgian has quit [Client Quit]
giorgian has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
alfiemax has joined #ruby
roadie has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
travonted has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
xco has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
code_zombie has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
lxsameer has joined #ruby
<s_> this might be more of a unix question... but this simple program https://bpaste.net/A6YQ has an issue where if I background it, it stops because its waiting for stdin. I tried fixing that by connecting input to a named pipe, but I don't think that helped either. the process is running, but the port refuses the connection as if it weren't running.
<s_> it is a bit of a pain for me to change my code here.. wondering if there is a workaround to make this work other than screen
zacts has joined #ruby
<s_> it is puzzling to me why attaching stdin to a named pipe didn't work.. the process shows as running... but the modbus server isn't 'working' as it refuses connections
bkuhlman_ has joined #ruby
bkuhlmann has quit [Ping timeout: 260 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
ritalinona has quit [Remote host closed the connection]
ritalinona has joined #ruby
zacts has quit [Quit: WeeChat 2.7.1]
zacts has joined #ruby
bkuhlmann has joined #ruby
bkuhlman_ has quit [Ping timeout: 256 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troulouliou_div2 has quit [Quit: Leaving]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
dviola has quit [Ping timeout: 258 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
imode has joined #ruby
NODE has quit [Quit: changing servers]
sergioro has joined #ruby
NODE has joined #ruby
giorgian has quit [Remote host closed the connection]
GodFather has joined #ruby
giorgian has joined #ruby
Benett has quit [Quit:  ]
Benett has joined #ruby
Benett has quit [Remote host closed the connection]
Benett has joined #ruby
dviola has joined #ruby
ta has quit [Ping timeout: 264 seconds]
roadie has quit [Ping timeout: 256 seconds]
rippa has joined #ruby
roadie has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Ping timeout: 256 seconds]
cahoots_ has joined #ruby
<cahoots_> hi, is there some generic "stream" interface or something for both strings and files, where i have generic .write and .read methods?
duderonomy has joined #ruby
giorgian has quit [Remote host closed the connection]
giorgian has joined #ruby
<phaul> cahoots_: we have StringIO
<phaul> &ri StringIO
ChmEarl has joined #ruby
eldritch has quit [Quit: ZNC 1.6.6+deb1ubuntu0.1 - http://znc.in]
DTZUZU2 has joined #ruby
DTZUZU has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 265 seconds]
shakes has joined #ruby
d3bug has joined #ruby
eldritch has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
TCZ has joined #ruby
romanlevin has quit [Ping timeout: 256 seconds]
shakes has quit [Quit: Leaving]
DTZUZU has joined #ruby
romanlevin has joined #ruby
DTZUZU2 has quit [Ping timeout: 265 seconds]
Benett has quit [K-Lined]
NODE has quit [K-Lined]
romanlevin has quit [Ping timeout: 265 seconds]
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
NODE has joined #ruby
c0d3r has joined #ruby
markopasha has joined #ruby
c0d3r has quit [Quit: WeeChat 2.8]
romanlevin has joined #ruby
<cahoots_> phaul, ty
giorgian has quit [Ping timeout: 256 seconds]
<havenwood> No more bug fixes for 2.5. Time to update to 2.6 or 2.7!
alexherbo2 has joined #ruby
romanlevin has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
markopasha has quit [Read error: Connection reset by peer]
ellcs has quit [Ping timeout: 260 seconds]
nullvalue has joined #ruby
TCZ has quit [Quit: Leaving]
cahoots_ has quit [Quit: leaving]
giorgian has joined #ruby
cahoots has joined #ruby
<cahoots> hi, i've been trying truffleruby, and it's really, really slow. i'm not using any gems, and i'm running a simple 54-line program without any crazy meta-programming. any ideas what might be the issue?
ellcs has joined #ruby
<havenwood> cahoots: Show your code? Are you using Graal or Substrate VM?
<havenwood> cahoots: Is it only slow to start? If so, switch to a Substrate build.
<cahoots> havenwood, if i do "puts 'hello, world'" it runs quickly. or do you mean there's a startup time per line of code?
darkstardevx has joined #ruby
<cahoots> and i guess i'm using graal, i just installed 19.3.1 via rbenv
<cahoots> i guess i *am* using gems, but nothing installed manually, just pre-bundled (yaml and erb)
giorgian has quit [Quit: restart emacs]
<cahoots> i also took a random benchmark on the benchmarks game and found it to be much slower for truffleruby (12 secs vs. 7 secs): https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/pidigits-mri-1.html
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
giorgian has joined #ruby
ta has joined #ruby
ur5us has joined #ruby
nullvalue has quit [Remote host closed the connection]
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #ruby
alfiemax has joined #ruby
sh7d has quit [Ping timeout: 240 seconds]
TCZ has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
ua has quit [Ping timeout: 264 seconds]
caterfxo has quit [Quit: leaving]
sh7d has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
jeromelanteri has quit [Quit: Leaving]
gitter1234 has joined #ruby
cahoots has quit [Ping timeout: 256 seconds]
code_zombie has quit [Quit: Leaving]
caterfxo has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby
ur5us has joined #ruby
conta has joined #ruby
ellcs has joined #ruby
TCZ has quit [Quit: Leaving]
conta has quit [Quit: conta]
cd has joined #ruby
TCZ has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
schne1der has quit [Ping timeout: 250 seconds]
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby
<havenwood> cah, ah, they left while I was AFK. That microbenchmark has a *ton* of object churn. It looks JRuby takes the cake there, followed by nightly CRuby.
<havenwood> JRuby.take(🍰)
akem has quit [Quit: Leaving]
MadLamb has quit [Remote host closed the connection]
infinityfye has quit [Quit: Leaving]
giorgian has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Leaving]
giorgian has joined #ruby
giorgian has quit [Ping timeout: 264 seconds]
tomekjozwik has joined #ruby
gitter1234 has quit [Quit: Connection closed for inactivity]
ellcs has quit [Ping timeout: 256 seconds]
tomekjozwik has left #ruby [#ruby]
roadie has joined #ruby
tomekjozwik56 has joined #ruby
DispelUndead has joined #ruby
roadie has quit [Read error: Connection reset by peer]
tomekjozwik56 has quit [Client Quit]
DispelUndead has quit [Quit: leaving]
tomekjozwik38 has joined #ruby
galaxie has quit [Ping timeout: 240 seconds]
tomekjozwik38 has quit [Client Quit]
tomekjozwik34 has joined #ruby
tomekjozwik34 has quit [Client Quit]
tomekjozwik has joined #ruby
akem has joined #ruby
galaxie has joined #ruby
DispelUndead has joined #ruby
bkuhlmann has quit []
tpanarch1st has joined #ruby
mistergibson has joined #ruby
giorgian has joined #ruby
henninb has joined #ruby
cahoots has joined #ruby
<cahoots> havenwood, thoughts?
brool has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
<havenwood> cahoots: On first inspection it looks like this benchmark generates a ton of objects and GC pressure. I haven't looked into why TruffleRuby isn't particularly fast on it, but TruffleRuby is tuned by default for long-running processes.
<havenwood> cahoots: JRuby *is* particularly fast at it. I'd suggest looking at something less microbechmarky, like optcarrot.
tomekjozwik has quit [Quit: Connection closed]
<havenwood> cahoots: An NES emulator, or something nontrivial like that, will be a much more valuable benchmark.
<s_> this simple program https://bpaste.net/A6YQ has an issue where if I background it, it stops because its waiting for stdin. I tried fixing that by connecting input to a named pipe, but I don't think that helped either. the process is running, but the port refuses the connection as if it weren't running.
<havenwood> s_: You created a named pipe like with File.mkfifo or what?
<s_> havenwood: i did it in the shell and piped to it
<s_> foo.rb < myfifo > log
<havenwood> s_: If you push something to its stdin, does it start back up?
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<s_> hmm. i think i tried that. but let me try it again
<s_> need a sec
<havenwood> mkfifo altin && echo 'testing' > altin&; ruby -p -e '$_.capitalize!' < altin
<havenwood> echo 'testing' > altin&; ruby -e 'puts STDIN.read.capitalize' < altin
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<s_> sorry having some key issues
<s_> havenwood: even weirder?
<s_> mb_slave 50001 < /tmp/myfifo > modbus.log &
<s_> then I did echo hi > /tmp/myfifo
brool has quit [Ping timeout: 265 seconds]
Na_Klar has joined #ruby
hiroaki has quit [Ping timeout: 265 seconds]
<s_> not sure why its getting a nil there
<s_> havenwood: your minimal test seemed to work though
<s_> I even tried this and it worked. ruby -e 'puts STDIN.gets.chomp.split " "' < /tmp/myfifo
<Na_Klar> I want to establish a socket communication between two peers. It is a CLI program. Firstly my prog starts a thread for STDIN and listens to it. Then each peer starts a ServerSocket in a new thread and listens to it. Both sides then connect to each socket, which is again in a new thread. That way a bidirectional communication is possible. ... But now I want to make it not necessarry that both sides start a listening socket. How do I get the list
<s_> omg this is driving me nuts
DispelUndead has left #ruby [#ruby]
Ai9zO5AP has joined #ruby
zacts has quit [Quit: WeeChat 2.7.1]
zacts has joined #ruby
<s_> havenwood: it seems.. that upon writing to the named pipe, the loop executes a second time and that is the time i get the error with chomp. so gets is not blocking but rather returning nil
<havenwood> Na_Klar: Have you looked at DRb in the Ruby stdlib? My first thought is that it might already have solid abstractions along the lines you're talking.