« Back to channel list

#ruby - 20 September 2017

« Back 1 day Forward 1 day »
[00:03:30] yokel: has joined #ruby
[00:05:55] jinie: has joined #ruby
[00:06:05] creeg: has joined #ruby
[00:06:11] achillesturtle: has joined #ruby
[00:08:13] mtkd: has joined #ruby
[00:17:17] _aeris_: has joined #ruby
[00:20:51] tAn: has joined #ruby
[00:24:37] Cohedrin_: has joined #ruby
[00:26:01] MarkBilk_: has joined #ruby
[00:28:34] enterprisey: has joined #ruby
[00:30:45] bronson: has joined #ruby
[00:34:14] achillesturtle: has left #ruby: ()
[00:34:25] mson: has joined #ruby
[00:37:24] brent__: has joined #ruby
[00:40:31] gheegh: has joined #ruby
[00:40:46] jobewan: has joined #ruby
[00:40:50] nobitanobi: has joined #ruby
[00:42:24] enterprisey: has joined #ruby
[00:43:57] AndBobsYourUncle: has joined #ruby
[00:44:23] cschneid_: has joined #ruby
[00:50:18] bronson: has joined #ruby
[00:52:01] cagomez: has joined #ruby
[00:57:40] GodFather_: has joined #ruby
[00:59:02] chouhoulis: has joined #ruby
[01:00:15] roadt: has joined #ruby
[01:01:35] GodFather_: has joined #ruby
[01:07:10] d^sh: has joined #ruby
[01:11:40] ghoti: has left #ruby: ()
[01:14:18] gizmore: has joined #ruby
[01:16:25] brent__: has joined #ruby
[01:16:29] minimalism: has joined #ruby
[01:18:11] hugo_dc: has joined #ruby
[01:21:29] tAn: has joined #ruby
[01:21:41] Rodya_: has joined #ruby
[01:25:25] cagomez: has joined #ruby
[01:27:10] aphprentice: has joined #ruby
[01:29:12] raul782: has joined #ruby
[01:31:47] chouhoulis: has joined #ruby
[01:33:46] mim1k: has joined #ruby
[01:34:07] enterprisey: has joined #ruby
[01:34:07] Cohedrin_: has joined #ruby
[01:35:23] jdawgaz: has joined #ruby
[01:37:12] swills: has joined #ruby
[01:37:12] swills: has joined #ruby
[01:39:10] BTRE: has joined #ruby
[01:47:15] gnufied: has joined #ruby
[01:48:29] pb122: has joined #ruby
[01:50:35] charliesome: has joined #ruby
[01:50:50] br0d1n: has joined #ruby
[02:00:53] Jameser: has joined #ruby
[02:02:18] jenrzzz: has joined #ruby
[02:08:54] orbyt_: has joined #ruby
[02:12:05] Jameser: has joined #ruby
[02:12:42] Cohedrin_: has joined #ruby
[02:14:59] orbyt_: has joined #ruby
[02:16:47] Rodya_: has joined #ruby
[02:22:21] tAn: has joined #ruby
[02:26:44] tax: has joined #ruby
[02:30:35] jenrzzz: has joined #ruby
[02:30:35] jenrzzz: has joined #ruby
[02:34:55] chouhoulis: has joined #ruby
[02:39:54] arescorpio: has joined #ruby
[02:44:17] Jameser: has joined #ruby
[02:45:08] sarbs: has joined #ruby
[02:48:43] webguynow: has joined #ruby
[02:53:33] s2013: has joined #ruby
[02:56:28] jenrzzz: has joined #ruby
[03:00:08] cadillac_: has joined #ruby
[03:16:17] meadmoon: has joined #ruby
[03:23:50] raul782: has joined #ruby
[03:24:22] Algebr: has joined #ruby
[03:24:55] Algebr: In rake files, task :default => :target, this is the task method being called with a single argument with is a hash pair of symbols?
[03:24:56] raul782: has joined #ruby
[03:25:37] matthewd: Algebr: Yes
[03:26:16] Algebr: so why can't I assign values like so: a = :default => :target
[03:26:27] Algebr: and I need the {}
[03:26:54] matthewd: Because you can't ¯\_(ツ)_/¯
[03:27:15] matthewd: The braces are only optional when the hash is the last argument of a method call
[03:28:31] Algebr: and task is a function that is implicity provided by Rake?
[03:28:59] Algebr: no require 'rake' needed, also, does doing require 'f' just make everything in f in to the global scope?
[03:29:45] matthewd: Rakefiles are evaluated in a special context (you don't execute them with `ruby some_filename.rb`)
[03:30:11] Dimik: has joined #ruby
[03:30:24] matthewd: Approximately yes
[03:30:53] DrCode: has joined #ruby
[03:31:54] Algebr: so ruby doesn't have a module system?
[03:32:49] matthewd: Ruby doesn't have a file-based module system
[03:33:24] elomatreb: Nothing in the language enforces anything, it's all convention
[03:33:57] ozialien: has joined #ruby
[03:34:11] mim1k: has joined #ruby
[03:35:00] Cohedrin_: has joined #ruby
[03:35:35] Algebr: what is this: :copy, :source, :target, :needs => :other_task What is the key? A list? tuple?
[03:36:15] elomatreb: The first three are arguments (Symbols), the last one is a Hash
[03:36:56] Algebr: that was ambigious
[03:37:38] matthewd: Rake is not a good choice to learn ruby's syntax rules.. its use of the hash is weird, and done purely for the visual appearance
[03:38:08] Algebr: I'm almost done with it
[03:38:14] Algebr: to the level that I need
[03:42:51] Algebr: R::T new do |t| ... end
[03:43:10] Algebr: this is passing that lambda to the intiailizer of T?
[03:43:43] gix: has joined #ruby
[03:43:52] Algebr: what is the t parameter?
[03:45:01] Algebr: but then I see: Rake::GemPackageTask.new(spec) do |package| and now its like, does that mean that GemPackageTask is taking two parameters?
[03:47:26] gr33n7007h: Algebr: t is the yielded argument passed to the block.
[03:48:53] elomatreb: Algebr: 1. That's not a lambda, that's a block 2. They're not exactly arguments/parameters, you can pass one to any method but the method just ignores it if you never yield
[03:49:16] gr33n7007h: Algebr: example.
[03:49:18] gr33n7007h: >> def foo(n) yield(n) end; foo(8) { |n| n * 2 }
[03:49:20] ruby[bot]: gr33n7007h: # => 16 (https://eval.in/864725)
[03:49:59] gr33n7007h: so argument 8 gets passed to the block and doubles.
[03:53:19] Algebr: what is the difference between a block & lambda?
[03:54:03] imode: has joined #ruby
[03:54:04] elomatreb: A lambda is an object (an instance of a class), a block is a primitive (and not an object)
[03:54:27] Algebr: class T < F, < is inheritance?
[03:55:40] govg: has joined #ruby
[03:58:19] gr33n7007h: Algebr: thing to note ruby is single inheritence, ruby uses mixins for multiple inheritnece i.e modules.
[04:00:04] Algebr: what does & do
[04:00:26] gr33n7007h: convert a block to proc/lambda
[04:00:58] elomatreb: Just to a proc, no lambdas here either
[04:01:28] elomatreb: (The main difference between Proc and Lambda is how they treat their arguments, lambdas will error like methods when you e.g. call them with missing arguments)
[04:01:31] Algebr: & is an operator that exists only for that usecase?
[04:02:06] gr33n7007h: and returns in a lambda are different too.
[04:02:07] elomatreb: It means a few different things depending on context
[04:02:41] gr33n7007h: Algebr: blocks can be passed around.
[04:03:19] cschneid: has joined #ruby
[04:03:30] elomatreb: *Procs can be passed around, but Procs are effectively just blocks wrapped in a very simple object
[04:04:15] gnufied: has joined #ruby
[04:04:16] gr33n7007h: Algebr: a bit contrived but
[04:04:20] gr33n7007h: >> def foo(&block) [1,2,3].map(&block) end; foo { |n| n * 2 }
[04:04:21] ruby[bot]: gr33n7007h: # => [2, 4, 6] (https://eval.in/864732)
[04:05:18] elomatreb: But the & in the parameter list is different from the & in the arguments to map
[04:05:52] howdoi: has joined #ruby
[04:08:20] gr33n7007h: Algebr: anything you don't understand just ask.
[04:09:55] Algebr: appreciated
[04:10:49] Algebr: if you do require in a block, is it scoped to the block?
[04:11:41] gr33n7007h: Algebr: yes, anything inside the block is, short lived within the block.
[04:12:42] elomatreb: require is not scoped, anything you require sticks around in the same global namespace
[04:13:00] gr33n7007h: (1..3).each { |i| }; i
[04:13:05] gr33n7007h: >> (1..3).each { |i| }; i
[04:13:07] ruby[bot]: gr33n7007h: # => undefined local variable or method `i' for main:Object (NameError) ...check link for more (https://eval.in/864738)
[04:13:07] mkali: has joined #ruby
[04:13:35] Algebr: so doing require in a block will still alter the global namespace ?
[04:13:45] gothicsouth: has joined #ruby
[04:13:51] gr33n7007h: >> for i in 1..3; i end; i
[04:13:52] ruby[bot]: gr33n7007h: # => 3 (https://eval.in/864739)
[04:14:04] elomatreb: Yes. If you want scoped behavior, refinements can offer that in certain situations, but they're tricky and not something I'd worry about when first learning
[04:14:39] gr33n7007h: Algebr: yep, in that situation yes.
[04:15:06] gr33n7007h: hah, elomatreb beat me to it.
[04:15:09] Algebr: can you unrequire
[04:15:32] elomatreb: The only thing local to blocks are variables, afaik
[04:15:46] gr33n7007h: elomatreb: correct
[04:16:49] Algebr: so people must use classes as namespacing
[04:17:06] elomatreb: Typically modules, but yes
[04:18:38] Jameser: has joined #ruby
[04:25:19] bronson: has joined #ruby
[04:25:40] perniciouscaffei: has joined #ruby
[04:29:06] gothicsouth: has joined #ruby
[04:31:12] Algebr: is ruby white space senstive for methods?
[04:31:45] gr33n7007h: Algebr: no. but two spaces is the convention.
[04:32:16] cadillac_: has joined #ruby
[04:32:31] mim1k: has joined #ruby
[04:40:08] uZiel: has joined #ruby
[04:40:46] Algebr: what is << in class T << L
[04:41:02] Algebr: especially: class << self
[04:41:25] gr33n7007h: Algebr: digging into the classes singleton class.
[04:42:37] enterprisey: has joined #ruby
[04:45:22] Algebr: given def fc first, second, third, last, g f = 10 g(f + 2) end
[04:45:25] Algebr: and puts fc 1, 2, 3 do |data| puts data end
[04:45:47] Algebr: I get `wrong number of arguments (3 for 5)`
[04:46:46] Algebr: oh, fixed the extraneous parameter, but same fundamental problem of calling the block ?
[04:47:05] Algebr: now: wrong number of arguments (3 for 4)
[04:47:33] brent__: has joined #ruby
[04:49:34] cdg: has joined #ruby
[04:51:38] gr33n7007h: Algebr: you're passing 3 arguments instead of the 5 you declared.
[04:52:06] gr33n7007h: and where does g and f come from?
[04:53:17] Algebr: but this seems like correct # of args: def fc first, second, third, g f = 10 g(f + 2) end puts fc 1, 2, 3 do |data| puts data end
[04:54:14] matthewd: A block is not an ordinary argument; you need & if you want to capture it into a variable
[04:54:16] Cohedrin_: has joined #ruby
[04:54:48] BTRE: has joined #ruby
[04:55:08] gr33n7007h: ah, i see g is a block wasn't concentrating then
[04:55:28] Algebr: where do I put the &
[04:56:47] matthewd: Enthusiastic experimentation is great, but there's a point at which you'll make much better progress from reading some introductory syntax documentation instead of just asking us why a block of code isn't working
[04:57:49] gr33n7007h: then in the method g.yield(f + 2)
[04:58:10] Algebr: I'm getting up to speed much faster this way
[04:58:33] anisha: has joined #ruby
[05:07:36] wooaf: has joined #ruby
[05:09:47] Algebr: how to split strings across lines?
[05:10:02] Radar: Algebr: what haveyou tried so far?
[05:10:03] gr33n7007h: Algebr: how'd you mean?
[05:10:51] Radar: Algebr: I'd advise you to follow this advice when asking questions here: https://stackoverflow.com/help/how-to-ask
[05:11:22] Algebr: Thanks Radar, I'm aware of 'how to ask questions'
[05:11:46] Radar: Saying you are and demonstrating are entirely different concepts.
[05:11:52] gr33n7007h: Algebr: try to be a bit more clear in asking.
[05:12:19] Algebr: sorry, I thought 'how to split strings across lines' was to the point...
[05:12:34] Algebr: How to write a string which spans multiple lines but is really just 1 string?
[05:12:54] gr33n7007h: Algebr: str.split("\n")
[05:13:00] havenwood: Algebr: What you tried should have worked.
[05:13:05] wooaf: https://www.commandercoriander.net/blog/2014/11/09/a-multiline-string-cheatsheet-for-ruby/
[05:13:39] havenwood: <<~SQUiGGLE
[05:14:34] havenwood: https://infinum.co/the-capsized-eight/multiline-strings-ruby-2-3-0-the-squiggly-heredoc
[05:15:23] Algebr: ah figured this one out, ruby keeps C behavior, "f" "g" gets concated to "fg"
[05:16:04] gr33n7007h: and it's fast.
[05:16:47] Bock: has joined #ruby
[05:22:59] alex``: has joined #ruby
[05:26:01] bronson: has joined #ruby
[05:28:38] rabajaj: has joined #ruby
[05:44:12] harai_: has joined #ruby
[05:44:36] kt: has joined #ruby
[05:45:29] gr33n7007h: Algebr: if you don't want to pass a block around just yield to the block.
[05:53:19] astronavt: has joined #ruby
[05:54:36] Hanmac: has joined #ruby
[05:55:25] ujihisa: has joined #ruby
[05:58:57] aupadhye: has joined #ruby
[06:00:04] paranoicsan: has joined #ruby
[06:00:46] aufi: has joined #ruby
[06:04:16] cschneid: has joined #ruby
[06:14:27] dionysus69: has joined #ruby
[06:27:42] ShalokShalom: has joined #ruby
[06:29:27] naprimer2: has joined #ruby
[06:34:04] conta: has joined #ruby
[06:34:10] mbariananets: has joined #ruby
[06:39:45] workmad3: has joined #ruby
[06:46:03] phaul: has joined #ruby
[06:48:22] uneeb: has joined #ruby
[06:53:14] pavelz: hi, this is sort of a ruby question, is there a way to trace all ruby calls on a program.? like strace does in linux or dtrace in mac
[06:57:07] r7c: has joined #ruby
[07:07:27] dionysus69: has joined #ruby
[07:09:43] tAn: has joined #ruby
[07:10:47] brent__: has joined #ruby
[07:19:15] claudiuinberlin: has joined #ruby
[07:20:43] TomyWork: has joined #ruby
[07:21:53] gr33n7007h: pavelz: in what way?
[07:26:46] bronson: has joined #ruby
[07:27:37] mark_66: has joined #ruby
[07:31:13] claudiuinberlin: has joined #ruby
[07:31:24] matthewd: pavelz: TracePoint
[07:36:05] ferr: has joined #ruby
[07:36:24] irick: has joined #ruby
[07:36:25] claudiuinberlin: has joined #ruby
[07:37:10] nobitanobi: has joined #ruby
[07:38:06] burgestrand: has joined #ruby
[07:38:14] rafasc: has joined #ruby
[07:39:07] Sembei: has joined #ruby
[07:41:57] astronavt: has anyone tried to port numpy to ruby? other than the sheer drudgery and massive amount of features to reimplement, from a language design and performance standpoint is there any reason it would be a bad idea?
[07:42:07] astronavt: (just a thought experiment, not planning on doing it)
[07:44:37] enterprisey: has joined #ruby
[07:44:53] bruce_lee: has joined #ruby
[07:49:36] matthewd: astronav_: I'm not familiar with details of either, but SciRuby might be relevant
[07:51:15] rafasc: trying to understand rspec tests. Still not sure If I grasp the concept.
[07:52:29] ur5us: has joined #ruby
[07:52:51] rafasc: https://github.com/rafasc/octodown/blob/master/spec/integration_spec.rb is failing under some versions of ruby...
[07:53:04] rafasc: what's the proper way to test against a forking process?
[07:55:25] mkali: has joined #ruby
[08:00:20] InfinityFye: has joined #ruby
[08:08:02] hurricanehrndz: has joined #ruby
[08:13:03] ams__: has joined #ruby
[08:13:41] InfinityFye: has joined #ruby
[08:15:47] hs366: has joined #ruby
[08:17:44] mim1k: has joined #ruby
[08:18:03] jphase: has joined #ruby
[08:18:52] mkali: has joined #ruby
[08:27:16] jenrzzz: has joined #ruby
[08:27:16] jenrzzz: has joined #ruby
[08:27:42] Beams: has joined #ruby
[08:31:56] belmoussaoui: has joined #ruby
[08:33:05] PaulCapestany: has joined #ruby
[08:35:44] biberu: has joined #ruby
[08:42:41] jinie_: has joined #ruby
[08:43:48] MyMind: has joined #ruby
[08:45:46] pavelz: gr33n7007h: well i have an app and it responds with a generic 404, code somewhere in middlewares or gems. If I can't get understanding where it it before waiting for the next request it'd be awesome. just list of method calls would be awesome
[08:48:43] ur5us: has joined #ruby
[08:49:45] gr33n7007h: pavelz: take a look at TracePoint in that case as someone pointed out.
[08:50:11] cdg: has joined #ruby
[08:50:57] pavelz: gr33n7007h: matthewd : thanks!
[08:51:46] mniip: has joined #ruby
[08:52:32] firecat: has joined #ruby
[08:55:35] mim1k_: has joined #ruby
[09:00:12] JD2020X: has joined #ruby
[09:00:39] bruno-: has joined #ruby
[09:00:42] jdawgaz: has joined #ruby
[09:01:32] lxsameer: has joined #ruby
[09:02:52] claudiuinberlin: has joined #ruby
[09:04:11] gr33n7007h: no probs. :)
[09:09:53] phinxy: has joined #ruby
[09:11:50] phinxy: has left #ruby: ()
[09:16:31] anisha_: has joined #ruby
[09:16:43] PaulCapestany: has joined #ruby
[09:22:00] Mon_Ouie: has joined #ruby
[09:22:20] A124: has joined #ruby
[09:26:29] anisha_: has joined #ruby
[09:26:40] brent__: has joined #ruby
[09:27:38] bronson: has joined #ruby
[09:27:52] bauruine: has joined #ruby
[09:38:50] soc42: has joined #ruby
[09:41:57] brent__: has joined #ruby
[09:43:34] PaulCapestany: has joined #ruby
[09:49:22] soc42: has joined #ruby
[09:53:34] marr: has joined #ruby
[09:56:04] jinie: has joined #ruby
[09:59:23] hs366: has joined #ruby
[10:00:43] Serpent7776: has joined #ruby
[10:03:28] fusta: has joined #ruby
[10:04:46] charliesome: has joined #ruby
[10:05:38] eksi: has joined #ruby
[10:06:32] eksi: has joined #ruby
[10:11:30] arquebus: has joined #ruby
[10:13:40] charliesome: has joined #ruby
[10:14:19] Algebr: has joined #ruby
[10:15:39] harfangk: has joined #ruby
[10:18:42] hfp_work: has joined #ruby
[10:19:02] guardian: has joined #ruby
[10:20:00] guardian: I believe I've seen somewhere a way to access foo[:bar][:baz] where foo is a hash and it would return nil without raising if foo[:bar] doesn't exist to begin with
[10:20:02] guardian: does that ring a bell?
[10:20:42] tbuehlmann: you probably mean foo.dig(:bar, :baz)
[10:21:16] guardian: which ruby version do I need for that?
[10:21:23] guardian: well how do I check which ruby version introduced something?
[10:24:18] Silthias: has joined #ruby
[10:25:16] teatime: That was new in Ruby 2.3
[10:27:24] ebrugulec: has joined #ruby
[10:29:53] charlekit: has joined #ruby
[10:37:32] Siyfion: has joined #ruby
[10:43:21] charliesome: has joined #ruby
[10:45:12] tvw: has joined #ruby
[10:53:47] A124: has joined #ruby
[10:56:26] roadt: has joined #ruby
[11:00:54] chouhoulis: has joined #ruby
[11:01:42] fusta: has joined #ruby
[11:04:07] t-recx: has joined #ruby
[11:04:25] burgestrand: has joined #ruby
[11:08:07] Algebr: has joined #ruby
[11:09:00] ur5us: has joined #ruby
[11:09:59] rikai: has joined #ruby
[11:13:07] stamina: has joined #ruby
[11:16:48] charliesome: has joined #ruby
[11:17:50] jphase: has joined #ruby
[11:19:10] meadmoon: has joined #ruby
[11:30:13] ShekharReddy: has joined #ruby
[11:33:18] mim1k: has joined #ruby
[11:34:51] soc42: has joined #ruby
[11:35:19] jenrzzz: has joined #ruby
[11:35:19] jenrzzz: has joined #ruby
[11:35:52] depesz: has left #ruby: ("WeeChat 1.9")
[11:36:51] ShalokShalom: has joined #ruby
[11:41:45] JD2020X: has joined #ruby
[11:41:48] ts_: has joined #ruby
[11:46:16] Jameser: has joined #ruby
[11:47:21] gheegh: has joined #ruby
[11:47:41] brent__: has joined #ruby
[11:48:18] muscle: has joined #ruby
[11:48:55] muscle: does anyone know how to make sass rule to make multiple parents target the same child classes?
[11:49:13] muscle: for example .parent1 .child1, .parent1 .child2, .parent2 .child1, .parent2 .child2
[11:52:26] ShalokShalom_: has joined #ruby
[11:54:15] burgestrand: has joined #ruby
[11:56:47] nekomune: has joined #ruby
[12:00:59] DrBojingle: has joined #ruby
[12:01:19] jaruga: has joined #ruby
[12:02:19] Algebr: has joined #ruby
[12:06:39] paranoicsan: has joined #ruby
[12:07:04] DipoleHourglass: has joined #ruby
[12:12:04] synthroid: has joined #ruby
[12:12:21] mson: has joined #ruby
[12:12:45] herbmillerjr: has joined #ruby
[12:13:20] selim: has joined #ruby
[12:14:22] Beams_: has joined #ruby
[12:21:38] elsevero: has joined #ruby
[12:22:31] thinkpad: has joined #ruby
[12:29:22] tax: has joined #ruby
[12:30:33] mostlybadfly: has joined #ruby
[12:31:21] EminenceHC: has joined #ruby
[12:33:42] ts_: has joined #ruby
[12:33:43] selim: has joined #ruby
[12:34:31] jb__: has joined #ruby
[12:34:53] ts_: has joined #ruby
[12:36:46] duckpuppy: has joined #ruby
[12:39:51] ts_: has joined #ruby
[12:41:04] ts_: has joined #ruby
[12:41:22] belmoussaoui: has joined #ruby
[12:41:33] bwq: has joined #ruby
[12:42:01] A124: has joined #ruby
[12:42:26] ts_: has joined #ruby
[12:43:40] huyderman: has joined #ruby
[12:45:03] ebrugulec: has joined #ruby
[12:51:06] CrazyEddy: has joined #ruby
[12:56:23] Algebr: has joined #ruby
[12:59:47] ecuanaso: has joined #ruby
[13:03:24] jdawgaz: has joined #ruby
[13:13:19] jphase: has joined #ruby
[13:14:13] jb__: has left #ruby: ("Good Bye")
[13:19:05] apparition: has joined #ruby
[13:31:52] maryo_: has joined #ruby
[13:32:10] DLSteve: has joined #ruby
[13:33:57] belmoussaoui: has joined #ruby
[13:34:09] marr: has joined #ruby
[13:37:29] jenrzzz: has joined #ruby
[13:37:29] jenrzzz: has joined #ruby
[13:37:38] NoOova: has joined #ruby
[13:37:47] NoOova: Hu guys. How i can render erb template?
[13:38:21] jahvetti: has joined #ruby
[13:39:27] numbdewd: has joined #ruby
[13:42:13] burgestrand: has joined #ruby
[13:43:01] dextrey: has joined #ruby
[13:45:59] paranoicsan: NoOova: ERB.new(template_path).result(binding)
[13:48:45] RedNifre: has joined #ruby
[13:50:42] Algebr: has joined #ruby
[13:53:58] jahvetti: has joined #ruby
[13:58:09] alex``: has joined #ruby
[14:00:22] LastWhisper____: has joined #ruby
[14:00:25] AgentVenom: has joined #ruby
[14:05:13] synthroid: has joined #ruby
[14:06:17] duckpuppy: has joined #ruby
[14:07:49] guardian: is there an easy way to kindof negate the match with string.gsub? like I would like it to stop on "foo" and "baz" when the input string is "foobarbaz"
[14:08:21] guardian: in other word "it's negating" /bar/
[14:08:39] elbuki: has joined #ruby
[14:09:37] Rapture: has joined #ruby
[14:11:51] mikecmpbll: has joined #ruby
[14:17:19] burgestrand: guardian I'm afraid I don't understand
[14:22:19] jahvetti: has joined #ruby
[14:22:30] tcopeland: has joined #ruby
[14:25:29] guardian: given "foobarbaz" I want to stop on "foo" and "bar" and let me replace each
[14:26:28] jackjackdripper: has joined #ruby
[14:27:43] jdawgaz: has joined #ruby
[14:27:59] Bhootrk_: has joined #ruby
[14:28:16] mtkd: has joined #ruby
[14:28:25] lxsameer: has joined #ruby
[14:29:59] matthewd: guardian: You're saying the same thing. Try using different words, or an example, or showing what you've tried so far. (Or even better, all of the above.)
[14:30:35] quobo: has joined #ruby
[14:31:06] burgestrand: guardian gsub accepts either a block to run for replacement, or a hash; try using that with a pattern that matches all that you wish to replace
[14:31:14] grepsuzette: has joined #ruby
[14:31:58] burgestrand: >> "abc".gsub(/(a|c)/, { "a" => "Å", "c" => "Ç" })
[14:32:00] ruby[bot]: Burgestrand: # => "ÅbÇ" (https://eval.in/865294)
[14:32:25] LastWhisper____: has joined #ruby
[14:32:32] grepsuzette: has left #ruby: ("WeeChat 1.9")
[14:34:40] optikalmouse: has joined #ruby
[14:35:58] jahvetti: has joined #ruby
[14:37:56] nobitanobi: has joined #ruby
[14:38:46] JD2020X: has joined #ruby
[14:40:42] gizmore: has joined #ruby
[14:41:00] jphase_: has joined #ruby
[14:44:41] Algebr: has joined #ruby
[14:44:49] Adreanna: has joined #ruby
[14:45:32] bruno-: has joined #ruby
[14:46:16] alex```: has joined #ruby
[14:49:07] Siyfion: has joined #ruby
[14:50:36] LastWhisper____: has joined #ruby
[14:51:25] DTZUZO: has joined #ruby
[14:52:21] chouhoulis: has joined #ruby
[14:54:00] synthroid: has joined #ruby
[14:55:38] pagios: has joined #ruby
[14:55:40] pagios: https://pastebin.com/pjLHzy5r
[14:55:40] ruby[bot]: pagios: as I told you already, please use https://gist.github.com
[14:55:47] pagios: any idea how to sovle it?
[14:56:15] pagios: https://gist.github.com/anonymous/dd7331d9ec062535b5bcd87035572046
[14:56:29] jphase: has joined #ruby
[14:56:46] pagios: gem 2.6.8
[14:56:48] apofis: has joined #ruby
[14:57:06] elomatreb: pagios: Judging from the errors, is your system clock accurate?
[14:57:18] pagios: it is wrong
[14:57:28] pagios: May 25 01:53:00
[14:57:31] rippa: has joined #ruby
[14:57:41] elomatreb: You need an accurate system clock to do any TLS
[14:59:19] pagios: elomatreb, ok i did fix t he clock now
[14:59:28] pagios: need to purge the SSLs to do a gem install ?
[14:59:37] pagios: still getting the error
[14:59:40] FahmeF: has joined #ruby
[14:59:43] elomatreb: The same error?
[14:59:52] pagios: SSL verification error at depth 0: certificate has expired (10)
[15:04:04] yeticry: has joined #ruby
[15:05:04] dionysus69: has joined #ruby
[15:07:02] pagios: elomatreb, it worksn ow thanks man
[15:07:14] pagios: so this is a general rule about SSL?
[15:07:18] cschneid: has joined #ruby
[15:07:29] pagios: time needs to be synch in server and client as ssl has an expiry date?
[15:07:53] cschneid: has joined #ruby
[15:09:09] Papierkorb: pagios: SSL certificates have a start and end date, correct. Its checked by your system clock, which is why it needs to be 'somewhat' accurate for that.
[15:11:13] troys: has joined #ruby
[15:14:17] gnufied: has joined #ruby
[15:14:37] polishdub: has joined #ruby
[15:17:12] harai: has joined #ruby
[15:17:48] orbyt_: has joined #ruby
[15:19:21] elomatreb: If the inaccuracy is on the order of seconds to minutes you probably won't notice, but in the hours range it can already begin to cause problems with e.g. short OCSP staples
[15:24:17] harfangk: has joined #ruby
[15:27:40] mostlybadfly: has joined #ruby
[15:29:46] imode: has joined #ruby
[15:31:21] ArtCorvelay: has joined #ruby
[15:33:49] cagomez: has joined #ruby
[15:37:13] synthroid: has joined #ruby
[15:38:44] ShalokShalom: has joined #ruby
[15:38:56] Guest85471: has joined #ruby
[15:39:13] jenrzzz: has joined #ruby
[15:39:13] jenrzzz: has joined #ruby
[15:39:59] FastJack: has joined #ruby
[15:40:03] j0rd_: has joined #ruby
[15:42:33] j0rd_: Question about storing jsonb in postgres. Hard to find proper solution on google. I'm attempting to store "pure" json in the jsonb field in database with ApplicationRecord. But it keeps getting stored with the ruby objects in there. Is there a way to send straight json string instead of a hash. or a way to clean the hash so these classes dont get stored.
[15:42:48] j0rd_: ["data", "\"--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\\nasin: B01AQUP1A2 <- These muddle up the json in DB
[15:43:15] j0rd_: ps. ruby noob of 1 day, so take it easy on me :D
[15:43:16] brent__: has joined #ruby
[15:43:44] raz: has joined #ruby
[15:44:10] brent__: has joined #ruby
[15:44:18] raz: can someone explain to me why ++i is a legal statement?
[15:44:52] raz: even the how would already make me happy ;)
[15:44:56] elomatreb: It's only in certain situations, (something, before that) binary plus (unary plus(i))
[15:45:04] elomatreb: It usually results in a weird syntax error
[15:45:25] raz: well, it returns the value of i
[15:45:28] guardian: has joined #ruby
[15:46:08] raz: i == ++i
[15:46:10] raz: is true
[15:46:12] FrostCandy: has joined #ruby
[15:46:36] jackjackdripper: has joined #ruby
[15:46:42] dviola: has joined #ruby
[15:47:04] elomatreb: If both + are understood as unary plus, that happens, yes
[15:47:16] cdg: has joined #ruby
[15:47:18] elomatreb: And since they're effectively identity functions, you can chain as many as you want
[15:47:36] raz: ohhh.. now it starts to make sense
[15:47:52] TomyLobo: has joined #ruby
[15:49:47] bronson: has joined #ruby
[15:50:10] raz: still think that stuff should throw a syntax error
[15:50:22] brixen: has joined #ruby
[15:50:22] raz: unless someone can think of a real world use-case for e.g. +-+-1 ;)
[15:51:30] charliesome: has joined #ruby
[15:54:46] cdg_: has joined #ruby
[15:55:04] charliesome: has joined #ruby
[15:58:53] [Butch]: has joined #ruby
[16:00:12] Guest85471: has joined #ruby
[16:00:34] banisterfiend: raz can you think of a real world use-case for ((((())))) ? should that be a syntax error too?
[16:05:47] havenwood: Ruby, you'll shoot your eye out.
[16:13:09] orbyt_: has joined #ruby
[16:13:34] apofis: has joined #ruby
[16:15:54] mtkd: has joined #ruby
[16:17:16] raz: banisterfiend: no and yes :)
[16:17:58] raz: or is there a reason for why it should *not* be a syntax error?
[16:18:05] banisterfiend: raz so your argument is that anything supported by a grammar but it's 'redundant' should be a syntax error?
[16:18:26] banisterfiend: raz what about 1 + 0 + 0 + 0 +0 + 0 ?
[16:18:36] raz: well, not necessarily your example, but definitely mine, which is a boobytrap for C-family programmers
[16:19:19] raz: they are used to writing ++i and having it do something specific. ruby breaks their expectation without that expression being useful in any other way.
[16:21:14] nofxx: has joined #ruby
[16:21:15] banisterfiend: raz you realize that -+-+-+-+1 is valid in C right?
[16:21:45] milardovich: has joined #ruby
[16:22:02] banisterfiend: so ruby's behaviour is actually 'expected behaviour' for C programmers
[16:22:30] raz: your expression behaves the same in C and ruby, mine doesn't
[16:22:40] raz: ACTION hands banisterfiend back his strawman
[16:22:54] banisterfiend: raz this ? . +-+-1
[16:23:06] banisterfiend: that's what i just tried in C
[16:23:08] banisterfiend: it's the same as in ruby
[16:23:19] raz: and ++i is *not* the same as in ruby
[16:23:40] banisterfiend: raz -+-+-1 in C is the same as -+-+-1 in Ruby. I just wrote a ruby program and a C program to demonstrate it
[16:24:03] raz: yes. which i confirmed 3 times now...
[16:24:23] raz: the point about ++i is that this one does *not* behave the same in C and ruby
[16:24:30] raz: your example is unrelated
[16:24:30] jdawgaz: has joined #ruby
[16:25:30] banisterfiend: all i read was ' unless someone can think of a real world use-case for e.g. +-+-1 ;)'
[16:26:35] banisterfiend: and the reason is because ++ is not an operator in Ruby, so it behaves the same at it would if ++ was not an operator in C, i.e +(+(1))
[16:27:26] banisterfiend: so you're saying Ruby, a language without the ++ operator, should provide a syntax error just so that people who are used to ++ being an operator, don't get confused?
[16:27:43] havenwood: raz: Ruby is the principle of least surprise for Matz, not for raz. ;-P
[16:27:55] raz: banisterfiend: yes, that's what i'm saying
[16:28:02] raz: and yea i know it's unlikely to happen
[16:28:06] banisterfiend: rather than being internally consistent, and expanding ++i as +(+i)
[16:29:25] banisterfiend: well, there's many things in ruby that look like things in C, but behave completely differently :)
[16:29:26] r3QuiEm_cL: has joined #ruby
[16:29:35] banisterfiend: how about people just learn the language ;)
[16:29:49] raz: being consistent for a case that nobody needs doesn't seem a worthwhile goal when it causes actual problems for some people ¯\_(ツ)_/¯
[16:30:23] raz: yea, in the end it's not a big deal as it's probably unlikely to introduce subtle bugs anyway
[16:31:06] SeepingN: has joined #ruby
[16:31:30] banisterfiend: i think being internally consistent is more important than randomly throwing syntax errors because someone is expecting someting in Ruby to behave like in C
[16:31:45] sleetdrop: has joined #ruby
[16:32:03] charliesome: has joined #ruby
[16:34:24] raz: i think you are wrong, in this case
[16:34:32] cadillac_: has joined #ruby
[16:34:40] raz: but my japanese is very rusty, so you don't have to be afraid of me convincing anyone to implement it :P
[16:35:19] Papierkorb: There's not even `i++`, why should there be `++i`
[16:36:44] banisterfiend: raz also ++foo could be meaningful in ruby, since we can override the +foo operator
[16:37:23] raz: banisterfiend: yet another reason to make it illegal :)
[16:37:33] banisterfiend: how is that a reason?
[16:37:45] banisterfiend: +foo could return an object that you actually want to then call + on
[16:37:49] PaulCapestany: has joined #ruby
[16:38:06] synthroid: has joined #ruby
[16:38:43] banisterfiend: i.e ++foo could be meaningful and useful ruby, in the right situation
[16:38:44] raz: why would anyone do that, except to deliberately confuse people?
[16:38:50] nobitanobi: has joined #ruby
[16:39:15] banisterfiend: raz pfft, so now we're at the "a language should make any feature that could be abused to deliberately confuse someone, illegal" ?
[16:39:26] banisterfiend: do you realize the crazy shit you can do in C++ with operator overloading? :)
[16:39:44] raz: no. but any feature that doesn't have any *other* legitimate use-case.
[16:39:58] raz: yes, that's exactly what nobody wants in ruby
[16:40:10] banisterfiend: You don't know whether it has a legitimate use case or not, perhaps in a mathematical context something like that could be useful
[16:40:35] banisterfiend: maybe as some kind of special operator in a matrix algebra or so on
[16:40:53] jahvetti: has joined #ruby
[16:40:58] raz: uh huh. suure.
[16:41:00] banisterfiend: or for some kind of DSL. It's not confusing if someone were to read teh docs, it could be useful. I dont' know, and neither do you :)
[16:41:36] raz: banisterfiend: homework: grep all ruby code on github and find one example to back up your case.
[16:41:42] raz: just one
[16:42:34] banisterfiend: I don't need to - my point is simply that the grammar of the language allows something, it's perfectly logical and consistent.
[16:43:02] banisterfiend: The only people it might confuse is someone who comes from another language where that 'operator' has a special meaning. Big deal. They should learn ruby properly :)
[16:43:45] belmoussaoui: has joined #ruby
[16:43:57] raz: that's ivory tower bs
[16:44:04] raz: i'll back up my case: https://stackoverflow.com/questions/6509423/ruby-parenthesis-syntax-exception-with-i-i
[16:44:26] raz: that's ~5k people falling into the i++ / ++i trap and looking it up on stack overflow to figure it out
[16:44:40] raz: a syntax error would have saved them a few minutes of their lives ¯\_(ツ)_/¯
[16:45:00] banisterfiend: not a syntax error, a warning.
[16:45:17] bruno-_: has joined #ruby
[16:45:29] banisterfiend: I agree a warning could be introduced for a situation like that, but you shouldn't cripple the grammar
[16:46:08] raz: only if it also plays a tooting siren sound while it displays the warning
[16:46:30] raz: the ecto1-horn would be adequate
[16:46:40] AndBobsYourUncle: has joined #ruby
[16:47:03] havenwood: raz: Maybe a warning each line: Remember, this is the Ruby language, not another language!
[16:47:36] raz: havenwood: ideally displayed in multiple languages! :D
[16:48:23] havenwood: But yeah, Integers are frozen in Ruby. You can't increment them.
[16:48:29] havenwood: >> 42.frozen?
[16:48:30] ruby[bot]: havenwood: # => true (https://eval.in/865368)
[16:48:50] tAn: has joined #ruby
[16:49:20] banisterfiend: raz well, what about people coming from other languages to Ruby, and have different expectations ?
[16:49:38] havenwood: raz: Come from Smalltalk so you have the right expectations.
[16:49:40] banisterfiend: raz you could do something like: ruby --warning--im-from-python foo.rb
[16:49:43] graft: has joined #ruby
[16:49:51] banisterfiend: or ruby --warning--im-from-c foo.rb
[16:49:58] raz: banisterfiend: i doubt there are many other traps like ++i
[16:50:01] raynold: has joined #ruby
[16:50:22] banisterfiend: raz Yes there are.
[16:50:25] raz: havenwood: that may be somewhat true. the only problem being... nobody comes from smalltalk ;)
[16:50:32] raz: banisterfiend: like what?
[16:52:39] banisterfiend: raz the behaviour of 'return' is different, the way default values are defined in ruby vs python for function parameters, the meaning of '..' and '...' are inversed in ruby vs swift (iirc). Things like the way functions close over or don't close over local variables
[16:52:56] banisterfiend: there's a tonne of expectations that are violated in Ruby if you go into ruby expecting it to behave like another popular language
[16:53:17] raz: banisterfiend: so what would someone coming from swift accidentally write that would be comparable to ++i?
[16:53:19] havenwood: the plethora of warnings would be annoying and slow
[16:53:41] raz: .. and ... sounds interesting
[16:54:55] banisterfiend: raz probably a standard iterator, where you actually want it to be exclusive, but you use the wrong '..' so it's inclusive instead. So, in situations where you have something like: for i in 0..j.size instead of for i in 0...j.size
[16:55:09] banisterfiend: a warning could trivially be generated i assume
[16:55:27] teegee543: has joined #ruby
[16:55:46] banisterfiend: or where you're taking slices of an array and use .. instead of ... or vice versa, the compiler could infer what the user meant and figure out they most likely mean .. instead, and so on
[16:56:37] mtkd: has joined #ruby
[16:57:23] raz: has joined #ruby
[16:58:15] s2013: has joined #ruby
[16:59:35] banisterfiend: also shit like fall-through in case/when statements
[17:00:52] uZiel: has joined #ruby
[17:01:51] havenwood: ruby should note your errors, detect your languages of origin, and give appropriate warnings ;-P
[17:01:52] r3QuiEm_cL: has joined #ruby
[17:03:51] havenwood: raz: Ruby does do warnings for some gotchas, but always Ruby-related ones. It does seem like quite a slippery slope to warn of conflicts with other languages' syntax or semantics.
[17:04:14] raz: havenwood: yup agreed
[17:04:38] ArMedic: has joined #ruby
[17:04:43] ArMedic: has left #ruby: ()
[17:04:49] elomatreb: What is true though is that this particular behavior has a tendency to trip people up, esp. since it either is completely silent or has a weird SyntaxError often indicating very strange lines of code
[17:06:52] havenwood: a very narrowly-tailored warning might get accepted
[17:06:54] banisterfiend: most people don't come from a C background these days
[17:07:08] banisterfiend: I see more people tripped up by ruby's method behaviour (i.e that they're not closures, as they are in python) than by ++i
[17:07:24] banisterfiend: x = 10; def hello; puts x; end #===> why not print 10 ?
[17:07:37] banisterfiend: i've seen that confusion 50x more often
[17:07:51] elomatreb: Also i++ is propably more common, true
[17:08:59] havenwood: banisterfiend: aye, that or i always see: foo == bar || baz # intending to check if foo is bar or baz
[17:09:12] banisterfiend: yes or people coming from PHP confused about the behavoiur of ===
[17:09:28] elomatreb: havenwood: Are there languages that have behavior like that?
[17:09:48] havenwood: elomatreb: coffeescript i guess?
[17:09:53] havenwood: elomatreb: more of a noob mistake i suppose
[17:10:46] Ishido: has joined #ruby
[17:11:19] banisterfiend: i also vaguely remember there being a huge gotcha when going back and forth between ruby and coffeescript
[17:11:20] elomatreb: I guess it's a reasonable expectation to have a syntax to check if a variable is one of some values
[17:11:23] havenwood: elomatreb: the bottom example is my CoffeeScript FizzBuzz, and I do kinda like its odd logic: https://rosettacode.org/wiki/FizzBuzz#CoffeeScript
[17:11:31] banisterfiend: oh yeah, in coffeescript methods are invoked with @foo() but in ruby they're just foo()
[17:11:33] havenwood: not a bad oneliner!
[17:12:37] hahuang65: has joined #ruby
[17:12:54] banisterfiend: and i think with langauges that support the 'foo?' operator to check for nulls, it's super confusing when looking at ruby code with predciate foo? methods
[17:12:59] jahvetti: has joined #ruby
[17:13:20] elomatreb: Also what people think of as "properties" just being methods
[17:13:22] havenwood: banisterfiend: for sure
[17:13:46] banisterfiend: so yeah, in summary, there's a fuck tonne of possible confusions you can have in ruby code if you go in expecting it to behave like another language, and i believe most of them are a heck of a lot more common than ++i :)
[17:19:01] havenwood: >> class Numeric; def +@; warn 'This is no the "++" you are looking for...' end end; ++42
[17:19:02] ruby[bot]: havenwood: # => This is no the "++" you are looking for... ...check link for more (https://eval.in/865373)
[17:19:10] havenwood: >> class Numeric; def +@; warn 'This is no the "++" you are looking for...' end end; +42
[17:19:11] ruby[bot]: havenwood: # => 42 (https://eval.in/865374)
[17:19:49] banisterfiend: +i is actually useful though
[17:19:57] banisterfiend: it forces a negative number to be positive :)
[17:20:03] banisterfiend: wait no it doesn't, meh
[17:20:18] elcontrastador: has joined #ruby
[17:20:21] havenwood: I just use ++ to increment people.
[17:20:32] havenwood: banisterfiend++
[17:20:54] banisterfiend: hehe i wish that worked
[17:20:55] MarkBilk: has joined #ruby
[17:20:57] banisterfiend: might force me to go to the gym or something...
[17:21:47] FahmeF: has joined #ruby
[17:24:42] milardovich: has joined #ruby
[17:29:27] kies: has joined #ruby
[17:29:28] elomatreb: havenwood: Dumb question: How does that not warn for `+42`?
[17:30:16] eam: I assume + is handled in the parser, just like -42 doesn't invoke -@
[17:30:19] havenwood: >> require 'ripper'; Ripper.lex '++42' # elomatreb
[17:30:21] ruby[bot]: havenwood: # => [[[1, 0], :on_op, "+"], [[1, 1], :on_int, "+42"]] (https://eval.in/865380)
[17:30:34] havenwood: >> require 'ripper'; Ripper.lex '+42' # elomatreb
[17:30:35] ruby[bot]: havenwood: # => [[[1, 0], :on_int, "+42"]] (https://eval.in/865381)
[17:30:46] elomatreb: Ooh, thank you
[17:30:46] havenwood: elomatreb: what eam said
[17:31:02] eam: everything is sorta an object, sometimes
[17:31:14] havenwood: methods get called, sometimes
[17:32:15] havenwood: I was really surprised to learn that #next calls the method and #succ optimizes the method call away.
[17:32:28] havenwood: >> RubyVM::InstructionSequence.compile('42.succ').to_a.last
[17:32:30] ruby[bot]: havenwood: # => [1, [:trace, 1], [:putobject, 42], [:opt_succ, {:mid=>:succ, :flag=>16, :orig_argc=>0}, false], [:le ...check link for more (https://eval.in/865382)
[17:32:35] havenwood: >> RubyVM::InstructionSequence.compile('42.next').to_a.last
[17:32:36] ruby[bot]: havenwood: # => [1, [:trace, 1], [:putobject, 42], [:opt_send_without_block, {:mid=>:next, :flag=>16, :orig_argc=>0} ...check link for more (https://eval.in/865383)
[17:33:53] ltem: has joined #ruby
[17:34:32] RedNifre: has joined #ruby
[17:35:21] havenwood: another interesting optimization: https://bugs.ruby-lang.org/issues/13917
[17:35:24] havenwood: lots like that
[17:37:32] claudiuinberlin: has joined #ruby
[17:40:28] cdg: has joined #ruby
[17:41:48] PaulCapestany: has joined #ruby
[17:45:22] zachk: has joined #ruby
[17:48:57] jdawgaz: has joined #ruby
[17:52:14] theunraveler: has joined #ruby
[17:54:48] ivanskie: has joined #ruby
[17:55:10] michaelzinn: has joined #ruby
[17:55:19] orbyt_: has joined #ruby
[17:57:51] tAn: has joined #ruby
[18:04:34] r3QuiEm_cL: has joined #ruby
[18:05:20] Dimik: has joined #ruby
[18:06:20] naprimer: has joined #ruby
[18:07:12] mikecmpbll: has joined #ruby
[18:07:46] webguynow: has joined #ruby
[18:15:18] lxsameer: has joined #ruby
[18:15:56] michaelzinn: has joined #ruby
[18:16:10] milardovich: has joined #ruby
[18:17:21] jamesaxl: has joined #ruby
[18:18:19] JD2020X: has joined #ruby
[18:19:19] harai: has joined #ruby
[18:19:46] cdg: has joined #ruby
[18:20:50] duracrisis: has joined #ruby
[18:23:12] Cohedrin_: has joined #ruby
[18:26:28] tcopeland: has joined #ruby
[18:30:19] enterprisey: has joined #ruby
[18:33:16] gr33n7007h: has joined #ruby
[18:34:13] rasca_: has joined #ruby
[18:37:49] PaulCapestany: has joined #ruby
[18:37:53] Guest67931: has joined #ruby
[18:38:31] s3nd1v0g1us: has joined #ruby
[18:41:18] michaelzinn: has joined #ruby
[18:43:38] jenrzzz: has joined #ruby
[18:43:38] jenrzzz: has joined #ruby
[18:43:39] tvw: has joined #ruby
[18:43:48] jdawgaz: has joined #ruby
[18:44:33] jdawgaz: has joined #ruby
[18:45:23] jdawgaz: has joined #ruby
[18:46:12] naprimer: has joined #ruby
[18:46:12] jdawgaz: has joined #ruby
[18:46:57] jdawgaz: has joined #ruby
[18:47:06] phaul: has joined #ruby
[18:47:47] jdawgaz: has joined #ruby
[18:48:37] jdawgaz: has joined #ruby
[18:49:18] bmurt: has joined #ruby
[18:49:47] naprimer: has joined #ruby
[18:50:32] gusrub: has joined #ruby
[18:55:05] ecuanaso: has joined #ruby
[18:56:08] orbyt_: has joined #ruby
[18:56:54] r3QuiEm_cL: has joined #ruby
[18:58:55] dionysus69: has joined #ruby
[18:59:06] tAn: has joined #ruby
[18:59:15] r3QuiEm_cL: has joined #ruby
[19:02:02] michaelzinn: has joined #ruby
[19:05:55] ecuanaso: has joined #ruby
[19:06:05] ornerymoose: has joined #ruby
[19:06:40] ornerymoose: I’m using Nokogiri to parse a Rails view. If i remove some rows in the browser via jquery, they aren’t reflected in the generated CSV. Why is that? Do I need to use something like Mechanize? https://gist.github.com/ornerymoose/8e828ad525757ead1b8016d173689441
[19:07:39] elomatreb: ornerymoose: Nokogiri is a static HTML parser, no JS is executed
[19:08:15] ornerymoose: elomatreb: gotcha, thanks. Would Mechanize be a decent approach or do you have any suggestions?
[19:08:15] Moosashi: has joined #ruby
[19:09:01] elomatreb: Not familiar enough with it to say that, sorry
[19:09:18] ur5us: has joined #ruby
[19:09:29] ornerymoose: No sweat, I’ll look into it! Appreciate the quick reply
[19:10:53] DLSteve: has joined #ruby
[19:16:04] synthroid: has joined #ruby
[19:21:09] Dry_Lips: has joined #ruby
[19:21:09] Dry_Lips: has joined #ruby
[19:22:35] jdawgaz: has joined #ruby
[19:23:05] ivanskie_: has joined #ruby
[19:23:40] r3QuiEm_cL: has joined #ruby
[19:24:45] michaelzinn: has joined #ruby
[19:29:04] cagomez: has joined #ruby
[19:30:06] orbyt_: has joined #ruby
[19:32:17] milardovich: has joined #ruby
[19:36:56] ledestin: has joined #ruby
[19:42:08] enterprisey: has joined #ruby
[19:42:41] ivanskie: has joined #ruby
[19:43:07] jackjackdripper: has joined #ruby
[19:44:44] milardovich: has joined #ruby
[19:45:27] michaelzinn: has joined #ruby
[19:45:40] Xeago: has joined #ruby
[19:47:40] belmoussaoui: has joined #ruby
[19:48:51] perniciouscaffei: has joined #ruby
[19:51:13] milardovich: has joined #ruby
[19:51:32] jphase: has joined #ruby
[19:53:03] minimalism: has joined #ruby
[19:53:15] Cohedrin_: has joined #ruby
[19:56:49] halt: has joined #ruby
[19:59:46] PaulCapestany: has joined #ruby
[19:59:55] tAn: has joined #ruby
[20:00:48] dionysus69: has joined #ruby
[20:01:23] cagomez: has joined #ruby
[20:02:33] mnemon: ornerymoose: mechanize doesn't handle javascript either.
[20:02:41] bronson: has joined #ruby
[20:03:08] milardovich: has joined #ruby
[20:03:11] ornerymoose: mnemom: yeah doesnt seem to be :/ looking into phantomjs now
[20:03:31] ornerymoose: mnemon: anything you recommend?
[20:04:03] mnemon: selenium works, but it's just basically automation of a complete browser
[20:05:39] fmcgeough: has joined #ruby
[20:05:44] elomatreb: Both Chrome and Firefox got first-party headless modes recently, IIRC
[20:06:10] michaelzinn: has joined #ruby
[20:09:25] cdg: has joined #ruby
[20:12:24] RedNifre: has joined #ruby
[20:14:28] havenwood: ornerymoose: Rails 5.1 system tests defaults settings are Selenium using Chrome headless.
[20:15:32] havenwood: https://github.com/rails/rails/blob/5-1-stable/actionpack/lib/action_dispatch/system_test_case.rb
[20:17:40] havenwood: Oops, thought we were in #RubyOnRails. It's still a good choice.
[20:17:47] lxsameer: has joined #ruby
[20:18:40] cdg_: has joined #ruby
[20:20:44] Guest85471: how do I know what things will be brought into global scope by doing a require?
[20:21:14] RedNifre: I'm a ruby beginner, but I guess you don't know and everything could happen?
[20:28:09] ornerymoose: thank you havenwood
[20:28:33] perniciouscaffei: has joined #ruby
[20:28:38] michaelzinn: has joined #ruby
[20:29:20] cagomez: has joined #ruby
[20:30:33] hahuang61: has joined #ruby
[20:33:04] samuel02: has joined #ruby
[20:33:28] clemens3: has joined #ruby
[20:33:32] tAn: has joined #ruby
[20:35:05] samuel02: can someone help me with reducing a string like "foo.bar" to { 'foo' => { 'bar' => nil }}?
[20:35:07] samuel02: e.g. https://pastebin.com/wHiW45Yj
[20:35:10] ruby[bot]: samuel02: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/0c53b3596437f602f834fa5ae25201fc
[20:35:10] ruby[bot]: samuel02: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[20:35:40] samuel02: there must be some smart way of doing this :)
[20:36:05] samuel02: I tried using reduce but somehow I need to make it recursive..
[20:40:19] nobitanobi: has joined #ruby
[20:43:26] nicesignal: has joined #ruby
[20:45:55] al2o3-cr: samuel02: something like this maybe? s = "foo.bar"; Hash.new{ |h,k| h[k] = Hash.new(&h.default_proc) }.tap { |h| s.split('.').inject(h, :[]) }
[20:46:32] al2o3-cr: ah, no. that that returns an empty hash.
[20:48:33] r3QuiEm_cL: has joined #ruby
[20:48:40] jphase: has joined #ruby
[20:49:25] michaelzinn: has joined #ruby
[20:55:22] clemens3: s.split( /\./ ); h = {}; h[ s[ 0 ] ] = { s[ 1 ] => nil }
[20:57:31] perniciouscaffei: has joined #ruby
[21:02:53] genpaku: has joined #ruby
[21:03:54] jphase: has joined #ruby
[21:04:18] eblip: has joined #ruby
[21:09:34] ben_: has joined #ruby
[21:10:12] michaelzinn: has joined #ruby
[21:13:24] jinie: has joined #ruby
[21:16:01] xuanrui: has joined #ruby
[21:17:08] mson: has joined #ruby
[21:21:52] FahmeF: has joined #ruby
[21:25:01] jdawgaz: has joined #ruby
[21:26:59] ur5us: has joined #ruby
[21:27:13] phinxy: has joined #ruby
[21:32:45] michaelzinn: has joined #ruby
[21:35:45] bmurt: has joined #ruby
[21:36:50] Cohedrin_: has joined #ruby
[21:36:55] mim1k: has joined #ruby
[21:37:05] eckhardt: has joined #ruby
[21:38:18] kahra: has joined #ruby
[21:41:47] milardovich: has joined #ruby
[21:44:11] Mon_Ouie: has joined #ruby
[21:45:40] apofis: has joined #ruby
[21:46:07] Guest85471: are things like @, @@ and $ convention as well or actually enforced?
[21:46:17] jackjackdripper1: has joined #ruby
[21:47:04] goyox86_: has joined #ruby
[21:50:47] havenwood: Guest85471: Those are syntax. Generally avoid setting your own @@class_instance_variables and $global_variables unless you know why you're doing it (even then). Setting your own @instance_variables is fine.
[21:51:39] havenwood: Guest85471: `@instance_variables` are shared between methods in a class and `local_variables` are not.
[21:52:20] havenwood: Guest85471: But yeah, it's more than convention - it's determinative syntax.
[21:53:29] michaelzinn: has joined #ruby
[21:53:30] eam: naming a method @foo or @@foo or $foo is fine, though
[22:01:27] ornerymoose: has joined #ruby
[22:01:37] jphase: has joined #ruby
[22:01:53] orbyt_: has joined #ruby
[22:02:00] Cohedrin_: has joined #ruby
[22:03:08] jenrzzz_: has joined #ruby
[22:03:14] quobo: has joined #ruby
[22:03:27] bmurt: has joined #ruby
[22:03:37] bronson: has joined #ruby
[22:04:58] jphase: has joined #ruby
[22:06:32] ben_: has joined #ruby
[22:07:43] iszak: has joined #ruby
[22:07:43] iszak: has joined #ruby
[22:10:21] eckhardt: has joined #ruby
[22:13:52] Neptu: has joined #ruby
[22:14:12] michaelzinn: has joined #ruby
[22:14:57] skweek: has joined #ruby
[22:18:23] skweek: has joined #ruby
[22:18:50] Cohedrin_: has joined #ruby
[22:23:09] jphase: has joined #ruby
[22:36:47] michaelzinn: has joined #ruby
[22:41:07] mikecmpbll: has joined #ruby
[22:41:11] nobitanobi: has joined #ruby
[22:42:10] milardovich: has joined #ruby
[22:42:22] Cohedrin_: has joined #ruby
[22:43:08] jenrzzz: has joined #ruby
[22:43:08] jenrzzz: has joined #ruby
[22:45:42] bruce_lee: has joined #ruby
[22:45:42] bruce_lee: has joined #ruby
[22:48:14] ben_: has joined #ruby
[22:56:44] jphase: has joined #ruby
[22:57:23] michaelzinn: has joined #ruby
[22:58:12] jdawgaz: has joined #ruby
[22:58:57] jdawgaz: has joined #ruby
[22:59:47] jdawgaz: has joined #ruby
[23:00:37] jdawgaz: has joined #ruby
[23:01:22] jdawgaz: has joined #ruby
[23:02:12] jdawgaz: has joined #ruby
[23:02:58] tcopeland: has joined #ruby
[23:10:48] jdawgaz: has joined #ruby
[23:15:53] ornerymoose: has joined #ruby
[23:18:11] michaelzinn: has joined #ruby
[23:18:13] bronson: has joined #ruby
[23:19:02] cdg: has joined #ruby
[23:20:27] tAn: has joined #ruby
[23:23:17] tAn: has joined #ruby
[23:30:44] nofxx: has joined #ruby
[23:31:45] roadt: has joined #ruby
[23:37:21] mim1k: has joined #ruby
[23:38:50] PresidentBiscuit: has joined #ruby
[23:39:46] brent__: has joined #ruby
[23:40:47] michaelzinn: has joined #ruby
[23:45:07] cschneid: has joined #ruby
[23:46:10] jdawgaz: has joined #ruby
[23:48:05] cagomez: has joined #ruby
[23:48:16] cagomez: has joined #ruby
[23:49:20] jdawgaz: has joined #ruby
[23:49:27] cagomez: has joined #ruby
[23:49:32] moei: has joined #ruby
[23:50:05] jdawgaz: has joined #ruby
[23:50:55] jdawgaz: has joined #ruby
[23:51:25] cagomez_: has joined #ruby
[23:51:40] jdawgaz: has joined #ruby
[23:52:30] jdawgaz: has joined #ruby
[23:52:55] cagomez_: has joined #ruby
[23:53:16] MarkBilk: has joined #ruby
[23:53:20] jdawgaz: has joined #ruby
[23:54:05] jdawgaz: has joined #ruby
[23:54:55] jdawgaz: has joined #ruby
[23:55:40] jdawgaz: has joined #ruby
[23:58:07] jdawgaz: has joined #ruby