donofrio has quit [Remote host closed the connection]
alexherbo2 has quit [Ping timeout: 240 seconds]
Garb0_ has joined #ruby
Garb0_ has quit [Client Quit]
Garb0__ has quit [Ping timeout: 240 seconds]
<s_>
is there a debian+1 channel or similar
<s_>
wrong channel
elcuervo has joined #ruby
cuerbot has quit [Ping timeout: 272 seconds]
Pyrophilia has joined #ruby
Pyrophilia_ has joined #ruby
Pyrophilia__ has joined #ruby
Pyrophilia___ has joined #ruby
Pyrophilia____ has joined #ruby
Pyrophilia_____ has joined #ruby
Pyrophilia_ has quit [Client Quit]
Pyrophilia_____ has quit [Client Quit]
Pyrophilia____ has quit [Client Quit]
Pyrophilia___ has quit [Client Quit]
Pyrophilia__ has quit [Client Quit]
Pyrophilia has quit [Client Quit]
Pyrophilia has joined #ruby
elxbarbosa has quit [Read error: No route to host]
hwdyki has joined #ruby
<hwdyki>
hi.. i'm trying to migrate some stuff from ubuntu 16.04 to 20.04 that uses ruby-builder. looks like the paths have changed. on ub16, ruby-builder has /usr/lib/ruby/vendor_ruby/builder, but on ub20 this has moved to /usr/share/rubygems-integration/all/gems/builder-3.2.4/lib and my app is complaining about builder missing.
<havenwood>
Swyper: Whatcha wanna know time complexity for?
<Swyper>
I'm doing a take-home assignment for a new grad job
<Swyper>
You can use a library, but don’t trivialize the problem with the use of a library, as we won't get much sense of how you write code. xD
<Swyper>
Given two lists of student names, return a merged list of all the names combined. Order of the merged list is not important. Names in the merged list should only appear once, even if they appeared in both input lists.
<Swyper>
^^ is the question
<havenwood>
Swyper: Then that first link I gave you is along the lines of what they want, I presume?
<Swyper>
ruby has so many nice one liners for this, my initial solution was to push list A onto list B flatten then call uniq and assign the result to a new variable
<Swyper>
yeah
<havenwood>
Swyper: Show `a | b` then show how to implement Array#|.
<havenwood>
Swyper: I hate this type of homework problem, but a nice solution to its nebulousness is to show the actual solution then show a pure Ruby implementation of the methods you'd use.
<havenwood>
Swyper: Have you looked at TruffleRuby's implementation of Array#|?
<Swyper>
I have not
<Swyper>
I was thinking of also just throwing everything into a set then converting it back into an array
<Swyper>
I guess thats something I could break up into an extra method so it looks like I write good code which is what they want, I think
Swyper has quit [Remote host closed the connection]
wallace_mu has quit [Ping timeout: 260 seconds]
Swyper has joined #ruby
drincruz has joined #ruby
henninb has joined #ruby
henninb has quit [Client Quit]
henninb has joined #ruby
henninb has quit [Client Quit]
henninb has joined #ruby
henninb has quit [Client Quit]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
compufreak26 has joined #ruby
TCZ has quit [Quit: Leaving]
jenrzzz has joined #ruby
<compufreak26>
I'm trying to call an external auth cli that requires interactive input and capture the output. I tried Open3.capture3 but can't seem to get the stream redirected right. Kernel.system basically does what I want with pipes except not capturing the command output. IO.popen seems like it might work but I'm a bit confused what the object the block
<compufreak26>
returns is
<jhass>
leitz: I never took a deep look, but I believe on the Ruby side of things mruby is a subset of Ruby. What do you need a "lightweight ruby" for? (lightweight is a quite vague requirement, I would describe mruby as an "embeddable" Ruby runtime maybe)
jenrzzz has quit [Ping timeout: 264 seconds]
<jhass>
compufreak26: I believe it's just an IO where writing to it writes to the child's stdin and reading from it reads from the childs stdout. stderr access is thus probably not given unless you used the options (see docs on spawn) to redirect stderr to stdout
<yxhuvud>
compufreak26: I can recommend checking out the spawn method. It is simpler to use.
Pyrophilia has quit [Ping timeout: 260 seconds]
Pyrophilia has joined #ruby
<leitz>
jhass, I dislike the expectation of requiring a user to load dozens of gems onto their machine to get an application to work. Even with building a website, I prefer fewer gems and dependencies.
drincruz has quit [Ping timeout: 240 seconds]
<jhass>
leitz: mruby vs ruby doesn't change this at all
<jhass>
yxhuvud: I believe spawn and popen have the same signature, it's just that spawn requires you to manually setup the pipes?
drincruz has joined #ruby
<yxhuvud>
jhass: problem is that there is a billion different variants of popen, with slightly different behaviour.
<yxhuvud>
whereas spawn is a single interface that handles them all with minimum fuss.
<jhass>
yxhuvud: I think you might be mixing up open3 and IO.popen :)
<yxhuvud>
perhaps, but that makes my point too :)
<jhass>
IO.popen has the same signature as spawn/system :)
Rudd0 has quit [Ping timeout: 244 seconds]
<compufreak26>
With spawn I'd need to wire up all the pipes correctly tho 🤔
compufreak26 has quit [Remote host closed the connection]
<yxhuvud>
the ones you care about, yes.
cd has joined #ruby
cuerbot has joined #ruby
Swyper has quit [Remote host closed the connection]
elcuervo has quit [Ping timeout: 256 seconds]
brendan- has joined #ruby
akem has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
gensym has joined #ruby
sarna has quit [Quit: Connection closed]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
BSaboia has joined #ruby
<leitz>
jhass, it would seem that the culture of an mruby type project would be much more understanding of trying to minimize dependencies.
BSaboia has quit [Quit: Leaving]
BSaboia has joined #ruby
aesthe has joined #ruby
compufreak65 has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
tobiasvl has quit [Ping timeout: 240 seconds]
TCZ has joined #ruby
alfiemax has quit [Remote host closed the connection]
fercell has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
akem has joined #ruby
ChmEarl has joined #ruby
fandre1986 has joined #ruby
jenrzzz has joined #ruby
Swyper has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
bmurt has joined #ruby
roshanavand has quit [Ping timeout: 272 seconds]
burgestrand has quit [Quit: burgestrand]
phaul has quit [Ping timeout: 240 seconds]
rubydoc has quit [Ping timeout: 260 seconds]
moeSizlak has joined #ruby
<moeSizlak>
if i want to use ruby (not rails) as a replacement for php on an apache server, whats best way to do so
fandre198649 has joined #ruby
fandre1986 has quit [Ping timeout: 240 seconds]
phaul has joined #ruby
rubydoc has joined #ruby
duderonomy has joined #ruby
<apotheon>
moeSizlak: That's a very nonspecific question, and I'm not sure how to answer it.
<apotheon>
moeSizlak: Are you saying you want nothing but a templating system?
<apotheon>
moeSizlak: . . . but if you want just a little more friendliness for things, you could try Sinatra.
<apotheon>
moeSizlak: Sinatra separates concerns a little more than just a basic template approach, but it's not terribly difficult to just use it for basic templates.
Rubzz has joined #ruby
<Rubzz>
adam12: I just wanted to say, thanks for the assistance on Friday. I went with define_singleton_method.
fandre1986 has joined #ruby
<adam12>
Rubzz: Awesome.
fandre198649 has quit [Ping timeout: 260 seconds]
zacts has joined #ruby
Rubzz has quit [Remote host closed the connection]
Garb0 has quit [Read error: Connection reset by peer]
compufreak65 has quit [Remote host closed the connection]
dka- has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
howdoi has joined #ruby
exkith has joined #ruby
Lachezar has joined #ruby
* Lachezar
waves.
* apotheon
particles.
rubydoc has joined #ruby
<Lachezar>
I'm trying to recreate an encrypt/decrypt scheme that has been developed in Ruby.
<Lachezar>
It does: `cipher = OpenSSL::Cipher.new('AES-128-CBC')` `cipher.encrypt()` `cipher.key = generation_procedure()` and then returns `Base64.encode64(cipher.update(data) + cipher.final)`
<Lachezar>
Seems right, but when I try to replicate it (in Java) I get something unexpected: the java code returns different data every time I call it, while Ruby code returns the same encrypted text every time.
jenrzzz has joined #ruby
<Lachezar>
Is there something specific about padding or secure-random implementation that I need to know?
<pabs>
Lachezar: my recommendation would be to not roll your own crypto implementation, and use something like libsodium instead
<pabs>
the problem with trying to create your own implementation by picking algorithms and modes is you'll almost certainly guess wrong or forget to account for something
<pabs>
versus relying on a higher-level library, which will take care of most of those annoyances for you
<pabs>
(for example, if you just aes-128-cbc encrypt something, and i come along, i can reliably flip bits in the encrypted data without knowing the key, because it's not AEAD)
<Lachezar>
pabs: Not my choice. Already done by devs, and I need to integrate :-/
<Lachezar>
I am currently wondering how is the IV set in Ruby when encrypting using 'AES-128-CBC'.
davispuh has joined #ruby
* Lachezar
curses badly.
phaul has joined #ruby
ruby-lang442 has joined #ruby
<Lachezar>
So if I fix the IV in Java to be all zero I get the same encrypted as the Ruby.
* Lachezar
curses again, but a bit less aggressive