apeiros changed the topic of #ruby to: http://ruby-community.com || Ruby 2.2.2; 2.1.6; 2.0.0-p645: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org, other public logging is prohibited
duncannz has joined #ruby
Guest60_ has quit [Quit: Textual IRC Client: www.textualapp.com]
duncannz has quit [Max SendQ exceeded]
rodfersou has quit [Quit: leaving]
freerobby has quit [Quit: Leaving.]
metalic has quit [Quit: Leaving]
metalic has joined #ruby
djbkd has quit [Remote host closed the connection]
<xxneolithicxx> behold the power of cheese, one word answer lol
<xxneolithicxx> :-P
Deele has joined #ruby
juanpaucar has joined #ruby
evanjs has joined #ruby
vdamewood has quit [Max SendQ exceeded]
marr has quit []
MatthewsFace has quit [Remote host closed the connection]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lordkryss has quit [Quit: Connection closed for inactivity]
lidenskap has quit [Remote host closed the connection]
symbol has joined #ruby
enebo has quit [Quit: enebo]
metalic has quit [Quit: Leaving]
metalic has joined #ruby
juanpaucar has quit [Ping timeout: 245 seconds]
bruno- has quit [Ping timeout: 256 seconds]
lkba_ has quit [Read error: Connection reset by peer]
lkba has joined #ruby
evanjs has quit [Remote host closed the connection]
GaryOak_ has quit [Remote host closed the connection]
xploshioon has quit [Quit: Leaving]
paulcsmith has joined #ruby
graydot has joined #ruby
paulcsmith has quit [Client Quit]
aZaFred has quit [Remote host closed the connection]
laurentide has joined #ruby
JDiPierro has joined #ruby
mleung has quit [Quit: mleung]
neanderslob has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
lidenskap has joined #ruby
JDiPierro has quit [Remote host closed the connection]
mary5030 has joined #ruby
juanpablo_ has joined #ruby
cocotton has joined #ruby
crazydiamond has quit [Remote host closed the connection]
ruby597 has joined #ruby
ruby597 is now known as dudedudeman
dudedudeman has quit [Changing host]
dudedudeman has joined #ruby
dudedudeman has joined #ruby
Renich has joined #ruby
mary5030 has quit [Ping timeout: 245 seconds]
<dudedudeman> can anyone throw any gotchas or must knows about using .time in ruby?
juanpablo_ has quit [Ping timeout: 246 seconds]
stef204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
JDiPierro has joined #ruby
<A124> Unspecific question.
<dudedudeman> ok.
<Radar> dudedudeman: what A124 said.
<Radar> dudedudeman: What do you mean .time? Is that a method?
<Radar> Brozo: The Well-Grounded Rubyist and the Ruby Koans are what I recommend to everyone,.
<dudedudeman> i am learning about .time in ruby. i know that Time.zone.now is preferable when dealing wtith time zones, but i am looking to see if nayone with more experience in ruby could speak to any other tricks or tips that might need to be known
<Radar> Time.zone.now is a Rails method.
djbkd has joined #ruby
<dudedudeman> ah, that is good to know
<dudedudeman> i'm not dealing with rails at this point
symbol has quit [Ping timeout: 256 seconds]
Channel6 has joined #ruby
Sirupsen has joined #ruby
<Radar> How do you know about Time.zone.now then?
Sirupsen has quit [Client Quit]
uri has joined #ruby
Lucky___ has joined #ruby
<dudedudeman> the internet
<dudedudeman> i realize now that I was reading an article related to rails, not just ruby
JDiPierro has quit [Remote host closed the connection]
zorak8 has joined #ruby
xploshioon has joined #ruby
symbol has joined #ruby
<Radar> "the internet"
<Radar> pretty imprecise?
zorak8 has quit [Max SendQ exceeded]
<Radar> Do you have a link to this article?
mithrandeer has joined #ruby
arescorpio has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
zorak8 has joined #ruby
zorak8 has quit [Max SendQ exceeded]
mistermocha has joined #ruby
zorak8 has joined #ruby
zorak8 has quit [Max SendQ exceeded]
<sevenseacat> www.the.internet.com
<sevenseacat> i dont know what that will link to. maybe dont click it.
DEA7TH has quit [Ping timeout: 245 seconds]
vdamewood has joined #ruby
bricker has quit [Quit: leaving]
mistermocha has quit [Ping timeout: 256 seconds]
<dudedudeman> i clicked it
<dudedudeman> it takes you to internet.com
<dudedudeman> and it's just a site that wants you to search and create new domains
<sevenseacat> good good
keen_______ has quit [Read error: Connection reset by peer]
mrmargolis has quit [Remote host closed the connection]
mjuszczak has quit []
musashi1 has joined #ruby
<dudedudeman> Radar: this is one of the sites i'm looking at, though this is not one of the ones about rails, obviously because it's ruby-docs
keen_______ has joined #ruby
* Radar asks do you have a link to the article
<Radar> dudedudeman provides link to ruby-doc.org
* Radar is puzzled
* dudedudeman is dumb, he knows it
<dudedudeman> article, web page, site, i use them all interchangalby. please pardon me
* dudedudeman can't spell
<Radar> dudedudeman: I wanted a link to the article that you were reading that was talking about Time.zone.now.
danman has joined #ruby
<dudedudeman> the exact article i was reading for you then, http://stevenyue.com/2013/03/23/date-time-datetime-in-ruby-and-rails/
tanath has joined #ruby
jeramy_s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xploshioon has quit [Quit: Leaving]
Spami has joined #ruby
djbkd has quit [Remote host closed the connection]
musashi1 has quit [Ping timeout: 272 seconds]
uri has quit [Quit: Textual IRC Client: www.textualapp.com]
chipotle has joined #ruby
mithrandeer has quit [Remote host closed the connection]
Feyn has joined #ruby
danman has quit [Quit: danman]
jerematic has quit [Remote host closed the connection]
edwinvdgraaf has quit [Ping timeout: 245 seconds]
chipotle has quit [Client Quit]
chipotle has joined #ruby
chipotle has quit [Client Quit]
hazelux has joined #ruby
dfinninger has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
Limix has quit [Quit: Limix]
zoo-zed has quit [Quit: Textual IRC Client: www.textualapp.com]
djbkd has joined #ruby
mithrandeer has joined #ruby
Limix has joined #ruby
Limix has quit [Client Quit]
dfinninger has quit [Ping timeout: 246 seconds]
hazelux has quit []
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
camilasann has quit [Ping timeout: 276 seconds]
dx7 has joined #ruby
robustus has quit [Ping timeout: 264 seconds]
camilasan has joined #ruby
robustus|Off has joined #ruby
robustus|Off is now known as robustus
hanmac has quit [Ping timeout: 256 seconds]
mistermocha has joined #ruby
djbkd has quit [Remote host closed the connection]
iamjarvo has joined #ruby
dx7 has quit [Read error: Connection reset by peer]
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermo_ has joined #ruby
djbkd has joined #ruby
Brozo has left #ruby ["Leaving..."]
dx7 has joined #ruby
kbarry has quit [Ping timeout: 276 seconds]
charliesome_ has quit [Quit: zzz]
Guest42873 has joined #ruby
Guest42873 has quit [Changing host]
Guest42873 has joined #ruby
Guest42873 is now known as mocha
nizmow has joined #ruby
bim has joined #ruby
mistermo_ has quit [Read error: Connection reset by peer]
bim is now known as Guest44195
mistermocha has joined #ruby
<xxneolithicxx> let us know if you get random windows popping up later
<xxneolithicxx> re: visiting internet.com
workmad3 has joined #ruby
<dudedudeman> nothing to report as of yet. the site actually looked pretty cool imho
pika_pika has quit [Ping timeout: 245 seconds]
Technodrome has joined #ruby
Guest44195 has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby
mithrandeer has quit [Remote host closed the connection]
laurentide_ has joined #ruby
tmoor has joined #ruby
workmad3 has quit [Ping timeout: 250 seconds]
metalic has quit [Read error: Connection reset by peer]
jerematic has joined #ruby
metalic has joined #ruby
towski_ has quit [Remote host closed the connection]
metalic has quit [Read error: Connection reset by peer]
dx7 has quit [Remote host closed the connection]
krisquigley has joined #ruby
tus has quit [Ping timeout: 246 seconds]
huddy has quit [Quit: Connection closed for inactivity]
laurentide has quit [Ping timeout: 245 seconds]
mithrandeer has joined #ruby
redlegion has joined #ruby
krisquigley has quit [Ping timeout: 265 seconds]
mistermocha has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: Technodrome]
freerobby has joined #ruby
laurentide_ has quit [Ping timeout: 245 seconds]
hfp_work has quit [Ping timeout: 245 seconds]
RegulationD has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mithrandeer has quit [Remote host closed the connection]
duncannz has joined #ruby
hfp has quit [Ping timeout: 264 seconds]
Oka_ has joined #ruby
martin_work has quit [Quit: martin_work]
fungle has joined #ruby
DerisiveLogic has quit [Ping timeout: 265 seconds]
lidenskap has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 264 seconds]
jeramy_s has joined #ruby
<fungle> hello, is anyone here?
martin_work has joined #ruby
<centrx> no
freerobby1 has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<centrx> ?ping anyone
<ruboto> anyone, I don't know anything about ping
<centrx> ?fu roboto
<ruboto> roboto, I don't know anything about fu
freerobby has quit [Read error: Connection reset by peer]
Oka has quit [Ping timeout: 245 seconds]
<fungle> I have a question regarding enumerators if anyone would like to help me
djbkd has quit [Quit: My people need me...]
martin_work has quit [Client Quit]
<mozzarella> ?ask
<ruboto> Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<mozzarella> !ask
<mozzarella> .ask
msmith has joined #ruby
<mozzarella> ?ask fungle
<ruboto> fungle, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
cocotton has quit [Remote host closed the connection]
redlegion has quit [Quit: MYBALLSITCH]
fungle has left #ruby [#ruby]
jenrzzz has quit [Ping timeout: 265 seconds]
hfp has joined #ruby
vdamewood has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
hfp_work has joined #ruby
DerisiveLogic has joined #ruby
djbkd has joined #ruby
duncannz has quit [Read error: Connection reset by peer]
duncannz has joined #ruby
duncannz has quit [Read error: Connection reset by peer]
duncannz has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
hazelux has joined #ruby
juanpaucar has joined #ruby
<hazelux> Hey guys, can someone help me install eventmachine? Can't get it to work on a OS X
<mozzarella> gem install eventmachine
dfinninger has joined #ruby
mithrandeer has joined #ruby
<sevenseacat> that doesnt work on 10.10.3 - something got broken
endash has quit [Quit: endash]
Oka_ has quit [Quit: さようなら]
<hazelux> is it fixable?
djbkd has quit [Quit: My people need me...]
<sevenseacat> i dont know of one.
swgillespie has joined #ruby
<havenwood> works on my machine
phutchins has quit [Ping timeout: 256 seconds]
<hazelux> I'm on 10.10.2
<havenwood> 10.10.3 here
juanpaucar has quit [Ping timeout: 246 seconds]
<sevenseacat> well maybe its a different error then :) better gist it
<sevenseacat> i just tried again and it didnt work
phutchins has joined #ruby
pika_pika has joined #ruby
<hazelux> what ruby version, havenwood?
mithrandeer has quit [Remote host closed the connection]
symbol_ has joined #ruby
<havenwood> hazelux: 2.2.2
symbol has quit [Read error: Connection reset by peer]
dfinninger has quit [Ping timeout: 250 seconds]
<hazelux> tried with 1.9.3, and 2.2.0. No luck
<sevenseacat> yep, thats the same error i get.
ndrei has quit [Ping timeout: 255 seconds]
martin_work has joined #ruby
phutchins has quit [Ping timeout: 272 seconds]
vim_shimm has joined #ruby
chipotle has joined #ruby
jeramy_s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shortdudey123> running 10.10.3 and it installs fine for me... http://pastebin.com/bTwBSHKx
<ruboto> shortdudey123, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/2be037a51ec915058853
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
jeramy_s has joined #ruby
kbarry has joined #ruby
<dudedudeman> does anyone have any experience building a date picker in just ruby?
tcrypt has joined #ruby
ckrailo__ is now known as ckrailo
<Radar> dudedudeman: How would that even work?
<shortdudey123> side note... i am on ruby 2.1.5p273
<Radar> What interface would it provide?
kbarry has quit [Client Quit]
<dudedudeman> a dropdown menu of selected dates that i can choose from and then choose the appropriate date for my needs
juanpablo_ has joined #ruby
<Radar> dudedudeman: Sigh.
<Radar> HTML?
<Radar> Some native-app thingo?
<Radar> Please be more specific.
a5i has quit []
<ckrailo> Radar: dudedudeman is new to all this stuff, learning how to write a ruby web app using sinatra.
<Radar> ckrailo: thanks :)
<ckrailo> context helps! :D
<Radar> indeed
<dudedudeman> new is right!
plutonic has joined #ruby
zubov has joined #ruby
<hazelux> Holy crap I made it work. Ruby 2.1.2
<Radar> dudedudeman: You would probably use a select tag for that.
<Radar> <select name='date'><option>[date]</option>
<Radar> That's if you knew the dates in advance.
<Radar> if you didn't, then you'd probably have a select box for each of day, month and year
musashi1 has joined #ruby
gigetoo has quit [Ping timeout: 250 seconds]
karstensrage has left #ruby ["Leaving"]
juanpablo_ has quit [Ping timeout: 246 seconds]
a5i has joined #ruby
Ziioynx has quit [Quit: Connection closed for inactivity]
chipotle has quit [Quit: cheerio]
<dudedudeman> for what i'm doing now, i have some data that already has a date attached to it, but i need to manually input it in to my app. in the future, i'll be adding new data that doesn't currently exist, and i'd like to just automatically create date on my form submit
Spami_ has joined #ruby
avahey has joined #ruby
<sevenseacat> hazelux: how did you make it work
gigetoo has joined #ruby
Spami has quit [Ping timeout: 246 seconds]
<hazelux> sevenseacat: I just changed my Ruby version to 2.1.2 using rbenv. Bundle install worked fine with that version.
<sevenseacat> hrmm
krz has joined #ruby
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sevenseacat> i have 2.2.1 and 2.2.2 and it didnt work for either
kaleido has joined #ruby
_honning_ has quit [Ping timeout: 248 seconds]
Spami has joined #ruby
Meeh has quit [Read error: Connection reset by peer]
Spami_ has quit [Ping timeout: 245 seconds]
kaleido has quit [Client Quit]
<hazelux> sevenseacat: I also tried 2.2.0 and it didn't work. According to SO it's something specific to 2.2.x what breaks it. Try installing 2.1.2 and see if it works for you
<sevenseacat> will do
<sevenseacat> well, i'll install 2.1.6 :)
duncannz has quit [Ping timeout: 252 seconds]
Meeh has joined #ruby
n008f4g_ has quit [Ping timeout: 272 seconds]
Spami_ has joined #ruby
_honning_ has joined #ruby
Spami has quit [Ping timeout: 252 seconds]
<hazelux> Funny, I just happened to have 2.1.2 installed, and was just hoping for a miracle, just cycling through the versions and trying to get it to run
coderhs has joined #ruby
<havenwood> What version of Xcode are you on?
Ellistaa has joined #ruby
<Ellistaa> i’m working on creating a cipher, currently i’m using this method but it doesn’t look too good, can anyone give me a hint on what i might do to make it more dynamic?
coderhs has quit [Client Quit]
<sevenseacat> i have no idea, it got installed by ruby-install
nb_bez___ has quit [Quit: Connection closed for inactivity]
Spami_ has quit [Ping timeout: 245 seconds]
<havenwood> xcode-select -v #=> xcode-select version 2339.
Spami has joined #ruby
<sevenseacat> same error on 2.1.6
<sevenseacat> also 2339
<Hijiri> ruby map replaces the thing at the index with the result, right?
Brozo has joined #ruby
<Hijiri> then you can just have alphabet[key + 4] as the last expression
milesmatthias has joined #ruby
Nuck has quit [Max SendQ exceeded]
<Hijiri> or maybe I am wrong I don't know
greenbagels has joined #ruby
<sevenseacat> ah well. i dont need eventmachine, i just tried to install a gem that used it, the other day.
dx7 has joined #ruby
<Hijiri> oh, it creates a new array
<havenwood> sevenseacat: works for me but i dunno why
Brozo has quit [Client Quit]
<Hijiri> so you can have alphabet[key + 4], and have the result of your mapping be your result
<Hijiri> instead of the original array
Brozo has joined #ruby
<Hijiri> it will cost no extra because you are making a new array anyway
<Hijiri> and has the benefit of not involving any mutation
<havenwood> sevenseacat: but yeah, i don't use it either
* sevenseacat nukes ruby 2.1.6 from machine
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<Hijiri> Ellistaa: forgot to ping you
<Hijiri> also what do you mean by dynamic?
iamjarvo has joined #ruby
symbol_ has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
martin_work has quit [Ping timeout: 245 seconds]
<Ellistaa> hijiri: i figured dynamic wasn’t very clear, my bad, by taht i just mean the # changes, so in that code its + 4 but if someone wanted to change it to plus 10000 i want it to still work
<Hijiri> so they can specify the number?
zubov has quit [Quit: Leaving]
<Hijiri> also, does ruby array indexing wrap around if your value is too high
<Hijiri> oh, you can just mod it
<Hijiri> mod the key by the size of your alphabet
<Hijiri> then it will wrap around like a caesar cipher
<Ellistaa> i updated it i think my new code will work
<Hijiri> ok
vivekananda has quit [Ping timeout: 256 seconds]
laurentide has joined #ruby
baroquebobcat has joined #ruby
naztharune has quit [Quit: naztharune]
<ReK2> for those interested in nfosec+ruby https://www.reddit.com/r/ruby_infosec/
Ellistaa has quit [Quit: Ellistaa]
<laurentide> how do i install rvm so that it works on all domains and users on the server? i currently have it installed for a specific user on a subdomain and everything works great...
dx7 has quit [Ping timeout: 244 seconds]
Dwarf has quit [Ping timeout: 265 seconds]
hanmac has joined #ruby
jerematic has quit [Remote host closed the connection]
lidenskap has joined #ruby
Ellistaa has joined #ruby
freerobby1 has quit [Quit: Leaving.]
Ellistaa has quit [Client Quit]
dfinninger has joined #ruby
Dwarf has joined #ruby
mithrandeer has joined #ruby
jamto11 has joined #ruby
dfinninger has quit [Ping timeout: 256 seconds]
dudedudeman has quit [Ping timeout: 246 seconds]
jaequery has joined #ruby
mithrandeer has quit [Ping timeout: 245 seconds]
julieeharshaw has quit [Quit: ZZZZZzzzz]
<Radar> Can someone explain to me the purpose of https://gist.github.com/radar/7b031560323367613691#file-rails-L15
braincrash has quit [Quit: bye bye]
<sevenseacat> i see what you're doing
Brozo has quit [Quit: Leaving...]
Filete has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby
<Radar> mhm
cefkamcau has quit [Ping timeout: 252 seconds]
juanpablo_ has joined #ruby
mithrandeer has joined #ruby
jschoolcraft has joined #ruby
spider-mario has quit [Ping timeout: 256 seconds]
markholmes has joined #ruby
mleung has joined #ruby
michael_mbp has quit [Excess Flood]
markholmes has left #ruby [#ruby]
workmad3 has quit [Ping timeout: 240 seconds]
jeramy_s has quit [Quit: Peace out!]
Hijiri has quit [Quit: WeeChat 1.0.1]
braincrash has joined #ruby
spider-mario has joined #ruby
braincrash is now known as braincras
juanpablo_ has quit [Ping timeout: 256 seconds]
krisquigley has joined #ruby
michael_mbp has joined #ruby
dfinninger has joined #ruby
WildBamboo-Josh has quit [Read error: Connection reset by peer]
WildBamboo-Josh has joined #ruby
jschoolcraft has quit [Quit: peace]
multi_io has quit [Ping timeout: 252 seconds]
Gadgetoid has quit [Ping timeout: 245 seconds]
centrx has quit [Quit: Shutting down, Please wait...]
<shevy> off topic question: with git, can we actually restore to the initial variant of a given software to the primal status quo again?
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
multi_io has joined #ruby
ahuman has quit [Quit: No Ping reply in 180 seconds.]
krisquigley has quit [Ping timeout: 250 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tubuliferous_ has joined #ruby
ahuman has joined #ruby
Gadgetoid has joined #ruby
Hobogrammer has joined #ruby
jaequery has joined #ruby
cefkamcau has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
Technodrome has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
michael_mbp has quit [Excess Flood]
Spami has joined #ruby
graydot has quit [Quit: graydot]
<Radar> what
<Radar> are you asking how to apply git reset --hard?
Spami has quit [Remote host closed the connection]
michael_mbp has joined #ruby
Cache_Money has joined #ruby
RegulationD has joined #ruby
krz has quit [Read error: Connection reset by peer]
_honning_ has quit [Ping timeout: 248 seconds]
dfinninger has quit [Remote host closed the connection]
graydot has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
krz has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
graydot has quit [Client Quit]
julieeharshaw has joined #ruby
yfeldblum has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 256 seconds]
Anthony__ has joined #ruby
neanderslob_ has joined #ruby
kblake has joined #ruby
jack_rabbit has joined #ruby
longfeet has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
neanderslob_ has quit [Remote host closed the connection]
_blizzy_ has quit [Ping timeout: 255 seconds]
Anthony__ is now known as _blizzy_
charliesome has quit [Quit: zzz]
peteyg has quit [Ping timeout: 245 seconds]
peteyg has joined #ruby
juanpaucar has joined #ruby
<xxneolithicxx> that would put your master back to a previous version which is probably what you want (the changes wont be lost though you just have to dig for them using reflog). If you want to push master back to a specific
charliesome has joined #ruby
<xxneolithicxx> point and leave changes in staging do a soft
Channel6 has quit [Quit: Leaving]
juanpaucar has quit [Ping timeout: 250 seconds]
<shevy> Radar I am not familiar with git, sorry
<shevy> there are some ancient programming languages out there such as LPC http://en.wikipedia.org/wiki/LPC_%28programming_language%29; I haven't seen anyone combine it with git + github (then again I also did not search thoroughly for all LPC code bases out there)
idempotent has joined #ruby
<xxneolithicxx> what is your concern with LPC and git
<Radar> shevy: You can reset a branch back to a particular commit by running `git reset --hard <that sha>`
<Radar> And then you can force-push that branch.
sevvie has quit [Ping timeout: 250 seconds]
<Radar> But that's quite dangerous to do
<shevy> xxneolithicxx I want to know if, after xxxx changes, one could still reset to the initial variant of a code base. It's for argumentation purposes here mostly, I know of in particular one code base where they only keep regular snapshots of backups, but no initial prior commit (unless the programmer in question made a backup of the .c file, manually)
<xxneolithicxx> git keeps all prior commits leading up to the current state
pika_pika has quit [Ping timeout: 245 seconds]
charliesome has quit [Quit: zzz]
<xxneolithicxx> in addition if you did a reset on it, you wont actually lose those commits even after you change it as long as they arent garbage collected
blazes816 has joined #ruby
<xxneolithicxx> it takes a few days
<xxneolithicxx> so even if you messed up the reset you just have to find the hash with reflog if it hasnt been gc'ed
<xxneolithicxx> and if you want to look at a specific version of the .c just checkout the hash for that commit
tcrypt has quit [Ping timeout: 256 seconds]
mistermocha has joined #ruby
blazes816 has quit [Ping timeout: 244 seconds]
mithrandeer has quit [Quit: Leaving...]
Contigi777 has joined #ruby
charliesome has joined #ruby
QualityAddict has joined #ruby
VBlizzard has joined #ruby
Zamerick_ has joined #ruby
Guest82299 has quit [Ping timeout: 252 seconds]
blizzy has quit [Ping timeout: 240 seconds]
Contigi has quit [Ping timeout: 240 seconds]
Zamerick has quit [Ping timeout: 245 seconds]
sevvie has joined #ruby
Eiam_ has joined #ruby
andrew-l` has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Eiam_> hmm why is every google search for a ruby buildpack this cloudfoundry stuff... just want like, ruby + sinatra.
Olipro_ has joined #ruby
Olipro_ is now known as Guest70343
andrew-l has quit [Ping timeout: 246 seconds]
greenbagels has quit [Quit: Leaving]
DexterLB has joined #ruby
riceandbeans has joined #ruby
<riceandbeans> how bad is lock_file = File.open('/var/lock/myapplock', File::RDWR|File::CREAT, 0644) ?
krz has quit [Ping timeout: 245 seconds]
iamjarvo has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deimos_ has quit []
arescorpio has quit [Ping timeout: 256 seconds]
scripore has quit [Quit: This computer has gone to sleep]
deimos has joined #ruby
oo_ has joined #ruby
pragmaticivan has quit [Ping timeout: 256 seconds]
<mizbotre> How to rebuild ruby?
SouL_|_ has quit [Ping timeout: 240 seconds]
SouL_|_ has joined #ruby
<eam> riceandbeans: well, that won't work as a lockfile unless you also use File::EXCL
<eam> otherwise the open won't be exclusive and it won't lock anything
<eam> File::CREAT|File::EXCL gives "create file, raise if you can't" semantics
msmith has quit [Remote host closed the connection]
sevvie has quit [Ping timeout: 252 seconds]
kobain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
agent_white has quit [Ping timeout: 265 seconds]
<riceandbeans> eam: one sec, I rewrote it, tell me what you think, ok?
dx7 has joined #ruby
<riceandbeans> if File.exists?(lock_file)
<riceandbeans> puts "app already running"
<riceandbeans> exit 1
<riceandbeans> else
<riceandbeans> File.open(lock_file, 'w') { |file|
<riceandbeans> file.write("#{Time.new.inspect}")
<riceandbeans> }
<riceandbeans> end
<riceandbeans> eam: do you think that's better?
<eam> that's no good either, you want to use open with File::CREAT|File::EXCL
<eam> nothing else will be an atomic test and acquire
<riceandbeans> I don't understand
<eam> in your second example there's a race between exists? and open()
<eam> what happens if the file is created in parallel immediately before the open() ?
<riceandbeans> well, I can put as a final line in the thing to delete the file
<eam> won't help
<riceandbeans> in parallel?
<riceandbeans> this runs on a cron job
<riceandbeans> if a second one runs, it should exit
<riceandbeans> what does File::CREAT|File::EXCL mean?
<eam> it means create the file only if the file does not already exist
<eam> it's used to atomically test and set
<eam> it sounds like in your example you don't need true correctness, but if you had a possibility of two jobs starting at the same time you would care
<eam> otherwise there is a race condition
<riceandbeans> they should not be able to start at the same time
<riceandbeans> but one might start while the other is still running
<riceandbeans> if such is the case, the first took too long and I need to be alerted
<eam> what I'm hearing you say is "my locking doesn't have to be perfect"
<eam> so that's ok
<eam> but File::CREAT|File::EXCL is what you should do
<riceandbeans> I want to do this correctly though
<eam> ok try something like this
<riceandbeans> so File::EXCL means raise an exception if fail?
<eam> yes it will raise Errno::EEXIST if the file already exists
<eam> begin; open lock_file, File::CREAT|File::EXCL; do_your_code(); rescue Errno::EEXIST; raise "attempted to acquire lock, but lockfile exists"; end
<eam> oh, and add an File.unlink lock_file at the end of your block
<eam> to clean up the lock
<eam> this method provides perfect race-free lock semantics
<riceandbeans> ; and all?
<riceandbeans> can defs exist in a begin?
rikai has quit [Ping timeout: 264 seconds]
milesmatthias has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby
zotherstupidguy has quit [Quit: leaving]
SouL_|__ has joined #ruby
_blizzy_ has quit [Ping timeout: 244 seconds]
<eam> riceandbeans: you can call your own methods from there
<eam> you don't have to def methods inside the begin block
SouL_|_ has quit [Ping timeout: 244 seconds]
ndrei has joined #ruby
Morkel has joined #ruby
duncannz has joined #ruby
<riceandbeans> eam: should I put the rescue at the bottom of all my code?
<riceandbeans> and when you say open lock_file, do you mean like File.open(lock_file) ?
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jaequery has joined #ruby
Brozo has joined #ruby
icebourg has joined #ruby
bruno- has joined #ruby
michaeldeol has joined #ruby
wWwBUKOLAYcom has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
tanath has quit [Quit: Quit]
cocotton has joined #ruby
Brozo has quit [Quit: Leaving...]
bruno- has quit [Ping timeout: 256 seconds]
mengu has joined #ruby
phutchins has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
Hijiri has joined #ruby
balazs has joined #ruby
<eam> yes, File.open(lock_file, File::CREAT|File::EXCL)
cocotton has quit [Ping timeout: 255 seconds]
<eam> the begin / rescue should surround the code you want under the exclusionary lock
<eam> with an unlink at the very end of it
phutchins has quit [Ping timeout: 246 seconds]
ohaibbq has joined #ruby
f3lp has joined #ruby
a5i has quit [Quit: Connection closed for inactivity]
balazs has quit [Ping timeout: 256 seconds]
SouL_|__ has quit [Ping timeout: 256 seconds]
SouL_|__ has joined #ruby
workmad3 has joined #ruby
mleung has quit [Quit: mleung]
juanpablo_ has joined #ruby
tmoor has quit [Remote host closed the connection]
mengu has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 252 seconds]
juanpablo_ has quit [Ping timeout: 256 seconds]
bartkoo has quit [Quit: bartkoo]
krisquigley has joined #ruby
<riceandbeans> eam: your code didn't work :(
<riceandbeans> mine did though
yfeldblum has joined #ruby
Morkel has quit [Quit: Morkel]
sevvie has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iamjarvo has joined #ruby
yfeldblu_ has quit [Ping timeout: 245 seconds]
duderonomy has quit [Ping timeout: 276 seconds]
oo_ has quit [Ping timeout: 265 seconds]
krisquigley has quit [Ping timeout: 240 seconds]
tcrypt has joined #ruby
iamjarvo has quit [Client Quit]
mgberlin has joined #ruby
SouL_|__ has quit [Read error: Connection reset by peer]
fgo has joined #ruby
SouL_|_ has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
hanmac1 has joined #ruby
tcrypt has quit [Ping timeout: 276 seconds]
RegulationD has joined #ruby
SouL_|__ has joined #ruby
kblake has quit [Remote host closed the connection]
ponga has joined #ruby
SouL_|_ has quit [Ping timeout: 265 seconds]
icarus_ has joined #ruby
jamto11 has quit [Remote host closed the connection]
kblake has joined #ruby
RegulationD has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
doppler has joined #ruby
<doppler> o/
<apeiros> Senjai: used to be that (rules), now we have codified them on http://ruby-community.com/pages/user_rules
tagrudev has joined #ruby
oo_ has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
kblake has quit [Ping timeout: 248 seconds]
icarus_ is now known as ircarus
SouL_|_ has joined #ruby
ircarus is now known as icarus
SouL_|___ has joined #ruby
jeromelanteri has joined #ruby
SouL_|__ has quit [Ping timeout: 264 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
oo_ has quit [Remote host closed the connection]
Eiam_ has quit [Read error: Connection reset by peer]
Technodrome has quit [Quit: Technodrome]
mgberlin has quit [Remote host closed the connection]
SOLDIERz has joined #ruby
SouL_|_ has quit [Ping timeout: 245 seconds]
sevvie has quit [Ping timeout: 252 seconds]
juanpaucar has joined #ruby
SouL_|___ has quit [Ping timeout: 255 seconds]
SouL_|_ has joined #ruby
mgberlin has joined #ruby
Technodrome has joined #ruby
vivekananda has joined #ruby
juanpaucar has quit [Ping timeout: 252 seconds]
mistermocha has quit [Remote host closed the connection]
mgberlin has quit [Remote host closed the connection]
mocha has quit [Ping timeout: 256 seconds]
chipotle has joined #ruby
oo_ has joined #ruby
vivekananda has quit [Ping timeout: 240 seconds]
jamto11 has joined #ruby
balazs_ has quit [Ping timeout: 256 seconds]
dx7 has quit [Remote host closed the connection]
SouL_|_ has quit [Ping timeout: 245 seconds]
<shevy> xxneolithicxx hmm but I could actually restore to the initial variant of a codebase, if that is managed by git?
duderonomy has joined #ruby
lxsameer has quit [Ping timeout: 245 seconds]
Morkel has joined #ruby
<shevy> Anyone can recommend a "best practice for packaging ruby gems" guide?
davispuh has quit [Read error: Connection reset by peer]
slackbotgz has joined #ruby
hazelux has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
lxsameer has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
milesmatthias has joined #ruby
mengu has joined #ruby
towski_ has joined #ruby
kaspernj has joined #ruby
musashi1 has quit [Ping timeout: 252 seconds]
milesmatthias has quit [Ping timeout: 252 seconds]
Soliah has joined #ruby
kyrylo has joined #ruby
Soliah has quit [Client Quit]
mistermocha has joined #ruby
daynaskully has quit [Ping timeout: 265 seconds]
Cache_Money has quit [Quit: Cache_Money]
mistermo_ has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mistermocha has quit [Ping timeout: 245 seconds]
aganov has joined #ruby
sigurding has joined #ruby
SouL_|_ has joined #ruby
icebourg has quit []
jamto11 has quit [Remote host closed the connection]
sohrab has quit [Ping timeout: 252 seconds]
tkuchiki has joined #ruby
mistermo_ has quit [Ping timeout: 245 seconds]
sohrab has joined #ruby
BradPitt has joined #ruby
SouL_|__ has joined #ruby
lolmaus has joined #ruby
psy_ has quit [Ping timeout: 250 seconds]
ramfjord has quit [Ping timeout: 245 seconds]
Burgestrand has joined #ruby
SouL_|_ has quit [Ping timeout: 246 seconds]
<Radar> Like that?
SouL_|_ has joined #ruby
vire has joined #ruby
avgerinos has joined #ruby
pacMakaveli has joined #ruby
ndrei has joined #ruby
Mon_Ouie has quit [Ping timeout: 265 seconds]
sevvie has joined #ruby
Pupeno_ has quit [Read error: Connection reset by peer]
marienz has quit [Ping timeout: 624 seconds]
kblake has joined #ruby
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
chinmay_dd has joined #ruby
SouL_|__ has quit [Ping timeout: 252 seconds]
turtil has quit [Quit: WeeChat 1.1.1]
kstuart_ has quit [Quit: WeeChat 1.1.1]
laurentide has quit [Quit: Leaving]
arturaz has joined #ruby
Pupeno has quit [Ping timeout: 265 seconds]
kblake has quit [Ping timeout: 240 seconds]
<shevy> hmm
<hanmac1> shevy & Radar you also checked out this? http://guides.rubygems.org/make-your-own-gem/
pacMakaveli has quit []
<shevy> I am not quite sure yet... I feel that I am missing something how to build up my gems. It is true that I am lazy when it comes to documenting things, but I also struggle with how to use documentation, what files to put (USAGE.md? README.md?), where to put...
fedexo has joined #ruby
<shevy> Radar but I think I will try out bundler for a new project
<apeiros> shevy: toplevel README.markdown
<Radar> shevy: Bundler makes those decisions for you :)
<apeiros> and explain there with which classes to start
vire has quit [Ping timeout: 264 seconds]
<shevy> Radar: I see that you documented a lot of files there, must have been a lot of work
<Radar> shevy: Not really. I document a lot.
<apeiros> API docs should mostly cover the rest. unless you have a huge gem. then additional prosa docs might be useful.
<Radar> That big gap in the middle is all the time I spent writing other things :D
<Radar> I enjoy documenting
<shevy> apeiros on the same base level? A while ago, I started to add doc/ directories, then I was thinking, I could put all doc files there... but now I have gem-based projects, where I have a USAGE.md file, outside doc/ ... my own setup confuses me
<Radar> Why have a separate README + USAGE? What is README if it doesn't have USAGE?
Alina-malina has joined #ruby
<shevy> haha yeah
<shevy> I ended up with "doc/README.md" and "USAGE.md" too
icarus has quit [Ping timeout: 256 seconds]
<apeiros> shevy: for large projects yes, I'd add a doc dir. but that'd really have to be large. like 50+ classes.
<apeiros> i.e. usually only framework level gems.
SouL_|_ has quit [Ping timeout: 248 seconds]
<Radar> README should tell people 1) what the gem does (summary) 2) how to install it 3) finer grained usage info, with possibly links to other documentation 4) how to contribute back to the project 5) whatever else
SouL_|_ has joined #ruby
<Radar> But yeah Bundler is pretty nice for getting started.
juanpablo_ has joined #ruby
jenrzzz has joined #ruby
iamninja_ has quit [Read error: Connection reset by peer]
joonty has joined #ruby
iamninja_ has joined #ruby
juanpablo_ has quit [Ping timeout: 240 seconds]
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Technodrome has quit [Quit: Technodrome]
avahey has quit [Quit: Connection closed for inactivity]
pacMakaveli has joined #ruby
ramfjord has joined #ruby
vire has joined #ruby
crdpink2 has quit [Quit: q term]
Joufflu_ has quit [Quit: Peace]
jenrzzz has quit [Ping timeout: 265 seconds]
gagrio has joined #ruby
Technodrome has joined #ruby
bluOxigen has joined #ruby
bluOxigen has left #ruby [#ruby]
ramfjord has quit [Ping timeout: 245 seconds]
workmad3 has joined #ruby
BradPitt has quit [Ping timeout: 245 seconds]
kstuart has joined #ruby
crdpink has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
dodobrain has quit [Quit: bye... o/]
mizbotre has quit [Ping timeout: 248 seconds]
balazs_ has joined #ruby
krisquigley has joined #ruby
mengu__ has joined #ruby
digifiv5e has joined #ruby
digifiv5e is now known as Guest34688
slackbotgz has quit [Remote host closed the connection]
mengu has quit [Ping timeout: 248 seconds]
balazs_ has quit [Ping timeout: 250 seconds]
krisquigley has quit [Ping timeout: 240 seconds]
SOLDIERz has joined #ruby
milesmatthias has joined #ruby
ta has joined #ruby
antgel has joined #ruby
milesmatthias has quit [Ping timeout: 276 seconds]
swgillespie has joined #ruby
haxrbyte has quit [Remote host closed the connection]
crdpink has quit [Ping timeout: 245 seconds]
haxrbyte has joined #ruby
crdpink2 has joined #ruby
haxrbyte has quit [Remote host closed the connection]
RegulationD has joined #ruby
swgillespie has quit [Client Quit]
SouL_|__ has joined #ruby
davedev24_ has quit [Remote host closed the connection]
BradPitt has joined #ruby
haxrbyte_ has joined #ruby
SouL_|_ has quit [Ping timeout: 264 seconds]
fabrice31 has joined #ruby
mistermocha has joined #ruby
RegulationD has quit [Ping timeout: 255 seconds]
timonv has joined #ruby
marienz has joined #ruby
pagios has quit [Ping timeout: 252 seconds]
pagios has joined #ruby
rdark has joined #ruby
spider-mario has quit [Remote host closed the connection]
relix has joined #ruby
ta has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
vim_shimm has quit [Ping timeout: 250 seconds]
mistermocha has quit [Ping timeout: 245 seconds]
pagios has quit [Ping timeout: 256 seconds]
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
droidburgundy has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
pagios has joined #ruby
ki0 has joined #ruby
livathinos has joined #ruby
avgerinos has quit [Ping timeout: 276 seconds]
livathinos is now known as livathinos|away
juanpaucar has joined #ruby
<riceandbeans> anyone around?
<riceandbeans> shevy: ?
<avril14th> good morning ruby folks
icarus has joined #ruby
penzur has joined #ruby
SOLDIERz has joined #ruby
wWwBUKOLAYcom has quit [K-Lined]
alex88 has joined #ruby
livathinos|away is now known as livathinos
sevvie has quit [Ping timeout: 246 seconds]
Juanchito has joined #ruby
timonv has quit [Ping timeout: 256 seconds]
Zai00 has joined #ruby
juanpaucar has quit [Ping timeout: 250 seconds]
ta has joined #ruby
pagios has quit [Ping timeout: 244 seconds]
pagios has joined #ruby
towski_ has quit [Remote host closed the connection]
deuteriu_ has quit [Ping timeout: 245 seconds]
pacharanero has quit [Ping timeout: 264 seconds]
hanmac has quit [Ping timeout: 256 seconds]
andikr has joined #ruby
pacharanero has joined #ruby
Zai00 has quit [Ping timeout: 240 seconds]
systemd0wn has quit [Ping timeout: 240 seconds]
avgerinos has joined #ruby
kartouch is now known as kartouch|meeting
kartouch|meeting is now known as kartouch
edwinvdg_ has joined #ruby
charliesome has quit [Quit: zzz]
_blizzy_ has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
rippa has joined #ruby
haxrbyte has joined #ruby
IronKoopa has joined #ruby
edwinvdgraaf has quit [Ping timeout: 256 seconds]
astrobunny has joined #ruby
c0m0 has joined #ruby
BradPitt has quit [Ping timeout: 245 seconds]
Skelz0r_ has quit [Ping timeout: 264 seconds]
_blizzy_ has quit [Ping timeout: 272 seconds]
chipotle has quit [Quit: cheerio]
Cust0sL1men has quit [Ping timeout: 248 seconds]
plashchynski has joined #ruby
Skelz0r has joined #ruby
ohaibbq has quit [Quit: Leaving...]
systemd0wn has joined #ruby
hanmac has joined #ruby
KnownSyntax has joined #ruby
oo_ has quit [Remote host closed the connection]
pacMakaveli has quit []
elaptics is now known as elaptics_away
pacMakaveli has joined #ruby
edwinvdg_ has quit [Remote host closed the connection]
lolmaus has quit [Ping timeout: 256 seconds]
oo_ has joined #ruby
fedexo has quit [Ping timeout: 245 seconds]
yfeldblum has quit [Ping timeout: 245 seconds]
PierreRambaud has quit [Ping timeout: 248 seconds]
krz has joined #ruby
thinkswan has joined #ruby
EasyCo has joined #ruby
Burgestrand has quit [Quit: Burgestrand]
oo_ has quit [Remote host closed the connection]
plutonic has quit [Quit: plutonic]
pacharanero has quit [Ping timeout: 256 seconds]
bennysan has joined #ruby
tkuchiki_ has joined #ruby
milesmatthias has joined #ruby
vivekananda has joined #ruby
plashchynski has quit [Quit: plashchynski]
WildBamboo-Josh has quit [Read error: Connection reset by peer]
nemesit|znc has joined #ruby
mikecmpbll has joined #ruby
universa1 is now known as universal
universal is now known as universa1
vsh_ has joined #ruby
WildBamboo-Josh has joined #ruby
oo_ has joined #ruby
tkuchiki has quit [Ping timeout: 244 seconds]
PierreRambaud has joined #ruby
krisquigley has joined #ruby
milesmatthias has quit [Ping timeout: 256 seconds]
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
cschneid has quit [Ping timeout: 256 seconds]
startupality has joined #ruby
cschneid has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has joined #ruby
chthon has joined #ruby
lolmaus has joined #ruby
elaptics_away is now known as elaptics
noname1 has quit [Ping timeout: 248 seconds]
bim has joined #ruby
mikecmpb_ has joined #ruby
bim is now known as Guest5131
tkuchiki_ has quit [Ping timeout: 276 seconds]
jgoyon has joined #ruby
tkuchiki has joined #ruby
mikecmpbll has quit [Ping timeout: 246 seconds]
iasoon has joined #ruby
kblake has joined #ruby
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Feyn has quit [Ping timeout: 246 seconds]
blaxter has joined #ruby
mengu__ has quit [Ping timeout: 250 seconds]
jheg has joined #ruby
Pipoca has joined #ruby
granthatcher has joined #ruby
granthatcher has quit [Max SendQ exceeded]
Pipocah has joined #ruby
niko has quit [Remote host closed the connection]
granthatcher has joined #ruby
blackmesa has joined #ruby
niko has joined #ruby
lkba_ has joined #ruby
kblake has quit [Ping timeout: 256 seconds]
<jokester> fork{}
bayed has joined #ruby
lkba has quit [Ping timeout: 250 seconds]
lloyd is now known as Lloyd
Pipoca has quit [Ping timeout: 265 seconds]
vtunka has joined #ruby
bruno- has joined #ruby
roshanavand has joined #ruby
juanpablo_ has joined #ruby
tvw has joined #ruby
fabrice31_ has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
Morkel has quit [Quit: Morkel]
Feyn has joined #ruby
juanpablo_ has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
shoutsid has joined #ruby
blaxter has quit [Ping timeout: 245 seconds]
AlphaAtom has joined #ruby
SOLDIERz has joined #ruby
haxrbyte_ has joined #ruby
Contigi has joined #ruby
lessless has joined #ruby
Zamerick has joined #ruby
haxrbyte has quit [Ping timeout: 256 seconds]
Guest70343 has quit [Ping timeout: 276 seconds]
ponga has quit [Quit: Leaving...]
lkba_ has quit [Read error: Connection reset by peer]
cool_coder_forfo has joined #ruby
startupality has quit [Quit: startupality]
dANO has joined #ruby
chinmay_dd has quit [Quit: Leaving]
robbyoconnor has quit [Read error: Connection reset by peer]
startupality has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
pauly_oc has quit [Ping timeout: 255 seconds]
lidenskap has quit [Remote host closed the connection]
Zamerick_ has quit [Ping timeout: 244 seconds]
Contigi777 has quit [Ping timeout: 244 seconds]
TinkerTyper has quit [Ping timeout: 272 seconds]
gmas has quit [Ping timeout: 265 seconds]
jud has quit [Ping timeout: 265 seconds]
Zai00 has joined #ruby
workmad3 has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
roshanavand has quit [Ping timeout: 245 seconds]
roshanavand1 has joined #ruby
robbyoconnor has joined #ruby
jud has joined #ruby
jud has quit [Changing host]
jud has joined #ruby
livathinos has quit [Ping timeout: 255 seconds]
TinkerTyper has joined #ruby
AlecTaylor has joined #ruby
<AlecTaylor> hi
<AlecTaylor> Oh no - http://stackoverflow.com/q/29791893 - Ruby RVM + Gruntfile issues :(
Olipro_ has joined #ruby
Olipro_ is now known as Guest62726
DerisiveLogic has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 246 seconds]
<adaedra> 2.2.0 is not the really the ruby version
<adaedra> gems don't use the exact version, it's shared between minor releases
<adaedra> I wouldn't put an absolute name in the shebang like that, you're closing down portability and making deployment difficult
noname1 has joined #ruby
DerisiveLogic has joined #ruby
DerisiveLogic has quit [Remote host closed the connection]
Vivex has joined #ruby
DerisiveLogic has joined #ruby
blaxter has joined #ruby
gmas has joined #ruby
ThoMe has joined #ruby
<ThoMe> hiho
<ThoMe> anyone here? :-)
<ThoMe> is it posible to remove the tabs/spaces? to begin a line?
Cust0sL1men has joined #ruby
<AlecTaylor> adaedra: It's a super hack. What's the solution?
<adaedra> AlecTaylor: I don't remember well how rvm works
<AlecTaylor> :\
<ThoMe> can anyone help me please? :-)
<adaedra> ThoMe: I'm not sure I understand what you're trying to do
penzur has quit [Quit: wadiwasi]
<ThoMe> adaedra: i have multiple lines, like: priority: Sofort
<ThoMe> i would like remove the space/tab to begin of my line.
<adaedra> On your output?
<adaedra> This is what you're trying to clean?
<ThoMe> yes adaedra :-)
<adaedra> you can achieve this with some regex
<adaedra> >> " Hello ".gsub(/^\s+/, '').gsub(/\s+$/, '')
<ruboto> adaedra # => "Hello" (https://eval.in/316964)
<adaedra> This should cleane extra spaces
Pumukel has joined #ruby
<adaedra> clean*
Pumukel has quit [Client Quit]
lordkryss has joined #ruby
vtunka has quit [Quit: Leaving]
A205B064 has quit [Ping timeout: 244 seconds]
<ThoMe> adaedra: test = Nokogiri::HTML(' .... test.gsub(/^\s+/, '').gsub(/\s+$/, '')
<ThoMe> ?
<adaedra> after your .text, tes
<ThoMe> adaedra: and why doesnt works test.gsub(/^\s+/, '').gsub(/\s+$/, '')
<ThoMe> ?
IronKoopa has quit [Ping timeout: 245 seconds]
<adaedra> because gsub returns a new string
<adaedra> if you want to modify in-place, use gsub! instead of gsub
<sevenseacat> if this is a rails app, use test.squish
RegulationD has joined #ruby
<sevenseacat> <3 squish
balazs has joined #ruby
<ThoMe> adaedra: ah, ok. last question, is it also posible not delete my empty lines?
<ThoMe> only new line with spaces begin and text
<adaedra> See sevenseacat suggestion
<adaedra> otherwise
<adaedra> >> "Hello\n\n\nWorld\n\n!!!".gsub(/\n+/m, "\n")
<ruboto> adaedra # => "Hello\nWorld\n!!!" (https://eval.in/316968)
<apeiros> >> "Hello\n\n\nWorld\n\n!!!".squeeze("\n")
<ruboto> apeiros # => "Hello\nWorld\n!!!" (https://eval.in/316969)
ayaz has joined #ruby
<adaedra> :|
<apeiros> so rare that this method is ever useful :)
SouL_|_ has joined #ruby
<adaedra> There are too many methods sometimes, I can't remember them all :/
<adaedra> Hopefully, regex also solves number of problems.
<apeiros> well, re squeeze - IMO they could just remove it. use cases are like once in a decade.
r0bby_ has joined #ruby
RegulationD has quit [Ping timeout: 245 seconds]
SouL_|_ has quit [Read error: Connection reset by peer]
balazs has quit [Ping timeout: 256 seconds]
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SouL_|_ has joined #ruby
SouL_|__ has quit [Ping timeout: 265 seconds]
<adaedra> I wonder if using regex has a cost over squeeze, on performance
robbyoconnor has quit [Ping timeout: 245 seconds]
<AlecTaylor> How do I get Jekyll (in RVM) working with Grunt? - http://stackoverflow.com/q/29791893
<ThoMe> adaedra: hmm. but when I using test.gsub!(/^\s+/, '') why remove this my empty lines?
lolmaus has joined #ruby
<ThoMe> i would like only remove spaces to begin from a line,when text after comming (sorry. .my english :-)
<ThoMe> example: test \n\n blub <<only remove spaces, not the \n\n
<adaedra> And what was provided above doesn't works?
tkuchiki_ has joined #ruby
lidenskap has joined #ruby
<adaedra> Ah, I see
<adaedra> Use [ \t] instead of \s then
<adaedra> " Hello\n\n World".gsub(/^[ \t]+/, '')
<adaedra> >> " Hello\n\n World".gsub(/^[ \t]+/, '')
<ruboto> adaedra # => "Hello\n\nWorld" (https://eval.in/316971)
vtunka has joined #ruby
SouL_|__ has joined #ruby
ghr has joined #ruby
tkuchiki has quit [Ping timeout: 256 seconds]
<gregf_> >>"-" + " test \n\n blub ".gsub(/\s+/," ") + "-"
<ruboto> gregf_ # => "- test blub -" (https://eval.in/316974)
<gregf_> adaedra: \s includes everything(\t\r\n und \ space)
<adaedra> yes, I saw
SouL_|_ has quit [Ping timeout: 250 seconds]
<gregf_> >>"-" + "\t\t test \n\n \t\t blub \t ".gsub(/\s+/," ") + "-"
<ruboto> gregf_ # => "- test blub -" (https://eval.in/316978)
iasoon has quit [Ping timeout: 250 seconds]
Igorshp has joined #ruby
<gregf_> >>"-" + "\t\t test \n\n \t\t blub \t ".gsub(/\A\s+|\s+\z/," ") + "-"
<ruboto> gregf_ # => "- test \n\n \t\t blub -" (https://eval.in/316979)
lidenskap has quit [Ping timeout: 246 seconds]
juanpaucar has joined #ruby
<gregf_> ^^ would just do (lr)trim
<adaedra> what's different from .gsub(/^[ \t]+/, '') ?
<adaedra> Ah, you leave one space at beginning
startupality has quit [Quit: startupality]
<adaedra> And works only for first line
iasoon has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
AlecTaylor has quit [Remote host closed the connection]
acarpe has joined #ruby
haxrbyte has joined #ruby
timonv has joined #ruby
juanpaucar has quit [Ping timeout: 248 seconds]
niKeITA has joined #ruby
Technodrome has quit [Quit: Technodrome]
plashchynski has joined #ruby
shock_one has joined #ruby
<shock_one> Is there a de-facto standard text parser in Ruby community? Like in Haskell you should go with Parsec unless you have reasons not to.
Technodrome has joined #ruby
sohrab has quit [Ping timeout: 248 seconds]
<apeiros> shock_one: what's a text parser supposed to be?
<apeiros> Parsec sounds like a parser generator, not a parser… is that what you're asking for?
<shock_one> Yes, sorry for incorrect terminology.
kedare has joined #ruby
<apeiros> there's no de-facto standard for parser generators, no
<shock_one> Maybe some famous ones? I found Treetop and Parslet.
<apeiros> hm, no category for parser generators in ruby-toolbox.com
<apeiros> shock_one: yes, those two plus probably racc and ragel
<shock_one> Thank you.
shock_one has quit [Remote host closed the connection]
startupality has joined #ruby
startupality has quit [Client Quit]
shock_one has joined #ruby
jheg has quit [Quit: jheg]
sevenseacat has quit [Quit: Me dun like you no more.]
hectortrope is now known as noobQ
edwinvdgraaf has joined #ruby
niKeITA has quit [Quit: ZZZzzz…]
ndrei has quit [Ping timeout: 265 seconds]
plutonic has joined #ruby
gagrio has quit [Quit: Leaving...]
niKeITA has joined #ruby
gagrio has joined #ruby
jottr has joined #ruby
predator217 has quit [Ping timeout: 246 seconds]
quimrstorres has joined #ruby
n008f4g_ has joined #ruby
quimrstorres has quit [Remote host closed the connection]
ArchRogem has joined #ruby
quimrstorres has joined #ruby
sgambino has joined #ruby
AlphaAtom has quit [Ping timeout: 276 seconds]
predator117 has joined #ruby
icarus has quit [Ping timeout: 250 seconds]
krz has quit [Ping timeout: 240 seconds]
milesmatthias has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
pacharanero1 has joined #ruby
tubuliferous_ has quit [Ping timeout: 256 seconds]
ponga has joined #ruby
KnownSyntax has quit [Quit: Connection closed for inactivity]
mdw has joined #ruby
<oz> chan too quiet, adding cats GIFs
mdw has quit [Read error: Connection reset by peer]
milesmatthias has quit [Ping timeout: 272 seconds]
<ponga> why would cat behave that way
vtunka has quit [Quit: Leaving]
<oz> probably javascript
sigurding has quit [Quit: sigurding]
<ponga> no, im really curious
<adaedra> oz: haha
jenrzzz has joined #ruby
akemrir has joined #ruby
Pipocahh has joined #ruby
ChoiKyuSang has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
jespada has quit [Ping timeout: 245 seconds]
davedev24_ has joined #ruby
n008f4g_ has quit [Ping timeout: 245 seconds]
Pupeno has joined #ruby
kblake has joined #ruby
Pipocah has quit [Ping timeout: 272 seconds]
ChoiKyuSang has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
fabrice31_ has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
jottr has quit [Ping timeout: 256 seconds]
basiclaser has quit [Quit: Connection closed for inactivity]
vtunka has joined #ruby
sagittarian has quit [Ping timeout: 252 seconds]
michael_mbp has joined #ruby
kblake has quit [Ping timeout: 265 seconds]
postmodern has quit [Quit: Leaving]
Pipocah has joined #ruby
juanpablo_ has joined #ruby
Pipocahh has quit [Ping timeout: 244 seconds]
thinkswan has quit [Quit: ...]
juanpablo_ has quit [Ping timeout: 244 seconds]
Oka has joined #ruby
platzhirsch has joined #ruby
shock_one has quit [Remote host closed the connection]
lkba has joined #ruby
tkuchiki_ has quit [Ping timeout: 244 seconds]
jespada has joined #ruby
Guest5131 has quit [Remote host closed the connection]
bim has joined #ruby
anarang has joined #ruby
sagittarian has joined #ruby
bim has quit [Remote host closed the connection]
yfeldblum has joined #ruby
oo_ has quit [Remote host closed the connection]
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sigurding has joined #ruby
workmad3 has joined #ruby
Zai00 has quit [Quit: Zai00]
oo_ has joined #ruby
a5i has joined #ruby
astrobunny has quit [Remote host closed the connection]
shock_one has joined #ruby
doodlehaus has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
phutchins has joined #ruby
sdothum has joined #ruby
ndrei has joined #ruby
plribeiro3000 has joined #ruby
phutchins has quit [Ping timeout: 245 seconds]
OnBrokenWings has joined #ruby
bkxd has joined #ruby
jheg has joined #ruby
mostlybadfly has joined #ruby
shock_one has quit [Remote host closed the connection]
DEA7TH has joined #ruby
pagios_ has joined #ruby
pagios has quit [Ping timeout: 248 seconds]
weaksauce has quit [Ping timeout: 246 seconds]
shock_one has joined #ruby
DerisiveLogic has quit [Remote host closed the connection]
huddy has joined #ruby
shock_one has quit [Read error: Connection reset by peer]
shock_one has joined #ruby
Oka has quit [Remote host closed the connection]
RegulationD has joined #ruby
krz has joined #ruby
doodlehaus has quit [Remote host closed the connection]
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
ScorpusKahn has joined #ruby
antgel has quit [Ping timeout: 255 seconds]
plashchynski has quit [Quit: plashchynski]
matcouto has joined #ruby
quimrstorres has quit [Remote host closed the connection]
Oka has joined #ruby
izzol has joined #ruby
ponga has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 256 seconds]
quimrstorres has joined #ruby
phutchins has joined #ruby
jottr has joined #ruby
krz has quit [Ping timeout: 255 seconds]
acarpe has quit [Quit: acarpe]
lkba has quit [Ping timeout: 244 seconds]
<izzol> hello ;-)
emocakes has joined #ruby
fabrice31 has joined #ruby
mistermocha has joined #ruby
nszceta has joined #ruby
quimrstorres has quit [Ping timeout: 256 seconds]
pontiki has joined #ruby
gfawcettpq has joined #ruby
quimrstorres has joined #ruby
mistermocha has quit [Ping timeout: 245 seconds]
relix has quit [Remote host closed the connection]
lkba has joined #ruby
relix has joined #ruby
juanpaucar has joined #ruby
duncannz has quit [Remote host closed the connection]
terlar has joined #ruby
rodfersou has joined #ruby
shoutsid has quit [Remote host closed the connection]
pwattste has joined #ruby
shoutsid has joined #ruby
juanpaucar has quit [Ping timeout: 256 seconds]
terlar has quit [Client Quit]
_blizzy_ has joined #ruby
doodlehaus has joined #ruby
doertede1 has joined #ruby
doertede1 has quit [Client Quit]
anarang has quit [Quit: Leaving]
serivich has joined #ruby
mdw has joined #ruby
roshanavand1 has quit [Quit: roshanavand1]
yeticry has quit [Ping timeout: 250 seconds]
SouL_|_ has joined #ruby
<platzhirsch> izzol: Hello yourself
yeticry has joined #ruby
exadeci has joined #ruby
SOLDIERz has joined #ruby
acarpe has joined #ruby
Renich has quit [Read error: Connection reset by peer]
SouL_|__ has quit [Ping timeout: 240 seconds]
simonewestphal has joined #ruby
bkxd has quit [Ping timeout: 264 seconds]
vtunka has quit [Quit: Leaving]
bim has joined #ruby
simonewestphal has quit [Remote host closed the connection]
bim is now known as Guest55044
anarang has joined #ruby
kblake has joined #ruby
phutchins has quit [Ping timeout: 250 seconds]
plashchynski has joined #ruby
hanmac1 has left #ruby [#ruby]
sagittarian has quit [Ping timeout: 252 seconds]
simonewestphal has joined #ruby
pardusf has quit [Ping timeout: 244 seconds]
doertede1 has joined #ruby
kblake has quit [Ping timeout: 256 seconds]
otisZart has joined #ruby
codecop has joined #ruby
parduse has joined #ruby
DEA7TH has quit [Ping timeout: 272 seconds]
simonewestphal has left #ruby [#ruby]
havenwood has quit [Remote host closed the connection]
doodlehaus has quit [Read error: Connection reset by peer]
iasoon has quit [Ping timeout: 264 seconds]
doodlehaus has joined #ruby
simonewestphal has joined #ruby
IronKoopa has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
sn0wb1rd has quit [Ping timeout: 245 seconds]
jerematic has joined #ruby
digitalZombie has joined #ruby
terlar has joined #ruby
ndrei has joined #ruby
astrobunny has joined #ruby
simonewestphal has quit [Remote host closed the connection]
simonewestphal has joined #ruby
sn0wb1rd has joined #ruby
nfk has joined #ruby
Morkel has joined #ruby
Zai00 has joined #ruby
SouL_|_ has quit [Ping timeout: 272 seconds]
shock_one has quit [Remote host closed the connection]
milesmatthias has joined #ruby
sagittarian has joined #ruby
milesmatthias has quit [Ping timeout: 256 seconds]
jerius has joined #ruby
_honning_ has joined #ruby
ponga has joined #ruby
RegulationD has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
ldnunes has joined #ruby
ndrei has quit [Ping timeout: 248 seconds]
Technodrome has quit [Quit: Technodrome]
digitalZombie has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
RegulationD has quit [Ping timeout: 265 seconds]
sameerynho has joined #ruby
ndrei has joined #ruby
simonewestphal_ has joined #ruby
simonewestphal has quit [Read error: Connection reset by peer]
simonewestphal_ is now known as simonewestphal
lxsameer has quit [Ping timeout: 245 seconds]
roshanavand has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
doodlehaus has quit [Remote host closed the connection]
bruno- has joined #ruby
vtunka has joined #ruby
f3lp has quit [Ping timeout: 264 seconds]
acarpe has quit [Quit: acarpe]
juanpablo_ has joined #ruby
rodferso1 has joined #ruby
coderhs has joined #ruby
bruno- has quit [Ping timeout: 272 seconds]
coderhs has quit [Client Quit]
AlphaAtom has joined #ruby
rodfersou has quit [Ping timeout: 248 seconds]
<doppler> can someone explain , in human language, what this piece of code does? I know "empty?", but i dont understand this part "? i :x".... https://gist.github.com/d0ppler/a01bc0ad887f11ca4653
digitalZombie has joined #ruby
juanpablo_ has quit [Ping timeout: 272 seconds]
<shevy> doppler ok you have two states here
<aawe> doppler: (x ? y : z) is shorthand for (if x then y else z)
<shevy> (1) either it is empty or (2) it is not
<shevy> if it is empty (1), then we pick the first option; otherwise, we pick the second option
<shevy> so which one we pick depends on whether x is empty or not
<shevy> that code is very weird by the way
<shevy> x +='Fizz' if i%3==0
<shevy> ruby people would rather use x << 'Fizz' as that won't yield a new object; and they usually would write it like
<shevy> i % 3 == 0
<shevy> if at all
plutonic has quit [Quit: plutonic]
<shevy> hmmm
<doppler> oh i see
<shevy> does that code actually work?
<doppler> yes it does, i just ran it
<shevy> I would have assumed :x to mean a Symbol
<shevy> ok
haxrbyte has quit [Read error: Connection reset by peer]
<shevy> >> :x.class
<ruboto> shevy # => Symbol (https://eval.in/317126)
<shevy> isn't it nice when the ruby parser is cleverer :D
akemrir has quit [Quit: WeeChat 1.1.1]
segfalt has joined #ruby
haxrbyte has joined #ruby
rodferso1 has quit [Quit: leaving]
<doppler> i picked it up from rubyquiz, im just trying to understand what the freak im reading. practicing :D
digitalZombie has quit [Ping timeout: 245 seconds]
rodfersou has joined #ruby
<shevy> people do weird things in ruby
<ccooke> s/in ruby//
haxrbyte_ has joined #ruby
<shevy> yeah
jwingfi has joined #ruby
jwingfi has quit [Client Quit]
<shevy> people are just weird in general
<shevy> they even wrote a language on first april
<shevy> it became popular
<shevy> so they called it PHP
haxrbyte_ has quit [Client Quit]
<shevy> Lerdorf, Rasmus (2007-04-26). "PHP on Hormones"
<shevy> ok, not first april... 3 weeks later :)
<ytti> totally wrong channel for this, but is there native HTML way to choose number between X and Y, while displaying number
pika_pika has joined #ruby
<shevy> this channel is awesome ytti
<shevy> it's always the right channel
<ytti> shevy, so, seen any good furry movies lately?
<shevy> I am not sure how to answer that question though... what can you do with html? to choose something? or do you mean, to use javascript?
Igorshp has quit [Remote host closed the connection]
<ytti> shevy, like select box to choose number for a form
<ytti> between X-Y, say between 2 and 1000
workmad3 has joined #ruby
<shevy> ytti you mean with animals? there are not many good animal movies out there... last one I saw was some BBC documentation about flying birds flying around the globe... did you know that some vulture crashed into a plane at altutude 11.400 metres or something like that? they can reach that height, the vultures
<ytti> HTML5 has range, but it won't display what value you're working with
<apeiros> asking a question in #ror, reliably getting high blood pressure…
Oka has quit []
iasoon has joined #ruby
haxrbyte has quit [Ping timeout: 265 seconds]
<shevy> apeiros aaah
ndrei has quit [Ping timeout: 244 seconds]
sinkensabe has joined #ruby
lfox has joined #ruby
DaniG2k has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pacharanero1 has left #ruby [#ruby]
niKeITA has quit [Quit: ZZZzzz…]
fred1807 has joined #ruby
<shevy> I should learn rails
<shevy> then I can ask questions in #ror
<fred1807> how do I compile and run a simple ruby application like this one: https://github.com/jeffayle/rMPD ?
decoponio has joined #ruby
revoohc has joined #ruby
<ytti> no gemfile and no rakefile, good question :)
<ytti> it does have install instructions though
<shevy> $mpd = MPD.new $config[:host], $config[:port]
<shevy> I wonder if it works
<shevy> fred1807 how to start this project?
ghr has quit [Ping timeout: 264 seconds]
<shevy> hmmm
<shevy> "Make sure your webserver is configured to run .rb files as CGI scripts, then edit config.rb."
sinkensabe has quit [Remote host closed the connection]
<shevy> I don't even know how to do this in lighttpd
<fred1807> neither I :(
digitalZombie has joined #ruby
sinkensabe has joined #ruby
<fred1807> but thats ok, there are some python alternatives to control mpd from the browser
<fred1807> should be easier
shellfu_afk is now known as shellfu
<shevy> the structure of the project is a bit strange
plashchynski has quit [Quit: plashchynski]
Oka has joined #ruby
anarang has quit [Quit: Leaving]
Matachines has joined #ruby
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
oo_ has quit [Remote host closed the connection]
<fred1807> ok, nevermind, lets find something better :D
sinkensabe has quit [Ping timeout: 264 seconds]
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> hehe
OnBrokenWings has quit [Read error: Connection reset by peer]
SOLDIERz has joined #ruby
riotjones has joined #ruby
bjmllr has quit [Remote host closed the connection]
bjmllr has joined #ruby
krz has joined #ruby
riotjone_ has quit [Ping timeout: 265 seconds]
Rapier- has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
shock_one has joined #ruby
livathinos has joined #ruby
segfalt has quit [Quit: segfalt]
krz has quit [Ping timeout: 256 seconds]
nszceta has quit [Max SendQ exceeded]
n008f4g_ has joined #ruby
mhib has joined #ruby
nszceta has joined #ruby
Spami has joined #ruby
vudew has joined #ruby
DaniG2k has quit [Ping timeout: 240 seconds]
endash has joined #ruby
shock_one has quit [Ping timeout: 264 seconds]
jeromelanteri has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
jeromelanteri has joined #ruby
mistermocha has joined #ruby
oo_ has joined #ruby
otisZart has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
digitalZombie has quit [Ping timeout: 240 seconds]
f0ster has quit [Ping timeout: 248 seconds]
timonv has quit [Ping timeout: 252 seconds]
mistermocha has quit [Ping timeout: 245 seconds]
Morkel has quit [Quit: Morkel]
haxrbyte has joined #ruby
timonv has joined #ruby
astrobunny has quit [Remote host closed the connection]
ruby-lang727 has joined #ruby
jamto11 has joined #ruby
ruby-lang612 has joined #ruby
<ruby-lang612> someone on?
<ruby-lang612> whats wrong with this code:
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = ra
d10n-work has joined #ruby
dblessing has joined #ruby
luksaur has joined #ruby
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<doppler> wow
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<ruby-lang612> books = { Wheel_of_Time: 6, Mistborn: 5, Alchemist: 7, } puts "What would you like to do? Options: (add) (update) (delete) (list)" choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = r
<Lloyd> stop
<ruby-lang612> whats wrong
<ruby-lang612> with my code?
<Lloyd> put it in a gist
juanpaucar has joined #ruby
<ruby-lang612> choice = gets.chomp case choise when "add" puts "What book would you like to add to your hash?" title = gets.chomp if book[title.to_sym] = .nil? puts "What rating do you give this book? (Between 1 and 10)" rating = gets.chomp books [title.to_sym] = rating.to_i puts "#{title} has been added to your hash with a rating of #{rating}" else puts "That book is already in your hash"
<ruby-lang612> hwere?
<ruby-lang612> where?
<ruby-lang612> when I run it: ruby books.rb books.rb:19: syntax error, unexpected '=', expecting keyword_then or ';' or '\n' if book [title.to_sym] = .nil? ^ endre-c1ml2d4cdty3:ruby elev$
<ruby-lang612> why?
<apeiros> ruby-lang612: because spamming the channel is rather annoying
<ruby-lang612> yes but whats wrong
<ruby-lang612> with my ode
<ruby-lang612> my code
<doppler> put it on gist: https://gist.github.com/
<Lloyd> I'm not even going to look until you put it into a gist
<apeiros> ruby-lang612: gist it. and then we will try to help.
haxrbyte has quit [Ping timeout: 246 seconds]
<ruby-lang612> what means gist it?
<apeiros> ruby-lang612: that link people now gave you 3 times already.
<Lloyd> go to https://gist.github.com/ and paste your code there
ruby-lang727 has quit [Ping timeout: 246 seconds]
<ruby-lang612> I gisted it
<ruby-lang612> what now?
<Lloyd> give us the link to the gist
<apeiros> you paste the url to the gist here
krisquig_ has joined #ruby
krisquigley has quit [Read error: Connection reset by peer]
jheg has quit [Quit: jheg]
relix has quit [Read error: Connection reset by peer]
nszceta has quit [Remote host closed the connection]
scruple has joined #ruby
<ruby-lang612> whats wrong with the code?
barkerd427 is now known as zz_barkerd427
juanpaucar has quit [Ping timeout: 265 seconds]
knikolov1 has joined #ruby
<apeiros> ruby-lang612: what makes you think that something is wrong?
relix has joined #ruby
<ruby-lang612> when I run it
<ruby-lang612> in terminal
nszceta has joined #ruby
knikolov1 is now known as digitalZombie
<ruby-lang612> ruby books.rb books.rb:19: syntax error, unexpected '=', expecting keyword_then or ';' or '\n' if book [title.to_sym] = .nil? ^ endre-c1ml2d4cdty3:ruby elev$
<ruby-lang612> this comes
<ruby-lang612> ruby books.rb books.rb:19: syntax error, unexpected '=', expecting keyword_then or ';' or '\n' if book [title.to_sym] = .nil? ^ endre-c1ml2d4cdty3:ruby elev$
ki0 has quit []
fgo has quit [Quit: WeeChat 1.1.1]
<jhass> you don't need to paste everything twice
<apeiros> ruby-lang612: ok, take a look at line 17 in your gist
<jhass> ruby-lang612: indent it properly then you'll see that you miss an end
<apeiros> "if book[title.to_sym] = .nil? " - that .nil? is not valid
<ruby-lang612> what you mean
<ruby-lang612> what should i do?
<jhass> and that = is not what you intent
<apeiros> ruby-lang612: also you probably should get yourself a proper IRC client. the one you use now seems to send messages multiple times.
<ruby-lang612> jhass thanks
<ruby-lang612> so the code isnt working? or should I just change something in line 17?
relix has quit [Max SendQ exceeded]
allcentury has joined #ruby
<jhass> you should read the exercise explaining if's and case when's again
relix has joined #ruby
<ruby-lang612> but I did the same thing as a guy on youtube
<ruby-lang612> and it worked with him
otisZart has joined #ruby
<ruby-lang612> at 12 minutes the same code
<jhass> I'm pretty sure he didn't do that
<ruby-lang612> worked
<ruby-lang612> look at 12 minutes
ndrei has joined #ruby
<ruby-lang612> on the video
<ruby-lang612> same code
<ruby-lang612> 12.30
hazelux has joined #ruby
IronKoopa has quit [Ping timeout: 245 seconds]
basiclaser has joined #ruby
<jhass> get another tutorial series
<ruby-lang612> lol
<ruby-lang612> jhass?
<jhass> this one is pretty crappy
<ruby-lang612> why?
<jhass> ruby-lang612: look at the editor, at the tabs at the top
<jhass> see the * next to the filename?
<ruby-lang612> yes?
<jhass> he didn't even save what he shows
<ruby-lang612> lol
<jhass> so he's clearly running something else
<ruby-lang612> really?
<jhass> besides his indentation is completely fucked up, it's not good to learn from
<ruby-lang612> jhass I have to say something
<ruby-lang612> I think you banned me
startupality has joined #ruby
<jhass> though he fixed your error 2 minutes in
<ruby-lang612> ok
<ruby-lang612> you banned me
<ruby-lang612> when I used termina
jeromelanteri has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<ruby-lang612> I was elev or anonymous
<ruby-lang612> remember?
<ruby-lang612> 12 years old
<ruby-lang612> shit kid
<ruby-lang612> ?
digitalZombie has quit [Ping timeout: 276 seconds]
<jhass> if you want to discuss your ban take it to query please
<ruby-lang612> can you unban me pls
<shellfu> goddamn you're annoying with your typing habits. Stating everything like a short text message.
<ruby-lang612> I am sorry for wha I did
<ruby-lang612> sorry
sgambino has joined #ruby
otisZart has quit [Client Quit]
<ruby-lang612> jhass you think you can unban me?
hazelux has quit [Ping timeout: 250 seconds]
<shellfu> im too hungover to follow all the little messages. Formulate your thoughts, and if you see he asked to take it to query.
davedev24_ has quit [Remote host closed the connection]
<ruby-lang612> what does query means?
IronKoopa has joined #ruby
* shellfu stops reading IRC for a bit. Ping him if you need him.
JDiPierro has joined #ruby
<ruby-lang612> its jhass gone now?
<jhass> ruby-lang612: looks like I did a temporary ban
<ruby-lang612> yes
<jhass> you're not in any ban lists
<ruby-lang612> yes
<ruby-lang612> not this channel
<ruby-lang612> when I go to terminal irssi, join ruby it says: cant join channel you are banned
<ruby-lang612> 2 seconds ago
<shevy> use xchat
<apeiros> oh wow, lol @ that tutorial. so sad.
<ruby-lang612> 15:01 -!- Cannot join to channel #ruby (You are banned)
<apeiros> would be nice if there was a good video tutorial…
<ruby-lang612> apeiros is my tutorial bad?
scripore has joined #ruby
<jhass> apeiros: the codeschool stuff is fairly decent, didn't check the ruby one though and it's paid
jespada has quit [Quit: Leaving]
<ruby-lang612> jhass I am still banned
<ruby-lang612> my name was elev, anonym or anonymous
Igorshp has joined #ruby
<AlphaAtom> was it AnonymousWS?
<ruby-lang612> yes
<ruby-lang612> :)
<ruby-lang612> Thats my name on my computer :)
lfox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
quimrstorres has quit [Remote host closed the connection]
<ruby-lang612> jhass it was anonymousWS
<jhass> ah that one
<wasamasa> yes, that one
<ruby-lang612> sotty mate, give me 1 more chanse
<wasamasa> this should count as ban evasion actually and result in a permaban
scripore has quit [Client Quit]
quimrstorres has joined #ruby
* shellfu concurs
<wasamasa> so, please get the heck out and discuss this in a private /query or you'll lose that chance, too
ChoiKyuSang has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
krz has joined #ruby
shock_one has joined #ruby
<ruby-lang612> ok sorry guys
scripore has joined #ruby
tus has joined #ruby
shock_one has quit [Remote host closed the connection]
ChoiKyuSang has joined #ruby
toby has joined #ruby
Channel6 has joined #ruby
toby is now known as Guest82863
<ruby-lang612> jhass you here?
blaxter has quit [Quit: foo]
tagrudev has quit [Remote host closed the connection]
<wasamasa> dude
<jhass> as said, if you want to discuss, take it to a query
<wasamasa> it's a /query jhass
<Guest82863> yao
<wasamasa> leave the channel alone
Guest82863 is now known as tobyt
<ruby-lang612> jhass?
<tobyt> Any rails channel here on freenode? I just get redirected to ##namespace?
<jhass> ruby-lang612: you're still in the channel
quimrstorres has quit [Ping timeout: 246 seconds]
<jhass> ?rails tobyt
<ruboto> tobyt, Please join #RubyOnRails for Rails questions.
<shellfu> "Are you deaf and stupid? I said NO!" - Marty McFly
Phage is now known as Phage^
<tobyt> ruboto: thanks man
<shevy> tobyt ruboto is a bot :D
* wasamasa is not sure whether ruboto accepts that gendering
bruno- has joined #ruby
<shellfu> yeah. Was data "just a bot"?
<shellfu> Isnt Johnny 5 alive!?
<shevy> data was pretty smart
<shevy> except when it came to cats
<shevy> let me try to find that youtube clip...
<shellfu> truth :)
<jhass> or reproduction
* shellfu wonders if ruboto is 3 laws safe
<shevy> Der Runtergang
<ruby-lang612> I figured it out :) thanks guys
<shevy> awww... I recently saw some star trek NG meeting...
<shevy> dudes got so old, it made me sad :(
<ruby-lang612> jhass I am banned...
<shevy> I was young when I saw TNG!
<jhass> ruby-lang612: and with this account too next time you talk about that in the channel instead of query
<ruby-lang612> cannot join to channel #ruby (You are banned)
<ruby-lang612> what you mean?
<ruby-lang612> isnt this the channel?
blackmesa has joined #ruby
<jhass> yes, and that's the problem
<wasamasa> this is the channel and you should get out of it immediately
<ruby-lang612> why?
<wasamasa> because you were told so
<ruby-lang612> what?
EasyCo has quit [Quit: Connection closed for inactivity]
<ruby-lang612> I dont understand this
<ruby-lang612> jhass I am banned when I try go to this channel on the terminal
<ruby-lang612> can you unban me please?
<jhass> no
<ruby-lang612> I was elev, anonymous, anonymousws
<wasamasa> ruby-lang612: jhass is basically the law here
<ruby-lang612> why not?
<ponga> ruby-lang612: English isn't my first language and i understand the vid
<ruby-lang612> but I can just talk here?
<ponga> hey shevy
<ruby-lang612> why is it better to talk here than in terminal?
<wasamasa> ruby-lang612: better play along if you wish to get unbanned
<ponga> i found this on web and translated it http://i.imgur.com/op5st16.png
<ruby-lang612> I love jhass
platzhirsch has left #ruby [#ruby]
<ponga> they teach shit here
<ruby-lang612> he is online all time helping me xd
<jhass> !mute ruby-lang612
<tobyt> shellfu: thanks for letting me know pal :)
<wasamasa> [X] Can not take a hint
bruno- has quit [Ping timeout: 272 seconds]
tobyt has left #ruby [#ruby]
<ponga> i didn't know jhass was the crown here
<ponga> perhaps better for me to not troll him
<shevy> he has mighty cojones here
<flughafen> mongoponga he invented the crown
<ponga> cojones, another fancy English word i learn from shevy in #ruby
jamto11 has quit [Remote host closed the connection]
<shevy> ponga well ok it is spanish... but the USA adopts mexican-spanis
<flughafen> jhass is a mighty warrior with 3 ban dragons
<shevy> *spanish
mdw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
afrianska has joined #ruby
Feyn has quit [Quit: Leaving]
hiyosi has joined #ruby
davedev24_ has joined #ruby
allcentury has quit [Ping timeout: 252 seconds]
niKeITA has joined #ruby
milesmatthias has joined #ruby
ki0 has joined #ruby
Pupeno has quit [Quit: Leaving...]
simonewestphal has quit [Ping timeout: 245 seconds]
RegulationD has joined #ruby
emocakes has quit [Ping timeout: 264 seconds]
simonewestphal has joined #ruby
milesmatthias has quit [Ping timeout: 272 seconds]
ta has quit [Remote host closed the connection]
fryguy9 has joined #ruby
ta has joined #ruby
idealexit has joined #ruby
sankaber has joined #ruby
ghr has joined #ruby
evanjs has joined #ruby
RegulationD has quit [Ping timeout: 272 seconds]
bennysan has quit [Ping timeout: 265 seconds]
thatslifeson has joined #ruby
bennysan has joined #ruby
bennysan has quit [Remote host closed the connection]
bennysan has joined #ruby
mjuszczak has joined #ruby
doodlehaus has joined #ruby
vtunka has quit [Quit: Leaving]
ta has quit [Ping timeout: 276 seconds]
Soda has joined #ruby
hanmac1 has joined #ruby
mrmargolis has joined #ruby
sh00p has joined #ruby
yalue has joined #ruby
<sh00p> I am experimenting with receiving UDP broadcasts with rubys UDPSocket. However, it seems I need to bind to 0.0.0.0 in order to receive any
<sh00p> and then I seem to also receive the traffic on the loopback device
<sh00p> can I receive udp broadcasts by binding to my real interface ip?
<izzol> it's better to use private or protected? I understand private but protected seems to be strange..
DaniG2k has joined #ruby
<jhass> oh he found my mail address interesting
spyderman4g63 has joined #ruby
sevenseacat has joined #ruby
<izzol> jhass: who? :)
<jhass> izzol: protected is rarely used in the ruby community since a lot of people try to keep their hierarchies flat
<jhass> not important ;)
cocotton has joined #ruby
shock_one has joined #ruby
paulcsmith has joined #ruby
<shevy> his secret admirer
hellome has quit [Remote host closed the connection]
<wasamasa> lol
cocotton has quit [Remote host closed the connection]
<izzol> ahh, just scroll up the screen ;p
* wasamasa foresees OC spamming in #ruby
<ponga> shevy hey sir
bartkoo has joined #ruby
<wasamasa> something along the lines of "DeathCode and jhass sitting in a tree, K-I-S-S-I-N-G"
allcentury has joined #ruby
cphrmky has joined #ruby
<jhass> oddly enough deathcode knows very well how to do a query
<ponga> you know ,web application, one that's usually hosted on the server, but can i utilize this as "app that runs on browser cross-platform" and distribute the files available to download
bruno- has joined #ruby
<ponga> cos i can't bother about getting osx , windows, blah blah
juanpablo_ has joined #ruby
<wasamasa> jhass: you think he intentionally probed how far he can go?
<ponga> is this idea sane
<wasamasa> jhass: or is it more that he was forced to learn how to do it
bruno- is now known as Guest70488
jbc8 has joined #ruby
<jhass> wasamasa: I mean it's not deathcode
<wasamasa> jhass: ._.
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jbc8> if i run ssh ... -t "facter" it says "/usr/bin/env: ruby: No such file or directory"
jheg has joined #ruby
havenwood has joined #ruby
<jbc8> but it works from an ssh terminal
<shevy> yo ponga
spyderman4g63 has quit [Remote host closed the connection]
<ponga> shevy: would it work
lordkryss has quit [Quit: Connection closed for inactivity]
<jhass> sh00p: you do set SO_BROADCAST?
dstarh has joined #ruby
msmith_ has joined #ruby
<jhass> oh, nvm that was the sender side
_honning_ has quit [Remote host closed the connection]
<shevy> ponga I dunno. All I want is that I don't want to write javascript, I want ruby
anarang has joined #ruby
spyderman4g63 has joined #ruby
ento2206 has joined #ruby
msmith_ has quit [Remote host closed the connection]
<ento2206> hey
msmith_ has joined #ruby
<ento2206> sure :)
<ento2206> its jhass here?
juanpablo_ has quit [Ping timeout: 256 seconds]
mjuszcza_ has joined #ruby
_honning_ has joined #ruby
lovejhass has joined #ruby
<sh00p> jhass, solved it by setting SO_BINDTODEVICE
<jhass> sh00p: ah, nice
Channel6 has quit [Quit: Leaving]
IronKoopa has quit [Ping timeout: 272 seconds]
anarang has quit [Client Quit]
mjuszczak has quit [Ping timeout: 252 seconds]
ruby-lang612 has quit [Ping timeout: 246 seconds]
Guest55044 has quit [Remote host closed the connection]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
ento2206 has quit [Ping timeout: 246 seconds]
iamjarvo has joined #ruby
lovejhass has quit [Ping timeout: 246 seconds]
symbol_ has joined #ruby
Pipocah has quit [Quit: Leaving]
symbol_ has quit [Client Quit]
cocotton has joined #ruby
pauly_oc has joined #ruby
stef204 has joined #ruby
Guest34688 has quit [Changing host]
Guest34688 has joined #ruby
Guest34688 is now known as daynaskully
iamjarvo has quit [Ping timeout: 256 seconds]
bim has joined #ruby
workmad3 has joined #ruby
bim is now known as Guest58359
Cache_Money has joined #ruby
vtunka has joined #ruby
quimrstorres has joined #ruby
dkwjdies has joined #ruby
spyderman4g63 has quit [Remote host closed the connection]
lfox has joined #ruby
dkwjdies has quit [Client Quit]
lordkryss has joined #ruby
bartkoo has quit [Read error: No route to host]
shoutsid has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
sameerynho has quit [Quit: Leaving]
dumdedum has joined #ruby
bartkoo has joined #ruby
fabrice31 has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 264 seconds]
fabrice31 has joined #ruby
RandyT has quit [Ping timeout: 272 seconds]
lfox has quit [Client Quit]
enebo has joined #ruby
lfox has joined #ruby
<kq_away> Is there a reverse of .take? I want the range, except for 30 last elements
<kq_away> would foo[0..-30] be sufficient?
lfox has quit [Client Quit]
mocha has joined #ruby
Kricir has joined #ruby
noname1 has quit [Ping timeout: 272 seconds]
mocha is now known as Guest92020
mgberlin has joined #ruby
hazelux has joined #ruby
<gregf_> prolly -30..-1
simonewestphal has quit [Read error: Connection reset by peer]
blackmesa has quit [Read error: Connection reset by peer]
<jhass> 0..-30 looks good to me
mgberlin has quit [Remote host closed the connection]
<kq_away> actually
<kq_away> 0..-30 is off by one :P
<kq_away> 0...-30 worked :P
<gregf_> ah - ok, leave the last 30 elements
RandyT- has joined #ruby
juanpablo_ has joined #ruby
<kq_away> Yeah, I want to zip logs older than x, but leave y freshest logs in case none are being generated (weekends etc)
<kq_away> Thanks!
RandyT| has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
<jhass> might want to sort in reverse then and .drop(30)
griffindy has joined #ruby
<jhass> (I assume you're sorting somewhere)
RandyT has joined #ruby
<kq_away> hm
<kq_away> I am not, and it's doubleungood, because I rely on the filenames being sorted
<jhass> yeah, you should sort
<jhass> that it worked so far is pure luck
shock_one has quit [Remote host closed the connection]
<kq_away> otherwise, the behaviour is undefined
<kq_away> ;)
<jhass> >> [2, 4, 1, 3].sort_by {|x| -x }
<ruboto> jhass # => [4, 3, 2, 1] (https://eval.in/317190)
<jhass> in case you wondered
<kq_away> I think I'm good
droidburgundy has joined #ruby
<kq_away> the filenames begin with easily sortable date
RandyT- has quit [Ping timeout: 248 seconds]
RandyT| has quit [Ping timeout: 245 seconds]
balazs_ has joined #ruby
<kq_away> I wonder if there's a Duration class, though
cphrmky has quit [Ping timeout: 244 seconds]
<kq_away> I'd rather say 3 * 60 * 60.seconds or something
<apeiros> sadly not in plain ruby
simonewestphal has joined #ruby
<jhass> can I get you to use snake_case for variable names please? :P
claw has joined #ruby
jheg has quit [Quit: jheg]
workmad3 has joined #ruby
RandyT has quit [Ping timeout: 246 seconds]
<jhass> and I'd spare the .to_h, you're not relying on the hash lookup
RandyT has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
<jhass> Kernel. is never needed unless you're inside (a subclass of) BasicObject
<apeiros> and then it'd be ::Kernel.
sinkensabe has joined #ruby
<kq_away> jhass: give it time :P
sinkensabe has quit [Remote host closed the connection]
<kq_away> it's a copy of the log packer script, so there may be some leftovers
gauke has joined #ruby
andikr has quit [Remote host closed the connection]
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<kq_away> other than snake case and unnecessary .to_h and Kernel., am I good?
<jhass> it's fine, yeah
jenrzzz has joined #ruby
Kricir has quit []
<jhass> if you want to play with some OO, a BackupFile class could be nice
<kq_away> not this time, but there is a lot of ruby in my future, I think
<jhass> BackupFile.all.select {|file| file.older_than? MinimumAge }.each do |file| file.delete if file.compress
SOLDIERz has joined #ruby
griffindy has quit [Quit: leaving]
thatslifeson has quit [Read error: Connection reset by peer]
griffindy has joined #ruby
SOLDIERz has quit [Client Quit]
<kq_away> it does look nice though
<jhass> might do BackupFile.search_in(SearchDir) actually
psy_ has joined #ruby
lavros has joined #ruby
shock_one has joined #ruby
SOLDIERz has joined #ruby
simonewestphal has left #ruby [#ruby]
Cache_Money has quit [Quit: Cache_Money]
simonewestphal has joined #ruby
SOLDIERz has quit [Client Quit]
iamjarvo has joined #ruby
<hanmac1> jhass: i am still interested in a reverse_sort_by, bad that it isnt in the ruby code yet ...
iamjarvo has quit [Max SendQ exceeded]
<jhass> hanmac1: you can still submit it to Crystal :P
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
<hanmac1> hm other posible way would be sort_by(:dsc) {} ;P
iamjarvo has quit [Max SendQ exceeded]
mary5030 has joined #ruby
startupality has quit [Quit: startupality]
mary5030 has quit [Remote host closed the connection]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<kq_away> does foo.lazy.reverse make any sense?
<jhass> sort_asc_by, sort_desc_by and make sort_by an alias of sort_asc_by
startupality has joined #ruby
mary5030 has joined #ruby
<jhass> I don't think so
iamjarvo has joined #ruby
evanjs has quit [Remote host closed the connection]
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<jhass> actually there isn't even a .reverse for Enumerator::Lazy
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hanmac1 has quit [Quit: Leaving.]
<kq_away> I see
cpt_yossarian has quit [Ping timeout: 272 seconds]
iamjarvo has joined #ruby
<havenwood> kq_away: there isn't a plain Enumerator#reverse either
iamjarvo has quit [Max SendQ exceeded]
bluOxigen has joined #ruby
rodfersou has quit [Ping timeout: 264 seconds]
<kq_away> so it'd have to be foo.lazy[0..-1].reverse
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
griffindy has quit [Quit: leaving]
<kq_away> is there a better way to express time duration?
iamjarvo has joined #ruby
<jhass> the .lazy would just waste time in that
griffindy has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
kobain has joined #ruby
juanpaucar has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
jobewan has joined #ruby
<jhass> you mean than 3 * 60 * 60? some people prefer to do 10800 # 3*60*60
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
simonewestphal has quit [Quit: simonewestphal]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<kq_away> jhass: I'd prefer something like 3 * 60 * seconds(60) or 3.hours or something
iamjarvo has joined #ruby
<jhass> 3.hours you can get with ActiveSupport, but not plain ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
niKeITA has quit [Quit: ZZZzzz…]
juanpaucar has quit [Ping timeout: 256 seconds]
sigurding has quit [Quit: sigurding]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<havenwood> kq_away: >> require 'active_support/core_ext/numeric/time'; 3.hours #=> 10800 seconds
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
tvw has quit [Ping timeout: 245 seconds]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
krz has quit [Ping timeout: 276 seconds]
iamjarvo has joined #ruby
<havenwood> kq_away: Or there are other gems.
niKeITA has joined #ruby
pandaant has joined #ruby
<apeiros> havenwood: as per something I found out just a few hours ago, as of rails 4.2, you have to require 'active_support' first
OnBrokenWings has joined #ruby
<apeiros> well, actually if you only require the numeric/time, it might still work.
<shevy> jhass I dived into the C source of bluefish-1.x recently, and I have to say - GTK is ugly to no ends
<jhass> shevy: yeah...
<apeiros> havenwood: ok, requiring numeric/time specifically works in 4.2
afrianska has quit [Quit: Leaving]
dx7 has joined #ruby
<jhass> shevy: gobject-introspection is handy though
<jhass> makes binding generation a lot easier
segfalt has joined #ruby
pauly_oc has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chipotle has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mwlang has joined #ruby
<mwlang> hmmm…. Date.new.to_s => "-4712-01-01"
noname3 has joined #ruby
<mwlang> I don’t know why, but I would’ve expected today’s date rather than first date possible…
<jhass> yeah that's inconsistent with Time.new
Sp4rKy has quit [Changing host]
Sp4rKy has joined #ruby
fryguy9 has quit [Quit: Leaving.]
milesmatthias has joined #ruby
<kq_away> havenwood: thanks
<apeiros> mwlang: Date.today
bennysan has quit [Ping timeout: 245 seconds]
<kq_away> I have activesupport for to_xml already
<jhass> DateTime.new does it too though, so it's kinda Time that falls out
<havenwood> Speaking of Rails, live stream: https://www.youtube.com/watch?v=wQCda5PBn0A
<kq_away> though it is funny, because I have to use XmlSimple for xml reading
<apeiros> Date.new used to be private
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
konsolebox has joined #ruby
<apeiros> I'm still not sure whether I consider making it public and act like .civil a mistake, even despite the confusion that resulted in.
hiyosi has quit [Quit: Textual IRC Client: www.textualapp.com]
konsolebox has quit [Max SendQ exceeded]
konsolebox has joined #ruby
aganov has quit [Read error: Connection reset by peer]
hiyosi has joined #ruby
<havenwood> Koichi-san talking right now!
Pupeno has joined #ruby
* apeiros jealous
<mwlang> apeiros: yeah, it has been a confusing evolution of that class.
<apeiros> mwlang: that's actually about the only change :D
<havenwood> I'm not there. Just picked up the stream.
<apeiros> havenwood: ah
tesuji has quit [Read error: Connection reset by peer]
<havenwood> I've never been to a RailsConf
rodfersou has joined #ruby
avgerinos has quit [Remote host closed the connection]
<mwlang> I only tripped up just now because I was putting a utility function together to handle any of YYYY, YYYYMM, or YYYYMMDD coming in via an XML file.
konsolebox has quit [Max SendQ exceeded]
uri has joined #ruby
<jhass> havenwood: "Live streaming unavailable in Germany due to right issues" oO
konsolebox has joined #ruby
<havenwood> jhass: >.>
jenrzzz has quit [Ping timeout: 256 seconds]
<apeiros> I've been to some. but stopped due to budget unclarities in the company. and now I'd probably still not go due to USA being on my no-fly list.
<mwlang> Date.new(*value.match(/(\d{4})(\d{2})?(\d{2})?/).captures.compact.map(&:to_i))
<mwlang> :-D
<apeiros> mwlang: .compact? so you don't mind having the day as year?
<apeiros> ah well, actually with that regex, shouldn't happen…
fred1807 has left #ruby [#ruby]
<mwlang> apeiros: nope. No choice, really. I need a valid date to post to the database.
<mwlang> if only year is given, then Jan 1st of that year is acceptable.
balazs__ has joined #ruby
chipotle has quit [Quit: cheerio]
sevenseacat has quit [Quit: Me dun like you no more.]
arturaz has quit [Ping timeout: 244 seconds]
<mwlang> only issue is when value is blank, but it actually errs out on attempting to call captures on nil, so moot that Date.new => -4712-01-01
gfawcettpq has quit [Read error: Connection reset by peer]
gfawcettpq has joined #ruby
pandaant has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
evanjs has joined #ruby
balazs__ has quit [Ping timeout: 248 seconds]
snockerton has joined #ruby
<izzol> havenwood: "
<izzol> Live Streaming is not available in your country due to rights issues."
<izzol> :P
<mwlang> apeiros: I just realized you meant day slipping into first argument position…I was thinking you meant just a “year” argument resolving to “an arbitrary day” like Jan 1st of that year.
<izzol> looks like only havenwood can watch :P
shoutsid has joined #ruby
Hijiri has quit [Quit: WeeChat 1.0.1]
cphrmky has joined #ruby
segfalt has quit [Quit: segfalt]
sinkensabe has joined #ruby
<doppler> shevy do you remember the script i gisted? the one you thought was weird and not very rubyish. you mentioned something about "<<" and some other stuff, though im not really comfortable on how to use "<<".. i have an another example now which basically does the same thing as the last script, except it looks a little bit different. but it would be awesome if you could give me an example on how you would use "<<". https://gist.github.co
fryguy9 has joined #ruby
michaeldeol has joined #ruby
<doppler> i just would like to see how to do things differently =)
sinkensabe has quit [Remote host closed the connection]
<jhass> doppler: += and << is, for strings, interchangeable
<jhass> << is just more efficient
<jhass> but it modifies the value, which can be an issue if you don't own it (if it was passed to you)
<shevy> doppler rather than += you can use <<
<jhass> doppler: also your gist link got cut off due to the message limit
<doppler> x << 'Buzz' if i % 5 == 0
<doppler> ?
<jhass> doppler: make sure to enable syntax highlighting in your future gist btw
<doppler> like that?
<jhass> yes
iamjarvo has joined #ruby
shoutsid has quit [Ping timeout: 255 seconds]
SouL_|_ has joined #ruby
<jhass> not that either of those examples are nice examples of fizzbuzz
<doppler> i see. i read some other aswell. i just took those two out of random. the first example was a little weird. i didnt get it at first.
Cache_Money has joined #ruby
metalic has joined #ruby
segfalt has joined #ruby
zz_barkerd427 is now known as barkerd427
mistermocha has joined #ruby
plribeiro3000 has quit [Quit: Leaving.]
n008f4g_ has quit [Ping timeout: 255 seconds]
willharrison has joined #ruby
chipotle has joined #ruby
shoutsid has joined #ruby
gauke_ has joined #ruby
<doppler> does << bascially work like stack?
fryguy9 has quit [Quit: Leaving.]
<jhass> << is a method call, what it does depends on what you call it on
<jhass> same for +=, which is just a = a + b thus calls the + method
Bira has joined #ruby
<doppler> oh alright
gauke has quit [Ping timeout: 245 seconds]
gauke_ is now known as gauke
Matachines has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<doppler> oh maybe im just confusing it with stack because ive seen it used in examples with stack
<jhass> quite possible, on array it's similar to push
RegulationD has joined #ruby
CloCkWeRX has quit [Ping timeout: 256 seconds]
balazs_ has quit [Ping timeout: 256 seconds]
Technodrome has joined #ruby
fryguy9 has joined #ruby
mrmargol_ has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dx7 has quit [Quit: Leaving...]
vtunka has quit [Quit: Leaving]
<doppler> jhass okay alright. lemme figure this out and ill come back with a script. and maybe you could then give me a few pointers?
<jhass> sure
<doppler> thanks
<jhass> though don't focus on people too much, just ask the channel
<doppler> alright, roger that
RegulationD has quit [Ping timeout: 240 seconds]
mrmargolis has quit [Ping timeout: 248 seconds]
jbc8 has quit [Read error: Connection reset by peer]
ramfjord has joined #ruby
gauke has quit [Ping timeout: 276 seconds]
spyderman4g63 has quit [Read error: Connection reset by peer]
duderonomy has quit [Ping timeout: 256 seconds]
<ponga> !ping
<ponga> hm
spyderman4g63 has joined #ruby
<jhass> ?ping
<ruboto> I don't know anything about ping
<jhass> oh
<jhass> !fact mk ping pong
<ruboto> jhass, I will remember that ping is pong
blizzy has joined #ruby
quimrstorres has quit [Remote host closed the connection]
<ponga> !ping
<ponga> !fact ping
<ruboto> pong
quimrstorres has joined #ruby
<ponga> gud
<ponga> is it a coincidence that ruboto has the same name as android ruby framework
dudedudeman has joined #ruby
<dudedudeman> good morning to you beautiful rubyists
<ponga> mornin
<izzol> moin
_blizzy_ has quit [Ping timeout: 245 seconds]
ghr has quit [Ping timeout: 256 seconds]
dfinninger has joined #ruby
havenwood has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
quimrstorres has quit [Ping timeout: 240 seconds]
ndrei has quit [Ping timeout: 240 seconds]
<dudedudeman> what's everyone working on today?
Matachines has joined #ruby
<jhass> my sanity
balazs_ has joined #ruby
vroomanj has joined #ruby
<kq_away> .sanitize
Matachines has quit [Client Quit]
<dudedudeman> i would help if i could, but it would be the blind leading the blind then
<ponga> jhass.sanitize!
<vroomanj> I did a bundle update and now none of my bootstrap javascript is working (such as drop down menus and carousels). Anyone have any tips?
<jhass> NoMethodError: private method `sanitize` called for jhass:Person
<doppler> cool bot by the way. how does it remember stuff? i tried to make something similar. however, my knowledge of ruby is pretty much zero, so i didnt get very far. but i accidently came across YAML which was pretty neat. i didnt get it to work though.
fryguy9 has quit [Quit: Leaving.]
cphrmky has quit [Quit: Textual IRC Client: www.textualapp.com]
symbol has joined #ruby
<jhass> vroomanj: don't do an open bundle update
<jhass> bump stuff specifically and intentionally
<ponga> jhass: nice one :)
<ponga> no method!
<vroomanj> jhass: that's what I was getting the impression of. Now if I could only go back...
psyprus has joined #ruby
<jhass> so you can relate breakages to the update and look at the changelogs and reported issues
<jhass> vroomanj: you don't use git?
<jhass> or hg or anything
asmodlol has joined #ruby
startupality has quit [Read error: Connection reset by peer]
<vroomanj> jhass: Oh yeah, I guess the Gemfile.lock will still use the old versions wont it? I was thinking git wouldn't fix my problems.
fabrice31 has quit [Remote host closed the connection]
<jhass> doppler: this one uses a postgesql database, my own bot uses JSON, the version before it used indeed YAML
CloCkWeRX has joined #ruby
`sicks has quit [Quit: Leaving]
<jhass> vroomanj: bundle update does nothing beyond updating the lock (and installing the new version)
fabrice31 has joined #ruby
chipotle has quit [Ping timeout: 248 seconds]
<vroomanj> jhass: Ahhhhk Thanks. I think I can fix my problem.
startupality has joined #ruby
<doppler> jhass: very cool. i hope i can do something like that one day
<doppler> ops
davedev24_ has quit [Ping timeout: 246 seconds]
davedev2_ has joined #ruby
lessless has joined #ruby
roshanavand has quit [Ping timeout: 264 seconds]
roshanavand has joined #ruby
Guest92020 has quit [Ping timeout: 264 seconds]
ayaz has quit [Quit: Textual IRC Client: www.textualapp.com]
_honning_ has quit [Ping timeout: 276 seconds]
CloCkWeRX has quit [Ping timeout: 240 seconds]
fabrice31 has quit [Ping timeout: 245 seconds]
iamninja_ has quit [Read error: Connection reset by peer]
<shevy> doppler it will be better if you write ruby code by yourself, then your brain will have it easier to adapt it, rather than re-use what someone else wrote
iamninja_ has joined #ruby
freerobby has joined #ruby
davedev24_ has joined #ruby
gagrio has quit [Ping timeout: 255 seconds]
symbol has quit [Quit: WeeChat 1.1]
davedev2_ has quit [Ping timeout: 272 seconds]
sinkensabe has joined #ruby
kharma1 has joined #ruby
pacMakaveli has quit []
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
evanjs has quit [Remote host closed the connection]
mjuszcza_ has quit []
<kharma1> Hey all, does anyone have any previous success with extracting emails from winmail.dat files using ruby?
<doppler> shevy yes. thats true
iamjarvo has joined #ruby
fryguy9 has joined #ruby
iamjarvo has quit [Client Quit]
mjuszczak has joined #ruby
Cloudhand has joined #ruby
idealexit has quit [Remote host closed the connection]
mjuszczak has quit [Ping timeout: 256 seconds]
quimrstorres has joined #ruby
nettoweb has joined #ruby
segfalt has quit [Quit: segfalt]
sinkensabe has quit [Remote host closed the connection]
josephleon has joined #ruby
evanjs has joined #ruby
Cache_Money has left #ruby [#ruby]
laurentide has joined #ruby
doertede1 has quit [Ping timeout: 246 seconds]
scripore has quit [Quit: This computer has gone to sleep]
SouL_|__ has joined #ruby
asmodlol has quit [Quit: Leaving]
<dudedudeman> git push -u origin master
<dudedudeman> .... sorry. wrong window. :/
hollywood has joined #ruby
<ponga> wrong window? wrong channel was far from mistake!
mleung has joined #ruby
<dudedudeman> wrong everything. lol. i'm not even in a git channel
naftilos76 has joined #ruby
SouL_|_ has quit [Ping timeout: 252 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
segfalt has joined #ruby
segfalt has quit [Client Quit]
<audy> Counting objects: 6, done.
<audy> Delta compression using up to 4 threads.
<audy> Compressing objects: 100% (6/6), done.
segfalt has joined #ruby
CloCkWeRX has joined #ruby
havenwood has joined #ruby
alex88 has quit []
SouL_|_ has joined #ruby
fryguy9 has quit [Quit: Leaving.]
fryguy9 has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
barkerd427 is now known as zz_barkerd427
DerisiveLogic has joined #ruby
GaryOak_ has joined #ruby
SouL_|__ has quit [Ping timeout: 265 seconds]
pauly_oc has joined #ruby
bluOxigen has left #ruby [#ruby]
dumdedum has quit [Quit: foo]
ndrei has joined #ruby
_honning_ has joined #ruby
evanjs has quit [Remote host closed the connection]
pontiki has quit [Ping timeout: 250 seconds]
hollywood has quit [Quit: Leaving]
<izzol> Anyone using vim ruby-mode ? I cannot find the good plugin for it. I'm looking something similar to the python-mode (https://github.com/klen/python-mode)
momomomomo has joined #ruby
DaniG2k has quit [Quit: leaving]
SouL_|_ has quit [Read error: Connection reset by peer]
SouL_|_ has joined #ruby
shock_one has quit [Remote host closed the connection]
spyderma_ has joined #ruby
troyready has quit [Remote host closed the connection]
jaequery has joined #ruby
davedev24_ has quit []
sigurding has joined #ruby
timonv has quit [Ping timeout: 250 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SouL_|__ has joined #ruby
scripore has joined #ruby
spyderman4g63 has quit [Ping timeout: 250 seconds]
troyready has joined #ruby
SouL_|_ has quit [Ping timeout: 244 seconds]
relix has joined #ruby
simonewestphal has joined #ruby
SouL_|__ has quit [Read error: Connection reset by peer]
vire has quit [Ping timeout: 244 seconds]
fryguy9 has quit [Quit: Leaving.]
spider-mario has joined #ruby
sigurding has quit [Ping timeout: 245 seconds]
spyderman4g63 has joined #ruby
kohvihoor has quit [Read error: Connection reset by peer]
sagittarian has quit [Ping timeout: 252 seconds]
Crisix has joined #ruby
Crisix has quit [Max SendQ exceeded]
spyderma_ has quit [Ping timeout: 265 seconds]
spyderma_ has joined #ruby
pika_pika has quit [Ping timeout: 245 seconds]
kohvihoor has joined #ruby
<xxneolithicxx> shevy: late as heck to the party, but i guess you would have to explain what you mean by "initial variant of codebase" wrt to git
startupality has quit [Quit: startupality]
JDiPierro has quit [Remote host closed the connection]
mary5030 has quit [Ping timeout: 255 seconds]
juanpaucar has joined #ruby
spyderm__ has joined #ruby
sevvie has joined #ruby
spyderm__ has quit [Read error: Connection reset by peer]
spyderma_ has quit [Remote host closed the connection]
willharrison has quit [Quit: Textual IRC Client: www.textualapp.com]
spyderma_ has joined #ruby
<xxneolithicxx> shevy: "initial variant" really doesnt mean much to me but if you have multiple "versions" of your codebase committed to git over time and the initial version you are looking for was also committed before then yes you can restore to that point
paulcsmith has quit [Quit: Be back later ...]
atmosx has joined #ruby
spyderm__ has joined #ruby
spyderman4g63 has quit [Ping timeout: 264 seconds]
<xxneolithicxx> shevy: in a case like that tagging the hash of the "initial variant" commit would make checking it out to restore/change easier
bricker has joined #ruby
FDj_ is now known as FDj
livathinos has quit []
Cust0sL1men has quit [Ping timeout: 256 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
mary5030 has joined #ruby
livathinos has joined #ruby
Pupeno has quit [Quit: Leaving...]
juanpaucar has quit [Ping timeout: 264 seconds]
konsolebox has quit [Ping timeout: 264 seconds]
weaksauce has joined #ruby
spyderma_ has quit [Ping timeout: 256 seconds]
Spami has quit [Quit: This computer has gone to sleep]
sohrab has joined #ruby
icebourg has joined #ruby
swgillespie has joined #ruby
blackmesa has joined #ruby
sagittarian has joined #ruby
livathinos has quit [Ping timeout: 252 seconds]
granthatcher has quit []
basiclaser has quit [Quit: Connection closed for inactivity]
Limix has joined #ruby
mikecmpb_ has quit [Ping timeout: 250 seconds]
allcentury has quit [Ping timeout: 244 seconds]
work_op has joined #ruby
fxck has joined #ruby
shock_one has joined #ruby
sevvie has quit [Ping timeout: 240 seconds]
tearan has joined #ruby
iamninja_ has quit [Ping timeout: 250 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
atmosx is now known as atmosx_osx
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
terlar has quit [Quit: WeeChat 1.1.1]
simonewestphal_ has joined #ruby
josephleon has quit [Quit: Leaving...]
swgillespie has joined #ruby
shock_one has quit [Remote host closed the connection]
michaeldeol has joined #ruby
freerobby has joined #ruby
MatthewsFace has joined #ruby
MatthewsFace has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
simonewestphal has quit [Ping timeout: 256 seconds]
simonewestphal_ is now known as simonewestphal
fryguy9 has joined #ruby
deuterium has joined #ruby
MatthewsFace has joined #ruby
<mwlang> is order of a hash preserved in Ruby 2.x?
cjim_ has joined #ruby
<yxhuvud> mwlang: should be.
<mwlang> and specifically calling the #values method.
<havenwood> mwlang: They enumerate in the order that keys were inserted.
<mwlang> havenwood: thanks.
ghr has joined #ruby
shoutsid has quit [Remote host closed the connection]
gregf has quit [Quit: WeeChat 1.0.1]
<apeiros> mwlang: yes, it is
<apeiros> not just "should" :)
<apeiros> and actually as of 1.9
SouL_|_ has joined #ruby
<mwlang> apeiros: I thought I remembered that change was specifically introduced
<apeiros> yes. it was. and it makes "Hash" even more of a misnomer than before :D
<mwlang> great, this means I can avoid a huge swath of duplicate code.
<apeiros> more like OrderedHashMap or -Table
<havenwood> good writeup ^
RegulationD has joined #ruby
fryguy9 has quit [Quit: Leaving.]
krz has joined #ruby
<mwlang> mostly, I just wanted to confirm it was a fact rather than relying on an “undocumented feature”
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> ilya… still one of those people I'd love to work with…
<havenwood> mwlang: It's in the docs: "Hashes enumerate their values in the order that the corresponding keys were inserted."
mary5030_ has joined #ruby
<havenwood> mwlang: So relying on a documented feature. :P
mary5030_ has quit [Remote host closed the connection]
jaequery has joined #ruby
graydot has joined #ruby
mary5030_ has joined #ruby
SouL_|__ has joined #ruby
<apeiros> the one thing I wish about Hash was that it'd be possible to set the seed for #hash
<mwlang> excellent. I needed a hash of values for inserting a record, but just an array of values when updating (one inserts via sql, the other updates via stored procedure)
<mwlang> apeiros: what’s the use case?
SouL_|_ has quit [Ping timeout: 252 seconds]
mary5030 has quit [Read error: Connection reset by peer]
dorei has joined #ruby
mostlybadfly has joined #ruby
freerobby has left #ruby [#ruby]
ponga has quit [Quit: Leaving...]
RegulationD has quit [Ping timeout: 256 seconds]
zack6849 has joined #ruby
hazelux has quit [Remote host closed the connection]
krz has quit [Quit: WeeChat 1.0.1]
fella7s has quit [Ping timeout: 256 seconds]
shock_one has joined #ruby
mikecmpbll has joined #ruby
<zack6849> Hey guys, i'm having some difficulty with ruby and i'm fairly new to it, i have this class i've written https://gist.github.com/zack6849/dfbd1f550a19512d0837 and for some reason, it keeps telling me that ranks is nil
sagittarian has quit [Ping timeout: 252 seconds]
<zack6849> Despite that, if i understand this correctly, ranks are loaded first, so ranks being nil shouldn't be possible
hazelux has joined #ruby
tpimtts_away has quit [Ping timeout: 245 seconds]
<zack6849> On top of that, sometimes, seemingly at random, it will actually work and not be nil, and i have no idea why
paulcsmith has joined #ruby
jobewan has quit [Ping timeout: 250 seconds]
<havenwood> zack6849: Initialize `@ranks = {}` inside your #initialize method. Instead of `x == nil` use `x.nil?` or usually it's better to take advantage of nil's falseyness and not explicitly check nil.
pagios_ has left #ruby ["Leaving"]
lolmaus has quit [Quit: Konversation terminated!]
fxck is now known as govt
jobewan has joined #ruby
<zack6849> i declare ranks as a hash in the load_ranks method anyways, why would that be necessary?
<havenwood> zack6849: Consider initializing all your class instance methods in the #initialize method.
x1337807x has joined #ruby
jespada has joined #ruby
balazs has joined #ruby
c0m0 has quit [Ping timeout: 246 seconds]
<zack6849> could this possibly be some sort of race condition?
<zack6849> havenwood, initializing *methods* inside of methods?
<zack6849> or did you mean variables?
josephleon has joined #ruby
<havenwood> zack6849: i meant instance variables
govt has left #ruby ["Leaving"]
segfalt has quit [Quit: segfalt]
<ddv> zack6849, load_ranks is way too long, also learn to use inject, so you don't have to declare arrays/hashes outside of .each
ghr has quit [Remote host closed the connection]
pdoherty has joined #ruby
<zack6849> ddv, if you have an alternate suggestion on how to parse the file by all means
<havenwood> zack6849: Like the class I'm looking at right now, see the #initialize method: https://github.com/puma/puma/blob/master/lib/puma/thread_pool.rb
thumpba has joined #ruby
<havenwood> zack6849: Even the instance variables that are `nil` are set.
scripore has quit [Quit: This computer has gone to sleep]
<zack6849> wait, wait, i think i'm an idiot. :|
thumpba_ has joined #ruby
<shevy> zack6849 no
<shevy> you just did not see the right thing
scripore has joined #ruby
balazs has quit [Ping timeout: 244 seconds]
segfalt has joined #ruby
plribeiro3000 has joined #ruby
<ddv> zack6849, you should write a parser class for the file
scripore has quit [Client Quit]
<zack6849> i think my problem lies in that i'm using rails caching, and declaring the local instance variables inside of the rails cache, so it loads every time the cache expires
<havenwood> zack6849: And do initialize your instance variables in the aptly named #initialize method.
<zack6849> but otherwise, the variables are nil
<zack6849> (i think)
ki0 has quit [Ping timeout: 276 seconds]
<zack6849> problem is i'm not sure how to work around this, unless i just cache the entire object, perhaps?
Zai00 has quit [Quit: Zai00]
wallerdev has joined #ruby
<ddv> zack6849, drop pry in there, investigage
fryguy9 has joined #ruby
<ddv> investigate*
<zack6849> yeah, i don't know what pry is :D
Brozo has joined #ruby
<dudedudeman> pry is similar to irb!
<havenwood> ?pry zack6849
<ruboto> zack6849, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
<zack6849> i'm pretty much brand new to ruby, this is my first project
noobQ has quit [Quit: WeeChat 0.4.2]
thumpba has quit [Ping timeout: 245 seconds]
<havenwood> zack6849: gem install pry pry-doc
bartkoo has quit [Quit: bartkoo]
<ddv> zack6849, remove the caching first maybe? and then figure out if it works as expected, then re-add the caching
evanjs has joined #ruby
sagittarian has joined #ruby
<zack6849> yep, it worked without the caching
jenrzzz has joined #ruby
<ddv> zack6849, do players.first, instead of players[1], as per the ruby s tyle guide
<ddv> oh sorry
<ddv> :)
<ddv> im a noob
<ddv> you want the second element
Igorshp has quit [Remote host closed the connection]
<havenwood> then #second according the Rails style guide :P
zorak8 has joined #ruby
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<zack6849> is that what the deal is with #forty_second?
Igorshp has joined #ruby
<ddv> zack6849, also is caching really crucial?
<zack6849> ddv, it's a rails application, and i have users accessing it quite often
SouL_|__ has quit [Ping timeout: 256 seconds]
ArchRogem has quit [Quit: Textual IRC Client: www.textualapp.com]
SouL_|_ has joined #ruby
tpimtts_away has joined #ruby
<zack6849> loading online users on a server, along with ranks and other things isn't optimal
<zack6849> infact i'd very much prefer to not have to do that
shock_one has quit [Remote host closed the connection]
<ddv> zack6849, you should background this maybe?
ghr has joined #ruby
dANO has quit []
scpike has joined #ruby
chthon has quit [Ping timeout: 244 seconds]
tcrypt has joined #ruby
<zack6849> backgrounding isn't the thing, this is a motd for a server, which means i'd have like 10 players accessing it at a time at at least every map change
lkba has quit [Read error: Connection reset by peer]
ghostmoth has joined #ruby
scripore has joined #ruby
SouL_|__ has joined #ruby
<zack6849> even if i backgrounded it it'd still be querying the server that many times
hornairs_ has joined #ruby
<zack6849> i've implemented this as caching with java and php in previous iterations
<jokke> hi
Limix has quit [Quit: Limix]
<havenwood> zack6849: `lines = File.readlines(users_file).map &:chomp` or `lines = File.read(users_file).split "\n"`
shevy has quit [Ping timeout: 252 seconds]
<ddv> zack6849, don't use not or or, but || and ! (or better unless)
stef204 has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<zack6849> i saw that using || and ! is bad style for ruby, according to somone on stack overflow i think
Igorshp has quit [Ping timeout: 244 seconds]
<havenwood> zack6849: If you use `File.open` use it with a block for automatic file closing when the block closes.
jespada has quit [Ping timeout: 250 seconds]
scpike has quit [Client Quit]
shock_one has joined #ruby
SouL_|_ has quit [Ping timeout: 250 seconds]
danzilio has joined #ruby
<jokke> is it correct, that doing array.map {|el| sth = el.foo; sth.bar} has no performance benfit to doing array.map(&:foo).map(&:bar)? As in: In both cases the array is iterated once. correct?
shock_one has quit [Remote host closed the connection]
<havenwood> I disagree with both of those.
<hoelzro> jokke: in terms of iterations, right; there might be overhead constructing a block and calling it, though
<apeiros> jokke: the latter iterates twice. and not the same array (just arrays of the same length)
<ddv> havenwood, explain then
<hoelzro> you should try both and measure
<jokke> apeiros: i don't think it does
ndrei has quit [Ping timeout: 245 seconds]
<apeiros> jokke: you think wrong
<jokke> does it really?
<jokke> ah too bad
<apeiros> yes
<hoelzro> er, nevermind; I missed the second .map
hornairs has quit [Ping timeout: 240 seconds]
<ddv> zack6849, keep on ignoring me
<apeiros> unless your `array` is not really an Array and has a .map which returns something which doesn't iterate on .map
<jokke> hm
<zack6849> ddv, i'm not
<zack6849> i'm just incredibly busy trying to do what you've suggested
<ddv> ok
<ddv> sorry
<zack6849> no problem
<apeiros> jokke: also not quite sure why you use a temp var in the first
<havenwood> ddv: We use precedence all over. It's not a cognitively hard thing for folk to grasp. Proper use of `and` and `or` is elegant. I'd prefer folk learn Ruby than shun precedence as too hard.
<apeiros> jokke: why not just el.foo.bar ?
<apeiros> havenwood: in an ideal world I'd say the same
<ddv> ^
<apeiros> havenwood: but my experience is that most devs are just not up to that level of competence.
Lloyd is now known as lloyd
<apeiros> same reason why I advise not to use @@cvars or flip-flops
<zack6849> is this proper? if !File.exist?(users_file) || !File.readable?(users_file)
SouL_|__ has quit [Ping timeout: 245 seconds]
<jokke> apeiros: yeah that'd be the way to go but the & notation is so neat..
<havenwood> With those the former is ugly for several reasons and the latter is too clever.
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zack6849> old code was this if not File.exist?(users_file) or not File.readable?(users_file)
<apeiros> jokke: somebody (hanmac maybe? or was it banister?) wrote a gem which allows chains with & syntax
<havenwood> apeiros: I'm fine with advising starting with only && and || but a complete ban seems overly harsh to me.
<apeiros> I think it works like ary.map(&X.foo.bar)
jaequery has joined #ruby
Spami has joined #ruby
nfk|laptop has joined #ruby
<ddv> zack6849, why not use say if the file exists and is readable then parse
<ddv> ?
<ddv> do you*
shevy has joined #ruby
<havenwood> ddv: As for unless/else I don't find it confusing. I avoid it in public code begrudgingly.
<jokke> apeiros: wow
<workmad3> apeiros: I can't remember it getting to gem form... but I remember hanmac writing a bit of ruby to allow chains on symbols in that style
lkba has joined #ruby
<momomomomo> I prefer ! than looking at `unless`
jenrzzz has joined #ruby
<apeiros> shouldn't be too hard to do if you want to do it yourself
<zack6849> no, i check if the file doesnt exist or isn't readable, if it isn't, i read a backup from a url
<momomomomo> that above is easy to parse: the file doesn’t exist, or if it’s not readable
Ellis has joined #ruby
<momomomomo> and in the end, what style is about is being able to quickly and easily convey intention, innit?
<Ellis> i’m running this method decrypt_alphabet and it is returning an array of nils but i’m expecting an array of letters … what am i doing wrong? https://gist.github.com/ellismarte/ff4e1efebf53736e8740
jespada has joined #ruby
<zack6849> i'm from java mainly, honestly ruby's syntax is quite strange to me
jheg has joined #ruby
<zack6849> mainly the idea that you don't put parenthesis after methods confuses me
edwinvdgraaf has quit [Ping timeout: 264 seconds]
sagittarian has quit [Ping timeout: 252 seconds]
<momomomomo> zack6849: you come to either like it, or become indifferent
<havenwood> zack6849: Don't use parens unless it breaks the interpreter to omit them. Seattle style.
ghr has quit [Remote host closed the connection]
JDiPierro has joined #ruby
allcentury has joined #ruby
gaboesquivel has joined #ruby
dfinninger has quit [Remote host closed the connection]
<ddv> zack6849, I would run rubocop on the file :)
duderonomy has joined #ruby
mrmargolis has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
michaeldeol has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> parens hide bugs, i've heard people say: https://gist.github.com/drbrain/5ea7c9389a55c81fd3c1
<havenwood> down with parens!
<havenwood> think of the chars we save...
SouL_|_ has joined #ruby
<apeiros> jokke: wow?
mrmargol_ has quit [Ping timeout: 248 seconds]
<Ellis> > <
<apeiros> jokke: and it's indeed not too difficult to do. I just implemented it :) <8min :D
_blizzy_ has joined #ruby
dblessing has quit [Quit: Textual IRC Client: www.textualapp.com]
Morkel has joined #ruby
lolmaus has joined #ruby
fryguy9 has quit [Quit: Leaving.]
segfalt has quit [Quit: segfalt]
blazes816 has joined #ruby
<simonewestphal> need help with the ruby-markers for sublime. The ouput don’t comes behind the #=> but in a new line. I use sublime 3. Thanks
<Senjai> simonewestphal: I think you want to find a sublime channel :P
<momomomomo> simonewestphal: ##sublimetext or their support line
<zack6849> agreed with the comment there
<Ellis> how come i’m getting nil after i use map?? https://gist.github.com/ellismarte/ff4e1efebf53736e8740
<momomomomo> Ellis: !ask
zz_barkerd427 is now known as barkerd427
<momomomomo> Ellis: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
<zack6849> plus i cant tell what the hell "some_weird_thing" is when it's just sitting there alone, it looks like it should be a variable, not a method
<havenwood> Ellis: #puts returns: nil
<Ellis> havenwood: but when i hit return @encrypted_message it returns nils
<yxhuvud> havenwood: lol. (though I admit I am in the tenderlovian camp that doesn't prefer parens around method def argument lists)
<havenwood> Ellis: because you're mapping to the return value of #puts
<momomomomo> map does not change the original value
<momomomomo> oh, your’e using map!
<momomomomo> derp
<momomomomo> and yes, havenwood is correct
<havenwood> yxhuvud: fear and trepidation lay on the path to dragons when using parens! ahem, i mean i have a slight aesthetic preference for omitting them.
blizzy has quit [Ping timeout: 255 seconds]
dstarh has joined #ruby
pika_pika has joined #ruby
naftilos76 has quit [Remote host closed the connection]
<havenwood> Ellis: drop the `return`s, and you can drop line 17 entirely
tcrypt has quit [Ping timeout: 264 seconds]
Zackio has quit [Remote host closed the connection]
<havenwood> Ellis: if you're on a modern Ruby use `chars` instead of `split("")`
<Senjai> apeiros: You scare me sometimes
<Ellis> havewood: thank you … still doesn’t make sence to me but it worked ...
xerox has joined #ruby
<Ellis> chars does split?
<apeiros> Senjai: only sometimes? I guess I've to work more on that…
<momomomomo> >> “onetwothree”.chars
<ruboto> momomomomo # => undefined local variable or method `“onetwothree”' for main:Object (NameError) ...check link for more (https://eval.in/317285)
<apeiros> momomomomo: smart quotes…
<Senjai> apeiros: Sorry to let ya down mang
<momomomomo> UGH colloquy y u do this to me
graydot has quit [Quit: graydot]
<apeiros> >> "foobar".chars
<ruboto> apeiros # => ["f", "o", "o", "b", "a", "r"] (https://eval.in/317286)
<apeiros> Senjai: but what scared you this time?
sagittarian has joined #ruby
<Senjai> apeiros: My nightmares are my own >.> <.<
<havenwood> >> %w[! @ # $ % ^ & *]
<ruboto> havenwood # => ["!", "@", "#", "$", "%", "^", "&", "*"] (https://eval.in/317287)
<havenwood> Ellis: ^ consider using this shorthand
jgoyon has quit [Remote host closed the connection]
<havenwood> >> [33, *35..38, 42, 64, 94].map &:chr
<ruboto> havenwood # => ["!", "#", "$", "%", "&", "*", "@", "^"] (https://eval.in/317288)
<momomomomo> >> "test".chars
<ruboto> momomomomo # => ["t", "e", "s", "t"] (https://eval.in/317289)
<Ellis> how do i check if something is a letter?
hollywood has joined #ruby
Zackio has joined #ruby
<apeiros> Ellis: by which definition of "letter"?
<Ellis> a b c de f g etc
fryguy9 has joined #ruby
<apeiros> Ellis: is "ä" a letter?
<apeiros> Ellis: how about π?
<Ellis> no
<toretore> %w[a b c de t g etc].include?(something)
<Ellis> lol
<havenwood> Ellis: it is too
<apeiros> Ellis: in my language, the former is
<Ellis> well not under my circumstances
<apeiros> in greek, the latter
<apeiros> you see, definition matters…
<Ellis> is there a way to check for english alphabet
<apeiros> Ellis: so only a-zA-Z?
<Ellis> yeah
<apeiros> well, letter =~ /\A[a-z]\z/i
workmad3 has quit [Ping timeout: 276 seconds]
<Ellis> thank you apeiros
<momomomomo> >> "a".ord > 64 && "a".ord < 173
<ruboto> momomomomo # => true (https://eval.in/317290)
<apeiros> momomomomo: only covers lowercase
<momomomomo> nop
Rickmasta has joined #ruby
<apeiros> ah wait… also covers special chars
<havenwood> chars that aren't letters, yeah
<momomomomo> ah derp yep
<apeiros> also "a".ord.between?(64, 173) ;-)
SouL_|_ has quit [Ping timeout: 255 seconds]
<momomomomo> "a".ord.between?(65, 132) || "a".ord.between?(97, 172)
<momomomomo> >> "a".ord.between?(65, 132) || "a".ord.between?(97, 172)
<ruboto> momomomomo # => true (https://eval.in/317291)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood> Ellis: The equivalent that would allow "ä" and "π" is: letter =~ /\A[[:alpha:]]\z/
<momomomomo> guess that also answers my question of inclusivity from one end
<Ellis> havewood: thank you
akkad has quit [Excess Flood]
n008f4g_ has joined #ruby
<momomomomo> >> "z".ord.between?(65, 132) || "z".ord.between?(97, 172)
<ruboto> momomomomo # => true (https://eval.in/317292)
<momomomomo> cool, upper inclusive as well
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
<apeiros> somehow that looks wrong
<havenwood> >> ?z.between? ?a, ?z
<ruboto> havenwood # => true (https://eval.in/317293)
<momomomomo> lol the 65, shouldn't go to 132
<apeiros> shouldn't that be 65..90 and and 97..122?
<momomomomo> >> "z".ord.between?(65, 90) || "z".ord.between?(97, 172)
<ruboto> momomomomo # => true (https://eval.in/317294)
davedev24_ has joined #ruby
<apeiros> I mean there's not 75 chars between "a" and "z" :D (172-97)
<momomomomo> and 172 is wack too
<momomomomo> I keep misreading the oct column
naftilos76 has joined #ruby
<apeiros> heh
* momomomomo is lazily referencing an ascii chart
<momomomomo> >> "z".ord.between?(65, 90) || "z".ord.between?(97, 122)
<ruboto> momomomomo # => true (https://eval.in/317295)
<havenwood> momomomomo: that'd read nicer if you used Strings instead of Fixnums
<momomomomo> in the between?
akkad has joined #ruby
<havenwood> momomomomo: ya
rdark has quit [Quit: leaving]
<momomomomo> eh, but what's the point of evaluating that .ord for those
evanjs has quit [Remote host closed the connection]
atmosx_osx is now known as atmosx
chinmay_dd has joined #ruby
<apeiros> you can without .ord
<havenwood> >> letter = ?x; letter.between?(?a, ?z) || letter.between?(?A, ?Z)
<ruboto> havenwood # => true (https://eval.in/317296)
dseitz has joined #ruby
<havenwood> >> letter = 'x'; letter.between?(?a, ?z) || letter.between?(?A, ?Z)
<ruboto> havenwood # => true (https://eval.in/317297)
<havenwood> >> letter = '?'; letter.between?(?a, ?z) || letter.between?(?A, ?Z)
<ruboto> havenwood # => false (https://eval.in/317298)
<momomomomo> ah very good
<apeiros> shpammer!
<momomomomo> it's that damned ruboto
<momomomomo> never did much but spam
towski_ has joined #ruby
<apeiros> yeah, who's that guy anyway? behaves like a bot too!
ki0 has joined #ruby
<havenwood> I had to argue with folk here that I'm not a bot. It's not always easy to pass the turning test.
andrew-l` is now known as andrew-l
quimrstorres has quit [Remote host closed the connection]
<apeiros> yeah, one wrong turn…
<apeiros> (turing ;-)
<havenwood> Plot twist. We're all bots here.
<apeiros> plot twist: ruboto isn't
davedev2_ has joined #ruby
quimrstorres has joined #ruby
<momomomomo> >> [73, 32, 97, 109, 32, 97, 32, 115, 112, 97, 109, 109, 101, 114].map(&:chr).reduce(&:+)
<ruboto> momomomomo # => "I am a spammer" (https://eval.in/317299)
<momomomomo> proof
<apeiros> anyway, turing test isn't hard because bots become better at seeming to be human, it is hard because humans become worse…
<Senjai> Fucking humans
<momomomomo> apeiros: u wot m8 plz
<apeiros> !debug ruboto Channel("#ruboto_test").send("test")
<apeiros> whoops
<momomomomo> loool
davedev24_ has quit [Ping timeout: 244 seconds]
<apeiros> killed the whole punch line :D
kharma1 has quit [Quit: leaving]
bluOxigen has joined #ruby
metalic has quit [Ping timeout: 272 seconds]
hmnhf_ has joined #ruby
lidenskap has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
<ruboto> momomomomo, stop messing around with me.
<momomomomo> who uses a comma and not a colon rubuto?
<ruboto> momomomomo, sane people?
<havenwood> momomomomo: casuals
<momomomomo> ^
<ruboto> momomomomo, or to stay in the plotline: *people* ;-p
<ruboto> momomomomo, I have heard bots fancy colons, though.
quimrstorres has quit [Ping timeout: 265 seconds]
dfinninger has joined #ruby
<momomomomo> ha
nszceta has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
graydot has joined #ruby
_honning_ has quit [Ping timeout: 246 seconds]
lolmaus has quit [Quit: Konversation terminated!]
zlude has joined #ruby
spyderm__ has quit [Remote host closed the connection]
f3lp has joined #ruby
<momomomomo> lunch time, and I need a good bowl of ramen. adios ya'll
baroquebobcat has joined #ruby
spyderman4g63 has joined #ruby
<momomomomo> p.s. United Noodle has the best ramen around in Mpls
<ruboto> momomomomo, as if you'd eat… we've seen through your disguise!
<apeiros> momomomomo: bon apps!
segfalt has joined #ruby
momomomomo has quit [Quit: momomomomo]
Ellis has quit [Quit: Ellis]
serivich has quit [Ping timeout: 244 seconds]
Lissie has joined #ruby
tearan has quit [Quit: Textual IRC Client: www.textualapp.com]
djellemah_ has quit [Ping timeout: 265 seconds]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fryguy9 has quit [Quit: Leaving.]
pdoherty has quit [Ping timeout: 244 seconds]
swills_ is now known as swills
momomomomo has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
<momomomomo> spoke too soon
niKeITA has quit [Quit: ZZZzzz…]
nfk|laptop has quit [Ping timeout: 264 seconds]
<jhass> that's what a bot would say
BackEndCoder_ is now known as BackEndCoder
roshanavand has quit [Read error: Connection reset by peer]
josephleon has quit [Quit: Leaving...]
Rollabun_ has joined #ruby
nfk|laptop has joined #ruby
juanpaucar has joined #ruby
Rollabunna has quit [Ping timeout: 245 seconds]
evanjs has joined #ruby
startupality has joined #ruby
vim_shimm has joined #ruby
hornairs_ has quit [Quit: hornairs_]
juanpaucar has quit [Ping timeout: 252 seconds]
kaspernj has quit [Remote host closed the connection]
droidburgundy has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
droidburgundy has joined #ruby
<havenwood> beep bop boop
<momomomomo> :O
cranq has quit [Ping timeout: 250 seconds]
<havenwood> DeBot: !hangman gems
<DeBot> ␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣ [] 0/12
<havenwood> DeBot: -
<DeBot> ␣␣␣-␣␣␣␣␣␣␣-␣␣␣␣␣␣ [] 0/12
Technodrome has quit [Quit: Technodrome]
cranq has joined #ruby
<riceandbeans> what's wrong with this line?
<riceandbeans> File.open(lock_file, File::CREAT|File::EXCL) {
<riceandbeans> I put a puts on the next line, but there isn't any output
<havenwood> riceandbeans: try just: p
<riceandbeans> I also have a rescue with a puts but it's not printing that either
<riceandbeans> what's the difference?
cool_coder_forfo has quit [Ping timeout: 256 seconds]
<riceandbeans> havenwood: for reference, this is also 1.8
<havenwood> >> p nil
<ruboto> havenwood # => nil ...check link for more (https://eval.in/317303)
<riceandbeans> >> puts nil
<ruboto> riceandbeans # => ...check link for more (https://eval.in/317304)
<havenwood> >> puts nil.inspect
<ruboto> havenwood # => nil ...check link for more (https://eval.in/317305)
<riceandbeans> >> puts "I am awesome"
hazelux has quit [Remote host closed the connection]
<ruboto> riceandbeans # => I am awesome ...check link for more (https://eval.in/317306)
DEA7TH has joined #ruby
<havenwood> riceandbeans: puts will do things like print each element of an Array on its own line and an empty line for `nil` etc, while p is used for debugging and will #inspect things so you can tell what they are.
lolmaus has joined #ruby
<riceandbeans> using just p didn't fix it
<riceandbeans> I just want visual proof that I'm in a block
<havenwood> riceandbeans: What's in the block?
<riceandbeans> a bunch of stuff
vim_shimm has quit [Ping timeout: 240 seconds]
<riceandbeans> but I'm clearly not even entering the block
<havenwood> riceandbeans: Put a `binding.pry` in there?
<riceandbeans> the first line is a puts
<riceandbeans> what's a binding.pry?
<havenwood> ?pry riceandbeans
<ruboto> riceandbeans, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
jenrzzz has joined #ruby
rshetty has joined #ruby
deuterium has quit [Quit: zzZZZzzz..]
sizeoftank has joined #ruby
<havenwood> riceandbeans: You put `require 'pry'` at the top and `binding.pry` wherever you want to jump out to the REPL so you can explore in Pry.
<riceandbeans> so I'd have to install new software?
hazelux has joined #ruby
<havenwood> riceandbeans: gem install pry
chacmool has joined #ruby
<riceandbeans> can't use gem here
<riceandbeans> not allowed
<havenwood> riceandbeans: it's for exploring in development
<riceandbeans> if I want any gem it has to be individually approved, converted to rpm, and installed by rpm after the rpm is also approved
<havenwood> riceandbeans: you don't have to add the gem to the project to use it in development
sizeoftank has quit [Quit: leaving]
<havenwood> riceandbeans: or you're not allowed to use gem in dev either?
<riceandbeans> unfortunately, I have to test this script on production systems due to ACLs
jottr has joined #ruby
<rshetty> Hey guys
<riceandbeans> havenwood: not allowed to use non rpm packages here at all
josephleon has joined #ruby
OnBrokenWings has quit [Quit: Leaving]
<havenwood> riceandbeans: is there a rubygem-pry package?
<havenwood> rshetty: hi
<riceandbeans> there is, I don't know if they'll let me install it in production
shoutsid has joined #ruby
<havenwood> riceandbeans: pry is handy
<riceandbeans> I'll ask in a sec
<riceandbeans> so pry is like a 1:1 with IRB?
<rshetty> I am having trouble accessing 'config_file' inside the 'configuration_keys' method, I am missing something , Could somebody help point it ?
<rshetty> Here is the code: http://pastebin.com/BT1RYYiL
<ruboto> rshetty, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/8f22f37984a483e5625f
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<sohrab> do you guys use sets a lot? i think 90% of the cases that i've used arrays can use sets instead
<weaksauce> sohrab hardly ever
f3lp has quit [Ping timeout: 264 seconds]
<wallerdev> i usually use them for programming puzzles
<sohrab> weaksauce: why? i just learned about them last week and am trying to figure out how to use them. seems like a good way to keep a collection if they're all unique.
charliesome has joined #ruby
<wallerdev> yeah if its all unique and you dont care about order
iasoon has quit [Ping timeout: 256 seconds]
<wallerdev> and you need to be able to check if something is in the list quickly
<havenwood> sohrab: Used SortedSet yet?
<sohrab> wallerdev: yeah i'm doing a coding challenge
blahwoop has joined #ruby
<sohrab> havenwood: na, gonna look it up
<Brozo> so that's what gists are used for
<sohrab> havenwood: interesting
<blahwoop> hi all, i'm trying to use httparty. are there any open apis that don't require client id or key?
<blahwoop> i just want to mess around with it
Cache_Money has joined #ruby
<sohrab> what other data structures am i missing out on in ruby? i know arrays, hashes, sets, now sortedset. anything else?
RegulationD has joined #ruby
<sohrab> i know there are gems for trees and graphs
fryguy9 has joined #ruby
vim_shimm has joined #ruby
zorak8 has quit [Ping timeout: 265 seconds]
<wallerdev> linked lists i guess
zorak8 has joined #ruby
<wallerdev> stacks and queues
<havenwood> sohrab: How about Struct, Enumerator and Enumerator::Lazy
<havenwood> sohrab: Rinda::TupleSpace
colorisco has joined #ruby
djbkd has joined #ruby
<sohrab> havenwood: k, i need to learn those. ty
<havenwood> sohrab: OpenStruct
<havenwood> sohrab: You didn't mention Range, but I'm assuming you've run into it.
hmnhf_ has quit [Ping timeout: 264 seconds]
<sohrab> what % of cases do ppl not use array or hash? 5%? 10%? >25%?
<sohrab> havenwood: yes, i'm familiar with range, thank you. it seems simple... basically an array of sequential numbers?
<havenwood> sohrab: More a minimum value that responds to next until it gets to the end of a range.
RegulationD has quit [Ping timeout: 256 seconds]
<sohrab> havenwood: ah i see. interesting. whoa. so not necessarily with numbers?
stef204 has joined #ruby
SouL_|_ has joined #ruby
<havenwood> >> ('cat'..'dog').take 8
<ruboto> havenwood # => ["cat", "cau", "cav", "caw", "cax", "cay", "caz", "cba"] (https://eval.in/317308)
<wallerdev> i use almost exclusively arrays and hashes
<wallerdev> like 90%+
<wallerdev> haha
<riceandbeans> what's the difference between a set and an array?
<sohrab> havenwood: whoa
jenrzzz has quit [Ping timeout: 244 seconds]
juanpaucar has joined #ruby
<GaryOak_> riceandbeans: a set can only contain unique values
<wallerdev> an array is ordered and can contain duplicates and is a simpler data struccture in general
<sohrab> riceandbeans: the values must be unique, and they're not ordered
vim_shimm has quit [Ping timeout: 264 seconds]
<sohrab> when i use a set i feel like i'm imposing because i need to require it XD
<GaryOak_> It's nice for handling duplicates
<sohrab> wallerdev: it's the simpler? i thought set was the most simple
<wallerdev> the implementation of a set is more complicated than an array
<wallerdev> like the internal implementation
<sohrab> ah i see
<sohrab> how about hash? is that also more complicated than arrays?
<wallerdev> yeah a set is basically a hash with no values for the keys
<havenwood> sohrab: You'll only very rarely see an OpenStruct or Rinda::Tuplespace. A Struct, Set and SortedSet are more common but not ubiquitous like Array and Hash.
SouL_|_ has quit [Ping timeout: 264 seconds]
<GaryOak_> OpenStruct is almost like a JS object
<sohrab> cool. i'm learning a ton. thanks alls
scripore has quit [Quit: This computer has gone to sleep]
DerisiveLogic has quit [Read error: Connection reset by peer]
DerisiveLogic has joined #ruby
startupality has quit [Quit: startupality]
nszceta has joined #ruby
mrmargolis has quit [Ping timeout: 248 seconds]
SouL_|_ has joined #ruby
evanjs has quit [Remote host closed the connection]
tsipanov has joined #ruby
momomomomo has quit [Quit: momomomomo]
scripore has joined #ruby
<dudedudeman> i was just reading about struct, enumerators and Enumerator::lazy at lunch today. this is well timed. lol
startupality has joined #ruby
<Brozo> lol
metalic has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sohrab> dudedudeman: where? for a class?
SouL_|_ has quit [Ping timeout: 246 seconds]
SouL_|_ has joined #ruby
<dudedudeman> nope! i'm self teaching, learning from anything and everything. I have a mentor here at work that is guiding me through things, i peep this chat often to see what people are learning about, I am reading the pick axe book(and other sources) in any spare time, I am attending weekly hacknights in my area, and I'm working on a couple projects to help myself learn
<dudedudeman> i would LOVE to be in a class for this, but, my time at college has come and gone
Technodrome has joined #ruby
scripore has quit [Client Quit]
Rickmasta has joined #ruby
avgerinos has joined #ruby
shoutsid has quit [Remote host closed the connection]
<Brozo> I'm on the opposite end of the spectrum
nszceta_ has joined #ruby
_honning_ has joined #ruby
<dudedudeman> i bring the pick axe book with me to work, and read it over lunch
evanjs has joined #ruby
<dudedudeman> how so, Brozo?
<Brozo> I'm self-teaching and taking a year off from college while doing the same stuff
jobewan has quit [Ping timeout: 255 seconds]
pwattste has quit [Quit: Textual IRC Client: www.textualapp.com]
nszceta has quit [Ping timeout: 255 seconds]
<dudedudeman> nice. any particular reason for that?
balazs__ has joined #ruby
SouL_|__ has joined #ruby
spyderman4g63 has quit [Read error: Connection reset by peer]
Soda has quit [Ping timeout: 252 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chinmay_dd has quit [Quit: See ya!]
spyderman4g63 has joined #ruby
Soda has joined #ruby
chinmay_dd has joined #ruby
<sohrab> i'm self-teaching too
chrisja has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
SouL_|_ has quit [Ping timeout: 264 seconds]
granthatcher has joined #ruby
JDiPierr_ has joined #ruby
mjuszczak has joined #ruby
hornairs has joined #ruby
hornairs has quit [Client Quit]
<Brozo> well I'm starting a techstartup and so i figure this is the best time wher I don't really have any commitments
<dudedudeman> ah, that'll do it. that's cool!
odin22 has joined #ruby
JDiPierro has quit [Read error: Connection reset by peer]
jzigmund_ has joined #ruby
lsmola__ has joined #ruby
<weaksauce> sohrab mainly because sets don't mesh with the needs of web programming all that often and that's what I use ruby mainly for.
Rickmasta has quit [Quit: Textual IRC Client: www.textualapp.com]
<sohrab> weaksauce: ah, that makes sense.
mjuszczak has quit [Client Quit]
<pipework> dudedudeman: You know there isn't an age limit to college, right?
hollywood has quit [Quit: Leaving]
balazs__ has quit [Ping timeout: 245 seconds]
<weaksauce> heap is one that is very useful for algorithms in a lot of cases based on my extensive use of them back in a college algorithms class.
mrmargolis has joined #ruby
<pipework> I mean, they might push back a bit on post-humous students.
<dudedudeman> pipework: totally! but i did college for 5.5 years, have a lot of debt, and never finished my degree.
SouL_|__ has quit [Ping timeout: 244 seconds]
<dudedudeman> i actually would like to go back, but not for what i studied(music)
<pipework> dudedudeman: Fuck degrees! Get paid, pay off debt, go to school to learn.
<sohrab> dudedudeman: what kind of music?
mjuszczak has joined #ruby
<pipework> I'd only go for a degree if I ended up with a phd.
oo_ has quit [Remote host closed the connection]
<pipework> And only then so I could have people call me 'doctor'.
Rickmasta has joined #ruby
jzigmund has quit [Ping timeout: 272 seconds]
<sohrab> my opinion is that college is a waste for most professions nowadays. free time + internet = decent at most things.
Rickmasta has quit [Max SendQ exceeded]
lsmola_ has quit [Ping timeout: 264 seconds]
doppler has quit [Ping timeout: 246 seconds]
<dudedudeman> pipework: that's what i'm saying! lol. i'm learning to get my first dev job, and then pay off debt, and may look at school later on if i feel like i may need a masters or something
platosha has quit [Quit: This computer has gone to sleep]
<pipework> dudedudeman: Psh, I'd say you won't ever need a degree to work in the kinds of places worth working for.
platosha has joined #ruby
Rickmasta has joined #ruby
jottr has joined #ruby
<pipework> Just be awesome at what you do, if you can get there, you can win at life.
<weaksauce> sohrab a CS degree from a good school will teach you more than you would likely learn on your own. good breadth.
Rickmasta has quit [Max SendQ exceeded]
<dudedudeman> sohrab: any and all kinds. i'm weird, i love death metal, EDM, celine dion, lionel ritchie, pop, jazz, blues, whatever
<pipework> I believe a CS course is great.
<dudedudeman> to the argument of schools, i will say that a good teach goes a LONG way.
Rickmasta has joined #ruby
<dudedudeman> someone to challenege you and put you on some deadlines because in reality, you'll have challenges and deadlines in the real world
<pipework> I use the lack of a degree to filter out companies I wouldn't work for anyways.
granthatcher has quit []
tsipanov has quit []
<pipework> I don't care to work with degree-holding people, I want to work with awesome people who are smart and good at what they do. A degree simply doesn't provide any degree of confidence in that.
<pipework> But do what makes you happiest.
rikai has joined #ruby
lsmola__ has quit [Ping timeout: 246 seconds]
jzigmund_ has quit [Ping timeout: 250 seconds]
jobewan has joined #ruby
<sohrab> weaksauce: yeah i guess the ideal would be a passionate person who takes a good CS curriculum, but i think dispassionate people in a CS program might not turn out so great and a passionate autodidact might turn out alright too
metalic has quit [Quit: Leaving]
claw has quit [Ping timeout: 240 seconds]
Dreamer3 has joined #ruby
MasterPiece has joined #ruby
jzigmund has joined #ruby
claw has joined #ruby
tenseiten is now known as seitensei
cpt_yossarian has joined #ruby
<weaksauce> sohrab I think the trickier subjects would not be as good to self teach. I personally wouldn't have gone through a self taught DSP curriculum or a probability and stats curriculum if I self taught.
<Brozo> I've been going around to meetups and there are a lot of people willing to help and provide guidance.
<dudedudeman> see, that's exactly how i feel. stats? me and a book? mroe like me and a knife through my eyeball
<weaksauce> but yeah if you don't give a shit either way... you are not going to be very good regardless of the school
<Brozo> Not that it's a replacement for a cs program but i wouldn't know
<dudedudeman> Brozo: meetups are great! i consider myself lucky that there's a really good one in my area
<sohrab> weaksauce: how does knowing that stuff help you?
<Brozo> and building the network is really cool because i met a node.js guy who put me in touch with an ios dev
<sohrab> curious, bc i want to learn all the fundamentals
Lissie has quit []
iamninja_ has joined #ruby
SouL_|_ has joined #ruby
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
rdark has joined #ruby
<weaksauce> sohrab it gives you a good base to know where to study if you need and to know where to look for solutions to problems that you didn't know that you had.
SouL_|_ has quit [Read error: Connection reset by peer]
elaptics is now known as elaptics_away
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<weaksauce> kind of removes you from the "I didn't know I didn't know" section of the ignorance scale.
blazes816 is now known as tcrypt
<sohrab> weaksauce: yeah that's a problem i face :|
gfawcettpq has quit [Ping timeout: 255 seconds]
lidenskap has quit [Remote host closed the connection]
colorisco has quit [Ping timeout: 276 seconds]
pdoherty has joined #ruby
willharrison has joined #ruby
<weaksauce> sorry it's not the scale of ignorance, it's the stages of competence
rdark has quit [Client Quit]
kirun has joined #ruby
Ellis has joined #ruby
<Ellis> is there something wrong with this syntax? @counter == 5 ? return "BINGO" : index += 1
lidenskap has joined #ruby
<sohrab> yeah i'd like a survey of all the important tools and concepts. is there like a standard CS 101 textbook? i've been looking for one for a while
<audy> Ellis a little weird that there is a return in there
<Ellis> audy: can’t we do that?
<audy> Ellis you can do anything with Ruby!
<Ellis> but i’m getting a syntax error
mrmargolis has quit [Read error: Connection reset by peer]
SouL_|_ has joined #ruby
<riceandbeans> File.open(lock_file, File::CREAT|File::EXCL) { |file|
<audy> >> @counter == 5 ? return "foo" : "bar"
<ruboto> audy # => /tmp/execpad-8b3703e92831/source-8b3703e92831:2: syntax error, unexpected tSTRING_BEG, expecting ':' ...check link for more (https://eval.in/317310)
<audy> >> @counter == 5 ? "foo" : "bar"
<ruboto> audy # => "bar" (https://eval.in/317311)
<riceandbeans> I try to do file.write and it says file not opened for writing
mrmargolis has joined #ruby
<audy> Ellis guess not
<weaksauce> >> @counter == 1 ? (return "test") : "ted"
<ruboto> weaksauce # => "ted" (https://eval.in/317312)
<weaksauce> >> @counter == nil ? (return "test") : "ted"
<ruboto> weaksauce # => unexpected return (LocalJumpError) ...check link for more (https://eval.in/317313)
noeden has joined #ruby
DEA7TH has quit [Ping timeout: 255 seconds]
<weaksauce> but that is really awkward to do
lsmola__ has joined #ruby
<Ellis> :\
lidenskap has quit [Ping timeout: 250 seconds]
<dudedudeman> weaksauce: there's a really good your mom joke there....
noeden has quit [Client Quit]
eckod has joined #ruby
workmad3 has joined #ruby
braincras has quit [Ping timeout: 276 seconds]
<weaksauce> riceandbeans |File::RDWR perhaps?
philip1 has joined #ruby
rrichardsr3 has joined #ruby
<weaksauce> Ellis what problem are you solving with such a construct?
<eckod> hey guys, im getting an odd segfault and i cant determine its cause. Here's the error its yelling at me: http://pastebin.com/j6BtFfFx
<ruboto> eckod, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/3a11f580a8fc82526900
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<riceandbeans> weaksauce: I'm trying to use this as a lockfile and yesterday eam told me that that was wrong
lidenskap has joined #ruby
mjuszcza_ has joined #ruby
<Ellis> weaksauce: i’m creating a method to check if a bingo player got a bingo
<Ellis> so if the counter == 5 return BINGO, else add one to the index
<weaksauce> why not `return "BINGO" if @counter == 5` to make your intentions clear
TinkerTyper has quit [Quit: ZNC restarting...]
<Ellis> weaksuace: i thought about that but then i wondered can i comebine an else to that statement?
SouL_|_ has quit [Ping timeout: 244 seconds]
<weaksauce> you would put that at the top of your checks.
<weaksauce> there is no other statement
mjuszczak has quit [Ping timeout: 244 seconds]
<weaksauce> gist your code and someone can suggest a better way to write that statement
<weaksauce> riceandbeans I see. I am not privy to that conversation so I don't know. perhaps you could gist the code as well?
workmad3 has quit [Ping timeout: 250 seconds]
braincrash has joined #ruby
colorisco has joined #ruby
vim_shimm has joined #ruby
freerobby has joined #ruby
JDiPierr_ has quit [Read error: Connection reset by peer]
ndrei has joined #ruby
<sohrab> weaksauce: was there a CS 101 book that stuck out in your mind? i've found ones for other subjects, but idk if there's a famous textbook that provides an overview of everything. sicp is recommended, but i'm looking for a standard boring textbook
<weaksauce> eckod /home/rails/.rvm/gems/ruby-2.1.5/gems/json-1.8.2/lib/json/common.rb:67:
<weaksauce> and the next line > ruby 1.9.3p484
<weaksauce> you are using ruby gems compiled for a different version of ruby
JDiPierro has joined #ruby
hazelux has quit []
<dudedudeman> sohrab: harvard's edX program has a really cool, free, online course where they go over a CS 101 type of curriculum and all that. videos, examples, 'tests', and i think if you want, you can pay for a certificate of completion once you finish it. it's also at your own pace, so you can blow through it if you want, or take your time
lkba_ has joined #ruby
<eckod> weaksauce: so, i used the ansible rvm playbook to deploy a local rvm version. ive never had it not work before...
<weaksauce> sohrab CS is pretty vast a subject. I am not aware of a book that covers it all really
<sohrab> dudedudeman: i startd that course, but i didn't like it. didn't like the style. i just want basically a reference book that explains all the concepts simply
<weaksauce> eckod not sure.
A205B064 has joined #ruby
<Ellis> thank you ^^
claw has quit [Ping timeout: 256 seconds]
claw has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
wallerdev has quit [Quit: wallerdev]
<dudedudeman> sohrab: ah, word. I kind of did the same thing. went at it for a month, then stopped. lol.
lkba has quit [Ping timeout: 264 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
<dudedudeman> sohrab: i know this book exists and i've considered getting it myself http://shop.oreilly.com/product/0636920028192.do\
<dudedudeman> ugh, sorry
baroquebobcat has joined #ruby
<dudedudeman> added a slash in there by accident
baroquebobcat has quit [Client Quit]
kblake has joined #ruby
zorak8 has quit [Quit: Leaving]
<dudedudeman> o'reilly has a buy two get one free thing going on now as well. lol
<sohrab> dudedudeman: huh. i've seen a lot of books like this but i don't want something specifically for ruby. can't believe there isn't a canonical 101 textbook :(
<dudedudeman> oh i'm sure there is
sevvie has joined #ruby
shoutsid has joined #ruby
mjuszcza_ has quit [Ping timeout: 250 seconds]
lavros has quit [Quit: leaving]
danzilio has quit [Quit: My computer has fallen asleep!]
iasoon has joined #ruby
<dudedudeman> i certainly don't know one, though. :(
lidenskap has quit [Remote host closed the connection]
atmosx has quit [Quit: parting / quiting]
mjuszczak has joined #ruby
<Brozo> I remember stanford has a good online programming methodology course
<sohrab> just searched amazon myself too
<Brozo> they're kind of old now and they use java, but i liked them
<sohrab> think i'm gonna order it
plribeiro3000 has quit [Quit: Leaving.]
icarus has joined #ruby
<dudedudeman> $20 used isn't too bad
jheg has quit [Quit: jheg]
<sohrab> yeah :) i mean i'll have it sitting around for 5 years probably
<djbkd> This is a really solid book, very dense though (I had to review some long-forgotten math to get through it) http://www.amazon.com/Data-Structures-Algorithm-Analysis-Edition/dp/0201498405
<djbkd> figuratively solid, AND literally :D
<sohrab> djbkd: thanks :)
<djbkd> there's supposedly an answer companion (teacher's edition) but I haven't acquired a copy. Would be really good if you're doing the autodidactic thing
<sohrab> cool
gauke has joined #ruby
xploshioon has joined #ruby
<sohrab> i gotta head out. talk to y'all later
<dudedudeman> good luck with the things!
<Brozo> bye
<sohrab> lol i always need luck with things :)
<sohrab> *the things
chrishough has joined #ruby
TinkerTyper has joined #ruby
ScorpusKahn has quit [Quit: Konversation terminated!]
vim_shimm has quit [Ping timeout: 256 seconds]
lidenskap has joined #ruby
sohrab has quit [Ping timeout: 255 seconds]
SouL_|_ has joined #ruby
TinkerTyper has quit [Client Quit]
cjim_ has quit [Quit: (null)]
TinkerTyper has joined #ruby
Morkel has quit [Quit: Morkel]
Cloudhand has quit [Ping timeout: 240 seconds]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cjim_ has joined #ruby
yfeldblu_ has joined #ruby
yqt has joined #ruby
cjim_ has quit [Client Quit]
SouL_|_ has quit [Ping timeout: 250 seconds]
turtil has joined #ruby
ta has joined #ruby
_honning_ has quit [Ping timeout: 276 seconds]
gauke_ has joined #ruby
ley has joined #ruby
ta has quit [Remote host closed the connection]
ta has joined #ruby
simonewestphal has quit [Quit: simonewestphal]
<abyss> I'd like to write simple rest api app with webrick or other embedded server. Anyone knows any tutorial or book how to do it?
|\|370 has joined #ruby
rshetty has quit [Remote host closed the connection]
msmith has joined #ruby
<ley> any body in here wish he could knew ruby earlier before all these DSL happened and now i c
Cloudhand has joined #ruby
<dudedudeman> I have some forms that take user input, and I'd like to force the form to only accept certain combinations of input data(digits, letters, . ) is a regex the best way to do this?
eckod has quit [Ping timeout: 246 seconds]
<ley> ve to READ DOCS
rshetty has joined #ruby
gauke has quit [Ping timeout: 264 seconds]
gauke_ is now known as gauke
willharrison has quit [Quit: Textual IRC Client: www.textualapp.com]
RegulationD has joined #ruby
<weaksauce> it's a way dudedudeman
<weaksauce> it depends on how tricky the validation needs to be
<dudedudeman> weaksauce: show me the best way. lol.
<audy> abyss probably pretty easy w/ sinatra
<dudedudeman> umm, one field needs to be something like, digitdigit.digitdigit. so 80.13
relix has joined #ruby
<weaksauce> regex for that one yeah
<dudedudeman> and another way would be .digitdigitdigit
<dudedudeman> so .3258
msmith_ has quit [Ping timeout: 256 seconds]
<dudedudeman> and yet another with either yes or no
mostlybadfly has quit [Quit: Connection closed for inactivity]
yfeldblu_ has quit [Ping timeout: 256 seconds]
<abyss> audy: thank you. I wanted to avoid any frameworks to light app as possible. But if there no other simple aproach to do it fast and easy then I check this.
<weaksauce> as long as they are simple like that it would be easy
SouL_|_ has joined #ruby
<weaksauce> dudedudeman^
yfeldblum has joined #ruby
nfk|laptop has quit [Quit: yawn]
mjuszczak has quit []
rikai has quit [Ping timeout: 250 seconds]
<dudedudeman> that's as complex as they get. 80.84, .3134, .3280, 3, yes, (insert date here)
<dudedudeman> that's how i would fill out the form now as it stands
danzilio has joined #ruby
ley_ has joined #ruby
sinkensabe has joined #ruby
tus has quit [Ping timeout: 240 seconds]
startupality has quit [Quit: startupality]
grzywacz has joined #ruby
<weaksauce> play around on that. something like \b\d{2}.\d{2}\b should do it for the first case
RegulationD has quit [Ping timeout: 272 seconds]
<Synthead> I'm looking to write a custom RoR helper that uses blocks like so: instance_array(instances, :name) do |instance| ... end. I want it to build an array while making its currently-iterated "instance" available inside the block (much like my_array.each do |element| ... end). How can I do this, and what would the syntax look like?
<weaksauce> actually you need to escape the . like \.
patcable has joined #ruby
sigurding has joined #ruby
ley has quit [Ping timeout: 250 seconds]
mjuszczak has joined #ruby
<dudedudeman> i'm going to go play with that. i had heard of rubular before, but regex are something i know little to nothing about
<dudedudeman> but it does sound like this would work for me
scripore has joined #ruby
<weaksauce> try a bunch of different inputs and see if you can break your regex by accepting bad input. for instance if you don't escape the . it will work for 80R10
<weaksauce> or 80 10 or whatever
scripore has quit [Client Quit]
<dudedudeman> my browser hates rubular for some reason
_honning_ has joined #ruby
<dudedudeman> 80.23 looks like 00 03
<Synthead> dudedudeman: . literally means "anything" (including \.)
yfeldblum has quit [Ping timeout: 252 seconds]
cjim_ has joined #ruby
<Synthead> dudedudeman: that's why .* selects everything, it literally means (zero or more anythings)
grzywacz has left #ruby [#ruby]
Juanchito has quit [Quit: Connection closed for inactivity]
yfeldblum has joined #ruby
sinkensabe has quit [Remote host closed the connection]
sinkensabe has joined #ruby
rshetty has quit [Remote host closed the connection]
<Synthead> dudedudeman: . is special regex syntax, \. is a literal "." and is not regex syntax
rshetty has joined #ruby
<weaksauce> .* is also greedy. it will try to match as much as possible.
<patcable> hmm... I think i found a bug in Digest::SHA512 in ruby 2.2.2: "Base64.encode64(Digest::SHA512.digest("blah" + "coolsalt") + "coolsalt").chomp!" outputs "\n" in the digest after a certain amount of characters.
<dudedudeman> i don't even know what to believe anymore
<Synthead> patcable: file a bug
rikai has joined #ruby
momomomomo has joined #ruby
<Synthead> dudedudeman: http://rubular.com/r/JXAZmDzaxc
<Synthead> dudedudeman: look at the . in the regex quick reference
<dudedudeman> any single character
<apeiros> patcable: and in that place, \n should not be present? because base64 is defined to have \n
<weaksauce> dudedudeman there is a saying that I will paraphrase: "You have a problem and you try to solve it using regular expressions... now you have two problems"
<dudedudeman> weaksauce: dammit
sinkensabe has quit [Remote host closed the connection]
<patcable> apeiros: yeah, i checked with different libraries -- they kill that \n
jwingfi has joined #ruby
<patcable> apeiros: i.e. i tried with python and got a usable hash.
<apeiros> patcable: and how do you determine which one is correct?
scripore has joined #ruby
<patcable> apeiros: well one causes my ldap server to segfault when i try to bind against it
beneggett has joined #ruby
<apeiros> patcable: I'd say a segfaulting server is buggy either way
<patcable> apeiros: the other one (that lacks the \n) is fine
badhatter has quit [Ping timeout: 248 seconds]
kblake has quit [Remote host closed the connection]
<weaksauce> dudedudeman don't get me wrong... regex is a valuable tool but it's complex and easy to mess up your expression and match too much or too little or completely wrong stuff.
<apeiros> patcable: I'd go check the ldap specs
<weaksauce> dudedudeman and it's difficult to read.
_honning_ has quit [Ping timeout: 264 seconds]
<patcable> apeiros: in any case, other libraries (also tried one in C) omit the newline and ruby still has it, which seems problematic
<apeiros> patcable: though I'm not even sure that's proper. you didn't tell us in where you found that.
<dudedudeman> weaksauce: this totally makes sense. i don't want to get too wrapped up in to it, but when i see that (yes|no) would help me force my input to either be yes or no, i personally think that's pretty slick
<weaksauce> dudedudeman beyond any basic regex I would put it into whitespace insensitive mode and put each logical group on separate lines
jwingfi has quit [Remote host closed the connection]
<weaksauce> you can do that by adding a x to the trailing slash of the regex
startupality has joined #ruby
<jhass> patcable: use strict_encode64
<apeiros> patcable: if/when you file a bug - strict_encode64 is the …
badhatter has joined #ruby
kblake has joined #ruby
* apeiros smacks jhass :<
frem has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass> uh, did I miss something?
workmad3 has joined #ruby
<apeiros> no. you beat me to it.
revoohc has quit [Quit: revoohc]
<jhass> oh, yw then
evanjs has quit [Remote host closed the connection]
nszceta_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<Ellis> can anyone recommend a great source that explains blocs, procs, and lambdas?
freerobby has quit [Quit: Leaving.]
<apeiros> patcable: and would you mind telling us where you actually found that piece of code?
a5i has quit [Quit: Connection closed for inactivity]
Bira has quit [Remote host closed the connection]
decoponio has quit [Quit: Leaving...]
<apeiros> because I don't see Digest::SHA512 using encode64…
<patcable> no, i'm trying to build something that will spit out a base64 encoded digest::sha512
<apeiros> ah, you mean *you* call the encode64
<patcable> indeed, strict_encode64 is the solution to my issues
<patcable> yes
<jhass> patcable: I'd still file a bug against the ldap server
<apeiros> yeah, well, as said, base64 is specified to include a newline.
<jhass> it shouldn't segfault on invalid input
<patcable> "line feeds are added every 60 encoded characters" was a new thing to me
<apeiros> s/a newline/newlines/
<patcable> which makes sense, just didn't expect it in this instance. yeah, the openldap folks should know adding \n to a userpassword entry causes a segfault though
freerobby has joined #ruby
<jhass> patcable: such segfaults can be an entry point to exploit it in some way in fact, it hints input validation is going very wrong there
<apeiros> oy, openldap? that's sad :(
mrmargolis has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
mrmargolis has joined #ruby
<apeiros> segfault is always a bug. already said that :D
mary5030_ has quit [Read error: Connection reset by peer]
<jhass> I'm just strengthening your point! :P
<patcable> haha yeah, that much I knew
<apeiros> jhass: ok!
ldnunes_ has joined #ruby
<apeiros> I guess I'm cranky today
<workmad3> apeiros: and that's different from normal how...? :P
<jhass> workmad3: he realizes it
<patcable> in any case, thanks both of you. (and, next time, i'll look up the function first. doh)
<apeiros> workmad3: ( `Д´)=◯)`ν°)
<apeiros> ;-p
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros> yes, yes, I was totally waiting for a chance to use this emoji
<apeiros> emoticon?
* workmad3 wonders wtf it is
sgambino has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> facepunch?
<jhass> I thought it's a guy throwing a ball at another
<havenwood> Tuples, Space, TupleSpace! Wrote a little wrapper around Rinda::TupleSpace with some examples: https://gist.github.com/havenwood/08e859ddd53c84be6c56
<dudedudeman> is that a regex?
<workmad3> jhass: I think I've seen it in a physics paper...
GaryOak_ has quit [Remote host closed the connection]
<apeiros> workmad3: http://postimg.org/image/ilmucote1/0471fa48/ that's how it should render
diegoviola has joined #ruby
mjuszcza_ has joined #ruby
danzilio has quit [Quit: My computer has fallen asleep!]
sumark has quit [Remote host closed the connection]
dseitz has joined #ruby
<workmad3> apeiros: well, that at least makes it look like an angry guy punching a chicken... so closer I guess :P
<apeiros> :<
sumark has joined #ruby
mjuszczak has quit [Ping timeout: 255 seconds]
_honning_ has joined #ruby
baweaver has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
blahwoop has quit [Remote host closed the connection]
shock_one has joined #ruby
mhib has quit [Quit: Leaving]
greenbagels has joined #ruby
plribeiro3000 has joined #ruby
<Synthead> I'm getting a "no block given (yield)" error on this bit of code: http://pastie.org/10108086. I am using a block, so what's the problem?
agnostic has joined #ruby
Brozo has quit [Remote host closed the connection]
GaryOak_ has joined #ruby
mjuszczak has joined #ruby
mjuszcza_ has quit [Read error: Connection reset by peer]
relix has joined #ruby
<toretore> Synthead: which method call are you passing the block to?
mjuszcza_ has joined #ruby
<Synthead> toretore: what do you mean?
Brozo has joined #ruby
<ninjs> is there a way to iterate over any file in a directory, including the ones in subdirectories?
<jhass> Synthead: copy paste the full error message please
cjim_ has quit [Quit: (null)]
bruno- has joined #ruby
<jhass> ninjs: Dir["some_dir/**/*"] is an easy one
<toretore> Synthead: you have a do...end, where does that get sent to?
<jhass> ninjs: also Dir.glob with the same arg
bruno- is now known as Guest51681
<jhass> Synthead: ah, nvm, toretore got it
<ninjs> so I'm doing dir = Dir.open(__dir__); dir.each do |file|; right now
<jhass> toretore: I doubt they know about block precedence rules ;)
<Synthead> toretore: the function and how it's called is in that paste
<Synthead> toretore: error: http://pastie.org/10108095
gauke has quit [Quit: gauke]
<jhass> >> def a; end; def b; yield; end; a b do; end;
<apeiros> Synthead: what toretore is pointing at is that your method is not the receiver of that block
<ruboto> jhass # => no block given (yield) (LocalJumpError) ...check link for more (https://eval.in/317330)
elaptics_away is now known as elaptics
icebourg has quit []
cjim_ has joined #ruby
<apeiros> Synthead: your block is passed to puts instead
mjuszczak has quit [Ping timeout: 245 seconds]
jespada has quit [Quit: WeeChat 1.1.1]
vim_shimm has joined #ruby
kadoppe has quit [Ping timeout: 276 seconds]
<toretore> lesson to be learned: don't think that because ( ) for method calls is optional, you never have to use them
Brozo has quit [Ping timeout: 250 seconds]
<havenwood> zenspider just started his talk: https://www.youtube.com/watch?v=wQCda5PBn0A
Guest70488 has quit [Ping timeout: 264 seconds]
danzilio has joined #ruby
<havenwood> Minitest live stream from RailsConf ^
<Ellis> what is a practical example of using a proc?
baroquebobcat has joined #ruby
<havenwood> (Just not in Germany.)
rippa has quit [Read error: Connection reset by peer]
rippa has joined #ruby
<GaryOak_> where's that dhh keynote?
<Ellis> havenwood: thanks comrade
xerox has left #ruby [#ruby]
<Synthead> apeiros, toretore: ahhhhh, I see! I wrapped the function in () and puts now prints it just fine :)
sigurding has quit [Quit: sigurding]
<havenwood> Ellis: That's a stabby lambda. Stabby stab stab. ->{}
<Synthead> apeiros, toretore: thanks!
kadoppe has joined #ruby
Brozo has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
_djbkd has joined #ruby
<havenwood> Ellis: try: lamb = ->{ puts 'hi from lambda land!' }; lamb.call
Rapier- has quit [Quit: (null)]
mengu has joined #ruby
_djbkd has quit [Remote host closed the connection]
<Ellis> that’s too confusing for me, i’m still trying to figure out what these things are
_honning_ has quit [Ping timeout: 264 seconds]
<toretore> Ellis: they are functions
Brozo has quit [Remote host closed the connection]
<havenwood> Ellis: okay, then: prok = proc { puts 'hi from proc land!' }; proc.call
<GaryOak_> (\/) ~(*_*) (\/)
<havenwood> prok.call*
<jhass> def lamb.cook; call; end; lamb.cook
rshetty has quit [Remote host closed the connection]
<toretore> >> fn = ->(a){ p a }; fn.call('helo')
<ruboto> toretore # => "helo" ...check link for more (https://eval.in/317338)
<havenwood> Ellis: Like a block you can pass around. A nice MLT, mutton, lettuce, and tomato sandwich, where the mutton is nice and lean and the tomatoes are ripe.
yfeldblum has quit [Ping timeout: 245 seconds]
wallerdev has joined #ruby
yfeldblum has joined #ruby
<Ellis> err ill come back when im not confused. thanks for the info though
<havenwood> Ellis: Do you know what a block is?
<Ellis> duh
yalue has quit [Quit: return 0;]
<Ellis> :P
jonatin has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> Ellis: A proc or lambda is like a block you can assign a variable to.
danzilio has quit [Quit: My computer has fallen asleep!]
<Ellis> so why not just have either a proc or a lambda, why both
<toretore> Ellis: don't worry about the difference, they're the same
<Ellis> hah
<toretore> for most intents and purposes, these are the same: ->(a){}; proc{|a| }; lambda{|a| }
<havenwood> Ellis: Because of Tennent's Correspondence Principle or some such gibberish. They are different in a couple ways but don't worry about it.
<toretore> they all return a function, which can be called by doing fn.call(a)
<baweaver> main snafu is that lambdas are touchy about number of arguments and behaves differently when you use return.
<toretore> nothing more, nothing less
<Ellis> baweaver: thank you
<canton7> procs/blocks behave more like you'd expect a block of code to behave - e.g. 'return' returns from the enclosing method. 'lambda' behaves more like you'd expect a method to behave
<baweaver> that ^
<baweaver> it's subtle but enough that you want to remember it at least.
<baweaver> now as to why I normally use them, read through functional javascript by fogus
jheg has joined #ruby
<baweaver> in ruby I will, on occasion, do something like this: def divisible_by(n) -> x { x % n == 0 } end
<Ellis> whoa thanks everyone i really appreciate it
<baweaver> >> def divisible_by(n) -> x { x % n == 0 } end; (1..10).select(&divisible_by(3))
<ruboto> baweaver # => [3, 6, 9] (https://eval.in/317340)
xploshioon has quit [Quit: Leaving]
jheg has quit [Client Quit]
<baweaver> >> def divisible_by(n) -> x { x % n == 0 } end; (1..10).select(&divisible_by(4))
<ruboto> baweaver # => [4, 8] (https://eval.in/317341)
colorisco has quit [Ping timeout: 256 seconds]
nettoweb has joined #ruby
sinkensabe has joined #ruby
<havenwood> >> def prok; proc end; prok { puts 'prawk!' }.call
<ruboto> havenwood # => prawk! ...check link for more (https://eval.in/317342)
<baweaver> >> def responds_to(m) -> o { o.respond_to?(m) }; end; [nil, 's', 1].select(&responds_to(:next))
<ruboto> baweaver # => ["s", 1] (https://eval.in/317343)
<baweaver> can be handy
<baweaver> either that or if you want run once code, just stash it in a lambda with an ||= for caching
<baweaver> def run_once; @val ||= -> { do; some; process; and; return 1 }.call end
spyderman4g63 has quit [Remote host closed the connection]
jonatin has joined #ruby
JDiPierro has quit [Remote host closed the connection]
<baweaver> If I find myself frequently using something (such as add_one) I'll put it in a module and stash the lambda for calling later.
bluOxigen has quit [Ping timeout: 256 seconds]
wallerdev has quit [Quit: wallerdev]
* baweaver knows about next
<baweaver> be right back
baweaver has quit [Remote host closed the connection]
jheg has joined #ruby
Zai00 has joined #ruby
Limix has joined #ruby
ldnunes_ has quit [Quit: Leaving]
<ninjs> can I change a line in a file by line number?
<ninjs> like if I want to change what's written on line 3
<havenwood> ninjs: Permission granted.
uri has quit [Quit: Textual IRC Client: www.textualapp.com]
<ninjs> havenwood: sorry, how would I do so? The ways I've searched show lots of ways to change by the information *on* the line, but not by line number
wallerdev has joined #ruby
<havenwood> ninjs: Do you want to insert a line between existing lines or overwrite a line?
<ninjs> I want to overwrite the line with new data
Cloudhand has quit [Ping timeout: 255 seconds]
<havenwood> ninjs: There are various ways depending on how efficient you want to be with not reading the contents of the file into memory. Care about huge files or want short and sweet code?
<ninjs> havenwood: All of the files are the same size and right now I'm reading the files with File.readlines(file).map(&:chomp) and writing them to an array, then checking a spot in the array to make sure it's a file that should be changed
<jhass> let's say I have an improperly encoded URI, like https://mstrohm.sirius.uberspace.de/mowiki/Sammlung_von_Schiedsgerichtsfällen, what's the sanest way to turn it into something URI.parse is happy about? note that properly encoded URIs, like https://mstrohm.sirius.uberspace.de/mowiki/Sammlung_von_Schiedsgerichtsf%C3%A4llen is possible input too
pranny has joined #ruby
davedev24_ has joined #ruby
<jhass> URI.encode(URI.decode(input)) is my best try so far, but I wonder if there's something nicer or smarter
msmith has quit [Remote host closed the connection]
davedev2_ has quit [Ping timeout: 246 seconds]
chacmool has quit [Remote host closed the connection]
DenSchub has joined #ruby
msmith has joined #ruby
Technodrome has quit [Quit: Technodrome]
pranny has quit [Client Quit]
SuperTux88 has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
FernandoBasso has joined #ruby
fryguy9 has quit [Read error: Connection reset by peer]
Pharaoh2 has joined #ruby
fryguy9 has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
codecop has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
SouL_|_ has quit [Ping timeout: 252 seconds]
<ninjs> jhass:
naftilos76 has quit [Remote host closed the connection]
kyrylo_ has joined #ruby
startupality has quit [Quit: startupality]
<jhass> that would double encode :)
<havenwood> >> 'fällen'.encode Encoding::ASCII, undef: :replace, replace: '*'
<ruboto> havenwood # => "f*llen" (https://eval.in/317352)
nettoweb has joined #ruby
<jhass> looks like encode is an alias for escape actually
<apeiros> that's one thing I miss from iconv - the transliteration
riskish has joined #ruby
kyrylo has quit [Ping timeout: 250 seconds]
startupality has joined #ruby
Dakota-choad has joined #ruby
wallerdev has quit [Quit: wallerdev]
ldnunes has quit [Quit: Leaving]
Limix has quit [Quit: Limix]
mjuszcza_ has quit []
<apeiros> >> require "uri"; URI.encode(URI.decode("https://mstrohm.sirius.uberspace.de/mowiki/Sammlung_von_Schiedsgerichtsfällen"))
<apeiros> surprised that that works…
Ellis has quit [Quit: Ellis]
sagittarian has quit [Ping timeout: 252 seconds]
<apeiros> it's actually the same when you drop the decode
greenbagels has quit [Ping timeout: 245 seconds]
<jhass> yes, but without the decode it double encodes an already encoded one
ghr has joined #ruby
longfeet has joined #ruby
<apeiros> ah
<apeiros> it's probably the easiest. the less easy variant would be using gsub on invalid chars
<jhass> I basically just wonder if there's a smarter variant that recognizes escape sequences and skips them
<ninjs> wait jhass I think I got you
blackmesa has joined #ruby
<jhass> it's in a Rails context btw, if that makes any difference (doubt it)
benegget_ has joined #ruby
vasilakisfil has joined #ruby
<jhass> mh, should check if addressable has something
<Dakota-choad> Help a noob please! I need a ruby reggae that will match everything between the last - and first . so out of a hostname that looks like this site-name-application1.mysite.com I would return only application without the numeral. Thanks.
<Dakota-choad> regex
beneggett has quit [Ping timeout: 248 seconds]
<havenwood> jhass: transliterate
<vasilakisfil> ok... I want to do something xtreme I hope it is possible.. can I somehow check if a method accepts regular arguments or keyword arguments ?
<vasilakisfil> actually it's a lamda not a method
<vasilakisfil> and I also want to check if one of them has a default parameter :P
<jhass> havenwood: I don't follow?
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sohrab has joined #ruby
<ninjs> jhass: url = your_url unless url =~ /\A#{URI::regexp}\z/; new_url = URI.escape(url);
<jhass> havenwood: that doesn't seem to do URI encoding
<havenwood> jhass: oh, right
paulcsmith has quit [Quit: Be back later ...]
<jhass> alright, Addressable::URI.normalized_encode seems to do what I want, thanks anyway everybody
wallerdev has joined #ruby
<havenwood> DeBot: n
<DeBot> ␣␣␣-␣␣␣n␣␣␣-␣␣␣␣␣␣ [] 0/12
<ninjs> >> require "uri"; url = "https://mstrohm.sirius.uberspace.de/mowiki/Sammlung_von_Schiedsgerichtsf%C3%A4llen"; unless url =~ /\A#{URI::regexp}\z/; URI.escape(url); end;
<ruboto> ninjs # => nil (https://eval.in/317356)
<jhass> havenwood: sssh, you got two people to please first :P
michael_mbp has quit [Excess Flood]
<havenwood> jhass: just had to know about that 'n'!
<ninjs> >> require "uri"; url = "https://mstrohm.sirius.uberspace.de/mowiki/Sammlung_von_Schiedsgerichtsf%C3%A4llen"; if url =~ /\A#{URI::regexp}\z/; puts url; else; URI.escape(url); end;
michael_mbp has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<momomomomo> beware jhass addressable seems like it should take hashes with symbols and strings as input for nested params
<momomomomo> but that’s not the case
<havenwood> >> method(:puts).parameters
<ruboto> havenwood # => [[:rest]] (https://eval.in/317358)
matchaw has quit [Ping timeout: 246 seconds]
<havenwood> vasilakisfil: Check out #parameters ^
<ninjs> >> require "uri"; url = "https://mstrohm.sirius.uberspace.de/mowiki/Sammlung_von_Schiedsgerichtsfällen"; if url =~ /\A#{URI::regexp}\z/; puts url; else; URI.escape(url); end;
josephleon has quit [Quit: Leaving...]
lucashungaro has joined #ruby
<jhass> momomomomo: thanks, I'm going to keep the regular URI.parse and just use Addressable for normalizing encoding :)
<momomomomo> oh they did merge it
<momomomomo> nevermind
doodlehaus has quit [Remote host closed the connection]
Technodrome has joined #ruby
<havenwood> vasilakisfil: Here's an example of using #parameters to see how many args and keywords a method/proc/lambda can take: https://gist.github.com/havenwood/9163507
scripore has quit [Quit: This computer has gone to sleep]
Ellis has joined #ruby
<havenwood> vasilakisfil: So `{:arguments=>1..1, :keywords=>0..1}` would mean one mandatory arg and one optional kwarg.
sinkensabe has quit [Remote host closed the connection]
DenSchub has left #ruby ["Leaving."]
<momomomomo> oh nope, they fixed it in signet, but not with Addressable
sagittarian has joined #ruby
nobitanobi has joined #ruby
Igorshp has joined #ruby
scripore has joined #ruby
Soda has quit [Remote host closed the connection]
mjuszczak has joined #ruby
<jhass> Dakota-choad: prepare a rubular.com with more example input and your attempt so far ;)
<jhass> then share it
Bira has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Ellis has quit [Client Quit]
mjuszczak has quit [Client Quit]
<havenwood> >> s = "https://mstrohm.sirius.uberspace.de/mowiki/"; s[s.index('.').next..s.rindex('.').pred]
<ruboto> havenwood # => "sirius.uberspace" (https://eval.in/317362)
<havenwood> for the requisite non-regexp solution*
<ninjs> So yeah I'm still looking to change a line in a file by line numbert
<ninjs> So yeah I'm still looking to change a line in a file by line number
<ninjs> ** sorry used to slack pressing up arrow to edit my last message
<havenwood> ninjs: What's your current attempt?
kblake has quit [Remote host closed the connection]
<xxneolithicxx> dudedudeman: http://it-ebooks.info/book/2262/ dl they have a lot of books there
milesmatthias has quit [Remote host closed the connection]
<dudedudeman> whoa, that was a hot minute ago. lol
<ninjs> havenwood: My initial thought was to read the file and put it into the claim array (already done) then just write the changes to the array and then push that back to the file.
<havenwood> ninjs: Did that work? Have you tried rejoining the Array on "\n"s paired with File.write yet?
<ninjs> No I haven't tried that. I forgot that I needed to reappend "\n"
<havenwood> ninjs: Try that!
<vasilakisfil> ah thanks havenwood!
<havenwood> All pending tickets marked "feedback needed
<havenwood> DeBot: l
<DeBot> ␣␣␣-␣␣␣n␣␣␣-␣␣␣␣␣␣ [l] 1/12
Bira has quit [Remote host closed the connection]
<havenwood> Dash!
<ninjs> so would it be like array.each do |line|; line << "\n"; end?
Lissie has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
<havenwood> vasilakisfil: You're welcome!
Ellis has joined #ruby
<havenwood> vasilakisfil: Does the #arity_range thing output make sense to you or too confusing?
mrmargol_ has joined #ruby
quimrstorres has joined #ruby
<havenwood> ninjs: array.join "\n"
segfalt has quit [Quit: segfalt]
<havenwood> DeBot: s
<DeBot> ␣␣␣-␣␣␣n␣␣␣-␣␣␣␣␣␣ [ls] 2/12
<GaryOak_> DeBot: t
<DeBot> ␣␣␣-t␣␣n␣t␣-␣␣t␣␣t [ls] 2/12
<apeiros> DeBot: era
<DeBot> ␣␣␣-tr␣n␣t␣-␣␣t␣␣t [lsea] 4/12
<havenwood> DeBot: u
<DeBot> ␣␣␣-tr␣n␣t␣-␣ut␣ut [lsea] 4/12
<havenwood> ut_ut
<apeiros> gems?
<havenwood> ya
<GaryOak_> DeBot: p
<DeBot> ␣␣␣-tr␣n␣t␣-␣utput [lsea] 4/12
<havenwood> DeBot: o
<DeBot> ␣␣␣-tr␣n␣t␣-output [lsea] 4/12
mrmargolis has quit [Ping timeout: 245 seconds]
<GaryOak_> DeBot: i
<DeBot> ␣i␣-trinit␣-output [lsea] 4/12
wallerdev has quit [Quit: wallerdev]
<vasilakisfil> havenwood makes sense!
sinkensabe has joined #ruby
<havenwood> vasilakisfil: nice! :)
fred1807 has joined #ruby
<jhass> DeBot: y
<DeBot> ␣i␣-trinity-output [lsea] 4/12
<GaryOak_> DeBot: d
<DeBot> ␣i␣-trinity-output [lsead] 5/12
* apeiros wonders what that trinity thingy is
<GaryOak_> DeBot: m
<DeBot> ␣i␣-trinity-output [lseadm] 6/12
<ninjs> how do you set a variable to the output of a block?
<jhass> ninjs: "output"? you mean return value?
<ninjs> yes sorry
<jhass> foo = yield
<havenwood> ninjs: tried just assigning the variable?
wallerdev has joined #ruby
ghormoon has quit [Ping timeout: 255 seconds]
<xxneolithicxx> organizational question: you create a gem and the lib has resources (JSON files) loaded by class instances on creation. your dirs are organized by module /lib/<gem name>/module/class.rb . Where would you put resources?
<jhass> >> def upcase_by; thing = yield; thing.upcase; end; upcase_by { "foo" }
mary5030 has quit [Remote host closed the connection]
<ruboto> jhass # => "FOO" (https://eval.in/317367)
<Synthead> can I have a function call itself (recursive) without using the literal function name (something like self instead)?
<havenwood> Synthead: __method__
<jhass> >> Gem.datadir("rake")
<ruboto> jhass # => nil (https://eval.in/317368)
<Synthead> havenwood: that's great, thanks!
ghormoon has joined #ruby
shock_one has quit [Remote host closed the connection]
<havenwood> Synthead: You're welcome!
<jhass> xxneolithicxx: ^ well, for your gem it should return something
sankaber has joined #ruby
wldcordeiro has joined #ruby
<jhass> when installed
lidenskap has quit [Remote host closed the connection]
Lissie_ has joined #ruby
_blizzy_ has quit [Ping timeout: 272 seconds]
<havenwood> DeBot: p
<DeBot> ␣i␣-trinity-output [lseadm] 6/12
Zai00 has quit [Quit: Zai00]
Lissie has quit [Read error: Connection reset by peer]
sinkensabe has quit [Remote host closed the connection]
|\|370 has quit []
baweaver has joined #ruby
<GaryOak_> DeBot: f
<DeBot> fi␣-trinity-output [lseadm] 6/12
cjim_ has quit [Quit: (null)]
<jhass> DeBot: s
<DeBot> fi␣-trinity-output [lseadm] 6/12
<GaryOak_> DeBot: g
<DeBot> fi␣-trinity-output [lseadmg] 7/12
<jhass> oh, had that already
Ellis has quit [Quit: Ellis]
<xxneolithicxx> jhass: maybe i worded that badly, was more an organizational question of if your gem lib has resources other than ruby files would you place them in the same dir as the ruby file that uses it or somewhere else.
<xxneolithicxx> jhass: i guess it also depends on gem packaging standards which i dont know about
<jhass> xxneolithicxx: Gem.datadir should return the path to data/ next to oyur lib/
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass> if I interpreted it correctly
milesmatthias has joined #ruby
lidenskap has joined #ruby
<GaryOak_> DeBot: x
<DeBot> fix-trinity-output [lseadmg] 7/12 You won!
cocotton has quit [Remote host closed the connection]
<havenwood> "Trinity outputs fastq files that have been 'corrected'."
Brozo has joined #ruby
ramfjord has joined #ruby
philip1 has quit [Ping timeout: 245 seconds]
evanjs has joined #ruby
cpt_yossarian has quit [Read error: Connection reset by peer]
fryguy9 has quit [Read error: Connection reset by peer]
fryguy91 has joined #ruby
cpt_yossarian has joined #ruby
michaeldeol has joined #ruby
chinmay_dd has quit [Quit: See ya!]
elaptics is now known as elaptics_away
vasilakisfil has quit [Ping timeout: 265 seconds]
Ellis has joined #ruby
Pharaoh2 has quit [Remote host closed the connection]
RegulationD has joined #ruby
Ellis has quit [Client Quit]
Brozo has quit [Remote host closed the connection]
Brozo has joined #ruby
Technodrome has quit [Quit: Technodrome]
plribeiro30001 has joined #ruby
plribeiro3000 has quit [Ping timeout: 250 seconds]
benegget_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
badhatter has quit [Read error: Connection reset by peer]
RegulationD has quit [Ping timeout: 256 seconds]
mrmargol_ has quit [Remote host closed the connection]
<Dakota-choad> here is my rublar: .*?(?:[a-z][a-z]+).*?(?:[a-z][a-z]+).*?((?:[a-z][a-z]+)) but when i run it like so Facter.value(:hostname).*?(?:[a-z][a-z]+).*?(?:[a-z][a-z]+).*?((?:[a-z][a-z]+)) I get some syntax errors. Any ideas
badhatter has joined #ruby
freerobby has quit [Quit: Leaving.]
josephleon has joined #ruby
odin22 has quit [Read error: Connection reset by peer]
Bira has joined #ruby
tmoor has joined #ruby
<jhass> Dakota-choad: it's called regex or regular expression in full, http://rubular.com is a site ;)
spyderman4g63 has joined #ruby
Klerko has joined #ruby
<ninjs> What's the opposite of File.readlines? it's sure not File.writelines... haha
<Klerko> Hey
allcentury has quit [Ping timeout: 252 seconds]
<Klerko> How hard will Ruby be to learn for a C++ developer?
jottr_ has joined #ruby
jottr has quit [Read error: Connection reset by peer]
<shellfu> Dakota-choad, hop into #puppet for that. In addition if that is a customer facter fact you cannot simply append a regex to a facter value
barkerd427 is now known as zz_barkerd427
<toretore> Klerko: probably not very; though i don't know c++ myself
<Klerko> Anyone else that knows?
Lissie_ has quit [Read error: Connection reset by peer]
allcentury has joined #ruby
Lissie has joined #ruby
davedev2_ has joined #ruby
<Dakota-choad> Thanks.
davedev24_ has quit [Ping timeout: 264 seconds]
havenwood has quit []
pdoherty has quit [Ping timeout: 252 seconds]
<diegoviola> Klerko: I don't think there's a right answer to that question, difficulty with learning anything probably varies with every individual
EasyCo has joined #ruby
vim_shimm has quit [Ping timeout: 256 seconds]
<diegoviola> Klerko: I believe you already know how objects work, it should be straightforward
<diegoviola> although the object model in C++ is probably different to the one in Ruby
soulcake has quit [Quit: Quack.]
<diegoviola> I don't know C++ either
<Senjai> diegoviola: Very different.
<jhass> Klerko: I've seen both ends of the spectrum for people that called themselves C++ programmer, for some it was very hard for some it was very easy
soulcake has joined #ruby
<Senjai> diegoviola: Ruby doesnt have primitives, for example.
evanjs has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
vsh_ has quit [Ping timeout: 245 seconds]
<xxneolithicxx> i learned C++ when i was about 13, and Ruby was easy to learn except for its heavy use and passing of lambda's looked different than anything else id ever worked in and that was actually the most confusing
<Klerko> jhass, I have no problem learning new things as I have, over my life, been surrounded by abstraction.
mostlybadfly has joined #ruby
<diegoviola> Senjai: right
Ellis has joined #ruby
<jhass> Klerko: I'd say don't worry and just go for it, usually learning a new language teaches you something that you can apply in general, even if you're not going to use it a lot
Ellis has left #ruby [#ruby]
davedev2_ has quit [Ping timeout: 240 seconds]
philip1 has joined #ruby
<jhass> at very least it'll make learning the next language easier with every one you learned
spyderman4g63 has quit [Ping timeout: 250 seconds]
Bira has quit [Ping timeout: 245 seconds]
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
tus has joined #ruby
davedev24_ has joined #ruby
<Synthead> __method__ returns a symbol. I want to have a recursive function call itself without referring to itself literally. essentially __method__(foo) (but calling itself instead of trying to call a symbol). how can I do this?
Igorshp has quit [Remote host closed the connection]
<jhass> Synthead: (public_)send
Hijiri has joined #ruby
<jhass> Synthead: though I'd be curious about the usecase
mengu has quit [Remote host closed the connection]
<Synthead> jhass: it's a recursive function. it calls itself
jimms has joined #ruby
<Synthead> jhass: iterates over some items until there aren't any more to process, then stops the recursion
<apeiros> I *think* he got that part :D
mjuszczak has joined #ruby
<Synthead> I figured as much :p
jimms has quit [Client Quit]
<apeiros> the question is why you don't want to refer to it literally
<Synthead> but I mean, are recursive functions bad practice or something?
scripore has quit [Quit: This computer has gone to sleep]
<Synthead> apeiros: so if I change the function name, it doesn't break. I don't think it should break in this case
<jhass> Synthead: no, I just can't come up why you wouldn't just write the method name
<apeiros> in ruby it's generally not a good idea. stack is quite limited.
<jhass> eh, not worth it
<jhass> don't be smart, be explicit
<apeiros> somewhere around 4k callstack depth it's end of line
<apeiros> and with send you just half it
<jhass> write a test that fails if you rename it without changing the recursive call
<apeiros> and IMO what jhass said
<Synthead> jhass: well that's easy ... change the method name and when it tries to call itself by the old name, it's undefined
<jhass> see, no need to be smart
shellfu is now known as shellfu_afk
<jhass> you'll just confuse the hell out of people who come after you
lidenskap has quit [Remote host closed the connection]
dopie has quit [Ping timeout: 250 seconds]
<jhass> I thought you'd be in some metaprogramming context and wondered what that would look like without having the method name available
<jhass> I didn't even imagine your reason could be "more resistant to change"
<Synthead> jhass: doesn't seem like a very dynamic way to write code. to each their own, though.
wldcordeiro has quit [Ping timeout: 248 seconds]
allcentury has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
<jhass> just because Ruby allows for ton of dynamic code, doesn't mean it's a good idea to use it all the time
fryguy91 has quit [Quit: Leaving.]
kyrylo_ has quit [Ping timeout: 272 seconds]
Spami has quit [Quit: Leaving]
dopie has joined #ruby
havenwood has joined #ruby
ki0 has quit [Remote host closed the connection]
<Synthead> is there a better way to change the first hash element's value without knowing what the key is than this? http://pastie.org/10108244
<apeiros> Synthead: positional hash access is a code smell
<apeiros> and no, I don't think there's a better way than yours.
michaeld_ has joined #ruby
<Synthead> apeiros: ok, thanks! I'll consider using arrays instead
ddarkpassenger has joined #ruby
plribeiro30001 has quit [Quit: Leaving.]
Lissie has quit [Read error: Connection reset by peer]
Igorshp has joined #ruby
Lissie_ has joined #ruby
Astrologos_ has joined #ruby
nobitanobi has quit [Remote host closed the connection]
galeido_ has quit [Ping timeout: 272 seconds]
badhatter has quit [Ping timeout: 264 seconds]
thejoecarroll has quit [Ping timeout: 272 seconds]
MuffinPimp has quit [Ping timeout: 272 seconds]
bier has quit [Ping timeout: 272 seconds]
michaeldeol has quit [Ping timeout: 244 seconds]
mjuszczak has quit []
dorei has quit [Ping timeout: 250 seconds]
quimrstorres has quit [Remote host closed the connection]
sankaber has quit [Ping timeout: 244 seconds]
MuffinPimp has joined #ruby
Astrologos_ has quit [Ping timeout: 276 seconds]
kirun has quit [Quit: Client exiting]
nfk has quit [Quit: yawn]
wldcordeiro has joined #ruby
dopie has quit []
msmith has quit [Ping timeout: 265 seconds]
galeido has joined #ruby
bier has joined #ruby
thejoecarroll has joined #ruby
beneggett has joined #ruby
ghostmoth has quit [Quit: ghostmoth]
lidenskap has joined #ruby
yfeldblu_ has joined #ruby
dorei has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
yfeldblum has quit [Read error: No route to host]
yfeldblum has joined #ruby
Phage^ is now known as Phage
sevvie has quit [Ping timeout: 250 seconds]
stef204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Astrologos_ has joined #ruby
yfeldblu_ has quit [Ping timeout: 245 seconds]
Spami has joined #ruby
scripore has joined #ruby
tus has quit [Ping timeout: 250 seconds]
badhatter has joined #ruby
akkad has quit [Excess Flood]
mjuszczak has joined #ruby
JimmyNeutron has quit [Ping timeout: 264 seconds]
Cust0sL1men has joined #ruby
dorei has quit [Ping timeout: 256 seconds]
Astrologos_ has quit [Ping timeout: 245 seconds]
Lissie_ has quit [Read error: Connection reset by peer]
baroquebobcat_ has joined #ruby
ki0 has joined #ruby
dfinninger has quit [Remote host closed the connection]
baroquebobcat has quit [Ping timeout: 244 seconds]
baroquebobcat_ is now known as baroquebobcat
Lissie has joined #ruby
jerius has quit [Quit: /quit]
akkad has joined #ruby
musashi1 has joined #ruby
ghr has quit [Ping timeout: 256 seconds]
JimmyNeutron has joined #ruby
JimmyNeutron has quit [Max SendQ exceeded]
ylluminarious has joined #ruby
sankaber has joined #ruby
JimmyNeutron has joined #ruby
dorei has joined #ruby
gaboesquivel has quit []
tus has joined #ruby
shoutsid has quit [Remote host closed the connection]
<mwlang> when I have a potential for a nil argument and I want to return nil or some attribute of the passed argument, is it better to do: def a(bah); bah and bah[1]; end or def a(bah); bah && bah[1]; end ? (that is use “&&” or use “and”)
<Synthead> what's a clean way that I can return everything in an array but the first element? like the antonym of array.slice(0)?
nobitanobi has joined #ruby
existensil has quit [Ping timeout: 264 seconds]
<mwlang> Synthead: some_array[1, some_array.size]
doodlehaus has joined #ruby
<mwlang> or, if you want to remove the element from the array: some_array.shift
tus has quit [Client Quit]
<mwlang> That’ll return the first item in the array and remove it at the same time.
<Hijiri> diegoviola
predator217 has joined #ruby
<Hijiri> holy shit the game is working with wine-staging
shock_one has joined #ruby
<Hijiri> thank you for pointing me to it
baweaver has quit [Remote host closed the connection]
<Synthead> mwlang: there isn't something similar to {}.except
hiyosi has joined #ruby
<Hijiri> diegoviola++ in case this room has karma
<Synthead> mwlang: for Arrays?
fryguy9 has joined #ruby
Cache_Money has joined #ruby
existensil has joined #ruby
tus has joined #ruby
chrisja has quit [Quit: leaving]
b4tm4n has joined #ruby
<b4tm4n> does bundle install need sudo privileges?
jenrzzz has quit [Ping timeout: 250 seconds]
<Senjai> b4tm4n: Depends where its installing the gems
vudew has quit [Remote host closed the connection]
predator117 has quit [Ping timeout: 250 seconds]
scripore has quit [Quit: This computer has gone to sleep]
<mwlang> Synthead: yes
duncannz has joined #ruby
TheNumb has quit [Ping timeout: 264 seconds]
duncannz has quit [Max SendQ exceeded]
Guest123456666 has joined #ruby
vudew has joined #ruby
scripore has joined #ruby
<mwlang> nevermind my question regarding and vs &&, finally found the answer I was seeking. “Properly understood, and and or are control flow operators, not boolean operators.” http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/ I knew I had read this somewhere a few years ago.
doodlehaus has quit [Remote host closed the connection]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
sami__ has quit [Ping timeout: 264 seconds]
shock_one has quit [Ping timeout: 250 seconds]
Someguy123 has quit [Ping timeout: 252 seconds]
fryguy9 has quit [Client Quit]
sami has joined #ruby
zorak8 has joined #ruby
<Senjai> mwlang: Just dont use and and or :P
<mwlang> Senjai: why not? I needed flow-controlling logic in my use case...
<sohrab> i want to iterate through a set of values, and if i can't find a value that meets a condition, to do something else. is this possible?
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Senjai> 99% of the time you can just use && or ||
<Senjai> We dont need codebases that use both unless the lower precedence is actually required
d10n-work has quit [Quit: Connection closed for inactivity]
musashi1 has quit [Ping timeout: 244 seconds]
TheNumb has joined #ruby
pauly_oc has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
freerobby has joined #ruby
Klerko is now known as Valian
ramfjord has quit [Ping timeout: 265 seconds]
Cache_Money has quit [Remote host closed the connection]
WillAmes has quit [Remote host closed the connection]
Lissie has quit [Read error: Connection reset by peer]
Someguy123 has joined #ruby
<bricker> Senjai: there is never, ever a reason where you *have* to use "and" or "or", it's a completely optional syntax feature.
WillAmes has joined #ruby
Lissie has joined #ruby
<Senjai> bricker: I know, kind of the point I was making :P
<bricker> Senjai: I am corroborating!
<Senjai> Oh
<Senjai> I misread the tone then sorry :/
<bricker> mwlang: "and" and "or" are just syntax sugar for "if". Use "if", there is no ambiguity about how "if" works.
Astrologos_ has joined #ruby
riskish has quit [Quit: Textual IRC Client: www.textualapp.com]
Lissie has quit [Read error: Connection reset by peer]
ki0 has quit [Remote host closed the connection]
Lissie has joined #ruby
jerius has joined #ruby
<bricker> Senjai: *high-five*
<mwlang> bricker: Here’s the actual code: @id ||= (item = @identifiers.detect{|d| d.type == '03'} and item.id)
arescorpio has joined #ruby
<mwlang> basically fetching an id value that may or may not be present.
<Synthead> mwlang: what is it?
dorei has quit [Ping timeout: 256 seconds]
milesmatthias has quit [Remote host closed the connection]
<Guest123456666> can anyone help me with implementing a nested comment system similar to comment threading like reddit? i have regular comments working already
ramfjord has joined #ruby
dorei has joined #ruby
Rickmasta has joined #ruby
<mwlang> Synthead: sorry, I didn’t understand your question.
<Synthead> mwlang: there isn't something similar to {}.except for Arrays?
scripore has quit [Quit: This computer has gone to sleep]
<Synthead> mwlang: like [1, 2, 3].except(0) (to return [2, 3])
<Senjai> mwlang: Thats kind of doing too much
startupality has quit [Quit: startupality]
<mwlang> Synthead: not sure. That sounds like an active_support extension to me.
<Senjai> for like, one line
dstarh has joined #ruby
<Senjai> also, thats unfortunate code to have to work with
<Senjai> I cant imagine the infrastructure that would require you to write such a thing
<Senjai> mwlang: Make it readable, break it up into multiple lines
<Synthead> Senjai: that's a pretty loaded assumption ;)
<Senjai> Synthead: Yes it is, and I've been wrong dozens of times, but I've also been right dozens of times :P
workmad3 has joined #ruby
<sohrab> inside a nested conditional, can i do `return x; break`? if i want the conditional to return something and to stop the loop
<Senjai> Synthead: type == '03' << Hard coded string? That's CRAZY
Astrologos_ has quit [Ping timeout: 256 seconds]
<sohrab> nested conditional = a conditional inside a loop
<Synthead> Senjai: I'm not writing this due to some enterprise culprit or whatever, it's for a recursive function
<Senjai> Synthead: All good, I'm just poking fun
Astrologos_ has joined #ruby
<Senjai> Synthead: err. you know I was talking to mwlang right
Rollabun_ has quit [Read error: Connection reset by peer]
<Synthead> Senjai: oh right on
<Senjai> Synthead: Sorry >.>
Guest123456666 has quit [Quit: Textual IRC Client: www.textualapp.com]
<Synthead> Senjai: no worries man. people take the accidental nick things too seriously around here imo
DerisiveLogic has quit [Ping timeout: 256 seconds]
dorei has quit [Ping timeout: 245 seconds]
<mwlang> Senjai: maybe I need a better pattern for “see if an item’s in an array and if so, return some property of that item. I’m basically pulling data out of large XML structures that I’ve turned into PORO’s
<Senjai> mwlang: Can you gist the entire code
snockerton has quit [Quit: Leaving.]
msmith has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
cajone has quit [Quit: Leaving.]
_honning_ has joined #ruby
dorei has joined #ruby
mjuszczak has quit []
beneggett has quit [Ping timeout: 276 seconds]
vudew has quit [Ping timeout: 240 seconds]
<mwlang> Senjai: it’s a *lot* of code to gist….want me to try with a bit and then add more at your prompting?
djbkd has joined #ruby
<mwlang> as to the comment on type == '03' — one step at a time — working code first, then refactor the smells away. :-)
cajone has joined #ruby
a5i has joined #ruby
Astrologos_ has quit [Ping timeout: 244 seconds]
ley_ has quit [Ping timeout: 250 seconds]
Astrologos_ has joined #ruby
cjim_ has joined #ruby
mikecmpbll has quit [Remote host closed the connection]
Pharaoh2 has joined #ruby
cpt_yossarian has quit [Remote host closed the connection]
Pharaoh2 has quit [Remote host closed the connection]
<Senjai> mwlang: Totally fair, just gist the file that particular code is in
cpt_yossarian has joined #ruby
<frem> I have a class with a geocode method which is added by a gem and called in magical ways. I want to wrap that method in some error handling. Would `def geocode; safe_geocode { super }; end` pass the normal geocode method into my error handling function as a block?
dorei has quit [Ping timeout: 256 seconds]
dcarmich has joined #ruby
cpt_yossarian has quit [Remote host closed the connection]
<Senjai> frem: I would just alias the method
Lissie has quit [Quit: My computer has gone to sleep. ZZZzzz…]
<wallerdev> yeah use alias_method
platosha has quit [Quit: Leaving]
Deele has quit [Ping timeout: 256 seconds]
cpt_yossarian has joined #ruby
spicerack has joined #ruby
iotouch has joined #ruby
<frem> That does looks easier to reason about.
<Senjai> frem: You dont know how geocode is monkeypatched into your class, so super is not guarneteed to work
juanpablo_ has quit [Quit: (null)]
mjuszczak has joined #ruby
juanpaucar has quit [Remote host closed the connection]
<Senjai> frem: Alternatively, you could make the gem just be.. better
juanpablo_ has joined #ruby
<frem> I'm strongly considering working on that, after my app isn't constantly crashing from geocoding errors. :)
<Senjai> mwlang: https://gist.github.com/Senjai/efb930aa3b8da09d797c is much more readable
<Senjai> mwlang: You lose nothing by doing it that way, and it makes it dead simple to read
<Senjai> mwlang: No need to force a single line
<Senjai> I would also store the hardcoded string in a constant
<Senjai> mwlang: Also, I would actually just not memoize that
blackmesa has quit [Quit: WeeChat 1.1.1]
<Senjai> unless @identifiers.detect is expensive
icarus has quit [Ping timeout: 248 seconds]
juanpablo__ has joined #ruby
<Senjai> just have it return @identifiers.detect {|d| d.type == PRODUCT_TYPE}.id
WildBamboo-Josh has quit [Quit: Leaving]
<Senjai> Unless you actually have performance issues, you want to avoid over optimizing
jobewan has quit [Quit: Leaving]
zz_barkerd427 is now known as barkerd427
<mwlang> Senjai: fair points. the hardcoded strings will get symbolized later into a hash constant like this NOTIF_CODES = { "01" => :early, "02" => :advance, "03" => :confirm, "04" => :update, "05" => :delete }
Rollabunna has joined #ruby
<Senjai> mwlang: I feel like the values should be the keys, and the keys should be rhe values there
<mwlang> Senjai: I’ll be processing about 16 to 20 mb files at a time.
ddarkpassenger has quit [Quit: Leaving]
juanpablo_ has quit [Ping timeout: 264 seconds]
<Senjai> mwlang: And? How often do you call id?
<Senjai> and how slow isit
laurentide has quit [Quit: Leaving]
<Senjai> mwlang: I would prefer d.type == NOTIF_CODES[:confirm]
<mwlang> Senjai: ah, on that, I’m not concerned about.
<Senjai> in that case
sshao has joined #ruby
<Senjai> mwlang: Aye, dont memoize unless you have to :P
<Senjai> Just do the calculation on demand
<Senjai> unless you have a reason not to
<Senjai> If you want to memoize
<Senjai> I'd stick with the code I wrote in the gist
<mwlang> Senjai: The values come from the XML file….so I need NOTIF_CODES[“01”] to eval to :early so that the code that flow-controls “if notice.early? then …”
<diegoviola> Hijiri: np
RegulationD has joined #ruby
<Senjai> mwlang: Gotcha, but you still dont want a magic string there, you probably want to call it something
<diegoviola> Hijiri: you probably want to join #winehackers and let the devs know about that
<Senjai> mwlang: You could NOTIF_CODES.invert[:confirm]
<diegoviola> Hijiri: or #winehq
<Senjai> Beware calling invert on hashes with duplicate values though, because keys must be unique :P
<diegoviola> Hijiri: what game is that btw?
juanpablo__ has quit [Ping timeout: 264 seconds]
<Senjai> mwlang: At least that provides some logical meaning to all of the type checks you're doing
<mwlang> Senjai: definitely. I agree. I think I’m just confusing you with my rambling. The value “01” only appears in the NOTIF_CODES…I actually get it turned into notice.early? with a def early? NOTIF_CODES[self.value] == :early; end
Astrologos_ has quit []
dorei has joined #ruby
baweaver has joined #ruby
Brozo has quit [Remote host closed the connection]
Igorshp has quit [Remote host closed the connection]
<Senjai> mwlang: thing.detect {|d| NOTIF_CODES[d] == :confirm } then :P
<Senjai> its much better to read and reason about intead of dealing with numbers :P
<Senjai> mwlang: thing.detect {|d| NOTIF_CODES[d.type] == :confirm } then :P
<mwlang> Senjai: why not thing.detect{|d| d.early?} then
<Senjai> mwlang: If d has that method, then sure!
<Senjai> d.confirm? (I think you mean)
longfeet has quit [Ping timeout: 256 seconds]
<mwlang> Senjai: that’s what I was trying to describe as “my plan” above :-)
doodlehaus has joined #ruby
<Senjai> mwlang: that would change it to @identifiers.detect(&:confirm?).id
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
RegulationD has quit [Ping timeout: 256 seconds]
<mwlang> Senjai: ah…I never thought to do that with detect…I do it all the time with select/reject/map. :-p
<Senjai> mwlang: :)
superscott[8] has joined #ruby
<mwlang> Senjai: thanks for the constructive feedback.
<Senjai> mwlang: Glad we had this chat then
<Senjai> np
<Senjai> let me know how it pans out
beans has joined #ruby
jottr_ has quit [Read error: Connection reset by peer]
Brozo has joined #ruby
beans has left #ruby [#ruby]
baweaver has quit [Remote host closed the connection]
<mwlang> Senjai: Oh, I’m changing it exactly as you described…it is good to go readable.
<mwlang> sometimes I just don’t realize I went too far without a 2nd pair of eyes.
jottr_ has joined #ruby
GaryOak_ has quit [Remote host closed the connection]
Pharaoh2 has joined #ruby
kubunto has joined #ruby
duderonomy has quit [Ping timeout: 256 seconds]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Astrologos_ has joined #ruby
icebourg has joined #ruby
willharrison has joined #ruby
icebourg has quit [Max SendQ exceeded]
icebourg has joined #ruby
dorei has quit [Ping timeout: 264 seconds]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
perturbation has joined #ruby
AlecTaylor has joined #ruby
jenrzzz has joined #ruby
<AlecTaylor> hi
<AlecTaylor> How do I get Jekyll (in RVM) working with Grunt? - http://stackoverflow.com/q/29791893
WildBamboo-Josh has joined #ruby
thumpba_ has quit [Ping timeout: 245 seconds]
keen_______ has left #ruby ["ERC (IRC client for Emacs 25.0.50.1)"]