havenwood changed the topic of #ruby to: Rules & more: http://ruby-community.com || Ruby 2.3.0; 2.2.4; 2.1.8; 2.0.0-p648: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
rkazak has quit [Ping timeout: 265 seconds]
makenoise has joined #ruby
cschneid_ has quit [Remote host closed the connection]
hannelita has quit [Remote host closed the connection]
artX000 has quit [Remote host closed the connection]
dlitvak has joined #ruby
akkad has quit [Excess Flood]
bb010g has joined #ruby
hxegon has joined #ruby
brixen has quit [Excess Flood]
scripore has quit [Quit: This computer has gone to sleep]
brixen has joined #ruby
dfinninger has quit [Remote host closed the connection]
asccigcc has quit [Quit: asccigcc]
makenoise has quit [Ping timeout: 256 seconds]
akkad has joined #ruby
howdoicomputer has quit [Ping timeout: 256 seconds]
scottschecter has joined #ruby
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
atom3 has joined #ruby
trajing has joined #ruby
bodgix has joined #ruby
guacamole has joined #ruby
atom3 has quit [*.net *.split]
trajing has quit [*.net *.split]
bodgix has quit [*.net *.split]
atom3 has joined #ruby
bodgix has joined #ruby
trajing has joined #ruby
firstdayonthejob has quit [Ping timeout: 250 seconds]
<fartface> Right, so I'm going through the koans
chipotle has joined #ruby
<fartface> about_nil.rb-- assert_equal __, nil.is_a?(Object), "Unlike NULL in other languages"
<fartface> I changed __ to `true`, and passed the test
djellemah has quit [Read error: Connection timed out]
<Ox0dea> All is well.
moeabdol has joined #ruby
<Ox0dea> `nil` is in fact an Object, with methods and a superclass and everything.
razorgfx has joined #ruby
whippythellama has quit [Quit: WeeChat 1.4]
IrishGringo has joined #ruby
<fartface> Sure, but is that how assert_equal is to be used?
<Ox0dea> Yes.
<fartface> Alright, cool! Thanks!
<Ox0dea> Sure thing.
<fartface> I figured there may be something like an assert_true or something
<Ox0dea> There is.
<fartface> Then why wouldn't they use assert_true?
<Ox0dea> But assert_equal is more suited to letting you fill in the blank.
<fartface> lol that makes sense
<fartface> OK, so then the next problem, assert_equal __, ex.class (about which exception has been caught)
makenoise has joined #ruby
snockerton has quit [Quit: Leaving.]
dlitvak has quit [Remote host closed the connection]
artX000 has joined #ruby
<Ox0dea> fartface: Look instead at the next assertion; how on earth are you supposed to predict the contents of the error message? :P
<fartface> Ah
<Ox0dea> Spoiler: you're not. The Koans are meant to induce you to experiment elsewhere.
<Ox0dea> In `irb`, for instance.
PsionTheory has quit [Remote host closed the connection]
atomical has joined #ruby
platzhirsch has quit [Ping timeout: 240 seconds]
<fartface> Hmm
duckpuppy has joined #ruby
<cscheib_> I didn't mess around with irb... but a lot of the time, you run something, it fails, and you fill in the blank with info you gained from the failure
<cscheib_> for the koans, that is
ur5us has quit [Remote host closed the connection]
<cscheib_> basically, you're not supposed to get it right the first time
snockerton has joined #ruby
<cscheib_> and it *is* susceptible to cheating, as you're only modifying assertions (most of the time)
<Ox0dea> That approach is less conducive to learning and retention.
<Ox0dea> It's only supposed to be a game secondarily to a learning tool.
<fartface> lol
dcunit3d has joined #ruby
<Ox0dea> The goal isn't to "win", it's to come out the other side knowing the fundamentals of Ruby.
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
fclausen has quit [Ping timeout: 272 seconds]
s00pcan has quit [Ping timeout: 240 seconds]
kiki_lam1 is now known as kiki_lamb
<fartface> So, I'm running the code, it's giving me an error, I see the line the error happens on, I see expected FILL ME IN (__) to equal NoMethodError. Running 1rb about_nil.rb` spits out the code I'm reading in Sublime anyway,
<cscheib_> most of the "koans" are simple concepts that get introduced, and the assertions are just to prove the point to you
graphettion has quit [Remote host closed the connection]
<Ox0dea> No, that's not right.
Jardayn has quit [Ping timeout: 272 seconds]
<Ox0dea> The assertions are for demonstrating your understanding to yourself.
guacamole has joined #ruby
<Ox0dea> fartface: Cheater!
<fartface> ?
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<fartface> I'm... doing what you told me to do?
<Ox0dea> I suggested irb.
<Ox0dea> Not running the koan so that it gives you the answer.
s00pcan has joined #ruby
<fartface> It didn't though
<Ox0dea> It did.
<fartface> This is all a bit too meta for me.
<fartface> lol
razorgfx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<fartface> I'm all for test driven development, I've seen the benefits it brings, but it's like giving an illiterate person an essay and asking them to proofread it.
sgambino has joined #ruby
<Ox0dea> > expected FILL ME IN (__) to equal NoMethodError
<fartface> Sure, so I set __ to NoMethodError
<fartface> And that didn't pass the test either
thejamespinto has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
<fartface> And if that sounds like a stupid thing to do, like I said, an illiterate person proof reading an essay
<cscheib_> you should probably gist your code and the output
<Ox0dea> >> nil.gibberish rescue $!.class # fartface
<ruby[bot]> Ox0dea: # => NoMethodError (https://eval.in/505517)
cdg has quit [Remote host closed the connection]
duckpuppy has quit [Ping timeout: 256 seconds]
snockerton has quit [Quit: Leaving.]
djellemah has joined #ruby
<fartface> So here's my thing--I get what you're trying to show me here--and, this is tough to say without sounding unappreciative, but as a question, if I'm not familiar with ruby syntax, isn't this a bit much to start with?
symm- has quit [Ping timeout: 250 seconds]
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
Spami_ has joined #ruby
harly has quit [Read error: Connection reset by peer]
thejamespinto has quit [Ping timeout: 256 seconds]
<fartface> Huh... maybe I *don't* get what you're trying to show me lol
<fartface> Like I said, I think this is a bit over my head.
harly has joined #ruby
<fartface> I'm going to go back to Ruby Monk.
howdoicomputer has joined #ruby
Jardayn has joined #ruby
Jardayn has quit [Remote host closed the connection]
Spami has quit [Ping timeout: 276 seconds]
harly has quit [Read error: Connection reset by peer]
volty has joined #ruby
sgambino has quit [Quit: Textual IRC Client: www.textualapp.com]
ltd has quit [Ping timeout: 244 seconds]
ltd has joined #ruby
goodroot has quit [Ping timeout: 265 seconds]
harly has joined #ruby
sftrabbit has joined #ruby
TomPeed has joined #ruby
<fartface> OK hold on a second. I think I understand what you were trying to tell me before now.
<fartface> So I go into irb, type in `puts nul.some_method`
<fartface> nil*
<fartface> Get an error, which is to be expected
Cyrus has quit [Quit: Leaving]
makenoise has quit []
guacamole has joined #ruby
<fartface> But is that error that I'm matching the assertion to an object, a string, like how would I even capture that error to assert equality
<fartface> Is that a stupid question? lol
maletor has joined #ruby
catt has joined #ruby
marienz has quit [Ping timeout: 624 seconds]
Serka has joined #ruby
sftrabbit has quit [Ping timeout: 276 seconds]
Serka has left #ruby [#ruby]
rtail has quit [Quit: Later]
scripore has joined #ruby
jam_ has joined #ruby
doublemalt_ has quit [Remote host closed the connection]
ferr has quit [Ping timeout: 256 seconds]
jam_ has quit [Ping timeout: 250 seconds]
catt has quit [Quit: leaving]
fartface has quit [Quit: Leaving]
spider-mario has quit [Remote host closed the connection]
<volty> sequel with sqlite, I need a hook (callback) on dataset change. is it implemented ?
Encapsulation has joined #ruby
hannelita has joined #ruby
benlieb has quit [Quit: benlieb]
haraoka has joined #ruby
duckpuppy has joined #ruby
Cyrus has joined #ruby
paradisaeidae has joined #ruby
northfurr has joined #ruby
lemur has joined #ruby
fsapo has quit [Remote host closed the connection]
Serka has joined #ruby
<Serka> CANAL DE YOUTUBE EN EXPANSION CON TUTORIAL DE COMO GANAR DINERO GRATIS CON APLICACION DE GOOGLE PLAY PUEDES COBRAR EL DINERO CON STEAM ,GOOGLE PLAY,PAYPAL,PLAY STORE,ETC (NO ES PARA HACERSE RICO PERO 10$ EN DOS SEMANAS LOS GANAS) NO TE OLVIDES DE SUSCRIBIRTE AL CANAL UN SALUDO A TODOS/AS(CUALQUIER DUDA ESCRIMIRME A MI CANAL (Http://sh.st/nBwwh)
<Radar> !mute Serka
Serka has left #ruby [#ruby]
<OS-18137> what a spamfag
defendguin has joined #ruby
lemur has quit [Ping timeout: 240 seconds]
marienz has joined #ruby
D9 has joined #ruby
User458764 has joined #ruby
<Ox0dea> >> require 'prime'; 18137.prime?
<ruby[bot]> Ox0dea: # => false (https://eval.in/505519)
nertzy2 has joined #ruby
InvGhost has quit [Ping timeout: 240 seconds]
guacamole has quit [Ping timeout: 272 seconds]
guacamol_ has joined #ruby
n_blownapart has quit [Remote host closed the connection]
finisherr has left #ruby [#ruby]
Ox0dea has quit [Ping timeout: 264 seconds]
jottr_ has joined #ruby
pietr0 has quit [Quit: pietr0]
podman has quit [Quit: Connection closed for inactivity]
arescorpio has joined #ruby
northfurr has quit [Quit: northfurr]
paradisaeidae has quit [Quit: ChatZilla 0.9.92 [Firefox 43.0.4/20160105164030]]
zeroDivisible has quit [Quit: WeeChat 1.3]
nanoz has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
fclausen has joined #ruby
InvGhost has joined #ruby
rkazak has joined #ruby
InvGhost has quit [Ping timeout: 240 seconds]
thejamespinto has joined #ruby
fclausen has quit [Read error: Connection reset by peer]
fclausen has joined #ruby
User458764 has joined #ruby
yqt has quit [Ping timeout: 276 seconds]
baweaver has quit [Remote host closed the connection]
thejamespinto has quit [Ping timeout: 245 seconds]
IrishGringo has quit [Ping timeout: 250 seconds]
janebootydoe has joined #ruby
duckpuppy has quit [Ping timeout: 265 seconds]
chipotle has quit [Quit: cheerio]
gbgdev has quit [Remote host closed the connection]
goodroot has joined #ruby
average has joined #ruby
<average> I was reading this issue.. https://github.com/rbenv/ruby-build/pull/860
Ebok has joined #ruby
<average> I think this is my favorite pastime now
<average> reading Github issues where people get emotional and like they fight for their right
bronson has joined #ruby
yeticry has joined #ruby
<average> it's awesome when you're not one of those people, it's super-fun to watch
northfurr has joined #ruby
pawnbox has joined #ruby
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mondok has quit [Ping timeout: 250 seconds]
northfurr has quit [Client Quit]
gix has quit [Ping timeout: 264 seconds]
marr has quit [Remote host closed the connection]
yeticry_ has quit [Ping timeout: 260 seconds]
goodroot has quit [Ping timeout: 265 seconds]
onlyme_ has joined #ruby
ajf- has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
<harly> "a release label is much like a domain name" uhhh.
volty has quit [Quit: Konversation terminated!]
<harly> the thread is funny. but that statement. i'd get in there and fight :)
pawnbox has quit [Ping timeout: 245 seconds]
nertzy2 has quit [Quit: This computer has gone to sleep]
gix has joined #ruby
howdoicomputer has quit [Ping timeout: 256 seconds]
northfurr has joined #ruby
griffindy has joined #ruby
mrsolo_ has joined #ruby
cicloid_ has joined #ruby
duckpuppy has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
northfurr has quit [Client Quit]
<Darmani> Questionnn
baweaver has joined #ruby
<Darmani> What do you guys do
<average> I do well
<Darmani> When you can't fucking think anymore.
cicloid has quit [Ping timeout: 260 seconds]
<average> Darmani: you can sleep for example
<Darmani> Lol I'm taking like a break tho
<Darmani> talking*
mfb2 has quit [Remote host closed the connection]
<average> harly: they are turning GH issues into a pugilistic parking lot where devs duke it out
northfurr has joined #ruby
<harly> lots of you should instead of why do you
cicloid has joined #ruby
<harly> did you read the continuation? the new thread that was created to "remove rubinius" :)
<average> harly: I'm going to now
<average> this is a true saga
cicloid has quit [Max SendQ exceeded]
cicloid has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<harly> there's some gold in there. you'll laugh. you'll cry. you'll cringe at exactly how recently the author waved his dick int he wind. it's brilliant.
cicloid_ has quit [Ping timeout: 240 seconds]
cicloid_ has joined #ruby
Ox0dea has joined #ruby
<average> Darmani: oh about your question "What do you guys do when you can't f****** think anymore". It's easy Darmani , you get into fights on github issues
northfurr has quit [Quit: northfurr]
duckpuppy has quit [Ping timeout: 272 seconds]
northfurr has joined #ruby
crankhar1er has quit [Quit: leaving]
crankharder has joined #ruby
cicloid has quit [Ping timeout: 264 seconds]
Spami_ has quit [Quit: This computer has gone to sleep]
<Darmani> average - Lmao
<Darmani> that's how you relax?
<Darmani> I don't know enough about programming to argue with anyone xD
bklane has joined #ruby
ur5us has joined #ruby
kalopsian has quit [Ping timeout: 240 seconds]
<average> Darmani: that's totally fine
<average> Darmani: you have your chance to insert yourself into the wonderful world of opensource street fighting https://github.com/rbenv/ruby-build/issues/862
<average> Darmani: so just grab a broken bottle, and go there and hit someone in the head
<harly> lol
<Darmani> average - lmao
<harly> or stand back, put your thumb on your nose, blow a raspberry and wiggle your fingers, like @strcmp did with "3) rubinius isn't used that much, i know 0 people who use it in production but i'm sure there's a few.
<harly> 4) for a toy for people to try, this seems like a lot of effort." :)
<harly> great thread, thanks average. subscribed. :)
paradisaeidae has joined #ruby
pawnbox has joined #ruby
<average> :)
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hannelita has quit [Remote host closed the connection]
bklane has quit [Ping timeout: 240 seconds]
mfb2 has joined #ruby
arlek has joined #ruby
pawnbox has quit [Ping timeout: 250 seconds]
goodroot has joined #ruby
jottr_ has quit [Ping timeout: 272 seconds]
mfb2 has quit [Remote host closed the connection]
nfk|laptop has joined #ruby
average has left #ruby [#ruby]
kalopsian has joined #ruby
passcod has quit [Remote host closed the connection]
vdamewood has quit [Ping timeout: 265 seconds]
<Radar> Darmani: I go 1) sleep (because it's amazing) 2) for a walk (because fresh air is good) 3) play video games
<Radar> There have been a number of problems I have solved in my sleep
stevemackinnon has quit [Remote host closed the connection]
<Darmani> Radar - You dream in Ruby? Lol
<Radar> Darmani: What are dreams if not hallucinations to prepare us for the harshness of the following day's reality?
bklane has joined #ruby
<Radar> Darmani: put another way: sometimes
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Darmani> Radar - So poetic. I almost shed a tear right there.
passcod has joined #ruby
cholq has joined #ruby
cholq has left #ruby [#ruby]
robbyoconnor has joined #ruby
ddv has quit [Ping timeout: 250 seconds]
bklane has quit [Remote host closed the connection]
onlyme_ has quit [Remote host closed the connection]
replay has quit []
razorgfx has joined #ruby
ddv has joined #ruby
northfurr has quit [Quit: northfurr]
northfurr has joined #ruby
jam_ has joined #ruby
<Ox0dea> A prevailing theory is that dreams are so weird because we're trying to interpret memories while they're being serialized/compressed.
<Ox0dea> That's not to say that we know overly much about the file formats involved.
frem has quit [Quit: Connection closed for inactivity]
<diegoviola> can you guys help me with this code please: https://gist.github.com/diegoviola/0b442c7166b6591a8af4
<diegoviola> I'm trying to decode that email properly
<diegoviola> rot11 exercise
<Ox0dea> What's "me contratagora" mean?
djellemah has quit [Read error: Connection timed out]
Arnvald has joined #ruby
northfurr has quit [Client Quit]
<diegoviola> hiremenow
chipotle has joined #ruby
<Ox0dea> Interesting.
stevemackinnon has joined #ruby
sneakerhax has quit [Quit: Leaving]
<Ox0dea> diegoviola: You just need `rotate(-shift)`, I think.
<havenwood> diegoviola: How does this cypher expect you to treat numbers and symbols?
<diegoviola> I already rotated the string, but the numbers and @ and dots is not coming in
<Ox0dea> Oh, never mind. The problem is that you're rotating non-alphabetic characters.
<baweaver> Is this an interview question?
Arnvald has quit [Remote host closed the connection]
<Ox0dea> diegoviola: Do you know how #fetch works?
<diegoviola> more like for sending my CV, but I can already hear you won't help me
<Ox0dea> Calm down.
<diegoviola> ok sorry
<Ox0dea> The second argument to #fetch is the value to use if the key isn't found.
<Ox0dea> You're passing " " and ignoring the actual character you've got.
<havenwood> diegoviola: Instead of `" "` to put blank spaces in if the fetched key isn't present, what do you want to actually be that second argument?
Arnvald has joined #ruby
<diegoviola> I just want the symbols to stay as they are in the original string
zambini has quit [Quit: Leaving.]
<Radar> diegoviola: I think it's dishonest of you to get help from this channel with what is effectively a job application process.
<Radar> diegoviola: The company is hiring you. Not the #ruby channel.
iateadonut has joined #ruby
<havenwood> Though the #ruby channel is a compelling applicant!
<Radar> "None of us is as stupid as all of us" - channel motto
<Radar> (I kid, I kid)
<diegoviola> you're right
<Radar> When I have a HTTParty::Response object, is there a way to get the HTTP status code like "404 Not Found"? I've found #code which'll give me 404, but I want "404 Not Found" specifically.
<baweaver> radar s/is/are/
<Radar> baweaver: Maybe it was intentional? ;)
maletor has quit [Quit: Computer has gone to sleep.]
<baweaver> heresy
dlitvak has joined #ruby
<diegoviola> but I don't think I'll get hired anyway
<diegoviola> it's a php position
<baweaver> Radar: short of a response table, no clue.
<baweaver> eg: {404 => 'Not Found' ...}
s00pcan has quit [Remote host closed the connection]
<Radar> baweaver: yeah that's what I'm thinking.
<Ox0dea> Channel song: https://youtu.be/j-fWDrZSiZs?t=45
rsc___ has joined #ruby
<baweaver> if there's a builtin I can't find it from a cursory search at least
<Radar> thanks baweaver
<baweaver> might make a PR for fun
s00pcan has joined #ruby
<baweaver> make SURE to include the most important one of all though
<baweaver> 418
<Ox0dea> >> require 'webrick'; WEBrick::HTTPStatus::StatusMessage[404] # Radar
<ruby[bot]> Ox0dea: # => (https://eval.in/505530)
<baweaver> potentially interesting
<Radar> hax
auzty has joined #ruby
<Ox0dea> There we go: https://eval.in/505534
<Ox0dea> No need to bring in the whole library.
<Ox0dea> It's missing 418. :(
<baweaver> indeed
<baweaver> for shame
<Ox0dea> Never mind, Radar. WEBrick a shit.
<baweaver> agreed
zambini has joined #ruby
duckpuppy has joined #ruby
Rodya_ has joined #ruby
|ifei5g00d has joined #ruby
djellemah has joined #ruby
Rodya_ has quit [Remote host closed the connection]
guacamol_ has quit [Quit: Textual IRC Client: www.textualapp.com]
|ifei5g00d has quit [Remote host closed the connection]
sakix has joined #ruby
kobain has quit [Ping timeout: 240 seconds]
shadoi has quit [Quit: Leaving.]
|ifei5g00d has joined #ruby
zambini has quit [Ping timeout: 245 seconds]
goodroot has quit [Ping timeout: 250 seconds]
duckpuppy has quit [Ping timeout: 250 seconds]
tvw has quit [Ping timeout: 264 seconds]
<havenwood> >> code = 404; Net::HTTPResponse::CODE_TO_OBJ[code.to_s].name.sub('Net::HTTP', '').gsub(/([[:lower:]])([[:upper:]])/, '\1 \2')
<ruby[bot]> havenwood: # => uninitialized constant Net (NameError) ...check link for more (https://eval.in/505543)
<havenwood> Well, anyways. >.>
<Radar> Ok that's just crazy. Don't you people have jobs to do?
<havenwood> Hollywood Ruby meetup in 5 min!
djbkd has quit [Quit: My people need me...]
<havenwood> >> require 'net/http'; code = 417; Net::HTTPResponse::CODE_TO_OBJ[code.to_s].name.sub('Net::HTTP', '').gsub(/([[:lower:]])([[:upper:]])/, '\1 \2')
<ruby[bot]> havenwood: # => "Expectation Failed" (https://eval.in/505544)
lemur has joined #ruby
* havenwood bides time
razorgfx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
LMity has joined #ruby
<havenwood> TIL Net::HTTP Response doesn't support teapots.
Kryptonical has quit [Read error: Connection reset by peer]
Kryptonical has joined #ruby
<diegoviola> I found the solution to my problem: https://gist.github.com/diegoviola/0b442c7166b6591a8af4
<diegoviola> ty
razorgfx has joined #ruby
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood> diegoviola: gj
kobain has joined #ruby
<diegoviola> not that I want to work there anyway, I hope you didn't notice the domain name
<Radar> Noticed and logged for all time.
TomPeed has joined #ruby
<diegoviola> :P
shinnya has quit [Ping timeout: 265 seconds]
<Ox0dea> How to confirm the primality of 2 ** 74_207_281 - 1 with Ruby?
<Ox0dea> Can't do it without BigDecimal, and BigDecimal doesn't have #prime?.
<diegoviola> Radar: logged?
<Radar> diegoviola: I have a log of every message you've ever sent to #ruby or #rubyonrails since 2012-09-01
<Ox0dea> Radar: Would you like to fix that?
<diegoviola> Radar: that's fine, but not very ethical
lemur has quit [Ping timeout: 250 seconds]
<Radar> diegoviola: Why thank you.
<Ox0dea> whitequark's goes back to 2011-11-16 if you want 'em.
<Radar> meh, it's not that big of a deal to not have them
<Radar> unless you can give me them in a very particular SQL format
Darmani has quit [Ping timeout: 252 seconds]
<Ox0dea> Eh, it's a TSV.
<Radar> Or CSV, I guess.
<Radar> TSV works.
<Radar> Where can I find them?
<Ox0dea> They're over here.
mfb2 has joined #ruby
<bnagy> prime? is a toy anyway
pawnbox has joined #ruby
<bnagy> otherwise maybe the openssl bindings o_0
<Radar> bbl
<Ox0dea> bnagy: The new Mersenne prime is >22m digits in length. I think I'm just gonna have to trust them.
mfb2 has quit [Ping timeout: 245 seconds]
victortyau has quit [Quit: Textual IRC Client: www.textualapp.com]
joneshf-laptop has joined #ruby
<bnagy> oh there's a thing just for mersennes
<bnagy> but it would still be a pain, yeah
hannelita has joined #ruby
maletor has joined #ruby
mrsolo_ has quit [Quit: This computer has gone to sleep]
pawnbox has quit [Ping timeout: 276 seconds]
thejamespinto has joined #ruby
<bnagy> oh wait maybe that's a sieve https://en.wikipedia.org/wiki/Lucas%E2%80%93Lehmer_primality_test miller-rabin is probably still better for a given number
fclausen has quit [Ping timeout: 272 seconds]
dlitvak has quit [Remote host closed the connection]
<bnagy> nope, LLT is better
<bnagy> how does math
fclausen has joined #ruby
hannelita has quit [Ping timeout: 240 seconds]
thejamespinto has quit [Ping timeout: 264 seconds]
redtail has joined #ruby
newbie22 has joined #ruby
Ebok has joined #ruby
newbie22 has quit [Client Quit]
Mon_Ouie has quit [Quit: WeeChat 1.3]
floatingpoint has joined #ruby
hxegon has quit [Ping timeout: 264 seconds]
Sucks has quit [Ping timeout: 250 seconds]
jbrhbr has quit [Ping timeout: 264 seconds]
tvw has joined #ruby
dlitvak has joined #ruby
rsc___ has quit [Quit: rsc___]
kobain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
Sucks has joined #ruby
redtail has quit [Quit: Textual IRC Client: www.textualapp.com]
arthropododo has quit [Quit: Page closed]
rtail has joined #ruby
rtail has quit [Client Quit]
c355e3b has quit [Quit: Connection closed for inactivity]
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has quit [Ping timeout: 276 seconds]
baweaver has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Sucks has quit [Ping timeout: 250 seconds]
goodroot has joined #ruby
_fumk is now known as fumk
redtail has joined #ruby
razorgfx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tinnvec has quit [Remote host closed the connection]
tvw has quit [Ping timeout: 245 seconds]
Rodya_ has quit [Remote host closed the connection]
domgetter has joined #ruby
janebootydoe has quit [Quit: Leaving]
Sucks has joined #ruby
Rodya_ has joined #ruby
IrishGringo has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Musashi007 has joined #ruby
nanoz has quit [Quit: <3]
confounds has joined #ruby
sakix has quit [Ping timeout: 276 seconds]
Musashi007 has quit [Client Quit]
thejamespinto has joined #ruby
chipotle has quit [Quit: cheerio]
mebymyself has joined #ruby
pawnbox has joined #ruby
mebymyself has quit [Ping timeout: 252 seconds]
hnagamin has quit [Ping timeout: 240 seconds]
cbyrda has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 240 seconds]
Dimik is now known as asas
asas is now known as Dimik
Arnvald_ has joined #ruby
Arnvald has quit [Read error: Connection reset by peer]
framling has joined #ruby
pawnbox has joined #ruby
AMERICAN_PSYCHO has joined #ruby
davedev24 has quit [Remote host closed the connection]
IrishGringo has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Remote host closed the connection]
LMity has quit [Ping timeout: 240 seconds]
Lucky__ has joined #ruby
mrsolo_ has joined #ruby
ccaffeini has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
solocshaw has quit [Ping timeout: 276 seconds]
dfockler has quit [Ping timeout: 250 seconds]
rkazak has quit [Quit: Sleep.....ing....]
braincrash has quit [Quit: bye bye]
nfk|laptop has quit [Read error: Connection reset by peer]
User458764 has joined #ruby
tildes has joined #ruby
hannelita has joined #ruby
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has joined #ruby
Sucks has quit [Read error: Connection reset by peer]
arlek has quit [Ping timeout: 276 seconds]
pilne has quit [Quit: Quitting]
zast has joined #ruby
araujo_ has joined #ruby
vikas027 has joined #ruby
ccaffeini has joined #ruby
hannelita has quit [Ping timeout: 240 seconds]
<vikas027> Hello Everyone, I have an Array https://dpaste.de/962k named 'myarray', how can I search an item from it, something like myarray[last_notified] which prints nil or myarray[name] which prints hellome
freerobby has joined #ruby
<vikas027> This is the output of 'pp'
tinnvec has joined #ruby
dlitvak has quit [Ping timeout: 265 seconds]
araujo has quit [Ping timeout: 276 seconds]
<Ox0dea> vikas027: This is an Array containing a Hash.
<Radar> vikas027: .detect
arup_r has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
tinnvec has quit [Client Quit]
tinnvec has joined #ruby
<Ox0dea> vikas027: You want myarray[0]['name'], but better would be to fix the weirdness of your data.
braincrash has joined #ruby
howdoi has joined #ruby
rkazak has joined #ruby
roshanavand has joined #ruby
<vikas027> Ox0dea: Thanks, that is what I had tried. It did not worked on irb, but now after I exit and tried again, it worked. Not sure what happened :|
tinnvec has quit [Remote host closed the connection]
tinnvec has joined #ruby
<Radar> Praise be to Ox0dea.
<vikas027> Ox0dea: And that weird Array is coming from DynamoDB Table
tinnvec has quit [Remote host closed the connection]
tinnvec has joined #ruby
cajone has left #ruby [#ruby]
roshanavand has quit [Ping timeout: 240 seconds]
cbyrda has quit [Quit: Gone]
<Ox0dea> vikas027: Ah, fair enough. So it might be the case that you'll receive several records, right?
<vikas027> Ox0dea: yes
tinnvec has quit [Remote host closed the connection]
<Ox0dea> vikas027: Then you'll probably want #map.
<Ox0dea> `myarray.map { |hash| hash['name'] }` or the like.
tinnvec has joined #ruby
tinnvec has quit [Remote host closed the connection]
<vikas027> Ox0dea: Nice, I am trying that. I have just figured out that the class is actually not Array. It is Seahorse::Client::Response
tinnvec has joined #ruby
tinnvec has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 264 seconds]
Arnvald_ has quit [Read error: Connection reset by peer]
tinnvec has joined #ruby
<vikas027> Ox0dea: Map is working perfectly. Thank you
rsc___ has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Arnvald has joined #ruby
<Ox0dea> vikas027: Yay! :) Happy to help.
<Ox0dea> Be advised that there might be something a little more specialized for Seahorse in particular if you end up needing a fancier transformation.
hxegon has joined #ruby
<vikas027> Ox0dea: Yeah, I am using a ruby gem to talk to DynamoDB. Fanciness is expected :)
cajone has joined #ruby
mrsolo_ has quit [Quit: This computer has gone to sleep]
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackgoat has quit [Ping timeout: 250 seconds]
mrsolo_ has joined #ruby
skcin7 has joined #ruby
tjbiddle has joined #ruby
tinnvec has quit [Remote host closed the connection]
OS-18137 has quit [Quit: leaving]
tinnvec has joined #ruby
bronson has joined #ruby
devbug has joined #ruby
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AMERICAN_PSYCHO has quit [Read error: Connection reset by peer]
crdpink has joined #ruby
crdpink2 has quit [Ping timeout: 260 seconds]
akem has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
waka has joined #ruby
hnagamin has joined #ruby
robbyoconnor has quit [Quit: Konversation terminated!]
kalopsian has quit [Ping timeout: 276 seconds]
JohnT has joined #ruby
djellemah has quit [Read error: Connection timed out]
sneakerhax has joined #ruby
redtail has quit [Read error: Connection reset by peer]
baweaver has joined #ruby
Sembei has joined #ruby
bMalum has joined #ruby
gix has quit [Ping timeout: 260 seconds]
bMalum has quit [Client Quit]
rtail has joined #ruby
razorgfx has joined #ruby
duckpuppy has joined #ruby
mrsolo_ has quit [Quit: This computer has gone to sleep]
Pisuke has quit [Ping timeout: 272 seconds]
Arnvald has quit [Remote host closed the connection]
dfinninger has joined #ruby
<pizzaops> If I'm crafting an somearray.select and I know it's always going to return an array with just one item, and all I really want is that actual object, not the array, is there a more "elegant" way to accomplish that then just pairing select with .first?
<Radar> pizzaops: .detect
<pizzaops> E.g. something like .select_and_return_first
<Radar> pizzaops: or .find if you want a shorter version
<pizzaops> Radar: that's perfect! Thanks!
freerobby has quit [Quit: Leaving.]
<pizzaops> Radar: are .find and .detect aliases?
<pizzaops> From the docs it looks like they are.
<Radar> pizzaops: yes
<pizzaops> Is one of them the "not-alias" name of the method?
<Ox0dea> Nah.
confounds has quit []
<pizzaops> lolz, k
<Ox0dea> At least, there's no reason for that to matter.
<Ox0dea> But the C function is called enum_find().
<pizzaops> ah.
<pizzaops> That's funny since the example for #find uses .detect
<Radar> it uses both
gix has joined #ruby
<Ox0dea> I use #select and #find; I bet there's some weirdo that uses #find_all and #detect.
<Radar> I use #select + #detect
wilbert_ has joined #ruby
duckpuppy has quit [Ping timeout: 264 seconds]
rkazak has quit [Quit: Sleep.....ing....]
<Ox0dea> Hmm.
<pizzaops> I hear the word "select" used to describe that functionality more often than "find_all", so I'll just stick wit that.
<pizzaops> And for find vs. detect, I've seen find all over in code but never had to look it up, so I'll stick with that, if for no other reason than my coworkers seem to be used to it.
<Ox0dea> Sanity prevails!
<pizzaops> Although #detect sounds cooler :D
<Ox0dea> >> inspect or gadget
<ruby[bot]> Ox0dea: # => "main" (https://eval.in/505572)
<Ox0dea> That's funnier than I expected.
<pizzaops> haha
<pizzaops> Welp, back to the vSphere API. . .or as I call it. . .the VMnomicon. . .
dlitvak has joined #ruby
<pizzaops> Using the vSphere SOAP API: Just as complicated as raising the dead, and with the same odds of success!
<Ox0dea> Catchy.
djellemah has joined #ruby
pawnbox has quit [Remote host closed the connection]
Ebok has joined #ruby
terminalrecluse has joined #ruby
<Radar> pizzaops: You might want to make sure that that .find call isn't Model.find, which is different to [].find
<pizzaops> I'm calling find on an array
astrobunny has joined #ruby
<pizzaops> Radar: Model is a rails thing right? As in MVC? This isn't rails just pure ruby.
<pizzaops> It's not even a web application.
<Radar> pizzaops: yeah, it's from Rails
<Radar> Right then.
<pizzaops> Ah ok. There's zero chance of that then.
<pizzaops> I'm working on a Puppet type and provider. Just happens to require ruby.
dfinninger has quit [Remote host closed the connection]
martinliu has joined #ruby
<pizzaops> Thanks for you help folks!
dlitvak has quit [Ping timeout: 272 seconds]
Arnvald has joined #ruby
arescorpio has quit [Quit: Leaving.]
arup_r has quit [Remote host closed the connection]
saneax_AFK is now known as saneax
saneax is now known as Guest77345
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ebok has joined #ruby
hannelita has joined #ruby
chouhoulis has quit [Remote host closed the connection]
tjohnson has quit [Quit: Connection closed for inactivity]
hannelita has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
Eiam_ has joined #ruby
dcunit3d has quit [Ping timeout: 245 seconds]
dcunit3d has joined #ruby
djellemah has quit [Read error: Connection timed out]
razorgfx has quit [Read error: Connection reset by peer]
<domgetter> I'm getting "ERROR: Failed to build gem native extension." when trying to gem install curses on Ubuntu 14.04 with rvm and Ruby-2.2.3 Any ideas?
rsc___ has quit [Quit: rsc___]
hayden_ has quit [Quit: Connection closed for inactivity]
sigurding has joined #ruby
AlecTaylor has joined #ruby
<AlecTaylor> hi
<AlecTaylor> How do I hide specific warnings in Ruby 2.3?
tjbiddle has quit [Quit: tjbiddle]
<domgetter> AlecTaylor which warning?
tjbiddle has joined #ruby
thejamespinto has quit []
chipotle has joined #ruby
pwnd_nsfw` has joined #ruby
tjbiddle has quit [Client Quit]
<Ox0dea> domgetter: Could you post the error output?
pwnd_nsfw has quit [Ping timeout: 250 seconds]
techsethi has joined #ruby
arup_r has joined #ruby
speaking1ode has quit [Ping timeout: 265 seconds]
hxegon is now known as hxegon_AFK
hxegon_AFK is now known as hxegon
speaking1ode has joined #ruby
RobertBirnie has joined #ruby
RobertBirnie has quit [Excess Flood]
djellemah has joined #ruby
bronson has joined #ruby
KnownSyntax has quit [Read error: Connection reset by peer]
dlitvak has joined #ruby
<Ox0dea> domgetter: apt-get install build-essential
<domgetter> Ox0dea: build-essential is already the newest version.
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<Ox0dea> Er... it has a version?
<Ox0dea> It's supposed to be a metapackage, I thought.
bronson has quit [Ping timeout: 265 seconds]
<domgetter> that was the output from apt-get install
techsethi has quit [Ping timeout: 260 seconds]
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
KnownSyntax has joined #ruby
dlitvak has quit [Ping timeout: 250 seconds]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
krz has joined #ruby
djbkd has joined #ruby
bluOxigen has joined #ruby
astrobunny has quit [Remote host closed the connection]
hxegon has quit [Quit: BRB]
<domgetter> Ox0dea: I'll have to try tomorrow, thanks though
chipotle has quit [Quit: cheerio]
domgetter has quit []
bluOxigen_ has quit [Ping timeout: 250 seconds]
last_staff has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
waka has quit [Remote host closed the connection]
Cohedrin has joined #ruby
astrobunny has joined #ruby
djellemah has quit [Read error: Connection timed out]
<Ox0dea> AlecTaylor: Still about?
armyriad has quit [Ping timeout: 264 seconds]
altu1nsf0llow3r has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
katiej has joined #ruby
aryaching_ has quit [Ping timeout: 256 seconds]
armyriad has joined #ruby
<katiej> Hi - Can someone help me with Validation - one of my controllers is failing due to validation - but there's nothing set in the model
<katiej> Where else would a validation rule be?
sigurding has quit [Quit: sigurding]
<Radar> katiej: !code
<Radar> ?code katiej
<ruby[bot]> katiej: We can't help you without your code, please post it to https://gist.github.com
<katiej> ok one sec
vikas027 has quit [Ping timeout: 252 seconds]
ruby-lang470 has joined #ruby
<ruby-lang470> hi
<Radar> Why is this included?
skade has joined #ruby
<katiej> From the documentation I thought it was needed for the Validates rules
<Radar> No, you don't need to include that at all. ActiveRecord::Base includes everything that you need.
<ruby-lang470> can someone help me integrate the api from "wine.com" into my rails app
<ruby-lang470> now sure how to do it
<katiej> Oh - every example iw as looking at had it
<Radar> katiej: Including the official validations guide? http://guides.rubyonrails.org/active_record_validations.html
<katiej> I get the same error with that commented out
<Radar> katiej: Can you put this app on GitHub so that I can take a look?
<Radar> ruby-lang470: What have you tried so far?
fclausen has quit [Ping timeout: 272 seconds]
<katiej> I have passwords and company info in it at the moment so can't post it all publicly
<katiej> is there anything in particular I could show that'd help?
<Radar> Normally I'd ask for the model and the controller, but the model's been shown
<Radar> controller probably doesn't have anything in it
<AlecTaylor> Ox0dea: Yeah, nevermind, solution is sed
skade has quit [Read error: Connection reset by peer]
<Radar> katiej: Is that everything in your Ticket model that you're showing there?
<katiej> yep
<Ox0dea> AlecTaylor: Are you sure?
safe has joined #ruby
skade has joined #ruby
altu1nsf0llow3r has quit [Read error: Connection reset by peer]
<katiej> I can post the Ticket controller one sec
<Radar> katiej: Yeah then I'm not sure.
<Radar> katiej: Please try to reproduce this in a new Rails app and let me know if you can,.
chipotle has joined #ruby
<Ox0dea> AlecTaylor: Well, if you ever need to suppress specific warnings from Ruby-land: https://eval.in/505606
<Radar> katiej: Seems stock standard. Yeah, I'm out of ideas.
<katiej> Radar: I even tried to explicitly set Numericality to false but it still is saying it must be a number
tmtwd has joined #ruby
xet7 has quit [Quit: Leaving]
ur5us has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
Waheedi has joined #ruby
chouhoulis has joined #ruby
djellemah has joined #ruby
<katiej> Radar: Aha!
<Radar> katiej: what's up?
<katiej> Radar: did a rake db:reset and issue seems resolved
<katiej> no idea why..though
<Radar> katiej: that is extremely weird.
<Radar> katiej: Were those validations ever in the model?
<katiej> if you set a validation in testing..do you have to reset db if you remove it?
<katiej> maybe during testing
<Radar> Right. So what you've done is restart your Rails console and that's what fixed it because it reloaded the code.
mkosaki has quit [Ping timeout: 276 seconds]
<katiej> i tried restarting both server and console prior but that didn't fix
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rsc___ has joined #ruby
ascarter_ has joined #ruby
AlecTaylor has quit [Quit: Leaving]
waka has joined #ruby
<Radar> ok
<Radar> let's just put it down to computer gremlins and leave it at that
<katiej> ¯\_(ツ)_/¯
katiej is now known as scubawill
<scubawill> dont know who katiej is
chouhoulis has quit [Ping timeout: 272 seconds]
<Radar> scubawill: You don't?
xet7 has joined #ruby
<scubawill> nope maybe a random generated on the webclient i picked
<Radar> Thought it was a Friday night persona.
hakunin has quit [Ping timeout: 264 seconds]
<Radar> I tease I tease.
ur5us has joined #ruby
pawnbox has joined #ruby
ascarter has quit [Ping timeout: 276 seconds]
<scubawill> haha
hakunin has joined #ruby
<scubawill> this is my first ruby app but that one had me stumped for a bit
jam_ has quit [Remote host closed the connection]
zast has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
duckpuppy has joined #ruby
ascarter_ has quit [Ping timeout: 272 seconds]
pawnbox has quit [Remote host closed the connection]
hnagamin has quit [Ping timeout: 272 seconds]
lemur has joined #ruby
dionysus69 has joined #ruby
duckpuppy has quit [Ping timeout: 250 seconds]
chipotle has quit [Quit: cheerio]
dseitz has joined #ruby
ur5us has joined #ruby
darkf has joined #ruby
dionysus69 has quit [Client Quit]
lemur has quit [Ping timeout: 250 seconds]
dionysus69 has joined #ruby
ur5us_ has joined #ruby
ur5us has quit [Read error: No route to host]
djellemah has quit [Read error: Connection timed out]
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby
sigurding has joined #ruby
razorgfx has joined #ruby
krz has quit [Ping timeout: 272 seconds]
chipotle has joined #ruby
waka has quit [Read error: Connection reset by peer]
skade has quit [Client Quit]
agit0 has joined #ruby
tildes has quit [Ping timeout: 256 seconds]
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tildes has joined #ruby
ruby-lang470 has quit [Ping timeout: 252 seconds]
amoeba has quit [Quit: Leaving]
tildes has quit [Ping timeout: 265 seconds]
JohnT has joined #ruby
hannelita has joined #ruby
sigurding_ has joined #ruby
<martinliu> hello
krz has joined #ruby
hnagamin has joined #ruby
<havenwood> martinliu: hi
lxsameer has joined #ruby
safe has quit [Read error: Connection reset by peer]
djellemah has joined #ruby
sigurding has quit [Ping timeout: 272 seconds]
sigurding_ is now known as sigurding
hannelita has quit [Ping timeout: 240 seconds]
rippa has joined #ruby
martinliu has quit [Quit: Leaving]
aganov has joined #ruby
tmtwd has quit [Ping timeout: 265 seconds]
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
martinliu has joined #ruby
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
chipotle has quit [Quit: cheerio]
chipotle has joined #ruby
waka has joined #ruby
karapetyan has joined #ruby
x0f_ has joined #ruby
razorgfx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
atmosx has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
djellemah has quit [Read error: Connection timed out]
x0f has quit [Ping timeout: 240 seconds]
amclain has quit [Quit: Leaving]
Waheedi has quit [Quit: Waheedi]
pawnbox has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
arup_r has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 250 seconds]
dcunit3d has quit [Ping timeout: 245 seconds]
moeabdol has joined #ruby
yardenbar has joined #ruby
anisha_ has joined #ruby
BrunoSaboia has joined #ruby
kp666 has joined #ruby
codecop has joined #ruby
arup_r has joined #ruby
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
BSaboia has quit [Ping timeout: 265 seconds]
moeabdol has quit [Ping timeout: 276 seconds]
chipotle has quit [Quit: cheerio]
chipotle has joined #ruby
Waheedi has joined #ruby
einarj has joined #ruby
solars has joined #ruby
ascarter has joined #ruby
troulouliou_div2 has joined #ruby
Waheedi has quit [Client Quit]
chouhoulis has quit [Ping timeout: 260 seconds]
dcunit3d has joined #ruby
paradisaeidae has left #ruby [#ruby]
djellemah has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
scubawill has quit [Ping timeout: 252 seconds]
duckpuppy has joined #ruby
jackcom has joined #ruby
jackcom was kicked from #ruby by ChanServ [Banned: trolling]
dn` has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
jbrhbr has joined #ruby
astrobunny has joined #ruby
pawnbox has quit [Remote host closed the connection]
PaulCapestany has quit [Quit: .]
eowpows has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
<eowpows> Why does each_cons method in Enumerable class return nil at the end?
ss_much has quit [Quit: Connection closed for inactivity]
djbkd has quit [Remote host closed the connection]
duckpuppy has quit [Ping timeout: 276 seconds]
wilbert_ has quit [Ping timeout: 240 seconds]
<Ox0dea> eowpows: Could you clarify?
rtail has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
PaulCapestany has joined #ruby
Burgestrand has joined #ruby
<Ox0dea> Oh, #each_cons with a block; yeah, I don't see why it shouldn't return the receiver like #each does.
<eowpows> Ox0dea: What I'm trying to do is check a given array's elements wether it's continuous based on the range set? https://gist.github.com/dean-gr/1e6ff0bf9090f4d8043e
lxsameer has joined #ruby
<eowpows> Something like that.
chipotle has quit [Quit: cheerio]
bklane has joined #ruby
Arnvald has quit [Read error: Connection reset by peer]
Arnvald_ has joined #ruby
<eowpows> I want to get the `true` value from `p c == input` with that specific input and range in mind in the gist. Of course if the input is `[1, 3, 4]`. It should return false.
Waheedi has joined #ruby
Arnvald_ has quit [Read error: Connection reset by peer]
Arnvald has joined #ruby
<apeiros> *backlog #ruby 40
<apeiros> whoops
<ljarvis> eowpows: use any?
<Ox0dea> eowpows: For that you'll want `range.each_cons(input.size).any? { |c| c == input }`.
* ljarvis pow
<Ox0dea> It's still not entirely clear why, though. :P
sakix has joined #ruby
bronson has joined #ruby
rkazak has joined #ruby
<eowpows> Hmmmnnn. Alright. I'll try. Thanks. Updated my gist too. Added example inputs and outputs. If you have time, you could check it again. :)
ascarter has quit [Ping timeout: 240 seconds]
Waheedi has quit [Ping timeout: 276 seconds]
BTRE has quit [Quit: Leaving]
<Ox0dea> It's clear you're wanting to check for continuity; what's the other stipulation? Why (0..6)?
Waheedi has joined #ruby
<eowpows> ljarvis: It checks out. Thanks. :)
ascarter has joined #ruby
vdamewood has joined #ruby
arlek has joined #ruby
<eowpows> Ox0dea: Oh. It's for the days of the week. Whether if a person's schedule is from M to F, continously or MWF. :)
bronson has quit [Ping timeout: 265 seconds]
firstdayonthejob has joined #ruby
ascarter has quit [Max SendQ exceeded]
<Ox0dea> eowpows: I see. Still not sure about the 6, though.
<eowpows> Ummm. 0..6 is the numerical representation for the days of the week.
<Ox0dea> Aye, and 6 is Saturday.
chihhsin has quit [Remote host closed the connection]
gagrio has joined #ruby
Waheedi has quit [Ping timeout: 240 seconds]
<eowpows> Ox0dea: Yes. You're correct.
<ljarvis> that'll include Sunday too?
yfeldblum has quit [Remote host closed the connection]
<eowpows> ljarvis: Yep.
<eowpows> ljarvis: I actually had `any` in my irb console written already. Way too much info by reading the classes so I just stopped. Haha.
<eowpows> Then asked here.
Waheedi has joined #ruby
jas02 has joined #ruby
lyoshajapan has joined #ruby
chipotle has joined #ruby
<ljarvis> :)
rkazak has quit [Quit: Sleep.....ing....]
<Ox0dea> eowpows: For future reference, here's a pretty solid definition of #continuous?: https://eval.in/505648
bklane has quit [Read error: Connection reset by peer]
<Ox0dea> It relies on #succ rather than #pred since not all Enumerable respond to the latter.
<Ox0dea> >> ObjectSpace.each_object(Class).select { |c| m = c.instance_methods; m.include?(:succ) unless m.include?(:pred) }
<ruby[bot]> Ox0dea: # => [Time, Symbol, String] (https://eval.in/505649)
baweaver has quit [Remote host closed the connection]
<eowpows> Ox0dea: Thanks. This will be useful. I didn't know about the #succ method.
<Ox0dea> eowpows: It's like +1 for the general case. :P
<Ox0dea> >> 'Happy to helo'.succ
<ruby[bot]> Ox0dea: # => "Happy to help" (https://eval.in/505651)
Waheedi has quit [Ping timeout: 240 seconds]
bklane_ has joined #ruby
<eowpows> Ox0dea: What class does the #succ method belong?
Rinalds has joined #ruby
<Ox0dea> eowpows: It's class-dependent, of course.
<Ox0dea> Fixnum#succ is very different from String#succ.
<eowpows> Ox0dea: I see. Thanks. I learned something new today. :)
<Ox0dea> ^_^
rkazak has joined #ruby
<eowpows> Here's to hoping everything will be built in Ruby someday. Haha. It's such a fun language to code in. :D
blackms has joined #ruby
deweysdecimal has joined #ruby
ta has quit [Remote host closed the connection]
stevemackinnon has quit [Remote host closed the connection]
<Ox0dea> Hear, hear!
<ljarvis> I hope not! (but agree it's very fun)
Waheedi has joined #ruby
chipotle has quit [Quit: cheerio]
<Ox0dea> eowpows: More fun with #succ: https://eval.in/505653
lyoshajapan has quit [Remote host closed the connection]
<Ox0dea> You get to decide how your objects behave in Ranges.
<Ox0dea> Ruby = <3
sakix has quit [Ping timeout: 240 seconds]
lyoshajapan has joined #ruby
Bloomer has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Waheedi has quit [Client Quit]
x77686d has quit [Quit: x77686d]
djbkd has joined #ruby
x77686d has joined #ruby
Burgestrand has joined #ruby
skade has joined #ruby
x77686d has quit [Client Quit]
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ebok has joined #ruby
chipotle has joined #ruby
pawnbox has joined #ruby
moeabdol has joined #ruby
deweysdecimal has quit [Quit: Textual IRC Client: www.textualapp.com]
ascarter has joined #ruby
bklane_ has quit [Remote host closed the connection]
chihhsin has joined #ruby
razorgfx has joined #ruby
cpup has quit [Ping timeout: 260 seconds]
edwinvdgraaf has joined #ruby
TomyWork has joined #ruby
jgt has joined #ruby
eowpows has quit [Quit: Page closed]
chouhoulis has joined #ruby
cpup has joined #ruby
moeabdol has quit [Ping timeout: 260 seconds]
DirtyFinn has joined #ruby
blackms has quit [Ping timeout: 276 seconds]
quazimodo has quit [Ping timeout: 250 seconds]
mark2 has joined #ruby
ascarter has quit [Max SendQ exceeded]
curses has joined #ruby
usershell has joined #ruby
ta has joined #ruby
antgel has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
chipotle has quit [Quit: cheerio]
jam_ has joined #ruby
Dimik has quit [Ping timeout: 256 seconds]
Guest77345 is now known as saneax_AFK
skcin7 has joined #ruby
razorgfx has quit [Ping timeout: 272 seconds]
aufi has joined #ruby
jam_ has quit [Ping timeout: 245 seconds]
BTRE has joined #ruby
sonne_ is now known as sonne
sonne has quit [Changing host]
sonne has joined #ruby
arup_r has quit []
blackms has joined #ruby
craigp has joined #ruby
djbkd has quit [Remote host closed the connection]
craigp has quit [Remote host closed the connection]
jbrhbr has quit [Quit: Leaving.]
djbkd has joined #ruby
lyoshajapan has quit [Remote host closed the connection]
PedramT has joined #ruby
ascarter has joined #ruby
r4um has joined #ruby
User458764 has joined #ruby
juddey has quit [Ping timeout: 250 seconds]
mondok has joined #ruby
GammaZeSioux has quit [Remote host closed the connection]
djbkd has quit [Ping timeout: 276 seconds]
anisha_ has quit [Quit: Leaving]
sandstrom has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
SenpaiSilver has quit [Quit: Leaving]
skcin7 has quit [Read error: Connection reset by peer]
BrunoSaboia has quit [Ping timeout: 250 seconds]
Ishido has joined #ruby
agit0 has joined #ruby
skcin7 has joined #ruby
platzhirsch has joined #ruby
usershell has quit [Remote host closed the connection]
connor_goodwolf has quit [Ping timeout: 260 seconds]
usershell has joined #ruby
blaxter has joined #ruby
connor_goodwolf has joined #ruby
Cohedrin has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
platzhirsch has left #ruby [#ruby]
blackmes1 has joined #ruby
Xeago has joined #ruby
Spami has joined #ruby
dionysus69 has joined #ruby
arlek has quit [Ping timeout: 265 seconds]
usershell has quit [Ping timeout: 250 seconds]
baweaver has joined #ruby
yfeldblum has joined #ruby
Xeago has quit [Ping timeout: 264 seconds]
lyoshajapan has joined #ruby
<Bish> is there something in rubies that does something x times a second?
skade has quit [Quit: Computer has gone to sleep.]
rdark has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
puria has joined #ruby
Anderson69s_Deb has quit [Ping timeout: 265 seconds]
<Bish> like x << Proc.new { sleep 0.1; } # do this so it has been done 1600 times a second, BLOCK if we are higher or equal
ympeg has joined #ruby
Anderson69s_Deb has joined #ruby
sakix has joined #ruby
ascarter has quit [Ping timeout: 260 seconds]
baweaver has quit [Ping timeout: 240 seconds]
<Bish> doesn't look like exactly what i want
<Ox0dea> Bish: Resist the urge to reach for Timeout.
<harly> Bish, there's also https://github.com/javan/whenever
skade has joined #ruby
<Ox0dea> There's an esolang called Whenever.
<Bish> Ox0dea: i don't feel it
skade has quit [Excess Flood]
lele|w has quit [Read error: Connection reset by peer]
<Bish> that also doesn't look like what i want to do, i will try to write what i need and gist it for improvement!
like-all has joined #ruby
ascarter has joined #ruby
dcunit3d has quit [Ping timeout: 245 seconds]
sakix has quit [Ping timeout: 240 seconds]
saneax_AFK is now known as saneax
devbug has quit [Read error: Connection reset by peer]
joonty has joined #ruby
saneax is now known as Guest30574
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dlitvak has joined #ruby
SCHAAP137 has joined #ruby
ascarter has quit [Ping timeout: 250 seconds]
krz has quit [Ping timeout: 240 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
akem has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
DoubleMalt has joined #ruby
<Ox0dea> Bish: This isn't what you're trying to do? https://glot.io/snippets/eb6brkdvto
<Ox0dea> It returns `true` if it got through all the iterations and the number of iterations it *did* get to do if it couldn't get to them all.
quazimodo has joined #ruby
<Ox0dea> Oh, wait, it doesn't block.
Arnvald_ has joined #ruby
Arnvald has quit [Read error: Connection reset by peer]
ascarter has joined #ruby
<Ox0dea> Here's a blocking go at it: https://eval.in/505672
like-all has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
anisha_ has joined #ruby
<Ox0dea> And that should just be `i >= n || i`, of course.
puria has quit [Ping timeout: 264 seconds]
<harly> timeout is nice. i was rolling my own with Time.now etc
skade has joined #ruby
<Ox0dea> Well, it uses exceptions as control flow by design, which is generally to be shunned.
<Ox0dea> But it fits now and again.
<harly> well. it gives you a way to differentiate.
<harly> and the name implies timing out is an edge case or error.
Xeago has joined #ruby
sandstrom has joined #ruby
huyderman has joined #ruby
chouhoulis has joined #ruby
ascarter has quit [Ping timeout: 256 seconds]
krz has joined #ruby
dlitvak_ has joined #ruby
roshanav_ has joined #ruby
Mia has quit [Ping timeout: 256 seconds]
sigurding has quit [Quit: sigurding]
dlitvak has quit [Ping timeout: 245 seconds]
sigurding has joined #ruby
chouhoulis has quit [Ping timeout: 276 seconds]
roshanavand has quit [Ping timeout: 240 seconds]
consti has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
dmolina has joined #ruby
drptbl has joined #ruby
chipotle has joined #ruby
hannelita has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
duckpuppy has joined #ruby
Hounddog has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
puria has joined #ruby
Mia has quit [Ping timeout: 265 seconds]
codecop has quit [Read error: Connection reset by peer]
Hounddog has quit [Remote host closed the connection]
araujo_ has quit [Quit: Leaving]
ascarter has joined #ruby
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
hannelita has quit [Ping timeout: 245 seconds]
duckpuppy has quit [Ping timeout: 256 seconds]
marr has joined #ruby
codecop has joined #ruby
blackgoat has joined #ruby
lyoshajapan has quit [Remote host closed the connection]
zenlot1 is now known as zenlot
ta has quit [Remote host closed the connection]
troulouliou_div2 has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
dlitvak has joined #ruby
TakumoKatekari is now known as Takumo
chipotle has quit [Quit: cheerio]
dlitvak_ has quit [Ping timeout: 240 seconds]
elaptics` is now known as elaptics
bluOxigen_ has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
InvGhost has joined #ruby
howdoicomputer has joined #ruby
<harly> Ox0dea, glot.io is nice. just registered and installed glot-cli :)
<Burgestrand> Ox0dea it's also slightly dangerous in that it might cause even ensure-blocks of code to not run despite being ensured! (Timeout)
ascarter has joined #ruby
<Ox0dea> harly: Indeed! Much less constrained than eval.in as well.
<harly> also, compiled my first go porgram. yay.
<Ox0dea> Burgestrand: "Slightly" is a bit of an understatement there. :P
<Ox0dea> You really want your `ensure` blocks running with IO involved.
<Burgestrand> Ox0dea everything's relative. :)
<Burgestrand> But yes, Timeout bad, don't use it. You could maybe be exempt if you know what you are doing… maybe.
platzhirsch has joined #ruby
cornerma1 has joined #ruby
<Ox0dea> Hm... I don't see why Hash#[]= shouldn't support multiple assignment.
Xeago has quit [Ping timeout: 256 seconds]
ascarter has quit [Ping timeout: 245 seconds]
chthon has joined #ruby
dlitvak_ has joined #ruby
lkba has quit [Ping timeout: 276 seconds]
<Ox0dea> Anyway, 705 is the first Lucas pseudoprime.
<Ox0dea> >> require 'prime'; l = Hash.new { |h, k| h[k] = h[k-1] + h[k-2] }; l[1], l[2] = 1, 3; 2.upto(1/0.0).find { |n| n.prime? != ((l[n] - 1) % n == 0) }
<ruby[bot]> Ox0dea: # => 705 (https://eval.in/505693)
ascarter has joined #ruby
cornerman has quit [Ping timeout: 272 seconds]
cornerma1 is now known as cornerman
neanderslob has joined #ruby
neanderslob_ has quit [Read error: Connection reset by peer]
waka has quit [Remote host closed the connection]
sftrabbit has joined #ruby
dlitvak has quit [Ping timeout: 256 seconds]
<Ox0dea> harly: glot.io doesn't show partial results. :< https://glot.io/snippets/eb6cxn0iza
lipoqil has joined #ruby
<harly> what do you mean by partial?
<harly> ah have to wait for timeout (about 16 seconds) before seeing any output?
chipotle has joined #ruby
<Ox0dea> No, no output at all if it does timeout. :/
<harly> i got output...
<Ox0dea> Oh?
<harly> 705..113573
<harly> there's a STDOUT green panel, and an 'Error' red panel.
ascarter has quit [Max SendQ exceeded]
<Ox0dea> Ah, I might be retarded.
<harly> Error\nsignal: killed
<Ox0dea> Don't know how I missed it.
<harly> heh
<harly> would be really nice to get output streamed
skade has quit [Quit: Computer has gone to sleep.]
PedramT has quit [Remote host closed the connection]
<harly> heh, glot.io site written in haskell
<harly> i know basics. but yeah. i'll pass on crawling through that :)
skade has joined #ruby
ta has joined #ruby
FernandoBasso has joined #ruby
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> > All vars needs to be set, no default values are provided.
<Ox0dea> How very Haskell.
moeabdol has joined #ruby
robbyoconnor has joined #ruby
sleetdrop has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
aufi has quit [Quit: Konversation terminated!]
rodfersou has joined #ruby
Xeago has joined #ruby
ascarter has joined #ruby
<harly> :)
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
PedramT has joined #ruby
haxrbyte has joined #ruby
aufi has joined #ruby
dlitvak has joined #ruby
haxrbyte has quit [Client Quit]
auzty has quit [Ping timeout: 272 seconds]
InvGhost has quit [Read error: Connection reset by peer]
moeabdol has quit [Ping timeout: 264 seconds]
chipotle has quit [Quit: cheerio]
Snowy has joined #ruby
PedramT has quit [Remote host closed the connection]
|ifei5g00d has quit [Ping timeout: 260 seconds]
dlitvak_ has quit [Ping timeout: 245 seconds]
aufi has quit [Client Quit]
ta has quit [Remote host closed the connection]
aufi has joined #ruby
Arnvald_ has quit [Read error: Connection reset by peer]
haraoka has quit [Ping timeout: 276 seconds]
Arnvald has joined #ruby
PedramT has joined #ruby
stamina has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
FooMunki has joined #ruby
chouhoulis has joined #ruby
FooMunki has quit [Client Quit]
PedramT has quit [Remote host closed the connection]
FooMunki has joined #ruby
dlitvak_ has joined #ruby
PedramT has joined #ruby
workmad3 has joined #ruby
Arnvald has quit [Read error: Connection reset by peer]
Arnvald has joined #ruby
ta has joined #ruby
dwfait has joined #ruby
ascarter has quit [Ping timeout: 265 seconds]
dlitvak has quit [Ping timeout: 250 seconds]
chipotle has joined #ruby
chouhoulis has quit [Ping timeout: 256 seconds]
aufi has quit [Remote host closed the connection]
jam_ has joined #ruby
aufi has joined #ruby
chriscoffee has quit [Quit: Textual IRC Client: www.textualapp.com]
PedramT_ has joined #ruby
hannelita has joined #ruby
jottr_ has joined #ruby
jam_ has quit [Ping timeout: 240 seconds]
PedramT has quit [Ping timeout: 245 seconds]
howdoicomputer has quit [Ping timeout: 272 seconds]
User458764 has joined #ruby
ta has quit [Remote host closed the connection]
SegFaultAX has quit [K-Lined]
Junaos has quit [K-Lined]
Junaos has joined #ruby
ascarter has joined #ruby
platzhirsch has quit [Quit: Leaving.]
platzhirsch has joined #ruby
tsunamie has quit [Max SendQ exceeded]
arup_r has joined #ruby
ur5us_ has quit [Remote host closed the connection]
SegFaultAX has joined #ruby
karapetyan has quit [Remote host closed the connection]
ferr has joined #ruby
tsunamie has joined #ruby
howdoicomputer has joined #ruby
ascarter has quit [Ping timeout: 265 seconds]
hnagamin has quit [Ping timeout: 250 seconds]
tsunamie has quit [Max SendQ exceeded]
dlitvak_ has quit [Remote host closed the connection]
usershell has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
quazimodo has quit [Read error: Connection reset by peer]
<ddv> maybe a weird question, but does anyone know from which patchlevel of ruby 1.8.7 the colon syntax was removed for case/when statements?
<apeiros> it wasn't
<apeiros> 1.9 removed it
howdoicomputer has quit [Ping timeout: 240 seconds]
ldnunes has joined #ruby
tsunamie has joined #ruby
<ddv> apeiros: aaah that points me in the right direction
<ddv> apeiros: thanks
<apeiros> yw
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
Bloomer has quit [Remote host closed the connection]
hannelita has quit [Remote host closed the connection]
usershell has quit [Ping timeout: 276 seconds]
FooMunki has quit [Quit: FooMunki]
FooMunki has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
Xeago has quit [Remote host closed the connection]
rkazak has quit [Quit: Sleep.....ing....]
drptbl has joined #ruby
<Ox0dea> ddv: Just swap : for ;
<ddv> Ox0dea: nah
<Ox0dea> Fine.
<ddv> Ox0dea: you don't know the context
hannelita has joined #ruby
<ddv> Ox0dea: i'm moving very old legacy rails apps
mrtomme has quit [Ping timeout: 248 seconds]
<Ox0dea> Thank you for reminding me that I'm not omniscient. :(
mrtomme_ has joined #ruby
ta has joined #ruby
<ddv> Ox0dea: well thanks anyways :p
<apeiros> ddv: not sure how that makes Ox0dea not viable?
<ddv> apeiros: what do yu mean?
<ddv> you*
<Ox0dea> ddv: Just swap : for ;
<apeiros> swapping the : with ; in case/when
<ddv> not going to mess with old gems
nobitanobi has joined #ruby
<apeiros> ddv: you mean it's not code maintained by you/your company?
aufi_ has joined #ruby
<ddv> apeiros: exactly
<nobitanobi> When initializing a child that is using the parent's initializer, how can I access to a specific constant of the child? https://gist.github.com/novito/7cfd5f96ff34ce8ac47d
<ddv> old gems like radiant, rails 1.2.3 etc
<apeiros> nobitanobi: self.class::CONST
aufi_ has quit [Client Quit]
<apeiros> or redefine the method in the subclass.
<nobitanobi> apeiros: how come by default Ruby is accessing the parent?
<apeiros> it's not
<apeiros> it accesses the constant in the scope of definition
<nobitanobi> oh I see
<nobitanobi> so, what's a good pattern for this?
<apeiros> as said, self.class::CONST
<nobitanobi> ok thanks
<apeiros> that'll force it to use the normal lookup
fsapo has joined #ruby
chipotle has quit [Quit: cheerio]
<apeiros> i.e. you can omit the constant in the child, but if you have one there, it'll use that.
<nobitanobi> Oh cool
Xeago has joined #ruby
<nobitanobi> thanks apeiros
<nobitanobi> that is because the object is not initialized yet, correct?
<nobitanobi> so it goes to find it in the scope where initialize is defined
<apeiros> no
<apeiros> constant lookup in methods depends on where the method has been defined, not where it is called
<nobitanobi> uh, ok
<nobitanobi> thanks man
<nobitanobi> that helps a lot
Arnvald has quit [Read error: Connection reset by peer]
Arnvald has joined #ruby
radgeRayden_ has quit [Ping timeout: 256 seconds]
<Ox0dea> >> h = {}; h[:a, :b] = 1, 2 rescue $!
<ruby[bot]> Ox0dea: # => #<ArgumentError: wrong number of arguments (given 3, expected 2)> (https://eval.in/505730)
<Ox0dea> apeiros: Thoughts? Liable to do more harm than good, yeah?
nik0 has joined #ruby
<ddv> had to downgrade rubygems lol
<Ox0dea> I think `hash[*keys] = values` as an alternative to #update is kinda nice.
skade has quit [Quit: Computer has gone to sleep.]
niko has quit [Ping timeout: 600 seconds]
<Ox0dea> ddv: Ouch. You're really in the weeds, eh?
nik0 is now known as niko
<ddv> 300 customers still on rails 1.2.3 lol
<apeiros> Ox0dea: I have been missing parallel assignment for hashes and I don't see a collision for this suggestion
<apeiros> i.e. +1
m8 has joined #ruby
<apeiros> `hash[*keys] = values` > `hash.update(keys.zip(values).to_h)`
<Ox0dea> On it!
decoponio has joined #ruby
<Ox0dea> Gonna get case equality for #any? and friends some visibility as well.
anisha_ has quit [Quit: Leaving]
<apeiros> but if hash[*keys] = values, then *values2 = *hash[*keys] == values should hold true :)
sakix has joined #ruby
<Ox0dea> Hmm.
<apeiros> can just map Hash#[] to #values_at
<Ox0dea> Right.
<apeiros> ah… hm…
<apeiros> there be dragons
<Ox0dea> No?
<apeiros> hash[1] # should not return an array…
surrounder has left #ruby ["WeeChat 1.4"]
<Ox0dea> It should if there's an Array at that key.
<apeiros> of course
<apeiros> but that's not what I mean
<Ox0dea> Oh, but I see how you mean.
<Ox0dea> Arity checking is pretty easy in MRI.
<apeiros> you can't distinguish
aufi has quit [Quit: Konversation terminated!]
<apeiros> yes, but then you get incosistent results
<Ox0dea> Of course you can.
Arnvald has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
<apeiros> keys = [1]; hash[*keys] # => returns not an array
<apeiros> keys = [1,2]; hash[*keys] # => returns an array
<Ox0dea> Ah, right. :<
<Ox0dea> So then there'd be an asymmetry between Hash#[] and #[]=.
<apeiros> that's the downside of not copying perl's %@$ scalar/list/map contexts
<apeiros> indeed
<Ox0dea> But, well, Array#[] and #[]= aren't quite symmetrical.
aufi has joined #ruby
<apeiros> I think *I* could live with the discrepancy. but maybe it'd make sense then to have update_at instead of []=
<apeiros> i.e. []/[]= symmetric and values_at/update_at symmetric
<Ox0dea> I like syntax. ^_^
<apeiros> true re Array
sakix has quit [Ping timeout: 240 seconds]
<apeiros> wait… is it true?
<apeiros> where's it not symmetric?
<Ox0dea> >> a = [0]; a[0,1] = [1,2,3]; a[0] == [1,2,3]
<ruby[bot]> Ox0dea: # => false (https://eval.in/505734)
<Ox0dea> I guess asymmetric isn't quite the word.
<apeiros> hm, but that's a different kind of asymmetry, no? the same arguments have the same meaning in both [] and []=
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<apeiros> it's just not the case that (a[*args] = values) == (a[*args])
djellemah has quit [Read error: Connection timed out]
joonty has quit [Ping timeout: 264 seconds]
arup___ has joined #ruby
arup_r has quit [Ping timeout: 256 seconds]
CaptainAl has joined #ruby
mprelude has joined #ruby
hnagamin has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
CaptainAl has quit [Remote host closed the connection]
CaptainAl has joined #ruby
arup___ has quit []
sftrabbit has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> I can't see it being done in a way that would please everybody.
<Ox0dea> There might be some grossly hackish way to determine whether the arguments were the result of a splat, but that's not really a solution.
Rinalds has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
Rickmasta has joined #ruby
djellemah has joined #ruby
tvw has joined #ruby
anisha_ has joined #ruby
Rinalds has joined #ruby
Guest30574 is now known as saneax_AFK
fclausen has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
arup_r has joined #ruby
Rickmasta has quit [Ping timeout: 240 seconds]
duckpuppy has joined #ruby
waka has joined #ruby
dlitvak has joined #ruby
chipotle has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
sftrabbit has joined #ruby
duckpuppy has quit [Ping timeout: 276 seconds]
lyoshajapan has joined #ruby
<nobitanobi> If I am referencing long namespacing in my RUby app like User::Commerce::Headers, is it a good pattern to store that in a method/constant?
<ljarvis> nobitanobi: it's common to return it in a method yes. A constant doesn't quite do the same thing
<nobitanobi> ljarvis: why not?
Shaboum has joined #ruby
<Ox0dea> nobitanobi: You might also consider `include`, but you'll want to tread lightly.
howdoicomputer has joined #ruby
lyoshajapan has quit [Ping timeout: 256 seconds]
<ljarvis> nobitanobi: actually that's probably fine I was thinking of something else I think
<nobitanobi> thanks guys
chipotle has quit [Quit: cheerio]
startupality has joined #ruby
martinliu has quit [Quit: Leaving]
howdoicomputer has quit [Ping timeout: 256 seconds]
tvw has quit [Ping timeout: 245 seconds]
Jardayn has joined #ruby
hayden_ has joined #ruby
lucas has joined #ruby
puria has quit [Ping timeout: 250 seconds]
joonty has joined #ruby
BTRE has quit [Quit: Leaving]
DoubleMalt has joined #ruby
<lucas> hi! when parsing a JSON with hashes of hashes of hashes, I often find myself writing dirty code such as: http://paste.debian.net/366959/ . Is there a better way to write that?
<lucas> (the code does: check if key exists, if yes, get sub-hash, check if key eixsts, if yes, get sub-hash, etc.
drptbl has quit [Ping timeout: 240 seconds]
ICantCook has joined #ruby
moeabdol has joined #ruby
nobitanobi has quit [Ping timeout: 252 seconds]
norc has joined #ruby
<j416> lucas: wrap it in an accessor class
User458764 has joined #ruby
yfeldblum has quit [Ping timeout: 260 seconds]
<lucas> j416: well, it wouldn't change anything. I was more thinking about something like XPATH, but for ruby data structures
<j416> yes it would.
<lucas> j416: then I don't understand what you mean
dlitvak_ has joined #ruby
<j416> you could easily build something that allows you to do e.g. get('sensors.power.available')
blackmes1 has joined #ruby
<j416> 10-20 lines of code or thereabot
<lucas> that's about the same as what I have currently :)
<j416> then what's the problem
ympeg has quit [Ping timeout: 250 seconds]
moeabdol has quit [Ping timeout: 260 seconds]
quaristice has joined #ruby
BTRE has joined #ruby
dlitvak has quit [Ping timeout: 264 seconds]
moeabdol has joined #ruby
<Ox0dea> lucas: Ruby 2.3 introduced #dig for just such occasions.
codecop has quit [Remote host closed the connection]
<lucas> right, I just found about that. now I just need to find a gem that provides #dig in pre-2.3 :)
<Ox0dea> There is such a one!
sigurding has quit [Quit: sigurding]
lipoqil has quit [Quit: Connection closed for inactivity]
<lucas> right!
<lucas> two of them, actually: https://github.com/Invoca/ruby_dig
drptbl has joined #ruby
c355e3b has joined #ruby
fclausen has quit [Ping timeout: 272 seconds]
skade has joined #ruby
Xeago has joined #ruby
sakix has joined #ruby
Burgestrand has joined #ruby
drptbl has quit [Client Quit]
drptbl has joined #ruby
dlitvak has joined #ruby
sakix has quit [Ping timeout: 272 seconds]
myntcake has joined #ruby
dlitvak_ has quit [Ping timeout: 245 seconds]
Snowy has quit [Remote host closed the connection]
wtiger has joined #ruby
sanko has joined #ruby
wtiger has left #ruby ["WeeChat 1.3"]
Jardayn has quit [Read error: Connection reset by peer]
andrey has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
dlitvak has quit [Read error: Connection reset by peer]
dlitvak has joined #ruby
einarj has quit [Remote host closed the connection]
casadei has joined #ruby
chouhoulis has joined #ruby
gbgdev has joined #ruby
gbgdev has quit [Remote host closed the connection]
gbgdev has joined #ruby
rkoller has joined #ruby
gbgdev_ has joined #ruby
gbgdev has quit [Read error: Connection reset by peer]
dlitvak_ has joined #ruby
craigp has joined #ruby
davedev24 has joined #ruby
skcin7 has joined #ruby
sandstrom has joined #ruby
solocshaw has joined #ruby
dlitvak has quit [Ping timeout: 265 seconds]
jam_ has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
blackmes1 has quit [Ping timeout: 265 seconds]
startupality has quit [Quit: startupality]
sftrabbit has quit [Quit: sftrabbit]
Azulinho has quit [Ping timeout: 260 seconds]
matled has quit [Remote host closed the connection]
jottr_ is now known as jottr
dlitvak has joined #ruby
jam_ has quit [Ping timeout: 250 seconds]
sleetdrop has quit [Quit: Computer has gone to sleep.]
dlitvak_ has quit [Read error: Connection reset by peer]
robh71 has joined #ruby
Musashi007 has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Alina-malina has joined #ruby
Musashi007 has quit [Read error: No route to host]
aupadhye has joined #ruby
<sanko> How to make changes in a ruby gem?
Musashi007 has joined #ruby
dwfait has quit [Remote host closed the connection]
quaristice has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skakri` is now known as skakri
sdothum has joined #ruby
duckpuppy has joined #ruby
sigurding has joined #ruby
Burgestrand has joined #ruby
sanko has quit [Ping timeout: 252 seconds]
joonty has quit [Ping timeout: 245 seconds]
Alina-malina has left #ruby ["Leaving"]
matled has joined #ruby
sftrabbit has joined #ruby
UtkarshRay has joined #ruby
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freerobby has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
rsc___ has quit [Quit: rsc___]
einarj has joined #ruby
Anderson69s has joined #ruby
pawnbox has quit [Remote host closed the connection]
IrishGringo has joined #ruby
moeabdol has quit [Quit: WeeChat 1.4]
dlitvak_ has joined #ruby
duckpuppy has quit [Ping timeout: 260 seconds]
solocshaw has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
roller123 has joined #ruby
dlitvak has quit [Ping timeout: 264 seconds]
joonty has joined #ruby
pawnbox has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<roller123> hi, need a little help. I am executing rubber command to deploy in AWS EC2 but getting an error.
IrishGringo has quit [Ping timeout: 250 seconds]
<roller123> I am running this command :- cap rubber:create_staging
<roller123> and getting this error as bellow :-
onlyme_ has joined #ruby
<roller123> executing `rubber:create' /Users/gauravsarin/.rvm/gems/ruby-2.3.0@newapp/gems/rubber-3.2.0/lib/rubber/cloud/aws/base.rb:75:in `before_create_instance': undefined method `instance_alias' for #<Rubber::Configuration::InstanceItem:0x007fc9a9e73c48> (NoMethodError) Did you mean? instance_variables instance_eval instance_id from /Users/gauravsarin/.rvm/gems/ruby-2.3.0@newapp/gems/rubber-3.2.0/lib/rubber/thread_safe_proxy.rb:13:in `metho
<roller123> any ideas how to fix it asap
anisha_ has quit [Quit: Leaving]
onlyme_ has quit [Ping timeout: 250 seconds]
anisha_ has joined #ruby
<arup_r> what is the difference between add_development_dependency and add_runtime_dependency ?https://github.com/tinfoil/devise-two-factor/blob/master/devise-two-factor.gemspec#L33
r4um_ has joined #ruby
<arup_r> I am asking because after installing the gem, I see none of the gem is in my gemfile.lock ... which is giving me hints something is there which I don't know
synthroid has joined #ruby
PedramT_ has quit [Remote host closed the connection]
PedramT has joined #ruby
r4um has quit [Ping timeout: 265 seconds]
PedramT_ has joined #ruby
<roller123> any pointers would be appreciated
PedramT has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
kalopsian has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duckpuppy has joined #ruby
kspencer has quit [Ping timeout: 250 seconds]
shinnya has joined #ruby
PedramT has joined #ruby
PedramT_ has quit [Ping timeout: 250 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
roshanav_ has quit [Ping timeout: 250 seconds]
polysics has joined #ruby
duckpuppy has quit [Ping timeout: 256 seconds]
roshanavand has quit [Remote host closed the connection]
cornerman has left #ruby [#ruby]
PedramT has quit [Remote host closed the connection]
roshanavand has joined #ruby
dlitvak_ has quit [Ping timeout: 265 seconds]
craigp has quit []
zapata has quit [Quit: WeeChat 1.3]
ajf- has joined #ruby
craigp has joined #ruby
saneax_AFK is now known as saneax
chouhoulis has joined #ruby
startupality has joined #ruby
dlitvak has joined #ruby
PedramT has joined #ruby
bluOxigen has joined #ruby
<arup_r> apeiros: thank you very much "Development dependencies aren't installed by default and aren't activated when a gem is required." is the answer I was looking for ( http://guides.rubygems.org/specification-reference/#add_development_dependency )
saneax is now known as Guest50387
<apeiros> gem install -​-development/-​-development-all are the corresponding options
<arup_r> now, if they don't install by default, then what is the trick to get them.. because `bundle install` didn't install it.. so what is next ?
<apeiros> don't know with bundler
bluOxigen_ has quit [Ping timeout: 256 seconds]
<arup_r> ok.. bundle install --development .. let me try
<arup_r> ah.. I see
roshanavand has quit [Ping timeout: 260 seconds]
<arup_r> let me google then
craigp has quit [Client Quit]
<Ox0dea> roller123: Looks like a bug. :/
Azulinho has joined #ruby
<roller123> and idea how to solve this bug!
PedramT_ has joined #ruby
<roller123> anyother suggestion to work around
<Ox0dea> https://git.io/vzuJC is the line triggering the error and https://git.io/vzuJR is where #role_names is defined on InstanceItem, but every occurrence of `instance_alias` in the codebase is a local variable.
skcin7 has joined #ruby
PedramT has quit [Ping timeout: 264 seconds]
chouhoulis has quit [Ping timeout: 265 seconds]
neohunter has joined #ruby
craigp has joined #ruby
craigp has quit [Remote host closed the connection]
<roller123> ya that is the one, you are right. I just looked it, but any work around you can think of.
Snowy has joined #ruby
arup_r has quit [Remote host closed the connection]
hxegon has joined #ruby
dlitvak_ has joined #ruby
duckpuppy has joined #ruby
startupality has quit [Quit: startupality]
dlitvak has quit [Ping timeout: 240 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
jespada has joined #ruby
robh71 has quit [Remote host closed the connection]
sandstrom has joined #ruby
robh71 has joined #ruby
<Ox0dea> roller123: https://git.io/vzuIW indicates that ALIAS is a required environment variable for this task.
arup_r has joined #ruby
last_staff has quit [Read error: Connection reset by peer]
<Ox0dea> It's weird that it's not warning you about it being unset, but I think that's the root of the issue.
last_staff has joined #ruby
howdoicomputer has joined #ruby
<roller123> should i set it to my host name?
<Ox0dea> That does seem to be the intended value, yes.
sakix has joined #ruby
<Ox0dea> It probably doesn't mean your local hostname, though.
<roller123> sorry i didn't get you!
tvw has joined #ruby
shredding has joined #ruby
<Ox0dea> roller123: Did you skip this step? https://git.io/vzutI
pwnd_nsfw` is now known as pwnd_nsfw
quaristice has joined #ruby
ropeney has joined #ruby
howdoicomputer has quit [Ping timeout: 256 seconds]
arup_r has quit [Ping timeout: 276 seconds]
jaiks has quit [Remote host closed the connection]
c0m0 has joined #ruby
jaiks has joined #ruby
ropeney has quit [Client Quit]
<roller123> what is web_tools_user and web_tools_password?
bronson has joined #ruby
arup_r has joined #ruby
roshanavand has joined #ruby
DaniG2k has joined #ruby
sakix has quit [Ping timeout: 260 seconds]
atomical has joined #ruby
startupality has joined #ruby
FooMunki has quit [Quit: FooMunki]
ramortegui has joined #ruby
Guest50387 is now known as saneax_AFK
startupality has quit [Client Quit]
bronson has quit [Ping timeout: 265 seconds]
quaristice has quit [Quit: Textual IRC Client: www.textualapp.com]
roshanavand has quit [Ping timeout: 260 seconds]
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FooMunki has joined #ruby
startupality has joined #ruby
startupality has quit [Client Quit]
dwfait has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mfb2 has joined #ruby
mfb2 has quit [Remote host closed the connection]
r4um has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
aryaching has joined #ruby
hogetaro has joined #ruby
Pupeno has joined #ruby
nertzy2 has joined #ruby
puria has joined #ruby
arup___ has joined #ruby
r4um_ has quit [Ping timeout: 264 seconds]
gbgdev_ has quit [Remote host closed the connection]
Jardayn has joined #ruby
r4um has quit [Ping timeout: 240 seconds]
Drakevr has quit [Read error: Connection reset by peer]
adgtl has joined #ruby
hnagamin has quit [Ping timeout: 250 seconds]
hogetaro has quit [Ping timeout: 250 seconds]
r4um has joined #ruby
arup_r has quit [Ping timeout: 240 seconds]
startupality has joined #ruby
__chris has joined #ruby
hnagamin has joined #ruby
chipotle has joined #ruby
nilbus has joined #ruby
startupality has quit [Client Quit]
startupality has joined #ruby
gizmore has joined #ruby
r4um has quit [Ping timeout: 264 seconds]
dlitvak_ has quit [Remote host closed the connection]
dlitvak has joined #ruby
gambl0re has quit [Ping timeout: 240 seconds]
griffindy has joined #ruby
mikecmpbll has joined #ruby
treehug88 has joined #ruby
The_Phoenix has joined #ruby
karapetyan has joined #ruby
startupality has quit [Quit: startupality]
cdg has joined #ruby
<mikecmpbll> in the optparser "Complete example" (long one) in the docs here: http://ruby-doc.org/stdlib-2.3.0/libdoc/optparse/rdoc/OptionParser.html is there a bug? it looks to be calling the instance method `option_parser` from class method `self.parse`
sgambino has joined #ruby
Marsupermammal has joined #ruby
mfb2 has joined #ruby
nilbus has left #ruby ["Textual IRC Client: www.textualapp.com"]
Bsian has joined #ruby
krobzaur_ has joined #ruby
<apeiros> mikecmpbll: that whole example looks rather buggy
<mikecmpbll> yeah :/
astrofog has joined #ruby
<apeiros> tried some quick changes to get it to run
Burgestrand has joined #ruby
<mikecmpbll> bit of a mindbender this OptionsParser lark.
<ljarvis> should use a better option parser
<Papierkorb> mikecmpbll: opt_parser is a variable
<apeiros> got it to run, but with two rather ugly changes
hnagamin has quit [Read error: Connection reset by peer]
kp666 has quit [Remote host closed the connection]
sgambino has quit [Quit: Textual IRC Client: www.textualapp.com]
TomPeed has joined #ruby
techsethi has joined #ruby
nertzy2 has quit [Quit: This computer has gone to sleep]
<apeiros> hehe, and that's just running. it's not correct. because the @options is supposed to be in the instance too, not in the class.
sgambino has joined #ruby
puria has quit [Quit: Leaving]
Coldblackice has quit [Ping timeout: 265 seconds]
blackgoat has quit [Quit: WeeChat 1.3]
blackmes1 has joined #ruby
chouhoulis has joined #ruby
startupality has joined #ruby
Rodya_ has joined #ruby
aegis3121 has joined #ruby
<apeiros> holy, that's a rabbit hole.
<apeiros> sorry, gotta work again
hogetaro has joined #ruby
startupality has quit [Client Quit]
startupality has joined #ruby
system64 has joined #ruby
hayden_ has quit [Quit: Connection closed for inactivity]
lessless has joined #ruby
<ddv> irc is work apeiros
<shevy> hmm is ruboto permanently gone? :(
karmatr0n has joined #ruby
nertzy2 has joined #ruby
jam_ has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
<shevy> I just realized something... with ruby[bot], the "bot" sorta indicates that it is now a bot... that is deliberate right? because some people thought that ruboto was a real person
polysics has quit []
chouhoulis has quit [Ping timeout: 256 seconds]
PaulePan1er is now known as PaulePanter
startupality has quit [Client Quit]
sleetdrop has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
Rodya_ has quit [Remote host closed the connection]
startupality has joined #ruby
__chris has quit [Quit: This computer has gone to sleep]
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
jam_ has quit [Ping timeout: 264 seconds]
dlitvak_ has joined #ruby
gambl0re has joined #ruby
weckl has joined #ruby
floatingpoint has joined #ruby
__chris has joined #ruby
Rodya_ has joined #ruby
<mikecmpbll> :|
dlitvak has quit [Ping timeout: 240 seconds]
karmatr0n has quit []
<mikecmpbll> Papierkorb: no it's not?
krz has quit [Quit: WeeChat 1.2]
chipotle has quit [Quit: cheerio]
sambio has joined #ruby
nertzy2 has quit [Quit: This computer has gone to sleep]
sambio has quit [Client Quit]
kobain has joined #ruby
lucasb has joined #ruby
karmatr0n has joined #ruby
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DoubleMalt has quit [Ping timeout: 272 seconds]
scripore has joined #ruby
hogetaro_ has joined #ruby
scripore has quit [Max SendQ exceeded]
drptbl has joined #ruby
scripore has joined #ruby
babblebre has joined #ruby
kalopsian has quit [Ping timeout: 250 seconds]
dlitvak has joined #ruby
<mikecmpbll> it's calling method that reference @parser before inside the definition for @parser
davedev2_ has joined #ruby
sergey_makagon has joined #ruby
dlitvak_ has quit [Ping timeout: 256 seconds]
hogetaro has quit [Ping timeout: 272 seconds]
<mikecmpbll> oh okay, it's actually meant to refer to the block local `parser`, but it doesn't have access to that ..
duckpuppy has joined #ruby
rodfersou is now known as rodfersou|lunch
davedev24 has quit [Ping timeout: 260 seconds]
newdan has joined #ruby
PedramT has joined #ruby
B1n4r10 has joined #ruby
techsethi has quit [Ping timeout: 256 seconds]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
malconis has joined #ruby
efox has joined #ruby
AimlessRaven has joined #ruby
sepp2k has joined #ruby
PedramT_ has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Ping timeout: 276 seconds]
ympeg has joined #ruby
Musashi007 has quit [Quit: Musashi007]
hannelita has quit [Remote host closed the connection]
<platzhirsch> I am really confused about chaining multiple condition on a multi-line unless
<platzhirsch> >> unless false && false; puts 'Golly gosh'; end
<ruby[bot]> platzhirsch: # => Golly gosh ...check link for more (https://eval.in/505857)
<platzhirsch> >> unless false && true; puts 'Golly gosh'; end
<ruby[bot]> platzhirsch: # => Golly gosh ...check link for more (https://eval.in/505859)
Anderson69s has quit [Quit: Time to EAT, SLEEP OR WHATEVER BYE!!!!!]
dfinninger has joined #ruby
DoubleMalt has joined #ruby
<newdan> platzhirsch: unless is like inverse if
<aegis3121> >> unless true && true; puts 'Taocat'; end
<ruby[bot]> aegis3121: # => nil (https://eval.in/505861)
<newdan> platzhirsch: false && false and false && true are both false, so they satisfy the unless
<platzhirsch> yes but it seems the second argument gets ignored
<platzhirsch> oh right
<platzhirsch> I forgot about the precedence here
<platzhirsch> sorry, that was obvious : )
startupality has quit [Quit: startupality]
<AimlessRaven> platzhirsch: unless = if not
<mikecmpbll> it does, because when you && stuff and the first is false it doesn't need to evaluate the others :)
<platzhirsch> For some reason I always thought the not is then either applied individually in front of every part or just for the first
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
startupality has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
<platzhirsch> I never used unless in that form anyway because I always thought it's confusing
<mikecmpbll> ah, you thought it was if !false && true, as opposed to if !(false && true)
Sucks has joined #ruby
DirtyFinn has quit []
<platzhirsch> mikecmpbll: exactly
<newdan> platzhirsch: I agree, for anything non-trivial unless is very confusing
newbie22 has joined #ruby
whippythellama has joined #ruby
<newdan> I mean, it has predictable behavior but it just makes the code confusing to read
<platzhirsch> still, I should know that. My Ruby skills have slacked off so much off
PedramT has quit [Remote host closed the connection]
<platzhirsch> Anyone working for Travis CI here?
<AimlessRaven> platzhirsch: why you thing that ?
<AimlessRaven> unless is cool
<platzhirsch> Unless you stumble over it
<newbie22> *: morning
<Bish> hi
floatingpoint has joined #ruby
<newdan> newbie22: what IRC client do you use that puts "*: " in front of all your messages?
<Bish> this is a really ugly piece of PoC, i created to show you what i want to have
<platzhirsch> so to transform it I would have if !(a && b && c) instead of unless a && b && c ?
startupality has quit [Ping timeout: 240 seconds]
<newdan> platzhirsch: Correct
<Bish> Ox0dea: i feel like, you would like this one, don't you?
hayden_ has joined #ruby
dfinninger has quit [Remote host closed the connection]
krz has joined #ruby
<newbie22> newdan: I did it myself
<Ox0dea> Bish: Just heading out. Looks pretty wonky, though. :P
<Ox0dea> Godspeed.
<Bish> :) have fun at whatever you're doing
<lucasb> looks very well indented
hannelita has joined #ruby
ruby-lang634 has joined #ruby
dionysus69 has joined #ruby
AimlessRaven has quit [Quit: Page closed]
<ruby-lang634> Hey guys - I have a quick question - do you know if anonymous modules that are being prepended and no longer used are garbage collected?
roshanavand has joined #ruby
Burgestrand has joined #ruby
<Bish> my "implementation" if you want to call it this way, has some issues, which i would like to fix
Burgestrand has quit [Client Quit]
<Bish> 1. if i wanted it to be 100000 jobs per hour, it would spawn 100000 threads
Burgestrand has joined #ruby
<Bish> 2. that implies, that scheduling would be trying to get ALL work done as fast as possible, and not spread it over the hour/minute whatever
Snowy is now known as Eggskiwi
<Bish> i wrote a similiar one, which calculated the average execution time of a proc, and then waited for creating threads, but that was too ugly to show
User458764 has joined #ruby
hxegon is now known as hxegon_AFK
<apeiros> shevy: I will regroup ruboto with ruby[bot]'s account (ruboto is currently tied to mine)
<apeiros> shevy: when that's done we could switch the name back to ruboto. but as you just noticed, ruby[bot] has the advantage of having bot in the name.
roller123 has quit [Quit: Page closed]
<apeiros> that said, there have still been people replying to it :-S
<Bish> >> "ruboto"[/(bot)/,1]
<ruby[bot]> Bish: # => "bot" (https://eval.in/505865)
dlitvak_ has joined #ruby
<havenwood> Bish: So you want something along the lines of 1) a thread pool, and 2) a throttler not a limiter?
<havenwood> Bish: Is this to learn or use?
<Bish> havenwood: yeah that sounds like what i want
<Bish> use
B1n4r10 has quit [Ping timeout: 250 seconds]
newbie22 has quit [Quit: Leaving]
momomomomo has joined #ruby
pdoherty has joined #ruby
<Bish> it also would be cool if it had a scheduler, so the work gets spread over the time peroid which im going to watch
astrobunny has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 240 seconds]
Coldblackice has joined #ruby
<havenwood> Bish: How about Sidekiq or Resque?
momomomomo has quit [Client Quit]
bMalum_ has joined #ruby
s00pcan has quit [Remote host closed the connection]
gbgdev has joined #ruby
<Bish> i "know" about them, haven't really used them, though i felt like those are more for background jobs in rails
Drakevr has joined #ruby
Drakevr has quit [Client Quit]
<Bish> or can you give me an example, how something like want could be done in either of these
s00pcan has joined #ruby
zerowaitstate has joined #ruby
<Bish> sidekiq is using celluloid, right? im familiar with that one, but it didn't come to be how i would do that in celluloid either
<havenwood> Bish: Maybe give this a read for some ideas: https://github.com/mperham/sidekiq/wiki/Ent-Rate-Limiting
startupality has joined #ruby
zerowaitstate has quit [Quit: leaving]
<havenwood> Bish: No, Sidekiq 4 is a rewrite that dropped Celluloid for a custom, fast implementation
<apeiros> Bish: iirc sidekiq recently ditched celluloid
sftrabbit has joined #ruby
<Bish> apeiros: yeah i feel like that is a good idea
<Bish> celluloid looks awesome, but feels like it will break your neck if you use it
bMalum_ is now known as bMalum
Drakevr has joined #ruby
Drakevr has quit [Client Quit]
hxegon_AFK has quit [Quit: BRB]
<Papierkorb> Well, depends if that change makes your jobs actually faster or actually significantly slower ..
<Papierkorb> Doing expensive calculations *in* your job? Bad luck, better rewrite that one
rippa has joined #ruby
<havenwood> Bish: Just an aside, but since you mentioned Celluloid here's a related library that would keep your timers from slipping: https://github.com/celluloid/timers
zerowaitstate has joined #ruby
<Bish> thank you!
ImJune has joined #ruby
Emmanuel_Chanel has joined #ruby
<ImJune> hello
<ImJune> Does anyone here use rails on fedora 23
<havenwood> ImJune: They do.
<ImJune> every single build fails
<ImJune> "BUILD FAILED (Fedora 23 using ruby-build 20160111-25-g3b0714a)"
roshanavand has quit [Read error: Connection timed out]
Drakevr has joined #ruby
bluOxigen_ has joined #ruby
<ImJune> could anyone tell me a build version that would work on fedora 23
<ImJune> ?
hxegon has joined #ruby
<havenwood> ImJune: Sounds like rbenv's ruby-build is failing. It doesn't give you any better errors than that?
<ImJune> I went directly to the site and it seems they recommend 2.2.2
VeryBewitching has joined #ruby
<ImJune> oh it does
<ImJune> shall I pastbin the whole thing/
<ImJune> ?
<VeryBewitching> G'day folks.
<havenwood> ImJune: Ruby 2.2.4 or 2.3.0 should work great.
Musashi007 has joined #ruby
<havenwood> ImJune: Yeah, Gist it!
<havenwood> VeryBewitching: g'day
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<VeryBewitching> havenwood: How's the day so far?
chouhoulis has joined #ruby
Rickmasta has joined #ruby
<Bish> havenwood: celluloid timers look comfy
<havenwood> VeryBewitching: I woke up. Which I'm in the habit of doing most days.
dlitvak has joined #ruby
<havenwood> VeryBewitching: But it's pre-coffee, which is a dangerous time!
karapetyan has quit [Remote host closed the connection]
<VeryBewitching> Ah yes, that's a volatile time for me too
mondok has quit [Ping timeout: 250 seconds]
ruby-lang634 has quit [Quit: Page closed]
<ruby[bot]> ImJune: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
bluOxigen has quit [Ping timeout: 245 seconds]
<ImJune> sorry I guess you guys have your own little brand :) its ok
<Bish> well, actually which didn't come to my mind, was to spawn a maximum number of threads, and write a lock which opens every x seconds
<Bish> im too stupid ;;
<havenwood> ImJune: Yeah, pastebin is spamming me about adblock and won't show me the code: "Your paste has triggered our automatic SPAM detection filter. This happens when certain keywords are detected in a paste."
<ImJune> I am wondering if this rails is easier overall than django
karapetyan has joined #ruby
<ImJune> feel like it couldnt get much easier than django
<havenwood> ImJune: mkdir: cannot create directory ‘/home/nixadmin/.rbenv/versions’: Permission denied
<ImJune> yes
<ImJune> but I can't use sudo
dlitvak__ has joined #ruby
<havenwood> ImJune: Are you that user?
<ImJune> it doesn't even recognize the command if I try sudo
huyderman has quit [Remote host closed the connection]
<ImJune> I am
<apeiros> ImJune: "github - your own little brand" lol, where do you live? behind the moon?
Drakevr has quit [Quit: demons to some, angels to others]
<ImJune> I live in Japan
dlitvak_ has quit [Ping timeout: 272 seconds]
Rodya_ has quit [Remote host closed the connection]
armyriad has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Ping timeout: 264 seconds]
<havenwood> ImJune: stat ~/.rbenv
fmcgeough has joined #ruby
Rickmasta has quit [Ping timeout: 250 seconds]
<Bish> Big in Japan~
<ImJune> I was a SCADA guy for years and in sales so all this is new
<ImJune> Oh\
adgtl has quit [Remote host closed the connection]
bMalum has quit [Read error: Connection reset by peer]
<ImJune> Heaven you want the output from that command?
speaking1ode has quit [Ping timeout: 250 seconds]
<havenwood> ImJune: If you don't see the permissions error.
karapetyan has quit [Remote host closed the connection]
Drakevr has joined #ruby
Bloomer has joined #ruby
Musashi007 has quit [Quit: Musashi007]
dlitvak has quit [Ping timeout: 256 seconds]
<newdan> ImJune: Rails and Django are pretty similar
<ImJune> ok so if I am fairly ok with django I can learn this pretty easy?
__chris has quit [Quit: Leaving]
<tubbo> ImJune: they make some different decisions, but generally the concepts will seem familiar
<havenwood> ImJune: And if you manually try?: mkdir -p ~/.rbenv/versions
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dfinninger has joined #ruby
<tubbo> one important thing to remember is that they're not really related.
tjohnson has joined #ruby
<ImJune> I will try
Drakevr has quit [Remote host closed the connection]
bMalum has joined #ruby
<ddv> django is trying really to be like Rails but fails everytime
<ddv> +hard
Burgestrand has joined #ruby
<ImJune> thing is I think python is more useful for me as a general language
<ImJune> but ruby seems great for web developer and many people say its pleasant to code with in that
<tubbo> why do you say that ImJune?
<havenwood> ImJune: I'd suggest just installing Ruby for rbenv with ruby-install instead of rbenv's ruby-build - but if you can get ruby-build to stop erroring that works too: https://github.com/postmodern/ruby-install#integration
<havenwood> ImJune: Ruby is a general purpose language like Python
sigurding has quit [Quit: sigurding]
<ImJune> because python is widely supported for use with the automation tools I use now
<tubbo> python is pretty awesome, honestly the differences seem to come down to your own values
<ImJune> well I feel I can like them both
<tubbo> like what do *you* want out of your code
<ImJune> to be honest
<DaniG2k> I love how python 3 came out 10 years ago and hardly anyone has made the switch from 2.7
sigurding has joined #ruby
<DaniG2k> lololo
<havenwood> ImJune: It's an aesthetic choice. I have just a cat but if you'd like a dog or a cat and a dog go for it!
<ImJune> everyone in my company know both devoperations and developer is using python
<havenwood> ImJune: But whatever you choose, be aware that cats are superiour.
<ImJune> I like cats man
<ImJune> surely
<tubbo> just make sure you are feeding your pets with Vim, not Emacs.
<havenwood> ImJune: phew
roshanavand has joined #ruby
<ImJune> haven it denied me
<ImJune> permission
<ImJune> should I try as root
Drakevr has joined #ruby
<mikecmpbll> is there a ruby lib which parses "user@iporhostname:/some/path" type paths?
podman has joined #ruby
Drakevr has quit [Changing host]
Drakevr has joined #ruby
karapetyan has joined #ruby
<mikecmpbll> ack nvm, URI does i just needed to prefix it with the scp:// protocol
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
<havenwood> ImJune: Is there already a ~/.rbenv/versions dir? What do those permissions look like?
<ImJune> I did it as root it worked
<ImJune> It's true a Japanese guy made this language
bMalum has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
drptbl has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
framling has quit [Ping timeout: 250 seconds]
howdoicomputer has joined #ruby
lindistock has joined #ruby
dlitvak has joined #ruby
<ImJune> ls
<ImJune> oops
<Bish> No Permission
kalopsian has joined #ruby
roshanavand has quit [Remote host closed the connection]
<ImJune> drwxr-xr-x. 10 root root 4096 Jan 21 13:58 .rbenv
ajf- has joined #ruby
dfinninger has quit [Remote host closed the connection]
<Bish> ImJune: well that folder is owned by root, so you wont be able to access it besides reading
<ImJune> guess I can chmod now
<ImJune> moment
dfinninger has joined #ruby
dfinninger has quit [Read error: Connection reset by peer]
ajf- has quit [Client Quit]
sgambino has joined #ruby
dfinninger has joined #ruby
karapetyan has quit [Ping timeout: 272 seconds]
dlitvak__ has quit [Ping timeout: 276 seconds]
ajf- has joined #ruby
polishdub has joined #ruby
rodfersou|lunch is now known as rodfersou
howdoicomputer has quit [Ping timeout: 264 seconds]
dfinninger has quit [Remote host closed the connection]
curses has quit []
usershell has joined #ruby
hxegon has quit [Ping timeout: 260 seconds]
roshanavand has joined #ruby
usershell has quit [Remote host closed the connection]
puria has joined #ruby
usershell has joined #ruby
roshanavand has quit [Remote host closed the connection]
bklane has joined #ruby
bronson has joined #ruby
roshanavand has joined #ruby
<shevy> DaniG2k it causes quite some headache... for instance, gdk-pixbuf still insists on python 2.x for compilation, so I need it available if I want to upgrade ... so now I always have to use both python versions, that is such a huge mess for build systems... :(
howdoi has quit [Quit: Connection closed for inactivity]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
platzhirsch has left #ruby [#ruby]
scripore has quit [Quit: This computer has gone to sleep]
usershell has quit [Ping timeout: 265 seconds]
bronson has quit [Ping timeout: 265 seconds]
hxegon has joined #ruby
<ImJune> So I changed the permissions for the folder and it seems to be hanging
jas02 has quit [Quit: jas02]
<ImJune> does it usually take a long tiime
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<ImJune> rbenv install 2.2.2
mfb2 has quit [Remote host closed the connection]
dlitvak_ has joined #ruby
aufi has quit [Quit: Konversation terminated!]
anisha_ has quit [Quit: Leaving]
atomical_ has joined #ruby
roshanavand has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 265 seconds]
rburton has joined #ruby
bklane has quit [Ping timeout: 250 seconds]
gruz0 has joined #ruby
<rburton> did the 2.3.0 ruby tarball get updated? my distro is reporting that the shasum has changed.
<tubbo> it usually takes a little bit, ImJune
aegis3121 has quit [Ping timeout: 256 seconds]
<rburton> "File: '/home/ross/Yocto/downloads/ruby-2.3.0.tar.gz' has sha256 checksum ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507 when 5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44 was expected"
<shevy> official tarball is at ftp://ftp.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.xz
momomomomo has joined #ruby
<rburton> the web site says ba5 is the right checksum, but at some point in the past our distro insists it was 5ffc0
<shevy> I get this shasum: 96e620e38af351c8da63e40cfe217ec79f912ba1 ruby-2.3.0.tar.xz
momomomomo has quit [Client Quit]
dfinninger has joined #ruby
<chris2> i have ec7579eaba2e4c402a089dbc86c98e5f1f62507880fd800b9b34ca30166bfa5e for .bz2
<rburton> oh, i'm talking about the gz
<rburton> sorry :)
<shevy> ah yes now I see it... did not see the .tar.gz before
atomical has quit [Ping timeout: 245 seconds]
startupality has quit [Quit: startupality]
sgambino has quit [Read error: Connection reset by peer]
bklane has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
bklane_ has joined #ruby
<rburton> ok panic over, broken patches locally
rburton has left #ruby [#ruby]
slawrence00 has joined #ruby
startupality has joined #ruby
bklane has quit [Read error: Connection reset by peer]
asccigcc has joined #ruby
hxegon has quit [Ping timeout: 265 seconds]
gagrio has quit [Ping timeout: 265 seconds]
scripore has joined #ruby
lxsameer has quit [Quit: Leaving]
tvw has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
karapetyan has joined #ruby
c0m0 has quit [Ping timeout: 245 seconds]
kobain has quit [Ping timeout: 240 seconds]
<ImJune> this is what happens
mchu has joined #ruby
Rodya_ has joined #ruby
sgambino has joined #ruby
mfb2 has joined #ruby
rsc___ has joined #ruby
sergey_makagon has quit []
x77686d has joined #ruby
synthroid has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 240 seconds]
<gizmore> ImJune: cat /home/nixadmin/.gem/ruby/extensions/x86_64-linux/nokogiri-1.6.7.2/gem_make.out
<ImJune> ok
burbus has quit [Remote host closed the connection]
Bsian has quit [Ping timeout: 252 seconds]
sgambino has quit [Client Quit]
puria has quit [Quit: Leaving]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jbrhbr has joined #ruby
rsc___ has quit [Client Quit]
<ImJune> @giizmore
sgambino has joined #ruby
casadei has quit [Remote host closed the connection]
<ImJune> it mention that I need to install development tools but I am not sure which ones are needed
tomchapin has joined #ruby
<ImJune> I know that many rails developer like to used debian forks like ubuntu etc but surely I am leaving fedora
<havenwood> ImJune: I'd again recommend ruby-install over ruby-build, since it installs deps for you, etc, etc.
<ImJune> do you have a doc page for those things
fsapo has quit [Remote host closed the connection]
<ImJune> ruby install rails?
Spami_ has joined #ruby
Spami has quit [Ping timeout: 265 seconds]
bklane_ has quit [Ping timeout: 256 seconds]
bklane has joined #ruby
User458764 has joined #ruby
jam_ has joined #ruby
hornairs has joined #ruby
bklane_ has joined #ruby
bklane has quit [Read error: Connection reset by peer]
<ImJune> I think I will give up
ajf- has quit [Ping timeout: 272 seconds]
dhollinger has joined #ruby
<havenwood> sudo ruby-install --latest --system ruby && sudo gem install rails
momomomomo has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
<havenwood> ImJune: Yeah, if you can't get home dir permissions or packages working on Fedora maybe best to stick to a more familiar OS.
domgetter has joined #ruby
jam_ has quit [Ping timeout: 265 seconds]
<ImJune> I got the permissions working
<havenwood> RVM or ruby-install will do deps for you.
<domgetter> Ox0dea: I figured out my curses problem. I didn't have libgmp-dev installed
Pupeno has quit [Remote host closed the connection]
<havenwood> ImJune: If you want to install dev group stuff yourself looking into dnf groups.
duckpuppy has quit [Ping timeout: 272 seconds]
Spami_ has quit [Read error: Connection reset by peer]
<havenwood> look into*
Spami_ has joined #ruby
bklane_ has quit [Ping timeout: 245 seconds]
<havenwood> Or something like: sudo dnf install -y gcc automake gdbm-devel libffi-devel libyaml-devel openssl-devel readline-devel zlib-devel
EdwardIII has left #ruby [#ruby]
<havenwood> ImJune: rbenv and ruby-build have Wikis I believe if you want to go with their preferred way
bklane has joined #ruby
<ImJune> I am working on the dnf stuff
<ImJune> moment I will post what ends up working
chouhoulis has joined #ruby
mchu has quit [Quit: mchu]
hanneli has joined #ruby
Eggskiwi is now known as Snowy
genpaku has quit [Ping timeout: 272 seconds]
Rodya_ has quit [Remote host closed the connection]
JohnT has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
hannelita has quit [Ping timeout: 240 seconds]
genpaku has joined #ruby
dlitvak_ has quit [Remote host closed the connection]
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arup___ has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
huyderman has joined #ruby
bklane_ has joined #ruby
<ImJune> seems rails is not very well supported in this fedora community
cout_ is now known as cout
<havenwood> ImJune: I think you're wrong.
bklane has quit [Read error: Connection reset by peer]
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
jackjackdripper has joined #ruby
ajf- has joined #ruby
djbkd has quit [Quit: My people need me...]
sftrabbit has joined #ruby
<ImJune> Oh
<ImJune> it worked
<ImJune> thought it was going to fail
<havenwood> ImJune: sudo dnf install -y ruby
<havenwood> ImJune: done.
<ImJune> nope that didnt do it
<havenwood> ImJune: yeah, follow htat
<ImJune> [nixadmin@localhost ~]$ rails --version Rails 4.2.3
<havenwood> ImJune: Works on my machine.
synthroid has joined #ruby
<ImJune> you are using fedora?
<havenwood> ImJune: I have a Fedora box.
<ImJune> oh in VM
<ImJune> ok
<ImJune> I have this on baremetal
<ImJune> but either way if I can start trying out on maremetal
<ImJune> baremetal that is I feel it is more fun to try to get it working without falling back to windows just opinion
floatingpoint has joined #ruby
mchu has joined #ruby
bklane_ has quit [Read error: Connection reset by peer]
duckpuppy has joined #ruby
Pupeno has quit [Ping timeout: 265 seconds]
stamina has quit [Ping timeout: 245 seconds]
PedramT has joined #ruby
bklane has joined #ruby
ferr has quit [Ping timeout: 265 seconds]
ldnunes_ has joined #ruby
imperator has joined #ruby
Rodya_ has joined #ruby
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Bsian has joined #ruby
<Bsian> I need help. I have an array of objects sorted on database level. Let's imagine that objects are arrays (just to represent their properties). But I need to split the array on chunks and then sort each chunk by some other rules. I' have sort_chunk method so the problem in splitting on chunks only. http://hastebin.com/enecahebad.js
aganov has quit [Remote host closed the connection]
<imperator> I don't suppose anyone here has any experience with WinRM and multiple hops from a Linux/OSX box, do they?
DonOtreply has joined #ruby
karapetyan has joined #ruby
vikaton has joined #ruby
carella has quit []
<apeiros> bsian: what's your question? how to perform said chunking?
ldnunes has quit [Ping timeout: 272 seconds]
howdoi has joined #ruby
bklane has quit [Read error: Connection reset by peer]
mfb2 has quit [Remote host closed the connection]
<Bsian> apeiros: yes, exactly. I've heard about chunk_while but it's in ruby 2.3 only
melter has joined #ruby
bklane has joined #ruby
<apeiros> chunk exists before 2.3
blarghlarghl has joined #ruby
PedramT has quit [Remote host closed the connection]
<apeiros> but if you don't have the current version of ruby and ask questions, you absolutely should mention which version you do have.
FooMunki has quit [Quit: FooMunki]
karapetyan has quit [Ping timeout: 245 seconds]
<blarghlarghl> Hi all. I'd like to cleanly redefine a initialize() method for a class. We have a class that temporarily needs a monkey patch, and for reasons, I can't subclass. I'd like to be able to do the equivalent of class Foo; def initialize(arg); do_fix; super(arg); end; end, except of course super won't work since I'm not subclassing.
DonOtreply has quit [Client Quit]
<Bsian> apeiros: sorry, my bad. I don't have Ruby2.3. So I believe the only problem I have is chunking. As once I get chucked set of object I can sort each chunk and get proper resulting array
<blarghlarghl> and as apeiros rightly says, I should mention we're running 2.1.4. :)
DexterLB has quit [Read error: Connection reset by peer]
<Bsian> Ruby version: 2.2.3
<apeiros> blarghlarghl: if "temporarily" means "not all instances, but permanently on that instance is fine", then you can use Object#extend
jottr has joined #ruby
<apeiros> bsian: 2.2 has Enumerable#chunk
<apeiros> ary.chunk { |a,*| a }.map(&:last)
<apeiros> in your example
momomomomo has joined #ruby
<blarghlarghl> apeiros: Sadly, I mean "all instances, but we expect an upstream fix within a few weeks, which is why a *slightly* hacky solution is fine"
<apeiros> blarghlarghl: but this question has quite a code smell in it - why do you need a monkey patch? and what prohibits a global monkey patch?
dcunit3d has joined #ruby
<apeiros> I think 2.1 already had refinements. depending on the answer to "why", you can use that.
<blarghlarghl> apeiros: It's vendored software and the class definitions come directly from an external library (i.e. language bindings). Nothing prohibits a global monkey patch - but I just want to know how to best monkeypatch the intializer for the class. I dislike monkeypatching, so I don't know what best practices are when I have to do it. Especially since the last time I had to, it was done with alias_method, which I think is a 1.8.x-ism.
<apeiros> blarghlarghl: it very much sounds like any other variant will be worse, especially given that it'll be a temporary workaround.
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<blarghlarghl> apeiros: so: alias_method :initialize, :old_initialize; def initialize(arg); ... old_initialize(arg); end
<apeiros> blarghlarghl: what we did in such cases was one of a) clone gem, put it on local git server, patch the gem, reference our git server in the Gemfile, or b) in the app, require 'patches/gemname', and in there, require 'relevant/class'; PATCH
DexterLB has joined #ruby
TomyWork has quit [Ping timeout: 248 seconds]
<apeiros> no alias. just plain redefine.
bklane has quit [Read error: Connection reset by peer]
<apeiros> and once the patch is released, with a) obviously reference the gem again, and in b) drop the patch require
pdoherty has quit [Remote host closed the connection]
DonOtreply has joined #ruby
<blarghlarghl> apeiros: thing is, it's a .so file. I have no idea what the class does internally.
bklane has joined #ruby
Rodya_ has quit [Remote host closed the connection]
<apeiros> in that case, b), if you need to call the original initialize, then yes, do that alias dance.
<blarghlarghl> apeiros: I just know that it's expecting an argument wrongly. Specifically, it expects a string argument, and the string has to be UTF-32le encoded.
<blarghlarghl> apeiros: and that's all, it's just that, which is why I want a light-touch approach here until there's a fix out for that.
TomPeed has quit [Read error: Connection reset by peer]
pdoherty has joined #ruby
<blarghlarghl> OK, b it is! thanks apeiros
<apeiros> yw
codecop has joined #ruby
usershell has joined #ruby
dfinninger has quit [Remote host closed the connection]
bklane_ has joined #ruby
casadei has joined #ruby
amclain has joined #ruby
Amnez777 has quit [Ping timeout: 264 seconds]
agit0 has quit [Quit: zzzZZZ….]
cbyrda has joined #ruby
mfb2 has joined #ruby
Lucky__ has joined #ruby
wldcordeiro has quit [Ping timeout: 272 seconds]
bklane has quit [Ping timeout: 245 seconds]
cschneid_ has joined #ruby
FooMunki has joined #ruby
lucasb has quit [Quit: leaving]
zambini has joined #ruby
rkazak has joined #ruby
TomPeed has joined #ruby
zast has joined #ruby
shredding has quit [Ping timeout: 240 seconds]
zambini has quit [Read error: Connection reset by peer]
PedramT has joined #ruby
yardenbar has quit [Ping timeout: 276 seconds]
zambini has joined #ruby
dfinninger has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
graphettion has joined #ruby
rkazak has quit [Ping timeout: 250 seconds]
djbkd has joined #ruby
dcunit3d has quit [Ping timeout: 250 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
dlitvak has joined #ruby
[Butch] has joined #ruby
TomyLobo has joined #ruby
arup_r has joined #ruby
usershell has quit [Remote host closed the connection]
joonty has quit [Ping timeout: 240 seconds]
<floatingpoint> what exactly does "stack level too deep" in rspec indicate?
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros> floatingpoint: an infinite recursion
<apeiros> and s/in rspec//
pietr0 has joined #ruby
ruby881 has joined #ruby
djbkd has quit [Ping timeout: 240 seconds]
FooMunki has quit [Quit: FooMunki]
<apeiros> it can of course also just mean too many nested method calls without having an infinite recursion. but that's rather rare.
<floatingpoint> ok. how would one go about debugging this? for the record, I'm rspecing chef code
<apeiros> you would read the backtrace and figure where it starts recurring and then why it does so infinitely.
duckpuppy has quit [Ping timeout: 245 seconds]
bklane_ has quit [Ping timeout: 272 seconds]
bklane has joined #ruby
slawrence00 has quit [Excess Flood]
<floatingpoint> interesting. -b isn't printing a backtrace
hxegon_ has joined #ruby
hxegon_ has left #ruby ["PEACE OUT"]
hxegon has joined #ruby
pulgolino has joined #ruby
tildes has joined #ruby
ruby881 has quit [Quit: Page closed]
Xeago has quit [Remote host closed the connection]
hornairs has quit [Quit: hornairs]
Xeago has joined #ruby
usershell has joined #ruby
hanneli has quit [Remote host closed the connection]
antgel has quit [Ping timeout: 256 seconds]
hannelita has joined #ruby
x77686d has quit [Quit: x77686d]
ProofTechnique has joined #ruby
DaniG2k has quit [Quit: leaving]
vondruch has quit [Ping timeout: 240 seconds]
ajf- has quit [Quit: Textual IRC Client: www.textualapp.com]
sleetdrop has quit [Quit: Computer has gone to sleep.]
dlitvak has quit [Remote host closed the connection]
mark2 has quit [Remote host closed the connection]
f0ster_ has joined #ruby
Rickmasta has joined #ruby
baweaver has joined #ruby
symm- has joined #ruby
sneakerhax has quit [Quit: Leaving]
slash_nick is now known as slash_quit
karapetyan has joined #ruby
sts___ is now known as sts
chthon has quit [Ping timeout: 245 seconds]
neohunter has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
wolfedale has joined #ruby
<wolfedale> Hello :-)
neohunter has joined #ruby
<neohunter> xx
<ProofTechnique> Anyone have experience with roar and grape-entity and have some points of comparison?
Rickmasta has quit [Ping timeout: 260 seconds]
sgambino has joined #ruby
f0ster_ is now known as f0ster
f0ster has quit [Changing host]
f0ster has joined #ruby
<neohunter> im having this error /Users/arnoldroa/.rvm/gems/ruby-2.1.2/gems/psd-2.1.2/lib/psd/layer_info/typetool.rb:126:in `join': incompatible character..... I added a binding.pry inside that file and it doesnt stop. why?
dlitvak has joined #ruby
<neohunter> even tried with a raise, is like the file is not updated
sigurding has quit [Quit: sigurding]
sgambino has quit [Max SendQ exceeded]
<shevy> what is incompatible character... that can not be the full error?
karapetyan has quit [Ping timeout: 240 seconds]
weckl has quit [Remote host closed the connection]
<ProofTechnique> Roar looks more featureful, but I don't know if those features are really useful in practice. grape-entity seems pretty zero effort, with really transparent document nesting syntax, but I like the idea of updating a model based on parsing a document in roar.
amoeba has joined #ruby
<amoeba> anyone ever used net/ssh to chroot then execute commands?
benlieb has joined #ruby
xpt has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
<ProofTechnique> Free JSON-HAL, JSON-API, and XML in roar is also kind of attractive
PedramT has quit [Remote host closed the connection]
<neohunter> shevy: yeah, i dont care too much about the error.. is invalid encoding.. but i want to debug the gem... but i dont understnad why, if i modified the file on the gem, why it dont got executed
Bsian has quit [Quit: Page closed]
nertzy2 has joined #ruby
TomPeed has quit [Read error: Connection reset by peer]
system64 has quit [Quit: Connection closed for inactivity]
wldcordeiro has joined #ruby
PedramT has joined #ruby
bklane has quit [Ping timeout: 250 seconds]
scripore has quit [Quit: This computer has gone to sleep]
scripore has joined #ruby
mistnim has joined #ruby
jbrhbr has quit [Quit: Leaving.]
TomPeed has joined #ruby
<neohunter> so basically, if i receive this error: /Users/arnoldroa/.rvm/gems/ruby-2.1.2/gems/psd-2.1.2/lib/psd/layer_info/typetool.rb:126:" and I modify that file, why I run the script again and my code is not evaluated?
chadhs has joined #ruby
lindistock has quit [Remote host closed the connection]
howdoicomputer has joined #ruby
TomPeed has quit [Read error: Connection reset by peer]
Limix has joined #ruby
wilbert_ has joined #ruby
dlitvak_ has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
TomPeed has joined #ruby
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
howdoicomputer has quit [Ping timeout: 260 seconds]
Ebok has joined #ruby
atomical_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has quit [Ping timeout: 240 seconds]
pilne has joined #ruby
karapetyan has quit [Remote host closed the connection]
TomPeed has quit [Read error: Connection reset by peer]
Bloomer has quit [Remote host closed the connection]
scottschecter has quit [Quit: Leaving]
crdpink has quit [Quit: q term]
<mistnim> what does this mean? "Exceptions [in ruby] work in a similar manner [to C++], though the keyword names have been changed to protect the innocent."
huQeQwdpu47q has joined #ruby
DenSchub has quit [Read error: Connection reset by peer]
PedramT has quit [Remote host closed the connection]
DenSchub has joined #ruby
<ProofTechnique> It's a joke.
<ProofTechnique> It just means that exceptions work like they do in C++, but the keywords are different.
<mistnim> ProofTechnique: yes I figured, but I don't get the joke
bronson has joined #ruby
<ProofTechnique> It's from the opening narration
PedramT has joined #ruby
sftrabbit has joined #ruby
Xeago has quit [Remote host closed the connection]
terminalrecluse has joined #ruby
<mistnim> ProofTechnique: thanks
crdpink has joined #ruby
karapetyan has joined #ruby
devbug has joined #ruby
momomomomo has quit [Quit: momomomomo]
startupality has quit [Quit: startupality]
scripore has quit [Quit: This computer has gone to sleep]
bronson has quit [Ping timeout: 265 seconds]
bklane has joined #ruby
dopie has quit [Quit: Lost terminal]
FernandoBasso has quit [Quit: Leaving]
M-shine has quit [Quit: node-irc says goodbye]
karapetyan has quit [Remote host closed the connection]
TomPeed has joined #ruby
gruz0 has quit [Quit: Leaving]
Jackneill has joined #ruby
casadei has quit [Remote host closed the connection]
ESpiney_ has joined #ruby
SCHAAP137 has joined #ruby
rakm has joined #ruby
scripore has joined #ruby
f3ttX] has joined #ruby
myntcake has quit [Quit: Leaving]
karmatr0n has quit [Ping timeout: 264 seconds]
rails has joined #ruby
DonOtreply_ has joined #ruby
<rails> can someone recommend a better way to write this? if previos commands fail , it still runs, the code is also very ugly http://pastebin.com/TarfdS7u
<ruby[bot]> rails: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/98a578a5c62025b8c0f7
<ruby[bot]> rails: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
TomPeed has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
<rails> thank ruby bot
rtail has joined #ruby
benlieb has quit [Quit: benlieb]
DonOtreply has quit [Ping timeout: 250 seconds]
DonOtreply_ is now known as DonOtreply
ESpiney has quit [Ping timeout: 240 seconds]
yardenbar has joined #ruby
Amnez777 has joined #ruby
dmolina has quit [Quit: Leaving.]
CloCkWeRX has joined #ruby
<apeiros> ?justabot rails
<ruby[bot]> rails: I'm just a bot. You don't need to address me.
mikecmpbll has joined #ruby
<apeiros> rails: take a look at the FileUtils module. wrt tar, I'd probably shell out for that even though ruby gems exist.
karapetyan has quit [Remote host closed the connection]
lucasb has joined #ruby
sigurding has joined #ruby
bklane has quit [Remote host closed the connection]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
f4cl3y has quit [Ping timeout: 240 seconds]
Amnez777 has quit [Changing host]
Amnez777 has joined #ruby
karapetyan has joined #ruby
chadhs has quit [Quit: Textual IRC Client: www.textualapp.com]
karapetyan has quit [Remote host closed the connection]
dopie has joined #ruby
roshanavand has joined #ruby
Eiam_ has joined #ruby
dlitvak_ has quit [Remote host closed the connection]
rakm has joined #ruby
<shevy> lol
Jackneill has quit [Quit: Leaving]
<shevy> they still thank the bot
djbkd has joined #ruby
<apeiros> shevy: see
troulouliou_div2 has joined #ruby
rtail_ has joined #ruby
<drbrain> rails: I'll second FileUtils. Also, `` sets $? (the last process status) so you can `` if $?.success
darkxploit has joined #ruby
hanneli has joined #ruby
ec has quit [Disconnected by services]
ec^ is now known as ec
sgambino has joined #ruby
Nyammy_Work has joined #ruby
bklane has joined #ruby
jbrhbr has joined #ruby
nertzy2 has quit [Quit: This computer has gone to sleep]
hannelita has quit [Ping timeout: 265 seconds]
<rails> drbrain: yeah, I love the `` if $?.success idea
ramfjord has joined #ruby
<apeiros> drbrain: btw., wasn't conundrum your bot?
<drbrain> rails: $? is a Process::Status object, so you can look up documentation on what else it has
sftrabbit has quit [Quit: sftrabbit]
<drbrain> apeiros: yes, I've still got its data files lying around somewhere
rdark has quit [Ping timeout: 240 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
rtail_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<rails> does ruby have something like this? https://clojuredocs.org/clojure.core/-%3E that is one ofthe things i loved from clojure
<apeiros> drbrain: oh that might be interesting. do you wish anything from it imported into ruboto?
Jammy_Work has quit [Ping timeout: 256 seconds]
<drbrain> I don't think there's anything interesting there except the logs
<drbrain> but I think whitequark's log bot duplicates most of my logs
<apeiros> ok. the logs I'm actually interested in too. but that doesn't hurry.
karapetyan has joined #ruby
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
<apeiros> I think whitequark came quite a bit after conundrum started to exist. after all, conundrum was around when I started using IRC for ruby :)
rtl has joined #ruby
<apeiros> but for whitequark's log I've already written an importer :D
Xeago has joined #ruby
<drbrain> you'll have to remind me periodically to bring them up
ProofTechnique has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rails is now known as jtoy
<apeiros> ok. I barely remember conundrum. but it did have a factoids plugin too, right? iirc it was an rbot?
troulouliou_div2 has quit [Quit: Leaving]
<drbrain> yeah, it was an rbot
<shevy> oh dear god I remember rbot
<drbrain> I'm pretty sure the factoids were 95% junk
<shevy> I think I tried to download it in 2003 or so to study how to write an IRC bot in ruby
iateadonut has quit [Quit: Leaving.]
<mg^> first factoid bot I ever encountered was purl in efnet #perl
yardenbar has quit [Ping timeout: 245 seconds]
<mg^> now ~15% of my job is supporting "chatops" at my workplace using Lita
<apeiros> drbrain: that's why I've added a usage counter to mine. I intend to deprecate junk.
aegis3121 has joined #ruby
choke has joined #ruby
craigp has joined #ruby
felixal has quit [Ping timeout: 250 seconds]
Snowy has quit []
<drbrain> I'm pretty sure I'd cleaned out all of dross' contributions, but I wonder if I got all of them
moei has joined #ruby
<apeiros> heh, dross must have been a pain. was before my time, though.
nertzy2 has joined #ruby
<apeiros> I originally thought dross was the one who founded this channel, and thought that was one of the reasons it couldn't be merged. but fflush seems to be a different person?
arlek has joined #ruby
<chris2> jikes
<chris2> i read names i was happy to forget about :P
jam_ has joined #ruby
dlitvak has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
zapata has joined #ruby
CaptainAl has quit [Quit: CaptainAl]
shadoi has joined #ruby
baweaver has joined #ruby
<neohunter> Wow, still not able to understand! why if I modified a file in my .rvm gems folder, it get cached or not evaluated after some time have lapsed?
duckpuppy has joined #ruby
<neohunter> i run the script again with requires the gem and still using an old version
kadoppe_ has quit [Ping timeout: 256 seconds]
Azulinho has quit [Ping timeout: 240 seconds]
<apeiros> neohunter: you can always inspect $LOADED_FEATURES (aka $") to see which file actually gets loaded
<apeiros> probably you edited the wrong gem
kadoppe has joined #ruby
<neohunter> apeiros i know is the right file because i went to lunch, and went i came back my edit was working, i removed the lines and it .. continue working (raise with custom message) even when the line was already removed...
<neohunter> but when I initially added the raise it didnt work
pawnbox has quit []
deweysdecimal has joined #ruby
jam_ has quit [Ping timeout: 245 seconds]
karapetyan has quit [Remote host closed the connection]
<neohunter> Found it!
<neohunter> bundle caches it
<neohunter> .rvm/gems/ruby-2.1.2/cache
arup_r has quit []
arlek has quit [Ping timeout: 276 seconds]
baweaver has quit [Ping timeout: 256 seconds]
yardenbar has joined #ruby
sneakerhax has joined #ruby
devbug_ has joined #ruby
sigurding has quit [Quit: sigurding]
jbrhbr has quit [Quit: Leaving.]
x77686d has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jottr_ has joined #ruby
imperator has left #ruby ["Leaving"]
ProofTechnique has joined #ruby
ProofTechnique has quit [Remote host closed the connection]
nofxx has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
devbug has quit [Ping timeout: 250 seconds]
last_staff has quit [Quit: last_staff]
felixal has joined #ruby
Pupeno has joined #ruby
jottr has quit [Ping timeout: 272 seconds]
howdoicomputer has joined #ruby
deweysdecimal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roshanavand has quit [Remote host closed the connection]
zambini has quit [Quit: Leaving.]
Xeago has quit [Read error: Connection reset by peer]
mrsolo_ has joined #ruby
cschneid_ has quit [Ping timeout: 250 seconds]
jbrhbr has joined #ruby
zambini has joined #ruby
dlitvak_ has joined #ruby
Xeago has joined #ruby
baweaver has joined #ruby
Pupeno has quit [Ping timeout: 250 seconds]
dlitvak has quit [Ping timeout: 240 seconds]
justicefries has joined #ruby
hanneli has quit [Remote host closed the connection]
howdoicomputer has quit [Ping timeout: 260 seconds]
baweaver has quit [Remote host closed the connection]
baweaver has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
joonty has joined #ruby
mchu has quit [Quit: mchu]
hays has joined #ruby
mchu has joined #ruby
darkf has quit [Quit: Leaving]
mchu has quit [Client Quit]
<drbrain> I wonder if dross even registered it
baweaver has quit [Remote host closed the connection]
vdamewood has quit [Quit: Life beckons.]
karapetyan has joined #ruby
f3ttX] has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
einarj has quit [Remote host closed the connection]
hahuang65 has quit [Quit: WeeChat 1.4]
cschnei__ has joined #ruby
Bloomer has joined #ruby
TomPeed has joined #ruby
jottr has joined #ruby
dfockler has joined #ruby
Xeago has quit [Remote host closed the connection]
jottr_ has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
wilbert_ has quit [Ping timeout: 250 seconds]
hayden_ has quit [Quit: Connection closed for inactivity]
cbyrda has quit [Quit: Gone]
Xeago has quit [Remote host closed the connection]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
craigp has quit [Remote host closed the connection]
wldcordeiro has quit [Quit: WeeChat 1.3]
ramfjord has quit [Ping timeout: 272 seconds]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wilbert_ has joined #ruby
choke has joined #ruby
aclearman037 has joined #ruby
Pupp3tm4st3r has joined #ruby
nertzy2 has quit [Quit: This computer has gone to sleep]
e4xit has joined #ruby
blaxter has quit [Quit: foo]
usershell has quit [Remote host closed the connection]
aclearman037 has quit [Quit: Textual IRC Client: www.textualapp.com]
nerium has joined #ruby
tildes has quit [Ping timeout: 240 seconds]
kadoppe has quit [Ping timeout: 240 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
frem has joined #ruby
scpike has joined #ruby
<scpike> exit
joonty has quit [Ping timeout: 240 seconds]
scpike has quit [Client Quit]
baweaver has joined #ruby
wolfedale has quit [Remote host closed the connection]
scpike has joined #ruby
aost has joined #ruby
scpike has quit [Client Quit]
zast has quit [Remote host closed the connection]
Rickmasta has joined #ruby
duckpuppy has quit [Quit: WeeChat 1.4]
sharms has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
x0f_ has quit [Ping timeout: 272 seconds]
<hxegon> >> [[1], [2]].each {|e| e.each(&method(:p)) } # is there a cleaner way to do call blocks on nested arrays like this?
m8 has quit [Quit: Sto andando via]
<ruby[bot]> hxegon: # => 1 ...check link for more (https://eval.in/506035)
x0f has joined #ruby
<hxegon> yes brain. do call. sure.
cdg has quit [Remote host closed the connection]
momomomomo has joined #ruby
arthropododo has joined #ruby
<norc> hxegon, flatten first?
Rickmasta has quit [Ping timeout: 256 seconds]
<hxegon> norc not the kind of thing I was thinging of, but that works anyway. Thanks!
ur5us has joined #ruby
juddey has joined #ruby
craigp has joined #ruby
jbrhbr has quit [Ping timeout: 265 seconds]
jbrhbr has joined #ruby
PedramT has quit [Remote host closed the connection]
dcunit3d has joined #ruby
edwinvdgraaf has joined #ruby
cloudyhls has joined #ruby
PedramT has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<cloudyhls> whats good
Shaboum is now known as _Sh4b0um_
Limix has quit [Read error: Connection reset by peer]
_Sh4b0um_ is now known as Shaboum
arthropododo has quit [Quit: Page closed]
<eam> >> ObjectSpace.each_object.select { |o| o =~ /good/ rescue false }.uniq
<ruby[bot]> eam: # => ["good", " ObjectSpace.each_object.select { |o| o =~ /good/ rescue false }.uniq\n"] (https://eval.in/506036)
<eam> not much
<cloudyhls> basssiiccc
cloudyhls has quit [Quit: Leaving]
edwinvdgraaf has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
dasher00 has quit [Ping timeout: 240 seconds]
sandstrom has joined #ruby
symbol_ has joined #ruby
sandstrom has quit [Client Quit]
<hxegon> eam just tried that in pry, [4] is 'We dont have to take our clothes off to have a good time\n we could dance & party all night And drink some cherry wine. --Jermaine Stewart'
arthropododo has joined #ruby
<eam> hot damn
SenpaiSilver has joined #ruby
hahuang65 has joined #ruby
<eam> gems/pry-0.10.3/lib/pry/commands/easter_eggs.rb
<eam> command "get-naked", "" do
<eam> loooooool
mchu has joined #ruby
bklane has quit [Ping timeout: 240 seconds]
Encapsulation has quit [Remote host closed the connection]
iamvery_ has quit [Quit: ZNC - 1.6.0 - http://znc.in]
bklane has joined #ruby
ramfjord has joined #ruby
Encapsulation has joined #ruby
<hxegon> my god... the eighties... https://www.youtube.com/watch?v=ilQQb0ps34o
arup_r has joined #ruby
<eam> what a delightful turn of events we've encountered
dlitvak_ has quit [Ping timeout: 272 seconds]
hannelita has joined #ruby
dlitvak has joined #ruby
<hxegon> I never thought I would be able to argue that a Jermaine Stewart music video link was on topic.
polishdub has quit [Quit: Leaving]
<hxegon> >> get-naked # does this use pry?
<ruby[bot]> hxegon: # => undefined local variable or method `get' for main:Object ...check link for more (https://eval.in/506037)
<hxegon> aww
<eam> we would've seen it in the objspace filter!
kadoppe has joined #ruby
* hxegon slaps forehead
sftrabbit has joined #ruby
moei has quit [Quit: Leaving...]
Dimik has joined #ruby
hannelita has quit [Ping timeout: 245 seconds]
Bloomer has quit [Remote host closed the connection]
bronson has joined #ruby
Azulinho has joined #ruby
karapetyan has joined #ruby
<mistnim> I am the only one who just can't stand python style colon blocks, and loves ruby syntax?
Muz has quit [Quit: leaving]
Muz has joined #ruby
Muz has quit [Client Quit]
* hxegon looks at channel name
Muz has joined #ruby
dlitvak has quit [Remote host closed the connection]
babblebre has quit [Quit: Connection closed for inactivity]
<momomomomo> colon blocks don't bug me, spacing delimited line breaks do
<momomomomo> er
<momomomomo> spacing based syntax
<hxegon> I actually enjoyed pythons indentation based stuff.
bronson has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
<mistnim> I think it's a matter of symmetry, my brain feels the need for a closing statement, balance
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
wilbert_ has quit [Ping timeout: 256 seconds]
<hxegon> mistnim having six ends in a row can get be pretty not great too :P
<momomomomo> it makes code like https://github.com/snikolov/rumor/blob/master/processing.py#L103-L298 (already too large of a function) too hard to read
<mistnim> hxegon: that's even worse, the abrupt ravine that there would be in python terrifies me
<hxegon> It was always super clear to me what was in which scope
mic_e has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mistnim> hxegon: yes, but mine is just a psychological/emotional issue
<mistnim> I'm not saying python is bad
DonOtreply has quit [Quit: DonOtreply]
Xeago has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
dwfait has quit [Remote host closed the connection]
<hxegon> yeah, your not saying python is bad, your just saying that whitespace is the devil, and columns of whitespace need to die before EOF.
radgeRayden_ has joined #ruby
<hxegon> I get it, we've all hatcheted some whitespace to death before, your among friends
blackmes1 has joined #ruby
User458764 has joined #ruby
Azulinho has quit [Remote host closed the connection]
astrofog has quit [Quit: Quite]
JohnT has joined #ruby
djellemah_ has joined #ruby
znz_jp has quit [Ping timeout: 240 seconds]
sgambino has joined #ruby
mic_e has quit [Ping timeout: 276 seconds]
babblebre has joined #ruby
djellemah has quit [Ping timeout: 250 seconds]
cicloid_ has quit [Quit: Adios!]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
zeroDivisible has joined #ruby
tomchapin has joined #ruby
huyderman has quit [Remote host closed the connection]
symbol_ has quit [Ping timeout: 264 seconds]
agit0 has joined #ruby
yfeldblum has joined #ruby
cicloid has joined #ruby
ldnunes_ has quit [Quit: Leaving]
FernandoBasso has joined #ruby
cicloid has quit [Client Quit]
Cohedrin has joined #ruby
ympeg has quit [Ping timeout: 264 seconds]
ElderFain has quit [Max SendQ exceeded]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cicloid has joined #ruby
ElderFain has joined #ruby
Xeago has joined #ruby
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ebok has joined #ruby
ascarter has joined #ruby
spider-mario has joined #ruby
huQeQwdpu47q has quit [Ping timeout: 245 seconds]
The_Phoenix has quit [Quit: Leaving.]
Xiti` has quit [Quit: Xiti`]
riceandbeans has joined #ruby
Xiti has joined #ruby
dfinninger has quit [Remote host closed the connection]
lucasb has quit [Quit: leaving]
juanpablo_ has joined #ruby
Ebok has quit [Ping timeout: 250 seconds]
baweaver has joined #ruby
aegis3121 has quit [Ping timeout: 240 seconds]
<riceandbeans> I'd like to be able to treat versions like floats, though I can't, someone suggested Gem::Version, but I seem to be doing something wring, can anyone help out?
<riceandbeans> I mean, as long as the minor is < 10 it would be fine, but beyond that it wouldn't work
<riceandbeans> I'd have to split on . and do a comparison of both values individually
ympeg has joined #ruby
x77686d has quit [Quit: x77686d]
<riceandbeans> I'd like to just be able to be like, if version < 5.1 do this
<riceandbeans> and then if the version is 5.3 it won't do anything
<riceandbeans> but NOT break if it's like version < 5.3 and then I have version 5.10 installed
lemur has joined #ruby
aegis3121 has joined #ruby
jam_ has joined #ruby
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wilbert_ has joined #ruby
tomchapin has joined #ruby
<apeiros> riceandbeans: Gem::Version is indeed a good way to go
baweaver has quit [Ping timeout: 245 seconds]
<apeiros> but without you providing actually useful info, we can't possibly tell you what you're doing wrong with it
<riceandbeans> one sec let me see what I can safely paste
<riceandbeans> ok
<riceandbeans> Gem::Version.create(default['foo']['version']['short'] < config['version.current'])
Xeago_ has joined #ruby
Lorn has joined #ruby
aegis3121 has quit [Ping timeout: 256 seconds]
Lorn has quit [Changing host]
Lorn has joined #ruby
lemur has quit [Ping timeout: 264 seconds]
Xeago has quit [Ping timeout: 272 seconds]
<riceandbeans> so, I have a file that's yaml, I parse it and call it config, I hit the version.current key in the file, and I want it to be a float of that idea before in chef with node['foo']['version']['short']
jam_ has quit [Ping timeout: 276 seconds]
rodfersou has quit [Quit: leaving]
<riceandbeans> I'm calling it short because there's also major.minor.revision, but I didn't think I could treat that as a float at all
<apeiros> uh… yeah…
<apeiros> Gem::Version.create(a < b) does NOT compare Gem::Version's
<apeiros> you're comparing a and b, and create a Gem::Version from the result
<riceandbeans> that's how I was told to write it from someone
<riceandbeans> a doesn't exist, b does
<riceandbeans> I want to populate a with b and treat it like a gem version for comparison
<apeiros> you want Gem::Version.create(a) < Gem::Version.create(b)
<apeiros> and I'd be pretty surprised if that person told you otherwise
<riceandbeans> I literally copy pasted what he said
<riceandbeans> I just changed a name for foo for you
freerobby has quit [Ping timeout: 250 seconds]
<apeiros> that code literally makes no sense :)
<riceandbeans> so b might be like 5.1, if I do this, can I then later say, if version < a ?
aost has quit [Remote host closed the connection]
<riceandbeans> err..
<riceandbeans> if a < 5.3
roshanavand has joined #ruby
<riceandbeans> basically, if your installed version is < whatever, do this
<apeiros> no. you have to create a Gem::Version. you can't just compare with a float.
<apeiros> a float ain't a version.
<riceandbeans> ok, so the actual comparison line with the action needs the code
<riceandbeans> if Gem::Version.create(a) < Gem::Version.create(b)
ur5us has quit []
<apeiros> you can create the Gem::Version instances wherever you want
<riceandbeans> but then how do I compare?
zambini has quit [Quit: Leaving.]
<apeiros> you… know ruby basics, yes?
<riceandbeans> yes
<riceandbeans> but you said I can't do < or >
<apeiros> no. pay attention.
<apeiros> I said you can't compare with a *float*
<apeiros> I did not say you can't do < or >.
<apeiros> your operands need to be Gem::Version instances. where/when you create them is irrelevant.
<riceandbeans> ok ok
<riceandbeans> so in this example, say installed version is 5.1 and I want to compare against 5.3
roshanavand has quit [Remote host closed the connection]
<riceandbeans> Gem::Version.create(a) < Gem::Version.create(5.3)
roshanavand has joined #ruby
djbkd has quit [Remote host closed the connection]
<apeiros> not sure whether Gem::Version.create accepts a float. might have to be a string.
<riceandbeans> Gem::Version.create(b) < Gem::Version.create(config['version.current'])
<riceandbeans> if b < a .... end
ympeg has quit [Ping timeout: 265 seconds]
djbkd has joined #ruby
<riceandbeans> is that more correct?
<newdan> "Constructs a Version from the version string. A version string is a series of digits or ASCII letters separated by dots."
howdoicomputer has joined #ruby
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
davedev2_ has quit [Ping timeout: 240 seconds]
<riceandbeans> but was I correct in the way I said it?
jackjackdripper has quit [Quit: Leaving.]
<riceandbeans> assign the version to compare against to one variable, assign the existing version to another variable, both as Gem::Version, and then later if a < b type deal
davedev24 has joined #ruby
<riceandbeans> pushing the code to test is a pain so I'd rather be a little close than test with like 20 iterations
<newdan> riceandbeans: Yeah, that sounds right
<riceandbeans> thank you
roshanavand has quit [Client Quit]
<newdan> riceandbeans: You can always just launch irb/pry and play around to make sure it works how you expect...
sediment has joined #ruby
djbkd has quit [Ping timeout: 245 seconds]
guacamole has joined #ruby
mfb2 has quit [Remote host closed the connection]
mchu has quit [Quit: mchu]
pdoherty has quit [Ping timeout: 256 seconds]
codecop has quit [Remote host closed the connection]
hannelita has joined #ruby
akem has joined #ruby
mchu has joined #ruby
<apeiros> riceandbeans: Gem::Version.create(b) does not turn b into a Gem::Version. that's not how it works.
elaptics is now known as elaptics`away
NightMonkey has joined #ruby
hxegon is now known as hxegon_AFK
<apeiros> b = Gem::Version.create(some_version_string_from_wherever) # now b references a Gem::Version
<apeiros> and then - assuming a is also a Gem::Version - you can do `if a < b`
ur5us has joined #ruby
<apeiros> and you're lacking greatly in the ruby basics. you should really pick up some good tutorial or book and improve it.
hannelita has quit [Ping timeout: 245 seconds]
baweaver has joined #ruby
nerium has quit [Quit: nerium]
treehug88 has quit [Read error: Connection reset by peer]
nerium has joined #ruby
dfinninger has joined #ruby
<newdan> apeiros: That last bit is basically exactly what he already said
fantazo has joined #ruby
<sediment> Hi all. I'm looking for some help with getting a gem to be recognized. Is here a good place to ask about that?
<sediment> I'm trying to use the truncate_html gem, which I've installed with 'gem install', and seemed to work
<sediment> the readme at https://github.com/hgmnz/truncate_html seems to suggest you can just use the truncate_html function, but this doesn't seem to work for me
huQeQwdpu47q has joined #ruby
einarj has joined #ruby
<ddfreyne> sediment: Looking at the code for that gem, it seems like that only works after a `include TruncateHtmlHelper`
huQeQwdpu47q has quit [Read error: Connection reset by peer]
<sediment> in irb, if I run "require 'truncate_html'" (which succeeds) and then run truncate_html(some_html, length: 15, omission: '...(continued)'), I get an error:
<sediment> NameError: undefined local variable or method `some_html' for main:Object
<ddfreyne> (I assume that Rails does the `include` automatically)
<ddfreyne> sediment: Replace some_html with the string that you want to truncate
<sediment> ah, yeah, I'm doing that, don't worry
<sediment> but I think you're right about including TruncateHtmlHelper
<sediment> doing that seems to help, but doesn't totally solve the problem... it then throws this:
<sediment> NoMethodError: undefined method `html_safe' for "...(continued)":String
<sediment> maybe it wants one of the other classes to be included?
<sediment> any thoughts?
dudedudeman has joined #ruby
<apeiros> sediment: sounds like that gem is made for rails
<apeiros> since rails defines String#html_safe
<sediment> OK. Yeah, I'm trying to use it without rails.
arup_r has quit []
<sediment> that's weird, because it says in the readme "It can be used with or without Rails."
pilne has left #ruby ["Leaving!"]
<ddfreyne> That might be a lie :o
<sediment> :o
<newdan> sediment: What gem?
PedramT has quit [Ping timeout: 264 seconds]
treehug88 has joined #ruby
<sediment> OK, I don't really want to install or run rails, so I'll try some other gem. I think there were a couple others that did a similar thing.
PedramT has joined #ruby
<dudedudeman> would sinatra work?
<sediment> that's another framework, right? I'd prefer not to install anything like that. It's just for a little script I'm running locally.
<ddfreyne> I’d suggest finding a different gem!
cdg has joined #ruby
<dudedudeman> well, yeah, sinatra is just a small, light weight web framework
whippythellama has quit [Ping timeout: 240 seconds]
jaequery has joined #ruby
hxegon_AFK is now known as hxegon
djbkd has joined #ruby
<sediment> ddfreyne, I'm going to try this one https://rubygems.org/gems/truncateHTML
scripore has quit [Quit: This computer has gone to sleep]
<newdan> sediment: I'd try Nokogiri or something like that, personally
<norc> sediment, a gem that was updated only once, and that was 5 years ago? :o)
<newdan> Yeah the github page for truncate_html is not very helpful
<sediment> newdan, I know nokogiri and have used it a bit. It probably wouldn't be too hard to do what I want with it. I just thought I might as well avoid reinventing the wheel if I can.
<newdan> Their only "example" just doesn't work
mfb2 has joined #ruby
<sediment> norc, well-spotted... I'll give it a try, but maybe not too optimistically.
<sediment> newdan, glad I'm not the only one thrown by that github page.
<newdan> sediment: Well, that's why I'd suggest Nokogiri. It'll parse the HTML and let you find all text content inside
<norc> sediment, nokogiri was made for parsing broken html.
<newdan> It's a very small subset of Nokogiri but I think it'd do the trick
victortyau has joined #ruby
momomomomo has quit [Quit: momomomomo]
<sediment> I think I'll try this gem first and nokogiri second.
Guest38 has joined #ruby
djbkd has quit [Client Quit]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
VeryBewitching has quit [Quit: Konversation terminated!]
dionysus69 has quit [Ping timeout: 256 seconds]
Pupp3tm4st3r has quit [Remote host closed the connection]
pollardj has joined #ruby
<karapetyan> hi
<sediment> sure
<sediment> what about it, karapetyan?
ImJune has quit [Remote host closed the connection]
Xeago_ has quit [Ping timeout: 245 seconds]
<karapetyan> sediment: seems i found example. sorry
<sediment> no problem! It's neat.
<sediment> I love how it never needs brackets.
vincenthughes has joined #ruby
djbkd has joined #ruby
Guest38 is now known as adit
Limix has joined #ruby
BTRE has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 250 seconds]
lucasb has joined #ruby
PedramT_ has joined #ruby
BTRE has joined #ruby
karapetyan has quit [Remote host closed the connection]
dlitvak has joined #ruby
bb010g has joined #ruby
<sediment> That other truncateHTML gem seems broken, too. Seems like it doesn't work with current version of hpricot.
<sediment> guess I will go with nokogiri, newdan.
<vincenthughes> go fuck yourself
<norc> sediment, let that be a lesson to you.
<norc> sediment, always version lock your dependencies.
<sediment> haha. Noted.
whippythellama has joined #ruby
devbug has joined #ruby
tinnvec has quit [Remote host closed the connection]
lxsameer has quit [Quit: Leaving]
frog0909_ has quit [Remote host closed the connection]
tinnvec has joined #ruby
PedramT has quit [Ping timeout: 240 seconds]
pollardj has quit [Quit: Leaving]
Emmanuel_Chanel has quit [Read error: No route to host]
bb010g has quit [Changing host]
bb010g has joined #ruby
gbgdev has quit [Remote host closed the connection]
skcin7 has joined #ruby
synthroid has quit [Remote host closed the connection]
bklane has quit [Remote host closed the connection]
Rickmasta has joined #ruby
jespada has quit [Ping timeout: 256 seconds]
skcin7 has quit [Client Quit]
jbrhbr has quit [Quit: Leaving.]
devbug_ has quit [Ping timeout: 250 seconds]
karapetyan has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
PedramT_ has quit [Remote host closed the connection]
dn` has quit [Quit: dn`]
PedramT has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
Emmanuel_Chanel has joined #ruby
lacuna has joined #ruby
Rickmasta has quit [Ping timeout: 256 seconds]
vincenthughes has quit [Remote host closed the connection]
<bradland> silly question, but is there a shortcut for writing CSV::Table objects back to a CSV file?
djbkd has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 276 seconds]
<norc> bradland, ys.
djbkd has joined #ruby
DoubleMalt has joined #ruby
<norc> &ri CSV::Table # bradland
<bradland> it looks like #to_csv and writing to a string is it.
<norc> I recommend you take a very short look at the methods there.
<blarghlarghl> Anyone here happen to have any experience building gems that have native bindings using cmake?
<blarghlarghl> Like, is it a really silly thing to do?
<blarghlarghl> In fact, it's cmake and swig.
<dudedudeman> @shevy helllooooooooooo
mistnim has quit [Ping timeout: 252 seconds]
dlitvak has joined #ruby
_djbkd has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
aupadhye has quit [Ping timeout: 264 seconds]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krobzaur has joined #ruby
PedramT has quit []
synthroid has joined #ruby
ascarter has joined #ruby
krobzaur_ has quit [Ping timeout: 240 seconds]
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
e4xit has quit [Quit: Right I'm out!]
* adaedra pokes his head in
n_blownapart has joined #ruby
nerium has quit [Quit: nerium]
<dudedudeman> hi adaedra !
akem has quit [Remote host closed the connection]
fclausen has joined #ruby
tomchapin has joined #ruby
Pumukel has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hannelita has joined #ruby
guacamol_ has joined #ruby
choke has joined #ruby
synthroid has quit []
fmcgeough has quit [Quit: fmcgeough]
sandstrom has joined #ruby
guacamole has quit [Ping timeout: 250 seconds]
Lucky__ has joined #ruby
hannelita has quit [Ping timeout: 240 seconds]
akem has joined #ruby
bronson has joined #ruby
nymous has joined #ruby
<nymous> hey folks
<nymous> i need an advice
huQeQwdpu47q has joined #ruby
<Radar> I have many advices.
hannelita has joined #ruby
<bnagy> nymous: don't fall asleep in socks
<nymous> i'm writing a shell script (using ruby of course). it starts a system command using threads in parallel
<nymous> sometimes this command just hangs
<nymous> how can i kill it by timeout?
sebboh has joined #ruby
<nymous> i've tried t.kill unless t.join(10)
symm- has quit [Ping timeout: 265 seconds]
guacamole has joined #ruby
guacamol_ has quit [Ping timeout: 272 seconds]
<nymous> but it doesn't kill some processes and produce a lot of zombies
<nymous> t is a Thread instance
<bnagy> which interpreter?
_djbkd has quit [Remote host closed the connection]
<nymous> ruby 2.1
<sebboh> Hi. I don't speak ruby. I'm trying to run a program that I just installed via a gem. Per instructions here. http://defunkt.io/gist/ (but I used --user-install.) My question is, how do I invoke this program? This documentation makes it seem that there is some 'gist' binary on my path now. There isn't.
<nymous> i mean c ruby
stevemackinnon has joined #ruby
tercenya has quit []
<sebboh> s/binary/executable/
<bnagy> meh either way, personally I tend to track OS pids and kill those, Threads are fiddly when combined with exec
djbkd has joined #ruby
jbrhbr has joined #ruby
<sediment> sebboh, gem has a directory that it installs binaries too, which I guess isn't on your path. What OS are you using?
<sediment> on linux, it's something like ~/.gem/ruby/[version]/bin, I think
<sebboh> sediment: oh, probably somewhere in ~/.gem or ~/.ruby or something. I'll find it. Thanks!
<sebboh> :)
bronson has quit [Ping timeout: 265 seconds]
<sediment> you can either add that to your path or just run it from there.
<bnagy> nymous: if you _do_ want to kill a ruby Thread it's always better to signal it somehow and have it clean up itself and exit
dudedudeman has quit [Quit: dudedudeman]
<adaedra> gem install usually warns about gem path not being in $PATH.
karmatr0n has joined #ruby
<nymous> bnagy: it's a small script, so i don't want to go too complex on that. do you have any example?
<Radar> sebboh: Do you intend to do much Ruby or do you just want the gist app?
<bnagy> nymous: hm.. nothing to hand that would be isolated enough. You can use Queue as a quick and dirty cross-thread signalling bus though
symm- has joined #ruby
ur5us has quit [Remote host closed the connection]
<bnagy> otherwise mutex or (ew) condvar but that's imho arcane
zambini has joined #ruby
Shaboum has quit [Ping timeout: 250 seconds]
Marsupermammal has quit [Quit: Textual IRC Client: www.textualapp.com]
ur5us has joined #ruby
Rickmasta has joined #ruby
<bnagy> the reason I asked about interpreter is that jruby threads behave weirdly differently to MRI threads
djbkd has quit [Ping timeout: 272 seconds]
<bnagy> they're even more fragile when it comes to externally managing them
<norc> nymous, if you produce zombies... maybe you should wait your processes... ? :-)
bklane has joined #ruby
<bnagy> last thing, if you're getting zombies you want to check how you're spawning
skcin7 has joined #ruby
treehug88 has quit [Quit: Textual IRC Client: www.textualapp.com]
<bnagy> if you're popening or something then the child should know when the parent dies, unless there's weirdness
ur5us has quit [Remote host closed the connection]
akem has quit [Read error: No route to host]
Livecodingtv_ has joined #ruby
tercenya has joined #ruby
ur5us has joined #ruby
finisherr has joined #ruby
<bnagy> basically this isn't a simple script, no matter how short it might look
<norc> nymous, either way, you do not produce enough information for us to help you with.
karapetyan has quit [Remote host closed the connection]
<norc> nymous, all you told us is that you use threads and somehow end up with zombies, which so far does not make much sense to me.
<sediment> I'm outta here. Thanks for the help, all
sediment has quit [Quit: goodnight]
victortyau has quit [Quit: Leaving]
karapetyan has joined #ruby
Livecodingtv_ has left #ruby ["Leaving"]
baweaver has quit [Remote host closed the connection]
xet7 has quit [Quit: Leaving]
<sebboh> Radar: just use that tool. It's done now. :) Cya all later.
sebboh has left #ruby ["ERC (IRC client for Emacs 25.0.50.1)"]
<nymous> i need to check several sites using phantomjs
dudedudeman has joined #ruby
Jonah11_ has joined #ruby
<nymous> so phantom can just hang eating 100% cpu and doing nothing for no reason
<norc> nymous, ok - and what exactly is your issue now?
<norc> nymous, if your command hangs this is not Ruby related.
<eam> well, it is if he's asking how to terminate it from ruby, which I think he is
<nymous> yes
<nymous> it's started by ruby
<bnagy> nymous: there are plenty of ruby wrappers for phantom btw
<bnagy> you shouldn't need to shell out
baweaver has joined #ruby
<bnagy> that might make things a lot easier to wrangle
<nymous> if i won't use some kind of timeout, iteration just hangs
<eam> nymous: use a tool which returns the pid of your subprocess. Not system(), but perhaps something like spawn(). You can then send a signal to that pid
hospes has joined #ruby
<bnagy> 05:43 < bnagy> meh either way, personally I tend to track OS pids and kill those, Threads are fiddly when combined with exec
<eam> bnagy's advice is best, of course. don't implement this sort of thing yourself if you're not fluent in the area
<bnagy> :>
<eam> bnagy: yeah, well more importantly killing the thread has nothing to do with killing the subprocess :)
nerium has joined #ruby
<norc> "killing the thread" is such a bad term imo
GinoManWorks has quit [Read error: Connection reset by peer]
<bnagy> wat
<nymous> anyway, somehow it does produce zombies
<nymous> and not killing some processes
ur5us has quit [Remote host closed the connection]
fantazo has quit [Quit: Verlassend]
wilbert_ has quit [Ping timeout: 240 seconds]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackgoat has joined #ruby
<bnagy> nymous: I just looked up some old scrapers, back then I used celerity and capybara, and both were ok
<eam> norc: given Thread#kill it seems inevitable
<norc> eam, it is a horrible alias.
wilbert_ has joined #ruby
<eam> no argument
scripore has joined #ruby
lucasb has quit [Quit: leaving]
<norc> nymous, which makes good sense actually.
<nymous> bnagy: i just need to log some links, it's not repeatable task
<bnagy> I don't know what that means or why it's relevant
djbkd has joined #ruby
<nymous> i mean using a testing framework is overkill to me
<bnagy> well you haven't managed to kill it at all yet
<Ox0dea> Sick burn.
<bnagy> anyway do what you want, I'm not the cops
<eam> that's exactly the kind of thing the cops would say
dlitvak has quit [Ping timeout: 276 seconds]
<adaedra> *woop* *woop*
<eam> cheese it!
<nymous> i thought i can use ruby's timeout, but it seems that it would mess with threads
<norc> Ox0dea, hey, have you dug into Thread code at all?
<Ox0dea> norc: MRI-side?
<norc> Yes.
<Ox0dea> Nah.
<nymous> bnagy: i don't think that "knowing which widgets your site uses" is something illegal :)
<Ox0dea> norc: Dug into st_table code? :)
<norc> Ox0dea, wait...
Rinalds has quit []
<shellie> I'm learning ruby, what are some simple / well coded ruby scripts/libs/etc ?
<Ox0dea> norc: The hash table implementation that uses callbacks and the like all over the place.
dlitvak has joined #ruby
<bnagy> shellie: Rails
* bnagy dies laughing
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
<shellie> :)
momo-reina has joined #ruby
momo-reina has quit [Write error: Connection reset by peer]
sigurding has joined #ruby
<eam> Timeout spins up a thread and uses Thread#kill -- and is very dangerous
momo-reina has joined #ruby
roller123 has joined #ruby
<shellie> maybe I'll clarify that by simple I meant 'small and not overly complex', e.g 100-500 LoC
<Ox0dea> But the convenience!
<bnagy> srsly though imvho writing code > reading code for learning ruby
<eam> we found a great redis bug involving Timeout
guacamole has joined #ruby
<norc> eam, from the looks of it Ruby just uses a control mechanism akin to exceptions to forcibly end Thread execution immediately.
<shellie> I want to use them to basically compare to my code, which is that of a newbie
<apeiros> in newer rubies, Thread#kill can be handled, but it's not for the faint of heart.
<bnagy> "There's More Than One Way To Do It" leads to a pretty wide range of idiom
<shellie> I started reading the well grounded rubyist
Xeago has joined #ruby
<norc> eam, since the Thread causes sub-processes to be spawned, I am not surprised in the slightest this would cause Zombies
<norc> since they are never waited.
dlitvak has quit [Remote host closed the connection]
<newdan> shellie: If you're new it might be hard to read some libs. But if it were me I'd just go find some highly starred repos on Github and dig around
dudedudeman has quit [Quit: dudedudeman]
<eam> norc: agreed
<shellie> newdan: good idea, :)
jgpawletko has joined #ruby
<Ox0dea> shellie: Consider doing something like Codewars that shows you how other people solved it only once you've done so yourself.
<bnagy> shellie: the style guide is worth a look
<eam> so, redis + timeout, you do something like timeout { redis_query } and what happens is the timeout fires after the query is sent, but before the response is read off the socket
guacamole has quit [Client Quit]
<Ox0dea> No `ensure` for you!
<eam> so you loop and send another query(#2), but response(#1) is returned
<bnagy> and will teach you good vs poor form in a more condensed form than reading complete libs / apps
felixal has quit [Read error: Connection reset by peer]
<eam> and forevermore you have an off-by-one style error where the response you read is to the query sent just prior
<newdan> Ox0dea: That's a good idea. Although often I read stuff like that and wonder "Are people allergic to variable names with more than one letter?" (although haven't tried CodeWars specifically)
<shellie> Ox0dea: interesting, not familiar with codewars
<eam> until the connection is re-established
<eam> this is possible because there's no sequence number in the redis wire protocol
<shellie> bnagy: Yup, I was told about it and I have cast my eyes on it, but do need to revisit
<eam> so it doesn't know it's mixed up
<norc> apeiros, based on my first impressions of the code here I would stay far away from handle_interrupt honestly :D
<Ox0dea> newdan: It's not as if single-character identifiers don't have their place, mind.
<apeiros> norc: I didn't say "not for the faint of heart" for no reason :D
<bnagy> ?quickref
<eam> norc: that's how we minimized the above redis/timeout issue, actually
<bnagy> shellie: ^^ that too
<newdan> Ox0dea: I agree. But I routinely see those sorts of post solutions sites devolve into code golf
<apeiros> I doubt it's possible to write halfway sane code with handle_interrupt and the other bits which were added for this
<shellie> awesome :)
<shellie> thanks bnagy
<Ox0dea> newdan: As is to be expected, I think. People "upvote" golf.
sgambino has joined #ruby
chouhoulis has quit [Remote host closed the connection]
<shellie> is there anything similar to pylint for ruby?
<norc> apeiros today I had a nice one again - real WTF hour with strange parsing errors and an AST that was strange...
<Ox0dea> shellie: RuboCop.
<newdan> shellie: rubocop
<shellie> whoa :)
<norc> Completely forgot about non-breaking spaces on OSX...
<shellie> nice name
mrsolo_ has quit [Ping timeout: 265 seconds]
<nymous> speaking of code quality, i think you should properly understand OO idiom at first so you can code on any language it uses
<nymous> and later comes all this cool syntax sugar and stuff
<bnagy> so much side-eye right now
guacamole has joined #ruby
<norc> shellie, now that we have told you, its time for us to tell you to be careful with rubocop.
<shellie> bnagy: was that with regards to myself?
<shellie> ops
<shellie> nymous: was that with regards to myself?
<apeiros> hm, somebody know if it's possible to emulate a disconnect (TCP/IP) for a single process on osx?
<shellie> norc: why? :)
<nymous> shellie: yes
<norc> apeiros, hping?
<norc> Granted, might be a bit of an artillery there...
<shellie> nymous: oh, I'll prob need to learn the differences from python, of which I have solid experience :)
Jonah11_ has quit []
<eam> apeiros: emulate on what level?
<shellie> I'm not sure hping is going to be helpful
jam_ has joined #ruby
<shellie> you'd need to find the right sequence number for the session
<nymous> shellie: so, well, go with syntactic sugar part, you'll like it
<shellie> so your best bet would be to firewall it
vikaton has quit [Quit: Connection closed for inactivity]
<apeiros> eam: well, it should be like either as if e.g. my network went down, or like the remote server disconnected
ramortegui has quit [Quit: Ex-Chat]
<shellie> if your firewall supports reject
<riceandbeans> apeiros: with my earlier problem is nil < 5.1?
<apeiros> if I can't emulate it, I'll disable my wifi
<newdan> riceandbeans: Just try it in pry/irb
<eam> yeah, reject or drop for either scenario
<apeiros> riceandbeans: try and see what ruby tells you
SCHAAP137 has quit [Remote host closed the connection]
<eam> apeiros: ipfw
<shellie> disabling wifi will make the connection timeout tho
<riceandbeans> apeiros: it didn't err out or anything just seems to have skipped it
<eam> and if you want to do things like latency or packetloss I believe dummynet runs on osx
zambini has quit [Quit: Leaving.]
<shellie> it will not simulate a 'closed' or 'dropped' connection
<apeiros> riceandbeans: then you're doing it wrong
<apeiros> >> nil < 5.1
<ruby[bot]> apeiros: # => undefined method `<' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/506093)
<apeiros> ^ quite definitely errors out
xet7 has joined #ruby
<riceandbeans> apeiros: no no, but with gem::version
<apeiros> riceandbeans: uhm, yeah. be precise please.
<Ox0dea> norc: https://eval.in/506091
<riceandbeans> so instead of nil I need to set the values to 0?
<Ox0dea> eval.in kinda ruined the joke, though. :<
dcunit3d has quit [Ping timeout: 240 seconds]
<apeiros> maybe? I don't know what Gem::Version.create creates with nil.
<newdan> riceandbeans: Depends on your application
zambini has joined #ruby
<norc> Ox0dea, wait.. am I supposed to be amazed?
<Ox0dea> norc: No, of course not.
<norc> apeiros, did some digging, looks like KisMAC could be able to do it.
jbrhbr1 has joined #ruby
<nymous> btw, are basic data types in ruby thread safe? i mean, what if i want to have a global hash and add values in threads? do i need sync or something?
<Ox0dea> I did try to find some more interesting way of doing it, though.
<Ox0dea> nymous: You're fine there on MRI.
<apeiros> eam: does osx run ipfw by default?
<norc> Ox0dea, my favourite code challenge is still the Grand C++ Error Explosion Competition.
* apeiros reads up on hping
jbrhbr has quit [Ping timeout: 256 seconds]
<eam> I thought so, but I haven't ever really done much under osx sooo
jam_ has quit [Ping timeout: 264 seconds]
<apeiros> no ipfw around as it seems
<norc> Ox0dea, but I suppose having worked extensively in template heavy C++ projects I find it more amusing than others.
<mg^> pfctl
<apeiros> `which ipfw` turns up empty
<mg^> and I don't think pf is on by default
jackjackdripper has joined #ruby
<Ox0dea> norc: ~6 billion errors?!
jaequery has quit [Excess Flood]
<roller123> I'm getting the below error while running cap rubber:create_staging rubber command. I'm on mac OS X 10.11.2. Ruby version is 2.3.0 I've followed railscast 347 and to some extent this blog (https://aforkinthecode.wordpress.com/2013/11/27/getting-rails-4-to-work-with-amazon-awsrubber-gem/), and rubber doco., but unable to get around this error.
<eam> ah, it's pf?
<mg^> yeah
<apeiros> norc: how'd I make the app drop the connection using hping?
jaequery has joined #ruby
<roller123> * 2016-01-22 07:43:05 executing `rubber:create' /Users/gauravsarin/.rvm/gems/ruby-2.3.0@newapp/gems/rubber-3.2.0/lib/rubber/cloud/aws/base.rb:75:in `before_create_instance': undefined method `instance_alias' for #<Rubber::Configuration::InstanceItem:0x007fbb99e45be0> (NoMethodError) Did you mean? instance_variables instance_eval instance_id from /Users/gauravsarin/.rvm/gems/ruby-2.3.0@newapp/gems/rubber-
<norc> apeiros, do you need to transmit any traffic prior to dropping it?
scripore has quit [Quit: This computer has gone to sleep]
<apeiros> norc: yes. the program is connected and has data sent to the target.
<norc> apeiros, the thing is, hping is only useful for crafting packets from one side. If you just need to inject a packet into an existing connection you will need to pack out other tools like KisMAC
<apeiros> s/target/server/
<norc> apeiros, just send a FIN
<roller123> it'll be easier to view the complete error here https://github.com/rubber/rubber/issues/580
karapetyan has quit [Remote host closed the connection]
<norc> apeiros, though if you dont know that, chances are you want to read up on how TCP works since you need to craft every packet yourself.
jaequery has quit [Max SendQ exceeded]
<roller123> any ideas or workarounds for this ?
craigp has quit [Remote host closed the connection]
ympeg has joined #ruby
<apeiros> norc: so I send a FIN from my side, the remote server thinks I closed the connection and disconnects?
jaequery has joined #ruby
<norc> apeiros, not necessarily.
craigp has joined #ruby
Burgestrand has joined #ruby
<eam> you can send yourself a FIN though
<norc> apeiros, FIN just says that you will not be sending anything anymore. If you want the TCP connection to die, you need to inject an RST.
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pumukel has quit [Quit: ChatZilla 0.9.92 [Firefox 43.0.4/20160105164030]]
craigp has quit [Read error: Connection reset by peer]
<eam> it's probably easier to drop in a firewall rule though
scripore has joined #ruby
<apeiros> ok, it sounds like all solutions require a bit of learning, nothing for dummies which I could make use of within the next minute or so?
<norc> apeiros, absolutely.
kalopsian has quit [Ping timeout: 240 seconds]
<eam> if it was linux I could give you the one-line firewall rule :(
DoubleMalt has quit [Remote host closed the connection]
<apeiros> well then… I'll just disable wifi then :)
newdan has quit [Quit: Lost terminal]
yfeldblum has joined #ruby
<bnagy> that should work iff the target process sends more traffic
<eam> apeiros: blackhole route it
dlitvak has joined #ruby
<norc> eam, OSX firewall sucks to do anything with honestly.
jaequery has quit [Max SendQ exceeded]
Limix has quit [Quit: Limix]
hospes has quit [Quit: leaving]
<eam> sudo route add -host 1.2.3.4 127.0.0.1 -blackhole
jaequery has joined #ruby
<eam> apeiros: that oughta do it on osx
jgpawletko has quit [Quit: jgpawletko]
<bnagy> uh...
<bnagy> not sure that will make the client disconnect
<norc> apeiros, oh yeah, since you saved me from some headaches about ruby-oci8 let me save you about some troubles in the long run.
<eam> it'll drop traffic
<eam> easier than disabling wifi
<norc> apeiros, if you ever have the need to do anything with firewalls, just dont do it on OSX. :-)
<eam> (which also won't force a disconnect right away)
<bnagy> right but dropping traffic won't make the client disconnect right away
<eam> bnagy: agreed
jaequery has quit [Max SendQ exceeded]
Mon_Ouie has joined #ruby
<bnagy> -reject might work (looking at manpage)
<eam> I bet apeiros can't see us right now
<eam> his wifi is off
<norc> Hello Mon_Ouie.
<bnagy> you get an unreachable, that should make the tcp stack treat that as dead?
<Mon_Ouie> 'alut
jaequery has joined #ruby
<eam> bnagy: upon the next transmission, if there is one
<apeiros> eam bets quite correctly :)
<apeiros> back right now.
<eam> apeiros: give that route trick a shot - selectively nuke network connectivity to addresses
baweaver has quit [Remote host closed the connection]
sigurding has quit [Quit: sigurding]
<apeiros> eam: how'd I do that?
<bnagy> yeah, nothing much works without traffic being sent
<norc> apeiros, I also considered recommending you cut the cable - but then I realized the difficulty in doing that with WiFi...
<bnagy> except spoofing a RST from server
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<eam> sudo route add -host 1.2.3.4 127.0.0.1 -blackhole # where 1.2.3.4 is the ip address of the remote system you want to not talk to
<apeiros> I did learn that Kernel.select([socket]) does not notice the disconnect of the wifi
zenlot1 has joined #ruby
<eam> apeiros: correct
<norc> apeiros, no reason it should.
<eam> if you blackhole/drop traffic you will not notice until you transmit
mchu has quit [Quit: mchu]
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
<eam> if you're just holding the socket open it will sit that way forever
<eam> (unless you have tcp keepalives configured)
Nyammy_Work has quit [Quit: Leaving]
<apeiros> seems like a standard TCPSocket.open doesn't do that then
Hammy_Work has joined #ruby
<eam> it won't, it's a setsockopt()
zenlot has quit [Ping timeout: 250 seconds]
<apeiros> (it's for ruby[bot] btw.)
guacamole has joined #ruby
yqt has joined #ruby
<apeiros> eam: how'd I undo that?
djbkd has quit [Remote host closed the connection]
<eam> route delete
<apeiros> the blackholing
jaequery has quit [Max SendQ exceeded]
sakix has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
<apeiros> the route isn't identified by anything? o0
<eam> oh, same args, just s/add/delete/
<apeiros> ah, I see
<eam> what that's doing, btw, is telling your routing configuration to forward all traffic for 1.2.3.4 to 127.0.0.1 - which doesn't know what to do with it, and drops it
<apeiros> I could also send it to 192.168.0.<unused>?
guacamole has quit [Client Quit]
<adaedra> sudo route add -discussion -offtopic
<eam> actually -blackhole might just drop it period
<apeiros> ah, ok
djbkd has joined #ruby
<bnagy> -reject >= -blackhole I think
cicloid has quit [Quit: zzZZzzzZzzzzzZZZz]
guacamole has joined #ruby
<apeiros> thanks a lot to all who helped
scripore has quit [Quit: This computer has gone to sleep]
<apeiros> I'll try out some of the suggestions tomorrow :)
<roller123> hi Just wondering if anyone could help me regarding this issue that I'm facing while running rubber command https://github.com/rubber/rubber/issues/580
ledestin has joined #ruby
krobzaur has quit [Ping timeout: 250 seconds]
scripore has joined #ruby
mondok has joined #ruby
juddey has quit [Ping timeout: 245 seconds]
scripore has quit [Client Quit]
scripore has joined #ruby
sakix has quit [Ping timeout: 240 seconds]
zambini has quit [Quit: Leaving.]
chipotle has joined #ruby
edwinvdgraaf has joined #ruby
pietr0 has quit [Quit: pietr0]
baweaver has joined #ruby
Limix has joined #ruby
zambini has joined #ruby
wilbert_ has quit [Ping timeout: 260 seconds]
dfinninger has quit [Remote host closed the connection]
hayden_ has joined #ruby
zerowaitstate has quit [Quit: leaving]
dhollinger has quit [Quit: WeeChat 1.4]
jgpawletko has joined #ruby
zambini has quit [Client Quit]
Spami_ has quit [Quit: Leaving]
Antiarc is now known as BMRMike
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
dfinninger has joined #ruby
zambini has joined #ruby
jbrhbr has joined #ruby
guacamole has joined #ruby
zambini has quit [Client Quit]
BMRMike is now known as Antiarc
user083_ has quit [Quit: leaving]
Snowy has joined #ruby
user083 has joined #ruby
jbrhbr1 has quit [Ping timeout: 264 seconds]
Ox0dea has quit [Quit: WeeChat 1.4-rc1]
Antiarc is now known as whatever
<roller123> hi Just wondering if anyone could help me regarding this issue that I'm facing while running rubber command https://github.com/rubber/rubber/issues/580
whatever is now known as whatever12312312
whatever12312312 is now known as Antiarc
Ox0dea has joined #ruby
mdw has joined #ruby
maletor_ has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
einarj has quit [Remote host closed the connection]
choke has joined #ruby
fclausen has quit [Quit: leaving]
yossarian has quit [Quit: And then he took off.]
vikas027 has joined #ruby
dlitvak has quit [Remote host closed the connection]
zambini has joined #ruby
momo-reina has quit [Remote host closed the connection]
dlitvak has joined #ruby
solars has quit [Ping timeout: 264 seconds]
gizless has joined #ruby
<bnagy> roller123: please stop spamming
<bnagy> people heard you. Nobody is answering because they don't know or they're not active
<roller123> sorry I'm new to IRC
dfinninger has quit [Remote host closed the connection]
<bnagy> np. Best bet is to hang around and idle. It can be hours before someone picks up a question
gizmore has quit [Ping timeout: 240 seconds]
<bnagy> in the meantime you've opened an issue on the actual project, they're usually the best bet to help (just can be slow)
<roller123> ok
<mikecmpbll> roller123: also probably better off asking in #rubyonrails seeing as rubber appears to be rails related
jackjackdripper has quit [Quit: Leaving.]
<mikecmpbll> but mention that you've crossposted with #ruby.
jackjackdripper has joined #ruby
<Radar> mikecmpbll: it's not Rails related.
x77686d has joined #ruby
<mikecmpbll> oh, my bad.
<roller123> ok I'll try that
<mikecmpbll> i just read the summary on github which starts with "A capistrano/rails plugin"
<Radar> Filing a bug on the roller project was best thing
<Radar> uh, on the rubber project
guacamol_ has joined #ruby
jgpawletko has quit [Quit: jgpawletko]
jgt has quit [Ping timeout: 250 seconds]
dlitvak has quit [Ping timeout: 265 seconds]
ajf- has joined #ruby
<Radar> I'm _guessing_ it's a Ruby 2.3 thing but I can't be 100% sure.
Limix has quit [Ping timeout: 256 seconds]
woodruffw has joined #ruby
woodruffw has quit [Excess Flood]
cicloid has joined #ruby
TomyLobo has quit [Ping timeout: 245 seconds]
mdw has quit [Quit: Sleeping Zzzzz]
guacamole has quit [Ping timeout: 260 seconds]
woodruffw has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Radar> All tests pass on Ruby 2.3 for me locally, so I don't know.
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
blackmes1 has quit [Ping timeout: 264 seconds]
Burgestrand has quit [Quit: Textual IRC Client: www.textualapp.com]
d0nn1e_ has quit [Ping timeout: 265 seconds]
dudedudeman has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
Darmani has joined #ruby
<Darmani> Hey kids<3
<Radar> hey Darmani
krz has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 250 seconds]
mostlybadfly has joined #ruby
<Darmani> Radar<33
hannelita has quit [Remote host closed the connection]
maletor_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanpablo_ has quit [Quit: (null)]
maletor_ has joined #ruby
Xeago has quit [Remote host closed the connection]
framling has joined #ruby
<vikas027> Hello Everyone, there is ".to_date" in rails. What is the equivalent in Ruby ? I have date stored in DynamoDB "2016-01-22" which is stored as Array.
maletor_ has quit [Client Quit]
lacuna has quit [Quit: Textual IRC Client: www.textualapp.com]
ascarter has joined #ruby
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
waka has quit [Remote host closed the connection]
<apeiros> vikas027: what now, a string or an array? ("2016-01-22" is a String)
maletor_ has joined #ruby
<Ox0dea> >> require 'date'; Date.iso8601 '2016-01-22' # vikas027
<ruby[bot]> Ox0dea: # => #<Date: 2016-01-22 ((2457410j,0s,0n),+0s,2299161j)> (https://eval.in/506140)
FernandoBasso has quit [Quit: Leaving]
<apeiros> ^ if it's actually a string
firstdayonthejob has quit [Quit: WeeChat 1.4-dev]
ellistaa has joined #ruby
<vikas027> apeiros: When I check the class of the returned variable from DynamoDB, it shows as Array
<apeiros> vikas027: then show us what you've really got
<vikas027> Ox0dea: Thanks looking at this. Date.iso8601
<apeiros> because as said, "2016-01-22" ain't an array.
shellie has quit [Ping timeout: 276 seconds]
<apeiros> and if it's an array, Date.iso8601 won't help you either.
<ellistaa> i was asked to debug some code related to a finite state machine in an interview. do you think in order to be a good programmer you need to know about finite state machines? or do you think i was thrown a curve ball?
<vikas027> apeiros: sure, gimme a minute
hannelita has joined #ruby
dudedudeman has quit [Quit: dudedudeman]
speaking1ode has joined #ruby
shellie has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
<baweaver> If we want to continue that baseball metaphor, as a batter (interviewee) you have to be able to hit much of anything thrown your way. The question is more whether or not it was an actual strike.
edwinvdgraaf has joined #ruby
<apeiros> ellistaa: for anything more than trivially complex, state machines are quite important. so yes, if you want to be a good programmer, you should know about them IMO.
<baweaver> FSM probably isn't relevant, but the job might need it.
bklane has quit [Remote host closed the connection]
<Radar> ellistaa: A lot of my work at Spree was working on different FSMs to do with an ecommerce process.
<baweaver> apeiros: Interview: solve this FSM problem. Job: Use jQuery to put data into here
<ellistaa> : {
<ellistaa> thanks …
<apeiros> baweaver: unless your webapp has zero workflows that's not true
<ellistaa> i guess ill read about em
yfeldblum has quit [Remote host closed the connection]
* baweaver doesn't really know about FSMs
<apeiros> baweaver: but granted, tons of programmers will just reinvent how an FSM works and usually poorly so
<Radar> ellistaa: look at the workflow gem. Should give you a good idea.
<baweaver> explain one to me like I'm 5
<baweaver> I probably have a few times.
<ellistaa> radar: thanks i will
[Butch] has quit [Quit: I'm out . . .]
<apeiros> baweaver: if you've ever had a field "status" in an app, you probably should have used an FSM
bklane has joined #ruby
<Radar> If you've read Chapter 11 of Rails 4 in Action and gone through the examples you've used an FSM
joneshf-laptop has quit [Ping timeout: 272 seconds]
<vikas027> apeiros: I am saving the date as this - Time.now.strftime("%d %b %Y") in a string type field in DynamoDB table. When I retrieve this value using variable.map { |hash| hash['last_notified'] }.class ...it shows up as Array
<baweaver> I'll poke through it
dfinninger has joined #ruby
<baweaver> though I've done a lot with statuses and push/pull systems so probably.
<apeiros> vikas027: that's quite unspecific. you may want to actually show us your array.
<vikas027> apeiros: I can change the type or the date values there, if I can do the date comparison with the current date
<hxegon> I'm trying to get VCR up and running with my rspec suite. A trivial test that makes a GET request with fixed body, method, path, uri, etc. is being tried. I used the same config from the getting started doc: http://www.relishapp.com/vcr/vcr/v/3-0-1/docs/getting-started and it isn't recording the first cassette. From the debugger: https://gist.github.com/anonymous/f454689570fb19b556e5
<ellistaa> gtg
ellistaa has quit [Quit: ellistaa]
<baweaver> ah, that. Yeah, I've done that a lot in process polling systems
<apeiros> baweaver: it's a good idea. having a proper fsm usually means you'll get a more stable, easier to reason about, and hence more maintainable app
<baweaver> Just didn't know it by name.
<baweaver> Ox0dea: any favorite references on state machines?
yfeldblum has joined #ruby
<Ox0dea> baweaver: Tom Stuart's "Understanding Computation" is the fun option.
<baweaver> noted.
<vikas027> apeiros: https://dpaste.de/4cA0 Pls have a look
guacamol_ has quit [Quit: My face has gone to sleep. ZZZzzz…]
znz_jp has joined #ruby
<apeiros> vikas027: don't use puts. use p.
guacamole has joined #ruby
<Radar> vikas027: Show us what my_hash is please
<apeiros> puts invokes to_s on whatever you pass to it, making inspection difficult.
gbgdev has joined #ruby
adit has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ox0dea has quit [Quit: WeeChat 1.5-dev]
Ox0dea has joined #ruby
Synthmead has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
Encapsulation has quit [Read error: Connection reset by peer]
<vikas027> apeiros, Rader: https://dpaste.de/sD1P This is it
edwinvdg_ has joined #ruby
Ox0dea has quit [Client Quit]
<Radar> vikas027: So it's returning an array of hashes.
<vikas027> Radar: yes
<apeiros> uh, yeah, map returns an array
<apeiros> not your field
<apeiros> hash['last_notified'] is a string.
Ox0dea has joined #ruby
<Radar> vikas027: notifications = @dynamo.notifications_info(github_user)
<Radar> vikas027: notification = notifications[0]
<apeiros> and it isn't 2016-01-22 either as you suggested, it's "22 Jan 2016". that's quite different.
<Radar> vikas027: notification['last_notified']
bronson has joined #ruby
<Radar> Use Date.strptime to parse the date.
<apeiros> >> require 'date'; Date.strptime("22 Jan 2016", "%d %b %Y")
<ruby[bot]> apeiros: # => #<Date: 2016-01-22 ((2457410j,0s,0n),+0s,2299161j)> (https://eval.in/506141)
Encapsulation has joined #ruby
<Radar> That's the one.
Snowy has quit [Read error: Connection reset by peer]
<apeiros> but since you said you can change the format used to store, I'd strongly suggest to use iso8601
<vikas027> apeiros: Ok Let me try
<apeiros> standards. they're nice.
Snowy has joined #ruby
edwinvdgraaf has quit [Ping timeout: 256 seconds]
twe4ked has quit [Ping timeout: 260 seconds]
<apeiros> hm, I think I don't have deployed !xkcd yet…
juddey has joined #ruby
<Ox0dea> !xkcd 927
<Ox0dea> Worth a shot.
<apeiros> nope. I don't have :)
<apeiros> but I made it, just for you Ox0dea ;-)
<Ox0dea> apeiros: <3