« Back to channel list

#ruby - 21 January 2016

« Back 1 day Forward 1 day »
[00:02:09] makenoise: has joined #ruby
[00:04:47] dlitvak: has joined #ruby
[00:06:05] bb010g: has joined #ruby
[00:06:09] hxegon: has joined #ruby
[00:06:28] brixen: has joined #ruby
[00:07:49] akkad: has joined #ruby
[00:09:22] scottschecter: has joined #ruby
[00:10:12] atom3: has joined #ruby
[00:10:12] bodgix: has joined #ruby
[00:10:12] trajing: has joined #ruby
[00:10:23] guacamole: has joined #ruby
[00:10:58] atom3: has joined #ruby
[00:10:58] bodgix: has joined #ruby
[00:10:58] trajing: has joined #ruby
[00:11:24] fartface: Right, so I'm going through the koans
[00:11:42] chipotle: has joined #ruby
[00:11:51] fartface: about_nil.rb-- assert_equal __, nil.is_a?(Object), "Unlike NULL in other languages"
[00:12:04] fartface: I changed __ to `true`, and passed the test
[00:12:11] Ox0dea: All is well.
[00:12:12] moeabdol: has joined #ruby
[00:12:26] Ox0dea: `nil` is in fact an Object, with methods and a superclass and everything.
[00:12:27] razorgfx: has joined #ruby
[00:12:42] IrishGringo: has joined #ruby
[00:12:44] fartface: Sure, but is that how assert_equal is to be used?
[00:12:56] fartface: Alright, cool! Thanks!
[00:12:59] Ox0dea: Sure thing.
[00:13:10] fartface: I figured there may be something like an assert_true or something
[00:13:31] Ox0dea: There is.
[00:13:42] fartface: Then why wouldn't they use assert_true?
[00:13:44] Ox0dea: But assert_equal is more suited to letting you fill in the blank.
[00:13:49] fartface: lol that makes sense
[00:14:10] fartface: OK, so then the next problem, assert_equal __, ex.class (about which exception has been caught)
[00:14:18] makenoise: has joined #ruby
[00:15:33] artX000: has joined #ruby
[00:16:30] Ox0dea: fartface: Look instead at the next assertion; how on earth are you supposed to predict the contents of the error message? :P
[00:16:49] Ox0dea: Spoiler: you're not. The Koans are meant to induce you to experiment elsewhere.
[00:17:16] Ox0dea: In `irb`, for instance.
[00:17:47] atomical: has joined #ruby
[00:18:15] duckpuppy: has joined #ruby
[00:18:45] 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
[00:18:50] cscheib_: for the koans, that is
[00:19:10] cscheib_: basically, you're not supposed to get it right the first time
[00:19:21] snockerton: has joined #ruby
[00:19:32] cscheib_: and it *is* susceptible to cheating, as you're only modifying assertions (most of the time)
[00:19:34] Ox0dea: That approach is less conducive to learning and retention.
[00:19:51] Ox0dea: It's only supposed to be a game secondarily to a learning tool.
[00:19:57] fartface: I get that, but it's a bit of http://www.mamieyoung.com/dailydawdle/How%20to%20draw%20an%20owl1.jpg
[00:20:00] dcunit3d: has joined #ruby
[00:20:20] Ox0dea: The goal isn't to "win", it's to come out the other side knowing the fundamentals of Ruby.
[00:21:30] 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,
[00:21:41] cscheib_: most of the "koans" are simple concepts that get introduced, and the assertions are just to prove the point to you
[00:21:55] Ox0dea: No, that's not right.
[00:22:05] Ox0dea: The assertions are for demonstrating your understanding to yourself.
[00:22:17] guacamole: has joined #ruby
[00:22:39] Ox0dea: fartface: Cheater!
[00:22:57] fartface: I'm... doing what you told me to do?
[00:23:07] Ox0dea: I suggested irb.
[00:23:17] Ox0dea: Not running the koan so that it gives you the answer.
[00:23:22] s00pcan: has joined #ruby
[00:23:34] fartface: It didn't though
[00:24:04] fartface: This is all a bit too meta for me.
[00:24:57] 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.
[00:24:58] sgambino: has joined #ruby
[00:25:11] Ox0dea: > expected FILL ME IN (__) to equal NoMethodError
[00:25:28] fartface: Sure, so I set __ to NoMethodError
[00:25:33] fartface: And that didn't pass the test either
[00:26:03] thejamespinto: has joined #ruby
[00:26:11] fartface: And if that sounds like a stupid thing to do, like I said, an illiterate person proof reading an essay
[00:26:14] cscheib_: you should probably gist your code and the output
[00:26:48] Ox0dea: >> nil.gibberish rescue $!.class # fartface
[00:26:49] ruby[bot]: Ox0dea: # => NoMethodError (https://eval.in/505517)
[00:28:52] djellemah: has joined #ruby
[00:29:09] 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?
[00:29:22] Spami_: has joined #ruby
[00:31:22] fartface: Huh... maybe I *don't* get what you're trying to show me lol
[00:31:39] fartface: Like I said, I think this is a bit over my head.
[00:31:44] harly: has joined #ruby
[00:31:51] fartface: I'm going to go back to Ruby Monk.
[00:31:52] howdoicomputer: has joined #ruby
[00:31:58] Jardayn: has joined #ruby
[00:33:08] volty: has joined #ruby
[00:34:58] ltd: has joined #ruby
[00:35:10] harly: has joined #ruby
[00:35:14] sftrabbit: has joined #ruby
[00:35:22] TomPeed: has joined #ruby
[00:35:28] fartface: OK hold on a second. I think I understand what you were trying to tell me before now.
[00:35:43] fartface: So I go into irb, type in `puts nul.some_method`
[00:36:02] fartface: Get an error, which is to be expected
[00:36:36] guacamole: has joined #ruby
[00:36:54] 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
[00:37:01] fartface: Is that a stupid question? lol
[00:38:20] Maletor: has joined #ruby
[00:38:35] catt: has joined #ruby
[00:39:13] Serka: has joined #ruby
[00:40:19] Serka: has left #ruby: ()
[00:41:37] Scripore: has joined #ruby
[00:41:54] jamw: has joined #ruby
[00:49:41] volty: sequel with sqlite, I need a hook (callback) on dataset change. is it implemented ?
[00:49:43] Encapsulation: has joined #ruby
[00:49:57] hannelita: has joined #ruby
[00:50:53] haraoka: has joined #ruby
[00:51:04] duckpuppy: has joined #ruby
[00:51:48] Cyrus: has joined #ruby
[00:54:41] paradisaeidae: has joined #ruby
[00:54:51] northfurr: has joined #ruby
[00:55:23] lemur: has joined #ruby
[00:57:00] Serka: has joined #ruby
[00:57:37] 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)
[00:57:46] ruby[bot]: +qq Serka!*@* *!*@77.227.250.205
[00:57:48] ruby[bot]: -q MichaelJJackson!*@*
[00:58:38] Serka: has left #ruby: ()
[00:58:42] OS-18137: what a spamfag
[00:59:28] defendguin: has joined #ruby
[01:00:51] marienz: has joined #ruby
[01:01:28] D9: has joined #ruby
[01:03:00] User458764: has joined #ruby
[01:05:01] Ox0dea: >> require 'prime'; 18137.prime?
[01:05:02] ruby[bot]: Ox0dea: # => false (https://eval.in/505519)
[01:05:24] nertzy2: has joined #ruby
[01:07:02] guacamole: has joined #ruby
[01:07:07] Ox0dea: OS-18137: Is this you? http://genevisible.com/tissues/OS/UniGene/Os.18137
[01:09:41] finisherr: has left #ruby: ()
[01:13:01] jottr_: has joined #ruby
[01:14:19] arescorpio: has joined #ruby
[01:15:36] nanoz: has joined #ruby
[01:16:09] fclausen: has joined #ruby
[01:16:11] InvGhost: has joined #ruby
[01:17:03] rkazak: has joined #ruby
[01:20:53] thejamespinto: has joined #ruby
[01:21:11] fclausen: has joined #ruby
[01:22:53] User458764: has joined #ruby
[01:26:33] janebootydoe: has joined #ruby
[01:31:09] goodroot: has joined #ruby
[01:31:54] average: has joined #ruby
[01:32:02] average: I was reading this issue.. https://github.com/rbenv/ruby-build/pull/860
[01:32:03] Ebok: has joined #ruby
[01:32:16] average: I think this is my favorite pastime now
[01:32:29] average: reading Github issues where people get emotional and like they fight for their right
[01:32:32] bronson: has joined #ruby
[01:32:49] yeticry: has joined #ruby
[01:32:50] average: it's awesome when you're not one of those people, it's super-fun to watch
[01:32:55] northfurr: has joined #ruby
[01:33:34] pawnbox: has joined #ruby
[01:36:04] onlyme_: has joined #ruby
[01:36:26] ajf-: has joined #ruby
[01:37:21] harly: "a release label is much like a domain name" uhhh.
[01:37:40] harly: the thread is funny. but that statement. i'd get in there and fight :)
[01:39:28] gix: has joined #ruby
[01:41:12] northfurr: has joined #ruby
[01:41:17] griffindy: has joined #ruby
[01:42:02] mrsolow: has joined #ruby
[01:43:40] cicloid_: has joined #ruby
[01:44:04] duckpuppy: has joined #ruby
[01:46:11] Darmani: Questionnn
[01:46:13] baweaver: has joined #ruby
[01:46:14] Darmani: What do you guys do
[01:46:19] Darmani: When you can't fucking think anymore.
[01:46:34] average: Darmani: you can sleep for example
[01:46:53] Darmani: Lol I'm taking like a break tho
[01:47:00] average: harly: they are turning GH issues into a pugilistic parking lot where devs duke it out
[01:47:34] northfurr: has joined #ruby
[01:47:45] harly: lots of you should instead of why do you
[01:47:48] cicloid: has joined #ruby
[01:48:00] harly: did you read the continuation? the new thread that was created to "remove rubinius" :)
[01:48:15] average: harly: I'm going to now
[01:48:22] average: this is a true saga
[01:48:59] cicloid: has joined #ruby
[01:49:02] 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.
[01:51:27] cicloid_: has joined #ruby
[01:52:09] Ox0dea: has joined #ruby
[01:52:16] 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
[01:53:04] northfurr: has joined #ruby
[01:53:35] crankharder: has joined #ruby
[01:55:47] Darmani: average - Lmao
[01:55:50] Darmani: that's how you relax?
[01:56:01] Darmani: I don't know enough about programming to argue with anyone xD
[01:56:06] bklane: has joined #ruby
[01:56:38] ur5us: has joined #ruby
[01:58:01] ruby[bot]: -qq Serka!*@* *!*@77.227.250.205
[01:58:17] average: Darmani: that's totally fine
[01:59:05] 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
[01:59:27] average: Darmani: so just grab a broken bottle, and go there and hit someone in the head
[02:00:09] Darmani: average - lmao
[02:00:26] 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.
[02:00:26] harly: 4) for a toy for people to try, this seems like a lot of effort." :)
[02:01:26] harly: great thread, thanks average. subscribed. :)
[02:01:54] paradisaeidae: has joined #ruby
[02:03:46] pawnbox: has joined #ruby
[02:07:17] mfb2: has joined #ruby
[02:07:58] arlek: has joined #ruby
[02:08:14] goodroot: has joined #ruby
[02:08:43] nfk|laptop: has joined #ruby
[02:10:15] average: has left #ruby: ()
[02:10:31] kalopsian: has joined #ruby
[02:13:33] Radar: Darmani: I go 1) sleep (because it's amazing) 2) for a walk (because fresh air is good) 3) play video games
[02:13:52] Radar: There have been a number of problems I have solved in my sleep
[02:14:24] Darmani: Radar - You dream in Ruby? Lol
[02:14:47] Radar: Darmani: What are dreams if not hallucinations to prepare us for the harshness of the following day's reality?
[02:14:47] bklane: has joined #ruby
[02:14:57] Radar: Darmani: put another way: sometimes
[02:15:28] Darmani: Radar - So poetic. I almost shed a tear right there.
[02:15:44] passcod: has joined #ruby
[02:15:48] cholq: has joined #ruby
[02:16:03] cholq: has left #ruby: ()
[02:18:16] robbyoconnor: has joined #ruby
[02:26:17] razorgfx: has joined #ruby
[02:26:31] ddv: has joined #ruby
[02:30:08] northfurr: has joined #ruby
[02:30:47] jamw: has joined #ruby
[02:31:05] Ox0dea: A prevailing theory is that dreams are so weird because we're trying to interpret memories while they're being serialized/compressed.
[02:32:42] Ox0dea: That's not to say that we know overly much about the file formats involved.
[02:33:34] diegoviola: can you guys help me with this code please: https://gist.github.com/diegoviola/0b442c7166b6591a8af4
[02:33:39] diegoviola: I'm trying to decode that email properly
[02:33:50] diegoviola: rot11 exercise
[02:34:02] Ox0dea: What's "me contratagora" mean?
[02:34:20] Arnvald: has joined #ruby
[02:34:59] chipotle: has joined #ruby
[02:35:02] Ox0dea: Interesting.
[02:35:12] stevemackinnon: has joined #ruby
[02:35:22] Ox0dea: diegoviola: You just need `rotate(-shift)`, I think.
[02:35:37] havenwood: diegoviola: How does this cypher expect you to treat numbers and symbols?
[02:35:41] diegoviola: I already rotated the string, but the numbers and @ and dots is not coming in
[02:35:43] Ox0dea: Oh, never mind. The problem is that you're rotating non-alphabetic characters.
[02:35:49] baweaver: Is this an interview question?
[02:36:04] Ox0dea: diegoviola: Do you know how #fetch works?
[02:36:06] diegoviola: more like for sending my CV, but I can already hear you won't help me
[02:36:11] Ox0dea: Calm down.
[02:36:33] Ox0dea: The second argument to #fetch is the value to use if the key isn't found.
[02:36:47] Ox0dea: You're passing " " and ignoring the actual character you've got.
[02:37:31] 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?
[02:37:38] Arnvald: has joined #ruby
[02:39:07] diegoviola: I just want the symbols to stay as they are in the original string
[02:39:10] Radar: diegoviola: I think it's dishonest of you to get help from this channel with what is effectively a job application process.
[02:39:17] Radar: diegoviola: The company is hiring you. Not the #ruby channel.
[02:39:25] iateadonut: has joined #ruby
[02:39:32] havenwood: Though the #ruby channel is a compelling applicant!
[02:39:46] Radar: "None of us is as stupid as all of us" - channel motto
[02:39:57] Radar: (I kid, I kid)
[02:40:45] diegoviola: you're right
[02:40:52] 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.
[02:40:55] baweaver: radar s/is/are/
[02:41:08] Radar: baweaver: Maybe it was intentional? ;)
[02:41:21] dlitvak: has joined #ruby
[02:41:28] diegoviola: but I don't think I'll get hired anyway
[02:41:33] diegoviola: it's a php position
[02:41:38] baweaver: Radar: short of a response table, no clue.
[02:41:57] baweaver: eg: {404 => 'Not Found' ...}
[02:42:06] Ox0dea: Channel song: https://youtu.be/j-fWDrZSiZs?t=45
[02:42:06] Radar: baweaver: yeah that's what I'm thinking.
[02:42:21] rsc___: has joined #ruby
[02:42:22] baweaver: if there's a builtin I can't find it from a cursory search at least
[02:42:31] Radar: thanks baweaver
[02:42:44] baweaver: might make a PR for fun
[02:42:50] s00pcan: has joined #ruby
[02:42:57] baweaver: make SURE to include the most important one of all though
[02:43:38] Ox0dea: >> require 'webrick'; WEBrick::HTTPStatus::StatusMessage[404] # Radar
[02:43:40] ruby[bot]: Ox0dea: # => (https://eval.in/505530)
[02:43:43] baweaver: https://github.com/jnunemaker/httparty/blob/d85e617768b1e9ff00abc00da9f58fbbafd2c194/spec/httparty/response_spec.rb#L50
[02:43:48] baweaver: potentially interesting
[02:45:27] auzty: has joined #ruby
[02:45:47] Ox0dea: There we go: https://eval.in/505534
[02:45:52] Ox0dea: No need to bring in the whole library.
[02:46:18] Ox0dea: It's missing 418. :(
[02:46:30] Ox0dea: Never mind, Radar. WEBrick a shit.
[02:48:28] zambini: has joined #ruby
[02:48:51] duckpuppy: has joined #ruby
[02:49:22] Rodya_: has joined #ruby
[02:50:26] |ifei5g00d: has joined #ruby
[02:50:35] djellemah: has joined #ruby
[02:51:31] sakix: has joined #ruby
[02:52:06] |ifei5g00d: has joined #ruby
[02:54:39] havenwood: >> code = 404; Net::HTTPResponse::CODE_TO_OBJ[code.to_s].name.sub('Net::HTTP', '').gsub(/([[:lower:]])([[:upper:]])/, '\1 \2')
[02:54:40] ruby[bot]: havenwood: # => uninitialized constant Net (NameError) ...check link for more (https://eval.in/505543)
[02:54:49] havenwood: Well, anyways. >.>
[02:55:11] Radar: Ok that's just crazy. Don't you people have jobs to do?
[02:55:27] havenwood: Hollywood Ruby meetup in 5 min!
[02:55:56] havenwood: >> require 'net/http'; code = 417; Net::HTTPResponse::CODE_TO_OBJ[code.to_s].name.sub('Net::HTTP', '').gsub(/([[:lower:]])([[:upper:]])/, '\1 \2')
[02:55:58] ruby[bot]: havenwood: # => "Expectation Failed" (https://eval.in/505544)
[02:56:10] lemur: has joined #ruby
[02:56:28] havenwood: ACTION bides time
[02:56:43] LMity: has joined #ruby
[02:56:45] havenwood: TIL Net::HTTP Response doesn't support teapots.
[02:57:39] Kryptonical: has joined #ruby
[02:57:54] diegoviola: I found the solution to my problem: https://gist.github.com/diegoviola/0b442c7166b6591a8af4
[02:58:00] razorgfx: has joined #ruby
[02:58:20] havenwood: diegoviola: gj
[02:58:35] kobain: has joined #ruby
[02:58:43] diegoviola: not that I want to work there anyway, I hope you didn't notice the domain name
[02:58:56] Radar: Noticed and logged for all time.
[02:58:57] TomPeed: has joined #ruby
[02:59:13] Ox0dea: How to confirm the primality of 2 ** 74_207_281 - 1 with Ruby?
[02:59:34] Ox0dea: Can't do it without BigDecimal, and BigDecimal doesn't have #prime?.
[02:59:39] diegoviola: Radar: logged?
[02:59:55] Radar: diegoviola: http://logs.ryanbigg.com/p/diegoviola
[03:00:08] Radar: diegoviola: I have a log of every message you've ever sent to #ruby or #rubyonrails since 2012-09-01
[03:00:19] Ox0dea: Radar: Would you like to fix that?
[03:00:26] diegoviola: Radar: that's fine, but not very ethical
[03:00:37] Radar: diegoviola: Why thank you.
[03:01:09] Ox0dea: whitequark's goes back to 2011-11-16 if you want 'em.
[03:01:23] Radar: meh, it's not that big of a deal to not have them
[03:01:31] Radar: unless you can give me them in a very particular SQL format
[03:01:41] Ox0dea: Eh, it's a TSV.
[03:01:42] Radar: Or CSV, I guess.
[03:01:46] Radar: TSV works.
[03:02:02] Radar: Where can I find them?
[03:02:37] Ox0dea: They're over here.
[03:02:55] bnagy: Ox0dea: https://dzone.com/articles/miller-rabin-prime-test-ruby
[03:02:57] mfb2: has joined #ruby
[03:03:07] bnagy: prime? is a toy anyway
[03:03:12] pawnbox: has joined #ruby
[03:03:25] bnagy: otherwise maybe the openssl bindings o_0
[03:05:56] Ox0dea: bnagy: The new Mersenne prime is >22m digits in length. I think I'm just gonna have to trust them.
[03:07:17] joneshf-laptop: has joined #ruby
[03:07:24] bnagy: oh there's a thing just for mersennes
[03:07:43] bnagy: but it would still be a pain, yeah
[03:07:54] hannelita: has joined #ruby
[03:08:08] Maletor: has joined #ruby
[03:08:56] thejamespinto: has joined #ruby
[03:09:09] 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
[03:10:32] bnagy: nope, LLT is better
[03:10:39] bnagy: how does math
[03:11:12] fclausen: has joined #ruby
[03:14:57] redtail: has joined #ruby
[03:15:08] newbie22: has joined #ruby
[03:15:37] Ebok: has joined #ruby
[03:17:50] floatingpoint: has joined #ruby
[03:19:06] tvw: has joined #ruby
[03:19:49] dlitvak: has joined #ruby
[03:21:51] sucks: has joined #ruby
[03:22:15] rtail: has joined #ruby
[03:26:15] Rodya_: has joined #ruby
[03:27:25] goodroot: has joined #ruby
[03:27:55] redtail: has joined #ruby
[03:30:01] domgetter: has joined #ruby
[03:30:46] sucks: has joined #ruby
[03:31:10] Rodya_: has joined #ruby
[03:31:10] IrishGringo: has joined #ruby
[03:32:40] Musashi007: has joined #ruby
[03:33:33] confounds: has joined #ruby
[03:35:53] thejamespinto: has joined #ruby
[03:39:15] mebymyself: has joined #ruby
[03:43:18] pawnbox: has joined #ruby
[03:47:03] cbyrda: has joined #ruby
[03:51:50] Arnvald_: has joined #ruby
[03:52:07] framling: has joined #ruby
[03:53:38] pawnbox: has joined #ruby
[03:54:57] AMERICAN_PSYCHO: has joined #ruby
[04:02:11] luckyme: has joined #ruby
[04:04:44] mrsolow: has joined #ruby
[04:07:10] User458764: has joined #ruby
[04:07:52] tildes: has joined #ruby
[04:08:36] hannelita: has joined #ruby
[04:09:22] dlitvak: has joined #ruby
[04:10:48] zast: has joined #ruby
[04:10:54] araujo_: has joined #ruby
[04:11:05] vikas027: has joined #ruby
[04:11:34] ccaffeini: has joined #ruby
[04:13:23] 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
[04:13:35] freerobby: has joined #ruby
[04:13:38] vikas027: This is the output of 'pp'
[04:14:02] tinnvec: has joined #ruby
[04:15:28] Ox0dea: vikas027: This is an Array containing a Hash.
[04:15:38] Radar: vikas027: .detect
[04:15:44] arup_r: has joined #ruby
[04:16:12] tinnvec: has joined #ruby
[04:16:20] Ox0dea: vikas027: You want myarray[0]['name'], but better would be to fix the weirdness of your data.
[04:16:27] braincrash: has joined #ruby
[04:16:37] howdoi: has joined #ruby
[04:17:56] rkazak: has joined #ruby
[04:17:57] roshanavand: has joined #ruby
[04:19:16] 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 :|
[04:20:37] tinnvec: has joined #ruby
[04:20:38] Radar: Praise be to Ox0dea.
[04:21:31] vikas027: Ox0dea: And that weird Array is coming from DynamoDB Table
[04:21:43] tinnvec: has joined #ruby
[04:21:50] cajone: has left #ruby: ()
[04:22:22] Ox0dea: vikas027: Ah, fair enough. So it might be the case that you'll receive several records, right?
[04:22:40] vikas027: Ox0dea: yes
[04:22:55] Ox0dea: vikas027: Then you'll probably want #map.
[04:23:11] Ox0dea: `myarray.map { |hash| hash['name'] }` or the like.
[04:23:42] tinnvec: has joined #ruby
[04:24:17] vikas027: Ox0dea: Nice, I am trying that. I have just figured out that the class is actually not Array. It is Seahorse::Client::Response
[04:24:24] tinnvec: has joined #ruby
[04:26:52] tinnvec: has joined #ruby
[04:27:05] vikas027: Ox0dea: Map is working perfectly. Thank you
[04:27:06] rsc___: has joined #ruby
[04:27:12] Arnvald: has joined #ruby
[04:27:16] Ox0dea: vikas027: Yay! :) Happy to help.
[04:27:49] Ox0dea: Be advised that there might be something a little more specialized for Seahorse in particular if you end up needing a fancier transformation.
[04:28:31] hxegon: has joined #ruby
[04:28:52] vikas027: Ox0dea: Yeah, I am using a ruby gem to talk to DynamoDB. Fanciness is expected :)
[04:29:29] cajone: has joined #ruby
[04:31:05] mrsolow: has joined #ruby
[04:31:28] skcin7: has joined #ruby
[04:32:08] tjbiddle: has joined #ruby
[04:33:35] tinnvec: has joined #ruby
[04:35:25] bronson: has joined #ruby
[04:35:44] devbug: has joined #ruby
[04:39:05] crdpink: has joined #ruby
[04:39:50] akem: has joined #ruby
[04:40:14] waka: has joined #ruby
[04:40:39] hnagamin: has joined #ruby
[04:42:03] JohnT: has joined #ruby
[04:44:47] sneakerhax: has joined #ruby
[04:47:05] baweaver: has joined #ruby
[04:47:30] Sembei: has joined #ruby
[04:47:45] bmalum: has joined #ruby
[04:48:49] rtail: has joined #ruby
[04:49:16] razorgfx: has joined #ruby
[04:49:36] duckpuppy: has joined #ruby
[04:50:07] dfinninger: has joined #ruby
[04:51:09] 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?
[04:51:19] pizzaops: E.g. something like .select_and_return_first
[04:51:19] Radar: pizzaops: .detect
[04:51:31] Radar: pizzaops: or .find if you want a shorter version
[04:51:42] pizzaops: Radar: that's perfect! Thanks!
[04:52:06] pizzaops: Radar: are .find and .detect aliases?
[04:52:12] pizzaops: From the docs it looks like they are.
[04:52:14] Radar: pizzaops: yes
[04:52:24] pizzaops: Is one of them the "not-alias" name of the method?
[04:52:47] Ox0dea: At least, there's no reason for that to matter.
[04:52:53] Ox0dea: But the C function is called enum_find().
[04:53:08] pizzaops: That's funny since the example for #find uses .detect
[04:53:40] Radar: it uses both
[04:53:48] gix: has joined #ruby
[04:53:54] Radar: http://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-find
[04:53:59] Ox0dea: I use #select and #find; I bet there's some weirdo that uses #find_all and #detect.
[04:54:07] Radar: I use #select + #detect
[04:54:10] wilbert_: has joined #ruby
[04:54:53] pizzaops: I hear the word "select" used to describe that functionality more often than "find_all", so I'll just stick wit that.
[04:55:15] 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.
[04:55:25] Ox0dea: Sanity prevails!
[04:55:28] pizzaops: Although #detect sounds cooler :D
[04:56:03] Ox0dea: >> inspect or gadget
[04:56:06] ruby[bot]: Ox0dea: # => "main" (https://eval.in/505572)
[04:56:22] Ox0dea: That's funnier than I expected.
[04:57:54] pizzaops: Welp, back to the vSphere API. . .or as I call it. . .the VMnomicon. . .
[04:58:33] dlitvak: has joined #ruby
[04:58:36] pizzaops: Using the vSphere SOAP API: Just as complicated as raising the dead, and with the same odds of success!
[04:59:19] djellemah: has joined #ruby
[05:00:39] Ebok: has joined #ruby
[05:00:50] terminalrecluse: has joined #ruby
[05:00:56] Radar: pizzaops: You might want to make sure that that .find call isn't Model.find, which is different to [].find
[05:01:31] pizzaops: I'm calling find on an array
[05:02:00] astrobunny: has joined #ruby
[05:02:01] pizzaops: Radar: Model is a rails thing right? As in MVC? This isn't rails just pure ruby.
[05:02:10] pizzaops: It's not even a web application.
[05:02:11] Radar: pizzaops: yeah, it's from Rails
[05:02:15] Radar: Right then.
[05:02:18] pizzaops: Ah ok. There's zero chance of that then.
[05:02:41] pizzaops: I'm working on a Puppet type and provider. Just happens to require ruby.
[05:02:51] martinliu: has joined #ruby
[05:02:53] pizzaops: Thanks for you help folks!
[05:03:30] Arnvald: has joined #ruby
[05:07:36] Ebok: has joined #ruby
[05:09:24] hannelita: has joined #ruby
[05:16:04] ramfjord: has joined #ruby
[05:17:49] Eiam_: has joined #ruby
[05:20:20] dcunit3d: has joined #ruby
[05:23:21] 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?
[05:24:37] sigurding: has joined #ruby
[05:24:58] AlecTaylor: has joined #ruby
[05:25:08] AlecTaylor: How do I hide specific warnings in Ruby 2.3?
[05:25:53] domgetter: AlecTaylor which warning?
[05:26:15] tjbiddle: has joined #ruby
[05:26:36] chipotle: has joined #ruby
[05:26:47] pwnd_nsfw`: has joined #ruby
[05:28:09] Ox0dea: domgetter: Could you post the error output?
[05:30:08] techsethi: has joined #ruby
[05:32:44] arup_r: has joined #ruby
[05:34:41] speaking1ode: has joined #ruby
[05:35:05] RobertBirnie: has joined #ruby
[05:37:10] djellemah: has joined #ruby
[05:37:11] bronson: has joined #ruby
[05:38:11] dlitvak: has joined #ruby
[05:38:57] domgetter: Ox0dea: https://gist.github.com/anonymous/7db7925a18925ae7f607
[05:39:27] Ox0dea: domgetter: apt-get install build-essential
[05:40:58] domgetter: Ox0dea: build-essential is already the newest version.
[05:41:20] Ox0dea: Er... it has a version?
[05:41:31] Ox0dea: It's supposed to be a metapackage, I thought.
[05:41:40] domgetter: that was the output from apt-get install
[05:42:30] KnownSyntax: has joined #ruby
[05:42:30] KnownSyntax: has joined #ruby
[05:43:47] pawnbox: has joined #ruby
[05:44:44] krz: has joined #ruby
[05:45:00] djbkd: has joined #ruby
[05:47:00] bluOxigen: has joined #ruby
[05:48:50] domgetter: Ox0dea: I'll have to try tomorrow, thanks though
[05:51:40] last_staff: has joined #ruby
[05:54:39] Cohedrin: has joined #ruby
[05:57:22] astrobunny: has joined #ruby
[05:58:48] Ox0dea: AlecTaylor: Still about?
[05:59:04] altu1nsf0llow3r: has joined #ruby
[05:59:27] katiej: has joined #ruby
[05:59:38] armyriad: has joined #ruby
[06:00:03] 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
[06:00:08] katiej: Where else would a validation rule be?
[06:00:25] Radar: katiej: !code
[06:00:30] Radar: ?code katiej
[06:00:31] ruby[bot]: katiej: We can't help you without your code, please post it to https://gist.github.com
[06:00:54] katiej: ok one sec
[06:01:40] katiej: https://gist.github.com/willwiggins/22e7df548174deaa8c63
[06:01:54] ruby-lang470: has joined #ruby
[06:02:01] Radar: https://gist.github.com/willwiggins/22e7df548174deaa8c63#file-gistfile1-txt-L13
[06:02:04] Radar: Why is this included?
[06:02:44] skade: has joined #ruby
[06:02:51] katiej: From the documentation I thought it was needed for the Validates rules
[06:03:07] Radar: No, you don't need to include that at all. ActiveRecord::Base includes everything that you need.
[06:03:13] ruby-lang470: can someone help me integrate the api from "wine.com" into my rails app
[06:03:16] ruby-lang470: now sure how to do it
[06:03:18] ruby-lang470: https://api.wine.com/wiki
[06:03:27] katiej: Oh - every example iw as looking at had it
[06:03:39] Radar: katiej: Including the official validations guide? http://guides.rubyonrails.org/active_record_validations.html
[06:03:54] katiej: I get the same error with that commented out
[06:04:15] Radar: katiej: Can you put this app on GitHub so that I can take a look?
[06:04:22] Radar: ruby-lang470: What have you tried so far?
[06:05:35] katiej: I have passwords and company info in it at the moment so can't post it all publicly
[06:05:43] katiej: is there anything in particular I could show that'd help?
[06:06:10] Radar: Normally I'd ask for the model and the controller, but the model's been shown
[06:06:20] Radar: controller probably doesn't have anything in it
[06:06:32] AlecTaylor: Ox0dea: Yeah, nevermind, solution is sed
[06:06:35] Radar: katiej: Is that everything in your Ticket model that you're showing there?
[06:06:46] Ox0dea: AlecTaylor: Are you sure?
[06:06:57] safe: has joined #ruby
[06:07:03] skade: has joined #ruby
[06:07:39] katiej: I can post the Ticket controller one sec
[06:07:54] Radar: katiej: Yeah then I'm not sure.
[06:08:03] Radar: katiej: Please try to reproduce this in a new Rails app and let me know if you can,.
[06:08:12] chipotle: has joined #ruby
[06:08:27] katiej: https://gist.github.com/willwiggins/93934aacd446a12a4610
[06:08:33] Ox0dea: AlecTaylor: Well, if you ever need to suppress specific warnings from Ruby-land: https://eval.in/505606
[06:08:51] Radar: katiej: Seems stock standard. Yeah, I'm out of ideas.
[06:09:04] katiej: Radar: I even tried to explicitly set Numericality to false but it still is saying it must be a number
[06:09:49] tmtwd: has joined #ruby
[06:12:28] waheedi: has joined #ruby
[06:14:46] chouhoulis: has joined #ruby
[06:14:51] djellemah: has joined #ruby
[06:15:47] katiej: Radar: Aha!
[06:15:58] Radar: katiej: what's up?
[06:16:02] katiej: Radar: did a rake db:reset and issue seems resolved
[06:16:10] katiej: no idea why..though
[06:16:47] Radar: katiej: that is extremely weird.
[06:17:01] Radar: katiej: Were those validations ever in the model?
[06:17:02] katiej: if you set a validation in testing..do you have to reset db if you remove it?
[06:17:07] katiej: maybe during testing
[06:17:23] Radar: Right. So what you've done is restart your Rails console and that's what fixed it because it reloaded the code.
[06:17:44] katiej: i tried restarting both server and console prior but that didn't fix
[06:17:47] rsc___: has joined #ruby
[06:18:01] ascarter_: has joined #ruby
[06:18:59] waka: has joined #ruby
[06:19:08] Radar: let's just put it down to computer gremlins and leave it at that
[06:19:21] katiej: ??\_(???)_/??
[06:19:47] scubawill: dont know who katiej is
[06:20:00] Radar: scubawill: You don't?
[06:20:03] xet7: has joined #ruby
[06:20:13] scubawill: nope maybe a random generated on the webclient i picked
[06:20:33] Radar: Thought it was a Friday night persona.
[06:20:45] Radar: I tease I tease.
[06:21:00] ur5us: has joined #ruby
[06:21:01] pawnbox: has joined #ruby
[06:21:38] hakunin: has joined #ruby
[06:21:41] scubawill: this is my first ruby app but that one had me stumped for a bit
[06:22:47] duckpuppy: has joined #ruby
[06:25:19] lemur: has joined #ruby
[06:25:34] dionysus69: has joined #ruby
[06:29:14] dseitz: has joined #ruby
[06:29:29] ur5us: has joined #ruby
[06:29:35] darkf: has joined #ruby
[06:30:18] dionysus69: has joined #ruby
[06:30:52] ur5us_: has joined #ruby
[06:32:34] skade: has joined #ruby
[06:32:34] sigurding: has joined #ruby
[06:32:48] razorgfx: has joined #ruby
[06:35:01] chipotle: has joined #ruby
[06:37:16] agit0: has joined #ruby
[06:37:56] tildes: has joined #ruby
[06:42:58] JohnT: has joined #ruby
[06:44:08] hannelita: has joined #ruby
[06:44:53] sigurding_: has joined #ruby
[06:45:19] krz: has joined #ruby
[06:45:21] hnagamin: has joined #ruby
[06:45:24] havenwood: martinliu: hi
[06:45:24] lxsameer: has joined #ruby
[06:47:43] djellemah: has joined #ruby
[06:51:30] rippa: has joined #ruby
[06:52:42] aganov: has joined #ruby
[06:54:05] martinliu: has joined #ruby
[06:58:20] User458764: has joined #ruby
[06:58:43] akem: has joined #ruby
[07:01:07] chipotle: has joined #ruby
[07:02:23] waka: has joined #ruby
[07:02:27] karapetyan: has joined #ruby
[07:02:31] x0F_: has joined #ruby
[07:03:14] atmosx: has joined #ruby
[07:07:32] pawnbox: has joined #ruby
[07:11:13] moeabdol: has joined #ruby
[07:11:37] yardenbar: has joined #ruby
[07:12:23] anisha_: has joined #ruby
[07:13:12] BrunoSaboia: has joined #ruby
[07:13:42] kp666: has joined #ruby
[07:14:07] codecop: has joined #ruby
[07:14:48] arup_r: has joined #ruby
[07:15:57] chouhoulis: has joined #ruby
[07:18:50] chipotle: has joined #ruby
[07:19:09] waheedi: has joined #ruby
[07:19:19] einarj: has joined #ruby
[07:19:21] solars: has joined #ruby
[07:19:26] ascarter: has joined #ruby
[07:20:05] troulouliou_div2: has joined #ruby
[07:20:38] dcunit3d: has joined #ruby
[07:20:39] paradisaeidae: has left #ruby: ()
[07:20:59] djellemah: has joined #ruby
[07:23:32] duckpuppy: has joined #ruby
[07:23:33] jackcom: has joined #ruby
[07:23:33] ChanServ: +b jackcom!*@*
[07:23:33] ChanServ: ChanServ kicked jackcom: trolling
[07:23:35] ruby[bot]: -b+b jackcom!*@* jackcom!*@*$#ruby-banned
[07:23:48] dn`: has joined #ruby
[07:26:01] jbrhbr: has joined #ruby
[07:26:09] astrobunny: has joined #ruby
[07:28:14] eowpows: has joined #ruby
[07:28:42] eowpows: Why does each_cons method in Enumerable class return nil at the end?
[07:30:50] Ox0dea: eowpows: Could you clarify?
[07:32:01] PaulCapestany: has joined #ruby
[07:32:09] burgestrand: has joined #ruby
[07:32:53] Ox0dea: Oh, #each_cons with a block; yeah, I don't see why it shouldn't return the receiver like #each does.
[07:33:07] 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
[07:33:11] lxsameer: has joined #ruby
[07:33:12] eowpows: Something like that.
[07:35:04] bklane: has joined #ruby
[07:35:05] Arnvald_: has joined #ruby
[07:35:14] 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.
[07:35:38] waheedi: has joined #ruby
[07:36:26] Arnvald: has joined #ruby
[07:37:27] apeiros: *backlog #ruby 40
[07:37:52] ljarvis: eowpows: use any?
[07:37:57] Ox0dea: eowpows: For that you'll want `range.each_cons(input.size).any? { |c| c == input }`.
[07:38:03] ljarvis: ACTION pow
[07:38:25] Ox0dea: It's still not entirely clear why, though. :P
[07:38:35] sakix: has joined #ruby
[07:39:08] bronson: has joined #ruby
[07:39:41] rkazak: has joined #ruby
[07:40:06] 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. :)
[07:41:13] Ox0dea: It's clear you're wanting to check for continuity; what's the other stipulation? Why (0..6)?
[07:41:22] waheedi: has joined #ruby
[07:41:26] eowpows: ljarvis: It checks out. Thanks. :)
[07:41:35] ascarter: has joined #ruby
[07:42:47] vdamewood: has joined #ruby
[07:42:49] arlek: has joined #ruby
[07:43:10] 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. :)
[07:44:33] firstdayonthejob: has joined #ruby
[07:44:41] Ox0dea: eowpows: I see. Still not sure about the 6, though.
[07:45:10] eowpows: Ummm. 0..6 is the numerical representation for the days of the week.
[07:45:18] Ox0dea: Aye, and 6 is Saturday.
[07:45:45] gagrio: has joined #ruby
[07:46:16] eowpows: Ox0dea: Yes. You're correct.
[07:46:38] ljarvis: that'll include Sunday too?
[07:49:18] eowpows: ljarvis: Yep.
[07:50:10] 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.
[07:50:18] eowpows: Then asked here.
[07:50:29] waheedi: has joined #ruby
[07:50:40] jas02: has joined #ruby
[07:50:43] lyoshajapan: has joined #ruby
[07:51:08] chipotle: has joined #ruby
[07:52:09] Ox0dea: eowpows: For future reference, here's a pretty solid definition of #continuous?: https://eval.in/505648
[07:52:24] Ox0dea: It relies on #succ rather than #pred since not all Enumerable respond to the latter.
[07:53:52] Ox0dea: >> ObjectSpace.each_object(Class).select { |c| m = c.instance_methods; m.include?(:succ) unless m.include?(:pred) }
[07:53:54] ruby[bot]: Ox0dea: # => [Time, Symbol, String] (https://eval.in/505649)
[07:54:08] eowpows: Ox0dea: Thanks. This will be useful. I didn't know about the #succ method.
[07:54:20] Ox0dea: eowpows: It's like +1 for the general case. :P
[07:54:50] Ox0dea: >> 'Happy to helo'.succ
[07:54:52] ruby[bot]: Ox0dea: # => "Happy to help" (https://eval.in/505651)
[07:55:31] bklane_: has joined #ruby
[07:55:50] eowpows: Ox0dea: What class does the #succ method belong?
[07:55:50] Rinalds: has joined #ruby
[07:56:10] Ox0dea: eowpows: It's class-dependent, of course.
[07:56:19] Ox0dea: Fixnum#succ is very different from String#succ.
[07:57:31] eowpows: Ox0dea: I see. Thanks. I learned something new today. :)
[07:57:43] rkazak: has joined #ruby
[07:58:24] eowpows: Here's to hoping everything will be built in Ruby someday. Haha. It's such a fun language to code in. :D
[07:58:25] blackms: has joined #ruby
[07:58:36] deweysdecimal: has joined #ruby
[08:00:48] Ox0dea: Hear, hear!
[08:01:09] ljarvis: I hope not! (but agree it's very fun)
[08:01:28] waheedi: has joined #ruby
[08:01:49] Ox0dea: eowpows: More fun with #succ: https://eval.in/505653
[08:01:57] Ox0dea: You get to decide how your objects behave in Ranges.
[08:02:04] Ox0dea: Ruby = <3
[08:03:14] lyoshajapan: has joined #ruby
[08:04:04] Bloomer: has joined #ruby
[08:07:08] djbkd: has joined #ruby
[08:07:16] x77686d: has joined #ruby
[08:09:00] burgestrand: has joined #ruby
[08:09:26] skade: has joined #ruby
[08:11:35] Ebok: has joined #ruby
[08:11:40] chipotle: has joined #ruby
[08:12:02] pawnbox: has joined #ruby
[08:12:08] moeabdol: has joined #ruby
[08:13:50] ascarter: has joined #ruby
[08:15:34] chihhsin: has joined #ruby
[08:15:44] razorgfx: has joined #ruby
[08:16:09] edwinvdgraaf: has joined #ruby
[08:16:11] TomyWork: has joined #ruby
[08:16:17] jgt: has joined #ruby
[08:16:39] chouhoulis: has joined #ruby
[08:17:09] cpup: has joined #ruby
[08:18:25] DirtyFInn: has joined #ruby
[08:19:26] mark2: has joined #ruby
[08:20:34] curses: has joined #ruby
[08:21:01] usershell: has joined #ruby
[08:21:11] ta: has joined #ruby
[08:21:37] antgel: has joined #ruby
[08:22:38] jamw: has joined #ruby
[08:25:49] skcin7: has joined #ruby
[08:25:52] aufi: has joined #ruby
[08:28:59] BTRE: has joined #ruby
[08:32:22] sonne: has joined #ruby
[08:35:44] blackms: has joined #ruby
[08:36:02] craigp: has joined #ruby
[08:36:52] djbkd: has joined #ruby
[08:37:10] PedramT: has joined #ruby
[08:39:28] ascarter: has joined #ruby
[08:39:58] r4um: has joined #ruby
[08:40:13] User458764: has joined #ruby
[08:41:03] mondok: has joined #ruby
[08:43:03] sandstrom: has joined #ruby
[08:43:10] roshanavand: has joined #ruby
[08:44:36] roshanavand: has joined #ruby
[08:46:05] Ishido: has joined #ruby
[08:46:11] agit0: has joined #ruby
[08:46:12] skcin7: has joined #ruby
[08:46:53] platzhirsch: has joined #ruby
[08:48:13] usershell: has joined #ruby
[08:48:30] blaxter: has joined #ruby
[08:48:39] connor_goodwolf: has joined #ruby
[08:48:40] Cohedrin: has joined #ruby
[08:50:00] platzhirsch: has left #ruby: ()
[08:50:30] blackmes1: has joined #ruby
[08:50:54] Xeago: has joined #ruby
[08:51:17] Spami: has joined #ruby
[08:51:56] dionysus69: has joined #ruby
[08:54:34] baweaver: has joined #ruby
[08:54:42] yfeldblum: has joined #ruby
[08:55:27] lyoshajapan: has joined #ruby
[08:55:47] Bish: is there something in rubies that does something x times a second?
[08:56:26] rdark: has joined #ruby
[08:57:05] puria: has joined #ruby
[08:58:09] harly: Bish, one: https://github.com/jmettraux/rufus-scheduler
[08:58:15] 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
[08:58:18] ympeg: has joined #ruby
[08:58:58] Anderson69s_Deb: has joined #ruby
[08:58:59] sakix: has joined #ruby
[08:59:15] Bish: doesn't look like exactly what i want
[08:59:51] Ox0dea: Bish: Resist the urge to reach for Timeout.
[08:59:52] harly: Bish, there's also https://github.com/javan/whenever
[09:00:00] skade: has joined #ruby
[09:00:13] Ox0dea: There's an esolang called Whenever.
[09:00:13] Bish: Ox0dea: i don't feel it
[09:00:52] 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!
[09:01:13] like-all: has joined #ruby
[09:02:10] ascarter: has joined #ruby
[09:03:52] joonty: has joined #ruby
[09:05:23] dlitvak: has joined #ruby
[09:06:13] SCHAAP137: has joined #ruby
[09:09:54] edwinvdgraaf: has joined #ruby
[09:10:06] DoubleMalt: has joined #ruby
[09:10:17] Ox0dea: Bish: This isn't what you're trying to do? https://glot.io/snippets/eb6brkdvto
[09:10:52] 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.
[09:11:30] quazimodo: has joined #ruby
[09:11:33] Ox0dea: Oh, wait, it doesn't block.
[09:11:57] Arnvald_: has joined #ruby
[09:12:36] ascarter: has joined #ruby
[09:12:56] Ox0dea: Here's a blocking go at it: https://eval.in/505672
[09:13:25] anisha_: has joined #ruby
[09:13:46] Ox0dea: And that should just be `i >= n || i`, of course.
[09:14:12] harly: timeout is nice. i was rolling my own with Time.now etc
[09:14:19] skade: has joined #ruby
[09:14:32] Ox0dea: Well, it uses exceptions as control flow by design, which is generally to be shunned.
[09:14:36] Ox0dea: But it fits now and again.
[09:15:14] harly: well. it gives you a way to differentiate.
[09:15:24] harly: and the name implies timing out is an edge case or error.
[09:16:13] Xeago: has joined #ruby
[09:17:02] sandstrom: has joined #ruby
[09:17:27] huyderman: has joined #ruby
[09:17:27] chouhoulis: has joined #ruby
[09:18:10] krz: has joined #ruby
[09:18:36] dlitvak_: has joined #ruby
[09:20:39] roshanav_: has joined #ruby
[09:22:03] sigurding: has joined #ruby
[09:23:33] consti: has joined #ruby
[09:23:35] Mia: has joined #ruby
[09:23:35] Mia: has joined #ruby
[09:24:24] dmolina: has joined #ruby
[09:24:39] drptbl: has joined #ruby
[09:24:59] chipotle: has joined #ruby
[09:25:24] hannelita: has joined #ruby
[09:25:30] Axy: has joined #ruby
[09:25:30] Axy: has joined #ruby
[09:25:34] duckpuppy: has joined #ruby
[09:26:20] Hounddog: has joined #ruby
[09:27:17] puria: has joined #ruby
[09:29:32] ascarter: has joined #ruby
[09:29:43] araujo: has joined #ruby
[09:29:43] araujo: has joined #ruby
[09:30:27] marr: has joined #ruby
[09:30:41] codecop: has joined #ruby
[09:30:56] blackgoat: has joined #ruby
[09:32:36] troulouliou_div2: has joined #ruby
[09:33:46] dlitvak: has joined #ruby
[09:37:49] bluOxigen_: has joined #ruby
[09:38:33] InvGhost: has joined #ruby
[09:40:32] howdoicomputer: has joined #ruby
[09:42:50] harly: Ox0dea, glot.io is nice. just registered and installed glot-cli :)
[09:42:58] burgestrand: Ox0dea it's also slightly dangerous in that it might cause even ensure-blocks of code to not run despite being ensured! (Timeout)
[09:43:15] ascarter: has joined #ruby
[09:43:38] Ox0dea: harly: Indeed! Much less constrained than eval.in as well.
[09:43:56] harly: also, compiled my first go porgram. yay.
[09:44:14] Ox0dea: Burgestrand: "Slightly" is a bit of an understatement there. :P
[09:44:28] Ox0dea: You really want your `ensure` blocks running with IO involved.
[09:44:35] burgestrand: Ox0dea everything's relative. :)
[09:46:05] burgestrand: But yes, Timeout bad, don't use it. You could maybe be exempt if you know what you are doing??? maybe.
[09:46:52] platzhirsch: has joined #ruby
[09:47:06] cornerma1: has joined #ruby
[09:47:20] Ox0dea: Hm... I don't see why Hash#[]= shouldn't support multiple assignment.
[09:48:36] chthon: has joined #ruby
[09:48:52] dlitvak_: has joined #ruby
[09:50:12] Ox0dea: Anyway, 705 is the first Lucas pseudoprime.
[09:50:14] 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) }
[09:50:15] ruby[bot]: Ox0dea: # => 705 (https://eval.in/505693)
[09:50:27] ascarter: has joined #ruby
[09:51:19] neanderslob: has joined #ruby
[09:51:57] sftrabbit: has joined #ruby
[09:53:14] Ox0dea: harly: glot.io doesn't show partial results. :< https://glot.io/snippets/eb6cxn0iza
[09:53:26] lipoqil: has joined #ruby
[09:54:02] harly: what do you mean by partial?
[09:54:58] harly: ah have to wait for timeout (about 16 seconds) before seeing any output?
[09:55:01] chipotle: has joined #ruby
[09:55:07] Ox0dea: No, no output at all if it does timeout. :/
[09:55:14] harly: i got output...
[09:55:22] harly: 705..113573
[09:55:37] harly: there's a STDOUT green panel, and an 'Error' red panel.
[09:55:48] Ox0dea: Ah, I might be retarded.
[09:56:01] harly: Error\nsignal: killed
[09:56:10] Ox0dea: Don't know how I missed it.
[09:56:25] harly: would be really nice to get output streamed
[09:57:51] harly: heh, glot.io site written in haskell
[09:57:59] harly: i know basics. but yeah. i'll pass on crawling through that :)
[09:58:03] skade: has joined #ruby
[09:58:41] ta: has joined #ruby
[09:58:51] FernandoBasso: has joined #ruby
[09:59:50] Ox0dea: > All vars needs to be set, no default values are provided.
[09:59:54] Ox0dea: How very Haskell.
[10:00:19] moeabdol: has joined #ruby
[10:00:22] robbyoconnor: has joined #ruby
[10:00:33] sleetdrop: has joined #ruby
[10:01:12] rodfersou: has joined #ruby
[10:01:14] Xeago: has joined #ruby
[10:01:26] ascarter: has joined #ruby
[10:02:51] PedramT: has joined #ruby
[10:03:42] haxrbyte: has joined #ruby
[10:04:09] aufi: has joined #ruby
[10:04:17] dlitvak: has joined #ruby
[10:05:32] snowy: has joined #ruby
[10:09:37] aufi: has joined #ruby
[10:10:16] Arnvald: has joined #ruby
[10:11:02] PedramT: has joined #ruby
[10:12:37] stamina: has joined #ruby
[10:17:47] FooMunki: has joined #ruby
[10:18:11] chouhoulis: has joined #ruby
[10:19:10] FooMunki: has joined #ruby
[10:19:18] dlitvak_: has joined #ruby
[10:19:18] PedramT: has joined #ruby
[10:19:27] workmad3: has joined #ruby
[10:21:25] Arnvald: has joined #ruby
[10:22:06] ta: has joined #ruby
[10:22:24] dwfait: has joined #ruby
[10:22:42] chipotle: has joined #ruby
[10:23:26] jamw: has joined #ruby
[10:24:28] aufi: has joined #ruby
[10:25:46] PedramT_: has joined #ruby
[10:25:59] hannelita: has joined #ruby
[10:26:30] jottr_: has joined #ruby
[10:28:23] User458764: has joined #ruby
[10:29:59] Junaos: has joined #ruby
[10:30:33] ascarter: has joined #ruby
[10:31:04] platzhirsch: has joined #ruby
[10:32:04] arup_r: has joined #ruby
[10:32:19] SegFaultAX: has joined #ruby
[10:34:24] ferr: has joined #ruby
[10:34:55] tsunamie: has joined #ruby
[10:34:58] howdoicomputer: has joined #ruby
[10:36:37] usershell: has joined #ruby
[10:39:02] 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?
[10:39:22] apeiros: 1.9 removed it
[10:39:27] ldnunes: has joined #ruby
[10:39:29] tsunamie: has joined #ruby
[10:39:49] ddv: apeiros: aaah that points me in the right direction
[10:39:51] ddv: apeiros: thanks
[10:43:10] FooMunki: has joined #ruby
[10:45:37] drptbl: has joined #ruby
[10:45:58] Ox0dea: ddv: Just swap : for ;
[10:46:11] ddv: Ox0dea: nah
[10:46:18] ddv: Ox0dea: you don't know the context
[10:46:46] hannelita: has joined #ruby
[10:46:48] ddv: Ox0dea: i'm moving very old legacy rails apps
[10:47:09] Ox0dea: Thank you for reminding me that I'm not omniscient. :(
[10:47:10] mrtomme_: has joined #ruby
[10:47:28] ta: has joined #ruby
[10:47:34] ddv: Ox0dea: well thanks anyways :p
[10:47:36] apeiros: ddv: not sure how that makes Ox0dea not viable?
[10:47:52] ddv: apeiros: what do yu mean?
[10:47:58] Ox0dea: ddv: Just swap : for ;
[10:48:01] apeiros: swapping the : with ; in case/when
[10:48:13] ddv: not going to mess with old gems
[10:48:21] nobitanobi: has joined #ruby
[10:48:29] apeiros: ddv: you mean it's not code maintained by you/your company?
[10:48:30] aufi_: has joined #ruby
[10:48:36] ddv: apeiros: exactly
[10:48:49] 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
[10:48:52] ddv: old gems like radiant, rails 1.2.3 etc
[10:49:13] apeiros: nobitanobi: self.class::CONST
[10:49:25] apeiros: or redefine the method in the subclass.
[10:49:31] nobitanobi: apeiros: how come by default Ruby is accessing the parent?
[10:49:49] apeiros: it accesses the constant in the scope of definition
[10:50:00] nobitanobi: so, what's a good pattern for this?
[10:50:07] apeiros: as said, self.class::CONST
[10:50:21] apeiros: that'll force it to use the normal lookup
[10:50:24] fsapo: has joined #ruby
[10:50:44] apeiros: i.e. you can omit the constant in the child, but if you have one there, it'll use that.
[10:51:18] Xeago: has joined #ruby
[10:51:21] nobitanobi: thanks apeiros
[10:51:30] nobitanobi: that is because the object is not initialized yet, correct?
[10:51:53] nobitanobi: so it goes to find it in the scope where initialize is defined
[10:52:43] apeiros: constant lookup in methods depends on where the method has been defined, not where it is called
[10:53:01] nobitanobi: that helps a lot
[10:54:11] Arnvald: has joined #ruby
[10:54:56] Ox0dea: >> h = {}; h[:a, :b] = 1, 2 rescue $!
[10:54:58] ruby[bot]: Ox0dea: # => #<ArgumentError: wrong number of arguments (given 3, expected 2)> (https://eval.in/505730)
[10:55:05] Ox0dea: apeiros: Thoughts? Liable to do more harm than good, yeah?
[10:56:06] nik0: has joined #ruby
[10:56:06] ddv: had to downgrade rubygems lol
[10:56:09] Ox0dea: I think `hash[*keys] = values` as an alternative to #update is kinda nice.
[10:57:04] Ox0dea: ddv: Ouch. You're really in the weeds, eh?
[10:57:27] ddv: 300 customers still on rails 1.2.3 lol
[10:57:34] apeiros: Ox0dea: I have been missing parallel assignment for hashes and I don't see a collision for this suggestion
[10:57:56] m8: has joined #ruby
[10:58:14] apeiros: `hash[*keys] = values` > `hash.update(keys.zip(values).to_h)`
[10:58:31] decoponio: has joined #ruby
[10:58:36] Ox0dea: Gonna get case equality for #any? and friends some visibility as well.
[10:59:12] apeiros: but if hash[*keys] = values, then *values2 = *hash[*keys] == values should hold true :)
[10:59:44] sakix: has joined #ruby
[11:00:17] apeiros: can just map Hash#[] to #values_at
[11:00:24] apeiros: ah??? hm???
[11:00:28] apeiros: there be dragons
[11:00:45] apeiros: hash[1] # should not return an array???
[11:00:51] surrounder: has left #ruby: ("WeeChat 1.4")
[11:01:07] Ox0dea: It should if there's an Array at that key.
[11:01:23] apeiros: but that's not what I mean
[11:01:24] Ox0dea: Oh, but I see how you mean.
[11:01:33] Ox0dea: Arity checking is pretty easy in MRI.
[11:01:34] apeiros: you can't distinguish
[11:01:45] apeiros: yes, but then you get incosistent results
[11:01:45] Ox0dea: Of course you can.
[11:02:02] apeiros: keys = [1]; hash[*keys] # => returns not an array
[11:02:06] apeiros: keys = [1,2]; hash[*keys] # => returns an array
[11:02:13] Ox0dea: Ah, right. :<
[11:02:37] Ox0dea: So then there'd be an asymmetry between Hash#[] and #[]=.
[11:02:52] apeiros: that's the downside of not copying perl's %@$ scalar/list/map contexts
[11:03:46] Ox0dea: But, well, Array#[] and #[]= aren't quite symmetrical.
[11:03:57] aufi: has joined #ruby
[11:04:02] apeiros: I think *I* could live with the discrepancy. but maybe it'd make sense then to have update_at instead of []=
[11:04:22] apeiros: i.e. []/[]= symmetric and values_at/update_at symmetric
[11:04:22] Ox0dea: I like syntax. ^_^
[11:04:39] apeiros: true re Array
[11:05:03] apeiros: wait??? is it true?
[11:05:07] apeiros: where's it not symmetric?
[11:05:33] Ox0dea: >> a = [0]; a[0,1] = [1,2,3]; a[0] == [1,2,3]
[11:05:35] ruby[bot]: Ox0dea: # => false (https://eval.in/505734)
[11:06:20] Ox0dea: I guess asymmetric isn't quite the word.
[11:06:32] apeiros: hm, but that's a different kind of asymmetry, no? the same arguments have the same meaning in both [] and []=
[11:07:04] apeiros: it's just not the case that (a[*args] = values) == (a[*args])
[11:10:00] arup_r1: has joined #ruby
[11:11:01] CaptainAl: has joined #ruby
[11:11:13] mprelude: has joined #ruby
[11:13:24] hnagamin: has joined #ruby
[11:14:52] CaptainAl: has joined #ruby
[11:16:17] sftrabbit: has joined #ruby
[11:17:48] Ox0dea: I can't see it being done in a way that would please everybody.
[11:18:08] 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.
[11:19:01] chouhoulis: has joined #ruby
[11:20:24] rickmasta: has joined #ruby
[11:21:15] djellemah: has joined #ruby
[11:21:52] tvw: has joined #ruby
[11:22:07] anisha_: has joined #ruby
[11:22:52] Rinalds: has joined #ruby
[11:23:37] fclausen: has joined #ruby
[11:24:18] arup_r: has joined #ruby
[11:26:19] duckpuppy: has joined #ruby
[11:26:51] waka: has joined #ruby
[11:28:15] dlitvak: has joined #ruby
[11:28:18] chipotle: has joined #ruby
[11:29:41] sftrabbit: has joined #ruby
[11:31:46] lyoshajapan: has joined #ruby
[11:32:23] 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?
[11:33:05] ljarvis: nobitanobi: it's common to return it in a method yes. A constant doesn't quite do the same thing
[11:33:14] nobitanobi: ljarvis: why not?
[11:34:31] Shaboum: has joined #ruby
[11:35:02] Ox0dea: nobitanobi: You might also consider `include`, but you'll want to tread lightly.
[11:35:40] howdoicomputer: has joined #ruby
[11:37:15] ljarvis: nobitanobi: actually that's probably fine I was thinking of something else I think
[11:38:56] startupality: has joined #ruby
[11:42:48] Jardayn: has joined #ruby
[11:42:58] hayden_: has joined #ruby
[11:43:05] lucas: has joined #ruby
[11:46:14] joonty: has joined #ruby
[11:46:37] DoubleMalt: has joined #ruby
[11:47:10] 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?
[11:47:33] lucas: (the code does: check if key exists, if yes, get sub-hash, check if key eixsts, if yes, get sub-hash, etc.
[11:48:19] ICantCook: has joined #ruby
[11:48:26] moeabdol: has joined #ruby
[11:48:42] norc: has joined #ruby
[11:49:07] j416: lucas: wrap it in an accessor class
[11:49:25] User458764: has joined #ruby
[11:50:06] lucas: j416: well, it wouldn't change anything. I was more thinking about something like XPATH, but for ruby data structures
[11:50:11] j416: yes it would.
[11:50:23] lucas: j416: then I don't understand what you mean
[11:50:53] dlitvak_: has joined #ruby
[11:50:57] j416: you could easily build something that allows you to do e.g. get('sensors.power.available')
[11:51:13] blackmes1: has joined #ruby
[11:51:27] j416: 10-20 lines of code or thereabot
[11:51:49] lucas: that's about the same as what I have currently :)
[11:52:06] j416: then what's the problem
[11:53:09] quaristice: has joined #ruby
[11:53:56] BTRE: has joined #ruby
[11:55:55] moeabdol: has joined #ruby
[11:55:57] Ox0dea: lucas: Ruby 2.3 introduced #dig for just such occasions.
[11:58:13] lucas: right, I just found about that. now I just need to find a gem that provides #dig in pre-2.3 :)
[11:58:24] Ox0dea: There is such a one!
[11:58:39] Ox0dea: https://github.com/jrochkind/dig_rb
[11:59:21] lucas: two of them, actually: https://github.com/Invoca/ruby_dig
[11:59:43] drptbl: has joined #ruby
[12:00:15] c355E3B: has joined #ruby
[12:01:03] skade: has joined #ruby
[12:01:30] Xeago: has joined #ruby
[12:02:03] sakix: has joined #ruby
[12:03:47] burgestrand: has joined #ruby
[12:05:54] drptbl: has joined #ruby
[12:06:10] dlitvak: has joined #ruby
[12:07:04] myntcake: has joined #ruby
[12:12:41] wtiger: has joined #ruby
[12:12:46] sanko: has joined #ruby
[12:13:25] wtiger: has left #ruby: ("WeeChat 1.3")
[12:14:05] Andrey: has joined #ruby
[12:16:13] dlitvak: has joined #ruby
[12:19:14] casadei: has joined #ruby
[12:19:48] chouhoulis: has joined #ruby
[12:19:54] gbgdev: has joined #ruby
[12:20:36] gbgdev: has joined #ruby
[12:20:38] rkoller: has joined #ruby
[12:20:59] gbgdev_: has joined #ruby
[12:21:10] dlitvak_: has joined #ruby
[12:21:21] craigp: has joined #ruby
[12:21:34] davedev24: has joined #ruby
[12:21:42] skcin7: has joined #ruby
[12:22:37] sandstrom: has joined #ruby
[12:23:15] solocshaw: has joined #ruby
[12:24:12] jamw: has joined #ruby
[12:28:27] dlitvak: has joined #ruby
[12:30:51] robh71: has joined #ruby
[12:31:07] Musashi007: has joined #ruby
[12:31:51] Alina-malina: has joined #ruby
[12:32:21] aupadhye: has joined #ruby
[12:33:12] sanko: How to make changes in a ruby gem?
[12:33:18] Musashi007: has joined #ruby
[12:35:39] sdothum: has joined #ruby
[12:37:33] duckpuppy: has joined #ruby
[12:37:34] sigurding: has joined #ruby
[12:39:21] burgestrand: has joined #ruby
[12:39:45] Alina-malina: has left #ruby: ("Leaving")
[12:40:10] matled: has joined #ruby
[12:40:40] sftrabbit: has joined #ruby
[12:41:14] UtkarshRay: has joined #ruby
[12:43:59] freerobby: has joined #ruby
[12:44:55] einarj: has joined #ruby
[12:45:11] Anderson69s: has joined #ruby
[12:49:08] IrishGringo: has joined #ruby
[12:50:30] dlitvak_: has joined #ruby
[12:52:05] solocshaw: has joined #ruby
[12:53:38] roller123: has joined #ruby
[12:55:09] joonty: has joined #ruby
[12:55:27] pawnbox: has joined #ruby
[12:56:19] pawnbox: has joined #ruby
[12:56:27] roller123: hi, need a little help. I am executing rubber command to deploy in AWS EC2 but getting an error.
[12:57:01] roller123: I am running this command :- cap rubber:create_staging
[12:57:23] roller123: and getting this error as bellow :-
[12:57:42] onlyme_: has joined #ruby
[12:57:48] 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
[12:58:14] roller123: any ideas how to fix it asap
[13:02:07] anisha_: has joined #ruby
[13:03:06] 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
[13:04:46] r4um_: has joined #ruby
[13:05:25] 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
[13:05:29] synthroid: has joined #ruby
[13:07:29] PedramT: has joined #ruby
[13:09:00] PedramT_: has joined #ruby
[13:09:35] roller123: any pointers would be appreciated
[13:11:21] roshanavand: has joined #ruby
[13:11:29] kalopsian: has joined #ruby
[13:11:53] duckpuppy: has joined #ruby
[13:12:31] shinnya: has joined #ruby
[13:13:28] PedramT: has joined #ruby
[13:15:49] Polysics: has joined #ruby
[13:17:00] cornerman: has left #ruby: ()
[13:17:27] roshanavand: has joined #ruby
[13:19:27] ajf-: has joined #ruby
[13:19:28] craigp: has joined #ruby
[13:19:39] apeiros: arup_r: http://guides.rubygems.org/specification-reference/
[13:20:33] chouhoulis: has joined #ruby
[13:20:46] startupality: has joined #ruby
[13:20:48] dlitvak: has joined #ruby
[13:20:52] PedramT: has joined #ruby
[13:20:57] bluOxigen: has joined #ruby
[13:20:58] 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 )
[13:21:36] apeiros: gem install -???-development/-???-development-all are the corresponding options
[13:21:38] 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 ?
[13:21:55] apeiros: don't know with bundler
[13:22:09] arup_r: ok.. bundle install --development .. let me try
[13:22:15] arup_r: ah.. I see
[13:22:20] arup_r: let me google then
[13:22:32] Ox0dea: roller123: Looks like a bug. :/
[13:22:40] Azulinho: has joined #ruby
[13:23:11] roller123: and idea how to solve this bug!
[13:23:11] PedramT_: has joined #ruby
[13:23:40] roller123: anyother suggestion to work around
[13:23:52] 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.
[13:25:09] skcin7: has joined #ruby
[13:25:49] neohunter: has joined #ruby
[13:26:21] craigp: has joined #ruby
[13:27:37] roller123: ya that is the one, you are right. I just looked it, but any work around you can think of.
[13:27:40] snowy: has joined #ruby
[13:28:18] hxegon: has joined #ruby
[13:30:00] dlitvak_: has joined #ruby
[13:30:31] duckpuppy: has joined #ruby
[13:33:14] jespada: has joined #ruby
[13:36:39] sandstrom: has joined #ruby
[13:37:17] robh71: has joined #ruby
[13:37:34] Ox0dea: roller123: https://git.io/vzuIW indicates that ALIAS is a required environment variable for this task.
[13:37:39] arup_r: has joined #ruby
[13:37:50] Ox0dea: It's weird that it's not warning you about it being unset, but I think that's the root of the issue.
[13:38:05] last_staff: has joined #ruby
[13:38:25] howdoicomputer: has joined #ruby
[13:39:07] roller123: should i set it to my host name?
[13:39:25] Ox0dea: That does seem to be the intended value, yes.
[13:39:31] sakix: has joined #ruby
[13:39:54] Ox0dea: It probably doesn't mean your local hostname, though.
[13:40:30] roller123: sorry i didn't get you!
[13:41:38] tvw: has joined #ruby
[13:41:59] shredding: has joined #ruby
[13:42:14] Ox0dea: roller123: Did you skip this step? https://git.io/vzutI
[13:42:29] quaristice: has joined #ruby
[13:42:35] Ropeney: has joined #ruby
[13:43:41] c0m0: has joined #ruby
[13:43:51] jaiks: has joined #ruby
[13:44:41] roller123: what is web_tools_user and web_tools_password?
[13:45:02] bronson: has joined #ruby
[13:45:18] arup_r: has joined #ruby
[13:46:27] roshanavand: has joined #ruby
[13:47:16] DaniG2k: has joined #ruby
[13:47:29] atomical: has joined #ruby
[13:48:03] startupality: has joined #ruby
[13:48:57] ramortegui: has joined #ruby
[13:51:15] FooMunki: has joined #ruby
[13:51:51] startupality: has joined #ruby
[13:54:08] dwfait: has joined #ruby
[13:55:21] mfb2: has joined #ruby
[13:57:08] r4um: has joined #ruby
[13:57:26] aryaching: has joined #ruby
[13:57:51] hogetaro: has joined #ruby
[13:58:38] Pupeno: has joined #ruby
[13:59:13] nertzy2: has joined #ruby
[13:59:16] puria: has joined #ruby
[14:00:00] arup_r1: has joined #ruby
[14:00:30] Jardayn: has joined #ruby
[14:01:41] adgtl: has joined #ruby
[14:02:11] r4um: has joined #ruby
[14:02:54] startupality: has joined #ruby
[14:03:25] mrchris: has joined #ruby
[14:04:12] hnagamin: has joined #ruby
[14:04:18] chipotle: has joined #ruby
[14:04:27] Nilbus: has joined #ruby
[14:06:22] startupality: has joined #ruby
[14:06:36] gizmore: has joined #ruby
[14:09:07] dlitvak: has joined #ruby
[14:09:57] griffindy: has joined #ruby
[14:10:44] mikecmpbll: has joined #ruby
[14:11:48] treehug88: has joined #ruby
[14:11:51] The_Phoenix: has joined #ruby
[14:12:07] karapetyan: has joined #ruby
[14:12:24] cdg: has joined #ruby
[14:12:25] 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`
[14:12:55] sgambino: has joined #ruby
[14:14:11] Marsupermammal: has joined #ruby
[14:14:46] mfb2: has joined #ruby
[14:14:55] Nilbus: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[14:15:34] Bsian: has joined #ruby
[14:15:40] krobzaur_: has joined #ruby
[14:16:05] apeiros: mikecmpbll: that whole example looks rather buggy
[14:16:21] astrofog: has joined #ruby
[14:16:21] apeiros: tried some quick changes to get it to run
[14:16:41] burgestrand: has joined #ruby
[14:16:43] mikecmpbll: bit of a mindbender this OptionsParser lark.
[14:17:31] ljarvis: should use a better option parser
[14:17:55] Papierkorb: mikecmpbll: opt_parser is a variable
[14:17:59] apeiros: got it to run, but with two rather ugly changes
[14:19:00] TomPeed: has joined #ruby
[14:19:02] techsethi: has joined #ruby
[14:19:12] 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.
[14:19:33] sgambino: has joined #ruby
[14:21:14] blackmes1: has joined #ruby
[14:21:17] chouhoulis: has joined #ruby
[14:21:35] startupality: has joined #ruby
[14:21:36] Rodya_: has joined #ruby
[14:22:06] aegis3121: has joined #ruby
[14:22:12] apeiros: holy, that's a rabbit hole.
[14:22:19] apeiros: sorry, gotta work again
[14:22:30] hogetaro: has joined #ruby
[14:23:19] startupality: has joined #ruby
[14:23:19] system64: has joined #ruby
[14:24:17] lessless: has joined #ruby
[14:24:31] ddv: irc is work apeiros
[14:24:36] shevy: hmm is ruboto permanently gone? :(
[14:24:37] karmatr0n: has joined #ruby
[14:24:39] nertzy2: has joined #ruby
[14:24:58] jamw: has joined #ruby
[14:25:14] 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
[14:27:27] sleetdrop: has joined #ruby
[14:28:25] startupality: has joined #ruby
[14:29:59] dlitvak_: has joined #ruby
[14:30:18] gambl0re: has joined #ruby
[14:30:20] weckl: has joined #ruby
[14:30:42] floatingpoint: has joined #ruby
[14:31:12] mrchris: has joined #ruby
[14:33:04] Rodya_: has joined #ruby
[14:33:29] mikecmpbll: Papierkorb: no it's not?
[14:35:02] sambio: has joined #ruby
[14:35:41] kobain: has joined #ruby
[14:36:13] lucasb: has joined #ruby
[14:36:28] karmatr0n: has joined #ruby
[14:38:56] Scripore: has joined #ruby
[14:39:11] hogetaro_: has joined #ruby
[14:39:51] drptbl: has joined #ruby
[14:39:56] Scripore: has joined #ruby
[14:40:08] babblebre: has joined #ruby
[14:40:21] dlitvak: has joined #ruby
[14:40:29] mikecmpbll: it's calling method that reference @parser before inside the definition for @parser ???????????? wat is going on.
[14:40:30] davedev24: has joined #ruby
[14:40:59] sergey_makagon: has joined #ruby
[14:43:07] mikecmpbll: oh okay, it's actually meant to refer to the block local `parser`, but it doesn't have access to that ..
[14:43:35] duckpuppy: has joined #ruby
[14:44:36] newdan: has joined #ruby
[14:44:59] PedramT: has joined #ruby
[14:45:03] B1n4r10: has joined #ruby
[14:46:49] malconis: has joined #ruby
[14:47:06] efox: has joined #ruby
[14:47:46] AimlessRAven: has joined #ruby
[14:48:24] sepp2k: has joined #ruby
[14:50:29] ympeg: has joined #ruby
[14:52:19] platzhirsch: I am really confused about chaining multiple condition on a multi-line unless
[14:52:33] platzhirsch: >> unless false && false; puts 'Golly gosh'; end
[14:52:34] ruby[bot]: platzhirsch: # => Golly gosh ...check link for more (https://eval.in/505857)
[14:52:40] platzhirsch: >> unless false && true; puts 'Golly gosh'; end
[14:52:42] ruby[bot]: platzhirsch: # => Golly gosh ...check link for more (https://eval.in/505859)
[14:52:49] dfinninger: has joined #ruby
[14:53:02] DoubleMalt: has joined #ruby
[14:53:34] newdan: platzhirsch: unless is like inverse if
[14:53:38] aegis3121: >> unless true && true; puts 'Taocat'; end
[14:53:40] ruby[bot]: aegis3121: # => nil (https://eval.in/505861)
[14:53:54] newdan: platzhirsch: false && false and false && true are both false, so they satisfy the unless
[14:53:57] platzhirsch: yes but it seems the second argument gets ignored
[14:54:15] platzhirsch: I forgot about the precedence here
[14:54:24] platzhirsch: sorry, that was obvious : )
[14:54:41] AimlessRAven: platzhirsch: unless = if not
[14:54:41] mikecmpbll: it does, because when you && stuff and the first is false it doesn't need to evaluate the others :)
[14:55:06] platzhirsch: For some reason I always thought the not is then either applied individually in front of every part or just for the first
[14:55:14] startupality: has joined #ruby
[14:55:23] platzhirsch: I never used unless in that form anyway because I always thought it's confusing
[14:55:25] mikecmpbll: ah, you thought it was if !false && true, as opposed to if !(false && true)
[14:55:28] sucks: has joined #ruby
[14:56:25] platzhirsch: mikecmpbll: exactly
[14:56:29] newdan: platzhirsch: I agree, for anything non-trivial unless is very confusing
[14:56:30] newbie22: has joined #ruby
[14:56:31] whippythellama: has joined #ruby
[14:56:43] newdan: I mean, it has predictable behavior but it just makes the code confusing to read
[14:56:43] platzhirsch: still, I should know that. My Ruby skills have slacked off so much off
[14:56:52] platzhirsch: Anyone working for Travis CI here?
[14:57:26] AimlessRAven: platzhirsch: why you thing that ?
[14:57:33] AimlessRAven: unless is cool
[14:57:55] platzhirsch: Unless you stumble over it
[14:58:52] Bish: https://gist.github.com/anonymous/cce6c5d27cd5eddd02e8
[14:58:59] floatingpoint: has joined #ruby
[14:59:02] newdan: newbie22: what IRC client do you use that puts "*: " in front of all your messages?
[14:59:03] Bish: this is a really ugly piece of PoC, i created to show you what i want to have
[14:59:22] platzhirsch: so to transform it I would have if !(a && b && c) instead of unless a && b && c ?
[14:59:50] newdan: platzhirsch: Correct
[15:00:23] Bish: Ox0dea: i feel like, you would like this one, don't you?
[15:00:23] hayden_: has joined #ruby
[15:01:04] krz: has joined #ruby
[15:01:12] newbie22: newdan: I did it myself
[15:01:16] Ox0dea: Bish: Just heading out. Looks pretty wonky, though. :P
[15:01:23] Ox0dea: Godspeed.
[15:02:03] Bish: :) have fun at whatever you're doing
[15:02:27] lucasb: looks very well indented
[15:03:03] hannelita: has joined #ruby
[15:03:14] ruby-lang634: has joined #ruby
[15:03:20] dionysus69: has joined #ruby
[15:03:37] 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?
[15:03:55] roshanavand: has joined #ruby
[15:04:05] burgestrand: has joined #ruby
[15:04:06] Bish: my "implementation" if you want to call it this way, has some issues, which i would like to fix
[15:04:29] Bish: 1. if i wanted it to be 100000 jobs per hour, it would spawn 100000 threads
[15:04:57] burgestrand: has joined #ruby
[15:05:02] 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
[15:05:35] 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
[15:06:58] User458764: has joined #ruby
[15:08:15] apeiros: shevy: I will regroup ruboto with ruby[bot]'s account (ruboto is currently tied to mine)
[15:08:43] 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.
[15:08:55] apeiros: that said, there have still been people replying to it :-S
[15:09:19] Bish: >> "ruboto"[/(bot)/,1]
[15:09:20] ruby[bot]: Bish: # => "bot" (https://eval.in/505865)
[15:09:26] dlitvak_: has joined #ruby
[15:09:32] havenwood: Bish: So you want something along the lines of 1) a thread pool, and 2) a throttler not a limiter?
[15:09:46] havenwood: Bish: Is this to learn or use?
[15:09:48] Bish: havenwood: yeah that sounds like what i want
[15:10:21] momomomomo: has joined #ruby
[15:10:32] pdoherty: has joined #ruby
[15:10:47] 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
[15:12:25] Coldblackice: has joined #ruby
[15:12:33] havenwood: Bish: How about Sidekiq or Resque?
[15:12:53] bmalum_: has joined #ruby
[15:13:12] gbgdev: has joined #ruby
[15:13:15] Bish: i "know" about them, haven't really used them, though i felt like those are more for background jobs in rails
[15:13:31] Drakevr: has joined #ruby
[15:13:41] Bish: or can you give me an example, how something like want could be done in either of these
[15:13:56] s00pcan: has joined #ruby
[15:14:08] zerowaitstate: has joined #ruby
[15:14:09] 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
[15:14:11] havenwood: Bish: Maybe give this a read for some ideas: https://github.com/mperham/sidekiq/wiki/Ent-Rate-Limiting
[15:14:21] startupality: has joined #ruby
[15:14:36] havenwood: Bish: No, Sidekiq 4 is a rewrite that dropped Celluloid for a custom, fast implementation
[15:14:41] apeiros: Bish: iirc sidekiq recently ditched celluloid
[15:15:00] havenwood: Bish: https://github.com/mperham/sidekiq#readme
[15:15:16] sftrabbit: has joined #ruby
[15:15:20] Bish: apeiros: yeah i feel like that is a good idea
[15:15:38] Bish: celluloid looks awesome, but feels like it will break your neck if you use it
[15:15:43] Drakevr: has joined #ruby
[15:16:13] Papierkorb: Well, depends if that change makes your jobs actually faster or actually significantly slower ..
[15:16:43] Papierkorb: Doing expensive calculations *in* your job? Bad luck, better rewrite that one
[15:16:59] rippa: has joined #ruby
[15:17:17] 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
[15:17:26] zerowaitstate: has joined #ruby
[15:17:44] Bish: thank you!
[15:18:15] ImJune: has joined #ruby
[15:18:22] Emmanuel_Chanel: has joined #ruby
[15:19:21] ImJune: Does anyone here use rails on fedora 23
[15:19:27] havenwood: ImJune: They do.
[15:19:32] ImJune: every single build fails
[15:19:54] ImJune: "BUILD FAILED (Fedora 23 using ruby-build 20160111-25-g3b0714a)"
[15:20:17] Drakevr: has joined #ruby
[15:20:18] bluOxigen_: has joined #ruby
[15:20:33] ImJune: could anyone tell me a build version that would work on fedora 23
[15:21:02] hxegon: has joined #ruby
[15:21:03] havenwood: ImJune: Sounds like rbenv's ruby-build is failing. It doesn't give you any better errors than that?
[15:21:05] ImJune: I went directly to the site and it seems they recommend 2.2.2
[15:21:06] VeryBewitching: has joined #ruby
[15:21:11] ImJune: oh it does
[15:21:20] ImJune: shall I pastbin the whole thing/
[15:21:28] havenwood: ImJune: Ruby 2.2.4 or 2.3.0 should work great.
[15:21:29] Musashi007: has joined #ruby
[15:21:33] havenwood: ImJune: Yeah, Gist it!
[15:21:39] havenwood: VeryBewitching: g'day
[15:21:58] VeryBewitching: havenwood: How's the day so far?
[15:22:01] chouhoulis: has joined #ruby
[15:22:09] rickmasta: has joined #ruby
[15:22:15] Bish: havenwood: celluloid timers look comfy
[15:22:26] havenwood: VeryBewitching: I woke up. Which I'm in the habit of doing most days.
[15:22:41] dlitvak: has joined #ruby
[15:22:49] havenwood: VeryBewitching: But it's pre-coffee, which is a dangerous time!
[15:23:03] VeryBewitching: Ah yes, that's a volatile time for me too
[15:23:44] ImJune: http://pastebin.com/vm5xe3q4
[15:23:45] 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
[15:24:34] ImJune: https://gist.github.com/anonymous/ad319045b7f24c5dca41
[15:24:47] ImJune: sorry I guess you guys have your own little brand :) its ok
[15:24:51] 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
[15:24:55] Bish: im too stupid ;;
[15:25:10] 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."
[15:25:14] ImJune: I am wondering if this rails is easier overall than django
[15:25:19] karapetyan: has joined #ruby
[15:25:24] ImJune: feel like it couldnt get much easier than django
[15:25:35] havenwood: ImJune: mkdir: cannot create directory ???/home/nixadmin/.rbenv/versions???: Permission denied
[15:25:43] ImJune: but I can't use sudo
[15:25:44] dlitvak__: has joined #ruby
[15:25:51] havenwood: ImJune: Are you that user?
[15:26:01] ImJune: it doesn't even recognize the command if I try sudo
[15:26:13] apeiros: ImJune: "github - your own little brand" lol, where do you live? behind the moon?
[15:26:24] ImJune: I live in Japan
[15:26:39] havenwood: ImJune: stat ~/.rbenv
[15:26:40] fmcgeough: has joined #ruby
[15:26:41] Bish: Big in Japan~
[15:26:53] ImJune: I was a SCADA guy for years and in sales so all this is new
[15:27:29] ImJune: Heaven you want the output from that command?
[15:27:51] havenwood: ImJune: If you don't see the permissions error.
[15:28:02] Drakevr: has joined #ruby
[15:28:13] Bloomer: has joined #ruby
[15:28:15] ImJune: https://gist.github.com/anonymous/a2b175e90c7577f271b7
[15:29:07] newdan: ImJune: Rails and Django are pretty similar
[15:29:27] ImJune: ok so if I am fairly ok with django I can learn this pretty easy?
[15:31:01] tubbo: ImJune: they make some different decisions, but generally the concepts will seem familiar
[15:31:10] havenwood: ImJune: And if you manually try?: mkdir -p ~/.rbenv/versions
[15:31:16] dfinninger: has joined #ruby
[15:31:24] tubbo: one important thing to remember is that they're not really related.
[15:31:32] tjohnson: has joined #ruby
[15:32:00] ImJune: I will try
[15:32:03] bmalum: has joined #ruby
[15:32:05] ddv: django is trying really to be like Rails but fails everytime
[15:32:15] burgestrand: has joined #ruby
[15:32:39] ImJune: thing is I think python is more useful for me as a general language
[15:33:01] ImJune: but ruby seems great for web developer and many people say its pleasant to code with in that
[15:33:05] tubbo: why do you say that ImJune?
[15:33:10] 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
[15:33:19] havenwood: ImJune: Ruby is a general purpose language like Python
[15:33:32] ImJune: because python is widely supported for use with the automation tools I use now
[15:33:34] tubbo: python is pretty awesome, honestly the differences seem to come down to your own values
[15:33:44] ImJune: well I feel I can like them both
[15:33:45] tubbo: like what do *you* want out of your code
[15:33:47] ImJune: to be honest
[15:33:54] DaniG2k: I love how python 3 came out 10 years ago and hardly anyone has made the switch from 2.7
[15:34:02] sigurding: has joined #ruby
[15:34:03] 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!
[15:34:22] ImJune: everyone in my company know both devoperations and developer is using python
[15:34:23] havenwood: ImJune: But whatever you choose, be aware that cats are superiour.
[15:34:33] ImJune: I like cats man
[15:34:37] tubbo: just make sure you are feeding your pets with Vim, not Emacs.
[15:34:41] havenwood: ImJune: phew
[15:34:50] roshanavand: has joined #ruby
[15:34:52] ImJune: haven it denied me
[15:34:56] ImJune: permission
[15:35:05] ImJune: should I try as root
[15:35:14] Drakevr: has joined #ruby
[15:35:16] mikecmpbll: is there a ruby lib which parses "user@iporhostname:/some/path" type paths?
[15:35:21] podman: has joined #ruby
[15:35:45] Drakevr: has joined #ruby
[15:36:14] karapetyan: has joined #ruby
[15:36:36] mikecmpbll: ack nvm, URI does i just needed to prefix it with the scp:// protocol
[15:37:02] havenwood: ImJune: Is there already a ~/.rbenv/versions dir? What do those permissions look like?
[15:37:13] ImJune: I did it as root it worked
[15:37:40] ImJune: It's true a Japanese guy made this language
[15:38:33] drptbl: has joined #ruby
[15:39:13] howdoicomputer: has joined #ruby
[15:39:30] lindistock: has joined #ruby
[15:39:31] dlitvak: has joined #ruby
[15:40:12] Bish: No Permission
[15:40:58] kalopsian: has joined #ruby
[15:41:24] ImJune: drwxr-xr-x. 10 root root 4096 Jan 21 13:58 .rbenv
[15:41:38] ajf-: has joined #ruby
[15:42:03] Bish: ImJune: well that folder is owned by root, so you wont be able to access it besides reading
[15:42:24] ImJune: guess I can chmod now
[15:42:52] dfinninger: has joined #ruby
[15:43:28] sgambino: has joined #ruby
[15:43:28] dfinninger: has joined #ruby
[15:43:41] ajf-: has joined #ruby
[15:43:43] polishdub: has joined #ruby
[15:44:34] usershell: has joined #ruby
[15:45:54] roshanavand: has joined #ruby
[15:46:23] puria: has joined #ruby
[15:46:38] usershell: has joined #ruby
[15:47:13] bklane: has joined #ruby
[15:47:31] bronson: has joined #ruby
[15:48:12] roshanavand: has joined #ruby
[15:48:29] 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... :(
[15:50:55] roshanavand: has joined #ruby
[15:50:59] platzhirsch: has left #ruby: ()
[15:53:02] hxegon: has joined #ruby
[15:53:37] ImJune: So I changed the permissions for the folder and it seems to be hanging
[15:53:43] ImJune: does it usually take a long tiime
[15:54:19] ImJune: rbenv install 2.2.2
[15:55:53] dlitvak_: has joined #ruby
[15:57:55] atomical_: has joined #ruby
[15:59:37] rburton: has joined #ruby
[15:59:41] gruz0: has joined #ruby
[16:00:03] rburton: did the 2.3.0 ruby tarball get updated? my distro is reporting that the shasum has changed.
[16:00:09] tubbo: it usually takes a little bit, ImJune
[16:00:15] rburton: "File: '/home/ross/Yocto/downloads/ruby-2.3.0.tar.gz' has sha256 checksum ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507 when 5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44 was expected"
[16:00:18] shevy: official tarball is at ftp://ftp.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.xz
[16:00:25] momomomomo: has joined #ruby
[16:00:35] rburton: the web site says ba5 is the right checksum, but at some point in the past our distro insists it was 5ffc0
[16:00:47] shevy: I get this shasum: 96e620e38af351c8da63e40cfe217ec79f912ba1 ruby-2.3.0.tar.xz
[16:01:08] dfinninger: has joined #ruby
[16:01:11] chris2: i have ec7579eaba2e4c402a089dbc86c98e5f1f62507880fd800b9b34ca30166bfa5e for .bz2
[16:01:23] rburton: oh, i'm talking about the gz
[16:01:43] shevy: ah yes now I see it... did not see the .tar.gz before
[16:01:58] bklane: has joined #ruby
[16:03:20] mary5030: has joined #ruby
[16:04:08] mary5030: has joined #ruby
[16:05:10] bklane_: has joined #ruby
[16:05:19] rburton: ok panic over, broken patches locally
[16:05:20] rburton: has left #ruby: ()
[16:05:34] slawrence00: has joined #ruby
[16:06:21] startupality: has joined #ruby
[16:07:14] asccigcc: has joined #ruby
[16:10:34] Scripore: has joined #ruby
[16:12:08] djbkd: has joined #ruby
[16:13:30] karapetyan: has joined #ruby
[16:15:35] ImJune: https://gist.github.com/anonymous/28ed22caf2e67db3cc6f
[16:15:43] ImJune: this is what happens
[16:15:46] mchu: has joined #ruby
[16:15:46] Rodya_: has joined #ruby
[16:15:56] sgambino: has joined #ruby
[16:16:47] mfb2: has joined #ruby
[16:17:22] rsc___: has joined #ruby
[16:17:32] x77686d: has joined #ruby
[16:18:16] gizmore: ImJune: cat /home/nixadmin/.gem/ruby/extensions/x86_64-linux/nokogiri-1.6.7.2/gem_make.out
[16:20:15] jbrhbr: has joined #ruby
[16:20:40] ImJune: https://gist.github.com/anonymous/a2b175e90c7577f271b7
[16:20:51] ImJune: @giizmore
[16:21:09] sgambino: has joined #ruby
[16:21:31] ImJune: it mention that I need to install development tools but I am not sure which ones are needed
[16:22:06] tomchapin: has joined #ruby
[16:22:12] ImJune: I know that many rails developer like to used debian forks like ubuntu etc but surely I am leaving fedora
[16:22:56] havenwood: ImJune: I'd again recommend ruby-install over ruby-build, since it installs deps for you, etc, etc.
[16:23:35] ImJune: do you have a doc page for those things
[16:23:45] ImJune: ruby install rails?
[16:24:05] Spami_: has joined #ruby
[16:24:45] bklane: has joined #ruby
[16:25:28] User458764: has joined #ruby
[16:25:40] jamw: has joined #ruby
[16:26:05] hornairs: has joined #ruby
[16:26:47] bklane_: has joined #ruby
[16:28:50] ImJune: I think I will give up
[16:29:24] dhollinger: has joined #ruby
[16:29:38] havenwood: sudo ruby-install --latest --system ruby && sudo gem install rails
[16:29:49] momomomomo: has joined #ruby
[16:29:58] 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.
[16:30:13] domgetter: has joined #ruby
[16:30:34] ImJune: I got the permissions working
[16:30:45] havenwood: RVM or ruby-install will do deps for you.
[16:30:54] domgetter: Ox0dea: I figured out my curses problem. I didn't have libgmp-dev installed
[16:31:44] havenwood: ImJune: If you want to install dev group stuff yourself looking into dnf groups.
[16:32:44] Spami_: has joined #ruby
[16:33:22] havenwood: Or something like: sudo dnf install -y gcc automake gdbm-devel libffi-devel libyaml-devel openssl-devel readline-devel zlib-devel
[16:33:45] EdwardIII: has left #ruby: ()
[16:33:46] havenwood: ImJune: rbenv and ruby-build have Wikis I believe if you want to go with their preferred way
[16:34:29] bklane: has joined #ruby
[16:34:36] ImJune: I am working on the dnf stuff
[16:34:44] ImJune: moment I will post what ends up working
[16:34:47] chouhoulis: has joined #ruby
[16:35:06] hanneli: has joined #ruby
[16:35:27] JohnT: has joined #ruby
[16:36:28] genpaku: has joined #ruby
[16:37:19] huyderman: has joined #ruby
[16:37:22] bklane_: has joined #ruby
[16:37:38] ImJune: seems rails is not very well supported in this fedora community
[16:38:24] havenwood: ImJune: I think you're wrong.
[16:39:00] Pupeno: has joined #ruby
[16:39:00] Pupeno: has joined #ruby
[16:39:24] jackjackdripper: has joined #ruby
[16:39:34] ajf-: has joined #ruby
[16:39:35] sftrabbit: has joined #ruby
[16:39:48] ImJune: it worked
[16:39:53] ImJune: thought it was going to fail
[16:39:58] havenwood: ImJune: sudo dnf install -y ruby
[16:40:01] havenwood: ImJune: done.
[16:40:12] ImJune: nope that didnt do it
[16:40:14] ImJune: but https://developer.fedoraproject.org/tech/languages/ruby/ror-installation.html
[16:40:30] havenwood: ImJune: yeah, follow htat
[16:40:35] ImJune: [nixadmin@localhost ~]$ rails --version Rails 4.2.3
[16:40:38] havenwood: ImJune: Works on my machine.
[16:40:39] synthroid: has joined #ruby
[16:40:45] ImJune: you are using fedora?
[16:40:50] havenwood: ImJune: I have a Fedora box.
[16:41:04] ImJune: I have this on baremetal
[16:41:19] ImJune: but either way if I can start trying out on maremetal
[16:41:49] floatingpoint: has joined #ruby
[16:41:49] ImJune: baremetal that is I feel it is more fun to try to get it working without falling back to windows just opinion
[16:42:31] mchu: has joined #ruby
[16:43:32] duckpuppy: has joined #ruby
[16:43:51] PedramT: has joined #ruby
[16:44:32] bklane: has joined #ruby
[16:44:53] ldnunes_: has joined #ruby
[16:44:53] imperator: has joined #ruby
[16:45:00] Rodya_: has joined #ruby
[16:45:09] Bsian: has joined #ruby
[16:45:20] 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
[16:45:28] imperator: I don't suppose anyone here has any experience with WinRM and multiple hops from a Linux/OSX box, do they?
[16:45:38] DonOtreply: has joined #ruby
[16:45:57] karapetyan: has joined #ruby
[16:46:10] vikaton: has joined #ruby
[16:47:28] apeiros: bsian: what's your question? how to perform said chunking?
[16:47:50] howdoi: has joined #ruby
[16:48:25] Bsian: apeiros: yes, exactly. I've heard about chunk_while but it's in ruby 2.3 only
[16:48:31] melter: has joined #ruby
[16:48:36] bklane: has joined #ruby
[16:48:36] apeiros: chunk exists before 2.3
[16:48:43] blarghlarghl: has joined #ruby
[16:48:53] apeiros: but if you don't have the current version of ruby and ask questions, you absolutely should mention which version you do have.
[16:50:12] 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.
[16:50:27] 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
[16:50:28] blarghlarghl: and as apeiros rightly says, I should mention we're running 2.1.4. :)
[16:51:05] Bsian: Ruby version: 2.2.3
[16:51:08] apeiros: blarghlarghl: if "temporarily" means "not all instances, but permanently on that instance is fine", then you can use Object#extend
[16:51:22] jottr: has joined #ruby
[16:51:23] apeiros: bsian: 2.2 has Enumerable#chunk
[16:51:32] apeiros: ary.chunk { |a,*| a }.map(&:last)
[16:51:36] apeiros: in your example
[16:51:53] momomomomo: has joined #ruby
[16:52:00] 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"
[16:52:18] 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?
[16:52:49] dcunit3d: has joined #ruby
[16:52:57] apeiros: I think 2.1 already had refinements. depending on the answer to "why", you can use that.
[16:54:04] 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.
[16:54:52] apeiros: blarghlarghl: it very much sounds like any other variant will be worse, especially given that it'll be a temporary workaround.
[16:55:44] blarghlarghl: apeiros: so: alias_method :initialize, :old_initialize; def initialize(arg); ... old_initialize(arg); end
[16:55:52] 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
[16:55:54] DexterLB: has joined #ruby
[16:56:04] apeiros: no alias. just plain redefine.
[16:56:33] apeiros: and once the patch is released, with a) obviously reference the gem again, and in b) drop the patch require
[16:56:35] DonOtreply: has joined #ruby
[16:56:45] blarghlarghl: apeiros: thing is, it's a .so file. I have no idea what the class does internally.
[16:56:51] bklane: has joined #ruby
[16:57:17] apeiros: in that case, b), if you need to call the original initialize, then yes, do that alias dance.
[16:57:23] 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.
[16:57:44] 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.
[16:57:58] pdoherty: has joined #ruby
[16:58:03] blarghlarghl: OK, b it is! thanks apeiros
[16:58:23] codecop: has joined #ruby
[16:59:02] usershell: has joined #ruby
[16:59:08] bklane_: has joined #ruby
[16:59:40] casadei: has joined #ruby
[16:59:52] amclain: has joined #ruby
[17:00:15] cbyrda: has joined #ruby
[17:00:52] mfb2: has joined #ruby
[17:01:32] luckyme: has joined #ruby
[17:02:16] cschneid_: has joined #ruby
[17:02:24] FooMunki: has joined #ruby
[17:02:56] zambini: has joined #ruby
[17:03:19] rkazak: has joined #ruby
[17:03:49] TomPeed: has joined #ruby
[17:04:27] zast: has joined #ruby
[17:04:47] PedramT: has joined #ruby
[17:04:56] zambini: has joined #ruby
[17:05:07] dfinninger: has joined #ruby
[17:06:47] Graphettion: has joined #ruby
[17:07:58] djbkd: has joined #ruby
[17:08:48] dlitvak: has joined #ruby
[17:08:58] [Butch]: has joined #ruby
[17:09:57] TomyLobo: has joined #ruby
[17:10:00] arup_r: has joined #ruby
[17:11:08] floatingpoint: what exactly does "stack level too deep" in rspec indicate?
[17:11:39] apeiros: floatingpoint: an infinite recursion
[17:11:51] apeiros: and s/in rspec//
[17:11:53] pietr0: has joined #ruby
[17:12:09] ruby881: has joined #ruby
[17:12:35] apeiros: it can of course also just mean too many nested method calls without having an infinite recursion. but that's rather rare.
[17:12:59] floatingpoint: ok. how would one go about debugging this? for the record, I'm rspecing chef code
[17:13:20] apeiros: you would read the backtrace and figure where it starts recurring and then why it does so infinitely.
[17:14:09] bklane: has joined #ruby
[17:15:02] floatingpoint: interesting. -b isn't printing a backtrace
[17:15:06] hxegon_: has joined #ruby
[17:15:15] hxegon_: has left #ruby: ("PEACE OUT")
[17:15:33] hxegon: has joined #ruby
[17:15:47] pulgolino: has joined #ruby
[17:16:04] tildes: has joined #ruby
[17:17:56] Xeago: has joined #ruby
[17:18:19] usershell: has joined #ruby
[17:19:27] hannelita: has joined #ruby
[17:19:48] ProofTechnique: has joined #ruby
[17:22:49] f0ster_: has joined #ruby
[17:22:54] rickmasta: has joined #ruby
[17:23:14] baweaver: has joined #ruby
[17:24:02] symm-: has joined #ruby
[17:24:58] karapetyan: has joined #ruby
[17:27:20] wolfedale: has joined #ruby
[17:27:33] neohunter: has joined #ruby
[17:27:50] ProofTechnique: Anyone have experience with roar and grape-entity and have some points of comparison?
[17:27:54] sgambino: has joined #ruby
[17:28:03] f0ster: has joined #ruby
[17:28:05] 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?
[17:28:19] dlitvak: has joined #ruby
[17:28:20] neohunter: even tried with a raise, is like the file is not updated
[17:28:40] shevy: what is incompatible character... that can not be the full error?
[17:30:08] 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.
[17:30:16] amoeba: has joined #ruby
[17:30:54] amoeba: anyone ever used net/ssh to chroot then execute commands?
[17:31:01] benlieb: has joined #ruby
[17:32:02] xpt: has joined #ruby
[17:32:22] ProofTechnique: Free JSON-HAL, JSON-API, and XML in roar is also kind of attractive
[17:33:11] 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
[17:33:31] nertzy2: has joined #ruby
[17:34:50] wldcordeiro: has joined #ruby
[17:35:16] PedramT: has joined #ruby
[17:36:36] Scripore: has joined #ruby
[17:37:23] mistnim: has joined #ruby
[17:37:33] TomPeed: has joined #ruby
[17:37:34] 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?
[17:37:35] chadhs: has joined #ruby
[17:39:57] howdoicomputer: has joined #ruby
[17:42:06] Limix: has joined #ruby
[17:42:33] wilbert_: has joined #ruby
[17:42:46] dlitvak_: has joined #ruby
[17:43:57] TomPeed: has joined #ruby
[17:44:30] karapetyan: has joined #ruby
[17:44:46] Ebok: has joined #ruby
[17:45:58] pilne: has joined #ruby
[17:47:54] 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."
[17:48:16] huQeQwdpu47q: has joined #ruby
[17:48:39] DenSchub: has joined #ruby
[17:49:05] ProofTechnique: It just means that exceptions work like they do in C++, but the keywords are different.
[17:49:14] mistnim: ProofTechnique: yes I figured, but I don't get the joke
[17:49:33] bronson: has joined #ruby
[17:49:39] ProofTechnique: https://en.wikipedia.org/wiki/Dragnet_(franchise)
[17:49:43] ProofTechnique: It's from the opening narration
[17:49:54] PedramT: has joined #ruby
[17:50:01] sftrabbit: has joined #ruby
[17:50:23] terminalrecluse: has joined #ruby
[17:50:55] mistnim: ProofTechnique: thanks
[17:51:57] crdpink: has joined #ruby
[17:52:06] karapetyan: has joined #ruby
[17:53:01] devbug: has joined #ruby
[17:55:31] bklane: has joined #ruby
[17:57:08] TomPeed: has joined #ruby
[17:57:23] Jackneill: has joined #ruby
[17:57:28] ESpiney_: has joined #ruby
[17:57:38] SCHAAP137: has joined #ruby
[17:57:39] rakm: has joined #ruby
[17:57:53] Scripore: has joined #ruby
[17:58:13] f3ttX]: has joined #ruby
[17:58:29] rails: has joined #ruby
[17:58:47] DonOtreply_: has joined #ruby
[17:58:53] 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
[17:58:54] ruby[bot]: rails: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/98a578a5c62025b8c0f7
[17:58:54] ruby[bot]: rails: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[17:59:01] karapetyan: has joined #ruby
[17:59:05] rails: thank ruby bot
[17:59:10] rtail: has joined #ruby
[18:00:06] yardenbar: has joined #ruby
[18:00:14] Amnez777: has joined #ruby
[18:00:31] CloCkWeRX: has joined #ruby
[18:00:53] apeiros: ?justabot rails
[18:00:53] ruby[bot]: rails: I'm just a bot. You don't need to address me.
[18:01:07] mikecmpbll: has joined #ruby
[18:01:40] apeiros: rails: take a look at the FileUtils module. wrt tar, I'd probably shell out for that even though ruby gems exist.
[18:02:26] lucasb: has joined #ruby
[18:02:26] sigurding: has joined #ruby
[18:03:23] Amnez777: has joined #ruby
[18:03:47] karapetyan: has joined #ruby
[18:04:27] dopie: has joined #ruby
[18:04:31] roshanavand: has joined #ruby
[18:04:32] Eiam_: has joined #ruby
[18:05:49] rakm: has joined #ruby
[18:07:05] shevy: they still thank the bot
[18:07:19] djbkd: has joined #ruby
[18:07:23] apeiros: shevy: see
[18:07:44] troulouliou_div2: has joined #ruby
[18:08:20] rtail_: has joined #ruby
[18:08:44] drbrain: rails: I'll second FileUtils. Also, `` sets $? (the last process status) so you can `` if $?.success
[18:09:36] darkxploit: has joined #ruby
[18:10:49] hanneli: has joined #ruby
[18:11:40] sgambino: has joined #ruby
[18:11:49] Nyammy_Work: has joined #ruby
[18:11:53] bklane: has joined #ruby
[18:12:13] jbrhbr: has joined #ruby
[18:13:37] rails: drbrain: yeah, I love the `` if $?.success idea
[18:13:37] ramfjord: has joined #ruby
[18:14:18] apeiros: drbrain: btw., wasn't conundrum your bot?
[18:14:20] drbrain: rails: $? is a Process::Status object, so you can look up documentation on what else it has
[18:14:34] drbrain: apeiros: yes, I've still got its data files lying around somewhere
[18:14:51] rails: does ruby have something like this? https://clojuredocs.org/clojure.core/-%3E that is one ofthe things i loved from clojure
[18:14:53] apeiros: drbrain: oh that might be interesting. do you wish anything from it imported into ruboto?
[18:15:12] drbrain: I don't think there's anything interesting there except the logs
[18:15:32] drbrain: but I think whitequark's log bot duplicates most of my logs
[18:15:36] apeiros: ok. the logs I'm actually interested in too. but that doesn't hurry.
[18:15:53] karapetyan: has joined #ruby
[18:16:03] 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 :)
[18:16:04] rtl: has joined #ruby
[18:16:17] apeiros: but for whitequark's log I've already written an importer :D
[18:16:33] Xeago: has joined #ruby
[18:17:09] drbrain: you'll have to remind me periodically to bring them up
[18:17:33] apeiros: ok. I barely remember conundrum. but it did have a factoids plugin too, right? iirc it was an rbot?
[18:18:39] drbrain: yeah, it was an rbot
[18:18:48] shevy: oh dear god I remember rbot
[18:18:49] drbrain: I'm pretty sure the factoids were 95% junk
[18:18:57] shevy: I think I tried to download it in 2003 or so to study how to write an IRC bot in ruby
[18:19:35] mg^: first factoid bot I ever encountered was purl in efnet #perl
[18:20:06] mg^: now ~15% of my job is supporting "chatops" at my workplace using Lita
[18:20:41] apeiros: drbrain: that's why I've added a usage counter to mine. I intend to deprecate junk.
[18:21:13] aegis3121: has joined #ruby
[18:21:18] choke: has joined #ruby
[18:22:08] craigp: has joined #ruby
[18:24:03] drbrain: I'm pretty sure I'd cleaned out all of dross' contributions, but I wonder if I got all of them
[18:24:23] moei: has joined #ruby
[18:24:53] apeiros: heh, dross must have been a pain. was before my time, though.
[18:25:19] nertzy2: has joined #ruby
[18:25:37] 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?
[18:26:18] arlek: has joined #ruby
[18:26:28] chris2: i read names i was happy to forget about :P
[18:26:28] jamw: has joined #ruby
[18:26:30] dlitvak: has joined #ruby
[18:27:36] zapata: has joined #ruby
[18:27:47] shadoi: has joined #ruby
[18:27:50] baweaver: has joined #ruby
[18:28:04] 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?
[18:28:23] duckpuppy: has joined #ruby
[18:28:26] neohunter: i run the script again with requires the gem and still using an old version
[18:28:50] apeiros: neohunter: you can always inspect $LOADED_FEATURES (aka $") to see which file actually gets loaded
[18:29:00] apeiros: probably you edited the wrong gem
[18:29:24] kadoppe: has joined #ruby
[18:29:45] 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...
[18:30:04] neohunter: but when I initially added the raise it didnt work
[18:30:25] deweysdecimal: has joined #ruby
[18:32:11] neohunter: bundle caches it
[18:32:17] neohunter: .rvm/gems/ruby-2.1.2/cache
[18:33:04] yardenbar: has joined #ruby
[18:33:05] sneakerhax: has joined #ruby
[18:34:08] devbug_: has joined #ruby
[18:36:10] x77686d: has joined #ruby
[18:36:56] jottr_: has joined #ruby
[18:37:11] imperator: has left #ruby: ("Leaving")
[18:37:20] ProofTechnique: has joined #ruby
[18:37:26] nofxx: has joined #ruby
[18:37:27] nofxx: has joined #ruby
[18:37:45] roshanavand: has joined #ruby
[18:39:32] felixal: has joined #ruby
[18:39:46] Pupeno: has joined #ruby
[18:40:44] howdoicomputer: has joined #ruby
[18:42:48] mrsolow: has joined #ruby
[18:43:08] jbrhbr: has joined #ruby
[18:43:12] zambini: has joined #ruby
[18:43:47] dlitvak_: has joined #ruby
[18:43:50] Xeago: has joined #ruby
[18:44:12] baweaver: has joined #ruby
[18:44:46] JusticeFries: has joined #ruby
[18:46:24] baweaver: has joined #ruby
[18:48:58] joonty: has joined #ruby
[18:50:59] hays: has joined #ruby
[18:51:10] mchu: has joined #ruby
[18:52:05] drbrain: I wonder if dross even registered it
[18:53:52] karapetyan: has joined #ruby
[18:56:35] cschneid_: has joined #ruby
[18:56:40] Bloomer: has joined #ruby
[18:56:45] TomPeed: has joined #ruby
[18:58:38] jottr: has joined #ruby
[18:58:53] dfockler: has joined #ruby
[19:03:22] Xeago: has joined #ruby
[19:08:37] wilbert_: has joined #ruby
[19:09:51] choke: has joined #ruby
[19:09:53] aclearman037: has joined #ruby
[19:10:00] Pupp3tm4st3r: has joined #ruby
[19:11:22] e4xit: has joined #ruby
[19:16:37] nerium: has joined #ruby
[19:19:15] Frem: has joined #ruby
[19:19:28] scpike: has joined #ruby
[19:21:20] baweaver: has joined #ruby
[19:22:25] scpike: has joined #ruby
[19:22:45] aost: has joined #ruby
[19:23:54] rickmasta: has joined #ruby
[19:27:12] hxegon: >> [[1], [2]].each {|e| e.each(&method(:p)) } # is there a cleaner way to do call blocks on nested arrays like this?
[19:27:14] ruby[bot]: hxegon: # => 1 ...check link for more (https://eval.in/506035)
[19:27:47] x0F: has joined #ruby
[19:27:52] hxegon: yes brain. do call. sure.
[19:28:07] momomomomo: has joined #ruby
[19:28:35] arthropododo: has joined #ruby
[19:28:41] norc: hxegon, flatten first?
[19:29:10] hxegon: norc not the kind of thing I was thinging of, but that works anyway. Thanks!
[19:29:44] ur5us: has joined #ruby
[19:30:10] juddey: has joined #ruby
[19:30:41] craigp: has joined #ruby
[19:31:12] jbrhbr: has joined #ruby
[19:31:28] dcunit3d: has joined #ruby
[19:31:41] edwinvdgraaf: has joined #ruby
[19:31:50] cloudyhls: has joined #ruby
[19:32:03] PedramT: has joined #ruby
[19:32:46] edwinvdgraaf: has joined #ruby
[19:35:18] eam: >> ObjectSpace.each_object.select { |o| o =~ /good/ rescue false }.uniq
[19:35:19] ruby[bot]: eam: # => ["good", " ObjectSpace.each_object.select { |o| o =~ /good/ rescue false }.uniq\n"] (https://eval.in/506036)
[19:36:02] eam: not much
[19:38:44] sandstrom: has joined #ruby
[19:38:46] symbole: has joined #ruby
[19:40:43] 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'
[19:40:44] arthropododo: has joined #ruby
[19:40:53] eam: hot damn
[19:41:56] SenpaiSilver: has joined #ruby
[19:41:57] hahuang65: has joined #ruby
[19:41:58] eam: gems/pry-0.10.3/lib/pry/commands/easter_eggs.rb
[19:42:12] eam: command "get-naked", "" do
[19:42:14] eam: loooooool
[19:42:30] mchu: has joined #ruby
[19:43:58] eam: https://github.com/pry/pry/blob/master/lib/pry/commands/easter_eggs.rb#L12
[19:44:15] bklane: has joined #ruby
[19:44:36] ramfjord: has joined #ruby
[19:44:53] Encapsulation: has joined #ruby
[19:44:57] hxegon: my god... the eighties... https://www.youtube.com/watch?v=ilQQb0ps34o
[19:45:00] arup_r: has joined #ruby
[19:45:20] eam: what a delightful turn of events we've encountered
[19:46:11] hannelita: has joined #ruby
[19:46:25] dlitvak: has joined #ruby
[19:46:30] hxegon: I never thought I would be able to argue that a Jermaine Stewart music video link was on topic.
[19:47:07] hxegon: >> get-naked # does this use pry?
[19:47:09] ruby[bot]: hxegon: # => undefined local variable or method `get' for main:Object ...check link for more (https://eval.in/506037)
[19:47:41] eam: we would've seen it in the objspace filter!
[19:47:59] kadoppe: has joined #ruby
[19:48:38] hxegon: ACTION slaps forehead
[19:49:55] sftrabbit: has joined #ruby
[19:50:15] Dimik: has joined #ruby
[19:51:39] bronson: has joined #ruby
[19:52:37] Azulinho: has joined #ruby
[19:52:53] karapetyan: has joined #ruby
[19:52:58] mistnim: I am the only one who just can't stand python style colon blocks, and loves ruby syntax?
[19:53:17] Muz: has joined #ruby
[19:53:33] hxegon: ACTION looks at channel name
[19:54:43] Muz: has joined #ruby
[19:55:03] momomomomo: colon blocks don't bug me, spacing delimited line breaks do
[19:55:15] momomomomo: spacing based syntax
[19:56:04] hxegon: I actually enjoyed pythons indentation based stuff.
[19:56:57] Xeago: has joined #ruby
[19:57:03] mistnim: I think it's a matter of symmetry, my brain feels the need for a closing statement, balance
[19:57:53] Xeago: has joined #ruby
[19:58:17] hxegon: mistnim having six ends in a row can get be pretty not great too :P
[19:58:49] 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
[19:59:40] mistnim: hxegon: that's even worse, the abrupt ravine that there would be in python terrifies me
[20:00:15] hxegon: It was always super clear to me what was in which scope
[20:00:38] mic_e: has joined #ruby
[20:01:00] mistnim: hxegon: yes, but mine is just a psychological/emotional issue
[20:01:19] mistnim: I'm not saying python is bad
[20:02:33] 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.
[20:02:56] radgeRayden_: has joined #ruby
[20:03:04] hxegon: I get it, we've all hatcheted some whitespace to death before, your among friends
[20:03:04] blackmes1: has joined #ruby
[20:03:12] User458764: has joined #ruby
[20:05:02] JohnT: has joined #ruby
[20:05:07] djellemah_: has joined #ruby
[20:05:55] sgambino: has joined #ruby
[20:07:10] babblebre: has joined #ruby
[20:10:08] lxsameer: has joined #ruby
[20:10:08] lxsameer: has joined #ruby
[20:11:01] zeroDivisible: has joined #ruby
[20:12:09] tomchapin: has joined #ruby
[20:13:28] agit0: has joined #ruby
[20:15:01] yfeldblum: has joined #ruby
[20:15:03] cicloid: has joined #ruby
[20:15:40] FernandoBasso: has joined #ruby
[20:16:17] Cohedrin: has joined #ruby
[20:17:11] cicloid: has joined #ruby
[20:17:29] ElderFain: has joined #ruby
[20:17:37] Xeago: has joined #ruby
[20:19:05] Ebok: has joined #ruby
[20:19:28] ascarter: has joined #ruby
[20:20:02] spider-mario: has joined #ruby
[20:21:55] riceandbeans: has joined #ruby
[20:22:03] Xiti: has joined #ruby
[20:23:25] juanpablo_: has joined #ruby
[20:23:37] baweaver: has joined #ruby
[20:24:36] 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?
[20:24:59] riceandbeans: I mean, as long as the minor is < 10 it would be fine, but beyond that it wouldn't work
[20:25:13] riceandbeans: I'd have to split on . and do a comparison of both values individually
[20:25:41] ympeg: has joined #ruby
[20:25:56] riceandbeans: I'd like to just be able to be like, if version < 5.1 do this
[20:26:06] riceandbeans: and then if the version is 5.3 it won't do anything
[20:26:31] riceandbeans: but NOT break if it's like version < 5.3 and then I have version 5.10 installed
[20:26:33] lemur: has joined #ruby
[20:26:36] aegis3121: has joined #ruby
[20:27:11] jamw: has joined #ruby
[20:28:07] wilbert_: has joined #ruby
[20:28:31] tomchapin: has joined #ruby
[20:29:03] apeiros: riceandbeans: Gem::Version is indeed a good way to go
[20:29:23] apeiros: but without you providing actually useful info, we can't possibly tell you what you're doing wrong with it
[20:29:49] riceandbeans: one sec let me see what I can safely paste
[20:30:52] riceandbeans: Gem::Version.create(default['foo']['version']['short'] < config['version.current'])
[20:30:56] Xeago_: has joined #ruby
[20:31:01] lorn: has joined #ruby
[20:31:18] lorn: has joined #ruby
[20:32:10] 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']
[20:32:32] 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
[20:33:04] apeiros: uh??? yeah???
[20:33:20] apeiros: Gem::Version.create(a < b) does NOT compare Gem::Version's
[20:33:33] apeiros: you're comparing a and b, and create a Gem::Version from the result
[20:33:51] riceandbeans: that's how I was told to write it from someone
[20:34:02] riceandbeans: a doesn't exist, b does
[20:34:17] riceandbeans: I want to populate a with b and treat it like a gem version for comparison
[20:34:29] apeiros: you want Gem::Version.create(a) < Gem::Version.create(b)
[20:34:38] apeiros: and I'd be pretty surprised if that person told you otherwise
[20:34:49] riceandbeans: I literally copy pasted what he said
[20:34:57] riceandbeans: I just changed a name for foo for you
[20:35:51] apeiros: that code literally makes no sense :)
[20:36:01] riceandbeans: so b might be like 5.1, if I do this, can I then later say, if version < a ?
[20:36:36] roshanavand: has joined #ruby
[20:36:37] riceandbeans: basically, if your installed version is < whatever, do this
[20:36:39] apeiros: no. you have to create a Gem::Version. you can't just compare with a float.
[20:36:43] apeiros: a float ain't a version.
[20:36:55] riceandbeans: ok, so the actual comparison line with the action needs the code
[20:37:18] riceandbeans: if Gem::Version.create(a) < Gem::Version.create(b)
[20:37:38] apeiros: you can create the Gem::Version instances wherever you want
[20:37:49] riceandbeans: but then how do I compare?
[20:38:01] apeiros: you??? know ruby basics, yes?
[20:38:14] riceandbeans: but you said I can't do < or >
[20:38:25] apeiros: no. pay attention.
[20:38:31] apeiros: I said you can't compare with a *float*
[20:38:40] apeiros: I did not say you can't do < or >.
[20:38:58] apeiros: your operands need to be Gem::Version instances. where/when you create them is irrelevant.
[20:39:24] riceandbeans: so in this example, say installed version is 5.1 and I want to compare against 5.3
[20:39:54] riceandbeans: Gem::Version.create(a) < Gem::Version.create(5.3)
[20:40:02] roshanavand: has joined #ruby
[20:40:12] apeiros: not sure whether Gem::Version.create accepts a float. might have to be a string.
[20:40:24] riceandbeans: Gem::Version.create(b) < Gem::Version.create(config['version.current'])
[20:40:34] riceandbeans: if b < a .... end
[20:40:40] djbkd: has joined #ruby
[20:40:44] riceandbeans: is that more correct?
[20:40:52] newdan: http://ruby-doc.org/stdlib-2.0.0/libdoc/rubygems/rdoc/Gem/Version.html#method-c-new
[20:41:06] newdan: "Constructs a Version from the version string. A version string is a series of digits or ASCII letters separated by dots."
[20:41:27] howdoicomputer: has joined #ruby
[20:42:10] riceandbeans: but was I correct in the way I said it?
[20:42:37] 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
[20:42:58] davedev24: has joined #ruby
[20:43:00] riceandbeans: pushing the code to test is a pain so I'd rather be a little close than test with like 20 iterations
[20:43:00] newdan: riceandbeans: Yeah, that sounds right
[20:43:15] newdan: riceandbeans: You can always just launch irb/pry and play around to make sure it works how you expect...
[20:44:08] sediment: has joined #ruby
[20:45:26] guacamole: has joined #ruby
[20:47:03] hannelita: has joined #ruby
[20:49:27] akem: has joined #ruby
[20:49:45] mchu: has joined #ruby
[20:49:59] apeiros: riceandbeans: Gem::Version.create(b) does not turn b into a Gem::Version. that's not how it works.
[20:50:03] NightMonkey: has joined #ruby
[20:50:24] apeiros: b = Gem::Version.create(some_version_string_from_wherever) # now b references a Gem::Version
[20:50:45] apeiros: and then - assuming a is also a Gem::Version - you can do `if a < b`
[20:50:59] ur5us: has joined #ruby
[20:51:20] apeiros: and you're lacking greatly in the ruby basics. you should really pick up some good tutorial or book and improve it.
[20:51:54] baweaver: has joined #ruby
[20:53:26] nerium: has joined #ruby
[20:53:31] dfinninger: has joined #ruby
[20:54:11] newdan: apeiros: That last bit is basically exactly what he already said
[20:54:29] fantazo: has joined #ruby
[20:55:13] 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?
[20:55:32] sediment: I'm trying to use the truncate_html gem, which I've installed with 'gem install', and seemed to work
[20:56:19] 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
[20:56:48] huQeQwdpu47q: has joined #ruby
[20:57:11] einarj: has joined #ruby
[20:57:14] ddfreyne: sediment: Looking at the code for that gem, it seems like that only works after a `include TruncateHtmlHelper`
[20:57:30] 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:
[20:57:36] sediment: NameError: undefined local variable or method `some_html' for main:Object
[20:57:37] ddfreyne: (I assume that Rails does the `include` automatically)
[20:58:05] ddfreyne: sediment: Replace some_html with the string that you want to truncate
[20:58:22] sediment: ah, yeah, I'm doing that, don't worry
[20:58:38] sediment: but I think you're right about including TruncateHtmlHelper
[20:59:15] sediment: doing that seems to help, but doesn't totally solve the problem... it then throws this:
[20:59:18] sediment: NoMethodError: undefined method `html_safe' for "...(continued)":String
[20:59:30] sediment: maybe it wants one of the other classes to be included?
[21:00:03] sediment: any thoughts?
[21:01:20] dudedudeman: has joined #ruby
[21:01:49] apeiros: sediment: sounds like that gem is made for rails
[21:01:55] apeiros: since rails defines String#html_safe
[21:02:18] sediment: OK. Yeah, I'm trying to use it without rails.
[21:02:46] sediment: that's weird, because it says in the readme "It can be used with or without Rails."
[21:03:26] pilne: has left #ruby: ("Leaving!")
[21:03:53] ddfreyne: That might be a lie :o
[21:04:21] newdan: sediment: What gem?
[21:04:27] treehug88: has joined #ruby
[21:04:32] 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.
[21:04:41] sediment: newdan, https://github.com/hgmnz/truncate_html
[21:05:03] PedramT: has joined #ruby
[21:05:48] dudedudeman: would sinatra work?
[21:06:35] 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.
[21:06:51] ddfreyne: I???d suggest finding a different gem!
[21:07:13] cdg: has joined #ruby
[21:07:22] dudedudeman: well, yeah, sinatra is just a small, light weight web framework
[21:07:41] jaequery: has joined #ruby
[21:07:58] djbkd: has joined #ruby
[21:08:04] sediment: ddfreyne, I'm going to try this one https://rubygems.org/gems/truncateHTML
[21:08:21] newdan: sediment: I'd try Nokogiri or something like that, personally
[21:08:48] norc: sediment, a gem that was updated only once, and that was 5 years ago? :o)
[21:09:08] newdan: Yeah the github page for truncate_html is not very helpful
[21:09:12] 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.
[21:09:16] newdan: Their only "example" just doesn't work
[21:09:21] mfb2: has joined #ruby
[21:09:32] sediment: norc, well-spotted... I'll give it a try, but maybe not too optimistically.
[21:09:51] sediment: newdan, glad I'm not the only one thrown by that github page.
[21:10:01] newdan: sediment: Well, that's why I'd suggest Nokogiri. It'll parse the HTML and let you find all text content inside
[21:10:13] norc: sediment, nokogiri was made for parsing broken html.
[21:10:15] newdan: It's a very small subset of Nokogiri but I think it'd do the trick
[21:10:32] victortyau: has joined #ruby
[21:11:22] sediment: I think I'll try this gem first and nokogiri second.
[21:12:19] Guest38: has joined #ruby
[21:14:55] pollardj: has joined #ruby
[21:15:31] karapetyan: anyone know https://en.wikipedia.org/wiki/Reverse_Polish_notation
[21:16:35] sediment: what about it, karapetyan?
[21:16:58] karapetyan: sediment: seems i found example. sorry
[21:17:11] sediment: no problem! It's neat.
[21:17:24] sediment: I love how it never needs brackets.
[21:17:34] vincenthughes: has joined #ruby
[21:18:07] djbkd: has joined #ruby
[21:18:26] Limix: has joined #ruby
[21:19:29] lucasb: has joined #ruby
[21:20:01] PedramT_: has joined #ruby
[21:20:05] BTRE: has joined #ruby
[21:20:41] dlitvak: has joined #ruby
[21:20:46] bb010g: has joined #ruby
[21:21:04] sediment: That other truncateHTML gem seems broken, too. Seems like it doesn't work with current version of hpricot.
[21:21:11] sediment: guess I will go with nokogiri, newdan.
[21:21:15] vincenthughes: go fuck yourself
[21:21:21] norc: sediment, let that be a lesson to you.
[21:21:28] norc: sediment, always version lock your dependencies.
[21:21:44] sediment: haha. Noted.
[21:22:34] whippythellama: has joined #ruby
[21:22:40] devbug: has joined #ruby
[21:23:02] tinnvec: has joined #ruby
[21:23:29] bb010g: has joined #ruby
[21:24:11] skcin7: has joined #ruby
[21:24:50] rickmasta: has joined #ruby
[21:26:01] karapetyan: has joined #ruby
[21:27:16] PedramT: has joined #ruby
[21:28:33] Emmanuel_Chanel: has joined #ruby
[21:29:15] lacuna: has joined #ruby
[21:31:21] bradland: silly question, but is there a shortcut for writing CSV::Table objects back to a CSV file?
[21:32:09] norc: bradland, ys.
[21:32:20] djbkd: has joined #ruby
[21:32:22] DoubleMalt: has joined #ruby
[21:32:23] norc: &ri CSV::Table # bradland
[21:32:24] `derpy: bradland: http://ruby-doc.org/stdlib-2.3.0/libdoc/csv/rdoc/CSV/Table.html
[21:32:36] bradland: it looks like #to_csv and writing to a string is it.
[21:32:38] norc: I recommend you take a very short look at the methods there.
[21:32:38] blarghlarghl: Anyone here happen to have any experience building gems that have native bindings using cmake?
[21:32:48] blarghlarghl: Like, is it a really silly thing to do?
[21:32:56] blarghlarghl: In fact, it's cmake and swig.
[21:33:35] dudedudeman: @shevy helllooooooooooo
[21:33:51] dlitvak: has joined #ruby
[21:34:47] _djbkd: has joined #ruby
[21:36:37] krobzaur: has joined #ruby
[21:36:53] synthroid: has joined #ruby
[21:37:17] ascarter: has joined #ruby
[21:42:03] adaedra: ACTION pokes his head in
[21:42:20] n_blownapart: has joined #ruby
[21:45:37] fclausen: has joined #ruby
[21:45:39] tomchapin: has joined #ruby
[21:45:46] Pumukel: has joined #ruby
[21:47:46] hannelita: has joined #ruby
[21:47:57] guacamole: has joined #ruby
[21:47:57] choke: has joined #ruby
[21:50:26] sandstrom: has joined #ruby
[21:50:45] luckyme: has joined #ruby
[21:53:53] akem: has joined #ruby
[21:54:05] bronson: has joined #ruby
[21:54:07] nymous: has joined #ruby
[21:54:14] nymous: hey folks
[21:54:20] nymous: i need an advice
[21:54:22] huQeQwdpu47q: has joined #ruby
[21:54:28] Radar: I have many advices.
[21:54:40] hannelita: has joined #ruby
[21:54:51] bnagy: nymous: don't fall asleep in socks
[21:55:21] nymous: i'm writing a shell script (using ruby of course). it starts a system command using threads in parallel
[21:55:36] nymous: sometimes this command just hangs
[21:55:44] nymous: how can i kill it by timeout?
[21:55:45] sebboh: has joined #ruby
[21:56:19] nymous: i've tried t.kill unless t.join(10)
[21:56:30] guacamole: has joined #ruby
[21:56:45] nymous: but it doesn't kill some processes and produce a lot of zombies
[21:56:51] nymous: t is a Thread instance
[21:57:15] bnagy: which interpreter?
[21:57:36] 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.
[21:57:38] nymous: i mean c ruby
[21:57:47] stevemackinnon: has joined #ruby
[21:57:48] sebboh: s/binary/executable/
[21:57:49] bnagy: meh either way, personally I tend to track OS pids and kill those, Threads are fiddly when combined with exec
[21:57:50] djbkd: has joined #ruby
[21:58:10] jbrhbr: has joined #ruby
[21:58:20] sediment: sebboh, gem has a directory that it installs binaries too, which I guess isn't on your path. What OS are you using?
[21:58:38] sediment: on linux, it's something like ~/.gem/ruby/[version]/bin, I think
[21:58:45] sebboh: sediment: oh, probably somewhere in ~/.gem or ~/.ruby or something. I'll find it. Thanks!
[21:59:07] sediment: you can either add that to your path or just run it from there.
[21:59:32] 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
[21:59:44] adaedra: gem install usually warns about gem path not being in $PATH.
[22:00:04] karmatr0n: has joined #ruby
[22:00:14] nymous: bnagy: it's a small script, so i don't want to go too complex on that. do you have any example?
[22:00:26] Radar: sebboh: Do you intend to do much Ruby or do you just want the gist app?
[22:00:52] 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
[22:00:57] symm-: has joined #ruby
[22:01:21] bnagy: otherwise mutex or (ew) condvar but that's imho arcane
[22:01:29] zambini: has joined #ruby
[22:02:07] ur5us: has joined #ruby
[22:02:22] rickmasta: has joined #ruby
[22:02:43] bnagy: the reason I asked about interpreter is that jruby threads behave weirdly differently to MRI threads
[22:03:03] bnagy: they're even more fragile when it comes to externally managing them
[22:03:27] norc: nymous, if you produce zombies... maybe you should wait your processes... ? :-)
[22:03:30] bklane: has joined #ruby
[22:03:45] bnagy: last thing, if you're getting zombies you want to check how you're spawning
[22:03:46] skcin7: has joined #ruby
[22:04:28] bnagy: if you're popening or something then the child should know when the parent dies, unless there's weirdness
[22:05:22] Livecodingtv_: has joined #ruby
[22:05:22] tercenya: has joined #ruby
[22:05:30] ur5us: has joined #ruby
[22:05:41] finisherr: has joined #ruby
[22:05:43] bnagy: basically this isn't a simple script, no matter how short it might look
[22:05:55] norc: nymous, either way, you do not produce enough information for us to help you with.
[22:06:32] 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.
[22:06:38] sediment: I'm outta here. Thanks for the help, all
[22:07:09] karapetyan: has joined #ruby
[22:07:33] Livecodingtv_: has left #ruby: ("Leaving")
[22:07:40] nymous: norc: full code https://gist.github.com/divanikus/5fee400251252204b0c1
[22:08:01] sebboh: Radar: just use that tool. It's done now. :) Cya all later.
[22:08:04] sebboh: has left #ruby: ("ERC (IRC client for Emacs 25.0.50.1)")
[22:08:10] nymous: i need to check several sites using phantomjs
[22:08:31] dudedudeman: has joined #ruby
[22:08:33] Jonah11_: has joined #ruby
[22:08:38] nymous: so phantom can just hang eating 100% cpu and doing nothing for no reason
[22:09:45] norc: nymous, ok - and what exactly is your issue now?
[22:10:03] norc: nymous, if your command hangs this is not Ruby related.
[22:10:19] eam: well, it is if he's asking how to terminate it from ruby, which I think he is
[22:10:37] nymous: it's started by ruby
[22:10:45] bnagy: nymous: there are plenty of ruby wrappers for phantom btw
[22:10:51] bnagy: you shouldn't need to shell out
[22:10:58] baweaver: has joined #ruby
[22:11:02] bnagy: that might make things a lot easier to wrangle
[22:11:02] nymous: if i won't use some kind of timeout, iteration just hangs
[22:11:03] 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
[22:11:22] hospes: has joined #ruby
[22:11:27] bnagy: 05:43 < bnagy> meh either way, personally I tend to track OS pids and kill those, Threads are fiddly when combined with exec
[22:11:29] eam: bnagy's advice is best, of course. don't implement this sort of thing yourself if you're not fluent in the area
[22:11:52] eam: bnagy: yeah, well more importantly killing the thread has nothing to do with killing the subprocess :)
[22:11:59] nerium: has joined #ruby
[22:12:04] norc: "killing the thread" is such a bad term imo
[22:12:12] nymous: anyway, somehow it does produce zombies
[22:12:32] nymous: and not killing some processes
[22:13:20] blackgoat: has joined #ruby
[22:13:32] bnagy: nymous: I just looked up some old scrapers, back then I used celerity and capybara, and both were ok
[22:14:03] eam: norc: given Thread#kill it seems inevitable
[22:14:10] norc: eam, it is a horrible alias.
[22:14:22] wilbert_: has joined #ruby
[22:14:26] eam: no argument
[22:14:33] Scripore: has joined #ruby
[22:15:08] norc: nymous, which makes good sense actually.
[22:15:11] nymous: bnagy: i just need to log some links, it's not repeatable task
[22:15:32] bnagy: I don't know what that means or why it's relevant
[22:16:04] djbkd: has joined #ruby
[22:16:11] nymous: i mean using a testing framework is overkill to me
[22:16:32] bnagy: well you haven't managed to kill it at all yet
[22:16:45] Ox0dea: Sick burn.
[22:16:52] bnagy: anyway do what you want, I'm not the cops
[22:17:08] eam: that's exactly the kind of thing the cops would say
[22:17:29] adaedra: *woop* *woop*
[22:17:39] eam: cheese it!
[22:17:52] nymous: i thought i can use ruby's timeout, but it seems that it would mess with threads
[22:18:02] norc: Ox0dea, hey, have you dug into Thread code at all?
[22:18:12] Ox0dea: norc: MRI-side?
[22:18:23] nymous: bnagy: i don't think that "knowing which widgets your site uses" is something illegal :)
[22:18:42] Ox0dea: norc: Dug into st_table code? :)
[22:19:10] norc: Ox0dea, wait...
[22:19:32] shellie: I'm learning ruby, what are some simple / well coded ruby scripts/libs/etc ?
[22:19:37] Ox0dea: norc: The hash table implementation that uses callbacks and the like all over the place.
[22:19:38] dlitvak: has joined #ruby
[22:19:42] bnagy: shellie: Rails
[22:19:45] bnagy: ACTION dies laughing
[22:19:57] momo-reina: has joined #ruby
[22:19:59] sigurding: has joined #ruby
[22:20:08] eam: Timeout spins up a thread and uses Thread#kill -- and is very dangerous
[22:20:09] momo-reina: has joined #ruby
[22:20:20] roller123: has joined #ruby
[22:20:21] shellie: maybe I'll clarify that by simple I meant 'small and not overly complex', e.g 100-500 LoC
[22:20:21] Ox0dea: But the convenience!
[22:20:23] bnagy: srsly though imvho writing code > reading code for learning ruby
[22:20:41] eam: we found a great redis bug involving Timeout
[22:20:42] guacamole: has joined #ruby
[22:20:43] norc: eam, from the looks of it Ruby just uses a control mechanism akin to exceptions to forcibly end Thread execution immediately.
[22:20:44] shellie: I want to use them to basically compare to my code, which is that of a newbie
[22:20:50] apeiros: in newer rubies, Thread#kill can be handled, but it's not for the faint of heart.
[22:20:51] bnagy: "There's More Than One Way To Do It" leads to a pretty wide range of idiom
[22:20:52] shellie: I started reading the well grounded rubyist
[22:20:55] Xeago: has joined #ruby
[22:21:01] norc: eam, since the Thread causes sub-processes to be spawned, I am not surprised in the slightest this would cause Zombies
[22:21:05] norc: since they are never waited.
[22:21:17] 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
[22:21:25] eam: norc: agreed
[22:21:33] shellie: newdan: good idea, :)
[22:21:51] jgpawletko: has joined #ruby
[22:21:59] Ox0dea: shellie: Consider doing something like Codewars that shows you how other people solved it only once you've done so yourself.
[22:22:01] bnagy: shellie: the style guide is worth a look
[22:22:06] 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
[22:22:25] Ox0dea: No `ensure` for you!
[22:22:26] eam: so you loop and send another query(#2), but response(#1) is returned
[22:22:28] bnagy: and will teach you good vs poor form in a more condensed form than reading complete libs / apps
[22:22:54] eam: and forevermore you have an off-by-one style error where the response you read is to the query sent just prior
[22:22:58] 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)
[22:22:59] shellie: Ox0dea: interesting, not familiar with codewars
[22:23:00] eam: until the connection is re-established
[22:23:11] eam: this is possible because there's no sequence number in the redis wire protocol
[22:23:14] shellie: bnagy: Yup, I was told about it and I have cast my eyes on it, but do need to revisit
[22:23:17] eam: so it doesn't know it's mixed up
[22:23:20] norc: apeiros, based on my first impressions of the code here I would stay far away from handle_interrupt honestly :D
[22:23:24] Ox0dea: newdan: It's not as if single-character identifiers don't have their place, mind.
[22:23:42] apeiros: norc: I didn't say "not for the faint of heart" for no reason :D
[22:23:43] bnagy: ?quickref
[22:23:43] ruby[bot]: http://www.zenspider.com/Languages/Ruby/QuickRef.html
[22:23:48] eam: norc: that's how we minimized the above redis/timeout issue, actually
[22:23:53] bnagy: shellie: ^^ that too
[22:23:57] newdan: Ox0dea: I agree. But I routinely see those sorts of post solutions sites devolve into code golf
[22:24:08] apeiros: I doubt it's possible to write halfway sane code with handle_interrupt and the other bits which were added for this
[22:24:11] shellie: awesome :)
[22:24:14] shellie: thanks bnagy
[22:24:24] Ox0dea: newdan: As is to be expected, I think. People "upvote" golf.
[22:24:33] sgambino: has joined #ruby
[22:24:41] eam: apeiros: https://github.com/redis/redis-rb/pull/502
[22:24:47] shellie: is there anything similar to pylint for ruby?
[22:24:48] norc: apeiros today I had a nice one again - real WTF hour with strange parsing errors and an AST that was strange...
[22:24:52] Ox0dea: shellie: RuboCop.
[22:24:53] newdan: shellie: rubocop
[22:24:59] norc: Completely forgot about non-breaking spaces on OSX...
[22:25:29] nymous: speaking of code quality, i think you should properly understand OO idiom at first so you can code on any language it uses
[22:25:44] nymous: and later comes all this cool syntax sugar and stuff
[22:25:59] bnagy: so much side-eye right now
[22:26:03] guacamole: has joined #ruby
[22:26:05] norc: shellie, now that we have told you, its time for us to tell you to be careful with rubocop.
[22:26:13] shellie: bnagy: was that with regards to myself?
[22:26:33] shellie: nymous: was that with regards to myself?
[22:26:38] apeiros: hm, somebody know if it's possible to emulate a disconnect (TCP/IP) for a single process on osx?
[22:26:44] shellie: norc: why? :)
[22:26:45] nymous: shellie: yes
[22:26:59] norc: apeiros, hping?
[22:27:12] norc: Granted, might be a bit of an artillery there...
[22:27:15] shellie: nymous: oh, I'll prob need to learn the differences from python, of which I have solid experience :)
[22:27:19] eam: apeiros: emulate on what level?
[22:27:52] shellie: I'm not sure hping is going to be helpful
[22:27:58] jamw: has joined #ruby
[22:28:01] shellie: you'd need to find the right sequence number for the session
[22:28:05] nymous: shellie: so, well, go with syntactic sugar part, you'll like it
[22:28:09] shellie: so your best bet would be to firewall it
[22:28:25] apeiros: eam: well, it should be like either as if e.g. my network went down, or like the remote server disconnected
[22:28:26] shellie: if your firewall supports reject
[22:28:37] riceandbeans: apeiros: with my earlier problem is nil < 5.1?
[22:28:54] apeiros: if I can't emulate it, I'll disable my wifi
[22:29:02] newdan: riceandbeans: Just try it in pry/irb
[22:29:02] eam: yeah, reject or drop for either scenario
[22:29:02] apeiros: riceandbeans: try and see what ruby tells you
[22:29:13] eam: apeiros: ipfw
[22:29:16] shellie: disabling wifi will make the connection timeout tho
[22:29:25] riceandbeans: apeiros: it didn't err out or anything just seems to have skipped it
[22:29:29] eam: and if you want to do things like latency or packetloss I believe dummynet runs on osx
[22:29:30] shellie: it will not simulate a 'closed' or 'dropped' connection
[22:29:34] apeiros: riceandbeans: then you're doing it wrong
[22:29:37] apeiros: >> nil < 5.1
[22:29:38] ruby[bot]: apeiros: # => undefined method `<' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/506093)
[22:29:47] apeiros: ^ quite definitely errors out
[22:29:50] xet7: has joined #ruby
[22:29:55] riceandbeans: apeiros: no no, but with gem::version
[22:30:06] apeiros: riceandbeans: uhm, yeah. be precise please.
[22:30:09] Ox0dea: norc: https://eval.in/506091
[22:30:10] riceandbeans: so instead of nil I need to set the values to 0?
[22:30:29] Ox0dea: eval.in kinda ruined the joke, though. :<
[22:30:40] apeiros: maybe? I don't know what Gem::Version.create creates with nil.
[22:30:44] newdan: riceandbeans: Depends on your application
[22:30:52] zambini: has joined #ruby
[22:31:02] norc: Ox0dea, wait.. am I supposed to be amazed?
[22:31:07] Ox0dea: norc: No, of course not.
[22:31:27] norc: apeiros, did some digging, looks like KisMAC could be able to do it.
[22:31:30] jbrhbr1: has joined #ruby
[22:31:31] 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?
[22:31:36] Ox0dea: I did try to find some more interesting way of doing it, though.
[22:31:56] Ox0dea: nymous: You're fine there on MRI.
[22:32:09] apeiros: eam: does osx run ipfw by default?
[22:32:17] norc: Ox0dea, my favourite code challenge is still the Grand C++ Error Explosion Competition.
[22:32:17] apeiros: ACTION reads up on hping
[22:32:29] eam: I thought so, but I haven't ever really done much under osx sooo
[22:32:52] apeiros: no ipfw around as it seems
[22:32:54] norc: Ox0dea, but I suppose having worked extensively in template heavy C++ projects I find it more amusing than others.
[22:33:02] apeiros: `which ipfw` turns up empty
[22:33:06] mg^: and I don't think pf is on by default
[22:33:30] jackjackdripper: has joined #ruby
[22:33:36] Ox0dea: norc: ~6 billion errors?!
[22:33:43] 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.
[22:33:44] eam: ah, it's pf?
[22:34:07] apeiros: norc: how'd I make the app drop the connection using hping?
[22:34:25] jaequery: has joined #ruby
[22:34:30] 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-
[22:34:30] norc: apeiros, do you need to transmit any traffic prior to dropping it?
[22:34:51] apeiros: norc: yes. the program is connected and has data sent to the target.
[22:34:59] 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
[22:35:04] apeiros: s/target/server/
[22:35:04] norc: apeiros, just send a FIN
[22:35:09] roller123: it'll be easier to view the complete error here https://github.com/rubber/rubber/issues/580
[22:35:27] 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.
[22:35:41] roller123: any ideas or workarounds for this ?
[22:36:09] ympeg: has joined #ruby
[22:36:11] apeiros: norc: so I send a FIN from my side, the remote server thinks I closed the connection and disconnects?
[22:36:12] jaequery: has joined #ruby
[22:36:33] norc: apeiros, not necessarily.
[22:36:38] craigp: has joined #ruby
[22:36:38] burgestrand: has joined #ruby
[22:36:41] eam: you can send yourself a FIN though
[22:36:50] 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.
[22:37:14] eam: it's probably easier to drop in a firewall rule though
[22:37:29] Scripore: has joined #ruby
[22:37:33] 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?
[22:37:40] norc: apeiros, absolutely.
[22:37:46] eam: if it was linux I could give you the one-line firewall rule :(
[22:37:53] apeiros: well then??? I'll just disable wifi then :)
[22:38:14] yfeldblum: has joined #ruby
[22:38:29] bnagy: that should work iff the target process sends more traffic
[22:38:40] eam: apeiros: blackhole route it
[22:38:47] dlitvak: has joined #ruby
[22:38:56] norc: eam, OSX firewall sucks to do anything with honestly.
[22:39:37] eam: sudo route add -host 1.2.3.4 127.0.0.1 -blackhole
[22:39:38] jaequery: has joined #ruby
[22:39:41] eam: apeiros: that oughta do it on osx
[22:40:37] bnagy: not sure that will make the client disconnect
[22:40:42] 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.
[22:40:43] eam: it'll drop traffic
[22:40:49] eam: easier than disabling wifi
[22:41:05] norc: apeiros, if you ever have the need to do anything with firewalls, just dont do it on OSX. :-)
[22:41:05] eam: (which also won't force a disconnect right away)
[22:41:10] bnagy: right but dropping traffic won't make the client disconnect right away
[22:41:15] eam: bnagy: agreed
[22:41:22] Mon_Ouie: has joined #ruby
[22:41:30] bnagy: -reject might work (looking at manpage)
[22:41:35] eam: I bet apeiros can't see us right now
[22:41:38] eam: his wifi is off
[22:41:48] norc: Hello Mon_Ouie.
[22:42:01] bnagy: you get an unreachable, that should make the tcp stack treat that as dead?
[22:42:09] jaequery: has joined #ruby
[22:42:12] eam: bnagy: upon the next transmission, if there is one
[22:42:12] apeiros: eam bets quite correctly :)
[22:42:25] apeiros: back right now.
[22:42:33] eam: apeiros: give that route trick a shot - selectively nuke network connectivity to addresses
[22:42:46] apeiros: eam: how'd I do that?
[22:42:52] bnagy: yeah, nothing much works without traffic being sent
[22:42:58] norc: apeiros, I also considered recommending you cut the cable - but then I realized the difficulty in doing that with WiFi...
[22:43:01] bnagy: except spoofing a RST from server
[22:43:12] 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
[22:43:14] apeiros: I did learn that Kernel.select([socket]) does not notice the disconnect of the wifi
[22:43:15] zenlot1: has joined #ruby
[22:43:20] eam: apeiros: correct
[22:43:30] norc: apeiros, no reason it should.
[22:43:42] eam: if you blackhole/drop traffic you will not notice until you transmit
[22:43:58] eam: if you're just holding the socket open it will sit that way forever
[22:44:06] eam: (unless you have tcp keepalives configured)
[22:44:32] apeiros: seems like a standard TCPSocket.open doesn't do that then
[22:44:42] Hammy_Work: has joined #ruby
[22:44:45] eam: it won't, it's a setsockopt()
[22:44:52] apeiros: (it's for ruby[bot] btw.)
[22:45:00] guacamole: has joined #ruby
[22:45:52] yqt: has joined #ruby
[22:46:13] apeiros: eam: how'd I undo that?
[22:46:18] eam: route delete
[22:46:18] apeiros: the blackholing
[22:47:04] sakix: has joined #ruby
[22:47:10] jaequery: has joined #ruby
[22:47:19] apeiros: the route isn't identified by anything? o0
[22:47:31] eam: oh, same args, just s/add/delete/
[22:47:54] 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
[22:48:32] apeiros: I could also send it to 192.168.0.<unused>?
[22:48:46] adaedra: sudo route add -discussion -offtopic
[22:48:46] eam: actually -blackhole might just drop it period
[22:49:22] djbkd: has joined #ruby
[22:49:56] bnagy: -reject >= -blackhole I think
[22:50:16] guacamole: has joined #ruby
[22:51:25] apeiros: thanks a lot to all who helped
[22:51:35] apeiros: I'll try out some of the suggestions tomorrow :)
[22:52:34] 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
[22:52:48] ledestin: has joined #ruby
[22:53:44] Scripore: has joined #ruby
[22:55:01] mondok: has joined #ruby
[22:56:07] Scripore: has joined #ruby
[22:58:52] chipotle: has joined #ruby
[22:58:53] edwinvdgraaf: has joined #ruby
[22:59:03] baweaver: has joined #ruby
[22:59:13] Limix: has joined #ruby
[22:59:43] zambini: has joined #ruby
[23:00:01] hayden_: has joined #ruby
[23:02:03] jgpawletko: has joined #ruby
[23:03:21] dfinninger: has joined #ruby
[23:03:34] zambini: has joined #ruby
[23:03:43] jbrhbr: has joined #ruby
[23:04:17] guacamole: has joined #ruby
[23:06:03] snowy: has joined #ruby
[23:06:08] user083: has joined #ruby
[23:06:30] 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
[23:06:46] Ox0dea: has joined #ruby
[23:08:12] mdw: has joined #ruby
[23:09:30] maletor_: has joined #ruby
[23:11:57] choke: has joined #ruby
[23:13:22] vikas027: has joined #ruby
[23:13:58] zambini: has joined #ruby
[23:14:47] dlitvak: has joined #ruby
[23:15:45] gizless: has joined #ruby
[23:15:47] bnagy: roller123: please stop spamming
[23:16:15] bnagy: people heard you. Nobody is answering because they don't know or they're not active
[23:16:31] roller123: sorry I'm new to IRC
[23:17:24] bnagy: np. Best bet is to hang around and idle. It can be hours before someone picks up a question
[23:17:47] 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)
[23:18:18] mikecmpbll: roller123: also probably better off asking in #rubyonrails seeing as rubber appears to be rails related
[23:18:26] mikecmpbll: but mention that you've crossposted with #ruby.
[23:18:34] jackjackdripper: has joined #ruby
[23:18:35] Radar: mikecmpbll: it's not Rails related.
[23:18:35] x77686d: has joined #ruby
[23:18:50] roller123: ok I'll try that
[23:18:57] mikecmpbll: i just read the summary on github which starts with "A capistrano/rails plugin"
[23:19:01] Radar: Filing a bug on the roller project was best thing
[23:19:11] Radar: uh, on the rubber project
[23:19:11] guacamole: has joined #ruby
[23:20:11] ajf-: has joined #ruby
[23:20:26] Radar: I'm _guessing_ it's a Ruby 2.3 thing but I can't be 100% sure.
[23:20:36] woodruffw: has joined #ruby
[23:20:42] cicloid: has joined #ruby
[23:21:36] woodruffw: has joined #ruby
[23:23:01] Radar: All tests pass on Ruby 2.3 for me locally, so I don't know.
[23:28:52] dudedudeman: has joined #ruby
[23:32:12] Darmani: has joined #ruby
[23:32:18] Darmani: Hey kids<3
[23:32:46] Radar: hey Darmani
[23:34:26] mostlybadfly: has joined #ruby
[23:37:47] maletor_: has joined #ruby
[23:38:16] framling: has joined #ruby
[23:38:45] 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.
[23:40:08] ascarter: has joined #ruby
[23:41:23] apeiros: vikas027: what now, a string or an array? ("2016-01-22" is a String)
[23:41:24] maletor_: has joined #ruby
[23:41:50] Ox0dea: >> require 'date'; Date.iso8601 '2016-01-22' # vikas027
[23:41:51] ruby[bot]: Ox0dea: # => #<Date: 2016-01-22 ((2457410j,0s,0n),+0s,2299161j)> (https://eval.in/506140)
[23:42:17] apeiros: ^ if it's actually a string
[23:43:04] ellisTAA: has joined #ruby
[23:43:26] vikas027: apeiros: When I check the class of the returned variable from DynamoDB, it shows as Array
[23:43:42] apeiros: vikas027: then show us what you've really got
[23:43:49] vikas027: Ox0dea: Thanks looking at this. Date.iso8601
[23:43:51] apeiros: because as said, "2016-01-22" ain't an array.
[23:44:04] apeiros: and if it's an array, Date.iso8601 won't help you either.
[23:44:11] 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?
[23:44:22] vikas027: apeiros: sure, gimme a minute
[23:44:35] hannelita: has joined #ruby
[23:44:55] speaking1ode: has joined #ruby
[23:45:16] shellie: has joined #ruby
[23:45:57] 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.
[23:45:58] edwinvdgraaf: has joined #ruby
[23:46:07] 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.
[23:46:11] baweaver: FSM probably isn't relevant, but the job might need it.
[23:46:44] Radar: ellistaa: A lot of my work at Spree was working on different FSMs to do with an ecommerce process.
[23:46:50] baweaver: apeiros: Interview: solve this FSM problem. Job: Use jQuery to put data into here
[23:47:09] apeiros: baweaver: unless your webapp has zero workflows that's not true
[23:47:10] ellisTAA: i guess ill read about em
[23:47:24] baweaver: ACTION doesn't really know about FSMs
[23:47:29] apeiros: baweaver: but granted, tons of programmers will just reinvent how an FSM works and usually poorly so
[23:47:41] Radar: ellistaa: look at the workflow gem. Should give you a good idea.
[23:47:48] baweaver: explain one to me like I'm 5
[23:47:54] baweaver: I probably have a few times.
[23:47:56] ellisTAA: radar: thanks i will
[23:48:05] apeiros: baweaver: if you've ever had a field "status" in an app, you probably should have used an FSM
[23:48:28] bklane: has joined #ruby
[23:48:30] Radar: If you've read Chapter 11 of Rails 4 in Action and gone through the examples you've used an FSM
[23:48:42] 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
[23:48:51] baweaver: I'll poke through it
[23:49:02] dfinninger: has joined #ruby
[23:49:05] baweaver: though I've done a lot with statuses and push/pull systems so probably.
[23:49:16] apeiros: vikas027: that's quite unspecific. you may want to actually show us your array.
[23:49:22] vikas027: apeiros: I can change the type or the date values there, if I can do the date comparison with the current date
[23:49:37] 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
[23:50:32] baweaver: ah, that. Yeah, I've done that a lot in process polling systems
[23:50:32] 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
[23:50:43] baweaver: Just didn't know it by name.
[23:51:11] baweaver: Ox0dea: any favorite references on state machines?
[23:51:13] yfeldblum: has joined #ruby
[23:51:28] Ox0dea: baweaver: Tom Stuart's "Understanding Computation" is the fun option.
[23:51:50] vikas027: apeiros: https://dpaste.de/4cA0 Pls have a look
[23:52:07] znz_jp: has joined #ruby
[23:52:11] apeiros: vikas027: don't use puts. use p.
[23:52:23] guacamole: has joined #ruby
[23:52:24] Radar: vikas027: Show us what my_hash is please
[23:52:25] apeiros: puts invokes to_s on whatever you pass to it, making inspection difficult.
[23:52:39] gbgdev: has joined #ruby
[23:53:15] Ox0dea: has joined #ruby
[23:54:46] vikas027: apeiros, Rader: https://dpaste.de/sD1P This is it
[23:54:50] edwinvdg_: has joined #ruby
[23:55:02] Radar: vikas027: So it's returning an array of hashes.
[23:55:23] apeiros: uh, yeah, map returns an array
[23:55:25] apeiros: not your field
[23:55:44] apeiros: hash['last_notified'] is a string.
[23:55:45] Ox0dea: has joined #ruby
[23:55:56] Radar: vikas027: notifications = @dynamo.notifications_info(github_user)
[23:56:02] Radar: vikas027: notification = notifications[0]
[23:56:06] apeiros: and it isn't 2016-01-22 either as you suggested, it's "22 Jan 2016". that's quite different.
[23:56:07] Radar: vikas027: notification['last_notified']
[23:56:10] bronson: has joined #ruby
[23:56:25] Radar: Use Date.strptime to parse the date.
[23:56:47] apeiros: >> require 'date'; Date.strptime("22 Jan 2016", "%d %b %Y")
[23:56:48] ruby[bot]: apeiros: # => #<Date: 2016-01-22 ((2457410j,0s,0n),+0s,2299161j)> (https://eval.in/506141)
[23:56:54] Encapsulation: has joined #ruby
[23:57:04] Radar: That's the one.
[23:57:21] apeiros: but since you said you can change the format used to store, I'd strongly suggest to use iso8601
[23:57:23] vikas027: apeiros: Ok Let me try
[23:57:27] apeiros: standards. they're nice.
[23:57:55] snowy: has joined #ruby
[23:58:01] Radar: https://xkcd.com/1179/
[23:59:18] apeiros: hm, I think I don't have deployed !xkcd yet???
[23:59:18] juddey: has joined #ruby
[23:59:25] Ox0dea: !xkcd 927
[23:59:28] Ox0dea: Worth a shot.
[23:59:31] apeiros: nope. I don't have :)
[23:59:43] apeiros: but I made it, just for you Ox0dea ;-)
[23:59:59] Ox0dea: apeiros: <3