« Back to channel list

#ruby - 24 June 2016

« Back 1 day Forward 1 day »
[00:00:12] chopin: has joined #ruby
[00:01:34] arescorpio: has joined #ruby
[00:02:39] karapetyan: jhass: oh, gcd makes it easy, thanks
[00:03:01] drbrain: here's an input that'll test your speed: [510510, 1299709]
[00:03:06] jhass: well, consider if it's still in the spirit of the kata
[00:03:35] drbrain: that's the product of the first 7 primes divided by the 100,000th prime
[00:03:58] drbrain: your implementation takes 10 seconds on my machine
[00:04:45] karapetyan: ok, i understand, thank you
[00:05:06] jenrzzz: has joined #ruby
[00:05:06] jenrzzz: has joined #ruby
[00:05:40] drbrain: I picked those numbers because they'll stress your implementation pretty well, and should give you good clues about how to optimize even if you don't use #gcd
[00:06:51] mattwashere: has joined #ruby
[00:07:08] nankyokusei: has joined #ruby
[00:07:14] karapetyan: drbrain: i'l try optimize without using #gcd, thank you.
[00:07:48] drbrain: if you know how to use #gcd to pass the kata I think that would be OK too
[00:08:28] drbrain: I left a comment on your gist
[00:09:22] aryaching: has joined #ruby
[00:13:23] havenwood: diegoviola: Here's a fun version: https://gist.github.com/havenwood/569af2e526cda3bc0b66da8c5aaf4a00
[00:13:38] dhruvasagar: has joined #ruby
[00:13:48] havenwood: diegoviola: that's my post-work variant :P
[00:14:22] diegoviola: that's out of my mind
[00:15:46] havenwood: diegoviola: but not quite right
[00:16:26] havenwood: diegoviola: i think that'd get the 7s and 35s right, but not the 5s
[00:16:47] havenwood: diegoviola: could fix
[00:19:22] havenwood: just not right at all, but we should do some fun ones for rosetta code
[00:20:52] timanema: has joined #ruby
[00:23:18] chipotle_: has joined #ruby
[00:23:30] jenrzzz: has joined #ruby
[00:26:03] harfangk: has joined #ruby
[00:31:04] ornerymoose: has joined #ruby
[00:32:21] RegulationD: has joined #ruby
[00:33:05] Silthias: has joined #ruby
[00:34:13] diegoviola: havenwood: I'm trying to write some tests for this with minitest but I'm getting very frustrated by coping the actual output in an assert_equal, is there a better way?
[00:34:22] diegoviola: and trying to compare it
[00:35:25] Silthias1: has joined #ruby
[00:38:16] amclain: has joined #ruby
[00:39:09] ICantCook: I've got a ruby script (myscript.rb) which kicks off a linux daemon by running `/opt/my/daemon -d`
[00:39:21] ICantCook: problem is, myscript.rb keeps running forever
[00:39:40] pawnbox: has joined #ruby
[00:39:49] ICantCook: how would i go about kicking off / forking? this command and letting myscript.rb exit
[00:40:07] ICantCook: if I kill myscript.rb with kill -9, /opt/my/daemon dies too
[00:40:17] ICantCook: this is not desired
[00:42:18] jhass: ICantCook: system("systemd-run /opt/my/daemon")
[00:43:00] jhass: http://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/
[00:44:32] kies: has joined #ruby
[00:44:32] jher: has joined #ruby
[00:45:09] shevy: ICantCook have you tried https://rubygems.org/gems/daemons yet? you can also look at the source to see how they went about enabling daemons
[00:45:45] jhass: http://devdocs.io/ruby~2.3/process#method-c-detach
[00:45:54] cdg: has joined #ruby
[00:46:04] jhass: http://devdocs.io/ruby~2.3/process#method-c-daemon
[00:46:10] jhass: but seriously, use a supervisor
[00:48:39] gizmore: has joined #ruby
[00:50:37] mattwashere: has joined #ruby
[00:51:23] isberg: Does anyone know a tool that reveals exactly where a string/text on a webpage is located? Started building something like this of my own last week but want to check again, just to make sure.
[00:51:23] isberg: Example input: google.com, "Welcome to Google", output "google.com/file.html" "#logo > a"
[00:56:57] dtzuzu: has joined #ruby
[00:58:50] AcidCrash: has joined #ruby
[01:03:10] dstarh: has joined #ruby
[01:04:02] Spami: has joined #ruby
[01:05:21] diegoviola: https://gist.github.com/diegoviola/a05249767421ded57b57c93fec6de1df
[01:05:34] ullu: has joined #ruby
[01:05:37] diegoviola: 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
[01:05:44] diegoviola: why is it passing with just that 1 in there?
[01:06:41] matp: has joined #ruby
[01:06:44] diegoviola: sorry https://gist.github.com/406478ae525bc6bbb776a12c20eb1bc8
[01:08:49] jenrzzz: has joined #ruby
[01:08:54] jenrzzz: has joined #ruby
[01:09:53] Ropeney: has joined #ruby
[01:10:00] guardianJ: has joined #ruby
[01:21:27] jetpackjoe: has joined #ruby
[01:23:32] Hobogrammer: has joined #ruby
[01:24:08] Spami: has joined #ruby
[01:30:05] jher: has joined #ruby
[01:32:09] pawnbox: has joined #ruby
[01:32:27] gizless: has joined #ruby
[01:42:30] moeabdol: has joined #ruby
[01:44:28] tokynet: has joined #ruby
[01:45:10] hutch34_: has joined #ruby
[01:45:18] skweek: has joined #ruby
[01:46:30] Asher: has joined #ruby
[01:53:53] xall: has joined #ruby
[01:54:14] mattwashere: has joined #ruby
[01:54:41] Spami: has joined #ruby
[01:54:43] dhruvasagar: has joined #ruby
[01:56:30] sneakers: has joined #ruby
[01:58:03] roamingdog: has joined #ruby
[01:58:28] ur5us: has joined #ruby
[02:00:15] northfurr: has joined #ruby
[02:05:59] araujo_: has joined #ruby
[02:08:00] nankyokusei: has joined #ruby
[02:11:40] dcunit3d: has joined #ruby
[02:12:01] sumobob: has joined #ruby
[02:12:59] valetudo: has joined #ruby
[02:15:21] sapslaj_: has joined #ruby
[02:16:10] ruby-lang880: has joined #ruby
[02:21:55] ptierno: has joined #ruby
[02:22:21] roamingdog: has joined #ruby
[02:22:31] northfurr: has joined #ruby
[02:24:34] sp4rrow: has joined #ruby
[02:25:43] dstarh: has joined #ruby
[02:26:13] pawnbox: has joined #ruby
[02:29:43] timanema: has joined #ruby
[02:31:27] mistermocha: has joined #ruby
[02:31:46] northfurr: has joined #ruby
[02:33:32] kireevco: I'm using aws sdk. and trying to read metadata, any example how to read custom user metadata? `x-amz-meta-*`
[02:34:34] ketherah: has joined #ruby
[02:35:04] nullFxn: has joined #ruby
[02:36:02] kireevco: oh... so that data is automatically prefixed, and I should be able to access it via :bar for x-amz-meta-bar
[02:39:12] braincra-: has joined #ruby
[02:39:56] jenrzzz: has joined #ruby
[02:39:56] jenrzzz: has joined #ruby
[02:40:26] mattwashere: has joined #ruby
[02:40:33] timanema: has joined #ruby
[02:42:12] northfurr: has joined #ruby
[02:46:29] giz|work: has joined #ruby
[02:47:51] roamingdog: has joined #ruby
[02:50:56] mistermocha: has joined #ruby
[02:53:34] pwnd_nsfw`: has joined #ruby
[02:54:53] mattwashere: has joined #ruby
[02:55:20] textchimp: has joined #ruby
[02:57:52] jaguarmagenta: has joined #ruby
[02:58:02] Silthias: has joined #ruby
[03:01:05] minimalism: has joined #ruby
[03:01:24] Neo--: has joined #ruby
[03:02:06] pawnbox: has joined #ruby
[03:03:33] globalall0c: has joined #ruby
[03:04:16] Es0teric: has joined #ruby
[03:04:52] northfurr: has joined #ruby
[03:06:09] zacstewart: has joined #ruby
[03:06:36] SilverKey: has joined #ruby
[03:13:18] chipotle: has joined #ruby
[03:15:55] dstarh: has joined #ruby
[03:16:30] cdg: has joined #ruby
[03:18:06] braincrash: has joined #ruby
[03:19:00] jackjackdripper: has joined #ruby
[03:19:02] sumobob: has joined #ruby
[03:20:48] testuser: has joined #ruby
[03:21:21] k3rn31: has joined #ruby
[03:25:30] joneshf-laptop: has joined #ruby
[03:27:04] c0mrad3: has joined #ruby
[03:30:32] moeabdol: has joined #ruby
[03:31:12] gix: has joined #ruby
[03:33:31] RegulationD: has joined #ruby
[03:36:01] lessless: has joined #ruby
[03:38:08] pawnbox: has joined #ruby
[03:40:38] agentmeerkat: has joined #ruby
[03:40:59] jenrzzz: has joined #ruby
[03:44:19] nando293921: has joined #ruby
[03:44:32] hk238: has joined #ruby
[03:47:34] mattwashere: has joined #ruby
[03:48:20] mattwashere: has joined #ruby
[03:55:28] pickandmix: has joined #ruby
[03:55:32] pickandmix: can anyone please help? This is the problem I'm getting right now http://pastebin.com/7uD6wks4
[03:55:33] ruby[bot]: pickandmix: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/28b736cbec26c8464323ffd76678e01b
[03:55:33] ruby[bot]: pickandmix: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[03:55:50] ensyde__: has joined #ruby
[03:57:33] northfurr: has joined #ruby
[03:58:09] dstarh: has joined #ruby
[04:00:07] ullu: has joined #ruby
[04:00:58] voodoofish430: has joined #ruby
[04:01:12] tmtwd: has joined #ruby
[04:03:25] tmtwd: has joined #ruby
[04:03:47] craigp: has joined #ruby
[04:08:59] nankyokusei: has joined #ruby
[04:09:00] l4v2: has joined #ruby
[04:11:33] pontiki: has joined #ruby
[04:12:32] Neo--: has joined #ruby
[04:14:01] l4v2: Can someone take a look at this and tell me why this LIKE querry isn’t working. Thank you. https://gist.github.com/anonymous/61c23405aaeb0b5561cc642f4f333d13
[04:16:56] l4v2: Correction, the link is this https://gist.github.com/anonymous/55a21d026e0624d695d26e29b6966d2f
[04:18:50] elifoster: has joined #ruby
[04:19:18] Wolland: has joined #ruby
[04:22:04] adam12: l4v2: you likely want "%good%"
[04:22:52] sumobob: has joined #ruby
[04:24:14] pontiki: looks like homework to me
[04:25:05] l4v2: adam12 ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: cars: SELECT "cars".* FROM "cars" WHERE (cars LIKE '%good%')
[04:25:25] l4v2: No, it’s just me doing this guys git challenges
[04:25:38] adam12: l4v2: 'cars' in your query should be 'condition'
[04:25:59] l4v2: https://github.com/schneems/arrays_and_active_record
[04:27:22] l4v2: Sweet, thanks adam12. I was close. everything I saw used the # sign in there
[04:27:51] adam12: l4v2: #{} is interopolation. So #{good} would of been the value of the local variable 'good'
[04:28:07] adam12: so it would of worked, had you put `good = "good"` somewhere before it.
[04:28:20] l4v2: oh ok, thanks
[04:28:30] l4v2: How is this better than SQL?
[04:29:07] adam12: Well for one, if `good` was ";DROP FROM cars" it wouldn't work because it's escaped properly for you.
[04:30:43] l4v2: THis seems hard lol
[04:30:57] l4v2: Not seeing it yet
[04:31:04] pontiki: it isn't better ; it *is* sql
[04:31:14] patrick_star: has joined #ruby
[04:31:57] astrobunny: has joined #ruby
[04:32:32] l4v2: Why not just query the SQL or PostgreSQL way?
[04:33:26] pontiki: when you put a query in a string like that, it *is* SQL
[04:33:36] dcunit3d: has joined #ruby
[04:33:54] SilverKey: has joined #ruby
[04:34:21] RegulationD: has joined #ruby
[04:35:26] xall: has joined #ruby
[04:37:28] mattwashere: has joined #ruby
[04:37:32] l4v2: Are any of you rails developers?
[04:38:27] maloik: has joined #ruby
[04:38:29] l4v2: I’m trying to get my first Rails job, and even with a degree, I only got one interview.
[04:38:46] l4v2: I’ve been learning on my own time
[04:39:46] pontiki: i've been doing rails dev since ~ 2007
[04:39:55] pontiki: heavily the last 5 years
[04:40:14] l4v2: Remotely or on site?
[04:40:25] pontiki: full-time and contract
[04:40:36] l4v2: What city are you in?
[04:40:57] l4v2: There’s no Rails work in my area.
[04:41:17] l4v2: I’m probably gonna have to move to NYC
[04:41:19] pontiki: most major cities in the US there is
[04:41:43] pontiki: it's never going to be as prevalent as PHP or Java
[04:42:06] l4v2: Yeah, I’m outside of Syracuse NY, and there’s nothing, but I will move to do it.
[04:43:33] ponga: has joined #ruby
[04:44:12] pontiki: isn't Rochester a big tech area?
[04:44:24] pontiki: NYC certainly has a lot
[04:44:39] voodoofish430: has joined #ruby
[04:44:43] conta: has joined #ruby
[04:45:03] l4v2: A lot of places in NY are big tech areas, but only NYC seems to have Rails stuff going on.
[04:45:08] pontiki: i'm in the twin cities, and there's a bunch here; there's a lot in SF, Denver, KC, PDX, Seattle
[04:45:16] adam12: Buffalo is really picking up
[04:45:40] l4v2: I was just in Buffalo and NYC for some other work
[04:46:39] l4v2: I’d rather go to the big city, where I just paid out my but in tolls, bridge tolls, parking, etc…
[04:46:44] pontiki: seems to be a lot in TX; i keep getting offers from all over there. This past week I've heard from Ohio, PA, NC too
[04:47:13] l4v2: How did you get your first Rails job?
[04:47:58] pontiki: i was contacted by a recruiter
[04:49:01] l4v2: I can’t even get into the tech field…
[04:49:20] pontiki: i've been in the tech field since 1980
[04:49:41] smathy: Better to have some open source contributions/projects to your name than a degree.
[04:49:53] astrobunny: has joined #ruby
[04:49:57] pontiki: indeed, yes
[04:50:08] smathy: ...and better to meet and network with people at meetups than apply for advertised jobs.
[04:50:40] pontiki: good jobs, the jobs you want, are not gotten by sending in a resume with a million other people
[04:50:55] pontiki: they're had by meeting and talking to people, getting to know them and them you
[04:51:45] l4v2: Sounds like I’m gonna go back to bagging groceries then, because I know no one in this field
[04:51:51] djbkd: has joined #ruby
[04:51:57] smathy: Certainly when you're first starting, later, once you have an impressive record and career you can compete with others in an interview/applicant situation.
[04:52:10] pontiki: you will never meet them if you don't go out and meet them
[04:53:04] jenrzzz: has joined #ruby
[04:53:04] jenrzzz: has joined #ruby
[04:53:06] cyphase: has joined #ruby
[04:53:52] l4v2: What a ridiculous field to start out in. I go to school, get a degree, then no one will touch me, because I don’t have a big history, yet in the 80’s and 90’s everyone was learning together.
[04:54:15] smathy: It was the same in the 80s and 90s.
[04:54:16] pontiki: what degree?
[04:54:21] l4v2: Comp Sci
[04:55:07] pontiki: most ppl in web i've met don't have a degree at all
[04:55:22] l4v2: I thought I was gonna be all sought after, and I ehar back from no one with a pretty impressive resume
[04:55:26] pontiki: a lot of the top players i know don't, even
[04:55:41] smathy: A degree has never meant anything in this industry. Not unless you wanted some boring corporate job.
[04:55:55] smathy: I have no degree, I dropped out of comsci because it was boring.
[04:57:02] pontiki: i have a CS degree, but i think i got hired initially because i already had actual dev experience. tonight i said something like "getting my degree didn't prevent from learning to be a developer"
[04:57:33] kareeoleez: has joined #ruby
[04:58:07] l4v2: Well, I look at this year like it is my fifth year in college, becuase now I am acrually focusing on one thing to be really good at it.
[04:58:27] smathy: The greatest thing about the tech industry is that it's so easy to prove yourself (with or without a degree).
[04:58:57] smathy: It's hard for graduates in any industry to get their first job, but at least in tech you can get involved in other things.
[04:59:11] smathy: ...but l4v2, you gotta move from Syracuse - that's just a non-starter.
[04:59:36] smathy: Heh, pontiki, I love that statement - so true :)
[05:00:06] l4v2: I keep applying to Rails jobs in NYC and remotely
[05:00:37] smathy: Yeah, very unlikely to score there with no track record. Remote jobs are the hardest to get because you're competing with everyone else in the whole country.
[05:01:01] l4v2: I know, that’s why I’m applying to NYC
[05:01:20] pontiki: are they hiring entry level rails devs anywhere there?
[05:01:20] smathy: Oh sorry, I thought you meant for remote jobs in NYC.
[05:01:23] smathy: I'd recommend moving to SF, NY, LA, Chicago, San Diego, or Austin - in that order.
[05:02:04] pontiki: I'll toss in Minneapolis/St. Paul there; Rails is hot here. The weather sucks mightily tho
[05:02:29] l4v2: Yeah, I have a place to sublet from in NJ just across the bridge from NYC, but if someone down there would actully respond to my resume I will move.
[05:03:19] l4v2: I had one phone interview, and the guy said “Oh learning curve>” and let me go.
[05:03:39] smathy: l4v2, btw, this is a decent resource to see where all the jobs are: https://whoishiring.io/ - and interesting it suggests I should have mentioned Denver too :)
[05:04:40] l4v2: Cool, thank you
[05:05:11] smathy: What that doesn't show though is the insane community that exists in SF. It's like a 24x7 tech convention is constantly in progress there.
[05:05:46] smathy: If I was just starting my career, there's nowhere else in the world I would be.
[05:05:58] smathy: (and I don't even like SF :)
[05:07:29] yfeldblum: has joined #ruby
[05:08:11] pontiki: thank you; SF is my love, my true home, my tribal lands
[05:08:43] rbennacer: has joined #ruby
[05:09:00] smathy: Heh :) Man, if I could stand living there, I'd be there without question.
[05:09:04] cyphase: has joined #ruby
[05:09:29] l4v2: Why don’t you guys like it there?
[05:09:38] pontiki: i *do* like it there
[05:09:52] smathy: I was gonna say :)
[05:10:01] pontiki: i am where i am today because i'm also caring for my parents
[05:10:13] pontiki: but i'll be back there as soon as i can manage it
[05:10:19] l4v2: Hey look, and there’s my area - military job, military job, etc…
[05:10:22] craigp: has joined #ruby
[05:11:09] smathy: pontiki, ah, fair enough.
[05:11:31] smathy: I don't like SF because it's humid when it's hot, it's windy when it's cold, lots of homeless, hippies, and socialists. I like visiting the place, but I can't live there.
[05:11:56] pontiki: i am a hippy, i am a socialist, and i've been homeless :)
[05:12:15] smathy: Heh :) It is your tribal land ;)
[05:12:22] pontiki: when it's humid, it's not really humid
[05:12:36] pontiki: it's actually more humid when it's cold, which is why the wind hurts
[05:12:54] pontiki: why you wore your expedition parka at candlestick park :D
[05:13:38] pontiki: i love the whole bay area, all of it, even the "bad" parts
[05:14:13] smathy: Maybe I've been unlucky, I definitely had some very humid hot days there, but windy and the other things are enough to kill it as an option for me :)
[05:14:29] pLaToOn: has joined #ruby
[05:14:31] smathy: I wish I did too, it's such a great place for tech.
[05:14:49] pontiki: nothing like i get here in the midwest, 90deg and 90%H
[05:14:51] l4v2: My plain leaves tomorrow.
[05:15:31] pontiki: the bay area has "natural A/C" with the marine layer moving in nightly and cooling everything off
[05:15:37] bnagy: has joined #ruby
[05:16:02] pontiki: (which is what makes the humid cold, mostly)
[05:16:25] pontiki: it's by no means perfect, and by no means suited for everyone
[05:16:41] pontiki: it is a hugely different mental landscape than most of the rest of the world
[05:17:20] smathy: l4v2, good for you.
[05:17:31] pontiki: for me, within that, lies a level of honesty and authenticity i've never felt anywhere else (and i miss it)
[05:17:58] smathy: Yeah, people are definitely disarmingly up front there.
[05:18:12] l4v2: I was just kidding, I was gonna go to NYC first, just cause I don’t watn to be too far away from my family.
[05:18:57] pontiki: another aspect of SF is that it is a mecca for misfits
[05:19:12] smathy: l4v2, you can definitely make NYC work, that's the second best place in the US for tech. It's definitely a distant second though, and worth thinking about, but close to family is important too for most people.
[05:19:13] l4v2: That’s where I belong then
[05:20:04] l4v2: Thanks for the advice. I’m gonna get back to ActiveRecord querying now.
[05:20:44] smathy: ACTION heads off too - although to sleep :)
[05:21:06] smathy: Smelly hippy!
[05:21:11] l4v2: Is queryng usually done on Heroku?
[05:21:20] l4v2: console?
[05:21:33] l4v2: in production?
[05:21:37] pontiki: sorry, i dn't use heroku
[05:21:52] pontiki: and i never touch production unless there's a huge bug
[05:22:12] diablerouge: has joined #ruby
[05:22:14] l4v2: So you do it in development and then push it up
[05:22:17] pontiki: and then cuss at the devs who made it impossible to debug locally
[05:22:34] pontiki: yes, dev/text -> qa -> staging -> production
[05:22:41] pontiki: those arrows go in one direction only
[05:23:10] pontiki: unless we do a major fuckup
[05:23:46] l4v2: So go into the Rails Console to mess with the model
[05:24:19] l4v2: just like I did inside of SQL
[05:25:07] sp4rrow: has joined #ruby
[05:25:42] harfangk: has joined #ruby
[05:25:53] pontiki: yeah, keep your console stuff within development
[05:26:06] pontiki: the playing around and experiemnting, i mean
[05:26:18] Hyuk: has joined #ruby
[05:27:20] KINGSABRI__: has joined #ruby
[05:27:46] textchimp: has left #ruby: ()
[05:28:05] joeyjones: has left #ruby: ("Leaving")
[05:29:27] l4v2: Cool thanks. Last question, what is the most important stuff to now for Rails?
[05:30:17] astrobunny: has joined #ruby
[05:30:23] l4v2: I read the “Well Grounded Rubyist” as well as making a Twitter themed site with Rails
[05:30:53] tmtwd: has joined #ruby
[05:35:15] RegulationD: has joined #ruby
[05:35:27] iMadper: has joined #ruby
[05:36:00] l4v2: has left #ruby: ()
[05:37:22] pontiki: when not to do something
[05:37:35] pontiki: just like in jazz -- you have to know what notes not to play
[05:37:59] zacstewart: has joined #ruby
[05:38:37] diablerouge: has left #ruby: ()
[05:38:56] pontiki: the most important thing to know *right now* about rails is it is complex, deep, and often looks like magic
[05:39:31] pontiki: so you need to start learning in small bits and pieces; do not ever be afraid to spool up a new rails app on the fly just to figure out one small thing
[05:40:07] vqrs: has joined #ruby
[05:40:26] Coldblackice: has joined #ruby
[05:40:43] pawnbox: has joined #ruby
[05:41:17] mistermocha: has joined #ruby
[05:42:16] mistermocha: has joined #ruby
[05:44:10] pLaToOn: has joined #ruby
[05:45:00] Wolland: has joined #ruby
[05:46:26] lkb: has joined #ruby
[05:47:09] mistermo_: has joined #ruby
[05:48:09] mistermocha: has joined #ruby
[05:49:27] mtkd: has joined #ruby
[05:49:28] TomyLobo: has joined #ruby
[05:50:08] mistermocha: has joined #ruby
[05:51:02] mistermo_: has joined #ruby
[05:53:50] pawnbox: has joined #ruby
[05:55:27] duncannz: has joined #ruby
[05:55:41] northfurr: has joined #ruby
[05:57:21] sauvin: has joined #ruby
[05:58:10] tAn: has joined #ruby
[05:58:11] chopin: has joined #ruby
[06:02:19] dcunit3d: has joined #ruby
[06:06:50] mistermocha: has joined #ruby
[06:07:19] timonv: Does anyone use sidekiq with high req/s on a http server? The server is able to easily 1500req/s, but in sidekiq it just clutters up
[06:07:53] zacstewart: has joined #ruby
[06:08:08] timonv: simple net http, and benchmarks on the server with ruby show a high req/s as well
[06:09:01] ornerymoose: has joined #ruby
[06:09:45] nankyokusei: has joined #ruby
[06:10:24] northfurr: has joined #ruby
[06:11:00] Niham: has joined #ruby
[06:11:20] aufi: has joined #ruby
[06:14:44] mistermocha: has joined #ruby
[06:15:26] moei: has joined #ruby
[06:15:37] the_drow: has joined #ruby
[06:16:19] harfangk: has joined #ruby
[06:18:57] johns_: has joined #ruby
[06:19:41] johns_: has left #ruby: ()
[06:21:41] andikr: has joined #ruby
[06:26:11] dhruvasagar: has joined #ruby
[06:26:31] mistermocha: has joined #ruby
[06:27:03] last_staff: has joined #ruby
[06:27:30] timanema: has joined #ruby
[06:29:57] agit0: has joined #ruby
[06:31:49] MrBusiness: has joined #ruby
[06:32:25] workmad3: has joined #ruby
[06:32:25] mistermo_: has joined #ruby
[06:32:42] hutch34_: has joined #ruby
[06:32:51] conta1: has joined #ruby
[06:33:25] mistermocha: has joined #ruby
[06:33:28] firstdayonthejob: has joined #ruby
[06:34:18] Dimik: has joined #ruby
[06:34:28] hk238: has joined #ruby
[06:34:29] mistermo_: has joined #ruby
[06:36:08] RegulationD: has joined #ruby
[06:36:10] sp4rrow: has joined #ruby
[06:38:35] banister: has joined #ruby
[06:39:10] jenrzzz: has joined #ruby
[06:39:10] jenrzzz: has joined #ruby
[06:40:53] jaguarmagenta: has joined #ruby
[06:44:16] mistermo_: has joined #ruby
[06:44:20] tAn: has joined #ruby
[06:45:43] aganov: has joined #ruby
[06:47:37] douglascorrea: has joined #ruby
[06:48:18] jenrzzz: has joined #ruby
[06:50:08] Madplatypus: has joined #ruby
[06:51:31] elifoster: has joined #ruby
[06:54:40] yfeldblum: has joined #ruby
[06:55:00] haxrbyte: has joined #ruby
[06:55:37] xall: has joined #ruby
[06:58:32] vuoto: has joined #ruby
[07:00:07] jas02: has joined #ruby
[07:05:13] madgen: has joined #ruby
[07:05:34] rrs: has joined #ruby
[07:06:14] jaruga___: has joined #ruby
[07:06:50] jaruga___: has joined #ruby
[07:07:20] dionysus69: has joined #ruby
[07:09:09] zacstewart: has joined #ruby
[07:10:41] jaruga___: has joined #ruby
[07:10:45] Hyuk: has joined #ruby
[07:10:53] cyphase: has joined #ruby
[07:11:45] ptierno_: has joined #ruby
[07:12:59] BTRE: has joined #ruby
[07:14:06] craigp: has joined #ruby
[07:16:24] Hounddog: has joined #ruby
[07:16:51] anisha: has joined #ruby
[07:18:53] codecop: has joined #ruby
[07:18:59] dcunit3d: has joined #ruby
[07:19:09] astrobunny: has joined #ruby
[07:19:26] jenrzzz: has joined #ruby
[07:19:30] n1x-nz: has joined #ruby
[07:20:30] ruby[bot]: has joined #ruby
[07:20:30] ChanServ: +o ruby[bot]
[07:22:14] tAn: has joined #ruby
[07:22:35] vondruch: has joined #ruby
[07:25:12] TomyWork: has joined #ruby
[07:26:18] astrobunny: has joined #ruby
[07:31:07] vuoto: has joined #ruby
[07:32:53] cyphase: has joined #ruby
[07:33:40] djbkd: has joined #ruby
[07:34:57] edwinvdgraaf: has joined #ruby
[07:37:00] RegulationD: has joined #ruby
[07:38:01] binaryplease1: has joined #ruby
[07:39:33] ptierno: has joined #ruby
[07:39:34] ptierno: has joined #ruby
[07:40:53] haxrbyte: has joined #ruby
[07:41:48] Pumukel: has joined #ruby
[07:42:47] LoneHerm_: has joined #ruby
[07:44:32] quakephil: has joined #ruby
[07:47:06] multi_io: has joined #ruby
[07:47:19] mistermocha: has joined #ruby
[07:48:29] Es0teric: has joined #ruby
[07:49:39] yfeldblum: has joined #ruby
[07:51:39] bigkevmcd: has joined #ruby
[07:52:35] tmtwd: has joined #ruby
[07:53:04] eGGshke: has joined #ruby
[07:55:39] haxrbyte_: has joined #ruby
[07:56:16] blaxter: has joined #ruby
[07:57:06] vuoto: has joined #ruby
[07:58:40] rkazak: has joined #ruby
[08:00:42] eGGshke: has joined #ruby
[08:03:24] sepp2k: has joined #ruby
[08:03:42] haxrbyte: has joined #ruby
[08:04:51] pawnbox_: has joined #ruby
[08:05:19] mdw: has joined #ruby
[08:05:37] jenrzzz: has joined #ruby
[08:06:53] Silthias1: has joined #ruby
[08:06:56] Spami: has joined #ruby
[08:07:00] Hyuk: has joined #ruby
[08:08:19] harfangk: has joined #ruby
[08:09:26] zacstewart: has joined #ruby
[08:09:51] mistermocha: has joined #ruby
[08:09:58] nofxx: has joined #ruby
[08:09:58] nofxx: has joined #ruby
[08:10:36] nankyokusei: has joined #ruby
[08:12:30] Ropeney: has joined #ruby
[08:13:48] mistermocha: has joined #ruby
[08:14:33] dhruvasagar: has joined #ruby
[08:16:49] piotrj: has joined #ruby
[08:18:21] tristanp_: has joined #ruby
[08:20:10] harfangk: has joined #ruby
[08:20:12] nhhc: has joined #ruby
[08:21:24] olspookishmagus: has joined #ruby
[08:22:05] dhruvasa1: has joined #ruby
[08:30:34] mistermocha: has joined #ruby
[08:31:19] tomphp: has joined #ruby
[08:32:48] marr: has joined #ruby
[08:33:42] mrgrieves: has joined #ruby
[08:34:42] mistermo_: has joined #ruby
[08:36:37] piotrj: has joined #ruby
[08:37:09] mistermocha: has joined #ruby
[08:37:52] RegulationD: has joined #ruby
[08:37:58] Couch: has joined #ruby
[08:38:00] jgt: has joined #ruby
[08:38:17] mistermo_: has joined #ruby
[08:39:14] snowy: has joined #ruby
[08:41:23] norc: has joined #ruby
[08:41:41] workmad3: has joined #ruby
[08:44:20] mistermocha: has joined #ruby
[08:44:35] LoneHerm_: has joined #ruby
[08:47:19] vuoto: has joined #ruby
[08:51:23] harfangk: has joined #ruby
[08:52:39] araujo: has joined #ruby
[08:54:44] pandaant: has joined #ruby
[08:56:04] MrBusiness2: has joined #ruby
[08:57:18] Silthias: has joined #ruby
[09:01:07] pawnbox: has joined #ruby
[09:04:35] yfeldblum: has joined #ruby
[09:09:15] tildes: has joined #ruby
[09:12:50] mistermocha: has joined #ruby
[09:13:21] agit0: has joined #ruby
[09:13:38] ur5us: has joined #ruby
[09:13:44] solars: has joined #ruby
[09:15:22] dsea11: has joined #ruby
[09:20:39] neo_: has joined #ruby
[09:21:22] norc: has left #ruby: ()
[09:22:21] madgen: has joined #ruby
[09:24:48] ciampix: has joined #ruby
[09:27:53] msvbhat: has joined #ruby
[09:28:39] jhass: timonv: your question is not entirely clear to me, you're making requests and sidekiq has too much overhead? Do you create a job for each request?
[09:32:57] tAn: has joined #ruby
[09:33:46] bkxd: has joined #ruby
[09:34:21] mtkd: has joined #ruby
[09:36:02] Niham: has joined #ruby
[09:38:15] flughafen: has joined #ruby
[09:38:25] flughafen: ohaiyo gozaimasu
[09:38:45] cajone: has joined #ruby
[09:38:53] RegulationD: has joined #ruby
[09:39:15] Niham: has joined #ruby
[09:42:20] Beverage: has joined #ruby
[09:42:20] Niham: has joined #ruby
[09:43:06] hk238: has joined #ruby
[09:44:16] isberg: has joined #ruby
[09:45:38] mistermocha: has joined #ruby
[09:45:55] pawnbox: has joined #ruby
[09:48:48] skade: has joined #ruby
[09:49:26] madgen: has joined #ruby
[09:50:09] lxsameer: has joined #ruby
[09:50:17] agit0: has joined #ruby
[09:52:16] Guest8082: has joined #ruby
[09:54:11] dcunit3d: has joined #ruby
[09:54:20] timonv: jhass: Under high load each job makes 10s of requests, where we might have a 100 jobs active, the jobs themselves do it in serial ofcourse
[09:54:50] timonv: jhass: When we test it with ab or via ruby threading manually, it goes fine and it shouldn't be an issue
[09:55:33] timonv: jhass: Tried also Net::HTTP.start and typheous, and all of them get 1000+req/s easilly (with <100ms respond times accross)
[09:55:52] jhass: typhoeus inside sidekiq?
[09:55:57] timonv: So I'm suspecting it's something to do with sidekiq
[09:56:00] timonv: Haha hell no
[09:56:20] timonv: That never worked, although I suppose sidekiq 4 might have different results
[09:56:33] timonv: Sidekiq is using Net::HTTP.start right now
[09:57:00] harfangk: has joined #ruby
[09:57:57] timonv: jhass: Working on bulking up the requests per job anyway, but since we get < 100req/s in sidekiq, the math implies it will still be a problem
[09:58:31] jhass: typhoeus inside sidekiq does work for us
[09:59:28] jhass: idk there's not much to do here without hands on
[09:59:38] jhass: I suspect a mutex somewhere
[09:59:48] joonty: has joined #ruby
[10:00:32] jhass: typhoeus hydra inside sidekiq with large bulks (1-10k) should get you there
[10:00:43] SilverKey: has joined #ruby
[10:00:53] jhass: if you're up to experimental stuff sidekiq.cr might be another venue
[10:05:48] eGGshke: has joined #ruby
[10:06:30] dminuoso: has joined #ruby
[10:07:06] d0lph1n98: has joined #ruby
[10:07:19] jgt: has joined #ruby
[10:09:29] howdoi: has joined #ruby
[10:11:25] zacstewart: has joined #ruby
[10:11:29] nankyokusei: has joined #ruby
[10:12:28] tildes: has joined #ruby
[10:16:28] sdothum: has joined #ruby
[10:17:25] biberu: has joined #ruby
[10:18:05] seth: has joined #ruby
[10:18:46] Silthias: has left #ruby: ()
[10:19:54] millerti: has joined #ruby
[10:20:29] bkxd_: has joined #ruby
[10:20:41] pwnd_nsfw: has joined #ruby
[10:23:50] AlexRussia: has joined #ruby
[10:24:16] emiltin: has joined #ruby
[10:25:34] mistermocha: has joined #ruby
[10:27:04] mdw: has joined #ruby
[10:27:44] platzhirsch: has joined #ruby
[10:27:49] timanema: has joined #ruby
[10:28:56] symm-: has joined #ruby
[10:28:58] MrBusiness2: has joined #ruby
[10:29:58] tao_: has joined #ruby
[10:33:03] senayar: has joined #ruby
[10:33:04] senayar: has joined #ruby
[10:34:44] hutch34_: has joined #ruby
[10:35:25] Guest53067: has joined #ruby
[10:38:04] DoubleMalt: has joined #ruby
[10:38:10] dhruvasagar: has joined #ruby
[10:39:36] jgt: has joined #ruby
[10:39:38] RegulationD: has joined #ruby
[10:40:38] jaguarmagenta: has joined #ruby
[10:41:55] biberu: has joined #ruby
[10:42:11] freerobby: has joined #ruby
[10:44:12] mistermocha: has joined #ruby
[10:46:41] vuoto: has joined #ruby
[10:47:21] jgt: has joined #ruby
[10:48:02] chip_: has joined #ruby
[10:50:21] diegoaguilar: has joined #ruby
[10:55:03] mistermocha: has joined #ruby
[10:55:56] johnmilton: has joined #ruby
[10:56:33] LoneHermit: has joined #ruby
[10:58:30] mistermo_: has joined #ruby
[11:00:04] blackgoat: has joined #ruby
[11:02:48] gnufied: has joined #ruby
[11:04:42] Silthias: has joined #ruby
[11:08:17] kareeoleez: has joined #ruby
[11:08:32] isberg: has joined #ruby
[11:12:56] isxek: has joined #ruby
[11:13:27] timonv: jhass: Thanks
[11:16:00] rodfersou: has joined #ruby
[11:17:42] roamingdog: has joined #ruby
[11:17:57] kareeoleez: has joined #ruby
[11:19:09] armin: has joined #ruby
[11:22:25] giz|work: has joined #ruby
[11:22:51] yfeldblum: has joined #ruby
[11:24:26] GodFather: has joined #ruby
[11:25:01] Vile`: has joined #ruby
[11:25:50] moeabdol: has joined #ruby
[11:25:58] allcentury: has joined #ruby
[11:31:05] GodFather: has joined #ruby
[11:32:57] yorickpeterse: >> Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
[11:33:01] ruby[bot]: yorickpeterse: # => 1466767978614458397 (https://eval.in/594926)
[11:33:07] yorickpeterse: >> Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
[11:33:10] ruby[bot]: yorickpeterse: # => 10823698665 (https://eval.in/594927)
[11:33:20] yorickpeterse: I wonder how OS X handles those
[11:34:35] apeiros: microsecond is its maximum precision
[11:34:56] apeiros: Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond) # => 1466768063924563000
[11:35:04] dcunit3d: has joined #ruby
[11:35:53] kareeoleez: has joined #ruby
[11:38:42] Niham: has joined #ruby
[11:40:30] RegulationD: has joined #ruby
[11:42:01] Niham: has joined #ruby
[11:42:35] timanema: has joined #ruby
[11:42:56] d0lph1n98: has joined #ruby
[11:45:20] ldnunes: has joined #ruby
[11:45:34] kareeoleez: has joined #ruby
[11:46:26] ullu: has joined #ruby
[11:49:47] cyphase: has joined #ruby
[11:49:55] toretore: has joined #ruby
[11:54:05] kareeoleez: has joined #ruby
[11:57:10] 7YUABEWIE: has joined #ruby
[12:01:40] msvbhat: has joined #ruby
[12:02:48] gnufied: has joined #ruby
[12:02:50] synthroid: has joined #ruby
[12:03:21] c355E3B: has joined #ruby
[12:03:24] ensyde__: has joined #ruby
[12:04:35] loseyourmind: has joined #ruby
[12:06:18] conta1: has joined #ruby
[12:06:27] neo_: has joined #ruby
[12:07:07] quakephil: has joined #ruby
[12:07:17] tknz: has joined #ruby
[12:08:41] vale_tudo: has joined #ruby
[12:11:50] douglascorrea: has joined #ruby
[12:12:01] kareeoleez: has joined #ruby
[12:12:19] nankyokusei: has joined #ruby
[12:12:27] dminuoso: has joined #ruby
[12:13:11] zacstewart: has joined #ruby
[12:13:14] armyriad: has joined #ruby
[12:13:45] vale-tudo: has joined #ruby
[12:13:47] senayar^: has joined #ruby
[12:13:53] nickjj_: has joined #ruby
[12:13:56] d0nn1e: has joined #ruby
[12:14:57] madgen: has joined #ruby
[12:16:25] benlieb: has joined #ruby
[12:17:25] quakephil: has joined #ruby
[12:20:26] isberg: has joined #ruby
[12:21:25] armyriad: has joined #ruby
[12:25:27] aries_liuxueyang: has joined #ruby
[12:26:16] slowmatt: has joined #ruby
[12:27:56] aupadhye: has joined #ruby
[12:31:44] deuterium: has joined #ruby
[12:32:40] mdw: has joined #ruby
[12:35:30] joonty: has joined #ruby
[12:38:07] araujo_: has joined #ruby
[12:39:10] ensyde__: has joined #ruby
[12:40:16] araujo_: has joined #ruby
[12:41:00] ornerymoose: has joined #ruby
[12:41:25] RegulationD: has joined #ruby
[12:41:26] jaguarmagenta: has joined #ruby
[12:41:33] tadassce: has joined #ruby
[12:41:50] workmad3: has joined #ruby
[12:42:08] rbennacer: has joined #ruby
[12:42:33] araujo_: has joined #ruby
[12:43:15] dn`: has joined #ruby
[12:43:55] Jardayn: has joined #ruby
[12:46:25] ornerymoose: has joined #ruby
[12:46:38] nettoweb: has joined #ruby
[12:46:42] Macaveli: has joined #ruby
[12:48:44] giz|work: has joined #ruby
[12:51:13] davedev24: has joined #ruby
[12:54:08] yorickpeterse: Ah well, as long as Linux supports it it should be fine
[12:54:49] CloCkWeRX: has joined #ruby
[12:55:41] bmurt: has joined #ruby
[12:55:43] madgen: has joined #ruby
[12:55:59] msvbhat: has joined #ruby
[12:57:09] sergio_101: has joined #ruby
[12:57:39] kareeoleez: has joined #ruby
[12:58:10] LoneHermit: has joined #ruby
[12:59:05] kareeoleez: has joined #ruby
[13:00:37] timanema: has joined #ruby
[13:01:01] solocshaw: has joined #ruby
[13:03:08] solocshaw: has joined #ruby
[13:04:08] jgt: has joined #ruby
[13:04:36] Infra-Red: has joined #ruby
[13:05:04] solocshaw: has joined #ruby
[13:06:29] jgt1: has joined #ruby
[13:06:59] Infra-Red: has joined #ruby
[13:07:15] allcentury: has joined #ruby
[13:12:17] romistrub: has joined #ruby
[13:12:42] romistrub: got an interesting issue
[13:12:47] romistrub: https://gist.github.com/romistrub/abdf57786a79ff2cbccb641cef7dafff
[13:13:11] romistrub: returns ArgumentError, missing keywords a, b
[13:13:17] snowy: has joined #ruby
[13:13:42] apeiros: it does not *return* an ArgumentError, it *raises* one
[13:13:46] loseyourmind: has joined #ruby
[13:13:52] apeiros: try: def f(*args); p args; end
[13:13:54] romistrub: apeiros: yeah, that one :P
[13:14:05] apeiros: see how the arguments you pass are received by the method
[13:14:10] apeiros: you might see why.
[13:14:44] zacstewart: has joined #ruby
[13:15:34] malconis: has joined #ruby
[13:16:39] pawnbox: has joined #ruby
[13:17:24] malconis: has joined #ruby
[13:17:53] Vile`: has joined #ruby
[13:18:18] romistrub: now I'm getting a really weird issue
[13:18:21] romistrub: undefined method `call' for nil:NilClass (NoMethodError)
[13:18:39] apeiros: ?code romistrub
[13:18:40] ruby[bot]: romistrub: We can't help you without your code, please post it to https://gist.github.com
[13:18:48] aegis3121: has joined #ruby
[13:19:26] romistrub: https://gist.github.com/romistrub/abdf57786a79ff2cbccb641cef7dafff
[13:19:38] Niham: has joined #ruby
[13:19:44] DTZUBDUB: has joined #ruby
[13:19:54] rbennacer: has joined #ruby
[13:19:56] apeiros: romistrub: uh, yeah, and why exactly do you `f.call`?
[13:20:25] romistrub: apeiros: because I need to use it in my real program, and I'm just testing it out here
[13:20:35] apeiros: bad answer
[13:21:06] romistrub: I'm debugging my program and trying to isolate how f.call works and why I'm getting an ArgumentError
[13:21:39] rbennacer: has joined #ruby
[13:22:07] apeiros: your old invocation: `f(*{a:1,b:2})`, your new one: `f.call(*{a:1,b:2})` - try again: why. did. you. change that?
[13:22:15] chip_: has joined #ruby
[13:22:29] fmcgeough: has joined #ruby
[13:22:43] romistrub: I have a hash of functions that I'm making visible for RPC, and I use #call on those functions
[13:22:56] apeiros: and in your code example you also have a hash of functions?
[13:22:58] jrafanie: has joined #ruby
[13:23:08] romistrub: apeiros: nope, just testing out .call
[13:23:23] romistrub: to see why it behaves differently from a normal function call
[13:23:25] apeiros: how on earth do you figure that this makes any sense at all?
[13:24:07] romistrub: isn't it just called sanity-checking?
[13:24:18] apeiros: you do seem to need some sanity-checking…
[13:24:41] ChiefAlexander: has joined #ruby
[13:24:42] apeiros: quick, tell me what `foo.bar()` in ruby does
[13:24:52] romistrub: calls bar() on foo
[13:24:56] douglascorrea: has joined #ruby
[13:25:03] apeiros: good, so tell me what `f.bar()` does
[13:25:05] cdg: has joined #ruby
[13:25:15] romistrub: calls bar on f
[13:25:25] apeiros: and `f.call()`?
[13:25:36] romistrub: calls call on f
[13:25:46] apeiros: and in your code example, what is `f`?
[13:26:06] apeiros: ok, but you don't call methods on methods, you call methods on object
[13:26:18] apeiros: so… on what is .call called on?
[13:26:22] romistrub: wait what? I thought methods *were* objects
[13:26:29] diegoviola: has joined #ruby
[13:26:31] romistrub: a method object
[13:26:35] romistrub: oh, well there's my confusion
[13:26:40] jhass: you can get a representation of a method as a Method object
[13:26:49] jhass: but methods itself aren't objects
[13:26:50] romistrub: could I just do rpc_hash["my_function"]() ?
[13:27:02] apeiros: romistrub: you should answer my question before asking new ones.
[13:27:16] jhass: romistrub: you can't "call" an object
[13:27:22] jhass: you can only call methods
[13:27:40] jhass: you call methods on an object
[13:27:42] jhass: end of story
[13:28:06] apeiros: so: in `f.call()`, f is a method, yes, but on what is .call called?
[13:28:17] romistrub: it can't be called
[13:28:50] romistrub: well that's what I'm running into... f isn't an object, it's a method, so .call can't be called on it
[13:28:54] apeiros: >> "hello".upcase.capitalize.gsub(/e/, 'a')
[13:28:57] ruby[bot]: apeiros: # => "Hallo" (https://eval.in/594993)
[13:29:05] apeiros: we can very well chain methods
[13:29:23] apeiros: romistrub: in the above example, what's .capitalize called on?
[13:29:34] apeiros: hint: not on the method upcase.
[13:29:38] romistrub: the result of "hello".upcase
[13:29:49] apeiros: and that's an object
[13:29:58] apeiros: so: in `f.call()`, f is a method, yes, but on what is .call called?
[13:30:14] romistrub: wait a minute...
[13:30:19] romistrub: on the return value of f
[13:30:21] romistrub: booooo urns
[13:30:33] apeiros: congrats. mystery half solved.
[13:30:38] apeiros: and what's the return value of `f`?
[13:30:47] romistrub: hence the error
[13:30:54] apeiros: and nil.call does not exist, yes, hence the error.
[13:31:02] apeiros: you can call it. but it raises.
[13:31:29] romistrub: so how do I get f as an object? :P
[13:31:34] apeiros: method(:f)
[13:32:30] apeiros: seems your sanity check checked out :-p
[13:32:40] apeiros: (hope I got that expression right…)
[13:35:43] lalalaaa: has joined #ruby
[13:35:50] jher: has joined #ruby
[13:36:21] romistrub: sigh, now I get another weird error... ArgumentError, wrong number of arguments, 0 for 1 (one sec, about to paste the gist
[13:36:55] romistrub: https://gist.github.com/romistrub/abdf57786a79ff2cbccb641cef7dafff
[13:37:03] romistrub: same gist as before, just updated
[13:38:45] apeiros: don't use puts. that's useless for debugging.
[13:39:11] romistrub: haha, ok, use p?
[13:39:13] apeiros: and why on earth do you write method[:f]
[13:39:18] apeiros: that's NOT the same as method(:f)
[13:39:27] romistrub: typo, I swear
[13:39:29] apeiros: you can't just randomly replace sigils in proglangs
[13:39:55] apeiros: you've got your current error right there.
[13:40:12] romistrub: I'm embarrassing myself this morning
[13:40:25] apeiros: your exception also tells you that btw.
[13:40:39] hutch34_: has joined #ruby
[13:40:42] apeiros: line 2 of your exception should read "…:in `method'"
[13:41:02] apeiros: the :in `method' tells you which method was affected. in your case, the 'method' method.
[13:41:28] SilverKey: has joined #ruby
[13:41:39] d0lph1n98: has joined #ruby
[13:41:44] isberg: has joined #ruby
[13:42:17] RegulationD: has joined #ruby
[13:42:50] imperator: has joined #ruby
[13:44:03] apeiros: sorry if I'm a bit brusque, might be the heat
[13:44:19] shinnya: has joined #ruby
[13:45:24] ornerymoose: has left #ruby: ()
[13:46:31] jhass: don't you have some mountain to crawl into down there? :P
[13:47:53] apeiros: the wifi is crap inside mountains
[13:47:56] Jenzo: God save the queen!
[13:48:11] Jenzo: My British pound dropped 20 cents
[13:48:18] ruby[bot]: Jenzo: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[13:48:33] flughafen: ?ot apeiros
[13:48:34] ruby[bot]: apeiros: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[13:49:00] apeiros: !qkick flughafen don't abuse the bot
[13:49:00] ruby[bot]: ruby[bot] kicked flughafen: abuse the bot
[13:49:03] Jenzo: sorry wrong room
[13:49:08] Jenzo: I thought I was in another window
[13:49:43] jhack: has joined #ruby
[13:50:18] aries_liuxueyang: has joined #ruby
[13:50:59] nankyokusei: has joined #ruby
[13:51:56] jhass: apeiros: who needs wifi anyway, you don't have fiber directly into your laptop?
[13:51:58] mattwashere: has joined #ruby
[13:53:16] ledestin: has joined #ruby
[13:53:23] JeremyM_: has joined #ruby
[13:54:56] skade: has joined #ruby
[13:56:25] agit0: has joined #ruby
[13:57:51] strigon33: has joined #ruby
[13:57:56] ciampix: has joined #ruby
[13:58:07] chipotle: has joined #ruby
[13:58:28] mtkd: has joined #ruby
[13:58:57] brendan-: has joined #ruby
[14:00:05] neo_: has joined #ruby
[14:00:23] chipotle: has joined #ruby
[14:00:24] SilverKey: has joined #ruby
[14:01:16] romistrub: I'm surprised this channel is so quiet, given the number of ruby devs
[14:01:51] vuoto: has joined #ruby
[14:01:56] imperator: has left #ruby: ("Leaving")
[14:02:32] jhass: ruby's just too easy
[14:02:36] jhass: no questions
[14:02:45] romistrub: jhass: lol plausible
[14:03:05] pwnd_nsfw`: has joined #ruby
[14:03:29] AndroUser2: has joined #ruby
[14:04:50] FernandoBasso: has joined #ruby
[14:05:57] Kruppe: has joined #ruby
[14:06:48] arnonhongklay: has joined #ruby
[14:06:57] AndroUser2: has left #ruby: ("AndroIRC")
[14:07:26] AndroUser2: has joined #ruby
[14:08:55] LoneHerm_: has joined #ruby
[14:09:22] macsteps: has joined #ruby
[14:09:25] msvbhat: has joined #ruby
[14:09:28] karapetyan: has joined #ruby
[14:09:41] karapetyan: hi, why i got error ? if from == number ? return from : return to
[14:09:54] Spami: has joined #ruby
[14:10:01] karapetyan: from == number ? return from : return to
[14:10:18] karapetyan: syntax error, unexpected tIDENTIFIER, expecting ':' (SyntaxError)
[14:10:40] snowy: has joined #ruby
[14:10:55] apeiros: because of precedence
[14:11:01] pontiki: has joined #ruby
[14:11:11] apeiros: and are you really using "if" + ternary + return in a single statement?
[14:11:29] apeiros: return from == number ? from : to # that's more how ternary is supposed to be used
[14:11:56] jhass: and no need for return if it's the last expression in your method
[14:12:10] mrgrieves: has joined #ruby
[14:12:33] karapetyan: oh, thank you.
[14:14:41] hutch34_: has joined #ruby
[14:15:14] zacstewart: has joined #ruby
[14:17:31] AlexJakeGreen: has joined #ruby
[14:19:42] Oberon: has joined #ruby
[14:20:26] DTZUBDUB: has joined #ruby
[14:20:34] Oberon: Is anyone on that'd be willing to help me refactor a simple script? I'm trying to teach myself Ruby outside of the free courses online and just what I can figure out on the docs
[14:20:42] MrBusiness2: has joined #ruby
[14:21:03] djbkd: has joined #ruby
[14:22:15] tvw: has joined #ruby
[14:22:20] spidapeeg: has joined #ruby
[14:22:30] spidapeeg: Are people live?
[14:22:36] spidapeeg: #!/usr/bin/ruby # 35 students in our class NUM_STUDENTS = 35 # Max grade of 100% MAX_GRADE = 100 num_compare = 0 arr = Array.new(NUM_STUDENTS) # Randomly populate arr for i in 0..(NUM_STUDENTS - 1) # Maximum possible grade is 100%, keep in mind that rand(5) returns possible values 0-4, so we must add 1 to MAX_GRADE arr[i] = rand(MAX_GRADE + 1) end # Output cur
[14:22:48] aegis3121: let's go with a gist for that, please?
[14:23:14] spidapeeg: It is a sort for an array
[14:23:25] pontiki: seems like the stupid is out in force this morning
[14:23:29] adam12: Oberon: If you share your code in a gist with a question, people might chime in.
[14:23:36] aegis3121: spidapeeg: Can you share your code in a gist? https://gist.github.com/
[14:23:51] chip_: has joined #ruby
[14:23:55] caudill: has joined #ruby
[14:24:00] spidapeeg: Thanks pontiki, give me a few months. I'll be swimming laps
[14:24:15] pontiki: and the D-K
[14:24:21] Oberon: Are people live?
[14:24:47] ullu: has joined #ruby
[14:24:54] Oberon: Adam12-- sorry, gotcha
[14:25:30] Oberon: https://gist.github.com/pmills88/7798d95ad8afcb28174b0f26bb3bd79a
[14:26:02] Oberon: Simple script that count words, chars, and lines. Reteaching myself ruby. It works, but I know its ugly af. 8 iterations currently.. trying to refactor it down.
[14:26:20] davedev24: has joined #ruby
[14:28:03] pontiki: Oberon: write tests before you refactor anything
[14:29:18] SilverKey: has joined #ruby
[14:29:55] adam12: Oberon: I'd start with opening and reading the file only once.
[14:30:24] adam12: Oberon: I don't believe lines 15-17 do what you think they do (which I believe is nothing)
[14:30:27] spidapeeg: https://gist.github.com/anonymous/d23afd64cf352e0c998a1d8717bf7987
[14:30:31] eljimmy: has joined #ruby
[14:31:13] spidapeeg: Why do we do NUM_STUDENTS - 2 in line 23?
[14:31:24] Oberon: 15 checks for extra chars that could confuse the script for words, need to add the check for hyphens
[14:31:50] Oberon: 17 is how the array of words is formed so it can be counted
[14:31:55] lkba: has joined #ruby
[14:32:04] Oberon: er, how the array is given a value with words
[14:32:46] adam12: Oberon: The block of 13 through 19 could likely be an assignment with file.each.line.reduce. `words_count = file.each_line.reduce(0) {|line, acc| acc + line.length}` or something similar.
[14:33:14] adam12: Oberon: What I am saying is I am not sure you can manipulate values like you are doing. Did you test that it works?
[14:33:33] adam12: ie. you can't reassign in the block and expect it to work.
[14:33:34] Oberon: I mean it outputs the correct number in the terminal when I run it
[14:34:12] ekinmur_: has joined #ruby
[14:34:46] nando293921: has joined #ruby
[14:35:50] polishdub: has joined #ruby
[14:36:35] benlieb: has joined #ruby
[14:39:14] adam12: Oberon: I don't want to rewrite it for you but I put how I would structure it at the top of my version: https://gist.github.com/adam12/44fc82daf6fee939531b871ee28ba081
[14:39:29] adam12: Oberon: Everybody in this channel would likely write it _somewhat_ differently.
[14:39:38] Oberon: yeah, for sure
[14:39:50] Oberon: I wouldn't want a rewrite anyway, you've already given me a lot to think about. Thanks =)
[14:40:56] agent_white: has joined #ruby
[14:41:28] zacstewart: has joined #ruby
[14:41:29] speakingcode: has joined #ruby
[14:41:38] TomyLobo: has joined #ruby
[14:41:42] adam12: Oberon: It could be further optimizes by not reading into `lines`, and using the `#each_line` method like you already use.
[14:42:04] Oberon: adam12: right on, thanks again =)
[14:42:06] adam12: And incrementing line_count the same way the other counters get incremented.
[14:42:11] jaguarmagenta: has joined #ruby
[14:42:13] jhack: has joined #ruby
[14:43:08] RegulationD: has joined #ruby
[14:43:59] giz|work: has joined #ruby
[14:44:01] snath: has joined #ruby
[14:44:06] arajakul: has joined #ruby
[14:44:18] Es0teric: has joined #ruby
[14:44:34] go|dfish: has joined #ruby
[14:45:03] Hobogrammer: has joined #ruby
[14:45:35] macsteps: has joined #ruby
[14:47:15] arajakul: whats the best way to remove everything from a file except for the following regex expression ie: /S-\d-(\d+-){1,14}\d+/
[14:48:22] shevy: arajakul you could capture the result via () and then simply set the new file content to the match
[14:48:23] timanema: has joined #ruby
[14:49:59] arajakul: how would i capture the result with ()?
[14:50:33] jhass: there's no need to capture
[14:50:49] jhass: just File.write(file, File.read(file)[regex])
[14:51:18] LoneHerm_: has joined #ruby
[14:51:35] jhass: or .scan(regex).join if you have more than one occurrence you'd like to keep
[14:52:03] arajakul: ohh, lemmie give that a try- thanks!
[14:54:03] msvbhat: has joined #ruby
[14:54:12] MrBusiness2: has joined #ruby
[14:55:31] harfangk: has joined #ruby
[14:56:31] Infra-Red: has joined #ruby
[14:56:54] antgel: has joined #ruby
[14:56:55] mattwashere: has joined #ruby
[14:57:09] tildes: has joined #ruby
[14:57:43] lkb: has joined #ruby
[14:58:00] roamingdog: has joined #ruby
[14:59:03] gregf_: https://gist.github.com/anonymous/1343b1745c030a047fe35c390384bf2e
[14:59:10] gregf_: oops sorry :/
[14:59:11] rbennacer: has joined #ruby
[14:59:12] icarus: has joined #ruby
[15:01:11] nankyokusei: has joined #ruby
[15:01:26] strigonLeader: has joined #ruby
[15:01:54] arajakul: how would one add a new line to the scan? i've attempted to .join("\n") but that did not work
[15:02:03] speakingcode: has joined #ruby
[15:03:17] arajakul: err nm, it did work
[15:03:43] torandu: has joined #ruby
[15:04:44] Madplatypus: has joined #ruby
[15:05:14] diegoaguilar: has joined #ruby
[15:06:33] skade: has joined #ruby
[15:08:02] lalalaaa: jhass: You need any graphical work for your social network?
[15:08:10] lalalaaa: I'm up just pm or something
[15:08:24] smathy: has joined #ruby
[15:09:24] jhass: it's not "my social network" ;)
[15:09:44] diegoaguilar: has joined #ruby
[15:09:51] jhass: https://github.com/diaspora/diaspora/issues perhaps you find something
[15:10:12] jhass: we also got https://github.com/ruby-community/ruby-community if you're looking for a project to contribute to
[15:10:49] diegoaguilar: has joined #ruby
[15:11:30] LucasTT: has joined #ruby
[15:12:03] neo_: has joined #ruby
[15:13:03] shevy: huh rubygems-2.6.6/bundler/
[15:13:35] SilverKey: has joined #ruby
[15:15:38] agit0: has joined #ruby
[15:17:27] mrgrieves: has joined #ruby
[15:18:53] moeabdol: has joined #ruby
[15:20:04] terrabl: has joined #ruby
[15:20:13] mdw: has joined #ruby
[15:20:13] JeremyM_: has joined #ruby
[15:20:54] tAn: has joined #ruby
[15:21:50] terrabl: Hello, I need to be able to take a JSON response from HTTParty, and then turn that into a hash so that I can run key value pairs on it. But everything I am attempting to do isn't working. It was working when I hard coded the hash but when I did JSON.parse(response.body), which I though puts the JSON to a hash it isnt allowing me to access elements using hash[:key]
[15:22:30] jhass: terrabl: show your code and the full error message that you get via gist.github.com
[15:22:56] vuoto: has joined #ruby
[15:24:55] neo_: has joined #ruby
[15:27:39] redbaritone: has joined #ruby
[15:27:43] jtperreault: terrabl: I believe JSON.parse() uses string keys (not symbols) by default. So, based on your example, you should be able to access the data using hash["key"] rather than hash[:key]
[15:27:49] MrBusiness3: has joined #ruby
[15:27:59] jetpack_joe: has joined #ruby
[15:28:15] terrabl: Yeah I know that but if I do that then I cant cycle through using .each do |key, value|
[15:28:54] jhass: terrabl: sure you can
[15:29:44] terrabl: really? because when I do hash["details"].each do |k, v| it gives me an error
[15:30:04] terrabl: ah frick i was missing the hash[0]["details"
[15:30:06] jhass: terrabl: as already mentioned, if you want help "an error" is completely and utterly useless
[15:30:24] terrabl: Yeah I know I think I figured it out, I was making the gist
[15:31:41] tomchapin: has joined #ruby
[15:32:02] ruby-lang407: has joined #ruby
[15:32:21] ruby-lang407: https://gist.github.com/anonymous/d23afd64cf352e0c998a1d8717bf7987
[15:32:37] neo_: has joined #ruby
[15:33:16] 64MAAIAT7: has joined #ruby
[15:33:29] neo_: has joined #ruby
[15:34:02] jhass: is there a question?
[15:34:37] i9B: has joined #ruby
[15:34:38] terrabl: Nope. I figured it out, thanks though
[15:34:44] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:45] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:51] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:51] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:51] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:51] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:54] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:58] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:58] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:34:58] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:00] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:01] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:05] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:06] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:07] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:07] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:07] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:13] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:13] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:14] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:15] terrabl: uh... stop
[15:35:18] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:18] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:18] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:19] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:23] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:23] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:23] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:23] aegis3121: someone should...block this...maybe...
[15:35:24] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:24] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:24] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:26] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:26] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:26] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:27] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:27] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:27] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:32] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:32] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:32] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:32] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:32] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:32] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:34] adam12: 11:35 i9B: v <!- hah
[15:35:40] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:40] jhass: !spam i9B
[15:35:40] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:40] i9B: www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.python.org www.py
[15:35:40] ruby[bot]: +bb i9B!*@*$#ruby-banned *!*@gateway/web/freenode/ip.192.241.204.127$#ruby-banned
[15:35:40] ruby[bot]: ruby[bot] kicked i9B: is a bannable offense, see http://ruby-community.com/pages/user_rules
[15:35:56] ruby[bot]: -bb TripleK!*@*$#ruby-banned *reggin*!*@*$#ruby-banned
[15:36:16] ruby-lang407: https://gist.github.com/anonymous/d23afd64cf352e0c998a1d8717bf7987
[15:36:16] terrabl: maybe if it was a python bot it would have banned him faster hahah
[15:36:33] jhass: terrabl: don't talk about trolls
[15:36:39] ruby-lang407: Question is Line 23
[15:36:39] adam12: jhass: Seems like it's the same time every day.
[15:36:47] adaedra: terrabl, aegis3121: next time use !ops to call them
[15:37:00] aegis3121: Got it, thanks
[15:37:02] ruby-lang407: What is the logic of 0..(NUM_STUDENTS - 2)
[15:37:06] ruby-lang407: Instead of - 1
[15:37:11] MrBusiness2: has joined #ruby
[15:39:25] aep-shoutlet: has joined #ruby
[15:40:30] jhass: ruby-lang407: - 1 is clear right? i would go beyond the boundary else
[15:40:39] jhass: - 2 is to skip the last element
[15:41:05] jhass: the inner loop considers it already
[15:41:22] jhass: so if we reach the second to last element, the inner loop compares it and the last element
[15:41:24] ruby[bot]: -bb Telecom!*@*$#ruby-banned *!*@gateway/web/freenode/ip.93.91.194.103$#ruby-banned
[15:41:59] MrBusiness3: has joined #ruby
[15:42:48] pickandmix: has joined #ruby
[15:43:24] ruby[bot]: -bb Tim_Franco!*@*$#ruby-banned *!*@gateway/web/freenode/ip.85.203.17.254$#ruby-banned
[15:43:32] jetpack_joe: has joined #ruby
[15:44:00] RegulationD: has joined #ruby
[15:44:20] jhass: folks. don't. comment. on. the. spam.
[15:44:22] pickandmix: Hi guys, https://gist.github.com/anonymous/b28f1a9fd5cbf5526862c633e1b6b7be I get this error while trying to run rails, Can anyone see what's wrong and advice?
[15:44:49] jhass: pickandmix: you have no postgresql running
[15:45:32] Beendllanke: has joined #ruby
[15:45:32] pickandmix: jhass: But I have installed postgresql?
[15:45:44] jhass: doesn't mean it's running
[15:46:02] pickandmix: um jhass so how do I run it? :/
[15:46:20] jhass: that's a question for your operating system's support channel
[15:46:33] pickandmix: right, thanks alot!
[15:47:22] NSABear: has joined #ruby
[15:47:35] NSABear: Ruby -> exe / .app
[15:47:50] jhass: Traveling Ruby, somewhat
[15:48:04] NSABear: Ruby -> recording / playing audio
[15:48:24] ruby[bot]: -bb RubyPlasma!*@*$#ruby-banned *!*@gateway/web/freenode/ip.208.123.223.254$#ruby-banned
[15:48:26] NSABear: Ruby -> voip client
[15:49:00] jhass: should be
[15:49:10] NSABear: any good gems I should Know of?
[15:49:14] NSABear: I'm considering learning Ruby.
[15:49:58] troulouliou_div2: has joined #ruby
[15:50:28] nando293921: has joined #ruby
[15:50:35] shevy: prawn is a good gem!
[15:50:41] [Butch]: has joined #ruby
[15:51:25] NSABear: I really do want to learn ruby
[15:51:29] NSABear: It's interesting.
[15:51:42] apawl: has joined #ruby
[15:51:56] shevy: start today!
[15:52:15] NSABear: Ruby -> Gui gems
[15:52:16] hutch34_: has joined #ruby
[15:52:18] NSABear: Any good ones?
[15:52:30] adaedra: Lots, but it all depends what you want.
[15:52:36] jhass: gir_ffi-gtk looks decent
[15:52:57] mello: shoes, VR with glade is great
[15:52:58] apawl: Silly question. Does Tempfile have to store files in /tmp? It's filling up my tmpfs, and I'd like to still have the ephemeral/automatic cleanup functionality of Tempfile, but temporarily stored somewhere on disk.
[15:53:00] snath: has joined #ruby
[15:53:10] braincrash: has joined #ruby
[15:53:12] adaedra: https://www.ruby-toolbox.com and http://awesome-ruby.com list some
[15:53:13] NSABear: A friend is learning to program and I am willing to learn a new langauage
[15:53:18] jhass: apawl: I think it respects TEMPDIR or something liek that
[15:53:49] jhass: apawl: https://github.com/ruby/ruby/blob/trunk/lib/tmpdir.rb#L26
[15:54:18] emiltin: has joined #ruby
[15:54:40] adaedra: apawl: if you look at Tempfile initializer, you'll see a dir parameter
[15:55:08] arajakul: has joined #ruby
[15:56:32] neo_: has joined #ruby
[15:57:03] craigp: has joined #ruby
[15:57:10] apawl: ..well that's someplace I should have looked first. Thanks.
[15:57:26] triangles: has joined #ruby
[16:00:11] bkxd: has joined #ruby
[16:00:24] ruby[bot]: -bbb JackCook!*@*$#ruby-banned Mack192!*@*$#ruby-banned *!*@gateway/web/freenode/ip.191.101.30.254$#ruby-banned
[16:00:28] tao_: has joined #ruby
[16:02:03] conta: has left #ruby: ()
[16:03:21] mtkd: has joined #ruby
[16:03:24] rkazak: has joined #ruby
[16:04:17] amclain: has joined #ruby
[16:04:30] dminuoso: has joined #ruby
[16:06:21] braincrash: has joined #ruby
[16:07:27] NET||abuse: has joined #ruby
[16:08:33] macsteps: has joined #ruby
[16:08:57] Mia: has joined #ruby
[16:12:04] macsteps: has joined #ruby
[16:12:24] ruby[bot]: -bb Jayson_!*@*$#ruby-banned *!*@gateway/web/freenode/ip.85.203.18.254$#ruby-banned
[16:12:44] jokke: does capistrano provide a method that runs a command no the host and returns true or false depending on the return value?
[16:13:02] elifoster: has joined #ruby
[16:13:02] jokke: i tried test() but i get an argument error (1 instead of 2 arguments provided)
[16:14:20] jokke: or should i ask in #rubyonrails?
[16:15:09] dminuoso: jokke: Capistrano is not rails specific, but chances are there are more people there experienced with it.
[16:15:27] whathappens: has joined #ruby
[16:15:30] jokke: yeah that's what i though
[16:15:41] dminuoso: jokke: execute() should return true/false though, shouldn't it?
[16:15:44] MrBusiness3: has joined #ruby
[16:16:03] dminuoso: jokke: just pass raise_on_non_zero_exit: true to it
[16:16:09] User458764: has joined #ruby
[16:16:14] dminuoso: Otherwise it will.. well.. raise.
[16:16:22] jokke: you mean false
[16:16:31] dminuoso: I suppose the default behaviour is false then.
[16:18:59] giz|work: has joined #ruby
[16:19:42] jokke: undefined method execute
[16:20:52] dminuoso: jokke: I was assumig you already had sshkit
[16:21:36] dminuoso: jokke: Oh wait.
[16:21:43] dminuoso: jokke: Can you gist your code?
[16:21:50] `tim`: has joined #ruby
[16:22:38] DTZUBDUB: has joined #ruby
[16:24:21] dc1: has joined #ruby
[16:24:49] dionysus69: has joined #ruby
[16:26:15] mistermocha: has joined #ruby
[16:28:22] mattwashere: has joined #ruby
[16:28:53] terminalrecluse: has joined #ruby
[16:29:11] whiteline: has joined #ruby
[16:32:17] moeabdol: has joined #ruby
[16:32:21] mistermocha: has joined #ruby
[16:33:47] SilverKey: has joined #ruby
[16:34:28] mistermocha: has joined #ruby
[16:34:31] Xiti: has joined #ruby
[16:35:11] dvinciguerra: has joined #ruby
[16:36:23] mistermocha: has joined #ruby
[16:36:50] jokke: https://p.jreinert.com/nUYyZ/text
[16:36:56] jokke: https://p.jreinert.com/nUYyZ/ruby
[16:37:48] Dimik: has joined #ruby
[16:38:06] jokke: dminuoso:
[16:38:53] dminuoso: jokke: You must place execute() inside on blocks.
[16:39:29] jokke: on blocks?
[16:39:38] dminuoso: on roles(:database) do; execute("rm -rf /;"); end
[16:39:45] dminuoso: Try that code. It is good.
[16:40:17] mistermo_: has joined #ruby
[16:42:10] mistermocha: has joined #ruby
[16:42:27] phrozen77: has joined #ruby
[16:42:52] jher: has joined #ruby
[16:42:57] jaguarmagenta: has joined #ruby
[16:44:10] mistermo_: has joined #ruby
[16:44:52] RegulationD: has joined #ruby
[16:45:41] nando293921: has joined #ruby
[16:46:19] mistermo_: has joined #ruby
[16:46:28] tape88: has joined #ruby
[16:48:08] mistermocha: has joined #ruby
[16:49:02] pwnd_nsfw: has joined #ruby
[16:50:14] mistermo_: has joined #ruby
[16:54:06] mistermocha: has joined #ruby
[16:56:11] mistermo_: has joined #ruby
[16:56:37] timanema: has joined #ruby
[16:56:52] sepp2k: has joined #ruby
[16:57:23] neo_: has joined #ruby
[16:57:49] mistermo_: has joined #ruby
[16:57:55] jackjackdripper: has joined #ruby
[16:58:04] jackjackdripper: has joined #ruby
[16:58:22] Alina-malina: has joined #ruby
[16:58:27] Amnez777: has joined #ruby
[17:00:01] Alina-malina: has joined #ruby
[17:00:13] RegulationD: has joined #ruby
[17:02:02] mistermocha: has joined #ruby
[17:02:04] nankyokusei: has joined #ruby
[17:03:53] Xeago_: has joined #ruby
[17:03:57] mistermo_: has joined #ruby
[17:04:59] sp4rrow: has joined #ruby
[17:05:25] jgt1: has joined #ruby
[17:05:52] Spami: has joined #ruby
[17:05:57] mistermo_: has joined #ruby
[17:06:24] symm-: has joined #ruby
[17:07:20] djbkd: has joined #ruby
[17:07:58] mistermocha: has joined #ruby
[17:09:45] mistermo_: has joined #ruby
[17:09:53] BinaryJobSearch: has joined #ruby
[17:11:12] CJKinni: has joined #ruby
[17:11:40] dc1: has joined #ruby
[17:11:41] spider-mario: has joined #ruby
[17:11:44] mistermo_: has joined #ruby
[17:12:03] xall: has joined #ruby
[17:12:10] whathappens: has joined #ruby
[17:12:46] macsteps: has joined #ruby
[17:13:43] whathapp_: has joined #ruby
[17:14:08] pure_eval: has joined #ruby
[17:14:43] User458764: has joined #ruby
[17:15:10] wrkrcoop: has joined #ruby
[17:15:40] SilverKey: has joined #ruby
[17:15:45] wrkrcoop: anyone familiar with present?
[17:16:11] rcvalle: has joined #ruby
[17:16:34] pureeval: has joined #ruby
[17:16:35] pureeval: has left #ruby: ()
[17:16:49] wrkrcoop: {}.present? says undefined method but in this code im reading they call .present? on a hash
[17:17:06] agentmeerkat: has joined #ruby
[17:17:36] mistermocha: has joined #ruby
[17:17:49] firstdayonthejob: has joined #ruby
[17:18:54] wrkrcoop: but according to documentation present? is used on objects …
[17:18:54] timanema: has joined #ruby
[17:19:16] SilverKey: has joined #ruby
[17:19:35] mistermo_: has joined #ruby
[17:19:59] pilne: has joined #ruby
[17:20:01] wilsonc91: has joined #ruby
[17:20:11] toretore: what is the code you're reading, what is the code you're executing, and what makes you assume that present? will work in both?
[17:20:29] wrkrcoop: toretore: [].present?
[17:20:41] wrkrcoop: according to this site this should work: https://railsless.blogspot.com/2011/08/difference-between-nil-empty-blank.html
[17:20:54] wrkrcoop: but when i run it in irb it says NoMethodError: undefined method `present?' for []:Array
[17:21:17] toretore: there is no method "present?" in ruby's stdlib
[17:21:38] mistermo_: has joined #ruby
[17:21:53] wrkrcoop: what do i need to include
[17:22:50] toretore: what is the problem you're trying to solve?
[17:23:09] CJKinni`: has joined #ruby
[17:24:16] SilverKey: has joined #ruby
[17:24:17] miqlas-H: has joined #ruby
[17:24:19] rippa: has joined #ruby
[17:24:38] arajakul1: has joined #ruby
[17:25:19] wrkrcoop: toretore: im trying to read some code and understand what it is doing, but since i used [].present? and that said no method i couldn’t figure out what the code was doing
[17:25:30] mistermocha: has joined #ruby
[17:25:30] wrkrcoop: just looking for clarification
[17:25:35] geekbri: has joined #ruby
[17:26:47] toretore: https://www.google.fr/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=ruby%20%22present%3F%22
[17:26:57] shevy: hmm https://github.com/hsbt - what is the first name and what is the last name? the CAPS is the family name? I'd like to know so that I don't use the wrong name in an email/issue request on github
[17:27:25] toretore: usually caps is family name
[17:27:58] wrkrcoop: they must be including some library
[17:28:14] toretore: did you look at the link i pasted?
[17:28:27] jhass: shevy: you could also just omit it, Hello, Hi, Hey, Greetings, ...
[17:28:54] shevy: jhass hmm yeah
[17:28:59] wrkrcoop: u sent me a link to a google search
[17:29:03] shevy: "Hey japanese dude!"
[17:29:14] toretore: wrkrcoop: what were the results of this search?
[17:29:27] mistermo_: has joined #ruby
[17:29:57] Neo--: has joined #ruby
[17:30:10] lucas: has joined #ruby
[17:30:14] MrBusiness3: has joined #ruby
[17:30:27] timanema: has joined #ruby
[17:30:32] Ebok: has joined #ruby
[17:30:35] nictrasavios: has joined #ruby
[17:30:38] moeabdol: has joined #ruby
[17:30:45] gigetoo: has joined #ruby
[17:30:49] pawnbox: has joined #ruby
[17:31:15] nictrasavios: Hello! I'm sort of new-ish to ruby, and I'm looking for someone to help me turn a cludge into elegance.
[17:31:56] shevy: oh a poetry question, out with it
[17:32:05] ruby[bot]: wrkrcoop: I don't know anything about asl
[17:32:06] nictrasavios: I posted it to SO, but I figured it might be easier to get help here: http://stackoverflow.com/questions/38018988/ruby-i-want-to-make-this-path-cludge-more-elegant-how-can-i-dynamically-refer
[17:32:08] ruby[bot]: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[17:32:40] wrkrcoop: man i feel bad ass for using ?ask
[17:32:55] nictrasavios: Don't worry, I should have known to just ask ;).
[17:33:05] nictrasavios: I'm just timid in new communities.
[17:33:21] mistermocha: has joined #ruby
[17:33:25] PaulCapestany: has joined #ruby
[17:33:34] djbkd: has joined #ruby
[17:33:56] pawnbox: has joined #ruby
[17:34:17] doubledouble: has joined #ruby
[17:35:00] nictrasavios: TL;DR: Mr. Bones makes a few methods that makes it easy to load all .rb files from a subdirectory with the same name as the class name. I have four of these classes, and I C/P-ed his code into each one. This feels... wrong. So, I'd like to externalize the methods and have each class call it to require their subfiles
[17:35:11] shevy: the require code is not needed in quite that way IMO
[17:35:20] mistermocha: has joined #ruby
[17:35:24] shevy: LIBPATH = ::File.expand_path('..', __FILE__) + ::File::SEPARATOR
[17:35:44] tomchapin: has joined #ruby
[17:35:51] shevy: the, in my opinion, best, is to structure and install like a gem
[17:36:06] aryaching: has joined #ruby
[17:36:54] shevy: for getting the absolute paths to your gem, there are several ways - one that I use is to define a project-specific constant e. g. BASE_DIR = RbConfig::CONFIG['sitelibdir']+'/name_of_the_gem_here/'
[17:37:16] mistermo_: has joined #ruby
[17:37:17] A124: has joined #ruby
[17:37:29] shevy: when you have two files like lib/web.rb and lib/main.rb
[17:37:47] shevy: you could do, if main.rb depends on web.rb, this: require 'name_of_your_gem_here/web.rb'
[17:38:17] shevy: what is the callers self btw? is that caller()?
[17:38:21] dionysus69: has joined #ruby
[17:38:21] djbkd: has joined #ruby
[17:38:31] postmodern: has joined #ruby
[17:38:38] diegoaguilar: has joined #ruby
[17:38:50] nictrasavios: I couldn't say, Mr. Bones (The gem) generated the project skeleton, I've just been hacking it to work.
[17:39:22] mistermo_: has joined #ruby
[17:39:49] toretore: nictrasavios: how far have you come on your project apart from creating the skeleton?
[17:41:22] mistermocha: has joined #ruby
[17:42:45] nictrasavios: There are four parts to the project, 3 seperate API's (A webserver to run the other parts and proccessing incomming HTTP POST requests, Slack's RealTimeMessaging API, Slack slash-command API, and Slack's incomming Webhooks API). So far, I have input from the 3rd party API's feeding into incomming webhooks, and RTM responding to simple things like "Hello", as well as the slash command for "help"
[17:43:07] Xeago_: has joined #ruby
[17:43:24] mistermo_: has joined #ruby
[17:43:37] nictrasavios: So, I have the basics for each modules down, and the project runs.
[17:43:51] toretore: i'd advice getting rid of this mr bones crap, if it's doable
[17:44:47] toretore: follow best practices for naming and placing your files, then require where necessary; making sure they're in the load path is the responsibility of the caller
[17:45:13] nictrasavios: Alright, so then then how can I do this: Webserver loads init.rb, init calls lib/web.rb, lib/main.rb, lib/commands.rb & lib/config.rb, and then those files load everything in lib/web/*.rb, lib/main/*.rb, etc.
[17:45:16] BobTheBlob: has joined #ruby
[17:45:39] mattwashere: has joined #ruby
[17:45:39] nictrasavios: By the way, if I'm not following best practices here, let me know. I think I am, from what I can clean from other forums.
[17:45:45] toretore: nictrasavios: what does "load" and "call" mean here?
[17:46:04] nictrasavios: Load meanning require, and call meaning require. Sorry - brand new and used to C/C++
[17:46:21] justinmrkva: has joined #ruby
[17:46:30] toretore: nictrasavios: any file that depends on another should require that file at the top
[17:46:51] nictrasavios: Is there a way to make it more dynamic, so that I don't have to require every single file in the subdirectories?
[17:46:59] toretore: and require should be `require('yourlib/path')`
[17:47:13] toretore: you should make each require explicit
[17:47:49] shevy: nictrasavios yeah you can do so too, t hat is why I tend to define a toplevel constant sometimes. You can use Dir[] to obtain all .rb files and then just require all of them via that; but otherwise, the really best practice is to require exactly (and only) the parts you need to use in the particular .rb file at hand
[17:48:29] nictrasavios: Fun, haha. *alright*, I guess I was trying to cheat the system
[17:49:06] shevy: it's just four files!
[17:49:17] nictrasavios: The four files each load between 5 and 25 more
[17:49:18] toretore: word of advice: if you're new to ruby, be skeptical of any gem or "tip" to make your development easier
[17:49:31] toretore: they generally only do the opposite
[17:49:42] nictrasavios: That's why I wanted each of those four to have dynamic loading of a subdirectory with their name on it ;P
[17:49:54] shevy: one of the main reasons for when I do dynamic requires is when I tend to add new classes at a later time, when you then add like +30 new classes in a project, it's easier to just do a dynamic require since you can't forget anything that way
[17:49:54] dhruvasagar: has joined #ruby
[17:50:08] nictrasavios: That's exactly what I'm doing >.<
[17:50:20] toretore: it's not difficult to add a require to a file...
[17:52:35] d10n-work: has joined #ruby
[17:53:00] emiltin: has joined #ruby
[17:53:02] justinmrkva: Just had to mention this strange tip. I was going through a codebase and saw this: `warn "WA"+"RN: message..."` At first it appears to be a Daily WTF style antipattern, but it does one useful thing: it prevents WARN from showing up in a case-sensitive search unless the warning was actually called. That's assuming that's what the programmer actually intended, of course.
[17:53:37] nictrasavios: Okay, at least make my life a little easier ;), is there a way to specify the base path of require on a per file basis? So, in web.rb, instead of require 'web/file1' require 'web/file2', etc, and in commands require 'commands/fileA' require 'commands/fileB', just have require 'file1' require 'file2' in web, and require 'fileA' require 'fileB' in commands
[17:54:02] toretore: yes, but you shouldn't
[17:54:06] mistermocha: has joined #ruby
[17:54:13] solars: has joined #ruby
[17:54:18] toretore: def my_require(f); require "web/#{f}"; end
[17:54:25] nictrasavios: Shoot, alright - at least tell me why so I don't end up being an idiot?
[17:54:52] toretore: first of all, overriding require behavior globally for a file? not a good idea
[17:55:23] toretore: secondly; all your requires should be explicit about what they're doing. it should be easy to see exactly what is being required and from where
[17:55:27] mattwashere: has joined #ruby
[17:55:55] shevy: justinmrkva lol
[17:56:17] nictrasavios: Programming 101 right, explicit rather than implicit. Shoot, foiled again.
[17:56:21] toretore: i've never seen anything done that actually improves require
[17:56:26] nictrasavios: I have a lot to learn about ruby.
[17:56:55] neo_: has joined #ruby
[17:57:12] karapetyan: how can i optimize this
[17:57:14] karapetyan: return from if (number % from == 0 && number / from == target)
[17:57:14] karapetyan: return to if (number % to == 0 && number / to == target)
[17:57:22] djbkd: has joined #ruby
[17:57:39] toretore: nictrasavios: you can make a file web.rb which contains all the requires for the web directory
[17:57:45] toretore: then require 'web'
[17:58:00] toretore: this may or may not make sense or be a good idea for your case
[17:58:57] nictrasavios: , /bin/init requires /lib/web.rb, I was hoping web.rb could require /lib/web/*.rb ;P
[17:59:06] nictrasavios: But, if that's bad practice than so be it ;P
[17:59:15] toretore: you can, but i don't see the point
[17:59:24] shevy: nictrasavios that setup leads to circular require warnings
[17:59:41] shevy: which is another reason why minimal-single require calls to the minimum code required is useful
[17:59:53] nictrasavios: So, should I do all my requires in init?
[17:59:56] shevy: for /bin/init, in general, you need nothing more than: require 'name_of_your_gem'
[18:00:03] nictrasavios: Ah, thank you.
[18:00:06] shevy: if you ever need more than that, then something was setup incorrectly prior to that
[18:00:15] SCHAAP137: has joined #ruby
[18:00:23] nictrasavios: That is exactly what I'm doing, it's just that there is sort of ... "four gems in one"
[18:00:25] toretore: here's the guiding principle for requires: i should be able to require *any* file inside your lib and it should: 1) work 2) not drag in a bunch of unrelated stuff
[18:00:44] shevy: nictrasavios well you can have a look at some other gems if you want to, how they solve it
[18:00:50] shevy: let me grab some examples from other people
[18:01:12] nictrasavios: Thank you! I've been looking at slack-ruby-bot and slack-ruby-server
[18:01:14] toretore: 1 doesn't work if you put all your requires at the top level and 2 doesn't if you centralize your requires
[18:01:14] shevy: wget https://rubygems.org/downloads/rack-1.6.4.gem
[18:01:25] shevy: gem unpack rack-1.6.4.gem
[18:01:44] shevy: ok in lib/ you have rack.rb and rack/ directory
[18:01:52] mistermocha: has joined #ruby
[18:01:54] lele: has joined #ruby
[18:01:55] shevy: which is the common way for gems to be setup... name_of_gem.rb and name_of_gem/
[18:02:07] toretore: actually i ran into this very problem not many days ago with rack
[18:02:13] nictrasavios: That's exactly what I have, I have have it quadrupled for encapsilation
[18:02:16] toretore: i couldn't just require 'rack/builder'
[18:02:19] shevy: now the rack.rb does it a bit differently than many other gems; it uses a lot of autoload statements
[18:02:25] toretore: i had to require the whole thing
[18:02:32] shevy: autoload :Builder, "rack/builder"
[18:02:47] shevy: curiously enough no require statement but it is probably not needed. let's have a look at another gem
[18:03:12] shevy: wget https://rubygems.org/downloads/pry-0.10.3.gem # extract it like before
[18:03:18] timanema: has joined #ruby
[18:03:34] xaxisx: has joined #ruby
[18:03:39] shevy: ok pry does not use autoload, at the least not on the base pry.rb file; it has several require statements such as
[18:03:43] shevy: require 'pry/input_lock'; require 'pry/exceptions' etc...
[18:03:53] mistermo_: has joined #ruby
[18:03:58] nictrasavios: Yup, exactly the way you guys said to.
[18:04:02] shevy: this one I think is more common to see, it corresponds to e. g. pry/ subdirectory, and inside that directory, input_lock.rb and so on
[18:04:47] nictrasavios: So, even though I have 4 /lib/name.rb and four /lib/name/*.rb, I should still always do it explicitly, right?
[18:04:49] shevy: I'd start with the same way, it is more boring... if you really need dynamic requires, once you know the full path, you can always do Dir[] and get an array with your .rb files back, which you can require Dir[PATH].each etc...
[18:05:39] nictrasavios: My only holdoff on dyanmic requires is something that I don't even know if its possible.
[18:06:16] SilverKey: has joined #ruby
[18:06:28] aegis3121: has joined #ruby
[18:06:37] nictrasavios: This program has parts that need near 100% uptime, I kinda of wanted to ability to throw *.rb files into one of the /lib/name/ directories have it load them durring runtime
[18:06:41] BobTheBlob: Has anyone written a differential equation solver?
[18:06:51] shevy: nictrasavios btw so far I never heard the name of your gem :D
[18:06:51] harfangk: has joined #ruby
[18:06:51] nictrasavios: But, I think that dream is 1) stupid, and 2) not worth it.
[18:07:19] nictrasavios: It's actually not a gem, its a SlackBot that I'm writing to manage marketing and PR within my company
[18:07:45] toretore: nictrasavios: you are right about both 1 and 2 ;)
[18:07:51] mistermocha: has joined #ruby
[18:07:53] neo_: has joined #ruby
[18:08:07] toretore: nictrasavios: your deployment strategy should use external tools for these purposes
[18:09:15] nictrasavios: We've been using external tools, but due to some ... thing's that I'm probably under NDA abut ... we can't continue to use 3rd party tools like zapier
[18:09:26] djbkd: has joined #ruby
[18:09:47] mistermo_: has joined #ruby
[18:09:57] toretore: you just need something like systemd or supervisord
[18:10:25] aryaching: has joined #ruby
[18:10:43] toretore: and probably a load balancer between the apps and the world
[18:11:07] toretore: but it's also likely that you don't actually need any of this and that doing a git pull and restart is fine
[18:11:55] mistermo_: has joined #ruby
[18:12:09] nictrasavios: All it is is posting anything sent to our twitter/facebook feeds to a slack channel, posting any new "appointments" with "service people" to a channel, and having PR give a "yes or no" on purposed posts. We were using Zapier to do it, but as we got bigger... well, why pay 250$/month/location for zapier when you can force the development team to make something that can run on a 7$/month heroku server right?
[18:12:11] smathy: has joined #ruby
[18:12:42] daivyk: has joined #ruby
[18:12:43] nictrasavios: There are also a few problems that can't be solved using external tools, but I can't talk about them ;P.
[18:13:17] macsteps: has joined #ruby
[18:13:53] nictrasavios: Unfortunately, the development team consists f myself, a C++ developer, and another dude who I will only describe as a "spoon with a brain".
[18:14:17] shevy: a spoon is very useful!
[18:14:28] sp4rrow: has joined #ruby
[18:14:30] nictrasavios: He does help keep me sane!
[18:14:36] toretore: at least he has a brain
[18:15:00] roamingdog: has joined #ruby
[18:15:05] rbr: has joined #ruby
[18:15:09] nictrasavios: Good point, previously the development team consisted of myself and a plush dragon. I wish I was kidding about that, but the dragon has an instagram.
[18:15:29] pLaToOn: has joined #ruby
[18:15:39] nictrasavios: https://www.instagram.com/snugglythedragon/
[18:15:54] nictrasavios: ^ The old head of PR owns him. She was a Psyc student.
[18:17:51] nictrasavios: I love my job.... XD. Thanks for the help!
[18:19:15] mistermocha: has joined #ruby
[18:19:21] aryaching: has joined #ruby
[18:19:25] jhack: has joined #ruby
[18:20:09] shevy: a plush dragon
[18:20:20] smathy: "a spoon with a brain" - heh :)
[18:20:20] shevy: now if I ever saw a hipster company
[18:20:28] neo_: has joined #ruby
[18:21:39] haxrbyte: has joined #ruby
[18:21:43] mistermocha: has joined #ruby
[18:21:56] e4xit: has left #ruby: ()
[18:22:23] aeruder: has left #ruby: ("WeeChat 1.0.1")
[18:22:36] djbkd: has joined #ruby
[18:25:48] jhack: has joined #ruby
[18:26:34] arlek: has joined #ruby
[18:26:42] ur5us: has joined #ruby
[18:27:34] mistermocha: has joined #ruby
[18:27:44] snebel: has joined #ruby
[18:29:09] snebel: I'm actually having a lot of problems trying to install rvm using chef and in the same run install multiple ruby versions then bundle install some repositories..
[18:29:16] SilverKey: has joined #ruby
[18:29:36] mistermo_: has joined #ruby
[18:29:37] nictrasavios: Does anyone know what's going on with the VCR gem? It seems to be outdated and failing
[18:29:40] snebel: not looking for very specific answer here but more what;s your preffered way on achieving that
[18:29:56] toretore: snebel: what's your goal?
[18:30:08] snebel: install multiple ruby scripts that needs different versions and gemsets
[18:30:17] snebel: using chef
[18:30:31] snebel: in a centos 7.1 server
[18:30:34] cdg: has joined #ruby
[18:30:46] snebel: i'm trying with rvm
[18:30:59] snebel: but chef tens to install all the stuff on system ruby
[18:31:08] snebel: looks like rvm is very tide to the session
[18:31:23] snebel: and because chef runs all in the same don't load properly all the profile stuff it needs
[18:31:32] toretore: have you though about running containers instead?
[18:31:34] snebel: specially bash functions
[18:31:55] snebel: I'd really like to but my ionfrastructure is still running vm's
[18:32:02] snebel: and using chef
[18:32:31] snebel: centos just provides ruby 2.0.0
[18:32:45] snebel: i need at least 2.1.0 for a chef gem dependency
[18:32:56] adam12: snebel: After installing RVM, can you manually source the profile changes? or perhaps re-exec current shell?
[18:32:57] snebel: other scripts runs on 2.2.0
[18:33:03] adam12: snebel: I'm not familiar with Chef so just throwing out ideas.
[18:33:11] snebel: yes, it's a good path thanks
[18:33:22] snebel: yes i'm trying but strlugging all the time with it
[18:33:31] snebel: then trying to install bundler
[18:33:44] snebel: i'm really missing to being able to static compile those ruby scripts...
[18:33:47] joneshf-laptop: has joined #ruby
[18:33:58] snebel: but i need to deal with dependencies and interpreter versions..
[18:34:03] adam12: What about Travelling Ruby?
[18:34:07] jidar: chef should provide you a way of (either nativly or via some cookbooks) to execute those gem installs under a rvm
[18:34:08] snebel: Travelling Ruby?
[18:34:21] snebel: didn't find anything for chef to do so
[18:34:29] snebel: there is a rvm cookbook but failing all the time
[18:34:30] adam12: snebel: http://phusion.github.io/traveling-ruby/
[18:34:30] jidar: you're likely not looking in the right place then
[18:34:35] snebel: just system wide install works
[18:34:44] snebel: but mess with chef stuff that requires 1.9.3
[18:34:49] snebel: it's a nightmare
[18:35:01] snebel: let's look this travelling stuff
[18:35:12] adam12: This doesn't solve your problem, but this is why I ended up choosing Ansible
[18:35:20] snebel: mm looks promissing let's read more..
[18:35:21] adam12: .. which has it's own problems, but very small dependency stack on nodes.
[18:35:49] snebel: yeah, i'm also thinking a lot that for those scripts would have been nice to use golang
[18:35:50] zacstewart: has joined #ruby
[18:36:04] snebel: but the thing is i'm tide right now to those technologies
[18:36:13] snebel: i love ruby but some times dealing with dependencies...
[18:36:19] snebel: containers would be a super solution
[18:36:26] roamingdog: has joined #ruby
[18:36:29] dionysus69: has joined #ruby
[18:36:30] snebel: but i have to make it work with vm's
[18:36:40] snebel: and chef...
[18:36:56] toretore: what do vms have to do with it?
[18:37:13] mistermocha: has joined #ruby
[18:37:18] snebel: well that i still don't have a propoer containers infra
[18:37:25] snebel: available
[18:37:28] snebel: we're doing some POC
[18:37:40] xall: has joined #ruby
[18:37:40] snebel: but still not fully integrated in my organization
[18:37:44] toretore: you don't need a container "infrastructure" to run a few containers
[18:38:03] snebel: yeah but looks like overkill start doing some docker to solve this problem..
[18:38:29] toretore: i bet it would be much easier to just create some images than dealing with all the chef rvm stuff
[18:38:29] snebel: not sure, may be if i start being more desperate
[18:38:38] snebel: yea make senses...
[18:38:58] snebel: just wondering how long would this take to me.. start feeling pressure for delivery
[18:39:00] chip_: has joined #ruby
[18:39:12] snebel: dont currently have experience with docker/containers
[18:39:22] snebel: so i'd need to spend some time learniing
[18:39:33] snebel: but yes i'm feeling binary images would be the solution..
[18:39:48] snebel: just looking the fastest make it working solution..
[18:40:04] toretore: if you were familiar with docker i'd say go for it for sure, but as you say it's something you have to learn
[18:40:11] craigp_: has joined #ruby
[18:40:20] snebel: yeah thats the thing...
[18:40:32] snebel: i have some docker expert at the company
[18:40:37] snebel: may be ill ask him..
[18:40:46] snebel: in parallel i'll also look to this travelling
[18:40:53] snebel: anybody used it for production stuff?
[18:41:04] snebel: any feedback?
[18:41:17] adam12: I've explored it, but ended up writing what I needed in Crystal because it was small enough.
[18:41:28] adam12: Tho because it's from the Passenger peeps I'm sure it's solid.
[18:41:47] snebel: mmm so le't see if i can do something relatively fast
[18:41:58] snebel: in parallel containers trial...
[18:42:17] snebel: thanls guys i got some fresh/new attack vectors for my problem
[18:42:24] arooni: has joined #ruby
[18:43:07] mistermocha: has joined #ruby
[18:43:43] jaguarmagenta: has joined #ruby
[18:46:39] ule: Do you guys know why this returns "uby on" instead of "Ruby on" ? ----> puts "Ruby on Rails".delete("Rails")
[18:48:22] jhass: ule: yes I know why
[18:49:00] spk: has joined #ruby
[18:49:21] ule: irb(main):003:0> puts "Please tell me why".delete("Rails")
[18:49:24] ule: Pee te me why
[18:49:30] jhass: http://devdocs.io/ruby~2.3/string#method-i-delete
[18:50:44] mistermocha: has joined #ruby
[18:51:13] whiteline: has joined #ruby
[18:51:49] ule: this question is on ruby certification study guide
[18:52:09] roamingdog: has joined #ruby
[18:52:44] craigp_: has joined #ruby
[18:53:15] Xeago_: has joined #ruby
[18:53:25] memorasus: has joined #ruby
[18:54:00] e4xit: has joined #ruby
[18:54:00] kirun: has joined #ruby
[18:55:07] mistermo_: has joined #ruby
[18:55:57] tAn: has joined #ruby
[18:56:34] pLaToOn: has joined #ruby
[18:56:57] choke: has joined #ruby
[18:57:14] dvinciguerra_: has joined #ruby
[18:57:38] SilverKey: has joined #ruby
[18:57:39] Xeago_: has joined #ruby
[18:58:32] ramfjord: has joined #ruby
[18:58:49] ule: looks a mix of regex
[18:58:55] ule: I can't figure out 100% yet
[18:59:53] apeiros: jhass: devdocs > rdoc.info/ruby-doc in your opinion?
[19:00:16] neo_: has joined #ruby
[19:00:23] jhass: for the stuff it has, yes
[19:00:54] mistermocha: has joined #ruby
[19:01:01] jhass: it can't fully replace rdoc.info because I rely on its /gems/foo or /github/user/foo stuff
[19:01:30] jhass: but if you work fullstack a unified search over ruby including stdlib, rails, js, css & html is quite handy
[19:01:58] nankyokusei: has joined #ruby
[19:02:20] mdw: has joined #ruby
[19:02:20] smathy: ule, it removes all occurrences of any letter in the set you provide it. It's like the character class of a regex.
[19:02:42] jhass: well similar, the rules are not exactly the same I think
[19:03:02] mistermo_: has joined #ruby
[19:03:10] smathy: "Like" means "similar" :)
[19:03:31] jhass: yes, just wanted to make it a bit more clear :)
[19:03:43] smathy: ...but actually...
[19:03:56] smathy: >> "ruby on rails".delete "a-r"
[19:04:00] ruby[bot]: smathy: # => "uy s" (https://eval.in/595131)
[19:04:41] mistermo_: has joined #ruby
[19:04:57] apeiros: >> "ruby on rails".delete "^a-r"
[19:05:08] ruby[bot]: apeiros: # => "rbonrail" (https://eval.in/595133)
[19:05:11] apeiros: is it eval-in or ruboto which is slow?
[19:05:32] jhass: probably both :P
[19:06:10] jhass: can't tell because of the log issue I mentioned
[19:06:18] jhass: opened I mean
[19:06:47] mistermocha: has joined #ruby
[19:08:35] isberg: has joined #ruby
[19:09:38] tao_: has joined #ruby
[19:09:39] sp4rrow: has joined #ruby
[19:10:44] mistermo_: has joined #ruby
[19:11:27] Spami: has joined #ruby
[19:11:31] solars: has joined #ruby
[19:12:27] dionysus70: has joined #ruby
[19:14:37] mistermocha: has joined #ruby
[19:14:46] roamingdog: has joined #ruby
[19:17:09] snath: has joined #ruby
[19:17:22] sneakers: has joined #ruby
[19:17:32] MrBusiness3: has joined #ruby
[19:21:08] nofxx: has joined #ruby
[19:21:08] nofxx: has joined #ruby
[19:21:39] mistermocha: has joined #ruby
[19:23:20] elementaru: has joined #ruby
[19:23:43] mistermo_: has joined #ruby
[19:24:08] sumobob: has joined #ruby
[19:25:30] mistermo_: has joined #ruby
[19:27:53] Spami: has joined #ruby
[19:28:37] Hanmac: ACTION gains a new hobby in selling apricot seeds at vegans ;P
[19:29:07] choke: has joined #ruby
[19:29:30] jhass: ?ot hanmac
[19:29:30] ruby[bot]: hanmac: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[19:33:20] nankyokusei: has joined #ruby
[19:33:25] jhack: has joined #ruby
[19:36:02] mistermocha: has joined #ruby
[19:37:00] nictrasavios: Where can I find ruby class/module/variable/method/file naming conventions?
[19:37:24] skweek: has joined #ruby
[19:37:46] lxsameer: has joined #ruby
[19:38:26] karapetyan: has joined #ruby
[19:38:55] shevy: nictrasavios you could look at the style guide from rubocop
[19:39:18] shevy: but it is really simple... module Foo; SOME_CONSTANT = 42 ...
[19:39:24] shevy: foo_bar.rb -> class FooBar
[19:39:26] shevy: foobar.rb -> class Foobar
[19:39:47] jhass: ?styleguides
[19:39:47] ruby[bot]: here are three popular styleguides, you should read and follow at least one: https://github.com/styleguide/ruby https://github.com/bbatsov/ruby-style-guide https://github.com/thoughtbot/guides/tree/master/style/ruby
[19:40:55] skade: has joined #ruby
[19:42:26] aegis3121: has joined #ruby
[19:42:44] nictrasavios: I shall read all 3 :3.
[19:42:48] malconis: has joined #ruby
[19:43:13] mistermo_: has joined #ruby
[19:43:46] malconis: has joined #ruby
[19:43:50] shevy: use all 3!!!
[19:44:00] shevy: in particular when they contradict one another :)
[19:44:27] shevy: there may be a fourth
[19:44:46] shevy: https://github.com/chneukirchen/styleguide/blob/master/RUBY-STYLE but I think that is mostly integrated into the bbatsov one
[19:44:54] nictrasavios: Currently wrapping my head around if requires are inherited in ruby ;P
[19:45:11] mistermo_: has joined #ruby
[19:45:19] nictrasavios: So, after I figure that out, I'll see what I can do to fix up this... very ugly code.
[19:45:28] madgen: has joined #ruby
[19:45:56] FernandoBasso: How do I use this method? http://ruby-doc.org/core-2.3.1/String.html#method-c-new
[19:45:58] shevy: I always think of requires like a "just put the code there from that file, into this file here"
[19:46:26] FernandoBasso: my_str = String.new('ção', 'UTF-8') returns nil and assigns that value to my_str.
[19:46:47] nictrasavios: That's how they work in C++, but because there is no compiler directives in ruby, I'm worried XD.
[19:47:07] shevy: FernandoBasso that is not documented behaviour right?
[19:47:17] jhack: has joined #ruby
[19:47:18] nankyokusei: has joined #ruby
[19:47:21] shevy: "Returns a new string object containing a copy of str."
[19:47:44] shevy: new(str="", encoding: enc)
[19:47:52] shevy: my_str = String.new('ção', encoding: 'UTF-8')
[19:47:58] shevy: I think that should work
[19:48:03] ruby[bot]: baweaver: # => "ção" (https://eval.in/595180)
[19:48:08] tokynet: has joined #ruby
[19:48:11] FernandoBasso: See, I don't know how to read docs...
[19:48:30] baweaver: do you even need encoding for that?
[19:48:36] shevy: well you need sharp eyes in ruby, I also did not notice that there was no encoding: there at first from your example code
[19:49:56] tomchapin: has joined #ruby
[19:50:24] jhass: FernandoBasso: what problem do you hope to solve with using String.new? chances are big you don't need it. at all.
[19:50:52] FernandoBasso: jhass: I am just trying to read and docs and type in examples.
[19:51:17] davedev24: has joined #ruby
[19:51:43] shevy: FernandoBasso lol I'll store that quote!
[19:51:47] l4v2: has joined #ruby
[19:52:01] l4v2: Howdy howdie
[19:52:47] FernandoBasso: Shevy it was a response to the joke "why do ruby programmers wear glasses?"
[19:52:57] FernandoBasso: But the joke was on my mind only, not in #ruby.
[19:53:12] shevy: it's sorta true!
[19:54:00] FernandoBasso: >> str = String.new('ção', encoding: 'UTF-8')
[19:54:00] shevy: like take the hash syntax ... { :foo => :bar } ... versus { foo: bar } versus... foo: bar (if it is the last argument, one can omit the {})
[19:54:04] shevy: either sharp eyes or bigger fonts!
[19:54:05] chopin: has joined #ruby
[19:54:07] mistermocha: has joined #ruby
[19:54:10] ruby[bot]: FernandoBasso: # => "ção" (https://eval.in/595181)
[19:54:34] FernandoBasso: I prefer the last generally.
[19:54:54] shevy: people love to omit syntax
[19:55:05] mistermo_: has joined #ruby
[19:56:04] shevy: like the () in def method definitions
[19:56:22] FernandoBasso: Yeah, and I don't buy the argument "this language doesn't require ; at the and of the statments". That is the least of my problems when using a programming languages.
[19:56:38] ytti: that is weird thing to say
[19:56:41] ytti: you can't omit syntax
[19:56:47] ytti: i think by definition
[19:56:57] ytti: if it works, it's syntactically corrct
[19:56:59] mistermo_: has joined #ruby
[19:57:07] Affix: has joined #ruby
[19:57:42] shevy: I so often forgot the ; in php
[19:58:59] mistermo_: has joined #ruby
[19:59:08] FernandoBasso: ruby 2.2.3: str = String.new('ção', encoding: 'UTF-8')
[19:59:08] pontiki: has joined #ruby
[19:59:10] FernandoBasso: ArgumentError: wrong number of arguments (2 for 0..1)
[19:59:41] icarus: has joined #ruby
[19:59:49] roamingdog: has joined #ruby
[20:00:03] zeroDi: has joined #ruby
[20:00:29] shevy: works here fine on ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
[20:01:01] FernandoBasso: http://ruby-doc.org/core-2.2.3/String.html#method-c-new
[20:01:05] jhass: FernandoBasso: don't worry about String.new. You'll never need it
[20:01:15] FernandoBasso: jhass: I know :)
[20:01:37] jhass: move to the next one ;)
[20:01:47] FernandoBasso: It changed the api from 2.2 to 2.3
[20:02:05] jhack: has joined #ruby
[20:02:52] shevy: we are going towards ruby 3.POWER_ZERO
[20:05:13] yorickpeterse: Yeah somehow Ruby 3 is going to be 3x faster...somehow
[20:05:20] dc1: has joined #ruby
[20:05:20] sp4rrow: has joined #ruby
[20:05:40] timanema_: has joined #ruby
[20:05:48] shevy: we should skip 3 and jump to ruby 4 for FOUR times the speed
[20:06:00] baweaver: Hopefully they don't go the Angular 2 route and scrap everything
[20:06:30] SilverKey: has joined #ruby
[20:06:33] yorickpeterse: I can't wait for ng-ruby
[20:06:55] yorickpeterse: I guess Ruby being slow kinda matches Angular at least
[20:07:12] wrkrcoop: has joined #ruby
[20:07:19] AndroidLoverInSF: has joined #ruby
[20:07:33] yorickpeterse: At least Ruby isn't as over-engineered
[20:07:47] yorickpeterse: no dependency injection and all that bs
[20:08:01] toretore: it's a little under-engineered
[20:08:21] yorickpeterse: I think you meant "non-engineered" :P
[20:08:38] yorickpeterse: and yet here we are
[20:08:46] yorickpeterse: I guess it's the lesser evil, certainly compared to Python, JS, etc
[20:09:03] baweaver: JS over engineered?
[20:09:12] baweaver: the language itself, or the community?
[20:09:14] MrBusiness3: has joined #ruby
[20:09:20] macsteps: has joined #ruby
[20:09:36] baweaver: the latter I would agree with, the former: it was made in a week
[20:09:50] shevy: all good things are done in a week
[20:09:51] roamingdog: has joined #ruby
[20:09:55] shevy: like the creation of the universe!!!
[20:10:24] jhass: that then explains why humans take 9 months
[20:10:51] toretore: js certainly suffered from being under-engineered
[20:11:08] yorickpeterse: baweaver: No, the language is a weekend hack on crutches
[20:11:23] yorickpeterse: stuff like NPM is like Mc Donalds for JS/Node.js
[20:11:36] baweaver: NPM is nothing
[20:11:41] yorickpeterse: you get way too fat too easily
[20:11:51] yorickpeterse: npm install something
[20:11:54] shevy: god you have made me so hungry now
[20:11:54] yorickpeterse: 1203891209382 dependencies installed
[20:11:56] baweaver: you're forgetting bower, grunt, gulp, yeoman, transpilers, compilers, es6, ......
[20:12:22] yorickpeterse: https://www.youtube.com/watch?v=lKXe3HUG2l4 mandatory watching material, featuring Joe Armstrong ranting about Grunt
[20:12:40] shevy: better than grunting about Runt!
[20:12:44] baweaver: because micro modules are a thing
[20:12:45] macsteps: has joined #ruby
[20:13:05] symm-: has joined #ruby
[20:13:29] arnonhongklay: has joined #ruby
[20:13:29] apeiros: ACTION snickers
[20:14:29] baweaver: I gave a challenge to my Node sympathetic friends to explain left pad to a common person and why it's needed.
[20:14:37] yorickpeterse: https://rubygems.org/search?utf8=%E2%9C%93&query=left+pad
[20:14:59] yorickpeterse: I'm surprised there's not a C ext version and an FFI version
[20:15:15] yorickpeterse: and a JRuby version that uses like half of Maven
[20:15:18] yorickpeterse: enterprise-left-pad
[20:15:55] postmodern: has joined #ruby
[20:15:58] baweaver: PadFactoryMapperBeanAbstractSingletonCommander?
[20:16:30] _mak: has left #ruby: ("..")
[20:16:37] mistermocha: has joined #ruby
[20:17:27] rbr: has joined #ruby
[20:18:03] yorickpeterse: need an observer pattern in there
[20:18:06] yorickpeterse: and dependency injection
[20:18:48] shevy: I see what you did there
[20:18:50] shevy: you are brotherly merging javascript and java here
[20:19:16] baweaver: that was on the JRuby enterprise comment
[20:19:22] apeiros: aren't those the same?
[20:19:31] Hanmac: yorickpeterse: hm didnt we have a observer pattern in ruby-stdlib ?
[20:19:46] baweaver: I haven't observed it
[20:20:13] shevy: those dam observers
[20:20:33] Hanmac: yorickpeterse: http://ruby-doc.org/stdlib-2.3.1/libdoc/observer/rdoc/index.html
[20:20:49] yfeldblum: has joined #ruby
[20:21:33] JesseH: has joined #ruby
[20:24:28] CSWookie: has joined #ruby
[20:26:23] djbkd: has joined #ruby
[20:27:49] frem_: has joined #ruby
[20:29:12] SilverKey: has joined #ruby
[20:30:09] agentmeerkat: has joined #ruby
[20:30:35] graft: has joined #ruby
[20:30:57] last_staff: has joined #ruby
[20:31:31] sp4rrow: has joined #ruby
[20:34:49] Xiti: has joined #ruby
[20:37:42] AndroidLoverInSF: has joined #ruby
[20:38:19] mistermocha: has joined #ruby
[20:40:26] djbkd: has joined #ruby
[20:44:19] roamingdog: has joined #ruby
[20:44:29] jaguarmagenta: has joined #ruby
[20:45:01] mistermocha: has joined #ruby
[20:46:06] tAn: has joined #ruby
[20:46:28] MrBusiness3: has joined #ruby
[20:47:21] rbennacer: has joined #ruby
[20:49:15] mistermo_: has joined #ruby
[20:50:04] roamingdog: has joined #ruby
[20:52:22] zxd: has joined #ruby
[20:54:03] centrx: has joined #ruby
[20:56:56] mistermocha: has joined #ruby
[20:58:33] macsteps: has joined #ruby
[20:58:55] mistermo_: has joined #ruby
[21:00:05] MrBusiness3: has joined #ruby
[21:01:02] mistermo_: has joined #ruby
[21:02:50] mistermocha: has joined #ruby
[21:02:53] blackgoat: has joined #ruby
[21:03:43] aryaching: has joined #ruby
[21:04:49] mistermo_: has joined #ruby
[21:05:11] jhack: any good resources on ML in ruby?
[21:06:51] chopin: has joined #ruby
[21:07:28] moeabdol: has joined #ruby
[21:07:39] SilverKey: has joined #ruby
[21:07:48] pilne: >.< the first hit for constraint programming in ruby "Gecoder" is hosted on rubyforge... which is down >.<
[21:08:54] pilne: ah-ha! there is minikanren!
[21:08:58] pilne: ACTION does a happydance
[21:10:59] allcentury: has joined #ruby
[21:12:44] mistermocha: has joined #ruby
[21:14:04] l4v2: Hey, I am doing this querying tutorial to learn from and this is giving me an error message. Anyone know? https://gist.github.com/anonymous/8291072fbd819f2eaf134187701a8ef1
[21:14:31] aegis3121: what is the error?
[21:14:41] jetpack_joe: has joined #ruby
[21:15:03] sp4rrow: has joined #ruby
[21:15:03] l4v2: has joined #ruby
[21:17:15] tAn: has joined #ruby
[21:18:23] choke: has joined #ruby
[21:18:36] apeiros: l4v2: 23:14 aegis3121: what is the error?
[21:18:48] apeiros: (not leaving after asking a question helps too btw. :-p)
[21:19:18] l4v2: NameError: undefined local variable or method `color' for #<ActiveRecordTest:0x007feb732d9018>
[21:19:26] l4v2: My computer shut off….?
[21:19:41] aegis3121: https://gist.github.com/anonymous/8291072fbd819f2eaf134187701a8ef1#file-gistfile1-txt-L9
[21:19:45] aegis3121: `color` isn't defined anywhere
[21:20:42] l4v2: I believe it is in a method before the class in this file.
[21:21:24] l4v2: I’ll make a new paste bin with it
[21:21:41] smathy: It's obviously out of scope.
[21:22:06] smathy: (sorry, let me s/obviously// - I'm trying to get out of that habit)
[21:22:06] snath: has joined #ruby
[21:22:27] centrx: smathy obviously knows what he's talking about
[21:22:45] shevy: that is indeed quite obvious
[21:22:50] n_blownapart: has joined #ruby
[21:23:22] smathy: Obvious to people with years of experience, understanding of objects, classes, context, scope, etc. :)
[21:23:29] replay: has joined #ruby
[21:24:37] l4v2: THis is before the Class https://gist.github.com/anonymous/bec5f44193c94e2e2ba599a342d3bc70
[21:25:49] smathy: l4v2, that doesn't define a color method, and actually the only `color` in there is a hash key in the `options` hash.
[21:26:11] toretore: l4v2: gist entire files, not just parts you think are relevant
[21:26:26] mistermocha: has joined #ruby
[21:26:30] toretore: the more code you share, the easier it is to give advice
[21:26:48] northfurr: has joined #ruby
[21:26:55] toretore: less frustration, less time spent, faster resolution
[21:27:24] `tim`: has joined #ruby
[21:28:05] toretore: and if you're following some sort of tutorial, link to it
[21:28:06] chopin: has joined #ruby
[21:28:24] mistermo_: has joined #ruby
[21:29:23] Es0teric: has joined #ruby
[21:30:34] mistermo_: has joined #ruby
[21:31:23] millerti: has joined #ruby
[21:31:32] whathappens: has joined #ruby
[21:31:58] l4v2: Vim is being really annoying at the moment, but they are all just seperate tests form one another
[21:32:47] pawnbox: has joined #ruby
[21:33:27] toretore: gist should really let you upload files in the ui
[21:33:37] toretore: i'm surprised it doesn't
[21:34:09] yfeldblum: has joined #ruby
[21:34:15] toretore: ah, you can drag & drop files
[21:34:30] mdw: has joined #ruby
[21:36:00] duncannz: has joined #ruby
[21:36:28] srgupta_: has joined #ruby
[21:38:07] l4v2: idk, it’s not letting me
[21:38:27] GodFather: has joined #ruby
[21:39:41] n_blownapart: has left #ruby: ()
[21:40:39] l4v2: Ok, here it is, the first line is indented and it shouldn’t be https://gist.github.com/anonymous/c99c0f1a012b55b34cb62989b012f9e0
[21:43:06] chipotle: has joined #ruby
[21:43:40] l4v2: Well there is other formating errors as well, but that’s the content in the file
[21:44:03] mistermocha: has joined #ruby
[21:45:24] tao_: has joined #ruby
[21:45:43] toretore: l4v2: ok, so `color` isn't defined at the point you're using it
[21:46:49] toretore: and `Car.find(color)` probably won't make sense either
[21:47:08] smathy: The only place `color` is defined is in the `test_having` method.
[21:47:29] l4v2: Yeah, they are giving me everything I need already in all of the other tests
[21:48:07] mistermo_: has joined #ruby
[21:48:11] nankyokusei: has joined #ruby
[21:48:31] l4v2: they get defined with the create method?
[21:48:37] smathy: ...not that it would matter because `find` only accepts IDs, *and* you're not creating your Cars with any colors, so a finder using colors is never going to find any anyway.
[21:49:40] smathy: l4v2, whether the color of a car is set during create or not, the identifier `color` is not being initialized. This is not about data in your DB, it's about the ruby identifier denoted by the name `color`
[21:49:42] `tim`: has joined #ruby
[21:49:59] mistermocha: has joined #ruby
[21:50:37] smathy: l4v2, can I suggest that you work through a programming tutorial first, specifically Learn to Program: https://pine.fm/LearnToProgram/
[21:51:35] chipotle: has joined #ruby
[21:52:02] mistermocha: has joined #ruby
[21:52:15] dminuoso: has joined #ruby
[21:52:19] l4v2: I already read a Rails book, and most of the well grounded rubyist. I have just yet to do querying.
[21:53:14] l4v2: The Active Record is so weird to me
[21:53:49] smathy: l4v2, I'm making this recommendation based on your understanding of this error, of the `color` identifier, and how you're responding to the help people are trying to give you. It's a fundamental concept in programming that you don't seem to have covered yet.
[21:53:58] smathy: l4v2, the issue you're having with `color` has nothing at all to do with ActiveRecord.
[21:54:05] mistermocha: has joined #ruby
[21:55:31] l4v2: Do you know how to solve this, it’s jsut for fun
[21:55:50] baweaver: color is undefined
[21:55:56] mistermocha: has joined #ruby
[21:56:02] baweaver: find is not an instance method
[21:56:15] baweaver: it's a class method, so it has no concept of what color is
[21:56:26] last_staff: has joined #ruby
[21:56:39] baweaver: that, and find takes the primary key of the table which is probably not color.
[21:56:55] baweaver: Car.find_by(color: 'white')
[21:57:11] baweaver: but seriously, read some tutorials all the way through
[21:57:15] filipechagas: has joined #ruby
[21:57:52] mistermo_: has joined #ruby
[21:58:14] smathy: l4v2, yes I know how to solve it, but if you don't understand the sentence: "`color` is undefined" then I can't communicate how to solve it to you.
[21:58:47] l4v2: Holy cow dude you ar not that smart becuasae I already know that, so what do you actually suggest genius?
[21:59:24] l4v2: Dealing with people like this always in this field, like I don’t understand that. It’s the closest I can get to the answer
[21:59:37] l4v2: do I use the find method?
[21:59:49] l4v2: Do I even need it?
[21:59:50] aegis3121: That's...actually been answered a couple of times.
[21:59:52] mistermo_: has joined #ruby
[22:00:01] aegis3121: <baweaver> Car.find_by(color: 'white')
[22:00:16] aegis3121: <smathy> ...not that it would matter because `find` only accepts IDs, *and* you're not creating your Cars with any colors, so a finder using colors is never going to find any anyway.
[22:00:35] baweaver: these have all been answered
[22:00:50] baweaver: (mainly due to me not reading the entire backlog admittedly)
[22:01:22] l4v2: I just started Active Record stuff yesterday, I know you guys have more time than that, that’s why I came here.
[22:02:00] baweaver: that, and likely you want to be in the #RubyOnRails channel
[22:02:18] baweaver: l4v2: you have the answers already
[22:02:31] diegoaguilar: has joined #ruby
[22:02:50] baweaver: read back on the chat log and try them out.
[22:03:04] l4v2: Yeah, I have to define color, I tried that, so maybe it is a syntax error, like I said, this is just for learning for the sake of learning.
[22:03:12] roamingdog: has joined #ruby
[22:03:46] l4v2: So how do I define it, becuase when I tried to do it with cheetah as the color it dind’t work. So is it just solor?
[22:03:56] mistermocha: has joined #ruby
[22:04:18] jhass: "didn't work" is not anywhere near an adequate problem description
[22:04:27] ekinmur: has joined #ruby
[22:05:00] malconis: has joined #ruby
[22:05:19] baweaver: jhass: https://gist.github.com/anonymous/c99c0f1a012b55b34cb62989b012f9e0#file-gistfile1-txt-L83
[22:05:33] jhass: yeah I found that
[22:05:37] l4v2: This is why I hate programing, I get no joy out of solving things, just want the answer so I can use it going forward.
[22:05:42] baweaver: color isn't defined, they're using find instead of find_by, and the create method is using random params
[22:05:55] mistermocha: has joined #ruby
[22:06:00] baweaver: l4v2: You have gotten the answer multiple times in multiple different ways
[22:06:13] l4v2: write the syntax
[22:06:25] mdw: has joined #ruby
[22:06:31] toretore: l4v2: if you don't actually like programming, maybe find a job that doesn't require it
[22:06:31] baweaver: If you cannot read, we cannot help
[22:06:46] baweaver: toretore: pushing it.
[22:07:01] toretore: pushing what?
[22:07:34] baweaver: little bit out of line, assumes too much.
[22:07:46] mistermo_: has joined #ruby
[22:07:50] baweaver: it was stated that they're learning to learn earlier.
[22:08:12] toretore: <l4v2> This is why I hate programing, I get no joy out of solving things, just want the answer so I can use it going forward.
[22:08:22] l4v2: bweaver, I did not see your reply, because I was on the other screen, thank you though
[22:08:22] toretore: this is pretty clear to me
[22:08:57] toretore: i made the assumption that it was for a job, which i don't know
[22:09:02] l4v2: It’s jsut so predictable that no one ever jsut answers a question in this field, it’s like a game of clue.
[22:09:16] l4v2: no, I already said, fun tutorial
[22:09:17] toretore: but i could substitute job for university and i'd still mean it
[22:09:20] jhass: l4v2: your question has been answered multiple times
[22:09:21] shevy: new people start by learning activerecords??
[22:09:30] sypheren: has joined #ruby
[22:09:42] mistermocha: has joined #ruby
[22:09:52] jhass: l4v2: if you don't understand the answers given, ask about clarification of specific parts of the given answer instead of repeating your initial question.
[22:09:55] l4v2: New to Active Records, adn I focused more on the Rails part of it too
[22:10:18] sypheren: Hello, what IDE's do you guys tend to use?
[22:10:33] jhass: Sypheren: $EDITOR and $SHELL
[22:10:38] sypheren: I use Intellij for Java but it doesn't seem to be cutting it for ruby
[22:10:53] baweaver: Sypheren: Most popular are: Vim, Sublime, Emacs, Rubymine (also Jetbeans), and Atom
[22:11:15] sypheren: I see, thank you!
[22:11:18] baweaver: Only Rubymine is an IDE though.
[22:11:19] l4v2: I could just say this, what is the exact line of code that solves this test, so that I can use it going forward, the whole line.
[22:11:37] baweaver: and then we could say we gave you it already
[22:11:47] l4v2: But then I have to do the whole song and dance about here’s a clue anyway. Only in this field
[22:11:53] mistermo_: has joined #ruby
[22:12:07] baweaver: the point is to get you to learn for yourself
[22:12:16] sypheren: baweaver, why is there such a small number of IDE's for ruby?
[22:12:27] baweaver: Sypheren Most people don't need one.
[22:12:27] sypheren: Is it just not needed, like it is in Java?
[22:12:28] jhass: l4v2: https://ruby-community.com/pages/user_rules#rule_1_3
[22:12:32] l4v2: I can learn more basic stuff in less time once I get basic concepts down
[22:12:52] sypheren: My coding background is pretty much 99% java 1% python, so I'm used to relying on heavy IDE's
[22:13:03] baweaver: Sypheren: In Java you need an IDE just to cope with the complexity and AbstractFactoryProxySingletonFactoryBeans
[22:13:28] sypheren: Java was a pretty good way for me to learn coding though
[22:13:36] l4v2: There’s a rule for everything in this world
[22:13:39] mistermo_: has joined #ruby
[22:13:42] baweaver: If you like Ruby but want to still run on the JVM look into JRuby and Scala
[22:13:56] sypheren: I actually didn't start using an IDE for it until I was forced to use libraries to work faster
[22:14:07] sypheren: I credit that to why I learned it well
[22:14:27] jhass: l4v2: we're here to help you with your problem if clearly stated as by the channel rules. We're not here to listen to your views about the world or the computer science or programming fields. Please stop that.
[22:15:04] baweaver: Sypheren: I avoid using an IDE for much the same reason. It forces me to read and learn the language instead of having things autocomplete for me.
[22:15:09] l4v2: I learn better when I see the answer after spedning time on it myself, then I can just say what does that mean. If I had the answer I wouldn’t be here asking.
[22:15:09] sypheren: Sorry, jhack
[22:15:15] sypheren: Er... jhass
[22:15:18] baweaver: Sypheren: He wasn't referring to you
[22:15:27] sypheren: However, I was also doing the same thing
[22:15:45] l4v2: I usually give people the answer and then let them ask questions.
[22:15:45] mistermocha: has joined #ruby
[22:15:57] sypheren: baweaver, but it's great once you learn it and your goal becomes to work fast!
[22:15:58] jhass: l4v2: well we don't, see the channel rule I linked
[22:16:12] l4v2: I don’t do the whole bread crumb trail
[22:16:19] baweaver: Sypheren: that's fair
[22:16:47] l4v2: And I still don’t see how you guys would solve it exactly? I got the test to pass, but it’s probably not the best way to do it, which is why I asked
[22:16:50] sypheren: Once you get the syntax and conventions down, you usually start to focus on the bigger picture and worry about how your code will be read by other people
[22:16:55] jhass: l4v2: #new2ruby might have a mindest closer to yours, perhaps it's a better avenue for you
[22:17:12] baweaver: Sypheren: I just built up a lot of shortcuts, macros, and snippets in vim. Used to be a SysAdmin so Vim was where I lived for the longest time.
[22:17:18] sypheren: I've heard testing was also pretty big in Ruby and Rails
[22:17:36] jhass: l4v2: we can't judge whether you solved it correctly without seeing what you did
[22:17:40] l4v2: I’m just asking someone in the community, maybe not even you to write it how you would do it, so I can compare it to what I did.
[22:17:44] mistermo_: has joined #ruby
[22:17:52] jhass: that's the wrong way around
[22:18:03] sypheren: I've wanted to set up macros, but I've never sat down and tried to do it well
[22:18:04] jhass: show what you accomplished and we can suggest how you can improve it
[22:18:04] pontiki: too much work
[22:18:09] baweaver: Sypheren: It is. Look into Rails 4 in Action. Radar and sevenseacat wrote it.
[22:18:34] sypheren: I hang out on #rubyonrails all the time, it's very well written!
[22:18:39] l4v2: I already did, passed with an error, so I wanted to get rid of the error, the test doesn’t fail
[22:18:40] baweaver: https://www.manning.com/books/rails-4-in-action
[22:18:55] baweaver: A good portion of us are on both channels
[22:19:12] sypheren: I tend to fear larger channels becasue I type a lot and don't stay on topic
[22:19:44] mistermo_: has joined #ruby
[22:19:48] baweaver: #ruby-offtopic is safe
[22:20:00] sypheren: This exists
[22:20:00] jhass: and we'll tell you to go there if it becomes a problem ;)
[22:20:01] baweaver: though there's a lot of hangman being played.
[22:21:31] mistermocha: has joined #ruby
[22:21:53] l4v2: has left #ruby: ()
[22:23:29] mistermocha: has joined #ruby
[22:23:46] slackbotgz: has joined #ruby
[22:23:48] GodFather: has joined #ruby
[22:24:59] sp4rrow: has joined #ruby
[22:25:26] mistermocha: has joined #ruby
[22:25:45] tomphp: has joined #ruby
[22:27:22] mistermo_: has joined #ruby
[22:28:30] `tim`: has joined #ruby
[22:30:49] mistermocha: has joined #ruby
[22:32:53] neo_: has joined #ruby
[22:34:29] Asher: has joined #ruby
[22:34:35] zenlot6: has joined #ruby
[22:34:39] moeabdol: has joined #ruby
[22:38:00] sypheren: has joined #ruby
[22:38:47] centrx: has joined #ruby
[22:40:06] cisco: has joined #ruby
[22:40:57] neo_: has joined #ruby
[22:41:22] xKillerFo: has joined #ruby
[22:42:15] the_drow: has joined #ruby
[22:42:23] solocshaw: has joined #ruby
[22:45:13] jaguarmagenta: has joined #ruby
[22:46:52] moeabdol: has joined #ruby
[22:48:24] l4v2: has joined #ruby
[22:48:57] l4v2: bweaver insults me for asking a question and then blocks me when I tell him he is being arrogant.
[22:49:12] l4v2: Whatever you have to do
[22:49:16] l4v2: pathetic
[22:49:26] jhass: l4v2: https://ruby-community.com/pages/user_rules#rule_3_2
[22:49:59] l4v2: Ok, wehre’s the rule that says don’t insult people when they ask a question
[22:50:05] ruby[bot]: +qqq $a:l4v2 l4v2!*@* *!*@cpe-24-59-157-0.twcny.res.rr.com
[22:50:10] jhass: not here, read the rules
[22:50:11] mistermocha: has joined #ruby
[22:51:47] sypheren: has joined #ruby
[22:52:21] symm-: has joined #ruby
[22:53:28] dminuoso: has joined #ruby
[22:55:34] Gasher: has joined #ruby
[22:55:43] snath: has joined #ruby
[22:58:27] KillerFox: has joined #ruby
[22:59:28] allcentury: has joined #ruby
[23:02:11] ruby-lang642: has joined #ruby
[23:02:54] l4v2: has left #ruby: ()
[23:05:16] roamingdog: has joined #ruby
[23:06:35] isberg: has joined #ruby
[23:07:32] bkxd: has joined #ruby
[23:07:41] solocshaw: has joined #ruby
[23:07:48] Gasher: has joined #ruby
[23:10:46] coyo: has joined #ruby
[23:11:40] ruby-lang642: what's the best way to ask for help on code when it involves multiple files?
[23:11:55] toretore: ?gist ruby-lang642
[23:11:55] ruby[bot]: ruby-lang642: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[23:14:35] ruby-lang642: So I'm stuck on trying to use inheritance and class variables. This is the code I'm working with: https://gist.github.com/drwl/650512e5bbdf0dba61e31e85a1c180fb
[23:15:24] solocshaw: has joined #ruby
[23:15:39] baweaver: If you mean @@var, they tend to behave badly on inheritance iirc
[23:15:42] ruby-lang642: If you run app.rb it returns 5 instead of 2, and I read it's because the class variable @@items is being used by the sub-classes. I read and found that you can use class instance variables, but I'm not quite sure how to implement it. Changing @@items to @items in item.rb (and subsequent files) causes an error
[23:15:48] jhass: ruby-lang642: you probably discovered why the usage of class variables is discouraged in ruby except for a very few very specific cases
[23:15:53] smathy: has joined #ruby
[23:16:06] shevy: odd way to use class variables
[23:16:21] shevy: https://gist.github.com/drwl/650512e5bbdf0dba61e31e85a1c180fb#file-customer-rb-L6
[23:16:24] ruby-lang642: jhass: yes I read that on several sites places on google and am trying to make the switch to class instance variables
[23:16:30] jhass: ruby-lang642: could you show the changed version of the code and the error it gives?
[23:16:36] ruby-lang642: sure, one moment
[23:16:42] solocshaw: has joined #ruby
[23:16:49] shevy: ruby-lang642 I'd use methods instead that should return the desired result, e. g. "Items.items?" as a method on class Items
[23:19:37] rbr: has joined #ruby
[23:19:43] mistermocha: has joined #ruby
[23:19:49] ruby-lang642: I updated the gist. https://gist.github.com/drwl/650512e5bbdf0dba61e31e85a1c180fb I basically changed the @@items in Item class to try and make it a class instance variable
[23:20:12] toretore: ruby-lang642: are you sure you actually want to "inherit" @@items ? if we disregard the issues with class vars for a moment and assume that it works the way you intend, all these classes will share the same "store"
[23:20:18] ruby-lang642: shevy: I'm not sure what you mean, could you elaborate?
[23:20:51] toretore: ruby-lang642: that is; Product.all and Customer.all will return the same
[23:21:07] ruby-lang642: toretore: I understand that's the bug now. I don't want to inherit the @@items but I do want the sub classes to inherit the reused behavior, if that makes sense.
[23:21:32] mistermo_: has joined #ruby
[23:21:46] jhass: ruby-lang642: so @items being an instance variable now means that each (sub)class has its own distinct version of it
[23:22:08] jhass: in other words line 4 of item.rb is not magically inherited by its subclasses
[23:22:15] ruby-lang642: yes, that is also my understanding of class instance variables and inheritance
[23:22:52] jhass: ruby-lang642: it's probably best to have a generic add_to_items method in class Item that lazily initializes @items on first access
[23:22:58] toretore: ruby-lang642: i suggest this: create an accessor Item.items that instantiates an instance variable: def Item.items; @items ||= []; end
[23:23:02] jhass: and get rid of the @@products and @@customers stuff
[23:23:18] jhass: toretore: they said they don't want a global store
[23:23:52] braincra-: has joined #ruby
[23:24:16] ruby-lang642: it might be because ruby has changed in 10 years but doesn't the @items get inherited & instantiated by subclass? That's what I read here http://www.railstips.org/blog/archives/2006/11/18/class-and-instance-variables-in-ruby/
[23:24:32] toretore: this will be inherited, but the "instance" variable will not, and thus be created for each class
[23:24:59] toretore: thus, Product.items and Customer.items are separate
[23:25:03] shevy: ruby-lang642 to rely on methods for when you want to query data
[23:25:13] baweaver: Honestly I'd just use SQL
[23:25:24] speakingcode: has joined #ruby
[23:25:36] neo_: has joined #ruby
[23:25:57] shevy: ruby-lang642 you actually already do that now so that is good https://gist.github.com/drwl/650512e5bbdf0dba61e31e85a1c180fb#file-item-rb-L6
[23:26:15] shevy: this part is still weird though https://gist.github.com/drwl/650512e5bbdf0dba61e31e85a1c180fb#file-customer-rb-L6
[23:27:16] ruby-lang642: my thought was to have a class variable that keeps track of Products, if there are suggestions please let me know and I'll make them
[23:27:26] ruby-lang642: I'm still reading through the suggestions and trying to understand what is being said
[23:27:36] neo_: has joined #ruby
[23:28:39] shevy: yeah get rid of all @@ as a first step
[23:28:47] shevy: use @foo and accessor methods to these
[23:28:53] solocshaw: has joined #ruby
[23:29:31] mistermocha: has joined #ruby
[23:29:45] ruby-lang642: shevy: can you explain what you mean by accessor methods for the @foo
[23:29:54] ruby-lang642: like I know what accessor methods are
[23:31:01] jhass: ruby-lang642: okay it might help a bit to clear up on what classes are in Ruby. They're instances of the class Class, so full blown objects themselves. And like all ruby objects they can have objects and instance variables that belong to just that one instance
[23:31:43] pawnbox: has joined #ruby
[23:31:57] jhass: ruby-lang642: when you do def self.foo you're defining a method, not different from def foo, it just lives somewhere else, in a class that's just for this single object, which is an instance of Class in this case but that's not really relevant
[23:33:29] jhass: so "class level instance variables" are really not all that different from the instance variables you probably already understand well, they just live in another (implicit) class
[23:35:12] ruby-lang642: oh okay that makes sense
[23:35:31] ruby-lang642: that's actually pretty interesting
[23:36:57] jhass: ok since that went well we might as well go a little bit deeper still
[23:37:17] ruby-lang642: i'm guessing the scopes between class variables and class level instance variables are different?
[23:37:26] jhass: >> class Foo; end; Foo.singleton_class.ancestors
[23:37:30] ruby[bot]: jhass: # => [#<Class:Foo>, #<Class:Object>, #<Class:BasicObject>, Class, Module, Object, Kernel, BasicObject] (https://eval.in/595324)
[23:37:48] jhass: ruby-lang642: yes, very
[23:38:26] jhass: so in the above example the first thing to note is the singleton_class method, that gives as implicit class Ruby creates for each and every object as needed
[23:38:51] jhass: it's the very same object than the first item of its .ancestors
[23:38:58] shevy: ruby-lang642 accessors are getter and setter methods; like: Items.product = 'black cat'; Items.product # "black cat"
[23:39:13] jhass: and it's also the place where your "class level instance variables" and "class methods" live
[23:39:34] jhass: they're instance variables and instance methods respectively of said singleton class
[23:40:37] jhass: the next thing we can observe there is that the singleton class there first inherits the singleton classes of the parent classes of its object's class (in this case Class)
[23:41:00] ur5us: has joined #ruby
[23:41:10] jhass: and then also the regular ancestor chain of its object's class
[23:41:25] jhass: this is why child classes inherit "class methods"
[23:42:00] jhass: but it's also why "class level instance variables" are not shared
[23:42:44] jhass: just to prove that claim:
[23:42:45] shevy: ruby-lang642 in theory you could also use things such as: class Items; def product?; @@product; end; end but unless you really need a @@ class variable, prefer the @ variants
[23:42:55] postmodern: has joined #ruby
[23:42:58] jhass: >> class Foo; end; class Bar < Foo; end; Bar.singleton_class.ancestors
[23:43:04] ruby[bot]: jhass: # => [#<Class:Bar>, #<Class:Foo>, #<Class:Object>, #<Class:BasicObject>, Class, Module, Object, Kernel, B ...check link for more (https://eval.in/595325)
[23:44:01] jhass: and to make clear that Class really is _not_ a special case here:
[23:44:07] jhass: >> "".singleton_class.ancestors
[23:44:17] ruby[bot]: jhass: # => [#<Class:#<String:0x40865bec>>, String, Comparable, Object, Kernel, BasicObject] (https://eval.in/595326)
[23:44:31] nadir: has joined #ruby
[23:45:18] mistermocha: has joined #ruby
[23:46:35] bkxd: has joined #ruby
[23:49:03] nankyokusei: has joined #ruby
[23:49:13] mistermo_: has joined #ruby
[23:49:49] ruby-lang642: okay so I'm rereading what you wrote. In irb/pry, I've executed Foo.ancestors, Foo.singleton_class.ancestors
[23:50:24] ruby[bot]: -qqq $a:l4v2 l4v2!*@* *!*@cpe-24-59-157-0.twcny.res.rr.com
[23:50:38] ruby-lang642: before I dive deeper into what you wrote, can you explain the differences of the output?
[23:50:57] ruby-lang642: => [Foo, Object, PP::ObjectMixin, Kernel, BasicObject] is different than => [#<Class:Foo>, #<Class:Object>, #<Class:BasicObject>, Class, Module, Object, PP::ObjectMixin, Kernel, BasicObject]
[23:51:16] jhass: yes, you call it on different Class instances
[23:52:08] jhass: Foo is an instance of the class Class, Foo = Class.new do end is semantically equivalent to class Foo end
[23:52:27] solocshaw: has joined #ruby
[23:52:46] jhass: so it's a regular object. All Ruby objects have a so called singleton class which you can fetch with .singleton_class
[23:53:10] jhass: the singleton class is itself just an instance of Class
[23:53:39] xlegoman: has joined #ruby
[23:54:14] dminuoso: has joined #ruby
[23:54:57] mistermocha: has joined #ruby
[23:55:02] jhass: so it has its own ancestor chain
[23:55:28] gse: hey, i'm trying to do something seemingly simple but ... not happening. I have an array of elements ['foo', 'bar'] and the end result should be "foo", "bar" ... I tried ['foo', 'bar'].map { |x| "\"#{x}\"" }.join(',') and that wasn't what I wanted.
[23:56:06] jhass: gse: I'm unclear on what your expected result is exactly, "foo", "bar" is not a valid Ruby expression
[23:56:42] gse: actually never mind.. i just realised what i'm doing wrong
[23:57:10] l4v2: has joined #ruby
[23:58:33] jhass: ruby-lang642: btw if you understand this you deciphered the secret to most of Ruby's "magic" behaviors and it'll probably actually put you ahead in understanding to a lot of already fully productive rubyists ;)
[23:59:08] ruby-lang642: I appreciate the help, I'm drawing a diagram to better understand this and then I'll respond to your messages.
[23:59:26] Radar: l4v2: welcome back
[23:59:30] djbkd: has joined #ruby
[23:59:43] jhass: ruby-lang642: sure, take your time, it took me quite some to click too