« Back to channel list

#ruby - 27 March 2016

« Back 1 day Forward 1 day »
[00:00:18] brentw: never heard of it
[00:00:21] epitron: You don't have to initialize it anywhere...
[00:01:06] epitron: http://ruby-doc.org/stdlib-2.3.0/libdoc/singleton/rdoc/Singleton.html
[00:01:24] pawnbox: has joined #ruby
[00:02:32] brentw: i'll take a look
[00:02:51] brentw: thanks for the help havenwood Ox0dea shevy
[00:03:16] Ox0dea: brent_: Sure thing. :)
[00:05:11] jobewan: has joined #ruby
[00:06:12] Musashi007: has joined #ruby
[00:06:50] jnj: has joined #ruby
[00:10:38] brentw: sure i'll be back asking for help again soon
[00:11:19] smathy: There are very few.
[00:11:44] smathy: (scrolled back, talking about hoping to find a use for @@ :)
[00:14:18] shevy: we all hope so!
[00:15:37] Ox0dea: @@ is for when you don't want the warning associated with redefining a constant. :)
[00:17:09] sandstrom: has joined #ruby
[00:17:57] Azure: has joined #ruby
[00:19:09] preyalone: has joined #ruby
[00:19:57] brentw: a constant in the class would be betterthan @@?
[00:20:15] yatish27: has joined #ruby
[00:20:59] Ox0dea: brent_: It's essentially the same thing.
[00:21:54] SuperLag: has joined #ruby
[00:21:58] brentw: seems like it
[00:22:11] Ox0dea: brent_: The equivalence breaks when it comes to assignment, though.
[00:22:15] brentw: but you said it will proivde a warning while @@ doesnt'
[00:22:18] havenwood: Which reminds me, I think Pry needs a private_constant patch.
[00:22:35] SuperLag: I have someone else's rails app code, and I'm trying to set it up. Do I have to manually install all the gems in the Gemfile, or is there a way to get all that done automatically?
[00:22:46] havenwood: SuperLag: bundle
[00:23:04] havenwood: SuperLag: As in from the root dir of the project type: bundle
[00:23:14] smathy: Ox0dea, except you CAN redefine a constant in a subclass without overwriting the base class's value.
[00:23:20] havenwood: SuperLag: (After installing Bundler: gem install bundler)
[00:23:38] Ox0dea: smathy: Right, that's the crucial distinction.
[00:25:37] Timba-as: has joined #ruby
[00:25:45] Ox0dea: brent_: https://eval.in/542709
[00:26:01] danielpclark: has joined #ruby
[00:27:25] Azure: has joined #ruby
[00:27:29] Ox0dea: So, for sharing data with subclasses, constants suffice unless you actually *want* the data to be modifiable by all relevant parties, which is rarely a great idea.
[00:28:27] brentw: makes sense
[00:30:03] tesuji: has joined #ruby
[00:31:04] Blaguvest: has joined #ruby
[00:31:14] Ox0dea: >> x = 1; -x.class rescue $! # This kinda sucks.
[00:31:15] ruby[bot]: Ox0dea: # => #<NoMethodError: undefined method `-@' for Fixnum:Class> (https://eval.in/542712)
[00:33:01] Rutix: has joined #ruby
[00:33:01] Rutix: has joined #ruby
[00:33:39] danielpclark: >> RUBY_VERSION
[00:34:14] danielpclark: Does the bot require a specific format to process code?
[00:34:37] adaedra: It requires to be registered.
[00:36:32] hiyosi: has joined #ruby
[00:39:00] bronson: has joined #ruby
[00:40:35] danielpclark: >> eval "#{"!" * rand(2)}:quarter ? :heads : :tails" # coin toss
[00:40:37] ruby[bot]: danielpclark: # => :heads (https://eval.in/542717)
[00:41:29] danielpclark: That's awesome :-)
[00:42:26] mjuszczak: has joined #ruby
[00:43:04] Timba-as: has joined #ruby
[00:43:07] mjuszczak: has joined #ruby
[00:43:30] Ox0dea: This is nifty: https://eval.in/542718
[00:43:48] mjuszczak: has joined #ruby
[00:44:21] Ox0dea: But the precedence of method calls over unary + makes chaining on them ugly. :/
[00:44:50] ascarter: has joined #ruby
[00:47:29] blackgoat: has joined #ruby
[00:49:21] houhoulis: has joined #ruby
[00:49:23] torandu: has joined #ruby
[00:51:27] mjuszczak: has joined #ruby
[00:56:34] htmldrum: has joined #ruby
[00:56:34] htmldrum_: has joined #ruby
[00:58:31] Evan-: has joined #ruby
[01:00:54] rehat: what does "rvm reinstall 2.2.1 --disable-binary" do? that fixed a OpenSSL error I was having. Does that just reinstall ruby? It took forever to finish lol
[01:02:37] Cohedrin: has joined #ruby
[01:03:01] tesuji: has joined #ruby
[01:03:09] huyderman: has joined #ruby
[01:11:23] elifoster: has joined #ruby
[01:15:41] Timba-as_: has joined #ruby
[01:16:45] tubuliferous_: has joined #ruby
[01:17:07] mistermocha: has joined #ruby
[01:17:25] dasher^0_o: has joined #ruby
[01:18:58] ytti: has joined #ruby
[01:18:58] ytti: has joined #ruby
[01:20:52] mgorbach: has joined #ruby
[01:22:20] glcx: has joined #ruby
[01:24:21] ytti: has joined #ruby
[01:25:18] shaman42: has joined #ruby
[01:25:21] nw: has joined #ruby
[01:29:20] uglybandersnatch: has joined #ruby
[01:29:31] Musashi007: has joined #ruby
[01:31:01] htmldrum_: has joined #ruby
[01:31:01] htmldrum: has joined #ruby
[01:31:08] ytti: has joined #ruby
[01:33:43] xxneolithicxx: has joined #ruby
[01:33:44] u404: has joined #ruby
[01:34:14] xxneolithicxx: has joined #ruby
[01:34:24] jpfuentes2: has joined #ruby
[01:35:21] Cohedrin: has joined #ruby
[01:36:17] shaman42: has joined #ruby
[01:36:40] Guest45216: has joined #ruby
[01:36:43] astrobun_: has joined #ruby
[01:39:24] tvon: has joined #ruby
[01:39:54] `tim`: has joined #ruby
[01:39:54] diego1: has joined #ruby
[01:40:15] cpup: has joined #ruby
[01:40:31] fullofcaffeine: has joined #ruby
[01:41:09] diego1: has joined #ruby
[01:43:00] Es0teric: has joined #ruby
[01:43:12] ytti: has joined #ruby
[01:43:12] ytti: has joined #ruby
[01:43:17] arescorpio: has joined #ruby
[01:43:23] brentw: Ox0dea https://eval.in/542725 does this make sense. board is defaulted to a str of "_" for unguessed letters
[01:43:53] brentw: trying to give some logic to have the computer pick the most likely letters
[01:44:14] Ox0dea: brent_: You want it to make the optimal guess?
[01:44:59] kfpratt: has joined #ruby
[01:45:04] brentw: so w/ letters defined
[01:45:13] binaryplease: has joined #ruby
[01:45:16] brentw: i will then have it select the most frequent letter
[01:45:34] brentw: which i need to figure out how to do
[01:45:40] Hoffman: has joined #ruby
[01:45:44] freerobby: has joined #ruby
[01:46:04] brentw: but wonder if that makes sense to reduce the dictionary to words that have correclty guessed letters in the same index
[01:46:47] Hoffman: I am playing around with hashes, and I see that you can specify that the key is neither a string (it isnt quoted) nor a symbol (it isnt prefixed with a colon), so it must be a variable name. Yet that key can only be accessed by a symbol
[01:46:49] Hoffman: why is that?
[01:47:28] Ox0dea: Hoffman: Huh? Hash keys can be pretty much anything.
[01:47:48] Hoffman: yeah, but if I specify myHash={key: "value"}
[01:47:54] Hoffman: key is neither a string nor a symbol
[01:48:02] Ox0dea: brent_: Yes, that makes sense. In general, you want to reduce it down to all the words that it could be.
[01:48:08] Hoffman: but I need to do myHash[:key] to get the value
[01:48:23] Ox0dea: Hoffman: It's a Symbol there.
[01:48:34] Hoffman: I thought symbols had to be preceded by a colon
[01:48:39] Ox0dea: `{a: 1}` is syntactic sugar for `{:a => 1}`.
[01:48:50] Ox0dea: >> {a: 1} # Told ya.
[01:48:50] Hoffman: what if a actually was a variable holding a string
[01:48:51] ruby[bot]: Ox0dea: # => {:a=>1} (https://eval.in/542726)
[01:49:00] Hoffman: and I wanted to use that string as the key
[01:49:08] Ox0dea: Then you'd have to use `=>`.
[01:49:11] Ox0dea: Without the colon.
[01:49:23] Ox0dea: >> s = 'foo'; h = {s => 42}; h['foo']
[01:49:24] ruby[bot]: Ox0dea: # => 42 (https://eval.in/542727)
[01:49:28] Hoffman: ok -- and that's true even in the latest version of ruby?
[01:49:39] Ox0dea: The sugar is a 1.9-ism.
[01:49:51] Hoffman: so it's not true in versions after 1.9?
[01:50:00] Ox0dea: ¯\_(ツ)_/¯
[01:50:18] brentw: do you have a recommendation for finding the most frequent str in that letters array?
[01:50:38] brentw: is there a way thats better than making a hash?
[01:51:01] tristanp: has joined #ruby
[01:51:26] Ox0dea: brent_: I'd set it up so that I could eventually call #max_by.
[01:52:01] brentw: i saw something about group_by
[01:52:09] brentw: but trying to understand how it works
[01:52:36] Hoffman: I also see, when discussing methods, the way to name a method is Class#Method
[01:52:44] Hoffman: why isn't it Class.Method, the way it is called?
[01:52:58] Ox0dea: Because a distinction needs to be made between class methods and instance methods.
[01:54:25] brentw: letters.group_by { |letter| letter }.max_by(&:size)
[01:54:42] freerobby: has joined #ruby
[01:54:42] brentw: that look right?
[01:55:21] Ox0dea: Not quite; #group_by gives you back a Hash, and all your elements there are going to be of size 2.
[01:55:26] Hoffman: Ox0dea: so # refers to instance methods, whereas X refers to class (static?) methods
[01:55:33] Hoffman: is that right, and what is 'X'
[01:55:42] Ox0dea: Hoffman: X is `.` or `::`.
[01:55:48] Ox0dea: Prefer the former.
[01:56:01] htmldrum: has joined #ruby
[01:56:02] brentw: letters.group_by { |letter| letter }.max_by(&:size).first wouldn't work? seemed to in pry
[01:56:02] htmldrum_: has joined #ruby
[01:56:11] Hoffman: and is a class method synonymous with a static method in Java?
[01:56:35] brentw: what do you mean by the size of 2, feel free to take your time as you're helping others
[01:57:13] Ox0dea: >> 'abbccc'.chars.group_by(&:itself).map(&:size) # brent_
[01:57:14] ruby[bot]: Ox0dea: # => [2, 2, 2] (https://eval.in/542728)
[01:57:46] Rubie: has joined #ruby
[01:58:04] Ox0dea: Hoffman: No, not quite; `Hash.new` is a class method, in that it's defined on Hash itself, whereas Hash#size is available on instances thereof.
[01:58:25] Hoffman: Ox0dea: sure, but regarding my question?
[01:58:35] Hoffman: that seems synonymous with java and s/class/static/
[01:59:13] Hoffman: static methods are called on the Class itself, whereas instance methods are available on instances thereof
[01:59:58] brentw: >> "aaabbcc".chars.group_by {|e| e }.max_by(&:size).first
[02:01:17] jpfuentes2: has joined #ruby
[02:01:32] Hoffman: Ox0dea: Integer.parseInt() for instance
[02:01:51] solocshaw: has joined #ruby
[02:01:51] ytti: has joined #ruby
[02:02:12] Ox0dea: Hoffman: The analogy more or less holds, sure.
[02:02:56] Hoffman: cool, thanks
[02:03:00] Hoffman: for both @s
[02:03:01] Ox0dea: No worries.
[02:04:03] danielpclark: >> 'The cat in the hat eats his green eggs and ham'.chars.reduce({}) {|h,v| h[v] = h[v].to_i + 1; h}
[02:04:04] ruby[bot]: danielpclark: # => {"T"=>1, "h"=>5, "e"=>6, " "=>10, "c"=>1, "a"=>5, "t"=>4, "i"=>2, "n"=>3, "s"=>3, "g"=>3, "r"=>1, "d ...check link for more (https://eval.in/542729)
[02:04:33] goodroot: has joined #ruby
[02:04:53] tvon: has joined #ruby
[02:05:17] diego1: has joined #ruby
[02:06:53] brentw: Ox0dea can you elaborate on what you mean by size 2?
[02:07:14] uglybandersnatch: has joined #ruby
[02:07:50] aef: has joined #ruby
[02:08:07] danielpclark: >> 'abbcccddddeeee'.chars.reduce({}) {|h,v| h[v] = h[v].to_i + 1; h}.max_by {|k,v| v } # max by value character count
[02:08:08] ruby[bot]: danielpclark: # => ["d", 4] (https://eval.in/542730)
[02:08:41] Ox0dea: brent_: Sure. Did you get clear on what #group_by does?
[02:09:48] brentw: looks like it returns a hash w/ the key as the value and an array of each time the value occurs
[02:10:20] Ox0dea: >> [1,2,3,4].group_by { |x| x.even? }
[02:10:22] ruby[bot]: Ox0dea: # => {false=>[1, 3], true=>[2, 4]} (https://eval.in/542731)
[02:10:22] brentw: 'a' => [a, a ,a]
[02:10:55] Ox0dea: brent_: The results of the predicate are used as the keys.
[02:11:27] Axy: has joined #ruby
[02:12:01] brentw: are you talkinga bout size of 2, because of the key/value?
[02:12:43] gh: has joined #ruby
[02:14:12] Ox0dea: brent_: When you use any Enumerable method other than #select/#reject on a Hash, it gets converted to an Array of key-value pairs; the size of any pair is of course 2.
[02:15:23] brentw: so is it a performance consideration?
[02:16:57] yfeldblum: has joined #ruby
[02:17:05] Ox0dea: In hindsight, I think I probably just misinterpreted something. :P If you have a frequency hash, you can say `hash.sort_by { |_, v| v.size }.last.first`.
[02:17:20] Hoffman: So to include INSTANCE methods from another class into your class, you can use INCLUDE... to include CLASS methods from another class into your class, you can use EXTEND.... but, to include INSTANCE methods from another class into your OBJECT, you use... EXTEND?
[02:17:41] Hoffman: Why wouldn't the third be INCLUDE, since we're referring to instance methods and not class methods?
[02:18:01] Ox0dea: Hoffman: Because you want those instance methods to be added to the object's singleton class.
[02:18:17] Hoffman: just that single object instance
[02:18:21] Hoffman: no other instances of the object
[02:18:34] Ox0dea: A singleton class belongs to exactly one object, yes.
[02:18:38] fullofca_: has joined #ruby
[02:19:01] Hoffman: I thought a singleton class is a class which can only have a single instance
[02:19:12] Ox0dea: No, that's a singleton.
[02:19:34] Ox0dea: "The hardest part of computer science is naming things."
[02:19:41] Hoffman: so a singleton class is effectively a singleton for that instance
[02:19:52] patrick-sartent: has joined #ruby
[02:19:58] Hoffman: since no other instances will share that singleton class
[02:20:19] Ox0dea: That's right; you can't make new instances from singleton classes.
[02:20:47] Ox0dea: >> singleton_class.new rescue $!
[02:20:48] ruby[bot]: Ox0dea: # => #<TypeError: can't create instance of singleton class> (https://eval.in/542732)
[02:20:55] Hoffman: Ox0dea: but that still doesnt really address the initial question, because INCLUDE vs. EXTEND can both be used to extend a class, and the one you use depends on whether you want to include instance methods or class methods
[02:21:11] Hoffman: so why would you use the one meant to include class methods if your intention is to include instance methods
[02:22:30] Ox0dea: Hoffman: foo.extend(bar) adds bar's instance methods to foo's singleton class.
[02:22:43] Ox0dea: It works the same for classes as for individual objects.
[02:22:57] Ox0dea: Since, y'know, classes *are* individual objects. :P
[02:23:13] abort: has joined #ruby
[02:23:41] Hoffman: if you put in a class foo that it EXTENDS bar, then bar's CLASS methods go into foo. If you put in a class foo that it INCLUDES bar, then bar's INSTANCE methods go into foo
[02:24:19] Hoffman: so the difference between "extend" and "include" in ruby appears to be that "extend" is for including class methods, whereas "include" is for including instance methods
[02:24:38] Hoffman: but then, if you want to include those same instance methods into an object, rather than a class, it's backwards
[02:24:49] Ox0dea: It's not.
[02:25:05] Hoffman: if you want to include INSTANCE methods in a class, you use INCLUDE. If you want to include INSTANCE methods in an object, you use EXTEND
[02:25:16] diego1: has joined #ruby
[02:25:37] Hoffman: if you're doing the same thing, why is it two different keywords?
[02:25:46] Ox0dea: They're methods, not keywords.
[02:25:52] Hoffman: method names are keywords
[02:25:59] Hoffman: by the dictionary definition
[02:26:08] Hoffman: lemme fix it then
[02:26:08] Hoffman: if you're doing the same thing, why is it two different *words*
[02:26:44] spuk: has joined #ruby
[02:26:55] Hoffman: "I want to put instance methods into this thing" should be extend, or it should be include, so why is it both?
[02:26:59] Hoffman: depending on the scenario
[02:27:30] shevy: you operate on different scopes
[02:28:18] Hoffman: sure, but there was a conscious decision to use two different words depending on scope, instead of the intuitive one
[02:28:36] shevy: https://gist.github.com/shevegen/6ad04866d59cf6d6771b
[02:29:03] ytti: has joined #ruby
[02:29:11] shevy: you'd have to ask matz about the distinction. I don't even think that the distinction between classes or modules makes any sense either
[02:31:11] postmodern: has joined #ruby
[02:31:36] shevy: we can even do Module.new!
[02:32:17] BTRE: has joined #ruby
[02:32:21] Ox0dea: Hoffman: I hope this helps. https://eval.in/542733
[02:32:59] LoneHermit: has joined #ruby
[02:33:19] gregf: has joined #ruby
[02:33:32] dextertzu: has joined #ruby
[02:33:46] Ox0dea: A class is "just an Object", an instance of the Class class.
[02:35:14] jaequery: has joined #ruby
[02:37:06] duncannz: has joined #ruby
[02:39:04] astrobun_: has joined #ruby
[02:40:17] dn5: has joined #ruby
[02:41:04] bronson: has joined #ruby
[02:41:24] dn5: how would I generate from A to Z respectively like: QQWE QQWR QQWT etc. instead of A..Z rand
[02:41:59] dn5: ehm more like QQQQ QQQW QQQE
[02:43:18] Mendenhall_: More details?
[02:43:43] Ox0dea: dn5: https://eval.in/542737
[02:44:28] dn5: Ox0dea: would this go further like WWWW etc.
[02:44:55] Ox0dea: dn5: Nix the `first(10)` bit if you want all 456976 of 'em. :)
[02:45:10] andywojo: has joined #ruby
[02:45:11] kfpratt: has joined #ruby
[02:45:35] Hoffman: Ox0dea: I guess it makes sense in that context
[02:45:50] dn5: Ox0dea: I do want all of them. You are truly a master :) ty
[02:46:05] Ox0dea: dn5: Happy to help.
[02:46:09] Hoffman: Since a class method is just an instance method of the superclass
[02:46:20] Ox0dea: s/superclass/singleton class/
[02:46:21] Hoffman: or something
[02:46:41] Musashi007: has joined #ruby
[02:47:05] Hoffman: so when I define but do not instantiate a class in Ruby, I am still instantiating an object, which is called a singleton class, which extends Class
[02:48:08] Ox0dea: Not really. :/
[02:48:30] Hoffman: so when I define but do not instantiate a class in Ruby, I am still instantiating an object <--- right so far?
[02:48:36] Hoffman: since a class is an object
[02:48:36] Ox0dea: Right so far.
[02:48:58] Hoffman: and any class methods added to that class, are actually instance methods of Class
[02:49:13] Hoffman: since that class is an instance of Class
[02:49:59] Hoffman: So when that class is defined, it becomes an object, whose template is the superclass "Class"
[02:50:11] Hoffman: and that template is copied and stored with the defined class/object
[02:50:15] Hoffman: and that copy is the singleton class?
[02:50:24] ytti: has joined #ruby
[02:50:35] Ox0dea: "Copied" isn't quite right; it's a little more implicit than that.
[02:52:08] Ox0dea: https://eval.in/542742
[02:52:59] Hoffman: how was that inheirited after the fact?
[02:53:11] Hoffman: doesn't inheiritance mean, by definition, that the parent had it?
[02:53:22] Ox0dea: In Ruby, it means that the parent *has* it.
[02:53:36] Hoffman: oh nvm, I read it backwards
[02:54:01] Hoffman: I am thinking more along the lines of...
[02:54:40] Ox0dea: That was only meant to demonstrate why "copied" isn't perfectly applicable.
[02:54:41] Hoffman: if defining a class just creates an instance of Class, how can you do stuff like add methods to that instance?
[02:55:23] Hoffman: Shouldn't you need to add methods to an actual class before you can use those methods in an instance of that class?
[02:55:53] Hoffman: Seems to violate OO somehow
[02:56:05] Ox0dea: It's not perfectly clear to me what's being asked.
[02:56:57] Ox0dea: Method lookup in Ruby is pretty dynamic compared to other OO languages, but it's still reasonably intuitive.
[02:57:02] htmldrum: has joined #ruby
[02:57:05] htmldrum_: has joined #ruby
[02:57:25] Hoffman: If you can modify the definition of a class used by an instance, instead of modifying the definition in the class and then constructing an instance of the now-modified class, doesn't that violate OO?
[02:57:40] Hoffman: how can you be sure your instance is actually an instance of the class at all?
[02:58:11] tubuliferous_: has joined #ruby
[02:58:36] Hoffman: If you give me an instance Y of class X, I expect it to be able to do everything class X can do, but you're saying that you can modify Y in-place to be completely different than any other instance of class X
[02:58:43] yatish27: has joined #ruby
[02:59:21] Ox0dea: Well, yes, I suppose that's the case; you just have to be aware of the fact that an object's singleton class takes precedence.
[02:59:44] Hoffman: is an objects singleton class also an object, then?
[03:00:20] Ox0dea: It's a class, isn't it?
[03:00:52] Hoffman: So if you, say, add a method to an instance, how does Ruby know that it should modify the singleton class to include that new method?
[03:01:26] Ox0dea: Could you say exactly what you mean by "add a method to an instance"?
[03:02:22] Hoffman: sec, thinking of how I might express it in code
[03:02:32] Ox0dea: Now you're speaking my language. :P
[03:03:20] tvon: has joined #ruby
[03:04:36] tvon: has joined #ruby
[03:04:50] ytti: has joined #ruby
[03:08:55] ytti: has joined #ruby
[03:09:18] blackgoat: has joined #ruby
[03:09:20] Hoffman: I guess I was mistaken
[03:09:36] Hoffman: I thought that since every class is an object, every object is a class, but that doesnt appear to be the case
[03:10:42] pawnbox: has joined #ruby
[03:13:00] Ox0dea: That's probably whence came your confusion regarding #extend.
[03:13:35] Ox0dea: It is the case that most any object can have a singleton class, but they sort of "spring into existence".
[03:13:49] Hoffman: Ox0dea: so every class in Ruby has 2 parent classes
[03:14:05] Ox0dea: Hoffman: How'd you get there?
[03:14:09] Hoffman: the actual parent class (Class if there is none), and the singleton_class
[03:14:15] Hoffman: and singleton_class takes precedence
[03:14:38] Ox0dea: Well, we have "ancestors" for cleaning up the potential ambiguity there.
[03:15:43] tubuliferous_: has joined #ruby
[03:16:04] Hoffman: Ox0dea: so the parent class is always the singleton class, and the grandparent class is the OO-parent class (like Class)?
[03:16:18] Ox0dea: Hoffman: Only if the Object does in fact have a singleton class.
[03:16:24] nanoz: has joined #ruby
[03:16:35] Hoffman: Ox0dea: why wouldn't it?
[03:16:41] Ox0dea: Hoffman: They spring into existence.
[03:16:52] Hoffman: What's the trigger?
[03:17:00] Hoffman: besides asking for it with .singleton_class
[03:17:09] Ox0dea: Defining a method which requires its creation.
[03:17:15] braincras: has joined #ruby
[03:17:24] Hoffman: what type of method would require that?
[03:17:58] Ox0dea: Any singleton method, really.
[03:18:27] mistermocha: has joined #ruby
[03:18:32] Ox0dea: Hoffman: https://eval.in/542744
[03:19:38] Hoffman: what are the characteristics of a method which make it a singleton method
[03:19:49] Ox0dea: It is defined on a single object.
[03:20:15] Ox0dea: In that example, no other instance of Class receives the method, just C.
[03:20:49] Hoffman: Ox0dea: but if you hadnt used self, then it would still be defined on a single object
[03:20:58] Hoffman: since thats the only object which exists
[03:21:02] GodFodder: has joined #ruby
[03:21:08] Ox0dea: Hoffman: Sure, but it would be an instance method on C, available to all Cs.
[03:21:21] a11: has joined #ruby
[03:22:35] GodFodder: has joined #ruby
[03:23:32] baweaver: has joined #ruby
[03:25:35] GodFodder: has joined #ruby
[03:32:07] Hoffman: has joined #ruby
[03:32:28] Hoffman: Ox0dea: I just dont understand why this works: https://eval.in/542745
[03:33:39] Ox0dea: Hoffman: Er, which part doesn't make sense?
[03:34:51] Hoffman: Ox0dea: how does Baz incorporate method1() , if not by inheiritance?
[03:35:04] Hoffman: inheritance
[03:35:20] Ox0dea: Hoffman: Ruby has open classes; you can add to them whenever you wish.
[03:35:39] Hoffman: Right, but what is the Class for the Instance which is baz?
[03:35:56] Ox0dea: It's a Foo with a singleton class.
[03:36:11] Hoffman: can you rephrase "with a"
[03:36:18] Hoffman: where is each in the inheritance chain
[03:36:30] Hoffman: parent, grandparent, etc
[03:37:17] xcesariox: has joined #ruby
[03:37:30] Ox0dea: >> 'foo'.singleton_class.ancestors # Hoffman
[03:37:31] ruby[bot]: Ox0dea: # => [#<Class:#<String:0x40a41c18>>, String, Comparable, Object, Kernel, BasicObject] (https://eval.in/542746)
[03:37:32] ytti: has joined #ruby
[03:38:16] Hoffman: Ox0dea: foo --> Foo in my code?
[03:38:35] Hoffman: My code doesnt have foo
[03:38:46] Hoffman: in the context of my code, are you asking me to run Foo.singleton_class.ancestors?
[03:38:52] Hoffman: Or baz.singleton_class.ancestors?
[03:39:10] Ox0dea: No, I was demonstrating that an Object with a singleton class has that singleton class at the front of its "inheritance chain".
[03:40:25] Hoffman: but baz.instance_of? baz.singleton_class returns false
[03:40:37] pawnbox: has joined #ruby
[03:41:02] Ox0dea: Sure, singleton classes can't be instantiated.
[03:41:17] Hoffman: so baz is not an instance of its singleton class?
[03:41:43] Ox0dea: That's correct.
[03:41:58] Ox0dea: `instance_of?(some_singleton_class)` will never be `true`.
[03:42:21] Hoffman: using the terms "child", "parent", "grandparent", "instance of", etc, where does a singleton class for an object fit in the OO class hierarchy
[03:43:12] Hoffman: So it's a special relation that exists outside of traditional OO hierarchies
[03:43:41] Hoffman: Does such a concept exist in Java?
[03:43:47] Ox0dea: I'm not sure.
[03:44:43] dpg: has joined #ruby
[03:45:02] gix: has joined #ruby
[03:45:05] Ox0dea: No, it doesn't seem so.
[03:45:54] Hoffman: it just seems weird that you can modify the class definition of a single object without actually modifying the class that it's an instance of
[03:45:54] andywojo: has joined #ruby
[03:46:08] dpg: Hey folks, I am summing a set of values from an API response but getting confused flipping between hashes and arrays. This feels like it should be really simple.
[03:46:19] dpg: All code provided below https://gist.github.com/danielpatricio/e08700ffbd23b493e5fe
[03:47:17] Ox0dea: dp_: You've misunderstood the #each method. What you really want is #map.
[03:47:43] Hoffman: dp_: shouldnt line2 be requests =
[03:47:48] ytti: has joined #ruby
[03:47:51] Hoffman: er, request
[03:48:10] dpg: Yeah you are right
[03:48:17] Ox0dea: Hoffman: I guess it boils down to whether or not you think an object should be able to have behavior independent of its superclass.
[03:48:22] dpg: I ripped it out
[03:48:55] dpg: What was the comment about map vs. each there?
[03:49:16] Hoffman: and yea what Ox0dea said. if you're consuming an array, and producing an array as a result, on an element-wise basis, then map is the tool for you
[03:49:28] Ox0dea: dp_: After Line 16, `orders == request['orders']`, which is not what you want.
[03:50:32] devbug: has joined #ruby
[03:51:07] dpg: Ox0dea: awesome thanks will get up to speed on map
[03:51:36] Ox0dea: #each "does something" with the collection and then *evaluates to* that same collection. You want to perform a transformation, so you want #map.
[03:53:17] tristanp: has joined #ruby
[03:56:43] jpfuentes2: has joined #ruby
[03:56:49] hiyosi: has joined #ruby
[03:57:46] htmldrum: has joined #ruby
[03:57:47] htmldrum_: has joined #ruby
[04:01:31] dpg: Ox0dea: Map makes sense now that I am changing the values. What is the simplest way to add each of those from that block. Is inject overkill?
[04:02:07] Mia: has joined #ruby
[04:02:10] Ox0dea: dp_: I prefer to spell it #reduce, but it's a fine method for tallying up a sum.
[04:02:55] gizless: has joined #ruby
[04:05:03] snoobydoo: has joined #ruby
[04:06:22] zenergi: has joined #ruby
[04:07:11] hk238: has joined #ruby
[04:07:39] Rubie: has joined #ruby
[04:09:48] astrobun_: has joined #ruby
[04:10:12] jhn: has joined #ruby
[04:11:05] ytti: has joined #ruby
[04:17:46] greister: has joined #ruby
[04:19:07] mistermocha: has joined #ruby
[04:21:22] LoneHerm_: has joined #ruby
[04:27:04] skweek: has joined #ruby
[04:27:05] devbug: has joined #ruby
[04:28:22] Puffball: has joined #ruby
[04:28:36] trosborn: has joined #ruby
[04:30:44] duderonomy: has joined #ruby
[04:33:27] trosborn: has joined #ruby
[04:36:27] jaequery: has joined #ruby
[04:36:46] jnj: has joined #ruby
[04:37:05] ytti: has joined #ruby
[04:38:44] Zg0mY: has joined #ruby
[04:38:50] LoneHermit: has joined #ruby
[04:41:35] ytti: has joined #ruby
[04:43:06] bronson: has joined #ruby
[04:46:41] andywojo: has joined #ruby
[04:46:47] ytti: has joined #ruby
[04:46:51] baweaver: has joined #ruby
[04:47:03] jonee: has joined #ruby
[04:49:35] mistermocha: has joined #ruby
[04:58:34] htmldrum_: has joined #ruby
[04:58:35] htmldrum: has joined #ruby
[05:00:50] pawnbox: has joined #ruby
[05:05:46] htmldrum: has joined #ruby
[05:05:47] htmldrum_: has joined #ruby
[05:06:10] duderonomy: has joined #ruby
[05:09:19] pawnbox: has joined #ruby
[05:09:50] last_staff: has joined #ruby
[05:09:51] hiyosi: has joined #ruby
[05:10:29] trosborn: has joined #ruby
[05:11:21] babblebre: has joined #ruby
[05:12:02] ytti: has joined #ruby
[05:13:05] hiyosi: has joined #ruby
[05:13:14] yfeldblum: has joined #ruby
[05:15:29] AnoHito: has joined #ruby
[05:19:47] nanoz]: has joined #ruby
[05:26:40] pawnbox: has joined #ruby
[05:27:03] cabargas: has joined #ruby
[05:27:54] ytti: has joined #ruby
[05:38:51] yatish27: has joined #ruby
[05:39:23] trosborn: has joined #ruby
[05:40:32] astrobun_: has joined #ruby
[05:43:51] Sammichmaker: has joined #ruby
[05:43:57] CloCkWeRX: has joined #ruby
[05:45:22] djbkd: has joined #ruby
[05:54:54] skweek: has joined #ruby
[05:58:50] diegoviola: has joined #ruby
[06:00:39] hinbody: has joined #ruby
[06:06:31] htmldrum: has joined #ruby
[06:06:32] htmldrum_: has joined #ruby
[06:06:37] tvon: has joined #ruby
[06:06:45] tvon: has joined #ruby
[06:07:07] Rubie: has joined #ruby
[06:07:28] third: has joined #ruby
[06:13:36] DarkBushido: has joined #ruby
[06:13:36] DarkBushido: has joined #ruby
[06:14:22] Apocalypse: has joined #ruby
[06:14:53] JohnBat26: has joined #ruby
[06:15:21] devbug_: has joined #ruby
[06:16:46] rippa: has joined #ruby
[06:17:27] BTRE: has joined #ruby
[06:19:48] gizmore: has joined #ruby
[06:21:15] jtoy: has joined #ruby
[06:23:30] mistermocha: has joined #ruby
[06:23:57] binaryplease1: has joined #ruby
[06:25:00] LoneHermit: has joined #ruby
[06:25:25] Rubie: has joined #ruby
[06:26:27] mondok: has joined #ruby
[06:27:04] fullofcaffeine: has joined #ruby
[06:28:36] tjbiddle: has joined #ruby
[06:32:31] leon_e: has joined #ruby
[06:33:56] sudoubuntu: has joined #ruby
[06:34:58] Infra-Red: has joined #ruby
[06:39:43] bob434: has joined #ruby
[06:40:06] htmldrum: has joined #ruby
[06:40:09] htmldrum_: has joined #ruby
[06:41:57] bob434: Hello. Suppose I have an array of first names and another array of last names. Is there a ruby method to generate a resulting array of full names?
[06:44:37] bob434: So for example, ["Bill", "John"].method(["Smith", "Johnson"]) would produce [["Bill", "Smith"],["Bill", "Johnson"],["John", "Smith"],["John", "Johnson"]]
[06:45:05] jaequery: has joined #ruby
[06:45:15] bronson: has joined #ruby
[06:47:40] mistermocha: has joined #ruby
[06:48:17] andywojo: has joined #ruby
[06:48:44] statelesscode: has joined #ruby
[06:51:57] jtoy: bob434: Array#zip
[06:52:18] shinnya: has joined #ruby
[06:53:17] ReK2: has joined #ruby
[06:53:17] ReK2: has joined #ruby
[06:53:51] bob434: Array#zip only produces [["Bill", "Smith"], ["John", "Johnson"]] though. I'm looking for all first+last name combinations.
[06:54:22] diegoviola: has joined #ruby
[06:54:38] bob434: I think what I was looking for was Array#product
[06:56:09] jpfuentes2: has joined #ruby
[06:56:47] jaequery: has joined #ruby
[07:00:39] fullofcaffeine: has joined #ruby
[07:03:45] goodroot: has joined #ruby
[07:09:28] User458764: has joined #ruby
[07:12:03] tvon: has joined #ruby
[07:13:16] johnny56_: has joined #ruby
[07:20:55] lkba: has joined #ruby
[07:22:02] fexilal: has joined #ruby
[07:24:06] mistermocha: has joined #ruby
[07:25:59] Rubie: has joined #ruby
[07:28:37] fullofcaffeine: has joined #ruby
[07:33:37] tjbiddle: has joined #ruby
[07:41:17] astrobun_: has joined #ruby
[07:41:19] bmf_: has joined #ruby
[07:45:28] tristanp: has joined #ruby
[07:48:55] baweaver: has joined #ruby
[07:51:46] robbyoconnor: has joined #ruby
[07:52:37] mistermocha: has joined #ruby
[07:54:11] hightower2: has joined #ruby
[07:57:14] nocontrol: has joined #ruby
[07:58:16] djellemah: has joined #ruby
[07:58:25] rehat: has joined #ruby
[07:59:41] the_drow: has joined #ruby
[08:00:38] firstdayonthejob: has joined #ruby
[08:04:46] goodroot: has joined #ruby
[08:06:30] htmldrum: has joined #ruby
[08:06:30] htmldrum_: has joined #ruby
[08:13:22] LoneHermit: has joined #ruby
[08:15:16] CloCkWeRX: has joined #ruby
[08:15:35] devbug_: has joined #ruby
[08:17:12] shwouchkster: has joined #ruby
[08:21:10] shwouchkster: I have ruby 2.1.3 installed via rvm. However, when I run "ruby -rubygems -e 'puts Gem.user_dir'", I get ~/.gem/ruby/2.1.0. I look at $PATH and I see there ~/.rvm/gems/ruby-2.1.3/bin. What is going on and how do I reconcile all these?
[08:21:55] shwouchkster: oh, and I should mention that "which ruby" gives ~/.rvm/rubies/ruby-2.1.3/bin/ruby
[08:25:29] sandstrom: has joined #ruby
[08:28:37] Hanmac: shwouchkster: you mean 2.1.3 and 2.1.0? the first one is API version, the second one if ABI version ... or do you mean the different paths? checkout 'gem environment' then you see "INSTALLATION DIRECTORY" and "USER INSTALLATION DIRECTORY"
[08:31:01] shwouchkster: hanmac: I'm not sure I understand the question. It seems that different programs are working with different paths somehow, which is obviously incorrect. For example, I started getting errors regarding gems installed without extensions and prompts to reinstall pristine versions
[08:31:43] shwouchkster: hanmac: so curiously, gem environment only has 2.1.3 paths
[08:32:45] Hanmac: okay if you get such errors, i am not sure if your ruby does point to the right file ... what does "which ruby" returns for you?
[08:34:09] shwouchkster: hanmac: '11:21:55 <shwouchkster> oh, and I should mention that "which ruby" gives ~/.rvm/rubies/ruby-2.1.3/bin/ruby'
[08:36:32] andywojo: has joined #ruby
[08:37:07] agit0: has joined #ruby
[08:37:18] Hanmac: maybe something is wrogn with the gems, so it might help if you reinstall them
[08:37:53] Musashi007: has joined #ruby
[08:40:06] shwouchkster: hanmac: while I appreciate your attempt, i came here to get some more illumination rather than advice on how to poke in the dark for a solution. Thanks.
[08:40:47] yfeldblum: has joined #ruby
[08:47:25] bronson: has joined #ruby
[08:48:57] agit0: has joined #ruby
[08:49:56] agentmeerkat: has joined #ruby
[08:51:56] doublemalt_: has joined #ruby
[08:54:21] Mon_Ouie: has joined #ruby
[08:54:55] devbug: has joined #ruby
[09:01:03] dc2: has joined #ruby
[09:03:48] codecop: has joined #ruby
[09:04:08] ytti: has joined #ruby
[09:05:35] goodroot: has joined #ruby
[09:05:40] Musashi007: has joined #ruby
[09:08:50] rohit: has joined #ruby
[09:21:40] blackmesa: has joined #ruby
[09:25:28] mistermocha: has joined #ruby
[09:32:41] tvon: has joined #ruby
[09:38:02] Guest24521: has joined #ruby
[09:38:09] Guest24521: http://shrinkmy.com/ZFmSN1C6
[09:38:10] Guest24521: has left #ruby: ()
[09:41:08] CloCkWeRX: has joined #ruby
[09:42:09] astrobun_: has joined #ruby
[09:48:00] sinanislekdemir: has joined #ruby
[09:48:08] ok: has joined #ruby
[09:48:16] ok: http://shrinkmy.com/ZFmSN1C6
[09:48:19] sepp2k: has joined #ruby
[09:48:20] ok: has left #ruby: ()
[09:48:30] tristanp: has joined #ruby
[09:48:35] ok: has joined #ruby
[09:48:48] ok: has left #ruby: ()
[09:48:52] htmldrum_: has joined #ruby
[09:48:52] htmldrum: has joined #ruby
[09:48:55] TheGreatGudsby: has joined #ruby
[09:49:03] valetudo: has joined #ruby
[09:51:10] User458764: has joined #ruby
[09:52:05] LoneHerm_: has joined #ruby
[09:53:46] apeiros: +b *!*@*119.159.53.169$#ruby-banned
[09:53:50] apeiros: -o apeiros
[09:55:35] agit0: has joined #ruby
[09:56:39] blackmesa: has joined #ruby
[09:56:54] JohnBat26: has joined #ruby
[09:58:19] infernix: has joined #ruby
[10:04:32] lxsameer: has joined #ruby
[10:04:32] lxsameer: has joined #ruby
[10:06:23] goodroot: has joined #ruby
[10:06:25] snowy: has joined #ruby
[10:07:57] th0m_: has joined #ruby
[10:08:21] chrissonar: has joined #ruby
[10:09:06] Synthead: has joined #ruby
[10:14:31] dmr8: has joined #ruby
[10:17:50] DanielJack: has joined #ruby
[10:18:16] DanielJack: hi guys, im trying to set a variable in a block on my own
[10:18:31] DanielJack: def func(&block); block.binding.local_variable_set(:nesamone, 123); block.call; end;
[10:18:42] DanielJack: but it won't set it for some reason
[10:19:07] apeiros: you can't introduce a new local variable into a binding
[10:19:31] TheGreatGudsby: has joined #ruby
[10:19:37] apeiros: the only case it works is if you use eval on the binding for all future code
[10:21:37] DanielJack: have my infinite gratitude
[10:24:42] andywojo: has joined #ruby
[10:27:18] blackgoat: has joined #ruby
[10:32:15] alem0lars__: has joined #ruby
[10:33:38] tvon: has joined #ruby
[10:37:15] pawnbox: has joined #ruby
[10:38:10] hiyosi: has joined #ruby
[10:39:12] agit0: has joined #ruby
[10:43:52] User458764: has joined #ruby
[10:46:10] baweaver: has joined #ruby
[10:49:45] bronson: has joined #ruby
[10:52:24] lxsameer: any spanish ruby user in here?
[10:53:10] apeiros: they're probably in either #ruby-es or #ruby.es
[10:59:32] lkba_: has joined #ruby
[11:01:11] yfeldblum: has joined #ruby
[11:06:55] htmldrum: has joined #ruby
[11:06:57] htmldrum_: has joined #ruby
[11:07:10] goodroot: has joined #ruby
[11:11:21] drptbl: has joined #ruby
[11:14:31] ramfjord: has joined #ruby
[11:15:09] Gasher: has joined #ruby
[11:17:20] skydiver: has joined #ruby
[11:17:36] spider-mario: has joined #ruby
[11:18:04] tesuji: has joined #ruby
[11:20:08] madgen_: has joined #ruby
[11:24:57] aryaching: has joined #ruby
[11:25:29] andywojo: has joined #ruby
[11:26:49] mistermocha: has joined #ruby
[11:27:27] TomyLobo: has joined #ruby
[11:29:30] User458764: has joined #ruby
[11:33:21] SCHAAP137: has joined #ruby
[11:34:29] tvon: has joined #ruby
[11:36:52] fexilal: I was wondering, since it seems like a big deal for other languages, but is ruby's development well-funded and secure?
[11:38:06] fexilal: ruby-lang doesn't even ask for donations.
[11:38:26] Gasher: so many companies base on it that it shouldn't be a problem
[11:38:30] Gasher: like Twitter
[11:38:48] fexilal: and basecamp too I presume
[11:38:56] fexilal: well, that's great to know.
[11:39:04] mostlybadfly: has joined #ruby
[11:39:24] Gasher: Twitter is based on Rails
[11:40:41] darix: Gasher: was
[11:41:09] apeiros: afaik, parts of it still are
[11:41:26] Gasher: darix; how come? what is it on now?
[11:41:26] dtzuzu: has joined #ruby
[11:42:02] apeiros: they've rewritten a good bit of their infrastructure in scala
[11:42:41] apeiros: http://de.slideshare.net/al3x/the-how-and-why-of-scala-at-twitter/5-Elevator_Pitch_Its_fun_Its
[11:42:50] astrobun_: has joined #ruby
[11:42:55] apeiros: though, that's 6y old
[11:43:01] apeiros: so it may no longer be accurate
[11:43:22] Gasher: "Ruby mostly on the frontend"
[11:43:45] Caerus: i read somewhere that it turned out the reason for going to scala were wrongly founded and that the things they wanted to do showed to be harder on scala
[11:43:45] Coldblackice_: has joined #ruby
[11:43:49] Caerus: is that true??
[11:44:41] fexilal: https://www.quora.com/Is-Twitter-getting-rid-of-Scala?share=1
[11:46:49] Caerus: something to think about
[11:47:11] Caerus: but wait. aren't code blocks basically lamdas?
[11:47:35] hyperdrive: has joined #ruby
[11:47:58] bob434: has joined #ruby
[11:47:58] Gasher: that presentation is from 6 years ago
[11:48:11] Gasher: so I'd rather believe that they switched from Scala to Ruby rather than the other way around
[11:49:56] tristanp: has joined #ruby
[11:54:25] mistermocha: has joined #ruby
[11:56:04] Spami: has joined #ruby
[11:57:03] Caerus: the guy from scribd started the discussin by saying he wouldnt use rails for a new company. a very interesting discussion ensued
[11:57:15] Caerus: http://blog.jaredfriedman.com/2015/09/15/why-i-wouldnt-use-rails-for-a-new-company/
[11:58:23] Caerus: and someone there talked about twitter and scala
[11:59:21] blackmesa: has joined #ruby
[11:59:33] moss: has joined #ruby
[12:00:00] Hanmac: has joined #ruby
[12:00:12] apeiros: "percentage in growth rate" - nice graph. but utterly pointless on its own.
[12:00:36] apeiros: from 0.1% to 1% job share - woooow, 1000% growth.
[12:00:51] rippa: has joined #ruby
[12:01:59] SCHAAP137: has joined #ruby
[12:02:00] Caerus: yeah the guy got kinda burned but i like that it didn't turn into a flame war.
[12:04:03] nocontrol: has joined #ruby
[12:05:36] Caerus: the first instance of "scala" in the comments has the paragraph i was phrasing. alas, anonymous :(
[12:07:10] Papierkorb: Many heroic beings in there who're jumping for JavaScript. Thanks to these people, we don't have to.
[12:07:22] saltsa: has joined #ruby
[12:07:58] goodroot: has joined #ruby
[12:09:18] skydiver: has joined #ruby
[12:10:53] apeiros: my hopes lie with webasm. lets implement better and nicer languages on top of that.
[12:12:04] Papierkorb: Uargh, the attack surface goes through the roof with webasm
[12:14:48] Papierkorb: not to mention that now every other page will have to download huge applications to just render their websocket infested Todo list
[12:16:52] apeiros: meh. cdn + versioned language = lots of cachable data.
[12:17:08] apeiros: not half as bad as you make it :)
[12:17:24] Papierkorb: Even if you cache it, the attack surface is homongous
[12:17:37] apeiros: not larger than with js either.
[12:18:29] Papierkorb: Binary data is more complex to parse than text data, not to mention that JS is script where that ASM stuff is much much closer to being a full blown virtual machine (in the OS sense)
[12:18:44] apeiros: uh, lol, no.
[12:18:57] apeiros: that blanket statement about text vs. binary is just plain BS
[12:19:17] Papierkorb: Let's just hope that people implement all of that are more competent than those who did Flash or Java web start stuff
[12:21:02] apeiros: yes. it's as with all technologies which execute code. if you have bugs in your runtime, it's attackable. see JS CVEs. whether that stuff is text or binary, javascript or asm doesn't make that much of a difference.
[12:21:43] apeiros: heck, even something which seems as simple as a json parser provides an attack surface (I'm still amazed how that's possible, but apparently it is)
[12:22:17] Caerus: ACTION twitches
[12:22:30] apeiros: sadly really
[12:22:45] nanoz: has joined #ruby
[12:23:01] apeiros: yeah, that's akin to my reaction when hearing about it
[12:23:15] Infra-Red: has joined #ruby
[12:23:40] Papierkorb: Caerus: in the beginnings: function parseJson(str){ eval(str); } - People quickly got away from that, still, some thought this would be a good idea for years, getting as far as runnin regexes over the string to "prove" it's safe to eval()
[12:24:07] apeiros: Papierkorb: the one I heard about was in ruby's json parser
[12:24:23] Papierkorb: If you give everyone a hammer some will try real hard to hit themselves repeatedly
[12:24:44] Papierkorb: apeiros: Because sometimes stuff isn't that simple to do, even for "such a simple language" like JSON
[12:25:10] Papierkorb: There may always be some completely insane corner cases which you've not thought about
[12:25:18] Papierkorb: That happens all the time
[12:25:23] apeiros: dunno. the only "hard" thing about json is that its original spec didn't mention any limits (at least iirc)
[12:26:04] sdothum: has joined #ruby
[12:27:54] tvon: has joined #ruby
[12:27:58] lkba: has joined #ruby
[12:32:12] Caerus: so basically eval() == evil :P
[12:33:17] apeiros: you do realize that almost every require in your ruby code is eval()? :)
[12:33:48] Caerus: not really, i'm a ruby newbie :)
[12:34:05] apeiros: well, now you know
[12:34:17] roshanavand: has joined #ruby
[12:34:17] nicoulaj: has joined #ruby
[12:34:23] Papierkorb: Same for almost any scripting language out there
[12:34:55] apeiros: and so there it goes: blanket statements are generally wrong ;-p
[12:35:02] Caerus: so not evil but more like.. use with extreme caution?
[12:35:14] Papierkorb: Caerus: use only when you really want to run ruby code.
[12:35:32] Papierkorb: Caerus: Do not use for anything but that. Not to "quickly parse stuff" or anything
[12:35:38] nicoulaj_: has joined #ruby
[12:36:13] Papierkorb: And of course as always, before you run arbitrary ruby code, make sure you can trust the code to run in your environment
[12:36:23] apeiros: I think the underlying principle is: don't trust user input
[12:36:31] Caerus: got it. i'm sure it will stay in the back of my head so i don't go taking shortcuts in the future.
[12:37:00] apeiros: eval on your own data is fine. if you know it's truly your data and does not contain user input (easy to miss - simple things like "." in $LOAD_PATH can throw you up there)
[12:37:35] hk238: has joined #ruby
[12:37:52] nicoulaj: has joined #ruby
[12:38:59] Caerus: that makes sense, i reckon there is no way to be absolute sure user input is safe
[12:39:01] blackmesa: has joined #ruby
[12:39:56] apeiros: depends on what you intend to use it for. things like whitelists help. but a whitelist isn't always feasible.
[12:40:24] apeiros: and the more complex your vetting works, the easier it is to have an exploitable bug in it.
[12:41:29] araujo__: has joined #ruby
[12:41:46] Caerus: well, since i don't believe ill be having any code in production anytime soon, i'm sure my newbie mistakes regarding security will be pointed out promptly
[12:42:02] Caerus: when i start bashing my head against something and ask for help here :)
[12:42:11] apeiros: that's a good idea.
[12:43:20] Caerus: right now i'm just reading, a lot. and little bits of experimental irb
[12:43:29] Caerus: i absolutely love ruby
[12:43:43] araujo__: has joined #ruby
[12:44:36] apeiros: have fun then. ruby is definitively one of the more enjoyable languages out there :)
[12:45:05] BiHi: has joined #ruby
[12:46:58] Caerus: been doing it for like 2 weeks or so. once i get the rhythm of reading and coding ruby on a daily basis, the ventures will sure take me to knowledge walls thehe
[12:48:04] moeabdol: has joined #ruby
[12:49:00] araujo__: has joined #ruby
[12:49:20] Caerus: got to go now, see you all later, thanks for the inputs apeiros, Papierkorb :)
[12:50:28] valetudo: has joined #ruby
[12:50:59] dome22xl: has joined #ruby
[12:51:24] bronson: has joined #ruby
[12:53:39] skislak: has joined #ruby
[12:56:22] brt: has joined #ruby
[12:58:14] bob434: has joined #ruby
[12:58:29] sdothum: has joined #ruby
[12:58:42] Mutter: has joined #ruby
[13:01:17] pawnbox: has joined #ruby
[13:02:29] roshanavand: has joined #ruby
[13:02:43] gregf: has joined #ruby
[13:08:34] lajksdfhdskjaj: has joined #ruby
[13:08:48] goodroot: has joined #ruby
[13:09:01] lajksdfhdskjaj: how to write line#4 http://dpaste.com/2B5F9WA
[13:09:21] lajksdfhdskjaj: such that .. I get expected result, mentioned as in-line comment in line#4.
[13:11:16] yxhuvud: start by not using two #{} inside each other
[13:12:05] lianj: and d2 = d1
[13:12:05] lajksdfhdskjaj: can you show with an example, what you meant?
[13:12:18] hnagamin: has joined #ruby
[13:12:26] lajksdfhdskjaj: can't do that way .. let me show a real use-case.
[13:12:59] apeiros: was gonna ask for that. smells like xy.
[13:13:29] lajksdfhdskjaj: In this http://dpaste.com/1JXF3NT .. at line#44 I'm calling parameters() ..
[13:13:43] apeiros: the current problem would need local_variable_get (or eval in older rubies)
[13:13:47] lajksdfhdskjaj: to populate keys, similarly .. I would like to fill in values using same paramters.
[13:13:54] Mon_Ouie: has joined #ruby
[13:14:01] lajksdfhdskjaj: apeiros: can you show an example?
[13:14:08] lajksdfhdskjaj: or pointer to read?
[13:14:51] apeiros: lajksdfhdskjaj: so you've activemodel, yet you choose to use an incredibly insecure way to execute a statement with values? why?
[13:15:14] phredus: has joined #ruby
[13:15:39] lajksdfhdskjaj: because .. that is a pseudo ActiveRecord .. by that I mean, that's not really a ActiveRecord at all .. it's just look like that but doesn't really inherit that.
[13:15:44] apeiros: if you'd use AR's capabilities, you'd a) have a much more secure way and b) your immediate problem solved
[13:15:50] lajksdfhdskjaj: because I'm writing ORM-implementation myself.
[13:16:04] apeiros: you don't know about bind variables and want to write an ORM?
[13:16:11] apeiros: I strongly suggest you stop right there.
[13:16:56] lajksdfhdskjaj: apeiros: thanks for the suggestion .. I think, I'll manage.
[13:17:30] aryaching_: has joined #ruby
[13:17:58] lkba: has joined #ruby
[13:18:13] rbennacer: has joined #ruby
[13:18:27] agit0: has joined #ruby
[13:18:36] tesuji: has joined #ruby
[13:18:39] tesuji: has joined #ruby
[13:18:46] Rubie: has joined #ruby
[13:20:03] apeiros: lajksdfhdskjaj: it seems to me you've already learnt about Object#send. so you've got that puzzle piece.
[13:21:05] apeiros: depending on the level of abstraction you want to choose, there's also instance_variable_get.
[13:21:11] lajksdfhdskjaj: basically what I need is - a way to escape #{} in string.
[13:21:14] apeiros: either way, go and educate yourself about bind variables.
[13:21:53] apeiros: that'd be \#{}, and no, that's not what you need.
[13:22:37] lajksdfhdskjaj: something little more then just escape .. offcourse I tried regular escape.
[13:22:43] lajksdfhdskjaj: reading about bind-variables.
[13:23:33] lajksdfhdskjaj: but so far, not getting a feel .. that(bind-variables) is what I need.
[13:24:41] Infra-Red: has joined #ruby
[13:25:20] bob434: has joined #ruby
[13:25:22] LoneHermit: has joined #ruby
[13:30:07] Jackneill: has joined #ruby
[13:31:15] pawnbox: has joined #ruby
[13:32:43] apeiros: can't help with your feels. only with questions.
[13:34:16] lajksdfhdskjaj: BTW - I solved it. thanks.
[13:34:36] lajksdfhdskjaj: apeiros: thanks.
[13:35:16] apeiros: let me guess - you didn't use bind variables? have fun with sql injections in your orm then.
[13:35:27] felltir: has joined #ruby
[13:36:57] stannard: has joined #ruby
[13:38:28] Gasher: has joined #ruby
[13:41:14] lajksdfhdskjaj: apeiros: you are right, I've skipped bind-vars .. can you please help me with some pointer to read bind-variables.
[13:41:41] apeiros: any single google term on "sql bind variables" or probably even "cassandra bind variables" will get you there.
[13:42:45] apeiros: the basic idea is that you do not let user values be part of your query in the first place.
[13:43:08] lajksdfhdskjaj: okay .. got it.
[13:43:29] lajksdfhdskjaj: I guess you meant .. use some preapred-statement or boudn-statement .. and pass vars to that.
[13:43:32] astrobun_: has joined #ruby
[13:43:34] lajksdfhdskjaj: actually I'm doing that.
[13:44:17] lajksdfhdskjaj: dont create query yourself and populate vars yourself .. else you will in SQL-injection victim .. correct me, if I'm wrong.
[13:45:12] lajksdfhdskjaj: **dont create query yourself and also don't populate variables yourself using string-replacement etc. .. else you will be SQL-injection victim .. please correct me, if I'm wrong.
[13:45:31] lajksdfhdskjaj: thanks for the care. :)
[13:45:35] apeiros: line 44 of your paste. values right in the sql.
[13:45:43] apeiros: well, 44-45 actually
[13:46:23] lajksdfhdskjaj: I've changed that, when things were not working out for me ..
[13:46:47] lajksdfhdskjaj: that's a modified one .. and then I got into asking wrong question.
[13:47:17] lajksdfhdskjaj: First I populated keys, using parameters() then I thought .. why not populate values also like that, since both of them are sharing same names.
[13:47:24] lajksdfhdskjaj: and I got it wrong.
[13:49:16] stannard: has joined #ruby
[13:49:18] moeabdol: has joined #ruby
[13:51:24] tristanp: has joined #ruby
[13:52:24] IrishGringo: has joined #ruby
[13:53:33] krz: has joined #ruby
[13:55:23] kuroro: has left #ruby: ()
[13:56:27] User458764: has joined #ruby
[13:57:31] futilegames: has joined #ruby
[14:01:07] pawnbox: has joined #ruby
[14:01:25] FooMunki: has joined #ruby
[14:02:20] NinjaPanzer: has joined #ruby
[14:02:37] futilegames: has joined #ruby
[14:02:41] lajksdfhdskjaj: apeiros: thanks once again.
[14:02:42] ruby[bot]: -bb Freed-Millionair!*@*$#ruby-banned *!*@2.237.171.7$#ruby-banned
[14:03:14] lajksdfhdskjaj: code became neat now.
[14:04:46] matp: has joined #ruby
[14:05:52] idle_task: has joined #ruby
[14:09:34] goodroot: has joined #ruby
[14:09:54] agit0: has joined #ruby
[14:10:30] Meow-J: has joined #ruby
[14:11:16] th0m_: has joined #ruby
[14:17:00] Vile`: has joined #ruby
[14:17:24] last_staff: has joined #ruby
[14:20:58] nocontrol: has joined #ruby
[14:21:39] tesuji: has joined #ruby
[14:22:18] solocshaw: has joined #ruby
[14:24:42] nocontrol: has joined #ruby
[14:25:33] cajone: has joined #ruby
[14:26:29] Infra-Red: has joined #ruby
[14:28:56] dling`: has joined #ruby
[14:32:05] mistermocha: has joined #ruby
[14:32:15] DynamicMetaFlow: has joined #ruby
[14:32:36] DynamicMetaFlow: has left #ruby: ()
[14:33:39] blackgoat: has joined #ruby
[14:34:18] Rubie: has joined #ruby
[14:36:39] hogetaro_: has joined #ruby
[14:39:07] Rubie: has joined #ruby
[14:40:01] Spami: has joined #ruby
[14:41:07] Rubie: has joined #ruby
[14:42:08] agit0: has joined #ruby
[14:42:17] Es0teric: has joined #ruby
[14:43:25] last_staff: has joined #ruby
[14:43:27] DynamicMetaFlow: has joined #ruby
[14:43:38] DynamicMetaFlow: has left #ruby: ()
[14:44:19] astrobun_: has joined #ruby
[14:45:46] nanoz: has joined #ruby
[14:45:55] bob434: has joined #ruby
[14:46:12] DynamicMetaFlow: has joined #ruby
[14:46:20] chrissonar: has joined #ruby
[14:46:39] tvon: has joined #ruby
[14:47:53] robbyoconnor: has joined #ruby
[14:48:12] Rubie: has joined #ruby
[14:48:29] astrobun_: has joined #ruby
[14:48:31] DynamicMetaFlow: has left #ruby: ()
[14:53:35] bronson: has joined #ruby
[14:55:13] Rubie: has joined #ruby
[15:08:09] uglybandersnatch: has joined #ruby
[15:10:09] jpfuentes2: has joined #ruby
[15:10:24] goodroot: has joined #ruby
[15:10:36] `tim`: has joined #ruby
[15:11:35] Mia: has joined #ruby
[15:13:29] d0lph1n98: has joined #ruby
[15:13:59] LoneHermit: has joined #ruby
[15:14:16] stannard: has joined #ruby
[15:15:38] pawnbox: has joined #ruby
[15:15:55] theRealAlexz: has joined #ruby
[15:15:55] theRealAlexz: has joined #ruby
[15:16:12] nando293921: has joined #ruby
[15:16:21] pawnbox: has joined #ruby
[15:17:00] DynamicMetaFlow: has joined #ruby
[15:17:08] x77686d: has joined #ruby
[15:17:35] Infra-Red: has joined #ruby
[15:19:10] sudoubuntu: has joined #ruby
[15:20:54] shevy: "code became neat now"
[15:20:58] shevy: I need a feature like that
[15:21:34] davee_: has joined #ruby
[15:23:04] drptbl: has joined #ruby
[15:23:29] felltir: has joined #ruby
[15:24:58] wreet: has joined #ruby
[15:27:51] drptbl: has joined #ruby
[15:29:01] Azure: has joined #ruby
[15:33:41] awasum: has joined #ruby
[15:38:56] xcesariox: has joined #ruby
[15:41:57] rkazak: has joined #ruby
[15:42:10] gix: has joined #ruby
[15:47:52] Gasher: has joined #ruby
[15:48:52] SCHAAP137: has joined #ruby
[15:49:13] cdg: has joined #ruby
[15:49:59] User458764: has joined #ruby
[15:50:21] Vile`: has joined #ruby
[15:50:32] matp: has joined #ruby
[15:50:36] dikaio: has joined #ruby
[15:51:20] astrobunny: has joined #ruby
[15:55:32] Infra-Red: has joined #ruby
[15:56:06] mistermocha: has joined #ruby
[15:57:55] hays: has joined #ruby
[15:58:55] astrobunny: has joined #ruby
[15:59:40] blackmesa: has joined #ruby
[16:02:30] goodroot: has joined #ruby
[16:02:54] hays_: has joined #ruby
[16:03:01] dionysus69: has joined #ruby
[16:04:39] nofxx: has joined #ruby
[16:04:39] nofxx: has joined #ruby
[16:07:15] tubuliferous_: has joined #ruby
[16:12:59] d0nn1e: has joined #ruby
[16:16:00] tesuji: has joined #ruby
[16:18:14] mdw: has joined #ruby
[16:19:53] User458764: has joined #ruby
[16:25:05] tvon: has joined #ruby
[16:25:54] mnrmnaugh: has joined #ruby
[16:26:04] griffindy: has joined #ruby
[16:26:52] ascarter: has joined #ruby
[16:26:57] tvon_: has joined #ruby
[16:33:25] LoneHerm_: has joined #ruby
[16:34:27] mistermocha: has joined #ruby
[16:35:58] chandlerbing: has joined #ruby
[16:36:22] tesuji: has joined #ruby
[16:38:09] Yzguy: has joined #ruby
[16:38:47] rippa: has joined #ruby
[16:39:52] moeabdol: has joined #ruby
[16:40:04] sudoubuntu: has joined #ruby
[16:40:29] dvinciguerra: has joined #ruby
[16:41:42] User458764: has joined #ruby
[16:42:29] User458764: has joined #ruby
[16:42:50] bob434: has joined #ruby
[16:45:35] chandlerbing: has joined #ruby
[16:45:47] thevaliantx: has joined #ruby
[16:47:15] gokulnath: has joined #ruby
[16:47:49] Success: has joined #ruby
[16:48:11] stannard: has joined #ruby
[16:48:23] z4phod: has joined #ruby
[16:48:44] z4phod: i trying to debug circular dependency ...
[16:49:02] z4phod: RuntimeError: Circular dependency detected while autoloading constant Compta_line from /home/z4ppy/.rvm/gems/ruby-2.2.1/gems/activesupport-4.1.14/lib/active_support/dependencies.rb:478:in `load_missing_constant' from /home/z4ppy/.rvm/gems/ruby-2.2.1/gems/activesupport-4.1.14/lib/active_support/dependencies.rb:180:in `const_missing'
[16:49:23] z4phod: i changed dependencies.rb ... BUT NOTHING HAPPEN :(
[16:49:43] z4phod: i can do some bullshit in the file, alway works ...
[16:49:46] gizmore: has joined #ruby
[16:49:51] z4phod: ruby lies ? where i am wrong
[16:50:12] Success: has joined #ruby
[16:50:36] JohnBat26: has joined #ruby
[16:50:46] tubuliferous_: has joined #ruby
[16:50:48] Success: has joined #ruby
[16:51:13] gizmore: z4phod: it´s german and means read!
[16:51:58] z4phod: i need rebuild the gem ?
[16:52:06] z4phod: i thinked wasn't build
[16:52:11] cpup: has joined #ruby
[16:52:13] z4phod: like interpreter
[16:52:32] myntcake: has joined #ruby
[16:52:37] shevy: z4phod someone else wrote the code?
[16:53:23] safe: has joined #ruby
[16:54:01] SCHAAP137: has joined #ruby
[16:54:12] apeiros: z4phod: changing dependencies.rb is pointless. not sure what you even changed there. it's just where the exception is being reported. check the full backtrace. the origin is somewhere in your own code.
[16:54:45] z4phod: but i can't find without more info, so i wanted add some debug info
[16:54:57] z4phod: and i changed /home/z4ppy/.rvm/gems/ruby-2.2.1/gems/activesupport-4.1.14/lib/active_support/dependencies.rb but nothing happen
[16:55:04] apeiros: that's not what you said, though.
[16:55:44] bronson: has joined #ruby
[16:55:44] apeiros: so you did some stuff and some stuffs did not happen? I guess you should do some other stuffs then.
[16:56:03] apeiros: alternatively: try to make some sense. those vague informations you give are useless.
[16:56:14] vdamewood: has joined #ruby
[16:56:19] jaequery: has joined #ruby
[16:56:22] z4phod: now i add bullshit error, and alway run, seem like my modification doesn't do something
[16:56:31] davedev24: has joined #ruby
[16:56:43] apeiros: z4phod: this is not helpful information.
[16:57:02] z4phod: so i changed dependencies.rb, why nothing happen ?
[16:57:17] shevy: z4phod you are trolling
[16:57:21] blackmesa: has joined #ruby
[16:57:27] z4phod: i mean you can't see my circular error, but why i can't change the gem ?
[16:57:36] Gasher: has joined #ruby
[16:57:45] adaedra: shevy: could you stop telling everyone they're trolling?
[16:58:07] shevy: adaedra I don't tell "everyone" so stop insinuating something that is unfounded
[16:58:20] z4phod: no i only want change gem code and run with my patch, but i don't know why ruby doesn't reload the gem
[16:58:23] apeiros: shevy: you are very quick to accuse people of trolling
[16:58:41] shevy: apeiros yeah - 20 lines without showing any code, no reply to my question either?
[16:58:43] apeiros: and I'd support adaedra request to not be that quick
[16:58:44] z4phod: yes, no troll, i promese
[16:59:23] apeiros: z4phod: but you see how you're being perceived. I suggest you try to add useful information. because until now, you haven't given any.
[16:59:28] z4phod: i said you, i changed gem code and nothing happen... i just want patch gem
[16:59:44] z4phod: /home/z4ppy/.rvm/gems/ruby-2.2.1/gems/activesupport-4.1.14/lib/active_support/dependencies.rb
[16:59:50] astrobun_: has joined #ruby
[16:59:57] vdamewood: has joined #ruby
[17:00:21] z4phod: lign 481 i added "BOUM", line without sense, but alway run
[17:00:28] sepp2k: has joined #ruby
[17:00:40] z4phod: so i mean i missed something in the patch
[17:00:45] z4phod: maybe rebuild ?
[17:00:53] z4phod: i am noob in ruby
[17:00:58] z4phod: (and in english sorry)
[17:00:59] skweek: has joined #ruby
[17:01:09] merida: has joined #ruby
[17:01:09] apeiros: the exception originates in line 478
[17:01:16] apeiros: why do you expect line 481 to be run?
[17:01:26] apeiros: execution stops at exceptions.
[17:01:31] z4phod: i only check if i can modifie code and i can't
[17:01:57] apeiros: also that kind of change will almost certainly not help you debug a rails app.
[17:02:11] z4phod: if loaded.include?(expanded)
[17:02:11] z4phod: raise "Circular dependency detected while autoloading constant #{qualified_name} #{expanded} !!!!"
[17:02:28] adaedra: z4phod: don't paste code here please, use a gist at least
[17:02:35] z4phod: i alway see "Circular dependency .." in error message, without "!!!"
[17:02:50] adaedra: but yeah, you should not be changing the code of the gem to debug your thing
[17:03:04] z4phod: only for debug, no release
[17:03:16] adaedra: even just for debug
[17:03:23] z4phod: ruby don't tell me many thing about the circular dependencies error :(
[17:03:45] apeiros: read the full backtrace. check which of your files is affected.
[17:03:57] z4phod: is a BIG file
[17:04:03] z4phod: with many dependencies
[17:04:13] apeiros: the backtrace comes with linenumbers
[17:04:17] arlek: has joined #ruby
[17:04:24] z4phod: so i wanted look the dependencies tree when ruby load it
[17:04:25] apeiros: it's not like you'd have to riddle
[17:04:31] z4phod: but i can't modifie gem
[17:04:37] adaedra: you don't need to.
[17:04:54] apeiros: z4phod: you came here for help. I tell you how to proceed. you don't seem to care.
[17:05:02] apeiros: tell me why I should continue to try helping
[17:05:21] z4phod: you said "dont modify gem"
[17:05:44] apeiros: you want to do pointless stuff or solve your problem?
[17:06:06] adaedra: z4phod: we're telling you there's a better way and we're trying to show it to you, can you follow us this way?
[17:06:06] z4phod: i want know why my patch dont work...
[17:06:21] z4phod: for dependencies i want too :)
[17:06:31] z4phod: you're nice, sorry for my poor english
[17:06:50] adaedra: z4phod: what's your native language?
[17:06:50] z4phod: so backtrace contain only trace of gem
[17:07:40] apeiros: might be worth a shot to try #ruby.fr (or #ruby-fr?)
[17:07:49] apeiros: the reason why your patch didn't work I told you too
[17:08:02] apeiros: error in line 478, your change in line 481 - won't be hit.
[17:08:28] z4phod: i added info in error message
[17:09:11] adaedra: z4phod: you're sure there's only gem context in your stacktrace?
[17:09:15] z4phod: i wanted see the tree
[17:09:24] z4phod: i will paste
[17:09:39] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[17:09:54] drptbl: has joined #ruby
[17:10:33] tristanp_: has joined #ruby
[17:10:42] z4phod: https://gist.github.com/anonymous/6663f22342bf6e58e6a0
[17:11:05] adaedra: "from (irb):3"
[17:11:28] z4phod: z4ppy@compta:~/luna/lunacompta-dev$ ls -l app/models/compta_line.rb
[17:11:28] z4phod: -rw-r--r-- 1 z4ppy z4ppy 6090 Feb 15 15:50 app/models/compta_line.rb
[17:11:33] adaedra: ah yes, I see the IRB prompt now
[17:11:49] z4phod: yes first
[17:11:50] adaedra: if your file is compta_line.rb, your model should be ComptaLine
[17:12:03] z4phod: the first error is strange too
[17:12:51] z4phod: so much time on it (before go here), ty VERY MUCH
[17:13:25] z4phod: (the error message was so ...)
[17:13:29] tenderlove: has joined #ruby
[17:13:30] adaedra: But next time, try to follow what we're telling you sooner, so it's better for everyone
[17:14:00] apeiros: z4phod: you changed the line and did not restart the rails console?
[17:14:15] apeiros: if you didn't - rails does not autoload gems. only the stuff in app
[17:14:33] Success: has joined #ruby
[17:14:38] apeiros: do you use spring?
[17:14:40] z4phod: i restarted all process using the model, but nothing happen
[17:14:46] z4phod: i mean yes
[17:15:01] z4phod: isn't my project, i'm starting with ruby
[17:15:10] apeiros: if you use spring, even restarting the rails console won't pick up changes in gems
[17:15:36] pawnbox: has joined #ruby
[17:16:22] dvinciguerra: has joined #ruby
[17:16:28] nando293921: has joined #ruby
[17:17:01] htmldrum: has joined #ruby
[17:17:03] htmldrum_: has joined #ruby
[17:17:13] z4phod: gem 'spring'
[17:17:13] z4phod: gem 'spring-commands-rspec'
[17:17:20] z4phod: (in the Gemfile)
[17:17:30] z4phod: in group :development, :test do
[17:18:16] adaedra: spring keeps a version of you app alive so you can use some tools like the console more quickly
[17:18:40] adaedra: so gem code is already loaded and modifying it won't change the loaded version
[17:18:43] GodFather: has joined #ruby
[17:19:46] diegoaguilar: has joined #ruby
[17:23:47] andywojo: has joined #ruby
[17:29:36] lxsameer: has joined #ruby
[17:31:46] Suntzu: has joined #ruby
[17:31:55] xcesariox: has joined #ruby
[17:32:45] biberu: has joined #ruby
[17:32:51] smathy: has joined #ruby
[17:33:07] User458764: has joined #ruby
[17:33:20] goodroot: has joined #ruby
[17:33:39] goodroot: has joined #ruby
[17:35:20] spuk: has joined #ruby
[17:36:07] pawnbox: has joined #ruby
[17:36:23] DynamicM`: has joined #ruby
[17:40:37] symm-: has joined #ruby
[17:40:39] RegulationD: has joined #ruby
[17:42:39] andywojo: has joined #ruby
[17:43:43] codecop: has joined #ruby
[17:44:45] LoneHerm_: has joined #ruby
[17:50:16] Success: has joined #ruby
[17:52:14] dome22xl: has joined #ruby
[17:53:16] GodFather: has joined #ruby
[17:54:49] blackmesa: has joined #ruby
[17:56:47] cdg: has joined #ruby
[17:57:14] silentpost: has joined #ruby
[17:57:38] zmartAway: has left #ruby: ("Leaving")
[17:57:47] mistermocha: has joined #ruby
[17:58:28] hinbody: has joined #ruby
[17:58:34] havenwood: export DISABLE_SPRING=1
[17:59:43] nofxx: has joined #ruby
[18:01:17] drptbl: has joined #ruby
[18:01:44] andywojo: has joined #ruby
[18:02:26] tildes: has joined #ruby
[18:04:51] Gasher: has joined #ruby
[18:05:50] GodFather: has joined #ruby
[18:06:54] abort: has joined #ruby
[18:07:47] dmr8: has joined #ruby
[18:10:11] rbennacer: has joined #ruby
[18:10:44] NinjaPanzer: has joined #ruby
[18:12:02] sandstrom: has joined #ruby
[18:14:22] Dimik: has joined #ruby
[18:14:30] jkahn: has joined #ruby
[18:15:24] rolha: has joined #ruby
[18:16:14] ljames: has joined #ruby
[18:17:15] pawnbox_: has joined #ruby
[18:18:14] djellemah: has joined #ruby
[18:21:02] fullofcaffeine: has joined #ruby
[18:21:29] ruby[bot]: has joined #ruby
[18:21:30] ChanServ: +o ruby[bot]
[18:21:59] marcdel: has joined #ruby
[18:22:27] stannard: has joined #ruby
[18:23:41] grepsuzette: has joined #ruby
[18:25:02] lxsameer: has joined #ruby
[18:25:57] imperator: has joined #ruby
[18:26:34] MagisterQuis: has joined #ruby
[18:28:02] andywojo: has joined #ruby
[18:28:19] dvinciguerra: has joined #ruby
[18:28:54] Success: has joined #ruby
[18:29:34] Success: has joined #ruby
[18:29:48] MagisterQuis: Hi. I'm trying to install a program's gems with 'bundle install'
[18:30:06] MagisterQuis: One requires a C library for which the header's not where bundler expects it.
[18:30:21] MagisterQuis: How can another include path be specified, globally?
[18:30:27] MagisterQuis: Like -I/usr/local/include
[18:33:14] darix: MagisterQuis: it depends on the build system
[18:33:25] darix: export CFLAGS="-I..."
[18:33:32] darix: export LDFLAGS="-L..."
[18:33:34] darix: might work
[18:34:01] Success: has joined #ruby
[18:34:15] FooMunki: has joined #ruby
[18:34:21] User458764: has joined #ruby
[18:36:07] mistermocha: has joined #ruby
[18:36:22] LoneHerm_: has joined #ruby
[18:36:22] weemsledeux: has joined #ruby
[18:36:27] tubuliferous_: has joined #ruby
[18:36:29] MagisterQuis: darix: I'll give it a go.
[18:36:34] tristanp: has joined #ruby
[18:36:36] MagisterQuis: Seems to just be using make under the hood.
[18:37:20] lxsameer: has joined #ruby
[18:37:26] MagisterQuis: CFLAGS worked, apparently I don't know where the library itself lives :D
[18:38:48] MagisterQuis: No, it's not using LDFLAGS, hm.
[18:39:04] arthropododo: has joined #ruby
[18:40:08] lxsameer: has joined #ruby
[18:41:20] krobzaur_: has joined #ruby
[18:41:42] rehat_: has joined #ruby
[18:46:17] Danishman: has joined #ruby
[18:46:37] sq271: has joined #ruby
[18:46:55] lxsameer: has joined #ruby
[18:47:40] dome22xl: has joined #ruby
[18:47:43] dome: has joined #ruby
[18:48:08] fullofcaffeine: has joined #ruby
[18:49:00] jcdesimp: has joined #ruby
[18:49:22] hinbody: has joined #ruby
[18:50:47] QualityAddict: has joined #ruby
[18:53:06] jpfuentes2: has joined #ruby
[18:53:31] grepsuzette: has left #ruby: ("WeeChat 1.4")
[18:54:19] darix: MagisterQuis: export LIBS maybe
[18:55:53] Inside: has joined #ruby
[18:55:53] Inside: has joined #ruby
[18:56:22] lxsameer: has joined #ruby
[18:57:47] bronson: has joined #ruby
[18:57:49] mdw: has joined #ruby
[18:57:52] scepticulous: has joined #ruby
[18:59:01] Moosashi: has joined #ruby
[19:00:19] mdw: has joined #ruby
[19:02:43] JohnBat26: has joined #ruby
[19:07:02] yqt: has joined #ruby
[19:08:09] solocshaw: has joined #ruby
[19:08:21] jaequery: has joined #ruby
[19:08:31] A124: has joined #ruby
[19:09:56] uglybandersnatch: has joined #ruby
[19:10:46] brentw: has joined #ruby
[19:11:09] Mia: has joined #ruby
[19:11:09] Mia: has joined #ruby
[19:11:41] rehat: has joined #ruby
[19:14:55] znz_jp: has joined #ruby
[19:15:39] Musashi007: has joined #ruby
[19:16:23] jaequery: has joined #ruby
[19:17:20] _blizzy_: has joined #ruby
[19:23:29] shevy: does anyone know off-hand, without testing - if we have two .rb files in a project, one has "frozen_string_literal: true" and the other has "# frozen_string_literal: false" as part of the expanded shebang-header, will this be valid on a per-file basis? that is, code in one file for strings will be frozen and the other strings will not?
[19:24:34] Silex: has joined #ruby
[19:25:02] IrishGringo: has joined #ruby
[19:25:02] lxsameer: has joined #ruby
[19:25:54] fedexo: has joined #ruby
[19:26:40] agit0: has joined #ruby
[19:26:54] gizless: has joined #ruby
[19:27:36] moeabdol: has joined #ruby
[19:27:43] lxsameer: has joined #ruby
[19:28:48] djellemah_: has joined #ruby
[19:29:51] darix: shevy: should be per file
[19:32:27] kfpratt: has joined #ruby
[19:33:25] LoneHerm_: has joined #ruby
[19:33:42] lxsameer: has joined #ruby
[19:35:11] silentpost: has joined #ruby
[19:37:46] blackmesa: has joined #ruby
[19:38:33] dikaio: has joined #ruby
[19:39:50] dikaio: has joined #ruby
[19:40:41] GnuYawk: has joined #ruby
[19:41:01] stannard: has joined #ruby
[19:41:16] p0wn3d: has joined #ruby
[19:41:39] tubuliferous_: has joined #ruby
[19:45:16] p0wn3d: has joined #ruby
[19:53:20] pawnbox: has joined #ruby
[19:53:32] Ebok: has joined #ruby
[19:54:22] Silex: has joined #ruby
[19:57:18] MagisterQuis: darix: LIBS did it, thanks much.
[19:58:16] nando293921: has joined #ruby
[19:58:42] mistermocha: has joined #ruby
[19:58:46] Rubie: has joined #ruby
[19:59:44] kloeri: has joined #ruby
[20:00:43] Don_John: has joined #ruby
[20:01:14] ramfjord: has joined #ruby
[20:02:57] yfeldblum: has joined #ruby
[20:10:32] fullofcaffeine: has joined #ruby
[20:11:13] parduse: has joined #ruby
[20:11:16] riceandbeans: given json, what's the best way to report an error if any key has a nil/'' value
[20:12:07] Zarthus: riceandbeans: to the programmer or to the user?
[20:12:09] riceandbeans: right now I'm having a method do foo.each do |x| return true unless x.nil? end
[20:13:04] riceandbeans: I'm half awake and realize it's wrong
[20:13:06] Zarthus: riceandbeans: `return' stops the loop, you probably want return false if x.nil?
[20:13:56] apeiros: a) you say "key", implying it's an object with key/value but you use .each with only a single variable, implying it's an array - what is it now?
[20:14:25] apeiros: b) you say nil/'' value, which I read as "any key which is either nil or ''", but you only test for nil? - what is it now?
[20:14:32] riceandbeans: it's parsed json but you can reference it like foo['bar']
[20:14:45] bob434: has joined #ruby
[20:14:58] riceandbeans: I just need to make sure the value is something at the moment
[20:15:00] apeiros: that'd be an Object, which in ruby is represented by a Hash. so .each do |x| is wrong no matter what. since x will be a [key, value] array.
[20:15:48] apeiros: "is something" is rather unspecific. is an empty string something?
[20:16:39] riceandbeans: I'm just trying to write a method to validate an API that's accepting json and returning json
[20:16:54] apeiros: can't you just answer the question instead of saying something unrelated?
[20:17:12] riceandbeans: no, an empty string is not something
[20:17:34] riceandbeans: ' ' would be something, it would fail, but it would be something
[20:17:40] apeiros: then your block is wrong too, since "".nil? is false.
[20:18:40] djbkd: has joined #ruby
[20:18:45] Melpaws: has joined #ruby
[20:19:56] apeiros: you probably want .any? or none? on foo.values and a block which tests for `value.nil? || (value.is_a?(String) && value.empty?)`
[20:20:36] Ox0dea: Why the check for String?
[20:21:02] riceandbeans: I'm not opposed to better ideas for checking
[20:21:06] apeiros: Ox0dea: because plenty of valid json values do not respond to .empty?
[20:21:22] Ox0dea: apeiros: Well, just the numbers, no?
[20:21:44] apeiros: that's still values where you'd get an exception without the check
[20:21:59] apeiros: but true/false/nil too
[20:22:02] MagisterQuis: has left #ruby: (""Thanks darix"")
[20:22:15] riceandbeans: for instance, I want a json blob to be able to create a user by an API, but I have to check that the username doesn't already exist and create it, but if the username passed in is '' or nil, then it won't work
[20:23:09] pawnbox: has joined #ruby
[20:25:03] LoneHermit: has joined #ruby
[20:27:20] stannard: has joined #ruby
[20:27:52] Melpaws: has joined #ruby
[20:30:28] Es0teric: has joined #ruby
[20:30:31] uglybandersnatch: has joined #ruby
[20:36:42] htmldrum_: has joined #ruby
[20:36:42] htmldrum: has joined #ruby
[20:37:26] mistermocha: has joined #ruby
[20:38:24] Gasher: has joined #ruby
[20:41:36] sebyx07: has joined #ruby
[20:42:33] FooMunki: has joined #ruby
[20:43:15] QualityAddict: has joined #ruby
[20:44:29] blackmesa: has joined #ruby
[20:44:29] sebyx07: does anyone know how to disable logging for a particular url? I receive some images as base64 in post requests and they are pretty big, so the log file gets bloated with that
[20:45:31] gix: has joined #ruby
[20:45:50] apeiros: sebyx07: wrong channel? or did you just omit to name the context (application/framework) within which you have logging?
[20:46:31] Inside: has joined #ruby
[20:46:46] sebyx07: has left #ruby: ()
[20:47:27] Azure: has joined #ruby
[20:48:30] skweek: has joined #ruby
[20:48:42] apeiros: classy. leaving without another word.
[20:49:08] JohnBat26: has joined #ruby
[20:50:02] TheGreatGudsby: has joined #ruby
[20:50:03] adaedra: IRC is hard.
[20:50:27] apeiros: manners are hard too, as it seems.
[20:51:06] Ebok: patience is even harder
[20:51:08] stannard: has joined #ruby
[20:52:02] riceandbeans: apeiros: when I do values instead of each I don't hit binding.pry statements in the block
[20:52:44] elifoster: has joined #ruby
[20:52:52] riceandbeans: apeiros: wait, is it supposed to be foo.values.each?
[20:53:40] apeiros: neither. foo.values.any? or foo.values.none?, depending on what result you want.
[20:53:41] riceandbeans: changing .values to .values.each returned the correct response...
[20:56:30] Trynemjoel: has joined #ruby
[20:56:32] spacemud: has joined #ruby
[20:56:43] unsymbol: has joined #ruby
[20:59:55] bronson: has joined #ruby
[21:00:48] Balzrael: has joined #ruby
[21:01:29] agit0: has joined #ruby
[21:01:50] Guest11: has joined #ruby
[21:02:42] th0m_: has joined #ruby
[21:02:49] firstdayonthejob: has joined #ruby
[21:10:51] dvinciguerra: has joined #ruby
[21:13:57] trinaldi: has joined #ruby
[21:15:28] Trynemjoel: has joined #ruby
[21:17:38] SenpaiSilver: has joined #ruby
[21:20:37] threh: has joined #ruby
[21:20:39] chris2: has joined #ruby
[21:21:43] blackmesa: has joined #ruby
[21:23:58] TheGreatGudsby: has left #ruby: ("nah bro...")
[21:24:02] moeabdol: has joined #ruby
[21:26:50] cjheath: has joined #ruby
[21:26:59] CloCkWeRX: has joined #ruby
[21:29:05] darkf: has joined #ruby
[21:30:01] Trynemjoel: has joined #ruby
[21:30:14] TheGreatGudsby: has joined #ruby
[21:30:49] TheGreatGudsby: has joined #ruby
[21:35:40] spuk: has joined #ruby
[21:36:39] Whiz: has joined #ruby
[21:38:03] Es0teric: has joined #ruby
[21:38:26] martin290: has joined #ruby
[21:38:30] martin290: hey everyone
[21:38:51] mistermocha: has joined #ruby
[21:39:20] northfurr: has joined #ruby
[21:40:55] martin290: has left #ruby: ()
[21:44:23] Xiti: has joined #ruby
[21:45:07] jcdesimp: has joined #ruby
[21:45:13] Rubie: has joined #ruby
[21:45:30] bmf: has joined #ruby
[21:45:56] bmf_: has joined #ruby
[21:46:13] bmf_: has joined #ruby
[21:46:34] Silex: has joined #ruby
[21:47:28] bmf_: has joined #ruby
[21:47:33] Trynemjoel: has joined #ruby
[21:47:35] bmf: has left #ruby: ()
[21:48:03] bmf: has joined #ruby
[21:49:55] tubuliferous_: has joined #ruby
[21:52:13] gizmore: has joined #ruby
[21:52:26] hightower3: has joined #ruby
[21:53:41] Ebok: has joined #ruby
[21:54:55] zotherstupidguy: has joined #ruby
[21:58:02] jaequery: has joined #ruby
[21:58:53] bob434: has joined #ruby
[21:59:06] russt: has joined #ruby
[22:00:39] ccmc: has joined #ruby
[22:00:48] northfurr: has joined #ruby
[22:02:17] xlegoman: has joined #ruby
[22:03:39] CloCkWeRX: has joined #ruby
[22:04:07] davedev24: has joined #ruby
[22:05:03] jenrzzz: has joined #ruby
[22:05:03] jenrzzz: has joined #ruby
[22:06:04] jhack: has joined #ruby
[22:06:13] GnuYawk: has joined #ruby
[22:06:27] Melpaws1: has joined #ruby
[22:07:32] jcdesimp_: has joined #ruby
[22:10:04] threh: has joined #ruby
[22:10:54] toretore: has joined #ruby
[22:11:35] Melpaws1: has left #ruby: ()
[22:13:15] vdamewood: has joined #ruby
[22:14:45] htmldrum: has joined #ruby
[22:14:46] htmldrum_: has joined #ruby
[22:14:51] Yzguy: has joined #ruby
[22:16:23] gregf: has joined #ruby
[22:18:28] rkazak: has joined #ruby
[22:23:03] Silex: has joined #ruby
[22:24:09] Trynemjoel: has joined #ruby
[22:24:12] sandstrom: has joined #ruby
[22:24:38] Noxilex: has joined #ruby
[22:25:04] yatish27: has joined #ruby
[22:25:04] [gmi]: has joined #ruby
[22:25:09] cjheath: has joined #ruby
[22:26:44] bluestreak0: has joined #ruby
[22:27:03] bb010g: has joined #ruby
[22:28:43] qhp: has joined #ruby
[22:31:07] codecop: has joined #ruby
[22:31:09] vdamewood: has joined #ruby
[22:36:01] symm-: has joined #ruby
[22:40:00] zenlot6: has joined #ruby
[22:42:58] pawnbox: has joined #ruby
[22:44:21] yfeldblum: has joined #ruby
[22:45:15] htmldrum: has joined #ruby
[22:45:16] htmldrum_: has joined #ruby
[22:47:38] skweek: has joined #ruby
[22:58:52] jnj: has joined #ruby
[22:58:55] sudoubuntu: has joined #ruby
[23:02:01] bronson: has joined #ruby
[23:03:48] chipotle: has joined #ruby
[23:06:39] Es0teric: has joined #ruby
[23:07:18] Es0teric: has joined #ruby
[23:07:57] Es0teric: has joined #ruby
[23:08:09] jonatin: has joined #ruby
[23:08:45] codex: has joined #ruby
[23:10:04] minimalism: has joined #ruby
[23:13:33] blackgoat: has joined #ruby
[23:13:46] pawnbox: has joined #ruby
[23:16:35] sudoubuntu: has joined #ruby
[23:21:20] kfpratt: has joined #ruby
[23:22:11] htmldrum: has joined #ruby
[23:22:11] htmldrum_: has joined #ruby
[23:22:38] jhn: has joined #ruby
[23:24:03] ur5us: has joined #ruby
[23:27:12] diegoaguilar: has joined #ruby
[23:28:26] ur5us: has joined #ruby
[23:29:04] LoneHerm_: has joined #ruby
[23:33:42] sudoubuntu: has joined #ruby
[23:36:13] brentw: has joined #ruby
[23:37:36] hiyosi: has joined #ruby
[23:38:22] diegoaguilar: has joined #ruby
[23:40:07] tristanp: has joined #ruby
[23:41:09] mistermocha: has joined #ruby
[23:42:22] Outlastsheep: has joined #ruby
[23:44:18] rbennacer: has joined #ruby
[23:46:07] zacts: hi rubyists
[23:54:22] LoneHerm_: has joined #ruby