« Back to channel list

#ruby - 18 May 2016

« Back 1 day Forward 1 day »
[00:00:13] tgeeky: i actually need one class variable here :o
[00:00:42] tgeeky: Radar: the problem is that the Source initializer isn't called before the transform initializer is.
[00:00:45] tgeeky: so there is no count
[00:01:57] eljimmy: has joined #ruby
[00:02:18] Hyuk: has joined #ruby
[00:02:35] eljimbo: has joined #ruby
[00:03:46] nettoweb: has joined #ruby
[00:03:53] akiTendo: has joined #ruby
[00:04:32] shakes: has joined #ruby
[00:04:57] ramfjord: has joined #ruby
[00:04:58] arescorpio: has joined #ruby
[00:05:47] gtsai_: has joined #ruby
[00:06:32] |2701: has joined #ruby
[00:06:32] |2701: has joined #ruby
[00:07:05] Es0teric: has joined #ruby
[00:08:04] RegulationD: has joined #ruby
[00:08:36] Oclair: has joined #ruby
[00:10:46] tAn: has joined #ruby
[00:12:54] impermanence: has joined #ruby
[00:12:59] akiTendo: has joined #ruby
[00:13:23] hahuang65: has joined #ruby
[00:13:32] n_blownapart: has joined #ruby
[00:13:48] astrobunny: has joined #ruby
[00:16:24] Ropeney: has joined #ruby
[00:16:39] chouhoulis: has joined #ruby
[00:16:51] jancel: has joined #ruby
[00:17:03] RegulationD: has joined #ruby
[00:17:15] LoneHerm_: has joined #ruby
[00:18:03] drewo: has joined #ruby
[00:18:03] cdg: has joined #ruby
[00:18:04] curses: has joined #ruby
[00:18:45] impermanence: has joined #ruby
[00:19:07] tAn: has joined #ruby
[00:22:46] Kus: has joined #ruby
[00:23:02] aghalarp: has joined #ruby
[00:26:32] zapata: has joined #ruby
[00:26:58] karmatr0n: has joined #ruby
[00:27:53] rickmasta: has joined #ruby
[00:30:12] tAn: has joined #ruby
[00:30:20] gtsai: has joined #ruby
[00:30:56] Kus: has joined #ruby
[00:35:38] tgeeky: Radar: got it working. ;)
[00:36:00] nergdnulg: has joined #ruby
[00:36:10] nergdnulg: has left #ruby: ()
[00:39:59] smathy_: has joined #ruby
[00:42:55] vdamewood: has joined #ruby
[00:44:10] halfamind: has joined #ruby
[00:46:04] akiTendo: has joined #ruby
[00:46:31] moei: has joined #ruby
[00:47:31] Devalo: has joined #ruby
[00:48:31] tAn: has joined #ruby
[00:49:37] halfamind1: has joined #ruby
[00:49:59] tatsuo: has joined #ruby
[00:51:41] whathappens: has joined #ruby
[00:56:55] Bman: has joined #ruby
[00:59:42] lewis1711: has joined #ruby
[01:01:50] Es0teric: has joined #ruby
[01:03:26] serafin88: has joined #ruby
[01:05:14] pawnbox: has joined #ruby
[01:09:24] nankyokusei: has joined #ruby
[01:10:27] tAn: has joined #ruby
[01:11:04] `tim`: has joined #ruby
[01:11:09] mtkd: has joined #ruby
[01:11:34] gtsai_: has joined #ruby
[01:11:46] curses: has joined #ruby
[01:15:22] astrobunny: has joined #ruby
[01:15:52] B1n4r10: has joined #ruby
[01:15:56] hahuang65: has joined #ruby
[01:18:37] weemsledeux: has joined #ruby
[01:19:51] tAn: has joined #ruby
[01:20:11] zapata: has joined #ruby
[01:22:28] bronson: has joined #ruby
[01:24:00] sneakerhax: has joined #ruby
[01:24:55] skweek: has joined #ruby
[01:28:03] youch: has joined #ruby
[01:29:25] skolman: has joined #ruby
[01:30:09] chosen1: has joined #ruby
[01:32:48] wrkrcoop: has joined #ruby
[01:34:35] serafin88: anyone is alive?
[01:34:55] Hyuk_: has joined #ruby
[01:35:19] XxJMGxX: has joined #ruby
[01:36:04] benzrf: hi serafin88
[01:38:16] dubin: has joined #ruby
[01:39:01] serafin88: Hi benzrf, Do you know where can I download a good tutorial of Ruby?
[01:40:07] moeabdol: has joined #ruby
[01:40:31] blackgoat: has joined #ruby
[01:40:59] IrishGringo: has joined #ruby
[01:41:14] pawnbox: has joined #ruby
[01:41:29] Hates_: has joined #ruby
[01:42:29] Limix: has joined #ruby
[01:43:30] benzrf: serafin88: hard question
[01:43:37] benzrf: serafin88: what's your prior programming experience?
[01:46:12] serafin88: I'm a newbie in Ruby
[01:51:25] benzrf: serafin88: but what other languages have you used? none?
[01:54:09] akiTendo: has joined #ruby
[01:56:07] serafin88: I used Python, and Javascript a bit
[01:56:14] gregf: has joined #ruby
[01:56:27] tAn: has joined #ruby
[01:57:48] roshanavand1: has joined #ruby
[01:58:09] blackmesa: has joined #ruby
[02:02:16] benzrf: serafin88: i'm probably not the best person to tell you what to look at, then
[02:02:22] benzrf: you may want to come back some other time
[02:03:06] serafin88: thanks benzrf :)
[02:03:27] tatsuo: has joined #ruby
[02:04:06] kam270: has joined #ruby
[02:05:50] benzrf: no problem
[02:06:12] jancel: has joined #ruby
[02:06:58] tAn: has joined #ruby
[02:12:13] grs: has joined #ruby
[02:15:58] astrobunny: has joined #ruby
[02:16:04] nando293921: has joined #ruby
[02:20:23] shazaum__: has joined #ruby
[02:26:16] chipotle: has joined #ruby
[02:26:43] catpoop: has joined #ruby
[02:27:38] gigetoo: has joined #ruby
[02:27:41] Nanuq: has joined #ruby
[02:28:26] rodfersou: has joined #ruby
[02:40:20] nullFxn: has joined #ruby
[02:45:38] |ifei5g00d: has joined #ruby
[02:45:43] EXCHGR: has joined #ruby
[02:46:20] jancel: has joined #ruby
[02:47:15] aries_liuxueyang: has joined #ruby
[02:47:55] EXCHGR: quick question. say i have a class that has a class method, and then it calls that class method from within the class, but that call doesn't happen within any method. when i reference that class from another class, when does the first class call its own method, if at all?
[02:49:24] beauby: exchgr: The call should happen when the class is defined (i.e. the first time you `require` the file it is defined in)
[02:51:01] beauby: (when I say "the class", I mean the first one you talked about)
[02:51:07] Yzguy: has joined #ruby
[02:53:02] EXCHGR: so that's what i thought. but alright, so riddle me this: these two classes are children of the same parent. the parent defines the class method, and the children call it. the first class's class method writes to a class variable, and the second class reads from it. because of the way class variables are in ruby, it's the same class variable that's accessible from both classes, right? but even though i've already required and referenced
[02:53:02] EXCHGR: the first class from within the second class, it seems that the first class hasn't done its job. but if i manually call that class method on the first class from the second class, it seems to work
[02:53:03] hutch34: has joined #ruby
[02:57:18] EXCHGR: trying to whip up an example of what i'm talking about
[02:58:07] chouhoulis: has joined #ruby
[02:58:24] aghalarp: has joined #ruby
[03:00:13] blackmesa: has joined #ruby
[03:00:43] aries_liuxueyang: has joined #ruby
[03:02:00] EXCHGR: @beauby: here ya go http://hastebin.com/cikuqujace.rb
[03:03:09] EXCHGR: there's an error thrown on line 11: in `belongs_to': undefined method `[]' for nil:NilClass (NoMethodError)
[03:03:19] zacts: shevy: indeed, I'm now to the _last_ ch of Head First Ruby. I feel awesome! \o/ I'll let you know when I actually complete it. (but not my other books, as I don't want to spam you either).
[03:04:07] EXCHGR: and that's because @@associations is nil. but it should be {:artist => {:album => :has_many}} by then, right?
[03:08:53] LoneHerm_: has joined #ruby
[03:08:58] moeabdol: has joined #ruby
[03:10:15] nankyokusei: has joined #ruby
[03:13:29] EXCHGR: hm i think i might have found the issue, but not the fix. it looks like i'm requiring album.rb before Artist is finished defining itself, including calling its own class method, which is a fun catch-22
[03:14:27] gix: has joined #ruby
[03:14:53] codeurge: has joined #ruby
[03:15:12] zast: has joined #ruby
[03:17:15] gtsai: has joined #ruby
[03:18:03] mistermocha: has joined #ruby
[03:18:23] braincrash: has joined #ruby
[03:21:50] JesseH: has joined #ruby
[03:23:48] pawnbox: has joined #ruby
[03:27:58] aries_liuxueyang: has joined #ruby
[03:28:36] Es0teric: has joined #ruby
[03:28:59] hahuang65: has joined #ruby
[03:30:54] beauby: exchgr: In the snipped you posted, you write to @@associations[class_name][association.singularize] and you read from @@associations[association][class_name]
[03:31:23] brendan-: has joined #ruby
[03:31:29] EXCHGR: yep, that's on purpose, since we're writing from one class and reading from another
[03:32:12] EXCHGR: class_name in one class should be the same as association.singularize in another, and vice versa
[03:33:03] halfamind: has joined #ruby
[03:33:42] beauby: Also, why do you need to require the other class?
[03:33:43] EXCHGR: on line 6, it's @@associations[:artist][:album], and on line 11, it's @@associations[:artist][:album], supposing class_name yields the name of the current class in downcased symbol form
[03:33:46] A5101: has joined #ruby
[03:33:51] EXCHGR: well i need them later on
[03:34:56] beauby: So do you expect the class attribute @@associations to be defined on the `Base` class?
[03:35:30] EXCHGR: i expect it to be defined when Artist calls has_many :albums
[03:36:01] nwhirschfeld: has joined #ruby
[03:38:35] Arcaire: has joined #ruby
[03:38:51] EXCHGR: i think my issue here is that Artist hasn't finished defining itself by the time it requires Album, and they require each other, so it's not exactly clear what the dependency order is
[03:39:19] rbennacer: has joined #ruby
[03:40:00] beauby: http://hastebin.com/mabujekeqi.rb
[03:40:13] beauby: This works, so your problem is probably somewhere else
[03:40:34] beauby: There is no "catch-22" of overlapping definitions because everything is defined sequentially
[03:41:00] mistermocha: has joined #ruby
[03:41:05] ftj: has joined #ruby
[03:43:31] Arcaire: has joined #ruby
[03:43:32] agent_white: has joined #ruby
[03:46:14] bluOxigen: has joined #ruby
[03:46:17] noService: has joined #ruby
[03:51:36] noService: has joined #ruby
[03:52:38] EXCHGR: i think the specifics of my issue were a little more twisted than i was letting on; i seem to have fixed the issue by dynamically requiring the association's file from within belongs_to
[03:53:04] EXCHGR: require_relative "./#{association}"
[03:57:07] mjuszczak: has joined #ruby
[04:01:53] astrobunny: has joined #ruby
[04:02:24] blackmesa: has joined #ruby
[04:04:08] pawnbox: has joined #ruby
[04:07:40] grs: has joined #ruby
[04:08:55] elifoster: has joined #ruby
[04:09:59] tAn: has joined #ruby
[04:10:11] kareeoleez: has joined #ruby
[04:10:12] LoneHermit: has joined #ruby
[04:10:24] duncannz: has joined #ruby
[04:18:15] pwnd_nsfw`: has joined #ruby
[04:18:19] jud: has joined #ruby
[04:19:58] nando293921: has joined #ruby
[04:22:03] griffindy: has joined #ruby
[04:24:59] bronson: has joined #ruby
[04:26:15] rbennacer: has joined #ruby
[04:29:07] lxsameer: has joined #ruby
[04:30:34] Guest43: has joined #ruby
[04:31:27] tildes_: has joined #ruby
[04:32:56] lewis1711: has joined #ruby
[04:34:55] ramfjord: has joined #ruby
[04:35:09] D9: has joined #ruby
[04:38:01] halfamind: has joined #ruby
[04:39:27] pawnbox: has joined #ruby
[04:40:15] aagdbl: has joined #ruby
[04:40:23] last_staff: has joined #ruby
[04:41:30] nertzy2: has joined #ruby
[04:43:14] kgrz: has joined #ruby
[04:44:25] tAn: has joined #ruby
[04:47:01] Tyrant_: has joined #ruby
[04:49:19] Devalo: has joined #ruby
[04:51:09] Devalo: has joined #ruby
[04:51:24] zzak: has joined #ruby
[04:54:50] lewis1711: has joined #ruby
[04:58:30] jaguarmagenta: has joined #ruby
[05:02:30] astrobunny: has joined #ruby
[05:02:39] jetpack_joe: has joined #ruby
[05:03:28] zzak: [travis-ci, irc.freenode.net] The build is still failing. by @naruse: See https://travis-ci.org/ruby/ruby/builds/131036136
[05:03:36] edmen_: has joined #ruby
[05:03:44] jud^: has joined #ruby
[05:04:06] Oclair_: has joined #ruby
[05:04:36] Azure|dc: has joined #ruby
[05:05:01] yaewa: has joined #ruby
[05:05:24] jaguarma_: has joined #ruby
[05:06:02] Zarthus_: has joined #ruby
[05:06:19] Yiota_: has joined #ruby
[05:06:31] lewis1711: has joined #ruby
[05:07:26] Miccet: has joined #ruby
[05:07:32] mwlang_: has joined #ruby
[05:08:01] angseus_: has joined #ruby
[05:08:05] nevynxxx_: has joined #ruby
[05:08:05] majuscul1: has joined #ruby
[05:08:15] connor_g1odwolf: has joined #ruby
[05:08:18] camilasann: has joined #ruby
[05:08:20] thorgi_: has joined #ruby
[05:08:23] mistermocha: has joined #ruby
[05:08:28] ltd_: has joined #ruby
[05:08:35] rarruda: has joined #ruby
[05:08:35] claws: has joined #ruby
[05:08:38] ptx0_: has joined #ruby
[05:08:51] atmosx_alt: has joined #ruby
[05:09:10] yokel_: has joined #ruby
[05:11:00] nankyokusei: has joined #ruby
[05:11:22] yfeldblum: has joined #ruby
[05:11:47] ceej_: has joined #ruby
[05:11:49] trajing-: has joined #ruby
[05:11:51] vircung__: has joined #ruby
[05:11:51] mr_rich101: has joined #ruby
[05:11:55] techietrash_: has joined #ruby
[05:11:57] Phanes-: has joined #ruby
[05:11:57] scottschecter_: has joined #ruby
[05:12:00] spk_: has joined #ruby
[05:12:03] jinie_: has joined #ruby
[05:12:03] Tharbakery: has joined #ruby
[05:12:03] tris-: has joined #ruby
[05:12:05] unCork: has joined #ruby
[05:12:07] tabakhase__: has joined #ruby
[05:12:08] jyaworski_: has joined #ruby
[05:12:11] kitallisii: has joined #ruby
[05:12:14] Olipro_: has joined #ruby
[05:12:15] martinbjeldbak_: has joined #ruby
[05:12:22] elaptic``: has joined #ruby
[05:13:13] bluOxigen: has joined #ruby
[05:13:15] imajes: has joined #ruby
[05:13:19] djbkd: has joined #ruby
[05:13:26] theRoUS: has joined #ruby
[05:13:48] Dry_Lips: has joined #ruby
[05:13:48] Dry_Lips: has joined #ruby
[05:14:34] CloCkWeRX: has joined #ruby
[05:14:35] go|dfish: has joined #ruby
[05:14:52] aries_liuxueyang: has joined #ruby
[05:14:52] roger_rabbit: has joined #ruby
[05:14:55] gomix: has joined #ruby
[05:14:57] papachan: has joined #ruby
[05:15:29] LoneHermit: has joined #ruby
[05:15:46] cybrside: has joined #ruby
[05:16:02] Raboo: has joined #ruby
[05:17:49] akkad: has joined #ruby
[05:17:57] tax: has joined #ruby
[05:22:30] hack_fish: has joined #ruby
[05:23:53] Phanes: has joined #ruby
[05:25:23] emilkarl: has joined #ruby
[05:25:39] jackjackdripper: has joined #ruby
[05:27:16] aries_liuxueyang: has joined #ruby
[05:32:01] sauvin: has joined #ruby
[05:36:46] gtsai_: has joined #ruby
[05:37:38] postmodern: has joined #ruby
[05:37:49] aufi: has joined #ruby
[05:42:47] mistermocha: has joined #ruby
[05:44:14] chipotle: has joined #ruby
[05:46:42] ravishankarjha: has joined #ruby
[05:47:17] mistermocha: has joined #ruby
[05:51:55] DrCode: has joined #ruby
[05:52:54] Coldblackice: has joined #ruby
[05:53:43] tAn: has joined #ruby
[05:57:12] TomyLobo: has joined #ruby
[05:57:26] kareeoleez: has joined #ruby
[05:59:46] kareeoleez: has joined #ruby
[05:59:48] zzak: [travis-ci, irc.freenode.net] The build is still failing. by @nobu: See https://travis-ci.org/ruby/ruby/builds/131042346
[06:01:32] nankyokusei: has joined #ruby
[06:01:45] Radar: zzak: Are those travis notifications intentional?
[06:02:01] skade: has joined #ruby
[06:02:56] moeabdol: has joined #ruby
[06:03:29] Alazoral: has joined #ruby
[06:04:00] blackmesa: has joined #ruby
[06:04:34] lxsameer: has joined #ruby
[06:07:07] K7: has joined #ruby
[06:11:03] kgrz: https://github.com/ruby/ruby/blob/trunk/lib/csv.rb#L1306 I wonder why CSV module didn't choose to coerce the first argument to a string
[06:13:49] kgrz: CSV.parse(user_submitted_data) might fail if user_submitted_data is anything other than a string (or a pathname perhaps)
[06:14:12] Radar: Why would someone pass it a non-string?
[06:14:49] WhatsGoingOn: has joined #ruby
[06:15:07] kgrz: I was writing a spec for this and accidentally used a non-string value for the input, so ran in to this issue. :D Now confused whether I should even consider that case
[06:15:58] jaguarmagenta: has joined #ruby
[06:16:01] pLaToOn: has joined #ruby
[06:17:56] solars: has joined #ruby
[06:20:02] tAn: has joined #ruby
[06:21:21] d0lph1n98: has joined #ruby
[06:21:31] mistermocha: has joined #ruby
[06:22:09] crystal77: has joined #ruby
[06:24:51] dudepare: has joined #ruby
[06:27:25] firstdayonthejob: has joined #ruby
[06:27:43] bronson: has joined #ruby
[06:29:36] psf: has joined #ruby
[06:30:33] tAn: has joined #ruby
[06:31:24] hightower3: has joined #ruby
[06:31:41] CloCkWeRX: has joined #ruby
[06:31:49] Jasonc: has joined #ruby
[06:32:57] d0nn1e: has joined #ruby
[06:32:57] aganov: has joined #ruby
[06:33:50] Jasonc: sorry to be a bother. I'm new to Ruby, I was wondering if anyone here had any experience with rspec
[06:34:59] Radar: Not a bother at all.
[06:35:00] lxsameer: has joined #ruby
[06:35:10] Radar: Yes there are people here who have experience with RSpec. What's up?
[06:36:15] Omni_: has joined #ruby
[06:36:47] Radar: Jasonc: ^
[06:37:48] Jasonc: trying to intialize a class but I can't due to an instance variable that should be declared first
[06:38:29] Radar: Jasonc: ?code
[06:38:35] Radar: ?code Jasonc
[06:38:35] ruby[bot]: Jasonc: We can't help you without your code, please post it to https://gist.github.com
[06:39:16] biberu: has joined #ruby
[06:39:45] kraken: has joined #ruby
[06:40:01] kraken: If I install a gem in the wrong directory, did I majorly fuck things up?
[06:40:08] Jasonc: It's work based code so I can't.
[06:42:33] heftig: _kraken: restore your honor through sacred sepukku
[06:42:56] Jasonc: Wow bit hardcore for Ruby
[06:42:58] _kraken: <heftiq> lol what do you mean
[06:43:23] heftig: _kraken: just delete the files installed?
[06:43:46] heftig: use gem uninstall with the same install dir?
[06:43:48] emilkarl: has joined #ruby
[06:44:18] mikar: has joined #ruby
[06:44:20] _kraken: I'm just confused because I just gem install rspec for instance
[06:44:26] _kraken: but I wasnt under ~
[06:44:30] _kraken: when I did it
[06:44:38] _kraken: did that fuck things up or nah?
[06:44:42] heftig: Jasonc: make a code snippet that shows the same problem
[06:44:55] heftig: _kraken: no
[06:45:25] _kraken: Ah I see, so it doesn't matter what directory I'm currently in when I install a gem?
[06:45:32] _kraken: in the terminal that is
[06:45:49] _kraken: uhh yes? no? I'm confused
[06:45:56] heftig: it doesn't matter
[06:46:33] _kraken: not really
[06:47:49] idefine: has joined #ruby
[06:48:17] hk238: has joined #ruby
[06:50:34] Jet4Fire: has joined #ruby
[06:52:49] Radar: Jasonc: Ok. I can't really help you without seeing any code.
[06:56:03] agit0: has joined #ruby
[06:56:10] Oclair: has joined #ruby
[06:56:26] agit0: has joined #ruby
[06:56:32] ur5us: has joined #ruby
[06:58:15] edwinvdgraaf: has joined #ruby
[06:59:04] iooner: has joined #ruby
[07:01:28] Couch: has joined #ruby
[07:02:25] skade: has joined #ruby
[07:02:39] Jasonc: https://github.com/Amuro-Ray/rubyexample1/blob/master/ruby_example.rb
[07:02:48] Jasonc: There's a small example
[07:03:15] Jasonc: actually ignore that. I have to step away from my desk for a little bit sorry
[07:03:20] Radar: Perhaps you mean @instance ||= "new_address"
[07:03:22] Radar: Jasonc: ^
[07:05:12] blackmesa: has joined #ruby
[07:05:51] ur5us: has joined #ruby
[07:09:17] kgrz: _kraken: `gem env` can be your friend sometimes. Shows you all the settings for the gem utility
[07:13:15] norc: has joined #ruby
[07:14:11] norc: Are there advantages to accessing instance variables through attr_accessors over direct @ivar?
[07:14:31] norc: Ignoring the overhead of the extra call involved
[07:14:42] ravishankarjha: has joined #ruby
[07:15:30] moeabdol: has joined #ruby
[07:17:43] nkygle: has joined #ruby
[07:18:30] SShrike: has joined #ruby
[07:20:00] kgrz: has joined #ruby
[07:20:55] curses: has joined #ruby
[07:21:13] DoubleMalt: has joined #ruby
[07:23:51] Hyuk: has joined #ruby
[07:24:04] johnDoe111: has joined #ruby
[07:25:27] TomyWork: has joined #ruby
[07:28:26] terlar: has joined #ruby
[07:29:07] dreinull: has joined #ruby
[07:30:03] lxsameer: has joined #ruby
[07:30:25] tAn: has joined #ruby
[07:30:39] last_staff: has joined #ruby
[07:32:04] flughafen: bonjour adaedra
[07:33:15] norc: Greetings adaedra.
[07:34:11] platzhirsch: has joined #ruby
[07:36:19] mark_66: has joined #ruby
[07:39:03] mlehrer: has joined #ruby
[07:41:11] antgel: has joined #ruby
[07:43:29] shevy: cats adaedra
[07:44:04] shevy: norc I think the various attr*s are mostly there due to laziness
[07:44:57] jgt3: has joined #ruby
[07:47:32] platzhirsch: has joined #ruby
[07:47:41] the_drow: has joined #ruby
[07:49:13] norc: shevy: I do not see how providing an interface translates to laziness.
[07:49:43] flughafen: ooh, google io is today
[07:50:16] norc: Unless you consider keeping code maintainable a symptom of being lazy.
[07:53:01] shevy: norc I usually avoid the various attrs and define all methods on my own
[07:54:07] Labaleine: has joined #ruby
[07:55:10] Morkel: has joined #ruby
[07:58:20] bluOxigen: has joined #ruby
[08:00:47] anisha: has joined #ruby
[08:02:18] nankyokusei: has joined #ruby
[08:02:27] chipotle: has joined #ruby
[08:06:23] blackmesa: has joined #ruby
[08:06:57] Jasonc: has joined #ruby
[08:09:05] bazzy: norc, accessing through the attr_accessor's sets up your use of the variable as an API.. so if you ever needed *more than an attr_accessor* functionality, you could implement the function yourself and add whatever other code to do what you need
[08:10:01] bazzy: Bear in mind I'm a Ruby n00b
[08:10:31] bazzy: remember, the attr_accessor also opens up your variable to be accessed *from outside*
[08:10:57] bazzy: so it does have a use regardless of "API" benefit
[08:11:55] bazzy: in fact I believe that is its primary use.. the API thing could be considered an extra
[08:12:59] johnDoe111: has joined #ruby
[08:14:12] pawnbox: has joined #ruby
[08:16:19] akkmaxon: has joined #ruby
[08:17:44] shevy: adaedra you lose a lot of control if you use attr*
[08:18:41] adaedra: I don't see what you mean by that
[08:18:55] woodruffw: has joined #ruby
[08:19:25] woodruffw: has joined #ruby
[08:20:03] ferr: has joined #ruby
[08:20:45] lxsameer: has joined #ruby
[08:20:45] lxsameer: has joined #ruby
[08:24:10] tomphp: has joined #ruby
[08:24:30] idletask: has joined #ruby
[08:24:38] bazzy: adaedra, I kind of explained it already.. I'm sure shevy would confirm that
[08:27:55] tao_: has joined #ruby
[08:28:42] noobsu: has joined #ruby
[08:29:16] shevy: I always do a lot of modifications to any dataset that gets assigned to @ivars
[08:29:34] norc: bazzy: You misunderstand. Im not asking about attr_accessor, but whether there is a point in using that same interface from inside the class.
[08:29:35] bronson: has joined #ruby
[08:29:36] shevy: I also use a lot of boolean methods to access
[08:29:45] shevy: if use_colours?
[08:30:33] chipotle: has joined #ruby
[08:30:49] blackmesa: has joined #ruby
[08:31:04] bazzy: norc, I explained that (see "API")
[08:31:15] jwang: has joined #ruby
[08:31:23] evidex: has joined #ruby
[08:32:02] bazzy: there's no real benefit other than "I am already using an API style of accessing so I don't need to manually modify it later" AFAIK
[08:32:11] norc: bazzy: I know what interfaces are.
[08:32:32] siovene: has joined #ruby
[08:32:54] bazzy: if you were directly accessing the instance var's and wanted to have the API style access later you would need to modify all references to that instance variable to use the function..
[08:33:14] bazzy: so just doing it from the get go eliminates that need ..
[08:36:32] antgel: has joined #ruby
[08:37:33] norc: Why is it that I'm getting Ruby specific design input from someone who admitted he does not know much about Ruby.
[08:37:34] ravishankarjha: has joined #ruby
[08:37:50] norc: Honest question here.
[08:39:04] bazzy: Radar, would you mind verifying what I've said starting around 4:09 EST .. I'm wondering if I've missed the mark in any way? Thanks
[08:39:21] Mweshi: has joined #ruby
[08:39:38] kareeoleez: I am looking for opinions for a fun project http://stackoverflow.com/questions/37271086/possibilities-generator-in-ruby
[08:39:49] kareeoleez: If you have some spare time take a look
[08:39:57] norc: bazzy: Im not saying you said anything wrong, but it is hard to take design feedback if you have no experience from you.
[08:40:03] kith_: has joined #ruby
[08:40:47] dsea11: has joined #ruby
[08:41:00] nertzy3: has joined #ruby
[08:41:06] Regulati_: has joined #ruby
[08:41:09] noobsu_: has joined #ruby
[08:41:55] GinoManWorks_: has joined #ruby
[08:42:34] Cyrus1: has joined #ruby
[08:43:04] mikecmpbll: has joined #ruby
[08:43:14] siovene_: has joined #ruby
[08:43:18] deeprave_: has joined #ruby
[08:43:18] angiebadillo_: has joined #ruby
[08:43:19] mwlang_: has joined #ruby
[08:43:24] the-eat-scout_: has joined #ruby
[08:43:26] shelling___: has joined #ruby
[08:43:32] m4rCsi: has joined #ruby
[08:43:37] halfdan_: has joined #ruby
[08:43:37] jhass: norc: it's somewhat hard to argue in Ruby but I agree with bazzy here. Crystal makes it easier to argue, even for private accessors. There we got multiple variants of attr_accessor or property it's called there. So later if for example the compiler starts thinking my instance variable is nilable but I know it isn't all I have is to change private getter foo into private getter! foo for example
[08:43:41] podman_: has joined #ruby
[08:43:43] Lloyd__: has joined #ruby
[08:43:46] mjc__: has joined #ruby
[08:43:47] ramblinpeck_: has joined #ruby
[08:43:58] mic_e: has joined #ruby
[08:44:06] jhass: and that'll generate me an accessor that makes sure it's not actually nil
[08:44:08] nadir_: has joined #ruby
[08:44:16] KINGSABRI: has joined #ruby
[08:44:29] bcavileer_: has joined #ruby
[08:44:31] j2k_: has joined #ruby
[08:44:31] chrismytton_: has joined #ruby
[08:44:31] vqrs: has joined #ruby
[08:44:32] braderhart_: has joined #ruby
[08:44:35] ijij_: has joined #ruby
[08:44:35] chridal_: has joined #ruby
[08:44:37] jhass: *have to do
[08:44:40] kkirsche: has joined #ruby
[08:44:40] LiquidIn1ect: has joined #ruby
[08:44:42] jcp_: has joined #ruby
[08:44:43] humding3r: has joined #ruby
[08:44:45] jyaworski_: has joined #ruby
[08:44:45] Mr_Pancake-: has joined #ruby
[08:44:46] rideh-: has joined #ruby
[08:44:46] rfv_: has joined #ruby
[08:44:47] norc: jhass: Curious that you mention Crystal. I just spend some time today looking at it because I was interested in more type safety in Ruby.
[08:44:48] alexblom_: has joined #ruby
[08:44:50] Kero_: has joined #ruby
[08:44:54] jtdowney_: has joined #ruby
[08:44:57] HashNuke__: has joined #ruby
[08:44:58] danieli_: has joined #ruby
[08:44:58] Spaceghost|work: has joined #ruby
[08:45:01] MalcolmReynolds: has joined #ruby
[08:45:05] jvdev: has joined #ruby
[08:45:06] LBRapid_: has joined #ruby
[08:45:08] sunya7a__: has joined #ruby
[08:45:10] daytime: has joined #ruby
[08:45:11] TvL: has joined #ruby
[08:45:14] rarruda_: has joined #ruby
[08:45:21] shiver_: has joined #ruby
[08:45:30] MadWasp_: has joined #ruby
[08:45:36] jrod_: has joined #ruby
[08:45:37] axisys_: has joined #ruby
[08:45:45] Billias: has joined #ruby
[08:45:46] bodie__: has joined #ruby
[08:45:46] tylersmith: has joined #ruby
[08:45:46] Seich: has joined #ruby
[08:45:46] LinuxHippie: has joined #ruby
[08:45:46] elomatreb: has joined #ruby
[08:45:49] chridal: has joined #ruby
[08:45:50] yodeler: has joined #ruby
[08:45:52] kspencer: has joined #ruby
[08:46:04] bweston92: has joined #ruby
[08:46:05] alxndr: has joined #ruby
[08:46:06] Veejay: has joined #ruby
[08:46:09] ProofTechnique: has joined #ruby
[08:46:13] IrishGringo_: has joined #ruby
[08:46:15] TheBrayn: has joined #ruby
[08:46:18] Diabolik: has joined #ruby
[08:46:18] j416_: has joined #ruby
[08:46:19] bazzy: has joined #ruby
[08:46:21] llua: has joined #ruby
[08:46:27] Biohazard: has joined #ruby
[08:46:30] YaknotiS: has joined #ruby
[08:46:30] jhass: hypothetical Ruby usecases would be turning your class into for example something using an ORM which overloads attr_accessor
[08:46:31] teotwaki: has joined #ruby
[08:46:32] norc: jhass: So in Crystal variables have a "nillability" property? Or is that a guarantee for bang method?
[08:46:34] Nightmare: has joined #ruby
[08:46:36] kspencer: has joined #ruby
[08:46:37] catbusters: has joined #ruby
[08:46:42] snowy: has joined #ruby
[08:46:44] CustosLimen: has joined #ruby
[08:46:44] jokke: has joined #ruby
[08:46:52] shevy: jhass aha so crystal does additional steps compared to ruby there? e. g. the example of ensuring that something is not nil
[08:46:54] jokester: has joined #ruby
[08:46:56] swills: has joined #ruby
[08:46:56] mlehrer: has joined #ruby
[08:47:05] alxgsv: has joined #ruby
[08:47:08] jhass: well, it's a bit more general
[08:47:11] gomix: has joined #ruby
[08:47:19] Hanmac: has joined #ruby
[08:47:30] pawnbox: has joined #ruby
[08:47:35] blackjid: has joined #ruby
[08:47:38] jhass: Crystal knows union types, say a variable may be a string, int or nil, its type would be String|Int32|Nil
[08:47:41] Kamilion: has joined #ruby
[08:47:43] norc: jhass: Honestly the one thing I would like to see in Crystal is clear separation of const methods and mutable members. But that would be too much to ask for, right?
[08:47:58] jhass: as long as it does have that type I can only call methods on it common to these types
[08:48:10] duoi: has joined #ruby
[08:48:19] tpendragon: has joined #ruby
[08:48:20] bedouin: has joined #ruby
[08:48:25] jhass: if I know for example it can't be nil, I can tell the compiler to remove Nil from the union
[08:48:29] Caelum: has joined #ruby
[08:48:39] jhass: for example by raising if it in fact would be nil
[08:49:04] jhass: which is what Object#not_nil! does and getter! generates an getter that calls that for me
[08:49:33] eggoez: has joined #ruby
[08:49:35] haxrbyte: has joined #ruby
[08:49:40] jhass: norc: I'm not so much into FP still, so not sure I get you
[08:49:49] apipkin_: has joined #ruby
[08:49:56] PaulePanter: Hi. Can `@exhibitions.map {|e| [ e.name, e.id ] }` be written even shorter?
[08:50:11] idefine: has joined #ruby
[08:50:24] jaruga___: has joined #ruby
[08:50:29] ggherdov_: has joined #ruby
[08:50:46] tAn: has joined #ruby
[08:50:49] norc: jhass: In C++ you can qualify a member function (method) to be const, which is a promise to not make (visible) changes to the object it belongs to. At the same time you can specify mutable member variables which may be modified by const member functions (for things like Mutexes) with no visible side effects.
[08:50:53] cardoni: has joined #ruby
[08:50:59] Macaveli: has joined #ruby
[08:51:37] mc_fail: has joined #ruby
[08:51:46] marr: has joined #ruby
[08:51:47] jhass: ah well, I wouldn't say it's out of question but I'm not sure if it really brings that much to the language for the conceptual complexity it adds
[08:51:58] amitchellbullard: has joined #ruby
[08:52:07] [ace]: has joined #ruby
[08:52:36] bttf: has joined #ruby
[08:52:45] aupadhye: has joined #ruby
[08:53:04] hayden__: has joined #ruby
[08:53:07] saneax_AFK: has joined #ruby
[08:53:36] Lord_of_Life: has joined #ruby
[08:53:51] kgrz: kareeoleez: adding to that answer already on SO, the Set functionality in stdlib is pretty useful. In most cases, if you're doing a [].uniq, Set is a much better option. [].uniq.sort can be replaced by SortedSet instead
[08:53:57] Didac: has joined #ruby
[08:53:57] djbkd: has joined #ruby
[08:54:06] bove: has joined #ruby
[08:54:11] kareeoleez: kgrz: noted, thank you
[08:54:15] cstrahan: has joined #ruby
[08:54:22] incomprehensibly: has joined #ruby
[08:54:26] drewo: has joined #ruby
[08:54:27] Es0teric: has joined #ruby
[08:54:34] kgrz: kareeoleez: Note that array and set do not have the same method list. That's why the 'in most cases' caveat
[08:54:51] Shidash: has joined #ruby
[08:55:00] kareeoleez: yeah it's a simple problem and so complicated in the other hand
[08:55:39] davidmichaelkarr: has joined #ruby
[08:55:43] alem0lars: has joined #ruby
[08:56:37] workmad3: has joined #ruby
[08:56:41] colstrom: has joined #ruby
[08:57:10] ndrst: has joined #ruby
[08:57:24] acalewin: has joined #ruby
[08:57:26] giz|work: has joined #ruby
[08:57:29] daemonwrangler: has joined #ruby
[08:57:35] zrl_: has joined #ruby
[08:57:37] machty: has joined #ruby
[08:58:02] mrfooo: has joined #ruby
[08:58:07] infernix: has joined #ruby
[08:58:11] adambeynon: has joined #ruby
[08:58:19] err_ok: has joined #ruby
[08:58:22] Hyuk: has joined #ruby
[08:58:40] iamdevnul: has joined #ruby
[08:58:46] cbetta: has joined #ruby
[08:58:47] frode15243: has joined #ruby
[08:58:52] kgrz: kareeoleez: https://gist.github.com/kgrz/050b20d042014ca78e35b002d4d04758 modified to use set. Added a benchmark result
[08:59:04] [diecast]: has joined #ruby
[08:59:23] digitalfiz: has joined #ruby
[08:59:42] jhill: has joined #ruby
[08:59:51] daxroc: has joined #ruby
[09:00:15] toretore: has joined #ruby
[09:00:18] kareeoleez: kgrz: the thing is that If you generate all possible strings a-z, A-Z, 0-9 with length = 8 it might take days
[09:00:29] startupality: has joined #ruby
[09:00:39] kdisneur: has joined #ruby
[09:00:48] charles81: has joined #ruby
[09:01:02] kareeoleez: kgrz: because there are not only individual character strings but repeating characters also like aaaaabb1 or f89345fw
[09:01:16] gmci: has joined #ruby
[09:01:42] kareeoleez: kgrz: so I want to pop out a message with the time elapsed, strings generated until now and it will be easy enough to calculate an average by keys/second
[09:02:05] kareeoleez: kgrz: I hope to generate a huge rainbow table for fun (some spare hard drives around)
[09:02:11] d0nn1e: has joined #ruby
[09:02:45] jhass: not sure Ruby is your best tool there tbh
[09:04:00] mikar: has joined #ruby
[09:04:08] jabreity__: has joined #ruby
[09:04:11] caw: has joined #ruby
[09:04:31] PaulePanter: jhass: Thank you!
[09:04:57] snowy: has joined #ruby
[09:05:53] PaulePanter: jhass: Since Rails 4, if @exhibition is a model one could use `@exhibitions.pluck(:name, :id )`, I guess.
[09:06:01] yo61: has joined #ruby
[09:06:13] jhass: I guess, this is #ruby after all though ;)
[09:06:27] PaulePanter: jhass: Yes, just wanted to mention it.
[09:06:34] senayar: has joined #ruby
[09:06:34] senayar: has joined #ruby
[09:07:18] kareeoleez: jhass: why not ruby ? I know C or shell could be much faster
[09:07:42] jhass: that's why really
[09:07:50] kareeoleez: I want to create an environment for it
[09:07:55] jhass: well doubt shell will be any faster
[09:08:02] kareeoleez: I am saying it again, it's for fun
[09:08:14] kareeoleez: so I'll play with benchmarking
[09:08:20] kareeoleez: to get the most out of methods
[09:08:26] kareeoleez: and learn ruby better
[09:08:33] kareeoleez: there are many challenges here
[09:09:21] norc: kareeoleez: If you want to improve this would be a great time to learn about: "Pick the right tools for the job"
[09:10:02] jaguarmagenta: has joined #ruby
[09:10:10] kareeoleez: the job is not the focus
[09:10:23] kareeoleez: use ruby for the job the best I can it is
[09:11:59] freija_: has joined #ruby
[09:13:09] kripx: has joined #ruby
[09:13:27] norc: kareeoleez: Sure you can use a shovel to put nails into a wall, but neither will that make you good at shovelling nor at nailing.
[09:13:45] norc: But hey, who am I to argue if you wan to do this. :)
[09:14:09] kareeoleez: no offence but I want to do this
[09:14:30] kareeoleez: maybe I'll use shell or .c and use ruby to extract statistics
[09:14:37] kareeoleez: I'll see how it goes
[09:15:26] norc: kareeoleez: You could also write the underlying generation library in C and provide interfaces for Ruby to call (yes you can call C code from Ruby).
[09:15:55] kareeoleez: should FFI or extconf help ?
[09:15:57] lxsameer: has joined #ruby
[09:16:11] kareeoleez: or are they just for LibC and ports to it ?
[09:16:28] mdw: has joined #ruby
[09:17:15] norc: kareeoleez: FFI is simple but effective and elegant.
[09:18:27] JohnBat26: has joined #ruby
[09:18:50] weckl: has joined #ruby
[09:21:16] edwinvdgraaf: has joined #ruby
[09:22:00] curses: has joined #ruby
[09:22:25] norc: kareeoleez: Note that you do not have to use the ffi gem, you could just use the builtin Fiddle.
[09:22:52] kareeoleez: never heard of it
[09:23:14] Trieste: has joined #ruby
[09:25:29] tao_: has joined #ruby
[09:26:11] ruby[bot]: -b *!*@85-76-15-154-nat.elisa-mobile.fi$#ruby-banned
[09:27:06] cgfbee: has joined #ruby
[09:27:53] ocbtec: has joined #ruby
[09:28:51] tAn: has joined #ruby
[09:32:59] sdothum: has joined #ruby
[09:33:35] terlar: has joined #ruby
[09:36:02] zipkid: has joined #ruby
[09:36:37] ferr: has joined #ruby
[09:36:46] olivierjanss: has joined #ruby
[09:37:14] bestie: has joined #ruby
[09:38:28] matp: has joined #ruby
[09:44:08] symm-: has joined #ruby
[09:44:31] antgel: has joined #ruby
[09:44:44] mdw: has joined #ruby
[09:44:49] Madplatypus: has joined #ruby
[09:44:51] fbandov: has joined #ruby
[09:45:15] blaxter: has joined #ruby
[09:47:25] moeabdol: has joined #ruby
[09:47:35] jimeh: has joined #ruby
[09:48:39] drewo: has joined #ruby
[09:49:43] Gasher: has joined #ruby
[09:50:09] JasonC1: has joined #ruby
[09:51:11] psf: has joined #ruby
[09:52:39] shevy: Fiddle has a very encouraging name
[10:00:13] tAn: has joined #ruby
[10:01:34] mc_fail: hi everyone, again
[10:01:41] mc_fail: is there any way to have Net::HTTP working with pkcs11 in ruby?
[10:01:47] mc_fail: i see there is a module for pkcs11 on github https://github.com/larskanis/pkcs11
[10:01:53] mc_fail: but it doesnt seems like it supported by https somehow
[10:02:12] jhass: mc_fail: same question as yesterday, do you mean TLS client authentication?
[10:02:15] mc_fail: i mean, to use certificate+key on the token for https authentification
[10:03:02] jhass: Just use that gem to extract a OpenSSL::Pkey and a OpenSSL::X509::Certificate and set them for Net:HTTP#key and Net::HTTP#cert respectively
[10:03:10] nankyokusei: has joined #ruby
[10:03:35] jhass: or if you're able to by any means upgrade your infrastructure to PKCS12 and use OpenSSL::PKCS12 instead of the gem
[10:05:07] mc_fail: it seems like pkcs11 is not an option, as i understand, all hardware tokens support pkcs11 only
[10:05:21] jhass: mc_fail: that's not what I said at all
[10:06:23] the_drow: has joined #ruby
[10:06:39] jgt3: has joined #ruby
[10:08:21] mc_fail: + as i understand, with hardware token private key cannot be extracted, because the entire point of having token is to avoid copying keys
[10:09:02] mc_fail: therefore, i don't think that extracting OpenSSL::Pkey is possible
[10:09:17] Robtop__: has joined #ruby
[10:12:36] mc_fail: hmm, meanwhile, this is intresting http://comments.gmane.org/gmane.comp.lang.ruby.cvs/11434
[10:14:10] mc_fail: since openssl support pkcs11 natively, and as i understand ruby Openssl library is just a wrapper over openssl binaries, it might work
[10:14:18] mtkd: has joined #ruby
[10:14:42] skade: has joined #ruby
[10:15:56] giz|work: has joined #ruby
[10:15:57] diegoaguilar: has joined #ruby
[10:16:59] horaceheaven: has joined #ruby
[10:18:40] aries_liuxueyang: has joined #ruby
[10:19:54] blackgoat: has joined #ruby
[10:20:19] bluOxigen: has joined #ruby
[10:20:27] jhass: http://devdocs.io/ruby~2.3/openssl/engine is the interface I guess
[10:25:07] tAn: has joined #ruby
[10:25:41] yfeldblum: has joined #ruby
[10:25:57] mc_fail: yeah, but it seems like openssl itself cannot load my token .so file
[10:28:34] chipotle: has joined #ruby
[10:30:09] ur5us: has joined #ruby
[10:30:33] Robtop__: has joined #ruby
[10:31:48] bronson: has joined #ruby
[10:32:05] f4cl3y: has joined #ruby
[10:37:29] blackgoat: has joined #ruby
[10:39:15] tAn: has joined #ruby
[10:40:14] d0lph1n98: has joined #ruby
[10:40:16] Elysia: has joined #ruby
[10:42:46] drewo: has joined #ruby
[10:42:46] senayar: has joined #ruby
[10:44:02] ptx0_: has joined #ruby
[10:44:33] jgt3: has joined #ruby
[10:45:18] emilkarl: has joined #ruby
[10:50:15] Jasonc: has joined #ruby
[10:51:03] gtsai: has joined #ruby
[10:52:01] thorgi: has joined #ruby
[10:53:02] idefine: has joined #ruby
[10:53:27] johnmilton: has joined #ruby
[10:58:15] JonasOSDever: has joined #ruby
[10:59:19] diegoaguilar: has joined #ruby
[10:59:31] tabakhase: has joined #ruby
[11:00:04] antgel: has joined #ruby
[11:00:51] deadnull: has joined #ruby
[11:01:25] nettoweb: has joined #ruby
[11:03:03] blaxter: has joined #ruby
[11:03:32] skweek: has joined #ruby
[11:07:06] Mweshi: has joined #ruby
[11:08:11] ravishankarjha: has joined #ruby
[11:10:44] jaguarmagenta: has joined #ruby
[11:11:48] Mweshi: has joined #ruby
[11:12:53] giz|work: has joined #ruby
[11:13:57] CausaMortis: has joined #ruby
[11:16:50] CausaMortis: has joined #ruby
[11:18:11] CausaMortis: has joined #ruby
[11:19:31] CausaMortis: has joined #ruby
[11:21:03] CausaMortis: has joined #ruby
[11:22:38] curses: has joined #ruby
[11:23:44] johnDoe111: has joined #ruby
[11:25:34] halfamind: has joined #ruby
[11:26:21] the_drow: has joined #ruby
[11:26:55] harry111: has joined #ruby
[11:31:56] skade: has joined #ruby
[11:32:18] Mweshi: has joined #ruby
[11:34:24] Lumio: has joined #ruby
[11:35:58] ldnunes: has joined #ruby
[11:36:06] Mweshi: has joined #ruby
[11:37:02] drewo: has joined #ruby
[11:37:38] chipotle: has joined #ruby
[11:41:20] startupality: has joined #ruby
[11:41:35] Ropeney: has joined #ruby
[11:44:03] paha80: has joined #ruby
[11:45:35] the_drow: has joined #ruby
[11:47:16] senayar: has joined #ruby
[11:50:32] JasonC1: has joined #ruby
[11:50:50] adambeynon: has joined #ruby
[11:50:57] bazzy: has left #ruby: ("Leaving")
[11:51:07] bazzy: has joined #ruby
[11:51:57] ReK2: has joined #ruby
[11:53:40] |2701: has joined #ruby
[11:53:59] idefine: has joined #ruby
[11:54:18] Pumukel: has joined #ruby
[11:56:12] giz|work: has joined #ruby
[11:57:23] cgfbee: has joined #ruby
[11:58:21] aries_liuxueyang: has joined #ruby
[11:59:19] rodfersou: has joined #ruby
[12:01:32] gnufied: has joined #ruby
[12:01:44] Fredrich010: has joined #ruby
[12:02:44] Hanmac: has joined #ruby
[12:04:01] nankyokusei: has joined #ruby
[12:06:36] hutch34: has joined #ruby
[12:08:00] mdw: has joined #ruby
[12:09:05] terlar: has joined #ruby
[12:12:03] maucar: has joined #ruby
[12:12:11] chouhoulis: has joined #ruby
[12:12:31] Juanchito: has joined #ruby
[12:14:21] tAn: has joined #ruby
[12:14:22] roshanavand: has joined #ruby
[12:16:27] flashpoint9: has joined #ruby
[12:16:45] binaryplease: has joined #ruby
[12:16:46] aries_liuxueyang: has joined #ruby
[12:18:26] nadir: has joined #ruby
[12:22:18] chipotle: has joined #ruby
[12:25:08] arup_r: has joined #ruby
[12:25:57] arup_r: Hi, what is better way to extract everything but not the protocol from a url? I was trying the URI lib, but seems it will not help https://gist.github.com/aruprakshit/97bad411397a475dd2df110e9c77191b
[12:26:53] arup_r: it works when I have 'http://www.mglenn.com/directory' but doesn't give proper result when I have like 'www.mglenn.com/directory'
[12:28:02] blackmesa: has joined #ruby
[12:28:27] Madplatypus: has joined #ruby
[12:30:09] snapcase: a URL needs a scheme
[12:31:04] drewo: has joined #ruby
[12:31:31] arup_r: yeah, I have those urls from user input .. so they don't give always with scheme
[12:32:36] CloCkWeRX: has joined #ruby
[12:33:27] snapcase: can't you just add it if it's missing?
[12:34:05] pawnbox: has joined #ruby
[12:34:10] deadnull: has joined #ruby
[12:35:35] mic_e: has joined #ruby
[12:35:45] aries_liuxueyang: has joined #ruby
[12:37:09] arup_r: yeah, that is how I am doing it...
[12:39:40] Ishido: has joined #ruby
[12:41:15] binaryplease: has joined #ruby
[12:43:21] jancel: has joined #ruby
[12:44:59] malconis: has joined #ruby
[12:45:29] pawnbox: has joined #ruby
[12:49:24] halfamind: has joined #ruby
[12:50:23] Ropeney: has joined #ruby
[12:50:29] Jasonc: has joined #ruby
[12:50:54] haxrbyte: has joined #ruby
[12:54:20] skweek: has joined #ruby
[12:55:25] Azure: has joined #ruby
[12:57:53] arup_r: snapcase: doing like http://stackoverflow.com/a/7908682/2767755
[12:58:33] CloCkWeRX: has joined #ruby
[12:58:51] ramortegui: has joined #ruby
[12:59:22] shevy: hmm if I have: def foo; puts __method__; end; alias bar foo; foo; bar
[12:59:42] shevy: the output is foo and foo. Is there some way to find out that an aliased-method was called?
[12:59:44] aegis3121: has joined #ruby
[13:00:12] pawnbox: has joined #ruby
[13:00:56] aries_liuxueyang: has joined #ruby
[13:02:26] adaedra: try with alias_method
[13:02:27] pawnbox_: has joined #ruby
[13:02:28] Es0teric: has joined #ruby
[13:02:32] jhass: I'd argue if you need to care it's not actually an alias
[13:03:27] shevy: adaedra aha, let me try
[13:04:26] aries_liuxueyang: has joined #ruby
[13:06:17] camilasan: has joined #ruby
[13:07:27] shevy: https://gist.github.com/shevegen/8c1b842ae95c314b6149044f30327d69
[13:07:48] shevy: I am having a brain blackout, the above does not work with alias_method but alias works
[13:08:50] rbennacer: has joined #ruby
[13:08:55] jhass: shevy: https://carc.in/#/r/yte
[13:09:03] DanyC: has joined #ruby
[13:10:43] aries_liuxueyang: has joined #ruby
[13:11:31] jaguarmagenta: has joined #ruby
[13:13:45] bluOxigen: has joined #ruby
[13:14:55] psf: has joined #ruby
[13:15:32] nerium: has joined #ruby
[13:16:08] sepp2k: has joined #ruby
[13:17:13] akiTendo: has joined #ruby
[13:20:52] Lonloren: has joined #ruby
[13:21:51] mog: has left #ruby: ("Leaving")
[13:22:29] David27: has joined #ruby
[13:23:30] curses: has joined #ruby
[13:24:32] Lonloren: has left #ruby: ()
[13:24:43] rbr: has joined #ruby
[13:24:50] kobain: has joined #ruby
[13:25:02] griffindy: has joined #ruby
[13:25:12] drewo: has joined #ruby
[13:27:27] ChiefAlexander: has joined #ruby
[13:27:31] aries_liuxueyang: has joined #ruby
[13:28:16] Mweshi: has joined #ruby
[13:28:43] moeabdol: has joined #ruby
[13:28:44] eeuymh: has joined #ruby
[13:29:00] yos7ph: has joined #ruby
[13:31:43] aegis3121: has joined #ruby
[13:31:49] Bengals: has joined #ruby
[13:34:20] bronson: has joined #ruby
[13:35:25] duoi: has joined #ruby
[13:35:54] VeryBewitching: has joined #ruby
[13:38:05] startupality: has joined #ruby
[13:39:41] emilkarl: has joined #ruby
[13:40:03] chipotle: has joined #ruby
[13:41:17] eljimbo: has joined #ruby
[13:42:12] halfamind: has joined #ruby
[13:43:12] synthroid: has joined #ruby
[13:43:17] antgel: has joined #ruby
[13:44:42] cdg: has joined #ruby
[13:44:42] aries_liuxueyang: has joined #ruby
[13:46:33] banister: has joined #ruby
[13:49:22] pikajude: has joined #ruby
[13:49:22] pikajude: has joined #ruby
[13:50:45] JasonC1: has joined #ruby
[13:51:57] duoi: has joined #ruby
[13:52:31] jancel: has joined #ruby
[13:54:23] jaguarmagenta: has joined #ruby
[13:57:17] `tim`: has joined #ruby
[13:58:00] zapata: has joined #ruby
[14:00:26] horaceheaven: has joined #ruby
[14:04:52] nankyokusei: has joined #ruby
[14:06:35] idefine: has joined #ruby
[14:07:41] idle_task: has joined #ruby
[14:10:44] nando293921: has joined #ruby
[14:11:15] tinnvec: has joined #ruby
[14:11:53] brendan-_: has joined #ruby
[14:13:41] IrishGringo: has joined #ruby
[14:14:23] Kus: has joined #ruby
[14:14:24] chipotle: has joined #ruby
[14:14:58] tvw: has joined #ruby
[14:15:01] idefine_: has joined #ruby
[14:16:44] startupality: has joined #ruby
[14:17:09] dhollinger: has joined #ruby
[14:18:10] insanedreamer: has joined #ruby
[14:19:13] Mweshi: has joined #ruby
[14:19:20] drewo: has joined #ruby
[14:20:33] neanderslob: has joined #ruby
[14:20:36] JasonC1: Does anyone know alot about CGI::Cookie?
[14:20:37] JasonC1: http://ruby-doc.org/stdlib-1.9.3/libdoc/cgi/rdoc/CGI/Cookie.html
[14:20:51] kareeoleez: has joined #ruby
[14:21:36] ruby[bot]: Just ask your question, if anyone has or can, they will respond.
[14:24:30] mozzarel1: has joined #ruby
[14:24:34] rapha: has joined #ruby
[14:24:59] JakFrist: has joined #ruby
[14:25:00] duoi: has joined #ruby
[14:26:37] crystal77: has joined #ruby
[14:28:58] mikecmpbll: has joined #ruby
[14:29:43] gtsai: has joined #ruby
[14:30:02] blackmesa: has joined #ruby
[14:30:43] jwren: has joined #ruby
[14:30:53] noService: has joined #ruby
[14:31:34] troulouliou_div2: has joined #ruby
[14:31:47] nareiber: has joined #ruby
[14:32:44] TomyWork: is there any pretties way to do things like these, save messing with "properties" beforehand? facts.merge!(properties['directories'][directory]['facter']) if properties['directories'] and properties['directories'][directory] and properties['directories'][directory]['facter']
[14:33:25] jhass: TomyWork: since 2.3 we got http://devdocs.io/ruby~2.3/hash#method-i-dig
[14:34:55] horaceheaven: has left #ruby: ()
[14:35:47] iamvery: has joined #ruby
[14:36:46] malconis: has joined #ruby
[14:38:02] malconis: has joined #ruby
[14:39:16] cpruitt: has joined #ruby
[14:39:38] ChiefAlexander: has joined #ruby
[14:40:02] f4cl3y: has joined #ruby
[14:40:45] weemsledeux: has joined #ruby
[14:42:14] davedev24: has joined #ruby
[14:43:47] SilverKey: has joined #ruby
[14:45:09] JesseH: has joined #ruby
[14:45:39] skolman_: has joined #ruby
[14:45:59] rippa: has joined #ruby
[14:47:35] skolman_: has joined #ruby
[14:48:29] Zamyatin: has joined #ruby
[14:49:48] p0p0pr37_: has joined #ruby
[14:50:50] JasonC2: has joined #ruby
[14:50:52] JasonC2: has left #ruby: ()
[14:51:10] kobain: has joined #ruby
[14:52:04] duoi: has joined #ruby
[14:52:20] agent_white: has joined #ruby
[14:52:57] umdstu: has joined #ruby
[14:53:25] umdstu: Despite cURL working, and browser access working, RestClient can’t seem to establish an SSL connection to a host. ‘alert certificate unknown’ error. Using the same cert and ca with curl is fine. what could be wrong?
[14:56:22] mic_e: has joined #ruby
[14:58:35] Rixius: has joined #ruby
[14:58:40] Caelum: has joined #ruby
[15:01:53] purrkode: has joined #ruby
[15:02:07] existensil: has joined #ruby
[15:02:37] aries_liuxueyang: has joined #ruby
[15:03:31] JakFrist: has joined #ruby
[15:03:42] DrCode: has joined #ruby
[15:03:56] ferr: has joined #ruby
[15:05:13] SilverKey: has joined #ruby
[15:08:01] SilverKey: has joined #ruby
[15:10:15] zenguy_pc: has joined #ruby
[15:10:23] SilverKey: has joined #ruby
[15:13:25] drewo: has joined #ruby
[15:13:41] ixti: has joined #ruby
[15:14:24] perlgod: has joined #ruby
[15:14:38] Rixius: has joined #ruby
[15:14:42] antgel: has joined #ruby
[15:15:24] apeiros: jhass: I'm curious as to why people don't ask their question after being told to just do that…
[15:15:46] theRoUS: has joined #ruby
[15:15:53] jhass: I'll never get it either
[15:16:43] apeiros: maybe "oh great, so other people know a lot about that. that's all I wanted to know." :D
[15:17:01] bijan_: has joined #ruby
[15:18:23] bijan_: Is the documentation weird or me?! From where do I know that the require name is "shell" (lowercase) when I see this stdlib doc: http://ruby-doc.org/stdlib-2.3.1/libdoc/shell/rdoc/Shell.html
[15:18:33] shevy: the documentation is usually weird
[15:18:44] ereslibre: has joined #ruby
[15:18:44] ereslibre: has joined #ruby
[15:19:06] bijan_: Where is the import name written?!
[15:19:08] apeiros: bijan_: there's a convention for the mapping
[15:19:16] bijan_: apeiros: okay that is?
[15:19:17] apeiros: bijan_: sadly even stdlib has some exception to that convention
[15:19:41] shevy: that thing seems even weird
[15:19:41] apeiros: FooBarBaz -> require 'foobarbaz' (ruby convention)
[15:19:42] shevy: require 'shell'
[15:19:42] shevy: shell(#<Th:0x00000000d72198>): warn: override definition of Shell#mkdir.
[15:19:45] bijan_: how am I supposed to know that?
[15:19:46] Papierkorb: bijan_: the files are all called (or begin with) "shell", the URL suggests so too, and from the libraries name "Shell" you can at least guess that it's most likely "shell"
[15:19:49] apeiros: FooBarBaz -> require 'foo_bar_baz' (rails convention)
[15:19:58] apeiros: and Foo::Bar -> require 'foo/bar'
[15:20:04] apeiros: (both ruby & rails)
[15:20:07] shevy: most common variant is the downcased name
[15:20:33] shevy: with odd exceptions like require 'English' :D
[15:20:34] bijan_: is it because main file is called shell.rb?
[15:20:36] apeiros: bijan_: i.e. ruby convention is the constant lower cased and :: namespace separators replaced with / path separators
[15:20:40] umdstu: apeiros: who did that?
[15:20:47] apeiros: bijan_: yes. require is about files.
[15:20:56] apeiros: the argument you pass to require is the file it should load.
[15:21:12] bijan_: English.rb
[15:21:15] shevy: bijan_ yeah file name usually. so you should also find an English.rb file. Perhaps one day ruby will have a better way to load add ons, require() itself is very simple
[15:21:21] jhack: has joined #ruby
[15:21:47] apeiros: the path is either relative to the lib dir of any installed gem, or relative to any path in $LOAD_PATH. the filename-extension is optional for the known ones (.rb, .so, .bundle, .dylib, .dll iirc)
[15:22:24] apeiros: exceptions in stdlib: StringScanner -> require 'strscan', OpenStruct -> 'ostruct'
[15:22:24] bijan_: okay but I must say that this is confusing for people new to ruby that are trying to look something up
[15:22:44] nareiber: has joined #ruby
[15:22:48] apeiros: even if it follows the convention, it should mention the necessary require in the toplevel constant.
[15:23:15] shevy: bijan_ yeah. I think that all stdlib examples should show the require statement too... ruby core should move to a generic template to enforce consistency
[15:23:21] Papierkorb: bijan_: not too much imo, it's knowing the conventions. once you know those, it's usually somewhat obvious (There are some exceptions. Meh.)
[15:23:33] shevy: optparse!
[15:23:33] apeiros: but if nothing is mentioned, try the ruby convention for non-rails stuff, and the rails convention for rails stuff (and then the rails convention anyway). and if neither works, check the source.
[15:23:36] bijan_: it is also a bit weird that the docs are on a different domain
[15:23:44] shevy: http://ruby-doc.org/stdlib-2.3.1/libdoc/optparse/rdoc/OptionParser.html
[15:23:49] Papierkorb: shevy: I hate it how it's called that
[15:23:55] shevy: OptionParser is required via require 'optparse'
[15:24:19] hobodave: has joined #ruby
[15:24:20] Papierkorb: shevy: But OTOH, the library is called 'optparse'
[15:24:20] apeiros: bijan_: um, that's because it's a third party
[15:24:25] curses: has joined #ruby
[15:24:28] apeiros: bijan_: the official docs are on your hard drive
[15:24:28] jhack_: has joined #ruby
[15:24:34] flughafen_: has joined #ruby
[15:24:34] shevy: bijan_ you should have been here about 9 years ago or so, we had iframes somewhere :D
[15:24:47] apeiros: `ri Array#map` in your shell for example.
[15:25:37] bijan_: usually this wouldn't be too much of a problem with decent code completion... is there a good editor/ide that knows the imports etc?
[15:26:39] apeiros: cannons for sparrows…
[15:26:45] apeiros: sure. kills them too.
[15:27:30] apeiros: best ide for ruby I know of is rubymine. not sure whether it'll do requires for you.
[15:27:31] jhass: you all forget the real official docs http://docs.ruby-lang.org/ja/
[15:27:46] shevy: bijan_ perhaps RubyMine. I have no real idea though, not using an IDE
[15:27:47] apeiros: jhass: nice
[15:28:50] Vingador: has joined #ruby
[15:29:37] umdstu: Despite cURL working, and browser access working, RestClient can’t seem to establish an SSL connection to a host. ‘alert certificate unknown’ error. Using the same cert and ca with curl is fine. what could be wrong?
[15:30:52] sleepunit: has joined #ruby
[15:30:58] jhass: you using rest_client? :P
[15:31:17] grs: has joined #ruby
[15:31:38] gregf: has joined #ruby
[15:31:49] umdstu: jhass: rest-client
[15:31:56] maucar: has joined #ruby
[15:32:15] umdstu: i GUESS it could switch to something newer
[15:32:16] bijan_: jhass: http://docs.ruby-lang.org/en/2.3.0/File.html is also not explicit about the require name
[15:32:51] apeiros: bijan_: you're in the core docs. everything core is already loaded. no require necessary.
[15:33:11] shevy: happiness \o/
[15:33:26] apeiros: but that documentation template doesn't separate core- from stdlib. bad.
[15:33:32] jhass: also the official docs are at /ja/, not /en/ still ;P
[15:33:38] CJKinni: has joined #ruby
[15:34:23] |2701: has joined #ruby
[15:34:23] |2701: has joined #ruby
[15:34:26] apeiros: can we have http://docs.ruby-lang.org/ja/2.3.0/function/index.html in english please? :-(
[15:34:53] aries_liuxueyang: has joined #ruby
[15:34:59] apeiros: though, seems sparse
[15:35:34] iceden: has joined #ruby
[15:35:50] Vingador_: has joined #ruby
[15:36:59] bronson: has joined #ruby
[15:38:48] elifoster: has joined #ruby
[15:39:47] shevy: ruby is like zen
[15:39:56] shevy: you must not read documentation - you must attain a state of knowing
[15:41:47] symm-: has joined #ruby
[15:42:19] idefine: has joined #ruby
[15:42:41] idefine: has joined #ruby
[15:43:16] idefine: has joined #ruby
[15:44:15] Caelum: has joined #ruby
[15:46:31] swills: has joined #ruby
[15:47:17] startupality: has joined #ruby
[15:47:39] duoi: has joined #ruby
[15:47:54] norc: has joined #ruby
[15:48:22] jancel: has joined #ruby
[15:48:27] bluOxigen: has joined #ruby
[15:49:17] CJKinni: has joined #ruby
[15:50:12] nettoweb: has joined #ruby
[15:50:18] zast: has joined #ruby
[15:50:27] nando294021: has joined #ruby
[15:50:57] skolman_: has joined #ruby
[15:51:19] wor: has joined #ruby
[15:52:39] wor: Hi guys, I'm on ubuntu and I installed ruby 2.3.0 using ruby-install, but ruby --version returns 1.9.3, how do I switch my computer to use the 2.3.0 version? which is in the .rubies folder
[15:53:54] JakFrist: has joined #ruby
[15:54:34] umdstu: what does `which ruby` say
[15:54:41] umdstu: and did you perhaps open a new terminal window?
[15:54:59] LastWhisper____: has joined #ruby
[15:55:19] wor: /usr/bin/ruby
[15:56:45] wor: It's in the same terminal window. I don't think ruby-install added 2.3.0 to the path but I'm not sure how to go about 'properly' adding the new ruby into the path
[15:57:38] kareeoleez: has joined #ruby
[15:57:54] LastWhisper____: has joined #ruby
[15:58:03] umdstu: open another terminal window and run the same version command
[15:58:04] soc42: has joined #ruby
[15:58:08] wor: I see there's a 'ruby' in ~/.rubies/ruby-2.3.1/bin/ but I'm not sure copying that to /usr/bin will work
[15:58:21] wor: it's ruby 1.9.3
[15:59:16] platzhirsch: has joined #ruby
[15:59:59] Ballo: has joined #ruby
[16:00:09] Ballo: Hey, I have a question. How come I cant j = {mon-notice:t} (t is a hash) but I can j = {:mon-notice => t}
[16:00:35] j416: Ballo: because you're using ruby < 1.9
[16:00:47] Ballo: no I'm not
[16:00:54] j416: Ballo: then because there is a dash in the name
[16:01:02] CJKinni: has joined #ruby
[16:01:16] umdstu: wor: add that path to your PATH in your .bashrc
[16:01:41] Ballo: so :dash-in-name is halal but dash-in-name: is haram?
[16:01:43] umdstu: Ballo: yea I htink you need _ there
[16:01:49] j416: Ballo: never use dashes in names
[16:01:56] psf: has joined #ruby
[16:02:02] j416: Ballo: it just creates trouble
[16:02:25] Ballo: it's a key in a hash for a json I have no choice
[16:02:28] whathappens: has joined #ruby
[16:02:39] Ballo: so you can stop wagging your finger
[16:02:45] wor: umdstu:I could but I think a better way is to replace the /usr/bin/ruby with ~/.rubies/ruby-2.3.1/bin/ruby but I'm not sure how that works (if i copy it over how will it access the other libs)
[16:02:50] j416: Ballo: try something like { 'mon-notice': t }
[16:02:54] umdstu: Ballo: then wrap in quotes
[16:03:25] Ballo: I made a rule where I'm not going to use mutable keys
[16:03:25] umdstu: wor: thats definitely not better
[16:03:49] mistermocha: has joined #ruby
[16:03:55] Ballo: mutable keys are going away in the next ruby anyway so no, I'm not going to use quotes
[16:04:00] umdstu: export PATH:~/.rubies/ruby-2.3.1/bin
[16:04:05] qasaur: has joined #ruby
[16:04:24] umdstu: then `which ruby`
[16:04:27] Lloyd: do you only need one version of ruby on the machine?
[16:04:32] tacit7: has joined #ruby
[16:04:41] umdstu: it’s not a good idea to mangle your system ruby that way
[16:04:57] wor: Lloyd:Yea, I only need 1 that is >= version 2.0
[16:05:01] danostrowski: has joined #ruby
[16:05:12] Lloyd: what version of ubuntu?
[16:05:32] wor: apt installing it got me the 1.9.3 version
[16:05:40] nankyokusei: has joined #ruby
[16:05:40] j416: Ballo: did it work?
[16:05:49] Xiti: has joined #ruby
[16:05:51] Lloyd: yeah you need a ppa for the newer versions
[16:05:52] Lloyd: https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng
[16:06:14] Lloyd: https://www.brightbox.com/docs/ruby/ubuntu/
[16:06:18] j416: Ballo: what do you mean by "mutable keys are going away"?
[16:06:25] j416: Ballo: it's still a symbol.
[16:06:58] drewo: has joined #ruby
[16:07:00] j416: Ballo: I would avoid using symbols altogether, if that is an option.
[16:08:18] bryanray: has joined #ruby
[16:08:23] amclain: has joined #ruby
[16:10:41] kareeoleez: is there any chance to view a log of today's message of this room ?
[16:10:49] kareeoleez: someone sent me a link and I've lost it
[16:11:16] Lloyd: kareeoleez: it’s in the topic
[16:12:22] eein: has joined #ruby
[16:12:29] kareeoleez: Lloyd: thank you
[16:12:39] wor: Lloyd:the ppa looks outdated and I'm having trouble using the added legacy one too, I'll just export the path to the newer ruby
[16:13:13] Lloyd: wor: it’s not out dated, but whatever you’d like to do
[16:13:15] idefine: has joined #ruby
[16:13:43] wor: it says This PPA no longer includes Phusion Passenger packages, and NGINX packages with Passenger support. in https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng
[16:14:17] qasaur: has joined #ruby
[16:14:27] Lloyd: yeah, that PPA only has ruby packages
[16:14:57] MEATCHICKEN: has joined #ruby
[16:15:25] MEATCHICKEN: Object.where.overlap <- how can I be sure that overlap is called with rspec?
[16:15:28] wor: after adding it and sudo apt-get update and install ruby gives me version 1.9.3 though hmm
[16:16:02] MEATCHICKEN: .where returns a very specific object - my first thought would be to expect(obj.where).to receive(:method)
[16:16:04] Lloyd: apt-get install ruby2.2
[16:16:25] wor: damn I'm an idiot
[16:16:41] wor: Lloyd:thank you!
[16:16:45] Lloyd: no worries
[16:16:49] shevy: apt-get is not the simplest piece of software on earth!
[16:17:01] Lloyd: try to not snowflake servers ;P
[16:17:07] shevy: the creation of rvm, chruby, rbenv etc... happened for a reason :D
[16:17:19] chrisja: has joined #ruby
[16:17:28] Lloyd: the creation of rvm, chruby and rbenv were for development reasons
[16:17:43] jhass: meatchicken: best just stub where, relation = double; allow(obj).to receive(:where).and_return(double); expect(relation).to receive(:overlap)
[16:17:58] jhass: meatchicken: though make sure you're still testing behavior here, not implementation
[16:17:59] Devalo: has joined #ruby
[16:18:15] jhass: eh, and_return(relation) of course
[16:18:24] MEATCHICKEN: jhass, overlap is not implemented in userland - it is in 3rd party
[16:18:26] Lloyd: they really shouldn’t be used in production, they use so much magic, servers should only really use one ruby version at a time, and if you can’t, you should omnibus, rather than hacking around in bash
[16:18:31] MEATCHICKEN: I shouldn't have to test it?
[16:18:45] jhass: that's right
[16:18:46] MEATCHICKEN: userland is not the right word
[16:18:53] MEATCHICKEN: it is in a gem*
[16:18:55] jhass: "project codebase"
[16:19:14] MEATCHICKEN: That's a nice solution though, jhass. Thanks! I've never had to use doubles until now
[16:19:26] ChiefAlexander: has joined #ruby
[16:19:27] mtkd: has joined #ruby
[16:20:08] biox-: has joined #ruby
[16:21:36] wldcordeiro: has joined #ruby
[16:21:47] lxsameer: has joined #ruby
[16:22:07] lubekpl: has joined #ruby
[16:22:37] c_nick: has joined #ruby
[16:22:42] blackmesa: has joined #ruby
[16:22:46] c_nick: How to compare files ?
[16:22:53] mistermocha: has joined #ruby
[16:23:56] MEATCHICKEN: c_nick, diff file_a file_b
[16:24:17] hahuang65: has joined #ruby
[16:25:29] aphprentice: has joined #ruby
[16:25:39] JackMc: Hey everyone - is there a way to generate a password in Ruby that fits certain requirements (i.e. one number, one capital letter, etc)
[16:25:47] synthroid: has joined #ruby
[16:26:59] rbennacer: has joined #ruby
[16:27:02] jhass: there's probably a gem out there but nothing in stdlib
[16:27:08] f4cl3y: has joined #ruby
[16:27:09] jhass: should be easy enough to custom code too
[16:27:38] jhass: Array#sample and Array#shuffle are your friends
[16:28:01] mistermocha: has joined #ruby
[16:28:43] eein: hello. I am having trouble removing ruby. apt-get remove ruby just kicks off a ruby install that fails
[16:28:48] eein: I just want it gone
[16:29:06] JackMc: eein: That's more of an Ubuntu/debian/your distro question, no?
[16:29:06] jhass: how did you install it?
[16:29:17] JackMc: jhass: Currently my code does that and tries to satisfy some of the requirements by generating random passwords and then checking they fit the requirements, but I feel like that is inefficient somehow
[16:29:26] JackMc: The specific requirements are the passwords must be at least 8 chars, and contain at least one uppercase letter, one lowercase letter, and one number
[16:30:20] eein: JackMc, I guess though I imagine many ruby people run ubuntu also is it not ruby behavior that it is trying to install pending ruby install
[16:30:21] purrkode: has joined #ruby
[16:30:39] arthurl: has joined #ruby
[16:30:58] dimon_: has joined #ruby
[16:31:09] arthurl: hi guys- i'm having an issue where a bundle install command installs gems to a different location than i would like it to- how do i tell bundler where to install gems?
[16:31:13] dimon_: hey. for this function my_hash = Digest::SHA512.hexdigest("secret_string123"), does ruby use SIMD Optimizations?
[16:31:19] jhass: JackMc: I'd pivot the the requirements into an array, .concat the result of a .sample(rand(MIN_LENGTH-3..MAX_LENGTH-3)) over the total valid character set and shuffle.join the result
[16:31:22] eein: its like it is running dpkg and trying to reconfigure
[16:31:57] wor: when I bundle install on this project i get `An error occurred while installing cmdparse (3.0.1), and Bundler cannot continue. Make sure that `gem install cmdparse -v '3.0.1'` succeeds before bundling. but after sudo gem installing cmdparse and rerunning bundle install I still get the same error
[16:32:23] smathy: has joined #ruby
[16:32:44] jhass: eein: if all you did is apt-get install ruby, I agree that's more of a #ubuntu question. Provide them with your full error output
[16:33:44] eein: jhass, no I just want to uninstall it but it just keeps running dpkg on a package I removed
[16:34:24] jhass: dimon_: https://github.com/ruby/ruby/blob/trunk/ext/digest/sha2/sha2.c here's the source
[16:34:45] jhass: note there's also OpenSSL::Digest providing a binding to the openssl implementation
[16:34:54] freeze: has joined #ruby
[16:35:06] jhass: wor: full output to gist.github.com please
[16:35:09] dimon_: jhass: tnx
[16:36:06] qasaur: has joined #ruby
[16:36:11] moeabdol: has joined #ruby
[16:36:22] Zamyatin: has joined #ruby
[16:36:33] lxsameer: has joined #ruby
[16:38:01] dimon_: jhass: is it in the file "ext/digest/digest.c"?
[16:38:14] jhass: the openssl binding?
[16:39:01] danostrowski: has joined #ruby
[16:39:29] wor: jhass:https://gist.github.com/garvinguan/4cd57d541066d18ff27c84e3f862696d
[16:40:22] stunder: has joined #ruby
[16:40:31] Azure: has joined #ruby
[16:40:43] jhass: wor: can you update that with the outputs for: command -v bundle; bundle exec ruby -v; head -n1 $(which bundle); ?
[16:42:03] ramfjord: has joined #ruby
[16:42:12] `tim`: has joined #ruby
[16:42:41] nankyokusei: has joined #ruby
[16:43:37] jhass: wor: oh and command -v ruby while we're at it please :)
[16:43:43] flashpoint9: has joined #ruby
[16:43:52] wor: updated, let me run that one too
[16:44:11] wor: it's /usr/bin/ruby
[16:44:32] qasaur: has joined #ruby
[16:44:42] jhass: how did you install Ruby?
[16:45:19] jhass: your bundler is using an old Ruby version, you need to reinstall it for your current ruby version
[16:46:01] wor: initially sudo apt-get install ruby, which gave me 1.9 something, then I did ruby-install 2.3, then I added the new ppa and did apt-get install ruby2.3 and now it's on my patah
[16:46:31] shinnya: has joined #ruby
[16:46:39] jhass: at that point sudo gem install bundler can't do any more harm to your system I guess :P
[16:47:21] wor: yep I just ran that command :P
[16:47:48] wor: the output is coming back with more green lines! woohoo
[16:48:06] wor: thanks man, saved my life lol
[16:48:27] jhass: wor: btw the ruby-install/ruby-build way usually goes together with chruby
[16:48:57] jhass: which would set all the environment variables so the one from ~/.rubies/ would be used
[16:50:24] eljimador: has joined #ruby
[16:50:48] Vinkkamph: has joined #ruby
[16:51:20] safe: has joined #ruby
[16:51:58] zast: has joined #ruby
[16:52:53] qasaur: has joined #ruby
[16:54:21] hightower3: has joined #ruby
[16:55:23] jds: has joined #ruby
[16:55:52] chipotle: has joined #ruby
[16:56:25] tildes_: has joined #ruby
[16:57:40] nerium: has joined #ruby
[16:58:05] curses: has joined #ruby
[16:58:31] nerium: Is there a gem for verifying ssl certificates?
[16:58:57] mikecmpbll: has joined #ruby
[16:59:24] jhass: nerium: just use OpenSSL stdlib?
[17:00:10] nerium: jhass: Not sure how to use it. Did some experimenting with ”openssl s_client” but can’t get it to work properly
[17:00:42] Mweshi: has joined #ruby
[17:01:04] jhass: so you want to connect to a site and see if it has a valid certificate?
[17:01:25] Weavel: has joined #ruby
[17:02:29] jhass: http://devdocs.io/ruby~2.3/openssl#module-OpenSSL-label-SSL+client
[17:03:17] Mweshi: has joined #ruby
[17:03:30] flips: Any major drawback using concat withing <% %> in erb, instead of <%= %> for printing?
[17:03:42] flips: s/withing/within/
[17:03:55] jhass: I don't follow, can you provide full examples?
[17:03:58] spider-mario: has joined #ruby
[17:04:26] e4xit: has joined #ruby
[17:04:36] gizmore: has joined #ruby
[17:04:41] wilbert: has joined #ruby
[17:04:58] flips: jhass: Ref http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-concat states "If you absolutely must output text within a non-output code block (i.e., <% %>), you can use the concat method."
[17:05:15] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[17:05:53] flips: erb isn't rails specific, I guess?
[17:05:53] qasaur: has joined #ruby
[17:05:58] jhass: but concat is
[17:06:12] flips: oh ... dang
[17:06:26] jhass: normal erb doesn't even allow you to do that and I would consider it a smell in any case
[17:06:43] wor: I ran into a few more errors and decided to retry the installation steps but ran into bundle not currently installed though I installed it with gem https://gist.github.com/garvinguan/acd388d08554fa5ea65addd579a1bc7f
[17:07:50] aegis3121: has joined #ruby
[17:07:53] jhass: wor: is /usr/local/bin still in your $PATH?
[17:08:08] flips: jhass: I'm trying to avoid bad smelling code (kinda re-learning Ruby after some years away)
[17:08:24] nerium: jhass: Yes, that’s correct. I the end I want to tell Monit to verify that my site has a valid certificate
[17:08:31] jhass: flips: it's a strong indicator that you way too much logic in your view
[17:08:44] jhass: nerium: see my link then
[17:08:45] wor: yes /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/garvin/dev/activator-1.3.9/bin:/home/garvin/.rubies/ruby-2.3.1/bin
[17:09:30] jhass: uh you probably should take out the ~/.rubies one out of your path by now
[17:09:44] jhass: could you update your gist with the output of `gem env` ?
[17:09:52] jhass: and `sudo gem env` for good measure
[17:10:14] flips: jhass: Good point :) Thanks
[17:10:51] Asher: has joined #ruby
[17:10:54] xuex: has joined #ruby
[17:11:02] nankyokusei: has joined #ruby
[17:11:39] wor: removed ~/.rubies and updated gist with that output https://gist.github.com/garvinguan/acd388d08554fa5ea65addd579a1bc7f
[17:11:58] halfamind: has joined #ruby
[17:12:18] vdamewood: has joined #ruby
[17:12:42] jhass: you edited out your username or is it really that way?
[17:12:55] wor: i editted it out
[17:13:10] jhass: /usr/local/bin/bundle does not exist, correct?
[17:13:14] chouhoulis: has joined #ruby
[17:13:38] jds_: has joined #ruby
[17:13:40] ramfjord: has joined #ruby
[17:14:10] wor: ls /usr/local/bin brings it up
[17:14:29] jhass: huh, it does?
[17:14:38] jhass: why does command-not-found trigger then?
[17:14:52] jhass: did you maybe remove it's executable flag by accident or something like that?
[17:15:27] jhass: (considering you also made that directory world writable you probably where messing with it)
[17:15:38] jhass: (you should fix that too btw)
[17:15:41] wor: i was running into https://github.com/bundler/bundler/issues/3372 so i was trying to reinstall it but was messing with the permissions everywhere ugh
[17:16:20] wor: I'll try deleting it reinstalling with gem
[17:16:36] Cohedrin: has joined #ruby
[17:18:17] moeabdol: has joined #ruby
[17:18:29] mistermocha: has joined #ruby
[17:18:30] davedev24: has joined #ruby
[17:19:24] konsolebox: has joined #ruby
[17:19:36] firstdayonthejob: has joined #ruby
[17:19:57] e4xit: has joined #ruby
[17:20:19] tacit7: has joined #ruby
[17:20:51] nanoz: has joined #ruby
[17:22:10] last_staff: has joined #ruby
[17:22:48] TomyLobo: has joined #ruby
[17:23:33] lxsameer: has joined #ruby
[17:24:30] davedev24: has joined #ruby
[17:24:33] blackmesa: has joined #ruby
[17:25:15] dimon_: What's the idiomatic way to profile ruby or rails application? By profiling I mean finding bottlenecks.
[17:25:49] gnufied: has joined #ruby
[17:25:54] hahuang65: has joined #ruby
[17:27:34] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[17:28:31] Mr0rris0: has joined #ruby
[17:29:11] psf: has left #ruby: ()
[17:29:13] halfamind1: has joined #ruby
[17:29:27] mistermocha: has joined #ruby
[17:30:00] skade: has joined #ruby
[17:30:02] dimon_: hey, does anybody know the fastest way to calculate SHA512.hexdigest ? I mean, other than Digest::SHA512.hexdigest(secret_string)
[17:30:14] tomchapin: has joined #ruby
[17:30:41] dimon_: which is slow in my app
[17:30:56] jancel: has joined #ruby
[17:31:39] Billias: has joined #ruby
[17:31:44] nankyokusei: has joined #ruby
[17:32:24] umdstu: how can i tell if ruby compiled with openssl correctly, and what all ruby supports of the ssl install?
[17:32:55] drewo: has joined #ruby
[17:33:21] qasaur: has joined #ruby
[17:33:26] startupality: has joined #ruby
[17:33:42] jhass: well it either compiles with it or not, right?
[17:34:10] djbkd: has joined #ruby
[17:35:08] jhass: dimon_: quick unscientific benchmark suggests that Digest::SHA512 is faster than OpenSSL::Digest::SHA512
[17:35:18] noobsu: has joined #ruby
[17:35:36] rbennacer: has joined #ruby
[17:35:37] jhass: you realize the point of that hash function is to take its time, right?
[17:36:35] mikecmpbll: has joined #ruby
[17:36:41] Mr0: has joined #ruby
[17:37:05] dimon_: jhass: I see, tnx.
[17:37:12] anna`: has joined #ruby
[17:37:48] jhass: umdstu: as to what's supported, look at the docs
[17:37:50] dimon_: jhass: "you realize the point of that hash function is to take its time, right?" -- what do you mean?
[17:38:07] purrkode: has joined #ruby
[17:38:14] dimon_: ah, to prevent timing attacks?
[17:38:39] Billias: has joined #ruby
[17:38:43] dimon_: jhass: ah, to prevent timing attacks?
[17:38:59] jhass: that's one thing, also to make brute forcing harder
[17:39:03] bronson: has joined #ruby
[17:39:23] hxegon: anyone have a good up to date multithreading tutorial? The ones I can find are either old, or have no date and seem old.
[17:39:58] apeiros: hxegon: threading 101 didn't change the past 50 years
[17:40:34] jhass: that said next gen stuff like the actor model/celluloid isn't that old
[17:40:55] gtsai: has joined #ruby
[17:41:22] aeontech: has joined #ruby
[17:41:32] depesz: has joined #ruby
[17:42:01] depesz: is there any way to figure out how much memory is hash using? assuming it's plain hash with string as keys and integer as values.
[17:42:41] apeiros: depesz: require 'objspace' and then ObjectSpace.memsize_of
[17:42:55] apeiros: you'll have to do it on the hash and all its elements and sum that up
[17:43:25] depesz: ouch. anything that I could just feed hash to, and it would do the magic?
[17:43:45] apeiros: I would have started with that one…
[17:44:06] gtsai: has joined #ruby
[17:44:07] depesz: ok. thanks.
[17:44:17] psf: has joined #ruby
[17:44:26] ChiefAlexander: has joined #ruby
[17:47:47] tildes_: has joined #ruby
[17:48:33] havenwood: >> require 'objspace'; class Hash; def memsize; [*flat_map { |k, v| [ObjectSpace.memsize_of(k), ObjectSpace.memsize_of(v)] }, ObjectSpace.memsize_of(self)].inject(:+) end end; {soup: 'cereal'}.memsize
[17:48:34] ruby[bot]: havenwood: # => 136 (https://eval.in/573442)
[17:49:10] Billias: has joined #ruby
[17:49:47] hahuang65: has joined #ruby
[17:50:14] apeiros: havenwood: just map and + in the map
[17:50:20] apeiros: less arrays
[17:50:31] havenwood: apeiros: i started out that way, wasn't sure which was funner!
[17:50:46] havenwood: map { |k, v| ObjectSpace.memsize_of(k) + ObjectSpace.memsize_of(v) }
[17:51:20] tvw: has joined #ruby
[17:51:31] havenwood: yeah, fewer arrays is nice
[17:53:15] apeiros: IMO add #memsize to all objects and use .memsize :)
[17:53:20] havenwood: inject(0) { |sum, (k, v)| sum + ObjectSpace.memsize_of(k) + ObjectSpace.memsize_of(v) } + ObjectSpace.memsize_of(self)
[17:53:22] apeiros: enables easy recursion
[17:53:51] apeiros: so: class Object; def memsize; ObjectSpace.memsize_of(self); end; end
[17:54:13] stunder: has joined #ruby
[17:54:31] apeiros: and then: class Hash; def memsize; super+map { |k,v| k.memsize+v.memsize }.inject(:+); end; end
[17:55:14] djellemah: ha.reduce(ObjectSpace.memsize_of ha){|mem,(k,v)| mem + (ObjectSpace.memsize_of k) + (ObjectSpace.memsize_of v)}
[17:56:03] aeontech: has joined #ruby
[17:56:05] apeiros: apart from the ugly choice of parens - yeah, why not :)
[17:56:07] noobsu: has joined #ruby
[17:56:38] havenwood: apeiros: mmm :)
[17:57:16] blackmesa: has joined #ruby
[17:57:35] aeon_: has joined #ruby
[17:57:42] postmodern: has joined #ruby
[17:59:16] skolman: has joined #ruby
[18:01:10] Billias: has joined #ruby
[18:01:36] cpruitt: has joined #ruby
[18:01:51] mjuszczak: has joined #ruby
[18:02:01] flughafen_: has joined #ruby
[18:03:52] jhass: why not avoid one more array, inject(0) {|s, (k, v)| s += k.memsize + v.memsize }
[18:03:53] mikecmpbll: has joined #ruby
[18:03:59] Terens: has joined #ruby
[18:04:03] banister: has joined #ruby
[18:04:05] jhass: eh + not +=
[18:05:30] depesz: ok. one more question - is there any way to make stdout automatically flush on each write ?
[18:06:00] symm-: has joined #ruby
[18:06:30] aegis3121: has joined #ruby
[18:06:38] skylerto: has joined #ruby
[18:06:45] havenwood: depesz: http://ruby-doc.org/core/IO.html#method-i-sync-3D
[18:06:47] apeiros: jhass: that's what djellemah suggested? (though his included memsize of the hash itself via startvalue)
[18:06:57] depesz: havenwood: thanks.
[18:07:02] machinewar: has joined #ruby
[18:07:03] jhass: oh, somehow overlooked it
[18:07:23] havenwood: depesz: np, yeah just: STDOUT.sync = true
[18:07:29] machinewar: is it possible to connet to sftp w/ ruby's FTP module and not using sftp gem
[18:08:04] machinewar: maybe with net::SSH?
[18:08:12] jhass: machinewar: SFTP, not to be confused with FTPS and FTP are entirely distinct protocols
[18:08:23] jhass: Net::SSH is not a stdlib either
[18:08:37] dimon_: has joined #ruby
[18:08:45] machinewar: jhass: ah alright that's where I was confused thanks, any relatively simple way to do it with standard library
[18:09:06] shiver: has joined #ruby
[18:09:16] machinewar: jhass: kk thanks
[18:09:50] jhass: well besides shelling out to scp, but I hope that's not an option :P
[18:10:24] machinewar: jhass: lol not exactly
[18:10:36] dimon_: I need somehow speed up calculating sha512 in Ruby. Will it worth it to call a C++ library from Ruby calculating it? Or more or less the same as if I'm doing it in Ruby?
[18:11:15] jhass: dimon_: both OpenSSL::Digest::SHA512 and Digest::SHA512 are already implemented in C
[18:11:36] adaedra: you may be coming up against your computer's limits here.
[18:12:54] dimon_: jhass: yes, but if I call them in C, they'll be calculated faster, won't they?
[18:13:11] Billias: has joined #ruby
[18:13:34] jhass: I guess I don't follow your plan then
[18:16:23] smathy: I don't understand any of this, SHA512 is designed to be expensive, both in time and CPU resources.
[18:16:28] skade: has joined #ruby
[18:16:56] gtsai: has joined #ruby
[18:17:27] adaedra: And implementation is in C already.
[18:17:33] marr: has joined #ruby
[18:18:58] dimon_: adaedra: but calling it from Ruby adds overhead.
[18:19:16] adaedra: Not during calculation.
[18:19:22] adaedra: So it's not really relevant.
[18:19:22] smathy: The implementation specifics are irrelevant, the algorithm is designed to be expensive.
[18:19:35] smathy: (it would be pointless to make one implementation slow :)
[18:19:45] hiddenloop: has joined #ruby
[18:20:14] smathy: dimon_, the point here is that the calling overhead is trivial compared to the intentional expense of the algorithm itself.
[18:22:07] danostrowski: has joined #ruby
[18:22:36] Coldblackice: has joined #ruby
[18:24:02] idletask: has joined #ruby
[18:24:58] ftj: has joined #ruby
[18:25:22] adaedra: "overhead" https://gist.github.com/adaedra/03d719c3ac2840d3876d4f7bb3bdc2b4
[18:26:11] arlek: has joined #ruby
[18:26:12] aupadhye: has joined #ruby
[18:27:03] drewo: has joined #ruby
[18:27:14] ramfjord: has joined #ruby
[18:27:58] snowy: has joined #ruby
[18:28:11] adaedra: (Oh, OS X shasum is in perl, that explains it)
[18:28:34] kirun: has joined #ruby
[18:32:48] shevy: won't they rewrite everything in swift?
[18:33:09] gtsai: has joined #ruby
[18:34:12] startupality: has joined #ruby
[18:34:30] zeroDi: has joined #ruby
[18:34:33] whathappens: has joined #ruby
[18:34:54] skade: has joined #ruby
[18:36:56] aupadhye: has joined #ruby
[18:39:27] psf: has joined #ruby
[18:40:18] jenrzzz: has joined #ruby
[18:40:41] hahuang65: has joined #ruby
[18:41:00] arlek: has joined #ruby
[18:41:17] jancel: has joined #ruby
[18:42:38] qasaur: has joined #ruby
[18:44:25] hahuang65: has joined #ruby
[18:47:30] kareeoleez: can someone tell me why this code is leaking memory https://gist.github.com/chrisvel/cb5270ac0c64f78340d03ec476fa512b ?
[18:49:27] aupadhye: has joined #ruby
[18:50:33] skade: has joined #ruby
[18:50:43] ramfjord_: has joined #ruby
[18:51:25] Vegitto: has joined #ruby
[18:52:30] Vegitto: Hi! I want to import a package so that I could use it in irb and Ruby scripts. I've successfully done sudo gem install <package>, but if I attempt to use it in irb, it says 'undefined method'. How do I import it?
[18:52:46] umdstu: require ‘package'
[18:53:06] Vegitto: Hmm, that returns: NameError: undefined local variable or method
[18:53:22] umdstu: are you using rails?
[18:53:35] Vegitto: It's for this package: https://github.com/grosser/sort_alphabetical
[18:53:54] Vegitto: After gem install, it said: Successfully installed sort_alphabetical-1.0.2
[18:54:08] smathy: Vegitto, the line right after `require 'package'` has NameError ?
[18:54:46] jhass: kareeoleez: it's not, just producing GC bloat (the GC remembers that it needs all that memory all the time and doesn't free() it)
[18:54:56] smathy: Vegitto, did you maybe forget the quotes?
[18:55:11] kareeoleez: jhass: I was reading http://ruby-doc.org/core-2.3.0/GC.html just now
[18:55:16] blaxter: has joined #ruby
[18:55:20] kareeoleez: jhass: do you think I must trigger GC manually ?
[18:55:22] Vegitto: smathy: yup, I did - now irb(main):002:0> require 'sort_alphabetical' returns 'true'
[18:55:22] stunder: has joined #ruby
[18:55:26] jhass: kareeoleez: no
[18:55:27] adaedra: shevy: If it works already, no need to rewrite it.
[18:55:50] kareeoleez: jhass: so I need to free it manually
[18:55:57] gtsai: has joined #ruby
[18:56:23] kareeoleez: what do you suggest ?
[18:56:28] aupadhye: has joined #ruby
[18:56:33] jhass: accept the memory usage
[18:56:55] jhass: if you can't, then ruby is likely not the right tool for the job, sorry
[18:57:01] drownme: has joined #ruby
[18:57:06] kareeoleez: jhass: this makes sens
[18:57:18] eam: actually that's bad advice - forcing the GC to run manually will probably fix the issue
[18:57:22] apeiros: http://img.memecdn.com/deal-with-it_o_268819.jpg
[18:57:23] kareeoleez: jhass: but how could I control it ? what about If I break down the iterations
[18:57:29] eam: there are a bunch of workloads where ruby GC just does silly things
[18:57:37] eam: and many of them can be fixed by invoking the GC
[18:57:55] kareeoleez: eam: remove stress to class ?
[18:58:23] eam: kareeoleez: try adding a GC.start in there
[18:58:36] drownme: this is most likely a dumb question: how am I supposed to install rubygems once I have RVM?
[18:58:54] jhass: drownme: you should already have it
[18:59:27] drownme: jhass, my shell doesn't know 'gem' though
[18:59:49] jhass: you sure you installed a ruby into RVM?
[18:59:52] kareeoleez: eam: that does nothing
[19:00:09] jhass: drownme: what's `rvm current` saying?
[19:00:17] kareeoleez: eam: actually I see ruby memory doesn't get freed after the program finishes
[19:00:30] eam: kareeoleez: memory is always freed after a program finishes
[19:00:41] kareeoleez: I see it in the activity monitor
[19:00:54] jhass: drownme: that's curious, mind pasting `rvm info` to gist?
[19:01:00] eam: you see a process?
[19:01:06] eam: if you see a process, the program hasn't exited
[19:01:16] eam: if you don't see a process, the memory is no longer in use
[19:01:20] kareeoleez: eam: ah ok it frees it but after some seconds
[19:01:39] kareeoleez: eam: but again, it's consuming 6.5GB of memory for a simple iteration
[19:02:14] eam: well how much should it be consuming?
[19:02:15] kareeole_: has joined #ruby
[19:02:22] drownme: jhass, https://gist.github.com/anonymous/e69027a5bd312d49da550a4988804baa
[19:02:37] kraken: has joined #ruby
[19:02:42] eam: running the GC will help you with multiple iterations - but if one single iteration is using too much memory that's something you'll need to work with
[19:02:57] kraken: does a splat argument create an array when you feed in multiple arguments to it?
[19:03:02] kareeoleez: eam: https://gist.github.com/chrisvel/cb5270ac0c64f78340d03ec476fa512b that doesn't work
[19:03:09] eam: jhass: one of the first ruby programs I ever wrote would reliably drive my system into the dirt: https://gist.github.com/eam/0c054ab590b1fbb4c2b543f1c8eb1698
[19:03:10] jhass: drownme: well that says gem is at /home/me/.rvm/rubies/ruby-2.3.0/bin/gem and /home/me/.rvm/gems/ruby-2.3.0/bin is in your $PATH
[19:03:31] ur5us: has joined #ruby
[19:03:38] eam: each SDL surface would be something like 10MB, and after reading one or two comic books I'd be out of memory
[19:03:58] eam: but prodding the GC -> worked like a charm
[19:04:03] drownme: jhass, sorry and thanks
[19:04:19] drownme: jhass, using RVM for the first time
[19:04:24] jhass: eam: well, I guess with all the stuff happening to the GC in every 2.x that to be problems of the past
[19:05:09] eam: 2.0 is way better (and I think I was using ... 1.6 back then?)
[19:05:09] kareeoleez: eam: I don't know why it doesn't work for me
[19:05:20] kareeoleez: I believe I'll have to break the iteration down
[19:05:40] eam: but even on fairly new 2.x rubies I've seen pretty terrible GC behavior with loops that allocate objects
[19:05:49] kareeoleez: but again there will be a large iteraation and many small ones
[19:06:01] eam: not an issue unique to ruby
[19:07:54] asher128__: has left #ruby: ("Leaving")
[19:08:21] gtsai: has joined #ruby
[19:08:55] codecop: has joined #ruby
[19:10:07] qasaur: has joined #ruby
[19:10:28] chipotle: has joined #ruby
[19:10:43] finisherr: has joined #ruby
[19:12:08] tomphp: has joined #ruby
[19:13:16] programmerq: has joined #ruby
[19:13:28] tercenya: has joined #ruby
[19:14:03] kareeoleez: eam: I don't get what really happens in order to fix it
[19:15:27] blackmesa: has joined #ruby
[19:15:35] jhass: if you want memory usage down, give up sorting and pass a block to repeated_combination
[19:15:49] smathy: You're iterating over ~ 23 million arrays, joining them and then sorting them, this is going to be CPU and memory intensive, no way around it.
[19:16:08] kareeoleez: jhass: do you think sorting is slowing it down ?
[19:16:22] Mweshi: has joined #ruby
[19:16:28] jhass: no, but impossible without allocating an array
[19:16:31] nanoz: has joined #ruby
[19:16:41] kareeoleez: smathy: so the entire code is wrong
[19:16:51] kareeoleez: I mean maybe just my solution is not right
[19:17:20] jhass: ah yeah and don't #product
[19:17:22] smathy: The sort doesn't add much time or memory.
[19:17:37] jhass: if you can avoid it
[19:17:46] jhass: though that should still be okayish
[19:17:55] smathy: It's over 4GB and 60 seconds on my machine with no sort and not using map (just pushing the join onto an array).
[19:18:17] chouhoulis: has joined #ruby
[19:18:23] smathy: The product doesn't cost much at all, just generates lots of elements ;)
[19:18:30] rht: has joined #ruby
[19:19:02] noobsu: has joined #ruby
[19:19:50] kareeoleez: so I need to decrease the amount of array elements
[19:20:11] kareeoleez: I don't get why do they have to be ~ 23 million arrays
[19:20:23] smathy: ...you created that many.
[19:20:26] kareeoleez: because in every iteration only a small portion of it is being used
[19:20:42] kareeoleez: the GC shouldn't free the memory ?
[19:21:07] drewo: has joined #ruby
[19:21:55] jhass: you don't get that the blockless repeated_combination call pushes all combinations into an array?
[19:22:27] kareeoleez: When invoked with a block, yields all repeated combinations of length n of elements from the array and then returns the array itself.
[19:22:44] kareeoleez: but for the X iteration only Y elements are used
[19:23:04] kareeoleez: do you believe it pushes them all in one array ?
[19:23:16] JakFrist: has joined #ruby
[19:23:32] smathy: kareeoleez, how else do you think the .sort can work?
[19:24:42] ramfjord: has joined #ruby
[19:24:49] ma489: has joined #ruby
[19:24:56] smathy: ...but actually, the resulting array isn't the issue here, it's the internal array that repeated_combination itself is generating. I mean it returns an iterator, but you must realize that the values are held somewhere.
[19:25:42] yfeldblum: has joined #ruby
[19:26:44] jhass: it's not computing them lazily? :o
[19:27:00] qasaur: has joined #ruby
[19:27:07] smathy: Yeah, sorry, forget me - you're right jhass.
[19:27:17] cpup: has joined #ruby
[19:27:27] smathy: ...it IS the resulting array's fault.
[19:27:44] apeiros: it still has to create an array on each iteration for the .map
[19:28:02] jhass: yes, but GC can free it
[19:28:03] apeiros: those should be short-lived
[19:28:11] moei: has joined #ruby
[19:28:18] jhass: yup, and we're talking about memory here, not so much speed
[19:28:51] smathy: Yep, as I mentioned above, switching to a block that pushes the `.join` onto an array doesn't alter the memory or CPU usage much.
[19:29:10] kareeoleez: so the entire implementation is wrong
[19:29:46] kareeoleez: maybe I should move to a block instead of using predefined methods like product and repeated combination
[19:29:50] smathy: Might not be, this might be the best way there is to do this.
[19:30:20] smathy: kareeoleez, none of that will make any difference.
[19:30:29] crystal77: has joined #ruby
[19:30:45] aldodelgado: has joined #ruby
[19:30:47] RegulationD: has joined #ruby
[19:31:20] jhass: allocation free IO for the win :P
[19:31:23] smathy: The slowest and most memory hungry part of this is the join
[19:31:41] eljimmy: has joined #ruby
[19:32:08] jhass: array.join("", STDOUT)
[19:32:36] nankyokusei: has joined #ruby
[19:33:28] Polysics: has joined #ruby
[19:34:42] CoderPuppy: has joined #ruby
[19:35:08] maxdoubt: has joined #ruby
[19:35:11] kareeoleez: sure there will be a way
[19:35:36] kareeoleez: isn't it what algorithms are for ?
[19:36:03] smathy: kareeoleez, yep.
[19:36:36] smathy: So yeah, if you can avoid making the array that you then join into a string then you'll be better off.
[19:36:41] kareeoleez: there's cewl also https://github.com/crunchsec/cewl
[19:37:54] stunder: has joined #ruby
[19:38:15] flughafen_: has joined #ruby
[19:41:07] idefine_: has joined #ruby
[19:41:28] bronson: has joined #ruby
[19:41:31] kareeoleez: smathy: yeah strings (I believe) should be fine
[19:41:34] kareeoleez: thanks for this
[19:41:48] mistermocha: has joined #ruby
[19:41:49] noobsu: has joined #ruby
[19:43:01] idefine_: has joined #ruby
[19:43:06] _kraken: Is it usual to get this long ass error when you use 'rake' and have a syntax error? http://i.imgur.com/qyAVR4m.png
[19:43:42] tubbo: so i'm trying to do a silly thing. i want to see all constants defined in a module.
[19:43:49] tubbo: but not just directly in the module...all the way down
[19:44:02] Akuma: has joined #ruby
[19:44:09] tubbo: so if i have a Foo::Bar::Baz class, and I do Foo.constants, only Bar shows up, not 'Bar::Baz'
[19:44:28] unreal: has joined #ruby
[19:44:48] apeiros: tubbo: because Bar::Baz is not a constant
[19:44:52] smathy: _kraken, it's a stacktrace, yes - normal.
[19:44:54] tubbo: this is actually for a further silly thing...even sillier than the first. the idea here is to iterate through each instance method defined in a module and build a new .rb file with those definitions.
[19:45:08] _kraken: <smathy> What is a stackface?
[19:45:10] tubbo: apeiros: right, that makes sense
[19:45:57] tubbo: i tried to iterate over every constant that also had .constants defined, but i got a really weird list of stuff that wasn't in my module at all
[19:46:24] smathy: Bar::Baz is as much a constant as Bar is though, no?
[19:46:56] apeiros: Bar is a constant
[19:47:04] apeiros: Baz is a constant within Bar
[19:47:25] apeiros: and Bar::Baz is accessing the constant Baz within Bar
[19:47:32] smathy: Oh, ok. I see the distinction.
[19:47:34] duoi: has joined #ruby
[19:48:06] apeiros: of course, colloquially we'll refer to it as "the constant Bar::Baz"
[19:48:21] tubbo: oh wait i got it
[19:48:50] smathy: ...what if you defined Bar::Baz like that, like: Bar::Baz = 5 ?
[19:49:05] apeiros: you'll have to define Bar first
[19:49:15] apeiros: and it'll have to be a Module or subclass thereof
[19:49:39] apeiros: (and let me remind the audience at this point that Class is a subclass of Module)
[19:51:37] mostlybadfly: has joined #ruby
[19:52:48] mrfoto: has joined #ruby
[19:53:32] Avinty-L: has joined #ruby
[19:53:38] skylerto: has joined #ruby
[19:54:24] qasaur: has joined #ruby
[19:55:35] tinnvec: has left #ruby: ("I'm going to my own channel, with blackjack and hookers!")
[19:56:18] djbkd: has joined #ruby
[19:57:17] 7GHAA4DG2: has joined #ruby
[19:57:37] johnmilton: has joined #ruby
[19:58:00] hutch34: has joined #ruby
[19:59:12] edwinvdgraaf: has joined #ruby
[19:59:15] whathappens: has joined #ruby
[19:59:16] duckpuppy: has joined #ruby
[20:01:15] JonasOSDever: has joined #ruby
[20:02:16] aeontech: has joined #ruby
[20:02:33] jenrzzz: has joined #ruby
[20:02:52] eL_bAmba: has joined #ruby
[20:03:46] z4ppy_: has joined #ruby
[20:04:47] nankyokusei: has joined #ruby
[20:06:35] cschneid_: has joined #ruby
[20:07:18] cschneid_: I'm exploring some ruby C apis, and would like to be able to drop into gdb. Is there a way to load up a gem in irb, then break into gdb at a certain breakpoint? I'm not super familiar w/ gdb-land unfortunately
[20:07:40] cschneid_: or would I write a test shim .rb file, then launch ruby with gdb, and breakpoint the spot, then 'run' the app
[20:09:04] bougyman: there's no way to access a (local) variable that I have assigned to another variable, is there?
[20:09:21] bougyman: test = "myvar"; myvar = "something"
[20:09:56] danostrowski: has joined #ruby
[20:10:20] adaedra: surely through binding
[20:10:50] bougyman: [22] pry(main)> binding.send(test.to_sym)
[20:10:50] bougyman: NoMethodError: undefined method `myvar' for #<Binding:0x00000002a3be00>
[20:10:55] bougyman: not like that, anyway, tried it.
[20:11:15] bougyman: oh, binding.local_variable_get
[20:12:00] Xiti: has joined #ruby
[20:12:38] qasaur: has joined #ruby
[20:12:46] jancel: has joined #ruby
[20:12:53] noobsu_: has joined #ruby
[20:13:49] eljimmy: has joined #ruby
[20:13:51] mistermocha: has joined #ruby
[20:15:11] drewo: has joined #ruby
[20:15:52] klausmeyer: has joined #ruby
[20:16:04] johnmilton: has joined #ruby
[20:16:12] cdg: has joined #ruby
[20:16:18] Mr0: has joined #ruby
[20:17:42] neanderslob_: has joined #ruby
[20:18:18] ule: has joined #ruby
[20:18:53] ule: has joined #ruby
[20:18:57] xall: has joined #ruby
[20:19:04] futilegames: has joined #ruby
[20:19:16] gizless: has joined #ruby
[20:20:22] xall: has joined #ruby
[20:20:25] gizmore|2: has joined #ruby
[20:20:46] danostrowski: has joined #ruby
[20:21:13] gizmore|3: has joined #ruby
[20:21:53] gizmore|4: has joined #ruby
[20:21:55] cpup: has joined #ruby
[20:22:13] edwinvdgraaf: has joined #ruby
[20:22:53] futilegames: has joined #ruby
[20:22:55] gizmore: has joined #ruby
[20:23:00] pawnbox: has joined #ruby
[20:23:23] jancel: has joined #ruby
[20:25:46] troulouliou_dev: has joined #ruby
[20:26:23] flashpoint9: has joined #ruby
[20:28:26] shevy: style question
[20:28:41] shevy: say you have a class: class Foo; def initialize; puts 'hi'; end; end
[20:29:03] wilsonc91: has joined #ruby
[20:29:04] shevy: now you want to add a class method, def self.run ... so we have it as Foo.run too. Would you put the class-method definitions above, or below, "def initialize"?
[20:29:32] smathy: shevy, wherever my cursor happened to be.
[20:30:26] jhass: run like calls new, new is kind of implicitly defined by initialize or at least calls it, so run calls initialize and thus run goes before it
[20:30:47] voker57: has joined #ruby
[20:30:47] voker57: has joined #ruby
[20:30:54] JStoker: has joined #ruby
[20:30:59] mdw: has joined #ruby
[20:31:03] _whitelogger: has joined #ruby
[20:31:17] tekacs: has joined #ruby
[20:31:19] [spoiler]: has joined #ruby
[20:31:59] shevy: smathy haha that was what I was doing just now... then I realized, I was putting it above "def initialize" which I found odd
[20:32:07] shevy: jhass I see
[20:32:32] noobsu: has joined #ruby
[20:32:45] jenrzzz: shevy: if there are only a couple class methods, I don't worry about it too much. if there are more I put them in a class << self block at the top of the class definition
[20:32:54] neanderslob: has joined #ruby
[20:37:37] Es0teric: has joined #ruby
[20:37:59] whathappens: has joined #ruby
[20:38:22] whathapp_: has joined #ruby
[20:38:29] Gasher: has joined #ruby
[20:38:36] edwinvdg_: has joined #ruby
[20:38:41] hahuang65: has joined #ruby
[20:38:45] skylerto: quick question, is in necessary to have bundler in a gem's gemspec?
[20:39:23] adaedra: bundler is for Gemfile
[20:39:38] skylerto: that makes sense.
[20:39:42] skylerto: Thanks so much. :D
[20:40:01] adaedra: (doesn't mean you should put bundler in your Gemfile either)
[20:40:39] centrx: has joined #ruby
[20:41:29] CoderPuppy: has joined #ruby
[20:41:34] mtkd: has joined #ruby
[20:41:41] JonasOSDever: has joined #ruby
[20:42:20] skylerto: but as long as they have bundler on their machine they can bundle install in the gem and ti will fetch the required gems and put them in .bundle?
[20:42:33] skylerto: by on their machine i mean system wide.
[20:45:06] adaedra: If there's a Gemfile, yes
[20:46:44] noobsu: has joined #ruby
[20:47:04] s00pcan_: has joined #ruby
[20:47:19] eljimador: has joined #ruby
[20:49:20] blackgoat: has joined #ruby
[20:49:24] ur5us: has joined #ruby
[20:50:40] startupality: has joined #ruby
[20:52:16] Mweshi: has joined #ruby
[20:53:27] frem_: has joined #ruby
[20:53:35] Xiti: has joined #ruby
[20:53:41] duoi: has joined #ruby
[20:53:58] edwinvdgraaf: has joined #ruby
[20:54:53] danostrowski: has joined #ruby
[20:55:11] aeontech: has joined #ruby
[20:56:19] ramfjord: has joined #ruby
[20:57:39] Tesla: has joined #ruby
[20:57:52] Tesla: Anyone active here?
[20:58:31] ruby[bot]: Just ask your question, if anyone has or can, they will respond.
[20:58:59] Tesla: I'm kind of new to ruby but I was wondering if I can start practicing by creating a simple window... However, I am curious to know if there is a way to do so from scratch, like you could do with just code in a language like Java using integrated libraries like JFrame. Any ideas?
[20:59:52] adaedra: To be honest, GUI is not one of ruby's strengths. But there are some libraries to do that, yes, like shoes
[21:00:14] skylerto: shoes is nice. :D
[21:00:55] zacts: Tesla: I <3 AC over DC
[21:00:57] Tesla: I also regret to say that I am not very familiar with using libraries in programming, in Java I would just use an IDE like Eclipse and link any libraries I wanted to add... Are there any such IDEs for Ruby?
[21:00:58] zacts: just fwiw
[21:01:31] bougyman: Tesla: I hear Rubymine has all those dials and bells and whistles.
[21:01:31] bougyman: i've never tried it myself.
[21:01:31] bougyman: it's for-pay, iirc.
[21:01:51] ruby[bot]: an IDE is not necessary to develop with ruby. A decent text editor is sufficient. If you truly want an IDE, take a look at RubyMine by JetBrains (https://www.jetbrains.com/ruby/).
[21:01:57] noobsu_: has joined #ruby
[21:02:05] adaedra: Ruby libraries are named "gems" and are really easy to use.
[21:02:24] Tesla: I can pirate anything you have to pay for but is there any simple, very open and publicly used IDE for ruby that has the ability to do so? Like Eclipse for Java?
[21:02:30] adaedra: Also, Ruby is different from Java in the way of working, as you have no "compilation" step
[21:02:30] zacts: I wonder if Atom supports Ruby well
[21:02:40] adaedra: And we don't pirate in this channel, thank you.
[21:02:46] bougyman: Tesla: you just lost me with the pirate comment.
[21:02:49] Tesla: adaedra what so it's directly interpreted?
[21:02:56] zacts: Tesla: Atom may or may not have what you are looking for, or Eclipse
[21:03:03] zacts: http://atom.io
[21:03:06] chip_: has joined #ruby
[21:03:14] adaedra: Most editors have support for Ruby.
[21:03:29] zacts: but Ruby doesn't need an IDE like Java, afaik.
[21:03:30] adaedra: An editor and a terminal is really all you need to get started.
[21:03:32] zacts: I'm doing fine with vim
[21:03:41] Tesla: I know Eclipse usually has plugins and extensions for practically every language but I wanted to see if there's a Ruby IDE
[21:03:51] zacts: I use a terminal + tmux + vim + bash shell
[21:04:04] zacts: ^ this is my Ruby IDE
[21:04:12] zacts: (being a newbie)
[21:04:14] Papierkorb: Atom editor, before it was (KDE) Kate.
[21:04:16] havenwood: Tesla: There's JetBrains RubyMine but most Rubyists use a text editor.
[21:04:33] Dimik: has joined #ruby
[21:04:34] eL_bAmba: sublime text its another good editor
[21:04:40] djbkd: has joined #ruby
[21:05:03] flopsec: has joined #ruby
[21:05:09] Tesla: Could you then direct me to a tutorial or tutor me on how to setup a project folder with source code and libraries that I could errr... export?
[21:05:28] adaedra: http://guides.rubygems.org/make-your-own-gem/
[21:05:41] Tesla: Papierkorb like a standalone executable launcher
[21:05:44] nettoweb: has joined #ruby
[21:06:07] Papierkorb: adaedra: You probably mean "how to build a Gem?", see what adaedra wrote
[21:06:07] futilegames: has left #ruby: ()
[21:06:23] adaedra: You may want to start by learning the language itself though. :)
[21:06:26] skweek: has joined #ruby
[21:06:29] Tesla: adaedra I have
[21:06:51] Tesla: adaedra but a long time ago, a few revisions are usually enough for me to remember...
[21:07:00] adaedra: So you're not "kind of new"?
[21:07:13] bobbycvi: has joined #ruby
[21:07:25] Tesla: I know the syntax and explored some frameworks and APIs like rails etc but somewhat long ago
[21:07:35] n_blownapart: has joined #ruby
[21:07:44] zacts: Tesla: I like this book Head First Ruby
[21:07:48] Tesla: but only the syntax and uses of frameworks and APIs, not how to use them really
[21:07:49] zacts: as an intro book
[21:08:02] adaedra: Well, read up a little more on rubygems
[21:08:13] ramfjord: has joined #ruby
[21:08:21] Tesla: adaedra: on http://guides.rubygems.org/ ?
[21:08:31] adaedra: Precisely.
[21:08:48] Tesla: I've moved from Java because of how in-complete and annoying it is :S
[21:08:55] yqt: has joined #ruby
[21:09:00] workmad3: has joined #ruby
[21:09:08] Papierkorb: in-complete? (Annoying, yes)
[21:09:18] adaedra: Well, let's not start a language war here, people.
[21:09:50] Tesla: Some of the features do not exploit the full potential behind their concepts, for saving a bit of memory, processing power and efficiency... Though freedom of expression is not worth the sacrafice
[21:10:01] Tesla: adaedra it's not a war, just a discussion
[21:10:24] adaedra: We've #ruby-offtopic for these discussions.
[21:11:13] Tesla: Papierkrob: e.g. arrays not supporting generics because they're co-variant and too much is handled at compile-time :|
[21:11:43] Tesla: adaedra: it's Ruby vs Java, notice the "Ruby" in the name of this discussion
[21:12:46] Papierkorb: Tesla: even then, you can use JRuby to interact with (existing?) Java Code/Libraries with ease. Just showcased this to my Java coworkers today, they were surprised how easy it was and how well it works
[21:13:25] Tesla: Meh... java can go to hell, Ruby's the spiritual successor of Smalltalk, which offered insane potential, heil yus
[21:14:25] Papierkorb: Both have their place. Ruby just happens to fill a large-ish "niche" for many I guess
[21:14:56] Tesla: that's oxymoronic :S
[21:16:10] Tesla: Waaaait... Ruby interpreters directly... sooooooooo, there's no compile-time limitations? :O
[21:16:33] JonasOSDever: has joined #ruby
[21:16:54] adaedra: What kind of limitations?
[21:17:19] adaedra: But yeah, Ruby has some nice run-time tricks.
[21:18:14] Tesla: Well often times compilers are very strict and to optimize code can disallow some... "out-of-the-box" programming design patterns
[21:18:59] Tesla: If that makes sense ._.
[21:19:31] Papierkorb: If an interpret can do something, a compiler can do it too (and vice-versa)
[21:19:45] Tesla: I can't pinpoint any examples from my experience but I do know that many obstacles I've encountered in programming were due to limitations imposed by compilers during compile-time
[21:19:56] Tesla: especially in Java ¬_¬
[21:19:58] chouhoulis: has joined #ruby
[21:20:05] Papierkorb: Then those were language limitations
[21:20:07] cdg_: has joined #ruby
[21:20:08] adaedra: Limitations are more often dependant on the language
[21:20:15] adaedra: Papierninja
[21:20:56] Tesla: I know but whether a language is interpreted or compiled first is also dependent on the language, some allow both I assume but if a decision is made to use a compiler, the imposition of many limitations often follow it.
[21:21:36] Tesla: *sighs* Ignore me... I'm just obsessed with freedom :|
[21:21:37] qasaur: has joined #ruby
[21:22:01] Papierkorb: ya lets not build a wall
[21:22:47] eam: I'm not aware of any languages which can't be either interpreted or compiled
[21:23:54] Tesla: Ermm... I haven't even installed Ruby... anyone know of any video tutorial on compiling it?
[21:24:07] stunder: has joined #ruby
[21:24:09] cdg: has joined #ruby
[21:24:23] Papierkorb: Tesla: ask your OS repo manager to install it for you
[21:24:25] adaedra: step 1: install ruby-install. step 2: install ruby with ruby-install. step 3: profit!
[21:24:27] Papierkorb: (Or use chruby)
[21:24:33] Tesla: OS... repo... manager?
[21:24:38] qasaur: has joined #ruby
[21:24:43] Papierkorb: Tesla: are you on windows?
[21:24:43] adaedra: What system are you on?
[21:24:59] Tesla: Windows? :O
[21:25:27] adaedra: ruby-lang.org, section Install, should have everything you need.
[21:25:34] djbkd: has joined #ruby
[21:25:58] Tesla: The only confusion I have is that I never knew "sudo" is a command in Windows?
[21:26:03] Mweshi: has joined #ruby
[21:26:14] jancel: has joined #ruby
[21:26:28] eam: runas is, however
[21:26:38] ChiefAlexander: has joined #ruby
[21:26:39] gtsai: has joined #ruby
[21:27:02] adaedra: Just go with RubyInstaller and be happy, or get a Linux on a VM and save some headaches.
[21:27:29] Tesla: But... it's probably simple in Windows too... only... I have no idea where to find a guide :U
[21:27:41] adaedra: Windows is not the best system to do Ruby on.
[21:27:59] Papierkorb: Windows is not the best system. Just end the sentence there.
[21:28:04] xall: has joined #ruby
[21:28:19] Tesla: I don't think I'm going to change my OS just for the sake of one hobby :T
[21:28:26] Tesla: I know you can do Ruby on Windows
[21:28:43] adaedra: You can, but you'll run into problems with some gems sooner or later.
[21:28:47] adaedra: I know I have.
[21:29:07] eam: most people who know what they're doing aren't using that system, so you'll run into a shortage of people to ask for help -- which is what's happening here
[21:29:13] qasaur: has joined #ruby
[21:29:25] Tesla: I want to write most of my programs from scratch so I doubt I'm going to use anything external apart from shoes...
[21:30:06] Papierkorb: Tell me in 6 months if you changed your mind about "everything from scratch"
[21:30:40] Tesla: I'ma dryer, it shouldn't take too long
[21:30:55] adaedra: Papierkorb: everything is possible, we have someone still doing CGI here after all.
[21:31:10] Tesla: by dry I mean Don't Repeat Yourself :|
[21:31:27] adaedra: Another rule is "Don't reinvent the wheel"
[21:31:27] gtsai: has joined #ruby
[21:31:55] bobbycvi: has joined #ruby
[21:31:57] Tesla: A rule which I don't follow...
[21:32:09] djbkd: has joined #ruby
[21:32:51] tacit7`: has joined #ruby
[21:33:00] Tesla: Meh... I'll just use Ruby Installer... too lazy P:
[21:33:22] bobbycvi: has joined #ruby
[21:33:32] zel: has joined #ruby
[21:33:36] gtsai: has joined #ruby
[21:33:50] Tesla: What's Tcl/Tk support, the installer's saying it's for building GUIs... which sounds useful
[21:34:33] jhass: if you were okay with swing GUIs, Tk will be fine too I guess
[21:34:34] tacit7``: has joined #ruby
[21:35:07] Tesla: Only heard swing in Java, where I used JFrame, if that's something similar then that's great?
[21:35:52] jhass: I was referring to java swing
[21:37:46] Tesla: Oh my shits... It's just like Java...
[21:38:18] jhass: that's what I meant
[21:38:23] beauby: has joined #ruby
[21:38:32] Tesla: Ik... but it fails to sink in
[21:40:01] startupality: has joined #ruby
[21:40:12] Tesla: How can I hide the default console?
[21:40:25] kareeole_: has joined #ruby
[21:40:42] Tesla: Oh nevermind just changing extension to .rbw
[21:41:12] alxgsv: has joined #ruby
[21:41:42] n_blownapart: has joined #ruby
[21:42:37] bronson: has joined #ruby
[21:43:22] hahuang65: has joined #ruby
[21:43:26] Tesla: Omg... ruby is beast
[21:44:55] noobsu: has joined #ruby
[21:45:39] Tesla: Guys... say I have an .rbw file that requires Tk and lots of other .rb files that I write for some program... And I have all this in one folder, is there any way I can make this into something people can download and use without having to install ruby? E.g. a game
[21:46:09] eam: Tesla: generally you'd distribute it with a ruby bundled together with all the gems
[21:46:27] eam: most applications consist of large bundles of files
[21:46:54] djbkd: has joined #ruby
[21:47:03] Tesla: eam: How would one go about doing this? I'd assume you'd need an .exe launcher, scripts in a folder and ruby interpreter and Tk too, but how would... err... I bundle this?
[21:47:18] Tesla: Link to tutorial(s)?
[21:47:30] eam: can't help you with windows, sorry. Most systems have package management built in
[21:47:46] Tesla: ok thnx anyway
[21:48:07] Tesla: well I have to make something first so I'll just stick to that :)
[21:48:19] djbkd: has joined #ruby
[21:50:27] ramfjord: has joined #ruby
[21:51:44] hays_: has joined #ruby
[21:51:59] ledestin: has joined #ruby
[21:55:43] Tesla: Is ruby friendly with functional programming?
[21:56:04] ctrlrsf: has joined #ruby
[21:56:07] ruby-lang326: has joined #ruby
[21:56:27] sondr3: has joined #ruby
[21:57:29] qasaur: has joined #ruby
[21:58:41] mic_e: has joined #ruby
[22:00:10] Pumukel: has joined #ruby
[22:00:40] jancel: has joined #ruby
[22:00:44] jhass: some argue so, but don't expect to find FP concepts directly
[22:01:15] jhass: Ruby is object oriented throughout
[22:02:24] qasaur: has joined #ruby
[22:03:35] yfeldblum: has joined #ruby
[22:04:42] xall_: has joined #ruby
[22:04:44] qasaur: has joined #ruby
[22:05:24] yfeldblum: has joined #ruby
[22:06:04] gregf: has joined #ruby
[22:07:16] leitz: has joined #ruby
[22:08:22] wldcordeiro: has joined #ruby
[22:08:38] Tesla: has joined #ruby
[22:09:20] shevy: did he insta-quit!
[22:09:42] mjuszczak: has joined #ruby
[22:12:43] halfamind: has joined #ruby
[22:13:20] nettoweb: heys guys, do you know if it's possible to do this exactly command but using just sql? https://gist.github.com/osnysantos/8d110810ee33760e4ee6b372c825da4d ? Update a model based in a association
[22:13:20] noobsu: has joined #ruby
[22:15:32] danostrowski: has joined #ruby
[22:17:39] Radar: ?xy nettoweb
[22:17:39] ruby[bot]: nettoweb: 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
[22:18:06] malconis: has joined #ruby
[22:18:27] Cork: has joined #ruby
[22:18:57] nettoweb: Because it seems hard to do in sql, maybe a clue so I can search for
[22:19:55] hahuang65: has joined #ruby
[22:19:59] Radar: nettoweb: Why do you want to do it in SQL anyway?
[22:20:47] nettoweb: yes, because it's form a project in PHP, using a framework I've seen before. So maybe a sql is better
[22:21:29] jhass: UPDATE statements happily accept subselects in their values
[22:21:48] jhass: that's all, this ain't #RubyOnRails, nor #sql nor #php
[22:22:07] madhatter: has joined #ruby
[22:22:12] eam: or joins
[22:22:50] shadeslayer: has joined #ruby
[22:22:53] jhass: most RDBMS probably rewrite both to the same anyway
[22:23:44] amincd: has joined #ruby
[22:24:31] Danielss89: has joined #ruby
[22:24:32] zacts: shevy: I just finished all of head first ruby! \o/
[22:24:36] amincd: Hi, how do I get a ruby program to wait until a 'puts' method has completed outputting its result before moving to the next line of code?
[22:24:36] depesz: has joined #ruby
[22:24:40] zacts: I love this book
[22:24:47] zacts: on to my next readings: poodr is next
[22:25:20] jhass: amincd: STDOUT.sync = true though probably an XY-problem
[22:27:00] shevy: zacts you mean a book?
[22:27:07] amincd: jhass: just tried it, unfortunately didn't work. It's writing the output of the second 'puts' method before it has finished the output from the first 'puts' call
[22:27:08] noobsu: has joined #ruby
[22:27:39] jhass: that seems unlikely, show code/reproducer?
[22:29:06] zacts: shevy: yes. the book Head First Ruby. I just finished it. And next on my list is http://poodr.com
[22:31:49] jaguarmagenta: has joined #ruby
[22:33:36] qasaur: has joined #ruby
[22:33:59] nankyokusei: has joined #ruby
[22:36:01] snowy: has joined #ruby
[22:36:23] nullFxn: has joined #ruby
[22:36:37] Ballo: if I need to pass multiple arguments can I use an array? I tried this line to no avail:
[22:36:37] Ballo: err_arr.map { |t| [t.to_hash,t.tminutes] if !t.test? }.compact.each do |tuple|
[22:36:54] blackgoat: has joined #ruby
[22:37:47] sneakerhax: has joined #ruby
[22:38:33] zenlot6: has joined #ruby
[22:40:46] baweaver: [['a', 1],['b,2],nil].compact.each { |(k,v)| ... }
[22:40:49] jhass: that does work, can even do .each |hash, minutes| at the end
[22:40:59] amincd: jhass: https://gist.github.com/anonymous/03a0695e838f1c8cbd12a8e17fd5aa86
[22:41:10] nullFxn: has joined #ruby
[22:41:26] ubuntu3134: has joined #ruby
[22:42:53] yfeldblum: has joined #ruby
[22:43:08] zel: has joined #ruby
[22:45:23] jhass: amincd: https://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20160519_004511.png took out the STDOUT.sync = true even
[22:45:28] jhass: so cannot reproduce
[22:45:33] leitz: Up to chapter 7 of an old copy of the Pickaxe book.
[22:46:14] jyaworski: has joined #ruby
[22:46:38] alxgsv: has joined #ruby
[22:46:56] mtkd: has joined #ruby
[22:48:58] ctrlrsf: has joined #ruby
[22:50:13] pawnbox: has joined #ruby
[22:50:23] Ballo: it's complaining in `block in process_error_checks': undefined local variable or method `t' for Urgent:Class (NameError)
[22:50:40] sepp2k: has joined #ruby
[22:50:46] ruby[bot]: We can't help you without your code, please post it to https://gist.github.com
[22:50:54] Ballo: [15:36] <Ballo> err_arr.map { |t| [t.to_hash,t.tminutes] if !t.test? }.compact.each do |tuple|
[22:51:00] Radar: what is err_arr
[22:51:07] Ballo: an array of objects
[22:51:13] Radar: bzzt try again
[22:51:28] Radar: what is err_arr
[22:51:40] Ballo: it's an array of objects
[22:51:46] Radar: bzzzzzzzzzzzttttt
[22:51:48] Radar: still wrong
[22:51:51] Radar: Third time lucky maybe?
[22:51:53] jenrzzz: has joined #ruby
[22:51:54] Radar: what is err_arr
[22:51:59] Ballo: it's an array of objects
[22:52:11] rkazak: has joined #ruby
[22:52:12] baweaver: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[22:52:13] Radar: Ballo: Ok, you're just being silly now.
[22:52:25] Radar: Ballo: Show us some code to reproduce the issue and we'd be happy to help.
[22:52:43] Ballo: it's an array of objects like [obj1, obj2, obj3]
[22:52:54] startupality: has joined #ruby
[22:52:57] qasaur: has joined #ruby
[22:52:57] baweaver: Ballo: that tells us nothing
[22:52:58] Ballo: I don't know why that's so difficult to grasp
[22:53:05] Radar: Ballo: Show us how obj1 is defined, please.
[22:53:07] baweaver: what do they look like?
[22:53:28] Ballo: they implement methods to_hash, tminutes, and test?
[22:53:29] baweaver: because your code as is should work
[22:53:34] Ballo: just like the code implies
[22:53:47] Ballo: the error complains about the name 't', not that the method doesn't exist
[22:53:48] Radar: baweaver is right. Your code should work. Please provide us a way that we can reproduce this error on our machines.
[22:53:52] baweaver: so giving us fake values does you very little good
[22:54:15] amincd: jhass: I just want to verify that the <!DOCTYPE html... text should not be there, right? It indicates that the second "puts.." call is being executed before the first one has finished its output operation..?
[22:55:35] nando293921: has joined #ruby
[22:55:44] jhass: amincd: no? how come you think so?
[22:56:13] nullFxn: has joined #ruby
[22:56:14] jhass: the </html> is the end of the first one
[22:56:30] jhass: then comes the second one with all the new lines and "new read"
[22:56:49] jhass: then after that's done the doctype comes which is the start of the third one
[22:57:08] mistermocha: has joined #ruby
[22:57:49] hightower3: has joined #ruby
[22:57:50] dsea: has joined #ruby
[22:57:59] wdi: has joined #ruby
[22:58:13] minimalism: has joined #ruby
[22:59:16] Ballo: ACTION found a better less-retardo way to write this
[22:59:18] amincd: jhass: ah I see what I was getting wrong.
[23:00:17] wdi14: has joined #ruby
[23:00:56] amincd: I was assuming I was doing a 'puts file.read', rather than a 'puts content'. So I was assuming the third 'puts ..' call was outputting nothing
[23:01:17] wdi14: Hi! I need help with a ruby application using sinatra. I just need to redirect a page, although, it is not working due the '#' symbol
[23:01:36] amincd: and I explained the presence of html code after the second 'puts ..' call as a result of the second puts call being executed before the first had completed
[23:01:51] wdi14: https://repl.it/CS0v
[23:02:13] wdi14: Here's the code https://repl.it/CS0v the problem is at line 16
[23:02:39] minimali1: has joined #ruby
[23:02:49] Radar: wdi14: which symbol?
[23:03:01] Radar: wdi14: Can you describe how it's not working?
[23:03:21] jhass: ^ what do you expect when doing what exactly and what do you get instead?
[23:04:31] mistermocha: has joined #ruby
[23:04:52] wdi14: Radar: the sharp symbol #. The code should redirect me to the website with that argument
[23:05:07] gtsai: has joined #ruby
[23:05:08] Radar: wdi14: that looks like string interpolation. Where is it redirecting you to instead?
[23:05:39] wdi14: Radar: It's a very simple thing
[23:05:54] Kallis: has joined #ruby
[23:06:24] ubuntu3134_: has joined #ruby
[23:06:36] wdi14: Radar: A redirection but because I have to pass using #{} the url address returns an error
[23:06:49] Radar: wdi14: and what is that error?
[23:07:38] JesseH: has joined #ruby
[23:08:59] cdg: has joined #ruby
[23:09:07] jhass: and what's the generated URL exactly?
[23:09:32] amincd: thank you very much jhass
[23:10:50] mistermocha: has joined #ruby
[23:14:07] Radar: wdi14: Are you still there?
[23:14:29] whathapp_: has joined #ruby
[23:15:57] whathappens: has joined #ruby
[23:16:29] gtsai: has joined #ruby
[23:19:13] aghalarp: has joined #ruby
[23:19:22] kappy: has joined #ruby
[23:20:37] idefine: has joined #ruby
[23:21:01] wdi14: Thanks Radar
[23:21:05] wdi14: Problem solved
[23:21:22] am55: has joined #ruby
[23:21:39] wdi14: It worked fine. Ruby returns the variable without the sharp sign and the url becomes valid and works
[23:21:41] wdi14: has left #ruby: ()
[23:22:28] arescorpio: has joined #ruby
[23:25:48] koooge: has joined #ruby
[23:26:37] hutch34: has joined #ruby
[23:28:05] Asher: has joined #ruby
[23:32:50] skweek: has joined #ruby
[23:34:03] banister: has joined #ruby
[23:36:04] aries_liuxueyang: has joined #ruby
[23:37:34] insanedreamer: has joined #ruby
[23:39:25] danostrowski: has joined #ruby
[23:39:48] mikecmpbll: has joined #ruby
[23:43:58] duoi: has joined #ruby
[23:43:58] blackgoat: has joined #ruby
[23:45:19] Trynemjoel: has joined #ruby
[23:45:27] curses: has joined #ruby
[23:48:35] qasaur: has joined #ruby
[23:50:13] idefine: has joined #ruby
[23:51:04] RegulationD: has joined #ruby
[23:53:14] jhack: has joined #ruby
[23:55:35] maxdoubt: has joined #ruby
[23:55:51] jackjackdripper: has joined #ruby
[23:56:02] postmodern: has joined #ruby