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]
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>
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. :)
<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.
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…]