#ruby - 02 January 2018
« Back 1 day Forward 1 day »
[00:12:02] namho: Happy New Years everyone. I'm new to Ruby and was hoping for some guidance. I went through the Codecademy Ruby lesson - would the Pickaxe book, Well-Grounded, and Eloquent good places to go next?
[00:19:27] Radar: namho: welcome :) Yes all of those places are good to go through after codecademy's course.
[00:22:34] Radar: namho: I'm usually around about this time until ~7 hours from now so if you've got any questions just ask
[05:02:06] xcesariox: when i did `rails s' to run server i keep getting Could not find rake-12.3.0 in any of the sources
[05:38:27] mikhael_k33hl: I have a class that creates a database object for sqlite3, should I make it a singleton since it will be used by multiple threads?
[05:52:10] mikhael_k33hl: elomatreb: can you elaborate on that one? I'm a bit confused with "The class is already a singleton object
[06:52:37] mikhael_k33hl: elomatreb: say I use the Ruby SIngleton Module, how do I change the value of the database during unit tests?
[06:53:27] elomatreb: You can bypass access restrictions with #send (e.g. `some_instance.send(:private_method, "some_arg")`)
[07:21:12] mikhael_k33hl: elomatreb: I got a symbol in my class that I need to change during unit test, is there any way to do it or do I have to define a getter?
[07:21:43] elomatreb: Depends on where you assigned it, there is instance_variable_set for instance variables
[07:23:52] mikhael_k33hl: elomatreb: i'm not sure if I'm doing this right though: https://gist.github.com/marzdgzmn/9bf6ccf1ab85c2a5ae652e8390a9d40b
[07:25:37] elomatreb: That assignment on line 11 doesn't look right, doesn't that give a syntax error?
[08:20:21] mikhael_k33hl: Since I have a singleton for database access, how do I ensure that the database get's closed when the program is closed since that connection will always be open as long as the program is runjning
[09:58:32] ren0v0: Hi, i'm trying to install ruby via RVM, but its just freezing on "Installing required packages: gawk, libyaml-dev, libsqlite3-dev," ?
[10:13:00] apeiros: ren0v0: uh, maybe run it with `set -x` (I hope that's the right command). i.e. `set -x` then `rvm install your_ruby`
[10:13:38] ren0v0: because i found the issue and it was related, in the logfile it had a popup for another package that needed confirmation
[10:14:22] apeiros: it's quite possible that rvm doesn't properly shield one from interactive sections, yes. I'd ask over in #rvm what to do about that
[10:55:02] mikhael_k33hl: apeiros: what if the program get closed unexpectedly will theh at_exit still run?
[10:55:47] apeiros: depending on how unexpectedly a program terminates, there's little to nothing you can do anyway
[10:56:21] apeiros: you can set up a global begin/rescue/end to rescue all ruby related exceptions and with rescue Interrupt, also a ctrl-c termination
[10:57:52] apeiros: I'm actually mistaken. at_exit will also be run in case of unhandled exceptions.
[14:50:05] c-c: I'm back to working on my little game engine. I'm in the process of making it into a open source project. I've tested the simple base and its run over 20 billion fames without crashing (52 hours of processor time). I'm convinced that to get anything happening I need +4 times more velocity for the project. I'm considering things like rewards for best contributors, seen any ruby projects that do that?
[15:31:59] apeiros: basically you set up a catch, and within the block of that catch, you can throw. throw will return to the catch.
[15:32:19] apeiros: if you know begin/rescue/end + raise - exactly the same. just slightly different syntax. and you can throw about anything, not just exceptions.
[15:49:01] c-c: Hm, need to make sure its ok to have rewards with github and this GPL 3 license, too
[15:49:56] c-c: havenwood: ever contributed for reward, or "competed" for a reward in a open source project?
[15:57:18] havenwood: c-c: I know folk who did the Github challenge for a shirt - that's the only example I can think of.
[15:57:36] dminuoso: Not sure whether that speaks for his skills, or just his lack of participation in such adventures.
[15:59:58] apeiros: and damn, the emoji search is localized. searched for "cookie", turned up empty. searched manually until I figured I should have searched for "keks" :-S
[16:01:09] c-c: havenwood: You are hereby heralded with an irc medal as a reward for your help and services.
[16:29:52] apeiros: kristian_on_linu: some possible reasons: a) you installed jekyll under a different ruby than you try to run it, b) you are in a directory with a Gemfile
[16:34:51] apeiros: kristian_on_linu: can you please do the following and gist the session? `cd ~; rvm list; gem install jekyll; jekyll -v`
[16:39:27] kristian_on_linu: I understand that gist is cool, but I never used it ... and I don't want you to spend time on helping with that too ;)
[16:41:39] havenwood: Yeah, something is amiss because that's a 2.3 ABI gem command and a 2.4 Ruby selected.
[16:57:04] apeiros: fix your PATH. which is usually defined in ~/.profile, ~/.bash_profile or similar
[17:10:40] apeiros: line 24 adds the rvm bin dir *after* all other. PATH is search left to right. first wins.
[17:13:23] dminuoso: This should be a thing for a doctor: "You have a headache? Have you tried uninstalling RVM?"
[17:24:26] dminuoso: kristian_on_linu: I dont have anything against rvm, but if you dont have any good reasons to use rvm or rbenv specifically, you are almost always better off with ruby-install for installing ruby versions, and chruby for switching between multiple ruby versions.
[17:25:15] tcopeland: rubycoder37: no, you still need to install bundler after installing ruby 2.5.0
[17:27:03] tcopeland: it was going to be in there but that was reverted shortly before the release https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/61416
[17:30:52] kristian_on_linu: dminuoso: I'm a very low level user ... I just do jekyll and related task
[17:31:10] kristian_on_linu: every guide I've seen says rvm makes it all easier ... but if that's not the case, I will avoid it next time
[17:32:18] dminuoso: kristian_on_linu: Dont worry too much about it, rvm is fine until you start using rvm commands that do.. things.
[17:37:47] apeiros: no, hand crafted. target for the mobile site is to have it <200KB for initial load and viewable with low-res images. post-load is high-res images and probably webfont. maybe sound, not sure on that one though, since I hate websites with sound :)
[20:18:33] desperek: i want to use mysql2 but bundler keeps installing mysql2 for mingw (windows; x64)
[20:19:15] desperek: mingw version doesn't work and produces and error with require (rails so i think it may be different thing)
[21:48:55] samort7: What does it mean if a hash is initialized like this: def api_hash locale=Locale.first ?
[22:17:30] havenwood: samort7: Not sure what you mean by "what does it mean" but it seems you're saying the Locale::first returns a Hash? Are you wondering how that gem implements ::first?