<drbrain>
croberts: people don't often use `::` for method calls anymore, usually File.readable?(…)
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<croberts>
drbrain: thank you i will use the . instead
nankyokusei has joined #ruby
toretore has quit [Ping timeout: 258 seconds]
saneax is now known as saneax_AFK
rajdesai has joined #ruby
killerkamel has joined #ruby
marr has quit [Ping timeout: 260 seconds]
byteflame has quit [Ping timeout: 250 seconds]
nankyokusei has quit [Ping timeout: 265 seconds]
rajdesai has quit [Ping timeout: 258 seconds]
replay has quit []
nando293921 has quit [Ping timeout: 260 seconds]
bkxd has joined #ruby
aeterne has joined #ruby
byteflame has joined #ruby
ElFerna has quit [Ping timeout: 260 seconds]
dell has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
Spami has quit [Quit: This computer has gone to sleep]
nerium has quit [Quit: nerium]
howdoi has quit [Quit: Connection closed for inactivity]
rcvalle has quit [Quit: rcvalle]
ensyde has quit [Ping timeout: 258 seconds]
macsteps has quit [Remote host closed the connection]
byteflame has quit [Ping timeout: 244 seconds]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zotherst1 has joined #ruby
zotherstupidguy has quit [Ping timeout: 264 seconds]
SilverKey has joined #ruby
roflmyeggo has joined #ruby
sarbs has quit [Ping timeout: 258 seconds]
dminuoso has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
jaguarmagenta has quit [Remote host closed the connection]
dminuoso has quit [Ping timeout: 240 seconds]
sarbs has joined #ruby
kavanagh has quit [Quit: That's all folks!]
sumobob has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
A_Drone has joined #ruby
JeanCarloMachado has quit [Quit: Lost terminal]
jenrzzz has joined #ruby
Axy has joined #ruby
blackmesa has joined #ruby
Mia has quit [Ping timeout: 250 seconds]
davedev24 has quit [Remote host closed the connection]
blackgoat has joined #ruby
ElFerna has joined #ruby
killerkamel has quit [Ping timeout: 240 seconds]
elifoster has joined #ruby
Ropeney has joined #ruby
_djbkd has quit [Quit: My people need me...]
davedev24 has joined #ruby
ensyde has joined #ruby
spudowiar has quit [Quit: gtg sleepz]
blackmesa has quit [Ping timeout: 258 seconds]
postmodern has quit [Ping timeout: 250 seconds]
tmtwd has joined #ruby
s2013 has joined #ruby
gusrub has quit [Remote host closed the connection]
A_Drone has quit [Ping timeout: 250 seconds]
ElFerna has quit [Ping timeout: 240 seconds]
dhollinger has quit [Quit: WeeChat 1.5]
qguv has joined #ruby
rajdesai has joined #ruby
A_Drone has joined #ruby
macsteps has joined #ruby
der-landgraf has quit [Quit: WeeChat 1.5]
postmodern has joined #ruby
eljimmy has joined #ruby
A_Drone has quit [Remote host closed the connection]
BrianJ has joined #ruby
rajdesai has quit [Ping timeout: 252 seconds]
dhollinger has joined #ruby
bkxd has joined #ruby
qguv has quit [Quit: bye]
Spami has joined #ruby
qguv has joined #ruby
SteenJobs has joined #ruby
davedev24 has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 258 seconds]
<SteenJobs>
hey all - i need to build a web scraper for a page with about 4000 rows that are lazy loaded - what tools would i need to overcome the lazy loading bit?
<SteenJobs>
slash if you have any good blogs/articles/etc i’ll gladly take those
RegulationD has joined #ruby
<baweaver>
Look for their official API
<baweaver>
if they don't have one, they probably don't want you scraping.
freerobby has quit [Quit: Leaving.]
JeanCarloMachado has joined #ruby
RegulationD has quit [Ping timeout: 260 seconds]
dell has quit [Ping timeout: 260 seconds]
<SteenJobs>
baweaver: it’s not one of those cases…it’s a simple site that just lists tons of rows of vendors for some sort of event, which someone needs to copy and paste by hand into a csv - so instead i’m writing them a script to do it
qguv has quit [Quit: bye]
dell has joined #ruby
johnmilton has quit [Ping timeout: 252 seconds]
<SteenJobs>
baweaver: seems like my best bet is to use capybara and just execute a scroll. although i know nothing about capybara so gotta read up on it - like how to know once the data is loaded, etc. so i can begin parsing
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
qguv has joined #ruby
<SteenJobs>
i guess i can just have a while loop that checks the number of rows against some value, and exits the loop once they match
A_Drone has joined #ruby
A_Drone has quit [Remote host closed the connection]
A_Drone has joined #ruby
dminuoso has joined #ruby
jaguarmagenta has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
<drbrain>
SteenJobs: figure out what request brings in more rows and reqeusts that directly
marxarelli is now known as marxarelli|afk
Dysp has quit [Ping timeout: 250 seconds]
<SteenJobs>
drbrain: right - so i tried doing that, and i found the request, but when i ran it i didn’t get any of the contents. i expected a JSON response (on top of that, it specifies the row range, so i figured if i set it to the maximum range, i’d get the entire response)
<drbrain>
if you have Chrome, does the inspector's copy to curl give the subset you want?
<drbrain>
if so, it's a good start for converting that to ruby
dminuoso has quit [Ping timeout: 276 seconds]
<SteenJobs>
drbrain: :). so it gave me a pretty verbose curl, and it worked once…but when i ran it again it didn’t work. problem is i need it to be a repeatable, user friendly script, so can’t have the person using it copy and pasting from chrome’s inspector
<drbrain>
maybe there's some session magic going on
<drbrain>
bleh
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gregf has quit [Quit: WeeChat 1.4]
gregf has joined #ruby
<SteenJobs>
drbrain: that’s what i figured, based on the ten million headers in the copied curl. but great thinking. that’s where capybara comes in, seems to simulate whatever session magic is going on
<SteenJobs>
i think...tbd
jdawgaz has joined #ruby
<drbrain>
hopefully
<SteenJobs>
drbrain: ok, test 1 worked - used capybara to load the page, then turned the html into a nokogiri object, and was able to get the first relevant row
<SteenJobs>
drbrain: so all i need to do is execute a scroll with some vanilla js, and then parse all the rows. the only tricky part is what i mentioned re somehow knowing once all the rows have finished loading.
* drbrain
nods
johnmilton has joined #ruby
leea has joined #ruby
qguv has quit [Quit: bye]
<SteenJobs>
:) a nod is all the confirmation i needed
qguv has joined #ruby
killerkamel has joined #ruby
blackmesa has joined #ruby
blackgoat has quit [Read error: Connection reset by peer]
JeanCarloMachado has quit [Ping timeout: 244 seconds]
blackgoat has joined #ruby
killerkamel has quit [Ping timeout: 252 seconds]
blackmesa has quit [Ping timeout: 265 seconds]
Sucks has joined #ruby
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jaguarmagenta has quit [Ping timeout: 260 seconds]
dennisvennink has quit [Read error: Connection reset by peer]
dennisvennink has joined #ruby
A_Drone has joined #ruby
Asher has joined #ruby
skweek has quit [Ping timeout: 276 seconds]
Takumo has quit [Ping timeout: 276 seconds]
duncannz has joined #ruby
Takumo has joined #ruby
Takumo has quit [Changing host]
Takumo has joined #ruby
hahuang61 has joined #ruby
blackmesa has joined #ruby
yardenbar has joined #ruby
alfiemax has quit [Ping timeout: 276 seconds]
eggoez has quit [Ping timeout: 258 seconds]
arescorpio has quit [Quit: Leaving.]
djbkd_ has joined #ruby
RegulationD has joined #ruby
c0mrad3 has quit [Quit: Connection closed for inactivity]
bitnap has joined #ruby
<bitnap>
So in ruby is everyting an object?
russt has quit [Ping timeout: 258 seconds]
tubuliferous has joined #ruby
raeoks has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
LoneHerm_ has quit [Ping timeout: 276 seconds]
russt has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
RegulationD has quit [Ping timeout: 258 seconds]
eggoez has joined #ruby
jaguarmagenta has joined #ruby
tubuliferous has quit [Ping timeout: 250 seconds]
tachikomas has joined #ruby
tachikomas has quit [Client Quit]
tachikomas has joined #ruby
jaguarma_ has quit [Ping timeout: 264 seconds]
grenierm has joined #ruby
alfiemax has joined #ruby
jondot has joined #ruby
ecnalyr has joined #ruby
diegoviola has quit [Quit: WeeChat 1.5]
ruby-lang169 has joined #ruby
<ruby-lang169>
hey everyone
<ruby-lang169>
would anyone be able to help with a web scraping question
ruby910 has joined #ruby
astrobun_ has joined #ruby
<tachikomas>
Just ask ;)
ruby-lang169 has quit [Client Quit]
ruby-lang957 has joined #ruby
<ruby-lang957>
oops just left the site a moment ago
<ruby-lang957>
I'm just a little confused with how to deal with a redirect I thought tools like Mechanizer automatically dealt with those sorts of things
<ruby-lang957>
in the dictionary site here, the query parameter for the word I want to look up (in this case, the word "effect") is passed but the problem is the site redirects to this
<dminuoso>
Why do you think an extra fork is needed?
ur5us has quit [Remote host closed the connection]
mim1k has joined #ruby
TheGillies has joined #ruby
drahosj_ has quit [Ping timeout: 260 seconds]
<jhass>
execve/execv replace the current process
<jhass>
spawn doesn't
drahosj_ has joined #ruby
astrobun_ has quit [Read error: Connection reset by peer]
binaryplease1 has joined #ruby
zotherstupidguy has joined #ruby
zotherst1 has quit [Ping timeout: 260 seconds]
A_Drone has quit [Ping timeout: 250 seconds]
binaryplease has quit [Ping timeout: 250 seconds]
tomphp has joined #ruby
<dminuoso>
jhass: Huh?
<bitnap>
w
Jerrry has quit [Ping timeout: 250 seconds]
<jhass>
dminuoso: what's unclear?
<bitnap>
Is their a compiler for ruby that compiles?
<dminuoso>
bitnap: What are you trying to do?
kp666 has joined #ruby
<bitnap>
I'm doing a lot of number processing
<bitnap>
And why looking for something faster than the default ruby interpreter
<jhass>
maybe you're actually looking for something like http://sciruby.com/
<dminuoso>
bitnap: CRuby does not really optimize its code (yet). You can look at JRuby (in particular Truffle/Graal), which offers far greater optimization for algorithmic flow.
<dminuoso>
(Though currently most libraries that I know of outsourced the computational heavy code into a C library that can be optimized AOT)
binaryplease1 is now known as binaryplease
<dminuoso>
the_drow: ?rails
<dminuoso>
?rails the_drow
<ruby[bot]>
the_drow: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<the_drow>
ok sorry
<the_drow>
Got no answer there... I thought someone might know
<dminuoso>
I wanted to buy a Ford, but since there was no salesman at the Ford shop I went to the Renault shop. Why doesn't anyone there want to sell me a Ford?
anisha_ has joined #ruby
<bitnap>
Because you can't aford one?
<the_drow>
dminuoso, again, I apologise for the spam
duncannz has quit [Remote host closed the connection]
bitnap is now known as greentree
greentree is now known as wut
<dminuoso>
jhass: You haven't looked at the regex parts then.
wut is now known as Guest72895
Shashikant86 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pandaant has joined #ruby
Guest72895 is now known as bakwards
hahuang61 has joined #ruby
bdknls has quit [Remote host closed the connection]
mrgrieves has joined #ruby
blackmesa has quit [Ping timeout: 258 seconds]
RegulationD has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
Charles_leung has joined #ruby
hahuang61 has quit [Ping timeout: 276 seconds]
tubuliferous has joined #ruby
RegulationD has quit [Ping timeout: 240 seconds]
dreinull has joined #ruby
harfangk has joined #ruby
Shashikant86 has joined #ruby
tubuliferous has quit [Ping timeout: 276 seconds]
craigp has quit [Ping timeout: 244 seconds]
pawnbox has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
hipertracker has quit [Quit: hipertracker]
xcesario_ has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
xcesariox has quit [Ping timeout: 244 seconds]
<jhass>
bakwards: oh btw if you feel a bit experiment, Crystal might be appealing to you
<jhass>
*experimental
<bakwards>
ok
hexhaxtron has quit [Read error: Connection reset by peer]
<jhass>
though our gmp bindings are still somewhat slow for some reason, so if your number crunching exceeds UInt64 you might want to prepare to invest some work into that area
Ishido has quit [Read error: Connection reset by peer]
Ishido has joined #ruby
ur5us has joined #ruby
bkxd has joined #ruby
M-manveru has joined #ruby
M-mistake has joined #ruby
Tempesta has joined #ruby
Charles_leung has quit [Quit: Charles_leung]
c355e3b has joined #ruby
ruid has joined #ruby
Rickmasta has joined #ruby
bkxd has quit [Ping timeout: 258 seconds]
A_Drone has joined #ruby
cgfbee has joined #ruby
blackmesa has joined #ruby
hipertracker has quit [Quit: hipertracker]
A_Drone has quit [Read error: Connection reset by peer]
A_Drone has joined #ruby
pawnbox has quit [Remote host closed the connection]
ruby-newby has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chosen1 has joined #ruby
<ruby-newby>
Hiya fellas, here's the latest version of my game. https://repl.it/CfZu/168 I've refactored it with much of your feedback in mind but in doing so I've reintroduced a bug which I'm hoping someone can help me understand as I don't understand enough about what's going on under the hood and don't have a good ide to step through and inspect it
<ruby-newby>
The problem line is 235 where I'm using erb to replace the weapon name (to fix the problem of interpolating the string when there's no value)
pawnbox has joined #ruby
<ruby-newby>
to recreate the bug, run the game, pick a name, the axe, cross the draw bridge and then "SHOW the axe"
johnmilton has quit [Ping timeout: 276 seconds]
tubuliferous has joined #ruby
chosen1_ has quit [Ping timeout: 258 seconds]
nankyokusei has joined #ruby
<ruby-newby>
I'm expecting it to include the name of the axe in the string but it's blank, now initially I was just interpolating but obiously this bakes the value into the string to early (before its actually) set, what I can't understand is, after the refactor, why is the value still blank? I pass in the new_player object to the game and set properties on it (which I believe is done by *reference* - in that odd sort of ruby way) so I don't u
<ruby-newby>
at print time
rodfersou has joined #ruby
<ruby-newby>
please forgive my horrendous typing and punctuation - jesus
tubuliferous has quit [Ping timeout: 265 seconds]
<ruby-newby>
as always any other feedback on the design is welcome too!
hiyosi has joined #ruby
nankyokusei has quit [Ping timeout: 276 seconds]
Bish has joined #ruby
<Bish>
hey, what do i use for creating salted hashs
<tobiasvl>
what algorithm?
<Bish>
a safe one i suppose
<Bish>
i don't care actually, just don't know how to do it
<Bish>
im not a cryptoguy
<Bish>
guess md5 sucks!?
<tobiasvl>
yes
<tobiasvl>
use bcrypt for example
<tobiasvl>
or scrypt
<Bish>
for salt i can take the user name? should i generate random data?
Shashikant86 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<canton7>
it's polite to tell us then, otherwise we'll waste our time trying to understand what you mean
<GorillaApe>
if you have any suggestions please let me know. problem was that I want to prevent repetion of any specified characters
<GorillaApe>
FA/FA should work but not FF/WE
<spectrum>
ruby-newby, yeah it gets hairy after that because of how you've structured your classes, erb is probably the correct solution to your problem but you need to have a way of getting to the player and or the game from inside the choice class, and maybe resolve the erb inside there as well
<canton7>
wait, I thought you'd fixed the problem?
Es0teric has quit [Quit: Computer has gone to sleep.]
<GorillaApe>
yes
<GorillaApe>
but I am not sure if it is 100% ok . i pasted the link
<GorillaApe>
with example
ur5us has quit [Ping timeout: 240 seconds]
<jobat>
well it satisfies your needs
<GorillaApe>
i hope so
Es0teric has joined #ruby
ur5us has joined #ruby
<jobat>
you probably don't need the .*s though
<jobat>
just . would do
freerobby has joined #ruby
A_Drone has quit [Remote host closed the connection]
bkxd has joined #ruby
<spectrum>
ruby-newby, actually it's executed inside game class thats fine, just add binding as a parameter to erb.result and change new_player to @player
davedev24 has joined #ruby
kavanagh has quit [Ping timeout: 276 seconds]
ur5us has quit [Ping timeout: 276 seconds]
jrafanie has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
kavanagh has joined #ruby
davedev24 has quit [Ping timeout: 250 seconds]
Tomatosoup- has joined #ruby
Tomatosoup- has left #ruby ["Leaving"]
synthroid has joined #ruby
koooge has quit [Quit: Leaving...]
yokel has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 244 seconds]
yokel has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
shmulik_mobile has quit [Ping timeout: 244 seconds]
dionysus69 has joined #ruby
allcentury has quit [Ping timeout: 258 seconds]
AzureStigma has joined #ruby
jrafanie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xall has joined #ruby
SHyx0rmZ has joined #ruby
Pupeno has joined #ruby
giz|work has joined #ruby
Pupeno_ has joined #ruby
Pupeno_ has quit [Remote host closed the connection]
Pupeno has quit [Ping timeout: 244 seconds]
xall has quit [Ping timeout: 258 seconds]
ElFerna has joined #ruby
mrmortondk has joined #ruby
giz|work has quit [Ping timeout: 244 seconds]
LoneHerm_ has joined #ruby
cyphase has quit [Ping timeout: 258 seconds]
aryaching has joined #ruby
griffindy has joined #ruby
Ropeney has joined #ruby
Ropeney has quit [Client Quit]
kavanagh has quit [Ping timeout: 260 seconds]
johnmilton has joined #ruby
giz|work has joined #ruby
LoneHerm_ has quit [Ping timeout: 265 seconds]
cyphase has joined #ruby
kavanagh has joined #ruby
jrafanie has joined #ruby
ruby-newby has quit [Ping timeout: 250 seconds]
allcentury has joined #ruby
ruby-newby2 has joined #ruby
<ruby-newby2>
Hi guys, sorry my browser crashed and I had to clear my cache before I could ge back in, before it did I saw someone kindly posted some advice on my problem with a text adventure game using erb but I'm not sure who it was
<ruby-newby2>
would that person mind reporting their chats?
Shashikant86 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruby-newby2>
sorry about this
<ruby-newby2>
I think you said something about it being tricky because of how my classes are structured but I couldn't see the full thing as my window was frozen and it took me forever to get back in :(
<dminuoso>
ruby-newby2: Check the topic of this chat, we have a log. :)
<dminuoso>
?topic
<ruby[bot]>
dminuoso: I don't know anything about topic
<ruby-newby2>
ah ok thanks
<ruby-newby2>
?topic
<dminuoso>
ruby-newby2: Sorry I was hoping we had a factoid pointing you towards the topic.
<ruby-newby2>
no worried I ound the log cheers
<dminuoso>
It should be displayed in your client somewhere, possibly it can also be shown using /topic
minimalism has quit [Quit: minimalism]
<dminuoso>
Alright.
nankyokusei has joined #ruby
ElFerna has quit [Ping timeout: 244 seconds]
<ruby-newby2>
spectrum: thank you for your help, sorry for the late reply, some machine issues
<ruby-newby2>
I'm not sure I follow you about "add the binding"
<jhass>
dminuoso: feel free to suggest one. There's ?logs ;)
<ruby-newby2>
spectrum: I see yous sent me something on bindings that's great thanks but I'm struggling to grasp it a bit. what you suggested sounded really simple, could I be a pain and ask you to show me the changes you propose in a snippet?
<ruby-newby2>
would owe you one :)
swills_ has quit [Ping timeout: 265 seconds]
<dminuoso>
ruby-newby2: To clear one confusion up about Ruby though, everything in Ruby is passed by value, except it doesn't pass objects but "pointers" by value.
<dminuoso>
(A true pass-by-reference is not very common in languages)
<ruby-newby2>
yes I've read up a bit on this and it's confusing but I think I get it
<ruby-newby2>
it's technically passed by value but in practical terms, objects are passed by reference correct?
<dminuoso>
No.
chouhoulis has joined #ruby
<dminuoso>
"Pointers to objects" are passed by value. The distinct is really important.
<ruby-newby2>
so it passes a point to the object by value but practically we cantreat this as if it's being passed by reference. I saw diagrams that explained it
<ruby-newby2>
ok maybe I don't understand it then
hipertracker has quit [Ping timeout: 265 seconds]
A_Drone has joined #ruby
<ruby-newby2>
I saw a thing which explained that it's essentially creating a second variable inside the method being called but a variable that points to the same object in memory
<dminuoso>
ruby-newby2: Ignore implementation, lets look at behavior
<dminuoso>
>> def(arg); arg << 1; end; a = []; foo(a); p a
<ruby[bot]>
dminuoso: # => /tmp/execpad-6b11d5facd49/source-6b11d5facd49:2: syntax error, unexpected ';', expecting :: or '.' ...check link for more (https://eval.in/616032)
<dminuoso>
>> def foo(arg); arg << 1; end; a = []; foo(a); p a
<dminuoso>
but it cannot change the underlying object.
nerium has joined #ruby
<dminuoso>
arg is just a pointer to an object. assigning changes that pointer to a new one.
banisterfiend has joined #ruby
allcentury has quit [Quit: WeeChat 1.2]
ta_ has quit [Remote host closed the connection]
<dminuoso>
ruby-newby2: that last summary sounds about right.
alfiemax has joined #ruby
hk238 has joined #ruby
<dminuoso>
ruby-newby2: So no, it's not pass by reference. Pointer semantics allow you to implement almost the same as pass-by-reference, but not quite.
<ruby-newby2>
ok I'm studying your example but I don't think I understand it. So it looks like you've defined a method which has an args param and appends '1' to it. You then pass an empty array; 'a' to this method, and I would *expect* it to append a 1 to it but your output shows that it's still empty
<ruby-newby2>
in which case... I don't understand (sorry)
Shashikant86 has joined #ruby
<ruby-newby2>
I might be lost as I don't have an intuitive grasp of what appending 1 to an array would normally do.... (return [1]?) - still very new to the language and you can't really append an int to an array in c# (where I come from) so I'm sort of making assumptions here which might be my undoing
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<toretore>
you are confusing the two examples, look closer at them
<ruby-newby2>
ah ok... that's much easier to follow yes
<ruby-newby2>
hmmmm
<ruby-newby2>
ok
tyang_ has quit [Client Quit]
tyang has joined #ruby
<ruby-newby2>
so it can modify, but not assign?
<ruby-newby2>
hmmm
hwcomcn has joined #ruby
hwcomcn has quit [Max SendQ exceeded]
hwcomcn has joined #ruby
<ruby-newby2>
ok, that's much clearer. It hasn't fully 'sunk in' yet but I understand and can follow the later example, thank you
Asade has joined #ruby
<ruby-newby2>
I need to go back to for a bit but I will revisit this, this afternoon. I still have no idea how to solve my game issue but I'll make sure I understand this more deeply before retrying
bmurt has joined #ruby
JeanCarloMachado has quit [Quit: Lost terminal]
kavanagh has quit [Ping timeout: 240 seconds]
fergal has joined #ruby
kavanagh has joined #ruby
SHyx0rmZ has quit [Remote host closed the connection]
anisha_ has quit [Quit: This computer has gone to sleep]
xall has joined #ruby
saneax is now known as saneax_AFK
ChiefAlexander has joined #ruby
mim1k has joined #ruby
SHyx0rmZ has joined #ruby
xall has quit [Ping timeout: 260 seconds]
anisha_ has joined #ruby
weemsledeux has joined #ruby
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 244 seconds]
TheWhip has quit [Remote host closed the connection]
lazyatom has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
weemsledeux has joined #ruby
weemsledeux has quit [Client Quit]
joonty has quit [Quit: This computer has gone to sleep]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tyang has joined #ruby
griffindy has joined #ruby
yardenbar has quit [Ping timeout: 250 seconds]
RegulationD has quit [Ping timeout: 240 seconds]
<toretore>
dminuoso: in which scenario, with or without an exception happening?
<dminuoso>
toretore: Without an exception.
<dminuoso>
Ive been debugging the living crap out of this, and I don't understand why the second variant completely changes the state of "agent" at the time out logout.
<dminuoso>
*time of
astrobun_ has quit [Remote host closed the connection]
axl_ has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<toretore>
dminuoso: changes it how?
<toretore>
how do you know that it does, and that this difference is why?
AzureStigma has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dminuoso>
toretore: The second is throwing exceptions on agent.logout.
<toretore>
what exceptions?
<toretore>
i have a feeling the difference lies somewhere in the code you're not showing
<dminuoso>
toretore: All this is part of some webscraper. Essentially whats happening is that during the agent.logout using the second variant the Mechanize::Page is incomplete.
<dminuoso>
This is the only change Im making.
<dminuoso>
These lines.
AzureStigma has joined #ruby
AzureStigma has quit [Client Quit]
pawnbox has quit [Remote host closed the connection]
<dminuoso>
(It's missing portions of the page, which causes things to break of course)
Macaveli has joined #ruby
<dminuoso>
And yes, the only change Im making is to these three lines.
l4v2 has joined #ruby
jishankai has quit [Ping timeout: 265 seconds]
Shashikant86 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 240 seconds]
JeremyM has joined #ruby
bkxd has joined #ruby
nerium has quit [Quit: nerium]
kgutteridge has joined #ruby
edwinvdgraaf has joined #ruby
davedev24 has joined #ruby
matp has joined #ruby
pawnbox has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
Shashikant86 has joined #ruby
davedev24 has quit [Ping timeout: 258 seconds]
vondruch has joined #ruby
Shashikant86 has quit [Max SendQ exceeded]
pawnbox has quit [Ping timeout: 258 seconds]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
jaguarmagenta has joined #ruby
Spami has joined #ruby
Spami has quit [Remote host closed the connection]
saneax_AFK is now known as saneax
mrmortondk has quit [Read error: Connection reset by peer]
<dminuoso>
About the only exotic thing Im doing, is that all of this happens inside a refinement..
jaguarmagenta has quit [Ping timeout: 265 seconds]
cdg has quit [Ping timeout: 250 seconds]
macsteps has joined #ruby
eizua has joined #ruby
c0mrad3 has joined #ruby
Linell has joined #ruby
macsteps has quit [Remote host closed the connection]
<Linell>
I've got a large flac file that I need to split into several files that are less than a minute long each. What's a good starting point for something like that?
last_staff has quit [Quit: last_staff]
nfk has joined #ruby
xall has joined #ruby
gregf has quit [Quit: WeeChat 1.4]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dminuoso>
fergal: In Ruby everything is truthy except nil and false.
<dminuoso>
No exceptions.
sarbs has quit [Max SendQ exceeded]
ChiefAlexander has quit [Ping timeout: 240 seconds]
ChiefAlexander has joined #ruby
<ruby-newby2>
Anyone know what spectrum means by " just add binding as a parameter to erb.result and change new_player to @player"? I spent some time google "bindings in ruby" and I'm none the wiser :\ https://repl.it/CfZu/167
kavanagh has joined #ruby
pawnbox has quit [Remote host closed the connection]
submitnine has quit []
<croberts>
if i wanted to delete a file but check it first with File.file?(file_name) how would i capture the true output, would I store it to a variable or can I pass it to the next command if true File.delete()
the_drow has quit [Quit: This computer has gone to sleep]
pawnbox has joined #ruby
saneax is now known as saneax_AFK
<fergal>
dminuoso: what’s the !! operator called?
dionysus69 has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
yardenbar has joined #ruby
<ljarvis>
croberts: if File.file?(file); File.rm(file); end
<ljarvis>
or postfix if, File.rm(file) if File.file?(file)
<aeruder>
fergal: it is just the ! operator twice
dminuoso has quit [Ping timeout: 276 seconds]
<aeruder>
fergal: but has the wonderful side effect of coercing a value into a boolean
blackmesa has joined #ruby
kavanagh has quit [Ping timeout: 260 seconds]
sarbs has joined #ruby
<ljarvis>
the double bang
tyang has quit [Ping timeout: 240 seconds]
nando293921 has joined #ruby
<ljarvis>
aka not not
<ljarvis>
aka the realist
banisterfiend has joined #ruby
nando293921 has quit [Read error: Connection reset by peer]
<ruby-newby2>
Anyone know what spectrum means by " just add binding as a parameter to erb.result and change new_player to @player"? I spent some time google "bindings in ruby" and I'm none the wiser :\ https://repl.it/CfZu/169
<ruby-newby2>
sorry for repeat
polishdub has joined #ruby
haylon has joined #ruby
mim1k has joined #ruby
dminuoso has joined #ruby
syndikate has joined #ruby
aufi has quit [Ping timeout: 244 seconds]
syndikate has quit [Remote host closed the connection]
ChiefAlexander has quit [Remote host closed the connection]
syndikate has joined #ruby
OTORelic1 has joined #ruby
RegulationD has joined #ruby
ChiefAlexander has joined #ruby
flashpoint9 has joined #ruby
tyang has joined #ruby
edwardly has quit [Ping timeout: 258 seconds]
saneax_AFK is now known as saneax
hwcomcn has quit [Ping timeout: 276 seconds]
leea has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
aryaching has quit [Remote host closed the connection]
<Linell>
ruby-newby2: what's not working in it?
RegulationD has quit [Ping timeout: 250 seconds]
tubuliferous has joined #ruby
<ruby-newby2>
if you run, pick a name, the axe weapon, cross the drawbridge then "Show the axe", the name is blank
<ruby-newby2>
apparently I need to pass a binding to erb.result to fix but I have no idea
kavanagh has joined #ruby
leea has quit [Client Quit]
<ruby-newby2>
I'm reading up on it but there's so simple explanations I can find
<ruby-newby2>
*no simple
Ishido has quit [Remote host closed the connection]
edwinvdgraaf has quit [Ping timeout: 258 seconds]
<ruby-newby2>
I understand bindings will allow me to set scope and use the local variables instead of te top level ones but I'm lost beyond that
Es0teric has quit [Quit: Computer has gone to sleep.]
<ruby-newby2>
does that make sense Linell ?
Ishido has joined #ruby
leea has joined #ruby
TomyWork has joined #ruby
<ruby-newby2>
shit lol, ok I've fixed it but have no idea what's going on, could someone explain line 136 to me? what is that binding arg doing? https://repl.it/CfZu/171
<Zarthus>
hmm.. but can I get rid of the troll with my fish
tubuliferous has quit [Ping timeout: 276 seconds]
<jhass>
ruby-newby2: it might be easier if you instead defined well known replacements and used String#%, not erb
<Zarthus>
yeah, String.format or String#% are easier to use
aganov has quit [Remote host closed the connection]
<Zarthus>
or of course, string interpolation
yardenbar has quit [Ping timeout: 250 seconds]
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Silthias has quit [Ping timeout: 244 seconds]
<ruby-newby2>
I can't use string interpolation because it would bake in the empty value (which isn't set until after the string is passed) and not update at print time
kavanagh has joined #ruby
<ruby-newby2>
I think jhass suggested I look into using sprintf before which I did but got the same result (probably did it wrong but here we are)
<Zarthus>
string interpolation accepts methods as well
<ruby-newby2>
this now works - exactly as I'd like it to... I just don't understand what passing "binding" did... it's transferred the scope somehow but I don't reall understand it
<dminuoso>
What control mechanism could cause ruby to not execute code after yielding a block? Its not an exception, the rescue handler is never entered.
<dminuoso>
(The ensure block is executed though)
<jhass>
throw, fiber, thread comes to mind
tvon has quit [Quit: System is sleeping...]
<dminuoso>
jhass: How do fiber/thread play into this?
<jhass>
sleep
<dminuoso>
Can you elaborate?
<jhass>
thread change context at any point, so that too. And then do something in the now active thread that locks up the whole process
<dminuoso>
jhass: It's not blocked. I have dead code.
<dminuoso>
Brb, leaving train.
<jhass>
fiber would be an explicit switch to another one and never switching back
dminuoso has quit [Remote host closed the connection]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AndrewIsHere has joined #ruby
dminuoso has joined #ruby
Silthias has joined #ruby
<dminuoso>
jhass sorry. Basically I have a yield that is followed by code. The block is called entirely. The code does not get executed.
<jhass>
what's in the block?
GorillaApe has quit [Remote host closed the connection]
<dminuoso>
Code that uses refined mechanize
yeticry has quit [Ping timeout: 250 seconds]
kobain has joined #ruby
<dminuoso>
Its as if Ruby isnt unwinding its callstack properly
etetz has joined #ruby
yeticry has joined #ruby
sepp2k has quit [Quit: Leaving.]
AndrewIsHere has quit [Ping timeout: 265 seconds]
cschnei__ has joined #ruby
<dminuoso>
jhass oh my. I have an idea....
<dminuoso>
Im gonna stub out things to produce a testcase
soulisson has joined #ruby
tomphp has joined #ruby
<soulisson>
Hi, sorry for this question, but are the expressions inside a regular expression, regular expressions them selves
<soulisson>
?
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
depends on how you define what an expression inside a regular expression is
AndrewIsHere has joined #ruby
<dminuoso>
jhass: wow. What a strange behavior. Return inside blocks doesnt do what I thought it would
<dminuoso>
Holy crap.
<elomatreb>
Do you maybe mean matching groups or character classes?
jhack has joined #ruby
<jhass>
dminuoso: oh, yeah, return returns from the calling method, break from the called method and next from the block
<soulisson>
jhass, like /a|b/, can "a" be considered a regexp and "b" be a regexp?
<jhass>
given /a/ and /b/ are both valid regular expressions, sure
<dminuoso>
Metaprogramming wise useful Im sure, but this is so misleading....
<jhass>
dminuoso: same for procs, only lambda procs change that behavior
<ruby-newby2>
thank you jhass, I'm not sure I see the benefit of your solution over my own but one downfall is we're hard coding the weapon in the display_choice_outcome. the game designer may want to add any player property, I ultimately want to let them build their own game from my engine without needed to modify the engine, this works https://repl.it/CfZu/172 I just don't understand what the binding arg does on ln:136
<soulisson>
jhass, thanks
zacts has quit [Ping timeout: 250 seconds]
mistermocha has joined #ruby
<dminuoso>
jhass considering that lambas are peocs under the hood that seems even more silly.
<soulisson>
If I'm not mistaking yield is a method, like super, no?
<jhass>
neither is a method
<aeruder>
jhass: doesn't the definition of return/break/next there basically depend entirely on how the block is invoked? as in, next actually depends on it being part of an iteration in the caller
<jhass>
soulisson: as proven by both being in the list I linked you
<jhass>
aeruder: no
<soulisson>
jhass, thanks
<dminuoso>
soulisson: The thing is, there is no real method calls. You send a message to an object, either it responds or it doesnt.
kavanagh has quit [Quit: That's all folks!]
<jhass>
?
<jhass>
what would a "real" method call be then?
tvon has joined #ruby
tvon has quit [Client Quit]
craigp_ has joined #ruby
hahuang61 has joined #ruby
A_Drone has quit [Ping timeout: 250 seconds]
<dminuoso>
jhass: I said method calls, not methods.
<dminuoso>
I.e. you dont really call a method. You send a message to the object.
synthroid has joined #ruby
swistak35 has quit [Ping timeout: 250 seconds]
freerobby has quit [Quit: Leaving.]
thejoecarroll has quit [Ping timeout: 250 seconds]
<dminuoso>
It kind of has this smalltalk feeling.
<jhass>
am I missing an actual technical difference here?
thejoecarroll has joined #ruby
swistak35 has joined #ruby
<jhass>
otherwise this seems to be something you'd differentiate to feel smarter...
sevvie has quit [Ping timeout: 264 seconds]
<aeruder>
jhass: i'm going to vote the latter
thiesen has joined #ruby
kavanagh has joined #ruby
hahuang61 has quit [Ping timeout: 276 seconds]
malconis has quit [Read error: Connection reset by peer]
malconis_ has joined #ruby
freerobby has joined #ruby
<soulisson>
Is there something similar to scan for regular expressions? like regexp.scan(a_string)?
<ruby-newby2>
Anyone know a good way to redistribute this game to friends in a way that hides source code (which has spoilers) like is there a pretty-ish online service that lets you share just your program console? I tried packaging with OCRA to run in windows command prompt but the windows command prompt is AWFUL. Wraps text mid word, tiny display window, just awful
banisterfiend has joined #ruby
<ruby-newby2>
like can I give someone this game without giving them the code too (which I'm not really bothered about so long as it's hidden initially)
aryaching has joined #ruby
<elomatreb>
ruby-newby2: If they look into the sourcecode and get spoilered, isn't it their loss?
gdonald has quit []
<jhass>
soulisson: no
LuckyABA has joined #ruby
<ruby-newby2>
yes but I'd like to not have it starring them in the face the moment they open the game, as I say if it could be closed initially but all of these sites are for sharing the code and don't seem to offer that
blaxter has quit [Quit: foo]
<soulisson>
jhass, ok, thanks
<ruby-newby2>
and the windows console might be the ugliest thing I've ever seen
amclain has joined #ruby
<ruby-newby2>
to ask another way, anyone know of any free windows apps that will run a .rb file and display it in a reasonably pleasant fashion?
LuckyABA has quit [Client Quit]
<elomatreb>
Powershell is supposed to be a lot better than regular cmd.exe, but I haven't used it
<ruby-newby2>
yeah, it is, but still does annoying stuff like wrapping text mid word
<ruby-newby2>
weird this isn't a problem that's been solved already, perhaps I'm looking at it wrong I don't know
<elomatreb>
Hard-wrapping is normal behaviour for shells. Have you tried maybe making your game available on a website, using monospaced fonts? Could look a lot nicer
mooru has joined #ruby
<eam>
ruby-newby2: if you're worried about casual spoilers, just uuencode your script and have the running program uudecode it before running
<ruby-newby2>
no but I had considered it elomatreb. I'm SUPER new to ruby though so forgive the question, would I need to learn rails to do that?
Macaveli has joined #ruby
<ruby-newby2>
eam: I don't know what that means sorry
<elomatreb>
ruby-newby2: Rails is one (probably overkill) solution. Sinatra (http://www.sinatrarb.com/) is quite simple, yet based on the same infrastructure as rails
<ruby-newby2>
ok thank you, I'll look into that!
bkxd has joined #ruby
<aeruder>
i do think there's a valid case for what you are talking about ruby-newby2, but afaik most solutions have been for each individual author to redo their app to take advantage of a gui lib or web, haven't really seen anything to host console ruby programs in a more pleasant way
TheWhip has quit [Remote host closed the connection]
<ruby-newby2>
thanks eam
* elomatreb
has flashbacks to obfuscated PHP code
<eam>
you can encode your program into the __END__ block by running: ruby -rbase64 -e'puts Base64.encode64 File.read ARGV.shift' your_original_script.rb
davedev24 has joined #ruby
<ruby-newby2>
understood aeruder
<eam>
it's trivial to reverse, but will keep people from casually seeing spoilers
<ruby-newby2>
that might do
<eam>
base64 is an encoding used to turn binary files into 7-bit clean text fields, email and so on uses it
bkxd has quit [Ping timeout: 260 seconds]
TPug has joined #ruby
<ruby-newby2>
yeah to encode images as strings etc, I'm familiar, thank you for the suggestion, it might just do
<eam>
(realized I had an error in the gist, should be eval not puts)
<ruby-newby2>
ok
davedev24 has quit [Ping timeout: 258 seconds]
syndikate has quit [Ping timeout: 250 seconds]
syndikate has joined #ruby
dionysus69 has joined #ruby
TheWhip has joined #ruby
<cschnei__>
what's the base class of all numbers? I have to do some type checking and want to say "if this is a number" vs. "if this is a string" ...
<eam>
cschnei__: Numeric?
<ljarvis>
why not just check if it's a string?
Zapperino has joined #ruby
<Zapperino>
Hi
<cschnei__>
eam: derp. I got stuck on fixnum in my head :)
mark_66 has quit [Remote host closed the connection]
tyang has quit [Ping timeout: 260 seconds]
Chair has quit [Ping timeout: 264 seconds]
daffy_duck_3 has joined #ruby
armin has quit [Quit: relate to the matter as i drop the bomb]
daffy_duck_2 has quit [Ping timeout: 264 seconds]
hipertracker has quit [Quit: hipertracker]
kavanagh has quit [Ping timeout: 264 seconds]
armin has joined #ruby
kgutteridge has quit [Quit: kgutteridge]
joonty has quit [Quit: This computer has gone to sleep]
<soulisson>
Sorry to bother you again, is there a way in pry to clear the screen?
<jobat>
doesn't ctrl-l do it?
<soulisson>
jobat, thanks
<jobat>
soulisson: np. standard command for most shells.
bkxd has joined #ruby
mistermocha has quit [Remote host closed the connection]
<soulisson>
jobat, ouaw, I learn something, I always used the clear command
mistermocha has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
RegulationD has joined #ruby
<jobat>
soulisson: yeah, me too. the more you know
bkxd has quit [Ping timeout: 260 seconds]
yardenbar has joined #ruby
hakunin has quit [Remote host closed the connection]
kavanagh has joined #ruby
chouhoulis has joined #ruby
chouhoul_ has joined #ruby
hakunin has joined #ruby
thiesen has quit [Ping timeout: 260 seconds]
majmon_tsuri has quit [Ping timeout: 250 seconds]
fergal has quit [Quit: fergal]
tubuliferous has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
hiyosi has joined #ruby
rocknrollmarc has joined #ruby
rocknrollmarc has quit [Max SendQ exceeded]
kgutteridge has joined #ruby
rocknrollmarc has joined #ruby
hakunin has quit [Ping timeout: 250 seconds]
Ishido has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 240 seconds]
tubuliferous has quit [Ping timeout: 260 seconds]
Ishido has joined #ruby
Snowy has quit [Remote host closed the connection]
hiyosi has quit [Ping timeout: 240 seconds]
Snowy has joined #ruby
saneax is now known as saneax_AFK
sharkman has joined #ruby
Zapperino has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
<sharkman>
if i do, class Stuff; def self.x; @x ||= "a"; end; end; p Stuff.x class LittleStuff < Stuff; end; p LittleStuff.x
djellemah has joined #ruby
<sharkman>
will that call to LittleStuff.x use the cached variable from earlier?? or will it recreate it since it is a new class?
symm- has quit [Ping timeout: 276 seconds]
<jhass>
the latter
<sharkman>
cool thanks jhass
Snowy has quit [Ping timeout: 258 seconds]
zotherst1 has joined #ruby
zotherstupidguy has quit [Ping timeout: 250 seconds]
Zapperino has joined #ruby
Vingador has quit [Remote host closed the connection]
ixti has joined #ruby
antgel has quit [Ping timeout: 264 seconds]
djellemah_ has joined #ruby
soulisson has quit [Ping timeout: 244 seconds]
TPug has joined #ruby
djellemah has quit [Ping timeout: 240 seconds]
AzureStigma has joined #ruby
kgutteridge has quit [Quit: kgutteridge]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
safetypin has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
redy has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
firstdayonthejob has joined #ruby
ChiefAlexander has joined #ruby
jobat has quit [Ping timeout: 250 seconds]
tomphp has joined #ruby
mahlon has joined #ruby
xall has joined #ruby
AzureStigma is now known as AzureStigma|Away
AzureStigma|Away has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
redy has quit [Quit: Leaving]
macsteps has joined #ruby
jhack has quit [Quit: jhack]
xall has quit [Ping timeout: 258 seconds]
macsteps has quit [Remote host closed the connection]
AzureStigma has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djellemah has joined #ruby
macsteps has joined #ruby
roger_rabbit has joined #ruby
diegoviola has joined #ruby
sepp2k has joined #ruby
YaknotiS has quit [Ping timeout: 258 seconds]
elaptics is now known as elaptics`away
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
joonty has joined #ruby
Derperperd has left #ruby [#ruby]
Spami has joined #ruby
Derperperd has joined #ruby
Spami has quit [Remote host closed the connection]
TPug has quit [Read error: Connection reset by peer]
roger_rabbit has quit [Quit: WeeChat 0.3.8]
dopamean_ has joined #ruby
hahuang61 has joined #ruby
freerobby has quit [Quit: Leaving.]
Spami has joined #ruby
freerobby has joined #ruby
djellemah has quit [Quit: Leaving]
chouhoulis has joined #ruby
bkxd has joined #ruby
chouhou__ has joined #ruby
hahuang61 has quit [Ping timeout: 264 seconds]
giz|work has quit [Ping timeout: 260 seconds]
tomphp has quit [Ping timeout: 276 seconds]
djbkd has joined #ruby
guacamole has quit [Quit: leaving]
djellemah__ has joined #ruby
guacamole has joined #ruby
chouhoul_ has quit [Ping timeout: 276 seconds]
hipertracker has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
AndrewIsHere has quit [Ping timeout: 250 seconds]
AndrewIsHere has joined #ruby
thiesen has joined #ruby
djellemah_ has quit [Ping timeout: 260 seconds]
TPug has joined #ruby
tomphp has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hiyosi has joined #ruby
tyang has joined #ruby
rubie has quit []
rodfersou|lunch is now known as rodfersou
AzureStigma has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ChiefAlexander has quit [Remote host closed the connection]
t1mxg0d has joined #ruby
hiyosi has quit [Ping timeout: 250 seconds]
ponga has quit [Quit: Connection closed for inactivity]
skade has joined #ruby
bkxd has quit [Ping timeout: 258 seconds]
macsteps has quit [Remote host closed the connection]
hakunin has joined #ruby
spiette has quit [Ping timeout: 265 seconds]
spiette has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
spiette has quit [Max SendQ exceeded]
skade has quit [Ping timeout: 250 seconds]
spiette has joined #ruby
Akuma has quit [Read error: Connection reset by peer]
skade has joined #ruby
DoubleMalt has joined #ruby
thiesen has quit [Ping timeout: 240 seconds]
AzureStigma has joined #ruby
xall has joined #ruby
l4v2 has quit [Quit: l4v2]
TomyWork has quit [Ping timeout: 276 seconds]
spiette has quit [Max SendQ exceeded]
johnmilton has quit [Remote host closed the connection]
kirun has joined #ruby
sumobob has quit [Ping timeout: 258 seconds]
mooru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
poguez_ has joined #ruby
Rickmasta has joined #ruby
roger_rabbit has joined #ruby
shinnya has quit [Ping timeout: 244 seconds]
t1mxg0d has quit [Quit: WeeChat 1.5]
YaknotiS has joined #ruby
AzureStigma has quit [Quit: Gotta run..]
t1mxg0d has joined #ruby
Pupeno has joined #ruby
skade has quit [Ping timeout: 240 seconds]
wrkrcoop has joined #ruby
gusrub has quit [Remote host closed the connection]
<wrkrcoop>
im writing some specs. and i have some dummy data. the dummy data are hashes … i was thinking of storing them in their own files as txt and reading them and turning them into hashes
<jhass>
just use JSON or YAML
<wrkrcoop>
jhass: ok ill use json. but would i just read the file with File.read?
<wrkrcoop>
or how would i read it from the file?
<jhass>
sure
<wrkrcoop>
so i read each line then strip each line of the new line and then turn it into hash?
<Papierkorb>
Sounds more like a job for shared_examples
<jhass>
no, just use a JSON array as the outer container
<Papierkorb>
joevandyk: Are there two machines in a hot standby setup?
macsteps has joined #ruby
umdstu has quit [Quit: umdstu]
<aeruder>
"Symantec"
<joevandyk>
Papierkorb: i have no idea.. this is a salesforce owned system. we use them to send emails. :)
<Papierkorb>
No idea about Salesforces. I don't even know what they are, so there's that
CloCkWeRX has quit [Ping timeout: 265 seconds]
memorasus has joined #ruby
chouhou__ has quit [Remote host closed the connection]
TheWhip has quit [Ping timeout: 265 seconds]
ElFerna has quit [Ping timeout: 276 seconds]
<joevandyk>
jhass: thank you!
mtkd has quit [Ping timeout: 244 seconds]
chouhoulis has joined #ruby
fergal has joined #ruby
mtkd has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skweek has quit [Ping timeout: 260 seconds]
bkxd has joined #ruby
CloCkWeRX has joined #ruby
johnmilton has joined #ruby
spider-mario has joined #ruby
jackjackdripper has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
l4v2 has joined #ruby
macsteps has quit [Remote host closed the connection]
haylon has left #ruby ["WeeChat 1.5"]
QORRiE has joined #ruby
<wrkrcoop>
im trying to turn a string of json into a hash using JSON.parse. when i use binding.pry it works in my program, but when i try it in my spec it complains about a parse error …
<jhass>
well, fix the parse error
tomphp has joined #ruby
<wrkrcoop>
it doesnt say where it is, it just says ‘parse erorr'
<jhass>
I doubt that
<wrkrcoop>
omg its because i wasn’t using JRUBY
<jhass>
I doubt that
<wrkrcoop>
its true
<wrkrcoop>
i didnt change anything
<jhass>
I doubt that
SilverKey has joined #ruby
flashpoint9 has joined #ruby
<wrkrcoop>
haha
<wrkrcoop>
umm maybe its because i didnt run bundle … idk
SilverKey has quit [Max SendQ exceeded]
<jhass>
I doubt that
Devalo has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
Macaveli has joined #ruby
SilverKey has joined #ruby
pandaant has quit [Remote host closed the connection]
SilverKey has quit [Max SendQ exceeded]
mooru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SilverKey has joined #ruby
Rickmasta has joined #ruby
tyang has quit [Ping timeout: 276 seconds]
mooru has joined #ruby
rajdesai has joined #ruby
edwinvdgraaf has joined #ruby
dhollinger has quit [Ping timeout: 260 seconds]
replay has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Dimik has joined #ruby
shinnya has joined #ruby
aryaching has quit [Ping timeout: 260 seconds]
aryaching has joined #ruby
Macaveli has joined #ruby
postmodern has joined #ruby
mooru_ has joined #ruby
mooru has quit [Ping timeout: 240 seconds]
hipertracker has quit [Quit: hipertracker]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
minimalism has joined #ruby
thejoecarroll has joined #ruby
zacts has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
blackmesa has quit [Ping timeout: 250 seconds]
SilverKey has quit [Quit: Halted.]
hakunin has quit [Remote host closed the connection]
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
hakunin has joined #ruby
dhollinger has joined #ruby
Tomatosoup- has joined #ruby
Tomatosoup- has left #ruby ["Leaving"]
tubulife- has joined #ruby
alfiemax has joined #ruby
byteflame has quit [Ping timeout: 244 seconds]
[Butch]_ has joined #ruby
byteflame has joined #ruby
tyang has joined #ruby
fullstack has quit [Changing host]
fullstack has joined #ruby
bascht_ has joined #ruby
Spami has joined #ruby
[Butch] has quit [Ping timeout: 260 seconds]
[Butch]_ is now known as [Butch]
tubulife- has quit [Ping timeout: 260 seconds]
tmtwd has joined #ruby
sharkman has quit [Ping timeout: 258 seconds]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
hakunin has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
<kegster>
If I want to run a function that's part of an API so I can't control it-- how can I catch ANY error it may give and just do something instead of the script crashing? very new to ruby here and just have to use it for interaction with an API when needed heh
borodin has joined #ruby
pawnbox has joined #ruby
<borodin>
if I have an array of hashes, and I want to edit one of them, choosing the one to edit based on a value of one of it's tuples, how do I do that? for example: [{"a"=>1,"b"=>2},{"a"=>3,"b"=>7},{"a"=>1,"b"=>4}]
<elomatreb>
kegster: If you want to catch an error, you use begin/rescue blocks or statements. If you want to rescue (basically) anything, you can use a rescue statement without an argument
<borodin>
I want to set "a" to 2 where "b" is 2, but I need to add another tuple as well, so I really need to pull the hash out and then put it back in
<kegster>
elomatreb, so i have 3 functions i need to run, 1 line per function. i can put all 3 within a begin and then just rescue it?
<kegster>
i tried begin / 3 lines of potentially errored code / rescue / my code to run if no errors / end
ineb has quit [Quit: leaving]
<elomatreb>
And did it work?
<elomatreb>
Ah. the rescue code runs *only* if there is an error
RegulationD has quit [Remote host closed the connection]
the_rhizo has joined #ruby
yfeldblum has joined #ruby
nettoweb has joined #ruby
<aeruder>
you'd want else <foo> for the no error case
doublemalt_ has joined #ruby
DoubleMalt has quit [Read error: No route to host]
bkxd has joined #ruby
<elomatreb>
aeruder: I have yet to see that feature being used in actual code
spiette has joined #ruby
TomyLobo has quit [Disconnected by services]
pzvxewlxmllzncdz has joined #ruby
pzvxewlxmllzncdz is now known as nmvudnfpktqoodup
nmvudnfpktqoodup is now known as TomyLobo
<aeruder>
elomatreb: it seems rarely useful, maybe for closing out some sort of transaction as opposed to aborting it in the other cases
shinnya has quit [Ping timeout: 252 seconds]
wrkrcoop has joined #ruby
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tyang has quit [Ping timeout: 264 seconds]
last_staff has joined #ruby
nando294021 has quit [Ping timeout: 252 seconds]
symm- has joined #ruby
ChiefAlexander has joined #ruby
tyang has joined #ruby
ur5us has joined #ruby
dmix has quit [Read error: Connection reset by peer]
dreamyspell has joined #ruby
[Butch] has quit [Ping timeout: 276 seconds]
Devalo has quit [Remote host closed the connection]
Devalo has joined #ruby
blackgoat has joined #ruby
sergey_makagon has joined #ruby
solars has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
Devalo has quit [Ping timeout: 244 seconds]
<kegster>
elomatreb, no it didn't work
<kegster>
sorry i'm on hotspot
<kegster>
the API is throwing a java error
eizua has quit [Quit: Leaving]
<kegster>
i just had to use the api to get around it lol
bkxd has quit [Ping timeout: 240 seconds]
kriskropd has quit [Quit: WeeChat 0.4.2]
rajdesai has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 265 seconds]
sharkman has joined #ruby
dreamyspell has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Ping timeout: 264 seconds]
djbkd has quit [Remote host closed the connection]
zacts has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
roflmyeggo has joined #ruby
dreamyspell has joined #ruby
zacts has joined #ruby
<jhass>
borodin: ruby is pass by reference, so no need to put anything back in. Just use .find to get a hold of it
<hightower2>
Hey folks, 6 months ago or so someone here gave a 3-4 line recipe how to change the class' parent/superclass in runtime (it involved a pointer manipulation in C). Does anyone what that code snippet was?
LuckyABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
postmodern has quit [Ping timeout: 250 seconds]
Tristan-Speccy has quit [Ping timeout: 240 seconds]
doublemalt_ has quit [Ping timeout: 244 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kirun has quit [Quit: Client exiting]
ecnalyr has quit []
rajdesai has quit [Remote host closed the connection]
<OTORelic1>
q
swills_ has quit [Ping timeout: 276 seconds]
bkxd has quit [Ping timeout: 250 seconds]
leea has joined #ruby
synthroi_ has quit []
bkxd has joined #ruby
sharkman has quit [Ping timeout: 264 seconds]
ixti has quit [Quit: WeeChat 1.5]
sharkman has joined #ruby
borodin has quit [Ping timeout: 250 seconds]
postmodern has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 240 seconds]
doublemalt_ has joined #ruby
<wrkrcoop>
im trying to test this one method which creates threads. im getting back an array of threads. can ilook into those dead threads to see what data the contain? im expecting an object from all of them
<toretore>
no
<jhass>
the last expression of a threads body is available as Thread#value
yardenbar has quit [Ping timeout: 250 seconds]
kavanagh has joined #ruby
<wrkrcoop>
thank you. will try that
Rickmasta has joined #ruby
hipertracker has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
der-landgraf has quit [Quit: WeeChat 1.5]
LuckyABA has joined #ruby
ineb has joined #ruby
AndyBotwin has quit [Quit: Leaving]
solars has quit [Ping timeout: 240 seconds]
matcouto has joined #ruby
last_staff has quit [Quit: last_staff]
bmurt has joined #ruby
kavanagh has quit [Quit: That's all folks!]
goofy has quit [Quit: Lost terminal]
nando293921 has joined #ruby
eljimmy has joined #ruby
RegulationD has joined #ruby
<wrkrcoop>
im trying to stub a method but i want the argument that the real method gets
<wrkrcoop>
is there a way to do that?
macsteps has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hahuang61 has quit [Ping timeout: 244 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
RegulationD has quit [Read error: Connection reset by peer]
dminuoso_ has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
GinoManWorks has joined #ruby
dminuoso_ has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shmuli has joined #ruby
jaequery has joined #ruby
zacts has quit [Quit: WeeChat 1.4]
malconis_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pupeno has joined #ruby
dminuoso_ has quit [Ping timeout: 258 seconds]
Zapperino has quit [Quit: Bye]
dminuoso_ has joined #ruby
Zapperino has joined #ruby
swills_ has joined #ruby
ruid has joined #ruby
sharkman has quit [Ping timeout: 260 seconds]
mooru has joined #ruby
jhooker has quit [Ping timeout: 258 seconds]
doublemalt_ has quit [Remote host closed the connection]
jhooker has joined #ruby
rocknrollmarc has quit [Read error: Connection reset by peer]
djbkd has quit [Remote host closed the connection]
Zapperino has quit [Read error: Connection reset by peer]
Zapperino has joined #ruby
solrize has joined #ruby
AzureStigma has joined #ruby
<solrize>
what's the simplest way in ruby to execute a block of code 17 times?
killerkamel has quit [Ping timeout: 252 seconds]
minimalism has quit [Quit: minimalism]
ChiefAlexander has quit [Quit: Leaving...]
<toretore>
17.times{ code }
<solrize>
i'm asking because of a discussion happening in the python community about whether it's bogus to require using a for loop with an index
AndChat|460649 has joined #ruby
<solrize>
aha thanks
byteflame has quit [Ping timeout: 240 seconds]
AndChat|460649 has quit [Client Quit]
Zapperino has quit [Read error: Connection reset by peer]
Zapperino has joined #ruby
solrize has left #ruby ["Leaving"]
JeanCarloMachado has joined #ruby
djbkd has joined #ruby
shmuli has quit [Remote host closed the connection]
shmuli has joined #ruby
shmuli has quit [Remote host closed the connection]
Rickmasta has joined #ruby
jmignault has quit [Ping timeout: 276 seconds]
ruid has quit [Ping timeout: 265 seconds]
toretore has quit [Ping timeout: 258 seconds]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
vuoto has quit [Remote host closed the connection]
skade has quit [Read error: Connection reset by peer]
<OTORelic1>
q!
ensyde has quit [Quit: WeeChat 1.5]
jhack has joined #ruby
weemsledeux has joined #ruby
davedev24 has quit [Remote host closed the connection]
sp_ has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
spudowiar has joined #ruby
nhhc has joined #ruby
zeroDi has joined #ruby
OTORelic1 has quit [Ping timeout: 250 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lxsameer has quit [Quit: WeeChat 1.5]
rajdesai_ has joined #ruby
bkxd has joined #ruby
QORRiE has quit [Quit: Leaving]
nerium has quit [Read error: Connection reset by peer]
nerium has joined #ruby
rajdesai has quit [Ping timeout: 258 seconds]
shmuli has joined #ruby
swills_ has quit [Ping timeout: 252 seconds]
Ariadeno has quit [Ping timeout: 240 seconds]
Ariadeno has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
<fergal>
guys, if i have an if statement that calls a function, like `if myfunc …`, and myfunc returns an empty array like [], why does the if body execute when if i change my if to `if myfunc == true …` the if body fails to execute?
<fergal>
so i guess my question is why does myfunc returning a [] evaluate to true, whereas checking that the result of myfunc is == true, evaluate to false?
cd-rum has joined #ruby
<drbrain>
fergal: the only objects that ruby consides non-true or `nil` and `false`
<drbrain>
0, [], "" are all considered truthy
<drbrain>
maybe you want if myfunc.empty?
<fergal>
drbrain: but although they are truthy they do not == true?
tvw has joined #ruby
<drbrain>
they do not equal true
<drbrain>
only true == true
axl_ has quit [Quit: axl_]
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<wrkrcoop>
im trying to write a spec to test my threads. im using a file to mock out an endpoint, but im getting this error about
Ariadeno has quit [Ping timeout: 276 seconds]
<wrkrcoop>
ah nvm
Bugboy1028 has quit [Ping timeout: 258 seconds]
bkxd has quit [Ping timeout: 265 seconds]
Ariadeno has joined #ruby
grenierm has joined #ruby
swills_ has joined #ruby
byteflame has joined #ruby
macsteps has joined #ruby
Serpent has joined #ruby
nando293921 has joined #ruby
djbkd has quit [Quit: My people need me...]
macsteps has quit [Ping timeout: 258 seconds]
marxarelli|afk has quit [Max SendQ exceeded]
UserInNeed has quit [Ping timeout: 276 seconds]
RegulationD has quit [Remote host closed the connection]
byteflame has quit [Ping timeout: 244 seconds]
UserInNeed has joined #ruby
Silthias1 has joined #ruby
claw has quit [Ping timeout: 260 seconds]
AzureStigma is now known as AzureStigma|Away
AzureStigma|Away has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
definiv has joined #ruby
claw has joined #ruby
chouhoulis has quit [Remote host closed the connection]
definiv has quit [Client Quit]
chouhoulis has joined #ruby
jhooker has quit [Quit: Leaving]
grenierm has quit [Quit: grenierm]
Silthias has quit [Ping timeout: 250 seconds]
grenierm has joined #ruby
Rickmasta has joined #ruby
etetz has quit [Remote host closed the connection]
shmuli has quit [Remote host closed the connection]
Pupeno has quit [Remote host closed the connection]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spider-mario has quit [Remote host closed the connection]
etetz has joined #ruby
SilverKey has joined #ruby
chouhoulis has quit [Ping timeout: 252 seconds]
Es0teric has joined #ruby
killerkamel has joined #ruby
<wrkrcoop>
is it possible to read a file at the same time with 10 different threads?
mistermo_ has quit [Remote host closed the connection]
aries_liuxueyang has quit [Ping timeout: 276 seconds]
<baweaver>
readonly, sure
<baweaver>
though the second you try and write...
<baweaver>
well, let's just say Mutex is not a fun field of study
mistermocha has joined #ruby
etetz has quit [Ping timeout: 250 seconds]
firstdayonthejob has quit [Ping timeout: 264 seconds]
<wrkrcoop>
yeah im not writing to the file
fergal has quit [Quit: fergal]
<wrkrcoop>
just trying to run a spec
killerkamel has quit [Ping timeout: 244 seconds]
<baweaver>
What I would do is read the file before the threads even have to open
minimalism has joined #ruby
<baweaver>
considering it's read-only it's best not to have to read it more than once
astrobun_ has joined #ruby
the_rhizo has quit [Ping timeout: 264 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
<aeruder>
you need to open the file 10 times (once per thread)
nettoweb has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
byteflame has joined #ruby
bkxd has joined #ruby
Silthias1 has quit [Ping timeout: 260 seconds]
etetz has joined #ruby
sharkman has joined #ruby
Gasher has quit [Quit: Leaving]
etetz has quit [Ping timeout: 240 seconds]
hipertracker has quit [Quit: hipertracker]
<hightower2>
Hey I don't get this behavior of Array#grep: a= ['a','b','c']; a.grep(/a/) == ['a']. However when values are numbers, e.g. a = [1,2,3], then a.grep(/1/) is []. What's the catch here?
rajdesai has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
solars has quit [Ping timeout: 252 seconds]
karapetyan has joined #ruby
wrkrcoop has joined #ruby
hahuang61 has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]