« Back to channel list

#ruby - 22 September 2015

« Back 1 day Forward 1 day »
[00:00:33] tejasmanohar_: has joined #ruby
[00:00:34] blackmesa: has joined #ruby
[00:02:43] momomomomo: has joined #ruby
[00:03:53] Timba-as: has joined #ruby
[00:05:06] ruby-lang691: has joined #ruby
[00:05:52] nettoweb: has joined #ruby
[00:06:38] stardiviner: has joined #ruby
[00:06:50] wkoszek: shevy: Thanks man. Will check #rack. Wrt. middleman: I use it for my website https://circleci.com/gh/wkoszek/me/70, and I added 1 article the same way as always, and it is not picked up.
[00:07:32] otacon-: has joined #ruby
[00:07:48] ramfjord: has joined #ruby
[00:08:27] Musashi007: has joined #ruby
[00:08:45] wkoszek: So I did simple debugging: copied the content from YYYYMMDD-new-article-here.md to YYYYMMDD-existing-....md and it rendered OK.
[00:09:30] kidoz_: has joined #ruby
[00:09:33] wkoszek: (this eliminated my suspicionnthat I got frontmatter messed up). Then I copied existing article to a new file, changed the date in the frontmatter and it still doesn't render.
[00:10:14] Sembei: has joined #ruby
[00:11:03] neanderslob: has joined #ruby
[00:11:23] Alina-malina: has joined #ruby
[00:11:41] pepperbreath: has joined #ruby
[00:12:15] m4rCsi: has joined #ruby
[00:12:17] cantaberry: has joined #ruby
[00:12:43] Kricir: has joined #ruby
[00:12:58] tockitj: has joined #ruby
[00:14:10] Morrolan: has joined #ruby
[00:14:12] reprazent: has joined #ruby
[00:14:38] SCHAAP137: has joined #ruby
[00:15:00] devoldmx: has joined #ruby
[00:15:05] firoxer: has joined #ruby
[00:15:07] _djbkd: has joined #ruby
[00:15:28] phutchins: has joined #ruby
[00:15:39] newtonianb: has joined #ruby
[00:17:29] ruisantos: has joined #ruby
[00:17:38] jgt1: has joined #ruby
[00:17:43] chrisarcand: has joined #ruby
[00:19:58] Biohazard: has joined #ruby
[00:20:00] redlegion: has joined #ruby
[00:20:02] allcentury: has joined #ruby
[00:21:01] hfp_work: has joined #ruby
[00:21:29] edwardly: has joined #ruby
[00:21:29] edwardly: has joined #ruby
[00:22:23] CrazyEddy: has joined #ruby
[00:25:51] kloeri_: has joined #ruby
[00:26:06] bnagy: has joined #ruby
[00:26:29] ericjphillips: has joined #ruby
[00:28:06] yfeldblum: has joined #ruby
[00:28:31] jso: has joined #ruby
[00:28:48] inteq: has joined #ruby
[00:31:16] roxtrongo: has joined #ruby
[00:32:32] hfp_work: has joined #ruby
[00:33:19] Musashi007: has joined #ruby
[00:33:55] doublemalt_: has joined #ruby
[00:34:25] ckuhn: has joined #ruby
[00:35:44] casadei_: has joined #ruby
[00:37:05] ckuhn: baweaver: nvm what I said about Java earlier... lol just started working in it again. Hate it
[00:37:33] tkuchiki: has joined #ruby
[00:37:40] pwnd_nsfw: I'd probably only go as far as JRuby
[00:37:47] pwnd_nsfw: And thats' close enough to that fire...
[00:37:52] bigmac: has joined #ruby
[00:38:09] ckuhn: Java != JVM tho
[00:38:15] ckuhn: The problem is not the JVM
[00:38:32] baweaver: Scala is fine, Clojure is fine, JRuby I have no real experience with.
[00:38:38] baweaver: Frege is.... interesting
[00:39:32] Keil: has joined #ruby
[00:39:39] BlackCoyote: has joined #ruby
[00:39:47] ckuhn: not really familiar with Haskell... or functional programming
[00:39:55] tjbiddle: has joined #ruby
[00:41:08] barhum2013: has joined #ruby
[00:42:37] solocshaw: has joined #ruby
[00:43:35] shevy: ckuhn you must start to love java like people loved big brother in the novel 1984
[00:44:25] ckuhn: ACTION running away
[00:45:27] ckuhn: The only thing worse than Java is HTML/JS
[00:46:42] michael_mbp: has joined #ruby
[00:47:00] shevy: I don't like that javascript has a monopoly :(
[00:47:14] pwnd_nsfw: Do something about it
[00:47:38] michael_mbp: has joined #ruby
[00:48:16] sp4rrow: has joined #ruby
[00:50:25] shevy: yeah, I will single-handedly change the world
[00:50:33] freerobby: has joined #ruby
[00:50:47] ramfjord: java 8 has at least added a lot of good new features
[00:51:00] ramfjord: default method implementation on interfaces (mixins), lambdas
[00:51:14] ckuhn: Still sucks to write
[00:51:40] Ox0dea: ckuhn: I would wager more Java code has been auto-generated/tab-completed than hand-written.
[00:51:52] Ox0dea: By a sizeable margin, even.
[00:51:53] ramfjord: I think in my experience it's about 50-50
[00:52:08] Ox0dea: ramfjord: Sounds like you need a better IDE. :P
[00:52:12] ckuhn: Ox0dea: Agreed
[00:52:14] ramfjord: but the pros can probably autogenerate a lot more
[00:52:47] tkuchiki: has joined #ruby
[00:52:53] baweaver: If your language requires an IDE, something is horribly wrong
[00:52:54] ckuhn: My Java build setup is so fckd that I can't build it successfully outside of eclipse
[00:53:08] baweaver: IntelliJ tends to be a nicer editor
[00:53:43] bigmac: has joined #ruby
[00:54:07] infernix: has joined #ruby
[00:54:39] ramfjord: Yeah, I really miss my Gemfile.lock files in ivy
[00:55:03] ramfjord: configuring things to take the latest version is dangerous - every time you build it will update it
[00:55:09] shevy: ckuhn this has always scared me in java... that I need an IDE...
[00:55:17] ckuhn: baweaver: Except I can't change as of now lol
[00:55:27] ckuhn: shevy: ya it really sucks
[00:55:42] ckuhn: I have a entry level CS class that's in Java
[00:56:20] ellisTAA: has joined #ruby
[00:56:56] shevy: ewww so you must pass some java exam right
[00:57:20] ckuhn: shevy: probably. but im not an entry level java programmer
[00:57:33] Ox0dea: ckuhn: You should see what happens if you write your assignment in a JVM-backed language and just submit the disassemby.
[00:57:37] Ox0dea: *disassembly
[00:57:47] Ox0dea: Even better, run it through something that tries to reconstruct it into Java. :P
[00:57:53] ckuhn: Ox0dea: we have to submit eclipse projects. like wtf
[00:58:30] Ox0dea: That's not necessarily a deal-breaker.
[00:58:32] paradisaeidae: has joined #ruby
[00:58:58] swgillespie: has joined #ruby
[00:59:01] ckuhn: Will eclipse compile any other jvm languages otb?
[00:59:10] Ox0dea: I would imagine so.
[01:00:01] Ox0dea: Damn, it looks like not; are plugins strictly off-limits?
[01:00:04] ckuhn: Obviously with plugins but not sure about fresh install
[01:00:07] ckuhn: Yes probably
[01:00:15] Ox0dea: Probably strictly?
[01:00:22] ckuhn: I think im gonna ask if I can just be a TA
[01:00:33] ckuhn: Ya, no plugins
[01:00:37] Ox0dea: You want to read code instead of write it?
[01:00:42] ckuhn: Maybe I could submit binaries tho
[01:00:43] Ox0dea: Masochism.
[01:01:07] ckuhn: I like teaching people. so maybe
[01:01:34] bffff_: has joined #ruby
[01:02:17] Ox0dea: I also like teaching, but I've never been able to pinpoint precisely why.
[01:02:32] ckuhn: Agreed. Helps you learn better too
[01:03:01] Ox0dea: Well, it solidifies what you've already learned.
[01:03:11] ckuhn: Anyone else have that one IT guy that they hate?
[01:03:27] baweaver: It will, at least with Scala
[01:03:38] sphex: has joined #ruby
[01:04:05] Soda: has joined #ruby
[01:07:59] ckuhn: baweaver: How?
[01:09:49] workmad3: has joined #ruby
[01:10:30] momon: has joined #ruby
[01:11:43] evanjs: has joined #ruby
[01:11:57] howdoico1: has joined #ruby
[01:12:08] momon: has left #ruby: ()
[01:12:50] benlovell: has joined #ruby
[01:14:12] chris6131: has joined #ruby
[01:15:28] workmad3: has joined #ruby
[01:15:39] bigmac: has joined #ruby
[01:16:05] chris6131: Hi y'all. I've been using rjr to do RPC over websockets but have a service where I need to use TLS (wss://) which AFAICT the underlying em-websocket library does not support. Can anyone recomend an alternative RPC over websockets implementation I should try? Having trouble searching one out
[01:16:52] ckuhn: baweaver: no plugins
[01:17:53] bkulbida: has joined #ruby
[01:17:54] blackmesa: has joined #ruby
[01:19:05] jenrzzz: has joined #ruby
[01:19:06] sphex: has joined #ruby
[01:21:15] PaulCapestany: has joined #ruby
[01:22:51] Ox0dea: chris6131: https://github.com/igrigorik/em-websocket#secure-server
[01:23:05] chipotle: has joined #ruby
[01:23:42] PaulCapestany: has joined #ruby
[01:24:06] chris6131: Ox0dea: Well I'll be damned. Thank you and sorry for the silliness.
[01:24:09] chris6131: ACTION will try this immediately
[01:24:37] howdoicomputer: has joined #ruby
[01:25:06] ckuhn_: has joined #ruby
[01:25:55] solocshaw1: has joined #ruby
[01:27:14] howdoico1: has joined #ruby
[01:27:31] benlieb: has joined #ruby
[01:28:10] chris6131: Ox0dea: That is for accepting TLS connections. I'm concerned with this "At this time, the wss (WebSocket over SSL) protocol is not supported." (https://github.com/mwylde/em-websocket-client) I take back my silliness remark - it was LATE last night, but I was not hallucinating :)
[01:28:42] chris6131: em-websocket != em-websocket-client, though :P
[01:29:15] arescorpio: has joined #ruby
[01:30:11] Ox0dea: chris6131: Ah, that's unfortunate.
[01:30:45] Ox0dea: How about Faye?
[01:30:46] devoldmx: has joined #ruby
[01:30:53] chris6131: Yeah I was really liking rjr. If I can't find anything maybe I can just try adding it.
[01:31:11] chris6131: I saw Faye but it looks like I'd need something else to add the json-rpc unless I wanted to rewrite that
[01:31:22] chris6131: Thanks for the suggestions
[01:33:00] v0n: has joined #ruby
[01:34:01] gambl0re: has joined #ruby
[01:34:51] bmurt: has joined #ruby
[01:35:01] renderful: has joined #ruby
[01:35:38] weemsledeux: has joined #ruby
[01:36:29] Maletor: has joined #ruby
[01:36:33] NeverDie: has joined #ruby
[01:36:49] casadei_: has joined #ruby
[01:36:55] shevy: what ways exist to disable checks like: class Foo; end; puts 'it exists' if Object.const_defined? :Foo
[01:37:05] shevy: doing Foo = nil in irb afterwards does not seem to work
[01:37:43] toretore: what do you mean disable?
[01:37:48] toretore: make it return false?
[01:38:14] shevy: I guess to get completely rid of that constant
[01:38:18] toretore: remove_const
[01:38:58] shevy: oh yes... I tried Object.const_remove :D
[01:42:54] keen__: has joined #ruby
[01:43:31] jgt1: has joined #ruby
[01:44:59] Ox0dea: shevy: #const_{g,s}et led you astray! :/
[01:45:40] workmad3: has joined #ruby
[01:46:12] havenwood: has joined #ruby
[01:47:03] devbug: has joined #ruby
[01:47:07] evanjs: has joined #ruby
[01:47:43] j4cknewt: has joined #ruby
[01:48:31] mary5030: has joined #ruby
[01:48:57] EminenceHC: has joined #ruby
[01:49:28] Ox0dea: shevy: #const_remove won't actually destroy the class.
[01:50:57] Ox0dea: *#remove_const
[01:51:04] deject3d: has joined #ruby
[01:51:17] mary5030: has joined #ruby
[01:52:03] Ox0dea: https://eval.in/437058
[01:52:22] Ox0dea: I wonder how to completely destroy a class.
[01:52:44] mary5030_: has joined #ruby
[01:52:51] shevy: hidden in the deepness of ObjectSpace
[01:53:10] Ox0dea: https://github.com/banister/free
[01:53:40] mary5030: has joined #ruby
[01:55:50] mary5030_: has joined #ruby
[01:56:34] mary5030_: has joined #ruby
[01:57:11] Musashi007: has joined #ruby
[01:58:19] shevy: you like to tinker
[01:58:27] j4cknewt: has joined #ruby
[01:58:55] deject3d: has joined #ruby
[02:00:46] lubuntu: has joined #ruby
[02:00:54] mary5030: has joined #ruby
[02:01:41] banjara: has joined #ruby
[02:03:23] chills42: has joined #ruby
[02:04:44] rgb-one: has joined #ruby
[02:06:36] drewvanstone: has joined #ruby
[02:06:54] rgb-one: I would be grateful for you help with this problem: https://gist.github.com/rgb-one/6a97e96b9732c837c025
[02:07:58] mary5030: has joined #ruby
[02:08:15] zenguy_pc: has joined #ruby
[02:09:18] havenn: has joined #ruby
[02:10:01] rgb-one: Ox0dea: You available?
[02:11:50] j4cknewt: has joined #ruby
[02:13:51] shevy: why does the changelog https://github.com/ruby/ruby/blob/trunk/ChangeLog reach back to 2014 only?
[02:14:12] Feyn: has joined #ruby
[02:16:37] ddrmanxbxfr: has joined #ruby
[02:17:42] Ox0dea: shevy: Because there are other ChangeLogs in /doc.
[02:17:59] Ox0dea: rgb-one: You want to combine Hash#values_at, #reduce, and #product.
[02:18:56] nateberkopec: has joined #ruby
[02:20:42] roxtrongo: has joined #ruby
[02:20:56] Musashi007: has joined #ruby
[02:21:59] bigmac: has joined #ruby
[02:22:00] cbz: has joined #ruby
[02:22:01] cbz: has joined #ruby
[02:23:18] Ox0dea: >> foo = {a: 1, b: 2}; bar = %i[a b b a]; foo.values_at *bar # rgb-one
[02:23:19] ruboto: Ox0dea # => [1, 2, 2, 1] (https://eval.in/437062)
[02:26:22] drewvanstone: has joined #ruby
[02:27:54] j4cknewt_: has joined #ruby
[02:29:31] vipaca: has joined #ruby
[02:30:19] bmurt: has joined #ruby
[02:30:29] Ox0dea: rgb-one: Never mind about #reduce, though.
[02:31:07] rgb-one: Ox0dea: %i means integer?
[02:31:18] rgb-one: or is it symbols
[02:31:30] Ox0dea: >> %i[foo bar] # rgb-one
[02:31:31] ruboto: Ox0dea # => [:foo, :bar] (https://eval.in/437063)
[02:31:41] rgb-one: Si, the latter
[02:31:46] Ox0dea: For "intern".
[02:32:09] Ox0dea: >> 'foo'.to_sym == 'foo'.intern
[02:32:10] ruboto: Ox0dea # => true (https://eval.in/437064)
[02:32:46] Ox0dea: rgb-one: I do think something like %d for numeric arrays would be nice.
[02:33:32] rgb-one: Ox0dea: Yea
[02:33:35] casadei_: has joined #ruby
[02:33:57] Ox0dea: rgb-one: Have you got a solid hold on how #product works?
[02:35:09] rgb-one: Ox0dea: I have a basic understanding I think but would appreciate some more information
[02:36:43] cbz: has joined #ruby
[02:36:43] cbz: has joined #ruby
[02:36:47] rbennacer: has joined #ruby
[02:37:02] opensource_ninja: has joined #ruby
[02:39:33] Ox0dea: >> ([1,2,3] + [4,5,6]).size == 3 + 3
[02:40:02] ramfjord: has joined #ruby
[02:40:19] patronus: has joined #ruby
[02:40:25] ruboto: Ox0dea # => true (https://eval.in/437065)
[02:40:29] Ox0dea: >> ([1,2,3].product [4,5,6]).size == 3 * 3
[02:40:30] ruboto: Ox0dea # => true (https://eval.in/437066)
[02:40:53] Ox0dea: rgb-one: #product really is like "multiplication" for arrays.
[02:41:16] Ox0dea: The arguments are "distributed", as it were, over the receiver.
[02:42:26] sarlalian: has joined #ruby
[02:42:55] kith_: has joined #ruby
[02:44:03] swgillespie: has joined #ruby
[02:44:17] martinbjeldbak: has joined #ruby
[02:44:30] mkosaki: has joined #ruby
[02:44:56] davidcelis: has joined #ruby
[02:44:57] davidcelis: has joined #ruby
[02:44:59] KervyN: has joined #ruby
[02:45:06] sonne: has joined #ruby
[02:45:13] Ox0dea: rgb-one: A permutation is all of the ways to arrange a single array, and a product is all of the ways to "combine" one or more of them.
[02:46:17] lhz: has joined #ruby
[02:46:35] Meeh: has joined #ruby
[02:46:36] ledestin: has joined #ruby
[02:47:02] Ox0dea: rgb-one: The latter sounds like just the thing for your current problem, eh?
[02:47:46] karapetyan: has joined #ruby
[02:47:59] mooe: has joined #ruby
[02:49:58] skweek: has joined #ruby
[02:51:39] nofxx: has joined #ruby
[02:57:02] gambl0re: what is ruby's runtime environment?
[02:57:28] RobertBirnie: has joined #ruby
[02:58:33] tkuchiki: has joined #ruby
[02:59:33] Ox0dea: >> %w[b c].product(%w[a u], %w[d t]).map(&:join) # rgb-one
[02:59:34] ruboto: Ox0dea # => ["bad", "bat", "bud", "but", "cad", "cat", "cud", "cut"] (https://eval.in/437072)
[03:00:23] baweaver: has joined #ruby
[03:00:32] agent_white: has joined #ruby
[03:01:00] gener1c: has joined #ruby
[03:01:03] benlovell: has joined #ruby
[03:01:28] workmad3: has joined #ruby
[03:03:13] iamninja: has joined #ruby
[03:03:54] nofxx: gambl0re, REPL?
[03:04:18] nofxx: Ox0dea, yo!
[03:10:18] braincrash: has joined #ruby
[03:10:37] havenn: gambl0re: It depends on the implementation of Ruby. The reference implementation is YARV (Yet Another Ruby VM) or there's JRuby on the JVM or Rubinius with an LLVM-base JIT, etc.
[03:12:16] havenn: gambl0re: man irb
[03:12:34] havenn: (If you really don't know what irb is?)
[03:12:55] favadi: has joined #ruby
[03:14:11] gambl0re: nodejs is a run time environment for javscript?
[03:14:31] aghalarp: has joined #ruby
[03:14:43] havenn: gambl0re: So Ruby has multiple runtime environments. I mentioned some prominent ones above.
[03:14:56] beauby: has joined #ruby
[03:15:21] gambl0re: oh ok, i guess those werent the answers i was looking for
[03:15:28] j4cknewt: has joined #ruby
[03:15:47] havenn: gambl0re: So like the JRE (Java Runtime Environment).
[03:15:48] shevy: these are not the passports you are looking for *waves hand like a jedi*
[03:15:55] gambl0re: the guys in #web said that Ruby MRI was ruby's runtime environment..
[03:16:09] aghalarp: has joined #ruby
[03:16:12] gambl0re: https://en.wikipedia.org/wiki/Ruby_MRI
[03:16:19] shevy: matz ruby
[03:17:02] havenn: gambl0re: MRI (Matz' Ruby Interpreter) was back in the days of Ruby 1.8. Then with Ruby 1.9 Ruby got a VM (YARV).
[03:17:37] gambl0re: why is it called node + express and not javascirpt + express....why not YARU + Rails then?
[03:17:59] havenn: gambl0re: The meaning of MRI is foggy. But YARV is the CRuby's VM these days.
[03:18:15] havenn: People mean different things when they say MRI.
[03:18:33] gambl0re: so its more of a general term?
[03:18:49] yfeldblum: has joined #ruby
[03:19:10] havenn: gambl0re: It generally means CRuby or more specifically the historical interpreter from Ruby 1.8 and prior.
[03:19:48] vipaca: has joined #ruby
[03:19:57] tjbiddle: has joined #ruby
[03:20:14] gambl0re: oh ok thanks
[03:20:16] havenn: gambl0re: But with Java "Runtime Environment" is even in the name. So there there's no debating. :P
[03:20:38] havenn: gambl0re: And it's a first class citizen for Ruby.
[03:21:08] havenn: gambl0re: There are more than one ways to do it. :)
[03:23:27] yfeldblum: has joined #ruby
[03:23:44] djbkd: has joined #ruby
[03:23:58] polly_wog: has joined #ruby
[03:24:35] havenn: gambl0re: I agree with the person in #web. MRI is the reference implementation. Or more specifically YARV.
[03:25:06] darkf: has joined #ruby
[03:25:13] havenn: gambl0re: But we're lucky to have multiple production-ready Ruby environments.
[03:28:08] rgb-one: Ox0dea: >> hash = {a: "Aa@", b: "Bb8"}; leet = %[a b b a]; hash.values_at *leet
[03:28:30] michaeldeol: has joined #ruby
[03:28:40] rgb-one: >> hash = {a: "Aa@", b: "Bb8"}; leet = %[a b b a]; hash.values_at *leet
[03:28:41] ruboto: rgb-one # => [nil] (https://eval.in/437077)
[03:31:01] RobertBi_: has joined #ruby
[03:31:30] devoldmx: has joined #ruby
[03:31:44] havenn: gambl0re: https://en.wikipedia.org/wiki/YARV
[03:32:03] rgb-one: >> hash = {a: "Aa@", b: "Bb8"}; leet = %i[a b b a]; hash.values_at *leet
[03:32:04] ruboto: rgb-one # => ["Aa@", "Bb8", "Bb8", "Aa@"] (https://eval.in/437082)
[03:32:37] rgb-one: Ox0dea: is there a way to use product on that dataset?
[03:34:24] minimalism: has joined #ruby
[03:35:15] rgb-one: Ox0dea: Without having to specify them in the form %w"A a @".product(%w"B b 8", %w"B b 8", %w"A a @") where I have to explicitly set the arrays to combine
[03:35:20] gix: has joined #ruby
[03:36:36] Ox0dea: rgb-one: Of course there is.
[03:36:40] dima_: has joined #ruby
[03:36:46] Ox0dea: They're just values, after all.
[03:37:17] Ox0dea: rgb-one: Do you know how to go from "Aa@" to %w"A a @"?
[03:37:23] aghalarp: has joined #ruby
[03:37:33] rgb-one: Ox0dea: split("")
[03:37:48] Ox0dea: That'd do, but we have the #chars method to say the same thing slightly more meaningfully.
[03:39:23] SylarRuby: has joined #ruby
[03:40:24] rgb-one: >> "Aa@".chars
[03:40:25] ruboto: rgb-one # => ["A", "a", "@"] (https://eval.in/437094)
[03:40:37] EminenceHC: has joined #ruby
[03:40:43] jenrzzz: has joined #ruby
[03:40:53] dopie: has joined #ruby
[03:41:04] Ox0dea: rgb-one: So, do you know how to take the first element of an Array?
[03:41:11] jgpawletko: has joined #ruby
[03:41:22] sdfgsdfg: has joined #ruby
[03:42:20] rgb-one: >> s = "abvca".chars; s[0]
[03:42:21] ruboto: rgb-one # => "a" (https://eval.in/437095)
[03:42:31] Ox0dea: And how about to get all the rest?
[03:42:39] Ox0dea: That is, every element but the first.
[03:43:01] j4cknewt: has joined #ruby
[03:43:04] Ox0dea: You want to be able to say `first.product(and, the, rest)`.
[03:43:38] rgb-one: >> s = "abvca".chars; s.tail
[03:43:40] ruboto: rgb-one # => undefined method `tail' for ["a", "b", "v", "c", "a"]:Array (NoMethodError) ...check link for more (https://eval.in/437097)
[03:43:45] Ox0dea: If only. :/
[03:44:34] jgt1: has joined #ruby
[03:44:52] rgb-one: >> s = "abvca".chars; s.first
[03:44:53] ruboto: rgb-one # => "a" (https://eval.in/437098)
[03:44:57] arescorpio: has joined #ruby
[03:45:15] Ox0dea: There are many, many ways to skin the same cat in Ruby.
[03:45:58] ramfjord: has joined #ruby
[03:46:39] Ox0dea: rgb-one: `drop 1` is a pretty common way to spell `tail` in Ruby.
[03:46:51] j4cknewt_: has joined #ruby
[03:47:07] Ox0dea: >> foo = [1,2,3,4]; foo[1..-1] # Here's another spelling.
[03:47:08] ruboto: Ox0dea # => [2, 3, 4] (https://eval.in/437099)
[03:47:23] Ox0dea: >> first, *rest = [1,2,3,4]; [first, rest]; # And one more.
[03:47:24] ruboto: Ox0dea # => [1, [2, 3, 4]] (https://eval.in/437100)
[03:48:08] Technodrome: has joined #ruby
[03:48:21] Ox0dea: A slightly neater approach presents itself if you're interested in the first and the rest, and you don't mind mutating the receiver.
[03:49:15] Ox0dea: The #shift method is like #first, with the side effect that it actually removes the element from the Array before returning it.
[03:49:17] tejasmanohar: has joined #ruby
[03:49:46] j4cknewt_: has joined #ruby
[03:50:05] HAL2328: has joined #ruby
[03:50:47] pontiki: has joined #ruby
[03:58:27] mghaig: has joined #ruby
[03:59:01] wldcordeiro: has joined #ruby
[03:59:08] fedexo: has joined #ruby
[03:59:53] tkuchiki: has joined #ruby
[04:00:17] banister_: has joined #ruby
[04:00:50] tlolczyk: has joined #ruby
[04:01:05] deavid: has joined #ruby
[04:01:18] luckyme: has joined #ruby
[04:01:36] Wolland: has joined #ruby
[04:02:42] dseitz: has joined #ruby
[04:02:52] tlolczyk: I'm having trouble doing something. I want to take a string and create a new string. The old string will have a number in it. I want to replace the with a right justified version.
[04:03:25] Ox0dea: &ri String#rjust @tlolczyk
[04:03:25] `derpy: tlolczyk: http://www.rubydoc.info/stdlib/core/String#rjust-instance_method
[04:03:50] weemsledeux: has joined #ruby
[04:03:53] pontiki: i just asked about that last night, Ox0dea
[04:04:02] Ox0dea: Fancy that.
[04:04:13] pen: has joined #ruby
[04:04:14] favadi: has joined #ruby
[04:04:26] pontiki: who runs `derpy ?
[04:06:29] Ox0dea: >> '%*d' % [5, 42] # This is kinda nice too.
[04:06:30] ruboto: Ox0dea # => " 42" (https://eval.in/437101)
[04:09:50] jobewan: has joined #ruby
[04:09:52] bruno-: has joined #ruby
[04:10:48] rgb-one: >> hash = {a: "Aa@", b: "Bb8"}; acronym = "aabb"; leet = acronym.chars; x = hash.value at *leet; first, *rest = x; [first, rest]
[04:10:49] ruboto: rgb-one # => undefined method `at' for main:Object (NoMethodError) ...check link for more (https://eval.in/437102)
[04:11:00] rgb-one: >> hash = {a: "Aa@", b: "Bb8"}; acronym = "aabb"; leet = acronym.chars; x = hash.values_at *leet; first, *rest = x; [first, rest]
[04:11:01] ruboto: rgb-one # => [nil, [nil, nil, nil]] (https://eval.in/437103)
[04:11:39] tlolczyk: Example: I want in a program: to take the string "foo :appears in line 15 of x.txt" I'm assuming that "foo :" is already justified I want 15 justified on 4 characters.
[04:12:19] rgb-one: >> hash = {a: "Aa@", b: "Bb8"}; acronym = "aabb"; leet = acronym.chars; x = hash.values_at *leet; leet.map! {|y| y.to_sym}; first, *rest = x; [first, rest]
[04:12:21] ruboto: rgb-one # => [nil, [nil, nil, nil]] (https://eval.in/437104)
[04:12:49] rgb-one: >> hash = {a: "Aa@", b: "Bb8"}; acronym = "aabb"; leet = acronym.chars; leet.map! {|y| y.to_sym}; x = hash.values_at *leet; first, *rest = x; [first, rest]
[04:12:50] ruboto: rgb-one # => ["Aa@", ["Aa@", "Bb8", "Bb8"]] (https://eval.in/437105)
[04:12:57] pontiki: rgb-one: please use pry to experiment
[04:12:59] tlolczyk: Ox0dea, nope. See example above.
[04:13:08] pontiki: flooding the channel is a bit much
[04:13:30] rgb-one: pontiki: My apologies
[04:13:51] Technodrome: has joined #ruby
[04:16:19] braincra-: has joined #ruby
[04:18:14] nanoz: has joined #ruby
[04:19:06] Ox0dea: rgb-one: Looks like you've just about got it.
[04:19:24] rgb-one: Ox0dea: Not quite
[04:19:39] Ox0dea: "Just about", mind. :)
[04:20:10] Ox0dea: Better to just make your keys Strings instead of mapping, I think.
[04:20:13] banjara: has joined #ruby
[04:22:54] Ox0dea: rgb-one: Also, your values should be Arrays, since those're the things to which you'll be applying #product.
[04:22:56] bnizzle1: has joined #ruby
[04:23:09] rgb-one: Ox0dea: Yea
[04:23:24] Ox0dea: You *could* do all these conversions each time, but it's better to just do it the once up-front.
[04:24:02] rgb-one: hash = {a: ['A', 'a', '@'], b: ['B' ,'b', '8']}; acronym = "aabb"; leet = acronym.chars; leet.map! {|y| y.to_sym}; x = hash.values_at *leet; first, *rest = x; rest.split(",")
[04:24:06] rgb-one: is what I have so far
[04:24:34] Ox0dea: What's up with that #split?
[04:24:47] Ox0dea: Also, you've used %w to good effect elsewhere; why not here?
[04:25:31] rgb-one: rest is an array of arrays so I am trying to remove the first array so what will be remaining are the three sub arrays
[04:26:20] Ox0dea: rgb-one: That's why I told you about #shift earlier.
[04:26:28] amystephen: has joined #ruby
[04:27:07] Ox0dea: Sorry, disregard that.
[04:27:46] Ox0dea: #shift is just an alternative approach to `first, *rest = ` in this particular case.
[04:28:44] Ox0dea: rgb-one: `rest` is the Array of Arrays you want to use as the arguments to #product.
[04:29:07] rgb-one: Ox0dea: Yea
[04:29:30] cbz: has joined #ruby
[04:29:42] Ox0dea: rgb-one: Just one last piece to the puzzle, then: do you know about the splat operator?
[04:29:56] rgb-one: Ox0dea: No
[04:30:37] Ox0dea: >> def sum3(a, b, c); a + b + c; end; nums = [2, 17, 23]; foo *nums # rgb-one
[04:30:38] ruboto: Ox0dea # => undefined method `foo' for main:Object (NoMethodError) ...check link for more (https://eval.in/437107)
[04:30:44] Ox0dea: >> def sum3(a, b, c); a + b + c; end; nums = [2, 17, 23]; sum3 *nums # rgb-one
[04:30:45] ruboto: Ox0dea # => 42 (https://eval.in/437108)
[04:31:27] pontiki: up above, if rest is an Array, how can you apply .split to it?
[04:31:43] pen: has joined #ruby
[04:32:22] Ox0dea: rgb-one: See how #sum3 expects three separate arguments? I was able to use the elements of the Array as individual arguments with * (the splat operator).
[04:33:43] roxtrongo: has joined #ruby
[04:34:29] rgb-one: Ox0dea: :)
[04:34:34] Ox0dea: rgb-one: Did you win?!
[04:34:41] bb010g: has joined #ruby
[04:34:56] rgb-one: Ox0dea: Big time
[04:35:49] benlovell: has joined #ruby
[04:38:54] rgb-one: hash = {a: %w'A a @', b: %w'B b 8'}; acronym = "aabb"; leet = acronym.chars; leet.map! {|y| y.to_sym}; x = hash.values_at *leet; first, *rest = x; first.product(*rest).map(&:join)
[04:39:03] rgb-one: >> hash = {a: %w'A a @', b: %w'B b 8'}; acronym = "aabb"; leet = acronym.chars; leet.map! {|y| y.to_sym}; x = hash.values_at *leet; first, *rest = x; first.product(*rest).map(&:join)
[04:39:04] ruboto: rgb-one # => ["AABB", "AABb", "AAB8", "AAbB", "AAbb", "AAb8", "AA8B", "AA8b", "AA88", "AaBB", "AaBb", "AaB8", "Aa ...check link for more (https://eval.in/437110)
[04:39:13] Ox0dea: rgb-one: Looks good. <3
[04:39:35] rgb-one: Ox0dea: :D
[04:39:52] Ox0dea: Instead of extracting with `first, *rest`, you could just say `x.shift.product(x)`.
[04:39:57] Ox0dea: That's why I mentioned #shift earlier.
[04:40:11] Ox0dea: Mind that it mutates the receiver, of course, but that's exactly what you want here.
[04:40:48] rickmasta: has joined #ruby
[04:40:58] rgb-one: The reciever means the original array?
[04:41:02] Ox0dea: That's right.
[04:41:14] Ox0dea: The object on which you've called #shift.
[04:41:53] slackbotgz: has joined #ruby
[04:43:19] ellisTAA: has joined #ruby
[04:43:35] EminenceHC: has joined #ruby
[04:44:09] Kricir: has joined #ruby
[04:45:29] rgb-one: >> hash = {"a" => %w'A a @', "b" => %w'B b 8'}; acronym = "aab"; leet = acronym.chars; x = hash.values_at *leet; x.shift.product(*x)
[04:45:30] ruboto: rgb-one # => [["A", "A", "B"], ["A", "A", "b"], ["A", "A", "8"], ["A", "a", "B"], ["A", "a", "b"], ["A", "a", "8" ...check link for more (https://eval.in/437113)
[04:46:22] Ox0dea: xet7: Ah, whoops. I did forget to splat the `x` up there, didn't I? Good catch. :P
[04:46:37] pawnbox: has joined #ruby
[04:46:37] Ox0dea: rgb-one: ^
[04:46:41] rgb-one: Ox0dea: :)
[04:46:44] Ox0dea: Not sure how that happened.
[04:47:39] Ox0dea: rgb-one: But yeah, you can just `map(&:join)` those results, and that'll be the thing done.
[04:49:32] Rollabunna: has joined #ruby
[04:49:35] workmad3: has joined #ruby
[04:50:01] Ox0dea: And now we wait for you to try to run this thing on complete sentences.
[04:50:20] Ox0dea: Then again, I suppose that's why you switched to just leeting the initials. :P
[04:51:06] rgb-one: Ox0dea: Yea, the results would be quite a bit on full sentences
[04:53:21] diego1: has joined #ruby
[04:53:59] Ox0dea: rgb-one: Just generating every combination for practice, then, or are you up to some mischief?
[04:54:05] drewvanstone: has joined #ruby
[04:54:20] diego1: has joined #ruby
[04:55:09] rgb-one: Ox0dea: Both :)
[04:55:30] Ox0dea: rgb-one: Perfect. <3
[04:56:00] Narzew: has joined #ruby
[04:58:32] jobewan: has joined #ruby
[04:59:53] devoldmx: has joined #ruby
[05:03:54] wldcordeiro: has joined #ruby
[05:08:18] jackjackdripper: has joined #ruby
[05:10:05] howdoico1: has joined #ruby
[05:11:01] SOLDIERz: has joined #ruby
[05:11:11] jenrzzz: has joined #ruby
[05:11:30] Azure: has joined #ruby
[05:12:46] wldcordeiro: has joined #ruby
[05:13:36] sanjayu: has joined #ruby
[05:16:58] bigmac: has joined #ruby
[05:17:10] krz: has joined #ruby
[05:17:50] tangentstorm: has joined #ruby
[05:19:19] tangentstorm: i need to make my own version of someone else's gem so i can patch it. how do i do that, and get my rails app to see my custom version?
[05:19:44] tangentstorm: i mean where do i put it? i know what to change in the gem. :)
[05:21:15] dhjondoh: has joined #ruby
[05:21:15] asi_: has joined #ruby
[05:24:33] Ox0dea: tangentstorm: Are you sure you can't patch it "programmatically"?
[05:24:46] Ox0dea: Whoops. Those quotes should be on "patch".
[05:25:06] howdoi: has joined #ruby
[05:25:33] tangentstorm: you mean by opening the class? no. i tried that, but i may not have done it right.
[05:25:50] Ox0dea: I mean, that's one way, but prepending a Module would be better.
[05:26:27] Ox0dea: Are you able to be more specific about what you're trying to do?
[05:27:58] tangentstorm: i'm using opal-phaser in a rails app. it's a wrapper for a javascript game library, but i doesn't wrap one of the functions i need.
[05:29:25] Ox0dea: tangentstorm: Your thing isn't intended for public export, then?
[05:29:39] bluOxigen: has joined #ruby
[05:30:36] tangentstorm: this is what i tried: https://github.com/tangentstorm/tankgame/blob/phaser-patch/app/assets/javascripts/phaser-patch.js.rb
[05:30:44] tangentstorm: i'm not sure what that means, Ox0dea
[05:32:46] tangentstorm: okay, i know how to build local gems now. do i have to run the 'build' step every time i change it?
[05:33:46] dopamean_: has joined #ruby
[05:33:50] Ox0dea: tangentstorm: Not if you've got Bundler properly set up.
[05:34:33] karapetyan: has joined #ruby
[05:35:51] tangentstorm: ACTION experiments
[05:36:13] Ox0dea: tangentstorm: It seems you just need to remove the << on Line 11?
[05:36:23] Stalkr_: has joined #ruby
[05:37:01] tangentstorm: doesn't that let me re-open the existing class?
[05:37:05] Ox0dea: You're opening GameObjectFactory's singleton class.
[05:37:20] Ox0dea: Nix the << to reopen the class itself.
[05:37:20] codenapper: has joined #ruby
[05:37:27] Musashi007: has joined #ruby
[05:37:53] tangentstorm: and it won't replace the whole class?
[05:37:55] tangentstorm: ACTION tries it
[05:38:25] Ox0dea: That's why it's called "reopening" and not "redefining".
[05:38:58] tangentstorm: hrm. can you redefine it?
[05:39:07] tangentstorm: i come from a faraway land called #python. :)
[05:39:17] tangentstorm: your ways are strange to me. :)
[05:39:33] tangentstorm: (that worked, thank you!)
[05:40:07] Ox0dea: tangentstorm: Happy to have helped.
[05:40:16] Ox0dea: Are Python classes actually immutable?
[05:40:45] tangentstorm: no, but if you wanted to add / change a method you'd say ClassName.newMethod = whatever
[05:42:10] pawnbox: has joined #ruby
[05:43:29] Ox0dea: tangentstorm: Well, you can say `ClassName.define_method(:foo) { bar }` for something similar.
[05:43:40] Ox0dea: Of course, our lambdae aren't limited to a single expression. ^_^
[05:44:05] arup_r: has joined #ruby
[05:44:23] gener1c_: has joined #ruby
[05:44:30] roxtrongo: has joined #ruby
[05:44:55] tangentstorm: yeah, lambdas are the worst part of python.
[05:44:56] khebbie: has joined #ruby
[05:45:08] niemcu: has joined #ruby
[05:45:17] jgt1: has joined #ruby
[05:45:21] Ox0dea: And arguably the best part of Ruby.
[05:45:39] Ox0dea: Small wonder the journey can be so treacherous.
[05:49:50] banjara: has joined #ruby
[05:52:04] Timba-as: has joined #ruby
[05:54:29] deject3d: has joined #ruby
[05:54:41] sp4rrow: has joined #ruby
[05:54:57] kaliwanagan: has joined #ruby
[05:55:41] last_staff: has joined #ruby
[05:56:17] EminenceHC: has joined #ruby
[06:00:09] allomov: has joined #ruby
[06:01:31] schlubbi: has joined #ruby
[06:02:31] karapetyan: has joined #ruby
[06:03:31] Stalkr^: has joined #ruby
[06:03:46] Stalkr^: has joined #ruby
[06:04:19] rgb-one: Ox0dea: Thanks teacher, im off for now
[06:04:41] Ox0dea: rgb-one: My pleasure. :)
[06:05:11] Ox0dea: Now don't go forgettin' all these learnin's on a night's sleep.
[06:10:02] codecop: has joined #ruby
[06:10:40] culturelabs: has joined #ruby
[06:12:01] rgb-one: has left #ruby: ()
[06:12:19] yfeldblum: has joined #ruby
[06:12:39] emilkarl: has joined #ruby
[06:14:00] eGGsha: has joined #ruby
[06:15:06] yfeldblum: has joined #ruby
[06:17:40] pawnbox: has joined #ruby
[06:21:09] howdoico1: has joined #ruby
[06:22:35] beauby: has joined #ruby
[06:24:10] timonv: has joined #ruby
[06:26:18] weemsledeux: has joined #ruby
[06:29:44] pawnbox: has joined #ruby
[06:32:52] iateadonut: has joined #ruby
[06:33:57] RobertBirnie: has joined #ruby
[06:36:43] dhjondoh: has joined #ruby
[06:37:23] bigmac: has joined #ruby
[06:37:42] workmad3: has joined #ruby
[06:39:13] firstdayonthejob: has joined #ruby
[06:39:18] cbz: has joined #ruby
[06:39:21] pxlsinmotion: has joined #ruby
[06:42:52] wldcordeiro: has joined #ruby
[06:44:22] auzty: has joined #ruby
[06:44:59] solocshaw: has joined #ruby
[06:45:03] pxlsinmotion: has joined #ruby
[06:45:22] karapetyan: has joined #ruby
[06:45:30] solocshaw: has joined #ruby
[06:47:20] pxlsinmotion: has joined #ruby
[06:47:54] pxlsinmotion: can anyone help me with a regex to parse the key:value string: key:[[value_1, value_2],[value_3, value4]], 5:10:00AM
[06:48:32] jgt1: has joined #ruby
[06:48:51] blackmesa: has joined #ruby
[06:51:46] havenwood: has joined #ruby
[06:52:23] jenrzzz: has joined #ruby
[06:53:51] pxlsinmotion: can anyone help me with a regex to parse the key:value string: key:[[value_1, value_2],[value_3, value4]], 5:10:00AM
[06:54:16] pxlsinmotion: sorry didn't mean to send that a second time
[06:54:33] hs366: has joined #ruby
[06:54:42] karapetyan: has joined #ruby
[06:55:46] Stan: has joined #ruby
[06:56:53] Technodrome: has joined #ruby
[06:57:46] Juanchito: has joined #ruby
[06:59:42] Balzrael: has joined #ruby
[07:00:29] framling: has joined #ruby
[07:01:13] tkuchiki: has joined #ruby
[07:01:38] mondayrain: has joined #ruby
[07:01:58] VeryBewitching: has joined #ruby
[07:02:12] skullcrasher: has joined #ruby
[07:02:18] ta: has joined #ruby
[07:02:34] yfeldblum: has joined #ruby
[07:02:35] Timba-as: has joined #ruby
[07:02:53] solars: has joined #ruby
[07:03:33] karapetyan: what returns while loop in ruby? nil?
[07:04:55] nofxx: pxlsinmotion, you want only the array?
[07:06:12] wldcordeiro: has joined #ruby
[07:06:27] pxlsinmotion: i need to create a hash that would look something like {"key": [[value_1, value_2],[value_3, value4]], "5": '10:00AM'}
[07:07:27] Ox0dea: >> foo = while true; break 42; end; foo # karapetyan
[07:07:28] ruboto: Ox0dea # => 42 (https://eval.in/437154)
[07:07:51] pxlsinmotion: i assume regex is the best way to solve this. i've been attempting to use StringScanner and only put myself in a worse condition that i started i think lol
[07:08:16] baweaver: pxlsinmotion: ?xy
[07:08:24] baweaver: pxlsinmotion: !xy
[07:08:29] Ox0dea: ?xy pxlsinmotion
[07:08:29] ruboto: pxlsinmotion, it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[07:08:29] baweaver: come now ruboto
[07:08:48] havenwood: >> /(?<key>[^:]+):\[\[(?<value_1>[^,]+),\s(?<value_2>[^\]]+)\],\[(?<value_3>[^,]+),\s(?<value_4>[^\]]+)/ =~ 'pie:[[strawberr_rhubarb, cherry],[blackberry, key_lime]], 5:10:00AM'; {key => [value_1, value_2, value_3, value_4]}
[07:08:49] ruboto: havenwood # => {"pie"=>["strawberr_rhubarb", "cherry", "blackberry", "key_lime"]} (https://eval.in/437156)
[07:09:44] nofxx: pxlsinmotion, isn't that json?
[07:10:00] Ox0dea: JSON without quoted keys.
[07:10:01] apeiros: pxlsinmotion: https://github.com/apeiros/literal_parser
[07:10:35] cfloare: has joined #ruby
[07:10:41] Ox0dea: Elseways known as "the end of reason".
[07:10:57] apeiros: it doesn't handle your notation, but you should be able to use it as a starting point for your parser
[07:11:07] SCHAAP137: has joined #ruby
[07:11:13] duncannz: has joined #ruby
[07:11:16] apeiros: if you can change the serialization however, I'd strongly recommend that over rolling your own.
[07:12:06] psye: has joined #ruby
[07:12:15] pxlsinmotion: the problem i have is the text file i'm parsing is formated as above and when i try using JSON.parse it fails because the key 5 does not have the quotes around the time and causes the parser to fail
[07:12:37] Ox0dea: pxlsinmotion: Why doesn't it have quotes around it?
[07:13:26] psye: has joined #ruby
[07:14:29] pxlsinmotion: i wish i knew....client provided an export of the data and this is how it's formatted guessing whoever created the internal program they are using didn't think to wrap dates with quotes on export
[07:14:38] lxsameer: has joined #ruby
[07:14:48] apeiros: smack your client with a cluebat
[07:14:55] Ox0dea: pxlsinmotion: Do you know their current whereabouts?
[07:15:04] apeiros: tell them the cost difference between a custom rolled format and using a proper standard
[07:15:26] pxlsinmotion: trust me they are going to pay extra for me dealing with this insanity
[07:15:35] apeiros: on the other hand - you might just leave it as is and charge them for the hour :-D
[07:15:37] cgfbee: has joined #ruby
[07:15:55] karapetyan: should i define &block in method header? def hello(&block) as i understand it works without explicit definition block?
[07:16:16] apeiros: karapetyan: no, you should not. you only use &block when you have to either pass it on or store it somewhere.
[07:16:26] apeiros: in the other cases, you use yield & block_given?
[07:16:34] bayed: has joined #ruby
[07:16:41] Ox0dea: Or defined?(yield). ;)
[07:16:49] jas02: has joined #ruby
[07:16:55] Ox0dea: But not actually.
[07:18:20] MichaelJJackson: has joined #ruby
[07:18:29] Ox0dea: http://i.imgur.com/XQFf6kP.jpg
[07:18:32] pxlsinmotion: thanks for the help. after i find the developer that made my life hell today i'm going to brush up on my regex i find myself needing it more and more
[07:18:36] MichaelJJackson: hello little boys
[07:19:21] blackmesa: has joined #ruby
[07:19:29] apeiros: don't drop the baby!
[07:19:38] karapetyan: Ox0dea: is thx is not ok? :)
[07:20:49] Ox0dea: pxlsinmotion: What are value_1, &c.?
[07:21:28] baweaver: !mute MichaelJJackson
[07:21:29] ruboto: +q MichaelJJackson!*@*
[07:21:29] ruboto: -o ruboto
[07:21:47] drewvanstone: has joined #ruby
[07:21:53] Ox0dea: karapetyan: Are you kidding? It even has its own logo.
[07:21:55] pxlsinmotion: they are string values like first and last name
[07:26:17] weemsledeux: has joined #ruby
[07:26:24] Ox0dea: >> a, b, c = while true; break 1, 2, 3; end; a + b + c
[07:26:25] ruboto: Ox0dea # => 6 (https://eval.in/437159)
[07:26:43] Ox0dea: Re-realized, more likely.
[07:28:11] wldcordeiro: has joined #ruby
[07:28:30] Ox0dea: pxlsinmotion: In that case, StringScanner isn't the worst approach.
[07:29:00] bronson: has joined #ruby
[07:29:08] pawnbox: has joined #ruby
[07:29:15] scoot: has joined #ruby
[07:30:19] pxlsinmotion: Ox0dea: thanks i'll keep going down the StringScanner route to solve the problem. after typing out my problem i think i know how to solve it now
[07:30:43] Ox0dea: You could probably get away with just tokenizing on /\w+|[\[:\]]/ or some such, but then you're pretty much writing a parser for Lisp.
[07:31:02] apeiros: pxlsinmotion: you've seen my github link? might help as a starting point
[07:31:41] benlovell: has joined #ruby
[07:32:26] pxlsinmotion: aperiros: yeah i'm looking at the link for the LiteralParser now
[07:32:56] apeiros: ?tabnick pxlsinmotion
[07:32:56] ruboto: pxlsinmotion, pro-tip - use tab completion for nicks. avoids typos in nicks.
[07:33:11] apeiros: ACTION should have this auto-trigger???
[07:33:38] pxlsinmotion: ruboto: haha thanks...been a long time since i've used IRC
[07:33:50] baweaver: ruboto is a bot
[07:33:53] keen___: has joined #ruby
[07:33:54] dionysus69: has joined #ruby
[07:34:02] baweaver: really long time eh?
[07:34:08] pxlsinmotion: i think it's bed time lol
[07:34:21] apeiros: or caffeine-infusion time
[07:35:35] pxlsinmotion: but then i'll never go to bed its 12:30am already
[07:37:00] ankr: has joined #ruby
[07:37:04] beauby: has joined #ruby
[07:37:29] renderful: has joined #ruby
[07:40:22] jschmid: has joined #ruby
[07:43:21] DrCode: has joined #ruby
[07:43:24] HashNuke: has joined #ruby
[07:43:32] thesheff17: has joined #ruby
[07:43:37] alxndr: has joined #ruby
[07:43:40] MiracleBlue: has joined #ruby
[07:43:41] cstrahan: has joined #ruby
[07:43:42] tonini: has joined #ruby
[07:43:43] cardoni: has joined #ruby
[07:43:43] bjeanes: has joined #ruby
[07:43:44] bttf: has joined #ruby
[07:43:44] manveru: has joined #ruby
[07:43:49] dirtyonekanobi: has joined #ruby
[07:43:51] colstrom: has joined #ruby
[07:44:15] troter___: has joined #ruby
[07:44:15] rflot: has joined #ruby
[07:44:22] startupality: has joined #ruby
[07:44:45] zemmihates: has joined #ruby
[07:45:05] hellschreiber: has joined #ruby
[07:45:06] drewvanstone: has joined #ruby
[07:45:33] tjbiddle: has joined #ruby
[07:45:41] Technodrome: has joined #ruby
[07:45:47] varunwachaspati: has joined #ruby
[07:47:53] lancetw: has joined #ruby
[07:48:00] Juanchito: has joined #ruby
[07:48:21] maasha: has joined #ruby
[07:49:42] maasha: I am experiencing what appears to be a memory leak or a problem with GC. I am filtering huge amounts of strings using a hash lookup to pick candidates. Ruby 2.1.2p95
[07:50:01] maasha: Memory use exeeds 6Gb
[07:50:06] prosodyC: has joined #ruby
[07:50:16] tomphp: has joined #ruby
[07:50:27] maasha: The hash is build from an ascii table ~60M and the data is streamed.
[07:51:17] zipkid: has joined #ruby
[07:52:47] apeiros: wow, what's with that K-Line orgy?
[07:53:13] baweaver: probably blacklisted part of DO again by accident
[07:53:16] baweaver: they do that.
[07:53:23] tkuchiki: has joined #ruby
[07:53:26] apeiros: maasha: with such bugs it's advisable to start by upgrading to at least the newest patchlevel of the version you're using
[07:53:29] baweaver: maasha: upgrade to 2.2.x if possible, see if it still happens.
[07:53:39] baweaver: GC improvements were made.
[07:54:02] lipoqil: has joined #ruby
[07:54:13] maasha: yeah, I am compiling and reading what Sam Saffron has blogged on
[07:54:47] baweaver: fairly sure that was on 2.0.x, but I'd have to look
[07:54:54] baweaver: and now is most certainly time for bed.
[07:55:22] apeiros: n8 baweaver
[07:56:08] maasha: So I am also using Set and wonder if it may be better to use Google Hash where GC is disabled.
[07:56:09] skade: has joined #ruby
[08:01:18] wldcordeiro: has joined #ruby
[08:01:42] scoot: has joined #ruby
[08:02:03] bruno-: has joined #ruby
[08:02:17] hadrig: has joined #ruby
[08:02:27] anisha: has joined #ruby
[08:02:33] krainboltgreene: has joined #ruby
[08:03:05] Hounddog: has joined #ruby
[08:03:51] pawnbox: has joined #ruby
[08:04:02] startupality: has joined #ruby
[08:05:18] ndrei: has joined #ruby
[08:06:21] pecpec: has joined #ruby
[08:08:45] Hounddog: has joined #ruby
[08:09:11] blackmesa: has joined #ruby
[08:09:15] nanoz: has joined #ruby
[08:09:54] wldcordeiro: has joined #ruby
[08:11:08] michael_mbp: has joined #ruby
[08:11:16] SenpaiSilver: has joined #ruby
[08:11:51] maasha: Hm, Set is also 25% slower than Hash, really?
[08:13:32] blaxter: has joined #ruby
[08:14:08] devoldmx: has joined #ruby
[08:14:21] rdark: has joined #ruby
[08:17:11] Kendos-Kenlen: has joined #ruby
[08:19:08] michael_mbp: has joined #ruby
[08:19:09] apeiros: maasha: Set uses a Hash
[08:19:14] apeiros: so it's Hash performance + overhead
[08:19:17] Zai00: has joined #ruby
[08:19:27] maasha: apeiros: but that is a lot of overhead :o(
[08:20:15] maasha: apeiros: I would expect it could be optimized to run at the same speed as Hash?
[08:20:33] krisquigley: has joined #ruby
[08:20:37] apeiros: reimplement it in C using the Hash source
[08:21:04] maasha: apeiros: hm, wonder if that is a feature request @ rubylang?
[08:21:21] arup_r: has joined #ruby
[08:21:28] youngbaks: has joined #ruby
[08:21:30] apeiros: go ahead and implement it?
[08:21:44] TheHodge: has joined #ruby
[08:21:58] weemsledeux: has joined #ruby
[08:22:50] maasha: apeiros: I wonder if I could.
[08:22:51] beauby: has joined #ruby
[08:23:01] apeiros: you'll know once you tried :)
[08:23:18] dmolina: has joined #ruby
[08:23:35] maasha: apeiros: how wise
[08:25:45] workmad3: has joined #ruby
[08:26:28] merlinp: has joined #ruby
[08:28:01] maasha: apeiros: looking at the source in set.rb it looks sort of OK, until you get to SortedSet
[08:29:21] maasha: apeiros: of cause it is all ruby, and would benefit from using the C API
[08:32:17] hmnhf: has joined #ruby
[08:35:35] quazimodo: has joined #ruby
[08:36:39] hmnhf: has joined #ruby
[08:37:19] bigmac: has joined #ruby
[08:37:30] sectoral: has joined #ruby
[08:37:50] leafybasil: has joined #ruby
[08:38:20] solocshaw1: has joined #ruby
[08:39:40] andikr: has joined #ruby
[08:40:00] marr: has joined #ruby
[08:40:58] DoubleMalt: has joined #ruby
[08:41:04] hmnhf: has joined #ruby
[08:41:09] lele|w: has joined #ruby
[08:41:28] sectoral: afternoon in indo
[08:42:04] apeiros: ?ugt sectoral
[08:42:04] ruboto: sectoral, it's morning, see http://www.total-knowledge.com/~ilya/mips/ugt.html
[08:43:42] yottanami: has joined #ruby
[08:44:08] apeiros: moin yottanami
[08:44:17] yottanami: I want to use WSDL API as client I find Savon but it can not handle import wsdl
[08:44:41] yottanami: Is there any usefull option? Is it bad Idea to work with it useing Net::HTTP?
[08:44:48] apeiros: ?toolbox yottanami
[08:44:49] ruboto: yottanami, https://www.ruby-toolbox.com is a website which lists lots of gems, topically organized
[08:44:57] apeiros: maybe you find something there
[08:44:59] sectoral: has left #ruby: ()
[08:45:32] hmnhf: has joined #ruby
[08:45:39] yottanami: apeiros, I searched there but there is no active WSDL client project
[08:45:55] apeiros: yottanami: then maybe patch wsdl import support into savon
[08:46:10] beauby: has joined #ruby
[08:46:19] yottanami: apeiros, So you think using Net::HTTP is bad idea?
[08:46:58] apeiros: it depends
[08:47:44] apeiros: it depends on your requirements, your context
[08:48:16] yottanami: apeiros, I just needs to send an Parlay 2 XML and recieve an XML result to an API
[08:48:19] apeiros: I use hand-built clients for the SOAP APIs we serve. but mostly for two reasons: savon wasn't multi-tenancy capable back when I needed it, and many of the SOAP services we interact with have, lets say, bad wsdls
[08:48:21] codenapp_: has joined #ruby
[08:48:32] apeiros: so it's possible to do. but it can be annoying and a lot of work
[08:49:01] apeiros: whether it's more work to make savon do what you need or build a custom soap client depends on the specifics of your task.
[08:49:44] jishankai: has joined #ruby
[08:49:52] shredding: has joined #ruby
[08:50:47] hmnhf_: has joined #ruby
[08:53:49] beauby: has joined #ruby
[08:54:17] yottanami: apeiros, As I checked unstable version of Savon can support WSDL imports
[08:54:24] yottanami: Is it risky to use it?
[08:54:26] jishankai: has joined #ruby
[08:54:34] jishankai: has left #ruby: ()
[08:54:43] apeiros: yottanami: no idea
[08:55:05] leafybasil: has joined #ruby
[08:55:20] hmnhf__: has joined #ruby
[08:55:55] jgt1: has joined #ruby
[08:58:08] krz: has joined #ruby
[08:59:11] tkuchiki: has joined #ruby
[08:59:48] hmnhf: has joined #ruby
[08:59:55] codenapper: has joined #ruby
[09:01:45] yosafbridge: has joined #ruby
[09:01:53] ByronJohnson: has joined #ruby
[09:02:11] allomov: has joined #ruby
[09:03:08] Pupeno: has joined #ruby
[09:03:13] Pupeno: has joined #ruby
[09:03:20] platzhirsch: has joined #ruby
[09:04:51] hmnhf_: has joined #ruby
[09:05:40] einarj: has joined #ruby
[09:05:42] exadeci: has joined #ruby
[09:05:57] beauby: has joined #ruby
[09:06:03] yardenbar: has joined #ruby
[09:09:15] hmnhf_: has joined #ruby
[09:09:16] mikecmpbll: has joined #ruby
[09:09:35] mrityunjay: has joined #ruby
[09:10:30] subshad: has joined #ruby
[09:11:47] ndrei: has joined #ruby
[09:14:41] hmnhf__: has joined #ruby
[09:14:49] yottanami: I am trying to use Savon unstable version like this : client = Savon.client(wsdl: "URL")
[09:14:54] devoldmx: has joined #ruby
[09:14:58] yottanami: and I got this error NoMethodError: undefined method `client' for Savon:Class
[09:15:19] yottanami: But it works in stable version
[09:15:28] apeiros: yottanami: so the API changed
[09:15:39] voker57: has joined #ruby
[09:15:40] apeiros: generate the docs for your current version and see how it works there
[09:16:59] hmnhf__: has joined #ruby
[09:19:16] Igorshp: has joined #ruby
[09:20:11] jgt: has joined #ruby
[09:21:23] hmnhf__: has joined #ruby
[09:22:21] ELCALOR: has joined #ruby
[09:22:22] karapetyan: has joined #ruby
[09:25:44] hmnhf__: has joined #ruby
[09:25:53] c0m0: has joined #ruby
[09:29:15] shevy: long live ruby!
[09:30:08] hmnhf__: has joined #ruby
[09:34:16] dhjondoh: has joined #ruby
[09:35:39] hmnhf: has joined #ruby
[09:35:43] Gnomethrower: has joined #ruby
[09:35:58] Gnomethrower: has joined #ruby
[09:36:53] charliesome: has joined #ruby
[09:37:44] tbuehlmann: ... that shalt be king hereafter!
[09:38:05] tbuehlmann: wait, wrong play
[09:40:02] hadrig: has joined #ruby
[09:40:11] OrbitalKitten: has joined #ruby
[09:40:13] hmnhf_: has joined #ruby
[09:40:55] Gnomethr_: has joined #ruby
[09:42:01] suchness: has joined #ruby
[09:42:39] robinboening: has joined #ruby
[09:42:55] pontiki: has joined #ruby
[09:42:56] Gnomethrower: has joined #ruby
[09:44:41] hmnhf__: has joined #ruby
[09:45:22] stamina: has joined #ruby
[09:45:40] yottanami: I am trying to use Savon and I got this error client.operations NoMethodError: undefined method `element_children' for nil:NilClass from /home/.../wasabi-3.5.0/lib/wasabi/parser.rb:311:in `sections'
[09:45:54] yottanami: How should I fix it?
[09:46:02] cbednarski: has joined #ruby
[09:46:18] apipkin: has joined #ruby
[09:46:23] Kharma: has joined #ruby
[09:46:26] danzilio: has joined #ruby
[09:47:00] jpinnix______: has joined #ruby
[09:47:07] frode15243: has joined #ruby
[09:47:16] suchness: yottanami: You should vim /home/.../wasabi-3.5.0/lib/wasabi/parser.rb and look at line 311 for what would be nil.
[09:47:29] bffff_: has joined #ruby
[09:47:36] daxroc: has joined #ruby
[09:47:39] Eleeleth: has joined #ruby
[09:47:44] alekst_: has joined #ruby
[09:47:59] glowcoil: has joined #ruby
[09:48:19] dmoe: has joined #ruby
[09:48:24] knowtheory: has joined #ruby
[09:48:25] cbetta: has joined #ruby
[09:48:44] bayed: has joined #ruby
[09:48:54] jevs: has joined #ruby
[09:49:00] hmnhf__: has joined #ruby
[09:49:05] jxf: has joined #ruby
[09:49:09] bestie: has joined #ruby
[09:49:11] jmcc: has joined #ruby
[09:49:17] holsee_: has joined #ruby
[09:49:31] jlyndon: has joined #ruby
[09:49:40] mjc_: has joined #ruby
[09:49:47] frankS2: has joined #ruby
[09:50:17] mroth: has joined #ruby
[09:50:31] yottanami: suchness, Here is line 113 but I can not find out https://github.com/savonrb/wasabi/blob/master/lib/wasabi/parser.rb#L113
[09:51:04] nickfausnight: has joined #ruby
[09:51:25] akahn: has joined #ruby
[09:51:54] suchness: yottanami: Wrong line.
[09:51:58] dyleted: has joined #ruby
[09:52:05] andersh: has joined #ruby
[09:52:09] ckrailo: has joined #ruby
[09:52:24] zrl: has joined #ruby
[09:52:31] amitchellbullard: has joined #ruby
[09:52:33] im0b: has joined #ruby
[09:52:36] bove: has joined #ruby
[09:52:39] PhilK: has joined #ruby
[09:52:47] adambeynon: has joined #ruby
[09:52:48] jmhmccr: has joined #ruby
[09:52:49] gyre007: has joined #ruby
[09:52:50] culturelabs: has joined #ruby
[09:52:55] halfdan: has joined #ruby
[09:52:57] bjmllr: has joined #ruby
[09:52:59] suchness: yottanami: So not only have you not even attempted to look at this yourself in the first place, you don't even care enough to check the right line number?
[09:53:00] Guest85414______: has joined #ruby
[09:53:01] twodayslate: has joined #ruby
[09:53:07] bcavileer: has joined #ruby
[09:53:08] bryancp: has joined #ruby
[09:53:08] benlakey: has joined #ruby
[09:53:10] makufiru: has joined #ruby
[09:53:15] petems: has joined #ruby
[09:53:17] elliottcable: has joined #ruby
[09:53:19] lacrosse: has joined #ruby
[09:53:27] rfv: has joined #ruby
[09:53:28] avdi: has joined #ruby
[09:53:42] pfg: has joined #ruby
[09:54:00] keyvan: has joined #ruby
[09:54:05] nyandoge: has joined #ruby
[09:54:06] pmarreck: has joined #ruby
[09:54:12] pizzaops: has joined #ruby
[09:54:18] ggherdov: has joined #ruby
[09:54:22] bb010g: has joined #ruby
[09:54:31] vcoinminer: has joined #ruby
[09:54:32] deimos_: has joined #ruby
[09:54:40] chrisseaton: has joined #ruby
[09:54:48] schaary: has joined #ruby
[09:54:53] ArchRogem: has joined #ruby
[09:54:58] yottanami: suchness, I taged wrong number on github but I am reading the correct lines in local, it seams document.root is nill
[09:54:59] djbender: has joined #ruby
[09:55:07] calleerlandsson: has joined #ruby
[09:55:23] akitada: has joined #ruby
[09:55:23] suchness: yottanami: You just said you couldn't figure it out.
[09:55:27] charles81: has joined #ruby
[09:55:28] skmp: has joined #ruby
[09:55:33] AdamMeghji: has joined #ruby
[09:55:33] yottanami: suchness, https://github.com/savonrb/wasabi/blob/master/lib/wasabi/parser.rb#L312
[09:55:40] grubernaut: has joined #ruby
[09:55:41] zzak: has joined #ruby
[09:55:43] yottanami: I can not figure out why it is null
[09:55:46] jeregrine: has joined #ruby
[09:55:50] n1ftyn8_: has joined #ruby
[09:56:13] suchness: yottanami: That aside you're right, your document has no root.
[09:56:16] yo61: has joined #ruby
[09:56:32] codeitagile: has joined #ruby
[09:57:22] shelling__: has joined #ruby
[09:58:29] preyalone: has joined #ruby
[09:58:51] ramblinpeck: has joined #ruby
[09:58:54] spastorino: has joined #ruby
[09:58:55] mrsolow: has joined #ruby
[09:59:00] DukeDave: has joined #ruby
[10:00:09] jabreity: has joined #ruby
[10:00:22] yottanami: suchness, You mean it should be <head> in WSDL?
[10:00:29] beauby: has joined #ruby
[10:00:30] unop: has joined #ruby
[10:00:36] heidar: has joined #ruby
[10:00:37] jgt: has joined #ruby
[10:00:37] neektza: has joined #ruby
[10:01:07] machty: has joined #ruby
[10:01:38] neersighted: has joined #ruby
[10:01:50] armyriad: has joined #ruby
[10:02:34] charliesome: has joined #ruby
[10:02:37] Heero: has joined #ruby
[10:04:11] Oka: has joined #ruby
[10:04:58] howdoi: has joined #ruby
[10:04:58] iamdevnul: has joined #ruby
[10:05:43] countryHick: has joined #ruby
[10:05:47] Lloyd: has joined #ruby
[10:06:10] diego1: has joined #ruby
[10:06:28] diego1: has joined #ruby
[10:07:12] joaomdmoura: has joined #ruby
[10:07:43] mllkm4n: has joined #ruby
[10:12:31] robinboening: has joined #ruby
[10:12:48] drewvanstone: has joined #ruby
[10:13:42] bnizzle1: has left #ruby: ()
[10:13:52] workmad3: has joined #ruby
[10:15:58] devoldmx: has joined #ruby
[10:16:15] suchness: yottanami: I have no idea, I have never used Savon and I am not familiar with what it does.
[10:16:46] suchness: yottanami: You might look at what exactly the document object consists of, and what the root method called on it does.
[10:17:44] bigkevmcd: has joined #ruby
[10:20:03] yottanami: suchness, I think it is because it can not parse wsdl import. I find this https://github.com/savonrb/wasabi/issues/1
[10:20:13] yottanami: Should I have to use version3?
[10:20:21] rickmasta: has joined #ruby
[10:20:22] pawnbox: has joined #ruby
[10:21:16] Igorshp: has joined #ruby
[10:23:03] tkuchiki: has joined #ruby
[10:25:28] platzhirsch: apeiros: just thinking.. how you said the bijective_encode and bijective_decode is redundant in the code I linked yesterday
[10:25:49] platzhirsch: is it though? It gives out information that the method used is actually bijective, where else would you put that, except let's say docs
[10:27:43] chills42: has joined #ruby
[10:28:27] tvw: has joined #ruby
[10:28:40] sanjayu: has joined #ruby
[10:29:20] nettoweb: has joined #ruby
[10:33:39] shevy: what the hell is bijective, is this like .inject
[10:33:46] soc42: has joined #ruby
[10:35:39] crack_user: has joined #ruby
[10:36:26] apeiros: platzhirsch: encode implies it can be decoded and vice versa
[10:36:51] platzhirsch: shevy: mathematical term
[10:36:56] platzhirsch: means both directions
[10:37:48] apeiros: shevy: basically a function f(x) is bijective iff a function f'(y) exists for all x with x == f'(f(x))
[10:38:08] apeiros: or at least that's how I remember. been a while :D
[10:41:27] sdothum: has joined #ruby
[10:42:08] greenarrow: has joined #ruby
[10:45:04] lulzmachine: has joined #ruby
[10:46:55] favadi: has joined #ruby
[10:48:06] Rurik: has joined #ruby
[10:49:10] allcentury: has joined #ruby
[10:50:00] RobertBirnie: has joined #ruby
[10:50:16] phutchins: has joined #ruby
[10:51:12] tockitj: has joined #ruby
[10:53:23] rodfersou: has joined #ruby
[10:54:21] nateberkopec: has joined #ruby
[10:57:33] prestorium: has joined #ruby
[10:57:50] andikr: has joined #ruby
[10:59:25] sylvain31: has joined #ruby
[10:59:32] Rurik: has joined #ruby
[11:01:41] karapetyan: has joined #ruby
[11:02:02] sylvain31: Hi, I would like to unittest my ruby task in my Rakefile. What lib must I require in my ruby file which wrap my task's code into a class to have access to rake method over filesystem like rm
[11:02:37] sylvain31: I got: NoMethodError(<undefined method `rm' for RCommand:Class>)
[11:03:21] arup_r: Why `"09/24/2015 09:59".to_datetime.strftime("%m/%d/%Y %H:%M")` Invalidate error giving ?
[11:03:22] deject3d: has joined #ruby
[11:03:54] chills42: has joined #ruby
[11:04:04] adaedra: From where does this to_datetime comes from
[11:05:26] adaedra: Ah, rails.
[11:05:41] adaedra: Looks like it wants dd/mm/yyyy, and you have mm/dd/yyyy, arup_r
[11:06:17] schlubbi: has joined #ruby
[11:06:57] sylvain31: rake-10.4.2 may add
[11:07:32] juzmach: has left #ruby: ()
[11:09:16] tjbiddle: has joined #ruby
[11:10:11] arup_r: No. adaedra I have what I shown you
[11:10:26] mikecmpbll: has joined #ruby
[11:11:12] apeiros: and that would be why you don't use DateTime.parse (which backs String#to_datetime)
[11:11:56] apeiros: arup_r: yes, you have what you've shown. and that's mm/dd/yyyy - unless you're telling us that there's a month 24.
[11:12:12] dhjondoh: has joined #ruby
[11:12:28] adaedra: (Also known as the "America wtf"-format)
[11:12:51] apeiros: aka "who needs big- or little-endian?!?"
[11:13:44] karapetyan: i really don't understand difference between block.call and yield
[11:13:47] jenrzzz: has joined #ruby
[11:14:06] apeiros: karapetyan: one requires a variable (block) which references an object which responds to call
[11:14:17] apeiros: the other works with the block passed to the method
[11:14:50] arup_r: apeiros: You are right.. wrong paste. But actuall issue is "09/24/2015 09:59".to_datetime
[11:14:58] apeiros: there's no *functional* difference between `def foo(&b); b.call; end` and `def foo; yield; end`. it's a difference in performance.
[11:15:12] apeiros: arup_r: you may want to read what you just wrote.
[11:15:39] arup_r: dunno what you meant
[11:15:55] adaedra: arup_r: How is the 24th month called?
[11:15:58] certainty: apeiros: what's the performance difference?
[11:16:10] jeffreylevesque: has joined #ruby
[11:16:10] apeiros: certainty: no object allocated, no method call overhead
[11:16:15] ccooke: arup_r: the problem is that you are using the US date layout, with the day between month and year, while to_datetime uses the more common international format, and expects the month to be in the middle
[11:16:23] apeiros: certainty: oh, and no object GC'ed
[11:16:24] jeffreylevesque: whats the most used ruby linter?
[11:16:33] arup_r: adaedra: leave that part,, to_datetime don't accept the format I gave
[11:16:36] ccooke: to_datetime thinks that you want the 9th day of the 24th month
[11:16:45] arup_r: ccooke: U are right
[11:16:45] certainty: apeiros: ruby checks if a block yields and only then creates the proc, whereas an explicit argument is always allocated?
[11:16:46] but3k4: has joined #ruby
[11:16:56] adaedra: arup_r: because there are not 24 months in a year
[11:17:01] apeiros: certainty: it doesn't create a proc at all
[11:17:03] arup_r: ccooke: I need to format it first using strptime
[11:17:09] apeiros: certainty: it only creates one if you have def foo(&block)
[11:17:18] arup_r: then it will be done
[11:17:27] jhass: jeffreylevesque: rubocop I'm afraid
[11:17:28] apeiros: at that point the difference is only the method call vs. syntax (yield isn't a method)
[11:17:46] jeffreylevesque: rubocop or ruby-lint?
[11:17:58] jeffreylevesque: https://github.com/YorickPeterse/ruby-lint
[11:18:05] yorickpeterse: rubocop is more popular
[11:18:05] jeffreylevesque: which one is preferred?
[11:18:16] yorickpeterse: Both serve different purposes too
[11:18:17] certainty: apeiros: hmm! i didn't know that. Where can I read more about this? Do you have specific resources or will googling be fine?
[11:18:20] krz: has joined #ruby
[11:18:28] chills42: has joined #ruby
[11:18:30] certainty: i could check the ruby sources i guess
[11:18:32] yorickpeterse: jeffreylevesque: https://github.com/YorickPeterse/ruby-lint#ruby-lint-versus-rubocop
[11:18:52] aswen: has joined #ruby
[11:18:57] apeiros: certainty: I don't have any specific resources, sorry. last I've seen it discussed in detail was in some rails issue years ago.
[11:19:01] youngbaks: has joined #ruby
[11:19:19] certainty: apeiros: thanks. I'll do a search and dig deeper
[11:19:42] apeiros: certainty: and of course, this applies to MRI. any other implementation may not have that difference.
[11:19:51] Stan: has joined #ruby
[11:19:56] certainty: apeiros: yeah I assumed that
[11:20:03] jeffreylevesque: yorickpeterse: can i use rubocop to lint a Puppetfile, what's the syntax?
[11:20:28] yorickpeterse: No idea, I don't use rubocop
[11:20:29] jeffreylevesque: `rubocop Puppetfile`
[11:20:33] syath: has joined #ruby
[11:20:44] Rollabunna: has joined #ruby
[11:21:05] shevy: isn't a puppetfile just ruby code anyway
[11:21:07] karapetyan: has joined #ruby
[11:24:41] ruurd: has joined #ruby
[11:25:15] iateadonut: has joined #ruby
[11:25:39] schlubbi: has joined #ruby
[11:25:41] rikkipitt: has joined #ruby
[11:25:43] sylvain31: in Rakefile I can use filesytem method wrapper, like rm 'filename'. Do you know which lib is providing those method? If I would use such method outside of a Rakefile.
[11:26:11] y0da: has joined #ruby
[11:26:14] jhass: sylvain31: method(:rm).owner
[11:26:14] adaedra: It's in the stdlib
[11:26:35] workmad3: has joined #ruby
[11:27:15] pwnd_nsfw: has joined #ruby
[11:27:53] shevy: people know rakefiles but no longer core ruby :)
[11:28:43] arup_r: adaedra: saying myself.. :D
[11:29:29] suchness: yottanami: Maybe
[11:29:43] phutchins: has joined #ruby
[11:29:56] [k-: has joined #ruby
[11:30:27] karapetyan: has joined #ruby
[11:30:40] sylvain31: jhass, Rake::FileUtilsExt
[11:31:10] jhass: now check what that does
[11:31:45] ndrei: has joined #ruby
[11:31:50] jhass: http://www.rubydoc.info/gems/rake/Rake/FileUtilsExt
[11:32:18] jgt: has joined #ruby
[11:32:24] shevy: looks ugly
[11:32:26] certainty: apeiros: ok found a somewhat old thread, but it doesn't seem to have changed since then. I have no idea about the internal reification of methods in mri, but i can see that just calling some code which is probably really just a function call, costs less memory wise than haveing to instantiate/allocate a full proc object with all it needs
[11:33:04] karapetyan: has joined #ruby
[11:33:25] elperdut: has joined #ruby
[11:34:13] certainty: oh sorry s/methods/blocks/
[11:34:27] yorickpeterse: certainty: generally you just want to use `yield` without &block
[11:34:35] yorickpeterse: &block is useful when you want to pass the block to another method
[11:34:37] ldnunes: has joined #ruby
[11:34:43] certainty: yorickpeterse: yepp. sometimes i can't though. for example in recursive methods
[11:35:00] yorickpeterse: certainty: https://github.com/YorickPeterse/oga/blob/master/lib/oga/xpath/compiler.rb#L104-L106 for example
[11:35:08] robinboening: has joined #ruby
[11:35:16] bnizzle: has joined #ruby
[11:35:36] certainty: yepp thanks
[11:36:10] benlovell: has joined #ruby
[11:36:49] elperdut: has joined #ruby
[11:36:56] Rurik: has joined #ruby
[11:36:56] Rurik: has joined #ruby
[11:38:02] sylvain31: jhass, thanks no mention of rm yet. I must check further in the inheritance path, thanks for the hint
[11:40:42] [k-: Tempfile
[11:41:48] Xiti: has joined #ruby
[11:43:22] emilkarl: has joined #ruby
[11:44:52] benlovell: has joined #ruby
[11:46:06] startupality: has joined #ruby
[11:46:43] devoldmx: has joined #ruby
[11:47:07] shevy: damn... does autoload make it harder to check against runtime errors when something is unavailable?
[11:47:21] greenarrow: has joined #ruby
[11:47:30] shredding: has joined #ruby
[11:47:41] shevy: I suddenly get a LoadError from a line that in itself does not require anything
[11:48:01] adaedra: if you know how it works, no.
[11:48:07] yqt: has joined #ruby
[11:48:16] shevy: from precisely something like: autoload :Foo, 'foo'
[11:48:46] nateberkopec: has joined #ruby
[11:48:59] Klamber|ext: has joined #ruby
[11:49:06] karapetyan: has joined #ruby
[11:49:23] bruno-: has joined #ruby
[11:49:28] shevy: yeah... now I removed autoload, and the error message is different
[11:49:37] shevy: uninitialized constant Foo
[11:49:46] shevy: I should have listened to jhass
[11:52:09] tkuchiki: has joined #ruby
[11:52:14] Klamber|ext: Hey! I recently (24 hours ago) started learning a bit of Ruby for some custom stuff on Jekyll. Now when I loop over some array caontaining for example pages then I get the error "cant convert nil to string". This is understandable but when I use to_s every string is as it should be. Why is that ?
[11:52:50] jhass: what line was raising that?
[11:52:51] suchness: Klamber|ext: nil.to_s
[11:53:05] ulak: has joined #ruby
[11:53:10] cornerman: has joined #ruby
[11:53:28] Klamber|ext: suchness: What do you mean ?
[11:54:05] jhass: Klamber|ext: it's way easier to explain on your real code
[11:54:11] chouhoulis: has joined #ruby
[11:54:17] jgt: has joined #ruby
[11:54:18] terabytes: the var in nil... you don't can onvert nil to string
[11:54:31] Klamber|ext: Heh. :D What I'm saying is that the array element is not empty.. but it complains and to_s outputs the string inside that element.
[11:54:32] suchness: Klamber|ext: You would need to show your code. Presumably you are trying to use a method on the elements of the array that require the object to be a string. You also have a nil object in the array that is not a string, hence the error. When you call to_s on your nil, it turns it into a string.
[11:56:25] vondruch: zenspider, ping ... hi ... how about this? https://bugs.ruby-lang.org/issues/11540
[11:56:54] workmad3: has joined #ruby
[11:59:30] ndrei: has joined #ruby
[12:00:26] krz: has joined #ruby
[12:00:55] arian0n: has joined #ruby
[12:01:02] Klamber|ext: Ok. Here's the code: http://pastebin.com/z9QEp5YE
[12:01:02] ruboto: Klamber|ext, 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
[12:02:29] sylvain31: Thanks about FileUtils modules hint. I make it working, require 'fileutils' and also import method into current namespace with include FileUtils.
[12:02:42] Klamber|ext: https://gist.github.com/AkselMeola/adcd7850a1509830c58e
[12:04:10] Klamber|ext: I want to understand this in Ruby. When someting is nil in other languages it's usually really empty. Then this has to do something with "everything is object" mentality.
[12:05:19] krisquigley: has joined #ruby
[12:05:29] shevy: nil is an object too :)
[12:05:57] [k-: vondruch: zenspider is asleep
[12:06:14] shevy: you can assume for the most part to just treat nil as false
[12:06:31] vondruch: [k-, np ... i can wait for answer :)
[12:06:49] shevy: def initialize; @config = nil; load_config # may manipulate @config and set it to another value than nil
[12:07:21] shevy: btw if you append to a string, you could use << rather than output +=
[12:07:37] shevy: the += will create a new string object, << will just append to the existing string object
[12:08:36] [k-: i think Ruby is smarter in manipulating strings now
[12:08:46] futilegames: has joined #ruby
[12:08:47] [k-: i think Ruby actually shares the string
[12:08:51] [k-: am i right?
[12:09:07] andyrs: has joined #ruby
[12:09:42] Klamber|ext: shevy: goot to know..
[12:09:50] Salehi: has joined #ruby
[12:10:23] Klamber|ext: So yes, nil is an object, but how dows nil contain my string then ?
[12:10:31] jhass: Klamber|ext: so page.data["title"] may return nil
[12:10:56] nzst: has joined #ruby
[12:11:16] jhass: Klamber|ext: use this form which calls to_s for you: output << %(<li><a href="#{page.url}">s: #{page.data['title']}</a></li>)
[12:11:22] Klamber|ext: There are 7 elements in pages array, all are outputed. Where is the nil element ?
[12:11:24] JDiPierro: has joined #ruby
[12:11:37] sgambino: has joined #ruby
[12:11:56] lkba: has joined #ruby
[12:11:57] jhass: try output << %(<li><a href="#{page.url}">s: #{page.data['title'] || "TITLE IS NIL!"}</a></li>)
[12:12:10] Klamber|ext: jhass: I have..
[12:12:21] Klamber|ext: With ifs and elses and with OR operator.
[12:12:41] Klamber|ext: It tests for nil never come true.
[12:13:01] jhass: the version you showed works and removing to_s does not, then your testing was flawed, sorry
[12:14:25] jhass: Klamber|ext: you can built your pages array like this btw: site.pages.select {|page| current_page["category"] == page.data["category" }
[12:14:34] jhass: pages = ...
[12:15:17] Klamber|ext: jhass: I will look into those Ryby style stuff later on. I started using it last night.
[12:16:03] pecpec: has joined #ruby
[12:16:28] Klamber|ext: What I now whant to understand is how does array element be nil and also contain my string. But testing it for nil never comes true.
[12:16:38] shevy: if it is nil
[12:16:41] shevy: it is not your string
[12:16:50] krisquigley: has joined #ruby
[12:16:50] pecpec_: has joined #ruby
[12:16:54] apeiros: Klamber|ext: it can't.
[12:16:54] roxtrongo: has joined #ruby
[12:17:00] lkba_: has joined #ruby
[12:17:46] shevy: the [] are method calls too, page.data['some_key']; if page is nil, or page.data is nil, or if page.data['this_key_does_not_exist'], may all give you nil
[12:17:57] charliesome: has joined #ruby
[12:18:03] Klamber|ext: From 7 elements all 7 are outputed. If there would be an empty element there should be 8 or more leemnts in array then. array.length gives me 7.
[12:18:31] shevy: btw nil.to_s will give you '' # empty string
[12:18:46] SylarRuby: has joined #ruby
[12:18:50] Klamber|ext: But no empty string is outputed.
[12:18:58] Klamber|ext: There is no empty string.
[12:19:35] Klamber|ext: Forgive me for being such a whiny cunt but that is just suprising to me right now.
[12:19:44] Xiti: has joined #ruby
[12:19:49] last_staff: has joined #ruby
[12:19:50] shevy: .length will return the amount of elements you have there
[12:19:55] jhass: it's impossible and that's all we can say from the information you have given
[12:20:01] shevy: >> [nil, nil, ''].length
[12:20:02] ruboto: shevy # => 3 (https://eval.in/437402)
[12:20:24] Klamber|ext: I understand what length does.
[12:20:42] pontiki: has joined #ruby
[12:20:45] shevy: I am not so sure ;-)
[12:20:57] [k-: an empty string does not add any characters to the screen
[12:20:58] Klamber|ext: shevy: Ruby is not my first language.
[12:21:14] [k-: maybe a newline with puts
[12:21:22] shevy: yeah but other languages have nil/null/0 so
[12:22:25] shevy: jhass what do you think of this proposal here: https://bugs.ruby-lang.org/issues/11537
[12:22:36] Klamber|ext: Ok. If you say my tests were flawd. How do i actually test for nil ?
[12:22:44] Klamber|ext: I'll test it again.
[12:23:10] [k-: >> [1.nil?, nil.nil?]
[12:23:11] ruboto: [k- # => [false, true] (https://eval.in/437403)
[12:23:46] quazimodo: has joined #ruby
[12:23:50] [k-: >> [1,2,3,nil,4].compact.length
[12:23:51] ruboto: [k- # => 4 (https://eval.in/437404)
[12:24:01] [k-: see, the array lost 1 element
[12:24:06] cball: has joined #ruby
[12:24:11] jhass: Klamber|ext: again, you never confirmed the assumptions I posed above, but if the version you showed works and removing the to_s breaks it again, the last version I gave must return "TITLE IS NIL!" somewhere
[12:24:41] greenarrow: has joined #ruby
[12:25:43] decoponio: has joined #ruby
[12:26:12] Jardayn: has joined #ruby
[12:26:30] jhass: shevy: I think that was proposed a couple of times already
[12:27:12] shevy: yeah but the syntax suggestion seemed new... u.?profile.?thumbnails.?large
[12:27:16] shevy: really weird to my eyes
[12:27:27] phutchins2: has joined #ruby
[12:27:35] shevy: I hope I will be able to append ? too so that I can have u.?profile?.?thumbnails?.?large?
[12:27:48] shevy: I am sure [k- and Ox0dea will make heavy use of it
[12:28:01] [k-: that is horrible
[12:28:03] [k-: i reject.
[12:28:17] [k-: it would break my ternaries
[12:28:29] shevy: could you not combine them?
[12:28:39] [k-: true?false.istripledog:tripleno
[12:28:39] shevy: u.?profile?.?thumbnails?.?large? ? method1? : method2?
[12:28:51] centrx: has joined #ruby
[12:29:01] [k-: im talking about non significant whitespace here
[12:29:14] [k-: how dare you suggest a breaking change!
[12:29:19] kirun: has joined #ruby
[12:29:26] shevy: hey I did not suggest that syntax!
[12:29:29] apeiros: [k-: in what situation is a . valid in front of ? from ternary now?
[12:29:47] devoldmx: has joined #ruby
[12:30:31] but3k4: has joined #ruby
[12:30:38] shinnya: has joined #ruby
[12:30:42] OrbitalKitten: has joined #ruby
[12:30:58] [k-: is there a dot before a question mark?
[12:31:17] jmignault: has joined #ruby
[12:31:53] apeiros: ok, let me rephrase: which expression which is now valid would work differently with .? being a thing?
[12:32:11] bronson: has joined #ruby
[12:32:20] shevy: I want a method called .
[12:32:31] Klamber|ext: jhass: SO now i have tested both ways: Your example using || operator never returns "Title is nil" but when I test it with .inil? in a IF before outputing then there is no error but the .nil? (true) instrunction also never executes. So what ever I do on nil case it's not executed.
[12:33:13] jhass: that sounds rather unlikely
[12:33:24] Klamber|ext: I'll show you my code..
[12:33:27] apeiros: probably missing that they're doing another method call
[12:33:31] apeiros: yes please :)
[12:33:35] jhass: yeah, can you make a runnable github repo or so?
[12:33:44] yosafbridge: has joined #ruby
[12:33:45] shevy: code that shows the error!
[12:34:02] [k-: shevy, you can . in Ruby
[12:34:20] Klamber|ext: This is a jekyll module so I would probably have to make a jekyll site ?
[12:34:30] roxtrongo: has joined #ruby
[12:34:43] jhass: whatever you do to produce your error, I want to be able to do the same
[12:35:14] [k-: >> class Foo; def call(*args); args; end end; Foo.new.("hi", "shevy")
[12:35:15] ruboto: [k- # => ["hi", "shevy"] (https://eval.in/437407)
[12:35:26] [k-: notice the last part
[12:35:27] jhass: I think this is beyond staring upon it, gotta throw a debugger into it
[12:35:37] bigkevmcd: has joined #ruby
[12:35:55] elperdut: has joined #ruby
[12:36:10] rickmasta: has joined #ruby
[12:36:12] moeabdol1: has joined #ruby
[12:37:25] bigmac: has joined #ruby
[12:37:25] elperdut: has joined #ruby
[12:37:40] allcentury: has joined #ruby
[12:38:25] skweek: has joined #ruby
[12:38:39] chris6131: has joined #ruby
[12:38:58] [k-: don't you hmmm me!
[12:38:59] Olipro: has joined #ruby
[12:39:56] ArnaudM: has joined #ruby
[12:40:09] Macaveli: has joined #ruby
[12:40:14] Rurik: has left #ruby: ("Leaving")
[12:40:17] ArnaudM: Hey I can't join #rails
[12:40:21] ArnaudM: any idea about that ?
[12:40:28] ruboto: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[12:40:35] ArnaudM: damned thx
[12:40:39] Musashi007: has joined #ruby
[12:41:11] shevy: ruboto is like the bot in Interstellar
[12:41:36] shevy: https://38.media.tumblr.com/5afd21f87a035e7bf09e9dac175cb5ab/tumblr_neuhpt0Cgq1qc31upo2_400.gif
[12:42:05] karapetyan: has joined #ruby
[12:42:36] OrbitalKitten: has joined #ruby
[12:43:24] charliesome: has joined #ruby
[12:43:46] shevy: but in shiny red :>
[12:44:18] IceyEC: has joined #ruby
[12:44:40] certainty: worth a try xD
[12:46:43] [k-: that is a valid String
[12:46:49] ruboto: [k- # => "?" (https://eval.in/437414)
[12:48:32] yottanami: has joined #ruby
[12:48:45] sepp2k: has joined #ruby
[12:48:58] SOLDIERz_: has joined #ruby
[12:49:20] karapetyan: has joined #ruby
[12:49:36] bigmac: has joined #ruby
[12:50:05] sgambino: has joined #ruby
[12:51:07] startupality: has joined #ruby
[12:51:48] jgt: has joined #ruby
[12:52:02] favadi: has joined #ruby
[12:52:56] shevy: the ?? is a string
[12:53:04] shevy: I would not have noticed that with my eyes alone
[12:53:29] malconis: has joined #ruby
[12:54:18] malconis: has joined #ruby
[12:55:06] shevy: certainty wish me luck
[12:55:17] certainty: shevy: what for?
[12:55:24] shevy: I have to generate a dump from a .cgi file, into .html, into .pdf
[12:55:25] ruboto: certainty # => "a" (https://eval.in/437415)
[12:55:35] IceyEC: has joined #ruby
[12:55:39] certainty: shevy: good luck!
[12:55:42] shevy: yeah but that was less surprising strangely enough
[12:55:47] chouhoulis: has joined #ruby
[12:55:47] shevy: since there was another character
[12:55:52] ruboto: shevy # => "!" (https://eval.in/437416)
[12:56:30] [k-: ruby can do anything
[12:57:03] [k-: >> [?$, ????, ????, ????, ?/, ?\]
[12:57:04] ruboto: [k- # => /tmp/execpad-e289d4eb3807/source-e289d4eb3807:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/437417)
[12:57:43] certainty: ?\] is the problem
[12:57:48] [k-: [?$, ????, ????, ????, ?/, ?,]
[12:58:00] [k-: >> [?$, ????, ????, ????, ?/, ?,]
[12:58:01] ruboto: [k- # => ["$", "???", "???", "???", "/", ","] (https://eval.in/437418)
[12:58:27] certainty: >> [?$, ????, ????, ????, ?/, ?\ ]
[12:58:28] ruboto: certainty # => ["$", "???", "???", "???", "/", " "] (https://eval.in/437419)
[12:58:35] certainty: the parser chokes on that one
[12:58:37] CloCkWeRX: has joined #ruby
[12:59:01] ruboto: jhass # => ["\\"] (https://eval.in/437420)
[12:59:25] s00pcan: has joined #ruby
[13:00:16] tkuchiki: has joined #ruby
[13:02:25] p0wn3d__: has joined #ruby
[13:06:23] OrbitalKitten: has joined #ruby
[13:07:05] bruno-: has joined #ruby
[13:07:07] mprelude: has joined #ruby
[13:07:34] User458764: has joined #ruby
[13:09:22] devoldmx: has joined #ruby
[13:09:28] amystephen: has joined #ruby
[13:10:12] tkuchiki: has joined #ruby
[13:10:59] JCOE: has joined #ruby
[13:11:24] ebragaparah: has joined #ruby
[13:12:11] sharkman: has joined #ruby
[13:12:21] favadi: has joined #ruby
[13:12:24] ebragaparah: has joined #ruby
[13:12:58] DmitryBochkarev: has joined #ruby
[13:13:08] jgt: has joined #ruby
[13:14:10] JoshL: has joined #ruby
[13:14:13] bmurt: has joined #ruby
[13:14:33] tkuchiki: has joined #ruby
[13:15:31] [k-: your face is ewww!
[13:15:36] workmad3: has joined #ruby
[13:16:07] gremly: has joined #ruby
[13:17:21] kirun_: has joined #ruby
[13:18:48] niro: has joined #ruby
[13:21:13] nettoweb: has joined #ruby
[13:21:23] bruno-: has joined #ruby
[13:21:34] evanjs: has joined #ruby
[13:22:19] rikkipitt: has joined #ruby
[13:23:12] benlovell: has joined #ruby
[13:23:31] tjbiddle: has joined #ruby
[13:23:38] IceyEC: has joined #ruby
[13:25:01] jeffreylevesque: has joined #ruby
[13:25:58] whippythellama: has joined #ruby
[13:28:20] mary5030: has joined #ruby
[13:29:34] mary5030: has joined #ruby
[13:30:49] suchness: has joined #ruby
[13:31:19] bkulbida: has joined #ruby
[13:31:41] casadei_: has joined #ruby
[13:32:59] mrrobot_: has joined #ruby
[13:33:19] mrrobot_: Hi. Can someone explain what symbols are in Ruby in the simplest way possible?
[13:34:48] [k-: strings that save memory (from repetition)
[13:34:51] Kendos-Kenlen_: has joined #ruby
[13:34:59] [k-: basically, immutable strings
[13:35:42] mrrobot_: [k-: Why are they used in hashes?
[13:35:45] ta: has joined #ruby
[13:36:45] emilkarl: has joined #ruby
[13:37:09] yorickpeterse: mrrobot_: because Hash keys often re-occur
[13:37:18] yorickpeterse: it's also a tad shorter to type
[13:38:04] mrrobot_: yorickpeterse: So a symbol is basically like an integer but it's a string?
[13:38:23] Ropeney: has joined #ruby
[13:38:35] lidenbrock: has joined #ruby
[13:38:36] iamninja: has joined #ruby
[13:38:54] spcmastertim: has joined #ruby
[13:39:18] Sou|cutter: also it's bad to mutate a hash key, at least if it changes its hash
[13:39:26] jeffreylevesque_: has joined #ruby
[13:39:28] yorickpeterse: mrrobot_: that's a with like comparing apples and pears
[13:39:36] victortyau: has joined #ruby
[13:39:48] yorickpeterse: Symbols are immutable strings of which the memory is not freed prior to 2.2.0
[13:39:56] renderful: has joined #ruby
[13:40:04] yorickpeterse: Even starting with 2.2.0 the memory of some symbols may be freed
[13:40:40] sanguisdex: has joined #ruby
[13:40:49] sanguisdex: has left #ruby: ()
[13:40:50] emilkarl: has joined #ruby
[13:41:07] chris6131: has joined #ruby
[13:41:07] [k-: it might be worthy to mention that this was done because people were carrying out dos attacks on ruby servers by exploiting the creation of symbols
[13:41:10] mrrobot_: yorickpeterse: So if I have a hash with a key of :sample_key, there's only 1 of this key in memory regardless of how many times it's mentioned in the code?
[13:41:48] [k-: Sou|cutter: hash stores a frozen copy of the key
[13:41:53] [k-: it cannot be modified
[13:42:03] [k-: by copy i mean a copy
[13:42:12] hoylemd: Hey, quick question: do blocks return values? e.g. `result = do\n a = 5\n b = 3\n a + b\nend`
[13:42:12] [k-: an actual copy
[13:42:32] Sou|cutter: [k-: is that right...
[13:42:32] [k-: yes, the last expression is returned
[13:42:45] Sou|cutter: mrrobot_: https://en.wikipedia.org/wiki/String_interning
[13:42:47] allcentury: has joined #ruby
[13:42:48] [k-: do you question my knowledge?!??!!
[13:43:01] [k-: tell him yorickpeterse!
[13:43:32] hoylemd: has left #ruby: ()
[13:43:41] hoylemd: has joined #ruby
[13:43:47] hoylemd: Hey, quick question: do blocks return values? e.g. `result = do\n a = 5\n b = 3\n a + b\nend`
[13:43:49] jhass: >> {Object.new => 1}.keys.first.frozen? # Sou|cutter always question [k-'s knowledge
[13:43:51] ruboto: jhass # => false (https://eval.in/437456)
[13:43:55] apeiros: [k-: Hash only copies and freezes string keys
[13:44:04] IceyEC: has joined #ruby
[13:44:10] apeiros: >> {"foo" => 1}.keys.first.frozen?
[13:44:12] ruboto: apeiros # => true (https://eval.in/437457)
[13:44:19] apeiros: and jhass showed the other part :)
[13:44:27] jhass: hoylemd: yes but they're not a standalone construct like that, they need to be passed to a method
[13:44:38] jhass: hoylemd: you begin/end to group expressions like that
[13:44:39] Sou|cutter: I feel betrayed
[13:44:42] IceyEC: has joined #ruby
[13:44:46] Sou|cutter: thanks apeiros / jhass
[13:44:50] apeiros: (and no, I've no idea why String keys are special cased like that in ruby)
[13:44:59] apeiros: *in ruby hashes
[13:45:10] Narzew: has joined #ruby
[13:45:14] hoylemd: ah, darn. I was hoping they could be like super convenient inline lambdas. This makes sense though. Thanks!
[13:45:14] Sou|cutter: TBH I think Strings should be immutable by default, like in Java
[13:45:34] [k-: i was partially right!
[13:46:14] jhass: hoylemd: lambda literal is -> { ... } btw
[13:46:15] [k-: i think it's because you can't dup certain things with certainty :)
[13:46:16] certainty: apeiros: because they're not immutable :) messing with the string used as a key would make them address a different record
[13:46:28] certainty: sure you can dup with me
[13:46:44] IceyEC: has joined #ruby
[13:46:45] Kendos-Kenlen: has joined #ruby
[13:46:48] [k-: in the literal meaning
[13:47:33] certainty: apeiros: sorry misinterpreted your last sentence. Now that i read the backlog :/
[13:47:35] apeiros: certainty: it's still a special casing. no other object is treated like that.
[13:47:51] certainty: yepp, just figured that that is what you were saying
[13:48:02] jhass: apeiros: guess somebody contrived a benchmark demonstrating the benefit or something
[13:48:06] IceyEC: has joined #ruby
[13:48:17] [k-: also, strings are so common
[13:48:34] [k-: (and lightweight)
[13:48:36] Sou|cutter: I never trust microbenchmarks
[13:48:45] lkba: has joined #ruby
[13:48:51] [k-: so they won't blow up the memory
[13:48:56] [k-: like some database
[13:49:38] beauby: has joined #ruby
[13:50:25] Pupeno: has joined #ruby
[13:50:25] Pupeno: has joined #ruby
[13:50:41] benlieb: has joined #ruby
[13:50:57] hoylemd: jhass: Oh, that might be what I'm looking for, actually...
[13:54:20] Joffily: has joined #ruby
[13:54:22] duggiefresh: has joined #ruby
[13:55:07] IceyEC: has joined #ruby
[13:55:27] tkuchiki_: has joined #ruby
[13:57:12] IceyEC: has joined #ruby
[13:59:08] IceyEC: has joined #ruby
[13:59:54] Klamber|ext: Ok. I'm back now with a simple Jekyll site that demonstrates my problem. In the _plugins directory is my code that has the comments and explanations.
[14:00:17] bigmac: has joined #ruby
[14:00:17] Klamber|ext: Wait.. copy paste misfortune
[14:00:32] Klamber|ext: https://github.com/AkselMeola/Jekyll-test-case.git
[14:01:01] [k-: ?fortunecookie -> $my?cookie
[14:01:01] ruboto: ->, I don't know anything about fortunecookie
[14:01:24] jeffreylevesque_: has joined #ruby
[14:01:37] certainty: apeiros: it might be because strings actually change the value of #hash if the content changes. Other objects don't do this. You can set ivars or add/remove methods, it will not affect the value of #hash on that object afair
[14:01:48] certainty: so it's kind of reasonable to special case for strings
[14:01:51] davedev24: has joined #ruby
[14:01:55] bruno-: has joined #ruby
[14:02:01] certainty: first copy then make sure it never changes
[14:02:06] [k-: https://github.com/AkselMeola/Jekyll-test-case/blob/master/_config.yml
[14:02:11] certainty: because it would mess with the internal consistency of the hashtable
[14:02:22] certainty: am i talking bs?
[14:02:24] [k-: what's that - doing over there by itself near the end?
[14:03:44] IceyEC: has joined #ruby
[14:03:51] [k-: >> str = "1"; [str.object_id, str.hash, str.replace("2").object_id, str.hash]
[14:03:52] ruboto: [k- # => [544552890, -537927102, 544552890, 1016155920] (https://eval.in/437460)
[14:03:53] workmad3: has joined #ruby
[14:04:13] [k-: interesting, interesting
[14:04:24] dcarmich: has joined #ruby
[14:04:45] NeverDie: has joined #ruby
[14:05:10] [k-: oooo dear, Klamber|ext, dont use tabs!
[14:05:25] [k-: ^ apeiros, do you have a case for that?
[14:05:58] tjohnson: has joined #ruby
[14:07:02] jhass: Klamber|ext: http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20150922_160654.png there's your nil
[14:07:14] bigbadbear: has joined #ruby
[14:07:35] Joffily: has joined #ruby
[14:07:41] [k-: ok, now to impart some good coding skills!
[14:07:48] Exuma: has joined #ruby
[14:08:11] jhass: current_page is {"layout"=>"default", "title"=>"Page 6", "content"=>"Does not belong to the testcat category.\n", "dir"=>"/some-pages", "name"=>"6-page.md", "path"=>"some-pages/6-page.md", "url"=>"/some-pages/6-page.html"}
[14:08:16] apeiros: [k-: what do you mean, case for what?
[14:08:16] IceyEC: has joined #ruby
[14:08:20] Joffily: has left #ruby: ()
[14:08:42] yottanami: has joined #ruby
[14:08:51] [k-: the nick!
[14:09:15] apeiros: I don't follow
[14:09:29] Klamber|ext: [k-: Not really sure. Jekyll has the example like that. Removing it makes no difference also not an expert on YAML.
[14:09:29] tacit7: has joined #ruby
[14:09:35] paulcsmith: has joined #ruby
[14:09:39] [k-: Klamber|ext: you can simplify this code: https://github.com/AkselMeola/Jekyll-test-case/blob/master/_plugins/page_navigation.rb#L30-L40
[14:09:56] [k-: apeiros: the nick detecting regexp!
[14:10:16] jhass: Klamber|ext: http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20150922_161005.png there's your "TITLE IS NIL"
[14:10:24] [k-: &ri Array#select @Klambler|ext
[14:10:24] `derpy: Klambler|ext: http://www.rubydoc.info/stdlib/core/Array#select-instance_method
[14:10:24] apeiros: [k-: it'll not count as "addressed person", but it'll be in the "mentions" list
[14:10:45] [k-: but im addressing him!
[14:11:02] Klamber|ext: [k-: Why not use tabs ?
[14:11:36] ruboto: I don't know anything about tabs
[14:11:42] [k-: why dont we have that?!
[14:11:51] [k-: it's a common source of mistakes!
[14:12:15] Klamber|ext: jhass: Is this running in Jekyll ?
[14:12:37] IceyEC: has joined #ruby
[14:12:41] Kricir: has joined #ruby
[14:13:18] IceyEC: has joined #ruby
[14:13:19] yottanami1: has joined #ruby
[14:13:50] kies^: has joined #ruby
[14:14:21] Klamber|ext: (So mutch scrolling... )
[14:14:23] certainty: apeiros: does my guess about why strings are special cased like that sound reasonable or am i wrong here?
[14:14:42] apeiros: certainty: sorry, I might have missed it. lemme see???
[14:14:50] Klamber|ext: [k-: So Tabs are source of mistakes in Ruby ?
[14:14:54] apeiros: 16:01 certainty: apeiros: it might be because strings actually change the value of #hash if the content changes. Other objects don't do this. You can set ivars or add/remove methods, it will not affect the value of #hash on that object afair
[14:15:00] certainty: yeah this one
[14:15:14] apeiros: ok, no. that's wrong.
[14:15:20] apeiros: other objects change their #hash too
[14:15:27] apeiros: #hash and #eql? are in tandem
[14:15:36] sharky: has joined #ruby
[14:15:38] freerobby: has joined #ruby
[14:15:39] jenrzzz: has joined #ruby
[14:15:40] apeiros: if an object's #eql? changes depending on its attributes, then so will its #hash
[14:15:49] certainty: hmm i thought i've checked that
[14:15:55] sharky: i am a sharkman
[14:16:12] jeffreylevesque: has joined #ruby
[14:16:13] alphaatom: has joined #ruby
[14:16:14] apeiros: certainty: note that Object#eql? uses identity, i.e. is an alias of equal?
[14:16:25] apeiros: so Object#eql? and Object#hash won't change when attributes change
[14:16:49] devoldmx: has joined #ruby
[14:17:09] [k-: Klamber|ext: tabs are a source of mistake in, like, almost everywhere
[14:17:28] Meow-J: has joined #ruby
[14:17:30] certainty: apeiros: can you give a case when it changes?
[14:17:50] yosafbridge: has joined #ruby
[14:18:02] [k-: why would Object use eql? as equal?
[14:18:09] [k-: that makes no sense
[14:18:41] Klamber|ext: [k-: How can tab cause error as it's a character like a space.
[14:18:49] apeiros: >> a = [1,2,3]; before = a.hash; a.pop; after = a.hash; [before, after]
[14:18:50] ruboto: apeiros # => [220937709, -319247676] (https://eval.in/437463)
[14:18:52] apeiros: certainty: ^
[14:18:56] IceyEC: has joined #ruby
[14:19:11] certainty: apeiros: ok i see
[14:19:30] Klamber|ext: [k-: yes YAMS don't like them... thats the only case I have seen tabs not liked... or some GNU style guides..
[14:20:06] apeiros: [k-: makes perfect sense
[14:20:20] [k-: whyyyyy
[14:20:25] apeiros: it's the strictest kind of comparison
[14:20:34] apeiros: so if you want less strict comparison, you have to implement it
[14:20:35] Klamber|ext: [k-: And also the problem on page 6 is that I have not accounted for categorys being nill yet. Why does it give me the nil error on page 1 for example ?
[14:20:36] apeiros: sane default.
[14:20:44] [k-: ohhhhhh
[14:20:56] tkuchiki: has joined #ruby
[14:21:07] [k-: Klamber|ext: you'd have to ask jhass!
[14:21:13] alphaatom|pc: has joined #ruby
[14:21:16] jeffreylevesque_: has joined #ruby
[14:21:48] jhass: Klamber|ext: it doesn't, it compiles all pages
[14:22:05] dorei: has joined #ruby
[14:22:11] JCOE: has joined #ruby
[14:22:28] yottanami__: has joined #ruby
[14:22:30] Klamber|ext: But the TEST 3 has no output that says "TITLE IS NIL" ...
[14:22:50] bigmac: has joined #ruby
[14:23:17] Klamber|ext: Does that TEST 3 compile aswell ?
[14:23:27] araujo_: has joined #ruby
[14:23:30] tejasmanohar: has joined #ruby
[14:24:19] chouhoulis: has joined #ruby
[14:24:32] certainty: apeiros: it's rather unusual for an object to change its #hash though right? the examples i can think of are hash,set,array etc. which are kind of defined by their structure. Not so much in terms of ivars. So it's kind of intuitive that these kinds of objects change
[14:24:37] certainty: don't know how to phrase that better
[14:24:44] certainty: thanks for the explanation
[14:24:57] araujo_: has joined #ruby
[14:25:00] rbennacer: has joined #ruby
[14:25:07] jhass: Klamber|ext: test 3 is not in the same "category"
[14:25:18] Klamber|ext: jhass: Why so ?
[14:25:30] jhass: because the category is the there's no category
[14:25:37] jhass: and the only items of it are feed.yml and page 6
[14:26:02] havenwood: has joined #ruby
[14:27:05] apeiros: certainty: not the least unusual. I expect every mutable object to change its #hash.
[14:27:30] Klamber|ext: jhass: Wait.. so since feed.yml and Page 6 belong to category nil (let's say so) and feed toes not have title then it gives me the error ?
[14:27:33] Gachr: has joined #ruby
[14:27:39] apeiros: as said, if a change to the object means it's not considered to be eql? to a copy of its previous state, then its #hash *must* change.
[14:27:39] UtkarshRay: has joined #ruby
[14:27:43] jeffreylevesque: has joined #ruby
[14:27:48] Gachr: Hi everyone.
[14:27:54] araujo: has joined #ruby
[14:29:36] voltalio: has joined #ruby
[14:29:43] ckuhn: has joined #ruby
[14:30:03] [k-: sometimes i wish Object was just called Obj (i just thought of this today)
[14:30:37] Klamber|ext: Man, i feel sutch an Idiot right now. Thanks everyone for putting up with this. (I'll look more into how jekyll does what it's doing.)
[14:30:38] banister: has joined #ruby
[14:30:43] araujo: has joined #ruby
[14:30:57] ckuhn: has joined #ruby
[14:31:36] ckuhn: Oops, this isnt bash
[14:32:20] jhass: Klamber|ext: yes
[14:32:38] Klamber|ext: jhass: Thanks.
[14:32:42] araujo: has joined #ruby
[14:32:42] alexUaN: has joined #ruby
[14:32:47] freerobby: has joined #ruby
[14:32:54] jhass: Klamber|ext: http://paste.mrzyx.de/pnyxkcrfw clean code version
[14:33:48] Kendos-Kenlen: has joined #ruby
[14:34:28] Klamber|ext: jhass: I'll learn on it.
[14:35:24] tejasmanohar_: has joined #ruby
[14:35:40] karapetyan: has joined #ruby
[14:36:01] araujo: has joined #ruby
[14:36:06] karapetyan: has joined #ruby
[14:36:17] Respek: has joined #ruby
[14:36:41] dopamean_: has joined #ruby
[14:36:42] elperdut: has joined #ruby
[14:39:00] workmad3: has joined #ruby
[14:42:40] rvchangue: has joined #ruby
[14:42:47] skweek: has joined #ruby
[14:45:08] platzhirsch: has left #ruby: ()
[14:45:56] krz: has joined #ruby
[14:46:03] shevy: if you people have several include statements
[14:46:06] shevy: do you sort them alphabetically? :D
[14:47:24] [k-: no, too much worj
[14:48:25] Klamber|ext: shevy: Your editor can probably do that
[14:49:55] Klamber|ext: I select a block and press F9 - all work done..
[14:49:55] Papierkorb: shevy: I sort them first by length and then in alphabetical order. Doing that since C++. Helps to quickly find if something is included if you know its name and thus can estimate its position based on the names length
[14:50:33] moeabdol: has joined #ruby
[14:54:05] momon: has joined #ruby
[14:55:09] momon: has left #ruby: ()
[14:56:16] ellisTAA: has joined #ruby
[14:57:12] kristofferR: has joined #ruby
[14:57:29] but3k4_: has joined #ruby
[14:58:11] Rodya_: has joined #ruby
[14:58:37] rippa: has joined #ruby
[14:58:54] hashrocket: has joined #ruby
[15:01:34] bronson: has joined #ruby
[15:02:06] decoponio: has joined #ruby
[15:02:47] Rodya_: has joined #ruby
[15:05:00] tomphp: has joined #ruby
[15:05:26] jeffreylevesque: has joined #ruby
[15:06:30] meatherly: has joined #ruby
[15:07:03] dopie: has joined #ruby
[15:08:18] shevy: Papierkorb lol
[15:08:33] shevy: well ok that is also sorting
[15:08:38] shevy: one could also just randomly add includes
[15:09:11] workmad3: has joined #ruby
[15:09:34] beauby: has joined #ruby
[15:10:35] deject3d: has joined #ruby
[15:10:52] [k-: you can definitely do that in Ruby
[15:11:53] Papierkorb: Well here most things are autoloaded, so less need to put structure into it
[15:12:14] Papierkorb: You think differently when you need to #include much stuff manually in a lot of files
[15:12:51] sharky: how do i access the text in this matchdata object, /^.+Top of 2nd/i.match(self.plays)
[15:13:15] sharky: oh its like an array, [0]. weird
[15:13:46] drewvanstone: has joined #ruby
[15:13:56] IceyEC: has joined #ruby
[15:14:18] momomomomo: has joined #ruby
[15:14:26] karapetyan: has joined #ruby
[15:17:00] IceyEC: has joined #ruby
[15:17:55] IceyEC: has joined #ruby
[15:18:50] codecop: has joined #ruby
[15:19:38] apeiros: sharky: it's a MatchData instance. you can use .class to figure that out.
[15:20:06] fertapric: has joined #ruby
[15:20:08] fierycatnet: has joined #ruby
[15:20:16] vjdhama: has joined #ruby
[15:21:16] EminenceHC: has joined #ruby
[15:22:46] nettoweb: has joined #ruby
[15:24:20] Soda: has joined #ruby
[15:25:27] andrew-l: has joined #ruby
[15:25:39] krisquigley: has joined #ruby
[15:25:43] psy: has joined #ruby
[15:26:08] vjdhama: has joined #ruby
[15:26:44] psy: has joined #ruby
[15:27:00] snockerton: has joined #ruby
[15:27:52] pecpec: has joined #ruby
[15:28:10] sharky: dummies/.scan(irc ruby channel)
[15:28:22] sharky: hold on the page is about to overflow with text
[15:28:34] User458764: has joined #ruby
[15:29:26] SenpaiSilver: has joined #ruby
[15:30:25] andyrs: has joined #ruby
[15:31:29] polishdub: has joined #ruby
[15:33:41] mwlang: has joined #ruby
[15:33:47] EminenceHC: has joined #ruby
[15:33:53] rcvalle: has joined #ruby
[15:34:05] andrew-l: hi, is anyone here familiar with ruby Threads? I'm looking for an explanation of code i'm using
[15:35:05] havenwood: andrew-l: Yes, there are folk here who are familiar with Threads. Ask away!
[15:35:20] platzhirsch: has joined #ruby
[15:35:25] evanjs: has joined #ruby
[15:35:44] circ-user-7dItm: has joined #ruby
[15:35:51] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[15:36:07] andrew-l: I'm working with this code: https://github.com/heroku-examples/ruby-websockets-chat-demo/blob/master/middlewares/chat_backend.rb and just not sure how Thread.new is running (or not running) with the redis.subscribe part
[15:36:15] dfockler: has joined #ruby
[15:37:03] sharky: whats the VIM command to delete all the white space going backwards until i reach non-whitespace
[15:37:13] havenwood: sharky: Wrong channel?
[15:37:23] sharky: oh sorry i thought it was related
[15:37:33] sharky: i thought maybe people coded ruby in VIM
[15:37:34] karapetyan: has joined #ruby
[15:37:35] andrew-l: I understand Thread.new creates a new thread, but it doesn't look like it's running, but when i throw a message into the redis channel, the message is processed.
[15:37:43] ArnaudM_: has left #ruby: (".")
[15:37:47] andrew-l: sharky: emacs user checking in :-)
[15:37:48] suchness: sharky: d^ will delete from current backward to first non-white-space character
[15:38:08] andrew-l: (from erc = emacs irc)
[15:38:16] havenwood: sharky: We also drink coffee and tea and eat chunky bacon. But only the bacon is ontopic.
[15:38:19] shevy: use a better editor people
[15:38:38] karapetyan: has joined #ruby
[15:38:48] andrew-l: shevy: uh oh... editor flame war on?! :-)
[15:38:59] shevy: what flame war
[15:39:30] iamninja: has joined #ruby
[15:39:31] Sou|cutter: >> class A; class B; end; end; A.const_defined?(:B, false)
[15:39:32] ruboto: Sou|cutter # => true (https://eval.in/437534)
[15:39:33] andrew-l: shevy: nvm. i'm happy with mine.
[15:39:37] dfockler: andrew-l: Are you using Thread#join?
[15:39:41] Sou|cutter: >> Class.new { class B; end }.const_defined?(:B, false)
[15:39:42] ruboto: Sou|cutter # => false (https://eval.in/437535)
[15:39:46] havenwood: andrew-l: A new thread is created that executes the block between `do` and `end`.
[15:39:58] tkuchiki: has joined #ruby
[15:40:06] havenwood: andrew-l: https://github.com/heroku-examples/ruby-websockets-chat-demo/blob/master/middlewares/chat_backend.rb#L17-L24
[15:40:20] havenwood: andrew-l: Have more specific questions? Or just wondering about threading in general?
[15:40:29] andrew-l: havenwood: yes, wondering about threading in general.
[15:40:40] andrew-l: just want to get a better understanding of the code
[15:40:46] Sou|cutter: ^^ where is B defined that it's inherited?
[15:40:54] Sou|cutter: (in the 2nd example)
[15:41:22] havenwood: andrew-l: Here's an ebook if you're looking for a well-written introduction: http://www.jstorimer.com/products/working-with-ruby-threads
[15:41:53] andrew-l: havenwood: thanks. i'll check it out too.
[15:42:14] andrew-l: but in this case, the thread is running even though it's not explictly called?
[15:42:18] havenwood: andrew-l: The docs are worth reading but are pretty cryptic if you're not familiar: http://ruby-doc.org/core/Thread.html
[15:42:48] havenwood: andrew-l: See the docs for Thread::new: http://ruby-doc.org/core/Thread.html#method-c-new
[15:43:01] Sou|cutter: Whoa, it's defined at the top-level
[15:43:23] shevy: alais string dataset
[15:43:25] shevy: who spots the error!!!
[15:43:32] karapetyan: has joined #ruby
[15:44:14] andrew-l: havenwood: aaah ok. thanks, i see what's going on. the thread is just running all the time on the redis.subscribe method.
[15:44:36] Sou|cutter: Is there a way to define a nested class within an anonymous class?
[15:44:43] havenwood: andrew-l: Some good rules for threading to keep in mind: https://github.com/jruby/jruby/wiki/Concurrency-in-jruby#concurrency-basics
[15:45:15] andrew-l: havenwood: thanks!
[15:45:22] havenwood: andrew-l: Yeah, a single new Thread is created when ChatDemo::ChatBackend.new is called. You're welcome!
[15:45:49] yfeldblum: has joined #ruby
[15:46:19] bluOxigen: has joined #ruby
[15:47:10] andrew-l: havenwood: just wondering, if there were multiple instances, each would have its own thread for the redis.subscribe and each would process whatever message published into that redis queue?
[15:47:22] karapetyan: has joined #ruby
[15:47:55] andrew-l: (i'm wondering when there's multiple rails server with this app, would they be synchronized using this method or would i have to implement another method to sync/execute)
[15:48:04] vjdhama: has joined #ruby
[15:49:25] yfeldblum: has joined #ruby
[15:49:42] InternetFriend: has joined #ruby
[15:51:54] Sou|cutter: ah ha! I got it
[15:52:17] zenguy_pc: has joined #ruby
[15:52:20] Sou|cutter: >> Class.new { const_set(:B, Class.new) }.const_defined?(:B, false)
[15:52:22] ruboto: Sou|cutter # => true (https://eval.in/437542)
[15:52:36] Sou|cutter: not sure if there's a better way
[15:52:40] havenwood: andrew-l: Are they sharing unsynchronized access to mutable data? I'm not sure I understand what you're asking. Do make sure there are fewer threads spawned at a given time than the number of maximum system threads allowed.
[15:52:54] havenwood: andrew-l: To illustrate in irb try: 1.upto(Float::INFINITY) { |n| puts "Spawning Thread #{n} ..."; Thread.new { sleep } }
[15:53:10] havenwood: andrew-l: On this box I get to: Spawning Thread 2047 ...
[15:53:14] havenwood: andrew-l: Then: ThreadError: can't create Thread: Resource temporarily unavailable
[15:53:24] mjuszczak: has joined #ruby
[15:53:43] andrew-l: havenwood: well, not about the threads themselves, but synchronizing message sending across instances.
[15:54:18] havenwood: andrew-l: Looks like you're using Redis for that? Or this demo is rather.
[15:54:23] startupality: has joined #ruby
[15:54:40] andrew-l: havenwood: yes, i've based my implementation on this demo.
[15:55:02] andrew-l: and was wondering about when we get more instances, will the instances be in sync
[15:55:09] andrew-l: (i.e. on heroku)
[15:55:17] havenwood: andrew-l: What do you mean by sync?
[15:55:47] blackmesa: has joined #ruby
[15:56:00] andrew-l: will each websocket client receive the message published to the redis, even if the clients are connected different instances
[15:56:29] havenwood: andrew-l: I've got to go (call then must relocate) but keep asking here and I'm sure you'll find answers.
[15:56:38] ebragaparah: has joined #ruby
[15:56:45] andrew-l: havenwood: thanks for the help!
[15:56:51] havenwood: andrew-l: Or ask me again later, but I'm sure someone will beat me to it.
[15:57:01] andrew-l: it's nice to get pointed in the right direction.
[15:58:12] last_staff: has joined #ruby
[15:58:23] rikkipitt: has joined #ruby
[15:58:37] shevy: when you use .cgi ... does anyone remember how to find out the name of the file that is requested? like index.cgi
[15:59:32] shevy: I think I may have found it ... SCRIPT_NAME
[15:59:48] dfockler: andrew-l: from the looks of the code, each client will receive the message if it's sent to the correct channel
[16:01:38] andrew-l: dfockler: thanks. I reasoned that out but just wanted to double check my reasoning
[16:01:53] towski_: has joined #ruby
[16:02:35] bricker: has joined #ruby
[16:03:06] jobewan: has joined #ruby
[16:03:18] pwnd_nfsw: has joined #ruby
[16:03:54] michaeldeol: has joined #ruby
[16:04:03] Narzew: has joined #ruby
[16:04:31] EminenceHC: has joined #ruby
[16:04:49] rbennacer: has joined #ruby
[16:04:53] dima_: has joined #ruby
[16:05:37] IceyEC: has joined #ruby
[16:05:40] amclain: has joined #ruby
[16:07:29] beast: has joined #ruby
[16:07:58] shevy: alright so my experiment did not work
[16:08:10] garyst1981: has joined #ruby
[16:08:23] shevy: I have a big html string... is there any simple way to convert this into a .pdf that will at least look somewhat familiar to the layout?
[16:09:08] andrew-l: shevy: have you tried Prawn?
[16:09:26] andrew-l: http://prawnpdf.org/api-docs/2.0/
[16:10:56] shevy: yeah I am using it to generate the .pdf in question
[16:11:02] SCHAAP137: has joined #ruby
[16:11:18] andrew-l: and you only have HTML strings to work from?
[16:11:18] Klamber|ext: has joined #ruby
[16:11:35] shevy: yeah, with the css style and classes all in the file
[16:12:12] freerobby: has joined #ruby
[16:12:15] andrew-l: hmm... is this from sinatra or rails?
[16:12:19] VeryBewitching: has joined #ruby
[16:13:26] shevy: I am using ruby; the html is generated. I just need a conversion from html to pdf :D
[16:13:52] n008f4g_: has joined #ruby
[16:13:53] Klamber|ext: N00b question coming through: How do you call this in Ruby %( <text> ) so I could go and read about it.
[16:13:55] andrew-l: hmm... let me look in an old project. i might have had the same problem
[16:14:17] shevy: Klamber|ext I think this is %Q
[16:14:22] shevy: might be another shortcut though
[16:14:30] shevy: >> %( <text> )
[16:14:31] ruboto: shevy # => " <text> " (https://eval.in/437543)
[16:14:32] User458764: has joined #ruby
[16:14:34] shevy: so you have a string there
[16:14:38] shevy: >> %Q( <text> )
[16:14:39] ruboto: shevy # => " <text> " (https://eval.in/437544)
[16:14:43] shevy: yay I was right \o/
[16:14:57] shevy: I guess they are format specifiers? not sure what their official name is
[16:15:13] shevy: you have %w() for array... %i or so for symbols.... and some more
[16:15:19] User458764: has joined #ruby
[16:15:26] but3k4: has joined #ruby
[16:15:34] rikkipitt: has joined #ruby
[16:15:50] Klamber|ext: I can see in a code that it outputs text, but what is it and why is it useful. Give me a starting point for learning more ..
[16:16:04] luckyme: has joined #ruby
[16:16:04] xMopxShell: has joined #ruby
[16:16:29] mjuszczak: has joined #ruby
[16:16:36] Tuxero: has joined #ruby
[16:16:38] dfockler: Klamber|ext: http://www.zenspider.com/Languages/Ruby/QuickRef.html#strings
[16:16:59] shevy: it may be useful when you have to use a lot of elements
[16:17:08] shevy: ['abc','def','ghi']
[16:17:12] shevy: %w( abc def ghi )
[16:17:18] shevy: so which variant do you prefer to type!
[16:17:34] devoldmx: has joined #ruby
[16:17:51] shevy: I don't know why in your case the person used %( <text> ), he could have just done ' <text> '
[16:17:53] andyrs: has joined #ruby
[16:18:05] shevy: I also don't know why he wanted to preserve the ' '
[16:18:08] shevy: or perhaps he was a noob
[16:19:02] andrew-l: shevy: have you tried: http://wkhtmltopdf.org/
[16:19:28] andrew-l: it basically takes the webkit rendering engine, renders it and outputs a PDF
[16:19:30] Maletor: has joined #ruby
[16:19:42] Klamber|ext: shevy: I made just an example..
[16:19:49] shevy: andrew-l have not yet tried that
[16:19:53] shevy: I'll have a look thanks
[16:20:00] blackmesa: has joined #ruby
[16:21:00] garyst1981: has left #ruby: ()
[16:21:09] garyst1981: has joined #ruby
[16:21:14] EminenceHC: has joined #ruby
[16:22:27] nanoz: has joined #ruby
[16:23:28] shevy: wxkhtmltopdf is a funny dude
[16:23:47] Klamber|ext: dfockler: Thanks.
[16:23:50] shevy: that is the python install script he uses: https://gist.github.com/shevegen/88029a587d3c955d4d20
[16:24:04] shevy: people seem so happy to try and avoid GNU autoconfigure these days :)
[16:24:32] bronson: has joined #ruby
[16:24:33] Jackneill: has joined #ruby
[16:26:54] darix: shevy: that script is a bit more than the usual things covered in autotools things
[16:27:32] NeverDie: has joined #ruby
[16:27:49] shevy: yeah... almost 1300 lines :D
[16:27:52] InternetFriend: has joined #ruby
[16:28:15] giuseppesolinas: has joined #ruby
[16:28:19] giuseppesolinas_: has joined #ruby
[16:28:24] ngscheurich: has joined #ruby
[16:28:24] ragingcake: has joined #ruby
[16:29:05] andyrs: has joined #ruby
[16:30:03] workmad3: has joined #ruby
[16:30:15] renderful: has joined #ruby
[16:30:49] Technodrome: has joined #ruby
[16:31:01] mondayrain: has joined #ruby
[16:31:05] shevy: andrew-l that seems to have worked
[16:31:11] platzhirsch: shevy: so you're studying biology?
[16:32:22] howdoico1: has joined #ruby
[16:32:47] andrew-l: shevy: awesome. that was pretty fast... and painless ;-)
[16:33:18] shevy: platzhirsch sorta, more in the past, currently more biochemistry/biotech/chemistry
[16:33:28] shevy: andrew-l yeah... let me try to look at the .pdf first...
[16:33:51] shevy: I just realized that a black background is not ideal to read in a .pdf :\
[16:34:22] s2013: has joined #ruby
[16:35:57] shevy: andrew-l - but, all the minor glitches aside... that is already better than what I have been able to come up with via html->prawn->pdf on my own... here is the rendered output... I can easily change the rest, it's css for the most part... http://shevegen.square7.ch/dia.pdf
[16:36:02] krisquigley: has joined #ruby
[16:36:10] shevy: but now I'm going to grab some food
[16:36:29] podman: has joined #ruby
[16:36:37] centrx: shevy, glhf
[16:38:44] psye: has joined #ruby
[16:38:55] Xeago: has joined #ruby
[16:38:55] Kendos-Kenlen: has joined #ruby
[16:39:49] RobertBirnie: has joined #ruby
[16:39:58] zotherstupidguy: has joined #ruby
[16:40:20] nzst: has joined #ruby
[16:41:34] NeverDie: has joined #ruby
[16:43:08] dima_: has joined #ruby
[16:44:05] tomphp: has joined #ruby
[16:44:13] dima_: has joined #ruby
[16:44:37] dima_: has joined #ruby
[16:46:41] elperdut: has joined #ruby
[16:46:56] whippythellama: has joined #ruby
[16:47:09] yqt: has joined #ruby
[16:47:25] Musashi007: has joined #ruby
[16:47:33] cschneid_: has joined #ruby
[16:49:43] imperator: has joined #ruby
[16:49:49] paulcsmith: has joined #ruby
[16:51:32] tacit7: has joined #ruby
[16:51:49] workmad3: has joined #ruby
[16:52:17] evanjs: has joined #ruby
[16:52:39] ruurd: has joined #ruby
[16:55:04] djbkd: has joined #ruby
[16:55:44] skweek: has joined #ruby
[16:55:48] voltalio: has joined #ruby
[16:56:56] banjara: has joined #ruby
[16:58:29] iamninja: has joined #ruby
[16:59:31] firstdayonthejob: has joined #ruby
[16:59:50] rakm: has joined #ruby
[17:00:31] leafybas_: has joined #ruby
[17:01:36] snockerton1: has joined #ruby
[17:01:40] symm-: has joined #ruby
[17:02:25] FernandoBasso: has joined #ruby
[17:02:51] otacon-: has joined #ruby
[17:03:21] freerobby: has joined #ruby
[17:03:25] jeffreylevesque: has joined #ruby
[17:03:43] fedexo: has joined #ruby
[17:04:08] InternetFriend: has joined #ruby
[17:05:27] doddok: has joined #ruby
[17:06:33] jeffreylevesque_: has joined #ruby
[17:06:38] rickmasta: has joined #ruby
[17:06:50] gregf: has joined #ruby
[17:07:00] dionysus69: has joined #ruby
[17:08:14] roxtrongo: has joined #ruby
[17:09:19] JCOE: has joined #ruby
[17:09:47] AccordLTN: has joined #ruby
[17:10:25] jschmid: has joined #ruby
[17:11:52] SylarRuby: has joined #ruby
[17:12:05] FernandoBasso1: has joined #ruby
[17:12:23] rbennacer: has joined #ruby
[17:12:29] beauby: Let's say I'm inside a class method `self.m(x)` of a class `A`: what's a sound way to bind a new class named `"Class#{x}"`, namespaced inside `A`? I've been toying with stuff like `c = Class.new() do ... end; const_set("Class#{x}", c)` Is there an other way?
[17:12:38] platzhirsch: Interesting, why does
[17:12:38] platzhirsch: statement rescue 'success' not rescue on Interrupt?
[17:13:27] centrx: beauby, That seems like the best way
[17:14:03] apt-get: has joined #ruby
[17:14:16] centrx: platzhirsch, StandardError -- default for rescue
[17:14:32] centrx: platzhirsch, So rescue by default only gets Exceptions under StandardError
[17:14:46] platzhirsch: ah that makes sense
[17:15:17] beauby: Cool, now what if I'm doing this inside a module `M` included in the class `A`, and I want to define `"A::Class#{x}"`?
[17:15:43] beauby: Basically, how do I get ahold of the namespace of "execution"?
[17:16:25] yeticry: has joined #ruby
[17:16:42] InternetFriend: has joined #ruby
[17:16:43] leafybasil: has joined #ruby
[17:17:26] Billias: has joined #ruby
[17:17:39] jenrzzz: has joined #ruby
[17:18:19] devoldmx: has joined #ruby
[17:18:45] jeffreylevesque: has joined #ruby
[17:19:01] wildlander: has joined #ruby
[17:19:24] petricore: has joined #ruby
[17:19:41] weemsledeux: has joined #ruby
[17:20:10] yfeldblum: has joined #ruby
[17:22:00] bruno-: has joined #ruby
[17:22:24] Hanmac: has joined #ruby
[17:23:24] Ox0dea: >> module Foo; class Bar; singleton_class.nesting; end end # beauby
[17:23:26] ruboto: Ox0dea # => [Foo::Bar, Foo] (https://eval.in/437621)
[17:23:28] blackmesa: has joined #ruby
[17:24:50] jeffreylevesque_: has joined #ruby
[17:25:06] Ox0dea: I missed that you asked about a Module inside a Class, but that's largely moot.
[17:25:29] yfeldblum: has joined #ruby
[17:26:01] ekain: has joined #ruby
[17:26:04] beauby: >> module Foo; def m(x); c = Class.new(); const_set("Class#{x}", c); end; end; class A; include Foo; def initialize; m("Hello"); p const_get("ClassHello").name; end; end; # Ox0dea
[17:26:05] ruboto: beauby # => :initialize (https://eval.in/437625)
[17:28:25] bronson: has joined #ruby
[17:28:41] nickjj: has joined #ruby
[17:28:48] Kruppe: has joined #ruby
[17:29:22] EminenceHC: has joined #ruby
[17:29:40] skweek: has joined #ruby
[17:31:57] Technodrome: has joined #ruby
[17:32:09] ramfjord: has joined #ruby
[17:32:37] startupality: has joined #ruby
[17:33:56] armyriad: has joined #ruby
[17:34:23] postmodern: has joined #ruby
[17:34:54] rehat: has joined #ruby
[17:35:39] Ox0dea: beauby: How's this? https://eval.in/437634
[17:35:45] armyriad: has joined #ruby
[17:35:59] Ox0dea: I think I've missed some nuance of what exactly you're trying to do, but that should get you most of the way there.
[17:37:12] bluntman: has joined #ruby
[17:37:21] wldcordeiro: has joined #ruby
[17:38:32] bruno-: has joined #ruby
[17:39:29] PaulCapestany: has joined #ruby
[17:39:49] Musashi007: has joined #ruby
[17:39:50] jgt: has joined #ruby
[17:40:16] workmad3: has joined #ruby
[17:40:23] futilegames: has joined #ruby
[17:40:41] Steve_Jobs: has joined #ruby
[17:40:50] casadei_: has joined #ruby
[17:41:17] tkuchiki: has joined #ruby
[17:41:53] beauby: Ox0dea: Thanks, here is a more specific version of what I'm trying to achieve: https://eval.in/437650 (although it doesn't work)
[17:43:51] zotherstupidguy: has joined #ruby
[17:44:09] hinbody: has joined #ruby
[17:45:40] jeffreylevesque: has joined #ruby
[17:47:48] willywos: has joined #ruby
[17:49:11] Ox0dea: beauby: Swapping `include Foo` for `extend Foo::ClassMethods` "works", but I suspect that's not the behavior you actually want.
[17:50:38] Ox0dea: Maybe say more about what exactly you're doing? Whence all this convolution?
[17:51:32] havenwood: has joined #ruby
[17:51:50] dyleted: has joined #ruby
[17:52:16] michaeldeol: has joined #ruby
[17:53:43] ejnahc: has joined #ruby
[17:55:00] NeverDie: has joined #ruby
[17:55:06] beauby: Ox0dea: So Associations (https://github.com/rails-api/active_model_serializers/blob/master/lib/active_model/serializer/associations.rb) is included in Serializer (https://github.com/rails-api/active_model_serializers/blob/master/lib/active_model/serializer.rb). Usage is: Serializer is subclassed into, say, PostSerializer, in the definition of which `has_many` is called, and I want to define PostSerializer::My
[17:55:12] beauby: Class, dynamically from whithin `has_many`
[17:56:25] dasher00: has joined #ruby
[17:56:39] evanjs: has joined #ruby
[17:56:39] jeffreylevesque: has joined #ruby
[17:57:40] futilegames: has left #ruby: ()
[17:58:06] callumacrae: heya! i have previous experience in coding (but not ruby), can anyone recommend me a book that is short and concise that will teach me ruby?
[17:58:10] freerobby: has joined #ruby
[17:58:55] callumacrae: emphasis on short. I don't need a comprehensive explanation of absolutely everything, I just need to know enough that I can figure the rest out myself
[17:58:59] Ox0dea: callumacrae: learnxinyminutes.com/docs/ruby/
[17:59:00] beauby: callumacrae: I personally find books useful only once you have some experience with a techno, so I'd recommend you start building stuff in ruby/follow tutorials, but that's just my 2cts
[17:59:34] JCOE: has joined #ruby
[17:59:46] Ox0dea: beauby: I'm trying to see if there's some clever way to get everything in place with Module#prepend.
[18:00:02] beauby: Ox0dea: Awesome, thanks for taking the time
[18:00:16] callumacrae: Ox0dea: Thanks!
[18:00:18] callumacrae: beauby: I've been working at a ruby shop for over a year now so I've read my fair share of ruby, and written a few erb files myself, so the syntax isn't that unfamiliar anymore
[18:00:38] bigmac: has joined #ruby
[18:00:42] callumacrae: Also did tryruby.com or whatever it's called a while back
[18:02:51] beauby: Ox0dea: Note that I don't want to override has_many, I actually want to do my stuff from within has_many
[18:03:25] User458764: has joined #ruby
[18:04:32] Ox0dea: beauby: Module#prepend lets you "decorate" methods, so to speak.
[18:04:50] shadoi: has joined #ruby
[18:04:55] Ox0dea: You do your custom thing and then usually invoke `super`.
[18:05:06] beauby: Ox0dea: I see. I can actually modify the Associations file though, I just don't want to modify the structure of the file too much
[18:05:16] Ox0dea: Oh, I see.
[18:05:55] beauby: Currently, when I do what we discussed it defines MyClass like ActiveModel::Serializer::Associations:ClassMethods::MyClass
[18:06:41] Ox0dea: beauby: And you're sure it's not Module#nesting you're looking for?
[18:07:05] karapetyan: has joined #ruby
[18:07:15] agent_meerkat: has joined #ruby
[18:07:44] beauby: Ox0dea: Well, no, because I'm calling has_many as follows: class PostSerializer < ActiveModel::Serializer; has_many :stuff; end, and PostSerializer is not present in the nesting chain
[18:07:44] face: has joined #ruby
[18:07:56] hahuang65: has joined #ruby
[18:10:41] beauby: (ActiveModel::Serializer is, though)
[18:11:32] dasher00: has joined #ruby
[18:12:36] decuser: has joined #ruby
[18:12:55] [Butch]: has joined #ruby
[18:12:55] beauby: (Hence my initial question about the "namespace of the execution context")
[18:13:42] youngbaks: has joined #ruby
[18:14:14] User458764: has joined #ruby
[18:14:56] baweaver: has joined #ruby
[18:16:05] renderful: has joined #ruby
[18:16:06] einarj: has joined #ruby
[18:16:43] segfalt: has joined #ruby
[18:17:05] ruurd: has joined #ruby
[18:17:35] krisquigley: has joined #ruby
[18:18:36] howdoico1: has joined #ruby
[18:18:44] jenrzzz: has joined #ruby
[18:19:04] DrCode: has joined #ruby
[18:19:48] jeffreylevesque_: has joined #ruby
[18:21:58] warreng: has left #ruby: ()
[18:22:36] codecop: has joined #ruby
[18:24:15] yfeldblum: has joined #ruby
[18:24:19] yqt: has joined #ruby
[18:24:33] RegulationD: has joined #ruby
[18:25:13] blackmesa: has joined #ruby
[18:25:26] myotkyaw: has joined #ruby
[18:25:37] myotkyaw: hello everyone
[18:25:49] rezzack: has joined #ruby
[18:26:06] Wolland: has joined #ruby
[18:26:41] polly_wog: has joined #ruby
[18:27:00] myotkyaw: has left #ruby: ()
[18:27:39] kadoppe: has joined #ruby
[18:29:52] evanjs: has joined #ruby
[18:30:46] segfalt: has joined #ruby
[18:30:53] snockerton: has joined #ruby
[18:32:34] djbkd: has joined #ruby
[18:32:37] Xeago_: has joined #ruby
[18:32:38] EminenceHC: has joined #ruby
[18:33:30] jeffreylevesque: has joined #ruby
[18:33:36] beauby: Ox0dea: Nevermind, it actually works, I was probably doing something else wrong. Thanks for the time and the examples though!
[18:34:14] dseitz: has joined #ruby
[18:34:23] Ox0dea: beauby: Ha. All right, then.
[18:34:25] Musashi007: has joined #ruby
[18:34:38] CloCkWeRX: has joined #ruby
[18:34:52] elperdut: has joined #ruby
[18:34:55] djbkd: has joined #ruby
[18:37:22] DexterLB: has joined #ruby
[18:37:26] Andrey_: has joined #ruby
[18:37:44] luckyme: has joined #ruby
[18:38:45] ericjphillips: has joined #ruby
[18:39:59] noethics: has joined #ruby
[18:40:07] adaedra: -o adaedra
[18:40:27] imperator: has joined #ruby
[18:41:29] roxtrongo: has joined #ruby
[18:41:31] j4cknewt: has joined #ruby
[18:41:49] tkuchiki: has joined #ruby
[18:42:12] allomov: has joined #ruby
[18:42:42] Xeago: has joined #ruby
[18:44:05] baweaver: has joined #ruby
[18:44:23] freerobby: has joined #ruby
[18:44:26] ellisTAA: has joined #ruby
[18:44:55] atmosx_laptop: has joined #ruby
[18:45:00] Konstruktionist: has joined #ruby
[18:45:19] cndiv: has joined #ruby
[18:45:45] tomaz_b: has joined #ruby
[18:46:09] michael_mbp: has joined #ruby
[18:47:38] sanjayu: has joined #ruby
[18:48:39] EminenceHC: has joined #ruby
[18:49:40] kobain: has joined #ruby
[18:51:46] jeffreylevesque: has joined #ruby
[18:52:33] jenrzzz: has joined #ruby
[18:55:56] ItSANgo: has joined #ruby
[18:56:21] cndiv: has joined #ruby
[18:56:54] cyklOpz: has joined #ruby
[18:57:26] jeffreylevesque_: has joined #ruby
[18:57:45] benlovell: has joined #ruby
[18:58:08] dstarh: has joined #ruby
[18:59:29] shadow: has joined #ruby
[18:59:39] j4cknewt_: has joined #ruby
[18:59:47] blackmesa: has joined #ruby
[18:59:53] voltalio: has joined #ruby
[19:01:35] Coldblackice: has joined #ruby
[19:01:56] lxsameer: has joined #ruby
[19:02:28] jeffreylevesque: has joined #ruby
[19:02:33] SylarRuby: has joined #ruby
[19:03:05] User458764: has joined #ruby
[19:03:42] jgt: has joined #ruby
[19:03:49] User458764: has joined #ruby
[19:03:53] frmendes: has joined #ruby
[19:07:15] ndrei: has joined #ruby
[19:07:37] Macaveli: has joined #ruby
[19:07:49] skweek: has joined #ruby
[19:08:24] Guest69987: Hello I forked a file from github then cloned it, I edited the view-layout file and am unable to view the results. I can't do rails s to see the server running nor push it back to github repository.
[19:08:26] centrx: atmosx_laptop, Are you related to atmosx?
[19:08:29] Guest69987: any idea why? Thanks
[19:08:41] atmosx_laptop: centrx: we're extremely close, but don't tell.
[19:09:01] EminenceHC: has joined #ruby
[19:09:06] spider-mario: has joined #ruby
[19:09:44] Soda: has joined #ruby
[19:09:53] djbkd: has joined #ruby
[19:10:08] HAL2328: has joined #ruby
[19:10:24] djbkd: has joined #ruby
[19:11:10] agent_meerkat: has left #ruby: ()
[19:11:21] pen: has joined #ruby
[19:11:54] rbennacer: has joined #ruby
[19:13:21] cmisenas: has joined #ruby
[19:13:52] chicagob2: Hello I forked a file from github then cloned it, I edited the view-layout file and am unable to view the results. I can't do rails s to see the server running nor push it back to github repository.
[19:13:57] chicagob2: any idea why? Thanks
[19:14:34] j4cknewt: has joined #ruby
[19:15:20] pencilcheck: has joined #ruby
[19:15:25] cyklOpz: has joined #ruby
[19:15:48] Stalkr_: has joined #ruby
[19:15:52] Stalkr_: has joined #ruby
[19:16:01] Sou|cutter: chicagob2: Are you a designer working with a team?
[19:16:20] cyklOpz: has joined #ruby
[19:16:23] casadei_: has joined #ruby
[19:16:32] jenrzzz: has joined #ruby
[19:16:36] dfockler: has joined #ruby
[19:16:44] EmeraldExplorer: has joined #ruby
[19:16:56] craysiii: has joined #ruby
[19:17:23] evanjs: has joined #ruby
[19:19:05] devoldmx: has joined #ruby
[19:19:25] pwnd_nsfw: has joined #ruby
[19:19:32] EmeraldExplorer: I bet this is a stupid question, but what exactly does the colon mean (what is it called) in this situation: create_table :employees do |t| t.column :name, :string
[19:20:42] dfockler: EmeraldExplorer: It's ruby's syntax for a symbol
[19:20:56] Pupeno: has joined #ruby
[19:20:56] Pupeno: has joined #ruby
[19:22:46] Sou|cutter: It's the same at "employees".to_sym
[19:23:01] Sou|cutter: end result, anyway
[19:23:03] EmeraldExplorer: Oh wait... I think I was interpreting it the wrong way... sorry I'm from Java. It is basically like this, right? create_table( :employees ) do |t| {}
[19:23:49] t_mmyv: has joined #ruby
[19:23:50] jhass: no idea where the {} comes from all of the sudden, but up to that, yes
[19:23:53] Sou|cutter: EmeraldExplorer: yeah. Except in ruby you wouldn't have those braces. do/end is the start/end of a block
[19:24:06] Synthead: is there a way I can put a function in an rc file somewhere so I can run a special function when needed (instead of declaring it every time I open a prompt)?
[19:24:10] bazbing80: sooo...how are you meant to pass an argument chain to a method in rspec? I know rspec isn't pure ruby but it's a pure ruby question.. | def method *args | let(:args){ 4,5,6 } #=> syntax error, unexpected ',' | see my probs?
[19:24:45] Sou|cutter: let(:args) { [4, 5, 6] } method(*args)
[19:25:09] havenwood: Synthead: Using IRB or Pry?
[19:25:09] bruno-: has joined #ruby
[19:25:16] Synthead: havenwood: pry
[19:25:23] havenwood: Synthead: .pryrc
[19:25:25] IceyEC: has joined #ruby
[19:25:42] Sou|cutter: bazbing80: you use an array and the splat operator
[19:25:43] havenwood: Synthead: https://github.com/pry/pry/wiki/Pry-rc
[19:26:33] bazbing80: Sou|cutter: but if you use an array, doesn't the splat operator put the entire array in the first entry of the array?
[19:26:41] Synthead: havenwood: excellent! thank you!
[19:26:45] j4cknewt: has joined #ruby
[19:26:51] havenwood: Synthead: you're welcome
[19:26:58] Macaveli: has joined #ruby
[19:27:11] bazbing80: Sou|cutter: the array you pass it goes in the first entry of the array created by the splat operator
[19:27:22] dorei: i'm about to write yard documentation for the first time :) do you know of any well documented ruby projects to get ideas?
[19:27:45] banjara: has joined #ruby
[19:28:22] workmad3: has joined #ruby
[19:28:28] j4cknewt_: has joined #ruby
[19:28:43] dfockler: dorei: https://github.com/lsegal/yard
[19:28:53] Sou|cutter: bazbing80: Nope, you are misunderstanding the splat operator
[19:29:20] Sou|cutter: bazbing80: method(args) <-- would pass an array as one argument method(*args) passes 3 arguments to method
[19:29:40] djbkd: has joined #ruby
[19:30:15] djbkd: has joined #ruby
[19:31:35] arup_r: has joined #ruby
[19:32:17] EmeraldExplorer: So do you think it is good practice to use ()s in Ruby for the sake of the reader?
[19:32:21] HAL2328: has joined #ruby
[19:32:24] bricker: EmeraldExplorer: yes
[19:32:33] havenwood: EmeraldExplorer: no
[19:33:41] EmeraldExplorer: let's debate! ;)
[19:34:09] bazbing80: Sou|cutter: see the difference? https://gist.github.com/anonymous/332ea566809e72714267
[19:35:49] bazbing80: so how should I encapsulate 3 arguments, not in array, in a proc i,e.
[19:35:58] bazbing80: let(:args){ 3,4,5 }
[19:37:14] BlackCoyote: has joined #ruby
[19:39:10] workmad3: has joined #ruby
[19:39:33] einarj: has joined #ruby
[19:39:57] `based_pdev`: has joined #ruby
[19:40:45] bronson: has joined #ruby
[19:41:15] bazbing80: any ideas? nothing online... :S
[19:41:29] AlxAltea: has joined #ruby
[19:41:34] evanjs: has joined #ruby
[19:43:08] tkuchiki: has joined #ruby
[19:43:29] vdamewood: has joined #ruby
[19:43:30] Pupeno: has joined #ruby
[19:44:06] j4cknewt: has joined #ruby
[19:44:07] youngbaks: has joined #ruby
[19:45:29] howdoico1: has joined #ruby
[19:45:30] jhass: bazbing80: let(:args) { [3, 4, 5] } ... foo(*args)
[19:47:26] baweaver: has joined #ruby
[19:49:28] Sou|cutter: bazbing80: Not in the method definition, in the way you call it
[19:49:55] Sou|cutter: bazbing80: def foo(a, b, c); end; args = [1, 2, 3]; foo(*args)
[19:50:26] havenn: has joined #ruby
[19:50:39] SCHAAP137: has joined #ruby
[19:51:31] evanjs: has joined #ruby
[19:52:16] michael_mbp: has joined #ruby
[19:52:17] breadmonster: has joined #ruby
[19:52:30] breadmonster: Hey everyone.
[19:52:36] havenn: breadmonster: hi
[19:52:43] breadmonster: I'm really new to programming and a friend recommended Ruby to me for web development.
[19:52:48] breadmonster: Could anyone help me out with resources?
[19:53:06] prestorium: has joined #ruby
[19:53:13] havenn: breadmonster: Here's a list of links from this channels website: http://ruby-community.com/pages/links
[19:54:19] karapetyan: has joined #ruby
[19:54:21] ItSANgo_: has joined #ruby
[19:54:46] havenn: breadmonster: There are some duplicate links but here're more from the Ruby website: https://www.ruby-lang.org/en/documentation/
[19:54:50] breadmonster: Alright thanks.
[19:54:56] breadmonster: I was wondering where to learn about Rails.
[19:54:58] bronson: has joined #ruby
[19:55:08] havenn: breadmonster: Are you new to programming or coming to Ruby from other languages?
[19:56:20] EmeraldExplorer: What exactly does class CreateEmployees < ActiveRecord::Migration mean? (The < )
[19:56:37] centrx: inherits from
[19:56:44] jhass: EmeraldExplorer: what's your background? any other languages we can relate to?
[19:57:02] jhass: < is extends
[19:57:05] drptbl_: has joined #ruby
[19:57:12] tiagonobre: has joined #ruby
[19:57:42] karapetyan: has joined #ruby
[19:57:47] j4cknewt_: has joined #ruby
[19:58:21] EmeraldExplorer: jhass: Ok thanks. Sorry for my newb questions... Google just doesn't like strange symbols :,(
[19:58:30] ItSANgo__: has joined #ruby
[19:58:43] Xeago: has joined #ruby
[19:58:44] jhass: symbolhound.com ;)
[19:59:09] bazbing80: EmeraldExplorer: it's weird why google doesnt do non-word/digit characters!
[19:59:24] EmeraldExplorer: jhass: tried that too but then it went to << which is not < :o
[19:59:34] breadmonster: havenn: I've used one other language before.
[19:59:43] jhass: ?quickref
[19:59:43] ruboto: http://www.zenspider.com/Languages/Ruby/QuickRef.html
[19:59:44] EmeraldExplorer: bazbing80: probably is more efficient with word/digit chars
[19:59:56] breadmonster: havenn: It's called Haskell, it's not very well known.
[20:00:01] breadmonster: But I like the community and so on.
[20:00:13] benlieb: has joined #ruby
[20:00:24] garyst1981: has joined #ruby
[20:00:31] breadmonster: A lot of people told me that Ruby is a great language for object oriented and web based programming.
[20:00:31] unop: has joined #ruby
[20:00:34] havenn: breadmonster: Here's a very brief Ruby-from-Java rundown: https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-java/
[20:00:36] breadmonster: Though I'm not sure what the former is.
[20:00:36] centrx: They are right!
[20:00:43] shevy: our webchatter is back in action again
[20:00:54] jhass: havenn: hit the wrong user there I think ;)
[20:01:22] havenn: breadmonster: I got confuzled, nevermind me.
[20:01:33] evanjs: has joined #ruby
[20:01:36] shevy: coffee time again
[20:01:50] havenn: shevy: I'm not sure coffee will help me today. I'm in a haze!
[20:02:08] RandyT: has joined #ruby
[20:02:34] InternetFriend: has joined #ruby
[20:03:41] ItSANgo: has joined #ruby
[20:03:48] zendrix: has joined #ruby
[20:04:24] giuseppesolinas_: has joined #ruby
[20:04:33] giuseppesolinas: has joined #ruby
[20:04:40] deject3d: has joined #ruby
[20:04:51] Inoperable: wish coffee would still work for me
[20:05:08] Inoperable: i can gulp a bucket of coffee and fall asleep instantly
[20:05:16] centrx: you're addicted
[20:05:24] Inoperable: not addicted
[20:05:36] Inoperable: i just have a tolerance to caffeine :>
[20:05:43] Inoperable: my liver knows it like a muscle memory ;>
[20:06:56] sharkman: has joined #ruby
[20:06:59] drptbl: has joined #ruby
[20:07:47] bricker: inoperable: probably your colon too :)
[20:07:52] baweaver: has joined #ruby
[20:08:44] p0wn3d_: has joined #ruby
[20:09:04] otacon-: have you tried amphetamines?
[20:09:12] centrx: Step it up!
[20:09:19] bmurt: has joined #ruby
[20:10:37] Pupeno: has joined #ruby
[20:12:38] shevy: inoperable caffeine had a mild effect of inducing vomit for me
[20:13:08] adaedra: it's the coffee you should drink, not the mug.
[20:13:16] Nuck: has joined #ruby
[20:15:03] baweaver: adaedra: but an early morning mugging really gets the blood flowing.
[20:16:28] j4cknewt: has joined #ruby
[20:16:55] momomomomo: has joined #ruby
[20:18:38] krisquigley: has joined #ruby
[20:19:51] devoldmx: has joined #ruby
[20:22:29] Igorshp: has joined #ruby
[20:23:56] jschmid: has joined #ruby
[20:24:36] jdawgaz: has joined #ruby
[20:24:36] jackjackdripper: has joined #ruby
[20:25:36] DLSteve: has joined #ruby
[20:25:47] breadmonster: Is there something like Ruby for Haskell programmers?
[20:26:16] bruno-: has joined #ruby
[20:26:21] devbug: has joined #ruby
[20:26:55] youngbaks: has joined #ruby
[20:27:23] wmoxam: breadmonster: wat
[20:27:26] jackjackdripper: has joined #ruby
[20:27:38] mattprelude: has joined #ruby
[20:28:26] solocshaw: has joined #ruby
[20:28:39] moshef: has joined #ruby
[20:28:53] momomomomo_: has joined #ruby
[20:29:11] pulgolino: has joined #ruby
[20:29:28] havenwood: has joined #ruby
[20:30:03] pencilcheck: has joined #ruby
[20:30:30] chouhoulis: has joined #ruby
[20:30:43] drptbl: has joined #ruby
[20:31:21] dfockler: breadmonster: there's the opposite direction guides
[20:32:52] lkba: has joined #ruby
[20:35:42] irctc894: has joined #ruby
[20:35:55] baweaver: I still think X for Y developers is a bad idea.
[20:35:59] NeverDie: has joined #ruby
[20:36:13] baweaver: The more metaphors you try and carry over, the worse it'll be.
[20:36:29] dfockler: That's partially true
[20:36:54] baweaver: It works for similar languages well enough
[20:37:05] baweaver: Java -> Ruby is nasty ugly
[20:37:12] j4cknewt_: has joined #ruby
[20:37:24] irctc337: has joined #ruby
[20:37:27] baweaver: Speaking of which, still need to write that Ruby accents guide some time
[20:38:07] michael_mbp: has joined #ruby
[20:38:08] dfockler: I was a java dev that switched to ruby and my old code looked like bad ruby and worse java
[20:39:02] irctc337: hello, i want to be able to use this http://www.avalara.com/ in my iOS app, my question is do i make it server side or on the iOS side?
[20:39:29] oddmunds: baweaver: X for Y devs could be documenting what metaphors you need to "forget"
[20:39:52] kinduff: has joined #ruby
[20:40:10] michael_mbp: has joined #ruby
[20:42:14] dfockler: I think OOP should be taught from the POODR/messaging perspective, it certainly makes a lot more sense than 'this is a class, etc'
[20:42:42] lapide_viridi: has joined #ruby
[20:43:43] j4cknewt: has joined #ruby
[20:44:49] HAL2328: i suggest chris pine's learn to program
[20:45:28] Torrieri: has joined #ruby
[20:45:28] Torrieri: has joined #ruby
[20:45:32] jhass: irctc337: welcome to the Ruby programming language channel. Are you writing your app with Ruby?
[20:45:36] elperdut: has joined #ruby
[20:45:57] irctc337: no my app is iOS
[20:46:18] jhass: I don't follow how your question relates to Ruby then
[20:46:22] benlovell: has joined #ruby
[20:46:28] phutchins2: has joined #ruby
[20:46:28] Spami: has joined #ruby
[20:46:54] ekleog: has joined #ruby
[20:47:00] irctc337: dont i integrate avalara.com api in ruby? then somehow communicate back to iOS ?
[20:47:29] jhass: So you wrote a backend in Ruby for your app?
[20:48:28] Exuma: has joined #ruby
[20:48:36] irctc337: i actually used Parse.com for ios
[20:49:29] shinnya: has joined #ruby
[20:50:02] adaedra: So what is in Ruby then?
[20:50:07] bricker: irctc337: you're asking if you should point the iOS client to avaltara directly, or make a proxy API on your servers?
[20:51:13] lkba: has joined #ruby
[20:51:54] _blizzy_: has joined #ruby
[20:52:17] bricker: irctc337: Hard to say for sure without having some knowledge of your business and future plans, but generally for iOS I would just connect directly to avaltara's servers.
[20:52:47] bricker: irctc337: anyways, there is already an official iOS SDK for that service: https://github.com/avadev/AvaTax-Calc-SDK-iOS
[20:53:04] irctc337: oh i didnt see this, thanks.
[20:54:32] ruby-lang354: has joined #ruby
[20:55:36] baweaver: has joined #ruby
[20:55:50] lipoqil: has joined #ruby
[20:56:05] Polysics: has joined #ruby
[20:56:44] deject3d: has joined #ruby
[20:57:03] djbkd: has joined #ruby
[20:57:05] crunk_bear: has joined #ruby
[20:57:59] j4cknewt_: has joined #ruby
[20:58:19] benlieb: has joined #ruby
[20:59:40] jher: has joined #ruby
[21:00:00] djbkd: has joined #ruby
[21:00:38] yfeldblum: has joined #ruby
[21:00:47] imperator: alright golfers
[21:01:01] imperator: got: ["restype:container", "comp:list", "include:snapshots", "include:metadata", "include:uncommittedblobs"]
[21:01:51] imperator: need: comp:list\ninclude:metadata,snapshots,uncommittedblobs\nrestype:container
[21:02:16] imperator: note: alphabetical key:value
[21:02:24] yfeldblum: has joined #ruby
[21:03:12] Asher: has joined #ruby
[21:03:25] baweaver: you're up first.
[21:03:52] adaedra: Not really difficult. You can use a hash to collect all values and then some joins.
[21:03:54] kappy: has joined #ruby
[21:04:14] jhass: .each_with_object(Hash.new {|k, v| k[v] = [] }) {|e, hash| k, v = e.split(":"); hash[k] << v }.map {|k, v| "k:#{v.sort.join(",")}" }.sort.join("\n") ?
[21:04:42] renancarvalho: has joined #ruby
[21:04:43] yfeldblum: has joined #ruby
[21:06:06] imperator: adaedra, i know, just thought it would be an interesting golf challenge
[21:06:07] dfockler: Your 3rd block needs a #{} around the k
[21:07:37] dfockler: can we give you a medal or something?
[21:07:53] krisquigley: has joined #ruby
[21:08:10] robinboening: has joined #ruby
[21:08:13] imperator: jhass, nice
[21:08:14] baweaver: each_with_object({}){|e,h|k,v=e.split(':');h[k]<<v}.map{|k,v|k+':'+v.sort*','}.sort*"\n"
[21:08:18] giuseppesolinas: has joined #ruby
[21:08:19] giuseppesolinas_: has joined #ruby
[21:08:37] baweaver: >>%w(one two three) * "\n"
[21:08:38] ruboto: baweaver # => "one\ntwo\nthree" (https://eval.in/437754)
[21:08:58] RegulationD: has joined #ruby
[21:09:25] tomphp: has joined #ruby
[21:09:42] baweaver: each_with_object({}){|e,h|k,v=e.split(':');(h[k]||=[])<<v}.map{|k,v|k+':'+v.sort*','}.sort*"\n"
[21:10:04] bruno-: has joined #ruby
[21:10:48] imperator: baweaver, impressive
[21:11:15] paracr4ck: has joined #ruby
[21:11:42] baweaver: probably some dirty regex way to go lower.
[21:11:47] baweaver: Ox0dea: ping
[21:11:47] voltalio: has joined #ruby
[21:11:54] baweaver: Ox0dea: there's code golf, tee up mate.
[21:12:29] j4cknewt: has joined #ruby
[21:13:41] tkuchiki: has joined #ruby
[21:14:07] adaedra: Maybe he's sleeping.
[21:14:16] adaedra: I never figured Ox0dea's operating times.
[21:14:25] adaedra: </confession>
[21:14:56] baweaver: Roughly Eastern Time Zone
[21:15:44] adaedra: Eastern America Time Zone?
[21:16:41] michael_mbp: has joined #ruby
[21:17:02] jdawgaz: has joined #ruby
[21:17:31] jamesaxl: has joined #ruby
[21:18:44] freerobby: has joined #ruby
[21:20:54] shevy: beaver time
[21:22:18] tomeara: has joined #ruby
[21:22:47] FernandoBasso: has joined #ruby
[21:22:48] swgillespie: has joined #ruby
[21:24:11] User458764: has joined #ruby
[21:27:17] workmad3: has joined #ruby
[21:27:20] j4cknewt_: has joined #ruby
[21:28:07] startupality: has joined #ruby
[21:29:50] jtoy: has joined #ruby
[21:31:51] pheuko: has joined #ruby
[21:32:52] rezzack1: has joined #ruby
[21:33:34] giuseppesolinas_: has joined #ruby
[21:33:36] giuseppesolinas: has joined #ruby
[21:34:15] kinduff: has joined #ruby
[21:35:38] User458764: has joined #ruby
[21:36:01] momomomomo: has joined #ruby
[21:37:42] Technodrome: has joined #ruby
[21:41:07] petricore: has joined #ruby
[21:41:56] j4cknewt: has joined #ruby
[21:42:43] dfockler: has joined #ruby
[21:43:06] Skelz0r: has joined #ruby
[21:43:29] bricker: this would be an odd time for someone in Florida to be sleeping on a weekday
[21:43:36] tomphp: has joined #ruby
[21:43:54] bricker: or maybe not? I don't know I've never lived in Florida, maybe they take siestas
[21:44:47] havenwood: has joined #ruby
[21:46:32] beauby: has joined #ruby
[21:46:37] casadei_: has joined #ruby
[21:47:31] shevy: they have to fend off crocodiles early morning, so they have to sleep in the middle of the day
[21:47:36] sargas: has joined #ruby
[21:47:45] rikkipitt: has joined #ruby
[21:48:12] centrx: ^ Science
[21:48:48] deject3d: has joined #ruby
[21:49:29] jenrzzz: has joined #ruby
[21:49:30] bricker: shevy: ah, of course
[21:50:12] agent_meerkat: has joined #ruby
[21:54:18] ramfjord: has joined #ruby
[21:55:35] NeverDie: has joined #ruby
[21:57:30] garyst1981: has left #ruby: ()
[22:02:08] decoponyo: has joined #ruby
[22:02:41] malconis_: has joined #ruby
[22:05:08] workmad3: has joined #ruby
[22:05:54] einarj: has joined #ruby
[22:06:35] Nilium: has joined #ruby
[22:06:50] Beoran_: has joined #ruby
[22:08:09] yfeldblum: has joined #ruby
[22:08:11] shelling___: has joined #ruby
[22:08:22] sethetter: has joined #ruby
[22:08:22] superrorc: has joined #ruby
[22:08:44] pizzaops: has joined #ruby
[22:08:50] crayfishx: has joined #ruby
[22:09:12] hobodave: has joined #ruby
[22:09:16] karapetyan: has joined #ruby
[22:09:25] zipkid: has joined #ruby
[22:09:28] edenc: has joined #ruby
[22:09:38] Jardayn_two: has joined #ruby
[22:10:08] GarethAdams: has joined #ruby
[22:10:44] Mekkis: has joined #ruby
[22:10:50] sparr: has joined #ruby
[22:10:59] yo61: has joined #ruby
[22:11:05] levifig: has joined #ruby
[22:12:33] jtdowney: has joined #ruby
[22:12:33] jtdowney: has joined #ruby
[22:12:44] marahin_: has joined #ruby
[22:12:59] bcavileer: has joined #ruby
[22:13:05] yeltzooo: has joined #ruby
[22:13:09] Yzguy: has joined #ruby
[22:13:13] Torrieri: has joined #ruby
[22:13:32] j4cknewt_: has joined #ruby
[22:13:54] shortdudey123: has joined #ruby
[22:14:08] yfeldblum: has joined #ruby
[22:14:41] twodayslate: has joined #ruby
[22:14:53] braincrash: has joined #ruby
[22:14:59] gf3: has joined #ruby
[22:15:12] Silex^^: has joined #ruby
[22:15:22] heftig: has joined #ruby
[22:15:25] wlanboy: has joined #ruby
[22:15:42] alekst_: has joined #ruby
[22:15:43] dbussink: has joined #ruby
[22:16:03] Leef_: has joined #ruby
[22:16:06] AccordLTN: has joined #ruby
[22:16:20] lkba: has joined #ruby
[22:16:29] tangentstorm: has joined #ruby
[22:16:41] amitchellbullard: has joined #ruby
[22:16:46] camilasan: has joined #ruby
[22:16:48] ghoti: has joined #ruby
[22:16:54] varesa: has joined #ruby
[22:17:11] Mekkis: has joined #ruby
[22:17:12] Nirgali42: has joined #ruby
[22:17:14] frankS2: has joined #ruby
[22:17:18] gz0: has joined #ruby
[22:17:50] Leef_: has joined #ruby
[22:17:54] prasselpikachu_: has joined #ruby
[22:18:11] rickmasta: has joined #ruby
[22:18:29] voltalio: has joined #ruby
[22:18:38] Evans: has joined #ruby
[22:18:42] polly_wog: has joined #ruby
[22:19:16] Leef90: has joined #ruby
[22:19:39] mistym: has joined #ruby
[22:19:39] mistym: has joined #ruby
[22:19:43] casadei_: has joined #ruby
[22:20:19] akkad: has joined #ruby
[22:20:36] devoldmx: has joined #ruby
[22:21:01] spider-mario: has joined #ruby
[22:21:03] preyalone: has joined #ruby
[22:21:07] Ox0dea: I was helping a mate with some moving and we took an early lunch.
[22:21:21] FernandoBasso: has joined #ruby
[22:21:45] sepp2k: has joined #ruby
[22:21:47] Ox0dea: shevy: It's true about the crocs, though.
[22:21:49] bodgix: has joined #ruby
[22:23:01] mondayrain: has joined #ruby
[22:23:22] workmad3: has joined #ruby
[22:23:46] einarj: has joined #ruby
[22:24:19] deject3d: has joined #ruby
[22:24:31] Makorak: has joined #ruby
[22:25:02] snockerton: how do i get data out of a data bag within a recipe?
[22:25:04] jokke|: has joined #ruby
[22:25:11] snockerton: oops, sry wrong channel
[22:25:53] MeMoc: has joined #ruby
[22:26:17] rfv: has joined #ruby
[22:26:38] unop: has joined #ruby
[22:26:47] deavid: has joined #ruby
[22:27:03] dravine: has joined #ruby
[22:27:11] michael_mbp: has joined #ruby
[22:27:25] hyperdrive: has joined #ruby
[22:28:37] baweaver: has joined #ruby
[22:28:37] mary5030: has joined #ruby
[22:28:46] Bish_: has joined #ruby
[22:29:01] dfockler: Who ran off with my data bags!?
[22:29:21] shevy: don't leave your data unattended
[22:30:06] Ox0dea: baweaver: Yours is 94; I've got it down to 65. ^_^
[22:30:07] dfockler: How will be able to fly on Chef airlines without my data bags?
[22:30:20] baweaver: This surprises me not
[22:30:31] Ox0dea: group_by{|s|s[/\w+/]}.map{|k,v|k+?:+v.map{|x|x[/\w+$/]}*?,}.sort*?\n
[22:30:50] Ox0dea: You called it regarding Regexp.
[22:30:54] dfockler: we still doing that golf example?
[22:30:57] andrew-l: has left #ruby: ("ERC Version 5.3 (IRC client for Emacs)")
[22:31:05] Ox0dea: ?c characters pared it down a fair bit as well.
[22:31:05] ruboto: characters, I don't know anything about c
[22:31:06] adaedra: Ox0dea was late, dfockler
[22:31:06] zenspider: sweet jesus
[22:31:09] baweaver: except it's grouping by the keys
[22:31:20] baweaver: zenspider: that's actually pretty tame for him.
[22:31:29] baweaver: have you seen FizzBuzz yet?
[22:31:39] zenspider: not sure what I walked into
[22:31:40] Ox0dea: baweaver: Yes, it's supposed to be grouping by the keys?
[22:32:01] baweaver: got: ["restype:container", "comp:list", "include:snapshots", "include:metadata", "include:uncommittedblobs"]
[22:32:06] baweaver: need: comp:list\ninclude:metadata,snapshots,uncommittedblobs\nrestype:container
[22:32:26] baweaver: note, include:metadata,snapshots
[22:32:40] baweaver: missed one, but you get what I was going for.
[22:32:53] baweaver: \w doesn't match ?: does it
[22:32:56] blackmesa: has joined #ruby
[22:33:04] baweaver: that'd do it
[22:33:43] j4cknewt: has joined #ruby
[22:33:48] baweaver: more of a derp and realization comment
[22:33:53] Ox0dea: Ah, I did forget to sort the values, though.
[22:34:24] Ox0dea: https://eval.in/437769
[22:34:38] benlovell: has joined #ruby
[22:34:48] workmad3: has joined #ruby
[22:34:51] Ox0dea: baweaver: Yours borked Vim's highlighting, and mine eval.in's.
[22:35:01] ellisTAA: has joined #ruby
[22:35:10] baweaver: eh, twas a five minute hack
[22:35:38] baweaver: I'll have to say 5 Hail Matz's for that transgression.
[22:35:45] devbug_: has joined #ruby
[22:36:02] Ox0dea: Wait, what actually happened there?
[22:36:21] Ox0dea: What are the red boxes meant to indicate?
[22:36:36] modern: has joined #ruby
[22:36:48] baweaver: https://gist.github.com/baweaver/b7a376f81e9bbf2ac2cf - For those wishing to repent transgressions against Ruby
[22:37:06] dfockler: Why?! Why does join have a shorthand!?
[22:38:23] tomphp: has joined #ruby
[22:38:50] casadei_: has joined #ruby
[22:39:45] dfockler: I'll never know all the syntax in ruby will I?
[22:39:57] ngscheurich: has joined #ruby
[22:40:29] luckyme: has joined #ruby
[22:41:07] jackjackdripper: new to ruby here how can I escape a nil value?
[22:41:30] jhass: jackjackdripper: "escape"? what context? what's your code? what's your error?
[22:41:50] dfockler: where were you on the night of April 23rd!
[22:42:09] jackjackdripper: undefined method `[]' for nil:NilClass (NoMethodError)
[22:42:24] baweaver: then don't call it on nil
[22:42:32] Ox0dea: dfockler: It's dangerous to go alone! Here, take this:
[22:42:34] jackjackdripper: i'll sanitize the code since it's an erb
[22:42:34] Ox0dea: >> ->*{[]}::()
[22:42:35] ruboto: Ox0dea # => [] (https://eval.in/437771)
[22:42:45] Ox0dea: (It's some kind of sword.)
[22:42:58] [k-: has joined #ruby
[22:43:00] jhass: wait, .() works for :: too?
[22:43:13] [k-: Ox0dea!
[22:43:16] jhass: omg, why matz, why
[22:43:29] adaedra: because ruby.
[22:43:45] Wolland: has joined #ruby
[22:43:46] Ox0dea: >> class Array; alias call reduce; end; [1,2,3]::(:+)
[22:43:47] ruboto: Ox0dea # => 6 (https://eval.in/437772)
[22:43:51] Ox0dea: The parentheses being necessary is lame.
[22:44:03] Ox0dea: Triple-colon would probably be unique to Ruby.
[22:44:10] opensource_ninja: has joined #ruby
[22:44:43] dfockler: What is that splat doing?
[22:44:58] Ox0dea: dfockler: Adding to the confusion.
[22:45:08] baweaver: *args effectively.
[22:45:09] Ox0dea: It permits the lambda to receive any number of arguments, but they're inaccessible without a name.
[22:45:11] dfockler: It's doing it's job admirably
[22:45:20] torpig: has joined #ruby
[22:45:24] Ox0dea: Well, "inaccessible".
[22:45:27] Ox0dea: This is Ruby, after all.
[22:46:09] baweaver: don't tempt me.
[22:46:23] jackjackdripper: here is the code
[22:46:25] jackjackdripper: http://pastebin.com/GWe1Bv7u
[22:46:25] ruboto: jackjackdripper, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/491845019b3d14ad1940
[22:46:25] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[22:46:36] jhass: oh wait test without arguments returns 1
[22:47:24] jhass: jackjackdripper: ohai_hash (unlikely, only if your json is "null") or ohai_hash["core"] returns nil
[22:47:29] [k-: puts *cores.compact
[22:47:32] [k-: so clever
[22:47:36] Ox0dea: [k-: No need to splat.
[22:47:46] [k-: that was just in case!
[22:48:12] dfockler: wow immediately called procs!
[22:48:14] j4cknewt: has joined #ruby
[22:48:36] Ox0dea: dfockler: IIFEs in Ruby!
[22:48:40] Ox0dea: ~ $ chruby-exec 1.8 -- ruby -e 'puts [1,2,3]' | wc -l
[22:48:44] Ox0dea: [k-: In case he's running 1.7?
[22:48:51] jackjackdripper: i'm trying to escape it if it returns null
[22:48:57] jackjackdripper: how do I go about it?
[22:49:01] [k-: ACTION nods slowly
[22:49:09] Ox0dea: jackjackdripper: Define "escape".
[22:49:11] jhass: jackjackdripper: first verify which of the two issues it is
[22:49:26] RickHull: has joined #ruby
[22:49:30] jhass: use `p ohai_hash` to inspect it
[22:49:37] jhass: before line 5
[22:49:37] banister: has joined #ruby
[22:49:45] dfockler: >> ->{[]}.call #A more boring version
[22:49:46] ruboto: dfockler # => [] (https://eval.in/437773)
[22:50:03] ericjphillips: has joined #ruby
[22:50:07] Ox0dea: dfockler: -> can be made much more boring.
[22:50:32] Ox0dea: `->{}` == `lambda do end`.
[22:50:36] [k-: Inlined version: [[
[22:51:08] Ox0dea: [k-: Can we use you as a Ruby compiler?
[22:51:45] chouhoulis: has joined #ruby
[22:52:03] dfockler: ACTION compiling any program "That uhhh does some stuff"
[22:52:20] jhass: >> require "json"; JSON.parse("1") # weird, what might the reason for that?
[22:52:21] [k-: i won't look through your code!
[22:52:21] ruboto: jhass # => A JSON text must at least contain two octets! (JSON::ParserError) ...check link for more (https://eval.in/437774)
[22:52:41] jhass: ah they still didn't update to the new spec I guess
[22:52:46] swgillespie: has joined #ruby
[22:52:49] dfockler: Is that valid JSON?
[22:52:53] NeverDie: has joined #ruby
[22:53:18] Ox0dea: The outermost JSON value must be a collection.
[22:53:19] jackjackdripper: ohai_hash is not nil but ohai_hash["core"]["cores"] was nil. I essentially would prefer that it ignores the nil value from the hash and set the ' ' value
[22:53:25] jhass: Ox0dea: no longer
[22:53:39] Ox0dea: Is that so?
[22:54:22] jhass: https://tools.ietf.org/html/rfc7159#section-2
[22:54:38] jhass: root grammar is value now, not object
[22:55:48] Ox0dea: Where's the video footage of Crockford eating a crow?
[22:56:02] jhass: jackjackdripper: the error message indicates that ohai_hash["core"] is nil (null or not existent), so check that before calling ["cores"] on it
[22:56:50] drbrain: pro-tip: if an element in a Hash is nullable, use Hash#fetch
[22:57:04] j4cknewt_: has joined #ruby
[22:57:08] dfockler: >> {"":->*{[]}}[:""]::()
[22:57:09] ruboto: dfockler # => [] (https://eval.in/437775)
[22:57:16] Ox0dea: Ooh, that's purdy.
[22:57:17] drbrain: ohai_hash.fetch 'core' # raises KeyError if the element is not found
[22:57:30] giuseppesolinas: has joined #ruby
[22:57:30] giuseppesolinas_: has joined #ruby
[22:57:47] Narzew: Why data=File.read(x) don't work with binary data on windows? It works with binary data well on Linux (tested on Zlib compression); I use working but complicated equivalent on Windows: data=lambda{File.open(x,'rb'){|r|return r.read}}.call
[22:58:47] jhass: Narzew: might need the File.read(x, "rb") explicitly
[22:58:54] Ox0dea: >> -~-~-~->{$.}[]
[22:58:55] ruboto: Ox0dea # => 3 (https://eval.in/437780)
[22:59:04] jackjackdripper: i'll revise this further
[22:59:08] Ox0dea: It's a program that counts the number of squigglies.
[22:59:43] Narzew: jhass: thanks ;)
[23:00:19] wallerdev: has joined #ruby
[23:00:22] drbrain: Narzew: or File.binread
[23:01:06] dravine: has joined #ruby
[23:01:08] drbrain: Narzew: windows is special and does newline conversion for historical reasons
[23:01:38] Ox0dea: Are they really "historical" if they'll be with us forever?
[23:02:28] drbrain: the reasons are historical, but that is separate from when the behavior will change
[23:02:35] drbrain: or even if
[23:02:36] Narzew: I use windows only for playing games - almost all programming work I do on Linux
[23:02:51] dorei: from an old typewritter perspective the windows approach to newlines seams correct xD
[23:04:21] Narzew: i have some encoding errors, when I read contents to gsub from file all works ok, but when I type str.gsub("??????","ace") for example I get error in that line; #encoding: utf-8 is my first line of script, any ideas ?
[23:05:03] ngscheurich: has joined #ruby
[23:05:40] jhass: does that actually reflect your file encoding?
[23:05:43] jhass: given windows...
[23:05:55] RickHull: dorei: from files as a stream of bytes perspective, the windows approach is hilarious
[23:06:02] jhass: declaring it as utf-8 doesn't make your editor save it as such
[23:06:14] tvon: has joined #ruby
[23:07:06] Narzew: So I need to use UTF-8 encoding for script file, yeah ? Is the way to fix ASCII-8BIT and UTF-8 incompatibility on the fly?
[23:07:38] jhass: yes, try to use UTF-8 always and everywhere
[23:07:47] jhass: especially for code these days
[23:09:06] beauby: has joined #ruby
[23:09:30] jhass: wait, is str the thing you read with File.binread / File.read(, "rb") ?
[23:11:06] Narzew: no, this is two separate questions; I use File.binread to read compressed data: Zlib ( Marshal.dump large table )
[23:11:27] Gachr: has joined #ruby
[23:11:35] weemsledeux: has joined #ruby
[23:11:38] Narzew: and I sometimes get encoding compatibility errors where I parse .html to generate these tables
[23:11:49] Gachr: Hi guys, I can't find how it is possible to make hidden enter field in a cmd.
[23:12:12] jhass: cmd like windows cmd?
[23:12:21] Gachr: I mean bash.
[23:12:33] j4cknewt: has joined #ruby
[23:12:42] Gachr: If you for example log in to a user in Linux, you type but you don't see that/
[23:12:56] eam: Gachr: you want to unset the echo flag on your terminal
[23:13:04] jhass: Gachr: http://devdocs.io/ruby/io#method-i-noecho
[23:13:28] fullofcaffeine: has joined #ruby
[23:14:25] jhass: Narzew: sounds like you read your HTML in the wrong encoding then
[23:14:34] NeverDie: has joined #ruby
[23:14:45] Gachr: jhass; Thanks, however I never used STDIN instead of gets before tho.
[23:14:49] jhass: specifically in no encoding (ASCII-8bit is just bytes)
[23:15:05] jhass: Gachr: don't worry, just try it
[23:15:39] Narzew: jhass: most of files work fine, but sometimes I get problem with encoding, so I guess some of .html are ASCII-8BIT encoded
[23:15:46] voltalio: has joined #ruby
[23:16:22] jhass: Narzew: ASCII-8bit is no encoding, hence it's also aliases as "binary". It's there for things that are just sequences of bytes
[23:16:48] charliesome: has joined #ruby
[23:16:59] rikkipitt: has joined #ruby
[23:17:03] jhass: a html document can't really be ASCII-8bit encoded, you just read it with that (and thus effectively with no encoding)
[23:18:53] platzhirsch: has joined #ruby
[23:19:33] Gachr: jhass; It works after playing with it, thanks. The only issue is that it doesn't insert a newline, can I do it with the STDIN thingy or do I need to just print a newline separately?
[23:19:54] platzhirsch: apeiros: Another funny fact about the posted code with the bijective function
[23:20:07] Ox0dea: Gachr: Do take some time to clarify your understanding of this "STDIN thingy"; it's quite important.
[23:20:10] platzhirsch: this can be shortened by using Fixnum#to_s(base)
[23:20:15] platzhirsch: Ruby has it all
[23:20:39] Ox0dea: platzhirsch: It doesn't have Unicode character name literals. :/
[23:20:41] jhass: Gachr: stdin is where you read from, the newline should go to stdout, so a regular puts is fine
[23:20:51] Gachr: Ox0dea; I do understand it.
[23:21:13] platzhirsch: Ox0dea: say that again?
[23:21:19] r00ster: has joined #ruby
[23:21:40] mary5030: has joined #ruby
[23:22:10] Ox0dea: platzhirsch: You can, for instance, say '\N{PILE OF POO' in Python.
[23:22:17] Ox0dea: *'\N{PILE OF POO}'
[23:22:17] Gachr: jhass; I just inserted it in the beginning of the next puts, thanks, you helped me create an app for evil purposes.
[23:22:45] platzhirsch: and the semantic of it is what?
[23:22:46] Ox0dea: Perl and LOLCODE too, but not Ruby. :(
[23:22:55] Ox0dea: platzhirsch: PILE OF POO is a Unicode character.
[23:23:07] mjs2600: has joined #ruby
[23:23:16] Ox0dea: We have to say "\u{1f4a9}" in Ruby.
[23:23:22] Ox0dea: And I think that's a damned shame.
[23:23:25] platzhirsch: The name literal for the Unicode
[23:23:27] platzhirsch: why didn't you say so
[23:23:34] shpoont: has joined #ruby
[23:23:36] Ox0dea: > Unicode character name literals
[23:23:36] platzhirsch: yeah that kinda sucks, I agree
[23:23:37] Narzew: Hidden Input in Ruby Example: https://pastebin.com/K3dbtAbj
[23:23:38] ruboto: Narzew, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/c010a8b20de83264b8fb
[23:23:38] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[23:23:44] pengin: has joined #ruby
[23:24:04] sp3: magical.
[23:24:32] platzhirsch: Ox0dea: what could it be used for?
[23:24:53] Ox0dea: platzhirsch: You know how "magic numbers" are frowned upon?
[23:25:02] platzhirsch: magic numbers?
[23:25:04] voltalio: has joined #ruby
[23:25:05] platzhirsch: You mean complex numbers?
[23:25:20] Ox0dea: https://en.wikipedia.org/wiki/Magic_number_(programming)
[23:25:24] Gachr: Thanks and cya guys.
[23:25:50] platzhirsch: cya? This isn't 1999
[23:25:56] shpoont: has joined #ruby
[23:26:02] jhass: https://en.wikipedia.org/wiki/Magic_number_%28programming%29#Unnamed_numerical_constants specifically
[23:26:40] platzhirsch: Well, wasn't that a necessity back than due to memory limitations?
[23:26:42] sp3: platzhirsch, magic numbers refer to literal values, as opposed to any sort of constant - where you directly use a `number` of no significant meaning in code.
[23:26:54] Ox0dea: platzhirsch: Not really.
[23:26:57] Ox0dea: Naming things is hard.
[23:27:11] Ox0dea: But the Unicode Consortium has already done the hard part for us in this case.
[23:27:27] sp3: platzhirsch, i think 0 and 1 are mostly the only sort of exceptions to this.
[23:27:48] Ox0dea: And yet <stdbool> is a thing.
[23:27:52] sp3: but hardcoded values are bad mojos.
[23:27:55] j4cknewt: has joined #ruby
[23:27:59] platzhirsch: As a UNIX user I don't frown too much upon it ;) but I get it
[23:28:02] ellisTAA: has joined #ruby
[23:28:09] sp3: platzhirsch, which UNIX do you use?
[23:28:25] Ox0dea: platzhirsch: That's not a UNIX.
[23:29:47] platzhirsch: As a UNIX-like user I don't frown too much upon it ;) but I get it
[23:30:01] CloCkWeRX: has joined #ruby
[23:30:01] platzhirsch: I want to call my lawyer!
[23:30:07] CloCkWeRX: has left #ruby: ()
[23:30:20] Narzew: has joined #ruby
[23:30:22] RickHull: It's a Gnu's Not Unix / Linux
[23:30:51] sp3: I wonder how many people use Linux think they're using UNIX.
[23:31:11] RickHull: linux is a unix in some sense
[23:31:20] RickHull: the categories are fuzzy
[23:31:27] blackmesa: has joined #ruby
[23:32:14] platzhirsch: Well, insisting that there is a big difference is surely farting into the gravel
[23:32:26] RickHull: better than a straw, I suppose
[23:32:29] platzhirsch: but I can sympathize, I also insist on differentiating methods vs. functions
[23:32:43] RickHull: http://slatestarcodex.com/2014/11/21/the-categories-were-made-for-man-not-man-for-the-categories/
[23:33:49] Ox0dea: platzhirsch: Which language do we have to thank for that colorful expression?
[23:34:01] pwnd_nfsw: has joined #ruby
[23:34:25] RickHull: reminiscent of pissing into the wind
[23:34:34] Ox0dea: Except there are repercussions there.
[23:34:57] platzhirsch: Surely is some very niche phrase even in that language
[23:35:16] Ox0dea: "Pissing into the wind" isn't terribly obscure.
[23:35:49] Ox0dea: platzhirsch: Does Ruby have functions?
[23:35:51] vF3hNGxc47h8: has joined #ruby
[23:36:15] platzhirsch: oh it has actually a different meaning, it means something a long the lines of building upon sand, basically misjudgement of a situation
[23:36:26] j4cknewt: has joined #ruby
[23:38:10] slackbotgz: has joined #ruby
[23:38:17] platzhirsch: Ox0dea: I just tell people to inhabit the language's name convention
[23:38:30] Ox0dea: platzhirsch: So methods vs. functions is about naming?
[23:38:59] platzhirsch: from a CS point of view I'd always argue, it's not a function unless it evaluates to a result
[23:39:34] bigmac: has joined #ruby
[23:39:42] Technodrome: has joined #ruby
[23:40:04] RickHull: has left #ruby: ()
[23:40:21] Ox0dea: It should be a crime to so thoroughly beat around a bush.
[23:40:56] platzhirsch: I didn't mean names as in naming things, but rather how constructs like sub-routines are normally called in a particular language
[23:41:47] centrx: Ox0dea, You could call a method defined outside of a class in a simple script, a function
[23:42:01] centrx: Ox0dea, Or things like lambda or procs
[23:42:28] platzhirsch: I personally wouldn't
[23:42:47] j4cknewt: has joined #ruby
[23:42:54] platzhirsch: though I get the point, because methods are often seen in a OOP related concept
[23:44:21] pabs: has joined #ruby
[23:45:20] Moblin: has joined #ruby
[23:45:56] Ox0dea: platzhirsch: The notion of a method doesn't make sense outside of object-orientation.
[23:46:08] michael_mbp: has joined #ruby
[23:46:22] michael_mbp: has joined #ruby
[23:47:14] j4cknewt_: has joined #ruby
[23:48:33] yfeldblum: has joined #ruby
[23:48:53] jdawgaz: has joined #ruby
[23:49:13] baweaver: has joined #ruby
[23:50:15] quazimodo: has joined #ruby
[23:50:24] Ox0dea: centrx: Yes, Procs are functions, but methods defined at the top level are not, technically (and even definitionally, in Ruby's case).
[23:50:46] tmtwd: has joined #ruby
[23:51:06] centrx: Would a rose by any other name execute as efficiently?
[23:51:57] Ox0dea: Precision matters.
[23:52:14] platzhirsch: As does farting into the gravel.
[23:52:24] yfeldblum: has joined #ruby
[23:52:42] platzhirsch: Procs are first and foremost objects
[23:53:43] Ox0dea: No, that Procs are objects is an implementation detail.
[23:55:22] Maletor: has joined #ruby
[23:55:22] platzhirsch: Proc for me is an implementation of a concept that is called subroutine
[23:56:13] platzhirsch: Because Proc is such a Ruby-specific thing if you want to go down that route
[23:56:19] Ox0dea: It's really not, though.
[23:56:22] Ox0dea: A Proc is just a closure.
[23:56:50] platzhirsch: Then you have a different definition of subroutine than me
[23:57:12] Ox0dea: platzhirsch: Do subroutines have an environment?
[23:57:27] bazbing80: is it possible to use matchers that support block expectations like this: | it{ is_expected.to raise_error } | Because that fails. I only get block matchers to work if using the specify method: | specify{ expect{ foo }.to raise_error } | Is that normal?
[23:57:31] platzhirsch: That again is implementation detail
[23:57:31] bazbing80: I hope the next version of rspec will support it{ is_expected.to raise_error } for block matchers if this is indeed normal!
[23:58:52] platzhirsch: oh that's cool Closures go back to functional programming, lambda calculus, how dare you mixing lambda calculus with something so procedural like Ruby
[23:59:22] Ox0dea: platzhirsch: Your misconstrual is almost painful to behold.
[23:59:24] aghalarp: has joined #ruby
[23:59:39] duncannz: has joined #ruby
[23:59:43] Ox0dea: Ruby is quite "functional", precisely because of things like Proc and blocks.