havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.5, 2.5.7, 2.7.0-preview1: 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!
<mynameisdebian> I have an array (a) with about 4.5 million members, each itself being an array containing a good amount of data. All of this was extracted from a CSV about 1GB in size. I have over 7GB free. When I run this code in IRB I get an error "failed to allocate memory": https://gist.github.com/AumCoin/4c2993fc548b8966503b96e74ac48013 . Anyone know why this can't allocate the memory? Is there a workaround?
<mynameisdebian> Might be wrong about having 7GB free, but the machine is a headless Linux instance with nothing else running on it, and has 8GB RAM
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
witlesswonder__ has joined #ruby
AJA4351 has joined #ruby
witlesswonder_ has quit [Ping timeout: 260 seconds]
xarthna has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Ping timeout: 276 seconds]
AJA4351 is now known as AJA4350
Intelo has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 245 seconds]
fphilipe has joined #ruby
n88 has quit [Ping timeout: 240 seconds]
fphilipe has quit [Ping timeout: 250 seconds]
<Iambchop> mynameisdebian: can you provide a small example input and output for your problem?
<leftylink> if I may make a completely uneducated guess. I would assume that `a[1...a.length]` would create another array. maybe Ruby just didn't have enough memory to do that. I don't know offhand whether Ruby is able to optimise this to a copy-on-write (whether it even does such a thing)
<baweaver> If you do a range subquery it totally does
<baweaver> mynameisdebian: what's the input look like?
<leftylink> I was unclear and now I want to know
<leftylink> does "it totally does" mean "it totally does create a new array" or "it totally does do a copy-on-write"
<baweaver> Also you left something off
<leftylink> I guess "do" is not the right word
<leftylink> "create a virtual array that has copy-on-write effect" I guess
<baweaver> m[3]
<baweaver> That means you iterated once already
<baweaver> So you're leaving some parts of the code off that are consuming more memory
drincruz has joined #ruby
<baweaver> The other thing is never read in the entire file like that for larger sizes
<mynameisdebian> ok guys, my instance is frozen, rbeooting and I'll try to answer some of these questions
hiroaki has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
poontangmessiah has joined #ruby
poontangmessiah has quit [Max SendQ exceeded]
<baweaver> You probably want CSV.foreach
<mynameisdebian> This is the whole code, except ignore the uncommented comment line in the middle: https://dpaste.de/CtbL
poontangmessiah has joined #ruby
<baweaver> Yeah, you're performing a ton more allocations
poontangmessiah has quit [Max SendQ exceeded]
poontangmessiah has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
ogres has quit [Quit: Connection closed for inactivity]
<SeepingN> pluck
<mynameisdebian> A CSV line looks like this: https://dpaste.de/pWY2
<SeepingN> why csv
<SeepingN> this is databaseland
<baweaver> Would only work in Rails on AR
<baweaver> because some people still have data in that format.
<mynameisdebian> CSV because that's just how the data is structured, and I need to do some calculations that are either very hard to do directly on a DB, or that I do not know how to do on a DB
<SeepingN> I have lots of data in csv. but when it's ...what was that, 11 million lines that I saw?
<mynameisdebian> 4.5 million
<SeepingN> uh ya
<SeepingN> awk maybe? lol definitely need soemthing that reads in chunks
<baweaver> Yeah
<baweaver> CSV.foreach
<Iambchop> and you're trying to group the entries by the fourth column?
<baweaver> Roughly like that
<mynameisdebian> Iambchop, yes
<SeepingN> is foreach_line or each_line deprecated now?
<baweaver> May need some adjustments, guessing
<baweaver> For File, no, but CSV is more efficient if you're dealing with CSVs
<SeepingN> righteo
<SeepingN> my mind was corrupted by years of horrible 1.8.6 code
<mynameisdebian> baweaver, running that solution
<mynameisdebian> baweaver, is there any way to get output to know how far it's coming along, without adding too much memory?
<baweaver> Could add a counter
<baweaver> Then it's just an Integer
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
wildtrees has quit [Quit: Leaving]
bradleyprice has joined #ruby
AJA4350 has quit [Quit: AJA4350]
<Iambchop> A little demo: readlines.map.split for a <200MB file adds >700MB RAM https://dpaste.de/k8fe
bambanx has quit [Ping timeout: 265 seconds]
kyrylo has joined #ruby
hiroaki has quit [Ping timeout: 250 seconds]
<Iambchop> without the splits: https://dpaste.de/uBRZ :-)
<SeepingN> da splits
<SeepingN> mynameisdebian: is output on a command line?
<SeepingN> terminal. shell. whatever
<mynameisdebian> SeepingN, irb output is in a shell, but I am trying to eventually write to a file
<mynameisdebian> baweaver's solution seems to be working pretty well
<SeepingN> yeah add a counter, but probably only print %100 or soemthing
<mynameisdebian> ya
<mynameisdebian> at 3.5mil so far
Fernando-Basso has quit [Remote host closed the connection]
<SeepingN> rarely do you need up to the millisecond status
<mynameisdebian> nope, just outputting every thousand
<SeepingN> do a lot of terminal ruby work?
<mynameisdebian> Uh oh, starting to page hehe
<mynameisdebian> SeepingN, no, this is a little bit new to me, analyzing data this way
<SeepingN> ah
<mynameisdebian> I do tech support for an API, but a customer thinks we ripped them off or something so I have to try to prove otherwise or something
<mynameisdebian> overcharged them for API calls, is what their concern is
<SeepingN> poor progammin on their side, is my concern
<SeepingN> BT,DT
<SeepingN> ..on both sides. lol
hiroaki has joined #ruby
SuspiciousMinds has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
hiroaki_ has joined #ruby
bradleyprice has quit [Remote host closed the connection]
mynameisdebian has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 240 seconds]
bradleyprice has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
xarthna has joined #ruby
dwc_ has joined #ruby
SuspiciousMinds has quit [Quit: Bye Bye]
queip has quit [Ping timeout: 250 seconds]
SystemXProc has left #ruby ["Leaving"]
queip has joined #ruby
dwc_ has quit [Ping timeout: 268 seconds]
gtwatt[m] has joined #ruby
Technodrome has joined #ruby
Esa_ has quit []
absolutejam has joined #ruby
gorsuch has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
thad_the_man_2 has joined #ruby
absolutejam has quit [Ping timeout: 240 seconds]
gorsuch has quit [Remote host closed the connection]
thad_the_man has quit [Ping timeout: 250 seconds]
Ai9zO5AP has quit [Quit: WeeChat 2.5]
gorsuch has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
mynameisdebian has joined #ruby
teardown has quit [Read error: Connection reset by peer]
teardown has joined #ruby
kyrylo has joined #ruby
fphilipe has joined #ruby
mynameisdebian has quit [Quit: Leaving]
hutch1 has joined #ruby
gorsuch has quit [Remote host closed the connection]
fphilipe has quit [Ping timeout: 276 seconds]
tdy has quit [Ping timeout: 240 seconds]
dasher00 has quit [Ping timeout: 265 seconds]
hutch1 has quit [Ping timeout: 250 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
cyclonis has quit [Ping timeout: 250 seconds]
cyclonis_ has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
brool has quit [Ping timeout: 246 seconds]
cd has quit [Quit: cd]
Swyper has quit [Remote host closed the connection]
tdy has joined #ruby
Swyper has joined #ruby
Mrbuck has joined #ruby
Swyper has quit [Remote host closed the connection]
gix- has joined #ruby
gix has quit [Disconnected by services]
xarthna has quit [Ping timeout: 268 seconds]
fierycatnet has joined #ruby
fierycatnet has quit [Client Quit]
Mrbuck has quit [Remote host closed the connection]
xarthna__ has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
xarthna__ has quit [Ping timeout: 276 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chalkmonster has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
mynameisdebian has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
<mynameisdebian> If I have a Hash, where each "value" is an array, how can I get the top 100 arrays, as an array?
<mynameisdebian> whoops, I mean by size of array
bradleyprice has quit [Ping timeout: 268 seconds]
<al2o3-cr> mynameisdebian: hash.values.max(100)
<mynameisdebian> each value is an array though, so I need the max by size
<leftylink> does max_by take a number
<leftylink> &ri Enumerable#max_by
<leftylink> great, it does. in that case, I'd go with that.
sauvin has joined #ruby
fphilipe has joined #ruby
<mozzarella> hash.values.sort_by(&:size).take(100)
<al2o3-cr> mynameisdebian: or as leftylink pointed out hash.values.max_by(100) { |a| a.size }
FlorianFa has quit [Ping timeout: 240 seconds]
<mozzarella> wait
<mozzarella> that would be the 100 smallest ones, sorry
fphilipe has quit [Ping timeout: 245 seconds]
<baweaver> al2o3-cr: with the size they're at I'd avoid values
<baweaver> 1G+ thereabouts
<al2o3-cr> baweaver: oh, i've not been following.
<baweaver> Not a problem
<baweaver> I'd figured something like that
<mynameisdebian> baweaver, glad to have you weigh in
<baweaver> otherwise they'd be right
<baweaver> hash.max_by(100) { |_k, vs| vs.size }.map!(&:last)
<baweaver> though I don't think that's sorted
<baweaver> Oh, it does
greypack has quit [Ping timeout: 240 seconds]
<baweaver> That's handy
<baweaver> &>> xs = (1..15).to_a.shuffle; { xs: xs, top_5: xs.max_by(5, &:itself) }
<rubydoc> # => {:xs=>[1, 3, 5, 2, 8, 10, 15, 6, 9, 13, 4, 11, 14, 12, 7], :top_5=>[15, 14, 13, 12, 11]} (https://carc.in/#/r/7t17)
FlorianFa has joined #ruby
<baweaver> &>> xs = (1..15).to_a.shuffle; { xs: xs, top_5: xs.min_by(5, &:itself) }
<rubydoc> # => {:xs=>[12, 11, 4, 15, 7, 10, 9, 8, 6, 14, 1, 13, 5, 3, 2], :top_5=>[1, 2, 3, 4, 5]} (https://carc.in/#/r/7t18)
<baweaver> al2o3-cr / havenwood: Did you know it did that?
<baweaver> I sure didn't
<baweaver> "If the n argument is given, maximum n elements are returned as an array. These n elements are sorted by the value from the given block, in descending order."
bradleyprice has joined #ruby
<baweaver> Sure enough
<baweaver> &>> xs = (1..15).to_a.shuffle; { xs: xs, top_5: xs.min(5) }
<rubydoc> # => {:xs=>[11, 6, 1, 10, 5, 15, 12, 14, 3, 8, 13, 2, 7, 4, 9], :top_5=>[1, 2, 3, 4, 5]} (https://carc.in/#/r/7t1d)
<al2o3-cr> baweaver: have you been doing haskell :P
<baweaver> NO
<baweaver> ....maybe a little
<al2o3-cr> lol ;)
<baweaver> I mean it makes sense now that I stop for more than 5 seconds to think about it
akemhp has quit [Remote host closed the connection]
akemhp has joined #ruby
greypack has joined #ruby
bradleyprice has quit [Ping timeout: 268 seconds]
<mynameisdebian> So I've been running into Ruby crashes due to memory issues on this, and I think I need to close my IRC client.
drincruz has quit [Ping timeout: 240 seconds]
<mynameisdebian> baweaver, thanks!
<mynameisdebian> and everyone else too
mynameisdebian has quit [Quit: Leaving]
<leftylink> well at least it was intentional, unlike our friend "close all programs you're not using"
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> baweaver: Aye, nice they're sorted by design rather than implementation.
cthulchu_ has joined #ruby
mgxm has quit [Ping timeout: 264 seconds]
mgxm has joined #ruby
drincruz has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
conta has joined #ruby
blackmesa has joined #ruby
absolutejam has joined #ruby
schne1der has joined #ruby
bradleyprice has joined #ruby
blackmesa has quit [Ping timeout: 245 seconds]
absolutejam has quit [Ping timeout: 276 seconds]
bradleyprice has quit [Ping timeout: 268 seconds]
fphilipe has joined #ruby
mossplix has joined #ruby
bradleyprice has joined #ruby
dionysus69 has joined #ruby
luminousnine has quit [Quit: Toodles]
bradleyprice has quit [Ping timeout: 240 seconds]
luminousnine has joined #ruby
luminousnine has quit [Changing host]
luminousnine has joined #ruby
blackmesa has joined #ruby
schne1der has quit [Ping timeout: 276 seconds]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hiroaki_ has quit [Ping timeout: 268 seconds]
spectra has quit [Ping timeout: 248 seconds]
spectra has joined #ruby
kyrylo has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.6]
blackmesa has quit [Ping timeout: 250 seconds]
andikr has joined #ruby
krandi has joined #ruby
krandi has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
vondruch has joined #ruby
conta has quit [Ping timeout: 240 seconds]
queip_ has joined #ruby
queip has quit [Ping timeout: 268 seconds]
queip_ is now known as queip
fphilipe has quit [Ping timeout: 264 seconds]
<sagax> hi all!
<sagax> we have binding to qt5 ?
cyclonis_ has quit [Ping timeout: 240 seconds]
akemhp_ has joined #ruby
<akemhp_> sagax, AFAIK no. And last time i checked there was no news and rubyforge was down.
<sagax> uff
akemhp has quit [Ping timeout: 240 seconds]
conta1 has joined #ruby
fphilipe has joined #ruby
nPUafy has joined #ruby
akemhp has joined #ruby
akemhp_ has quit [Ping timeout: 246 seconds]
TomyWork has joined #ruby
<havenwood> sagax: looks like some https://seanchas116.github.io/ruby-qml/
nPUafy1 has joined #ruby
schne1der has joined #ruby
nPUafy has quit [Ping timeout: 240 seconds]
<sagax> thanks, will see
queip has quit [Ping timeout: 268 seconds]
<sagax> uff, and maybe i must use just binding to qt4
queip has joined #ruby
bradleyprice has joined #ruby
nPUafy1 has quit [Ping timeout: 240 seconds]
<havenwood> sagax: tk? https://github.com/ruby/tk
akemhp has quit [Ping timeout: 265 seconds]
akemhp has joined #ruby
akemhp_ has joined #ruby
drincruz has joined #ruby
akemhp has quit [Ping timeout: 268 seconds]
bradleyprice has quit [Ping timeout: 240 seconds]
queip has quit [Ping timeout: 240 seconds]
queip_ has joined #ruby
drincruz has quit [Ping timeout: 250 seconds]
queip_ is now known as queip
gix- has quit [Ping timeout: 240 seconds]
akemhp_ has quit [Read error: Connection reset by peer]
bradleyprice has joined #ruby
absolutejam has joined #ruby
tpanarch1st has quit [Ping timeout: 240 seconds]
titanbiscuit has quit [Ping timeout: 268 seconds]
tbisker8 has joined #ruby
JohanP has quit [Remote host closed the connection]
bradleyprice has quit [Ping timeout: 268 seconds]
Intelo has joined #ruby
akemhp has joined #ruby
bradleyprice has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
Intelo has quit [Ping timeout: 265 seconds]
Intelo has joined #ruby
bradleyprice has quit [Ping timeout: 240 seconds]
queip has quit [Ping timeout: 250 seconds]
queip_ has joined #ruby
queip_ is now known as queip
gavlee has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thebananaking has quit [Quit: Connection closed for inactivity]
queip_ has joined #ruby
queip has quit [Ping timeout: 268 seconds]
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #ruby
queip_ is now known as queip
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
luminousnine has quit [Quit: Toodles]
blackmesa has joined #ruby
bradleyprice has joined #ruby
akemhp_ has joined #ruby
akemhp has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
bradleyprice has quit [Ping timeout: 240 seconds]
akemhp_ has quit [Ping timeout: 240 seconds]
luminousnine has joined #ruby
luminousnine has quit [Changing host]
luminousnine has joined #ruby
bradleyprice has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
luminousnine has quit [Read error: Connection reset by peer]
absolutejam has quit [Ping timeout: 265 seconds]
queip_ has joined #ruby
queip has quit [Ping timeout: 245 seconds]
fphilipe has quit [Ping timeout: 250 seconds]
queip_ is now known as queip
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
bradleyprice has quit [Ping timeout: 268 seconds]
no_gravity has joined #ruby
kyrylo has joined #ruby
<no_gravity> Hello! I'm looking into Ruby a bit today.
<no_gravity> Anybody here?
bradleyprice has joined #ruby
inkvar has joined #ruby
bitwinery has quit [Quit: Leaving]
luminousnine has joined #ruby
luminousnine has joined #ruby
luminousnine has quit [Changing host]
ur5us has quit [Ping timeout: 276 seconds]
chalkmonster has joined #ruby
inkvar has quit [Client Quit]
bradleyprice has quit [Ping timeout: 240 seconds]
absolutejam has joined #ruby
<leftylink> I guess that would put you ahead. I think it is not every day that I look into Ruby a bit
<no_gravity> leftylink: Heya!
<no_gravity> For example, how would this line look in Ruby? $names=['Joe','Sue','Min']; foreach($names as $name) echo "Hello $name!\n";
bradleyprice has joined #ruby
<leftylink> for that, I advise looking at Enumerable#each
<leftylink> &ri Enumerable#each
<rubydoc> Found no entry that matches class Enumerable instance method each
<leftylink> what did I do
<leftylink> &ri Array#each
ellcs has joined #ruby
<no_gravity> Well, I have never used Ruby. If I write it, it will probably not be very elegant.
<no_gravity> And I want to compare this line across languages.
bradleyprice has quit [Ping timeout: 268 seconds]
<leftylink> while it is true that `for ... in` exists in Ruby, one doesn't usually see it used, interestingly. hence my suggestion
<no_gravity> Well, my intention is to compare this across languages:
bradleyprice has joined #ruby
<no_gravity> Create some object that holds user names.
<no_gravity> Say hello to everybody.
blackmesa has joined #ruby
drincruz has joined #ruby
<leftylink> yup.
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Intelo has quit [Ping timeout: 240 seconds]
queip has quit [Ping timeout: 240 seconds]
queip_ has joined #ruby
queip_ is now known as queip
KeyJoo has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
_phaul has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
bradleyprice has quit [Ping timeout: 268 seconds]
cyclonis has joined #ruby
inkvar has joined #ruby
blackmesa has joined #ruby
<sagax> havenwood: no, because i need browser in custom window
<sagax> qt have browser
<sagax> but qt5 have fresh version
bradleyprice has joined #ruby
queip has quit [Ping timeout: 276 seconds]
queip_ has joined #ruby
queip_ is now known as queip
bradleyprice has quit [Ping timeout: 240 seconds]
bradleyprice has joined #ruby
troulouliou_div2 has joined #ruby
bradleyprice has quit [Ping timeout: 268 seconds]
Axy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Mia has quit [Ping timeout: 268 seconds]
bradleyprice has joined #ruby
cloaked1 has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
conta1 has quit [Ping timeout: 246 seconds]
bradleyprice has quit [Ping timeout: 240 seconds]
akem__ has quit [Quit: Leaving]
akemhp has joined #ruby
al2o3-cr has quit [Ping timeout: 246 seconds]
bradleyprice has joined #ruby
al2o3-cr has joined #ruby
queip has quit [Quit: bye, freenode]
Intelo has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
cloaked1 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
bradleyprice has quit [Ping timeout: 268 seconds]
bradleyprice has joined #ruby
troulouliou_div2 has quit [Ping timeout: 245 seconds]
teclator has quit [Ping timeout: 268 seconds]
bradleyprice has quit [Ping timeout: 240 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
SuspiciousMinds has joined #ruby
Ai9zO5AP has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
dasher00 has joined #ruby
queip has joined #ruby
guest999 has joined #ruby
bradleyprice has joined #ruby
bradleyprice has quit [Ping timeout: 240 seconds]
kyrylo has joined #ruby
mossplix has quit [Remote host closed the connection]
guest999 has left #ruby ["Leaving"]
Axy has quit [Quit: Leaving]
flughafen has joined #ruby
no_gravity has quit [Quit: leaving]
guest999 has joined #ruby
bradleyprice has joined #ruby
guest999 has quit [Quit: Leaving]
leitz has joined #ruby
bradleyprice has quit [Ping timeout: 268 seconds]
teclator has joined #ruby
<Bish> im not used to writing gems
bradleyprice has joined #ruby
<Bish> i forked a gem, and want to build and install it locally, how would i go with that?
<Bish> sure, i could install it with my github repo being the source
<Bish> is that the easiest way to do it?
fphilipe has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
bradleyprice has quit [Ping timeout: 240 seconds]
fphilipe has quit [Ping timeout: 268 seconds]
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
AJA4350 has joined #ruby
bradleyprice has joined #ruby
SuspiciousMinds has quit [Quit: Bye Bye]
SuspiciousMinds has joined #ruby
tdy has quit [Ping timeout: 265 seconds]
mossplix has quit [Read error: Connection reset by peer]
mossplix_ has joined #ruby
bradleyprice has quit [Ping timeout: 268 seconds]
NL3limin4t0r_afk is now known as NL3limin4t0r
<NL3limin4t0r> Bish: have you've already taken a look at the manuals provided by rubygems and bundler?
rafadc has quit [Quit: ZNC - https://znc.in]
<NL3limin4t0r> You can build the gem using `gem build gemspec_file.gemspec` then install with `gem install /path/to/gem_file.gem`.
fphilipe has joined #ruby
<NL3limin4t0r> If you're using bundler you don't have to install the gem to test it out. You can use it with `bin/console` instead.
poontangmessiah has joined #ruby
Intelo has quit [Ping timeout: 265 seconds]
darkwingchuck has joined #ruby
Intelo has joined #ruby
cyclonis_ has joined #ruby
bradleyprice has joined #ruby
cyclonis has quit [Ping timeout: 240 seconds]
rafadc has joined #ruby
<Bish> but im not making my own gem.. im trying to modify one
<Bish> isn't it colliding in some sort?
<Bish> NL3limin4t0r:
bradleyprice has quit [Ping timeout: 240 seconds]
<kp666[m]> Bish: you could build from the modified code or you could give that as a source in your gemfile
<NL3limin4t0r> Those manuals offer more info than only say how to initialize a new gem. They talk about folder structure, building and installing the gem localy, publishing the gem etc.
<NL3limin4t0r> So they should also apply to a forked gem.
blackmesa has joined #ruby
queip has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
queip has joined #ruby
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #ruby
queip has quit [Ping timeout: 246 seconds]
queip has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
mossplix_ has quit [Remote host closed the connection]
mossplix has joined #ruby
cyclonis has joined #ruby
DTZUZO has joined #ruby
cyclonis_ has quit [Ping timeout: 245 seconds]
mossplix has quit [Ping timeout: 240 seconds]
lucasb has joined #ruby
mossplix has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
zodd has joined #ruby
darkwingchuck has quit [Ping timeout: 245 seconds]
jacksoow_ has joined #ruby
jacksoow has quit [Ping timeout: 240 seconds]
stryek has joined #ruby
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #ruby
Obast has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
<Obast> Hi. Ive created a hash like this: myhash=["Ekonomistyrning" => "Ekonomi", "Fastigheter" => "Fastighet"] When I try 'puts myhash["Fastigheter"]' I get 'TypeError: no implicit conversion of String into Integer'. I suppose I am missing some basic ruby?
no_gravity has joined #ruby
DTZUZO has joined #ruby
sandstrom has joined #ruby
jacksoow_ has quit [Ping timeout: 252 seconds]
n88 has joined #ruby
akem_ has joined #ruby
<NL3limin4t0r> Obast: That's because you use `[...]` and not `{...}`.
<NL3limin4t0r> Have you looked at the result?
<NL3limin4t0r> &>> ["Ekonomistyrning" => "Ekonomi", "Fastigheter" => "Fastighet"]
DTZUZO has quit [Ping timeout: 268 seconds]
akemhp has quit [Ping timeout: 268 seconds]
<rubydoc> stderr: playpen: timeout triggered! (https://carc.in/#/r/7t4a)
<NL3limin4t0r> #=> [{"Ekonomistyrning"=>"Ekonomi", "Fastigheter"=>"Fastighet"}]
<NL3limin4t0r> aka, an array containing a hash
<Obast> NL3limin4t0r You're right. Thanks :)!
thad_the_man_2 has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 246 seconds]
<NL3limin4t0r> You should either change the definition to use {}, or change the access to `myhash[0]["Fastigheter"]`
<no_gravity> Hello! How would this line look like in Ruby? $names=['Sue','Joe','Min']; foreach($names as $name) echo "Hello $name!\n";
inkvar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Obast> A bit strange result. So when you put "hash code/data" inside array brackets ruby kind of creates a hash behind the scenes, and adds the result to the array?
DTZUZO has joined #ruby
<NL3limin4t0r> no_gravity: names = ['Sue', 'Joe', 'Min']; names.each { |name| puts "Hello #{name}!" }
mostlybadfly has joined #ruby
<NL3limin4t0r> Obast: Yep, just like parameters
<no_gravity> NL3limin4t0r: Nice, thanks!
<NL3limin4t0r> Obast: foo(1, 2, option_a: true, option_b: false)
<NL3limin4t0r> Will for example have 3 parameters, 1, 2 and {option_a: true, option_b: false}
<zodd> adam12, I fixed my DBI-ODBC issue. Turned out I forgot to install the dbi-odbc gem :P
akem_ has quit [Quit: Leaving]
mossplix has quit [Remote host closed the connection]
<zodd> error handling could have been better
akemhp has joined #ruby
Intelo_ has joined #ruby
mossplix has joined #ruby
darkwingchuck has joined #ruby
<NL3limin4t0r> Obast: However implicit hash convertion only kicks in for the last thing in the list. `[a: 1, 2]` would yield an exception and not `[{a: 1}, 2]`
<NL3limin4t0r> &>> [a: 1, 2]
<rubydoc> stderr: -e:4: syntax error, unexpected ']', expecting =>... check link for more (https://carc.in/#/r/7t4d)
DTZUZO has quit [Ping timeout: 276 seconds]
Intelo has quit [Ping timeout: 276 seconds]
<NL3limin4t0r> no_gravity: If you strings don't contain any spaces you could also use the %w syntax
<no_gravity> NL3limin4t0r: What is that |xyz| syntax doing?
<NL3limin4t0r> &>> %w[Sue Joe Min]
<rubydoc> # => ["Sue", "Joe", "Min"] (https://carc.in/#/r/7t4e)
mossplix has quit [Ping timeout: 268 seconds]
blackmesa has joined #ruby
schne1der has quit [Ping timeout: 265 seconds]
darkwingchuck has quit [Ping timeout: 268 seconds]
poontangmessiah has quit [Remote host closed the connection]
<NL3limin4t0r> no_gravity: The "each" method loops though each element in the list executing the { ... } block for each element. The element itself will be passed as parameter. With `|name|` you basically say accept one parameter and give it the name "name".
GodFather has joined #ruby
<NL3limin4t0r> Basically the same as `as $name` in your code.
<NL3limin4t0r> You can name it anything you want, as long as it is an valid variable name.
s2013 has joined #ruby
<adam12> zodd: great!
<no_gravity> NL3limin4t0r: Nice, thanks
<zodd> yeah. It all works now. 6 POCs to access databases using ODBC
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
<no_gravity> Did this line in PHP, Ruby, JS and Python. All are pretty close: https://pastebin.com/raw/XwrKGs9Q
<ruby[bot]> no_gravity: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<no_gravity> ruby[bot]: The /raw/ version has no adds, perfect formatting and loads blazingly fast.
DTZUZO has joined #ruby
mossplix has joined #ruby
Technodrome has joined #ruby
queip has quit [Ping timeout: 240 seconds]
brendan- has joined #ruby
SuspiciousMinds is now known as SzeregowyPosel
no_gravity has quit [Quit: leaving]
blackmesa has quit [Ping timeout: 245 seconds]
queip has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
darkwingchuck has joined #ruby
s2013 has joined #ruby
s2013 has quit [Client Quit]
blackmesa has joined #ruby
SzeregowyPosel has quit [Quit: Bye Bye]
<al2o3-cr> names = {'Joe', 'Sue', 'Min'} for _, name in ipairs(names) do print(("Hello %s!"):format(name)) end
<al2o3-cr> noodle: theres one for you in lua for your collection
<al2o3-cr> oh, they've gone. sorry noodle
BTRE has quit [Remote host closed the connection]
bradleyprice has joined #ruby
blackmesa has quit [Ping timeout: 276 seconds]
<NL3limin4t0r> al2o3-cr: yep, was about to add some aditional info then I saw I tagged the wrong nickname
BTRE has joined #ruby
<al2o3-cr> NL3limin4t0r: yep, i don't know how i didn't see them leave i've got join/leaves on too.
<al2o3-cr> *join/quit
darkwingchuck has quit [Ping timeout: 240 seconds]
<NL3limin4t0r> al2o3-cr: I have smart_filter enabled so I'm not seeing all join/quit messages.
<NL3limin4t0r> I find them to clutter the actual messages, since irc is pretty quite most days.
<al2o3-cr> NL3limin4t0r: i should activate that at some point, it does get a bit distracting sometimes.
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
<al2o3-cr> yes, using weechat. i'll take a look at that link, thanks.
Rapture has joined #ruby
drincruz has joined #ruby
tsujp_ has quit [Ping timeout: 265 seconds]
bradleyprice has quit [Ping timeout: 276 seconds]
inkvar has joined #ruby
tsujp has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 265 seconds]
akemhp has quit [Ping timeout: 268 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Quit: dionysus69]
haivron has joined #ruby
inkvar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akemhp has joined #ruby
DTZUZO has joined #ruby
darkwingchuck has joined #ruby
SzeregowyPosel has joined #ruby
troulouliou_div2 has joined #ruby
darkwingchuck has quit [Ping timeout: 268 seconds]
troulouliou_div2 has quit [Read error: Connection reset by peer]
haivron has quit [Quit: haivron]
akemhp has quit [Ping timeout: 240 seconds]
darkwingchuck has joined #ruby
Intelo__ has joined #ruby
kyrylo has joined #ruby
Intelo_ has quit [Ping timeout: 240 seconds]
darkwingchuck has quit [Ping timeout: 245 seconds]
Intelo__ has quit [Ping timeout: 265 seconds]
schne1der has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
inkvar has joined #ruby
rippa has joined #ruby
bradleyprice has joined #ruby
Inline has joined #ruby
jeremycw has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
mossplix has quit [Read error: Connection reset by peer]
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
inkvar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
conta2 has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
AJA4350 has joined #ruby
Intelo has joined #ruby
Intelo has quit [Remote host closed the connection]
absolutejam has quit [Ping timeout: 265 seconds]
dretnx has joined #ruby
Obast has quit [Remote host closed the connection]
inkvar has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
mossplix has quit [Ping timeout: 268 seconds]
xarthna has joined #ruby
_axx has joined #ruby
DaRock has quit [Remote host closed the connection]
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
xarthna has quit [Ping timeout: 240 seconds]
sgen has joined #ruby
sandstrom has quit [Ping timeout: 276 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cd has joined #ruby
crichoux has joined #ruby
xarthna has joined #ruby
ellcs has quit [Ping timeout: 245 seconds]
conta2 has quit [Quit: conta2]
crichoux has quit [Ping timeout: 268 seconds]
bradleyprice_ has joined #ruby
AJA4351 has joined #ruby
bradleyprice has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
tpanarch1st has joined #ruby
andikr has quit [Remote host closed the connection]
Inline has quit [Ping timeout: 264 seconds]
zodd has quit [Ping timeout: 252 seconds]
RougeR has joined #ruby
<RougeR> hello
crichoux has joined #ruby
<RougeR> guess whos doing funky stuff
* RougeR this guy is
psmolen has quit [Ping timeout: 252 seconds]
Inline has joined #ruby
xarthna has quit [Ping timeout: 240 seconds]
gnufied has joined #ruby
cyclonis has quit [Ping timeout: 276 seconds]
bambanx has joined #ruby
cyclonis_ has joined #ruby
orbyt_ has joined #ruby
chalkmonster has quit [Ping timeout: 276 seconds]
* SzeregowyPosel is impressed
psmolen has joined #ruby
donofrio_ has joined #ruby
psmolen has quit [Read error: Connection reset by peer]
chalkmonster has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
AJA4351 has joined #ruby
greengriminal has joined #ruby
tsujp has quit [Ping timeout: 240 seconds]
psmolen has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
cloaked1 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
gix has joined #ruby
SzeregowyPosel has quit [Quit: Bye Bye]
sgen has quit [Remote host closed the connection]
blackmesa has joined #ruby
sgen has joined #ruby
tsujp_ has joined #ruby
cyclonis_ has quit [Ping timeout: 240 seconds]
dous has quit [Ping timeout: 264 seconds]
xarthna_ has joined #ruby
<RougeR> hey
dous has joined #ruby
darkwingchuck has joined #ruby
tdy has joined #ruby
SeepingN has joined #ruby
cyclonis has joined #ruby
<al2o3-cr> o/
<adam12> \o/
<RougeR> hey
* RougeR just did something clever with active record classes
darkwingchuck has quit [Ping timeout: 240 seconds]
cloaked1_ has joined #ruby
cloaked1_ has quit [Client Quit]
cloaked1 has quit [Ping timeout: 276 seconds]
bradleyprice_ has quit [Remote host closed the connection]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
NL3limin4t0r is now known as NL3limin4t0r_afk
sandstrom has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wildtrees has joined #ruby
darkwingchuck has joined #ruby
dbz_ has joined #ruby
bradleyprice has joined #ruby
fphilipe has quit [Ping timeout: 265 seconds]
bitwinery has joined #ruby
darkwingchuck has quit [Ping timeout: 240 seconds]
dbz_ has quit [Read error: Connection timed out]
dbz_ has joined #ruby
johnny56 has quit [Remote host closed the connection]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
sgen has quit [Ping timeout: 245 seconds]
fphilipe has joined #ruby
blackmesa1 has joined #ruby
Inline has quit [Ping timeout: 264 seconds]
Inline has joined #ruby
blackmesa has quit [Ping timeout: 245 seconds]
Inline__ has joined #ruby
Inline__ has quit [Read error: Connection reset by peer]
Inline__ has joined #ruby
Inline__ has quit [Read error: Connection reset by peer]
Inline__ has joined #ruby
Inline__ has quit [Read error: Connection reset by peer]
Inline has quit [Ping timeout: 264 seconds]
Inline has joined #ruby
akemhp has joined #ruby
darkwingchuck has joined #ruby
gix has quit [Quit: Client exiting]
gix has joined #ruby
darkwingchuck has quit [Ping timeout: 268 seconds]
fphilipe has quit [Ping timeout: 276 seconds]
xarthna_ has quit [Ping timeout: 265 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
yokel has quit [Read error: Connection reset by peer]
dbz_ has quit [Remote host closed the connection]
dretnx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
xarthna_ has joined #ruby
yokel has joined #ruby
<adam12> Anybody remember which version of 2.6 was truncating data? I can't seem to find the issue now and I'm not sure if it was fixed in 2.6.5.
blackmesa1 has quit [Ping timeout: 246 seconds]
dbz_ has joined #ruby
brool has joined #ruby
nowhere_man has joined #ruby
<adam12> Looks like it was 2.6.4. https://bugs.ruby-lang.org/issues/16136 Fixed in 2.6.5 tho the release notes don't mention it :\
RyanMcCoskrie has joined #ruby
xarthna_ has quit [Ping timeout: 246 seconds]
leitz has quit [Quit: Leaving]
CableNinja has joined #ruby
darkwingchuck has joined #ruby
CableNinja_ has joined #ruby
darkwingchuck has quit [Ping timeout: 250 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
fphilipe has joined #ruby
CableNinja has quit [Ping timeout: 276 seconds]
xarthna has joined #ruby
cloaked1 has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
bradleyprice has quit [Remote host closed the connection]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
AJA4351 is now known as AJA4350
RyanMcCoskrie has quit [Remote host closed the connection]
akemhp_ has joined #ruby
hiroaki_ has joined #ruby
xarthna has quit [Ping timeout: 240 seconds]
absolutejam has joined #ruby
akemhp has quit [Ping timeout: 276 seconds]
bradleyprice has joined #ruby
blackmesa1 has joined #ruby
xarthna_ has joined #ruby
dbz__ has joined #ruby
dbz_ has quit [Ping timeout: 240 seconds]
sgen has joined #ruby
CableNinja_ has quit [Read error: Connection reset by peer]
CableNinja_ has joined #ruby
dbz__ has quit [Remote host closed the connection]
AJA4351 has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
wildtrees has quit [Ping timeout: 240 seconds]
crichoux has quit [Ping timeout: 240 seconds]
matheusmoreira has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
matheusmoreira has joined #ruby
Swyper has joined #ruby
bradland has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
dionysus69 has quit [Quit: dionysus69]
ellcs has joined #ruby
dionysus69 has joined #ruby
supsup has joined #ruby
Swyper has quit [Remote host closed the connection]
nutcr4ck3r has joined #ruby
fphilipe has quit [Ping timeout: 252 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #ruby
darkwingchuck has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
darkwingchuck has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
<RougeR> hello
<_phaul> o/
_phaul is now known as phaul
<phaul> o/
<RougeR> i did a coool thing
<RougeR> leme share
<phaul> we are all ears :)
<RougeR> sanitizing it
bradland has quit [Quit: bradland]
<RougeR> phaul,
<RougeR> pretty sweet eh, instead of a controller or multiple methods
hiroaki_ has quit [Ping timeout: 246 seconds]
<RougeR> eh without the trailing 's'
<phaul> I'm sure it is, forgive me for not trying to understand from the code, could you summarize what you did and why?
<RougeR> i need the ability to swap on the fly between elastic search and postgres for log storage
<phaul> I see
<RougeR> so i inheritted from elasticsearch then call super based on a flag in settings
<RougeR> and use double splat to be able to call it normally
frem has joined #ruby
<RougeR> ha, noticed a bug
<RougeR> i cant send in string searches
blackmesa1 has quit [Ping timeout: 264 seconds]
<phaul> RougeR: nice. one trick that just occured to me related to this: you can inherit from an expression :)
<RougeR> ?
<RougeR> do tell
<RougeR> for what i was saying
<RougeR> i can do Log.where(name: 'blah')
<phaul> class X < (rand(2) <=1 ? Hash : Array); end works
<RougeR> but not Log.where('severity > 5')
<RougeR> huh nice
hiroaki_ has joined #ruby
<RougeR> just trying to understand
<RougeR> oh wait
<RougeR> yeah i get it
darkwingchuck has joined #ruby
<RougeR> so i could do < ActiveRecord::Base if Setting.log_storage_type&.casecmp?('POSTGRES')
<RougeR> sort of thing
<phaul> you could
<RougeR> mmm nice
<RougeR> think it acomplishes the same thing here
<RougeR> but i can see how that could be very useful when we consider single inheritance
<RougeR> you could have a method which decides what to inherit from, because before this was inheriting from Ostruct when i just had elasticsearch
dionysus70 has joined #ruby
<RougeR> class Log < (Setting.log_storage_type&.casecmp?('POSTGRES') ? ActiveRecord::Base : OpenStruct)
<RougeR> hmmm that might cause issues with active record
<RougeR> i think
<RougeR> (it does)
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
<RougeR> but an interesting language feature id never seen
dbz_ has joined #ruby
crichoux has joined #ruby
dbz_ has quit [Remote host closed the connection]
dbz_ has joined #ruby
<RougeR> phaul,
<RougeR> this works
<RougeR> def self.where(args = nil, visible = true, **params)
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<phaul> RougeR: nice
<RougeR> :)
<RougeR> need an inline ternary though...
<RougeR> return super(params.empty? ? params : args)
<RougeR> im going to get rid of visible as well
<RougeR> stick it in **params
ur5us has joined #ruby
<RougeR> yep
<RougeR> def self.where(query = nil **params)
<RougeR> return super(params.empty? ? params : query) if Setting.log_storage_type&.casecmp?('POSTGRES')
<RougeR> out of curiosity
<RougeR> in your opinion is that okay code
<RougeR> im totally anticipating my manager to shit on it
<RougeR> hes from a .net background...struggle to get him to give in to ruby sometimes
akem__ has joined #ruby
<RougeR> changed the setting to 'log_store' instead of 'log_storage_type' its still obviosuly but shorter
<phaul> well.. it's all subjective. one thing I useon my personal stuff is reek.Now I have a policy that if reek and rubocop are both happy then it's good
<RougeR> eyyyyyy
<RougeR> (query || params)
<RougeR> can use this
<RougeR> as query is nil
<RougeR> mmm interesting
<RougeR> rubocop is not screaming
wildtrees has joined #ruby
<RougeR> all its got is branch asignment too high
<RougeR> but fuck that lol
<RougeR> actually this looks nice
<RougeR> return super(query || params) if Setting.log_store&.casecmp?('POSTGRES')
akemhp_ has quit [Ping timeout: 240 seconds]
<phaul> it's more difficult to keep reek happy :) that actually sometimes requires redesign
<RougeR> not used reek much may check it
<RougeR> lol whast your max line char
<RougeR> we have some monsters :l
<phaul> but others don't care about reek.. as I said it's subjective
<RougeR> i try keep under 120
sameerynho has joined #ruby
<RougeR> i know rubocop is 80
<phaul> home projects: 80. new job: 120
<RougeR> cool cool
<RougeR> interesting
<RougeR> i duno what our logest is at work lol
<RougeR> too long...
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
istrasci has joined #ruby
<istrasci> How do you override a method in a class from an included module?
<phaul> there is prepend as well as include
<phaul> but I'm not 100% I understand the question yet
<phaul> but if you prepend then the prpepended module will win over the class
<jeremycw> I think that if it doesn't act like where it shouldn't be called where. Call it query or something so there's no expectation.
<istrasci> If I have `class A; include B; end`, and B#c exists, I can call `A.new.c`.
<jeremycw> otherwise someone is going to write code that will only work on postgress and not on elasticsearch without even realizing.
wildtrees has quit [Quit: Leaving]
<istrasci> I want to override the method `c` to be something like `def c; some_condition? ? st_else : call_B#c; end`.
<phaul> istrasci: you just include and if you overide in the class you can use super to invoke the included modules method
<istrasci> That's what I was thinking, but I thought `super` was just for pure inheritance.
<phaul> include under the hood is pure inheritance
<istrasci> phaul: Although it doesn't seem to be working for me. I'll play around with it some more.
<phaul> &>> module B; def foo; 13; end; end; class A; include B; def foo; super * 2; end; end; A.new.foo
<rubydoc> # => 26 (https://carc.in/#/r/7t9u)
<istrasci> phaul: Thanks for the example.
<phaul> istrasci: yw
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<istrasci> phaul: OK, that's working. I had some faulty logic that made it seem like `super` wasn't working that way. My fault.
<phaul> np
<supsup> if anyone can give me some guidance on this i would appreciate it, if you have any questions let me know. https://pastebin.com/PBZ6qCHa
<ruby[bot]> supsup: as I told you already, please use https://gist.github.com
wildtrees has joined #ruby
<phaul> uhm.... jhass ? carc.in rendered html output seems messed up on my side?
<phaul> anybody else seeing this?
<leftylink> oho?
<leftylink> &>> p
<rubydoc> # => nil (https://carc.in/#/r/7ta2)
<Net> supsup: you'll have to be more specific. What is currentPage? What do you mean by "doc child contains the currentPage"?
<leftylink> the page of https://carc.in/#/r/7ta2 looks OK in my browser.
<jhass> phaul: I updated it the other day, maybe Ctrl+F5
<phaul> leftylink: your nil is fine, how does my # => 26 look
<supsup> sorry looked away was trying to setup a gist
<supsup> @net it's doc.link
<jhass> otherwise screenshot & browser would be interesting
<leftylink> that is very long
nutcr4ck3r has quit [Read error: Connection reset by peer]
<leftylink> the line of code bleeds into the output section
nutcr4ck3r has joined #ruby
<jhass> ah, mh
<jhass> well I'm really not good with CSS :D
<phaul> that's what I'm seeing too.. nvm.
<supsup> Net i added a part, does it make it more clear.? https://gist.github.com/supsup/beb350b9d3becd2b721edea11cb34f4d
<phaul> I thought it was some regression
<phaul> but I haven't realized how long single liner I wrote :D
<Net> supsup: is this a filesystem?
<Net> you want to see if the currentPage is a file under the link directory?
<supsup> i want to know if the current 'doc''s children collection contain the currentPage compared against the collections link property
<supsup> i'm drawing a navigation, have no problems making the child active, but i cannot make the parent active
<supsup> guessing i need to make a helper function that basically passes in the currentPage and the current docs collection
<supsup> which would trigger more recursion if more collections are in there.
<jhass> might very well be a regression, I switched from a old thoughtbot/neat to CSS grid
<supsup> and does not find a match at the current level
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
<phaul> possible. I can't say for sure but I kind of remember scrollable div boxes in this case
`nutcr4ck3r` has joined #ruby
jacksoow has joined #ruby
mossplix has joined #ruby
<RougeR> phaul,
<RougeR> haha okay that was a lot of dicking about
<RougeR> i just went and looked at the active record source code in the end and used their where method signature
Intelo has joined #ruby
orbyt_ has joined #ruby
nutcr4ck3r has quit [Ping timeout: 246 seconds]
cloaked1_ has joined #ruby
<Net> supsup: did you figure it out?
<supsup> working on it
<supsup> prob will figure it out
<Net> 👍🏼
<Net> I think I understand what you mean now if you need to talk about it
<Net> > i'm drawing a navigation
<Net> saying that helped clear it up
<supsup> i don't normally use ruby, so a bit of a syntax curve
<Net> I'm sure you're aware, you can just write a regular recursive function
cloaked1 has quit [Ping timeout: 268 seconds]
<RougeR> what you trying to do>
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
schne1der has quit [Ping timeout: 245 seconds]
mossplix has quit [Ping timeout: 240 seconds]
hiroaki_ has quit [Ping timeout: 246 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
SzeregowyPosel has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
fphilipe has joined #ruby
<jhass> phaul: should be better now
dbz__ has joined #ruby
<Frankenstein> if I have an array `foo = [1,2,3,4]` is there any semantic difference (or potential pitfalls) between `bar *foo` and `bar(*foo)`?
darkwingchuck has quit [Ping timeout: 240 seconds]
<jhass> not for ruby but it's one char short of bar * foo that is bar() * foo, so some people argue it's harder to read
dbz_ has quit [Ping timeout: 240 seconds]
<jhass> whereas bar(* foo) still does what you want
<Frankenstein> ah, ok
fphilipe has quit [Ping timeout: 250 seconds]
<jhass> additionally bar*foo also doesn't do what you want ofc
<jhass> or bar* foo
nutcr4ck3r has joined #ruby
darkwingchuck has joined #ruby
<Frankenstein> this is starting to remind me of c
<jhass> :D
<jhass> except in C two of the three do the same thing and people can't agree on what's the right way to write it
`nutcr4ck3r` has quit [Ping timeout: 265 seconds]
<Frankenstein> yeah, at least it means different things in ruby
ellcs has quit [Ping timeout: 264 seconds]
darkwingchuck has quit [Ping timeout: 240 seconds]
`nutcr4ck3r` has joined #ruby
nutcr4ck3r has quit [Ping timeout: 268 seconds]
Fernando-Basso has joined #ruby
darkwingchuck has joined #ruby
reber has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
cloaked1 has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
`nutcr4ck3r` has quit [Ping timeout: 240 seconds]
cloaked1_ has quit [Ping timeout: 265 seconds]
drincruz has quit [Ping timeout: 268 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
reber has quit [Ping timeout: 240 seconds]
Technodrome has joined #ruby
darkwingchuck has quit [Ping timeout: 265 seconds]
bambanx_ has joined #ruby
bradleyprice has quit [Remote host closed the connection]
nutcr4ck3r has joined #ruby
bambanx has quit [Ping timeout: 265 seconds]
nutcr4ck3r has left #ruby [#ruby]
greengriminal has joined #ruby
ogres has joined #ruby
greengriminal has quit [Client Quit]
jeremycw has quit [Ping timeout: 276 seconds]
bambanx_ has quit [Quit: Leaving]
AJA4351 has joined #ruby
bambanx has joined #ruby
supsup has quit [Remote host closed the connection]
AJA4350 has quit [Ping timeout: 246 seconds]
AJA4351 is now known as AJA4350
crichoux has quit [Ping timeout: 245 seconds]
bradleyprice has joined #ruby
jhass has quit [Quit: Bye]
absolutejam has quit [Ping timeout: 240 seconds]
dbz__ has quit [Remote host closed the connection]
xGrind has joined #ruby
dbz_ has joined #ruby
gix has quit [Quit: Client exiting]
jhass has joined #ruby
sameerynho has quit [Ping timeout: 245 seconds]
dbz_ has quit [Ping timeout: 276 seconds]
darkwingchuck has joined #ruby
darkwingchuck has quit [Ping timeout: 240 seconds]
mynameisdebian has joined #ruby
<mynameisdebian> baweaver, thanks for all your help yesterday
blackmesa1 has joined #ruby
thebananaking has joined #ruby
SzeregowyPosel has quit [Quit: Bye Bye]
<mynameisdebian> I am working on an app for my work. My boss wants me to do various kinds of testing, some to catch when my code breaks down the line, and some to catch when the upstream DB I am reading from changes. I don't have any experience with testing in general. I have heard of unit testing and various Ruby testing suites, but I'm not 100% either of those relate to the matter at hand. Should I be using unit testing or a testing suite for this, and can anyone
<mynameisdebian> recommend a guide somewhere that will bring me up to speed on what kinds of things should be tested and how?
bradleyprice has quit [Remote host closed the connection]
xarthna_ has quit [Ping timeout: 268 seconds]
tpanarch1st has quit [Ping timeout: 240 seconds]
dbz_ has joined #ruby
nowhere_man has quit [Ping timeout: 276 seconds]
wickedbloodfart has joined #ruby
cloaked1 has quit [Ping timeout: 240 seconds]
wickedbloodfart has quit [Client Quit]
eljimmy has quit [Quit: This computer has gone to sleep]
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
cyclonis_ has joined #ruby
eljimmy has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
cyclonis has quit [Ping timeout: 268 seconds]
eljimmy has quit [Client Quit]
tpanarch1st has joined #ruby
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
eljimmy has quit [Client Quit]
CableNinja_ has quit [Ping timeout: 240 seconds]
<Iambchop> mynameisdebian: there is a "testing" section in the books link linked from the channel topic https://goo.gl/wpGhoQ
<mynameisdebian> Iambchop, meant to thank you too
<mynameisdebian> also thanks
Axy has quit [Read error: Connection reset by peer]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
frem has quit [Quit: Connection closed for inactivity]
xGrind has quit [Quit: Saindo]
fphilipe has joined #ruby
cyclonis_ has quit [Quit: -a- IRC for Android 2.1.55]
cyclonis has joined #ruby
ExoUNX has quit [Quit: later fam...]
AJA4350 has quit [Ping timeout: 240 seconds]
SzeregowyPosel has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
Mia has quit [Read error: Connection reset by peer]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Intelo has quit [Ping timeout: 240 seconds]
darkwingchuck has joined #ruby
Mia has quit [Read error: Connection reset by peer]
<Frankenstein> is there a good light-weight migrations tool for a non-rails project?
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
darkwingchuck has quit [Ping timeout: 240 seconds]
Ai9zO5AP has quit [Quit: WeeChat 2.5]
gorsuch has joined #ruby
drincruz has joined #ruby
dbz_ has quit [Remote host closed the connection]