« Back to channel list

#ruby - 31 July 2018

« Back 1 day Forward 1 day »
[00:03:33] redlegion: has joined #ruby
[00:13:30] redlegion: has joined #ruby
[00:13:50] eckhardt_: has joined #ruby
[00:18:00] nowhereFast: has joined #ruby
[00:19:08] unshackled: has joined #ruby
[00:21:20] cagomez: has joined #ruby
[00:28:34] chris349: has joined #ruby
[00:29:11] nowhereman: has joined #ruby
[00:29:16] chris349: When I run rake db migrate it takes a long time to start up because its loading a bunch of irrelevant code, gems, etc. Is tehre any way to stop this on have db migrate only load the bare minimum to get the job done?
[00:31:49] p4p0l0: has joined #ruby
[00:33:32] redlegion: has joined #ruby
[00:39:13] chouhoulis: has joined #ruby
[00:41:35] nowhereman: has joined #ruby
[00:42:28] ciro: chris349: there is a #RubyOnRails channel. Maybe someone could answer your question there. Anyway, I think you would have to tweak your app's Rakefile. Take a look at this: https://rhnh.net/2010/09/07/speeding-up-rails-rake/
[00:45:49] elphe: has joined #ruby
[00:46:36] ciro: has joined #ruby
[00:47:41] CJKinni: has joined #ruby
[00:54:33] Nicmavr: has joined #ruby
[00:57:48] krawchyk: has joined #ruby
[01:04:30] leah2: has joined #ruby
[01:09:25] Synthead: has joined #ruby
[01:10:37] Synthead: I'm using minitest, and I want to ensure that a method gets called without actually calling the method (kinda like expect(instance).to receive(:method) in rspec)
[01:10:51] Synthead: I'm doing this (pasting as it's just three lines):
[01:10:58] Synthead: notify_mock = MiniTest::Mock.new
[01:10:59] Synthead: notify_mock.expect(:notify, nil, [])
[01:10:59] Synthead: notifier.stub(:notify, notify_mock) {}
[01:11:28] Synthead: however, the notify method still gets called when I do notifier.notify
[01:11:35] Synthead: What am I doing wrong?
[01:22:48] leah2: has joined #ruby
[01:31:17] kapil___: has joined #ruby
[01:34:24] worch: has left #ruby: ()
[01:37:58] eblip: has joined #ruby
[01:44:03] nowhereFast: has left #ruby: ()
[01:56:15] ur5us: has joined #ruby
[02:05:27] Jello_Raptor: has joined #ruby
[02:08:10] CJKinni: has joined #ruby
[02:08:39] alfiemax: has joined #ruby
[02:12:19] MzrE: has joined #ruby
[02:12:36] moei: has joined #ruby
[02:14:48] bmurt: has joined #ruby
[02:40:15] alfiemax: has joined #ruby
[02:40:39] chouhoulis: has joined #ruby
[02:46:36] krawchyk: has joined #ruby
[02:54:25] agent_white: has joined #ruby
[03:00:31] cadillac_: has joined #ruby
[03:11:14] braincrash: has joined #ruby
[03:47:29] orbyt_: has joined #ruby
[03:53:51] cagomez: has joined #ruby
[04:03:03] za1b1tsu: has joined #ruby
[04:10:29] TvL2386: has joined #ruby
[04:12:08] alyptik: has joined #ruby
[04:14:15] veloutin: has joined #ruby
[04:14:51] Nilium: has joined #ruby
[04:23:12] Phage: has joined #ruby
[04:26:28] nielsk: has joined #ruby
[04:51:32] sina: has joined #ruby
[04:51:37] jabreity: has joined #ruby
[04:52:13] adambeynon: has joined #ruby
[04:57:37] darkhanb: has joined #ruby
[04:57:53] howdoi: has joined #ruby
[05:01:04] ur5us: has joined #ruby
[05:08:16] nowhere_man: has joined #ruby
[05:13:21] s2013: has joined #ruby
[05:20:22] alfiemax: has joined #ruby
[05:30:17] sarna: has joined #ruby
[05:40:11] alfiemax: has joined #ruby
[05:45:24] sauvin: has joined #ruby
[05:45:42] cadillac_: has joined #ruby
[06:08:14] biberu: has joined #ruby
[06:09:56] conta: has joined #ruby
[06:22:09] snickers: has joined #ruby
[06:24:03] eckhardt: has joined #ruby
[06:32:15] Synthead: has joined #ruby
[06:35:47] p4p0l0: has joined #ruby
[06:59:14] cadillac_: has joined #ruby
[07:00:23] NightMonkey: has joined #ruby
[07:00:39] s2013: has joined #ruby
[07:02:31] Dbugger: has joined #ruby
[07:03:32] yohji: has joined #ruby
[07:05:11] nowhereman_: has joined #ruby
[07:09:32] clemens3: has joined #ruby
[07:09:37] ellcs: has joined #ruby
[07:20:58] p4p0l0: has joined #ruby
[07:22:40] kapil___: has joined #ruby
[07:24:23] sysvalve: has joined #ruby
[07:32:14] cschneid_: has joined #ruby
[07:41:02] reber: has joined #ruby
[07:47:47] elphe: has joined #ruby
[07:59:57] mikecmpbll: has joined #ruby
[08:08:36] ur5us: has joined #ruby
[08:10:20] lxsameer: has joined #ruby
[08:11:19] _aeris_: has joined #ruby
[08:17:20] cadillac_: has joined #ruby
[08:21:25] nowhereman_: has joined #ruby
[08:21:48] lxsameer: has joined #ruby
[08:24:49] cadillac_: has joined #ruby
[08:27:02] _aeris_: has joined #ruby
[08:37:32] tj-: has joined #ruby
[08:46:33] Beams: has joined #ruby
[08:52:21] unreal_: has joined #ruby
[08:52:28] deathwishdave: has joined #ruby
[09:01:33] dhollin3: has joined #ruby
[09:01:45] mengu: has joined #ruby
[09:03:51] jottr: has joined #ruby
[09:15:00] venmx: has joined #ruby
[09:30:47] ur5us: has joined #ruby
[09:35:17] ineb: just upgraded my rig with a gtx 1060. terminal is running so much smoother now
[09:37:04] tbuehlmann: increasing Metrics/LineLength Max to 100 like a pro
[09:37:10] Cork: has joined #ruby
[09:47:28] cgfbee: has joined #ruby
[09:50:57] lunarkitty7: has joined #ruby
[09:57:19] Bish: http://www.blacktm.com/blog/ruby-on-webassembly just read this article and it sounded interesting to me
[09:57:26] Bish: why is mruby "only" 1.8 compatible
[09:57:41] Bish: wouldn't it be super thrilling for rubyist to have ruby inside the browser with ALL it's features?
[09:58:12] bak1an: has joined #ruby
[09:58:14] Bish: i mean a ruby => mruby => c => llvm pipleline sounds like something that is doable
[09:59:53] Bish: pair that with some virtual dom language for ruby á la react and i think it would be super awesome
[10:03:30] bak1an: has joined #ruby
[10:09:55] cadillac_: has joined #ruby
[10:10:41] ineb: Bish: graalvm with truffle is another option
[10:10:54] Bish: oracle </discussion>
[10:11:21] ineb: its a shame indeed. but dont look away from truffle because of this. they are not oracle and doing a good job
[10:11:29] argoneus: has joined #ruby
[10:11:44] Bish: well, if it is as good that people could see over that licensing model i would certainly notice
[10:11:52] Bish: so long it doesnt exist for me
[10:11:59] ineb: well, some of them actually are oracle..
[10:12:10] Bish: what is "some of them"
[10:12:42] Bish: people? yeah well, they don't change the mind of all other people
[10:13:03] ineb: i just randomly clicked on someone who is answering issues on gh, https://github.com/chrisseaton and he is oracle
[10:13:07] Bish: and if mruby was completely compatible with 2.5 syntax i would already be writing stuff lijet hat
[10:13:31] Bish: ? well, sure they are, it's a oracle tool
[10:13:33] Bish: isn't it
[10:14:03] ineb: yes, i just wanted falsify my statement about truffle not being oracle
[10:14:37] Bish: yeah, well, my assumption is truffle has to be more than awesome, to be accepted by the community
[10:15:07] Bish: or rather graal
[10:15:36] Bish: but if mruby was 100% compatible with 2.5 syntax i'd be already writing some sort of automated framework
[10:15:43] Bish: to have ruby inside the browser
[10:15:45] ineb: yes. i have a project which mixes javascript and ruby and graal is working fine for that
[10:15:54] ineb: altough execjs is also fine
[10:16:25] Bish: not enough for me, i want 100% otherwise it's not interesting
[10:16:37] Bish: opaljs is impressive and would work in most of the cases
[10:16:52] Bish: but performance is an issue, so is immuntability of things
[10:16:56] Bish: and threads. and and and
[10:17:03] ineb: regarding https://github.com/mruby/mruby, mruby is 1.9 compatible
[10:17:11] Bish: i know, that's what i said
[10:17:20] Bish: (well i said 1.8, but that was just a typo)
[10:17:37] Bish: but what changes in syntax since 1.9?
[10:17:44] Bish: do i have {a:3}
[10:17:45] ineb: just one more typo and were on 2.0 :)
[10:17:47] Bish: do i have ->(x)
[10:18:07] Bish: no i needed 2 typos for that
[10:18:12] Bish: otherwise i would be at 2.8
[10:18:36] Bish: but honestly: what changed since 1.9, i don't remember
[10:19:16] beefjoe: has joined #ruby
[10:19:21] ineb: iam not sure if a typographical error is limited to one char
[10:19:23] Bish: syntax-wise nothing? really?
[10:19:26] cadillac_: has joined #ruby
[10:19:31] ineb: i dont remember either :/
[10:19:37] Bish: well if it's ONE error, and not errors
[10:19:40] Bish: certainly is :p
[10:20:06] Bish: maybe i will just play around and create a web framework with mruby, wil be fun i guess
[10:20:24] Bish: some virtual dom stuff in C & automatic model connection to clientside
[10:20:29] Bish: man that would be freakin awesome
[10:20:44] sameerynho: has joined #ruby
[10:23:21] Bish: and having a vm on top of a vm sounds odd doesnt it?
[10:28:10] ineb: by using opal you mean?
[10:28:41] gr33n7007h: has joined #ruby
[10:37:17] tristanp: has joined #ruby
[10:46:28] cadillac_: has joined #ruby
[10:53:04] Sylario: has joined #ruby
[10:54:21] elphe: has joined #ruby
[11:03:19] deathwishdave: has joined #ruby
[11:13:04] GodFather: has joined #ruby
[11:26:52] ohcibi: has joined #ruby
[11:32:12] kapil___: has joined #ruby
[11:34:48] Nicmavr: has joined #ruby
[11:35:07] ciro: has joined #ruby
[11:38:23] Nicmavr: has joined #ruby
[11:42:29] Kestrel-029: has joined #ruby
[11:44:34] chouhoulis: has joined #ruby
[11:45:44] jp: has joined #ruby
[11:50:26] elphe: has joined #ruby
[11:56:10] AJA4350: has joined #ruby
[12:00:26] za1b1tsu: has joined #ruby
[12:08:32] alfiemax: has joined #ruby
[12:16:56] Zaab1t: has joined #ruby
[12:18:31] conta: has joined #ruby
[12:20:31] chouhoulis: has joined #ruby
[12:23:33] Bish: ineb: noooo webassembly, you're really confusing
[12:24:54] micutzu: has joined #ruby
[12:25:13] ineb: Bish: but what VM on top of another VM (webassembly)? :<
[12:25:48] ur5us: has joined #ruby
[12:28:30] elphe: has joined #ruby
[12:30:04] cadillac_: has joined #ruby
[12:30:56] augcesar: has joined #ruby
[12:38:00] za1b1tsu: has joined #ruby
[12:47:43] imperator: has joined #ruby
[12:47:53] imperator: Good morning
[12:48:33] imperator: Isn't there a ruby library out there that will take a rest api specification and autogenerate a bunch of classes for you?
[12:49:25] ineb: imperator: swagger can do it
[12:49:38] imperator: ah, that's right, thanks ineb
[12:50:09] Bish: ineb: it's jsut one vm, graal doesnt run inside js, does it?
[12:50:15] Bish: and even if.. still would be a vm
[12:51:18] FernandoBasso: has joined #ruby
[12:51:36] FernandoBasso: How can one iterate over a collection, but only from index N and above?
[12:52:04] ineb: fernandobasso: why not skip until you there?
[12:56:38] imperator: fernandobasso, collection[n..-1].each{ ... }
[12:56:39] FernandoBasso: ineb: Well, if there is no other way.
[12:57:49] FernandoBasso: I'll say it again. This channel is more instructive than most Ruby books :D
[13:00:02] ineb: fernandobasso: for collections, imperator gave an solution. another way would be collection.drop(N).each
[13:00:07] FernandoBasso: Thanks, oh most honorable Ruby connoisseurs.
[13:00:27] ineb: fernandobasso: but iterators dont always have a fixed length and therefore could be problematic in this manner
[13:00:34] ineb: however, its also possible to #drop there ;)
[13:00:57] fmcgeough: has joined #ruby
[13:24:28] jp: has joined #ruby
[13:27:21] bmurt: has joined #ruby
[13:33:06] cadillac_: has joined #ruby
[13:35:47] elphe: has joined #ruby
[13:38:13] nowhere_man: has joined #ruby
[13:40:17] bak1an: has joined #ruby
[13:40:39] argoneus: has joined #ruby
[13:53:25] conta1: has joined #ruby
[13:56:41] Bish: .drop(:it).select(&:hot?)
[13:57:03] Bish: or rather likely_hot?
[13:57:10] Bish: i see myeself out
[14:02:31] bsamorim: has joined #ruby
[14:02:46] Rapture: has joined #ruby
[14:03:39] bsamorim: Hello! Is running `bundle install` as root user and executing the app as another one a bad practice in ruby?
[14:07:57] ineb: bsamorim: almost always yes. cant you install the required gems relative as normal user via bundle install --path vendor/bundle or so?
[14:08:36] Frem: has joined #ruby
[14:10:48] bsamorim: ineb: I haven't tried specifing a --path. Without the arg, I get a EACCESS error. I realize that this is fixable by setting up appropriate group membership to my app-running user but, since after root-bundle-installing the app's dependencies, I could exec the app just fine as another user, I wanted to know what exactly was behind this "no-bundler-as-root" rule
[14:11:50] nowhere_man: has joined #ruby
[14:12:03] ineb: bsamorim: basically because you are running arbitrary code in root context. gem installation routines can include any thinkable statements and therefore damage your system
[14:12:30] ineb: *therefore _possibly_ damage your system
[14:12:54] bsamorim: ineb: this exposure only happens during the actual bundle install, right?
[14:13:14] bsamorim: I can't exec arbitrary code as root just by running the app, right?
[14:14:26] ineb: bsamorim: not without running a privilege escalation exploit, no :)
[14:14:38] bsamorim: ineb: haha ok, thanks for the help!
[14:14:42] ineb: bsamorim: but you can of course sudo and stuff if your system is configured that way
[14:14:50] bsamorim: ineb: k, thx!
[14:19:39] sauvin: has joined #ruby
[14:25:55] za1b1tsu: has joined #ruby
[14:26:30] ur5us: has joined #ruby
[14:28:32] hgost: has joined #ruby
[14:37:06] snickers: has joined #ruby
[15:05:46] chouhoulis: has joined #ruby
[15:06:26] chouhoulis: has joined #ruby
[15:06:59] tdy: has joined #ruby
[15:08:06] rippa: has joined #ruby
[15:08:53] akaiiro: has joined #ruby
[15:09:56] Mike11: has joined #ruby
[15:10:27] _whitelogger: has joined #ruby
[15:18:13] Inline: has joined #ruby
[15:26:48] tcopeland: has joined #ruby
[15:27:14] za1b1tsu: has joined #ruby
[15:29:43] ivanskie: has joined #ruby
[15:38:27] cagomez: has joined #ruby
[15:45:50] kapil___: has joined #ruby
[15:50:25] konsolebox: has joined #ruby
[15:51:44] za1b1tsu: has joined #ruby
[15:54:22] polishdub: has joined #ruby
[16:03:07] cthu|: has joined #ruby
[16:09:28] orbyt_: has joined #ruby
[16:13:17] beowuff: has joined #ruby
[16:14:36] p4p0l0: has joined #ruby
[16:16:36] wildermind: has joined #ruby
[16:20:49] lxsameer: has joined #ruby
[16:21:58] darkhanb: has joined #ruby
[16:27:18] ur5us: has joined #ruby
[16:29:57] lxsameer: has joined #ruby
[16:34:24] alfiemax: has joined #ruby
[16:36:09] mroutis: has joined #ruby
[16:36:16] mroutis: has left #ruby: ()
[16:37:32] lxsameer: has joined #ruby
[16:40:52] orbyt_: has joined #ruby
[16:40:53] vikaton: has joined #ruby
[16:44:57] lxsameer: has joined #ruby
[16:48:49] jrich523: has joined #ruby
[16:54:27] Rapture: has joined #ruby
[16:56:07] agent_white: has joined #ruby
[16:57:50] mroutis: has joined #ruby
[17:18:01] brt: has joined #ruby
[17:18:09] mroutis: has joined #ruby
[17:24:08] tj-: Is this valid? "until (in = File.join(x,y)) != nill do "
[17:24:21] Some-body_: has joined #ruby
[17:24:22] tj-: as in assign to in, and test "in != nil" ?
[17:24:46] lxsameer: has joined #ruby
[17:24:50] mroutis: has left #ruby: ()
[17:31:51] lypsis: has joined #ruby
[17:32:54] go|dfish: has joined #ruby
[17:35:04] havenwood: TJ-: File#join always returns a String, never nil.
[17:36:16] havenwood: TJ-: It's often less convoluted to `loop do` with a `break foo if`.
[17:37:04] havenwood: TJ-: We might be able to give a better suggestion with more context regarding the surrounding code.
[17:37:31] havenwood: >> File.join ''
[17:37:37] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[17:37:55] havenwood: File.join '', '' #=> "/"
[17:39:59] bak1an: has joined #ruby
[17:41:20] cadillac_: has joined #ruby
[17:43:34] cthulchu_: has joined #ruby
[17:44:20] spiette: has joined #ruby
[17:45:07] tj-: havenwood: yeah, I noticed that, ignore that bit! I was on about the "until (a = b.method) == nil" construct, where b.method() will at some point return nil - My typing was all over the place originally :)
[17:45:50] tj-: havenwood: is it valid to assign and test the result of the assignment in the same statement like that
[17:46:48] brt: trying to compile ruby 2.5.1 for i686 on the latest x86_64 macos version, but I keep running into strange errors, like `error: use of undeclared identifier 'username_completion_function'; did you mean 'rl_username_completion_function'?` despite it being #define’d earlier in the file (readline.c)
[17:47:50] brt: I’m installing it with rvm, to which I’m passing the --with-arch=i686 option
[17:48:29] brt: and it seems to work fine with --with-arch=x86_64
[17:48:33] tj-: havenwood: I'm giving myself a crash-course in Ruby to hack vagrant-mutate with minimally invaise patches, so although I'm reading the docs it's a lot to take in all at once
[17:48:50] cadillac_: has joined #ruby
[17:49:03] brt: I’ve tried using my system default (some gcc version) and clang to no avail
[17:50:20] ldepandis: has joined #ruby
[17:50:51] moei: has joined #ruby
[17:52:15] AJA4350: has joined #ruby
[17:52:33] eckhardt: has joined #ruby
[17:52:41] NoidedSuper: has joined #ruby
[17:53:08] rrichardsr3: has joined #ruby
[17:54:30] Rapture: has joined #ruby
[17:54:57] Freshnuts: has joined #ruby
[17:57:10] rrichard_: has joined #ruby
[17:57:17] chouhoulis: has joined #ruby
[18:03:02] AJA4351: has joined #ruby
[18:04:32] graphene: has joined #ruby
[18:04:53] lxsameer: has joined #ruby
[18:10:49] za1b1tsu: has joined #ruby
[18:11:18] SeepingN: has joined #ruby
[18:12:15] graphene: has joined #ruby
[18:15:26] dtzuzu: has joined #ruby
[18:16:22] cadillac_: has joined #ruby
[18:25:19] ur5us: has joined #ruby
[18:29:00] AJA4351: has joined #ruby
[18:30:43] ByronJohnson: has joined #ruby
[18:33:11] biberu: has joined #ruby
[18:33:37] AJA4351: has joined #ruby
[18:40:10] nemesit|znc: has joined #ruby
[18:44:05] kieranjogrady: has joined #ruby
[18:44:46] lxsameer: has joined #ruby
[18:48:22] graphene: has joined #ruby
[18:49:58] kapil___: has joined #ruby
[18:51:01] mroutis: has joined #ruby
[18:55:14] elphe: has joined #ruby
[18:56:14] graphene: has joined #ruby
[18:56:45] Puffball: has joined #ruby
[19:00:27] AJA4350: has joined #ruby
[19:01:48] r29v: has joined #ruby
[19:07:15] graphene: has joined #ruby
[19:12:07] venmx: has joined #ruby
[19:14:35] mroutis: has joined #ruby
[19:15:39] \void: has joined #ruby
[19:21:28] graphene: has joined #ruby
[19:22:28] deathwishdave: has joined #ruby
[19:25:06] lxsameer: has joined #ruby
[19:34:55] lxsameer: has joined #ruby
[19:41:59] GodFather: has joined #ruby
[19:47:13] ur5us: has joined #ruby
[19:49:21] jrich523: has joined #ruby
[19:52:34] tj-: If a super-class has a method definition that has the same name as a sub-class instance variable, is it possible for the instance variable name to over-ride the method or are the names essentially different due to the instance variable's @ prefix? I'm looking for a way to avoid duplicating the same code in sub-classes by moving it to the super, but in some sub-classes the 'name' is just a variable
[19:57:57] bmurt: has joined #ruby
[20:02:27] kinduff: has joined #ruby
[20:08:41] AJA4351: has joined #ruby
[20:14:23] za1b1tsu: has joined #ruby
[20:18:14] bmurt: has joined #ruby
[20:24:41] AJA4350: has joined #ruby
[20:30:19] eckhardt: has joined #ruby
[20:33:14] lytol_: has joined #ruby
[20:40:34] graphene: has joined #ruby
[20:42:49] graphene: has joined #ruby
[20:43:21] elphe: has joined #ruby
[20:46:14] graphene: has joined #ruby
[20:53:56] yokel: has joined #ruby
[20:57:48] jrich523: hey guys, using pry to poke at some code and i get an error msg about using a "guests" member, and im confused to as why, if i do a pp kvm, it looks like this https://gist.github.com/jrich523/b572b8d964f3111febb07a0851c001c9
[20:58:11] jrich523: i am unable to access the guests at all
[20:58:11] deathwishdave: has joined #ruby
[21:01:23] segy: has joined #ruby
[21:01:38] AJA4351: has joined #ruby
[21:07:57] troulouliou_dev: has joined #ruby
[21:07:59] elphe: has joined #ruby
[21:24:51] elphe: has joined #ruby
[21:29:14] lupine: has joined #ruby
[21:32:45] baweaver: jrich523: What's the error?
[21:32:51] baweaver: I bet you it doesn't have an accessor.
[21:33:08] baweaver: An instance variable doesn't guarantee an accessor
[21:33:54] jrich523: and i bet you are right :)
[21:34:39] jrich523: so, i had this to hash method, pods.each(& :hash) which allowed me to see that data
[21:34:44] jrich523: so that sort of threw me off a bit
[21:35:02] jrich523: thought being, if i can export it, why cant i access it via the object
[21:35:30] jrich523: also on the object init there was a @guests = guests... which, doesnt mean it has an accessor... forgot that :-/
[21:37:40] postmodern: has joined #ruby
[21:38:32] lxsameer: has joined #ruby
[21:39:52] jp: has joined #ruby
[21:43:09] millerti: has joined #ruby
[21:52:02] Caerus: has joined #ruby
[22:06:55] mzo: has joined #ruby
[22:13:20] cthulchu: has joined #ruby
[22:21:40] ivanskie: has joined #ruby
[22:25:13] graphene: has joined #ruby
[22:50:17] deathwishdave: has joined #ruby
[23:10:23] leitz: has joined #ruby
[23:12:22] leitz: Style/clarity question. If you have different programs that will use the same class definition; where each program uses some of the classes' built-in methods and some that only that program uses, is it better to let each program extend the class as it needs or to put everything in the base class?
[23:19:38] mzo: leitz: generally you don't modify the source of libraries you're using
[23:20:28] mzo: sometimes you need to, but you don't just put your application code into the library
[23:20:45] leitz: mzo, even if I'm the author of the library and the program?
[23:21:03] leitz: So, you feel extending the class is the cleanest path?
[23:21:19] leitz: I'm moving into things I've never really done before, so trying to do them well.
[23:21:23] mzo: well why do you even need to add methods to this class?
[23:21:46] leitz: Different programs need different things from the instances of the class.
[23:22:08] feelx: has joined #ruby
[23:22:19] leitz: So the different programs utilize, and may even add to, data about the instances.
[23:22:31] mzo: that might be an indication that the class doesn't provide a very useful interface
[23:23:18] leitz: It provides a very clean and simple interface, and assumes it will be extended. :)
[23:23:32] Dark_Arc: has joined #ruby
[23:23:47] mzo: ok then extend it
[23:26:48] leitz: The base class is "Person", with a small set of attributes. Different programs need different attributes; one might want "Career" and another "Hair color" and "psychological profile".
[23:29:10] mzo: ok sure
[23:30:46] mzo: that's a pretty contrived example though. generally you don't see this in practice.
[23:31:10] leitz: That's pretty close to what I'm actually doing.
[23:31:31] mzo: but what does your program actually do?
[23:32:21] mzo: and what does this class do aside from have this small set of attributes?
[23:33:11] leitz: One is a space merchant game, another makes generic characters for games and fiction, and another stores and updates characters via a web interface. Note that these are being worked on, so "makes" is used loosely.
[23:33:50] mzo: and the Person class?
[23:34:19] leitz: The Person class has and presents basic data. Name, age, statistics (for a a game), gender. Each of the other programs uses that data plus it's own attributes.
[23:35:17] leitz: So the ship game might assign a work role "First officer on the Karava Manoi". The base class doesn't usually have a "work role" attribute.
[23:35:42] leitz: A character generation program just gives base data and lets the user decide what to add.
[23:36:53] mzo: the thing about adding new instance variables to classes is that none of the existing methods know about your new variables
[23:37:04] mzo: so they can't do anything with them
[23:37:21] mzo: so then you add new methods to the class that use your new variables
[23:37:33] mzo: but really you could have just made a new class
[23:38:38] mzo: if you're extending a class in a dynamically typed programming language and not overriding any of its methods, something is kind of odd
[23:39:12] lxsameer: has joined #ruby
[23:40:09] cadillac_: has joined #ruby
[23:40:58] mzo: it may seem unsatisfactory to recreate a Person class with a few of the same attributes for each of your programs, so i understand the impulse to go for code re-use, but imo you should just copy and paste the class for each program
[23:43:59] leitz: Each iteration pushes me to think better about the design. That's one of the big reasons for staying with code re-use. The other is to push me to learn how to really use objects. I could do this a lot easier with a struct and some methods.
[23:46:43] lupine: we're already way too far on the code-reuse side of the equation
[23:47:19] alfiemax: has joined #ruby
[23:48:46] leitz: lupine, not sure I understand.
[23:50:19] lupine: too much code reuse
[23:50:21] lupine: let's have less of it
[23:52:50] leitz: Nyah, I like it.