« Back to channel list

#ruby - 05 February 2018

« Back 1 day Forward 1 day »
[00:04:07] k0mpa: has joined #ruby
[00:05:54] psychicist__: has joined #ruby
[00:24:42] milardovich: has joined #ruby
[00:27:46] nadir: has joined #ruby
[00:31:28] bigblind: has joined #ruby
[00:37:15] eblip: has joined #ruby
[00:37:45] def_jam: has joined #ruby
[00:52:25] ur5us: has joined #ruby
[00:56:15] bigblind: has joined #ruby
[01:00:24] n0m4d1c: has joined #ruby
[01:02:30] venmx: has joined #ruby
[01:13:44] cadillac_: has joined #ruby
[01:15:08] bigblind: has joined #ruby
[01:17:11] Bounga: has joined #ruby
[01:27:32] dogweather: has joined #ruby
[01:27:37] ledestin: has joined #ruby
[01:29:17] mtkd: has joined #ruby
[01:31:49] cpruitt: has joined #ruby
[01:34:59] soahccc: I just finished the most ludicrous and unnecessarily complicated CLI tool ever for a simple task that could be easily replaced by a 10-line shell script but I feel good :) After living in hell for 2 weeks
[01:36:41] bigblind: has joined #ruby
[01:40:55] soahccc: also can any postgres literate tell me if you can disable foreign key constraint checks over a series of processes and time and reactivate it after a few parallel imports are complete?
[01:45:09] arescorpio: has joined #ruby
[01:51:31] atchoum: soahccc: what you want to do seems so weird
[01:51:40] jidar: soahccc: I'm not pg expert, but that sounds very wrong for DB's
[01:51:46] jidar: like very very wrong
[01:52:09] jidar: the whole point of FK is for data integrity
[01:52:46] atchoum: and what do you maen by « parallel imports »
[01:52:59] cschneid: has joined #ruby
[01:53:06] soahccc: I understand that. I'm a dirty mysql person you know :D and if I want to add something to our website I pull live data to my dev machine but the whole DB is huge and takes ages. So I just pull the tables I need
[01:53:30] craysiii: I'm a little confused. I monkey-patched #second onto Numeric, but when I try to test with RSpec e.g. expect(1).to respond_to :second, it fails, even though if I call 1.methods I can see it included in the list. Am I misunderstanding how respond_to works?
[01:53:35] soahccc: but there will be integrity violations but I'm cool with it
[01:54:06] atchoum: soahccc: what you are trying to do seems so dirty and disgusting that I don't wish to discuss it anymore.
[01:54:42] soahccc: atchoum: what would you do, if pulling the whole database, takes 4 hours?
[01:54:49] atchoum: I think in mysql, the in memory engine doesn't check constraint.
[01:55:31] ChanServ: -o baweaver
[01:55:49] atchoum: soahccc: I wouldnot depend on production data to write a patch. I would try to create locally on my machine a copy of the database structure then selectively import few data samples.
[01:56:10] jidar: sounds like you should pull it down into an ETL and never put it back
[01:57:08] atchoum: Well methodologically speaking. It seems weird to check out production data the way you do. I wish you good luck thouhg.
[01:58:08] atchoum: alternatively you could create the table without the foreign key constraints, dump the tables you are interested in and insert the data afterward (assuming this would work with PG).
[01:58:46] soahccc: I guess it depends on the use case. Surely one could solve it "better" but our way works good, I was just asking for psql. Some employees enter the boring data in our production backend and sometimes we have to add new features for specials, etc. and we just need a few tables which might reference data that we dont need.
[02:00:02] atchoum: https://www.dbrnd.com/2017/02/postgresql-how-to-disable-or-enable-foreign-key-constraint-of-a-table-data-migration-bulk-operation/
[02:00:59] soahccc: I was just curious because I never worked with psql and I rewrote my "db sucker" tool to play with a few things and am trying to figure out if anyone is interested (also I was trying to find out if I ever can add psql support)
[02:02:05] soahccc: In the worst case I end up with a tool that only our company uses and I learned a bunch of things while creating it :)
[02:03:37] arescorpio: has joined #ruby
[02:09:08] bigblind: has joined #ruby
[02:13:25] tjbp: has joined #ruby
[02:15:56] milardovich: has joined #ruby
[02:24:32] bigblind: has joined #ruby
[02:43:46] JoshB|: has joined #ruby
[02:45:49] JoshB|: so I'm trying to get this to run however I'm sure I'm causing a basic mistake can you help me out? https://gist.github.com/anonymous/abe6abf9c172b0cc50928f01d59068d0
[02:46:13] JoshB|: I did the hard part I think.
[02:46:17] haylon_: has joined #ruby
[02:46:56] JoshB|: It won't do the calculations and I'm not sure why
[02:47:02] bigblind: has joined #ruby
[02:56:54] milardovich: has joined #ruby
[02:58:27] JoshB|: has left #ruby: ()
[03:00:32] cadillac_: has joined #ruby
[03:05:31] d^sh: has joined #ruby
[03:07:10] bigblind: has joined #ruby
[03:10:00] c0ncealed: has joined #ruby
[03:17:23] Bounga: has joined #ruby
[03:18:14] drewmcmillan: has joined #ruby
[03:18:30] auv: has joined #ruby
[03:19:05] meinside: has joined #ruby
[03:21:24] n0m4d1c: has joined #ruby
[03:26:22] bigblind: has joined #ruby
[03:34:19] mtkd: has joined #ruby
[03:38:43] milardovich: has joined #ruby
[03:44:01] bigblind: has joined #ruby
[03:59:35] govg: has joined #ruby
[04:04:14] cpruitt: has joined #ruby
[04:05:44] rippa: has joined #ruby
[04:17:09] bigblind: has joined #ruby
[04:19:23] milardovich: has joined #ruby
[04:19:24] gix: has joined #ruby
[04:25:14] trautwein: has joined #ruby
[04:25:52] cpruitt: has joined #ruby
[04:26:18] solocshaw: has joined #ruby
[04:30:08] cpruitt: has joined #ruby
[04:39:20] roshanavand: has joined #ruby
[04:42:16] bigblind: has joined #ruby
[04:56:53] bigblind: has joined #ruby
[04:57:02] sanscoeur: has joined #ruby
[04:58:51] cpruitt: has joined #ruby
[05:06:37] bigblind: has joined #ruby
[05:09:00] cschneid: has joined #ruby
[05:14:05] cpruitt: has joined #ruby
[05:17:36] Bounga: has joined #ruby
[05:20:30] regedit: has joined #ruby
[05:33:40] bigblind: has joined #ruby
[05:35:29] cpruitt: has joined #ruby
[05:39:36] mtkd: has joined #ruby
[05:42:50] Xiti: has joined #ruby
[05:59:18] ChanServ: +o baweaver
[05:59:40] bigblind: has joined #ruby
[05:59:40] ChanServ: -o baweaver
[06:07:21] u0157542: has joined #ruby
[06:11:53] cpruitt: has joined #ruby
[06:16:00] milardovich: has joined #ruby
[06:16:33] roshanavand: has joined #ruby
[06:17:22] bigblind: has joined #ruby
[06:18:03] za1b1tsu: has joined #ruby
[06:20:30] hogetaro: has joined #ruby
[06:24:39] cpruitt: has joined #ruby
[06:25:22] milardovich: has joined #ruby
[06:27:54] u0157542: has joined #ruby
[06:28:58] Guest14: has joined #ruby
[06:29:01] mozzarella: has joined #ruby
[06:31:34] hhffppff: has joined #ruby
[06:41:39] cpruitt: has joined #ruby
[06:49:08] jeffreylevesque: has joined #ruby
[06:49:53] Dimik: has joined #ruby
[06:55:45] bigblind: has joined #ruby
[07:02:41] cpruitt: has joined #ruby
[07:06:49] milardovich: has joined #ruby
[07:07:16] u0157542: has joined #ruby
[07:12:44] RLa: has joined #ruby
[07:13:17] conta: has joined #ruby
[07:14:22] bigblind: has joined #ruby
[07:16:26] selim: has joined #ruby
[07:17:47] Bounga: has joined #ruby
[07:17:50] gothicsouth: has joined #ruby
[07:24:00] cpruitt: has joined #ruby
[07:29:47] u0157542: has joined #ruby
[07:31:00] Bounga: has joined #ruby
[07:32:06] martinw1: has joined #ruby
[07:32:19] mongag: has joined #ruby
[07:35:29] bigblind: has joined #ruby
[07:37:12] _aeris_: has joined #ruby
[07:37:44] eckhardt: has joined #ruby
[07:38:13] selim_: has joined #ruby
[07:45:14] rabajaj: has joined #ruby
[07:45:41] cpruitt: has joined #ruby
[07:47:58] milardovich: has joined #ruby
[07:52:46] dionysus69: has joined #ruby
[07:55:53] andikr: has joined #ruby
[08:02:29] venmx: has joined #ruby
[08:10:43] milardovich: has joined #ruby
[08:10:55] bigblind: has joined #ruby
[08:12:42] guardianx: has joined #ruby
[08:22:13] Immune: has joined #ruby
[08:23:30] clemens3: has joined #ruby
[08:23:34] geoffr: has joined #ruby
[08:25:21] geoffr: Hi all, I was wondering if there's simple way to run methods (such as FileUtils.mkdir_p ) but with sudo? For example I'm writing a service to run as an unprivileged user but that service needs to create directory for another user and I would like to avoid having to write my own system call
[08:28:28] ur5us: has joined #ruby
[08:29:00] amatas: has joined #ruby
[08:29:11] mark_66: has joined #ruby
[08:31:38] vondruch: has joined #ruby
[08:33:19] roshanavand: has joined #ruby
[08:34:02] u0157542: has joined #ruby
[08:35:01] jnollette: has joined #ruby
[08:36:08] bigblind: has joined #ruby
[08:36:08] claudiuinberlin: has joined #ruby
[08:36:28] roshanavand: has joined #ruby
[08:36:36] vondruch: has joined #ruby
[08:39:03] milardovich: has joined #ruby
[08:40:16] milardovich: has joined #ruby
[08:40:54] jaruga: has joined #ruby
[08:42:22] morfin60: has joined #ruby
[08:42:34] morfin60: what's simpliest way to remove first element in path
[08:42:51] morfin60: as example i have /A/B/C/D/E i need to remove A whatevet it is
[08:43:43] `derpy: http://ruby-doc.org/core-2.4.1/String.html
[08:43:44] baweaver: https://ruby-doc.org/core-2.4.0/String.html
[08:44:01] baweaver: Read through the string documentation
[08:44:55] aupadhye: has joined #ruby
[08:46:04] cpruitt: has joined #ruby
[08:46:28] harmaahylje: has joined #ruby
[08:49:10] RLa: has left #ruby: ("Leaving")
[08:50:45] konos5_: has joined #ruby
[08:51:17] konos5_: Hi, any thoughts on this?
[08:51:18] konos5_: https://stackoverflow.com/questions/48609722/availability-of-methods-defined-in-module-singleton-class
[08:51:53] mikecmpbll: has joined #ruby
[09:00:14] dminuoso: konos5_: Ruby has a relatively simple method lookup.
[09:00:15] anisha: has joined #ruby
[09:00:16] morfin60: not sure it's valid
[09:00:36] konos5_: right then up, correct?
[09:00:41] dminuoso: konos5_: It basically works like this: Take the receiver (whatever is on the left side of the dot in the method call), determine its class, and then check its ancestory for the method.
[09:01:39] dminuoso: konos5_: To allow for certain patterns to emerge, the algorithm has one little quirk - the ancestory implicitly begins with the receivers singleton class.
[09:02:23] dminuoso: konos5_: Next up, class << self is not a special thing, its a general syntax.
[09:02:26] havenwood: morfin60: Just #sub when you only want to do it once. Maybe something like: sub(/\A\/?[^\/]*/, '')
[09:02:33] dminuoso: You can do "class << foo" for anything to "open its singleton class"
[09:02:54] dminuoso: konos5_: So "class << self" is kind of similar to self.singleton_class.instance_eval
[09:03:04] cpruitt: has joined #ruby
[09:03:17] dminuoso: similary def foo.bar defines a method in foo's singleton class
[09:03:53] konos5_: let me stop you right there
[09:04:02] konos5_: I aware of this
[09:04:11] konos5_: I even get the post's answer
[09:04:35] konos5_: However the answer can't be explained using this diagram:
[09:04:36] konos5_: https://ibb.co/jQFctx
[09:04:55] Immune: has joined #ruby
[09:04:58] konos5_: ...which I found in Ruby Metaprogramming 2nd Edition
[09:05:38] konos5_: using depicted diagram only regular classes should get `Module`'s methods
[09:05:50] konos5_: ...and not their singleton classes...
[09:06:10] konos5_: ..yet we know that a singleton class is also an object thus its class is `Class`...
[09:06:21] konos5_: but that won't show in the diagram..!
[09:07:31] dextrey: has joined #ruby
[09:10:29] SebastianThorn: has joined #ruby
[09:12:47] ahrs: has joined #ruby
[09:14:04] ur5us: has joined #ruby
[09:14:56] ur5us: has joined #ruby
[09:18:33] Kilo`byte: has joined #ruby
[09:18:50] guille-moe: has joined #ruby
[09:19:59] cpruitt: has joined #ruby
[09:20:48] zigzig: has joined #ruby
[09:21:34] milardovich: has joined #ruby
[09:24:11] RougeR: has joined #ruby
[09:24:11] RougeR: has joined #ruby
[09:27:47] guille-moe: has joined #ruby
[09:31:32] venmx: has joined #ruby
[09:37:21] cpruitt: has joined #ruby
[09:39:37] venmx: has joined #ruby
[09:41:42] Immune: has joined #ruby
[09:42:36] jaruga: has joined #ruby
[09:43:26] klixto: has joined #ruby
[09:49:04] jottr: has joined #ruby
[09:50:14] mtkd: has joined #ruby
[09:52:56] ltem: has joined #ruby
[09:53:15] Jameser: has joined #ruby
[09:55:12] amatas: has joined #ruby
[10:01:20] devil_tux: has joined #ruby
[10:02:28] tvw: has joined #ruby
[10:02:49] milardovich: has joined #ruby
[10:02:52] tomphp: has joined #ruby
[10:04:18] Beams: has joined #ruby
[10:06:50] tomphp_: has joined #ruby
[10:08:08] rabajaj: has joined #ruby
[10:09:35] tomphp: has joined #ruby
[10:12:13] marr: has joined #ruby
[10:15:22] drewmcmillan: has joined #ruby
[10:16:04] ledestin: has joined #ruby
[10:17:30] cpruitt: has joined #ruby
[10:17:44] Immune: has joined #ruby
[10:20:24] ledestin: has joined #ruby
[10:28:56] cpruitt: has joined #ruby
[10:33:41] ur5us: has joined #ruby
[10:35:47] za1b1tsu: has joined #ruby
[10:37:38] ldnunes: has joined #ruby
[10:41:50] cpruitt: has joined #ruby
[10:44:03] desperek: has joined #ruby
[10:44:09] milardovich: has joined #ruby
[10:45:22] bigblind: has joined #ruby
[10:53:55] Serpent7776: has joined #ruby
[10:56:37] n0m4d1c: has joined #ruby
[10:57:31] Immune: has joined #ruby
[10:58:18] tvw: has joined #ruby
[11:01:50] cpruitt: has joined #ruby
[11:04:12] bigblind: has joined #ruby
[11:07:56] drewmcmillan: has joined #ruby
[11:09:44] morfin60: dminuoso, simple!?
[11:09:48] dminuoso: morfin60: Yes.
[11:10:51] dminuoso: konos5_: I made this diagram a while ago: http://i.imgur.com/04Mlrwp.png
[11:11:16] dminuoso: konos5_: It's ignoring modules for various reasons, but you could think of them as beind added to the left (prepending) and right (including) of classes.
[11:11:28] morfin60: and why the heck you call it simple?
[11:12:17] dminuoso: morfin60: Well things like private/public and method_missing aside, it's fairly simple: Get ancestory, check each class in ancestory, pick first matching method.
[11:12:44] dminuoso: Then it just becomes an issue of "what is the ancestory exactly"
[11:12:50] alex``: has joined #ruby
[11:12:55] leitz: has joined #ruby
[11:13:38] dminuoso: (The reason that I ignore private/public is this super frustrating bit, that if you mark a method as _private_, depending on _how_ you send the corresponding symbol it might either error out about calling a method, or pick method_missing instead.
[11:14:03] morfin60: as example we have something like Object->Module->Class->Foo->Instance of Foo, there can be ancestors for every level
[11:14:13] morfin60: *on every level
[11:14:17] dminuoso: morfin60: And it even makes things like super easy to understand. It's just "resume lookup and call the next matching"
[11:14:29] dextrey: has joined #ruby
[11:14:34] morfin60: does Ruby avoid looking up same thing somehow?
[11:14:45] dminuoso: morfin60: For `super`? Yes.
[11:15:00] dminuoso: It's basically "follow the super chain of the current rclass for the next matching"
[11:15:12] morfin60: as example Foo include Bar, Bar is basically Class
[11:15:26] dminuoso: morfin60: nope..
[11:15:30] morfin60: will Class and Object and Module looked up once
[11:16:11] dminuoso: Bar is then tucked to the right side of Foo, so that the diagram would look [Foo][Bar]--super-->[Object]--super-->[BasicObject]--super-->nil
[11:16:22] dminuoso: Prepend does the same thing, except it packs it on the left side
[11:16:38] dminuoso: (Note that this is only a mental model, because internally its a bit different)
[11:16:50] workmad3: has joined #ruby
[11:18:05] dminuoso: It's also the reason why I chose to do this vertically, so that "prepend" and "append" (i.e. include) works visually well.
[11:18:15] dminuoso: And when I say vertically I mean horizontally.
[11:20:43] qba73: has joined #ruby
[11:21:37] ramfjord: has joined #ruby
[11:22:52] marataziat: has joined #ruby
[11:25:32] milardovich: has joined #ruby
[11:26:35] tomphp_: has joined #ruby
[11:28:07] tAn: has joined #ruby
[11:30:45] phs^: has joined #ruby
[11:33:20] TomyWork: has joined #ruby
[11:34:26] phs^: has joined #ruby
[11:35:36] phs^: has joined #ruby
[11:36:04] marataziat: how to say Hello World in ruby?
[11:36:10] phs^: has joined #ruby
[11:36:51] phs^: has joined #ruby
[11:37:25] phs^: has joined #ruby
[11:39:07] KevinSjoberg: marataziat: puts "hello, world!"
[11:44:32] ramfjord: has joined #ruby
[11:45:29] Beams: has joined #ruby
[11:51:17] devil_tux: has joined #ruby
[11:55:20] mtkd: has joined #ruby
[11:56:24] nadir: has joined #ruby
[12:00:17] bigblind: has joined #ruby
[12:04:10] John_Ivan: has joined #ruby
[12:05:18] Ishido: has joined #ruby
[12:05:20] goatish: has joined #ruby
[12:06:35] Immune: has joined #ruby
[12:06:41] locsmif: has joined #ruby
[12:06:49] milardovich: has joined #ruby
[12:09:27] marataziat: has joined #ruby
[12:18:44] klixto: has joined #ruby
[12:19:19] TomyWork: has joined #ruby
[12:21:48] SynSynack: has joined #ruby
[12:28:10] bigblind: has joined #ruby
[12:32:55] Xiti: has joined #ruby
[12:34:40] ur5us: has joined #ruby
[12:35:17] drewmcmillan: has joined #ruby
[12:36:54] amatas_: has joined #ruby
[12:41:30] Lyubo1: has joined #ruby
[12:44:51] qba73: has joined #ruby
[12:45:26] Immune: has joined #ruby
[12:46:30] ramfjord: has joined #ruby
[12:48:04] milardovich: has joined #ruby
[12:55:54] tcopeland: has joined #ruby
[12:58:29] VladGh: has joined #ruby
[12:59:43] skweek: has joined #ruby
[13:00:29] milardovich: has joined #ruby
[13:00:48] milardovich: has joined #ruby
[13:01:10] zigzig: has joined #ruby
[13:04:25] apparition: has joined #ruby
[13:06:17] AJA4350: has joined #ruby
[13:13:51] cadillac_: has joined #ruby
[13:15:42] randomstrangerb: has joined #ruby
[13:17:53] jeffreylevesque: has joined #ruby
[13:21:17] John_Ivan: has joined #ruby
[13:21:17] John_Ivan: has joined #ruby
[13:22:11] shinnya: has joined #ruby
[13:23:35] DrCode: has joined #ruby
[13:23:55] Immune: has joined #ruby
[13:26:35] jeffreylevesque_: has joined #ruby
[13:30:12] Hanmac: has joined #ruby
[13:38:10] govg: has joined #ruby
[13:39:12] ShekharReddy: has joined #ruby
[13:39:34] devil_tux: has joined #ruby
[13:40:01] venmx: has joined #ruby
[13:42:20] marataziat: has joined #ruby
[13:45:17] cpruitt: has joined #ruby
[13:45:40] quobo: has joined #ruby
[13:52:56] cdg: has joined #ruby
[13:53:08] jottr: has joined #ruby
[14:00:04] cpruitt: has joined #ruby
[14:00:36] Immune: has joined #ruby
[14:00:58] zautomata: has joined #ruby
[14:01:10] zautomata: has joined #ruby
[14:04:58] qba73: has joined #ruby
[14:13:31] cpruitt: has joined #ruby
[14:15:08] alex``: has joined #ruby
[14:16:26] skinux: has joined #ruby
[14:17:19] skinux: Can someone help me solve this? I've already tried reinstalling Ruby https://gist.github.com/skinuxgeek/0afebc27de9bcc0ee806d9ac0bfd5439
[14:20:48] alfiemax: has joined #ruby
[14:21:08] victorjtfranco: has joined #ruby
[14:21:31] d10n-work: has joined #ruby
[14:25:16] Ishido: has joined #ruby
[14:25:46] jhass: skinux: how did you install ruby and what's your OS? Also could you amend the gist with the output of gem env?
[14:25:59] skinux: Ubuntu Xenial, using repo
[14:26:31] workmad3: has joined #ruby
[14:26:44] skinux: Gist appended
[14:27:57] DLSteve: has joined #ruby
[14:28:07] jhass: which repo?
[14:28:24] jhass: ah nvm the official one
[14:29:19] jhass: do you have a /usr/bin/rake as well?
[14:30:13] jhass: could you try just deleting /usr/local/bin/rake?
[14:30:45] skinux: Deleted it
[14:30:50] schneide_: has joined #ruby
[14:31:20] jhass: now the error should be gone or at least the output should be different
[14:32:20] Beams: has joined #ruby
[14:34:16] workmad3: has joined #ruby
[14:35:19] ur5us: has joined #ruby
[14:37:55] Immune: has joined #ruby
[14:38:57] oleo: has joined #ruby
[14:39:00] skinux: It can't find rake, looking at /usr/local/bin/
[14:39:08] catphish: has joined #ruby
[14:39:09] skinux: Should I symlink it to usr/bin?
[14:39:27] jhass: what exactly is the error message?
[14:39:39] skinux: "bash: /usr/local/bin/rake: No such file or directory"
[14:39:44] morfin60: how do i parse timestamp as value with specific timezone?
[14:39:48] morfin60: as example i have
[14:40:32] jhass: skinux: so something is referring explicitly to that? could you maybe provide some more context into what you're doing/running?
[14:40:48] skinux: Just trying to run rake on a rakefile
[14:41:05] morfin60: as example i have 1516208400 i want to parse it with Asia/Moskow timezone so reported date will be something like 2018-01-17 17:00:00 +03:00
[14:41:15] jhass: what if you run /usr/bin/rake explicitly?
[14:42:24] skinux: Gist updated
[14:42:35] qba73: has joined #ruby
[14:43:05] jhass: skinux: is there a Gemfile next to the Rakefile?
[14:43:16] skinux: I don't see one
[14:43:23] skinux: It's Adva CMS if that helps any
[14:43:28] jhass: ah, so ancient rails app I guess
[14:43:46] jhass: activesupport 2.3 is really really old
[14:43:52] jhass: not sure it'll even work with ruby 2.3
[14:44:01] skinux: Hmm. Any suggestion for a good one?
[14:45:02] jhass: not really, I'm not into CMSes, sorry. The little needs into that direction I have I solve with static site generators
[14:45:31] jhass: https://github.com/markets/awesome-ruby#cms here's a list of ruby based ones
[14:46:04] nikivi: has joined #ruby
[14:46:23] griffindy: has joined #ruby
[14:46:30] morfin60: strptime seems to be assuming that i have timezone UTC
[14:46:49] jhass: morfin60: why do you have a unix timestamp that's not in UTC?
[14:46:55] jhass: usually they all are
[14:47:19] jhass: so for 1516208400 2018-01-17 20:00:00 +03:00 would be correct
[14:47:22] morfin60: it's stored in database as UTC but server(opentsdb) convert it for me
[14:47:28] skinux: Okay. Thanks
[14:47:36] morfin60: >> DateTime.strptime(1516208400, "%s")
[14:47:38] ruby[bot]: morfin60: # => uninitialized constant DateTime (NameError) ...check link for more (https://eval.in/949902)
[14:47:59] morfin60: >> require 'date'; DateTime.strptime(1516208400, "%s")
[14:48:00] ruby[bot]: morfin60: # => no implicit conversion of Bignum into String (TypeError) ...check link for more (https://eval.in/949903)
[14:48:08] dminuoso: jhass: Unix timestamps dont have a timezone?
[14:48:12] morfin60: >> require 'date'; DateTime.strptime("1516208400", "%s")
[14:48:13] ruby[bot]: morfin60: # => #<DateTime: 2018-01-17T17:00:00+00:00 ((2458136j,61200s,0n),+0s,2299161j)> (https://eval.in/949904)
[14:48:44] milardovich: has joined #ruby
[14:48:46] jhass: dminuoso: because they're counting from 1970-01-01 00:00:00 UTC, so in practice they're seconds since that in UTC
[14:48:58] Prutheus: has joined #ruby
[14:49:02] dminuoso: jhass: Oh I see what you mean.
[14:49:14] Prutheus: mattwc: hello, you remember me from yesterday with ebay api stuff?
[14:49:30] dminuoso: jhass: Heya by the way. Haven't seen you around in a while. :)
[14:49:41] jhass: morfin60: so far that's very expected
[14:50:09] Prutheus: mattwc: today i found a new question ... https://developer.ebay.com/Devzone/finding/CallRef/findItemsAdvanced.html look at categoryId, I can define multiple ones in a call, but how to add multiple categoryId to my params hash?
[14:50:56] jhass: morfin60: so you're saying your DB is incorrectly assuming the date you give it (in whatever way) is UTC?
[14:51:28] jhass: while it's localtime, which in your case is +0300?
[14:52:03] mattwc: prutheus: hmmm, you can't really define the same key multiple times, I think you'd be better off just making your own raw requests and constructing the URL yourself
[14:52:44] coreycosman: has joined #ruby
[14:53:31] Prutheus: hm,,,,so i cant define multiple categories?
[14:54:29] mattwc: I don't see an easy way too, hashes can only have a key defined one and the eBay API ways the same key multiple times
[14:55:14] jhass: prutheus: no idea about the particular lib you're using, but in general the first thing I would try is giving an array as the value
[14:56:01] mattwc: Yeah reading the code last night that wouldn't work from my memory
[14:56:31] banisterfiend: has joined #ruby
[14:56:32] drewmcmillan: has joined #ruby
[14:56:49] mattwc: It just does a very basic string interpolation of "?#{key}=#{value}"
[14:56:49] za1b1tsu: has joined #ruby
[14:57:21] Prutheus: hm okay yeah you are right, then i just dont support multiple categories, what else should i do :/
[14:57:34] jhass: write a better client lib :P
[14:57:43] morfin60: Opentsdb seems to be weird
[14:57:46] mattwc: At this point, I'd just build the request yourself using like restclient or something
[14:58:07] Prutheus: i can do a category(0)
[14:58:13] Prutheus: category(1) like the itemfilters
[14:58:40] banisterfiend: apeiros check this out homie, show-c is new http://recordit.co/MusSastE0P
[14:58:47] cschneid: has joined #ruby
[14:58:59] jhass: morfin60: easiest might be to make sure to work with UTC dates everywhere possible and only convert to localtime at presentation
[14:59:55] jhass: so calling .utc in your parsed dates and .localtime before display
[15:00:13] mattwc: prutheus: if that works sweet
[15:02:15] jhass: banisterfiend: nice one
[15:02:30] jhass: how do you do that in the background? ctags db?
[15:03:24] banisterfiend: but the data from etags is a little weird, so i process it a bit
[15:06:12] jamesaxl: has joined #ruby
[15:07:14] nclx: has joined #ruby
[15:10:36] burgestrand: has joined #ruby
[15:12:57] Immune: has joined #ruby
[15:13:51] cschneid: has joined #ruby
[15:14:34] skinux: has left #ruby: ("Konversation terminated!")
[15:15:03] Rapture: has joined #ruby
[15:15:57] milardov_: has joined #ruby
[15:17:25] linduxed: has joined #ruby
[15:19:01] nowhereman_: has joined #ruby
[15:20:38] nowhereman_: has joined #ruby
[15:21:04] schneide_: has joined #ruby
[15:22:36] coreycosman: has left #ruby: ()
[15:22:39] workmad3: has joined #ruby
[15:24:42] coreycosman: has joined #ruby
[15:25:21] coreycosman: has left #ruby: ()
[15:26:06] Psybur: has joined #ruby
[15:26:53] qba73: has joined #ruby
[15:29:06] white_lilies: has joined #ruby
[15:37:13] Psybur_: has joined #ruby
[15:37:28] cabotto: has joined #ruby
[15:39:26] cschneid: has joined #ruby
[15:40:26] LastWhisper____: has joined #ruby
[15:41:05] zautomata: has joined #ruby
[15:41:23] pastorinni: has joined #ruby
[15:48:46] x77686d: has joined #ruby
[15:54:22] zleap: hmm Who was I chatting to yesterday about the 90 day challenge, i want to ask if I can fork the repository i was given
[15:54:28] schneide_: has joined #ruby
[15:55:46] nicesignal: has joined #ruby
[15:59:28] dinfuehr: has joined #ruby
[16:00:11] stormpack: has joined #ruby
[16:03:24] Ishido: has joined #ruby
[16:05:04] mtkd: has joined #ruby
[16:06:00] snath: has joined #ruby
[16:06:29] alfiemax: has joined #ruby
[16:06:47] ruby[bot]: You can find a log of this channel at https://irclog.whitequark.org/ruby/
[16:08:14] ramfjord: has joined #ruby
[16:09:33] drewmcmillan: has joined #ruby
[16:10:03] kapil___: has joined #ruby
[16:10:14] goatish: has joined #ruby
[16:12:21] zleap: yay found it thanks
[16:12:49] qba73: has joined #ruby
[16:17:23] banisterfiend: has joined #ruby
[16:17:32] k0mpa: has joined #ruby
[16:19:25] nowhere_man: has joined #ruby
[16:19:30] Beams: has joined #ruby
[16:21:23] Ishido: has joined #ruby
[16:21:41] Immune: has joined #ruby
[16:22:19] ramfjord: has joined #ruby
[16:23:57] schneide_: has joined #ruby
[16:24:48] antoniobeyah_: has joined #ruby
[16:25:48] antoniobeyah: has joined #ruby
[16:25:48] antoniobeyah: has joined #ruby
[16:28:01] cdg_: has joined #ruby
[16:28:44] morfin: has joined #ruby
[16:29:45] morfin: my timezones screwed up
[16:31:20] randomstrangerb: has joined #ruby
[16:33:52] troys: has joined #ruby
[16:35:57] ur5us: has joined #ruby
[16:35:59] skweek: has joined #ruby
[16:36:42] kiltzman: has joined #ruby
[16:37:17] kiltzman: has joined #ruby
[16:37:47] kiltzman: has joined #ruby
[16:40:19] ferox: has joined #ruby
[16:42:20] hahuang65: has joined #ruby
[16:42:27] banisterfiend: has joined #ruby
[16:48:43] TomyLobo: has joined #ruby
[16:50:38] Ishido: has joined #ruby
[16:52:59] schneide_: has joined #ruby
[16:56:25] n0m4d1c: has joined #ruby
[16:57:30] [Butch]: has joined #ruby
[16:58:56] guille-moe: has joined #ruby
[17:02:05] Immune: has joined #ruby
[17:02:09] marxarelli: has joined #ruby
[17:03:55] conta: has joined #ruby
[17:04:50] stormpack: has joined #ruby
[17:09:26] ledestin: has joined #ruby
[17:13:13] alfiemax: has joined #ruby
[17:15:44] guacamole: has joined #ruby
[17:15:44] guacamole: has joined #ruby
[17:16:32] rippa: has joined #ruby
[17:19:02] x77686d: has joined #ruby
[17:19:58] white_lilies: has joined #ruby
[17:25:02] ltem: has joined #ruby
[17:25:44] hoylemd: has left #ruby: ()
[17:27:09] Mike11: has joined #ruby
[17:27:57] ramfjord: has joined #ruby
[17:28:27] apeiros: banisterfiend: oooooh, nice! me like!
[17:30:59] c0ncealed: has joined #ruby
[17:33:00] white_lilies: has joined #ruby
[17:35:21] jottr: has joined #ruby
[17:36:38] armyriad: has joined #ruby
[17:41:59] Immune: has joined #ruby
[17:43:24] jnollette: has joined #ruby
[17:43:56] atchoum: has joined #ruby
[17:44:27] qba73: has joined #ruby
[17:45:00] randomstrangerb: has joined #ruby
[17:45:15] arkinor: has joined #ruby
[17:45:53] alfiemax: has joined #ruby
[17:46:40] bigblind: has joined #ruby
[17:47:23] suhdood: has joined #ruby
[17:49:41] sanscoeur: has joined #ruby
[17:50:21] sanscoeur: has joined #ruby
[17:51:16] yn^: has joined #ruby
[17:51:54] yn^: has joined #ruby
[17:52:27] yn^: has joined #ruby
[17:53:01] yn^: has joined #ruby
[17:53:39] yn^: has joined #ruby
[17:54:17] orbyt_: has joined #ruby
[17:54:24] yn^: has joined #ruby
[17:56:46] alfiemax: has joined #ruby
[17:59:12] kies: has joined #ruby
[17:59:41] Beams: has joined #ruby
[18:01:21] clemens3: has joined #ruby
[18:05:31] guacamole: has joined #ruby
[18:05:31] guacamole: has joined #ruby
[18:07:56] raynold: has joined #ruby
[18:08:44] mtkd: has joined #ruby
[18:09:22] chouhoulis: has joined #ruby
[18:10:21] roshanavand: has joined #ruby
[18:11:14] randomstrangerb: has joined #ruby
[18:11:46] nowhere_man: has joined #ruby
[18:15:24] x77686d: has joined #ruby
[18:16:32] schneide_: has joined #ruby
[18:17:47] hoylemd: has joined #ruby
[18:17:57] RougeR: has joined #ruby
[18:17:57] RougeR: has joined #ruby
[18:18:04] Lytol: has joined #ruby
[18:20:01] Emmanuel_Chanel: has joined #ruby
[18:20:28] thither: has joined #ruby
[18:20:54] thither: Can I do something so that a script gets the same namespace as a module?
[18:21:04] thither: For the purpose of a DSL
[18:21:44] nit3rid3: has joined #ruby
[18:22:32] havenwood: thither: Say more?
[18:23:13] thither: I have a file with a module called DSL. In the module I have defined refinements, classes, and methods
[18:23:28] thither: In a seperate file I require_relative and then say using DSL
[18:23:49] thither: I can use the refinements, but can't call the classes or functions of the method
[18:23:58] dviola: has joined #ruby
[18:24:13] thither: s/refinements, classes, and methods/refinements, classes, and functions/
[18:27:26] havenwood: thither: Are you using `include` as well as `using`? I do refinements in separate modules, but I haven't thought about why.
[18:27:52] thither: Nah, just require and using.
[18:28:23] tomphp: has joined #ruby
[18:29:11] thither: Okay, my bad.
[18:29:32] thither: Thanks - I've only ever done Rails so doing actual Ruby stuff makes me look like an idiot :P
[18:29:36] schneide_: has joined #ruby
[18:29:46] havenwood: thither: I'm not sure what to recommend without seeing the code, but I suspect you might want to consider using module_function with an include, and also look at Module#included.
[18:30:36] havenwood: thither: No worries at all! If you can show some code folk here might be able to give more concrete suggestions.
[18:31:37] orbyt_: has joined #ruby
[18:31:59] ramfjord: has joined #ruby
[18:34:03] ur5us: has joined #ruby
[18:36:06] alfiemax_: has joined #ruby
[18:42:37] PaulCapestany: has joined #ruby
[18:43:40] schneide_: has joined #ruby
[18:45:28] burgestrand: has joined #ruby
[18:52:57] OyoKooN: has joined #ruby
[18:57:15] orbyt_: has joined #ruby
[18:57:54] thither: has joined #ruby
[18:58:23] ltem: has joined #ruby
[18:59:55] Bounga: has joined #ruby
[19:03:49] arkinor: has joined #ruby
[19:04:09] schneide_: has joined #ruby
[19:04:16] shinnya: has joined #ruby
[19:08:35] sameerynho: has joined #ruby
[19:10:25] John_Ivan: has joined #ruby
[19:10:31] Lytol: has joined #ruby
[19:12:33] suhdood: has joined #ruby
[19:13:46] Beams_: has joined #ruby
[19:14:08] Hanmac: has joined #ruby
[19:17:16] jrvlima: has joined #ruby
[19:18:43] tAn: has joined #ruby
[19:19:20] krawchyk: has joined #ruby
[19:21:23] victorjtfranco: has joined #ruby
[19:22:45] Beams: has joined #ruby
[19:27:42] cdg: has joined #ruby
[19:27:43] drewmcmillan: has joined #ruby
[19:27:46] mistym: has joined #ruby
[19:28:44] alfiemax: has joined #ruby
[19:31:25] ramfjord: has joined #ruby
[19:32:07] Immune: has joined #ruby
[19:33:21] x77686d: has joined #ruby
[19:33:43] ldepandis: has joined #ruby
[19:34:39] wilbert: has joined #ruby
[19:35:19] naftilos76: has joined #ruby
[19:37:13] _aeris_: has joined #ruby
[19:37:28] white_lilies: has joined #ruby
[19:40:05] weaksauce: has joined #ruby
[19:42:00] guille-moe: has joined #ruby
[19:46:02] victorjtfranco: has joined #ruby
[19:46:59] za1b1tsu: has joined #ruby
[19:48:43] guille-moe: has joined #ruby
[19:51:26] dionysus69: has joined #ruby
[19:52:04] thither: has joined #ruby
[19:52:19] venmx: has joined #ruby
[19:55:28] jrvlima: has joined #ruby
[19:55:41] x77686d: has joined #ruby
[19:56:38] Dimik: has joined #ruby
[19:57:43] guacamole: has joined #ruby
[19:57:43] guacamole: has joined #ruby
[19:57:44] jnollette: has joined #ruby
[19:58:35] elcontrastador: has joined #ruby
[20:00:10] John_Ivan: has joined #ruby
[20:00:31] schneide_: has joined #ruby
[20:02:13] Bounga: has joined #ruby
[20:03:09] raul782: has joined #ruby
[20:07:05] Tempesta: has joined #ruby
[20:07:51] guacamole: has joined #ruby
[20:07:51] guacamole: has joined #ruby
[20:08:00] nathani: has joined #ruby
[20:13:41] banisterfiend: has joined #ruby
[20:13:51] mtkd: has joined #ruby
[20:15:05] minimalism: has joined #ruby
[20:16:46] drocsid: has joined #ruby
[20:19:33] rrichardsr3: has joined #ruby
[20:21:40] guacamole: has joined #ruby
[20:21:40] guacamole: has joined #ruby
[20:25:43] roshanavand: has joined #ruby
[20:34:08] alfiemax: has joined #ruby
[20:37:48] pastorinni: has joined #ruby
[20:39:42] Bounga`: has joined #ruby
[20:40:33] claudiuinberlin: has joined #ruby
[20:46:11] guacamole: has joined #ruby
[20:46:11] guacamole: has joined #ruby
[20:46:27] Beams: has joined #ruby
[20:46:38] tomphp: has joined #ruby
[20:53:12] quobo: has joined #ruby
[20:56:01] klixto: has joined #ruby
[20:58:06] schneide_: has joined #ruby
[20:58:10] n0m4d1c: has joined #ruby
[21:00:07] Bounga`: has joined #ruby
[21:02:21] guacamole: has joined #ruby
[21:02:21] guacamole: has joined #ruby
[21:02:52] Ishido: has joined #ruby
[21:04:31] cdg: has joined #ruby
[21:06:12] cdg_: has joined #ruby
[21:06:32] orbyt_: has joined #ruby
[21:08:17] RougeR: has joined #ruby
[21:08:17] RougeR: has joined #ruby
[21:08:21] venmx: has joined #ruby
[21:11:59] schneide_: has joined #ruby
[21:12:24] workmad3: has joined #ruby
[21:18:52] guille-moe: has joined #ruby
[21:19:22] milardovich: has joined #ruby
[21:20:35] x77686d: has joined #ruby
[21:21:23] schneide_: has joined #ruby
[21:21:52] Trel: has joined #ruby
[21:25:21] milardov_: has joined #ruby
[21:25:23] arkinor: has joined #ruby
[21:25:57] jeffreylevesque: has joined #ruby
[21:26:38] alfiemax: has joined #ruby
[21:27:14] BH23: has joined #ruby
[21:28:27] riskish: has joined #ruby
[21:30:55] bigblind: has joined #ruby
[21:31:50] roshanavand: has left #ruby: ()
[21:32:14] roshanavand: has joined #ruby
[21:34:02] drocsid: Hi I'm new to ruby and defined a simple Gemfile and then try bundle install but get a bunch of errors: https://pastebin.com/aHp29ME3
[21:34:04] ruby[bot]: drocsid: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/567e1049d3f198c2bf1077382a95edbc
[21:34:04] ruby[bot]: drocsid: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[21:37:49] Zarthus: a blind guess is that you need to install ruby-dev in your pkgmgr
[21:40:02] schneide_: has joined #ruby
[21:41:23] drocsid: Zarthus: not sure about that. Thought the whole point of rvm , etc was to not install ruby stuff via my package manager...
[21:41:41] drocsid: Trying to install a different ruby version to see if that helps...
[21:42:40] Zarthus: don't know anything about rvm, but when building native extensions it seems to require ruby headers
[21:42:49] Zarthus: ruby-dev includes those headers
[21:42:49] guille-moe: has joined #ruby
[21:43:01] Zarthus: er, maybe not ruby-dev, but librubydev, or something like that
[21:43:09] alfiemax: has joined #ruby
[21:43:58] hoylemd: has left #ruby: ()
[21:46:44] goatish: has joined #ruby
[21:47:22] eckhardt: has joined #ruby
[21:48:04] drocsid: Zarthus: I will give it a shot. Thanks. Ruby packaging and stuff looks simple but is confusing...
[21:48:38] Hanmac: its not ruby's fault but it is how distry do the packages
[21:49:03] Hanmac: for most things it makes sense that you don't need the dev parts if you want to use a lib or application
[21:49:09] drocsid: Hmm yeah I dunno got that rvm business to install ruby as suggested. But I dunno.
[21:49:36] drocsid: Read all this stuff `don't install ruby from your package manager`
[21:49:50] drocsid: now I hear I need ruby-dev
[21:50:05] drocsid: Didn't see that mentioned elsewhere...
[21:50:17] havenwood: drocsid: What version of Ruby are you trying to install?
[21:50:24] havenwood: drocsid: Is it for dev or prod?
[21:50:32] havenwood: drocsid: Do you need more than one version of Ruby?
[21:50:38] Hanmac: its also not about rvm but happens for other ruby too when using system ruby
[21:50:38] Hanmac: rvm does avoid that problem with installing all stuff
[21:50:38] Hanmac: PS: you currently not use rvm from what the gist told us
[21:51:36] drocsid: =* ruby-2.4.1 [ x86_64 ]
[21:52:23] Hanmac: hm no the problem is bundler currently seems to use system ruby, not the one you installed with rvm
[21:52:40] havenwood: drocsid: Quick fix: gem install bundler
[21:52:54] drocsid: yeah bundler was already installed
[21:53:10] havenwood: drocsid: Sanity check: gem which bundler
[21:53:13] havenwood: drocsid: which bundle
[21:53:26] Hanmac: you need to check where gem and ruby does point too
[21:53:30] nowhere_man: has joined #ruby
[21:53:58] drocsid: `/var/lib/gems/2.3.0/gems/bundler-1.16.1/lib/bundler.rb`
[21:54:08] drocsid: `/usr/local/bin/bundle`
[21:55:02] havenwood: drocsid: Are there any other bundlers installed?: which -a bundle
[21:55:08] drocsid: Not sure what happened but I think installing `ruby-dev` allowed the bundler to install it now...
[21:55:25] havenwood: drocsid: You either don't have bundler installed on your RVM Ruby (as suspected), or system Ruby bundler is ahead in the path.
[21:55:31] drocsid: which -a returns the same path above...
[21:55:41] havenwood: drocsid: So you don't have Bundler installed at all on your RVM Ruby.
[21:55:49] havenwood: drocsid: You do on your system Ruby.
[21:55:56] drocsid: Ok able to install after the ruby-dev package installation...
[21:56:09] drocsid: havenwood: just followed the docs regarding installing rvm.
[21:56:13] havenwood: drocsid: Then you bundled with your system Ruby.
[21:56:24] havenwood: It seems once you switched to your RVM Ruby you never installed Bundler.
[21:56:35] bmurt: has joined #ruby
[21:56:35] havenwood: gem install bundler
[21:56:42] havenwood: ^ with your RVM Ruby
[21:57:04] marxarelli: has joined #ruby
[21:57:16] drocsid: Allright well using system ruby now. Not sure how to swap. But it was able to install the module
[21:58:20] havenwood: drocsid: You're likely using RVM `gem` and `ruby` but system `bundle`.
[21:58:23] havenwood: drocsid: gem install bundler
[21:58:35] havenwood: drocsid: then check again: which -a bundle
[21:58:47] havenwood: (You should see the RVM one now on top.)
[22:01:29] drocsid: havenwood: need to be root to `gem install bundler`
[22:01:37] drocsid: `sudo gem install bundler`
[22:01:44] drocsid: `Successfully installed bundler-1.16.1`
[22:01:52] drocsid: `which -a bundle`
[22:01:53] havenwood: drocsid: which gem
[22:01:59] drocsid: `/usr/local/bin/bundle`
[22:02:29] havenwood: If the RVM `gem` isn't in front in your PATH, something is amiss.
[22:02:35] havenwood: drocsid: which -a gem
[22:02:42] havenwood: drocsid: Confirm: rvm current
[22:02:58] drocsid: `rvm current ruby-2.4.1`
[22:03:12] drocsid: `which -a gem /usr/bin/gem`
[22:04:47] drocsid: anyhow I was able to install the gems using bundle after installing `ruby-dev`. Not terribly happy about it, but seems that I have issues regarding the rvm installed ruby. I followed the instructions regarding ruby installation at the rvm site...
[22:04:48] milardovich: has joined #ruby
[22:05:01] Beams: has joined #ruby
[22:05:28] drocsid: So I am able to move forward. Think installing the `ruby-dev` package helped. Maybe all this is 2nd class in debian.. I don't know.
[22:05:42] havenwood: drocsid: I'm suspicious you somehow ended up doing a multi-user RVM installation (added sudo?) instead of the recommended single-user install.
[22:07:09] havenwood: drocsid: I'd suggest doing an `rvm implode --force` and then completely restarting your terminal to clear lingering env vars.
[22:07:23] n0m4d1c: has joined #ruby
[22:07:56] x77686d: has joined #ruby
[22:08:12] havenwood: drocsid: Then install Ruby 2.4.3 or 2.5.0, unless you really need 2.4.1.
[22:11:27] x77686d_: has joined #ruby
[22:12:42] drocsid: havenwood: just followed https://rvm.io/rvm/install#any-other-system
[22:12:43] tAn: has joined #ruby
[22:13:08] havenwood: drocsid: As a non-root user, without sudo: \curl -sSL https://get.rvm.io | bash
[22:13:12] drocsid: the basic install instructions. Want to move on to writing code but yeah I can try that again later.
[22:14:56] drocsid: ` \curl -sSL https://get.rvm.io | bash`
[22:15:36] drocsid: `Upgrading the RVM installation in REDACTED Upgrade of RVM in REDACTED is complete.`
[22:16:06] guille-moe: has joined #ruby
[22:18:21] workmad3: has joined #ruby
[22:20:45] hoylemd: has joined #ruby
[22:22:17] BH23: has joined #ruby
[22:24:28] white_lilies: has joined #ruby
[22:24:51] dogweather: has joined #ruby
[22:25:42] chouhoul_: has joined #ruby
[22:25:53] jeffreylevesque: has joined #ruby
[22:26:10] n0m4d1c: has joined #ruby
[22:35:00] raul782: has joined #ruby
[22:35:49] yosafbridge: has joined #ruby
[22:39:24] Mrgoose: has joined #ruby
[22:40:59] nowhere_man: has joined #ruby
[22:41:22] ferox: has joined #ruby
[22:42:06] guacamole: has joined #ruby
[22:42:06] guacamole: has joined #ruby
[22:42:14] hoylemd: has left #ruby: ()
[22:43:49] randomstrangerb: has joined #ruby
[22:45:53] drewmcmillan: has joined #ruby
[22:48:18] banisterfiend: has joined #ruby
[22:48:18] drocsid: I'm trying to understand rubies' match as it is used here: https://github.com/socketry/rubydns/blob/master/examples/flakey-dns.rb
[22:49:40] drocsid: I created a regex pattern on http://rubular.com/ with a single match group: single_ip_match_group = '/ip-([^.]*).*internal/'
[22:49:52] havenwood: drocsid: That's RubyDNS's match.
[22:50:09] drocsid: havenwood: thanks.. That makes sense...
[22:50:13] havenwood: drocsid: See: method(:match).owner
[22:50:14] havenwood: drocsid: And: method(:match).source_location
[22:50:22] havenwood: drocsid: https://github.com/socketry/rubydns/blob/8f90f12b63911dade1ac003b7c3fca531dd2e335/lib/rubydns/rule_based_server.rb#L34-L44?ts=2
[22:50:25] drocsid: How do I see the rubyDocs for ane xternal gem?
[22:50:50] drocsid: Again new to ruby...
[22:50:59] havenwood: ?pry drocsid
[22:50:59] ruby[bot]: drocsid: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[22:51:23] havenwood: drocsid: in IRB you can use: ri
[22:51:30] drocsid: Hmm no web based source?
[22:51:31] havenwood: drocsid: Or just use `ri` from your command line.
[22:51:35] havenwood: drocsid: Pry is nice.
[22:51:45] ur5us: has joined #ruby
[22:51:54] havenwood: drocsid: Sure, you can use the docs online. Or generate them yourself for local web browser use.
[22:52:42] drocsid: Any docs here: https://github.com/socketry/rubydns ?
[22:52:51] havenwood: drocsid: You can use `gem server` to run a local gem documentation server.
[22:52:59] drocsid: Hmm regardless of docs trying to match an ip pattern like above
[22:53:21] drocsid: match(single_ip_match_group) do |transaction, match_data|
[22:53:26] havenwood: drocsid: You can get pretty far with just irb and Ruby.
[22:53:35] havenwood: drocsid: Pry makes it easy to get at the code or docs.
[22:59:06] elomatreb: drocsid: For future reference, there are some sites that generate and host the embedded documentation in gems, e.g. for your gem/method: http://www.rubydoc.info/gems/rubydns/2.0.1/RubyDNS/RuleBasedServer#match-instance_method
[22:59:41] drocsid: elomatreb: Thanks. That's pretty convenient...
[23:00:00] drocsid: Still not sure why my match isn't working. The pattern seems to be ok via rubular...
[23:00:52] guacamole: has joined #ruby
[23:00:52] guacamole: has joined #ruby
[23:01:14] Tempesta_: has joined #ruby
[23:03:11] hahuang65: has joined #ruby
[23:03:48] drocsid: Anybody with a good guess. My string could be something like ip-88.22.355.23-us-east-1.computer.internal and my pattern is '/ip-([^.]*).*internal/'
[23:07:02] elomatreb: You want to extract the IP adress from it?
[23:08:13] havenwood: drocsid: [^.]
[23:09:17] drocsid: Yeah I want to match and then extract the IP. The match group contains the ip delimited by - . Then I do gsub. My issue is the pattern seems to match in rubular but not via a modified ruby dns example likehttps://github.com/socketry/rubydns/blob/master/examples/flakey-dns.rb
[23:09:26] havenwood: drocsid: Do you mean "any character except a newline" by that ^, because the dot isn't escaped so that's what it means.
[23:09:55] elomatreb: Dot does not get the special meaning in a character class
[23:10:17] drocsid: http://rubular.com/
[23:10:26] elomatreb: Neither do quantifiers btw
[23:10:47] drocsid: I put ip-([^.]*).*internal in the pattern
[23:11:09] havenwood: elomatreb: Ah, you're right of course.
[23:12:38] pastorin_: has joined #ruby
[23:12:44] elomatreb: drocsid: So, what do you know about the string? Is the part after the IP (-us-east-1.computer.internal) constant?
[23:19:07] mtkd: has joined #ruby
[23:23:48] regedit: has joined #ruby
[23:23:56] tcopeland: has joined #ruby
[23:26:21] atchoum: has joined #ruby
[23:28:29] white_lilies: has joined #ruby
[23:31:31] hoylemd: has joined #ruby
[23:31:37] eckhardt: has joined #ruby
[23:37:58] alfiemax: has joined #ruby
[23:39:00] drocsid: elomatreb: I mistyped the match string. ip-88-22-355-23.us-east-1.computer.internal is what I'm trying to match and again my pattern is the same ip-([^.]*).*internal
[23:39:19] drocsid: I get a match in rubular
[23:39:59] drocsid: The match group I plan on' replace with gsub("-",".")
[23:41:03] banisterfiend: has joined #ruby
[23:41:30] drocsid: The problem is I don't seem to match via RubyDNS' match, but do in Rubular...
[23:42:21] drocsid: Trying to match for all strings like ip-XX-XXX-X-XX.us-east-1.compute.internal
[23:43:29] drewmcmillan: has joined #ruby
[23:43:29] Zarthus: the regex itself looks fine
[23:44:00] drocsid: I'll share my ruby script. Hold on.
[23:44:01] Zarthus: well, "fine" is an overstatement, but it will do what you want
[23:44:04] elomatreb: Overly broad, but yes. It would also match `ip-garbage.internal`
[23:46:06] drocsid: https://gist.github.com/drocsid/588f3ba922be19aba639dcdbf3d5ba79
[23:46:17] drocsid: Yeah I don't mind if it's overly broad right now...
[23:46:32] raul782: has joined #ruby
[23:47:12] drocsid: I don't seem to end up in the match block, but in the otherwise block...
[23:48:17] nadir: has joined #ruby
[23:50:44] drocsid: Ok my bad. It seems to be because the regex pattern should not be a string...
[23:51:01] drocsid: single_ip_match_group = /ip-([^.]*).*internal/ works.
[23:58:15] ResidentBiscuit: has joined #ruby