« Back to channel list

#ruby - 16 July 2019

« Back 1 day Forward 1 day »
[00:05:55] MuffinPimp: has joined #ruby
[00:10:43] skryking: has joined #ruby
[00:18:43] giraffe: has joined #ruby
[00:19:12] tpendragon: has joined #ruby
[00:22:53] s2013: has joined #ruby
[00:23:55] bambanx: has joined #ruby
[00:30:39] DaRock: has joined #ruby
[00:37:11] ramfjord: has joined #ruby
[00:39:25] involans: has joined #ruby
[00:40:00] tf2ftw: has joined #ruby
[00:41:13] tf2ftw: has joined #ruby
[00:42:03] tf2ftw: has joined #ruby
[00:42:49] tf2ftw: has joined #ruby
[00:43:34] tf2ftw: has joined #ruby
[00:44:18] tf2ftw: has joined #ruby
[00:45:05] englishm: has joined #ruby
[00:49:59] greengriminal: has joined #ruby
[00:55:21] orbyt_: has joined #ruby
[00:57:35] ivlioioilvi: has joined #ruby
[00:58:06] s2013: has joined #ruby
[00:58:27] Thenekofell: has joined #ruby
[01:04:25] tdy: has joined #ruby
[01:05:48] fphilipe_: has joined #ruby
[01:15:45] Exuma: has joined #ruby
[01:28:42] chalkmonster: has joined #ruby
[01:42:47] ramfjord: has joined #ruby
[01:47:23] ivlioioilvi: has joined #ruby
[01:47:57] duderonomy: has joined #ruby
[01:52:13] chalkmonster: has joined #ruby
[02:03:18] Thenekofell: has joined #ruby
[02:13:59] Goon6: has joined #ruby
[02:16:13] tdy: has joined #ruby
[02:18:33] aphprentice__: has joined #ruby
[02:19:40] fphilipe_: has joined #ruby
[02:25:45] chalkmonster: has joined #ruby
[02:45:10] _whitelogger: has joined #ruby
[02:47:05] insu: has joined #ruby
[03:08:15] s3nd1v0g1us: has joined #ruby
[03:16:29] AlHafoudh: has joined #ruby
[03:34:03] ivlioioilvi: has joined #ruby
[03:41:20] gix-: has joined #ruby
[03:47:57] ivlioioilvi: has joined #ruby
[03:50:42] Technodrome: has joined #ruby
[03:55:01] ramfjord: has joined #ruby
[03:58:04] jarred: has joined #ruby
[04:08:17] Nicmavr: has joined #ruby
[04:08:27] ramfjord: has joined #ruby
[04:12:47] moei: has joined #ruby
[04:14:50] duderonomy: has joined #ruby
[04:14:52] cammellos: has joined #ruby
[04:21:11] Technodrome: has joined #ruby
[04:33:30] sk_c: has joined #ruby
[04:33:31] matheusmoreira: has joined #ruby
[04:42:06] ramfjord: has joined #ruby
[04:51:40] fphilipe_: has joined #ruby
[04:52:31] za1b1tsu: has joined #ruby
[04:56:03] jenrzzz: has joined #ruby
[05:01:54] absolutejam: has joined #ruby
[05:03:53] matheusmoreira: has joined #ruby
[05:08:49] ramfjord: has joined #ruby
[05:13:45] Thenekofell: has joined #ruby
[05:18:50] jenrzzz: has joined #ruby
[05:38:28] exmortus: has joined #ruby
[05:39:57] sauvin: has joined #ruby
[05:40:16] akem-lnvo: has joined #ruby
[05:40:49] staticx: has joined #ruby
[05:44:05] conta: has joined #ruby
[05:44:45] ivlioioilvi: has joined #ruby
[05:55:24] Exuma: has joined #ruby
[05:59:39] Mrgoose8: has joined #ruby
[06:01:54] conta1: has joined #ruby
[06:03:22] akem_lnvo: has joined #ruby
[06:04:13] ivlioioilvi: has joined #ruby
[06:05:11] fphilipe: has joined #ruby
[06:06:29] matheusmoreira: has joined #ruby
[06:10:55] tuor: has joined #ruby
[06:11:39] rippa: has joined #ruby
[06:16:30] schne1der: has joined #ruby
[06:16:52] ivlioioilvi: has joined #ruby
[06:20:04] jenrzzz: has joined #ruby
[06:25:13] alem0lars: has joined #ruby
[06:31:16] fphilipe: has joined #ruby
[06:43:32] aupadhye: has joined #ruby
[06:45:32] matheusmoreira: has joined #ruby
[06:54:29] absolutejam: has joined #ruby
[06:57:51] GodFather: has joined #ruby
[06:58:13] TomyWork: has joined #ruby
[06:58:48] Thenekofell: has joined #ruby
[07:05:19] ramfjord: has joined #ruby
[07:05:57] GodFather: has joined #ruby
[07:06:38] queip: has joined #ruby
[07:07:42] Technodrome: has joined #ruby
[07:13:11] moei: has joined #ruby
[07:17:02] ramfjord: has joined #ruby
[07:18:12] lord4163: has joined #ruby
[07:21:49] schne1der: has joined #ruby
[07:30:52] Technodrome: has joined #ruby
[07:33:30] ellcs: has joined #ruby
[07:41:12] fphilipe: has joined #ruby
[07:44:46] lxsameer: has joined #ruby
[07:53:40] ferhaty: has joined #ruby
[07:57:42] Irfan: has joined #ruby
[07:57:56] Irfan: has left #ruby: ()
[08:08:57] Sylario: has joined #ruby
[08:15:47] ramfjord: has joined #ruby
[08:17:44] duderonomy: has joined #ruby
[08:18:47] duderonomy: has joined #ruby
[08:20:04] duderonomy: has joined #ruby
[08:20:46] duderonomy: has joined #ruby
[08:21:33] queip: has joined #ruby
[08:21:39] duderonomy: has joined #ruby
[08:22:21] duderonomy: has joined #ruby
[08:23:18] duderonomy: has joined #ruby
[08:36:24] suukim: has joined #ruby
[08:45:50] absolutejam: has joined #ruby
[08:46:56] nerdius: has joined #ruby
[08:56:55] ramfjord: has joined #ruby
[08:57:50] skarlso: does anyone know what this sentence in File.link means?
[08:57:51] skarlso: https://ruby-doc.org/core-2.5.0/File.html#method-c-link
[08:58:02] skarlso: Here... saying Not available on all platforms.
[08:58:19] skarlso: because it looks like this method is not working the same way on linux and OSX
[08:58:27] skarlso: since osx is probably using APSF
[08:58:34] skarlso: But I have no clue as to what to use instead of it?
[08:59:37] Thenekofell: has joined #ruby
[09:02:07] ellcs: has joined #ruby
[09:17:59] al2o3-cr: has joined #ruby
[09:36:05] fphilipe: has joined #ruby
[09:41:28] absolutejam: has joined #ruby
[09:45:06] fphilipe: has joined #ruby
[09:51:05] xco: has joined #ruby
[09:54:02] queip: has joined #ruby
[10:00:28] Technodrome: has joined #ruby
[10:09:25] conta: has joined #ruby
[10:11:57] Technodrome: has joined #ruby
[10:12:47] leitz: has joined #ruby
[10:15:18] leitz: Okay, newbie question. My plan is to build a gem with a couple of programs that can be run from anywhere on the filesystem. For example, put in /usr/local/bin. How do I ensure the path to the data files needed are always set for the programs?
[10:27:33] jenrzzz: has joined #ruby
[10:29:35] fphilipe: has joined #ruby
[10:31:51] skarlso: you use ruby's environment instead of a binary under /usr/local/bin to find binaries ,or you create a shim which loads your installed gem and executes some code from there
[10:38:34] fphilipe: has joined #ruby
[10:39:23] absolutejam1: has joined #ruby
[10:42:57] suukim: has joined #ruby
[10:47:41] fphilipe: has joined #ruby
[10:57:27] ramfjord: has joined #ruby
[10:59:35] fphilipe: has joined #ruby
[11:01:05] tpanarch1st: has joined #ruby
[11:01:36] skarlso: has joined #ruby
[11:03:02] conta1: has joined #ruby
[11:08:04] leitz: Okay, seems like I have some reading and figuring out to do. Thanks!
[11:08:37] fphilipe: has joined #ruby
[11:11:20] tuor: Hi, I loaded a YAML file into an object called 'lxc'. It contains a list containers and a lot of information fields about the containers. Know I would like to look for keys in the object. LXC is an arary, but is shurely containing other arrays, hashes, strings. I would like to print the array entry which contains a hash with a key name matching a regex. I tried to google recursiv lookup but it seems, it's more complicated then I thought.
[11:16:08] Cork: has joined #ruby
[11:18:22] tuor: I tried to list all names like this, but I get only one name: `names = Array.new; lxc.each { |item| names =+ item['container']['name'] }`
[11:19:29] tuor: ah with map instead of each it works. :) I have to check documentation about map and each...
[11:21:36] skarlso: also, you might be looking for https://makandracards.com/makandra/41180-ruby-2-3-brings-array-dig-and-hash-dig
[11:21:45] skarlso: Array#dig or Hash#dig
[11:21:50] skarlso: which is available since 2.3
[11:26:09] tuor: I'll read your link. :) thx.
[11:26:27] tuor: I found now a way (with try and error :) )
[11:26:32] tuor: imgs = Hash.new; lxc.map { |item| names[item['container']['name']]=item['container']['config']['image.description'] }
[11:26:53] tuor: but that's not very readable in my opinion^^
[11:32:07] tuor: i tried dig and it's longer but more readable now: `imgs = Hash.new; lxc.map { |item| name=item.dig('container', 'name'); img=item.dig('container', 'config', 'image.description'); imgs[name]=img }`
[11:36:40] cellmaker: has joined #ruby
[11:39:07] donofrio: has joined #ruby
[11:47:54] Selvaraj: has joined #ruby
[11:48:15] ZAJDAN: has joined #ruby
[11:50:04] ZAJDAN: in ruby 2.3.0 I use 'system('mkdir', '-p', File.join("#{path}/SAP"), File.join("#{path}/CAD"), File.join("#{path}/NEST"), File.join("#{path}/ORDER") ) unless File.exists?(@commission.commission_num)' in Ruby 2.3.3 is problem..returns: TypeError (no implicit conversion of Fixnum into String)
[11:52:34] queip: has joined #ruby
[11:55:58] ZAJDAN: I would like to use something like: system('mkdir -p test/{SAP,CAD,NEST,ORDER}') .but it does not create the subfolders
[12:12:37] jenrzzz: has joined #ruby
[12:14:32] xco: has joined #ruby
[12:21:27] AJA4350: has joined #ruby
[12:31:56] yalue: has joined #ruby
[12:32:55] xco: has joined #ruby
[12:45:35] phaul: Any reason to fork sub-processes/shells for this? I would just use the Dir class
[12:45:54] phaul: &ri Dir.mkdir, ZAJDAN
[12:45:54] rubydoc: ZAJDAN: https://ruby-doc.org/core-2.6/Dir.html#method-c-mkdir
[12:47:36] phaul: you are welcome
[12:48:03] tdy: has joined #ruby
[12:48:52] galaxie: has joined #ruby
[12:50:38] ZAJDAN: in my case the probelm was here: https://dpaste.de/ZXcX
[12:55:58] phaul: https://gist.github.com/phaul/9fddfc54dbfb6ffcc8ba31bdd6c1253d ? (I have not tested it)
[12:56:57] reber: has joined #ruby
[12:58:00] phaul: if you are pasting path segments together into a string like "#{path}/CAD" there isn't much point in calling File.join on it.. It would just give back the same string
[12:58:45] phaul: the point would be to pass the segments to join as separate arguments, so it can use the system specific path separator
[13:11:21] Swyper: has joined #ruby
[13:12:16] involans: has joined #ruby
[13:21:15] queip: has joined #ruby
[13:21:43] mkaito_: has joined #ruby
[13:22:53] ZAJDAN: phaul: thank You
[13:34:06] tf2ftw: has joined #ruby
[13:34:10] RiPuk: has joined #ruby
[13:36:08] Swyper: has joined #ruby
[13:36:46] jmcgnh_: has joined #ruby
[13:48:52] Rapture: has joined #ruby
[13:54:56] Swyper: has joined #ruby
[13:58:30] ElFerna: has joined #ruby
[13:58:44] Swyper: has joined #ruby
[14:01:14] alem0lars_: has joined #ruby
[14:05:07] schne1der: has joined #ruby
[14:09:14] alem0lars__: has joined #ruby
[14:09:25] BrianWGray: has joined #ruby
[14:13:48] drnerdius: has joined #ruby
[14:13:57] Bish: how do people regulary encode fields in csv that have multiple values
[14:13:58] Bish: like an array
[14:14:26] Bish: in this case it's string it could be comma separated itself, but that's od
[14:15:13] ryouba: Bish: so use quotation
[14:15:19] Bish: well, okay
[14:16:05] havenwood: Bish: Switch to JSON? :P
[14:16:27] Bish: well, as you can expect csv wasn't my choice, and json is not making me happy in any way either
[14:16:37] Bish: well, in some ways, but not all
[14:18:29] Bish: also how do you encode much data with json?
[14:18:36] Bish: one big array? one document per line?
[14:21:52] havenwood: Bish: Folk do it both ways. In WireShark, for example, the .ek format is a JSON doc per line. That can be reasonable for *huge* run-on formats.
[14:22:24] Bish: i've done that in private a lot of time where nobody was watching
[14:22:31] Bish: never expected it to be used somewhere as "format"
[14:26:51] involans: has joined #ruby
[14:27:19] absolutejam: has joined #ruby
[14:28:49] aupadhye: has joined #ruby
[14:29:04] Azure: has joined #ruby
[14:34:05] lucasb: has joined #ruby
[14:39:09] unixcat: has joined #ruby
[14:40:58] Swyper: has joined #ruby
[14:42:10] involans: has joined #ruby
[14:43:22] Dbugger: has joined #ruby
[14:44:01] Swyper: has joined #ruby
[14:46:12] icholy: has joined #ruby
[14:46:30] icholy: when using "xmlrpc/server" is there a way to return a different http status code than 200?
[14:47:16] Bish: ACTION would rather use csv
[14:47:20] Bish: ACTION maybe not for rpc
[14:47:35] icholy: Bish: it's legacy code
[14:48:58] havenwood: icholy: https://github.com/ruby/xmlrpc/blob/a3163d39d4517baf5e974d097a53f3405d590e80/lib/xmlrpc/server.rb#L446
[14:49:16] Bish: yeah you said xml already :p
[14:49:41] havenwood: icholy: https://github.com/ruby/xmlrpc/blob/a3163d39d4517baf5e974d097a53f3405d590e80/lib/xmlrpc/server.rb#L493
[14:50:26] drnerdius: has joined #ruby
[14:55:52] Technodrome: has joined #ruby
[14:56:35] AlHafoudh: has joined #ruby
[14:57:54] ramfjord: has joined #ruby
[14:58:18] AlHafoudh: has joined #ruby
[15:20:35] Esa_: has joined #ruby
[15:33:16] paraxial2: has joined #ruby
[15:34:31] ivlioioilvi: has joined #ruby
[15:36:26] jenrzzz: has joined #ruby
[15:36:41] ivlioioilvi: has joined #ruby
[15:43:06] Technodrome: has joined #ruby
[15:45:53] icholy: havenwood: so no?
[15:51:20] icholy: has left #ruby: ()
[15:52:25] tf2ftw: has joined #ruby
[15:59:22] fphilipe: has joined #ruby
[16:06:51] matheusmoreira: has joined #ruby
[16:11:37] openstruct: has joined #ruby
[16:13:00] openstruct: I've been reading through all the "don't use Ruby timeout" blog posts and I'm not sure how I see that it's unsafe if I'm explicitly rescuing Timeout::Error every time I use it?
[16:13:56] openstruct: Is it still problematic because it can cause a client from a connection pool to be corrupted?
[16:18:42] DTZUZO: has joined #ruby
[16:24:14] involans: has joined #ruby
[16:25:13] duderonomy: has joined #ruby
[16:28:38] leeijaw: has joined #ruby
[16:29:35] leeijaw: has left #ruby: ()
[16:45:23] akem-lnvo: has joined #ruby
[16:47:58] DTZUZO: has joined #ruby
[16:48:51] duderonomy: has joined #ruby
[16:49:32] ramfjord: has joined #ruby
[16:51:36] hiroaki: has joined #ruby
[16:56:59] tf2ftw: has joined #ruby
[17:05:55] jenrzzz: has joined #ruby
[17:12:36] absolutejam: has joined #ruby
[17:18:49] wald0: has joined #ruby
[17:22:36] pygmypuppy: has joined #ruby
[17:31:43] conta2: has joined #ruby
[17:33:33] RougeRRR: has joined #ruby
[17:35:15] RougeRRR: curious which of these is the better way
[17:35:30] RougeRRR: i far prefer the look of the 2nd one, but iterating over a 2 item array feels wrong
[17:44:36] absolutejam: has joined #ruby
[17:45:31] jenrzzz: has joined #ruby
[17:49:01] DTZUZO: has joined #ruby
[17:55:23] ramfjord: has joined #ruby
[17:56:20] gix: has joined #ruby
[18:00:50] fphilipe: has joined #ruby
[18:04:53] ellcs: has joined #ruby
[18:05:03] orbyt_: has joined #ruby
[18:05:45] ellcs: has joined #ruby
[18:08:16] queip: has joined #ruby
[18:15:01] xco: has joined #ruby
[18:15:24] rafadc: has joined #ruby
[18:22:45] jenrzzz: has joined #ruby
[18:25:54] queip: has joined #ruby
[18:26:30] xco: has joined #ruby
[18:43:12] fluxAeon: has joined #ruby
[18:55:14] tf2ftw: has joined #ruby
[18:58:00] alem0lars: has joined #ruby
[19:02:13] LtHummus: has joined #ruby
[19:09:59] deepredsky: has joined #ruby
[19:20:55] absolutejam: has joined #ruby
[19:21:35] plujon: has joined #ruby
[19:22:55] Azure: has joined #ruby
[19:27:02] Azure: has joined #ruby
[19:35:33] Galopin: has joined #ruby
[19:35:43] Galopin: has left #ruby: ()
[19:38:20] jackChronicle: has joined #ruby
[19:38:32] Azure: has joined #ruby
[19:38:58] jackChronicle: has left #ruby: ()
[19:39:23] plujon: I'm interested in embedding ruby in a C program. Where can I find good documentation for rb_* such as rb_load ?
[19:40:28] ascarter: has joined #ruby
[19:41:34] plujon: I'm looking for rb_eval or something similar, that would allow me to evaluate a script that is embedded in the executable as a plain old C string.
[19:42:09] plujon: Oh! I see rb_eval_string in ruby.h; I'll give that a try.
[19:42:30] involans: has joined #ruby
[19:45:18] sameerynho: has joined #ruby
[19:46:45] fphilipe: has joined #ruby
[19:47:28] plujon: It works! Now, to figure out how to compile the thing on Windows...
[19:49:00] tf2ftw: has joined #ruby
[19:50:19] Azure: has joined #ruby
[19:54:36] conta2: has joined #ruby
[19:59:08] tf2ftw: has joined #ruby
[20:07:45] involans: has joined #ruby
[20:07:46] mochiyoda: has joined #ruby
[20:09:56] Goon6: has joined #ruby
[20:14:14] d^sh: has joined #ruby
[20:16:58] jenrzzz: has joined #ruby
[20:17:36] Technodrome: has joined #ruby
[20:31:13] jenrzzz: has joined #ruby
[20:34:33] mochiyoda: has left #ruby: ("Konversation terminated!")
[20:36:39] tf2ftw: has joined #ruby
[20:39:34] queip: has joined #ruby
[20:40:41] Thenekofell: has joined #ruby
[20:48:50] oncall-pokemon: has joined #ruby
[20:50:32] codefriar: has joined #ruby
[20:52:20] involans: has joined #ruby
[20:55:02] codefriar: has joined #ruby
[21:02:23] crankharder: has joined #ruby
[21:07:38] ur5us: has joined #ruby
[21:09:47] klaas: has joined #ruby
[21:18:33] gix: has left #ruby: ()
[21:19:39] jenrzzz: has joined #ruby
[21:25:10] DTZUZO: has joined #ruby
[21:37:54] Fernando-Basso: has joined #ruby
[21:38:54] bitwinery: has joined #ruby
[21:41:59] ramfjord: has joined #ruby
[21:46:49] ZummiG777: has joined #ruby
[21:49:02] fphilipe: has joined #ruby
[21:53:53] sameerynho: has joined #ruby
[21:58:21] ledhed2222: has joined #ruby
[21:58:49] evdubs: has joined #ruby
[21:59:29] ledhed2222: i just wrote a lil script where i wanted to trap some signals. #til about Signal.trap as opposed to rescuing SignalException and re-raising. Ruby is the only lang I’ve ever worked with that exposes signals as exceptions in this way. I’m curious whether anyone has a rule-of-thumb for which approach to take when trapping signals?
[22:00:18] adam12: ledhed2222: Can't say I've ever seen SignalException rescued in the wild before...
[22:01:57] hi: has joined #ruby
[22:02:11] ledhed2222: yeah i haven’t seen any ruby code in the wild that traps signals in the first place. so you think that one should just use Signal.trap 100% of teh time?
[22:04:11] sgen: has joined #ruby
[22:05:28] adam12: ledhed2222: I've only see Signal.trap used. I'm presuming there's a reason for it.
[22:06:47] ledhed2222: yeah that makes sense. it was always funky to me the way Ruby wraps sigs in exceptions. thanks dude!
[22:12:06] Exuma: has joined #ruby
[22:13:15] involans: has joined #ruby
[22:16:57] jenrzzz: has joined #ruby
[22:17:08] mochiyoda: has joined #ruby
[22:40:43] jinie: has joined #ruby
[22:42:01] al2o3-cr: has joined #ruby
[22:43:50] brool: has joined #ruby
[22:48:50] noobineer: has joined #ruby
[22:50:20] jenrzzz: has joined #ruby
[22:54:41] crankharder: has joined #ruby
[22:58:26] AJA4350: has joined #ruby
[23:01:08] AJA4351: has joined #ruby
[23:03:28] skryking: has joined #ruby
[23:05:27] fuzzface: has joined #ruby
[23:05:32] brool: in a sinatra modular app, can i access the app object's fields from a template?
[23:05:42] brool: or do i have to pass them into :locals somehow
[23:05:48] AJA4350: has joined #ruby
[23:07:19] skryking: has joined #ruby
[23:11:26] adam12: brool: Can you share some of your code? I'm not sure what an app object's fields are...
[23:12:50] adam12: brool: The template (view) is rendered in the scope of the request. If you assign an instance variable, that will be available as well (instead of using locals). Using locals is more explicit tho and can be nicer in teams to know what's available in a view.
[23:20:09] queip: has joined #ruby
[23:20:23] brool: ok i was putting my instance variable assignment in the wrong scope
[23:20:32] brool: i had it outside of any method
[23:22:32] AJA4350: has joined #ruby
[23:35:52] Thenekofell: has joined #ruby
[23:42:11] leitz: has joined #ruby
[23:42:27] jenrzzz: has joined #ruby
[23:43:21] leitz: I'm building a gem that runs a sinatra app. The program uses data files. How do I arrange the gem install location so the program can find the data files?
[23:43:46] leitz: Newbie question, I know. Happy to have a pointer to something to read.
[23:43:56] Averna: has joined #ruby
[23:44:37] agent_white: has joined #ruby
[23:48:19] gell5: has joined #ruby
[23:52:29] fphilipe: has joined #ruby