snguyen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
jbrhbr1 has joined #ruby
jbrhbr has quit [Ping timeout: 265 seconds]
<nkwsy>
so I have a question on parcing text. I am using mechanize to parse a table, I use table = page.at("table.ticketList").text.partition(" ") and I get the full list of stuff, titles and all. Now how can I pull the table data in a format where I can put it through to a csv. the pages I am parcing will vary in rows and such.
<shevy>
hmm if autoload will be removed in ruby 3.0, what alternative way should be done? plain old require?
dlitvak has quit [Ping timeout: 240 seconds]
<zenspider>
nkwsy: .text.partition(" ") ??
<zenspider>
what's that about?
blt has quit [Remote host closed the connection]
<nkwsy>
it makes it a bit neater in the cmdline, but not nessisary
samgerber has quit [Remote host closed the connection]
solocshaw has joined #ruby
mistermocha has quit [Ping timeout: 260 seconds]
zenlot1 has joined #ruby
<zenspider>
nkwsy: mechanize has already parsed your page. when you access via #at, you get the node at that level/tag/whatever. you're done. By asking for the text, you're essentially UN-parsing it
zenlot has quit [Ping timeout: 246 seconds]
<nkwsy>
how could I separate it so that I can put it into a DB or csv
charliesome has joined #ruby
jcdesimp_ has joined #ruby
InvGhostt has quit [Ping timeout: 260 seconds]
marr has quit [Read error: Connection reset by peer]
marr has joined #ruby
jcdesimp has quit [Ping timeout: 260 seconds]
Eising has quit [Ping timeout: 260 seconds]
nateberkopec has quit [Ping timeout: 260 seconds]
sugardrunk has quit [Ping timeout: 245 seconds]
Eising has joined #ruby
sugardrunk has joined #ruby
samgerber has joined #ruby
sluukkonen has quit [Ping timeout: 260 seconds]
Coldblackice has quit [Ping timeout: 250 seconds]
sluukkonen has joined #ruby
<nkwsy>
I guess it wouldnt really have to do with mechanize once I parced it. but I want to separate it and define parts to throw in a database
Coldblackice has joined #ruby
rgtk has quit [Remote host closed the connection]
<hxegon>
nkwsy parsed* what format is it in once it is parsed? array of arrays?
<dwfait>
From what I can tell, it’s of type ID which is typedef’d as uintptr_t, like VALUE, and I was expecting it to be defined as a #DEFINE or an enum, but my searches of the codebase have failed me
<dwfait>
and lldb can’t evaluate it on a breakpoint on that line
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
dr3w has joined #ruby
emilkarl has joined #ruby
colli5ion has joined #ruby
colli5ion has quit [Max SendQ exceeded]
colli5ion has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
colli5ion has quit [Client Quit]
dlitvak has joined #ruby
andikr has joined #ruby
colegatron has quit [Ping timeout: 246 seconds]
dr3w has quit [Ping timeout: 256 seconds]
cajone is now known as cajone_afk
jschmid has joined #ruby
colegatron has joined #ruby
andywojo has joined #ruby
blackmesa has joined #ruby
idefine has joined #ruby
dlitvak has quit [Ping timeout: 272 seconds]
rodfersou has joined #ruby
WeiJunLi has joined #ruby
andywojo has quit [Ping timeout: 264 seconds]
idefine has quit [Ping timeout: 265 seconds]
idefine has joined #ruby
chthon has joined #ruby
waka has quit [Ping timeout: 272 seconds]
jschmid has quit [Ping timeout: 272 seconds]
idefine has quit [Ping timeout: 256 seconds]
ruu_ has quit [Remote host closed the connection]
monthy has joined #ruby
wolffles has quit [Quit: wolffles]
joonty has quit [Quit: joonty]
ElFerna has joined #ruby
auzty has quit [Quit: Leaving]
puria has quit [Ping timeout: 245 seconds]
FernandoBasso has joined #ruby
joonty has joined #ruby
celly has joined #ruby
idefine has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
lyoshajapan has quit [Remote host closed the connection]
atomical has joined #ruby
DaniG2k has joined #ruby
drptbl has joined #ruby
senayar has joined #ruby
waka has joined #ruby
celly has quit [Ping timeout: 240 seconds]
qiukun has joined #ruby
<qiukun>
hi
<qiukun>
how do you parse the log logging logged?
lyoshajapan has joined #ruby
<adaedra>
What do you call "the log logging logged"?
idefine has quit [Ping timeout: 256 seconds]
<DefV>
did you log the logged loggong the log logged?
<qiukun>
the log logging module logged
<qiukun>
the log which the module logging logged
lictor36 has quit [Quit: lictor36]
<qiukun>
oh, sorry, im talking about python
<DefV>
well my friend, there's a channel for that
<qiukun>
DefV, tks
idefine has joined #ruby
dr3w has joined #ruby
tomphp has joined #ruby
Ishido has joined #ruby
idefine has quit [Ping timeout: 256 seconds]
puria has joined #ruby
arup_r has joined #ruby
dwfait_ has joined #ruby
dwfait has quit [Read error: Connection reset by peer]
dwfait_ is now known as dwfait
dr3w has quit [Ping timeout: 265 seconds]
nfk|laptop has joined #ruby
joonty has quit [Quit: joonty]
dwfait has quit [Client Quit]
joonty has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lyoshajapan has quit [Remote host closed the connection]
codecop has joined #ruby
M-prosodyContext has quit [Remote host closed the connection]
M-Kodo has quit [Remote host closed the connection]
M-mistake has quit [Read error: Connection reset by peer]
M-shine has quit [Remote host closed the connection]
Asher has quit [Read error: Connection reset by peer]
Asher1 is now known as Asher
pawnbox has joined #ruby
agent_white has quit [Quit: goodnight]
idefine has joined #ruby
freerobby has joined #ruby
kobain has joined #ruby
ElFerna has quit [Ping timeout: 240 seconds]
idefine_ has joined #ruby
senayar has quit [Remote host closed the connection]
tricon_ has joined #ruby
Tricon has quit [Read error: Connection reset by peer]
senayar has joined #ruby
idefine has quit [Ping timeout: 255 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
bronson has joined #ruby
idefine_ has quit [Ping timeout: 256 seconds]
j2k has quit [Quit: bai]
FooMunki has joined #ruby
j2k has joined #ruby
p0wn3d_ has joined #ruby
sankaber has joined #ruby
pawnbox has quit [Ping timeout: 250 seconds]
dotix has quit [Remote host closed the connection]
chouhoulis has joined #ruby
dotix has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
silverdust has joined #ruby
<silverdust>
What's the difference between Foo::bar and Foo.bar ?
scepticulous has joined #ruby
<silverdust>
My guess is Foo::bar has a static bar method but I don't even know if that exists in ruby
InvGhostt has quit [Read error: No route to host]
yes`r has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
dotix has quit [Ping timeout: 255 seconds]
chouhoulis has quit [Ping timeout: 272 seconds]
<norc>
apeiros: Ah, so it was a buggy brew package?
dotix has joined #ruby
millerti has joined #ruby
andywojo has joined #ruby
krz has quit [Ping timeout: 240 seconds]
DoubleMalt has joined #ruby
idefine has joined #ruby
prestorium has joined #ruby
idefine_ has joined #ruby
andywojo has quit [Ping timeout: 260 seconds]
<norc>
silverdust: tCOLON2 also provides you with access to the constants table of a class.
idefine has quit [Ping timeout: 255 seconds]
<norc>
Also you have tCOLON3, like: ::Array
idefine_ has quit [Ping timeout: 256 seconds]
last_staff has quit [Quit: last_staff]
<shevy>
silverdust in your case, when it is bar and not Bar, there should not be any difference between either variants, you call a class/module method in both cases
rippa has joined #ruby
<shevy>
silverdust now if it would be Foo::Bar or Foo.Bar it could either be a method or a constant (in the first case, for a constant, the second would always be a method call)
<claw>
hey guys
<norc>
shevy: And that is a shorthand for Object:: I think.
<claw>
How to : "C61810AC" => ["C6", "18", "10", "AC"] ?
ElFerna has joined #ruby
<claw>
any nice solution for this ?
<claw>
couldn't find anything mostly because i dont know how to name it
the_nick_me has quit [Remote host closed the connection]
prosody has left #ruby [#ruby]
synthroid has joined #ruby
<norc>
?guys claw
<ruboto>
claw, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<norc>
claw: Dont think there is a more elegant way than str.scan(/../) :)
puria has joined #ruby
atomical has joined #ruby
<claw>
scan is perfect thank you norc
Coldblackice has quit [Ping timeout: 240 seconds]
dotix has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
millerti has quit [Client Quit]
<norc>
claw: Depending on what you intend to do, String#unpack might also be of interest to you.
cassioscabral has joined #ruby
djbkd has joined #ruby
Kn|t3 has joined #ruby
lxsameer has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
idefine has joined #ruby
ElFerna has quit [Quit: WeeChat 1.3]
dionysus69 has joined #ruby
deuterium has quit [Ping timeout: 250 seconds]
big|bad|wolf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
shanemcd has joined #ruby
d0nn1e has quit [Ping timeout: 265 seconds]
idefine has quit [Ping timeout: 256 seconds]
d0nn1e has joined #ruby
emilkarl has joined #ruby
moeabdol has joined #ruby
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freerobby has quit [Quit: Leaving.]
bkxd has quit [Ping timeout: 260 seconds]
sigurding has joined #ruby
cajone_afk is now known as cajone
shanemcd has quit [Ping timeout: 246 seconds]
prestorium has quit [Quit: Leaving]
skade has joined #ruby
idefine has joined #ruby
krz has joined #ruby
FooMunki has quit [Quit: FooMunki]
prestorium has joined #ruby
FooMunki has joined #ruby
Kn|t3 has quit [Quit: Kn|t3]
shanemcd_ has joined #ruby
prestorium has quit [Client Quit]
millerti has joined #ruby
idefine has quit [Ping timeout: 265 seconds]
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
prestorium has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
freerobby has joined #ruby
adgtl has quit [Remote host closed the connection]
dotix has joined #ruby
big|bad|wolf has joined #ruby
millerti has joined #ruby
yes`r has joined #ruby
dstarh has joined #ruby
AlphaAtom has joined #ruby
bweston92 has quit [Ping timeout: 256 seconds]
arup_r has quit [Remote host closed the connection]
duckpuppy has joined #ruby
idefine has joined #ruby
chouhoulis has joined #ruby
blackgoat has quit [Quit: WeeChat 1.3]
celly has joined #ruby
elaptics is now known as elaptics`away
idefine has quit [Ping timeout: 255 seconds]
SenpaiSilver has joined #ruby
chouhoulis has quit [Ping timeout: 256 seconds]
ramortegui has joined #ruby
Bloomer has joined #ruby
celly has quit [Ping timeout: 240 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bweston92 has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
millerti has joined #ruby
millerti has quit [Client Quit]
dr3w has joined #ruby
tildes has quit [Remote host closed the connection]
ElFerna has joined #ruby
stannard has joined #ruby
hectortrope has joined #ruby
adgtl has joined #ruby
adgtl has quit [Remote host closed the connection]
adgtl has joined #ruby
dr3w has quit [Ping timeout: 246 seconds]
cornerma1 has joined #ruby
stannard has quit [Remote host closed the connection]
cornerman has quit [Ping timeout: 240 seconds]
cornerma1 is now known as cornerman
zanzarel has joined #ruby
zanzarel has left #ruby [#ruby]
idefine has joined #ruby
Kn|t3 has joined #ruby
yes`r has quit [Read error: Connection reset by peer]
yeshacker has joined #ruby
the_nick_me has joined #ruby
zotherstupidguy has joined #ruby
arup_r has joined #ruby
psy_ has quit [Ping timeout: 250 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roger_rabbit has quit [Ping timeout: 276 seconds]
idefine has quit [Ping timeout: 264 seconds]
PedramT has joined #ruby
elaptics`away is now known as elaptics
ElFerna has quit [Ping timeout: 240 seconds]
djbkd has quit [Remote host closed the connection]
aryaching has joined #ruby
idefine has joined #ruby
davejlong has joined #ruby
ElFerna has joined #ruby
hagabaka has quit [Ping timeout: 256 seconds]
the_nic__ has joined #ruby
bkxd has joined #ruby
iateadonut has joined #ruby
freerobby has quit [Quit: Leaving.]
idefine has quit [Ping timeout: 264 seconds]
voxxit has joined #ruby
the_nick_me has quit [Ping timeout: 240 seconds]
puria has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
BSaboia has joined #ruby
idefine has joined #ruby
sankaber has quit [Remote host closed the connection]
flori has quit [Ping timeout: 245 seconds]
sankaber has joined #ruby
djbkd has joined #ruby
flori has joined #ruby
shanemcd has joined #ruby
Sebastia1Thorn is now known as SebastianThorn
jokester has joined #ruby
babblebre has joined #ruby
joonty has quit [Quit: joonty]
the_nic__ has quit [Remote host closed the connection]
anisha has quit [Quit: Leaving]
idefine has quit [Ping timeout: 264 seconds]
shanemcd_ has quit [Ping timeout: 272 seconds]
TheBloke is now known as TheBloke-
joonty has joined #ruby
krobzaur has joined #ruby
chussenot has quit [Quit: chussenot]
ascarter has joined #ruby
mekekem is now known as elemeken
futilegames has joined #ruby
idefine_ has joined #ruby
chussenot has joined #ruby
rodfersou is now known as rodfersou|lunch
achamian has joined #ruby
adgtl has quit [Remote host closed the connection]
krobzaur has quit [Ping timeout: 245 seconds]
TheBloke- is now known as TheBloke
idefine_ has quit [Ping timeout: 260 seconds]
davejlong has quit []
<shevy>
hmm if I have a big hash, is there a simple way to do a hash-to-SQL conversion? such as a standalone .sqlite database?
joneshf-laptop has quit [Ping timeout: 272 seconds]
dotix has quit [Remote host closed the connection]
adgtl has joined #ruby
adgtl has joined #ruby
nfk|laptop has quit [Ping timeout: 255 seconds]
zapata has quit [Ping timeout: 240 seconds]
krobzaur has joined #ruby
idefine has joined #ruby
chouhoulis has joined #ruby
freerobby has joined #ruby
big|bad|wolf has quit [Max SendQ exceeded]
momomomomo has joined #ruby
hectortrope has quit [Remote host closed the connection]
Rodya_ has joined #ruby
achamian has quit []
Kn|t3 has quit [Quit: Kn|t3]
<norc>
shevy: hash-to-SQL?
tagrudev has quit [Remote host closed the connection]
Encapsulation has joined #ruby
<norc>
You mean like what AR does`?
<norc>
If you just want to write out a Hash to a file, use Marhsal.
<norc>
Marshal even.
jcdesimp has joined #ruby
idefine has quit [Ping timeout: 240 seconds]
stannard has joined #ruby
chouhoulis has quit [Ping timeout: 276 seconds]
hectortrope has joined #ruby
<shevy>
hmm
whippythellama has joined #ruby
dotix has joined #ruby
duckpuppy has quit [Ping timeout: 246 seconds]
andywojo has joined #ruby
idefine has joined #ruby
stannard has quit [Ping timeout: 265 seconds]
jcdesimp has quit [Ping timeout: 255 seconds]
cassioscabral has quit [Quit: cassioscabral]
learnme_ has joined #ruby
mary5030 has joined #ruby
cassioscabral has joined #ruby
krz has quit [Read error: Connection reset by peer]
duckpuppy has joined #ruby
andywojo has quit [Ping timeout: 276 seconds]
idefine has quit [Ping timeout: 256 seconds]
mdw has quit [Quit: Sleeping Zzzzz]
cassioscabral has quit [Client Quit]
theRouS is now known as theRoUS
cassioscabral has joined #ruby
arup_r has quit [Remote host closed the connection]
symm- has joined #ruby
ferr has quit [Ping timeout: 264 seconds]
arup_r has joined #ruby
blackmesa has joined #ruby
davejlong has joined #ruby
cassioscabral_ has joined #ruby
davedev24 has joined #ruby
PedramT_ has joined #ruby
davedev2_ has quit [Ping timeout: 260 seconds]
arup___ has joined #ruby
PedramT_ has quit [Remote host closed the connection]
cassioscabral has quit [Ping timeout: 245 seconds]
cassioscabral_ is now known as cassioscabral
n0vo has joined #ruby
shanemcd has quit [Remote host closed the connection]
shanemcd has joined #ruby
nettoweb has joined #ruby
davedev2_ has joined #ruby
arup_r has quit [Ping timeout: 265 seconds]
PedramT has quit [Ping timeout: 265 seconds]
drys has joined #ruby
stannard has joined #ruby
stannard has quit [Remote host closed the connection]
stannard has joined #ruby
shanemcd_ has joined #ruby
cassioscabral has quit [Quit: cassioscabral]
iateadonut has quit [Quit: Leaving.]
davedev24 has quit [Ping timeout: 250 seconds]
Kn|t3 has joined #ruby
codecop has quit [Remote host closed the connection]
shanemcd has quit [Ping timeout: 255 seconds]
cassioscabral has joined #ruby
krz has joined #ruby
djbkd_ has joined #ruby
idefine has joined #ruby
idefine_ has joined #ruby
curses has quit []
ta has quit [Remote host closed the connection]
jnj has joined #ruby
djbkd_ has quit [Ping timeout: 265 seconds]
Encapsulation is now known as Encapsulate
idefine has quit [Ping timeout: 256 seconds]
idefine_ has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
BSaboia has quit [Ping timeout: 256 seconds]
bronson has joined #ruby
Kn|t3 has quit [Quit: Kn|t3]
gambl0re has quit [Ping timeout: 240 seconds]
<jnj>
I'm learning ruby and I'm trying to implement a singly linked list but I'm running issues with my contains? function. For my while loop it checks to see if the current nodes element(elt) is equal to the given elt, and check to see if its not null and if both are true then the cursor moves onto the next element. So if you give it an element that is not contained in the list, then eventually the cursor will become nil so when I check to see if it's element is equal
<jnj>
to the given element I get undefined method error
zapata has joined #ruby
rodfersou|lunch has quit [Quit: leaving]
idefine has joined #ruby
<ljarvis>
jnj: could you show your code?
<apeiros>
norc: not sure what it effectively was. but starting over and not having 2 installations helped.
bkxd has quit [Ping timeout: 265 seconds]
ramfjord has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
<jnj>
ljarvis: Sure, but also I just fixed it haha. Turned out my while loop checked to see if the cursor's elt was equal to the given elt and then checking if it was nil, when I switched it around it worked
<mustmodify>
I have medical tests that are graded on a college-four-point-scale. 0 = F, 4 = A. Tests are grouped into sections, and we provide a GPA for each section, and, obviously, a grade. Just realized I'm calculating the average once in javascript and once in Ruby. Anyone have any experience with float math on both? I know that floats suck, but do they suck differently in JS vs Ruby? Could I end up with different averages?
karapetyan has quit [Remote host closed the connection]
<jnj>
thanks guys!
<adaedra>
grmbl.
adaedra has quit [Quit: Au revoir]
<jnj>
how would i implement my linked list with each? Should I just switch to using an array or collection instead of the ndoes? Or could I pass the nodes into each?
joonty has quit [Quit: joonty]
<jnj>
Or should I pass the nodes into a collection?
celly has quit [Ping timeout: 260 seconds]
adaedra has joined #ruby
<adaedra>
Sorry for the mess -_-
<adaedra>
jnj: you should pass each node, one by one
B1n4r10 has joined #ruby
monthy has quit [Remote host closed the connection]
<adaedra>
Each node value, in fact
stevenxl has joined #ruby
stevenxl has quit [Changing host]
stevenxl has joined #ruby
djbkd has quit [Quit: Leaving...]
<ljarvis>
jnj: something like this: https://eval.in/489255 probably not how I'd write each if I thought about it properly but you get the idea
<ljarvis>
it also means you can just add methods simple like this now: def contains?(value); to_a.include?(value); end
<adaedra>
Once you include Enumerable
<jnj>
Ah ok, I'll definitely switch to that
<ljarvis>
you dont need to actually for to_s, but yeah
<ljarvis>
to_a*
<ljarvis>
er ignore me
<adaedra>
Look at Enumerable doc to see all the methods implemented for you!
chouhoulis has joined #ruby
<ljarvis>
was thinking of .each.to_a :)
<jnj>
ljarvis: I'm still not sure what you meant earlier when you said that if I'm using reading, what is reading?
yonatankoren_ is now known as yonatankoren
<ljarvis>
jnj: I meant if you're using a reader
<ljarvis>
i.e attr_reader or attr_accessor
<ljarvis>
sorry, sometimes I type bad
<jnj>
OH, ok~
<jnj>
it's all good!
colegatron has quit [Ping timeout: 264 seconds]
<jnj>
ljarvis: So I can replace all @head, and @tail with just head, tail?
gizmore has joined #ruby
<ljarvis>
jnj: yep, except the assignments of course
<jnj>
ah, ok!
<jnj>
the assignments in the initializer right?
<ljarvis>
correct
podman has joined #ruby
ruby-lang407 has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
arup_r has joined #ruby
adgtl has quit []
karapetyan has quit [Remote host closed the connection]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
jessemcgilallen has joined #ruby
Guest8157 is now known as saneax_AFK
atomical has joined #ruby
karapetyan has joined #ruby
idefine_ has joined #ruby
<jnj>
What is a good resource to cover all ruby syntax, and maybe something that does comparisons with java?
<adaedra>
there's a cheatsheet somewhere
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
jessemcgilallen has quit [Client Quit]
<adaedra>
?cheatsheet
karapetyan has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
rgtk has quit [Remote host closed the connection]
pawnbox has joined #ruby
<jnj>
Does anyone know a good resource that'll teach you all things ruby but it's geared towards people that already know how to program? I keep on finding tutorials that assume I've never programmed before
djbkd has joined #ruby
<ljarvis>
jnj: honestly reading code will probably the best thing
karapety_ has quit [Remote host closed the connection]
Dimik has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
certainty has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Spami has joined #ruby
theRealGent has joined #ruby
kmckelvi1 has quit [Ping timeout: 265 seconds]
przemoskPL has joined #ruby
benlieb has joined #ruby
edwinvdgraaf has quit [Ping timeout: 264 seconds]
theRealGent has quit [Client Quit]
zeroDivisible has joined #ruby
Jardayn has joined #ruby
RickHull has quit [Ping timeout: 255 seconds]
shanemcd has joined #ruby
przemoskPL has quit [Remote host closed the connection]
certainty has quit [Ping timeout: 265 seconds]
renderfu_ has quit [Read error: Connection reset by peer]
centrx has joined #ruby
renderfu_ has joined #ruby
LetItSnow-y has quit [Remote host closed the connection]
adgtl has joined #ruby
moeabdol has joined #ruby
mark2 has quit [Remote host closed the connection]
momomomomo has joined #ruby
ibouvousaime has joined #ruby
gambl0re has quit [Read error: Connection reset by peer]
gambl0re has joined #ruby
agit0 has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jds has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
Rodya_ has quit [Quit: Leaving...]
cpup has quit [Ping timeout: 255 seconds]
sigurding has quit [Quit: sigurding]
shanemcd_ has joined #ruby
zapiano has quit [Quit: WeeChat 1.3]
cpup has joined #ruby
sneakerhax has joined #ruby
renderfu_ has quit [Read error: Connection reset by peer]
renderfu_ has joined #ruby
domypy has joined #ruby
eytanfb has joined #ruby
domypy has left #ruby [#ruby]
Phage- has left #ruby [#ruby]
davedev24 has joined #ruby
shanemcd_ has quit [Ping timeout: 250 seconds]
davedev2_ has quit [Ping timeout: 250 seconds]
elaptics is now known as elaptics`away
adgtl has quit [Remote host closed the connection]
adgtl has joined #ruby
adgtl has quit [Client Quit]
adgtl has joined #ruby
adgtl has quit [Changing host]
adgtl has joined #ruby
bronson has joined #ruby
kmckelvi1 has joined #ruby
prestorium has quit [Quit: Leaving]
jbrhbr has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
harrison_ has joined #ruby
hectortrope has joined #ruby
jbrhbr has quit [Client Quit]
harrison_ has left #ruby ["Leaving"]
agit0 has quit [Quit: zzzZZZ….]
dotix has quit [Remote host closed the connection]
ruby-noob has joined #ruby
adgtl has quit [Remote host closed the connection]
mostlybadfly has joined #ruby
dorei has joined #ruby
gmci has joined #ruby
Bloomer has quit [Remote host closed the connection]
<ruby-noob>
I have a set of report classes that essentially follow the interface of building a report (i.e. having a report instance method that returns a hash). Do ruby programmers have an agreed way of making this pattern explicit (via modules or inheritance) or am I not breaking free from my static typing roots?
the_nick_me has quit [Remote host closed the connection]
jbrhbr has joined #ruby
learnme_ has quit [Quit: Page closed]
certainty has joined #ruby
centrx has quit [Remote host closed the connection]
karmatr0n has quit [Remote host closed the connection]
hectortrope has quit [Quit: WeeChat 0.4.2]
centrx has joined #ruby
krz has quit [Ping timeout: 246 seconds]
colegatron has quit [Ping timeout: 245 seconds]
Anderson69s has joined #ruby
jamto11 has joined #ruby
certainty has quit [Ping timeout: 255 seconds]
Dimik has quit [Ping timeout: 245 seconds]
davedev2_ has joined #ruby
momomomomo has quit [Quit: momomomomo]
spider-mario has joined #ruby
davedev__ has joined #ruby
davedev24 has quit [Ping timeout: 240 seconds]
nettoweb has joined #ruby
ibouvousaime has quit [Ping timeout: 250 seconds]
davedev2_ has quit [Ping timeout: 250 seconds]
<shevy>
what "pattern"
davedev24 has joined #ruby
ashemark has joined #ruby
ibouvousaime has joined #ruby
freerobby has quit [Quit: Leaving.]
davedev__ has quit [Ping timeout: 250 seconds]
A124 has joined #ruby
jottr has joined #ruby
<apeiros>
ruby-noob: we don't have patterns to enforce it. we only have patterns to make use of something like that. i.e. cf. Enumerable module which depends on the presence of "each".
freerobby has joined #ruby
colegatron has joined #ruby
arup_r has quit []
duckpuppy has quit [Ping timeout: 260 seconds]
dotix has joined #ruby
skooks has quit [Read error: No route to host]
shanemcd has quit [Read error: Connection reset by peer]
ruu_ has quit [Remote host closed the connection]
Neronfapper has joined #ruby
<Neronfapper>
Hey guise
karapetyan has joined #ruby
jbrhbr has quit [Quit: Leaving.]
build22 has joined #ruby
shanemcd has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
ohaibbq has joined #ruby
ico has joined #ruby
skade has joined #ruby
djbkd_ has joined #ruby
nkwsy has joined #ruby
adgtl has joined #ruby
adgtl has quit [Changing host]
adgtl has joined #ruby
djbkd_ has quit [Ping timeout: 264 seconds]
bkxd has joined #ruby
symm- has quit [Quit: Leaving...]
adgtl has quit [Ping timeout: 256 seconds]
jamto11 has quit []
darkf has quit [Quit: Leaving]
ruu_ has joined #ruby
inferno5677 has joined #ruby
djbkd has quit [Quit: My people need me...]
baroquebobcat has joined #ruby
ashemark has quit [Ping timeout: 260 seconds]
slackbotgz has joined #ruby
andywojo has joined #ruby
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 264 seconds]
hxegon has joined #ruby
agentmeerkat has joined #ruby
Neronfapper has quit [Quit: Bye]
aryaching has quit [Remote host closed the connection]
build22 has quit [Remote host closed the connection]
Neronfapper has joined #ruby
aryaching has joined #ruby
rubynoobie has joined #ruby
mistermocha has joined #ruby
freerobby has quit [Quit: Leaving.]
andywojo has quit [Ping timeout: 256 seconds]
domgetter has joined #ruby
atomical has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
TheMoonMaster has quit [Ping timeout: 255 seconds]
dotix has quit [Remote host closed the connection]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TheMoonMaster has joined #ruby
rikkipitt has joined #ruby
ElFerna has joined #ruby
Coldblackice has joined #ruby
quesker_ has joined #ruby
jnj has joined #ruby
colegatron has quit [Ping timeout: 246 seconds]
andrew9184 has joined #ruby
<andrew9184>
anyone know how I should debug errors with this message: "\xEC" on US-ASCII
quesker has quit [Read error: Connection reset by peer]
<domgetter>
havenwood: Using lambdas for transducers is also faster than Cognitect's transducer gem
<shevy>
will we make it to a new ruby release in 2 days?
<shevy>
andrew9184 that is some encoding related issue isn't it?
fullofca_ has quit [Remote host closed the connection]
<andrew9184>
not sure. i’m basically just using rest-client to make api calls
fullofcaffeine has joined #ruby
celly has joined #ruby
<adaedra>
you may want to add a little more context, andrew9184. Libraries used, maybe some code.
<apeiros>
andrew9184: us-ascii is the wrong encoding
jbrhbr has joined #ruby
<apeiros>
andrew9184: us-ascii is only bytes 0x00-0x7f
<adaedra>
that looks like it's only a symptom tho.
<apeiros>
if you say you use rest-api, then you probably use something json based? then it'd be required to be utf-8.
<andrew9184>
ah I see, thanks for the suggestions — looking into it
<apeiros>
if it's not json based, then make sure you come back with more infos.
celly has quit [Ping timeout: 272 seconds]
<jnj>
So I've implemented my linked list using the enumerator interface (makes things so much easier), now I'm trying to traverse the list in reverse order using reverse_each. It prints out the list in reverse order but instead of ending with => nil in irb, it ends with => #<Enumerator: #<SinglyLinkedList:0x007ff06900ec98 @head=#<Node:0x007ff069009360 @element="a", @next_node=#<Node:0x007ff069001890 @element="b", @next_node=nil>>, @tail=#<Node:0x007ff069001890 @element
<jnj>
="b", @next_node=nil>>:each>
<jnj>
Why is that?
crime has joined #ruby
<adaedra>
can you share the revised code?
certainty has joined #ruby
<domgetter>
jnj: presumably the last thing you enumerated over was the head of the list, not the tail. Your tail is nil
ico has quit [Remote host closed the connection]
<domgetter>
or, your tail's next_node is nil, anyway
<shevy>
hanmac I wonder if they would sue ruby if ruby-people have old ruby versions on their machine as well
colegatron has joined #ruby
ico has quit [Read error: Connection reset by peer]
<domgetter>
shevy: Don't give them any ideas
<adaedra>
jnj: now that you've defined #each, you can just include Enumerable, you know :p
<jnj>
One of my professors this semester said that Oracle is basically 80% lawyers and 20% programmers
ico has joined #ruby
jessemcgilallen has joined #ruby
<domgetter>
jnj: if you include Enumerable, and you define an #each method, ruby will leverage your #each method to do all the other enumerable methods for your class
<jnj>
adaedra: Ah, ok. Does that mean I write require enumerable up top? (I'm thinking of include enumerable like an import)
karapetyan has quit [Remote host closed the connection]
djbkd has joined #ruby
<jnj>
domgetter: Does that mean that Enumerable's delete will work? Or would I have to implement my own?
<jnj>
dogmetter: Haha, I feel liked an idiot I did it without the hash and got a ton of errors
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ico has quit [Read error: Connection reset by peer]
<adaedra>
All the methods of Enumerable should work. Note that things returning a new collection, like #map, will return an Array, not an instance of your class.
<jnj>
Also, just wanted to say thanks for helping me out. You guys are making ruby my new favorite langauge
<domgetter>
No problem, I'm glad you're learning :)
djellemah_ has quit [Ping timeout: 276 seconds]
ico has joined #ruby
<adaedra>
jnj: what you're doing here is a 'mix-in': you have methods defined in a module and copy them in your own class.
Hounddog has quit [Read error: Connection reset by peer]
mistermocha has quit [Ping timeout: 256 seconds]
cassioscabral has quit [Read error: Connection reset by peer]
<jnj>
adaedra: So is this basically inheritance then, where Enumerator would be the parent class?
cassioscabral has joined #ruby
<jnj>
adaedra: Also, do I just call count as #count? It's showing as a comment
<adaedra>
Not exactly, as Enumerable (not Enumerator) is a module, so not instantiable
<adaedra>
No, you do .count
<adaedra>
"#count" means "the instance method count", but you call it with . on an instance
<domgetter>
jnj: You can do the same with the Comparable module. I did this with notes on a piano. If you define how two things compare when sorted, then you get a few methods for free.
dlitvak has quit [Ping timeout: 245 seconds]
<jnj>
oooh, ok so whenever it'
<jnj>
s #count, its really just .count? Gotcha
<crime>
# is notation for instance method of that object
<crime>
in code, its just a comment
<adaedra>
The method String#length is called by doing "string".length
Danishman has joined #ruby
stevenxl has quit [Quit: leaving]
nfk|laptop has joined #ruby
momomomomo has joined #ruby
<blub>
its so bad haha
<jbrhbr>
jake worth sure does like fixing typos
<adaedra>
?
<jbrhbr>
ruby core commits
duckpuppy has joined #ruby
ico has quit [Read error: Connection reset by peer]
koba has joined #ruby
ico has joined #ruby
snguyen has joined #ruby
jackjackdripper has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper1 has joined #ruby
agit0 has joined #ruby
jackjackdripper1 has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
jackjackdripper1 has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 246 seconds]
crime has quit [Ping timeout: 252 seconds]
symm- has joined #ruby
ur5us has joined #ruby
yqt has joined #ruby
blackmesa has joined #ruby
jmdade has joined #ruby
<jnj>
adaedra: Since enumerable has no mutating methods, that means that something like #drop would copy my linked list, then drop elements from the copy, but not the actual linked list, correct?
<adaedra>
no, just adding the kept elements to a new array and dropping directly the other ones
eytanfb has quit [Remote host closed the connection]
unreal_ has joined #ruby
kadoppe has quit [Ping timeout: 240 seconds]
ryxai has quit [Read error: Connection reset by peer]
<adaedra>
the fact that Enumerable is based on #each means that all its method sees are the values in order
Steve_Jobs has quit [Ping timeout: 244 seconds]
unreal has quit [Ping timeout: 250 seconds]
agit0 has quit [Quit: zzzZZZ….]
jottr has quit [Ping timeout: 240 seconds]
kadoppe has joined #ruby
cschneid_ has joined #ruby
djbkd_ has joined #ruby
<cschneid_>
I am Marshal.loading an object w/ an instance var (a Hash), no custom marshalling logic - any thoughts on why that hash would come back as nil? There's zero chance it was serialized as nil.
dlitvak has joined #ruby
dylanjhoulihan has joined #ruby
nateberkopec has quit [Quit: Leaving...]
mbeasley has joined #ruby
yfeldblum has joined #ruby
mbeasley has left #ruby [#ruby]
synthroid has quit [Remote host closed the connection]
<cschneid_>
oh, of course a minute after asking, it appears like an old version of the app is writing a slightly different name out to the file... :-/
mbeasley has joined #ruby
blaxter has quit [Ping timeout: 250 seconds]
djbkd_ has quit [Ping timeout: 260 seconds]
JakFrist has joined #ruby
_djbkd has joined #ruby
dotix has joined #ruby
Cihan has quit [Quit: Cihan]
robbyoconnor has quit [Read error: Connection reset by peer]
aryaching has quit []
CihanKaygusuz has joined #ruby
synthroid has joined #ruby
mbeasley has quit [Client Quit]
ico has quit [Read error: Connection reset by peer]
mbeasley has joined #ruby
mbeasley has quit [Client Quit]
ico has joined #ruby
aeipownu_ has quit [Ping timeout: 252 seconds]
djbkd has quit [Ping timeout: 245 seconds]
certainty has quit [Ping timeout: 256 seconds]
nateberkopec has joined #ruby
momomomomo has quit [Quit: momomomomo]
Vitor_ has quit [Ping timeout: 264 seconds]
dotix has quit [Remote host closed the connection]
_djbkd has quit [Ping timeout: 260 seconds]
ico has quit [Read error: Connection reset by peer]
devster31 has quit [Quit: cya]
ico has joined #ruby
djbkd has joined #ruby
stannard_ has joined #ruby
ElFerna has quit [Quit: WeeChat 1.3]
jackjackdripper1 has quit [Quit: Leaving.]
ElFerna has joined #ruby
freerobby has joined #ruby
jackjackdripper has joined #ruby
shanemcd_ has joined #ruby
eytanfb has joined #ruby
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
stannard has quit [Ping timeout: 245 seconds]
zotherstupidguy has quit [Quit: WeeChat 1.3]
PedramT has quit [Remote host closed the connection]
JakFrist has joined #ruby
baweaver has joined #ruby
shanemcd_ has quit [Ping timeout: 276 seconds]
ico has quit [Read error: Connection reset by peer]
JakFrist has quit [Client Quit]
ico has joined #ruby
DoubleMalt has quit [Ping timeout: 260 seconds]
duckpuppy has quit [Ping timeout: 245 seconds]
jessemcgilallen has quit [Quit: jessemcgilallen]
cyfr0n1 has joined #ruby
rikkipitt has quit [Quit: Leaving...]
devster31 has joined #ruby
unreal has joined #ruby
ta has quit [Remote host closed the connection]
arup_r has quit []
dlitvak has quit [Remote host closed the connection]
cyfr0n has quit [Ping timeout: 256 seconds]
Vitor has joined #ruby
ico has quit [Read error: Connection reset by peer]
lemur has joined #ruby
ico has joined #ruby
ico has quit [Read error: Connection reset by peer]
CihanKaygusuz has quit [Quit: CihanKaygusuz]
CihanKaygusuz has joined #ruby
ico has joined #ruby
jottr has joined #ruby
unreal_ has quit [Ping timeout: 240 seconds]
bronson has quit [Remote host closed the connection]
PedramT has joined #ruby
pandaant has quit [Remote host closed the connection]
kobain has quit [Ping timeout: 240 seconds]
baweaver has quit [Ping timeout: 264 seconds]
Dimik has joined #ruby
emilkarl has joined #ruby
rodfersou has quit [Quit: leaving]
nfk|laptop has quit [Ping timeout: 260 seconds]
yardenbar has quit [Ping timeout: 240 seconds]
eytanfb has quit [Remote host closed the connection]
lenwood has joined #ruby
nfk|laptop has joined #ruby
jds has quit [Quit: Connection closed for inactivity]
dlitvak has joined #ruby
DoubleMalt has joined #ruby
<domgetter>
adaedra: Unless each is defined not to take things in any particular order, like with Sets
dlitvak has quit [Remote host closed the connection]
skcin7 has joined #ruby
shanemcd has quit [Remote host closed the connection]
frem has joined #ruby
jessemcgilallen has joined #ruby
bkxd has joined #ruby
nfk|laptop has quit [Ping timeout: 276 seconds]
aevitas has joined #ruby
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hanmac has quit [Ping timeout: 260 seconds]
replay has joined #ruby
djbkd has joined #ruby
duckpuppy has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
bronson has joined #ruby
jessemcgilallen has quit [Ping timeout: 260 seconds]
devbug has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
freerobby has quit [Quit: Leaving.]
codecop has quit [Remote host closed the connection]
dagda1 has joined #ruby
ruby-noob has quit [Ping timeout: 252 seconds]
dlitvak has joined #ruby
aevitas has left #ruby [#ruby]
eytanfb has joined #ruby
kirun has joined #ruby
nfk|laptop has joined #ruby
Dimik has quit [Ping timeout: 264 seconds]
Shadyz has joined #ruby
akem has joined #ruby
allcentury has joined #ruby
dlitvak has quit [Ping timeout: 265 seconds]
Wsewolod has joined #ruby
hanmac has joined #ruby
jcdesimp has quit [Remote host closed the connection]
AnoHito has quit [Read error: Connection reset by peer]
rkazak has quit [Ping timeout: 272 seconds]
replay has quit [Ping timeout: 245 seconds]
dnewkerk has joined #ruby
snguyen has quit [Read error: Connection reset by peer]
Pumukel has joined #ruby
atomical has joined #ruby
kobain has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
ico has quit [Read error: Connection reset by peer]
dlitvak has joined #ruby
ico has joined #ruby
certainty has joined #ruby
dlitvak_ has joined #ruby
peeja has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has quit [Ping timeout: 255 seconds]
nfk|laptop has joined #ruby
<nkwsy>
I am parcing data with mechanize/nokogiri and putting it into a csv. I have a few things. how do I remove blank lines from csv? I am parcing like this doc.xpath('//table/tbody/tr').each do |row|
<nkwsy>
tarray = []
<nkwsy>
row.xpath('td[@class="bodytextsmall"]').each do |cell|
<nkwsy>
tarray << cell.text.strip
<nkwsy>
sorry for that
bronson has quit [Remote host closed the connection]
certainty has quit [Ping timeout: 264 seconds]
yeshacker has quit [Ping timeout: 256 seconds]
FernandoBasso has joined #ruby
andywojo has joined #ruby
<apeiros>
nkwsy: you reset the array on each iteration
PedramT has quit [Remote host closed the connection]
<nkwsy>
but <tr> is extreamly prevelant which returns like 40 blank lines before my data located at <td class='bodytextsmall'>
<apeiros>
ah, you have an inner loop…
dlitvak_ has quit [Remote host closed the connection]
ico has quit [Read error: Connection reset by peer]
<nkwsy>
interesting
jbrhbr has quit [Quit: Leaving.]
ico has joined #ruby
<apeiros>
I'd try to adapt the css, but you can always use .reject to remove rows which are empty
stevenxl has joined #ruby
<nkwsy>
okay ill try .reject
shanemcd has joined #ruby
celly has joined #ruby
ico has quit [Read error: Connection reset by peer]
yfeldblum has quit [Ping timeout: 260 seconds]
koba has quit [Ping timeout: 240 seconds]
dylanjho_ has joined #ruby
shanemcd_ has joined #ruby
ico has joined #ruby
freerobby has joined #ruby
emilkarl has quit [Quit: emilkarl]
jnj has quit [Quit: Leaving]
andywojo has quit [Ping timeout: 255 seconds]
ico has quit [Read error: Connection reset by peer]
<nkwsy>
how can I tell I have an inner loop?
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dylanjhoulihan has quit [Ping timeout: 272 seconds]
ico has joined #ruby
Neronfapper has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
ico has quit [Read error: Connection reset by peer]
celly has quit [Ping timeout: 276 seconds]
ico has joined #ruby
WeiJunLi has quit [Read error: Connection reset by peer]
shanemcd_ has quit [Ping timeout: 272 seconds]
<shevy>
foo.each {|bar| bar.each
gambl0re has quit [Ping timeout: 260 seconds]
unreal_ has joined #ruby
agent_white has joined #ruby
bubbys has quit [Ping timeout: 255 seconds]
andywojo has joined #ruby
dlitvak has joined #ruby
dagda1 has joined #ruby
unreal has quit [Ping timeout: 255 seconds]
lacuna has quit [Remote host closed the connection]
lemur has quit [Read error: Connection reset by peer]
Shadyz has quit [Ping timeout: 246 seconds]
bubbys has joined #ruby
blackgoat has joined #ruby
ruby-lang011 has joined #ruby
dlitvak has quit [Ping timeout: 260 seconds]
<ruby-lang011>
testing, can anyone see this?
<adaedra>
nobody, ruby-lang011.
sandstrom has quit [Quit: My computer has gone to sleep.]
<ruby-lang011>
thanks
kobain has quit [Read error: Connection reset by peer]
atomical_ has joined #ruby
p0wn3d_ has quit [Ping timeout: 245 seconds]
AnoHito has joined #ruby
akem has quit [Ping timeout: 240 seconds]
akem has joined #ruby
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
pwnd_nsfw has quit [Ping timeout: 240 seconds]
blackgoat has quit [Quit: WeeChat 1.3]
<ruby-lang011>
anyone familiar with the odin project?
lemur has joined #ruby
varunwachaspati has quit [Quit: Connection closed for inactivity]
akem has quit [Client Quit]
gizmore has quit [Remote host closed the connection]
<nkwsy>
now where would I add the .reject?
renderfu_ has quit [Read error: Connection reset by peer]
atomical has quit [Ping timeout: 256 seconds]
renderfu_ has joined #ruby
<nkwsy>
I put it after tarray << cell.text.strip.reject { |c| c.empty? }
dotix has joined #ruby
ruby-lang011 has quit [Quit: Page closed]
dotix_ has joined #ruby
ico has quit [Read error: Connection reset by peer]
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shanemcd has quit [Remote host closed the connection]
bubbys has quit [Ping timeout: 256 seconds]
<nkwsy>
I also did
<nkwsy>
cells = cell.reject { |c| c.empty? }
<nkwsy>
tarray << cells.text.strip
ico has joined #ruby
baweaver has quit [Ping timeout: 264 seconds]
atomical has joined #ruby
gizmore has joined #ruby
bijjr has joined #ruby
bubbys has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
nertzy has joined #ruby
cassioscabral has quit [Quit: cassioscabral]
last_staff has joined #ruby
beast has quit [Quit: Leaving]
blackgoat has joined #ruby
<shevy>
does it work or does it work
<shevy>
and - use a pastie
<shevy>
cell.reject! will be faster than .reject
atomical_ has quit [Ping timeout: 256 seconds]
dagda1 has joined #ruby
kobain has joined #ruby
crowell_ has joined #ruby
<nkwsy>
it does not work
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<shevy>
no
<shevy>
pastie
<nkwsy>
tab2.rb:20:in `block (2 levels) in <main>': undefined method `reject' for "9189531900":String (NoMethodError) from /Users/Dood/.gem/ruby/2.2.3/gems/nokogiri-1.6.7/lib/nokogiri/xml/node_set.rb:187:in `block in each' from /Users/Dood/.gem/ruby/2.2.3/gems/nokogiri-1.6.7/lib/nokogiri/xml/node_set.rb:186:in `upto'
<nkwsy>
from /Users/Dood/.gem/uby/2.2.3/gems/nokogiri-1.6.7/lib/nokogiri/xml/node_set.rb:186:in `e ach' from tab2.rb:19:in `block in <main>' from /Users/Dood/.gem/ruby/2.2.3/gems/nokogiri-1.6.7/lib/nokogiri/xml/node_set.rb:187:in `block in each' from /Users/Dood/.gem/ruby/2.2.3/gems/nokogiri-1.6.7/lib/nokogiri/xml/node_set.rb:186:in `upto' from /Users/Dood/.gem/ruby/2.2.3/gems/nokogiri-1.6.7/lib/nokogiri/xml/node_set
<nkwsy>
.rb:186:in `each' from tab2.rb:17:in `<main>'
<shevy>
pastie man
shanemcd has joined #ruby
<shevy>
not paste
<shevy>
you apply .reject onto a string; apply it on your array instead
<adaedra>
havenwood: that's hash['gah'] || hash['bah'], not really what he wanted?
ramfjord has joined #ruby
gizless has joined #ruby
Yzguy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood>
adaedra: Guess I read it wrong.
<adaedra>
(nvm the symbols)
<havenwood>
It's not pretty anyways!
dotix_ has quit [Remote host closed the connection]
ico has quit [Read error: Connection reset by peer]
<adaedra>
the advantage of %w[].any? is that it's trivial to add/remove cases.
<havenwood>
I retract. :)
ico has joined #ruby
krobzaur has quit [Ping timeout: 246 seconds]
nateberkopec has joined #ruby
shanemcd has joined #ruby
<havenwood>
I
yfeldblum has joined #ruby
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bubbys has quit [Ping timeout: 255 seconds]
<adaedra>
|
gizmore has quit [Ping timeout: 240 seconds]
bijjr has joined #ruby
atomical has joined #ruby
abronca has joined #ruby
moeabdol has quit [Ping timeout: 265 seconds]
eytanfb has quit [Remote host closed the connection]
shanemcd has quit [Remote host closed the connection]
<shevy>
I grew so fond of case x; when 'a','b','cdf',/ghi/
benlieb has quit [Ping timeout: 265 seconds]
bkxd has joined #ruby
ta has joined #ruby
sgambino has joined #ruby
<Papierkorb>
shevy: when String; ftw!
boorad420 has joined #ruby
benlieb has joined #ruby
minimalism has quit [Quit: minimalism]
minimalism has joined #ruby
ico has quit [Read error: Connection reset by peer]
Cihan_ has joined #ruby
gagrio has joined #ruby
ico_ has joined #ruby
<boorad420>
Hi friends, I'm trying to install a somewhat dated rails app, but I'm getting 'make' errors without much description when installing a common gem (json). Gist here: https://gist.github.com/RyanMorgan/dbf9feed77cca1e9aca0 Anyone got any suggestions? I've re-installed xcode and libxml2
elico has joined #ruby
bijjr has quit [Quit: bijjr]
bkxd has quit [Ping timeout: 240 seconds]
minimalism has quit [Client Quit]
<elico>
I want to create a 3 digit long number that starts with 001 and end in 999.
<elico>
I can use a range 1..999 to get the right number but is there a method to get it padded with 0? or Should I create it by myself?
minimalism has joined #ruby
<shevy>
elico if you only want '0' you can use rjust and ljust
<dorei>
elico: there's no point for a number to be padded, its string representation is padded
AlphaAtom has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
<elico>
dorei: I am using it as a string.. this is the main reason for that but I assumed it would be understood from my question..
<elico>
shevy: thanks!!
ElFerna has joined #ruby
ohaibbq has quit [Quit: Leaving...]
<elico>
shevy: this is what I was looking for!
<havenwood>
elico: For example: ('001'..'100').take 3 #=> ["001", "002", "003"]
last_staff has quit [Read error: Connection reset by peer]
maletor has joined #ruby
<havenwood>
elico: [*'001'..'100']
<elico>
havenwood: this is something I was never expecting!!!
<elico>
this is great!!
Cihan_ has quit [Quit: Updating details, brb]
d5sx43 has joined #ruby
build22 has joined #ruby
bronson has quit [Remote host closed the connection]
paha80 has joined #ruby
Cihan has quit [Quit: Cihan]
Pumukel has quit [Quit: ChatZilla 0.9.92 [Firefox 42.0/20151029151421]]
gizmore has joined #ruby
Cihan has joined #ruby
<shevy>
yeah havenwood knows the naughty tricks
gizmore|2 has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thisirs has quit [Ping timeout: 240 seconds]
eytanfb has joined #ruby
<elico>
shevy: I wrote more then one script in ruby but I always need to learn it back from 0.
build22_ has quit [Ping timeout: 245 seconds]
duckpuppy has quit [Ping timeout: 255 seconds]
bubbys has joined #ruby
<shevy>
I forget a lot of things as well
nertzy has joined #ruby
<shevy>
I keep tricks-o-bag I mean bag-o-tricks in some local files for easier access, but the [*'001'..'100'] trick I did not store yet
d5sx43 has quit [Client Quit]
gizless has quit [Ping timeout: 260 seconds]
jcdesimp has joined #ruby
<elico>
shevy: This is a great idea to store some of the tricks in some place.
<elico>
I have a local gitlab so I might use this for that.
<elico>
Yes!!!! 600+ links were created!!
duckpuppy has joined #ruby
ta has quit [Remote host closed the connection]
gizmore has quit [Ping timeout: 256 seconds]
last_staff has joined #ruby
<shevy>
:D
minimalism has quit [Quit: minimalism]
minimalism has joined #ruby
bradleyprice has joined #ruby
minimalism has quit [Client Quit]
cassioscabral has joined #ruby
minimalism has joined #ruby
build22_ has joined #ruby
build22 has quit [Read error: Connection reset by peer]
jcdesimp has quit [Ping timeout: 260 seconds]
tectonic has quit []
ledestin has joined #ruby
build22 has joined #ruby
zenlot2 has joined #ruby
bronson has joined #ruby
stu314 has quit [Remote host closed the connection]
celly has joined #ruby
zenlot1 has quit [Ping timeout: 260 seconds]
duckpuppy has quit [Ping timeout: 240 seconds]
build22_ has quit [Ping timeout: 246 seconds]
nateberkopec has quit [Quit: Leaving...]
<elico>
shevy: the issue was that I need to create a list of links to download and the simplest way is to use gsub and then download them one by one... and they created the nubmers in a 3 digit form.
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pwnd_nsfw has quit [Ping timeout: 250 seconds]
bogn has quit [Ping timeout: 250 seconds]
siddharth has quit [Read error: Connection reset by peer]
boorad420 has quit [Ping timeout: 252 seconds]
dylanjho_ has joined #ruby
celly has quit [Ping timeout: 260 seconds]
celly has joined #ruby
certainty has joined #ruby
synthroid has quit []
nertzy has quit [Quit: This computer has gone to sleep]
dylanjhoulihan has quit [Ping timeout: 260 seconds]
<Eising>
hey, what do you call syntax like #map(&:split)?
qhartman has joined #ruby
<lemur>
shorthand
<lemur>
or Symbol#to_proc
lemur is now known as baweaver
<baweaver>
every time...
<baweaver>
lemur === baweaver
paha80 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ElFerna has quit [Ping timeout: 246 seconds]
dylanjhoulihan has joined #ruby
rgtk has quit [Remote host closed the connection]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dylanjh__ has joined #ruby
gizmore|2 has quit [Ping timeout: 246 seconds]
paha80 has joined #ruby
dylanjh__ has quit [Max SendQ exceeded]
dylanjho_ has quit [Ping timeout: 255 seconds]
dylanjh__ has joined #ruby
jottr_ has quit [Read error: Connection reset by peer]
dylanjh__ has quit [Max SendQ exceeded]
certainty has quit [Ping timeout: 245 seconds]
dylanjho_ has joined #ruby
AlphaAtom has joined #ruby
dylanjho_ has quit [Client Quit]
dylanjhoulihan has quit [Ping timeout: 256 seconds]
rgtk has joined #ruby
pwnd_nsfw has joined #ruby
build22 has quit []
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]
robbyoconnor has joined #ruby
baweaver has quit [Read error: Connection reset by peer]
mary5030 has quit [Remote host closed the connection]
jgpawletko has quit [Quit: jgpawletko]
eytanfb has quit [Remote host closed the connection]
robbyoconnor has quit [Remote host closed the connection]
dhollinger has quit [Quit: WeeChat 1.3]
robbyoconnor has joined #ruby
gizmore has joined #ruby
stannard_ has quit [Remote host closed the connection]
gizless has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
siddharth has joined #ruby
eytanfb has joined #ruby
Harry has joined #ruby
gizmore has quit [Ping timeout: 265 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gizless has quit [Ping timeout: 256 seconds]
nertzy has joined #ruby
mistermocha has joined #ruby
bogn has joined #ruby
edwinvdgraaf has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
celly has quit [Remote host closed the connection]
spider-mario has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
jbrhbr has quit [Quit: Leaving.]
dopie has quit [Quit: This computer has gone to sleep]
dopie has joined #ruby
celly has joined #ruby
iateadonut has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
<shevy>
hmm say you have a string like x = "tioga-1.19.1.gem" but it could also be x = "tioga-1.19.1.tar.xz", is there a reliable way to obtain the last part, in the first case ".gem" but in the second case ".tar.xz" ?
jbrhbr has joined #ruby
houhoulis has joined #ruby
<xybre>
Regex.
grn has joined #ruby
<xybre>
considering some extensions have numbers in them, it's best if you make a list of expected extensions.
BSaboia has quit [Ping timeout: 265 seconds]
firstdayonthejob has quit [Ping timeout: 276 seconds]
`derpy has quit [Ping timeout: 246 seconds]
`derpy has joined #ruby
ta has joined #ruby
crdpink has quit [Quit: q term]
boorad420 has joined #ruby
abronca has left #ruby [#ruby]
crdpink has joined #ruby
blackmesa has joined #ruby
stevenxl has quit [Ping timeout: 260 seconds]
ysz has joined #ruby
gizless has joined #ruby
shazaum_ has joined #ruby
stevenxl has joined #ruby
stevenxl has joined #ruby
<al2o3-cr>
shevy: probably File.extname if just comparing the two
[Butch] has quit [Ping timeout: 260 seconds]
dopie has quit [Quit: Leaving]
<ysz>
are there that many gems written in C for Ruby as for PHP where that's a norm? I've started learning Ruby after PHP and would appreciate a hint
<dorei>
let's say i have an array like ['a', 41, 5, 'b', 41, 'zz', 'd'] , is there a way to split it at 41 so as to have an array like [['a'], [41], [5, 'b'], [41], ['zz', 'd']] ?
<xybre>
ysz: there's quite a few, but not a majority
gizmore has quit [Ping timeout: 250 seconds]
gizless is now known as gizmore
cassioscabral has quit [Quit: cassioscabral]
<shevy>
al2o3-cr problem is that File.extname will only take the last part so it will return a ".xz", I solved it in a similar way how xybre suggested though, I already have another project that splits into "program_name", and "version_name", so to get the part that comes afterwards, I just have to replace the former two from the full string
<ysz>
xybre, If I use rails casually will I step across those? are those required?
<ysz>
I hope to avoid that.
jottr_ has joined #ruby
<shevy>
ysz the amount of C hackers using ruby and still writing a lot of C code is somewhat rather low... surely less than 5% of the people here I would say
<Mon_Ouie>
the gems to talk with SQLite/MySQL are most often implemented in C (and then there are pure Ruby APIs built on top of them)
<havenwood>
dorei: one way: chunk { |e| e == 41 }.map &:last
VeryBewitching has joined #ruby
crdpink has quit [Quit: q term]
<VeryBewitching>
G'day folks.
<ysz>
thanks gents! now I'm not that afraid :)
dopie has joined #ruby
<ysz>
xybre, shevy ^^
celly has quit [Remote host closed the connection]
duckpuppy has joined #ruby
<ysz>
Mon_Ouie, that makes sense to me.
<dorei>
havenwood: that's magic, thanx :)
dopie has quit [Client Quit]
<xybre>
ysz: There's a couple of C gems that are required by Rails IIRC, the #rubyonrails channel might know more.
al2o3-cr has quit [Quit: WeeChat 1.3]
<Mon_Ouie>
slice_when { |x, y| x == 41 || y == 41 } is another solution, not sure it's better
dopie has joined #ruby
dopie has quit [Client Quit]
tectonic has joined #ruby
snockerton has quit [Quit: Leaving.]
dopie has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
radgeRayden has quit [Ping timeout: 265 seconds]
<dopie>
clear
<shevy>
dopie rescue!
crdpink has joined #ruby
grn has quit [Read error: Connection reset by peer]
duckpuppy has quit [Ping timeout: 240 seconds]
Spami has quit [Quit: This computer has gone to sleep]
grn has joined #ruby
rvchangue has quit [Quit: dead]
dopie has quit [Client Quit]
DoubleMalt has quit [Remote host closed the connection]
qhartman has quit [Quit: Ex-Chat]
dopie has joined #ruby
gizmore has quit [Changing host]
gizmore has joined #ruby
dopie has quit [Client Quit]
bkxd has joined #ruby
dlitvak has joined #ruby
Harry has quit [Quit: leaving]
certainty has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
grn has quit []
eytanfb has quit [Remote host closed the connection]