« Back to channel list

#ruby - 06 May 2017

« Back 1 day Forward 1 day »
[00:05:38] brent__: has joined #ruby
[00:09:47] chouhoulis: has joined #ruby
[00:12:07] brent__: has joined #ruby
[00:12:20] skweek: has joined #ruby
[00:12:46] oleo: has joined #ruby
[00:14:03] SCHAPiE: has joined #ruby
[00:14:20] Qommand0r: has joined #ruby
[00:14:48] charliesome: has joined #ruby
[00:15:52] brent__: has joined #ruby
[00:16:27] cagomez: has joined #ruby
[00:19:26] bronson: has joined #ruby
[00:22:27] andrevan: has joined #ruby
[00:23:20] dmtd: has joined #ruby
[00:25:21] enterprisey: has joined #ruby
[00:25:55] brent__: has joined #ruby
[00:26:12] bkxd: has joined #ruby
[00:28:12] gaucheph: has joined #ruby
[00:34:22] mokiwis: has joined #ruby
[00:37:24] cagomez: has joined #ruby
[00:37:29] Channel6: has joined #ruby
[00:40:50] GodFather: has joined #ruby
[00:43:13] GodFather: has joined #ruby
[00:50:10] jusa: has joined #ruby
[00:50:40] bkxd: has joined #ruby
[00:53:47] PorcoRex: has joined #ruby
[00:53:53] PorcoRex: Evening Ruby.
[00:55:10] ptx0: has joined #ruby
[00:56:05] pwnd_nsfw`: has joined #ruby
[00:56:06] nankyokusei: has joined #ruby
[00:57:41] guardianJ: has joined #ruby
[00:58:16] duderono_: has joined #ruby
[00:59:57] esObe_: has joined #ruby
[01:00:29] GodFather: has joined #ruby
[01:06:57] jgnagy: has joined #ruby
[01:07:25] HoierM: has joined #ruby
[01:09:13] bkxd: has joined #ruby
[01:09:15] d^sh: has joined #ruby
[01:17:53] DeeJayh: PorcoRex, Howdy!
[01:18:15] mim1k: has joined #ruby
[01:19:06] DeeJayh: Quick question folks, let's say I have an int in ruby and get a percentage out of it that would be a float. like 95 * 0.15 = 14.25
[01:19:23] DeeJayh: Does ruby convert it to a float? auto round down or up?
[01:19:30] jenrzzz: has joined #ruby
[01:19:31] jenrzzz: has joined #ruby
[01:21:02] DeeJayh: because when I do: a = 95; b = a * 0.15; puts b
[01:21:09] DeeJayh: I get 14.25 as if it's a float
[01:21:35] DeeJayh: and if I b.ceil, I get 15, but when used in the argument I'm doing, it stays as 14.
[01:21:43] Papierkorb: it autoconverts to floating point DeeJayh
[01:25:10] DeeJayh: Papierkorb, thanks that's what I thought and experienced through my testing, but it doesn't seem to be cooperating. I'm sure it's something silly
[01:28:57] NORTHSOUTHDENNIS: has joined #ruby
[01:36:01] brent__: has joined #ruby
[01:38:06] antib: has joined #ruby
[01:47:40] NORTHSOUTHDENNIS: has joined #ruby
[01:47:50] llw: has joined #ruby
[01:49:33] esObe_: has joined #ruby
[01:51:38] DeeJayh: There's gotta be a better way to do this... This is what I wrote, and it works, but it's a total nightmare and I'm wondering if I could've done it a better way: https://gist.github.com/Ruined1/dda25f8063ec766279050e7f4ad9ba36
[01:51:50] gizmore|2: has joined #ruby
[01:55:38] elomatreb: You could probably refactor the ranges into clearly named methods, to better convey intent
[01:57:06] elomatreb: Also, you don't *have* to use a switch here, a if/elsif chain with > operations is probably cleaner and avoids duplication
[01:58:19] pb122: has joined #ruby
[01:58:48] NORTHSOUTHDENNIS: has joined #ruby
[02:01:38] skweek: has joined #ruby
[02:07:38] libastral: has joined #ruby
[02:12:07] Ebok: has joined #ruby
[02:16:24] cschneid_: has joined #ruby
[02:16:49] cschneid_: has joined #ruby
[02:17:44] xall_: has joined #ruby
[02:18:54] NORTHSOUTHDENNIS: has joined #ruby
[02:20:24] genpaku: has joined #ruby
[02:21:21] duderonomy: has joined #ruby
[02:29:34] LastWhisper____: has joined #ruby
[02:32:34] haylon: Could/Should I use the README.md for my gem's spec.description ?
[02:32:35] bronson: has joined #ruby
[02:35:02] Jameser: has joined #ruby
[02:36:05] DeeJayh-L: has joined #ruby
[02:36:39] Ebok: has joined #ruby
[02:41:06] govg: has joined #ruby
[02:41:47] [ohjn]: has joined #ruby
[02:49:55] armando: has joined #ruby
[02:50:50] NORTHSOUTHDENNIS: has joined #ruby
[02:51:01] jusa: has joined #ruby
[02:51:11] esObe_: has joined #ruby
[02:52:46] DeeJayh-L: elomatreb, do you think an ifelse would truly be better? I thought they were interchangeable for the most part and it was a matter of preference. Also, when you say "refactor the ranges into clearly named methods" can you give me an example?
[02:53:20] romeoh_: has joined #ruby
[02:54:21] esObe_: has joined #ruby
[02:56:57] nankyokusei: has joined #ruby
[02:57:16] DeeJayh-L: I think I understand what you mean, but this only needs to happen once, normally you break things out into methods to write less code (by not re-writing the same functions over and over through your code) but in this case it's going to actually add code and spread it out more, seems counter-intuative
[03:02:41] romeoh_: looking for a way to convert a Symbol to a string, replace a substring, and then convert back to a symbol. I've got this working, seems terrible:
[03:02:44] romeoh_: @title_args[:order] = "#{@title_args[:order]}".sub!(/reverse_/, '').to_sym
[03:03:27] Ebok: It's not horrible.
[03:03:57] Ebok: I mean, I would try to avoid needing to do this type of conversion in the first place
[03:04:27] romeoh_: thanks - new to all this. Jumped on a project and they are appending the queries to page titles
[03:04:35] romeoh_: problem is when they are sorting, there is a reverse options
[03:04:53] Ebok: what kind of queries are we talking about?
[03:04:55] romeoh_: and the values for these queries don't exist in translations
[03:05:01] Ebok: Like sorting queries?
[03:05:14] romeoh_: sort_by_name, sort_by_reverse_name
[03:05:15] Ebok: Yeah.. How much of this is there already?
[03:05:24] Ebok: That's a shame
[03:05:46] Ebok: Well if you have to add to bad code, it's not going to look great.
[03:05:48] romeoh_: i've taken the project to learn more, so maybe I'll suggest a revamping of this area
[03:05:58] romeoh_: eventually
[03:06:32] Ebok: I would strongly suggest a good test suite, and then a day of splitting.
[03:06:51] romeoh_: another option is adding all those additional values to the translations
[03:07:15] Ebok: Or you could just write methods for them
[03:08:20] perniciouscaffei: has joined #ruby
[03:08:27] Ebok: def sort_by_name_reverse ; call sort_by_name.reverse ; end
[03:10:13] romeoh_: http://rubyfiddle.com/riddles/a3161/2 is what I'm looking @
[03:10:37] romeoh_: titles are passed something like: {:by=>"reverse_updated_at", :type=>:observation, :order=>:sort_by_reverse_updated_at}
[03:10:54] romeoh_: that's fed into the translation @title_tag.t()
[03:11:16] romeoh_: so something like: query_title_all_by: "[TYPES] by [ORDER]"
[03:13:28] Ebok: correct me here. @title_args is a symbol
[03:13:40] Ebok: I mean tag
[03:13:46] Ebok: @title_tag
[03:14:05] Ebok: Then in title... @title_tag gets called #t(args)
[03:14:18] Ebok: Why is a symbol invoking anything?
[03:14:41] Ebok: Also where is flavor defined?
[03:15:56] Ebok: Oh, this is just a chunk of a module, right. So the parent is responcible.
[03:16:09] enterprisey: has joined #ruby
[03:16:36] Ebok: Honestly... it looks like major refactoring needs to take place.
[03:16:45] romeoh_: yeah, I think so man
[03:16:55] romeoh_: @title_tag is like a base for the page title
[03:17:12] romeoh_: it looks in the localization locale for query_title_all which is: "[TYPE] Index"
[03:17:32] romeoh_: but this is a HUGE and old codebase
[03:18:20] Ebok: Well, the very first thing I'd do is put in that code you've got to get it working.
[03:18:38] romeoh_: I appreciate your feedback, I'm new to Rails.
[03:18:41] mim1k: has joined #ruby
[03:18:45] romeoh_: been using the opportunity to pick apart everyting
[03:18:45] Ebok: This is rails..?
[03:18:58] Ebok: Okay then.
[03:19:11] Ebok: There are a number of suggestions then.
[03:19:36] Ebok: 1. ) In your own time / when your boss says okay / when you've nothing on your plate
[03:20:00] Ebok: I'd consider pulling out the sorting from the main class.
[03:20:38] Ebok: Write it as a service to whatever active record model you're using.
[03:21:07] Ebok: And handle all the sorting logic in one place.
[03:21:33] NORTHSOUTHDENNIS: has joined #ruby
[03:22:08] Ebok: Only do this if you have good test coverage over the features. Hopefully your test coverage was well written unit tests.
[03:22:23] Ebok: Otherwise I'd write tests first <_>
[03:23:01] charliesome: has joined #ruby
[03:23:10] romeoh_: Sounds good, I will take note and talk to the others. I really appreciate it.
[03:23:14] romeoh_: This is just a volunteer project I jumped on for fun pretty recently. Been digging at it in when my workflow is light.
[03:23:27] romeoh_: It's pretty neat and about a decade old.
[03:23:29] Ebok: Open source, or just learning?
[03:23:34] romeoh_: Started as a hobby project, it's open source.
[03:23:43] romeoh_: Hobby project for the original dude.
[03:24:12] Ebok: Yeah, the way we think about rails now is not how they thought about rails then.
[03:25:00] Ebok: rails can be really flexible, but you can also build some really fragile code if you're not careful.
[03:27:18] Ebok: I tend to write a lot of small service classes organized by module. module FEATURE class ACTION. So you want to pull out the code so when you go to test the thing, you only have to test input to output.
[03:28:55] NORTHSOUTHDENNIS: has joined #ruby
[03:29:01] romeoh_: Yeah, I'm seeing that fragility first hand. This app is pretty big, I'm digging around everywhere trying to find the relevant code. A lot of this stuff is probably not where is should be located either.
[03:29:15] DeeJayh-L: I skip rails altogether, seems like unless you're building a very basic DB based site, it's not as useful as it first appeared.
[03:29:20] romeoh_: It's cool the site involves scientific classification so there is a rad complexity to it
[03:29:38] DeeJayh-L: I write my backend in ruby and have a frontend guy, then just communicate between the two
[03:29:44] romeoh_: for other side projects i've been using mostly node
[03:30:00] romeoh_: but I always had a fascination w/ Rails
[03:30:00] roamingdog: has joined #ruby
[03:30:26] DeeJayh-L: I did until I realized there was true power in the freedom of ruby without rails
[03:30:52] DeeJayh-L: I mean if you want to create another twitter, great! Rails away! Otherwise, unfortunately, it seems more of a hinderance.
[03:30:53] jusa: has joined #ruby
[03:31:41] romeoh_: Yeah I've got to venture out more
[03:31:48] romeoh_: I work as a freelance front end dev, but would like to transition over to more of a back end role.
[03:32:07] jenrzzz: has joined #ruby
[03:32:07] jenrzzz: has joined #ruby
[03:32:55] Ebok: Honestly, I learned to code in Rails
[03:33:00] bronson: has joined #ruby
[03:33:17] Ebok: But everytime I pull most of the ruby out of it, everything is nicer
[03:34:15] Ebok: When I'm allowed, I pretty much work on Rails as a plugin. At which point anything could be there instead and it would work just as well.
[03:34:35] DeeJayh-L: I mean, rails is just a framework for ruby. Rails is ruby language with structure to generate a website
[03:34:48] DeeJayh-L: but the structure seems too limited
[03:35:33] DeeJayh-L: I can create a site like twitter or netflix and host database information all day with it, but if I want a site with a roulette wheel on one page and something else on the next, seems to get pretty difficult from there
[03:35:43] Ebok: It's certainly easy to become dependent on Rails when working in it.
[03:35:53] romeoh_: yeah, or any framework
[03:36:27] Ebok: Best code I've seen pretty much works by itself, and the framework is used as a transition module. How to get input and output to the user.
[03:36:56] cfec0b8d: has joined #ruby
[03:37:42] Ebok: Or the database... or another website.
[03:38:08] DeeJayh-L: but that's what I'm saying, to display a database entry it's fantastic, but what if I want a spinning wheel displaying the results of a roulette game, starts to get cumbersome to stick to rails when something is easily made in HTML that doesn't require that framework. Add a little javascript to make socket connections to the ruby backend running it all and you got the best of both worlds
[03:38:47] DeeJayh-L: easy for the front end guy, easy for the backend guy, and your own custom language between the two of you for your socket reads/writes
[03:39:10] DeeJayh-L: of course, being a full stack developer is better
[03:39:49] DeeJayh-L: as far as employability and such, but from a purely hobbyist/oss standpoint, it's better for each piece to be as easy as possible
[03:40:56] Ebok: Being full stack does not mean it's good to mix client and server logic
[03:41:33] hutch34: has joined #ruby
[03:41:38] Ebok: I'm a full stack dev myself, it's not hard to be anywhere. The trick is being disciplined in everywhere.
[03:45:07] romeoh_: time to build a Roulette game ;D
[03:50:20] hutch34: has joined #ruby
[03:53:06] NORTHSOUTHDENNIS: has joined #ruby
[03:55:44] esObe_: has joined #ruby
[03:56:27] dcunit3d: has joined #ruby
[03:57:58] romeoh: has joined #ruby
[03:59:07] moufl: has joined #ruby
[04:01:49] esObe_: has joined #ruby
[04:04:46] gix: has joined #ruby
[04:06:37] jcao219: has joined #ruby
[04:07:20] sebd: has joined #ruby
[04:08:23] NORTHSOUTHDENNIS: has joined #ruby
[04:17:46] mim1k: has joined #ruby
[04:35:22] jenrzzz: has joined #ruby
[04:35:23] jenrzzz: has joined #ruby
[04:47:51] roflmyeggo: has joined #ruby
[04:54:08] astrobunny: has joined #ruby
[04:57:48] nankyokusei: has joined #ruby
[05:03:11] esObe_: has joined #ruby
[05:03:27] wigner: has joined #ruby
[05:17:25] Bock: has joined #ruby
[05:17:30] Puffball: has joined #ruby
[05:23:43] Tempesta: has joined #ruby
[05:24:18] itarato: has joined #ruby
[05:28:14] jusa: has joined #ruby
[05:32:24] dionysus69: has joined #ruby
[05:34:07] bronson: has joined #ruby
[05:44:54] nicesignal: has joined #ruby
[05:49:20] Pumukel: has joined #ruby
[05:52:13] roflmyeggo: has joined #ruby
[06:02:18] DrCode: has joined #ruby
[06:03:20] JeanCarloMachado: has joined #ruby
[06:05:27] charliesome: has joined #ruby
[06:11:55] esObe_: has joined #ruby
[06:16:17] esObe__: has joined #ruby
[06:23:04] _aeris_: has joined #ruby
[06:26:44] cagomez: has joined #ruby
[06:38:07] jenrzzz: has joined #ruby
[06:38:07] jenrzzz: has joined #ruby
[06:42:32] pwnd_nsfw: Hey guys, want a laugh? https://gist.github.com/SirUncleCid/3d4a94193275a1ece265f4dbdb25d90c
[06:43:27] mtkd: has joined #ruby
[06:46:38] enterprisey: has joined #ruby
[06:50:06] Pumukel: has joined #ruby
[06:53:45] rippa: has joined #ruby
[06:56:58] cschneid_: has joined #ruby
[06:58:07] apeiros: at least they seem to log extensively
[06:58:36] nankyokusei: has joined #ruby
[06:58:50] _aeris_: has joined #ruby
[07:13:10] rgr_: has joined #ruby
[07:15:09] bkxd: has joined #ruby
[07:17:41] esObe_: has joined #ruby
[07:23:31] Mia: has joined #ruby
[07:23:31] Mia: has joined #ruby
[07:26:18] charliesome: has joined #ruby
[07:27:27] Lucky_ABA: has joined #ruby
[07:27:47] jenrzzz: has joined #ruby
[07:32:00] roamingdog: has joined #ruby
[07:32:49] roamingdog: has joined #ruby
[07:33:04] User458764: has joined #ruby
[07:33:34] roamingdog: has joined #ruby
[07:34:20] roamingdog: has joined #ruby
[07:34:50] bronson: has joined #ruby
[07:35:10] roamingdog: has joined #ruby
[07:38:14] Mon_Ouie: has joined #ruby
[07:38:27] toretore: has joined #ruby
[07:40:55] marr: has joined #ruby
[07:45:26] djbkd_: has joined #ruby
[07:51:39] Pumukel: has joined #ruby
[07:59:50] duderonomy: has joined #ruby
[07:59:58] dionysus69: has joined #ruby
[08:06:02] blackmesa: has joined #ruby
[08:11:49] jenrzzz: has joined #ruby
[08:11:49] jenrzzz: has joined #ruby
[08:19:42] jenrzzz: has joined #ruby
[08:19:42] jenrzzz: has joined #ruby
[08:20:35] electrostat: has joined #ruby
[08:31:41] guardianJ: has joined #ruby
[08:31:44] esObe_: has joined #ruby
[08:35:57] User458764: has joined #ruby
[08:36:30] roamingdog: has joined #ruby
[08:37:48] _sfiguser: has joined #ruby
[08:39:18] rgr: has joined #ruby
[08:45:13] quobo: has joined #ruby
[08:46:45] Jameser`: has joined #ruby
[08:49:59] bkxd: has joined #ruby
[08:51:12] bairyn: has joined #ruby
[08:53:09] Pumukel: has joined #ruby
[08:53:52] samer: has joined #ruby
[08:54:39] Rneq: has joined #ruby
[08:55:39] Rneq: I'm trying to use joins to reduce multiple requests to the database, but I'm kinda stuck on this matter. Could anyone point me in the right direction?
[08:57:14] lxsameer: has joined #ruby
[08:58:35] guardianJ: has joined #ruby
[08:59:28] nankyokusei: has joined #ruby
[09:11:05] nadir: has joined #ruby
[09:11:37] d^sh: has joined #ruby
[09:13:51] antib: has joined #ruby
[09:19:31] arquebus: has joined #ruby
[09:20:21] arquebus: has joined #ruby
[09:21:23] arquebus: has joined #ruby
[09:22:31] arquebus: has joined #ruby
[09:23:33] arquebus: has joined #ruby
[09:24:35] arquebus: has joined #ruby
[09:29:21] nobodyzxc: has joined #ruby
[09:30:09] conta1: has joined #ruby
[09:33:07] esObe_: has joined #ruby
[09:34:31] mhenrixon: has joined #ruby
[09:36:07] bkxd: has joined #ruby
[09:36:11] bronson: has joined #ruby
[09:37:27] esObe_: has joined #ruby
[09:40:36] _sfiguser: has joined #ruby
[09:40:54] ski7777: has joined #ruby
[09:40:54] blackwind_123: has joined #ruby
[09:45:35] Joufflu: has joined #ruby
[09:46:39] KeyJoo: has joined #ruby
[09:48:29] xco: has joined #ruby
[09:49:01] xall_: has joined #ruby
[09:53:17] patarr: has joined #ruby
[09:54:36] Pumukel: has joined #ruby
[10:10:52] FastJack: has joined #ruby
[10:15:58] _2easy: has joined #ruby
[10:15:58] _2easy: has joined #ruby
[10:17:14] dionysus69: has joined #ruby
[10:37:10] raatiniemi: has joined #ruby
[10:42:56] BTRE: has joined #ruby
[10:44:32] alveric: has joined #ruby
[10:44:50] tomphp: has joined #ruby
[10:47:29] blackwind_123: has joined #ruby
[10:53:41] Guest96: has joined #ruby
[10:54:55] alveric: has joined #ruby
[10:55:25] Pumukel: has joined #ruby
[10:59:48] jcao219: has joined #ruby
[11:00:28] esObe_: has joined #ruby
[11:00:39] nankyokusei: has joined #ruby
[11:09:00] guardianJ: has joined #ruby
[11:09:06] Mia: has joined #ruby
[11:09:06] Mia: has joined #ruby
[11:12:04] crst: has joined #ruby
[11:14:01] crst: Hi, how can I change formatting (2017-05-06 to Mai 6 2017, for english) of this without destroying I18n: I18n.localize(article.date.to_date)
[11:17:34] My_Hearing: has joined #ruby
[11:17:46] megan_: has joined #ruby
[11:22:41] oleo: has joined #ruby
[11:24:35] shinzah: has joined #ruby
[11:25:09] RaeCarruth: has joined #ruby
[11:25:09] ChanServ: +b RaeCarruth!*@*
[11:25:09] ChanServ: ChanServ kicked RaeCarruth: troll
[11:25:11] ruby[bot]: -b+b RaeCarruth!*@* RaeCarruth!*@*$#ruby-banned
[11:27:23] leitz: has joined #ruby
[11:31:10] oleo: has joined #ruby
[11:31:12] oded: has joined #ruby
[11:32:06] bkxd: has joined #ruby
[11:34:37] Mia: has joined #ruby
[11:34:37] Mia: has joined #ruby
[11:34:43] roamingdog: has joined #ruby
[11:38:55] oleo: has joined #ruby
[11:40:21] bkxd: has joined #ruby
[11:46:32] My_Hearing: has joined #ruby
[11:48:19] blackwind_123: has joined #ruby
[11:50:36] BTRE: has joined #ruby
[11:54:13] ledestin: has joined #ruby
[11:56:08] oleo: has joined #ruby
[11:56:56] Pumukel: has joined #ruby
[11:57:41] cschneid_: has joined #ruby
[12:00:54] Mia: has joined #ruby
[12:00:54] Mia: has joined #ruby
[12:01:46] esObe_: has joined #ruby
[12:03:58] JeanCarloMachado: has joined #ruby
[12:08:13] govg: has joined #ruby
[12:10:39] rgr: has joined #ruby
[12:11:14] oleo: has joined #ruby
[12:26:32] Ishido: has joined #ruby
[12:27:59] oleo: has joined #ruby
[12:29:35] nadir: has joined #ruby
[12:29:53] millerti: has joined #ruby
[12:33:10] BaroMeter: has joined #ruby
[12:33:36] ddffg: has joined #ruby
[12:34:48] govg: has joined #ruby
[12:35:46] roamingdog: has joined #ruby
[12:40:42] nowhereman: has joined #ruby
[12:51:37] Ishido: has joined #ruby
[12:57:39] bkxd: has joined #ruby
[12:57:53] Pumukel: has joined #ruby
[13:01:25] nankyokusei: has joined #ruby
[13:01:37] Verity: pwnd_nsfw, ??
[13:02:31] leitz: I'm more discouraged by coming back to my code and forgetting simple stuff.
[13:09:36] User458764: has joined #ruby
[13:10:12] User458764: has joined #ruby
[13:10:54] JeanCarloMachado: has joined #ruby
[13:12:10] jgnagy: has joined #ruby
[13:12:48] gnufied: has joined #ruby
[13:24:23] mint: has joined #ruby
[13:26:00] sepp2k: has joined #ruby
[13:31:25] yqt: has joined #ruby
[13:31:39] KeyJoo: has joined #ruby
[13:31:44] JeanCarloMachado: has joined #ruby
[13:35:00] volty: has joined #ruby
[13:36:30] roamingdog: has joined #ruby
[13:38:01] bronson: has joined #ruby
[13:39:34] hardwin: has joined #ruby
[13:42:25] BTRE: has joined #ruby
[13:42:59] blipz: has left #ruby: ("Be back later...")
[13:44:13] esObe_: has joined #ruby
[13:44:33] Jameser: has joined #ruby
[13:52:39] JeanCarloMachado: has joined #ruby
[13:54:50] xco: has joined #ruby
[13:55:49] roflmyeggo: has joined #ruby
[13:58:50] Pumukel: has joined #ruby
[13:59:29] mint: has joined #ruby
[14:00:22] mint: has joined #ruby
[14:03:11] DeeJayh-L: has joined #ruby
[14:07:19] nankyokusei: has joined #ruby
[14:14:50] kiltzman: has joined #ruby
[14:16:31] dyyylan: what is the syntax `class << self` ?
[14:17:02] dyyylan: is that kind of like in other languages class foo extends bar?
[14:20:45] Jameser: has joined #ruby
[14:22:30] Hanmac: dyyylan: it opens the eigenclass of the object, with that is easier to define singleton methods (class methods) on a class or object
[14:23:19] bkxd_: has joined #ruby
[14:23:23] Jameser`: has joined #ruby
[14:23:55] romeoh: has joined #ruby
[14:25:27] dyyylan: I see. thanks
[14:25:37] andrzejku: has joined #ruby
[14:25:54] jameser``: has joined #ruby
[14:27:51] xco: has left #ruby: ()
[14:30:32] JeanCarloMachado: has joined #ruby
[14:32:51] mint: has joined #ruby
[14:33:54] mint: has joined #ruby
[14:34:50] mint: has joined #ruby
[14:35:37] mint: has joined #ruby
[14:36:15] tildes: has joined #ruby
[14:36:21] mint: has joined #ruby
[14:37:05] mint: has joined #ruby
[14:37:23] rgr_: has joined #ruby
[14:37:50] mint: has joined #ruby
[14:38:28] binaryplease: has joined #ruby
[14:46:00] jrafanie: has joined #ruby
[14:46:33] Lucky_ABA: has joined #ruby
[14:47:24] esObe_: has joined #ruby
[14:59:28] Tomski80: has joined #ruby
[15:00:05] shinzah: I'm trying to create some specs for OAuth2 flows. I'm using the oauth2 library to do so. But I'm having some trouble with this. Anyone who has some experience with mocking oauth applications?
[15:00:24] jgnagy: has joined #ruby
[15:01:37] patarr: has joined #ruby
[15:09:32] bkxd: has joined #ruby
[15:11:03] bronson: has joined #ruby
[15:15:04] nmpribeiro: has joined #ruby
[15:18:22] GodFather_: has joined #ruby
[15:18:35] nmpribeiro: hi there. trying to install 'gems install compass --user-install' outputs an error: /usr/local/rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/installer.rb:676: warning: Insecure world writable dir /home/admin in PATH, mode 040777
[15:18:56] nmpribeiro: You don't have write permissions for the /usr/local/rvm/gems/ruby-2.4.0/bin directory.
[15:19:05] nmpribeiro: anyone has an idea?
[15:23:21] Jameser: has joined #ruby
[15:23:48] minimalism: has joined #ruby
[15:25:21] ahrs: has joined #ruby
[15:25:58] asdfghzxcvbn: has joined #ruby
[15:26:27] volty: nmpribeiro: seems the install script of compass pretends to install where it shouldn t
[15:27:23] nmpribeiro: volty: got a time to research and read. adding my user to rvm group did the trick
[15:28:35] unreal: has joined #ruby
[15:33:30] SeepingN: has joined #ruby
[15:36:41] rgr_: has joined #ruby
[15:44:36] Pumukel: has joined #ruby
[15:45:15] Jameser: has joined #ruby
[15:47:21] User458764: has joined #ruby
[15:47:44] vuoto: has joined #ruby
[15:47:59] User458764: has joined #ruby
[15:48:40] esObe_: has joined #ruby
[15:49:30] Jameser: has joined #ruby
[15:55:22] _sfiguser: has joined #ruby
[15:57:54] charliesome: has joined #ruby
[15:58:49] cschneid_: has joined #ruby
[16:01:02] amperry: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[16:03:51] cisco: has joined #ruby
[16:05:00] esObe_: has joined #ruby
[16:05:38] bronson: has joined #ruby
[16:05:39] nanoz: has joined #ruby
[16:05:40] nanoz: has joined #ruby
[16:18:18] biberu: has joined #ruby
[16:18:35] blackwind_123: has joined #ruby
[16:21:27] JeanCarloMachado: has joined #ruby
[16:22:18] shinzah: has joined #ruby
[16:24:10] Ishido: has joined #ruby
[16:33:01] bkxd: has joined #ruby
[16:33:42] nobodyzxc: has joined #ruby
[16:33:45] xall_: has joined #ruby
[16:37:49] My_Hearing: has joined #ruby
[16:40:15] nankyokusei: has joined #ruby
[16:42:08] hutch34: has joined #ruby
[16:46:03] Pumukel: has joined #ruby
[16:48:27] Guest96: has joined #ruby
[16:58:00] cschneid_: has joined #ruby
[17:01:23] cseder: has joined #ruby
[17:02:42] cseder: good evening fellow gem diggers
[17:04:19] cseder: Can't believe that not all people use their Saturdays for coding in Ruby ;)
[17:04:26] romeoh_: has joined #ruby
[17:05:09] gusrub: has joined #ruby
[17:05:18] vuoto: has joined #ruby
[17:05:28] cseder: Same SeepingN
[17:05:47] SeepingN: coding may be a strong word. scripting? hacking? I really need to get my OO design on
[17:08:22] cseder: I've been taxing back and forth picking up my MacBook from service, just to discover it was still not working as it should, so had to return it again and now it's already evening here in timezone#relative and I have tons of stuff to finish...
[17:08:56] cseder: have to complain somewhere
[17:15:22] enterprisey: has joined #ruby
[17:22:35] SeepingN: overheating?
[17:24:09] shinzah: has joined #ruby
[17:25:21] asdfghzxcvbn: has joined #ruby
[17:25:40] asdfghzxcvbn: has joined #ruby
[17:25:53] asdfghzxcvbn: has joined #ruby
[17:29:38] gusrub: has joined #ruby
[17:32:49] User458764: has joined #ruby
[17:34:16] andrzejku: has joined #ruby
[17:35:54] yeticry: has joined #ruby
[17:37:12] perniciouscaffei: has joined #ruby
[17:38:00] blackmesa: has joined #ruby
[17:44:00] hutch34: has joined #ruby
[17:44:41] blackmesa: has joined #ruby
[17:46:48] Pumukel: has joined #ruby
[17:47:53] tildes: has joined #ruby
[17:50:23] patarr: has joined #ruby
[17:50:39] Guest96: has joined #ruby
[17:51:56] bronson: has joined #ruby
[17:52:13] jackrandom: has joined #ruby
[17:59:45] Sammichmaker: has joined #ruby
[18:01:15] Dimik: has joined #ruby
[18:02:15] shinzah: has joined #ruby
[18:03:07] blackmesa: has joined #ruby
[18:03:27] PatrikasZvaigzde: has joined #ruby
[18:04:52] mim1k: has joined #ruby
[18:07:15] roamingdog: has joined #ruby
[18:08:26] bmarkons_: has joined #ruby
[18:09:02] amoeba_: has joined #ruby
[18:09:57] northfurr: has joined #ruby
[18:12:49] BSaboia: has joined #ruby
[18:14:02] blackmesa: has joined #ruby
[18:14:15] bungoman: has joined #ruby
[18:23:25] perniciouscaffei: has joined #ruby
[18:29:38] gusrub: has joined #ruby
[18:29:54] knoxvilles_joker: has joined #ruby
[18:31:42] tildes: has joined #ruby
[18:41:15] nankyokusei: has joined #ruby
[18:45:21] jackrandom: has joined #ruby
[18:47:04] awesomess3: has joined #ruby
[18:47:44] awesomess3: What is the '-rubygems' command-line option? is that used to older ruby command-line builds?
[18:48:07] awesomess3: I saw it in a gist script and I removed it and it worked just as well.
[18:48:19] elomatreb: Rubygems used to be something you needed to enable
[18:49:11] awesomess3: but now it's no longer necessary? Do you know which version of ruby made it so that it became implicitly enabled?
[18:49:26] havenwood: awesomess3: 1.9
[18:49:29] awesomess3: Should I put it in my scripts so my Ubuntu 10.04 can use my script?
[18:50:23] havenwood: awesomess3: With Rubies shipped these days there's no need. 1.8 is dead.
[18:50:57] awesomess3: so there's a dead program in my end-of-life operating system?
[18:55:12] havenwood: awesomess3: Err, how old is your Ubuntu??
[18:55:20] randomguy: has joined #ruby
[18:56:23] vuoto: has joined #ruby
[18:57:21] Pumukel: has joined #ruby
[18:57:26] randomguy: Whats the best way to do a 301 redirect of a ruby app on aws? Should i handle this within the application or at the load balancer level? I am a beginner
[18:59:10] conta1: has joined #ruby
[19:00:15] vuoto: has joined #ruby
[19:00:52] awesomess3: randomguy: how do you create a ruby app on aws?
[19:01:29] randomguy: Im using elastic beanstalk
[19:01:50] nickjj: i would do all forms of redirects/SSL at the load balancer / proxy level
[19:03:08] patarr: has joined #ruby
[19:06:21] sp4rrow: has joined #ruby
[19:06:41] jrafanie: has joined #ruby
[19:07:05] conta1: has joined #ruby
[19:07:56] awesomess3: havenwood: Linux awesomess3-desktop 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
[19:13:19] __Yiota: has joined #ruby
[19:15:46] _aeris_: has left #ruby: ("Konversation terminated!")
[19:16:35] tomphp: has joined #ruby
[19:17:28] Lucky_ABA: has joined #ruby
[19:19:01] guest44: has joined #ruby
[19:19:33] guest44: has left #ruby: ()
[19:24:06] skweek: has joined #ruby
[19:24:33] romeoh: has joined #ruby
[19:25:16] randomguy: has joined #ruby
[19:31:17] randomguy: has joined #ruby
[19:33:51] jrafanie: has joined #ruby
[19:37:43] TomyLobo: has joined #ruby
[19:39:04] _2easy: has joined #ruby
[19:42:12] Tomski80: has joined #ruby
[19:47:21] govg: has joined #ruby
[19:48:50] ahrs: has joined #ruby
[19:54:51] futilegames: has joined #ruby
[19:57:30] JeanCarloMachado: has joined #ruby
[19:57:47] andrzejku: has joined #ruby
[19:58:07] Pumukel: has joined #ruby
[19:59:47] tomphp: has joined #ruby
[20:00:22] hutch34: has joined #ruby
[20:05:00] marr: has joined #ruby
[20:09:33] Guest96: has joined #ruby
[20:14:35] awesomess3: omg nobody has said anything xD
[20:14:42] awesomess3: for 1 hour 7 minutes
[20:15:04] awesomess3: actually I stopped using my Ubuntu 10.04 in 2013
[20:15:22] awesomess3: I saw the deadlights
[20:15:52] roflmyeggo: has joined #ruby
[20:16:38] jrafanie: has joined #ruby
[20:23:08] JeanCarloMachado: has joined #ruby
[20:26:13] blackmesa: has joined #ruby
[20:27:58] cipher_: has joined #ruby
[20:31:12] somerandomteen: has joined #ruby
[20:31:27] blackmesa: has joined #ruby
[20:32:18] jackjackdripper: has joined #ruby
[20:32:49] esObe_: has joined #ruby
[20:34:42] somerandomteen: Hi all, having a problem with validations. Wondered if someone could help? https://gist.github.com/mashedkeyboard/c942cb5be33356b16257ca524f977ffc the :dob validation errors because value is nil, and you can't call to_date on NilClass.
[20:35:52] awesomess3: So you need a way to determine if the value is nil?
[20:36:15] somerandomteen: No, I'm sending the value in the registration form.
[20:37:20] somerandomteen: RegistrationsController is just the bog-standard Devise controller, and I'm using <%= f.text_field :dob, placeholder: 'Date of birth', class: 'form-control' %> in <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> to send the data, just the same as I send :name et al.
[20:37:22] dn`: has joined #ruby
[20:38:42] roamingdog: has joined #ruby
[20:40:51] somerandomteen: Request parameters as copied from the error page are here https://thepasteb.in/p/oYhlEzGNwp1UZ. For some reason, the DOB is in the request, but never makes it into the local record variable
[20:41:58] nankyokusei: has joined #ruby
[20:48:55] spheric: has joined #ruby
[20:49:01] bronson: has joined #ruby
[20:51:54] armyriad: has joined #ruby
[20:57:41] spheric: has joined #ruby
[20:59:09] Pumukel: has joined #ruby
[21:00:42] __Yiota: has joined #ruby
[21:05:23] JeanCarloMachado: has joined #ruby
[21:08:03] roamingdog: has joined #ruby
[21:08:53] roamingdog: has joined #ruby
[21:09:38] roamingdog: has joined #ruby
[21:10:27] roamingdog: has joined #ruby
[21:10:48] leitz: has joined #ruby
[21:11:18] roamingdog: has joined #ruby
[21:12:03] roamingdog: has joined #ruby
[21:16:26] leitz: Any suggestins on why my if-elsif stuff isn't dealing with the lines? https://gist.github.com/LeamHall/342dc86c2265d38d0ec9afe56ce6a0c9
[21:16:39] leitz: Trying to parse PMs from various forums.
[21:17:22] apeiros: leitz: you know you can put non-code into a separate file in the same gist
[21:17:36] apeiros: what do you mean by "isn't dealing with the lines"?
[21:17:44] leitz: apeiros, actually, didn't know that.
[21:17:46] apeiros: what behavior do you observe, and what did you expect instead?
[21:17:55] apeiros: oh, brb, 2min
[21:19:08] leitz: I expect that each line gets dealt with according to the elseif. So most get put into a nested hash. If I have "puts line" right under the "in_file.each_line" it puts the line, so I know it's reading the lines.
[21:19:44] leitz: If it's cleaner I can put the code and a sample file on github.
[21:21:33] apeiros: yes, please update your gist so I can reproduce what's happening for you
[21:22:47] blackmesa: has joined #ruby
[21:24:44] leitz: Is this better? https://gist.github.com/LeamHall/201e05bc483bb425c4a1941173e45be1
[21:25:21] apeiros: the other secret git feature is that you can edit existing gists ;-)
[21:25:30] apeiros: has the benefit of providing nice diffs
[21:25:38] apeiros: and yes, that's better, thanks :)
[21:25:45] leitz: Ah...still learning. A lot to learn, it seems. :)
[21:26:14] leitz: The end state is a sing hash turned into JSON so I can dump it into MongoDB.
[21:26:23] apeiros: oh, you wrote the other file as comment
[21:26:33] apeiros: you should click "add file" and add it as a file. can't get raw of a comment :(
[21:26:41] leitz: Gimme a sec.
[21:27:51] auv: has joined #ruby
[21:28:28] bkxd: has joined #ruby
[21:29:22] Channel6: has joined #ruby
[21:29:37] auv: has joined #ruby
[21:29:40] DLSteve: has joined #ruby
[21:30:36] leitz: Didn't like adding the txt file.
[21:30:56] leitz: "Something went wrong". How verbose...
[21:31:05] hutch34: has joined #ruby
[21:31:15] apeiros: oy, bugs in github? :D
[21:31:33] leitz: Hehe...would another gist of just the txt work?
[21:32:10] hutch34: has joined #ruby
[21:33:39] leitz: https://gist.github.com/LeamHall/f824f1c047f88320e0cd7f1baabb28be
[21:34:00] leitz: I see the "Add file" now, with a new gist. Didn't see if once I had created the first gist.
[21:35:59] apeiros: well, your code hangs in "elsif messageid == 0"
[21:37:00] leitz: Yup, just saw that. That has to be after the section that increments message_id.
[21:38:38] leitz: And fixing the attempt to append to a String makes it work. For mild definitions of "work".
[21:40:28] jackrandom: has joined #ruby
[21:40:55] leitz: Hmm...not getting the other hash keys in, and not good json.
[21:41:00] leitz: More work to do...
[21:41:51] m0d: has joined #ruby
[21:43:06] volty: has joined #ruby
[21:44:22] jackrandom: has joined #ruby
[21:45:10] apeiros: you tell me when you need further help :)
[21:45:37] leitz: I'll always need further help, just not sure what to ask yet. ;)
[21:46:15] modlin: has joined #ruby
[21:47:28] JoshS: has joined #ruby
[21:52:47] quobo: has joined #ruby
[21:52:53] ddffg: has joined #ruby
[21:53:46] AlexRussia: has joined #ruby
[21:56:09] leitz: Hey apeiros, didn't they upgrade Ruby to allow malformed range calls on arrays? :P
[21:58:37] blackmesa: has joined #ruby
[22:00:37] leitz: Still need to figure out why the JSON is malformed.
[22:04:34] mostlybadfly: has joined #ruby
[22:06:25] apeiros: I don't think ruby allows anything malformed (and it shouldn't)
[22:06:40] awesomess3: has left #ruby: ("Leaving")
[22:07:11] leitz: /usr/local/lib/ruby/2.4.0/json/common.rb:286:in `generate': source sequence is illegal/malformed utf-8 (JSON::GeneratorError)
[22:08:45] leitz: And the "malformed" was me poking fun at me; the hash keys'weren't being set because I wasn using the wrong range mechanism.
[22:13:06] leitz: Not sure what the JSON error means, unless the file as bad UTF-8 in it.
[22:14:14] cschneid_: has joined #ruby
[22:15:02] apeiros: well, the error certainly implies that your string is not valid utf-8
[22:18:19] t-recx: has joined #ruby
[22:19:47] leitz: Well, that stinks. Is there a way to parse a string and test if it's mal-formed? The files can get pretty long and I don't want to try and find one character.
[22:20:25] apeiros: File.read(path).valid_encoding?
[22:20:44] apeiros: the example you gave is one message?
[22:20:58] apeiros: actually, seems to be 2 messages?
[22:22:05] leitz: Actual files contain 50-150 messages
[22:23:34] apeiros: sounds great
[22:23:45] apeiros: IMO you should split on ==…
[22:23:50] apeiros: and then process per message
[22:23:52] apeiros: and use classes
[22:23:57] apeiros: and stuff and dunno whatever
[22:24:20] apeiros: so before first ===… is metadata, and then ===… separates individual messages?
[22:24:30] apeiros: always 80 "="?
[22:24:31] leitz: Yes on ===
[22:24:54] leitz: Not sure on always 80 as I'm going to be parsing from different forums.
[22:24:59] leitz: This one is first.
[22:25:14] Sembei: has joined #ruby
[22:25:25] leitz: Was avoiding a class because 1) I stink at OOP and 2) This is just a data store.
[22:25:37] jcao219: has joined #ruby
[22:26:19] nertzy: has joined #ruby
[22:26:39] leitz: Well, dang. This puts false: puts File.read("privatemessages-Leitz-April 5th, 2016.txt").valid_encoding?
[22:29:52] apeiros: you'll keep stinking if you never try it
[22:29:59] apeiros: and it's ok if your first attempts at OOP stink
[22:30:14] apeiros: everybody's first attempts stank
[22:30:27] leitz: I've been trying it for a few years. That's why I think I stink. :)
[22:31:00] leitz: So, creating an encodings array and having each line append it's encoding to the array, and then doing a uniq! leaved me with UTF-8
[22:32:52] tildes: has joined #ruby
[22:36:49] leitz: Updating gems, just in case.
[22:37:11] volty: something like this: str = IO.read ... ; str.encode!( 'UTF-8', 'ISO-8859-1', invalid: :replace ) unless str.valid_encoding? ?
[22:37:49] nowhereman: has joined #ruby
[22:39:04] leitz: Ah, found it.
[22:39:14] leitz: Mangled volty's suggestion.
[22:39:24] coderphive: has joined #ruby
[22:40:08] leitz: So this line still uts UTF-8 puts line.encoding unless line.valid_encoding?
[22:41:38] volty: Sorry, can't get it.
[22:42:30] leitz: The line's encoding reports as UTF-8, but that's the line that chokes the script.
[22:42:59] nankyokusei: has joined #ruby
[22:43:40] leitz: Yup, that was it.
[22:43:47] cseder: has joined #ruby
[22:44:08] volty: and how are you going to fix it, hopefully forever ?
[22:44:36] leitz: Right now with "vi", as my attempts at encoding didn't seem to work.
[22:45:03] leitz: It reported as UTF-8 but choked on line.valid_encoding?
[22:45:41] volty: try to force re-encoding and see if it makes diff, and what is the diff
[22:46:22] LastWhisper____: has joined #ruby
[22:46:26] volty: i have a question. I forgot about closures. Need a func timeTrue(n) that when called returns true the first n times, then false
[22:46:42] volty: timesTrue(n)
[22:47:53] cseder: I'm just considering different options and I'm just learning ruby and rails. Heroku seems like a pretty good option for a startup, by reducing efforts involved in infrastructure, but will it scale well independent of server location?
[22:49:58] leitz: cseder, Rails and Ruby can scale pretty well. Not blazing fast performance. but if you spend a week or two with it you'll now if you like coding in it.
[22:50:29] leitz: I find enjoyment of the language a primary motivated to code, which is the primary tool for getting better.
[22:51:09] cseder: leitz Was thinking more about Heroku as a platform to deploy apps to, does it scale well if audience is spread across the globe?
[22:51:13] leitz: motivated/motivator
[22:51:38] cseder: ie not in the US
[22:52:05] leitz: Not as sure on Heroku, but I do know it's supposed to be good for start-ups to start up. You can move to AWS or similar once you have a revenue stream that supports it.
[22:52:52] coderphive: leitz: define "scale well
[22:54:02] coderphive: cseder: Any application can be scaled if designed to do so. That really depends on what sort of scaling you'd like to do and how much time you'd like to put into it.
[22:54:41] jackjackdripper: has joined #ruby
[22:54:46] leitz: And how much you want to pay for the power to perform. Large sites have used Rails (https://www.coderfactoryacademy.edu.au/posts/top-15-sites-built-with-ruby-on-rails), hence my use of "scale well".
[22:54:58] leitz: "Best" is a totally different term. :)
[22:55:07] cseder: Was thinking about stuff such as server response performance, network routes, nodes etc
[22:55:20] cseder: for the Heroku service
[22:56:44] leitz: Most of the sites I've supported suffered more from bad database queries and bloated java than infrastructure. Not saying it won't, but optimazation at that level might not be yoru first source of success.
[22:57:22] leitz: ACTION blames all poorly types words on a goblin infested keyboard.
[22:59:42] Pumukel: has joined #ruby
[23:00:08] coderphive: leitz: thanks ;)
[23:01:09] coderphive: cseder: so, just like leitz said it's not really about the infrastructure but moreso about how you implement it's usage when it comes to scaling.
[23:02:42] coderphive: in my experience external calls and poorly selected/utilized data storage are performance blockers in terms of scaling
[23:03:05] cseder: thats logical coderphive
[23:03:07] millerti: has joined #ruby
[23:05:23] cseder: I see that many businesses both large and small use Heroku with success (if I can believe the hype), so I guess it's a good way to go. I agree on the statements regarding proper coding as the main source of scalability
[23:06:11] cseder: Been programming in different languages for many years as a job, and I've seen alot
[23:07:27] mim1k: has joined #ruby
[23:07:46] cseder: Ruby is really fun to learn. It has so many fast workarounds for stuff that's cumbersome in other languages. And beautiful support for blocks / lambdas and metaprogramming
[23:08:16] cseder: Can't wait to code a real life application in it
[23:08:25] esObe_: has joined #ruby
[23:08:46] alveric1: has joined #ruby
[23:09:26] antgel: has joined #ruby
[23:09:44] volty: Do we have real threads (apart jruby) now ?
[23:09:59] volty: native, I mean
[23:13:15] havenwood: volty: Ruby went from green threads in 18 to one-to-one mapping to real system threads in 1.9. There is a global vm lock (GVL) around some things and not others. IO is the most-commonly pointed out release of the GVL.
[23:14:20] havenwood: volty: Guilds have been proposed for a future version of Ruby. Each guild will have its own guild-specific lock, but won't block parallel computation in another guild.
[23:15:00] havenwood: volty: http://olivierlacan.com/posts/concurrency-in-ruby-3-with-guilds/
[23:15:04] havenwood: volty: https://blog.heroku.com/ruby-3-by-3
[23:15:17] volty: thx havenwood
[23:25:27] jcao219: has joined #ruby
[23:28:24] roamingdog: has joined #ruby
[23:38:40] oleo: has joined #ruby
[23:49:34] perniciouscaffei: has joined #ruby
[23:49:56] jenrzzz: has joined #ruby
[23:55:13] latemus: has joined #ruby
[23:57:45] _sfiguser: has joined #ruby