segy has quit [Read error: Connection reset by peer]
fedruantine has quit [Max SendQ exceeded]
yfeldblu_ has quit [Remote host closed the connection]
yfeldblum has joined #ruby
Fuzai has quit [Quit: Leaving.]
segy has joined #ruby
Vingador has joined #ruby
haraigoshi has quit [Ping timeout: 272 seconds]
lightt has joined #ruby
segy has quit [Client Quit]
m_antis has joined #ruby
pepee has joined #ruby
flashpoi_ has quit [Remote host closed the connection]
m_antis has quit [Remote host closed the connection]
Vingador has quit [Remote host closed the connection]
ncthom91 has joined #ruby
AustinMatherne has joined #ruby
Vingador has joined #ruby
AustinMatherne has quit [Client Quit]
Vingador has quit [Read error: Connection reset by peer]
Vingador has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
Yiota has joined #ruby
segy has joined #ruby
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
palms has joined #ruby
AustinMatherne has joined #ruby
panpainter has joined #ruby
<shevy>
yo agent_white
panpainter has quit [Ping timeout: 252 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pilne>
i know the "... the hard way tutorials" have their flaws, but is what the author says about "for X in Y" type loops being "broken intentionally" true? I'm not uncomfortable with the each syntax, just curious about that statement.
dobbee has joined #ruby
<shevy>
if it is valid ruby syntax it goes
<shevy>
but it is not very idiomatic or common
<shevy>
when you can already use .each or variants of it
ncthom91 has joined #ruby
duckpupp1 has joined #ruby
johnDoe111 has joined #ruby
spyder55 has quit []
<pilne>
i understand that (maybe it was different at the time of writing?), the author just stated directly "They went so far as to break the for-each version of looping so that there are problems with using it, forcing you to conform to their culture." so I was curious.
haraigoshi has joined #ruby
<pilne>
i know the guy is highly opinionated, so i saw that and raised an eyebrow, because "intentionally breaking" something seems very anti-ruby to me, depreciate, yes, break no.
duckpupp1 has quit [Ping timeout: 240 seconds]
rehat has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
JazzyVariable227 has joined #ruby
skweek has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
JazzyVariable227 has quit [Ping timeout: 240 seconds]
panpainter has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
kspencer has joined #ruby
<shevy>
he is very opinionated
haraigoshi has quit [Ping timeout: 240 seconds]
panpainter has quit [Ping timeout: 252 seconds]
<shevy>
in general it would strike me as better to use a tutorial written by someone who also actually uses the language. admittedly though the amount of people who wriet a tutorial in the first place, is very very small compared to all those who do use a language
certainty has joined #ruby
haraigoshi has joined #ruby
davedev24 has quit []
arooni has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karmatr0n has joined #ruby
certainty has quit [Ping timeout: 258 seconds]
skweek has joined #ruby
xxneolithicxx has joined #ruby
GaryKing has joined #ruby
karmatr0n has quit [Ping timeout: 260 seconds]
xxneolithicxx has quit [Client Quit]
ur5us has joined #ruby
haraigoshi has quit [Ping timeout: 264 seconds]
<pilne>
its not my only tutorial, nor my first, i just needed something kinda productive, but not too mentally taxing to take on tonight :)
armyriad has joined #ruby
<pilne>
and i was like "what better tutorial author to follow when drunk?" lol.
bluOxigen has quit [Ping timeout: 240 seconds]
GaryKing has quit [Quit: GaryKing]
bluOxigen has joined #ruby
ur5us has quit [Ping timeout: 276 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
sandstrom has joined #ruby
snath has joined #ruby
kraken_ has quit [Quit: Leaving]
ur5us has quit [Ping timeout: 264 seconds]
Niham has joined #ruby
jord-n has joined #ruby
PaulCape_ has joined #ruby
kotk has joined #ruby
haraigoshi has joined #ruby
PaulCapestany has quit [Ping timeout: 250 seconds]
ekinmur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
c355e3b has quit [Quit: Connection closed for inactivity]
dcunit3d has joined #ruby
pawnbox has quit [Ping timeout: 244 seconds]
<pilne>
there is a second edition for sale as a book it would seem
jaguarmagenta has quit [Remote host closed the connection]
xlegoman has quit [Ping timeout: 246 seconds]
xlegoman has joined #ruby
braincrash has joined #ruby
braincrash is now known as braincras
jackjackdripper has quit [Quit: Leaving.]
jenrzzz has joined #ruby
k3rn31 has joined #ruby
haraigoshi has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
haraigoshi has joined #ruby
PaulCapestany has joined #ruby
CircleDot has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
PaulCape_ has quit [Ping timeout: 260 seconds]
kspencer has quit [Quit: WeeChat 1.3]
SuperLag has joined #ruby
blackmesa has joined #ruby
Canucktux has joined #ruby
Vingador has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
kspencer has joined #ruby
mistermocha has joined #ruby
blackmesa has quit [Ping timeout: 258 seconds]
dcunit3d has quit [Ping timeout: 250 seconds]
freerobby has joined #ruby
certainty has joined #ruby
gix has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
haraigoshi has quit [Ping timeout: 244 seconds]
zacts has quit [Ping timeout: 250 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
freerobby has quit [Client Quit]
karmatr0n has joined #ruby
gix has joined #ruby
certainty has quit [Ping timeout: 276 seconds]
pilne has quit [Quit: Quitting!]
pontiki has joined #ruby
howdoi has joined #ruby
karmatr0n has quit [Ping timeout: 240 seconds]
hk238 has joined #ruby
symm- has quit [Ping timeout: 244 seconds]
panpainter has joined #ruby
PaulCape_ has joined #ruby
palms has quit [Ping timeout: 252 seconds]
zacts has joined #ruby
terminalrecluse has joined #ruby
jord-n has quit [Ping timeout: 250 seconds]
benlieb has quit [Quit: benlieb]
chopin has joined #ruby
PaulCapestany has quit [Ping timeout: 246 seconds]
spyder55 has joined #ruby
panpainter has quit [Ping timeout: 246 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
johnDoe111 has joined #ruby
chopin has quit [Ping timeout: 246 seconds]
dobbee has quit [Quit: Quit]
ryan_notabot has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
nadir has quit [Quit: Connection closed for inactivity]
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
k3rn31 has joined #ruby
jackjackdripper has joined #ruby
JazzyVariable227 has joined #ruby
nankyokusei has joined #ruby
jaguarmagenta has joined #ruby
kraken_ has joined #ruby
jaguarmagenta has quit [Read error: Connection reset by peer]
noodle has quit [Ping timeout: 258 seconds]
jaguarmagenta has joined #ruby
kraken_ is now known as Silva_k
solocshaw has joined #ruby
<Silva_k>
So I've used YAML to serialize objects in their current states with their current instance variables, and I've generated json for hashes, but can I used json in a similar way to the way I've used YAML?
arescorpio has quit [Quit: Leaving.]
jackjackdripper1 has joined #ruby
jackjackdripper has quit [Ping timeout: 244 seconds]
A124 has quit [Ping timeout: 240 seconds]
JazzyVariable227 has quit [Remote host closed the connection]
Silva_k is now known as kraken_
yatish27 has joined #ruby
nankyokusei has quit [Ping timeout: 258 seconds]
jaguarmagenta has quit [Ping timeout: 240 seconds]
chopin has joined #ruby
PaulCapestany has joined #ruby
benlieb has joined #ruby
jenrzzz has joined #ruby
duckpupp1 has joined #ruby
PaulCape_ has quit [Ping timeout: 260 seconds]
hutch34 has quit [Ping timeout: 252 seconds]
duckpupp1 has quit [Ping timeout: 264 seconds]
ryan_notabot has quit [Ping timeout: 244 seconds]
houhouli_ has joined #ruby
solocshaw1 has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
houhoulis has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
solocshaw1 has quit [Ping timeout: 250 seconds]
certainty has joined #ruby
noodle has joined #ruby
solocshaw has joined #ruby
hutch34 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
JazzyVariable227 has joined #ruby
roamingdog has quit []
certainty has quit [Ping timeout: 244 seconds]
lightt has quit [Remote host closed the connection]
PaulCape_ has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
hutch34 has quit [Ping timeout: 264 seconds]
PaulCapestany has quit [Ping timeout: 252 seconds]
ElFerna has quit [Ping timeout: 260 seconds]
palms has joined #ruby
lightt has joined #ruby
djbkd has joined #ruby
slackbotgz has joined #ruby
soLucien has joined #ruby
duncannz has quit [Ping timeout: 246 seconds]
<soLucien>
hi guys i am trying to debug some ruby code
<baweaver>
I don't use an IDE so I wouldn't know about their built in debugging facilities. It might allow options like that, but I do know for a fact that Pry allows similar options
<soLucien>
it's been merged into the official version
<baweaver>
ah
<soLucien>
without some of the features removed
pawnbox has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
PaulCapestany has joined #ruby
<baweaver>
best bet is to try their IRC channel on a weekday or hit the mailing lists.
<baweaver>
or try back here on a weekday, maybe someone works vagrant
<soLucien>
i am there all the time
_Tariq has quit []
<baweaver>
StackOverflow might be worth a shot as well
<soLucien>
there is no one that can help . i have been asking for the last few months
<baweaver>
I just know that anything I can do here would be blind guessing as well.
<soLucien>
they don't watch irc, gitter or any other comm channel
<baweaver>
Have you contacted their support?
<soLucien>
the mailing list is something i have not tried yet
<soLucien>
no, no support
<baweaver>
give them both a shot
PaulCape_ has quit [Ping timeout: 244 seconds]
<baweaver>
I'd find it hard to believe that they have no point of communication for asking questions, or that StackOverflow wouldn't be able to help on it.
<baweaver>
Considering Hashicorp is fairly active on OS and Vagrant is one of their flagships
<soLucien>
i have not tried stackoverflow, mailing lists or their support
<soLucien>
not posting , that is
<soLucien>
i have read all there is to read
tref has quit [Quit: tref]
<soLucien>
but not asked. I have asked IRC and gitter
pawnbox has quit [Ping timeout: 276 seconds]
<baweaver>
There's always something you haven't read
<baweaver>
normally in a very dark corner of the internet somewhere that explains your exact issue with no actual solution.
<soLucien>
anyways, i am bootstrapping the powershell lib directly in the vagrantfile code at the moment, and it is working fine. I can use it, and it does its job. But creating a full-fledged plugin using their DSL is the next step, so evryone else can use it
<soLucien>
plus, i hate having 50 lines at the beginning of the file and copying them around
kmooney has quit [Quit: Lost terminal]
nankyokusei has joined #ruby
irrationalist has quit [Quit: @]
nankyokusei has quit [Ping timeout: 252 seconds]
johnbat26 has joined #ruby
jaguarmagenta has quit [Remote host closed the connection]
ta_ has joined #ruby
hakunin_ has quit []
<soLucien>
<baweaver> pry or pry-byebug ?
rkazak has joined #ruby
pythoninthegrass has quit [Quit: Textual IRC Client: www.textualapp.com]
PaulCape_ has joined #ruby
blaxter has joined #ruby
Madplatypus has joined #ruby
PaulCapestany has quit [Ping timeout: 240 seconds]
kareeoleez has quit [Remote host closed the connection]
jas02 has joined #ruby
minimalism has quit [Quit: minimalism]
kareeoleez has joined #ruby
johnDoe111 has joined #ruby
certainty has joined #ruby
kareeoleez has quit [Ping timeout: 246 seconds]
edwardly has quit [Ping timeout: 276 seconds]
johnDoe111 has quit [Ping timeout: 276 seconds]
certainty has quit [Ping timeout: 260 seconds]
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
ta_ has quit [Ping timeout: 276 seconds]
lightt has joined #ruby
hutch34 has joined #ruby
djbkd has quit [Remote host closed the connection]
houhouli_ has quit [Remote host closed the connection]
A124 has joined #ruby
lxsameer has joined #ruby
hutch34 has quit [Ping timeout: 252 seconds]
vdamewood has quit [Ping timeout: 240 seconds]
spyder55 has quit []
kareeoleez has joined #ruby
PaulCapestany has joined #ruby
dcunit3d has quit [Ping timeout: 250 seconds]
firstdayonthejob has joined #ruby
kareeoleez has quit [Ping timeout: 258 seconds]
yatish27 has quit [Remote host closed the connection]
yatish27 has joined #ruby
yatish27 has quit [Remote host closed the connection]
PaulCape_ has quit [Ping timeout: 244 seconds]
kgrz has joined #ruby
solars has joined #ruby
moei has quit [Quit: Leaving...]
duckpupp1 has quit [Ping timeout: 264 seconds]
dcunit3d has joined #ruby
moei has joined #ruby
johnmilton has quit [Remote host closed the connection]
pawnbox has joined #ruby
kareeoleez has joined #ruby
agent_white has quit [Quit: brb]
agent_white has joined #ruby
dcunit3d has quit [Ping timeout: 244 seconds]
Hyuk has joined #ruby
Hyuk has quit [Client Quit]
pawnbox has quit [Ping timeout: 264 seconds]
kareeoleez has quit [Ping timeout: 252 seconds]
dcunit3d has joined #ruby
<kraken_>
So when I'm using JSON with ruby, and I serialize a hash into json, then I deserialize it back into an object, the symbol keys will be string keys isntead? I guess there's no way around this?
solocshaw1 has joined #ruby
palms has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
<iCHAIT>
the data goes, but not with the correct content type
tildes has quit [Ping timeout: 264 seconds]
djbkd has quit [Ping timeout: 244 seconds]
PaulCapestany has quit [Ping timeout: 252 seconds]
blackmesa has joined #ruby
kareeoleez has joined #ruby
<jhass>
which would be "application/json", not "json"
<jhass>
side note: Hash[a => b] is the same as Hash[{a => b}] because it's the same as Hash.[](a => b) and thus the same as Hash.[]({a => b}), in other words the Hash[] is redundant
kareeoleez has quit [Ping timeout: 276 seconds]
nankyokusei has quit [Remote host closed the connection]
Madplatypus has quit [Quit: Connection closed for inactivity]
<toretore>
just use net/http. if you start using one of the many wrapper libs you are going to find yourself having to step down to the net/http level at one point anyway
nrk has quit [Client Quit]
nankyokusei has joined #ruby
sash_ has quit [Ping timeout: 264 seconds]
PaulCapestany has joined #ruby
dcunit3d has joined #ruby
tessi_zz has quit [Ping timeout: 258 seconds]
kareeoleez has joined #ruby
yude has joined #ruby
lightt has quit [Remote host closed the connection]
asahi has joined #ruby
nankyokusei has quit [Ping timeout: 258 seconds]
PaulCape_ has quit [Ping timeout: 252 seconds]
davedev24 has joined #ruby
<fgimian>
toretore thanks
<fgimian>
:)
<asahi>
Hello, I have a 1 character string that looks like a space but var == ' ' returns false, and #strip doesn't change it. #encoding returns UTF-8. Any ideas?
kareeoleez has quit [Ping timeout: 272 seconds]
digneety has joined #ruby
<chris2>
var.ord
<asahi>
160
<chris2>
nbsp i think
<chris2>
00A0 NO-BREAK SPACE
<asahi>
okay thanks. I'm not familiar with that, but I'll google it
<ytti>
it's normal sapce, which when rendered should not cause line wraps
<ytti>
in practice virtually no programming language considers it normal break syntactically
<ytti>
causing weird and hard to troubleshoot errors
aryaching has joined #ruby
<chris2>
category space tho
<ytti>
i disable it on my computers, because i tend to accidentally insert if oafter } and ]
<ytti>
so bunch of my code has after those NBSP
norc has joined #ruby
<ytti>
(i need alt-gr for those, an if i keep alt-gr pressed too long and press space, then i make NBSP)
<ytti>
jhass, so 1 + 1 with space or with NBSP should be same
zacstewart has quit [Ping timeout: 250 seconds]
<jhass>
but then I don't really want mixed whitspace in my code
isxek has joined #ruby
<ytti>
NBSP seems what we actually want to use always
bkxd has quit [Ping timeout: 244 seconds]
<ytti>
because we don't want them to be wrapped
danieli has quit [Ping timeout: 246 seconds]
mdw_ has joined #ruby
rapha has joined #ruby
<rapha>
Hi!
<jhass>
well we want them to be wrapped in string literals
<rapha>
Why does this return a Syntax Error? "if (@user.name.blank? ? (_('User #%{id}') % {id: @user.id}) : @user:name) ..."
<rapha>
ur sorry
ElFerna has joined #ruby
<rapha>
without the "if"
<jhass>
rapha: post the exact error message you get too and we can look at it together
hutch34 has quit [Ping timeout: 240 seconds]
<rapha>
oh nooooooes
<toretore>
@user:name
<rapha>
jhass: as usual, just posting it here made me see the problem: "@user:name" should be "@user.name"
<rapha>
sorry guys
* jhass
wait's for the question about the '#{}' issue :P
danieli has joined #ruby
<rapha>
what %{} issue?
<rapha>
:)
<jhass>
you'll see soon enough
mdw has quit [Ping timeout: 240 seconds]
<jhass>
or, %{}, the # confused me -.-
dh64 has quit [Quit: Konversation terminated!]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
PaulCape_ has joined #ruby
<toretore>
i'm just wondering what _ does
<jhass>
history question, why do we have eql? and ==?
ryan_notabot has joined #ruby
<jhass>
toretore: smells like gettext
<rapha>
jhass: so since it's % and not # there should be no problem, right?
<toretore>
oh right
freerobby has joined #ruby
<rapha>
toretore: _() is for gettext i18n'ing
<jhass>
rapha: yes, sorry, ignore me
<rapha>
okay :)
* rapha
can't stand Rails' i18n
PaulCapestany has quit [Ping timeout: 252 seconds]
banister has joined #ruby
<norc_>
jhass, I'm thinking it has to do with the automatic coercion on some types like numerics.
<jhass>
as in == does it and eql? doesn't?
<norc_>
jhass, yes.
<jhass>
mmh
<rapha>
Guys, I'm so happy to have discovered Ruby! All the Haskell and Rust and What-Have-You-Fanboys can talk all they want, I've found my programming-home, and that includes #ruby! :)
<shevy>
there are 1405 on #haskell :(
bkxd has joined #ruby
<rapha>
So what shevy
<shevy>
I guess 80% of these are just people who want to find out what monads are
<rapha>
Not sure what number's what in my Weechat status line, but it looks like 972 here.
<shevy>
yeah
<rapha>
In 2016, that's a lot of people in an IRC channel.
freerobby has quit [Ping timeout: 258 seconds]
sergey_makagon has quit [Remote host closed the connection]
weckl has quit [Quit: Leaving]
peitur has joined #ruby
blackmesa has quit [Ping timeout: 258 seconds]
certainty has joined #ruby
symm- has quit [Ping timeout: 276 seconds]
Guest66538 is now known as sash_
sash_ has quit [Changing host]
sash_ has joined #ruby
sash_ has quit [Changing host]
sash_ has joined #ruby
hutch34 has joined #ruby
freerobby has joined #ruby
<norc_>
jhass, honestly its still a mess though. === is called rb_equal internally, then you have == which does something differently entirely, and then eql? with a slight difference by convention...
certainty has quit [Ping timeout: 250 seconds]
<jhass>
norc_: don't forget equal? !
pawnbox has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
digneety has quit [Quit: digneety]
<norc_>
jhass, all of that got me confused. Now Ill just compare object IDs directly - at least then I know what I'm doing. ;-)
pwnd_nsfw has quit [Read error: Connection reset by peer]
<toretore>
catphish: you can force_encoding after reading
<ericli>
like this?
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
johnDoe111 has joined #ruby
xfbs has joined #ruby
<toretore>
catphish: (i recently looked into doing the same, and figured this was a lot easier)
<catphish>
toretore: unfortunately my issue is writing, not reading
<toretore>
oh
<toretore>
that's another issue
<shevy>
ericli this would be one way that should work. I am not sure what exactly you have to do though
xfbs has quit [Max SendQ exceeded]
kareeoleez has quit [Remote host closed the connection]
<shevy>
ericli break false should suffice but it reads weird, I never wrote that myself so far :)
<catphish>
i've probably got come code somewhere that does it, i'll grep my company's source code :)
<ericli>
shevy: oh my code just hole the def ca return false once a loop condition is met then break the loop.
xfbs has joined #ruby
<ericli>
shevy: so sounds like break then false makes more sense.
duckpupp1 has quit [Ping timeout: 258 seconds]
<toretore>
catphish: popen3 uses Kernel#spawn, which i think has these options, but i don't know how to get them to survive the layers on their way down there
<catphish>
toretore: popen3 has an options option, so i'd think it would be passed through
ctp has joined #ruby
<catphish>
but i couldnt figure out what option it would be
<catphish>
i just want it to open the pipes as binaryu
<catphish>
alternatively, maybe i can reopen somehow
PaulCape_ has joined #ruby
<toretore>
spawn is less than clearly documented, but i think using something like "cmd:binary" might work
blackmesa has joined #ruby
johnDoe111 has quit [Ping timeout: 260 seconds]
<catphish>
i just found this code: pid, stdin, stdout, stderr = Open4::popen4(command); stdin.set_encoding('BINARY')
<catphish>
hopefully that'll work :)
<catphish>
stdin.set_encoding("BINARY") << this works! i guess thats a method on IO
<toretore>
right; popen3 creates pipes using IO.pipe, and those are the objects you get in the block, and it should work if set_encoding works on pipes
<toretore>
yay
<catphish>
seems it does :)
<catphish>
thanks
PaulCapestany has quit [Ping timeout: 252 seconds]
<catphish>
just wanted to pipe some images through external imagemagick
ramfjord has joined #ruby
Rodya_ has quit [Remote host closed the connection]
David_H__ has joined #ruby
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 276 seconds]
Rodya_ has joined #ruby
jaguarmagenta has joined #ruby
m8 has joined #ruby
infinity__ has quit [Quit: Leaving]
David_H_Smith has quit [Ping timeout: 250 seconds]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 252 seconds]
van has joined #ruby
palms has joined #ruby
iajrz has joined #ruby
jaguarmagenta has quit [Ping timeout: 250 seconds]
chouhoulis has quit [Remote host closed the connection]
palms has quit [Ping timeout: 252 seconds]
vuoto has quit [Remote host closed the connection]
yatish27 has joined #ruby
yatish27_ has joined #ruby
alfiemax has joined #ruby
mdw has joined #ruby
hutch34 has joined #ruby
nobitanobi has quit [Remote host closed the connection]
digneety has joined #ruby
yatish27 has quit [Ping timeout: 250 seconds]
haraigoshi has quit [Ping timeout: 258 seconds]
yude has quit [Read error: Connection timed out]
dcunit3d has joined #ruby
mdw has quit [Ping timeout: 260 seconds]
nobitanobi has joined #ruby
yude has joined #ruby
vuoto has joined #ruby
xfbs has quit []
dcunit3d has quit [Ping timeout: 246 seconds]
lusory has joined #ruby
johnDoe111 has joined #ruby
nobitanobi has quit [Remote host closed the connection]
infra-red has joined #ruby
k3rn31 has quit [Quit: Leaving...]
digneety has quit [Quit: digneety]
exadeci has quit [Quit: Connection closed for inactivity]
blackmesa has quit [Ping timeout: 250 seconds]
mello has quit [Remote host closed the connection]
johnDoe111 has quit [Ping timeout: 244 seconds]
houhoulis has joined #ruby
chipotle has quit [Quit: cheerio]
AlexRussia has quit [Ping timeout: 250 seconds]
kareeoleez has joined #ruby
mdw has joined #ruby
postmodern has quit [Ping timeout: 250 seconds]
rkazak has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
nankyokusei has quit [Remote host closed the connection]
panpainter has joined #ruby
iCHAIT has left #ruby [#ruby]
fenre has quit []
aryaching has quit [Ping timeout: 252 seconds]
panpainter has quit [Ping timeout: 252 seconds]
mistermocha has joined #ruby
postmodern has joined #ruby
sk_0 has quit [Remote host closed the connection]
hightower2 has quit [Ping timeout: 244 seconds]
arlek has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
mdw has quit [Read error: Connection reset by peer]
mdw has joined #ruby
fedruantine has joined #ruby
iajrz` has joined #ruby
iajrz has quit [Ping timeout: 244 seconds]
diegoviola has joined #ruby
nankyokusei has joined #ruby
TomyLobo has quit [Disconnected by services]
TomyLobo has joined #ruby
kgrz has joined #ruby
van has quit [Ping timeout: 276 seconds]
Hobogrammer has joined #ruby
palms has joined #ruby
freerobby has joined #ruby
Mon_Ouie has joined #ruby
van has joined #ruby
vuoto has quit [Remote host closed the connection]
<shevy>
if you use a loop {}, then break like that, I don't think you will reach the statement below break
<shevy>
you are not even using a loop in this case though, you just iterate over a finite collection
<shevy>
you can use .select and .reject btw to filter away unwanted or wanted entries there
pepee has joined #ruby
<ericli>
shevy: so how can I return false if one is met the condition ?
Rodya_ has quit [Remote host closed the connection]
<ericli>
shevy: okay I will use a countr
mdw_ has joined #ruby
<toretore>
use Enumerable#any?
Rodya_ has joined #ruby
mdw has quit [Ping timeout: 240 seconds]
<toretore>
(you can "return" from a loop with `break value`)
blackmesa has joined #ruby
tmtwd has joined #ruby
infra-re_ has joined #ruby
djbkd has joined #ruby
<ericli>
toretore: oh how to do that
lxsameer has quit [Ping timeout: 244 seconds]
infra-red has quit [Ping timeout: 276 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
jaguarmagenta has joined #ruby
<sergey_makagon>
ericli what logic do you want to have? In your example i see that you iterate over ports and if port is not 200 you return false in any other case you return true.
<ericli>
sergey_makagon: yes
<sergey_makagon>
ericli but each will not return any value for you in current implementation
<ericli>
sergey_makagon: huh, why? thsatus_code will test if I can get 200 response code.
<ericli>
*the status_code
lxsameer has joined #ruby
yude has quit [Read error: Connection timed out]
Vingador has joined #ruby
<ericli>
sergey_makagon: anything wrong?
Vingador has quit [Client Quit]
yude has joined #ruby
chouhoulis has joined #ruby
<sergey_makagon>
ericli map would return array of results, but each will not return anything even if you explicitly write it. Also you do the break which will be executed earlier than return
nofxx has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
<toretore>
ericli: you have to articulate the problem better to understand the solution
cwenner has quit [Read error: Connection reset by peer]
xfbs has joined #ruby
<ericli>
toretore: return 200 means true or it would be false.
<ericli>
I pasted a modified version
jgt has quit [Ping timeout: 250 seconds]
<toretore>
you're still describing your problem in terms of what you think is the solution
<toretore>
describe the problem for what it is, "i want to send an http request to a list of ports; if at least one of those doesn't return http 200, do x"
dcunit3d has joined #ruby
Guest_ has joined #ruby
<ericli>
toretore: hmm, sorry about that. but I mentioned what I expected, return true or false based on the requests result.
k3rn31 has quit [Quit: Computer has gone to sleep.]
moeabdol1 has quit [Quit: WeeChat 1.4]
<ericli>
toretore: did u see the code I pasted? I guess that explains what I'm saying.
tref has quit [Quit: tref]
<toretore>
i'm trying to make you think about the problem in such a way that you can solve it yourself and then learn to solve similar problems in the future
<toretore>
but anyway, i don't have time right now, so here: [80, 443, 4080].all?{|p| status_code(p) == 200 }
<sergey_makagon>
i would say that this will solve your problem: ![80, 443, 4080].any? { |port| status_code(port) != 200 }
Guest_ has quit [Client Quit]
idiocrash has joined #ruby
idiocrash has quit [Max SendQ exceeded]
jrafanie has joined #ruby
kavanagh has quit [Quit: That's all folks!]
idiocrash has joined #ruby
mikecmpbll has joined #ruby
<ericli>
thanks
hutch34 has quit [Ping timeout: 244 seconds]
mesamoo has joined #ruby
<shevy>
that's the beauty with ruby - more than one way to pick!
Edward__ has quit [Quit: Leaving]
<sergey_makagon>
yeah, but in my implementation it will not have to go through the all array of ports :P
duckpupp1 has joined #ruby
edwinvdg_ has quit [Read error: Connection reset by peer]
<sergey_makagon>
hmm, but maybe i'm wrong. all? will stop iterating if it's find false value as well.
edwinvdgraaf has joined #ruby
jrafanie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sergey_makagon>
so yes, that's the beauty of Ruby)
duckpupp1 has quit [Ping timeout: 264 seconds]
duckpuppy has joined #ruby
<shevy>
clever implementation!
flashpoint9 has joined #ruby
solars has quit [Ping timeout: 264 seconds]
phrozen77 has joined #ruby
minimalism has joined #ruby
Vingador has joined #ruby
minimalism has quit [Client Quit]
jaguarmagenta has quit [Remote host closed the connection]
snath has quit [Ping timeout: 260 seconds]
xxneolithicxx has joined #ruby
snath has joined #ruby
djbkd has quit [Remote host closed the connection]
dcunit3d has quit [Ping timeout: 264 seconds]
duckpuppy has quit [Ping timeout: 250 seconds]
fuso has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
<pilne>
ruby is very clever and very "nice" to the programmer
<spudowiar>
it's just sad it's so slow :(
<spudowiar>
I absolutely love Ruby though
swills has joined #ruby
speakingcode has quit [Ping timeout: 244 seconds]
<pilne>
i've seen a couple of projects that are trying to address that. crystal (a new langauge, ruby inspired), and helix (bindings and boilerplate for using rust from/in ruby)
<spudowiar>
heh
<spudowiar>
nice
marr has joined #ruby
xxneolithicxx has quit [Quit: Leaving.]
solars has joined #ruby
multi_io has quit [Ping timeout: 276 seconds]
<spudowiar>
Eurgh
<spudowiar>
Why does gsub! return nil if no replacements were made
multi_io has joined #ruby
<spudowiar>
I can't do gsub!.tr! then :(
<spudowiar>
wait!
<spudowiar>
no
<spudowiar>
that can't happen either
dcunit3d has joined #ruby
van has quit [Remote host closed the connection]
<shevy>
don't chain ! methods usually
mgdepoo has joined #ruby
<shevy>
you may then often end up doing nil.method!
<mgdepoo>
Hi! I'm new to Ruby and I'm having a hard time understanding this outcome: http://pastebin.com/FG2Fcex4
kareeoleez has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
arooni has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
moeabdol has joined #ruby
d0nn1e has quit [Ping timeout: 260 seconds]
axsuul has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 260 seconds]
d0nn1e has joined #ruby
A124 has quit [Quit: '']
nonnatus has joined #ruby
hightower2 has joined #ruby
TomyLobo has quit [Ping timeout: 260 seconds]
flashpoint9 has joined #ruby
Rutix has quit []
DoubleMalt has quit [Ping timeout: 260 seconds]
tmtwd has quit [Ping timeout: 276 seconds]
madh has quit [Quit: Leaving]
flashpoint9 has quit [Ping timeout: 240 seconds]
Rutix has joined #ruby
Rutix has quit [Changing host]
Rutix has joined #ruby
Fernando-Basso has quit [Ping timeout: 250 seconds]
ur5us has quit [Remote host closed the connection]
Vingador has quit [Remote host closed the connection]
roamingdog has joined #ruby
Gasher has joined #ruby
ur5us has joined #ruby
hutch34 has joined #ruby
<pilne>
so i have this block of code. given with that comment. I can *see* what is going on, and I know what I'm suppose to end up doing (line 2 needs to check for all numbers 0-9 inclusive).
<pilne>
i just can't think of an elegant way to do it.
<jhass>
perhaps one of my other two hints gets you there then ;)
roamingdog has quit [Remote host closed the connection]
<pilne>
thank you, i think one of those is along what the author expects, now that i think about it a bit more
pontiki has joined #ruby
ecksit has quit [Ping timeout: 252 seconds]
Fraeon has quit [Ping timeout: 276 seconds]
Fraeon has joined #ruby
lightt has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
Noxilex has joined #ruby
lightt has quit [Read error: Connection reset by peer]
lightt has joined #ruby
AndChat-688961 has quit [Ping timeout: 240 seconds]
Noxilex has quit [Remote host closed the connection]
blaxter has quit [Read error: Connection reset by peer]
jgt has quit [Ping timeout: 264 seconds]
crystal77 has joined #ruby
certainty has joined #ruby
hutch34 has quit [Quit: WeeChat 1.5]
e4xit_ has joined #ruby
alfiemax has joined #ruby
TubaraoSardinha has quit [Ping timeout: 250 seconds]
nettoweb has joined #ruby
certainty has quit [Ping timeout: 276 seconds]
e4xit has quit [Ping timeout: 252 seconds]
e4xit_ is now known as e4xit
TubaraoSardinha has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Fernando-Basso has joined #ruby
johnDoe111 has joined #ruby
solars has quit [Ping timeout: 252 seconds]
nettoweb has quit [Ping timeout: 240 seconds]
ryan_notabot has quit [Quit: Leaving]
palms has joined #ruby
johnDoe111 has quit [Ping timeout: 276 seconds]
banister has joined #ruby
pepee has joined #ruby
zenlot6 has joined #ruby
zenlot has quit [Ping timeout: 276 seconds]
maloik has quit [Remote host closed the connection]
<jokke>
anyone know of a yaml pull parser for ruby? can psych do this?
maloik has joined #ruby
palms has quit [Ping timeout: 252 seconds]
Gasher has quit [Ping timeout: 264 seconds]
palms has joined #ruby
Gasher has joined #ruby
spider-mario has quit [Remote host closed the connection]
ryan_notabot has joined #ruby
<pilne>
jhass-} judging by the same author's python example, it is supposed to only take strings composed of 0 and/or 1, and i'm not in the mood to try that without a regex LOL
<pilne>
i just used a regex for my original idea and i'm moving on
palms has quit [Ping timeout: 252 seconds]
ryan_notabot has quit [Client Quit]
kavanagh has quit [Quit: That's all folks!]
ryan_notabot has joined #ruby
djbkd has joined #ruby
firstdayonthejob has quit [Ping timeout: 250 seconds]
m8 has quit [Quit: Sto andando via]
pawnbox has joined #ruby
antranigv has left #ruby [#ruby]
newbie|2 has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
pawnbox has quit [Ping timeout: 258 seconds]
ur5us has joined #ruby
chicken has quit [Ping timeout: 250 seconds]
<jhass>
pilne: okay, to expand my hints: choice.chars.all? {|char| ('0'..'9').include? char } and (choice.chars - [*'0'..'9']).empty?
r1v3r_ has joined #ruby
<pontiki>
what is a "yaml pull parser" ?
<jhass>
a pull parser for yaml
<pontiki>
what is a pull parser?
Klantastic has joined #ruby
<jhass>
commonly called SAX in XML world
<Klantastic>
is changing a variable during runtime metaprogramming?