« Back to channel list

#ruby - 18 July 2019

« Back 1 day Forward 1 day »
[00:10:34] skryking: has joined #ruby
[00:25:39] jenrzzz: has joined #ruby
[00:40:40] DaRock: has joined #ruby
[00:50:49] sgen: has joined #ruby
[01:11:54] fphilipe_: has joined #ruby
[01:14:03] codefriar: has joined #ruby
[01:25:17] Swyper: has joined #ruby
[01:31:07] DarthGandalf: has joined #ruby
[01:36:39] Swyper: has joined #ruby
[01:44:18] sidepocket: has joined #ruby
[01:47:53] duderonomy: has joined #ruby
[01:51:30] henninb: has joined #ruby
[02:03:52] Swyper: has joined #ruby
[02:22:02] sidepocket_: has joined #ruby
[02:30:47] unixcat: has joined #ruby
[02:32:48] ramfjord: has joined #ruby
[02:34:49] unixcat: has joined #ruby
[02:37:08] unixcat: has joined #ruby
[02:38:39] unixcat: has joined #ruby
[02:40:02] unixcat: has joined #ruby
[02:42:06] fphilipe_: has joined #ruby
[02:47:24] SidepocketNeo: has joined #ruby
[02:50:05] galaxie: has joined #ruby
[03:26:41] Thenekofell: has joined #ruby
[03:29:21] jmcgnh: has joined #ruby
[03:38:29] gix-: has joined #ruby
[03:48:40] Mrgoose8: has joined #ruby
[03:54:06] orbyt_: has joined #ruby
[03:55:57] gix: has joined #ruby
[04:12:17] fphilipe_: has joined #ruby
[04:15:32] spectra: has joined #ruby
[04:19:33] unixcat: has joined #ruby
[04:26:29] AndreYuhai: has joined #ruby
[04:36:00] AndreYuhai: has joined #ruby
[04:49:33] queip: has joined #ruby
[05:03:12] ur5us: has joined #ruby
[05:11:50] fphilipe_: has joined #ruby
[05:15:32] fphilipe: has joined #ruby
[05:21:54] sauvin: has joined #ruby
[05:23:28] conta: has joined #ruby
[05:24:17] aither: has joined #ruby
[05:31:00] teardown: has joined #ruby
[05:33:57] Swyper: has joined #ruby
[05:35:21] ramfjord: has joined #ruby
[05:35:36] LightStalker: has joined #ruby
[05:38:23] conta: has joined #ruby
[05:49:33] ur5us: has joined #ruby
[05:50:38] schneider: has joined #ruby
[05:53:53] absolutejam: has joined #ruby
[05:59:17] ferhaty: has joined #ruby
[06:31:35] Thenekofell: has joined #ruby
[06:44:10] snickers: has joined #ruby
[06:47:56] andikr: has joined #ruby
[06:49:14] lxsameer: has joined #ruby
[06:56:47] drnerdius: has joined #ruby
[06:57:27] prestorium: has joined #ruby
[06:58:58] leah2: has joined #ruby
[07:00:56] absolutejam: has joined #ruby
[07:05:25] TomyWork: has joined #ruby
[07:06:24] sauvin: has joined #ruby
[07:08:22] priodev: has joined #ruby
[07:18:37] aupadhye: has joined #ruby
[07:20:22] schneider: has joined #ruby
[07:26:34] bitwinery: has joined #ruby
[07:34:06] wopi: has joined #ruby
[07:35:59] ramfjord: has joined #ruby
[07:36:36] wopi: Hi, it's safe to upgrade from Puma 3.x to Puma 4.x? I can't see any related information. I mean is it a drop in replacement or are there changes I have to do in my application?
[07:37:19] snickers: has joined #ruby
[07:40:38] Lewix: im lookin . for a public url . that . timeout
[07:42:40] wopi: Lewix https://httpstat.us/
[07:47:39] Lewix: wopi: thank you
[07:47:48] deepreds1: has joined #ruby
[08:00:36] queip: has joined #ruby
[08:02:46] za1b1tsu: has joined #ruby
[08:06:14] wopi: has left #ruby: ("The Lounge - https://thelounge.github.io")
[08:12:49] havenwood: wop, it should *just work*
[08:19:31] DaRock: has joined #ruby
[08:20:23] themsay: has joined #ruby
[08:30:03] jefffrails35: has joined #ruby
[08:39:53] ellcs: has joined #ruby
[08:43:37] absolutejam: has joined #ruby
[08:48:26] absolutejam1: has joined #ruby
[08:50:47] evdubs_: has joined #ruby
[08:52:02] conta: has joined #ruby
[08:52:02] yxhuvud: So why was the major number increased? less support of old rubies?
[08:54:58] jenrzzz: has joined #ruby
[09:03:08] fphilipe: has joined #ruby
[09:03:24] dhollinger: has joined #ruby
[09:03:33] leitz: has joined #ruby
[09:13:04] havenwood: Yxhuvud: Not even old Rubies deprecated afaik. There was a commit that touches the tight loop portion of the thread pool, but it didn't change much.
[09:13:16] havenwood: https://github.com/puma/puma/pull/1648/files
[09:15:10] havenwood: Heh, guess I didn't quite get it right on my stab at that line back in 2014: https://github.com/wjordan/puma/commit/3896e2aa121bfc0ea99951bd984c8acf51f01154#diff-a4330ac333778a0fff63a0c404c4fc64
[09:15:18] havenwood: I was closer than before. :P
[09:15:37] havenwood: Inching towards correct.
[09:15:48] leitz: havenwood, are you up early or late?
[09:16:07] havenwood: speaking of, i need to sleep!
[09:16:39] leitz: I need to figure out why my rspec test fails sometimes.
[09:24:38] themsay: has joined #ruby
[09:25:18] dantey: has joined #ruby
[09:27:38] brahmana: has joined #ruby
[09:28:27] Nicmavr: has joined #ruby
[09:28:55] themsay: has joined #ruby
[09:35:04] queip: has joined #ruby
[09:36:16] ramfjord: has joined #ruby
[09:37:54] brahmana: Hi.. I have libssl1.0 and libssl1.1 (both) installed on my Ubuntu 18.04 machine. I am trying to build Ruby 2.2.10 on this. The build and install are successful but require 'openssl' doesn't work
[09:40:17] leitz: brahmana, "require 'openssl'" in your ruby code, or in the compile?
[09:40:58] leitz: On a different note, I'm loathe to suspect a bug in Ruby or one of the standard libraries. However, this is sort of funny, and suspect. https://gist.github.com/LeamHall/84a8d44ba542f28810416adcf6801fcb
[09:42:44] leitz: Usually it's operator error. Okay, it's always operator error. But in the data set, I'm using curl to pull a POST. The average "speed" reported by curl is in the 50,00 - 70,000 range. However, sometimes the speed is faster that 300K, and those times the output doesn't have what it's supposed to.
[09:44:02] leitz: The machine I'm on is void linux, patched, and just me sitting here. No real apps running except Firefox and HexChat. OS load is less than 0.2.
[09:44:39] brahmana: leitz : "require 'openssl'" in IRB.
[09:44:58] leitz: brahmana, openssl is a gem. Have you installed it?
[09:45:00] brahmana: Actually I encountered the error when I tried to install bundler with "gem install bundler"
[09:46:20] leitz: brahmana, hmmm... does Ubuntu have an "openssl-dev" package? Often compilers need the development tools for the topic, like openssl.
[09:46:50] brahmana: Yes, I have the libssl1.0-dev installed
[09:47:23] leitz: How about for 1.1, since you have both installed? Did the compile show any errors?
[09:47:51] brahmana: leitz : Btw, I did not know that I need to install the openssl gem separately. I thought it was a ruby extension installed along with ruby if not explicitly disabled during ./configure step
[09:48:04] leitz: I usually remember the -devel packages *after* the compile logs tell me they missed something.
[09:48:22] brahmana: make and make install worked without any issues.
[09:48:23] leitz: brahmana, I'd try 'gem install openssl' to see.
[09:52:55] dantey: has joined #ruby
[10:03:37] tuor: has joined #ruby
[10:04:21] brahmana: leitz : gem install openssl is not an option :
[10:04:37] brahmana: ERROR: While executing gem ... (Gem::Exception) Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
[10:05:10] brahmana: From the out of the "./configure" can I find out which openssl library / header files are being used
[10:05:20] brahmana: Or whether ruby is being compiled with OpenSSL or not?
[10:06:00] leitz: You should be able to. When I compile I usually make a separate log for configure, make, make install, etc.
[10:07:17] brahmana: Ok, I ran ./configure and I now have the config.log but it does not mention ssl anywhere
[10:07:48] sphenxes: has joined #ruby
[10:10:17] fphilipe: has joined #ruby
[10:10:29] reber: has joined #ruby
[10:11:12] leitz: brahmana, can you post that log, and the make log, in a gist? I have a few minutes if you want me to look over it.
[10:11:33] brahmana: doing that right away
[10:15:47] brahmana: leitz : https://dpaste.de/sUQT
[10:15:51] brahmana: That is the config.log
[10:16:22] brahmana: I do not seem to have a similar log file for make
[10:16:34] brahmana: Let me try running make again with output redirected to a file.
[10:18:42] leitz: Include the errors.
[10:18:58] leitz: I'm not seeing anything in the config.log that mentions ssl.
[10:19:44] mniip: has joined #ruby
[10:19:49] conta: has joined #ruby
[10:19:52] brahmana: yeah... that is what I am surprised about too.
[10:20:10] brahmana: leitz : Is there any config flag that I need to pass to enabled openssl ?
[10:21:16] brahmana: leitz : Ok ran make again in the same folder and this time there is an error
[10:21:20] leitz: Let me go look, I haven't compiled in a while.
[10:21:25] leitz: Errors can be good. :)
[10:21:32] brahmana: https://dpaste.de/E6aK
[10:22:51] leitz: That error looks more like a permission thing. Did you "make clean"?
[10:24:10] brahmana: make clean done
[10:24:15] brahmana: Do I ./configure again?
[10:25:03] leitz: I tend to, and ./configure > configure_yyyymmdd.log 2>&1, with yyyymmdd being the date.
[10:26:52] leitz: Ah, did you run "autoconf"?
[10:27:12] brahmana: I have never done that for previous Ruby builds
[10:27:54] jenrzzz: has joined #ruby
[10:28:25] leitz: I'm reading the README.md for Rubyt 2.2 now, and it mentions it. I tend to start with a totally blank slate when I compile.
[10:30:30] brahmana: ok.. Run autoconf after configure?
[10:30:52] leitz: it should re-write your configure.
[10:31:05] leitz: I'm doing the same on my void box.
[10:36:34] ixti: has joined #ruby
[10:36:58] leitz: brahmana, did you see this? https://github.com/rvm/rvm/issues/4357
[10:37:04] brahmana: https://dpaste.de/qOLB
[10:37:49] leitz: Maybe there's a libssl-dev and a libssl1.0-dev?
[10:37:52] brahmana: yes I did. There are a couple other such posts and stackoverflow QAs also
[10:38:08] Dbugger: has joined #ruby
[10:39:04] brahmana: No, I confirmed that. libssl-dev is not installed
[10:39:11] brahmana: Checked again now.
[10:39:39] brahmana: I pasted the latest make output above. it has references to openssl. Looks like openssl is being compiled
[10:41:33] leitz: Yup, I saw that. Have you tried "make install" and then "gem install openssl"?
[10:43:28] chalkmonster: has joined #ruby
[10:45:05] brahmana: leitz : Previously I had done make install. That is when I faced that error when installing any gem
[10:45:15] brahmana: Let me try install again after this second make
[10:47:47] leitz: It should work, or at least give us another error. :)
[10:47:49] brahmana: leitz : https://dpaste.de/ZRih - make install log
[10:48:49] leitz: Looking good!
[10:54:36] brahmana: leitz gem install is stuck because of a proxy issue. The machine is behind a proxy and gem tool doesn't seem to be picking up the http_proxy env var
[10:55:51] brahmana: leitz it seems to be working...
[10:56:51] brahmana: leitz : Worked... !!
[10:57:04] brahmana: bundler was successfully installed
[10:57:31] brahmana: leitz : Thank you
[10:58:00] queip: has joined #ruby
[10:58:28] conta: has joined #ruby
[11:00:14] leitz: My guess is that the configure was built before you had the ssl libraries installed. Running autoconf is probably what fixed that.
[11:01:46] brahmana: I actually did not run autoconf.. your first part is correct I think
[11:02:37] brahmana: I was running apt install to install a bunch of dev dependencies for compiling Ruby. I most likely started ./configure in parallel in a different shell
[11:02:51] brahmana: I do not precisely remember.. but most likely that is the case
[11:03:12] brahmana: So configure finished before apt install could install libssl1.0-dev
[11:03:55] leitz: Does the current configure script include ssl?
[11:04:23] brahmana: The configure output?
[11:04:30] brahmana: or the configure script itself?
[11:04:47] leitz: The first time it did not.
[11:05:40] leitz: Hmm..mine doesn't either. False trail, I think.
[11:05:41] dionysus69: I failed to point Gemfile gem path to point to my local gem
[11:05:57] dionysus69: does anyone have example on how to import a local .gem file
[11:06:03] brahmana: Yeah, configure does not have anything like ssl
[11:06:21] brahmana: make and make install outputs have it though
[11:06:53] leitz: dionysus69, you should just be able to "gem install <my-cool_gem>", if you're in the same directory as the gem file.
[11:07:25] leitz: brahmana, then it looks like Ruby builds with SSL if you have it installed, without a specific configure command. Cool.
[11:07:38] brahmana: yeah.. looks like it
[11:09:31] brahmana: Since require 'openssl' is now working in irb, I believe we can say that gem install 'openssl' is not needed as it comes packages with Ruby itself
[11:10:53] dionysus69: leitz: and it will use locally installed gem and not fetch from rubygems? because I also have it on rubygems
[11:13:19] dionysus69: ok I think I understood how it will work
[11:13:34] dionysus69: I will bump minor version, rebuild install and then use it in another gemfile using different version
[11:15:30] leitz: brahmana, openssl is a gem, but it may be a part of the core Ruby build or standard library. I'm not sure, thought.
[11:16:07] leitz: dionysus69, if you have one installed locally, and you 'require my_gem', then it should not try to fetch from rubygems.
[11:16:35] leitz: I thought you meant "Install a gem from a file I have locally".
[11:16:41] leitz: My coffee is wearing off...
[11:18:27] mniip: has joined #ruby
[11:19:13] dionysus69: leitz: worked without require too :), just specified gem "", "version"
[11:19:35] dionysus69: that's what I did yes, I installed file locally
[11:19:44] leitz: Ah, cool!
[11:19:46] dionysus69: cause I dont wanna release a gem on every minor change
[11:20:01] dionysus69: would be very taxing on rubygems.org too :D
[11:20:44] leitz: Agreed! I'm re-doing stuff on one of my gems and will re-publish when it's at a usable state. You have to balance deployment and stability.
[11:20:54] dionysus69: I am starting to like this gem ecosystem, turned out to be so simple, building my rails engine/plugin as a gem now ^.^
[11:33:00] mcspud: has joined #ruby
[11:36:27] ramfjord: has joined #ruby
[11:53:16] AJA4350: has joined #ruby
[12:00:18] lucasb: has joined #ruby
[12:10:40] jenrzzz: has joined #ruby
[12:14:00] Swyper: has joined #ruby
[12:14:36] Obats: has joined #ruby
[12:16:36] Obats: Hey guys, ruby newbie. Deep inside Mustache I get "Unknown error (class: Encoding::CompatibilityError): incompatible character encodings: UTF-8 and ASCII-8BIT", and then a stacktrace. Now, I get what the encodings part means, but how to find out which string(s) that are causing this error? Can I somehow enable extended error output, or something?
[12:22:02] Obats: It would probably solve the problem if I could just see the strings(it has to be something comparing two strings, right?)..
[12:24:42] leitz: Obats, I'm not familiar with Mustache, but the stack trace should give you more. You can also put "$VERBOSE = true" at the top of your Ruby code, in some cases it gives more detail.
[12:24:57] leitz: Maybe post a gist of the output?
[12:27:05] absolutejam: has joined #ruby
[12:28:41] Obats: leitz: It's a template engine. I'll just give $VERBOSE a quick try
[12:29:09] Obats: (thanks :))
[12:33:07] brahmana: has joined #ruby
[12:38:21] yalue: has joined #ruby
[12:40:14] selckin: has joined #ruby
[12:44:50] dantey: has joined #ruby
[12:46:17] Swyper: has joined #ruby
[12:51:13] Obats: leitz: https://pastebin.com/RK63A4QJ (I added linebreaks) If you - or anyone else - would feel like having a look.. It's just the stack though, no context or environment data of any kind =[
[12:51:13] ruby[bot]: Obats: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[12:51:43] DaRock: has joined #ruby
[12:52:11] drnerdius: has joined #ruby
[12:53:08] Obats: Ok, I just got a message from ruby about not using pastebin. Does that mean that you can't see my post with the pastebin link? (No harm intended, first time I'm here)
[12:53:34] leitz: Obats, I'm a newbie, so when the smart folks show up, listen to them. I can see your paste, just just gist next time.
[12:54:14] leitz: The errors go from most specific to parentage, so the first few lines are often where the issues are. The other bits are how you got there.
[12:55:31] absolutejam: has joined #ruby
[12:55:49] leitz: Obats, have you seen this? It might give you some ideas. https://github.com/logstash-plugins/logstash-filter-urldecode/issues/6
[13:02:04] adam12: Obats: Is this your project? or something you've downloaded?
[13:02:28] adam12: Obats: That mustache version is _ancient_.
[13:04:24] Obats: adam12: I'm one of the grunts working on that project
[13:05:31] Obats: ..and yes, I noticed there's 1.1.0 out now, not sure if that would help here, but it's perhaps worth a shot
[13:07:03] adam12: Obats: I'd try updating Mustache. Also, in mail_renderer.rb, I'm presuming you're calling Mustache.render or something similar, perhaps with a locals hash. I'd start checking those variables for their encodings.
[13:07:49] adam12: Obats: Also relevant. https://github.com/mustache/mustache/issues/132
[13:16:38] Swyper: has joined #ruby
[13:18:11] deepreds1: has joined #ruby
[13:27:06] leitz: Obats, adam12 is one of the "smart folks" I mentioned earlier. :)
[13:36:37] Obats: has joined #ruby
[13:39:43] absolutejam: has joined #ruby
[13:40:07] drnerdius: has joined #ruby
[13:43:48] DTZUZO: has joined #ruby
[13:49:58] deepreds1: has joined #ruby
[13:53:11] involans: has joined #ruby
[14:06:29] aupadhye: has joined #ruby
[14:08:34] akem-lnvo: has joined #ruby
[14:10:04] themsay: has joined #ruby
[14:11:53] ramfjord: has joined #ruby
[14:12:19] Obats: adam12: Yes, that's exactly what I am working on, checking the encoding of the variables. And yes, .render() is called :). I started using Ruby this morning though(sorry..). So I'm learning how to traverse an array with all kinds of types of data to print them, with the encoding if it's a string, etc..
[14:13:53] dantey: has joined #ruby
[14:18:46] za1b1tsu: has joined #ruby
[14:31:34] Inline: has joined #ruby
[14:41:52] Esa_: has joined #ruby
[14:47:03] orbyt_: has joined #ruby
[14:50:28] snowy: has joined #ruby
[15:01:09] Dbugger: has joined #ruby
[15:07:57] misterioso_: has joined #ruby
[15:11:17] sgen: has joined #ruby
[15:14:22] jenrzzz: has joined #ruby
[15:18:53] orbyt_: has joined #ruby
[15:21:59] anjen: has joined #ruby
[15:32:25] themsay: has joined #ruby
[15:39:36] Technodrome: has joined #ruby
[15:39:59] ruby_student: has joined #ruby
[15:45:44] ruby_student: Hi! Day 3 programming student here, can anyone point out what's wrong with my interpolation syntax. The array items are not appearing. "<#{tag_name} #{attributes[0]}=\"#{attributes[1]}\">#{yield}</#{tag_name}>"
[15:48:10] ixti: has joined #ruby
[15:52:22] deepreds1: has joined #ruby
[15:56:34] codefriar: has joined #ruby
[16:00:19] havenwood: ruby_student: Hi!
[16:01:03] havenwood: ruby_student: The interpolation looks good. Sanity check what `attributes` is?: p attributes
[16:01:55] havenwood: ruby_student: Is attributes an Array, for sure?: puts attributes.class
[16:02:15] havenwood: ruby_student: If it is, double check its size: puts attributes.size
[16:02:56] havenwood: ruby_student: (I'm suspicious it's a Hash, but just a wild guess.)
[16:06:01] Exuma: has joined #ruby
[16:09:19] ruby_student: yep, attributes is an array. I'm tinkering around with the code, something else should be causing the arrays to not return correctly. At least I now know the interpolation is correct, thanks havenwood!
[16:09:28] ruby_student: has left #ruby: ()
[16:12:00] AndreYuhai: has joined #ruby
[16:15:57] alem0lars: has joined #ruby
[16:16:46] alem0lars: has joined #ruby
[16:22:52] SanguineAnomaly: has joined #ruby
[16:27:19] involans: has joined #ruby
[16:34:45] gix: has joined #ruby
[16:43:36] jenrzzz: has joined #ruby
[16:51:22] joshua75: has joined #ruby
[16:52:30] joshua75: can anyone tell me if this is possible
[16:53:08] joshua75: im trying to set the IRB prompt mode using `IRB.conf[:PROMPT_MODE] = mode` where mode is a variable
[16:55:23] joshua75: the full code (except the config file where the variable is pulled from.) is at https://github.com/Myersj281/rbsh.git
[16:56:48] joshua75: has joined #ruby
[16:59:30] rshetty: has joined #ruby
[17:07:09] duderonomy: has joined #ruby
[17:26:31] lord4163: has joined #ruby
[17:27:49] s2013: has joined #ruby
[17:27:51] milkohol: has joined #ruby
[17:28:40] rshetty: has joined #ruby
[17:31:33] jenrzzz: has joined #ruby
[17:35:47] absolutejam: has joined #ruby
[17:40:02] zapata: has joined #ruby
[17:43:41] matled: has joined #ruby
[17:46:45] Nuck: has joined #ruby
[17:46:46] fowlduck: has joined #ruby
[17:46:49] zipkid: has joined #ruby
[17:55:15] akem-lnvo: has joined #ruby
[17:59:17] Iambchop: has joined #ruby
[18:10:29] absolutejam: has joined #ruby
[18:17:38] Exuma: has joined #ruby
[18:19:21] ramfjord: has joined #ruby
[18:22:24] oncall-pokemon: has joined #ruby
[18:25:20] xco: has joined #ruby
[18:29:33] mb^: has joined #ruby
[18:30:33] s2013: has joined #ruby
[18:47:32] snowy: has joined #ruby
[18:49:18] themsay: has joined #ruby
[18:50:36] schneider: has joined #ruby
[18:53:19] alem0lars: has joined #ruby
[18:56:15] Steap_: has joined #ruby
[19:03:55] cd: has joined #ruby
[19:17:27] tdy: has joined #ruby
[19:19:52] schne1der: has joined #ruby
[19:32:50] kaiser: has joined #ruby
[19:35:15] absolutejam: has joined #ruby
[19:37:07] queip: has joined #ruby
[19:39:52] crankharder: has joined #ruby
[19:44:22] kaiser0: has joined #ruby
[19:51:38] Technodrome: has joined #ruby
[19:51:44] involans: has joined #ruby
[20:02:34] xco: has joined #ruby
[20:04:22] manakanapa: has joined #ruby
[20:08:36] Nicmavr: has joined #ruby
[20:18:44] fphilipe: has joined #ruby
[20:20:32] bitwinery: has joined #ruby
[20:22:00] mynameisdebian: has joined #ruby
[20:22:09] orbyt_: has joined #ruby
[20:22:42] mynameisdebian: How do I text-join all members of an array with a comma, except those members that are nil?
[20:23:27] s2013: has joined #ruby
[20:23:35] canton7: what do you want to do with members that are nil? just exclude them entirely?
[20:24:53] hiroaki: has joined #ruby
[20:26:29] iNs: has joined #ruby
[20:34:53] ramfjord: mynameisdebian: ary.compact.join(",") do what you want?
[20:37:12] mynameisdebian: ramfjord, it does, thanks!
[20:37:58] mynameisdebian: definitely cleaner than .reject(&:blank?).join
[20:38:53] Norrin: what's the & do on that line?
[20:50:26] jenrzzz: has joined #ruby
[20:51:24] jinie: has joined #ruby
[20:53:55] leitz: has joined #ruby
[20:54:06] mozzarella: passes :blank? as block
[20:54:31] mozzarella: which gets .to_proc called upon
[21:14:40] sameerynho: has joined #ruby
[21:14:40] deepreds1: has joined #ruby
[21:18:36] snowy: has joined #ruby
[21:19:21] AndreYuhai: has joined #ruby
[21:19:59] AndreYuhai: Hey there, how do I throw an exception out of my function? Just like in Java like public int foo () throws ...
[21:22:41] tvw: has joined #ruby
[21:26:38] leftylink: is the question just about using the keyword `raise` ? or is it about signalling to some static analysis sytem that a function might raise? (answer to second question will depend on exactly what static analysis system)
[21:29:47] AndreYuhai: leftylink: Nope, to be more clear, I have a class called "Database" using the gem "Mysql2" and in that class I have a function called insert_into_table. So I am using this "Database" class in another class to insert some data into my table.
[21:30:10] AndreYuhai: But when the data is duplicate I get an exception. I want to pass this exception to the calling class
[21:30:31] leftylink: then doesn't that mean your question is in fact about the `raise` keyword?
[21:31:06] AndreYuhai: leftylink: So do I just rescue StandardError => e; raise e; end ?
[21:31:19] AndreYuhai: I mean inside the begin block of course
[21:36:10] queip: has joined #ruby
[21:37:35] s2013: has joined #ruby
[21:49:31] fphilipe: has joined #ruby
[21:50:51] DTZUZO: has joined #ruby
[21:51:31] Fernando-Basso: has joined #ruby
[21:51:48] ur5us: has joined #ruby
[21:58:22] kaiser0: has joined #ruby
[21:58:50] spiette: has joined #ruby
[22:07:24] themsay: has joined #ruby
[22:08:00] AndreYuhai: has joined #ruby
[22:15:32] ellcs: has joined #ruby
[22:15:58] AndreYuhai: has joined #ruby
[22:18:15] mynameisdebian: I use blocks = Array.new(20, {})
[22:18:16] mynameisdebian: to generate an array of empty Hashes, then blocks[0]["type"] = "context"
[22:18:16] mynameisdebian: and blocks is now an array of 20 Hashes, each Hash being {"type" => "context"} Any idea what's going on?
[22:19:22] brool: has joined #ruby
[22:21:32] baweaver: You want to use a block for those
[22:21:56] baweaver: Otherwise every default value is that hash
[22:21:57] baweaver: the same hash in fact
[22:21:58] baweaver: Array.new(20) { |i| {} }
[22:23:34] mynameisdebian: thanks, that works but I don't really get why
[22:23:59] baweaver: In your example it's using literally the same hash
[22:24:10] baweaver: The reason it works with things like 0 is because they cannot be mutated
[22:24:21] baweaver: Try it with a string or another array or an object
[22:30:04] ramfjord: has joined #ruby
[22:33:10] queip: has joined #ruby
[22:37:16] rafadc: has joined #ruby
[22:49:51] involans: has joined #ruby
[22:50:29] Technodrome: has joined #ruby
[22:51:26] ramfjord: has joined #ruby
[22:54:02] fphilipe: has joined #ruby
[23:02:22] s2013: has joined #ruby
[23:02:41] xco: has joined #ruby
[23:06:21] cd: has joined #ruby
[23:07:21] ramfjord: has joined #ruby
[23:10:18] amrx: has joined #ruby
[23:12:10] jls42: has joined #ruby
[23:15:16] kaiser0: has joined #ruby
[23:22:43] leitz: And look at the object_id.
[23:25:34] leitz: Well, I was going to ask a question, but I figured it out. :)
[23:25:50] henninb: has joined #ruby
[23:32:46] leitz: Is there a better way to make the form data in integer? https://github.com/makhidkarun/ftl_tools/blob/master/lib/ftl_tools/ship_builder.rb#L21-L22
[23:34:10] leitz: in/an integer
[23:34:55] Xeago_: has joined #ruby
[23:40:59] ixti: has joined #ruby
[23:43:11] defn: has joined #ruby
[23:45:47] leitz: Ah, just add .to_i to the @data(fetch blah blah).to_i
[23:48:07] snowy: has joined #ruby