« Back to channel list

#ruby - 04 October 2018

« Back 1 day Forward 1 day »
[00:03:11] tdy: has joined #ruby
[00:06:53] themsay: has joined #ruby
[00:18:01] bmurt: has joined #ruby
[00:22:02] ansraliant: has joined #ruby
[00:35:01] bmurt: has joined #ruby
[00:44:29] orbyt_: has joined #ruby
[00:46:12] ansraliant: installing gems locally, I have found that in the bin directory the files are names bundler.ruby2.5, which bash doesn't get when I type bundler. I have to add .ruby2.5. Has anyone experience something similar?
[00:46:40] helpa: has joined #ruby
[00:51:24] gnufied: has joined #ruby
[00:54:22] havenwood: ansraliant: RubyGems has a --format-executable flag that appends the Ruby version to gem executables, but it'd just add `25` not `.ruby25`.
[00:54:39] ansraliant: has joined #ruby
[00:55:04] gnufied__: has joined #ruby
[01:08:49] kawaicha00s: has joined #ruby
[01:14:09] chouhoulis: has joined #ruby
[01:20:40] dinfuehr: has joined #ruby
[01:22:18] tAn: has joined #ruby
[01:24:14] cagomez: has joined #ruby
[01:32:08] chouhoulis: has joined #ruby
[01:42:56] gnufied__: has joined #ruby
[01:43:59] pskosinski: has joined #ruby
[01:51:32] orbyt_: has joined #ruby
[01:53:05] twe4ked: has joined #ruby
[01:56:08] mrush: has joined #ruby
[02:00:28] gnufied__: has joined #ruby
[02:00:58] cliluw: has joined #ruby
[02:02:43] esrse: has joined #ruby
[02:04:42] dtzuzu: has joined #ruby
[02:09:02] elphe: has joined #ruby
[02:41:29] weaksauce: has joined #ruby
[02:45:19] rspades_: has joined #ruby
[02:46:34] DTZUZO_: has joined #ruby
[02:46:58] ivanskie: has joined #ruby
[02:47:51] tdy: has joined #ruby
[02:50:53] darkhanb: has joined #ruby
[02:57:54] dbz: has joined #ruby
[03:01:23] ivanskie: has joined #ruby
[03:04:24] dbz: has joined #ruby
[03:05:18] Xeago: has joined #ruby
[03:06:17] ivanskie: has joined #ruby
[03:06:34] gnufied: has joined #ruby
[03:09:53] braincrash: has joined #ruby
[03:35:22] dar123: has joined #ruby
[03:35:40] rspades_: has joined #ruby
[03:35:40] ivanskie: has joined #ruby
[03:49:54] za1b1tsu: has joined #ruby
[03:51:42] tAn: has joined #ruby
[03:55:50] kapil____: has joined #ruby
[04:06:15] mr_rich101: has joined #ruby
[04:13:02] akemot: has joined #ruby
[04:16:03] i8igmac: when you do loops like {|x|} vs do |x| is there a difference ?
[04:16:12] i8igmac: variables inside of {|x| var=1} are only set inside?
[04:16:24] i8igmac: do not exist outside
[04:16:37] alicef: has joined #ruby
[04:17:59] akemot: has joined #ruby
[04:18:58] havenwood: i8igmac: the difference between those two forms of blocks is just precedence
[04:19:05] havenwood: i8igmac: http://blog.plataformatec.com.br/2014/07/ruby-blocks-precedence/
[04:20:52] Exagone313: has joined #ruby
[04:21:49] xall: has joined #ruby
[04:26:59] i8igmac: ps aux | grep rails => Pid 666
[04:27:07] i8igmac: cant be good
[04:28:08] duderonomy: has joined #ruby
[04:45:33] dellavg_: has joined #ruby
[04:48:34] Hobbyboy: has joined #ruby
[05:02:53] reber: has joined #ruby
[05:03:55] leafyleong: has joined #ruby
[05:04:02] dbz: has joined #ruby
[05:16:00] sauvin: has joined #ruby
[05:19:57] rspades_: has joined #ruby
[05:20:01] mniip: has joined #ruby
[05:23:47] Xiti: has joined #ruby
[05:33:19] MoritaShinobu: has joined #ruby
[05:38:37] dhollinger: has joined #ruby
[06:08:18] stoffus: has joined #ruby
[06:10:19] nowhere_man: has joined #ruby
[06:19:27] dar123: has joined #ruby
[06:21:47] tAn: has joined #ruby
[06:30:55] tAn: has joined #ruby
[06:46:14] dbz: has joined #ruby
[06:53:05] aupadhye: has joined #ruby
[07:04:26] MoritaShinobu: has joined #ruby
[07:06:55] PasNox: has joined #ruby
[07:10:59] clemens3: has joined #ruby
[07:11:18] tdy: has joined #ruby
[07:20:56] phaul: has joined #ruby
[07:21:12] za1b1tsu: so I have main.rb, lib/bo.rb, lib/data_service.rb. And main.rb requires bo.rb and data_service.rb, but data_service.rb requires bo.rb as well. Do I put 'require_relative bo' in main.rb but also in lib/data_service.rb so they can be independent? Or just in main.rb. What is the good practise here? Having 'require_relative the_same_thing' looks chaotic
[07:21:40] za1b1tsu: in multiple files I mean
[07:22:54] yohji: has joined #ruby
[07:23:05] aufi: has joined #ruby
[07:23:13] za1b1tsu: https://paste.ofcode.org/35VsjQpRCsBBDLz2QKbUtDJ
[07:26:11] jinie: has joined #ruby
[07:27:22] duderonomy: has joined #ruby
[07:30:28] idiocrash: has joined #ruby
[07:32:28] dbz: has joined #ruby
[07:32:38] Beams: has joined #ruby
[07:41:04] sameerynho: has joined #ruby
[07:44:18] duderonomy: has joined #ruby
[07:45:33] raulp: has joined #ruby
[07:48:56] Pupeno: has joined #ruby
[07:49:18] Pupeno: Are there any guides about how to build Ruby on Windows?
[07:52:15] pskosinski: has joined #ruby
[07:55:45] trif: has joined #ruby
[07:57:33] zapata: has joined #ruby
[08:04:23] lxsameer: has joined #ruby
[08:07:32] LiftLeft2: has joined #ruby
[08:08:04] roshanavand: has joined #ruby
[08:12:00] elphe: has joined #ruby
[08:14:16] ua: has joined #ruby
[08:14:33] MIR100: has joined #ruby
[08:15:30] MIR100: has joined #ruby
[08:19:45] Charliebr73: has joined #ruby
[08:25:57] roshanavand: has joined #ruby
[08:27:08] Bish: has joined #ruby
[08:27:23] Bish: is there a way to overwrite a method definition without changing the parameters?
[08:33:41] Pupeno: What do you mean by without changing the parameters?
[08:33:56] Bish: well if i don't want to change the behaviour of the method and just "add" things
[08:34:05] Bish: i do def method(*args,&block)
[08:34:14] Bish: which changes the parameter count from x to undefined
[08:35:15] Pupeno: If you are overriding the method you are changing the behaviour of the method. Are you trying to wrap an existing method with your own functionality?
[08:35:33] Bish: something like, i don't want to change the behaviour at all
[08:35:39] Bish: just emit an event when it's called or something
[08:36:43] Pupeno: I'm sorry, I was thinking of replacing the method, not overriding.
[08:37:33] Bish: what's the difference?
[08:37:38] Pupeno: I don't think it's possible to define a method with def and have it have the same arguments as the one in the parent class.
[08:38:19] yohji: has joined #ruby
[08:38:43] Bish: well it's possible with weird hacks like eval
[08:38:48] Pupeno: In Ruby you can do pretty much whatever you want, so, you can write class Object; def to_s; end; end and re-define the the to_s method in the Object class.
[08:39:20] Bish: yeah you can call super in there, it's pretty much equivalent to inheritance.. isn't it?
[08:39:33] Pupeno: Yes, you can inspect the method in the parent class, find how many arguments it has, and create a new method with the same amount of arguments, but I don't think this is worthy.
[08:40:02] Pupeno: What I just described with Object is not inheritance, it's opening up an existing class and modifying it.
[08:40:17] Bish: but they're pretty much equivalent.. aren't they
[08:40:22] Bish: if not: what's different?
[08:40:57] Pupeno: No. There's no inheritance at play there. The moment you do that, every object in the system will have a new implementation of that method IIRC.
[08:41:23] Pupeno: Inheritance would doing class MyClass < Object ; def to_s....
[08:41:40] Pupeno: So there's a class called MyClass with a to_s method.
[08:41:47] Bish: yeh, i know.. but that's jsut like redeininfg to_s of the class
[08:41:48] Bish: isn't it?
[08:42:14] LiftLeft2: has joined #ruby
[08:42:24] Pupeno: It is redefining to_s for that class, yes. It's called monkey-patching and it's generally frowned upon because it's messy and dangerous.
[08:42:59] Pupeno: You can completely ignore it... I just missinterpreted your question as you doing monkey-patching, instead of proper inheritance overriding.
[08:43:36] Bish: oh, i see
[08:43:44] rebreak: has joined #ruby
[08:44:45] Pupeno: Why are you trying to preserve the amount of arguments?
[08:44:57] Bish: just because of error messages,, for example
[08:45:08] Bish: but i guess i could just through argument errors
[08:45:53] Pupeno: Why not just hard-code the argument and argument names to match the parent's class's method?
[08:46:29] Bish: puuh, because it stops working when the gem gets updated?
[08:46:31] Bish: had this several times
[08:47:34] Pupeno: Yeah, that's what I thought. I see your point.
[08:47:34] rafadc: has joined #ruby
[08:48:31] Pupeno: If you get *args and then pass it to the method, and it doesn't match the new amount of arguments, do you get an error that's hard to understand? I can't remember.
[08:50:36] Pupeno: Another possibilty is to check, on-load-time, whether the amount of arguments of the parent class is what you expected when writing your code, and if it's not, fail to load your class with a descriptive error message about tweaking the class. Not the same as matching the parent method.
[08:50:54] Pupeno: It's possible there's another solution that I'm forgetting about. I just came back to Ruby after a while.
[08:52:08] tdy: has joined #ruby
[08:53:36] Nicmavr: has joined #ruby
[08:55:25] rafadc: The error you get is ArgumentError: wrong number of arguments
[08:56:53] elphe: has joined #ruby
[08:58:50] dogweather: has joined #ruby
[09:07:22] wildermind: has joined #ruby
[09:14:34] Pupeno: This channel seems very quiet compared to other programming languages. Are Rubists hanging out somewhere else?
[09:15:17] phaul: yeah #elixir :)
[09:15:21] phaul: ACTION ducks
[09:16:19] zenspider: Pupeno: it's 2am pacific time... so...
[09:18:27] Pupeno: zenspider: take a look at #python, 2am pacific time and it's busting with activity.
[09:18:30] Mark22kk: has joined #ruby
[09:19:20] Pupeno: I know the Python community is biggen than Ruby, but the discrepancy in activity seems bigger, so, I'm wondering if people moved to Slack or something.
[09:21:26] thebigj: has joined #ruby
[09:22:10] sheepman: has joined #ruby
[09:29:26] alem0lars: has joined #ruby
[09:29:50] thebigj: I am using Jekyll for my blog. I started with Minimal theme provided by them.
[09:30:17] thebigj: I am expecting help to find other ways of finding the theme.
[09:30:38] thebigj: Are there any more visually appearing theme than the default theme?
[09:30:45] thebigj: Please share it with me.
[09:31:07] thebigj: Please guide me what are the appropriate ways to find Jekyll themes
[09:31:40] zenspider: thebigj: have you at least googled it?
[09:33:01] thebigj: zenspider: Thanks for the reply. Yes, I did. I am not happy with the ranked sites by Google.
[09:33:15] thebigj: zenspider: Many from there were giving broken themes
[09:34:03] ur5us: has joined #ruby
[09:54:27] AJA4350: has joined #ruby
[10:06:59] jkprg: has joined #ruby
[10:07:21] elphe: has joined #ruby
[10:13:10] xfbs: has joined #ruby
[10:18:22] Bish: Pupeno: rubyist are actaully working instead of being in chat all the time :p
[10:20:17] Bish: and python is busy fixing 2.7 vs 3 issues
[10:20:26] Bish: or unicode
[10:21:35] dalpo: thebigj: https://github.com/topics/jekyll-theme
[10:24:42] tdy: has joined #ruby
[10:27:16] TomyLobo: has joined #ruby
[10:30:38] za1b1tsu: realistically is there anyway to avoid 'require_relative' duplicates when making a gem?
[10:38:14] zenspider: za1b1tsu: similar to earlier today: if you haven't measured, you don't care.
[10:42:58] dbz: has joined #ruby
[10:52:22] catphish: has joined #ruby
[10:54:13] catphish: i'm trying to stream a large quantity of data to a command using net::ssh, struggling to find an example, does anyone happen to know how to do this?
[10:55:50] rspades_: has joined #ruby
[10:56:11] AJA4350: has joined #ruby
[10:56:25] Bish: so it's many datas not big data?
[10:56:58] catphish: Net::SSH::Connection::Channel#send_data buffers data to be sent to the channel, which is perfect, but i don't see a callback to let me know when more data is wanted
[10:57:01] Bish: catphish: what are you doing.. invoking a process and want to get it's stdout?
[10:57:15] roshanavand: has joined #ruby
[10:57:21] catphish: no, i want to send data to its stdin
[10:57:32] Bish: ah. then just do it? i mean.. what are you expecting..
[10:57:37] Bish: something like stdin is ready to get data?
[10:57:56] catphish: well the problem is that i don't want to buffer all the data in RAM at once
[10:58:05] catphish: so i want to send a chunk any time the buffer gets empty
[10:58:39] catphish: so i want to send a chunk, wait for it to clear, then send more
[10:59:13] catphish: i assume things like net::sftp do this somehow
[11:00:12] n13z: has joined #ruby
[11:01:49] catphish: all the examples i find are just sending really small amounts of data all at once to Net::SSH::Connection::Channel#send_data
[11:03:02] themsay: has joined #ruby
[11:05:40] catphish: ah got it, looks like i can monitor Net::SSH::Connection::Channel#output which is the output buffer on each invocation of #on_process
[11:11:43] rspades: has joined #ruby
[11:19:49] themsay: has joined #ruby
[11:29:07] Kilo`byte: has joined #ruby
[11:29:49] Tempesta: has joined #ruby
[11:32:09] roshanavand: has joined #ruby
[11:43:29] schneider: has joined #ruby
[11:51:45] catphish: yep that works fine :)
[11:52:15] catphish: ch.on_process { |ch| if ch.output.content.bytesize < n ... }
[12:07:13] kapil____: has joined #ruby
[12:08:22] roshanavand: has joined #ruby
[12:10:09] rebreak: has joined #ruby
[12:26:29] aufi: has joined #ruby
[12:28:38] donofrio: has joined #ruby
[12:30:11] akosednar: has joined #ruby
[12:33:31] NL3limin4t0r: has joined #ruby
[12:51:11] rspades: has joined #ruby
[13:05:55] tdy: has joined #ruby
[13:17:20] dmitch: has joined #ruby
[13:21:24] dbz: has joined #ruby
[13:22:34] bmurt: has joined #ruby
[13:34:00] apparition: has joined #ruby
[13:38:23] gnufied: has joined #ruby
[13:38:44] darix: has joined #ruby
[13:43:41] bkxd: has joined #ruby
[13:44:08] soniya29: has joined #ruby
[13:44:14] soniya29_: has joined #ruby
[13:46:24] rwb: has joined #ruby
[13:54:35] gnufied: has joined #ruby
[14:08:55] wojnar: has joined #ruby
[14:11:12] Rapture: has joined #ruby
[14:20:55] JJonah: Is there any way to refer to the entire argument hash on a method with named parameters? That is, to avoid the verbose repetition you see on line 14 here: https://hastebin.com/ejufuregaq.rb
[14:23:35] elphe: has joined #ruby
[14:25:48] desperek: has joined #ruby
[14:28:36] aufi_: has joined #ruby
[14:29:35] desperek: has joined #ruby
[14:34:16] ua: has joined #ruby
[14:34:31] [spoiler]: has joined #ruby
[14:34:34] m27frogy: has joined #ruby
[14:40:37] phaul: has joined #ruby
[14:45:30] soniya29_: has joined #ruby
[14:45:33] soniya29: has joined #ruby
[14:50:42] roshanavand: has joined #ruby
[14:52:54] maxmanders: has joined #ruby
[14:55:08] sameerynho: has joined #ruby
[14:56:08] rspades: has joined #ruby
[14:58:41] Fr4n: has joined #ruby
[15:01:55] rippa: has joined #ruby
[15:09:49] BloodyMary: has joined #ruby
[15:13:39] troys: has joined #ruby
[15:15:01] mn3m: has joined #ruby
[15:17:57] conta1: has joined #ruby
[15:19:56] dreamthese: has joined #ruby
[15:21:12] dinfuehr: has joined #ruby
[15:35:48] tdy: has joined #ruby
[15:39:04] chouhoulis: has joined #ruby
[15:43:23] dbz: has joined #ruby
[15:45:48] mikecmpbll: has joined #ruby
[15:51:32] ivanskie: has joined #ruby
[15:55:37] conta1: has joined #ruby
[15:58:27] ivanskie: has joined #ruby
[16:02:37] nowhere_man: has joined #ruby
[16:03:40] duderonomy: has joined #ruby
[16:03:51] jcalla: has joined #ruby
[16:05:26] canton7: JJonah, that hastebin is empty?
[16:08:15] orbyt_: has joined #ruby
[16:14:28] bmurt: has joined #ruby
[16:16:58] phaul: has left #ruby: ("WeeChat 2.2")
[16:17:03] phaul: has joined #ruby
[16:19:02] duderonomy: has joined #ruby
[16:25:04] marz_d`ghostman: has joined #ruby
[16:25:17] marz_d`ghostman: My rspec tests has no failures but it says it failed
[16:25:27] orbyt_: has joined #ruby
[16:26:37] duderonomy: has joined #ruby
[16:26:56] havenwood: marz_d`ghostman: Gist the output?
[16:27:20] havenwood: JJonah: def foo **input
[16:28:00] edwardly: has joined #ruby
[16:29:24] duderonomy: has joined #ruby
[16:30:53] Eiam: havenwood: wouldn't *input work too?
[16:30:57] Eiam: why the double splat
[16:31:08] Eiam: (single splat worked in a quick test here)
[16:32:26] Eiam: double splat doesn't work, says the method expected 0 arguments
[16:34:03] havenwood: Eiam: I saw "args" and "hash" and just wildly guess. (The hastebin link is empty.)
[16:34:30] havenwood: Wildly guessed* wrong.
[16:36:05] marz_d`ghostman: havenwood: Am I testing my class correctly though? http://termbin.com/n220 http://termbin.com/y7on http://termbin.com/i2w8
[16:36:19] marz_d`ghostman: modified the spec now I'm getting failures on the examples
[16:36:37] cd: has joined #ruby
[16:41:53] cthu|: I hesitate to claim that I found a bug
[16:41:59] cthu|: so I don't
[16:42:03] cthu|: but it looks like it
[16:42:45] cthu|: file.each_line behaves... strangely
[16:42:52] cthu|: it seems to be losing the data
[16:43:04] cthu|: because I have very special lines in that file
[16:43:25] cthu|: more like special new lines
[16:43:31] cthu|: I have two types of new lines
[16:45:02] dogweather: has joined #ruby
[16:45:54] darkhanb: has joined #ruby
[16:46:37] leitz: has joined #ruby
[16:49:45] Eiam: cthu|: the fun thing about software is bugs are more common than we'd like to admit
[16:50:19] sameerynho: has joined #ruby
[16:50:36] cthu|: I think I shouldn't use File.each_line... I think I should cast it into a string and split by \r\n and then parse it.
[16:50:46] cthu|: that's an "in-your-face" solution
[16:51:02] cthu|: maybe File has each_custom function
[16:51:10] cthu|: with a parameter to split by
[16:51:25] duderonomy: has joined #ruby
[16:52:19] fluxAeon: has joined #ruby
[17:02:43] phaul: marz_d`ghostman: one example I spot right away is when rspec is complaining that you expect exception but it was not given a block. You have to give expect a block. Like expect { raise 'some nastiness' }.to raise_error
[17:03:38] sgen: has joined #ruby
[17:04:12] phaul: a method, or some action in a block can raise error.. an object can't
[17:04:26] marz_d`ghostman: phaul: replaced expect(sync) to expect(sync.run) and it passes for all tests, weird
[17:04:44] marz_d`ghostman: phaul: no for the raise_error but for the .to receive
[17:10:30] marz_d`ghostman: interesting, I removed the subect { sync.run } and placed the sync.run after the it, and it passes
[17:10:54] marz_d`ghostman: ah rspec fails when my class exits with 1
[17:11:43] phaul: I wouldn't trust "it passes" too much in this case :) you have to fully understand what's going on, otherwise passing is just an illusion :)
[17:12:48] marz_d`ghostman: I have a block to exit 1 which I'm testing. If that gets invoked it exits 1 and also causes rspec to fail
[17:12:50] phaul: On rasie_error expectations use blocks. On expect.to recevie(:message) expectations use doubles
[17:13:17] snuz: has joined #ruby
[17:15:04] phaul: or mocks or stubs whatever they are these days
[17:15:32] phaul: along these lines https://relishapp.com/rspec/rspec-mocks/v/3-8/docs/basics/expecting-messages
[17:17:26] ivanskie: has joined #ruby
[17:19:15] dbz: has joined #ruby
[17:22:46] ivanskie: has joined #ruby
[17:25:19] phaul: tbh I don't understand expect(sync).to receive(:log_error).with(/pre_cmd/) part, upon which action should it recevie it? I don't see anything happening in the example. Usually you do some method sending in the same example, and assert that the mocks/stubs have received the messages they are supposed to receive. What triggers anything to happen in your case?
[17:27:16] shynoob: has joined #ruby
[17:27:20] shynoob: hello there
[17:28:32] marz_d`ghostman: phaul: Oh, it means it invokes the log_error if pre_cmd fails
[17:29:44] marz_d`ghostman: you see, the Sync class accepts a mirror object argument. the mirror object contains the pre_cmd value, which the sync runs. If that fails, it should invoke the :log_error with the value which in the test is set to 'pre_cmd' literally
[17:30:07] shynoob: has left #ruby: ()
[17:32:59] phaul: marz_d`ghostman: in your sentence "which the sync runs" on which line in http://termbin.com/y7on does that happen? is it subject { sync.run } ?
[17:34:07] marz_d`ghostman: phaul: sync.run invokes execute_cmd, then execute_cmd invokes log_error
[17:35:51] phaul: I don't think that's a valid way of using RSpec, but I can be wrong. I think it might even ignore your sync.run block being lazy.., if the subject is not in the example. Anyways I am pretty sure that wasn't the intention behind subject {}.
[17:36:35] marz_d`ghostman: phaul: How do I configure rspec not to fail if the class being tested exits with 1?
[17:37:42] marz_d`ghostman: hmm, well thinking of it, since I'm already logging the error, I shouldn't exit with 1
[17:39:46] phaul: feels like talking across purposes.. but subject {} is for setting a subject so you can do it is_expected.to rather than it '' { expect(object).to ... , seems you are trying to run code in the subject block, and assert on that run..
[17:40:59] phaul: which might not work
[17:42:42] marz_d`ghostman: phaul: http://termbin.com/pq19 how about that? still receiving error that the method is not being received though
[17:44:04] marz_d`ghostman: uncommented the subject, and removed the double, it passes now
[17:46:23] marz_d`ghostman: everything is passing now, I can rest peacefully, lol
[17:46:33] marz_d`ghostman: phaul: thanks for the help
[17:50:19] a1ph4g33k: has joined #ruby
[17:55:26] bmurt: has joined #ruby
[17:58:39] ziggylazer: has joined #ruby
[18:02:08] phaul: >> [1,1].sum
[18:03:19] phaul: ruby[bot]: where are you?
[18:05:49] tdy: has joined #ruby
[18:10:03] shenghi: has joined #ruby
[18:14:30] duderonomy: has joined #ruby
[18:18:47] roshanavand: has joined #ruby
[18:23:57] roshanavand: has joined #ruby
[18:28:42] cliluw: has joined #ruby
[18:29:05] mikecmpbll: has joined #ruby
[18:37:36] millerti: has joined #ruby
[18:45:05] SeepingN: has joined #ruby
[18:50:16] cliluw: has joined #ruby
[19:00:58] Fr4n: has joined #ruby
[19:02:08] lxsameer: has joined #ruby
[19:02:39] kent\n: has joined #ruby
[19:03:56] ivanskie: has joined #ruby
[19:09:13] clemens3: has joined #ruby
[19:09:50] mrl5: has joined #ruby
[19:11:14] mrl5: hello, I would like to generate unique string everytime when script is run (to generate a request id) any suggestion how should I do it?
[19:11:44] mrl5: I thought maybe Digest and timestamp?
[19:12:24] havenwood: mrl5: SecureRandom.uuid
[19:12:47] mrl5: thanks havenwood
[19:13:39] SuperL4g: has joined #ruby
[19:14:07] SuperLag_: has joined #ruby
[19:14:16] Rapture: has joined #ruby
[19:27:26] savolla: has joined #ruby
[19:33:51] Nicmavr: has joined #ruby
[19:37:59] phaul: havenwood: I see you are already on 2.5 ;)
[19:46:26] baweaver: Bit of a teaser for something fun coming up - https://twitter.com/keystonelemur/status/1047935342244851712
[19:47:47] rrichardsr3: has joined #ruby
[20:01:30] ivanskie: has joined #ruby
[20:10:46] dviola: has joined #ruby
[20:10:47] za1b1tsu: has joined #ruby
[20:15:37] za1b1tsu: Can someone offer some advice regarding oop, I'm trying to build a cmd line app. And when I parse options I want to have the parsed options organized by category
[20:15:40] za1b1tsu: https://paste.ofcode.org/Y4mCReFmrYj7jaB2QaHNpK
[20:16:14] za1b1tsu: but seems so ugly, any advice? oop design practices?
[20:19:02] phaul: donno. Ruby - and that's not OOP, that's ruby - can offer you some metaprogramming - libs exist, to shorten stuff around option parsing. But I don't find the code under your link ugly at first glane
[20:23:03] za1b1tsu: I'm thinking of a way to use a class instead of the hash for the metadata, but everything I do seems to make it unreadable
[20:23:33] mrl5: has left #ruby: ()
[20:24:17] za1b1tsu: in OOP design practices how would a class that presents constant metadata organized by category etc be called?
[20:24:21] za1b1tsu: is it a presenter?
[20:28:05] phaul: as someone who just reads your code the first time I would much rather see a hash there instead of a bunch of classes that even you have hard time to figure out..
[20:29:24] ramfjord: has joined #ruby
[20:29:41] za1b1tsu: yeah... true
[20:30:30] Vapez: has joined #ruby
[20:34:24] ramfjord: has joined #ruby
[20:35:53] tdy: has joined #ruby
[20:41:11] telegardian: has joined #ruby
[20:42:12] telegardian: has left #ruby: ("Leaving...")
[20:58:32] ramfjord: has joined #ruby
[21:02:45] lxsameer: has joined #ruby
[21:04:32] ramfjord: has joined #ruby
[21:07:33] Fr4n: has joined #ruby
[21:15:14] bkxd: has joined #ruby
[21:15:19] BloopMonster: has joined #ruby
[21:17:21] rwb: has joined #ruby
[21:21:56] EXCHGR: has joined #ruby
[21:22:14] kent\n: has joined #ruby
[21:27:15] elphe: has joined #ruby
[21:27:40] zenspider: za1b1tsu: why are you reinventing the wheel?
[21:29:03] zenspider: ah. ok. you're not. You're just abstracting unnecessarily.
[21:29:32] za1b1tsu: so how would you do it?
[21:29:51] zenspider: here's one of mine: https://github.com/seattlerb/flog/blob/master/lib/flog_cli.rb#L69-L154
[21:30:24] zenspider: here's one that's more complicated (so plugins can add options)
[21:30:26] zenspider: https://github.com/seattlerb/minitest/blob/master/lib/minitest.rb#L169-L233
[21:31:00] zenspider: but they're both fairly straightforward applications of OptionParser w/o any unnecessary abstractions.
[21:32:37] za1b1tsu: look more clean
[21:33:44] zenspider: DTSTTCPW... mostly. YAGNI a bit too.
[21:34:02] zenspider: do the simplest thing that can possibly work.
[21:34:08] zenspider: and you ain't gonna needit
[21:34:19] zenspider: aka: stop overthinking and complicating things. :P
[21:34:36] istrasci: has joined #ruby
[21:43:35] bkxd: has joined #ruby
[21:44:27] IanMalcolm: has joined #ruby
[21:44:45] MoritaShinobu: has joined #ruby
[21:53:58] EXCHGR: has joined #ruby
[22:06:33] blackhaze: has joined #ruby
[22:11:19] ramfjord: has joined #ruby
[22:13:29] arekushi: has joined #ruby
[22:18:51] al2o3-cr: has joined #ruby
[22:19:18] pr0ton: has joined #ruby
[22:19:54] EXCHGR: has joined #ruby
[22:21:51] baweaver: Ahahahahaha, it LIVES!!! - https://twitter.com/keystonelemur/status/1047974867562246145
[22:35:33] fluxAeon: has joined #ruby
[22:36:47] teej: has joined #ruby
[22:44:44] blackhaze: hello I need some help in ruby
[22:45:25] blackhaze: I am using linux and I need to know how to install rails on my distro
[22:46:52] zenspider: it "should" be: gem install rails; rails new myproject
[22:47:04] zenspider: where "should" is some function of linux dogma changing things
[22:49:01] havenwood: blackhaze: What distro? Do you have Ruby installed?
[22:56:19] pr0ton: has joined #ruby
[22:57:25] tdy: has joined #ruby
[22:58:29] blackhaze: I need to install ruby on rails but I have installed and an error is giving me some problem I try to build an app and message "could not locate gemfile " appears I am usin kubuntu
[22:59:18] ellcs: has joined #ruby
[23:02:32] havenwood: blackhaze: What command are you running and what is the full error message?
[23:03:11] blackhaze: No such file or directory -- /usr/share/rubygems-integration/all/gems/bundler-1.16.1/exe/bundle
[23:03:27] lxsameer: has joined #ruby
[23:04:47] blackhaze: I am trying to build a proyect in ruby but when I try to do it, No such file or directory -- /usr/share/rubygems-integration/all/gems/bundler-1.16.1/exe/bundle appears
[23:06:04] cthu|: has joined #ruby
[23:06:26] blackhaze: I am trying to update my gems and when I puts bundler in konsole it appears could not locate gemfile
[23:15:49] pr0ton: has joined #ruby
[23:16:21] dviola: has joined #ruby
[23:22:59] bkxd: has joined #ruby
[23:25:07] elphe: has joined #ruby
[23:28:18] DTZUZO: has joined #ruby
[23:28:55] baweaver: You sure you're in the right directory?
[23:34:39] blackhaze: I am in my app directory and now my error is slite3 "an error ocurred while installing sqlite3 (1.3.13), and bundler cannot continue"
[23:36:36] wildermind: has joined #ruby
[23:37:28] mzo: has joined #ruby
[23:38:14] blackhaze: baweaver: I am in my app directory and now my error is slite3 "an error ocurred while installing sqlite3 (1.3.13), and bundler cannot continue"
[23:43:41] blackhaze: beaweaver: make sure that gem install sqlite -v 1.3.13 succeeds before bundling
[23:44:20] baweaver: How did you install Ruby? What version is it (ruby -v)? What distro are you on?
[23:44:55] baweaver: This may help - https://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
[23:45:02] baweaver: It's updated a bit.
[23:45:17] blackhaze: mu ruby version is 2.5.1 I am in kubuntu
[23:45:38] baweaver: How did you install it?
[23:46:19] blackhaze: I did not install ruby it is inside kubuntu installed by default
[23:48:40] JJonah: Reposting this because hastebin was down earlier: Is there any way to refer to the entire argument hash on a method with named parameters? That is, to avoid the verbose repetition you see on line 14 here: https://hastebin.com/ogokidoduz.rb
[23:49:49] knight33: has joined #ruby
[23:52:00] baweaver: Unfortunately no.
[23:52:55] baweaver: I mean if you _really_ hacked it to hell, maybe, but it'd be 5x + slower easily
[23:53:13] baweaver: param_names = method(:name).parameters.map(&:last)
[23:53:41] baweaver: args = param_names.map { |v| binding.local_variable_get(v) }
[23:53:53] baweaver: something kinda like that, don't remember exactly.
[23:54:09] JJonah: baweaver: right, thanks for the confirmation though.
[23:54:29] baweaver: I'd like there to be introspection of methods in the method itself
[23:55:22] baweaver: current_method.arguments, current_method.default_values, current_method.to_proc, current_method.name
[23:55:25] baweaver: etc etc etc
[23:55:33] JJonah: me too. really seems like this should be built in. ofc the other way is take a hash, then validate the hash to enforce the args inside the method. but that feels worse than the repetition too...
[23:55:50] baweaver: Want to see my even scarier solution?
[23:56:04] baweaver: https://twitter.com/keystonelemur/status/1047974867562246145
[23:56:10] baweaver: I made destructuring work in Ruby
[23:56:35] baweaver: Could potentially be adapted to inject "current_method" into the....
[23:56:56] baweaver: ACTION runs off to write the code
[23:57:46] chouhoulis: has joined #ruby
[23:58:44] blackhaze: sqlite3.h not exists how can I download
[23:59:42] baweaver: Read through that guide above
[23:59:44] baweaver: it mentions it