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!
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
jenrzzz has quit [Ping timeout: 264 seconds]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 256 seconds]
nebiros has joined #ruby
howdoi has joined #ruby
segy has quit [Quit: ZNC - http://znc.in]
segy has joined #ruby
TCZ has joined #ruby
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
Industrial` has quit [Ping timeout: 256 seconds]
greypack has quit [Ping timeout: 246 seconds]
TCZ has quit [Quit: Leaving]
envex has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
segy has quit [Quit: ZNC - http://znc.in]
segy has joined #ruby
nicholaslyang has joined #ruby
ellcs has quit [Quit: Leaving.]
<lmat> Uncle_Cid: I've been comfortable with testing for several years. Testing this rails app has been a nightmare... (reasons specified above) :-)
segy has quit [Quit: ZNC - http://znc.in]
segy has joined #ruby
oddp has quit [Ping timeout: 256 seconds]
segy has quit [Quit: ZNC - http://znc.in]
imode has joined #ruby
nebiros has left #ruby [#ruby]
segy has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
bmurt has joined #ruby
ule has quit [Ping timeout: 244 seconds]
ule has joined #ruby
greypack has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greypack has quit [Quit: All your IRC are belong to ZNC]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
segy has quit [Quit: ZNC - http://znc.in]
segy has joined #ruby
bmurt has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
segy has quit [Quit: ZNC - http://znc.in]
nicholaslyang has joined #ruby
segy has joined #ruby
alfiemax has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
ChmEarl has quit [Quit: Leaving]
alfiemax has quit [Ping timeout: 256 seconds]
cyrus_mc_ has joined #ruby
alfiemax has joined #ruby
nebiros has joined #ruby
ule has quit [Changing host]
ule has joined #ruby
vpw has joined #ruby
alfiemax has quit [Remote host closed the connection]
Uncle_Cid has quit [Ping timeout: 258 seconds]
braincrash has quit [Quit: bye bye]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
braincrash has joined #ruby
cyrus_mc_ has quit [Quit: Connection closed]
dfucci has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
Garb0 has quit [Quit: I'm out.]
dfucci has quit [Ping timeout: 256 seconds]
sagax has quit [Quit: Konversation terminated!]
bambanx has quit [Quit: Leaving]
hassox_ has joined #ruby
hassox has quit [Ping timeout: 256 seconds]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mr_rich101 has quit [Quit: ZNC - http://znc.in]
anandprabhu has joined #ruby
mr_rich101 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicholaslyang has joined #ruby
r3m has quit [Quit: WeeChat 2.9-dev]
r3m has joined #ruby
alfiemax has joined #ruby
_whitelogger has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
howdoi has quit [Quit: Connection closed for inactivity]
_aeris_ has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
vpw_ has joined #ruby
vpw has quit [Ping timeout: 256 seconds]
r3m has quit [Quit: WeeChat 2.9-dev]
r3m has joined #ruby
_whitelogger has joined #ruby
vpw_ has quit [Quit: Leaving]
vpw_ has joined #ruby
dfucci has joined #ruby
vpw_ has quit [Client Quit]
vpw has joined #ruby
vpw has quit [Client Quit]
_whitelogger has joined #ruby
anandprabhu has quit [Quit: Konversation terminated!]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
wymillerlinux has quit [Ping timeout: 260 seconds]
nicholaslyang has joined #ruby
imode has quit [Ping timeout: 246 seconds]
plutes has quit [Ping timeout: 272 seconds]
dfucci has quit [Ping timeout: 244 seconds]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Industrial` has joined #ruby
plutes has joined #ruby
BH23 has joined #ruby
yxhuvud has quit [Remote host closed the connection]
yxhuvud has joined #ruby
envex has quit []
ellcs has joined #ruby
ellcs has quit [Client Quit]
nicholaslyang has joined #ruby
BH23 has quit [Ping timeout: 244 seconds]
_whitelogger has joined #ruby
cd has quit [Quit: cd]
venmx has joined #ruby
BH23 has joined #ruby
UncleCid has joined #ruby
mossplix has joined #ruby
con3 has quit [Quit: ZNC 1.7.5 - https://znc.in]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
con3 has joined #ruby
nicholaslyang has joined #ruby
alfiemax has quit [Remote host closed the connection]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
plutes has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
fanta1 has joined #ruby
mossplix has quit [Remote host closed the connection]
plutes has joined #ruby
comet23 has quit [Quit: Connection closed for inactivity]
bocaneri has quit [Ping timeout: 244 seconds]
bocaneri has joined #ruby
anandprabhu has joined #ruby
<UncleCid> lmat I found rspec + capybara to be quite a nice combo. I'm not sure exactly what part of the app you're testing, but that was always nice when testing features
mossplix has joined #ruby
mossplix has quit [Ping timeout: 244 seconds]
oddp has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
skx86 has quit [Quit: Connection closed for inactivity]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
jetchisel has joined #ruby
jinie has joined #ruby
Uncle_Cid has joined #ruby
TCZ has joined #ruby
TCZ2 has joined #ruby
TCZ2 has quit [Remote host closed the connection]
UncleCid has quit [Ping timeout: 246 seconds]
TCZ has quit [Client Quit]
mossplix has joined #ruby
TCZ has joined #ruby
anandprabhu has quit [Quit: Konversation terminated!]
anandprabhu has joined #ruby
postmodern has quit [Quit: Leaving]
mossplix has quit [Remote host closed the connection]
tau has joined #ruby
tau has quit [Changing host]
tau has joined #ruby
mossplix has joined #ruby
mossplix has quit [Ping timeout: 264 seconds]
_aeris_ has joined #ruby
leitz has joined #ruby
TCZ has quit [Quit: Leaving]
mossplix has joined #ruby
_whitelogger has joined #ruby
dfucci has joined #ruby
schne1der has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
Emmanuel_Chanel has joined #ruby
anandprabhu has quit [Read error: No route to host]
TCZ has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
<lmat> Uncle_Cid: I'm doing integration (controller or request) tests. Feature tests exist (and use capybara), but I don't know anything about them. I'll read up on it.
<apotheon> One of my "favorite" things is reading someone's explanation of how some technique is great for making code clear and readable, but the way the person writes code in general is so difficult to understand that the supposed benefits of the technique are lost in the line noise.
m27frogy has quit [Read error: Connection reset by peer]
m27frogy has joined #ruby
<Uncle_Cid> apotheon do as I say, not as I do lol
<apotheon> When their explanation depends on understanding what they've done to get the point of what they say, that may not help.
<apotheon> There's a lot of bad code in the world, sadly.
<apotheon> I've been shopping for a replacement car recently (not a process I enjoy), and when test driving a car I found the sheer quantity of second-guessing-the-driver's-intent technology a bit overwhelming. I decided I didn't want that trim level, and the salesperson didn't understand why.
<apotheon> I refrained, with some effort, from launching myself into an explanation of how every time one adds complexity to system design one introduces more bugs and more unexpected interactions between parts of the system.
<apotheon> That conversation would've gotten me nowhere. Even if we assume the code is initially bug-free, though, if it's poorly organized it'll almost certainly lead to introduction of bugs later when someone makes changes.
<apotheon> . . . because hard-to-read code is also very difficult to *change* without making it buggy -- which can be deadly if it involves stuff like the car you're driving deciding to apply maximum braking force at entirely the wrong time.
<apotheon> In general, collision avoidance is probably a good technology, but what if it's trying to perform some lane-following adjustment and adaptive cruise control following distance adjustment at the same time?
<apotheon> I could imagine it going sideways.
<apotheon> . . . and rolling.
<apotheon> can't review the code, can't opt for not including the code for features I'd never use . . .
lucasb has joined #ruby
<apotheon> When something as simple as a single object method in Ruby can be written to look like mushy spaghetti in a simplified example on someone's blog intended to show how a feature of the language can be used to make code readable, I get a bit concerned about whether the code controlling safety automation in a new car is maintainable.
mcspud has quit [Remote host closed the connection]
venmx has quit [Ping timeout: 244 seconds]
alfiemax has quit [Remote host closed the connection]
hassox has joined #ruby
tau has quit [Ping timeout: 256 seconds]
hassox_ has quit [Ping timeout: 246 seconds]
jingjinghack has joined #ruby
big-bon has joined #ruby
big-bon has left #ruby [#ruby]
ChmEarl has joined #ruby
wymillerlinux has joined #ruby
TCZ has quit [Quit: Leaving]
<lmat> I need a function in my unit testing suit (to check to see if an array is sorted already). Where should I put it? I'm using Rspec.
<lmat> I was thinking of putting the function above Rspec.describe .... way at the top of the file. Does that make sense, or is there a better spoc?
<lmat> s/spoc/spot/
<adam12> lmat: Could put it in spec_helper.rb or it's own file in support/
<lmat> adam12: Sweet.
<adam12> lmat: Maybe it's a custom assertion? expect(array).to be pre_sorted
<adam12> lmat: You'd have to check docs for custom assertions if that's the case.
<lmat> I have a thing={} thing[2] = 'a' thing[1] = 'b'
<lmat> adam12: That would make a lot of sense. That is how I'm using it.
<lmat> Regarding my thing={}...does it stay sorted?
<adam12> lmat: Hashes are sorted by insertion order.
Esa__ has joined #ruby
<adam12> lmat: So you create a Hash with elements in the order you want them to appear.
<adam12> lmat: Using a numeric index (1, 2) makes me think you want an Array.
<adam12> thing = []
<lmat> adam12: sweet. So it's not a hash table.
<lmat> adam12: My example maybe should have been thing[5] = 'a' thing[3] = 'b' :-)
<adam12> lmat: Not exactly. A hash table could possibly work too.
<adam12> lmat: but with the keys being numeric, you might want it to be an Array.
<lmat> adam12: Arrays can be sparse?
<adam12> lmat: Ruby Hashes can have almost anything as a key, so this could of worked too.
<adam12> lmat: Well, that's a good question actually.
<adam12> They won't be sparse; empty slots will have `nil`.
<adam12> I'm not sure what that actually looks like in memory tho. Never bothered to look.
<lmat> In most languages I know, the first index is 0 and the second index is 1.
<adam12> lmat: What's your end goal?
<adam12> lmat: That's true for Ruby as well.
<lmat> To make sure the documents on the generated pdf report are in the same order as the user put them in.
<adam12> lmat: Do you care about the index then? I'd presume an Array of documents would be fine here?
<lmat> adam12: Okay, so thing = []; thing[5] = "a"; thing[0] == thing[1] == thing[2] == nil?
<lmat> adam12: I think so, but there is a good deal of code that relies on that key...
<lmat> adam12: Iteration by key, etc.
<adam12> OK. I'd stick with Hash then I guess.
<lmat> thing = {}; thing[5] = "a"; thing[3] = "b"; puts thing.each { |k,v| v }.to_s; will yield something like ["a","b"] ?
<lmat> (is there a way to test this sort of thing out?
<lmat> )
<lmat> wow!
<adam12> &>> thing = {}; thing[5] = "a"; thing[3] = "b"; thing.values
<rubydoc> # => ["a", "b"] (https://carc.in/#/r/9dkd)
<lmat> it worked ^_^
<lmat> Thanks!
<lmat> So a {} is not a hash map, but an *ordered* associative array.
<adam12> lmat: You won't need each. The block doesn't do anything.
<lmat> like a vector of tuples.
<lmat> adam12: Yeah, I noticed that I still got key-values ^_^
<adam12> lmat: Don't forget you can just open irb and not use the ruby binary.
<lmat> adam12: I tried "repl" but that wasn't found in my shell. irb, thanks!
<adam12> Gotta run. Have fun.
DaRock has quit [Ping timeout: 246 seconds]
<havenwood> lmat: It's a doubly, circularly linked list.
<havenwood> lmat: Yup, order guaranteed.
<havenwood> lmat: (Ascending by time of key insertion.)
<havenwood> They didn't use to be ordered.
skx86 has joined #ruby
jingjinghack has quit [Quit: WeeChat 2.1]
<havenwood> Set is ordered too, but unlike Hash it's not guaranteed to be ordered across implementations since it's not part of the spec. There's currently a discussion about making Set formally ordered.
chalkmonster has quit [Quit: WeeChat 2.8]
<havenwood> They're SipHash 13 now too instead of SipHash 24. It seems lots of languages took the plunge together to go from 2 "c" rounds to 1 and 4 "d" rounds to 3. Faster and still works. :)
orbyt_ has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
chris has joined #ruby
chris is now known as Guest65212
venmx has joined #ruby
gavlee has quit [Excess Flood]
gavlee has joined #ruby
Guest65212 has quit [Ping timeout: 260 seconds]
venmx has quit [Ping timeout: 246 seconds]
venmx has joined #ruby
venmx has quit [Ping timeout: 264 seconds]
venmx has joined #ruby
schne1der has quit [Ping timeout: 246 seconds]
Uncle_Cid has quit [Remote host closed the connection]
Uncle_Cid has joined #ruby
venmx has quit [Ping timeout: 264 seconds]
chalkmonster has joined #ruby
<lmat> havenwood: doubly circular linked list, thanks.
SuperLag has quit [Remote host closed the connection]
<lmat> Found "sorted_by?"! expect(documents.sorted_by? { |d| d.order_number }).to be_falsy
dfucci has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
RiPuk has quit [Quit: ZNC 1.8.1 - https://znc.in]
RiPuk has joined #ruby
RiPuk has quit [Client Quit]
RiPuk has joined #ruby
ewanchic has joined #ruby
ewanchic has quit [Client Quit]
ewanchic has joined #ruby
venmx has joined #ruby
chris has joined #ruby
<Uncle_Cid> When developing an application, is it better to require the project files singularly in a root file, or should each file only require what it takes to run that file?
chris is now known as Guest31655
<Uncle_Cid> I'm in the middle, but the latter sounds better in the long run.
<Uncle_Cid> I'm finding it harder to test
rafadc has quit [Quit: ZNC - https://znc.in]
wymillerlinux has quit [Ping timeout: 244 seconds]
imode has joined #ruby
nicholaslyang has joined #ruby
mcspud has joined #ruby
Guest31655 has quit [Ping timeout: 256 seconds]
rafadc has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
<lmat> Uncle_Cid: As a total ruby noob, I'd lay the latter. In C++, we do something in the middle: files that won't change much (external libraries, etc.) we group together in a pre-compiled file for speedier compilation, but beside that, only what is needed.
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #ruby
<Uncle_Cid> Why thank ya
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dfucci has joined #ruby
tau has joined #ruby
tau has quit [Changing host]
tau has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
nicholaslyang has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davispuh has joined #ruby
dhollinger has quit [Ping timeout: 256 seconds]
chalkmonster has joined #ruby
dhollinger has joined #ruby
venmx has quit [Ping timeout: 246 seconds]
axsuul has quit [Ping timeout: 240 seconds]
akem_ is now known as akem
s_ has quit [Ping timeout: 256 seconds]
s_ has joined #ruby
LtHummus has quit [Quit: ZNC 1.8.1-rc1 - https://znc.in]
axsuul has joined #ruby
LtHummus has joined #ruby
jetchisel has joined #ruby
chris has joined #ruby
chris is now known as Guest32607
nicholaslyang has joined #ruby
s_ has quit [Ping timeout: 244 seconds]
s_ has joined #ruby
<lmat> I have a puts "one"; @record.update(field: new_val); puts "two"; I see the output for "one", but no SQL in the logs for the update and no "two".
<lmat> I switched to update! so that an exception would be raised if there was a problem, but that didn't fix anything...
cd has joined #ruby
AndreYuhai has joined #ruby
<AndreYuhai> Hey there, I am using httprb and sending concurrent requests to an API using proxies. However, I get this error 'SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello (OpenSSL::SSL::SSLError)' every once in a while.
TCZ has joined #ruby
Guest48 has joined #ruby
Guest48 is now known as smurfke
Guest32607 has quit [Ping timeout: 240 seconds]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apotheon> lmat: Is this in Rails?
<apotheon> lmat: . . . presumably in a model, I'd guess.
fanta1 has quit [Quit: fanta1]
gaqwas has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
bambanx has joined #ruby
<lmat> apotheon: YES!
<lmat> apotheon: It's rails, but not in a model. It's in app/jobs/report_generator_job.rb
<apotheon> lmat: Maybe you should try adding a binding.pry just before the @record.update line, then when it opens up a pry console you can manually paste in the @record line and see what happens.
AndreYuhai has quit [Ping timeout: 256 seconds]
AndreYuhai has joined #ruby
mossplix has quit [Remote host closed the connection]
wymillerlinux has joined #ruby
nicholaslyang has joined #ruby
s_ has quit [Ping timeout: 244 seconds]
s_ has joined #ruby
smurfke has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mossplix has joined #ruby
Guest48 has joined #ruby
Guest48 has quit [Client Quit]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
s_ has quit [Ping timeout: 260 seconds]
s_ has joined #ruby
Guest48 has joined #ruby
tau has quit [Ping timeout: 246 seconds]
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cliluw has quit [Ping timeout: 264 seconds]
cliluw has joined #ruby
mossplix has quit [Remote host closed the connection]
AndreYuhai has quit [Quit: Leaving]
Benett has quit [Quit:  ]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mossplix has joined #ruby
Guest48 has joined #ruby
TCZ has quit [Quit: Leaving]
Guest48 has quit [Client Quit]
Benett has joined #ruby
Guest48 has joined #ruby
nicholaslyang has joined #ruby
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
skx86 has quit []
Guest48 has joined #ruby
skx86 has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
gaqwas has quit [Remote host closed the connection]
Industrial` has quit [Ping timeout: 246 seconds]
s_ has quit [Ping timeout: 256 seconds]
s_ has joined #ruby
Benett has quit [Remote host closed the connection]
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bambanx has quit [Ping timeout: 246 seconds]
Benett has joined #ruby
Guest48 has joined #ruby
Guest48 has quit [Client Quit]
bambanx has joined #ruby
Guest48 has joined #ruby
mossplix has quit [Remote host closed the connection]
s_ has quit [Ping timeout: 256 seconds]
s_ has joined #ruby
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has quit [Quit: Leaving]
g0bl1n has joined #ruby
chris has joined #ruby
chris is now known as Guest74965
g0bl1n has quit [Quit: g0bl1n]
g0bl1n has joined #ruby
g0bl1n has quit [Client Quit]
tau has joined #ruby
tau has quit [Changing host]
tau has joined #ruby
Guest48 has joined #ruby