« Back to channel list

#ruby - 08 May 2018

« Back 1 day Forward 1 day »
[00:19:10] garyserj: lupine, eam: ah, I see, thanks.
[00:30:08] garyserj: In windows cmd.exe, unicode encodings don't work that well e.g. there is a command chcp 65001 to make things utf-8 but some programs don't work well with it.. So it's common for people to have some variety of 8 bit ascii. So in the uk, chcp 850 or in the us chcp 437. And ruby when 'binary' is not set, runs with whatever codepage is set there. So it should be the same speed 'cos 437 or 850 are
[00:30:08] garyserj: not variable width. Though sure if chcp 65001 (utf-8) was set then it would be variable width and i'd expect that would/could affect speed. Great point though about usage of 'b', particularly with unix.
[00:33:25] cagomez: has joined #ruby
[00:34:33] za1b1tsu: has joined #ruby
[00:35:48] Mike11: has joined #ruby
[00:47:02] noobineer: has joined #ruby
[00:48:07] herbmillerjr: has joined #ruby
[00:48:55] lele: has joined #ruby
[00:58:18] jamiejackson: has joined #ruby
[00:59:36] arand: has joined #ruby
[01:01:59] jamiejackson81: has joined #ruby
[01:11:44] armando: has joined #ruby
[01:11:58] caleBOT_: has joined #ruby
[01:11:58] caleBOT: has joined #ruby
[01:18:05] cagomez: has joined #ruby
[01:31:56] Bonjourm8: has joined #ruby
[01:36:13] dinfuehr_: has joined #ruby
[01:45:31] n0m4d1c: has joined #ruby
[01:47:24] alfiemax: has joined #ruby
[01:52:16] caleBOT: has joined #ruby
[01:52:17] caleBOT_: has joined #ruby
[01:56:29] gizmore|2: has joined #ruby
[01:57:09] caleBOT_: has joined #ruby
[01:57:09] caleBOT: has joined #ruby
[02:00:14] kapil___: has joined #ruby
[02:08:44] ccrow: has joined #ruby
[02:10:39] bmurt: has joined #ruby
[02:15:21] jready: has joined #ruby
[02:17:16] n0m4d1c_: has joined #ruby
[02:17:39] bayprogrammer: has joined #ruby
[02:20:33] nowhere_man: has joined #ruby
[02:22:36] za1b1tsu: has joined #ruby
[02:24:01] ccrow: has joined #ruby
[02:25:09] bayprogrammer: has joined #ruby
[02:38:32] dr3wo: has joined #ruby
[02:55:07] gnufied: has joined #ruby
[03:00:09] cadillac_: has joined #ruby
[03:02:01] yxhuvud: has joined #ruby
[03:08:29] orbyt_: has joined #ruby
[03:17:34] c_nick: has joined #ruby
[03:18:37] c_nick: has left #ruby: ()
[03:19:20] alfiemax: has joined #ruby
[03:24:50] alfiemax: has joined #ruby
[03:29:08] comet23: has joined #ruby
[03:29:45] comet23: have you guys done codefights/
[03:32:00] MzrE: codewars you mean?
[03:33:17] reginald: has joined #ruby
[03:51:38] gix: has joined #ruby
[03:59:53] funnel: has joined #ruby
[04:02:07] comet23: either one actually
[04:05:51] MzrE: Never seen codefights
[04:05:54] MzrE: I've used it a bit, I like the format. It gives you different tasks to solve and tests your solution in front of you
[04:06:00] MzrE: (Codewars that is)
[04:06:36] MzrE: The difficulty scales and you're essentially climbing a ladder through these randomized problems... if you don't like one you can just skip it and try another.
[04:07:56] alfiemax: has joined #ruby
[04:10:41] za1b1tsu: has joined #ruby
[04:11:26] Uptime: has joined #ruby
[04:11:33] comet23: i was wondering where i could learn to solve these problems better and how to figure out what requisite knowledge is necessary to complete the challenge
[04:11:43] comet23: i'm really bad at these types of problems
[04:14:25] alfiemax: has joined #ruby
[04:20:43] phenom: has joined #ruby
[04:20:46] govg: has joined #ruby
[04:32:48] apeiros: has joined #ruby
[04:37:43] lele: has joined #ruby
[04:54:07] Vashy: hi all can someone help me debug this simple class?
[04:54:07] Vashy: https://gist.github.com/hebron-george/9898dee4ff041be5355462925d9fd6b8#file-new_nil-rb-L6
[04:54:24] Vashy: I'm writing a simple rspec test that calls that class method
[04:54:34] Vashy: but new('asdf') returns nil for some reason
[04:55:01] Vashy: but if I call it from a pry session: Parser.parse('asdf') it creates the object and calls #parse
[04:55:07] Vashy: any ideas why?
[04:56:24] Vashy: [1] pry(main)> require 'parser'
[04:56:24] Vashy: [2] pry(main)> Parser.new('asdf').parse
[04:56:25] Vashy: [3] pry(main)> Parser.new('asdf')
[04:56:25] Vashy: => #<Parser:0x0000000171d4e0 @command_result="asdf">
[04:57:00] dminuoso: Vashy: What do you expect it to return?
[04:57:25] Vashy: do you mean the literal expect method?
[04:57:52] MzrE: comet23, codecademy might be better for you to learn on
[04:58:17] Vashy: expect(described_class).to receive(:new)
[04:58:17] Vashy: described_class.parse("some random input")
[04:58:24] comet23: i tried that and i know the syntax of ruby and how to use apis in ruby as well
[04:58:41] comet23: i'm just lacking that understanding and it's a bit frustrating =(
[04:58:45] dminuoso: Vashy: https://eval.in/1000765
[04:58:48] dminuoso: Vashy: This looks fine to me.
[04:59:04] dminuoso: Vashy: So what is the unexpected part in this?
[04:59:16] Vashy: the test says new('asdf') returns nil
[04:59:22] Vashy: and tries to call "#parse" on nil
[05:00:02] Vashy: Failure/Error: new(command_result).parse
[05:00:02] Vashy: NoMethodError:
[05:00:02] Vashy: undefined method `parse' for nil:NilClass
[05:00:22] dminuoso: What test says.
[05:00:22] dminuoso: Show me the code.
[05:00:22] dminuoso: I have just demonstrated that this is not the case.
[05:00:40] Vashy: kk one sec
[05:01:30] MzrE: comet23, I just try to make a reasonable attempt. Afterwards the site shows you others solutions which you can compare to --- they are rated based on being 'proper' or creative / efficient... im not sure of any other resources, sorry
[05:02:04] Vashy: https://eval.in/1000766
[05:02:08] Vashy: dminuoso, ^
[05:02:29] amar: has joined #ruby
[05:02:45] dminuoso: expect(described_class).to receive(:new)
[05:02:46] dminuoso: Vashy: What do you think this does?
[05:03:08] Vashy: I assumed that it would call new?
[05:03:17] Vashy: should I instead expect it to call initialize?
[05:03:56] dminuoso: Vashy: Okay it calls new. Done. Now what?
[05:04:12] Vashy: and call original :P
[05:05:49] Vashy: thanks dminuoso =)
[05:07:04] KeyJoo: has joined #ruby
[05:12:58] dminuoso: Vashy: Sorry Im a bit tired. Im a bit surprised this would work at all, isn't that for test doubles?
[05:13:11] dminuoso: Vashy: I have a feeling that this somehow stubs out #new
[05:13:19] Vashy: yes that's exactly what it does
[05:13:31] Vashy: so you can chain it with .and_call_original
[05:13:32] Vashy: to not stub
[05:13:47] Vashy: i.e. expect(described_class).to receive(:new).and_call_original
[05:18:58] eckhardt: has joined #ruby
[05:21:23] anisha_: has joined #ruby
[05:21:24] mondongo: has joined #ruby
[05:23:12] kapil___: has joined #ruby
[05:23:56] alfiemax: has joined #ruby
[05:31:51] b100s: has joined #ruby
[05:31:56] kapil___: i want a function argument to be only `'c', 'p', 'u', 'f' or 'e'` . how can i define it
[05:32:02] b100s: hi2all! what is the best way to validate URL ?
[05:35:16] DoubleMalt: has joined #ruby
[05:40:37] mlipienski: has joined #ruby
[05:40:50] dminuoso: kapil___: You cant in Ruby.
[05:41:10] kapil___: dminuoso: thanks a will use simple argument
[05:41:47] ur5us: has joined #ruby
[05:42:19] dminuoso: kapil___: You might want to write some combinator like: Sum = -> e { Class.new { def initialize(get); raise "Blahblah" unless e.include(get); @get = get; end; attr_reader :get; end } }
[05:42:41] aupadhye: has joined #ruby
[05:42:43] dminuoso: kapil___: And then go `States = Sum[%i[c p u f e]]
[05:42:56] dminuoso: If you want at least a minimum of safety guarantees
[05:43:17] dminuoso: This is one of those things I really miss in Ruby
[05:43:57] kapil___: dminuoso: thanks is above is a annonmous function?
[05:44:07] dminuoso: kapil___: It's a lambda function yes.
[05:45:03] kapil___: dminuoso: thanks a lot
[05:46:12] tvw: has joined #ruby
[05:49:02] kapil___: dminuoso: can u explain what above function do? why u used class?
[05:49:33] dminuoso: kapil___: Actually let me make a more comprehensive example.
[05:50:06] konsolebox: has joined #ruby
[05:54:54] dminuoso: kapil___: https://eval.in/1000782
[05:55:14] alfiemax_: has joined #ruby
[05:56:57] fullstack_: has joined #ruby
[05:57:30] lele: has joined #ruby
[05:58:44] za1b1tsu: has joined #ruby
[06:02:53] apeiros: has joined #ruby
[06:09:06] saTchymoto: has joined #ruby
[06:19:50] reber: has joined #ruby
[06:21:10] ineb: dminuoso: wasnt the question something like def foo(a); raise unless ['c','p','u'].include?(a);end ?
[06:26:03] za1b1tsu: has joined #ruby
[06:31:10] amar: has joined #ruby
[06:31:14] schleppel: has joined #ruby
[06:45:13] Ryzokuken: has joined #ruby
[06:46:41] phaul: has joined #ruby
[06:49:33] c0ncealed1: has joined #ruby
[06:53:30] amar: has joined #ruby
[06:55:46] TinkerT: has joined #ruby
[06:59:24] fullstack_: has joined #ruby
[07:02:16] suukim: has joined #ruby
[07:04:25] conta: has joined #ruby
[07:07:15] clemens3_: has joined #ruby
[07:11:46] alfiemax: has joined #ruby
[07:14:48] b100s: I have sinatra app. Is there way to write destructor when app stops ?
[07:14:59] agent_white: has joined #ruby
[07:15:15] emilford: has joined #ruby
[07:19:54] claudiuinberlin: has joined #ruby
[07:21:39] conta: has joined #ruby
[07:23:59] burgestrand: has joined #ruby
[07:31:46] stairmast0r: has joined #ruby
[07:33:20] alfiemax: has joined #ruby
[07:42:57] barnabyjones: has joined #ruby
[07:43:12] jenrzzz: has joined #ruby
[07:46:22] inerthia: has joined #ruby
[07:47:22] schneider1: has joined #ruby
[07:49:45] mlkkk: has joined #ruby
[07:54:28] chef_byd: has joined #ruby
[07:55:26] barnabyjones: has joined #ruby
[07:55:56] cadillac_: has joined #ruby
[07:57:53] dionysus69: has joined #ruby
[08:01:06] phaul: has joined #ruby
[08:05:06] sysvalve: has joined #ruby
[08:07:31] marr: has joined #ruby
[08:08:26] emilford: has joined #ruby
[08:12:55] andikr: has joined #ruby
[08:15:26] conta1: has joined #ruby
[08:18:38] amar: has joined #ruby
[08:18:40] galeido: has joined #ruby
[08:21:17] emilford_: has joined #ruby
[08:23:56] schneider1: has joined #ruby
[08:24:22] amar: has joined #ruby
[08:24:41] ellcs: has joined #ruby
[08:24:47] amar: has joined #ruby
[08:25:26] jamesaxl: has joined #ruby
[08:27:34] Sylario: has joined #ruby
[08:29:10] mlehrer: has joined #ruby
[08:38:39] simmaniac: has joined #ruby
[08:39:20] nickjj_: has joined #ruby
[08:39:40] dr3w__: has joined #ruby
[08:39:43] mlkkk_: has joined #ruby
[08:40:22] cadillac_: has joined #ruby
[08:40:54] tomphp: has joined #ruby
[08:41:25] ski7777: has joined #ruby
[08:41:33] reaVer: has joined #ruby
[08:41:34] KeyJoo: has joined #ruby
[08:41:52] aspiers: has joined #ruby
[08:42:05] brodul: has joined #ruby
[08:42:12] clemens3_: has joined #ruby
[08:42:43] m27frogy: has joined #ruby
[08:43:31] andikr: has joined #ruby
[08:46:10] tAn: has joined #ruby
[08:51:21] guille-moe: has joined #ruby
[08:52:43] tomphp: has joined #ruby
[08:58:23] schneider1: has joined #ruby
[08:59:07] harmaahylje: has joined #ruby
[09:04:35] venmx: has joined #ruby
[09:06:03] mnemon: has joined #ruby
[09:06:15] ur5us: has joined #ruby
[09:07:11] Doow: has joined #ruby
[09:08:34] tomphp: has joined #ruby
[09:09:50] schneider1: has joined #ruby
[09:15:26] guille-moe: has joined #ruby
[09:22:19] amatas: has joined #ruby
[09:23:12] suukim: has joined #ruby
[09:24:31] mhoungbo1: has joined #ruby
[09:25:03] dminuoso: b100s: How does your sintatra app stop?
[09:25:18] dionysus69: yesterday, by explicit locks you meant the db row locks right?
[09:30:28] mhoungbo1_: has joined #ruby
[09:32:28] tomphp: has joined #ruby
[09:33:36] tAn: has joined #ruby
[09:36:22] InfinityFye: has joined #ruby
[09:37:47] Azure: has joined #ruby
[09:37:57] tomphp: has joined #ruby
[09:38:04] InfinityFye: has left #ruby: ()
[09:38:35] kies^: has joined #ruby
[09:41:59] mhoungbo1: has joined #ruby
[09:43:37] tomphp: has joined #ruby
[09:46:42] amar: has joined #ruby
[09:54:31] mohsen_1: has joined #ruby
[09:55:06] tvw: has joined #ruby
[09:55:09] mohsen_1: has left #ruby: ()
[09:55:30] mohsen_1: has joined #ruby
[09:55:46] barnabyjones: has joined #ruby
[09:55:57] amatas: has joined #ruby
[09:57:17] amatas: has joined #ruby
[09:58:25] dionysus69: has joined #ruby
[10:00:38] RedNifre: has joined #ruby
[10:01:42] tomphp: has joined #ruby
[10:05:47] rabajaj: has joined #ruby
[10:12:48] phaul: has joined #ruby
[10:19:48] nowhere_man: has joined #ruby
[10:20:00] schneider1: has joined #ruby
[10:20:56] stormpack: has joined #ruby
[10:23:54] deathwishdave: has joined #ruby
[10:32:03] tAn: has joined #ruby
[10:39:31] vasilakisFiL: has joined #ruby
[10:39:56] RougeR: has joined #ruby
[10:40:09] vasilakisFiL: hi I have this string in a var: " \"Sí\"" and I want to store in a new variable the string itself without the start/end escaped quotes, like "Sí". In another example I would like " \"Sí \"seniorita\" \"" to become " Sí \"seniorita\" ". I tried with eval but only the first string works. Any idea/hint would be helpful.
[10:48:45] phaul: has joined #ruby
[10:50:46] apeiros: ew, eval. the second example is bad. how do you determine that the second \" does NOT terminate the string?
[10:51:13] apeiros: is it just 'everything from first \" to last \", don't care what's in between'?
[10:51:18] apeiros: @ vasilakisfil ^
[10:52:46] vasilakisFiL: basically I want to "unquote" it, like there is something wrong and the string has extra starting/terminating quotes
[10:52:51] apeiros: >> " \"Sí \"seniorita\" \"" to become " Sí \"seniorita\" "[/"(.*)"/, 1]
[10:52:52] ruby[bot]: apeiros: # => /tmp/execpad-3ec6200ee15b/source-3ec6200ee15b:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/1000966)
[10:53:14] apeiros: >> " \"Sí \"seniorita\" \""[/"(.*)"/, 1]
[10:53:15] ruby[bot]: apeiros: # => "Sí \"seniorita\" " (https://eval.in/1000967)
[10:53:31] apeiros: (copied to much from your message in the first try)
[10:53:58] apeiros: I do think I smell an XY here, though
[10:54:01] apeiros: ?xy vasilakisfil
[10:54:01] ruby[bot]: vasilakisfil: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[10:56:00] apeiros: oh, also you probably should use the m flag: string[/"(.*)"/m, 1]
[10:58:13] vasilakisFiL: thanks! seems to me like very advanced code but interesting regardless :D
[10:59:02] vasilakisFiL: my problem is that I parse an invalid yaml which has in its (invalid) valus quoted strings, but I want to "unquote" those before exporting the valid yaml
[11:05:28] dionysus69: has joined #ruby
[11:06:48] mhoungbo1: has joined #ruby
[11:06:48] apeiros: got to go for lunch break, so I'll read up later. how did the yaml become invalid?
[11:07:13] AJA4350: has joined #ruby
[11:08:08] dionysus69: has joined #ruby
[11:10:05] mikeiniowa: has joined #ruby
[11:12:00] tomphp: has joined #ruby
[11:14:28] mostlybadfly: has joined #ruby
[11:14:34] schneider1: has joined #ruby
[11:18:34] mhoungbo1: has joined #ruby
[11:19:17] Cavallari: has joined #ruby
[11:21:14] ineb: has joined #ruby
[11:23:57] schneider1: has joined #ruby
[11:31:33] ldnunes: has joined #ruby
[11:33:11] schneider1: has joined #ruby
[11:33:27] cyberg: has joined #ruby
[11:33:47] mhoungbo1: has joined #ruby
[11:35:11] apparition: has joined #ruby
[11:39:04] inerthia: has joined #ruby
[11:42:32] schneider1: has joined #ruby
[11:42:40] mhoungbo1: has joined #ruby
[11:47:26] tomphp: has joined #ruby
[11:48:39] yohji: has joined #ruby
[11:50:30] RedNifre: has joined #ruby
[11:51:51] schneider1: has joined #ruby
[11:52:24] InfinityFye: has joined #ruby
[11:53:00] InfinityFye: has left #ruby: ()
[11:54:21] TvL: has joined #ruby
[11:55:47] barnabyjones: has joined #ruby
[11:56:33] anjen: has joined #ruby
[11:58:50] Ryzokuken: has joined #ruby
[11:59:42] BTRE: has joined #ruby
[12:00:14] synthroid: has joined #ruby
[12:01:11] schneider1: has joined #ruby
[12:08:19] piixal: has joined #ruby
[12:09:20] bmurt: has joined #ruby
[12:10:07] piixal: has joined #ruby
[12:10:31] schneider1: has joined #ruby
[12:20:00] schneider1: has joined #ruby
[12:21:31] tomphp: has joined #ruby
[12:22:53] sonOfRa: has joined #ruby
[12:22:53] phaul: has joined #ruby
[12:23:47] alfiemax: has joined #ruby
[12:26:02] tomphp: has joined #ruby
[12:29:29] GodFather: has joined #ruby
[12:31:25] kurko_: has joined #ruby
[12:32:31] jeffreylevesque: has joined #ruby
[12:33:41] moeSizlak: has joined #ruby
[12:34:32] moeSizlak: this script runs every 20 mintes. it creates a temp file, writes to it, then renames it
[12:34:42] cagomez: has joined #ruby
[12:34:46] moeSizlak: about once every 100 times the rename fails saying no such file or directory
[12:35:04] moeSizlak: to open it it does File.open(tempfname, 'wb') do |file| .... end
[12:35:18] moeSizlak: to rename it does FileUtils.mv(tempfname, finalfname)
[12:35:40] moeSizlak: /opt/rbenv/versions/2.4.0/lib/ruby/2.4.0/fileutils.rb:1220:in `lstat': No such file or directory @ rb_file_s_lstat - /tmp/Iodine_IL_-2018-05-08-06-51-01-318.txt (Errno::ENOENT)
[12:36:33] moeSizlak: and indeed, the file does not exist in the temp directory. so where the heck is the file!?
[12:38:33] jsrn: has joined #ruby
[12:40:36] GodFather: has joined #ruby
[12:41:09] apeiros: moeSizlak: check with your OS how the /tmp directory is cleaned up
[12:41:29] moeSizlak: its centos and from what i can tell its not cleaned up at all
[12:41:32] rwb: has joined #ruby
[12:41:40] moeSizlak: cus there are temp files in there from months ago
[12:43:25] burgestrand: has joined #ruby
[12:43:28] apeiros: the only other thing that comes to mind is related to remote drives. we had a case where a file would be reported as written by the OS but not be visible until up to a minute later.
[12:44:03] moeSizlak: nope its a local drive
[12:44:39] moeSizlak: and the file isnt there now, so if it just a minute to show up....itd be there,
[12:45:03] apeiros: and you don't rescue any exceptions in your code?
[12:45:47] apeiros: in that case - does not sound like that should happen.
[12:46:26] apeiros: at the moment the block closes, ruby afaik flushes the content. iow, at the latest the file should be written after the block.
[12:46:38] apeiros: and if it can't write, you should get an exception
[12:46:59] apeiros: maybe if you gist the full code.
[12:47:40] apeiros: you only rely on timestamp for uniqueness of the name? that might be another issue.
[12:48:07] apeiros: 0.001s is an eternity to a CPU
[12:49:29] RougeR: has joined #ruby
[12:50:17] Silthias: has joined #ruby
[12:50:24] Silthias: has left #ruby: ()
[12:50:42] jsrn: has joined #ruby
[12:53:38] schneider1: has joined #ruby
[12:53:44] tomphp: has joined #ruby
[12:54:40] amelliaa: has joined #ruby
[12:56:29] moeSizlak: apeiros, https://gist.github.com/moeSizlak/0c2a502c86e24083727f5ff720c00745
[12:59:26] Psybur: has joined #ruby
[13:00:27] samort7: has joined #ruby
[13:02:11] coderphive: has joined #ruby
[13:04:11] moeSizlak: ok apeiros found the problem you were right
[13:04:44] moeSizlak: i had other scripts runnning at the same time and they were generating temp file names at the exact same milisecond resulting in duplicate filename
[13:07:24] k0mpa: has joined #ruby
[13:09:48] asio: moeSizlak: allow me to suggest https://ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html for handling temp files
[13:11:47] phaul: has joined #ruby
[13:13:28] amar_: has joined #ruby
[13:17:28] ptr4ce: has joined #ruby
[13:22:13] piixal: has joined #ruby
[13:24:54] apeiros: asio: may I recommend using current docs instead of long EOLd 1.9.3? :)
[13:26:08] gix: has joined #ruby
[13:26:41] asio: yeah..noticed after pasting it here...it was the first result on google when searching for tempfile :(
[13:36:30] tomphp: has joined #ruby
[13:40:03] burgestrand: has joined #ruby
[13:41:39] Bonjourm8: has joined #ruby
[13:42:08] amar_: has joined #ruby
[13:47:50] orbyt_: has joined #ruby
[13:49:53] yohji: has joined #ruby
[13:53:00] tomphp: has joined #ruby
[13:55:55] piixal: has joined #ruby
[13:59:02] chocoelho: has joined #ruby
[14:01:13] b100s: has joined #ruby
[14:02:43] Doow_: has joined #ruby
[14:03:41] jsrn: has joined #ruby
[14:03:57] marr123: has joined #ruby
[14:04:38] klaas_: has joined #ruby
[14:05:03] burgestrand: has joined #ruby
[14:05:16] tAn: has joined #ruby
[14:05:26] donofrio: has joined #ruby
[14:06:30] tris: has joined #ruby
[14:06:56] webhat: has joined #ruby
[14:07:51] chouhoulis: has joined #ruby
[14:12:21] soahccc: has joined #ruby
[14:13:18] Rapture: has joined #ruby
[14:17:09] za1b1tsu: has joined #ruby
[14:20:20] fyrril: has joined #ruby
[14:21:02] oleo: has joined #ruby
[14:23:15] tomphp: has joined #ruby
[14:24:30] piixal: has joined #ruby
[14:29:29] mhoungbo1: has joined #ruby
[14:29:53] tomphp: has joined #ruby
[14:31:04] flak: has joined #ruby
[14:33:25] ferr1: has joined #ruby
[14:36:00] ferr1: has left #ruby: ()
[14:36:15] infernix: has joined #ruby
[14:38:45] marr: has joined #ruby
[14:40:47] conta: has joined #ruby
[14:43:39] psychicist__: has joined #ruby
[14:44:37] tomphp: has joined #ruby
[14:53:50] ccooke: has joined #ruby
[14:59:42] chouhoulis: has joined #ruby
[14:59:53] tomphp: has joined #ruby
[15:05:29] cschneid_: has joined #ruby
[15:13:46] tdy: has joined #ruby
[15:14:43] dionysus69: has joined #ruby
[15:17:51] tomphp: has joined #ruby
[15:19:02] burgestrand: has joined #ruby
[15:19:52] conta: has joined #ruby
[15:21:41] MzrE: has joined #ruby
[15:25:03] yohji: has joined #ruby
[15:26:09] Yzguy: has joined #ruby
[15:28:04] phaul: has joined #ruby
[15:30:23] burgestrand: has joined #ruby
[15:42:55] konsolebox: moeSizlak: it's easy to make it unique by naming the temp files based on the PID of the ruby instance that runs the script
[15:43:12] dionysus69: has joined #ruby
[15:43:24] moeSizlak: i just put a securerandom uuid in the name
[15:44:28] konsolebox: there's still a very very very small chance of collision for that, no? why not go for the one that has certainty
[15:45:30] suukim: has joined #ruby
[15:45:31] apeiros: and then they multithread the script and are back in place 1 :)
[15:46:41] konsolebox: apeiros: he did say "other running scripts" though
[15:46:50] konsolebox: i had that idea too
[15:47:17] apeiros: yes, I was speaking about a potential future development. they did not make the impression it was currently multi-threaded.
[15:47:53] konsolebox: moeSizlak: all you need is $$
[15:48:59] apeiros: uuid's chances for collision are academical. bigger chance that the computer is hit by a lightning strike ;-)
[15:49:29] apeiros: though, you can calculate it. iirc the WP page for uuids even lists the formula.
[15:49:42] konsolebox: yeah. it's 128 bit after all. but i don't even trust aes anymore ;)
[15:52:45] anisha_: has joined #ruby
[15:52:55] jcarl43: has joined #ruby
[15:55:44] barnabyjones: has joined #ruby
[15:57:24] cagomez: has joined #ruby
[16:01:07] dionysus69: has joined #ruby
[16:03:21] barnabyjones: has joined #ruby
[16:10:12] nicholaslyang: has joined #ruby
[16:10:31] howdoi: has joined #ruby
[16:12:44] conta: has joined #ruby
[16:14:52] n13z: has joined #ruby
[16:19:55] ciscam: has joined #ruby
[16:20:31] chef9000: has joined #ruby
[16:30:25] mjacob_: has left #ruby: ()
[16:30:38] apeiros: has joined #ruby
[16:33:37] apeiros: has joined #ruby
[16:35:14] HemmE: has joined #ruby
[16:38:00] tvw: has joined #ruby
[16:38:56] conta: has joined #ruby
[16:40:32] Psybur_: has joined #ruby
[16:41:19] amar_: has joined #ruby
[16:43:03] Immune: has joined #ruby
[16:46:10] HemmE: has joined #ruby
[16:46:20] chris349: has joined #ruby
[16:47:09] n0m4d1c: has joined #ruby
[16:47:21] orbyt_: has joined #ruby
[16:48:20] coderphive: has joined #ruby
[16:52:28] RedNifre: has joined #ruby
[16:54:23] biberu: has joined #ruby
[16:55:03] n0m4d1c_: has joined #ruby
[16:57:20] mlkkk: has joined #ruby
[16:59:15] troulouliou_div2: has joined #ruby
[17:00:00] alfiemax: has joined #ruby
[17:01:57] n0m4d1c: has joined #ruby
[17:03:15] cabotto: has joined #ruby
[17:09:00] clemens3_: has joined #ruby
[17:11:19] n0m4d1c_: has joined #ruby
[17:13:22] conta: has joined #ruby
[17:13:40] piixal: has joined #ruby
[17:14:57] n0m4d1c: has joined #ruby
[17:19:07] synthroid: has joined #ruby
[17:19:09] amar: has joined #ruby
[17:19:35] justinfaler: has joined #ruby
[17:21:45] mondongo: has joined #ruby
[17:23:09] mahlon: has joined #ruby
[17:25:45] justinfaler: has joined #ruby
[17:26:57] eckhardt: has joined #ruby
[17:28:20] piixal: has joined #ruby
[17:31:38] pilne: has joined #ruby
[17:38:37] gr33n7007h: has joined #ruby
[17:39:20] nicholaslyang: has joined #ruby
[17:49:44] RougeR: has joined #ruby
[17:56:45] dorian: has joined #ruby
[17:57:24] andikr: has joined #ruby
[17:59:10] dorian: hey folks anybody know of a decent example of a command-line app (preferably using commander or something similar) that has a bunch of verbs you can run directly from the shell, or will load its own little shell when invoked with no args?
[18:00:22] dorian: mostly i'm looking for examples of reusing commands defined in commander on a readline loop
[18:00:42] dorian: (ideally this has already been considered and done by somebody)
[18:01:07] jsrn: has joined #ruby
[18:02:00] apeiros: dorian: all you need is readline + shellsplit
[18:03:02] apeiros: i.e. you abstract the argv processing so you can do like `YourGem.run_command ARGV`, and in your interactive loop, you just do `YourGem.run_command input_line.shellsplit`
[18:03:42] apeiros: you get shellsplit via `require 'shellwords'` btw., it's in the stdlib.
[18:04:20] dorian: cool thanks
[18:05:31] dorian: i was kinda liking the idea of all that boilerplate generation in commander though
[18:08:07] jsrn: has joined #ruby
[18:09:21] apeiros: dorian: I don't know commander. why does it generate boilerplate and why's that an enjoyable idea?
[18:09:34] dorian: https://www.rubydoc.info/gems/commander/
[18:09:56] dorian: deals with verbs, args, input (via highline) etc
[18:10:17] dorian: cli framework thing
[18:11:30] Quentinius: has joined #ruby
[18:11:49] nfsnobody: has joined #ruby
[18:12:49] apeiros: doesn't look like boilerplate, tho
[18:13:39] phaul: has joined #ruby
[18:14:21] p0p0pr37: has joined #ruby
[18:16:33] Cavallari: has joined #ruby
[18:17:14] Mondongo_: has joined #ruby
[18:18:15] piixal: has joined #ruby
[18:20:53] Bonjourm8: has joined #ruby
[18:24:17] dorian: eh maybe we have different definitions of 'boilerplate'; i just meant it seems to do a nice job of bundling up verbs, options, help messages etc
[18:24:33] klaas: has joined #ruby
[18:27:58] piixal: has joined #ruby
[18:27:58] za1b1tsu_: has joined #ruby
[18:27:59] facest: has joined #ruby
[18:27:59] apeiros: generally, boilerplate is something you want to reduce, and languages like ruby are excellent at providing ways to reduce boilerplate. the wp description is quite good:
[18:27:59] apeiros: https://en.wikipedia.org/wiki/Boilerplate_code
[18:29:46] gil_: has joined #ruby
[18:29:46] gil_: has joined #ruby
[18:30:10] ltd: has joined #ruby
[18:30:34] shaman42: has joined #ruby
[18:31:26] Mon_Ouie: has joined #ruby
[18:32:01] Puffball: has joined #ruby
[18:32:33] dorian: right, so i would consider hand-rolling help output for options to be boilerplate
[18:33:51] nfsnobody: has joined #ruby
[18:34:37] dorian: anyway all good
[18:34:53] Lyfe: has joined #ruby
[18:35:19] Lyfe: Anyone familiar with using ruby-net-ldap (or any other ldap library?) to connect to AD over SSL?
[18:35:21] apeiros: that would be boilerplate, yes. but it didn't look to me like you had to do that in commander?
[18:35:34] sameerynho: has joined #ruby
[18:36:02] dorian: i meant it takes care of that
[18:36:20] dorian: i probably wasn't communicating clearly; head is a bit wooly from a cold
[18:41:08] schneider1: has joined #ruby
[18:44:35] Sembei: has joined #ruby
[18:47:25] quobo: has joined #ruby
[18:50:41] RedNifre: has joined #ruby
[18:52:16] Lytol: has joined #ruby
[18:56:08] augcesar: has joined #ruby
[19:00:46] audy: has joined #ruby
[19:01:00] phaul: has joined #ruby
[19:02:11] shoogz: has joined #ruby
[19:02:35] cajone: has joined #ruby
[19:03:45] schneider1: has joined #ruby
[19:03:45] Mike11: has joined #ruby
[19:04:21] n0m4d1c_: has joined #ruby
[19:05:57] n0m4d1c: has joined #ruby
[19:06:00] BTRE: has joined #ruby
[19:06:58] raynold: has joined #ruby
[19:14:15] Rapture: has joined #ruby
[19:15:32] schneider1: has joined #ruby
[19:19:23] safetypin: has joined #ruby
[19:21:01] SeepingN: has joined #ruby
[19:24:46] jordanm: has joined #ruby
[19:30:08] gr33n7007h: has joined #ruby
[19:31:11] safetypin: has joined #ruby
[19:31:17] orbyt_: has joined #ruby
[19:34:18] schneider1: has joined #ruby
[19:34:46] za1b1tsu: has joined #ruby
[19:36:10] bmurt: has joined #ruby
[19:36:40] moeSizlak: has left #ruby: ("Leaving")
[19:39:20] mohsen_1: has joined #ruby
[19:42:32] schneider1: has joined #ruby
[19:44:03] dionysus69: has joined #ruby
[19:47:31] chouhoul_: has joined #ruby
[19:48:29] bmurt: has joined #ruby
[19:49:01] emilford: has joined #ruby
[19:49:39] mohsen_1: Hi, what book do you suggest for a beginner at ruby and not generally at programming?
[19:50:00] mohsen_1: I've read through the books url in the topic
[19:50:22] piixal: has joined #ruby
[19:50:48] mohsen_1: But I thought asking it here also doesn't hurt
[19:50:55] audy: mohsen_1: you mean for someone coming from another language?
[19:51:19] blackmesa: has joined #ruby
[19:52:07] mohsen_1: audy: somehow, I'm already familiar with the basic stuff of programming such as if statements, loops, functions, ...
[19:53:15] audy: mohsen_1: there is a list here https://programmingzen.com/ruby-books/
[19:53:27] jenrzzz: has joined #ruby
[19:53:46] audy: I really liked this book but it's more advanced: https://www.amazon.com/exec/obidos/ASIN/0321721330/zenruby-20/ref=nosim/
[19:55:45] za1b1tsu_: has joined #ruby
[19:55:46] jsrn: has joined #ruby
[19:56:02] piixal: has joined #ruby
[19:56:37] ramfjord: has joined #ruby
[19:56:59] esObe: has joined #ruby
[19:57:39] cadillac_: has joined #ruby
[19:59:52] tomphp: has joined #ruby
[20:00:11] mohsen_1: Thank you bro
[20:00:30] jrabe: has joined #ruby
[20:01:03] apeiros: maybe it's a sis, how'd you know?
[20:04:28] eam: a sis can be a bro
[20:05:17] ramfjord: has joined #ruby
[20:06:41] postmodern: has joined #ruby
[20:08:51] dr3wo: has joined #ruby
[20:09:32] piixal: has joined #ruby
[20:11:08] jokester: has joined #ruby
[20:16:42] herbmillerjr: has joined #ruby
[20:21:22] RedNifre: has joined #ruby
[20:23:06] m27frogy: has joined #ruby
[20:25:03] tomphp: has joined #ruby
[20:25:41] emilford: has joined #ruby
[20:27:13] TomyLobo: has joined #ruby
[20:27:16] govg: has joined #ruby
[20:29:14] orbyt_: has joined #ruby
[20:37:59] jnollette: has joined #ruby
[20:39:47] jenrzzz: has joined #ruby
[20:39:51] mlkkk: has joined #ruby
[20:39:56] jenrzzz: has joined #ruby
[20:43:18] jsrn: has joined #ruby
[20:43:34] minimalism: has joined #ruby
[20:44:50] jenrzzz: has joined #ruby
[20:46:04] tvw: has joined #ruby
[20:50:53] emilford_: has joined #ruby
[20:55:58] ur5us: has joined #ruby
[20:56:52] Mia: has joined #ruby
[20:56:56] ellcs: has joined #ruby
[21:05:20] alfiemax: has joined #ruby
[21:07:26] tomphp_: has joined #ruby
[21:09:04] za1b1tsu_: has joined #ruby
[21:09:43] Ropeney: has joined #ruby
[21:14:05] Ropeney: has left #ruby: ()
[21:15:01] Yzguy: has joined #ruby
[21:17:15] markkhosla: has joined #ruby
[21:19:12] RougeR: has joined #ruby
[21:19:12] RougeR: has joined #ruby
[21:20:59] moei: has joined #ruby
[21:22:19] jinie: has joined #ruby
[21:34:47] anjen: has joined #ruby
[21:38:15] nathias: has joined #ruby
[21:49:09] audy: moshen and I go way back
[21:49:27] audy: i mean mohsen_1
[21:49:47] chouhoulis: has joined #ruby
[21:53:21] Yzguy: has joined #ruby
[22:00:06] Yzguy: has joined #ruby
[22:02:17] mlkkk: has joined #ruby
[22:02:50] jenrzzz_: has joined #ruby
[22:03:35] dinfuehr: has joined #ruby
[22:12:18] nowhere_man: has joined #ruby
[22:13:45] tvw: has joined #ruby
[22:14:11] rwb: has joined #ruby
[22:26:47] bmurt: has joined #ruby
[22:33:03] jenrzzz: has joined #ruby
[22:35:22] RougeR: has joined #ruby
[22:40:15] nfsnobody: has joined #ruby
[22:42:42] alfiemax: has joined #ruby
[22:46:01] jsrn: has joined #ruby
[22:46:28] orbyt_: has joined #ruby
[22:52:51] nowhereman: has joined #ruby
[22:55:39] jenrzzz: has joined #ruby
[22:57:07] n0m4d1c: has joined #ruby
[22:58:33] samosaphile: has joined #ruby
[22:58:40] giraffe: has joined #ruby
[22:59:41] tpendragon: has joined #ruby
[22:59:49] ellcs: has joined #ruby
[23:00:09] GodFather: has joined #ruby
[23:00:52] roamingdog: has joined #ruby
[23:03:14] lele: has joined #ruby
[23:06:45] alfiemax: has joined #ruby
[23:09:59] jeffreylevesque: has joined #ruby
[23:11:42] ur5us: has joined #ruby
[23:14:03] cschneid_: has joined #ruby
[23:24:22] valkyr2e: has joined #ruby
[23:24:44] r3m: has joined #ruby
[23:32:19] vondruch: has joined #ruby
[23:36:48] vondruch: has joined #ruby
[23:40:02] orbyt_: has joined #ruby
[23:44:14] anjen: has joined #ruby
[23:51:59] jsrtr: has joined #ruby
[23:52:32] ged: has joined #ruby