« Back to channel list

#ruby - 25 June 2016

« Back 1 day Forward 1 day »
[00:00:13] l4v2: Thanks Radar
[00:01:02] mistermocha: has joined #ruby
[00:01:43] Radar: l4v2: Were you able to work out what was wrong with your code?
[00:02:01] l4v2: I went and got pizza. And no.
[00:02:08] ruby-lang642: jhass: is this right? http://i.imgur.com/gAhZyGJ.jpg
[00:02:59] l4v2: I’ve been stuck on it for a wile, I already looked, once I ask someoene I means I gave up looking. But no one in this field gets that.
[00:03:36] l4v2: It’s why I should have picked blueberry picker :)
[00:03:38] shevy: tomorrow is another day
[00:03:39] solocshaw: has joined #ruby
[00:04:02] l4v2: I like getting things done, I don’t ahve patients
[00:04:06] jhass: ruby-lang642: first of all the answer to the question is yes. Then given your arrows mean "parent", it's not incorrect, the right side is just missing a few items in the chain ;)
[00:04:40] l4v2: So if anyone would like to walk me through how to solve this, that would be cool
[00:05:08] l4v2: I got through all of the Array challenges easily, but Active Record is realy hard to me
[00:05:20] shevy: activerecord is hard!
[00:05:44] l4v2: So why not just use SQL?
[00:06:02] roamingdog: has joined #ruby
[00:06:13] ruby-lang642: l4v2: are you asking me?
[00:06:21] Radar: ruby-lang642: no
[00:06:22] shevy: don't ask me, I did not write activerecord; however had, if you work with ruby code, you will tend to abstract anyway unless you write plain SQL in which case, why need any programming language?
[00:06:27] Radar: l4v2: Show us your code again please.
[00:06:51] l4v2: Oh, well I can paste the code and if anyone can explaine to me how ruby and Active Record go together better than the guides do, then that would be cool
[00:06:51] mistermocha: has joined #ruby
[00:07:36] armyriad: has joined #ruby
[00:07:41] Radar: Well, I wrote the Active Record Query Interface guide.
[00:08:20] ruby-lang642: jhass: just to be confirm, Foo.ancestors.first is == Foo.singleton_class ?
[00:08:57] jhass: ruby-lang642: no. those are distinct hierarchies that only converge on Class
[00:09:02] Radar: ~~ class Foo; end; Foo.ancestors.first == Foo.singleton_class
[00:09:06] Radar: >> class Foo; end; Foo.ancestors.first == Foo.singleton_class
[00:09:10] ruby[bot]: Radar: # => false (https://eval.in/595335)
[00:10:01] jhass: ruby-lang642: all objects have a singleton class, even those that don't respond to .ancestors like instances of String for example
[00:10:18] l4v2: I passed the first x amount of tests, now I am on the one that starts on line 76 (this is just to learn from, not for anything but me here’s the link to where I got it from) https://github.com/schneems/arrays_and_active_record and here’s my code https://gist.github.com/anonymous/e4f187ecc649662368f414cfbd38fa7c
[00:10:51] mistermo_: has joined #ruby
[00:11:16] Radar: l4v2: Look on that page for "Other snippets you might use"
[00:11:58] mistermocha: has joined #ruby
[00:12:13] Radar: l4v2: Oh, you got past the last test. Sorry.
[00:12:24] pawnbox: has joined #ruby
[00:12:29] Radar: l4v2: For this line: https://gist.github.com/anonymous/e4f187ecc649662368f414cfbd38fa7c#file-gistfile1-txt-L84 You should learn the differences between find_by and where.
[00:12:35] MrBusiness3: has joined #ruby
[00:13:07] Radar: l4v2: I don't see where you're declaring the color variable there either.
[00:13:23] l4v2: Well the guides and Ruby docs were kind of confusing to me
[00:13:43] SilverKey: has joined #ruby
[00:14:41] l4v2: I ended up just using ‘find’ in the docs to get the solutiions. I mean this stuff is weird, but with a little help it will click. I bet code school has a querying challenge I should try
[00:14:47] ruby-lang642: jhass: oh ok I think I'm getting the hang of it after doing some more google searchers. So every object has a singleton_class, and class Foo is an object, so it has a singleton_class
[00:15:02] jhass: ruby-lang642: exactly!
[00:15:11] swills: has joined #ruby
[00:15:26] ruby-lang642: does it show up in Foo.ancestors? if so, is it Foo ?
[00:15:27] l4v2: ruby_lang642 (thumbs up image here)
[00:15:37] jhass: ruby-lang642: no and no
[00:15:47] mistermo_: has joined #ruby
[00:15:59] jhass: ruby-lang642: Foo.ancestors.first == Foo
[00:16:24] jhass: it's the same object, that holds true for the singleton class too, Foo.singleton_class.ancestors.first == Foo.singleton_class
[00:17:20] jhass: the latter expression will be trivially true in any case, you can replace Foo with any valid Ruby expression you'd like
[00:17:25] bkxd: has joined #ruby
[00:17:42] solocshaw1: has joined #ruby
[00:18:18] jhass: >> foo = "hello world"; def foo.say_it; puts self; end; foo.say_it
[00:18:21] ruby-lang642: so let's say you do foo = Foo.new, def foo.bar; puts 'hello'; end. Then foo.singleton_class != Foo.singleton_class
[00:18:24] ruby[bot]: jhass: # => hello world ...check link for more (https://eval.in/595336)
[00:18:43] dhruvasagar: has joined #ruby
[00:18:50] jhass: in the above example say_it is an instance method of foo.singleton_class
[00:18:53] l4v2: How do I assign a ruby variable to a model? Or columne (not sure what is going on here) would it be like this color = [Car.color => "red")
[00:19:10] jhass: ruby-lang642: yes
[00:19:13] mistermocha: has joined #ruby
[00:19:26] n1x-nz: has joined #ruby
[00:20:07] cdg: has joined #ruby
[00:20:10] ruby-lang642: out of curiousity is it possible to get behavior like bar = foo.new ? In pry it gives me an error, but I'm wondering if you can do that
[00:20:16] Radar: l4v2: Which line are you trying to do that in?
[00:20:17] l4v2: from a model I mean.
[00:20:26] Radar: l4v2: Are you trying to find all cars where the color is red?
[00:20:54] Radar: color = "red"
[00:20:58] Radar: Car.create(:color => color)
[00:21:02] jhass: ruby-lang642: yes you can, new is just am method call and Foo in class Foo is just a constant, so you can for example do class Foo; end; foo = Foo; bar = foo.new
[00:21:04] l4v2: I’m not sure, it sounds like that, but maybe I only have to say color
[00:21:05] Radar: Then Car.where(...)
[00:21:45] jhass: ruby-lang642: but also class Foo; def new; :i_am_a_teapot; end; end; foo = Foo.new; bar = foo.new
[00:22:03] l4v2: It still says undefined local variable or method `color'
[00:22:18] jhass: ruby-lang642: Foo.new there is just calling the instance method new of the class Class (which Foo is an instance of)
[00:22:51] ruby-lang642: hmm so after you modify the singleton_class of foo, can you make bar = foo.new and so it becomes an instance of foo? (i.e. it has the methods in the singleton_class not defined in Foo)
[00:23:57] jhass: ruby-lang642: ah no, you can't make new instances of singleton classes, there's always only ever one, at least and at most, one instance of a singleton class
[00:24:07] northfurr: has joined #ruby
[00:24:21] ruby-lang642: ok now I'm going to re-read what you wrote
[00:24:58] jenrzzz: has joined #ruby
[00:25:31] arescorpio: has joined #ruby
[00:29:55] jhass: ruby-lang642: btw while if you grasp this the solution to your problem will become immediately obvious, however it's certainly the long road to it. If you want to back out of it and come back if you're already more familiar with ruby that's perfectly fine. Just say it and we can show you a direct solution, you might just not fully get how it works yet then :)
[00:30:34] thejamespinto: has joined #ruby
[00:33:11] shevy: keep things simple
[00:33:53] banister: has joined #ruby
[00:34:34] Xeago_: has joined #ruby
[00:34:39] ruby-lang642: jhass: are instance methods, methods of the object and not in the singleton class, right?
[00:35:08] jhass: all ruby methods are in fact instance methods of some class
[00:35:37] jhass: methods which are unique to a single object, are instance methods of that objects singleton class
[00:35:55] solocshaw: has joined #ruby
[00:36:21] tenc: has joined #ruby
[00:37:28] ruby-lang642: i have to leave my computer for now, i will be thinking about this problem and will probably have to rejoin the chat under a different username
[00:37:29] nando293921: has joined #ruby
[00:37:45] ruby-lang642: i'll also be looking at the logs, so... basically i'll be back with more questions :)
[00:37:58] ruby-lang642: thanks for all of the help so far jhass
[00:40:18] solocshaw: has joined #ruby
[00:44:58] Radar: l4v2: Did you set color?
[00:45:04] Radar: l4v2: color = "red"
[00:45:18] Radar: l4v2: Also: direct messages at me if you want to speak to me. I've got IRC minimised most of the time.
[00:45:45] l4v2: Ok, cool thank you. No I wa sreading something on it
[00:46:01] jaguarmagenta: has joined #ruby
[00:47:29] RegulationD: has joined #ruby
[00:48:47] northfurr: has joined #ruby
[00:49:47] solocshaw1: has joined #ruby
[00:52:32] solocshaw: has joined #ruby
[00:53:25] pawnbox: has joined #ruby
[00:54:58] mclong: has joined #ruby
[00:56:16] dminuoso: has joined #ruby
[00:56:29] k3rn31: has joined #ruby
[00:56:32] ekinmur: has joined #ruby
[00:57:34] AcidCrash0x00: has joined #ruby
[01:00:05] arajakul1: has joined #ruby
[01:01:20] aaeron: has joined #ruby
[01:02:38] Es0teric: has joined #ruby
[01:06:44] roamingdog: has joined #ruby
[01:08:59] solocshaw: has joined #ruby
[01:12:25] passbe: Wondering if anyone can help me. I'm trying to load a model with the same name as the class im currently in: https://gist.github.com/passbe/47094c41f38acb5676bd95c9eda990c9
[01:12:51] passbe: I try ::Contact and it doesn't work. I try namespacing the model ::Model::Contact and that still wont work
[01:13:10] passbe: ruby 2.1 / grape
[01:14:09] roamingdog: has joined #ruby
[01:14:10] pawnbox: has joined #ruby
[01:14:23] adam12: passbe: What's the error?
[01:14:26] SilverKey: has joined #ruby
[01:15:04] passbe: if i try just ::Contact then: NameError: uninitialized constant Contact
[01:15:13] kraken: has joined #ruby
[01:15:27] adam12: And you're requiring the model file somewhere as well?
[01:15:40] passbe: with ::Model::Contact then: NameError: uninitialized constant API::V1::Contact::Model
[01:15:45] shinnya: has joined #ruby
[01:15:51] passbe: adam12: correct but ill triple check that now
[01:16:07] ekinmur: has joined #ruby
[01:16:09] krakenr: Alright, I'm really trying to understand object oriented design, and I was told to, instead of creating an array or values, create an array of objects that contain the values? What is the benefit of this? I cannot wrap my head around it. It just seems like an extra step!
[01:16:10] adam12: passbe: I don't see anything wrong, presuming you're requiring that model file before you attempt to use it.
[01:16:27] adam12: kraken_: Depends. Array of objects that could be primitives? Maybe not
[01:16:31] coffeecupp: has joined #ruby
[01:16:34] adam12: kraken_: Any array of hashes? Maybe so.
[01:16:59] krakenr: adam12, It's just an array of string values
[01:17:12] krakenr: adam12, I was to to make it an array of object containing string values
[01:17:20] krakenr: via readers
[01:17:31] adam12: Well, to be pedantic, in Ruby strings are objects, so just tell them they are already objects! :p
[01:17:32] MrBusiness2: has joined #ruby
[01:17:48] adam12: I'd make them into their own object if there was a chance for more. Ie.
[01:17:55] adam12: Consider a list of inputs for a web form
[01:18:10] adam12: You could get by with a list of strings, but then all of a sudden you need a hidden flag, disabled flag, different ID, etc.
[01:18:28] Es0teric: has joined #ruby
[01:18:34] adam12: Or maybe they are names of people. Maybe they should be Person objects with name attributes. All depends on use case.
[01:19:18] passbe: adam12: dear lord i should have triple checked the model. wasn't being included because of ** vs * in my Dir glob
[01:19:22] passbe: adam12: thank you!
[01:19:26] adam12: passbe: Cheers! :)
[01:21:09] dhruvasagar: has joined #ruby
[01:22:06] adam12: kraken_: Sandy Metz is great for all things Object Orientated. I encourage you to check out her book POODR.
[01:22:27] krakenr: adam12, thnanks for the suggestions, I've seen it mentioned many times
[01:22:44] adam12: Some of her videos are great as well. She's keynoted a bunch of Ruby related conferences.
[01:22:55] adam12: Not even for OO - she's very articulate and a pleasure to listen to.
[01:27:33] ptx0_: has joined #ruby
[01:27:58] pnbeast: has joined #ruby
[01:30:09] tenc: has joined #ruby
[01:30:58] MrBusiness3: has joined #ruby
[01:35:38] solocshaw: has joined #ruby
[01:37:42] roamingdog: has joined #ruby
[01:40:07] sypheren: has joined #ruby
[01:40:54] choke: has joined #ruby
[01:41:12] weaksauce: has joined #ruby
[01:45:34] Gasher: has joined #ruby
[01:45:44] mistermocha: has joined #ruby
[01:48:44] Channel6: has joined #ruby
[01:49:54] nankyokusei: has joined #ruby
[01:50:07] arnonhongklay: has joined #ruby
[01:52:44] ss_much: has joined #ruby
[01:53:37] ullu: has joined #ruby
[01:54:06] mistermocha: has joined #ruby
[01:56:16] solocshaw: has joined #ruby
[01:56:46] loseyourmind: has joined #ruby
[01:56:59] dminuoso: has joined #ruby
[02:00:44] edwardly: has joined #ruby
[02:00:44] edwardly: has joined #ruby
[02:01:09] dc1: has joined #ruby
[02:01:53] ptx0: has joined #ruby
[02:01:56] ptx0: has joined #ruby
[02:02:08] solocshaw: has joined #ruby
[02:03:50] mistermo_: has joined #ruby
[02:05:38] choke: has joined #ruby
[02:05:46] mistermocha: has joined #ruby
[02:05:46] d0nn1e: has joined #ruby
[02:06:25] nando293921: has joined #ruby
[02:07:44] mistermo_: has joined #ruby
[02:08:56] neo_: has joined #ruby
[02:09:50] mistermo_: has joined #ruby
[02:17:41] bdb-me: has joined #ruby
[02:19:41] mistermocha: has joined #ruby
[02:19:45] Azure: has joined #ruby
[02:21:31] allcentury: has joined #ruby
[02:28:54] erlend: has joined #ruby
[02:31:19] mistermo_: has joined #ruby
[02:31:48] bdb-me: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[02:33:12] giz|work: has joined #ruby
[02:33:21] mistermo_: has joined #ruby
[02:34:04] cyphase: has joined #ruby
[02:35:19] mistermocha: has joined #ruby
[02:35:59] ruskie: has joined #ruby
[02:37:02] KnownSyntax: has joined #ruby
[02:37:02] KnownSyntax: has joined #ruby
[02:37:11] mistermo_: has joined #ruby
[02:39:14] mistermo_: has joined #ruby
[02:39:51] allcentury: has joined #ruby
[02:41:07] mistermocha: has joined #ruby
[02:43:15] mistermocha: has joined #ruby
[02:45:53] rattatmatt: has joined #ruby
[02:46:20] mistermocha: has joined #ruby
[02:46:46] jaguarmagenta: has joined #ruby
[02:46:49] cyphase: has joined #ruby
[02:47:26] chipotle: has joined #ruby
[02:47:38] solocshaw: has joined #ruby
[02:47:54] mistermo_: has joined #ruby
[02:49:30] stardiviner: has joined #ruby
[02:50:02] mistermo_: has joined #ruby
[02:51:55] mistermocha: has joined #ruby
[02:53:04] mistermo_: has joined #ruby
[02:53:55] dh64: has joined #ruby
[02:54:04] solocshaw: has joined #ruby
[02:54:05] mistermocha: has joined #ruby
[02:55:40] coffeecupp: has joined #ruby
[02:57:45] dminuoso: has joined #ruby
[02:57:54] mistermocha: has joined #ruby
[02:57:59] enterprisey: has joined #ruby
[02:59:26] cyphase: has joined #ruby
[02:59:47] mistermocha: has joined #ruby
[03:00:52] mistermo_: has joined #ruby
[03:01:13] roamingdog: has joined #ruby
[03:02:48] mistermocha: has joined #ruby
[03:03:40] solocshaw: has joined #ruby
[03:04:47] mistermo_: has joined #ruby
[03:06:20] benlieb: has joined #ruby
[03:07:30] hahuang61: has joined #ruby
[03:07:56] pawnbox: has joined #ruby
[03:12:27] mistermo_: has joined #ruby
[03:12:31] robert45: has joined #ruby
[03:12:55] moeabdol: has joined #ruby
[03:14:40] cyphase: has joined #ruby
[03:15:27] tristanp: has joined #ruby
[03:16:28] robert45: has left #ruby: ()
[03:16:31] mistermocha: has joined #ruby
[03:17:38] ReK2: has joined #ruby
[03:18:20] hays_: has joined #ruby
[03:20:44] northfurr: has joined #ruby
[03:21:15] k3rn31: has joined #ruby
[03:22:37] mistermocha: has joined #ruby
[03:22:43] dhruvasagar: has joined #ruby
[03:27:55] braincras: has joined #ruby
[03:29:24] gix: has joined #ruby
[03:33:10] arajakul1: has joined #ruby
[03:33:55] solocshaw: has joined #ruby
[03:35:29] mistermocha: has joined #ruby
[03:39:00] xall: has joined #ruby
[03:39:08] shevy: is there a non-regex way, ideally an elegant way by default, to check if an input string contains only numbers? e. g. x = "55"; with a regex it is simple, if x =~ /^\d+$/
[03:41:53] hk238: has joined #ruby
[03:42:17] adam12: shevy: Integer(value) raises ArgumentError for anything it can't convert.
[03:42:23] adam12: shevy: Not sure if that's elegant or not :)
[03:42:37] adam12: >> Integer(55)
[03:42:41] ruby[bot]: adam12: # => 55 (https://eval.in/595356)
[03:42:55] adam12: >> Integer("42foobar")
[03:43:13] ruby[bot]: adam12: # => invalid value for Integer(): "42foobar" (ArgumentError) ...check link for more (https://eval.in/595357)
[03:44:23] nictrasavios: has joined #ruby
[03:47:11] mistermocha: has joined #ruby
[03:48:36] RegulationD: has joined #ruby
[03:49:04] cyphase: has joined #ruby
[03:50:42] nankyokusei: has joined #ruby
[03:51:09] mistermo_: has joined #ruby
[03:53:07] mistermocha: has joined #ruby
[03:54:59] northfurr: has joined #ruby
[03:57:05] mistermo_: has joined #ruby
[03:58:16] ptx0: has joined #ruby
[03:58:32] dminuoso: has joined #ruby
[03:59:43] mattwashere: has joined #ruby
[04:01:33] kraken: has joined #ruby
[04:02:19] krakenr: Hey has anyone read POODR by Sandi Metz? Can someone please explain what she means by the word 'messages', as in when she says that she prefers messages over data, and that object send 'messages' to one another
[04:02:22] roamingdog: has joined #ruby
[04:02:55] mistermocha: has joined #ruby
[04:04:14] hk238: kraken_ I can't explain it properly, but it refers to a concept called `message passing` which is one of the features useful for implementing an object oriented language. I think examples of that are things like datatypes.
[04:05:11] hk238: well I'm not sure if this is accurate, but at least it's a comparison, for an example if you have a function `absolute value` and thne you'v edifferent kinds of number types, like integers, unsigned integers, floating points, and so on
[04:05:25] krakenr: hk238, I'm jsut having a harder time trudging through than I thought. For instance, she recommends wrapping an instance variable in a method, and passing it as a 'message'. So is what a method returns a messages?
[04:06:14] krakenr: hmm I see what you're saying with the absolute value
[04:06:18] hk238: the `message passing` style of implementing these things would be that you pass this command to that thing, and it returns you the value. So for an example if you add another thing to the list of things that you could get an absolute value out of, you dont need to chang ethe `absoliute value`command, instead you just includ ea response in the newly defined thing
[04:06:49] hk238: hmm although I might be confusing this with the concept of `data driven..` ... data driven. What was it
[04:07:15] pilne: the more locations that have the ability to modify the same piece of data, the harder things get to debug (in general).
[04:07:52] pilne: it is much "safer" to send a message to retrieve a copy of data, than to send the data itself.
[04:07:58] hk238: I'm confused about this for, well I was watchin a lecture on this a few days ago when going to bed, and now I cant remember it corretcly
[04:08:08] hahuang61: has joined #ruby
[04:08:39] pilne: however, sharing a mutable variable instead of copying it, will have lower overhead... but we aren't talking about "low level" like that when we think ruby in general :)
[04:08:42] hk238: there was 3 concepts involved, but somehow I have formed categories for only two, and am miximg up the data driven approach with the message passing approach and cant tell what the difference is, I should go back and read up on tha Iguess... anyone else know what that distinction might be? ^^
[04:09:23] sumobob: has joined #ruby
[04:09:40] krakenr: pilne, what do you mean by 'send a message'
[04:10:52] ptx0: has joined #ruby
[04:10:55] ptx0: has joined #ruby
[04:11:03] Es0teric: has joined #ruby
[04:11:24] rattatmatt: has joined #ruby
[04:12:55] pilne: object A contains data a, b and c. object W contains x, y, and z. there are (at least) two ways to let W know about information in A. 1st A can expose access to it's data (a, b, c) to the outside world, or it could be setup so that W sends a request (message) to A, requsting a copy of the data, in this scenario, only A can modify it's data by default/design, but in the first, one could (intentionally or not) allow outside things to
[04:12:55] pilne: modify A's data.
[04:14:19] pilne: making/returning a copy is more "expensive" in terms of memory, cpu, and gc pressure, but if minimizing resource utilization is the key goal, you probably should be programming closer to the metal to begin with :)
[04:15:23] pilne: keep in mind, i'm not an expert at this by any means
[04:15:32] krakenr: I see what you mean
[04:15:41] krakenr: That makes sense
[04:16:12] krakenr: so instead of direct access to the variable, you wrap them into a message and send it off
[04:17:25] pilne: fwiw, ruby tends to make it more like "you can't see this" "you can read this" and "you can access (read/modify) this"
[04:17:34] pilne: (from the outside)
[04:18:09] pilne: instead of "pure" messaging, but the "read" it can kinda be seen as a very similar approach, which will only make a "copy" if needed when called.
[04:18:21] choke: has joined #ruby
[04:18:29] pilne: please someone correct me if i'm talking like ace ventura doing his "assy mcgee" impersonation
[04:18:39] electrostat: has joined #ruby
[04:18:49] chare: has joined #ruby
[04:20:26] pilne: hk, i'm still skimming data-driven programming and it isn't really clicking hard with me yet
[04:22:59] allcentury: has joined #ruby
[04:23:56] loseyourmind: has joined #ruby
[04:24:09] toretore: has joined #ruby
[04:25:52] hk238: the lecture I was watching is from youtube Computer Science 61A lecture 15, I think the year for this one was 2007.. The topic of the lecture is generic operators (also video title I think)
[04:26:02] dgncn: has joined #ruby
[04:26:30] hk238: it contained an example with squares and circles and different ways of implementing a system of calculating their `area` so that was like the absolute example
[04:26:32] CloCkWeRX: has joined #ruby
[04:26:36] pilne: it seems lie sed and awk are "good" examples of it, and that pattern-matching is a big part of it
[04:26:48] Hanmac: pilne: hm thats true for String and small array struff ... like when you have a string like "abcde" and you get the substring from it "bcd" it didnt make a new copy of it but use shared memory if able until you modify one of them. ... do you mean something like that?
[04:27:04] pilne: yes hanmac
[04:27:34] pilne: the ruby runtime is getting so very slick these days :)
[04:29:30] mistermocha: has joined #ruby
[04:30:38] Hanmac: pilne: from pre 2.0 days but should be still valid: http://patshaughnessy.net/2012/1/18/seeing-double-how-ruby-shares-string-values
[04:32:45] hk238: and the first case was `conventional approach` which was basically the worst way of defining things, in that method basically you write in side an operator how it deals with different types, like for an example some conditions.. if the type of this data is , then use that procedure.. and it's basically inefficient or awkward
[04:33:08] hk238: the reasoning being that if yo add a new type like `orange` or whatever, and then you want to include that into the system, you've to look at the definitions of each operation
[04:33:19] hk238: and add a new typetest, and a new procedure for the orange
[04:33:39] hk238: so it just makes things more convoluted
[04:34:06] pilne: i'll agree with that being quite akward
[04:34:12] hk238: then there was a data directed approach, in which case the operators were defined i na different manner, kind of like as a table, so I'm not sure what exact implementation style was... I guess this was the confusing part
[04:34:34] hk238: since the lecture is using schema or how you spell that? and I was going to bed, and when Im lying down, I cant see what the lecturer is typing
[04:34:47] hk238: so anyway I dont know the details of the implementation, but I'm just guessing based on the contetx what it must be
[04:35:38] hk238: and that is so you implement the operator procedure so that first there's a table of operations for each type, or something like that, and whne you include a new type, then you just add a row into the table.. But that seems awfully.. well exactly the same as the conventional approach
[04:36:19] hk238: and thne there was message passing, which was that the operator doesnt need to know anything about the object
[04:36:22] mistermocha: has joined #ruby
[04:36:30] hk238: instead it's defined in each object
[04:36:40] hk238: or something like that
[04:37:22] hk238: hmm I guess I dont know it accurately enough to make the difference out :o
[04:37:59] hk238: or maybe the difference was that
[04:39:09] stardiviner: has joined #ruby
[04:40:04] hk238: I dont know I'm getting too confused about this
[04:41:14] pilne: kinda sounds like there is some multiple dispatch involved in there too, but i'm tired as well.
[04:41:22] dc1: has joined #ruby
[04:42:11] ponga: has joined #ruby
[04:42:31] hk238: hmm maybe the difference was something of the sort that the function call included the type, either so that there isa routing layer with the type, that could be implemented as a table with functions
[04:43:00] dhruvasa1: has joined #ruby
[04:43:39] hk238: or that there's a separate function for each type, but that doesnt seem very efficient....... Ahh I dont kno.w But the message passing thing is convenient and it was the 3rd case, so send the object the message `area` and expect the object to return a value as a return message or somtehing like that
[04:44:07] hk238: kind of hoping someone would clear this up but I dont know.... I think it's good time to get some more coffee ^^
[04:45:16] bigkevmcd: has joined #ruby
[04:47:16] kt2: has joined #ruby
[04:47:28] jaguarmagenta: has joined #ruby
[04:48:36] rattatmatt: has joined #ruby
[04:49:25] RegulationD: has joined #ruby
[04:49:33] n1x-nz: has joined #ruby
[04:52:25] pilne: my brain is gettin too fuzzy tbh, night all
[04:53:30] pawnbox: has joined #ruby
[04:55:08] hahuang61: has joined #ruby
[04:57:35] zacstewart: has joined #ruby
[04:57:53] d0lph1n98: has joined #ruby
[04:59:14] dminuoso: has joined #ruby
[05:00:58] moeabdol: has joined #ruby
[05:04:41] nictrasavios: I just learned about splat arguments. As a c guy.... "WHAT IS THIS MADNESS!"
[05:04:55] chipotle: has joined #ruby
[05:06:15] nictrasavios: You mean ruby programmers don't like writing 15 overloaded method names, and protoyping all of them? Savages. I'm in love with it.
[05:06:38] Hanmac: nictrasavios: just wait how you will react when you see the double-splat ;P (its for using keyword arguments in newer ruby)
[05:07:12] nictrasavios: I don't even think my book is new enough for that ;P.
[05:09:09] nictrasavios: It was written for ruby 1.9 and rails 3.
[05:09:30] Hanmac: nictrasavios: there you can see all the different parameter types: (d,e,f are for keyword stuff)
[05:09:30] Hanmac: >> def meth(a,b=1,*c, d:, e: 4, **f, &g);end; method(:meth).parameters
[05:09:48] ruby[bot]: hanmac: # => [[:req, :a], [:opt, :b], [:rest, :c], [:keyreq, :d], [:key, :e], [:keyrest, :f], [:block, :g]] (https://eval.in/595359)
[05:10:04] nictrasavios: I'm so confused.
[05:11:05] nictrasavios: I think if it wasen't 2:10am, my brain could slowly make sense of that.
[05:11:26] Hanmac: in most of the cases you might not need the keyword stuff, but maybe if you have to much parameters, you might end up using an option-hash ... the keyword args are a development from that
[05:12:17] loseyourmind: has joined #ruby
[05:12:43] nictrasavios: Man, I'm still trying to get one 3rd party API to send me a list of users, another API to send me its, and then match them in a hash.
[05:13:40] ledestin: has joined #ruby
[05:14:51] nictrasavios: Tricky part is, one API sends "usernames", and one is based off actual names, so it's like: if calendar[1] == messenger[1].firstname do users[messenger] = calendar XD
[05:14:58] Hanmac: example compared keyargs with option hash
[05:14:58] Hanmac: >> def meth(key: 4); key; end; meth(key: 5)
[05:15:01] ruby[bot]: hanmac: # => 5 (https://eval.in/595360)
[05:15:16] Hanmac: 19>> def meth(opt); opt.fetch(:key, 4); end; meth(key: 5)
[05:15:22] ruby[bot]: hanmac: # => 5 (https://eval.in/595361)
[05:18:41] l4v2: I’ve been stuck all day on one thing.
[05:18:59] l4v2: I’d like to solve something today
[05:19:44] l4v2: I asked earlier for someone to answer it and I get the usual game of clue. So I’m done trying to come up with this answer on my own
[05:20:16] sauvin: has joined #ruby
[05:21:10] l4v2: Can someone write the line of code i need in this snipet https://gist.github.com/anonymous/7d8a1da9f05c92b2d9ca05a63e1947b7
[05:21:14] maloik: has joined #ruby
[05:21:45] l4v2: It’s the 8th line that is wrong
[05:22:10] toretore: why do you have :color in there?
[05:22:44] l4v2: idk, because the comment says cars with color. (not being mean here, but I’m being pissed off with this stupid thing)
[05:23:02] toretore: do you know sql?
[05:23:48] toretore: ok, so can you tell me what the sql would look like?
[05:23:55] l4v2: But like most things I’m rusty with it, but this Active record stuff is SQL, but not with SQL commands.
[05:24:08] l4v2: it’s 1:30 am I’ve been on this since 9 am
[05:24:24] l4v2: Can someone who knows just tell me
[05:24:39] toretore: maybe you're trying to learn too much at once
[05:24:54] l4v2: Nope, just want the answer
[05:25:04] l4v2: I did the first 20 challenges
[05:25:10] l4v2: no problem
[05:25:30] toretore: you're obviously having problems with some of the basic principles here
[05:26:00] toretore: http://api.rubyonrails.org/classes/ActiveRecord/Base.html
[05:26:04] l4v2: What is the point of a community if people can not jsut answer. Maybe I am, maybe I am missing something Maybe I only got a B+ in that class
[05:26:18] toretore: this will give you a lot of information on how to construct queries with AR
[05:26:37] l4v2: read it 20 times, it could have very easily been a syntax thing. THis is Ruby 1.8
[05:26:57] l4v2: Just need to see the answer, I guaruntee I was all over it
[05:27:14] l4v2: If no one knows it, jsut say so, I will go to bed and skip it
[05:27:19] toretore: ok, so in ruby 1.8 you can't do something(foo: 'bar'), it has to be something(:foo => 'bar')
[05:27:25] zeLemur: has joined #ruby
[05:27:33] l4v2: see, maybe that’s the problem
[05:27:35] nofxx: l4v2, actually you did the wrong question... you don't need answer.. and that sounds bossy anyway
[05:28:05] nofxx: you need why... show the error...
[05:28:10] toretore: if you did do something(foo: 'bar') you would get a syntax error, so it would be obvious
[05:28:19] l4v2: I never ask questions, but if I do I just want an answer.
[05:28:36] zeLemur: Isn't that 1.8 syntax that'd error there?
[05:28:54] zeLemur: 1.8 has been deprecated forever now
[05:28:59] nofxx: l4v2, don't order expect all hash params?
[05:29:14] nofxx: :color means color: :asc ? not using AR for some time now
[05:29:41] cyphase: has joined #ruby
[05:29:42] zeLemur: http://guides.rubyonrails.org/active_record_querying.html#ordering
[05:30:04] zeLemur: whoever is using 1.8 should really upgrade though, that'll break a lot of things in rails
[05:30:29] toretore: l4v2: the sql you want is "select * from cars where color = 'something' order by created_at desc", right?
[05:30:30] l4v2: I’m not good with Active Record, I’m not great with Ruby. You guys are. That’s why I came here
[05:30:47] nofxx: l4v2, also, on different subject: prefer #create! (notice the bang) there, so you won't have any silent failures on that
[05:30:58] toretore: l4v2: yes, we are pretty good, so you should trust that we know what we're doing when we try to help you
[05:31:32] l4v2: I know, but all day on this. I jsut want to see the answer and go to bed
[05:31:45] toretore: l4v2: you could have solved this hours ago if you had listened to us hours ago
[05:31:46] ruby-lang309: has joined #ruby
[05:31:55] zeLemur: not a very great way to learn things
[05:32:03] ruby-lang309: Is Bob the Blob here?
[05:32:10] l4v2: I need the line exactly
[05:32:27] zeLemur: if you always flip to the back of the answers book, you're going to fail the test
[05:32:34] toretore: l4v2: we're not going to give you copy-paste solutions, you know this by now
[05:32:47] zeLemur: ruby-lang309
[05:33:30] zeLemur: l4v2: that's a pretty crappy attitude. They're trying to help you learn
[05:33:46] l4v2: has left #ruby: ()
[05:34:04] baweaver: ACTION sighs
[05:34:09] baweaver: that one won't learn
[05:34:40] siaw23: has joined #ruby
[05:34:51] zeLemur: they've been here before?
[05:35:04] the_drow: has joined #ruby
[05:35:09] baweaver: yeah, but let's keep the offtopic over on #ruby-offtopic zeLemur
[05:35:13] toretore: it's really strange how some people work so hard to not learn anything and end up spending so much more time on everything than they have to
[05:35:25] siaw23: I have a method like this “sanitize(excerpt, tags: 'em') “ with an error that’s saying “You should pass :tags as an Enumerable”. how do i pass a symbol as enumerable?
[05:35:26] zeLemur: oops, ok, sorry
[05:35:44] baweaver: siaw23 probably the valie
[05:35:51] giz|work: has joined #ruby
[05:35:54] baweaver: tags: ['em']
[05:36:05] tmtwd: has joined #ruby
[05:36:19] siaw23: oh. is that so? let me check :D
[05:36:33] toretore: siaw23: what they actually mean is probably "anything that implements each"
[05:36:37] baweaver: because a hash is enumerable
[05:36:57] baweaver: It's _technically_ correct, but vague for newer folks
[05:37:24] siaw23: vague for me :D
[05:37:29] siaw23: looks like it’s working
[05:37:31] siaw23: thanks :)
[05:38:34] benlieb: has joined #ruby
[05:40:33] howdoi: has joined #ruby
[05:42:04] loseyoumind: has joined #ruby
[05:42:51] jetpack_joe: has joined #ruby
[05:44:32] krakenr: can anyone think of a better way to refactor this to make it more succinct? https://gist.github.com/KrakenHH/bcb3c924c53fdd22f453470057b14ca6
[05:45:02] baweaver: give me a sec
[05:45:07] baweaver: I'll comment on the gist
[05:45:41] smathy: has joined #ruby
[05:45:59] krakenr: much appreciated
[05:46:51] baweaver: arrays << [*0..3, *7..10, *14..17].map { |n| flat_grid[x + n * 7] }
[05:46:53] baweaver: pretty much that
[05:47:39] krakenr: jesus that's beautiful
[05:48:12] matp: has joined #ruby
[05:50:20] RegulationD: has joined #ruby
[05:51:39] nankyokusei: has joined #ruby
[05:52:17] krakenr: baweaver, what do the *'s do? [*0..3, *7..10, *14..17].map { |n| flat_grid[x + n * 7] }
[05:52:31] baweaver: >>[*0..3, *7..10, *14..17]
[05:52:35] ruby[bot]: baweaver: # => [0, 1, 2, 3, 7, 8, 9, 10, 14, 15, 16, 17] (https://eval.in/595375)
[05:52:51] baweaver: splats, or rather flattens an Enumerable
[05:53:40] baweaver: >> head, *tail = [1,2,3,4,5]; tail # that also lets you do this
[05:53:51] ruby[bot]: baweaver: # => [2, 3, 4, 5] (https://eval.in/595379)
[05:54:20] nofxx: tail recursive!
[05:59:39] duoi: has joined #ruby
[06:00:01] dminuoso: has joined #ruby
[06:00:16] voodoofish4301: has joined #ruby
[06:06:00] Yzguy: has joined #ruby
[06:06:06] loseyoumind: has joined #ruby
[06:06:59] yfeldblum: has joined #ruby
[06:07:20] pawnbox: has joined #ruby
[06:07:29] cajone: has joined #ruby
[06:10:08] uranellus: has joined #ruby
[06:10:08] uranellus: has joined #ruby
[06:12:26] dionysus69: has joined #ruby
[06:14:11] roamingdog: has joined #ruby
[06:21:22] rippa: has joined #ruby
[06:24:48] allcentury: has joined #ruby
[06:28:13] xall: has joined #ruby
[06:32:10] n__dles: has joined #ruby
[06:32:55] allcentury: has joined #ruby
[06:37:28] emiltin: has joined #ruby
[06:39:13] rbennacer: has joined #ruby
[06:47:30] Vile`: has joined #ruby
[06:48:16] jaguarmagenta: has joined #ruby
[06:48:21] pawnbox: has joined #ruby
[06:49:07] moeabdol: has joined #ruby
[06:49:52] tildes: has joined #ruby
[06:50:04] craigp_: has joined #ruby
[06:51:03] TomyLobo: has joined #ruby
[06:51:12] RegulationD: has joined #ruby
[07:00:48] dminuoso: has joined #ruby
[07:01:13] allcentury: has joined #ruby
[07:05:24] houhoulis: has joined #ruby
[07:07:28] astrobunny: has joined #ruby
[07:08:28] amincd: has joined #ruby
[07:08:28] tax_: has joined #ruby
[07:09:20] n1x-nz: has joined #ruby
[07:09:29] amincd: Hi, could someone explain the behavior of IO#readpartial http://ruby-doc.org/core-2.2.2/IO.html#method-i-readpartial to me? I realize this may be more of a *nix question.. Why does the second last code in the sample code not read everything in the pipe?
[07:09:47] amincd: *second last line in the sample code
[07:14:30] vuoto: has joined #ruby
[07:15:18] toretore: "If the byte buffer is not empty, it returns the data in the buffer. Otherwise if the stream has some content, it returns the data in the stream"
[07:17:52] tAn: has joined #ruby
[07:18:20] sucks: has joined #ruby
[07:18:56] chipotle: has joined #ruby
[07:23:09] amincd: toretore: so if the byte buffer is not empty, then it only returns the data in the buffer, and does not return the stream content?
[07:25:04] toretore: seems like it
[07:25:32] amincd: toretore: thanks
[07:25:37] toretore: i'm guessing byte buffer == ruby buffer && stream contents == kernel buffer
[07:26:14] houhoulis: has joined #ruby
[07:26:31] solars: has joined #ruby
[07:26:48] amincd: toretore: I see..
[07:28:03] toretore: tbh i've never used readpartial so this is just me guessing
[07:28:42] zacstewart: has joined #ruby
[07:29:04] sucks: has joined #ruby
[07:30:12] amincd: toretore: your explanation makes sense. I panicked when I couldn't immediately understand how it worked and didn't bother to carefully read the explanation about reading the buffer if not empty and otherwise reading the content in the stream
[07:30:48] xall: has joined #ruby
[07:31:04] djbkd: has joined #ruby
[07:33:11] emiltin: has joined #ruby
[07:36:09] kareeoleez: has joined #ruby
[07:36:41] mistermocha: has joined #ruby
[07:38:12] mistermocha: has joined #ruby
[07:39:01] kareeole_: has joined #ruby
[07:40:02] mistermocha: has joined #ruby
[07:41:32] tao_: has joined #ruby
[07:41:45] houhoulis: has joined #ruby
[07:42:11] mistermo_: has joined #ruby
[07:43:30] Sergey: has joined #ruby
[07:44:26] memorasus: has joined #ruby
[07:45:27] sucks: has joined #ruby
[07:46:01] mistermocha: has joined #ruby
[07:47:11] hahuang61: has joined #ruby
[07:47:27] multi_io: has joined #ruby
[07:48:10] mistermo_: has joined #ruby
[07:49:56] mistermo_: has joined #ruby
[07:51:41] DoubleMalt: has joined #ruby
[07:51:54] mistermocha: has joined #ruby
[07:52:07] RegulationD: has joined #ruby
[07:52:28] nankyokusei: has joined #ruby
[07:52:54] rann: has joined #ruby
[07:54:06] mistermo_: has joined #ruby
[07:55:50] mistermo_: has joined #ruby
[07:57:49] mistermocha: has joined #ruby
[08:00:55] Kero: has joined #ruby
[08:00:57] mistermo_: has joined #ruby
[08:01:30] dminuoso: has joined #ruby
[08:02:38] Yzguy: anyone have experience with Sequel?
[08:02:42] mistermocha: has joined #ruby
[08:02:44] allcentury: has joined #ruby
[08:03:19] pawnbox: has joined #ruby
[08:03:20] apeiros: ?anyone Yzguy
[08:03:20] ruby[bot]: Yzguy: Just ask your question, if anyone has, is or can, they will respond.
[08:03:55] apeiros: and people over in #sequel probably all have
[08:04:14] Yzguy: none of them responding :(
[08:04:27] sandelius: has joined #ruby
[08:04:30] Yzguy: anywho: https://github.com/slaney/whereeat/blob/yzguy/refactor/app.rb
[08:04:43] Yzguy: when I call /places I get a array with a hash in it
[08:04:45] mistermo_: has joined #ruby
[08:04:50] Yzguy: not sure why i'm getting the array at all
[08:05:26] apeiros: how'd you imagine getting a list of places if not as an array?
[08:06:00] Yzguy: well its suppose to be a json object
[08:06:10] Yzguy: [{"id":1,"name":"McMenamins"},{"id":2,"name":"Lompoc"}]
[08:06:39] mistermo_: has joined #ruby
[08:07:17] Yzguy: i gotta qualify it or whatever
[08:07:20] apeiros: a note on "json object":
[08:07:22] apeiros: ?jsonobject
[08:07:22] ruby[bot]: there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
[08:07:45] chipotle: has joined #ruby
[08:07:53] apeiros: and in your case, Place.all.to_json you have a string which contains a serialized array (because "list of places" -> array)
[08:08:34] apeiros: your `get '/places/:id'` is what you'd use to get a single place
[08:08:37] mistermocha: has joined #ruby
[08:09:40] msvbhat: has joined #ruby
[08:10:35] Yzguy: oh jeez, okay i understand how
[08:11:05] Yzguy: i think i was expecting a structure like { 'places': [ {'id': 1, 'name': 'McMenamins'} ] }
[08:11:27] tAn: has joined #ruby
[08:12:35] binaryplease1: has joined #ruby
[08:13:49] Yzguy: im crazy, ok this is working as I wanted
[08:14:27] Yzguy: the weird curl output was messing me up with it showing the speeds n stuff
[08:14:37] mistermocha: has joined #ruby
[08:15:26] SilverKey: has joined #ruby
[08:16:40] mistermocha: has joined #ruby
[08:18:27] mistermo_: has joined #ruby
[08:18:48] pawnbox: has joined #ruby
[08:20:26] mistermo_: has joined #ruby
[08:22:15] dc1: has joined #ruby
[08:22:33] mistermocha: has joined #ruby
[08:24:08] lxsameer: has joined #ruby
[08:24:23] mistermo_: has joined #ruby
[08:26:15] xall: has joined #ruby
[08:26:21] mistermo_: has joined #ruby
[08:26:41] vuoto: has joined #ruby
[08:27:18] firstdayonthejob: has joined #ruby
[08:28:19] mistermocha: has joined #ruby
[08:29:48] houhoulis: has joined #ruby
[08:30:16] mistermocha: has joined #ruby
[08:30:35] zacstewart: has joined #ruby
[08:32:24] mistermo_: has joined #ruby
[08:33:02] cyphase: has joined #ruby
[08:34:20] mistermo_: has joined #ruby
[08:36:10] mistermocha: has joined #ruby
[08:37:20] moeabdol: has joined #ruby
[08:38:18] mistermo_: has joined #ruby
[08:40:19] mistermo_: has joined #ruby
[08:40:22] kareeoleez: has joined #ruby
[08:40:54] miqlas-H: has joined #ruby
[08:41:27] dc1: has joined #ruby
[08:42:06] mistermocha: has joined #ruby
[08:46:01] mistermocha: has joined #ruby
[08:47:46] hahuang61: has joined #ruby
[08:47:48] mistermo_: has joined #ruby
[08:47:50] allcentury: has joined #ruby
[08:48:59] jaguarmagenta: has joined #ruby
[08:49:48] mistermo_: has joined #ruby
[08:50:28] Ishido: has joined #ruby
[08:50:37] cyphase: has joined #ruby
[08:51:21] harfangk: has joined #ruby
[08:52:00] mistermocha: has joined #ruby
[08:52:57] RegulationD: has joined #ruby
[08:54:07] mistermocha: has joined #ruby
[08:55:27] Es0teric: has joined #ruby
[08:55:51] mistermocha: has joined #ruby
[08:57:51] mistermo_: has joined #ruby
[08:59:56] mistermo_: has joined #ruby
[09:00:17] pawnbox: has joined #ruby
[09:00:18] dhruvasagar: has joined #ruby
[09:01:19] strigon33: has joined #ruby
[09:01:45] mistermocha: has joined #ruby
[09:02:15] dminuoso: has joined #ruby
[09:03:24] pawnbox: has joined #ruby
[09:03:41] mistermo_: has joined #ruby
[09:05:40] mistermo_: has joined #ruby
[09:07:36] mistermocha: has joined #ruby
[09:07:37] chipotle: has joined #ruby
[09:08:09] tao_: has joined #ruby
[09:08:54] marr: has joined #ruby
[09:09:27] mistermo_: has joined #ruby
[09:10:07] Endie: has joined #ruby
[09:11:35] mistermocha: has joined #ruby
[09:12:13] zeroDi: has joined #ruby
[09:13:13] bkxd: has joined #ruby
[09:13:33] mistermo_: has joined #ruby
[09:15:32] mistermo_: has joined #ruby
[09:16:54] spider-mario: has joined #ruby
[09:17:25] mistermocha: has joined #ruby
[09:18:46] sepp2k: has joined #ruby
[09:20:48] AcidCrash: has joined #ruby
[09:21:31] tildes: has joined #ruby
[09:21:46] azor: has joined #ruby
[09:23:35] tape88: has joined #ruby
[09:26:11] A124: has joined #ruby
[09:30:37] allcentury: has joined #ruby
[09:31:19] zacstewart: has joined #ruby
[09:32:11] tildes: has joined #ruby
[09:33:10] colegatron: has joined #ruby
[09:36:14] eugenmayer1: has joined #ruby
[09:36:44] eugenmayer1: hello. Writing rake tasks, i fail with my includes. I tried to adjust LOAD_PATH, but still, i cannot require utils like this: https://goo.gl/Ijji4c
[09:37:11] eugenmayer1: i could using ./utils/utils .. or using require_relative .. but i would try to avoid anything relative
[09:37:38] eugenmayer1: more or less, either defining the includes relative to the Rakefile automatically (no matter in which rake task or which folder )
[09:37:45] eugenmayer1: or by search-path. Any suggestions?
[09:37:52] sdothum: has joined #ruby
[09:38:31] apeiros: what's the output of your `puts lib`?
[09:38:40] nankyokusei: has joined #ruby
[09:38:53] apeiros: common pattern btw. is to have a "lib" dir and have that in $LOAD_PATH, not your project directory.
[09:38:59] eugenmayer1: the realpath of the folder, where the Rakefile is located. The file you see is the Rakefile
[09:39:18] eugenmayer1: i could do that wiht ulti
[09:40:02] apeiros: eugenmayer1: I'm quite sure your output includes "Rakefile"
[09:40:24] eugenmayer1: apeiros: change the Layout as you required: https://goo.gl/o4OeOH
[09:40:27] symm-: has joined #ruby
[09:40:27] apeiros: i.e. I'm quite sure your output shows that your `lib` variable is not actually the directory, but the path to the Rakefile itself
[09:40:34] eugenmayer1: still LoadError: cannot load such file -- utils
[09:41:26] eugenmayer1: you are totally right.
[09:41:35] eugenmayer1: .. /Users/em/Development/repos/dwm/Rakefile/lib
[09:41:50] gettalong: has joined #ruby
[09:41:52] nankyoku_: has joined #ruby
[09:41:59] yeticry: has joined #ruby
[09:42:14] apeiros: which is why you should do as asked ("what's the output of your `puts lib`?") - would have saved some guessing and testing on my side :-p
[09:42:22] eugenmayer1: what would i use if i would like to avoid a regexp / strreplace?
[09:42:28] apeiros: ../ instead of ./ in your expand_path, or __dir__ instead of __FILE__
[09:42:33] eugenmayer1: apeiros: blame it on me.
[09:42:48] siaw23: has joined #ruby
[09:42:58] apeiros: oh I do! :D
[09:43:15] eugenmayer1: ACTION feels punished - but deserved
[09:43:19] eugenmayer1: __dir__ works great.
[09:43:35] jhass: File.join(__dir__, "lib")
[09:43:40] jhass: it should expand already
[09:43:43] apeiros: File.expand_path('lib', __dir__)
[09:43:55] apeiros: jhass: afair __dir__ isn't always expanded, just like __FILE__
[09:44:41] jhass: "Returns the canonicalized absolute path of the directory of the file from which this method is called. It means symlinks in the path is resolved"
[09:44:45] eugenmayer1: i used lib = File.expand_path('./lib', __dir__)
[09:45:06] apeiros: oh, then it's either different from __FILE__, or that behavior got changed
[09:45:33] eugenmayer1: who ever designed invoke or execute .. should try again.
[09:45:43] craigp_: has joined #ruby
[09:45:50] jhass: they can't unfortunately
[09:45:52] emiltin: has joined #ruby
[09:46:27] eugenmayer1: Yes. And thats why it is so utterly broken + usless ;/
[09:47:07] eugenmayer1: the point that .reenable exists and has been ever documented. This method is the aquivalent of "pray and run"
[09:47:38] eugenmayer1: pray, that the invoked task does himself not run other tasks. Or you end up having such a huge mess, calling a tasks, which skips other tasks, eventhough you reenabled him
[09:48:11] eugenmayer1: also that "rembering i ran this task before" does not at all inspect the input arguments, and does not include them in his match, is .. man.
[09:48:20] jhass: they can't because they're not with us anymore
[09:48:32] hahuang61: has joined #ruby
[09:49:56] eugenmayer1: jhass: I know that Jim has passed, sad enaugh to not repeat it all day long i guess. But that does not mean this needs to stay as is until end of time, isnt it
[09:50:06] apeiros: tasks were not supposed to have input parameters. and writing tasks which should be library functions/methods is bad design. IMO if a task is more than ~5 lines -> write a class/library
[09:50:36] jhass: eugenmayer1: I was just referring to "they should try again"
[09:50:44] eugenmayer1: apeiros: the way tasks are designed, you should never exceed 1 single line - and that line calls your lib ( always )
[09:50:59] lkb: has joined #ruby
[09:51:15] apeiros: eugenmayer1: I think some amount of glue code is ok in a task
[09:51:19] eugenmayer1: apeiros: and designing tasks having no input parameter is more or less unbelievable :)
[09:51:22] apeiros: but yes, that's the gist
[09:51:38] apeiros: eugenmayer1: I don't say I agree with the "tasks have no input param" design
[09:52:01] apeiros: but it makes sense in a system where tasks invoke other tasks - it's hard to have a sane "nested params" input scheme.
[09:52:06] eugenmayer1: i love rake, but that 2 things kill me. Seriously
[09:52:18] apeiros: I guess there too, if you need input params, rake is just the wrong tool. write an executable.
[09:52:23] apeiros: which in turn can use your library
[09:52:40] eugenmayer1: yes, and know
[09:52:57] eugenmayer1: sure i use OptParser and stuff, but there are downsides - .e.g you can run rake from any subfolder
[09:53:13] eugenmayer1: while, if the bins are not in "global include path, you cannot do that with them
[09:53:14] apeiros: or use something like thor, I think that's built more towards those kinds of goals.
[09:53:18] gettalong: Hey everybody! Anybody here knowing how to tune methods that use splat arguments? Here would be an example: https://gist.github.com/gettalong/2a0dddc359f63bc153cbccad6e574d12
[09:53:51] apeiros: "if the bins are not in "global include path" - uh, guess what, same applies to rake. you can't run rake if your shell can't find it.
[09:53:52] RegulationD: has joined #ruby
[09:54:00] apeiros: and you can write any executable so it find the root of your project
[09:54:02] gettalong: When invoking such a method, multiple temporary arrays are created due to the splats and I try to get rid of them
[09:54:25] spider-mario: has joined #ruby
[09:54:49] apeiros: gettalong: did you measure that those temp arrays are a perf. issue or are you just mentarbating?
[09:55:47] eugenmayer1: apeiros: you can put rake once in you path, thats it
[09:56:12] eugenmayer1: very different if you add custom "executables" for each subproject. Its absolutely unpractical.
[09:56:29] gettalong: apeiros: I measured with allocation_tracer and in my test case millions of arrays were created, so the GC overhead is certainly a problem
[09:56:30] yfeldblum: has joined #ruby
[09:57:01] apeiros: gettalong: if it is truly a problem, then expect arrays and don't splat. i.e. drop all *'s there.
[09:57:16] apeiros: eugenmayer1: use bundler then
[09:58:57] gettalong: apeiros: I know that this would get rid of the temp arrays but then the methods where the calls get dispatched to need to accept an array instead of individual values
[10:00:00] msvbhat: has joined #ruby
[10:00:05] eugenmayer1: apeiros: bundler will help with rake, but not with custom bins, doesnt it?
[10:00:33] apeiros: helps with custom bins too
[10:00:37] eugenmayer1: apeiros: lets say i put bin/exe1 into my project then i go to ./foo/bar and run bundle exec exe1
[10:00:46] eugenmayer1: does this seriously work?
[10:01:06] gettalong: apeiros: The reason for the splats is that the target methods have a varying number of arguments, they don't do something like `def method(*args*)` but `def method(r, g, b)`.
[10:01:16] apeiros: no, you put your bin in a gem you depend on. might also work if your project is a gem itself and part of the Gemfile. don't think I tried that, though.
[10:01:23] tAn: has joined #ruby
[10:01:53] apeiros: gettalong: so? method([r,g,b]), you can choose, but you can't have both.
[10:02:30] apeiros: gettalong: also afaik ruby 2.2 and 2.3 did quite a bit of optimization wrt arguments passing, so if you're not using the newest ruby, that's also something you should try.
[10:02:35] eugenmayer1: apeiros: putting every bin in a gem - is that seriously a practical solution to a simple rake task? even infrastructural that is a huge overkill, or?
[10:03:03] dminuoso: has joined #ruby
[10:03:50] gettalong: apeiros: thanks! I have looked at the Ruby bug tracker and saw some optimization wrt to keyword arguments and splats. Which is one of the reason I'm using keyword arguments bc they are now nearly as fast as regular ones
[10:03:53] eugenmayer1: apeiros: thors looks very promising. Do i suggest right that it is like rake++ ?
[10:04:02] apeiros: eugenmayer1: you have a plethora of ways to solve this. you can also write a "myexec" which you install once, finds your project's root and executes the bin there. e.g. 'myexec foo input args' and if finds your bin/foo and calls it with 'input args'
[10:04:13] eugenmayer1: apeiros: i had a look at a comperison before and though thor is more like capistrano
[10:04:18] apeiros: eugenmayer1: plenty of other ways you could do it come to mind. be creative. solve your problem.
[10:04:45] apeiros: I haven't looked too much into thor, so can't comment on that.
[10:05:03] passbe: has joined #ruby
[10:05:42] eugenmayer1: apeiros: solving problems "just somehow" is not what a strive for, esp when i use rake for devops. It must be portable and easy to install, and most of the solutions you named are neither of this
[10:06:05] clearlybaffled: has joined #ruby
[10:06:12] apeiros: eugenmayer1: um, I think you make it harder than it is
[10:06:42] Endie1: has joined #ruby
[10:07:15] apeiros: having "myexec" and installing it on machines is no more difficult than having rake. but hey, as said - be creative. solve your problem. it's not on me to solve your problem. I just show you some options.
[10:08:08] chipotle: has joined #ruby
[10:08:18] gettalong: apeiros: I will then probably try something like `def invoke1(operator, op)`, `def invoke2(operator, op1, op2)`, ... since most of the operators have only up to four operands
[10:09:17] DenSchub: has joined #ruby
[10:09:53] miqlas-H: I trying to port the latest ruby to Haiku, but i got this: http://termbin.com/3v3g
[10:10:05] miqlas-H: Do you guys have any idea, what went wrong?
[10:10:49] mdw: has joined #ruby
[10:11:22] pandaant: has joined #ruby
[10:11:37] apeiros: miqlas-H: if you don't get help here, try the ruby-core mailing list.
[10:13:48] miqlas-H: apeiros: thanks
[10:13:51] shevy: a happy segfault!
[10:14:01] miqlas-H: Pretty happy segfault
[10:14:04] DenSchub: has joined #ruby
[10:14:33] miqlas-H: Is there a an International SEGFAULT Day already?
[10:14:39] DoubleMalt: has joined #ruby
[10:14:57] jhass: /sources/ruby-2.3.1/.ext/i586-haiku/openssl.so
[10:15:03] jhass: that's suspicious
[10:15:05] tildes: has joined #ruby
[10:15:20] jhass: as if your openssl claims to support stuff it doesn't actually or so
[10:16:02] jhass: resolve symbol "___tls_get_addr" returned: -2147478780
[10:16:35] miqlas-H: Somebody told me, it is defined in gcc; it gets patched in runtime loader.
[10:17:10] DenSchub: has joined #ruby
[10:17:18] trampi: has joined #ruby
[10:17:21] miqlas-H: I trying to compile it in chroot. Outside it compiles fine, but not in chroot. I make something wrong.
[10:18:04] miqlas-H: Maybe something missing from chroot.... or something like that.
[10:19:44] miqlas-H: I actually hate if i see warnings during the compiling. I get always warnings before the error coming, so it is a Pavlov-reflex for me, i think.
[10:19:46] eugenmayer1: apeiros: are you doing devops?
[10:20:21] eugenmayer1: apeiros: any, thank you a lot. You helped me big times!
[10:20:36] apeiros: not on a scale where I'd call it "devops"
[10:24:00] lupine: has joined #ruby
[10:24:00] bkxd: has joined #ruby
[10:24:13] bonhoeffer: has joined #ruby
[10:24:27] bonhoeffer: how could i read 10 1 10 1 10 from stdin into an array
[10:25:29] moeabdol: has joined #ruby
[10:25:55] shevy: if it is a string, .split(' ') on it
[10:25:58] dhruvasagar: has joined #ruby
[10:26:12] ardian_: has joined #ruby
[10:27:03] allcentury: has joined #ruby
[10:27:08] zenguy_pc: has joined #ruby
[10:27:59] ardian_: Hello I am trying to understand some code but this syntax is not well known to me, and I am not sure what it is really doing.
[10:28:11] ardian_: image = Aws::Image.start('param1' => 'param2')
[10:28:18] bonhoeffer: shevy: of course -- thanks!
[10:28:28] ardian_: The :: part is not clear to me.
[10:28:36] conta: has joined #ruby
[10:28:50] miqlas-H: isn't :: the namespace?
[10:29:20] apeiros: yes, it is
[10:29:28] Blue_Ice: has joined #ruby
[10:29:28] Blue_Ice: has joined #ruby
[10:29:39] shevy: it can be like: module Aws; class Image ... or vice versa... or two classes... or two modules
[10:29:40] apeiros: ardian_: Aws is either a module or a class, within which the Image constant is defined
[10:30:29] jinie: has joined #ruby
[10:30:47] ardian_: namespace ? this is a bit new to me, I am learning ruby. Thanks I will read more on that.
[10:32:46] zacstewart: has joined #ruby
[10:43:12] harfangk: has joined #ruby
[10:43:23] jenrzzz: has joined #ruby
[10:43:23] jenrzzz: has joined #ruby
[10:43:28] giz|work: has joined #ruby
[10:45:55] Hanmac: hey shevy did you heard about "Yoda_conditions" before? XD
[10:46:56] blackthor: has joined #ruby
[10:47:29] jhass: if 1 == var
[10:47:51] moeabdol: has joined #ruby
[10:48:16] Hanmac: jhass: yeah i laughed when i read that in another ruby article
[10:48:39] shevy: hanmac did not hear it
[10:49:19] hahuang61: has joined #ruby
[10:49:47] jaguarmagenta: has joined #ruby
[10:51:41] craigp_: has joined #ruby
[10:52:22] emiltin: has joined #ruby
[10:52:27] miqlas-H: Can you guys ecplain me the Yoda conditions?
[10:53:03] jhass: miqlas-H: if 1 == var instead of if var == 1
[10:53:11] A124: has joined #ruby
[10:53:29] jhass: "1 is this thing?" instead of "is this thing 1?"
[10:54:11] shevy: that is japanese english!
[10:54:45] RegulationD: has joined #ruby
[10:54:51] tomphp: has joined #ruby
[10:55:00] miqlas-H: what is the result if i compare something to 1 in ruby?
[10:56:09] shevy: I guess it is unusual to have the var appear on the right side
[10:56:59] JoL1hAHN: has joined #ruby
[10:57:37] sarbs: has joined #ruby
[10:58:27] spudowiar: miqlas-H: first case calls Fixnum#==, second calls var.==
[10:58:27] strigon33: has joined #ruby
[10:59:07] miqlas-H: spudowiar: i have no idea about ruby, so i cannot understand you, sorry.
[10:59:13] miqlas-H: i'm just porting ruby,
[10:59:28] spudowiar: miqlas-H: well, operators are just method calls
[10:59:46] spudowiar: miqlas-H: you'll want to learn the language at a lower level if you're porting it
[11:00:14] sdothum: has joined #ruby
[11:00:20] shevy: oh good explanation
[11:00:39] apeiros: spudowiar: they may not be porting it for their own purposes
[11:00:42] spudowiar: shevy: sarcasm?
[11:00:58] spudowiar: apeiros: but still
[11:01:11] miqlas-H: spudowiar: i'm using ruby (trough jekyll) since long time, but the programming site isn't interresting me. Just he posrting. And as ruby got c based bootstrap, i can port it and test it with jekyll.
[11:01:23] apeiros: spudowiar: na, if I'd be porting packages for an OS, I wouldn't want to learn each package. it's not necessary for the task of "porting".
[11:01:41] spudowiar: apeiros: ah, I see
[11:01:53] spudowiar: apeiros: I get what you're saying
[11:02:07] miqlas-H: i just want to update the haiku package to the latest one. Thats all.
[11:02:07] shevy: spudowiar where do you read sarcasm?
[11:02:55] miqlas-H: We already have a working ruby port, but it is a bit old: ruby 2.2.2p95 (2015-04-13 revision 50295) [i586-haiku]
[11:02:56] spudowiar: shevy: "oh good explanation" reads a bit like "yeah... You think *that* is a good way to explain it -- no way! lol"
[11:03:27] shevy: spudowiar naaaah, I have no idea how you interprete it but just to make it clear, there was no sarcasm in my statement, I simply have not thought about that difference at all
[11:03:29] spudowiar: shevy: well, to me, anyway
[11:03:46] dminuoso: has joined #ruby
[11:03:47] moeabdol: has joined #ruby
[11:03:48] spudowiar: shevy: oh OK. Thanks :)
[11:03:53] miqlas-H: As i'm not a software developer, i cannot understand too much tings. But configure && make possible for me.
[11:04:01] spudowiar: It might be #==? I'm not sure
[11:04:25] spudowiar: No, it's just #==
[11:04:28] cajone: has joined #ruby
[11:04:44] miqlas-H: But i know a bit python, c and c++, so i thnk i can port some things.
[11:05:19] spudowiar: Essentially, in Ruby, every operator is a method of the first operand. For a binary operator, the second operand is passed as an argument.
[11:05:49] shevy: miqlas-H if it just would not segfault already!
[11:06:07] spudowiar: ideally (a == b) == (b == a) but not always
[11:06:09] spudowiar: shevy: haha
[11:07:16] jhass: miqlas-H: this does look more like a Haiku than a Ruby issue tbh, probably one of your compatibility layers missing in the chroot
[11:09:17] miqlas-H: It segfaults :(
[11:11:22] jhass: the segfault is just the symptom
[11:11:36] jhass: your dynamic linker returning an invalid reference is the issue
[11:12:38] Mon_Ouie: has joined #ruby
[11:15:03] SCHAAP137: has joined #ruby
[11:18:40] miqlas-H: jhass: i'm reading about phlosophy, what it means then?
[11:19:37] miqlas-H: did i made sething wrng in my life? maybe the linker want to show me, tat something wrong in my lifestyle.
[11:19:57] miqlas-H: that there is
[11:20:18] miqlas-H: maybe i should chage on my lifestyle.
[11:20:46] jhass: tls in this context standing for thread local storage instead of transport layer security is quite mean I guess
[11:21:19] miqlas-H: jhass: i'm reading this: https://en.wikipedia.org/wiki/Philosophy_of_S%C3%B8ren_Kierkegaard
[11:22:03] miqlas-H: I think the same, jhass
[11:22:24] jhass: dunno, Kant had some pretty nasty stuff
[11:23:01] miqlas-H: Kant was a crazy man, i think. I had to learn about him too much.
[11:23:01] jhass: but I'm not into philosophy, so no idea how much of the nasty stuff influenced Kierkegaard
[11:23:21] miqlas-H: But ofc he had also sme good points.
[11:23:41] jhass: anyway, that's really offtopic ;)
[11:23:46] miqlas-H: and how ruby influenced Kant.
[11:24:21] dc1: has joined #ruby
[11:24:32] miqlas-H: I like to see a software developer philosopher. It could be nice. Ah, RMS.
[11:25:27] miqlas-H: *I would like to see
[11:25:37] madgen: has joined #ruby
[11:25:43] miqlas-H: But RMS already did that
[11:27:18] jhass: well I think the 60s to including 80s had a whole bunch of techno-philosophy
[11:27:25] tildes: has joined #ruby
[11:28:07] jhass: perhaps RMS kinda condensed a lot of that in the late 80s
[11:28:34] eugenmayer1: apeiros: thor is really good. Especially when we talk about arguments and tasks. Invocation has the same rules though
[11:28:44] eugenmayer1: means https://github.com/erikhuda/thor/wiki/Invocations
[11:29:51] RegulationD: has joined #ruby
[11:31:43] miqlas-H: I need to go.
[11:33:21] zacstewart: has joined #ruby
[11:34:48] nankyokusei: has joined #ruby
[11:40:24] DoubleMalt: has joined #ruby
[11:41:06] shevy: ruby and kant ... this channel can be weird sometimes
[11:44:02] tao_: has joined #ruby
[11:45:15] allcentury: has joined #ruby
[11:49:34] jenrzzz: has joined #ruby
[11:49:45] Hanmac: has joined #ruby
[11:50:03] hahuang61: has joined #ruby
[12:01:39] Pumukel: has joined #ruby
[12:02:08] gettalong: apeiros: Regarding are conversation about splats: I updated the code to not use splats where possible while still providing a useful and easy to use API. Result: 81% fewer arrays created and 23% faster for my test case :) Now only about 5 times slower than Java code doing the same
[12:04:30] dminuoso: has joined #ruby
[12:06:18] Mia: has joined #ruby
[12:06:58] Nahra: has joined #ruby
[12:14:59] hays: has joined #ruby
[12:15:08] boboc: has joined #ruby
[12:15:10] msvbhat: has joined #ruby
[12:17:49] d0lph1n98: has joined #ruby
[12:19:03] Endie: has joined #ruby
[12:19:56] dtzuzu: has joined #ruby
[12:20:59] sandelius: gettalong do the same in crystal and bench it :)
[12:21:57] jhass: just don't actually use any arrays, splats would be faster there
[12:22:46] elementaru: has joined #ruby
[12:22:51] c0mrad3: has joined #ruby
[12:26:01] DTZUBDUB: has joined #ruby
[12:27:53] tAn: has joined #ruby
[12:30:44] RegulationD: has joined #ruby
[12:32:00] lkba: has joined #ruby
[12:33:41] gettalong: sandelius: I actually looked at crystal last weekend and ported some parsing code to crystal. The Ruby code uses StringScanner and Crystal code is based on the Crystal json code.
[12:34:11] gettalong: sandelius: The speed difference wasn't drastic, though. The crystal code took about 7sec and the Ruby code 10sec.
[12:34:48] zacstewart: has joined #ruby
[12:35:16] averagejeoux: has joined #ruby
[12:35:48] gettalong: jhass: the problem is that the splat operator creates arrays and this was the problem in my case
[12:36:19] dhruvasagar: has joined #ruby
[12:37:07] jhass: gettalong: in crystal that is ;)
[12:37:21] c355E3B: has joined #ruby
[12:37:29] jhass: did you compile your thingy with --release?
[12:37:31] gettalong: sandelius: I will definitely look more into Crystal in the future but right now I rather complete the Ruby code
[12:37:49] gettalong: jhass: Ah, good to know ;) And yes, did compile with --release
[12:38:12] sandelius: gettalong Ruby is more than enough 95% of the times soo go for it :)
[12:38:14] jhass: well if you want to us to look over it for any obvious optimizations hop into #crystal-lang ;)
[12:43:21] gettalong: sandelius: Yeah, you are completely right. My code in Ruby outperforms some code in C++ after I though a bit more about the problem ;-) -- see https://gist.github.com/gettalong/8955ff5403fe7abb7bee and the benchmark for e.pdf (hexapdf vs qpdf)
[12:43:43] gettalong: jhass: thanks, I was there last week and you already helped me :)
[12:44:05] jhass: heh, sorry I don't memoize nicks :)
[12:44:50] gettalong: jhass: No problem. As I said I will need to learn the Crystal basics so that I have a better understanding of how to do things in crystal
[12:46:46] gettalong: has joined #ruby
[12:47:02] jenrzzz: has joined #ruby
[12:49:04] tomphp: has joined #ruby
[12:49:35] davedev24: has joined #ruby
[12:50:35] jaguarmagenta: has joined #ruby
[12:50:47] hahuang61: has joined #ruby
[12:52:53] GodFather: has joined #ruby
[12:53:03] lkb: has joined #ruby
[12:59:44] hogetaro: has joined #ruby
[12:59:55] shevy: until it will become crystal clear
[13:00:59] ekinmur: has joined #ruby
[13:02:04] aryaching: has joined #ruby
[13:03:59] Es0teric: has joined #ruby
[13:05:16] dminuoso: has joined #ruby
[13:13:14] Who: has joined #ruby
[13:13:48] freerobby: has joined #ruby
[13:19:09] loseyoumind: has joined #ruby
[13:22:31] AlexRussia: has joined #ruby
[13:31:35] RegulationD: has joined #ruby
[13:35:05] zacstewart: has joined #ruby
[13:37:51] benlieb: has joined #ruby
[13:37:55] gregf: has joined #ruby
[13:39:20] dhruvasagar: has joined #ruby
[13:41:22] Ishido: has joined #ruby
[13:44:02] helpa: has joined #ruby
[13:44:15] Tempesta_: has joined #ruby
[13:45:52] adambeynon_: has joined #ruby
[13:46:02] zzak____: has joined #ruby
[13:46:05] solocshaw: has joined #ruby
[13:46:06] err_ok_: has joined #ruby
[13:46:06] jmhmccr_: has joined #ruby
[13:46:21] staticfox`: has joined #ruby
[13:46:24] frode15243_: has joined #ruby
[13:46:30] rheddry: has joined #ruby
[13:46:35] dhk: has joined #ruby
[13:46:43] Lloyd__: has joined #ruby
[13:46:43] benlieb_: has joined #ruby
[13:47:04] Cyrus1: has joined #ruby
[13:47:10] meinside_: has joined #ruby
[13:47:10] Hates__: has joined #ruby
[13:47:11] jimcroft_: has joined #ruby
[13:47:17] im0b_: has joined #ruby
[13:47:23] daxroc1: has joined #ruby
[13:47:26] solocshaw: has joined #ruby
[13:47:26] pizzaops_: has joined #ruby
[13:47:34] vikid_: has joined #ruby
[13:47:35] bttf_: has joined #ruby
[13:47:42] zrl__: has joined #ruby
[13:47:59] KINGSABRI___: has joined #ruby
[13:48:02] spidermario: has joined #ruby
[13:48:13] ggherdov_: has joined #ruby
[13:48:30] madhatter: has joined #ruby
[13:48:33] Some-body_: has joined #ruby
[13:48:39] angelixd_: has joined #ruby
[13:48:39] c0mrad3___: has joined #ruby
[13:48:42] Prira: has joined #ruby
[13:48:42] abort_: has joined #ruby
[13:49:03] pabst: has joined #ruby
[13:49:09] piotrj_: has joined #ruby
[13:49:20] sunya7a__: has joined #ruby
[13:49:25] Azure|dc: has joined #ruby
[13:49:48] lewix_: has joined #ruby
[13:49:54] kapowaz_: has joined #ruby
[13:50:00] arlek: has joined #ruby
[13:50:02] RazorX-: has joined #ruby
[13:50:24] twodayslate_: has joined #ruby
[13:50:33] cfillion_: has joined #ruby
[13:50:35] jinie_: has joined #ruby
[13:50:37] bestie_: has joined #ruby
[13:50:39] tvsutton_: has joined #ruby
[13:50:40] sorah_: has joined #ruby
[13:50:46] SirFunk_: has joined #ruby
[13:50:48] darix-: has joined #ruby
[13:50:48] hfp__work: has joined #ruby
[13:50:51] electrostat_: has joined #ruby
[13:50:51] mexis_: has joined #ruby
[13:50:54] aef_: has joined #ruby
[13:50:57] soulcutter: has joined #ruby
[13:51:11] helpa: has joined #ruby
[13:51:18] ullu: has joined #ruby
[13:51:18] dcope: has joined #ruby
[13:51:19] tedwards: has joined #ruby
[13:51:19] jokke1: has joined #ruby
[13:51:19] Olipro_: has joined #ruby
[13:51:22] dcope: has joined #ruby
[13:51:26] bazzy-: has joined #ruby
[13:51:34] hahuang61: has joined #ruby
[13:51:35] SenpaiSilver: has joined #ruby
[13:51:35] LW_Luna: has joined #ruby
[13:51:42] tubbo: has joined #ruby
[13:51:45] CustosLimen: has joined #ruby
[13:51:46] whiteline: has joined #ruby
[13:51:50] tessi_zz: has joined #ruby
[13:51:53] matp: has joined #ruby
[13:51:57] Affix: has joined #ruby
[13:52:04] llua: has joined #ruby
[13:52:08] Tharbakim: has joined #ruby
[13:52:10] tekacs: has joined #ruby
[13:52:12] thejoecarroll: has joined #ruby
[13:52:15] Shidash: has joined #ruby
[13:52:17] TheBrayn: has joined #ruby
[13:52:18] iooner: has joined #ruby
[13:52:24] hayden__: has joined #ruby
[13:52:24] teotwaki: has joined #ruby
[13:52:24] aspiers: has joined #ruby
[13:52:26] avdi: has joined #ruby
[13:52:29] memorasus: has joined #ruby
[13:52:30] solars: has joined #ruby
[13:52:30] Phanes: has joined #ruby
[13:52:30] Phanes: has joined #ruby
[13:52:32] xxneolithicxx: has joined #ruby
[13:52:43] biberu: has joined #ruby
[13:52:58] apeiros: has joined #ruby
[13:53:11] M-mistake: has joined #ruby
[13:53:17] nchambers: has joined #ruby
[13:53:29] spastorino: has joined #ruby
[13:53:31] xxneolithicxx: has joined #ruby
[13:53:37] Vile`: has joined #ruby
[13:53:47] tjvc: has joined #ruby
[13:53:57] bunzz: has joined #ruby
[13:54:00] tjvc: has joined #ruby
[13:54:15] arthurnn: has joined #ruby
[13:54:19] dunj3: has joined #ruby
[13:54:24] arlek_: has joined #ruby
[13:54:28] andersh: has joined #ruby
[13:54:31] moeabdol: has joined #ruby
[13:54:34] northfurr: has joined #ruby
[13:54:47] amitchellbullard: has joined #ruby
[13:54:57] Bugboy1028: has joined #ruby
[13:55:39] TvL: has joined #ruby
[13:56:37] rflot: has joined #ruby
[13:57:28] chip_: has joined #ruby
[13:57:31] shevy: freenode splittings?
[13:57:33] nando293921: has joined #ruby
[13:57:46] arlek: has joined #ruby
[13:59:11] FernandoBasso: has joined #ruby
[14:02:00] Hyuk: has joined #ruby
[14:02:29] kirun: has joined #ruby
[14:02:37] arlek_: has joined #ruby
[14:02:40] macsteps: has joined #ruby
[14:02:41] Tempesta: has joined #ruby
[14:04:00] darix: has joined #ruby
[14:05:05] UnKnOwN|: has joined #ruby
[14:05:44] arlek: has joined #ruby
[14:06:00] dminuoso: has joined #ruby
[14:08:06] spudowiar: has joined #ruby
[14:09:18] arlek_: has joined #ruby
[14:11:22] A124: Does anyone know how to communicate with BDB from current Ruby?
[14:12:18] arlek: has joined #ruby
[14:13:04] xlegoman: has joined #ruby
[14:13:55] nankyokusei: has joined #ruby
[14:15:24] jhass: https://github.com/ruby-bdb
[14:15:32] jhass: literally first google result for "bdb ruby"
[14:15:55] moss: has joined #ruby
[14:16:22] jhass: otoh looks dead
[14:17:12] arlek_: has joined #ruby
[14:17:51] Mia: has joined #ruby
[14:17:51] Mia: has joined #ruby
[14:18:36] diegoviola: has joined #ruby
[14:20:59] ptx0: has joined #ruby
[14:23:18] arlek: has joined #ruby
[14:24:49] Nilium: has joined #ruby
[14:25:09] d0lph1n98: has joined #ruby
[14:26:13] arlek_: has joined #ruby
[14:26:48] Who: has joined #ruby
[14:27:13] vuoto: has joined #ruby
[14:29:28] arlek: has joined #ruby
[14:30:22] DoubleMalt: has joined #ruby
[14:32:32] RegulationD: has joined #ruby
[14:33:36] arlek_: has joined #ruby
[14:33:52] pLaToOn: has joined #ruby
[14:36:07] zacstewart: has joined #ruby
[14:36:55] arlek: has joined #ruby
[14:37:20] conta: has joined #ruby
[14:39:36] A124: jhass Yes, incompatible with 2.3. I am trying to read specification, but kinda vague.
[14:40:07] A124: Or maybe not, just long https://github.com/memcached/memcached/blob/master/doc/protocol.txt
[14:40:16] arlek_: has joined #ruby
[14:40:19] A124: Ups, that is not bdb.
[14:41:30] dhruvasagar: has joined #ruby
[14:41:46] jhass: is this a one off thing or something you need some more permanent solution for?
[14:42:20] nadir: has joined #ruby
[14:42:28] snowy: has joined #ruby
[14:44:06] snowy: has joined #ruby
[14:44:35] catt: has joined #ruby
[14:44:48] A124: jhass Both.
[14:44:49] catt: I need to properly configure the fontpath in the vncserver script when I launch the command 'vncserver :1 -geometry 1680x1050 -depth 32'
[14:45:37] catt: I need to configure properly*
[14:46:08] jhass: A124: heh. Well as it stands Ruby's ecosystem looks dim on this front. If you want to spend the effort on porting the existing gem or making a new one that'd be great, but I think personally I'd look into an alternative, Ruby might simply not be the right tool here
[14:46:43] A124: Crap. I am just iterating over databases and cannot find a good one.
[14:46:53] A124: Except cassandra, which is not that simple.
[14:47:27] jhass: A124: oh so this isn't some legacy to convert but something new entirely?
[14:48:03] pLaTo0n: has joined #ruby
[14:48:39] jhass: catt: is that a question? I'm not sure how it relates to Ruby
[14:48:50] tomphp: has joined #ruby
[14:49:11] catt: Yes, a question.
[14:49:34] jhass: well, could you elaborate?
[14:50:56] eugenmayer1: jhass: how can you even be that friendly in that case. Huge calmness over there :)
[14:51:20] jaguarmagenta: has joined #ruby
[14:51:51] catt: It does not work me the signed: https://rvm.io/rvm/install
[14:51:51] jhass: eugenmayer1: MINASWAN
[14:52:16] jhass: catt: you should get some output with some command to run, did you run that command?
[14:52:17] hahuang61: has joined #ruby
[14:52:54] northfurr: has joined #ruby
[14:54:35] catt: jhass: the output is what you say.
[14:54:46] emiltin: has joined #ruby
[14:54:55] eugenmayer1: jhass: interesting point there ( tltr the fully thing, but still ). I am failing with the "treat with respect" aspect regulary, when the 'other person' obviously has not respect at all
[14:55:03] A124: jhass Yes, new. I even did my flat file databases, but since my knowledge grew. I do not know about good libraries and stuff, if they even exist, and implementing own DB does take time to do it properly, test and benchmark. Indexing and more. I have uses for both key-value and columns, thouch I could cheat on that. So far I got trick with memcache interface on top of bdb, but that does not [...]
[14:55:04] A124: [...] support cursor, so..
[14:55:14] jhass: eugenmayer1: this is obviously just language barrier
[14:55:32] jhass: catt: so all good?
[14:55:33] eugenmayer1: jhass: looks like that
[14:55:35] tao_: has joined #ruby
[14:55:52] edwardly: has joined #ruby
[14:55:52] edwardly: has joined #ruby
[14:55:52] catt: All bad.
[14:56:22] eugenmayer1: jhass: Or its Donald :)
[14:56:24] jhass: catt: please make a gist showing us everything you did so far including all output
[14:56:26] jhass: ?gist catt
[14:56:26] ruby[bot]: catt: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[14:57:46] jhass: eugenmayer1: also http://freenode.net/catalysts
[14:57:49] kareeoleez: has joined #ruby
[14:59:02] eugenmayer1: jhass: i regulary fail on 2 - instand. Like in 2 seconds. And i regulary fail with the assumption obviously
[14:59:03] jhass: A124: what's the project, what kind of data do you want to store and what kind of queries do you have against it?
[15:00:11] jhass: eugenmayer1: I'm not saying I'm perfect, on the contrary. But it's something good to have in mind and remember from time to time
[15:00:44] eugenmayer1: jhass: thats how i got it. What i wrote up there, was a compliment, thus all your sources are interesting.
[15:01:04] jhass: understood as one, thank you ;)
[15:01:36] eugenmayer1: jhass: especially point 11 of http://freenode.net/catalysts is a huge issue in IRC / freenode. #perl most probably is about mastering the negative of http://freenode.net/catalysts (IMOH)
[15:01:38] chip_: has joined #ruby
[15:02:06] diegoviola: has joined #ruby
[15:03:49] eugenmayer1: slighlty offtopic, but actually with some reasonable background: Which IDE are you using for ruby? I am with IntellJ( or Rubymine)
[15:03:52] catt: jhass: https://gist.github.com/anonymous/f678718713f84b15610a031ab57533e0
[15:04:08] jhass: eugenmayer1: most people use $EDITOR and $SHELL ;)
[15:04:27] Es0teric: has joined #ruby
[15:04:30] nictrasavios: has joined #ruby
[15:05:00] eugenmayer1: the reason i ask: i am not a real ruby expert at all. Everytime i write ruby, i struggle due to the autocompletition being that bad in ruby ( due to the language itself .. ) - so i have to look up every method of array/hash/string/gem something
[15:05:00] jhass: vim/zsh being probably the most popular, but emacs, {sublime,atom}/{zsh,fish,bash} are not unseen
[15:05:03] A124: jhass Well, documents, small / larger (bytes to hundreds of kb). That is ideas for key-value with encryption that can use multiple blocks variably. The other is hash table basicaly and meta, tags, and stuff, but the the hashes and data might be tree-like, aka a column record could be multiple of same type.
[15:05:20] tildes: has joined #ruby
[15:05:30] A124: eugenmayer1 Sublime is nice. Atom also, but Atom is kinda slow
[15:05:36] jhass: ?pry eugenmayer1
[15:05:36] ruby[bot]: eugenmayer1: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[15:06:08] jhass: A124: that sounds very... general
[15:06:34] jhass: it's hard to make good suggestions for a description of your project like that
[15:06:46] A124: jhass First case is general blob store, yes, the other is specific.
[15:06:46] dminuoso: has joined #ruby
[15:07:38] eugenmayer1: A124: you seem to stick to nosql already - am i right
[15:07:43] jhass: catt: I don't see anything related to Ruby or RVM in your gist
[15:08:06] A124: eugenmayer1 Yeah, seems so.
[15:08:11] eugenmayer1: reading attributes like tags, trees .. most probably relates to "relations" and that is a pretty good argument against the usage of EVERY nosql
[15:08:47] eugenmayer1: decide wheather you have relations, or not. I intentionally did not say "want relations" not matter what you want - what does the application/domain enforces
[15:09:00] eugenmayer1: if you have relations, keep your fingers way from nosql.
[15:09:22] tAn: has joined #ruby
[15:09:23] eugenmayer1: Secondly, if you have, like you describe, heavy structured data and you _care_ about the structure - do not use nosql
[15:09:27] jhass: postgresql has become a fairly good polyglot actually
[15:09:35] eugenmayer1: what jhass said.
[15:09:44] jhass: the graph stuff is missing in it though
[15:10:03] eugenmayer1: A124: if you really do no have a _really_ good use case for nosql or you are not sure, always pick postgresql
[15:10:36] jhass: unless you need graph stuff that isn't for GIS stuff (then use PostGIS)
[15:11:30] Xeago_: has joined #ruby
[15:11:34] eugenmayer1: A124: i use percona/postgresql/mongodb depending on the app, sometimes 2 of them at the same time.
[15:11:35] armyriad: has joined #ruby
[15:12:01] eugenmayer1: but i really start to dislike mongo, heavily and am looking for alternatives
[15:12:03] jhass: but for simple schema less key value stuff you can just use an hstore column in postgresql
[15:12:23] eugenmayer1: KV can be redist also, if it does not need to persist
[15:12:23] A124: eugenmayer1 Tried, but that means running postgresql, small DB like BDB that can be archived, backep up and copied is simpler for document store. And cassandra is nice with blobs and stuff, but the setup needs more and .. requirements are larger.
[15:12:59] cajone: has joined #ruby
[15:12:59] A124: Will take a look at percona and mongo, I was there when mongo started, well it was not yet mongo, but the improvements over last years are massive.
[15:13:00] jhass: xapian might solve the metadata stuff for you, didn't really look into it yet
[15:13:06] SCHAAP137: has joined #ruby
[15:13:32] eugenmayer1: A124: i do myself not really suggest mongo. They have a HUGE QA issue accross all ecosystems
[15:14:22] eugenmayer1: A124: read http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/comment-page-1/ ..that will help you with "why nosql" and probably, "why not mongodb"
[15:14:40] eugenmayer1: (remember, i am not really biased against mongo .. i am using it mysql )
[15:15:06] nankyokusei: has joined #ruby
[15:19:13] eugenmayer1: i heard about RethinkDB being pretty solid, maybe Riak. Others maybe.
[15:20:27] eugenmayer1: if you though really have a lot of classifications of entities like tags/ categories, dates and you want to filter on them, also provide filter for users or similar ( could be the case in what you described ) use a facetted search like elasticsearch or solr
[15:21:20] eugenmayer1: the important aspect here is, if you will offer either drill-down views on your data, or filters (intelligent filters which give the use a set of values possible, not just "enter somehting here" uups nothing found, try again)
[15:21:58] mistermocha: has joined #ruby
[15:22:09] rbennacer: has joined #ruby
[15:23:30] mistermocha: has joined #ruby
[15:23:42] firstdayonthejob: has joined #ruby
[15:25:29] mistermo_: has joined #ruby
[15:27:17] mistermo_: has joined #ruby
[15:28:01] tourist_F: has joined #ruby
[15:29:12] mistermocha: has joined #ruby
[15:29:35] tildes: has joined #ruby
[15:30:09] tmtwd: has joined #ruby
[15:31:13] User458764: has joined #ruby
[15:31:19] mistermo_: has joined #ruby
[15:32:43] User458764: has joined #ruby
[15:33:10] mistermo_: has joined #ruby
[15:33:21] RegulationD: has joined #ruby
[15:35:06] Kus: has joined #ruby
[15:36:24] ruby[bot]: -bb i9B!*@*$#ruby-banned *!*@gateway/web/freenode/ip.192.241.204.127$#ruby-banned
[15:37:05] mistermocha: has joined #ruby
[15:37:35] zacstewart: has joined #ruby
[15:38:44] Lucky_ABA: has joined #ruby
[15:39:05] mistermo_: has joined #ruby
[15:41:05] mistermo_: has joined #ruby
[15:41:37] Lucky_ABA: has joined #ruby
[15:43:02] zacstewart: has joined #ruby
[15:43:09] mistermocha: has joined #ruby
[15:43:25] craigp_: has joined #ruby
[15:44:00] ullu: has joined #ruby
[15:44:24] ManWithNoName: has joined #ruby
[15:45:13] jaguarmagenta: has joined #ruby
[15:46:07] d0nn1e: has joined #ruby
[15:48:07] ManWithNoName: I would like install ruby v2.2.4 on ubuntu v12, but I need some help because I have only ruby v1.8.7
[15:48:12] rbennacer: has joined #ruby
[15:49:57] ManWithNoName: I have tried using apt-get and aptitude, it seems not work
[15:52:41] catt: jhass: thx
[15:52:45] catt: has left #ruby: ()
[15:53:01] hahuang61: has joined #ruby
[15:54:29] Xeago__: has joined #ruby
[15:54:49] Xeago-: has joined #ruby
[15:55:34] jhass: ManWithNoName: yes it doesn't
[15:56:33] gettalong: has joined #ruby
[15:56:40] jhass: ManWithNoName: looks like you're lucky and https://www.brightbox.com/docs/ruby/ubuntu/ still supports precise
[15:57:45] pawnbox_: has joined #ruby
[15:57:52] jhass: but keep in mind that you have less than a year left of support from canonical for that ubuntu version
[16:00:48] nankyokusei: has joined #ruby
[16:02:28] nictrasavios: Even Mint 17 (Current version, installed a few days ago), only had Ruby 1.9 in the default repos. Since it includes the newest ubuntu repos, that means even current ubuntu is behind.
[16:03:30] davedev24: has joined #ruby
[16:04:25] jhass: nictrasavios: http://packages.ubuntu.com/xenial/ruby
[16:05:27] nictrasavios: Huh, maybe mint screws with it then.
[16:06:47] nictrasavios: Ah, Mint's newest release still uses the Trusty repos.
[16:07:32] dminuoso: has joined #ruby
[16:08:08] davedev24: has joined #ruby
[16:08:53] nictrasavios: Yup, Rosa is on trusty, Sarah is in beta and using Xenial. (Two weeks left!)
[16:09:40] jhass: nictrasavios: http://packages.ubuntu.com/trusty/ruby2.0
[16:10:24] davedev24: has joined #ruby
[16:10:31] the_drow: has joined #ruby
[16:10:58] nictrasavios: jhass http://packages.ubuntu.com/trusty/ruby
[16:11:20] jhass: just saying it's there
[16:11:30] jhass: just not with apt-get install ruby
[16:13:00] nictrasavios: Thank you, I didn't know.
[16:13:51] nictrasavios: I've actually, and this is sad to say considering I'm on a near decade of using linux, how to find if a package I want exists in the defaults without searching through packages.ubuntu.com. Possibly OT, but I wish finding working dev tools was a little easier.
[16:13:53] ManWithNoName: jhass: Thanks for the tip ! I'm a beginner with linux, I didn' think that we need to add other repositories.
[16:14:37] ledestin: has joined #ruby
[16:15:09] jhass: ManWithNoName: why are you starting with a 4 years old linux if it's your first?
[16:17:12] yma__gib: has joined #ruby
[16:17:39] tristanp_: has joined #ruby
[16:18:05] ManWithNoName: jhass : I'm using vagrant with virtualbox. Precise don't need lot of MB and is always supported until April 2017. So I thought it was a good way to begin
[16:20:11] rbennacer: has joined #ruby
[16:23:19] Endie: has joined #ruby
[16:23:44] ManWithNoName: jhass: I can install ruby v2.2 but when I try to switch with this version "sudo ruby-switch --set ruby2.2" and then "ruby -v", it always display v1.8.7
[16:26:40] nictrasavios: Sorry, client bugged out.
[16:26:54] jhass: ManWithNoName: try logging out and back in again
[16:27:23] jhass: ManWithNoName: and does ruby2.2 -v work?
[16:29:06] sepp2k: has joined #ruby
[16:29:42] ManWithNoName: jhass: That works fine after log out then log in ! Thanks
[16:32:37] voodoofish430: has joined #ruby
[16:34:12] RegulationD: has joined #ruby
[16:39:04] chouhoulis: has joined #ruby
[16:42:07] memorasus: has joined #ruby
[16:42:20] nictrasavios: has left #ruby: ("My whole life has been unlimited code works.")
[16:42:39] dhruvasagar: has joined #ruby
[16:43:37] nictrasavios: has joined #ruby
[16:45:13] xall: has joined #ruby
[16:46:53] SCHAAP137: has joined #ruby
[16:49:46] joneshf-laptop: has joined #ruby
[16:53:46] hahuang61: has joined #ruby
[16:56:49] xall_: has joined #ruby
[16:57:25] aries_liuxueyang: has joined #ruby
[16:59:43] diegoviola: has joined #ruby
[17:00:53] firstdayonthejob: has joined #ruby
[17:08:16] dminuoso: has joined #ruby
[17:12:19] rbennacer: has joined #ruby
[17:14:09] snowy: has joined #ruby
[17:15:13] Hobogrammer: has joined #ruby
[17:19:32] moeabdol: has joined #ruby
[17:21:12] sumobob: has joined #ruby
[17:29:39] codecop: has joined #ruby
[17:30:08] dhruvasagar: has joined #ruby
[17:30:35] snowy: has joined #ruby
[17:32:14] nofxx: has joined #ruby
[17:34:29] hk238: has joined #ruby
[17:35:05] RegulationD: has joined #ruby
[17:37:11] houhoulis: has joined #ruby
[17:39:17] emiltin: has joined #ruby
[17:39:33] ctp__: has joined #ruby
[17:42:59] User458764: has joined #ruby
[17:44:31] enterprisey: has joined #ruby
[17:46:36] craigp_: has joined #ruby
[17:47:59] LoneHerm_: has joined #ruby
[17:52:46] benlieb: has joined #ruby
[17:54:31] hahuang61: has joined #ruby
[17:55:38] zacstewart: has joined #ruby
[17:56:16] mdw: has joined #ruby
[17:57:26] eugenmayer1: how would i check if a string is "in ('foo','bar','etc') in short?
[17:57:44] AlexRussia: has joined #ruby
[17:58:17] jaguarmagenta: has joined #ruby
[17:58:33] ctp__: has joined #ruby
[18:00:25] dionysus69: has joined #ruby
[18:01:32] DoubleMalt: has joined #ruby
[18:01:39] nankyokusei: has joined #ruby
[18:02:02] jhass: %w(foo bar etc).include? string
[18:02:03] xall_: has joined #ruby
[18:09:52] dminuoso: has joined #ruby
[18:10:41] tvw: has joined #ruby
[18:11:28] spudowiar: should I be overriding methods in RSpec? or is that bad practice
[18:11:41] spudowiar: also, how should one override a method in an instance simplest?
[18:12:17] Who: has joined #ruby
[18:12:37] Dimik: has joined #ruby
[18:12:58] symm-: has joined #ruby
[18:18:09] ptx0: has joined #ruby
[18:18:40] hectortrope: has joined #ruby
[18:19:04] AcidCrash: has joined #ruby
[18:19:06] jhass: no you should stub them
[18:19:29] jhass: allow(instance).to receive(:foo).and_return(bar)
[18:19:39] spudowiar: jhass: doesn't that need rspec-mocks?
[18:19:56] spudowiar: hmm, I don't know if I'll be allowed to use that
[18:20:07] pontiki: has joined #ruby
[18:20:10] jhass: you got already if you depend on rspec or rspec-rails instead of rspec-core
[18:20:17] spudowiar: yet it's not working :/
[18:20:32] spudowiar: I used expect *facepalms*
[18:28:48] diegoaguilar: has joined #ruby
[18:29:24] freerobby: has joined #ruby
[18:29:40] macsteps: has joined #ruby
[18:29:45] Xeago: has joined #ruby
[18:32:23] electrostat: has joined #ruby
[18:34:21] sesquipedalian: has joined #ruby
[18:34:44] last_staff: has joined #ruby
[18:35:58] RegulationD: has joined #ruby
[18:37:37] pilne: has joined #ruby
[18:38:15] nictrasavios: So, there is a gem that I want to use that requires MongoDB. I see a a lot "cloud solutions" and such, is there a database that is simple, local, secure and doesn't rely on other services?
[18:38:52] nictrasavios: Or a way that I can include a little local DB on a heroku server, without using mLab or relying on free services that might disappear tomorrow?
[18:39:30] adaedra: There's no way of having a MongoDB on heroku?
[18:40:02] JoL1hAHN: has joined #ruby
[18:40:38] nictrasavios: I know absolutely nothing about mongoDB, the last time I did any web-stuff, mySQL was the standard and LAMP was king.
[18:41:13] nictrasavios: So, I don't know if its possible to have puma/sinatra open a little local db, and just store stuff there, or how that would work with git-commits and pushes to the server
[18:42:27] neo_: has joined #ruby
[18:43:12] miqlas-H: has joined #ruby
[18:44:51] ManWithNoName: has joined #ruby
[18:46:28] nictrasavios: If it's not mongo, and another database like thing (YAML?), that's fine. I'll just fork the gem
[18:47:47] UnKnOwN|: nictrasavios: https://rubygems.org/gems/mongoid/versions/5.1.3
[18:48:32] nictrasavios: That's what the gem loads as a dependency
[18:48:36] nictrasavios: has left #ruby: ("My whole life has been unlimited code works.")
[18:48:41] nictrasavios: has joined #ruby
[18:49:11] electrostat: has joined #ruby
[18:49:47] nictrasavios: I still have no idea how to create and store a local db
[18:52:34] UnKnOwN|: nictrasavios: https://devcenter.heroku.com/articles/mongohq#use-with-ruby
[18:53:35] sumobob: has joined #ruby
[18:54:52] UnKnOwN|: dunno about heroku plans/prices but “Add-on Resources” is how
[18:55:15] hahuang61: has joined #ruby
[18:55:38] UnKnOwN|: "heroku addons:create mongohq:ssd_1g_elastic"
[18:55:39] ruby-lang642: has joined #ruby
[18:56:50] nwmcsween_: has joined #ruby
[18:56:50] nictrasavios: 18$/mo for cloud hosted db ;P.
[18:57:10] giz|work: has joined #ruby
[18:57:22] UnKnOwN|: glad to help, sorry not free
[18:57:41] nictrasavios: Not really a help there, since I asked about local, not cloud hosted
[18:58:00] electrostat: has joined #ruby
[18:58:09] UnKnOwN|: thought u said on heroku
[18:58:34] UnKnOwN|: not know bout the services
[18:58:41] adam12: nictrasavios: Whatcha building?
[18:58:42] ctp__: has joined #ruby
[18:58:59] Coldblackice: has joined #ruby
[18:59:28] scepticulous: has joined #ruby
[18:59:41] nictrasavios: I'm trying to implement the slack-ruby-server gem, which uses mongodb, but I don't want to use any sort of cloud hosted db. I just want it to make a little file on the server, store what i needs, and pull from the file. Same way Apache/PHP/MySQL used to all work together/
[19:00:08] adam12: Well, you can use Sequel with SQlite
[19:00:13] adam12: (Sequel the gem)
[19:00:22] adam12: Or you can use PStore (http://ruby-doc.org/stdlib-2.3.1/libdoc/pstore/rdoc/PStore.html)
[19:01:01] adam12: I'm not familiar with the slack-ruby-server gem.
[19:01:05] adam12: Can you link me?
[19:01:11] nictrasavios: https://github.com/dblock/slack-ruby-bot-server
[19:01:35] nictrasavios: I'd have to fork it to let it use SQLite, but I don't really mind if it means that I own the database
[19:01:37] ruby-lang642: are namespaces and scopes similar?
[19:01:46] adam12: Ah yes - hard MongoDB dependency :(
[19:02:10] nictrasavios: adam12: There is this: https://github.com/dblock/slack-ruby-bot-server/issues/12
[19:03:05] adam12: Unless I am missing something, there is only one Mongoid model
[19:03:19] adam12: Doesn't seem that hard to rewrite using your own adapter, if you felt so inclined.
[19:03:26] adam12: s/rewrite/fork
[19:04:03] adam12: Obviously not ideal but the alternatives are there.
[19:04:41] pilne: i think once i'm more fluent in ruby, i'm going to translate some of the python tutorials I enjoyed to ruby.
[19:04:45] electrostat: has joined #ruby
[19:05:24] adam12: nictrasavios: Would you be able to roll your own with https://github.com/dblock/slack-ruby-bot?
[19:05:29] solars: has joined #ruby
[19:06:35] triangles: has joined #ruby
[19:07:08] nictrasavios: adam12, I'm actually in the process of converting my app from working with slack-ruby-bot to slack-ruby-server since slack-ruby-bot requires an API token (for a custom bot).but I'm deploying a full app, which only gives a Client token. I don't know enough about slack or ruby to know if I can convert slack-ruby-bot to use the Client ID
[19:07:51] moeabdol: has joined #ruby
[19:09:03] nictrasavios: For all I know, if I pass slack-ruby-bot the client token It'll just work, and I'll look like a complete idiot.
[19:09:41] ManWithNoName: has left #ruby: ("Leaving")
[19:09:54] jenrzzz: has joined #ruby
[19:10:37] dminuoso: has joined #ruby
[19:13:07] nictrasavios: Nope, that failed ;P
[19:13:38] moei: has joined #ruby
[19:16:19] Gasher: has joined #ruby
[19:16:24] ctp__: has joined #ruby
[19:17:31] yma__gib: has joined #ruby
[19:20:09] slowmatt: has joined #ruby
[19:20:26] patrick_star_3: has joined #ruby
[19:20:41] fantazo: has joined #ruby
[19:22:23] yfeldblum: has joined #ruby
[19:23:13] dhruvasagar: has joined #ruby
[19:23:41] Es0teric: has joined #ruby
[19:26:28] nictrasavios: *sigh*. The trials of a C dev trying to become a ruby dev. I'm in over my head.
[19:26:28] ruby-lang642: does anyone know when this line gets called in the order of things? https://gist.github.com/drwl/c93978e4bae362f6c1b7a346256ae83b#file-product-rb-L8
[19:27:29] Mon_Ouie: ruby-lang642: It gets executed when you create the class
[19:27:53] ruby-lang642: Mon_Ouie: oh okay, thanks! that helps a lot actually
[19:28:39] ruby-lang642: nictrasavios: is there anything you're stuck on?
[19:30:22] diegoaguilar: has joined #ruby
[19:30:33] nando293921: has joined #ruby
[19:33:24] rbennacer: has joined #ruby
[19:33:45] yma__gib: has joined #ruby
[19:34:06] ruby-lang642: Mon_Ouie: do you know which is a better way to write this line? Or if it's a stylistic choice. Line 26 or 27 https://gist.github.com/drwl/c93978e4bae362f6c1b7a346256ae83b#file-product-rb-L22-L23
[19:36:51] RegulationD: has joined #ruby
[19:37:02] Mon_Ouie: I prefer the first one. That way, if you ever create a subclass of Product, the method will still work because you do not explicitly reference Product anywhere.
[19:37:21] sergey_makagon: has joined #ruby
[19:38:11] ruby-lang642: oh okay, so if I do that I should also change line 33 right? From Product.find_by => self.class.find_by?
[19:38:33] yma__gib: has joined #ruby
[19:39:19] Mon_Ouie: Yes, that's what I'd do (Even though admittedly self.class looks a bit awkward because you need the explicit self to call it)
[19:39:31] rickmasta: has joined #ruby
[19:41:17] ruby-lang642: yeah that's why i changed it to Product since my last change.
[19:41:30] ruby-lang642: thanks for the tips
[19:42:05] macsteps: has joined #ruby
[19:43:19] jgt1: has joined #ruby
[19:44:53] freerobby: has joined #ruby
[19:49:39] spudowiar: how can I change an instance variable from a RSpec context without affecting other contexts
[19:49:50] spudowiar: or should I choose a different name?
[19:50:14] kareeoleez: has joined #ruby
[19:50:51] spudowiar: forget that
[19:51:59] dextertzu: has joined #ruby
[19:52:00] conta: has joined #ruby
[19:54:25] nictrasavios: ruby-lang642: I feel like I've hit a wall of understanding. I know exactly what I want to do, and have no idea where to begin implimenting it.
[19:55:49] rbennacer: has joined #ruby
[19:55:51] joonty: has joined #ruby
[19:56:00] hahuang61: has joined #ruby
[19:57:04] ruby-lang642: hm maybe i can help, what is it that you want to do?
[19:58:10] ruby-lang642: jhass: this is what i was able to get working, i'm not sure if this is good design or if i should just reference .all. From this do you think I understood what you were trying to get across? https://gist.github.com/drwl/650512e5bbdf0dba61e31e85a1c180fb#file-item-rb-L2-L14
[19:58:48] jaguarmagenta: has joined #ruby
[19:59:33] nictrasavios: I have a slack-ruby-bot that works (https://api.slack.com/bot-users), and is registered via this API (https://ascensionacademics.slack.com/apps/new/A0F7YS25R-bots), but I want to convert it to a Slack App (https://api.slack.com/slack-apps), which slack-ruby-server is built for.
[19:59:35] spudowiar: jhass: hope you don't mind me harassing you :) do you know how to isolate a context, because if I've defined an instance variable in the context above, defining it again inside, will change it on the outside
[19:59:52] yma__gib: has joined #ruby
[20:00:07] siaw23: has joined #ruby
[20:00:21] Mon_Ouie: I don't think protected affects methods defined as def self.foo
[20:00:30] nictrasavios: ruby-lang642: Slack-ruby-bot has wonderful setup documentation: (https://github.com/dblock/slack-ruby-bot/blob/master/TUTORIAL.md), but slack-ruby-server feels way over my head.
[20:00:37] Mon_Ouie: >> class F; protected; def self.m; end; end; F.protected_methods
[20:01:12] ruby[bot]: Mon_Ouie: # => [] (https://eval.in/595543)
[20:01:53] ruby-lang642: hmm so I should remove it then? I was trying to keep that method hidden from outside of the subclasses
[20:02:00] Mon_Ouie: You can explicitly open Item's singleton class (class << self; …; end inside the Item class) and use protected and 'def item; …; end' there.
[20:02:29] nankyokusei: has joined #ruby
[20:02:30] ruby-lang642: nictrasavios: is there a brief summary for differences between slack bots vs slack apps?
[20:03:15] ruby-lang642: >> class F; class << self; def m; end; end; end; F.protected_methods
[20:04:00] Mon_Ouie: You would still need to call protected inside the class << self; …; end block
[20:04:18] ruby-lang642: >> class F; class << self; protected; def m; end; end; end; F.protected_methods
[20:04:25] nictrasavios: ruby-lang642: https://api.slack.com/slack-apps, A slack app is a combination of a slack bot, and commands and webhooks on top of that
[20:05:14] nictrasavios: ruby-lang642: You can see in that web page that bot users are like a subset of the Slack App.
[20:06:22] Mon_Ouie: Also FYI the bot ignores requests by users who aren't identified with NickServ to avoid spam
[20:06:31] ruby-lang642: i'll just run it on pry
[20:06:39] nictrasavios: ruby-lang642: But, you can create all of these "parts" of the app on their own, outside of them being bundled as an app.When they're seperate, every command/bot/webhook has its own API key, as an APP, they all share 1
[20:06:40] ruby-lang642: nictrasavios: do you understand webhooks and whatnot?
[20:07:13] nictrasavios: ruby-lang642: Yup,I have all the commands, webooks and the bot written. The problem is unifying them into the slack app.
[20:07:46] ruby-lang642: Mon_Ouie: thanks for pointing out the protected bit out. Do you think the choice I made for that is optimal? It violates DRY
[20:08:17] nictrasavios: ruby-lang642: I know slack-ruby-post is a dependency of, and included in slack-ruby-server, but due to his lack of documentation, I have no idea what the conversion even entails, let alone where to start.
[20:08:45] Mon_Ouie: ruby-lang642: The short-hand for that is just 'attr_reader :items'
[20:09:40] Mon_Ouie: It creates an instance method, but class methods of Item are just instance methods of Item's singleton class
[20:09:54] nictrasavios: ruby-lang642: For an example, I've been stuck at config.ru for 2 hours now. This is slack-ruby-server: https://github.com/dblock/slack-ruby-bot-server/blob/master/sample_app/config.ru, and this is slack-ruby-bot: https://github.com/dblock/slack-ruby-bot/blob/master/TUTORIAL.md (Scroll down to config.ru).
[20:10:08] nictrasavios: ruby-lang642: You can instantly see why I understand one, and am lost on the other.
[20:11:22] dminuoso: has joined #ruby
[20:12:00] ruby-lang642: Mon_Ouie: so I commented out def.self and put in the attr_reader, in the class definition. It doesn't work. Did I have to put the attr_reader inside class << self ?
[20:12:49] Mon_Ouie: Yes, you have to call attr_reader on Item's singleton class for it to define a class method on Item
[20:12:51] macsteps: has joined #ruby
[20:13:00] ruby-lang642: nictrasavios: one sec, i'm trying to read the links you gave me and fix something of my code
[20:13:24] jenrzzz: has joined #ruby
[20:13:24] jenrzzz: has joined #ruby
[20:13:32] nictrasavios: Not a problem, I'll be here for another 4-9 hours. (No joke)
[20:14:17] ruby-lang642: Mon_Ouie: what about the repeating code returning @items? Or maybe I can alias .all
[20:15:18] Mon_Ouie: alias seems reasonable, although it seems strange that you would have two methods. Is it expected that some subclasses will override one of the methods to make them behave differently?
[20:15:36] Mon_Ouie: Also you don't need to do "some #{object.to_s}", String interpolation implicitly calls to_s anyway
[20:17:12] Mon_Ouie: And instead of looking at the internal state of the object through instance variable, I would call a method on the object (using #public_send), that way you can filter by attributes that aren't necessarily implemented as instance variables (e.g. they're computed from other variables, or they're the result of a long computation which is cached in an ivar after the first time you call the method)
[20:17:52] yma__gib: has joined #ruby
[20:19:27] ruby-lang642: i removed the #to_s and am now trying to understand your 2nd message, so i'll be a moment
[20:20:06] zeroDi: has joined #ruby
[20:20:12] Yzguy: has joined #ruby
[20:22:02] bnagy: has joined #ruby
[20:22:37] ruby-lang642: Mon_Ouie: so instead of instance_var_get use #send?
[20:24:57] Mon_Ouie: Preferably #public_send, which won't let you call private methods
[20:26:03] nadir: has joined #ruby
[20:30:18] ruby-lang642: oh got it. I was looking through available methods of a dummy class and missed #public_send.
[20:31:09] SilverKey: has joined #ruby
[20:31:18] al2o3-cr: send will send a message to a pig-e-on on the high rollers `hola`
[20:32:34] dhruvasagar: has joined #ruby
[20:34:21] allcentury: has joined #ruby
[20:36:21] ruby-lang642: so what part are you stuck on?
[20:36:49] ruby-lang642: also have you taken a look at the examples? https://github.com/dblock/slack-market https://github.com/dblock/slack-gamebot
[20:37:48] RegulationD: has joined #ruby
[20:38:28] yma__gib: has joined #ruby
[20:38:39] nictrasavios: ruby-lang642: I am currently looking through "https://github.com/dblock/slack-amber-alert"
[20:38:48] nictrasavios: ruby-lang642: Is gamebot a better example?
[20:39:10] kraken: has joined #ruby
[20:40:28] Elvin: has joined #ruby
[20:40:33] Guest56199: is a 'let' in rspec called again at the begging of each it bloc?
[20:40:42] allcentury: has joined #ruby
[20:41:03] mdw: has joined #ruby
[20:41:04] ullu: has joined #ruby
[20:41:22] gorsuch: has joined #ruby
[20:45:57] Dimik: has joined #ruby
[20:48:46] EXCHGR: has joined #ruby
[20:51:20] allcentury: has joined #ruby
[20:55:31] idletask: has joined #ruby
[20:56:07] moeabdol: has joined #ruby
[20:56:45] hahuang61: has joined #ruby
[20:57:16] xall: has joined #ruby
[20:57:30] postmodern: has joined #ruby
[21:00:58] macsteps: has joined #ruby
[21:04:31] jenrzzz: has joined #ruby
[21:06:28] neo_: has joined #ruby
[21:06:29] davedev24: has joined #ruby
[21:06:36] jackjackdripper: has joined #ruby
[21:07:03] aries_liuxueyang: has joined #ruby
[21:07:24] AlexRussia: has joined #ruby
[21:08:25] allcentury: has joined #ruby
[21:09:48] diegoviola: has joined #ruby
[21:12:06] dminuoso: has joined #ruby
[21:12:08] Xiti: has joined #ruby
[21:14:21] kavanagh: has joined #ruby
[21:15:18] SCHAAP137: has joined #ruby
[21:17:46] dionysus69: has joined #ruby
[21:18:33] kavanagh: has joined #ruby
[21:24:31] jenrzzz: has joined #ruby
[21:25:56] MrBusiness2: has joined #ruby
[21:27:25] sucks: has joined #ruby
[21:29:31] dc2: has joined #ruby
[21:33:00] diegoviola: I need to write a parser for some json feed and load that data on redis, there is a mfield in there, so when I ctrl-c the script and I re-run it I want to resume where I left of, but I have no idea how to do the resume part
[21:33:32] diegoviola: I know I could use the mtime field
[21:33:46] kavanagh: has joined #ruby
[21:34:42] kareeoleez: has joined #ruby
[21:38:44] RegulationD: has joined #ruby
[21:41:40] LoneHerm_: has joined #ruby
[21:44:47] firstdayonthejob: has joined #ruby
[21:46:45] chip_: has joined #ruby
[21:48:28] mozzarella: has joined #ruby
[21:48:57] gizmore: has joined #ruby
[21:53:23] solocshaw: has joined #ruby
[21:54:16] vjacob: has joined #ruby
[21:54:25] mtkd: has joined #ruby
[21:55:05] MEATCHICKEN: has joined #ruby
[21:57:30] hahuang61: has joined #ruby
[21:57:42] solocshaw1: has joined #ruby
[21:58:41] shevy: http://cultureofdevelopment.com/blog/build-your-first-thing-with-web-assembly/
[21:58:48] shevy: "eventually you'll be able to write these web components in any language"
[21:58:49] memorasus: has joined #ruby
[21:59:36] jaguarmagenta: has joined #ruby
[22:02:20] monoprotic: has joined #ruby
[22:03:24] nankyokusei: has joined #ruby
[22:04:28] gizless: has joined #ruby
[22:05:12] diegoviola: has joined #ruby
[22:05:37] gizmore|2: has joined #ruby
[22:06:33] gizmore|3: has joined #ruby
[22:12:07] ctp__: has joined #ruby
[22:12:51] dminuoso: has joined #ruby
[22:16:20] jenrzzz: has joined #ruby
[22:16:27] cdg: has joined #ruby
[22:18:50] Ishido: has joined #ruby
[22:19:28] nando294021: has joined #ruby
[22:20:24] solocshaw1: has joined #ruby
[22:20:25] A5101: has joined #ruby
[22:20:50] allcentury: has joined #ruby
[22:21:04] macsteps: has joined #ruby
[22:22:29] rbennacer: has joined #ruby
[22:22:59] kavanagh: has joined #ruby
[22:24:09] Endie: has left #ruby: ()
[22:24:45] rbr: has joined #ruby
[22:26:25] gizmore: has joined #ruby
[22:27:38] gizless: has joined #ruby
[22:30:44] Guest73: has joined #ruby
[22:34:05] dhruvasagar: has joined #ruby
[22:34:31] zenlot: has joined #ruby
[22:35:21] madgen: has joined #ruby
[22:38:04] gizmore: has joined #ruby
[22:39:31] RegulationD: has joined #ruby
[22:41:46] aries_liuxueyang: has joined #ruby
[22:44:16] moeabdol: has joined #ruby
[22:50:14] northfurr: has joined #ruby
[22:51:04] n1x-nz: has joined #ruby
[22:52:41] northfurr: has joined #ruby
[22:54:29] minimalism: has joined #ruby
[22:55:35] ramfjord: has joined #ruby
[22:55:36] Ishido: has joined #ruby
[22:56:43] vuoto: has joined #ruby
[22:58:16] hahuang61: has joined #ruby
[22:59:32] der-landgraf: has joined #ruby
[23:00:27] tildes: has joined #ruby
[23:02:32] tildes: has joined #ruby
[23:03:39] blaxter: has joined #ruby
[23:04:52] aryaching: has joined #ruby
[23:05:06] Tharbakim: has joined #ruby
[23:06:49] Ishido: has joined #ruby
[23:06:55] nictrasavios_: has joined #ruby
[23:07:04] bkxd: has joined #ruby
[23:08:35] sucks: has joined #ruby
[23:10:10] snowy: has joined #ruby
[23:13:36] dminuoso: has joined #ruby
[23:13:41] benlieb: has joined #ruby
[23:16:47] cdg: has joined #ruby
[23:25:07] xall: has joined #ruby
[23:28:32] millerti: has joined #ruby
[23:28:42] Kallis: has joined #ruby
[23:29:01] ledestin: has joined #ruby
[23:30:38] xall_: has joined #ruby
[23:30:44] UnKnOwN|: has joined #ruby
[23:33:34] toretore: has joined #ruby
[23:37:11] mistermocha: has joined #ruby
[23:39:00] mistermo_: has joined #ruby
[23:40:24] RegulationD: has joined #ruby
[23:41:09] mistermo_: has joined #ruby
[23:42:47] sucks: has joined #ruby
[23:43:04] mistermocha: has joined #ruby
[23:44:29] LoneHermit: has joined #ruby
[23:44:32] allcentury: has joined #ruby
[23:44:48] chouhoulis: has joined #ruby
[23:45:07] mistermo_: has joined #ruby
[23:46:52] Rodya_: has joined #ruby
[23:46:52] mistermo_: has joined #ruby
[23:47:04] Madplatypus: has joined #ruby
[23:48:49] mistermocha: has joined #ruby
[23:49:13] Elvin: has joined #ruby
[23:49:50] douglascorrea: has joined #ruby
[23:50:43] mistermocha: has joined #ruby
[23:51:08] bkxd: has joined #ruby
[23:51:43] douglascorrea: has joined #ruby
[23:52:47] mistermo_: has joined #ruby
[23:54:45] mistermo_: has joined #ruby
[23:55:57] Rodya_: has joined #ruby
[23:57:16] mozzarella: has joined #ruby
[23:58:59] hahuang61: has joined #ruby
[23:59:57] ullu: has joined #ruby