« Back to channel list

#ruby - 20 March 2016

« Back 1 day Forward 1 day »
[00:01:07] hotpancakes: has joined #ruby
[00:04:09] nando293921: has joined #ruby
[00:06:25] Xiti: has joined #ruby
[00:07:08] spintronic: has joined #ruby
[00:08:00] htmldrum: has joined #ruby
[00:08:16] bronson: has joined #ruby
[00:10:31] Trynemjoel: has joined #ruby
[00:10:32] jdawgaz: has joined #ruby
[00:12:18] mistermocha: has joined #ruby
[00:17:23] halfamind: has joined #ruby
[00:19:31] KnownSyntax: has joined #ruby
[00:19:34] KnownSyntax: has joined #ruby
[00:20:25] Xeago: has joined #ruby
[00:22:35] mallu: has joined #ruby
[00:30:23] halfamind: has joined #ruby
[00:30:53] halfamind1: has joined #ruby
[00:31:23] mallu: has joined #ruby
[00:34:00] tAn: has joined #ruby
[00:36:47] samuelka-: has joined #ruby
[00:38:12] LoneHerm_: has joined #ruby
[00:38:14] johnny56_: has joined #ruby
[00:41:56] kellenevan: has left #ruby: ("WeeChat 1.4")
[00:43:44] RegulationD: has joined #ruby
[00:44:25] mbff: has joined #ruby
[00:45:16] jpfuentes2: has joined #ruby
[00:46:46] stannard: has joined #ruby
[00:49:36] mallu: has joined #ruby
[00:50:45] mallu: has joined #ruby
[00:51:09] nettoweb: has joined #ruby
[00:53:20] mistermocha: has joined #ruby
[00:53:24] hotpancakes: has joined #ruby
[00:56:13] Jardayn: has joined #ruby
[01:02:10] gregf: has joined #ruby
[01:03:55] sp4rrow: has joined #ruby
[01:08:28] ninjaaron: has joined #ruby
[01:09:52] bronson: has joined #ruby
[01:09:53] mallu: has joined #ruby
[01:12:34] mallu: has joined #ruby
[01:16:43] stannard: has joined #ruby
[01:19:02] rbennacer: has joined #ruby
[01:20:18] Musashi007: has joined #ruby
[01:23:58] devbug: has joined #ruby
[01:25:24] Xeago: has joined #ruby
[01:25:51] mistermocha: has joined #ruby
[01:31:06] samuelkadolph: has joined #ruby
[01:31:17] skweek: has joined #ruby
[01:32:22] ensyde_: has joined #ruby
[01:32:36] samuelkadolph1: has joined #ruby
[01:32:45] bob434: has joined #ruby
[01:34:10] SCHAAP137: has joined #ruby
[01:36:52] tAn: has joined #ruby
[01:40:26] halfamind: has joined #ruby
[01:43:08] chagel: has joined #ruby
[01:44:15] bob434: has joined #ruby
[01:44:51] RegulationD: has joined #ruby
[01:48:19] Suntzu: has joined #ruby
[01:51:41] BtcBen: has joined #ruby
[01:52:59] fullofcaffeine: has joined #ruby
[01:56:12] Jardayn_two: has joined #ruby
[01:56:16] samuelkadolph: has joined #ruby
[01:58:09] ninjaaron: what's the ruby equivalent for this perl thing:`i ~= s/pattern/\U$&/g`?
[01:58:17] samuelkadolph1: has joined #ruby
[02:00:07] stannard_: has joined #ruby
[02:00:13] Gasher: has joined #ruby
[02:00:43] htmldrum: has joined #ruby
[02:01:30] al2o3-cr: thats sum sed shit
[02:02:08] monoprotic: ninjaaron im a ruby novice but there is gsub http://ruby-doc.org/core-2.1.4/String.html#method-i-gsub
[02:03:13] al2o3-cr: for single sub use 'sub' global sub use 'gsub'
[02:03:33] al2o3-cr: for translation use 'tr'
[02:04:26] stannard: has joined #ruby
[02:04:35] bronson: has joined #ruby
[02:04:40] tristanp: has joined #ruby
[02:05:44] samuelkadolph: has joined #ruby
[02:06:29] baweaver: has joined #ruby
[02:06:32] mistermocha: has joined #ruby
[02:08:45] samuelkadolph1: has joined #ruby
[02:09:01] ninjaaron: got it. `i = i.gsub(/pattern/){|m| m.upper}
[02:09:20] bricker: has joined #ruby
[02:09:22] ninjaaron: I like blocks.
[02:09:39] ninjaaron: I'm more of a python person, but I often lust after ruby blocks.
[02:10:18] systemsgotyou: rbenv vs rvm which one?
[02:10:23] rhg135: has joined #ruby
[02:11:01] al2o3-cr: systemsgotyou: neither chruby + ruby_install
[02:12:16] al2o3-cr: systemsgotyou: do you need mutiple rubies?
[02:12:43] al2o3-cr: then stick to you system ruby
[02:14:28] al2o3-cr: systemsgotyou: what version is your system variant?
[02:15:58] al2o3-cr: systemsgotyou: ruby -v?
[02:24:30] a11: has joined #ruby
[02:25:14] DmitryBochkarev: has joined #ruby
[02:25:57] `tim`: has joined #ruby
[02:27:19] al2o3-cr: isn't ruby brilliant
[02:27:47] SCHAAP137: has joined #ruby
[02:31:04] norc_: has joined #ruby
[02:32:08] claw: has joined #ruby
[02:33:38] avarsh: has joined #ruby
[02:34:34] arescorpio: has joined #ruby
[02:35:46] duncannz: has joined #ruby
[02:36:00] x77686d: has joined #ruby
[02:37:21] onechr: has joined #ruby
[02:37:24] tAn: has joined #ruby
[02:40:10] onechr: has joined #ruby
[02:45:07] LoneHermit: has joined #ruby
[02:46:44] chouhoulis: has joined #ruby
[02:46:56] mistermocha: has joined #ruby
[02:47:13] safe: has joined #ruby
[02:50:44] safe: has joined #ruby
[02:50:53] adgtl: has joined #ruby
[02:51:55] Tempesta: has joined #ruby
[02:52:26] jdawgaz: has joined #ruby
[02:57:01] Synthead: has joined #ruby
[02:57:23] htmldrum: has joined #ruby
[03:12:44] Spami: has joined #ruby
[03:13:18] Spami: has joined #ruby
[03:15:53] jaequery: has joined #ruby
[03:17:01] jaequery: hi guys, i'm working on a cms , anyone care to try it out?
[03:19:48] bronson: has joined #ruby
[03:22:58] baweaver: has joined #ruby
[03:23:52] Karix: has joined #ruby
[03:23:56] mistermocha: has joined #ruby
[03:24:38] jpfuentes2: has joined #ruby
[03:26:43] a11: has joined #ruby
[03:29:14] skweek: has joined #ruby
[03:31:08] oliver__: has joined #ruby
[03:36:23] Don_John: has joined #ruby
[03:38:54] LoneHerm_: has joined #ruby
[03:41:09] Lucky_ABA: has joined #ruby
[03:45:41] krz: has joined #ruby
[03:47:56] chouhoulis: has joined #ruby
[03:52:47] rickmasta: has joined #ruby
[03:55:58] chagel: has joined #ruby
[04:01:23] jaequery_: has joined #ruby
[04:08:07] mistermocha: has joined #ruby
[04:09:15] montyboy: has joined #ruby
[04:09:16] graffix: has joined #ruby
[04:09:18] nerium_: has joined #ruby
[04:12:05] htmldrum: has joined #ruby
[04:13:00] baweaver: has joined #ruby
[04:15:22] braincrash: has joined #ruby
[04:16:19] LoneHermit: has joined #ruby
[04:23:33] mostlybadfly: has joined #ruby
[04:24:02] pawnbox: has joined #ruby
[04:25:00] hotpancakes: has joined #ruby
[04:26:09] treaki__: has joined #ruby
[04:26:17] PedramT: has joined #ruby
[04:26:18] hk238: has joined #ruby
[04:29:33] jaequery: has joined #ruby
[04:30:25] jdawgaz: has joined #ruby
[04:33:12] uglybandersnatch: has joined #ruby
[04:35:07] lkba: has joined #ruby
[04:36:05] PedramT: has joined #ruby
[04:36:06] pawnbox: has joined #ruby
[04:39:27] tAn: has joined #ruby
[04:40:27] PedramT: has joined #ruby
[04:40:41] halfamind: has joined #ruby
[04:41:26] rmulligan: has joined #ruby
[04:44:37] theRoUS: has joined #ruby
[04:46:09] PedramT: has joined #ruby
[04:47:44] yfeldblum: has joined #ruby
[04:48:20] mistermocha: has joined #ruby
[04:48:27] hotpancakes: has joined #ruby
[04:48:38] chouhoulis: has joined #ruby
[04:49:24] olimpop: has joined #ruby
[04:52:47] gix: has joined #ruby
[05:02:15] LoneHerm_: has joined #ruby
[05:03:01] nertzy: has joined #ruby
[05:03:21] Dimik: has joined #ruby
[05:04:22] solocshaw: has joined #ruby
[05:09:09] Musashi007: has joined #ruby
[05:12:10] mallu: has joined #ruby
[05:18:26] tristanp: has joined #ruby
[05:23:04] johnny56: has joined #ruby
[05:29:21] awasum: has joined #ruby
[05:29:23] fedexo: has joined #ruby
[05:29:28] mistermocha: has joined #ruby
[05:30:29] pawnbox: has joined #ruby
[05:31:30] clorisu: hey, anyone know why i'm getting this error: http://pastie.org/10766829 ?
[05:32:02] fullofcaffeine: has joined #ruby
[05:36:28] KnownSyntax: has joined #ruby
[05:36:31] KnownSyntax: has joined #ruby
[05:38:51] Xeago: has joined #ruby
[05:44:29] jaequery: has joined #ruby
[05:44:58] sneep: clorisu: You need semicolons
[05:45:40] clorisu: i'm following this: https://www.railstutorial.org/book/rails_flavored_ruby#sec-objects_and_message_passing
[05:45:50] clorisu: is his code incorrect or different in some way? (box 3)
[05:46:07] sneep: E.g.: s = "foo"; if s.empty?; "The string is empty"; else; "The string is nonempty"; end
[05:46:28] clorisu: oh theyre separate lines
[05:48:48] dcunit3d: has joined #ruby
[05:49:18] chouhoulis: has joined #ruby
[05:52:33] Synthead: has joined #ruby
[05:54:47] bricker: has joined #ruby
[05:58:12] guideX: has joined #ruby
[06:04:04] hotpancakes: has joined #ruby
[06:05:50] Synthead: has joined #ruby
[06:06:16] fullofcaffeine: has joined #ruby
[06:06:56] johnny56: has joined #ruby
[06:10:12] rkazak: has joined #ruby
[06:11:08] LoneHermit: has joined #ruby
[06:12:24] sysodaff: has joined #ruby
[06:12:42] htmldrum: has joined #ruby
[06:14:05] SuperDave: has joined #ruby
[06:15:44] frustrum: has joined #ruby
[06:16:18] bezhermoso: has joined #ruby
[06:17:22] SuperDave: wow i am impressed with changes here
[06:18:05] SuperDave: sorry, wrong channel lol
[06:18:13] SuperDave: has left #ruby: ()
[06:18:45] kentnl: has joined #ruby
[06:19:28] SuperDave: has joined #ruby
[06:19:43] SuperDave: this is very professional
[06:19:59] SuperDave: the rules are clearly stated - thank you for that
[06:20:34] SuperDave: has left #ruby: ()
[06:20:41] bronson: has joined #ruby
[06:21:28] sysodaff: has joined #ruby
[06:24:54] fullofcaffeine: has joined #ruby
[06:27:21] bezhermo_: has joined #ruby
[06:28:22] Marsjan: has joined #ruby
[06:31:38] xuex: has joined #ruby
[06:32:29] CloCkWeRX: has joined #ruby
[06:36:21] xue: has joined #ruby
[06:39:42] rmulligan: has joined #ruby
[06:40:06] kent\n: has joined #ruby
[06:40:14] bob434: has joined #ruby
[06:41:36] bob434: has joined #ruby
[06:42:53] tAn: has joined #ruby
[06:45:04] hotpancakes: has joined #ruby
[06:46:15] houhoulis: has joined #ruby
[06:46:26] hotpancakes: has joined #ruby
[06:47:19] the_drow: has joined #ruby
[06:51:15] dionysus69: has joined #ruby
[06:51:46] chouhoulis: has joined #ruby
[06:52:20] polyidus: has joined #ruby
[07:03:16] Infra-Red: has joined #ruby
[07:03:27] intrigueD: has joined #ruby
[07:03:42] intrigueD: has joined #ruby
[07:06:14] jpfuentes2: has joined #ruby
[07:06:50] mistermocha: has joined #ruby
[07:08:42] xue: has joined #ruby
[07:14:13] mahk: has joined #ruby
[07:15:10] trosborn: has joined #ruby
[07:18:14] Infra-Red: has joined #ruby
[07:20:55] mondok: has joined #ruby
[07:21:06] Infra-Red: has joined #ruby
[07:21:49] tildes: has joined #ruby
[07:23:02] Infra-Red: has joined #ruby
[07:26:39] kentnl: has joined #ruby
[07:27:09] fexilal: has joined #ruby
[07:29:21] Musashi007: has joined #ruby
[07:30:49] oliver__: has joined #ruby
[07:31:11] skade: has joined #ruby
[07:31:56] hotpancakes: has joined #ruby
[07:37:16] thegunbuster: has joined #ruby
[07:37:56] rippa: has joined #ruby
[07:41:50] SamGerber: has joined #ruby
[07:43:24] sand_bird: has joined #ruby
[07:44:53] LoneHermit: has joined #ruby
[07:48:35] djbkd_: has joined #ruby
[07:49:23] RegulationD: has joined #ruby
[07:49:36] Infra-Red: has joined #ruby
[07:52:30] chouhoulis: has joined #ruby
[07:53:05] guideX: how do you get ruby working with iis
[07:55:53] p0p0pr37: has joined #ruby
[07:59:35] scepticulous: has joined #ruby
[08:01:02] sol: has joined #ruby
[08:04:41] PedramT: has joined #ruby
[08:06:25] tAn: has joined #ruby
[08:08:09] coffeecupp: has joined #ruby
[08:10:15] coffeecupp: has joined #ruby
[08:13:07] htmldrum: has joined #ruby
[08:16:21] frustrum: has joined #ruby
[08:22:35] yqt: has joined #ruby
[08:24:23] bronson: has joined #ruby
[08:28:09] n008f4g_: has joined #ruby
[08:28:30] tao_: has joined #ruby
[08:30:36] rmulligan: has joined #ruby
[08:34:18] onechr: has joined #ruby
[08:35:04] uglybandersnatch: has joined #ruby
[08:38:35] tristanp: has joined #ruby
[08:39:25] tubuliferous: has joined #ruby
[08:40:27] merida_: has joined #ruby
[08:40:27] merida: has joined #ruby
[08:40:33] Suntzu: has joined #ruby
[08:42:07] arup_r: has joined #ruby
[08:42:59] SamGerber: Anyone know why Enumerable's #count no longer tries to call #size?
[08:44:54] Hanmac: samgerber: why should it?
[08:45:45] bezhermoso: has joined #ruby
[08:46:58] arup_r: any idea how can I print content of heredoc by doing left align in stdout. I can do it by writing the heredoc manually like that, but the indentation will not look good. Any programmatic way? link: https://gist.github.com/aruprakshit/e49156e63976ecb007aa#file-a-rb-L28-L34
[08:47:31] clorisu: im so confused. whats the difference between an object and a method?
[08:47:47] th0m_: has joined #ruby
[08:48:24] SamGerber: arup_r https://infinum.co/the-capsized-eight/articles/multiline-strings-ruby-2-3-0-the-squiggly-heredoc
[08:48:27] forcer: clorisu: An object is a collection of methods (code) and data
[08:48:53] clorisu: could you give me an example forcer
[08:49:30] arup_r: samgerber: oh, I see ruby 2.3 made my day. Let me install it first :D
[08:49:34] forcer: clorisu: This seems to be an ok intro: http://www.tutorialspoint.com/ruby/ruby_classes.htm
[08:51:16] patrick_star: has joined #ruby
[08:51:44] SamGerber: hanmac: I think it used to...between 1.8.7 and 2.0.0. I guess it seems odd to me that Array#count would operate in constant time while Hash and Set #count are relegated to linear time. (all this assuming no argument or block is passed)
[08:52:06] lessless: has joined #ruby
[08:52:28] Hanmac: samgerber: if you want size then use it ... specially Enumerator also has a #size method
[08:52:37] clorisu: thanks forcer ill read it and get back to you
[08:53:19] chouhoulis: has joined #ruby
[08:56:27] firstdayonthejob: has joined #ruby
[08:56:31] SamGerber: hanmac: thank you. I think I understand. What I'm looking to learn is a case when it would be useful to have a count method that traverses the collection even when no block or argument is given.
[08:56:47] forcer: So I'm curious. Class#method seems a common way of referencing methods in a class, but that's not Ruby syntax. Where did that syntax come from? :-)
[08:58:01] Hanmac: forcer: because Class.method is ambiguous
[08:58:45] yardenbar: has joined #ruby
[08:59:33] forcer: hanmac: That would be a class method, right?
[09:00:07] Hanmac: forcer: hm yes and no, because if you do: "ri File.size" it will show you both instance and class method
[09:01:29] forcer: hanmac: Ah! Well, it would at least *also* refer to class methods. Do you know where the # syntax came from? Or is that just something that was used and stuck around?
[09:01:35] Ox0dea: forcer: But yes, `Foo.bar` is the orthography used for class methods. You'll see `Foo::bar` sometimes used as well, but that's better reserved for constants.
[09:02:06] Ox0dea: I'm reasonably certain Foo#bar is just a convention that managed to stick.
[09:02:17] Hanmac: Ox0dea: thats the prob Foo::bar is a method, Foo::Bar is a constant, but Foo::Bar() is a method too ;P
[09:02:39] forcer: hanmac, Ox0dea: Thank you!
[09:02:42] Ox0dea: Sure thing.
[09:02:49] Ox0dea: samgerber: Never.
[09:03:13] Ox0dea: But why special-case #count when #size is already available?
[09:04:00] Guest34101: has joined #ruby
[09:05:25] marr: has joined #ruby
[09:05:57] arup_r: has left #ruby: ()
[09:06:21] SamGerber: Ox0dea: Consistency, I suppose. Array#count defers to #length and #size when no argument is given. Why isn't there a Hash#count that does the same thing? This isn't an attack, or anything, just curiosity. It seems like the behavior was implemented at one point and then was removed, so I was wondering what issues it had caused.
[09:10:14] Guest9744: has left #ruby: ("WeeChat 0.4.2")
[09:10:59] forcer: They probably started to wonder if they need all of #count, #count_pair, #count_key and #count_value, and then thought meh, never mind.
[09:11:03] Ox0dea: samgerber: I grant that it's inconsistent, but specializing various Enumerable methods for all the classes that include Enumerable is a slippery slope.
[09:12:26] rmulligan: has joined #ruby
[09:13:32] hotpancakes: has joined #ruby
[09:14:47] Ox0dea: >> Enumerable.instance_methods.select { |m| Hash.instance_method(m).owner == Hash }
[09:14:49] ruby[bot]: Ox0dea: # => [:to_a, :to_h, :include?, :select, :reject, :any?, :member?] (https://eval.in/539448)
[09:15:25] Ox0dea: Adding #count to that list opens the door for pretty much all the others, and that kinda defeats the purpose of Enumerable.
[09:15:39] SamGerber: Ox0dea: That makes sense. It would kind of defeat the point of having a module, eh?
[09:16:08] Ox0dea: samgerber: Well, it would certainly be antithetical to the goal of mixins.
[09:16:48] SamGerber: Ox0dea: It was on that list for 1.8.7 until 2.0.0, though, right?
[09:17:17] Ox0dea: samgerber: https://eval.in/539449
[09:18:34] SamGerber: Ox0dea: Ah, thanks, sorry, I'm a bit new to all of this. These are methods that are defined in Enumerable and then over-ridden in Hash, right?
[09:18:42] Ox0dea: samgerber: That's right.
[09:18:45] PedramT: has joined #ruby
[09:19:09] chagel: has joined #ruby
[09:19:22] Ox0dea: 1.9.3 is when Array#count got specialized, but I don't see anything specific to Hash in the change logs.
[09:20:57] Ox0dea: And I imagine that only happened because so many people were using it incorrectly. :/
[09:23:25] baweaver: has joined #ruby
[09:24:44] SamGerber: Ox0dea: I think I've been sloppy in my research, sorry. I looked at the source here: http://ruby-doc.org/core-1.8.7/Enumerable.html#method-i-count
[09:25:27] SamGerber: and then saw that the documentation says this: "...where size is called if it responds to it..." and then when I was looking at future versions, I just looked at documentation without again checking the source
[09:25:40] SamGerber: so I think I'm all off on when I think changes happened
[09:28:21] SamGerber: It looks like 1.9.2 is where the attempt to call size was removed, but the documentation wasn't updated at that time?
[09:28:25] SamGerber: http://ruby-doc.org/core-1.9.2/Enumerable.html#method-i-count
[09:28:49] SamGerber: Is there a better place to try to learn the reason for a change occurring?
[09:29:32] dgncn: has joined #ruby
[09:29:53] Ox0dea: samgerber: https://bugs.ruby-lang.org/issues/6473
[09:31:19] Ox0dea: More specifically: https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/25603
[09:31:26] Ox0dea: I'm not sure I understand the justification.
[09:32:57] SamGerber: Ox0dea: Is the thought that some people might define #size on a custom class using Enumerable#count?
[09:33:09] LoneHermit: has joined #ruby
[09:33:24] Ox0dea: samgerber: Well, that'd certainly get ugly.
[09:33:51] Hanmac: might have something to do if a size is something different than a integer (like the 2d size of a window)
[09:34:08] Ox0dea: hanmac: Why would Window include Enumerable?
[09:34:12] clorisu: is .map basically the .each for strings?
[09:34:14] clorisu: or arrays?
[09:34:33] Hanmac: Ox0dea: to interate over the child window/widget elements?
[09:34:39] the_drow: has joined #ruby
[09:34:52] Ox0dea: clorisu: #each is for "doing something" with each element of a collection; #map is for transforming the collection into a new one.
[09:34:53] Hanmac: clorisu: no String doenst have #map anymore
[09:35:29] Ox0dea: hanmac: Yes, that's a fair assessment.
[09:35:30] clorisu: Ox0dea: by doing something do you mean applying a block?
[09:35:45] skade: has joined #ruby
[09:35:49] Ox0dea: clorisu: Yes, more or less.
[09:35:57] clorisu: Ox0dea: what do you mean by transforming the collection?
[09:36:03] clorisu: isn't 'doing something' transforming it?
[09:36:18] Hanmac: samgerber: the difference between #size and #count with sized Enumerators:
[09:36:18] Hanmac: >> [1].cycle.size
[09:36:19] ruby[bot]: hanmac: # => Infinity (https://eval.in/539451)
[09:36:23] Hanmac: >> [1].cycle.count
[09:36:26] ruby[bot]: hanmac: # => (https://eval.in/539452)
[09:36:42] djellemah_: has joined #ruby
[09:37:11] Ox0dea: >> e = [].to_enum; [e.size, e.count] # the difference for unsized ones
[09:37:12] ruby[bot]: Ox0dea: # => [nil, 0] (https://eval.in/539453)
[09:37:23] clorisu: also Ox0dea and hanmac : why the # before the method? does it signify something?
[09:37:33] DoubleMalt: has joined #ruby
[09:37:41] Ox0dea: clorisu: It's used to signify "instance method".
[09:38:32] Ox0dea: File.size and File#size are different methods and we need a way to distinguish between them.
[09:38:46] n008f4g_: has joined #ruby
[09:39:29] SamGerber: hanmac Ox0dea: thanks a bunch. You have both given me a lot to think about and a new resource for learning about the history of ruby! (bugs.ruby-lang.org). I really appreciate both of your time and everyone else putting up with my spam.
[09:40:18] Ox0dea: samgerber: Any time, especially if this is the standard quality of your "spam". :P
[09:40:39] bezhermoso: has joined #ruby
[09:40:46] merida_: has joined #ruby
[09:40:49] Hanmac: clorisu: for array:
[09:40:50] Hanmac: #each: might change the objects, keep the array intact
[09:40:50] Hanmac: #map: mostly does not change the objects, return a new array with or without new objects
[09:40:50] Hanmac: #map!: does replace the objects with new ones, does not change the array
[09:41:52] Ox0dea: clorisu: https://eval.in/539455
[09:47:18] the_drow: has joined #ruby
[09:54:03] chouhoulis: has joined #ruby
[09:56:58] skade: has joined #ruby
[10:04:18] clorisu: so they function the same, but each is basically explicit whereas map is implicit?
[10:04:29] clorisu: sort of like <% code %> vs <%= code %> ?
[10:04:43] clorisu: map/ %= has an output?
[10:04:46] clorisu: or prints?
[10:04:57] beawesomeinstead: has joined #ruby
[10:05:51] kam270: has joined #ruby
[10:06:56] rmulligan: has joined #ruby
[10:07:11] adgtl: has joined #ruby
[10:07:11] adgtl: has joined #ruby
[10:07:31] onechr: has joined #ruby
[10:13:22] nerium: has joined #ruby
[10:15:13] apeiros: clorisu: neither map nor each print or have output. they yield and have return values.
[10:15:21] apeiros: each always returns the receiver
[10:15:25] apeiros: map returns a new array
[10:15:41] apeiros: map! returns the receiver, but applies the return value of the block to the array in-place.
[10:17:38] onechr: has joined #ruby
[10:18:25] tildes: has joined #ruby
[10:18:38] frustrum: has joined #ruby
[10:18:52] arup_r: has joined #ruby
[10:19:26] arup_r: Why my `ensure` code not trigerring? https://gist.github.com/aruprakshit/e49156e63976ecb007aa ... head paining now.. :/
[10:20:18] edwinvdgraaf: has joined #ruby
[10:20:41] mhoungbo: has joined #ruby
[10:21:03] edwinvdgraaf: has joined #ruby
[10:21:46] edwinvdgraaf: has joined #ruby
[10:25:34] Hanmac: arup_r: you forgot the put in the ensure clause
[10:25:37] bronson: has joined #ruby
[10:25:47] arup_r: thanks hanmac
[10:27:45] zenlot: has joined #ruby
[10:27:48] Mon_Ouie: has joined #ruby
[10:30:44] devbug: has joined #ruby
[10:34:39] merida__: has joined #ruby
[10:34:40] merida___: has joined #ruby
[10:37:03] DmitryBochkarev: has joined #ruby
[10:38:10] spider-mario: has joined #ruby
[10:38:25] rmulligan: has joined #ruby
[10:41:38] yfeldblum: has joined #ruby
[10:42:05] adaedra: ACTION waves
[10:44:44] bakedb: has joined #ruby
[10:50:24] onechr: has joined #ruby
[10:51:42] RegulationD: has joined #ruby
[10:52:56] djellemah_: has joined #ruby
[10:57:57] gagrio_: has joined #ruby
[10:58:49] cd-rum: has joined #ruby
[11:00:58] dixie_rebel: has joined #ruby
[11:02:25] millerti: has joined #ruby
[11:04:08] hotpancakes: has joined #ruby
[11:08:43] onechr: has joined #ruby
[11:10:12] mistermocha: has joined #ruby
[11:12:18] Hanmac: has joined #ruby
[11:14:31] krz: has joined #ruby
[11:14:51] n008f4g_: has joined #ruby
[11:17:28] onechr: has joined #ruby
[11:17:42] anjen: has joined #ruby
[11:19:20] frustrum: has joined #ruby
[11:21:20] LoneHerm_: has joined #ruby
[11:23:36] Spami: has joined #ruby
[11:25:47] SCHAAP137: has joined #ruby
[11:27:07] baweaver: has joined #ruby
[11:27:10] sdothum: has joined #ruby
[11:28:41] quakephil: has joined #ruby
[11:28:56] bezhermoso: has joined #ruby
[11:29:23] nerium: has joined #ruby
[11:32:21] moeabdol: has joined #ruby
[11:33:01] rmulligan: has joined #ruby
[11:34:03] tildes: has joined #ruby
[11:34:58] reprazent: has joined #ruby
[11:37:23] reprazent: has joined #ruby
[11:39:50] reprazent: has joined #ruby
[11:41:05] krz: has joined #ruby
[11:41:33] bricker: has joined #ruby
[11:42:16] last_staff: has joined #ruby
[11:42:17] adaedra: has joined #ruby
[11:43:31] CloCkWeRX: has joined #ruby
[11:43:34] Ropeney: has joined #ruby
[11:44:34] tubuliferous: has joined #ruby
[11:45:28] reprazent: has joined #ruby
[11:48:52] polyidus: has joined #ruby
[11:51:21] chagel: has joined #ruby
[11:54:57] dionysus69: has joined #ruby
[11:55:37] chouhoulis: has joined #ruby
[11:55:43] roshanavand: has joined #ruby
[12:00:16] jdawgaz: has joined #ruby
[12:15:36] skade: has joined #ruby
[12:16:57] matp_: has joined #ruby
[12:17:07] CloCkWeRX: has joined #ruby
[12:22:15] intrigueD: has joined #ruby
[12:22:15] intrigueD: has joined #ruby
[12:22:59] rbennacer: has joined #ruby
[12:23:26] bezhermoso: has joined #ruby
[12:27:07] rmulligan: has joined #ruby
[12:27:33] bronson: has joined #ruby
[12:28:21] adaedra: has joined #ruby
[12:33:24] slackbotgz: has joined #ruby
[12:37:01] ltd: has joined #ruby
[12:37:21] Silox|: has joined #ruby
[12:37:38] tvw: has joined #ruby
[12:38:56] BrunoSaboia: has joined #ruby
[12:40:49] skade: has joined #ruby
[12:41:31] millerti: has joined #ruby
[12:41:52] marsjaninzmarsa: has joined #ruby
[12:42:07] tristanp: has joined #ruby
[12:43:58] bricker: has joined #ruby
[12:44:32] TomyLobo: has joined #ruby
[12:47:01] millerti: has joined #ruby
[12:52:37] nennes: has joined #ruby
[12:56:15] chouhoulis: has joined #ruby
[12:58:36] stannard: has joined #ruby
[13:00:52] nerium: has joined #ruby
[13:01:36] stannard_: has joined #ruby
[13:02:37] Suntzu: has joined #ruby
[13:03:56] hotpancakes: has joined #ruby
[13:04:25] lkba: has joined #ruby
[13:06:21] thegunbuster: has joined #ruby
[13:07:26] evidex: has joined #ruby
[13:07:43] jdawgaz: has joined #ruby
[13:09:07] tkiel: has joined #ruby
[13:13:00] mistermocha: has joined #ruby
[13:13:28] nerium: has joined #ruby
[13:20:08] frustrum: has joined #ruby
[13:21:10] rmulligan: has joined #ruby
[13:28:30] baweaver: has joined #ruby
[13:32:35] codecop_: has joined #ruby
[13:35:36] Gasher: has joined #ruby
[13:36:26] charlemagne: has joined #ruby
[13:36:55] tonyynot: has joined #ruby
[13:39:48] hotpancakes: has joined #ruby
[13:40:01] binaryplease: has joined #ruby
[13:40:53] xue: has joined #ruby
[13:41:39] charlema_: has joined #ruby
[13:48:14] RedNifre: has joined #ruby
[13:49:26] RedNifre: Heya. I'm not quite clear on the "falsiness" of nil. I wanted to check two variables for not nil so I did if(a && b)... that works, but I get a "string used in condition" warning. Is there a better way to do this?
[13:50:18] RedNifre: ...or should I write the conventional if((a != nil) && (b != nil)) ?
[13:50:52] pestilence: has joined #ruby
[13:51:14] warprobot: has joined #ruby
[13:51:25] warprobot: has left #ruby: ()
[13:51:35] Tempesta: has joined #ruby
[13:53:21] pestilence: I would like to put a ruby script into the bin directory of a gem so that you can run it from the command line post-gem install
[13:53:30] pestilence: is it possible to do this in a cross-platform manner?
[13:53:40] pestilence: i.e. I would like it to work on both windows and linux
[13:54:44] bricker: has joined #ruby
[13:56:59] chouhoulis: has joined #ruby
[13:57:08] yeticry: has joined #ruby
[13:57:54] the_drow: has joined #ruby
[14:01:16] mtkd: has joined #ruby
[14:02:25] Papierkorb: RedNifre: What's the exact code you're trying? That warning only appears for me (as expected) when I use string literals in the condition, not with string variables
[14:02:49] skade: has joined #ruby
[14:02:51] warprobot: has joined #ruby
[14:02:52] Papierkorb: RedNifre: (a && b) is fine, if you really want to test for nil use #nil?
[14:05:23] warprobot: has joined #ruby
[14:05:39] warprobot: has left #ruby: ()
[14:05:44] idle_task: has joined #ruby
[14:08:29] RedNifre: Papierkorb the actual code uses first,second = ARGV, I got the warning when I tested if(nil && "bla") in the REPL.
[14:08:55] Papierkorb: RedNifre: then your test is the issue, the code works fine
[14:09:44] apeiros: ruby knows that && "blah" is pointless and tells you so
[14:10:54] freerobby: has joined #ruby
[14:11:46] snowy: has joined #ruby
[14:11:47] RedNifre: Makes sense, thanks.
[14:12:01] evidex: has joined #ruby
[14:12:07] djellemah: >> a = "string"; b = "condition"; if a && b then :yes else :no end # RedNifre, although then is just for the single-line
[14:12:09] ruby[bot]: djellemah: # => :yes (https://eval.in/539468)
[14:13:00] hotpancakes: has joined #ruby
[14:13:39] mistermocha: has joined #ruby
[14:15:03] JJM: has joined #ruby
[14:15:23] rmulligan: has joined #ruby
[14:18:10] edwinvdg_: has joined #ruby
[14:20:51] intrigueD: has joined #ruby
[14:21:06] houhoulis: has joined #ruby
[14:24:50] blandflakes: has joined #ruby
[14:25:02] dcunit3d: has joined #ruby
[14:28:09] pestilence: has joined #ruby
[14:28:09] pestilence: has joined #ruby
[14:30:41] biberu: has joined #ruby
[14:33:09] djellemah: Is there a way to get the same value as ::Kernel.raise(*args) rescue $! but without the rescue? TIA
[14:33:56] apeiros: djellemah: what are you trying to achieve by that?
[14:34:09] ruby[bot]: 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
[14:36:41] vdamewood: has joined #ruby
[14:36:44] pestilence: these instructions: http://guides.rubygems.org/make-your-own-gem/#adding-an-executable are specific for linux. do you just have to create two scripts, one for windows and one for linux?
[14:37:02] Xeago: has joined #ruby
[14:37:08] BrunoSaboia: has joined #ruby
[14:37:12] the_drow: has joined #ruby
[14:37:24] pestilence: is there a way to change what happens during gem installation based on the platform? maybe have it install one bin if you're on windows and one bin if you're on linux?
[14:38:00] apeiros: pestilence: not using windows, so I can't verify. but as far as I understood it - if ruby is properly installed on windows, then executables from gems will just work (assuming they scripts themselves don't have platform dependent stuff in it)
[14:40:45] djellemah: apeiros: I'll take that as "I don't know of a way" :-p
[14:41:03] apeiros: djellemah: that'd be stupid. but you're free to not answer follow up questions.
[14:42:43] tristanp: has joined #ruby
[14:43:31] djellemah: Why would it be stupid?
[14:44:08] apeiros: djellemah: I'm not interested in a meta discussion. want a solution? answer the question. otherwise: good luck.
[14:45:23] _djbkd: has joined #ruby
[14:45:27] rkazak: has joined #ruby
[14:45:28] freerobby1: has joined #ruby
[14:46:28] djellemah: Think about it for a while, you might find that all the information a potential answerer needs is already in the question. Thanks anyway ;-)
[14:46:40] Karix: has joined #ruby
[14:46:59] apeiros: ok, seems you're more interested in pissing off potential helpers than actually getting help.
[14:47:03] apeiros: welcome in my /ignore
[14:50:08] jaruga: has joined #ruby
[14:53:44] pestilence: look like this is a possible solution to my problem: http://code.activestate.com/lists/ruby-talk/35687/
[14:54:24] pestilence: branch on RUBY_PLATFORM
[14:54:27] RegulationD: has joined #ruby
[14:56:56] bricker: has joined #ruby
[14:56:58] tpo: has left #ruby: ()
[14:57:44] chouhoulis: has joined #ruby
[14:59:18] LoneHerm_: has joined #ruby
[15:01:19] marcofernandez: has joined #ruby
[15:02:02] merida: has joined #ruby
[15:02:07] merida_: has joined #ruby
[15:04:06] yqt: has joined #ruby
[15:05:18] hotpancakes: has joined #ruby
[15:05:38] snowy: has joined #ruby
[15:07:17] bluOxigen: has joined #ruby
[15:09:31] rmulligan: has joined #ruby
[15:12:30] tubuliferous: has joined #ruby
[15:13:25] x77686d: has joined #ruby
[15:14:29] mistermocha: has joined #ruby
[15:14:52] David27: has joined #ruby
[15:18:30] evidex: has joined #ruby
[15:20:51] frustrum: has joined #ruby
[15:22:18] jdawgaz: has joined #ruby
[15:24:11] hotpancakes: has joined #ruby
[15:29:18] baweaver: has joined #ruby
[15:29:46] xue: has joined #ruby
[15:33:44] awasum: has joined #ruby
[15:36:08] stannard: has joined #ruby
[15:37:39] Karix: has joined #ruby
[15:41:45] zapata: has joined #ruby
[15:45:31] dstrunk: has joined #ruby
[15:47:02] merida: has joined #ruby
[15:47:03] merida_: has joined #ruby
[15:47:20] hotpancakes: has joined #ruby
[15:47:40] baweaver: has joined #ruby
[15:48:21] millerti: has joined #ruby
[15:50:32] Jackneill: has joined #ruby
[15:50:35] TheCubeLord: if your channel has ItsLuke or zz on your channel please ban him, he has been ban evading
[15:51:12] dstrunk: has joined #ruby
[15:52:08] dstrunk: has joined #ruby
[15:55:35] RegulationD: has joined #ruby
[15:58:09] rmulligan: has joined #ruby
[15:58:43] chouhoulis: has joined #ruby
[16:01:22] shevy: yo havenwood
[16:01:43] Papierkorb: Hm is it possible to figure out what refinements are active for a class?
[16:03:10] shevy: good question
[16:03:12] apeiros: Papierkorb: since they're lexically scoped: just read the code?
[16:03:53] Papierkorb: apeiros: I'd like to auto inject them into templates
[16:04:15] apeiros: the templates are evaled?
[16:04:30] Papierkorb: Basically they are.
[16:04:38] havenwood: Papierkorb: Triple refine for higher purity.
[16:04:48] Papierkorb: Though I'm wondering why 'using' alone doesn't work in HAML
[16:05:05] Papierkorb: complains that there's no method named "using"
[16:05:39] apeiros: probably because they're evaled in the scope of an instance method
[16:07:56] silentpost: has joined #ruby
[16:08:49] tildes: has joined #ruby
[16:09:19] the_drow: has joined #ruby
[16:11:00] p0p0pr37: has joined #ruby
[16:14:05] kfpratt: has joined #ruby
[16:19:14] workmad3: has joined #ruby
[16:23:26] symm-: has joined #ruby
[16:23:30] jaequery: has joined #ruby
[16:24:10] havenwood: Pure Ruby SHA3 Now FIPS PUB 202 compliant: https://github.com/havenwood/sha3-pure-ruby
[16:24:19] havenwood: (Not that anyone uses it.) :)
[16:24:51] havenwood: One of the C-ext SHA3s is too it seems: https://github.com/johanns/sha3#readme
[16:25:45] havenwood: And the other needs a maintainer to fix it from the original C spec to take into account PUB 202 padding: https://github.com/phusion/digest-sha3-ruby/issues/5
[16:25:54] d0nn1e: has joined #ruby
[16:26:44] havenwood: I could probably port over the changes from the NPM version despite how bad I am at C. :O
[16:26:50] havenwood: Somebody else do it! ;)
[16:27:17] havenwood: It's a nice gem.
[16:28:29] havenwood: I kinda expected that one to make it into the Ruby stdlib but instead it's unmaintained.
[16:29:12] fedexo: has joined #ruby
[16:29:44] djellemah_: havenwood: digressing slightly: do you know of a fast stable digest for non-cryptographic purposes? The closest I could find was xxhash, but I need something that also works with jruby.
[16:31:06] havenwood: djellemah_: You could jump on the "Pure Ruby" bandwagon :D https://github.com/justinwsmith/ruby-xxhash#readme
[16:31:30] havenwood: djellemah_: Looking for a native Java ext one?
[16:33:08] frustrum: has joined #ruby
[16:37:23] evidex_: has joined #ruby
[16:38:45] uglybandersnatch: has joined #ruby
[16:44:58] Vingador: has joined #ruby
[16:47:22] LoneHermit: has joined #ruby
[16:48:49] hightower3: has joined #ruby
[16:49:15] vikaton: has joined #ruby
[16:50:42] TheCubeLord: has joined #ruby
[16:50:57] _whitelogger: has joined #ruby
[16:52:17] rmulligan: has joined #ruby
[16:54:38] baweaver: has joined #ruby
[16:56:29] djellemah_: havenwood: The pure ruby one would probably be fine. Thanks :-D
[16:57:29] mikecmpbll: has joined #ruby
[16:59:02] tristanp: has joined #ruby
[16:59:06] onechr: has joined #ruby
[16:59:23] chouhoulis: has joined #ruby
[17:00:22] bronson: has joined #ruby
[17:00:38] nettoweb: has joined #ruby
[17:00:40] lxsameer: has joined #ruby
[17:00:49] sameerynho: has joined #ruby
[17:03:21] TheCubeLord: has joined #ruby
[17:04:23] TheCubeLord_: has joined #ruby
[17:04:27] TheCubeLord11: has joined #ruby
[17:04:29] Aviio: has joined #ruby
[17:05:06] Xeago: has joined #ruby
[17:06:23] TheCubeLord11: has joined #ruby
[17:08:53] intrigueD: has joined #ruby
[17:15:48] jaequery: has joined #ruby
[17:15:51] dikaio: has joined #ruby
[17:19:42] djbkd_: has joined #ruby
[17:21:44] sphex: has joined #ruby
[17:24:15] skade: has joined #ruby
[17:24:28] _stu_: has joined #ruby
[17:26:14] nando293921: has joined #ruby
[17:27:16] danielwzd: has joined #ruby
[17:28:13] TomyLobo: has joined #ruby
[17:29:22] tinnvec: has joined #ruby
[17:29:37] chouhoulis: has joined #ruby
[17:29:48] Ishido: has joined #ruby
[17:31:01] Morrolan: has joined #ruby
[17:32:13] Azure: has joined #ruby
[17:32:18] chouhoul_: has joined #ruby
[17:33:05] unreal: has joined #ruby
[17:33:20] moeabdol: has joined #ruby
[17:38:39] gbgdev: has joined #ruby
[17:40:14] solocshaw: has joined #ruby
[17:42:00] chouhoulis: has joined #ruby
[17:42:00] LoneHerm_: has joined #ruby
[17:42:43] skweek: has joined #ruby
[17:42:58] jaequery: has joined #ruby
[17:43:38] uglybandersnatch: has joined #ruby
[17:46:23] rmulligan: has joined #ruby
[17:49:29] BtcBen: has joined #ruby
[17:51:35] nofxx: has joined #ruby
[17:56:02] scepticulous: has joined #ruby
[17:57:04] RegulationD: has joined #ruby
[17:58:05] morfin: hello, can anybody explain one thing - if i have private method foo then do :foo.to_proc.call(self) who calls that method?
[17:58:24] morfin: it says that i call private method foo(raise exception?)
[17:59:19] jpfuentes2: has joined #ruby
[17:59:48] Guest34101: has joined #ruby
[18:00:48] surial: has joined #ruby
[18:00:59] surial: I have a question related to ruby and a gem itself, not the language. Is this the right place?
[18:01:45] surial: (Specifically, mac os x and ruby from homebrew, gem install gtk2, and a factor 10,000% slowness).
[18:03:15] apeiros: morfin: the proc created by Symbol#to_proc does
[18:03:32] apeiros: surial: yeah, just ask
[18:04:13] surial: Okay. I ran 'gem install gtk2' which seems like it works but it does not. I then ran sudo gem install gtk2 and this works, but then when I start a gtk2-using app, ruby slows down.. a lot. As in, CTRL+C takes 3 minutes (!!) to process just to shut down ruby.
[18:04:32] surial: (as does sending a normal sigkill).
[18:04:42] apeiros: "but it does not" - how do you figure?
[18:04:46] surial: sigterm works fine, and the CPU is not going haywire.
[18:04:54] surial: apeiros: gtk2 bindings fail to load.
[18:05:14] shevy: surial I have no delay using ctrl-c when I use ruby-gtk programs
[18:05:35] surial: Right. So, something is messed up with the installation. All I did was brew install ruby / gem install gtk2 / run a ruby gtk app.
[18:05:37] shevy: I use linux though
[18:05:39] surial: I also get a warning from gtk about missing locales.
[18:05:44] surial: Yeah, on linux this would have been easier.
[18:07:55] surial: I have a little ruby experience, but not with GTK2, and this isn't my app. Possibly I'm in the wrong channel.
[18:08:10] griffindy: has joined #ruby
[18:09:58] dmr8: has joined #ruby
[18:10:25] shevy: it sorta sounds as if you have a bug
[18:11:58] yqt: has joined #ruby
[18:12:03] fullofcaffeine: has joined #ruby
[18:12:35] LoneHerm_: has joined #ruby
[18:12:39] shevy: here is a hello world example in ruby-gtk https://gist.github.com/shevegen/9be59482aa9ee7dec196
[18:12:52] shevy: you may have to try to find someone who uses osx too, to try that example
[18:12:58] TheCubeLord: has joined #ruby
[18:13:44] shevy: I myself tend to install the gtk/gnome bindings differently. I use https://sourceforge.net/projects/ruby-gnome2/files/ruby-gnome2/ latest variant always, extract it, then batch-install the components of the subdirectories in that extracted directory
[18:14:02] surial: Still pretty slow.
[18:14:09] surial: As in, CTRL+C takes about 10 seconds to process.
[18:14:18] surial: also, I gem unisntalled.. and it still works. so, how the heck is that possible.
[18:14:18] elifoster: has joined #ruby
[18:14:34] surial: oh, nevermind. It kinda worked but then failed when trying to write docs.
[18:14:46] scepticulous: has joined #ruby
[18:15:02] surial: Yeah, it's happening. This is idiotically slow. As in, 20seconds + complete frozen.
[18:15:22] jaequery: has joined #ruby
[18:16:07] shevy: sounds as if something blocks the main glib loop
[18:16:19] surial: Yes, and it's not the ruby code. Hmm..
[18:16:57] surial: I'm gonna try a reboot just in case.
[18:17:35] Vingador: has joined #ruby
[18:19:11] shevy: we may have to find another heroic osx user :)
[18:20:53] intrigueD: has joined #ruby
[18:21:12] tildes: has joined #ruby
[18:22:54] jgt: has joined #ruby
[18:23:24] arup_r: has joined #ruby
[18:24:21] codecop: has joined #ruby
[18:24:49] arup_r: Hi.. I am writing a code. Where I can't sort the random numbers array before hand. I have to output in sorted order through. I did, https://gist.github.com/aruprakshit/7a4a13be1a6f84df4b99#file-histogram-rb-L9. But making a Hash, then sorting it, and then converting back to Hash looks overkill. What is the better way?
[18:24:49] surial: reboot did not help.
[18:26:59] nofxx: has joined #ruby
[18:28:26] benzrf_irssi: has joined #ruby
[18:28:36] edwinvdgraaf: has joined #ruby
[18:28:40] benzrf_irssi: is chruby still preferred for multi-impl ruby stuff?
[18:29:21] frustrum: has joined #ruby
[18:29:36] apeiros: arup_r: in your example, the to_h is unnecessary
[18:29:44] apeiros: benzrf_irssi: chruby is still considered to be a good choice
[18:29:55] shevy: benzrf_irssi !!! you are BACK!!!!!!!
[18:29:59] edwinvdgraaf: has joined #ruby
[18:30:05] Xeago: has joined #ruby
[18:30:53] benzrf_irssi: i have mixed feelings about ruby these days :}
[18:31:02] shevy: you were gone like 10 years!
[18:31:04] benzrf_irssi: but i'm looking into gsoc with celluloid
[18:31:45] benzrf_irssi: shevy: more like 2-3 :]
[18:32:20] shevy: I wasn't so quite off :D
[18:33:12] IanMalcolm: has joined #ruby
[18:33:13] shevy: you settled for haskell?
[18:33:14] arup_r: apeiros: sort_by breaks Hash to Array..
[18:33:20] arup_r: what you meant
[18:33:40] benzrf_irssi: looks i stopped idling in #ruby on 2014-12-19
[18:33:44] apeiros: yes, if you actually want a hash back after sort, you need to_h.
[18:33:49] benzrf_irssi: so about a year and a half ago
[18:33:59] bronson: has joined #ruby
[18:34:00] benzrf_irssi: shevy: actually i hadn't been programming so much up until fairly recently
[18:34:02] dionysus69: has joined #ruby
[18:34:04] benzrf_irssi: doing more math
[18:34:14] IanMalcolm: has joined #ruby
[18:34:22] surial: Downgraded to GTK2 2.2.5. Same problem, but now killing it eventually leads to this: [BUG] pthread_mutex_unlock: Invalid argument (EINVAL)
[18:34:26] arup_r: nah, hash I needed to count frequency, so I no need any more it. thanks apeiros
[18:34:27] benzrf_irssi: since a month or two ago ive been getting back into doing more programming but mostly in python and a little bit of javascript
[18:34:33] surial: and it then tries to tell me where to find the crash log. The thing that tries to tell me where the crash log is.. crashed.
[18:34:40] benzrf_irssi: (haskell is still best though)
[18:34:42] surial: Boy, I don't know who maintains these, but clearly this is more of a hobby than a job for em huh.
[18:34:43] IanMalcolm: has joined #ruby
[18:34:56] benzrf: has joined #ruby
[18:35:36] IanMalcolm: has joined #ruby
[18:36:32] ruurd: has joined #ruby
[18:37:06] shevy: surial I think they all use linux ;)
[18:37:40] benzrf_irssi: shevy: what do you use, windows?
[18:37:55] infernix: has joined #ruby
[18:39:24] Xeago: has joined #ruby
[18:40:03] benzrf_irssi: does anybody know,
[18:40:05] gbgdev_: has joined #ruby
[18:40:17] benzrf_irssi: if i install rubies using my package manager (on Arch), will that work with chruby
[18:40:18] jaequery: has joined #ruby
[18:40:20] benzrf_irssi: or should i get ruby-install
[18:40:31] rmulligan: has joined #ruby
[18:41:35] pelegreno: has joined #ruby
[18:42:16] Xeago_: has joined #ruby
[18:42:18] Zipdot: has joined #ruby
[18:42:33] darkf: has joined #ruby
[18:42:40] havenwood: benzrf_irssi: https://gist.github.com/jhass/8839655bb038e829fba1
[18:42:43] Zipdot: Ahh, great! big channel. first time here! <--
[18:42:48] benzrf_irssi: hello Zipdot!
[18:43:56] benzrf_irssi: havenwood: neat, ty
[18:44:01] Dimik: has joined #ruby
[18:44:03] nando293921: has joined #ruby
[18:44:06] morfin: apeiros, that means "external" object calls that method
[18:44:33] havenwood: Zipdot: welcome
[18:46:24] _blizzy_: has joined #ruby
[18:47:47] hotpancakes: has joined #ruby
[18:48:44] Xeago: has joined #ruby
[18:49:33] xlegoman: has joined #ruby
[18:49:53] surial: benzrf: mac os x.
[18:50:43] benzrf_irssi: shouldve guessed from the channel :P
[18:50:56] BDA: has joined #ruby
[18:51:41] arup_r: I am trying to understand the difference between rand(10) and rand(srand(10)) I see srand version gives always same numbers,, how it rand works with srand to produce same output multiple times? https://gist.github.com/aruprakshit/7a4a13be1a6f84df4b99
[18:51:43] hotpanca_: has joined #ruby
[18:52:55] apeiros: somebody calling rand(srand(10)) seems to be somebody who doesn't know what they're doing.
[18:53:13] shevy: looks like php code!
[18:53:22] apeiros: you only call srand when you want to ensure a repeatable series of numbers from rand()
[18:53:30] nerium: has joined #ruby
[18:53:41] apeiros: and its return value is the old seed, which makes it rather unsuitable as input for rand()
[18:53:49] circ-user-woeWP: has joined #ruby
[18:54:49] arup_r: ok.. so.. if I use srand with rand, it will give me the same number all the time.. the number can be any number.. I am confused because in each turn it gives 9,9.. and then when I changed the seed always 8..
[18:55:46] baweaver: has joined #ruby
[18:55:54] arup_r: apeiros: what do you mean by old seed?
[18:56:20] apeiros: arup_r: I suggest you read the docs of srand and rand. all I'd do is repeat them.
[18:56:24] arup_r: and I have no connection with this https://gist.github.com/aruprakshit/7a4a13be1a6f84df4b99#file-rand-rb-L7 and my understanding.. How such a huge number came
[18:56:41] arup_r: I am on http://ruby-doc.org/core-2.0.0/Random.html#method-c-srand and http://ruby-doc.org/core-2.2.0/Kernel.html#method-i-rand
[18:56:55] arup_r: read 3 times.. have little confusion, so thought to ask here
[18:57:30] blandflakes: has joined #ruby
[18:58:15] havenwood: >> Random.new_seed
[18:58:25] Suntzu: has joined #ruby
[18:59:00] tinnvec: has joined #ruby
[19:00:15] tinnvec: has joined #ruby
[19:00:32] havenwood: arup_r: ^ meditate on the meaning of the first line of the docs: srand(number = Random.new_seed) → old_seed
[19:00:58] havenwood: arup_r: In your REPL, try `Random.new_seed` a few times.
[19:01:44] tinnvec: has joined #ruby
[19:02:21] havenwood: arup_r: Then check `Random::DEFAULT.seed` a few times, restart your REPL and try that again.
[19:03:38] havenwood: arup_r: Then try `Random::DEFAULT.seed` a few times followed by `srand` then another few `Random::DEFAULT.seed`s.
[19:03:41] benzrf_irssi: nope, doesnt work
[19:04:06] arup_r: yes doing here exactly what you said
[19:05:33] xlegoman: has joined #ruby
[19:06:02] millerti: has joined #ruby
[19:06:33] havenwood: arup_r: Next `srand 42`, check `Random::DEFAULT.seed` and try `rand 100` and `rand 1000`. Restart your REPL and do it again.
[19:08:23] Disavowed: has joined #ruby
[19:08:51] Mon_Ouie: has joined #ruby
[19:09:14] arup_r: havenwood: that's the excercise I was needed.. Thanks havenwood thanks. Got it now, what docs meant by old seed.
[19:11:04] elifoster: has joined #ruby
[19:11:30] arup_r: havenwood: you know what.. you made my day :D
[19:11:59] Aviio: has joined #ruby
[19:16:38] havenwood: arup_r: Glad to help. Happy coding!
[19:17:19] arup_r: thanks once again havenwood
[19:17:38] arup_r: you got the pain of mine.. and gave exact hints I needed
[19:17:47] tinnvec: has joined #ruby
[19:17:51] mistermocha: has joined #ruby
[19:18:18] Don_John: has joined #ruby
[19:19:31] fedexo: has joined #ruby
[19:19:33] morfin: >> srand 42; rand 100
[19:19:59] tinnvec: has joined #ruby
[19:20:05] xpt: ruby[bot]: alive?
[19:20:16] morfin: i am registered
[19:20:30] morfin: and identified
[19:20:49] apeiros: it has a bug with its user bookkeeping
[19:21:12] ruby[bot]: has left #ruby: ("leaving")
[19:21:12] ruby[bot]: has joined #ruby
[19:21:12] ChanServ: +o ruby[bot]
[19:22:06] morfin: i thought you fixed that : )
[19:22:19] apeiros: no, didn't get around to it yet. and won't anytime soon.
[19:22:20] floatingpoint: has joined #ruby
[19:22:53] apeiros: I guess I restart is in order. part/rejoin doesn't seem to do it.
[19:23:49] ruby[bot]: morfin: # => nil (https://eval.in/539494)
[19:23:57] sphex: has joined #ruby
[19:24:42] tinnvec: has joined #ruby
[19:24:46] morfin: btw there should be MT for Ruby i guess
[19:24:58] morfin: almost any language have own MT implementation :)
[19:26:32] tinnvec: has joined #ruby
[19:27:05] Spami: has joined #ruby
[19:27:07] morfin: Mersenne Twister
[19:27:21] n008f4g_: has joined #ruby
[19:27:34] morfin: fast but not safe for crypting pseudorandom number generator
[19:27:34] apeiros: good thing ruby has one too then
[19:27:50] apeiros: and good thing ruby has a crypto prng too
[19:28:14] chouhoul_: has joined #ruby
[19:28:24] morfin: is that using urandom?
[19:28:32] morfin: ah yes i knew
[19:28:43] morfin: OpenSSL/urandom/Win32
[19:30:28] ruby[bot]: has joined #ruby
[19:30:28] ChanServ: +o ruby[bot]
[19:32:43] dikaio_: has joined #ruby
[19:37:01] rrrepsaj: has joined #ruby
[19:40:36] Mattx: has joined #ruby
[19:40:55] cejodrake_: has joined #ruby
[19:41:22] Mattx: Hey guys. What's the correct syntax to do something like this? { callbacks: { success: {|msg| ... }, error: {|msg| ...} }}
[19:41:28] cejodrake_: has left #ruby: ()
[19:41:33] Mattx: I want to pass a hash as a param, with some callbacks inside
[19:43:35] xlegoman: has joined #ruby
[19:43:43] [dmp]: has joined #ruby
[19:44:33] arup_r: has left #ruby: ()
[19:45:43] dcunit3d: has joined #ruby
[19:46:14] rubyx9: has joined #ruby
[19:46:28] rubyx9: can someone help me with my syntax - speed > 60 || speed < 40 ? return true : return false
[19:46:46] rubyx9: I am attempting to use the Ternary Operator
[19:47:04] adaedra: it's not really needed here
[19:47:10] mdw: has joined #ruby
[19:47:15] adaedra: return speed > 60 || speed < 40 # should suffice
[19:49:08] cd-rum: has joined #ruby
[19:49:09] Mattx: return speed.between? 40, 60
[19:49:14] rubyx9: adaedra: you are absolutely correct but I am doing a ruby course, and per the course instructions, i have to use a Ternary Operator
[19:49:29] rubyx9: I put my working code here - http://pastebin.ca/3406929
[19:49:30] Mattx: err, return !speed.between?(40, 60)
[19:49:34] apeiros: between? is >=, <=, not >, <
[19:49:50] rubyx9: Mattix: the course wants the ?:
[19:49:52] apeiros: ah, the expression is negated, so it actually works
[19:50:04] frustrum: has joined #ruby
[19:50:05] Mattx: I forgot the ! :P
[19:50:22] adaedra: rubyx9: the expression your wrote seems correct, even if you can put the return out of the expression
[19:50:50] Mattx: so talking about syntax, what about putting a block inside a hash?
[19:51:03] Mattx: Something like this: { callbacks: { success: {|msg| ... }, error: {|msg| ...} }}
[19:51:17] adaedra: Mattx: use proc.
[19:51:32] adaedra: { callbacks: { success: proc { |msg| ... } }
[19:51:44] adaedra: or lambda, or ->, for this matter.
[19:51:58] rubyx9: this dang course man
[19:52:00] rubyx9: its weird
[19:52:00] Mattx: yeah, not sure if it's the same. because I'm passing that to a function that expect a block
[19:52:03] Mattx: I'll check anyway
[19:52:41] Gasher: has joined #ruby
[19:52:49] diegoviola: has joined #ruby
[19:53:03] mallu: has joined #ruby
[19:53:27] adaedra: Mattx: blocks are just an application case of procs. You can, with the thing above, then call a method waiting for a block with something like method(&callbacks[:success])
[19:54:38] morfin: >> ->() {puts "hello"}.call()
[19:54:40] ruby[bot]: morfin: # => hello ...check link for more (https://eval.in/539501)
[19:55:17] rubyx9: adaedra: ok how about this one - http://pastebin.ca/3406937
[19:55:30] rubyx9: adaedra: instead of using if/else, how can i use ?:
[19:57:29] rubyx9: I came back with this:
[19:57:31] rubyx9: speed > 60 || speed < 40 ? return true : speed > 40 || speed < 60 return false
[19:58:17] RegulationD: has joined #ruby
[19:58:44] vikaton: has joined #ruby
[19:59:32] rikai: has joined #ruby
[20:00:32] mtkd: what you doing rubyx9?
[20:00:44] mtkd: you don't need the else part at all from that pastie
[20:01:00] mtkd: the if can be written on a single line
[20:01:17] siflyn: has joined #ruby
[20:02:08] shevy: I guess he wants to use ternary, for some strange reason
[20:02:22] mtkd: in fact you don't even need an if - speed > 60 || speed < 40 alone will return what you want
[20:02:30] rubyx9: its my COURSE
[20:02:43] solars: has joined #ruby
[20:03:02] bricker: has joined #ruby
[20:03:02] TheCubeLord: has joined #ruby
[20:03:02] TheCubeLord: has joined #ruby
[20:03:05] rubyx9: shevy: yes I want to use ternary instead of if/else
[20:03:14] Hanmac: has joined #ruby
[20:03:37] rubyx9: https://learn.co/tracks/web-development-fundamentals/intro-to-ruby/conditionals/operators-and-conditionals == the course
[20:03:41] shevy: puts x = 5 < 4 ? 'hi' : 'bye'
[20:04:02] Musashi007: has joined #ruby
[20:04:05] shevy: x will be assigned to the string 'bye', puts will output x and thus output bye
[20:04:27] rubyx9: shevy: I understand your syntax
[20:04:30] rubyx9: thats the not the issue
[20:04:33] pawnbox: has joined #ruby
[20:04:53] kirillzh: has joined #ruby
[20:04:53] rubyx9: the COURSE wants you do it like this
[20:04:58] shevy: no please
[20:05:41] mtkd: http://pastebin.ca/3406954
[20:05:46] mtkd: something like that?
[20:05:57] mtkd: not sure the last return is needed but can't be arsed running it
[20:06:26] mtkd: I'm missing an end too
[20:06:44] rubyx9: mtkd: yes EXACTLY like that but I need that same code to use ?:
[20:07:08] rubyx9: they use a checker script, and it has to have a :? to pass
[20:07:34] rubyx9: http://flatironschool.com/
[20:07:38] shevy: my code has a ? !!!
[20:07:58] shevy: even the strange course shows the general syntax conditional ? action_if_true : action_if_false
[20:08:16] rubyx9: jesus christ i understand the syntax but its not passing
[20:08:46] shevy: your journey has come to an end
[20:09:02] skade: has joined #ruby
[20:09:02] rubyx9: http://pastebin.ca/3406960
[20:09:15] cpup: has joined #ruby
[20:09:17] rubyx9: 4) Operations #not_safe? uses the ternary operator
[20:09:17] rubyx9: Failure/Error: expect(match).to include("?")
[20:09:25] futilegames: has joined #ruby
[20:09:53] DoubleMalt: has joined #ruby
[20:11:47] bezhermoso: has joined #ruby
[20:13:11] mtkd: (0..40).cover?(speed) || speed > 60 ? true : false
[20:13:13] TheCubeLord_: has joined #ruby
[20:13:13] mtkd: does that work?
[20:14:03] al2o3-cr: speed.between?(40,60) ? false : true
[20:14:24] mtkd: nice, didn't know about between
[20:14:57] francesc: has joined #ruby
[20:16:08] rubyx9: al203-cr: yes that works
[20:16:41] diego1: has joined #ruby
[20:18:20] LoneHermit: has joined #ruby
[20:19:49] blandflakes: has joined #ruby
[20:23:24] therealGent: has joined #ruby
[20:26:17] SenpaiSilver: has joined #ruby
[20:27:00] Disavowed: has joined #ruby
[20:28:07] lkba: has joined #ruby
[20:29:17] chouhoulis: has joined #ruby
[20:30:37] LoneHerm_: has joined #ruby
[20:30:57] i8igmac: has joined #ruby
[20:32:10] Gasher: has joined #ruby
[20:32:40] lianj: has joined #ruby
[20:32:41] lianj: has joined #ruby
[20:34:36] Musashi007: has joined #ruby
[20:34:37] bronson: has joined #ruby
[20:35:52] diego1: has joined #ruby
[20:37:26] fullofcaffeine: has joined #ruby
[20:39:36] warprobot: has joined #ruby
[20:42:34] fullofca_: has joined #ruby
[20:43:10] mtkd: has joined #ruby
[20:45:00] fullofca_: has joined #ruby
[20:45:11] mdw7: has joined #ruby
[20:46:21] nofxx: has joined #ruby
[20:46:38] Yzguy: has joined #ruby
[20:47:00] mdw: has joined #ruby
[20:48:05] mdw7_: has joined #ruby
[20:49:09] moeabdol: has joined #ruby
[20:49:10] fullofcaffeine: has joined #ruby
[20:49:42] yfeldblum: has joined #ruby
[20:49:54] FooMunki: has joined #ruby
[20:50:50] diego1: has joined #ruby
[20:52:12] LoneHerm_: has joined #ruby
[20:52:23] moeabdol1: has joined #ruby
[20:53:19] Spami: has joined #ruby
[20:53:58] cHolthi: has joined #ruby
[20:54:50] rikkipitt: has joined #ruby
[20:55:34] diego2: has joined #ruby
[20:55:44] cHolthi1: has joined #ruby
[20:56:30] baweaver: has joined #ruby
[20:57:27] mallu: Can someone please tell me the correct regex for replace this AMI id in this line "ImageId" : "ami-1ec6257e"
[20:58:23] cHolthi: has joined #ruby
[20:58:55] apeiros: mallu: I see "ami" in there, no "AMI". you mean that? or why the lapse in casing?
[20:59:35] diego3: has joined #ruby
[20:59:56] sneakerhax: has joined #ruby
[21:00:01] mallu: apeiros: I want to replace that to "ImageId" : "aim-new"
[21:00:32] apeiros: your notation is confusing.
[21:00:46] apeiros: is '"ImageId" : "ami-1ec6257e"' as a whole a string?
[21:00:57] apeiros: or are you showing us part of a hash? or what?
[21:00:59] mallu: apeiros: I have json file and one of the line is "ImageId" : "ami-1ec6257e" I want to search for that line and change it to "ImageId" : "ami-something"
[21:01:34] apeiros: IMO you should parse the json then, and not use a regex on the serialization
[21:02:03] apeiros: gsub(/ami-[^"]*"/, "ami-new")
[21:02:05] TheCubeLord: has joined #ruby
[21:02:16] mallu: apeiros: ok thanks
[21:03:04] tjohnson: has joined #ruby
[21:03:44] jpfuentes2: has joined #ruby
[21:04:17] cHolthi1: has joined #ruby
[21:04:31] yqt: has joined #ruby
[21:05:20] mleung: has joined #ruby
[21:06:34] mleung: has joined #ruby
[21:07:00] RedNifre: has left #ruby: ("WeeChat 0.4.2")
[21:08:06] mallu: apeiros: I am getting this "ImageId" : "aim-new. Missing " after new
[21:08:08] diego3: has joined #ruby
[21:08:47] cHolthi: has joined #ruby
[21:09:37] apeiros: mallu: aaaand did you try to fix that?
[21:10:17] mallu: apeiros: can you please explain this to me [^"]*"
[21:10:46] jidar: not quotes
[21:10:57] apeiros: [^] is a negated character class. so [^"] means "any character except a quote"
[21:11:04] apeiros: * means zero-or-more
[21:12:33] mallu: apeiros: ok thanks
[21:15:54] mallu: apeiros: this will add trailing "? (/ami-[^"]*"/, "ami-new\"")
[21:16:34] Spami: has joined #ruby
[21:17:01] cHolthi: has joined #ruby
[21:17:08] vdamewood: has joined #ruby
[21:17:26] dcunit3d: has joined #ruby
[21:19:03] Riviera-: has joined #ruby
[21:21:51] cd-rum: has joined #ruby
[21:23:28] skade: has joined #ruby
[21:26:23] roshanavand: has joined #ruby
[21:27:19] the_drow: has joined #ruby
[21:29:17] Marsupermammal: has joined #ruby
[21:30:05] spacedev: has joined #ruby
[21:30:15] chouhoulis: has joined #ruby
[21:30:20] spacedev: i have installed cocoapods with "sudo gem install cocoapods", but when I "pod init" command, zsh return me command not found
[21:30:32] spacedev: i running with ZSH
[21:30:41] sucks: has joined #ruby
[21:32:40] shevy: spacedev you must have installed ruby in a strange way right?
[21:32:56] shevy: it must be
[21:33:10] spacedev: maybe its a path issue
[21:33:15] spacedev: im using zsh
[21:33:18] shevy: cocoapods has two executables in bin/ which is bin/pod and bin/sandbox-pod
[21:33:39] shevy: so you can not have a ruby that has the /usr prefix OR you must use something that installs in some other directory
[21:33:45] uglybandersnatch: has joined #ruby
[21:33:54] benzrf_irssi: spacedev: what OS are you using
[21:34:23] spacedev: yosemite (10.10.5)
[21:34:31] ready: has joined #ruby
[21:34:38] spacedev: cocoapods is in my gem list
[21:34:49] shevy: look at "gem env" output too
[21:34:57] spacedev: but pod not accessible in my terminal
[21:35:07] spacedev: what i have to do with the gem env ?
[21:35:37] shevy: it may show the unusual path
[21:35:57] spacedev: im really not friendly with path notion
[21:36:49] spacedev: http://pastebin.com/F1ncsf9F
[21:36:50] ruby[bot]: spacedev: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/5c860d5dfc0d6940af14
[21:36:50] ruby[bot]: spacedev: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[21:37:14] spacedev: https://gist.github.com/anonymous/5c860d5dfc0d6940af14
[21:37:21] spacedev: this is the output of my gem env
[21:39:45] shevy: so yeah you installed ruby in a strange way - rbenv :)
[21:40:00] PaulCape_: has joined #ruby
[21:40:16] blt: has joined #ruby
[21:40:26] shevy: I am not sure what rbenv recommends to have bin/ files work as-is
[21:40:47] Jesperhead: has joined #ruby
[21:41:05] spacedev: im totally lost$
[21:41:06] uglybandersnatch: has joined #ruby
[21:41:28] shevy: it should be either in /Users/kirgansomville/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0 or in /Users/kirgansomville/.gem/ruby/2.1.0
[21:41:38] intrigueD: has joined #ruby
[21:42:28] shevy: just find where the "pod" executable is there, you can then either add it to a $PATH or provide a symlink to it but I am sure that rbenv has some way too so you might find that in its documentation
[21:43:30] TheCubeLord: ACTION i have to relog
[21:43:32] Jesperhead: hey all, helping a friend get genieacs up and running on their home machine. They seem to be having problems which look *very* similar to https://github.com/flori/json/issues/229. I attempted to follow Anatol's comment (jan 5th, 2015) and replaced line 175 in /ext/fbuffer/fbuffer.h to include the second argument. Attempting to install still yields the same error. im very new to ruby/gem...
[21:43:34] Jesperhead: ...installer and friend even less so. do we need to compile the gem manually?
[21:43:49] TheCubeLord: has joined #ruby
[21:44:59] shevy: Jesperhead did you read the description at https://github.com/flori/json/ ?
[21:45:39] Jesperhead: no i have not
[21:45:46] shevy: I see three means; rake install_pure or ruby install.rb or using ragel for creating parser.c from parser.rl
[21:46:28] shevy: but you could try the pure ruby variant first
[21:47:13] Jesperhead: okay ill get the elders to use the village runestone to decrypt all that
[21:48:12] cd-rum: has joined #ruby
[21:49:38] kentnl: has joined #ruby
[21:49:42] spacedev: YES I GET IT
[21:49:56] spacedev: foudn it after 4hours of research
[21:50:23] spacedev: just had to run
[21:50:24] spacedev: eval “$(rbenv init -)”
[21:50:35] Radar: That should be in your ~/.bashrc
[21:50:37] spacedev: dont get exactly what it did..
[21:50:43] Radar: or ~/.bash_profile. I am not sure which one.
[21:51:03] jdawgaz: has joined #ruby
[21:51:45] Cohedrin: has joined #ruby
[21:53:17] binaryplease: has joined #ruby
[21:53:19] stannard: has joined #ruby
[21:53:56] dikaio: has joined #ruby
[21:55:11] jdawgaz: has joined #ruby
[21:55:51] n008f4g_: has joined #ruby
[21:56:24] silentpost: has joined #ruby
[21:56:57] djbkd: has joined #ruby
[21:58:11] stannard_: has joined #ruby
[22:00:08] RegulationD: has joined #ruby
[22:01:16] mdw: has joined #ruby
[22:02:02] mdw: has joined #ruby
[22:02:48] mdw: has joined #ruby
[22:02:50] Jesperhead: shevy: thanks for you earlier input and forgive my smarmy-ness. we're gonna shelve the issue for today. maybe we can get it working in the coming weeks
[22:03:04] Mattx: has joined #ruby
[22:03:58] nerium: has joined #ruby
[22:04:41] Mattx: Is there a way to stop the interpreter exactly when the exception occurs? It would be really time saving. For instance if I do foo/bar and bar=0, I want to stop the code right there before it throw the exception so I check what's wrong, instead of adding a "debugger" line and running the code again. Possible?
[22:05:00] Radar: Mattx: No. Put a debugger.
[22:05:13] darix: Mattx: there is a pry wrapper that will catch any exception
[22:05:21] Mattx: that's what I'm doing, but it takes a lot of time and effort
[22:05:26] cHolthi: has joined #ruby
[22:05:40] darix: Mattx: https://github.com/ConradIrwin/pry-rescue
[22:05:47] Mattx: because I'm developing a tool that takes random rows from the DB and process them, but sometimes it crashes, and it's hard to reproduce the error
[22:06:24] wilbert: has joined #ruby
[22:07:16] marr: has joined #ruby
[22:07:19] cHolthi1: has joined #ruby
[22:07:22] blackmesa: has joined #ruby
[22:07:55] cpup: has joined #ruby
[22:10:40] sesquipedalian: has joined #ruby
[22:10:51] Mattx: darix, seriously awesome, thanks!
[22:10:51] cHolthi: has joined #ruby
[22:11:08] ss_much: has joined #ruby
[22:12:09] BtcBen: has joined #ruby
[22:12:13] darix: Mattx: normally i dont put debugger statements into files anymore. rescue Exception => ex ; binding.pry ; end
[22:12:20] darix: and you can tinker
[22:14:08] ensyde_: has joined #ruby
[22:14:13] Mattx: sure, but you have to know where the bugs will be
[22:14:41] Mattx: the only problem I've found so far with pry-rescue is that when you're running more than one thread, it'll stop the thread with the exception while the other keeps running
[22:15:01] Mattx: so the output gets messed up
[22:15:28] Mattx: (or so I think, I'm still figuring it out)
[22:17:20] Aviio: has joined #ruby
[22:18:25] B4daBing73: has joined #ruby
[22:18:38] B4daBing73: has joined #ruby
[22:19:00] marcofernandez: has joined #ruby
[22:21:21] benzrf_irssi: Tfw no happy medium between js, ruby, & python
[22:22:04] bezhermoso: has joined #ruby
[22:23:44] TheCubeLord: has joined #ruby
[22:24:32] nando293921: has joined #ruby
[22:25:20] shevy: you have too much in your stack!
[22:25:23] shevy: throw out js :)
[22:26:47] benzrf_irssi: you're right, i should've said between ruby and python
[22:26:49] Mattx: darix, do you happen to know how you you move up into the stack? I've got an exception witin a gem, I want to see the code that called that method
[22:27:14] benzrf_irssi: i only mentioned js because some aspects of it already reach the happy medium i want, but others are much worse than either of ruby or python
[22:27:57] TheCubeLord: has joined #ruby
[22:30:13] darix: Mattx: up/down maybe?
[22:30:43] Mattx: yeah, I thought so but I needed to install pry-stack_explorer for up/down to work
[22:31:46] Mattx: There will be a time for me to wonder how I could code without pry-rescue and pry-stack_explorer :P
[22:31:57] benzrf_irssi: like, if you threw away js's syntax, just keeping the abstract syntax trees, and you stripped out almost all of its builtins and standard library, you'd get something pretty close to my ideal dynlang
[22:32:14] benzrf_irssi: er, rather, something pretty close to what you'd get by doing the same thing to my ideal dynlang
[22:32:32] benzrf_irssi: but of course the syntax and builtins and standard library are awful ;-;
[22:32:33] chouhoulis: has joined #ruby
[22:32:42] diegoviola: has joined #ruby
[22:33:59] sneakerhax: has joined #ruby
[22:35:38] cd-rum: has joined #ruby
[22:36:07] workmad3: has joined #ruby
[22:36:50] nettoweb: has joined #ruby
[22:37:37] tomatoes: has joined #ruby
[22:38:00] workmad3: has joined #ruby
[22:38:00] bronson: has joined #ruby
[22:38:20] ensyde_: has joined #ruby
[22:39:30] zenlot6: has joined #ruby
[22:40:49] cd-rum_: has joined #ruby
[22:42:59] Inside: has joined #ruby
[22:43:01] workmad3: has joined #ruby
[22:43:47] htmldrum: has joined #ruby
[22:43:51] workmad3: has joined #ruby
[22:45:03] JoshGlzBrk: has joined #ruby
[22:46:37] workmad3: has joined #ruby
[22:47:14] jcdesimp: has joined #ruby
[22:47:21] Phage: has left #ruby: ("WeeChat 1.4")
[22:48:41] workmad3: has joined #ruby
[22:49:10] workmad3: has joined #ruby
[22:49:41] workmad3: has joined #ruby
[22:50:51] hightower3: has joined #ruby
[22:51:39] intrigueD: has joined #ruby
[22:54:08] shevy: not much you seem to wanna keep from javascript :D
[22:54:09] benzrf_irssi: who EVER decided that abandoning explicitness in favor of conciseness was a good idea
[22:54:57] benzrf_irssi: even moderately cleverly written ruby is IMPOSSIBLE to read compared to, say, python
[22:58:07] fullofcaffeine: has joined #ruby
[22:58:30] Papierkorb: I always found python to be unreadable
[22:58:46] shevy: it sorta depends
[22:59:07] shevy: I'd like to have an optional way to write a given .rb file without any "end"
[22:59:14] rkoller: has joined #ruby
[23:00:46] benzrf_irssi: Papierkorb: do you mean syntactically?
[23:00:53] BtcBen: has joined #ruby
[23:01:01] nertzy: has joined #ruby
[23:01:03] benzrf_irssi: yeah, i meant semantically
[23:01:21] Papierkorb: I do need the end or } or whatever the language uses. I use them as visual skip markers to find end of branches all the time.
[23:01:23] benzrf_irssi: like, figuring out what a piece of code is doing, what other code it's making use of, etc
[23:01:40] benzrf_irssi: ruby is not so syntactically unreadable
[23:04:58] matp: has joined #ruby
[23:05:07] `tim`: has joined #ruby
[23:07:20] sysodaff: has joined #ruby
[23:07:33] Thomas-0725: has joined #ruby
[23:11:29] Ox0dea: benzrf_irssi: It can be. ^_^
[23:13:21] otherj: has joined #ruby
[23:14:04] n008f4g_: has joined #ruby
[23:15:16] SCHAAP137: has joined #ruby
[23:15:38] trosborn: has joined #ruby
[23:15:46] chipotle: has joined #ruby
[23:19:57] mistermocha: has joined #ruby
[23:20:53] rikkipitt: has joined #ruby
[23:20:56] RIK: ACTION ponders layout engines.
[23:21:10] marcdel: has joined #ruby
[23:21:28] cd-rum: has joined #ruby
[23:21:38] Marsupermammal: has joined #ruby
[23:21:52] RIK: i have to choose between everything Sinatra supports, and I'm thinking abot going with erb, becase it's included. Is that sensible, or does erb suck badly enough that i should pick another one?
[23:22:59] rodfersou: has joined #ruby
[23:23:22] Aviio: has joined #ruby
[23:23:36] Karix: has joined #ruby
[23:23:54] nickjj: rik, i never had any issues with erb
[23:24:00] benzrf: that's not what a layout engine is, is it?
[23:24:08] benzrf_irssi: aren't those called template engines?
[23:24:12] benzrf: or templating engines
[23:24:26] RIK: benzrf: no, to be fair, i did mean templating engine, in this case.
[23:25:26] riceandbeans: can you ensure data types in a struct?
[23:26:04] riceandbeans: like Foo = Struct.new( :bar, :baz ) where :bar is Fixnum and :baz is Bool ?
[23:27:30] shevy: don't think so
[23:27:42] shevy: structs are super primitive
[23:27:58] Aviio: has joined #ruby
[23:28:01] shevy: http://ruby-doc.org/core-2.3.0/Struct.html
[23:28:18] benzrf_irssi: riceandbeans: if you want correctness constraints on code, your best bet is to look elsewhere
[23:28:25] shevy: hmm perhaps you can patch it at runtime riceandbeans
[23:28:39] havenwood: has joined #ruby
[23:28:48] havenwood: has joined #ruby
[23:29:34] bezhermoso: has joined #ruby
[23:30:46] riceandbeans: what's the best way to do it if you want correctness constraints?
[23:30:50] riceandbeans: a class instead of a struct?
[23:30:53] Gasher^: has joined #ruby
[23:32:56] shevy: and use setter methods that ensure that these are always a fixnum or a bool and so on
[23:33:08] chouhoulis: has joined #ruby
[23:33:44] sysodaff: has joined #ruby
[23:41:06] x77686d_: has joined #ruby
[23:43:06] riceandbeans: shevy: actually, I'm not sure how to go about this
[23:43:43] riceandbeans: shevy: if I'm receiving json data, is it worth taking it and making a struct/class out of it, then referring to attr in them, or just parse the json and refer to it as keys of the json and leave it like that?
[23:44:43] jdawgaz: has joined #ruby
[23:45:38] jaequery: has joined #ruby
[23:46:19] blt: has joined #ruby
[23:48:33] Suntzu: has joined #ruby
[23:48:39] weemsledeux: has joined #ruby
[23:49:38] Anderson69s_Deb: has joined #ruby
[23:50:05] shevy: I dunno, I never was a big struct user
[23:50:21] shevy: I always end up writing a class that does the parsing for data, add methods to it etc..
[23:50:38] shevy: I mean it depends on what you want to be able to do
[23:50:49] shevy: if you want fancy methods, than fancy up that json hash
[23:51:14] riceandbeans: it's just dumb json being throw at an API
[23:54:17] decoponyo: has joined #ruby