« Back to channel list

#ruby - 20 November 2018

« Back 1 day Forward 1 day »
[00:00:21] awkwords: has joined #ruby
[00:00:40] OrangeManBad: has joined #ruby
[00:01:03] awkwords: has joined #ruby
[00:01:20] SeepingN: has joined #ruby
[00:02:39] dubuc: zenspider, sample input should be this
[00:02:55] zenspider: hrm... I could have sworn that there was a fragment emitter... but maybe that's json, not yaml
[00:03:03] dubuc: [{'add_kubernetes_metadata' => {'in_cluster' => false}}, {'drop_event' => {'when'=>{'not'=>{'equals' => {'kubernetes.namespace' => 'kube-system' }}}}}]
[00:03:11] zenspider: >> [1,2,3].to_yaml.chars.drop(4).join
[00:03:17] ruby[bot]: zenspider: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[00:03:25] zenspider: there's a number of ways to do this. they all suck
[00:03:33] zenspider: >> require "psych"; [1,2,3].to_yaml.chars.drop(4).join
[00:03:34] dubuc: that's basically what I was getting
[00:03:39] ruby[bot]: zenspider: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[00:03:56] zenspider: fuck. ignore the bot... there's been a lot of problems with the eval service we use lately
[00:04:07] dubuc: Detail: undefined method `[]' for #<Enumerator:0x7968727a>
[00:04:36] zenspider: but something like. YAML.dump(xxx).lines.drop(1).join
[00:04:50] zenspider: IOW, look in Enumerable and use an appropriate method from there instead of something from Array
[00:05:04] al2o3-cr: zenspider: temporary bot prefix &>>
[00:05:13] zenspider: oh? different bot?
[00:05:20] zenspider: &>> require "psych"; [1,2,3].to_yaml.chars.drop(4).join
[00:05:20] al2o3-cr: zenspider: yeah.
[00:05:23] rubydoc: # => "- 1\n- 2\n- 3\n" (https://carc.in/#/r/5kml)
[00:05:31] zenspider: &>> require "psych"; [1,2,3].to_yaml.lines.drop(1).join
[00:05:32] rubydoc: # => "- 1\n- 2\n- 3\n" (https://carc.in/#/r/5kmm)
[00:05:48] zenspider: that's been maddening
[00:06:42] zenspider: dubuc: see above?
[00:07:01] dubuc: Yeah, trying that out right now! :)
[00:07:09] hutch: has joined #ruby
[00:07:29] zenspider: I'd probably do the lines.drop(1) just to make the diff fit as much as possible
[00:07:40] awkwords_: has joined #ruby
[00:08:08] venmx: has joined #ruby
[00:08:42] awkwords_: has joined #ruby
[00:09:36] dviola: has joined #ruby
[00:10:39] dubuc: zenspider & al2o3-cr: YAML.dump(@processors).lines.drop(1).join.gsub(/^/, ' ')
[00:10:42] dubuc: this works like a charm
[00:10:45] dubuc: thank you guys!!!
[00:11:07] dubuc: man, this community is cool :) that was responsive
[00:12:42] awkwords: has joined #ruby
[00:16:28] elphe: has joined #ruby
[00:17:58] zenspider: that still feels dangerous and error-prone to me... but if it works...
[00:19:31] zenspider: that whole file could literally be a simple(r) ruby file populating a hash and a single YAML.dump at the end to a file... *shrug*
[00:20:04] dubuc: That would be a bigger refactor for sure
[00:20:24] zenspider: it would take 10-20 minutes. really
[00:21:00] zenspider: ok. I give up on this jruby bullshit. damn working with this thing is painful.
[00:21:12] zenspider: Adding 3 seconds to every failure is just untenable
[00:35:04] dubuc: zenspider: https://github.com/pcfens/puppet-filebeat/pull/199 I gave you and al2o3-cr credit
[00:35:14] dubuc: thanks again :)
[00:40:45] al2o3-cr: dubuc: zenspider is the one you should credit, i merely assisted with the prefix of the bot =)
[00:42:29] awkwords: has joined #ruby
[00:43:18] dubuc: Sure. Still grateful tho!
[00:44:06] al2o3-cr: dubuc: np ;)
[00:53:03] queip: has joined #ruby
[01:04:40] houhoulis: has joined #ruby
[01:06:21] Liothen: has joined #ruby
[01:12:43] meinside: has joined #ruby
[01:13:08] awkwords: has joined #ruby
[01:13:47] awkwords: has joined #ruby
[01:18:28] bmurt: has joined #ruby
[01:27:35] ss_much: has joined #ruby
[01:33:19] awkwords: has joined #ruby
[01:36:03] minimal_life: has joined #ruby
[01:36:15] cd: has joined #ruby
[01:45:57] arescorpio: has joined #ruby
[01:49:39] queip: has joined #ruby
[02:11:40] esrse: has joined #ruby
[02:12:08] Xeago_: has joined #ruby
[02:16:57] bairyn: has joined #ruby
[02:24:03] nertzy: has joined #ruby
[02:33:58] awkwords: has joined #ruby
[02:42:18] Exuma: has joined #ruby
[02:49:21] stooj: has joined #ruby
[02:52:19] queip: has joined #ruby
[02:52:28] bmurt: has joined #ruby
[03:05:12] dbz: has joined #ruby
[03:24:14] OrangeManBad: has joined #ruby
[03:34:52] Swyper: has joined #ruby
[03:35:16] Swyper: https://pastebin.com/pVkhx8wb
[03:35:17] ruby[bot]: Swyper: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[03:35:30] Swyper: sorry about that, should I repaste using gist?
[03:36:08] Swyper: https://gist.github.com/RickArora/5d396ff38c03c75334a7fb055944363a
[03:37:17] Swyper: I’m trying to make the variable x keep every char that is uppercase
[03:39:39] dkmueller: has joined #ruby
[03:43:50] nchambers: Swyper: try map
[03:43:57] nchambers: erm, .chars.map
[03:44:03] Swyper: I have not learnt that yet
[03:45:01] nchambers: .chars returns an array of characters from the string, ie "hello" -> ["h", "e", "l", "l", "o"]
[03:45:33] nchambers: .map is like .each(_char), except it returns the changed values, instead of the original
[03:45:56] nchambers: &>> "abcd".chars.each { |char| char.upcase }
[03:45:57] rubydoc: # => ["a", "b", "c", "d"] (https://carc.in/#/r/5knt)
[03:46:03] nchambers: &>> "abcd".chars.map { |char| char.upcase }
[03:46:04] rubydoc: # => ["A", "B", "C", "D"] (https://carc.in/#/r/5knu)
[03:46:18] nchambers: sorry, slow typer
[03:46:19] Swyper: whats wrong with each_char, though ?
[03:46:24] Swyper: https://gist.github.com/RickArora/2b320b1d9ea3218985c74da3a5ec9226 updated gist
[03:46:31] nchambers: its returning the original values
[03:46:45] nchambers: &>> "abcd".each_char { |x| x.upcase }
[03:46:45] rubydoc: # => "abcd" (https://carc.in/#/r/5knv)
[03:47:14] Exuma: has joined #ruby
[03:48:09] Swyper: o-o shouldent x.upcase return ABCD
[03:48:13] Swyper: I kind of see the error now
[03:48:37] baweaver: each_char returns the original array
[03:48:44] baweaver: map is what transforms each element by applying a function to it
[03:49:05] baweaver: each* methods don't, except for some odd ones like each_with_object
[03:49:23] nchambers: is there one for String like #map?
[03:54:37] baweaver: Strings don't have a clear iterator
[03:54:38] baweaver: Is it by character? Line? Delimiter? Could be a lot of things
[03:54:46] baweaver: Arrays and Hashes have clear iterators.
[03:54:53] queip: has joined #ruby
[03:54:56] nchambers: ah, fair enough
[03:55:00] baweaver: You could also do each_char.map
[03:55:04] baweaver: but that's more typing
[03:57:52] Swyper: does indentation matter in ruby?
[03:58:13] nchambers: i haven't seen a case where it does yet
[03:58:25] nchambers: since most constructs have an end-icator
[03:58:29] Swyper: https://gist.github.com/RickArora/6b0a33fd09c36a6f281f08f215430062
[03:58:38] Swyper: updated gist
[03:58:48] nchambers: still has the same problem
[03:58:50] Swyper: syntax error, unexpected end-of-input, expecting keyword_end
[03:58:51] Swyper: the error im getting
[03:59:05] nchambers: .each returns the original array, you want .map
[03:59:09] nchambers: your if is missing an end
[03:59:50] Swyper: https://gist.github.com/RickArora/71529d14e7b812c438dfe1ddf138566d - this works
[04:01:05] Swyper: adding another end does not seem to fix it
[04:01:43] Swyper: meaning that same error still exists
[04:04:25] Swyper: https://gist.github.com/RickArora/d629e70b2afcaa9d0fa2623cb45ce8e5
[04:04:39] Swyper: updated gist, I added another end I still have the same error any idea why? nchambers
[04:05:09] nchambers: so couple of notes
[04:05:23] nchambers: is there an end after the return x that you're not pasting?
[04:05:29] nchambers: if not, you need one there too
[04:05:48] nchambers: secondly, im pretty sure that condition should be [A..Z] === el
[04:06:06] nchambers: (i actually just read baweaver's medium post on ===, would recommend)
[04:06:18] nchambers: also, im pretty sure you mean x += el, not el += x
[04:07:18] Swyper: sorry im a new ruby programmer aha
[04:07:49] nchambers: im pretty new myself tbh
[04:09:02] Swyper: so now the error I’m getting is the x is undefined
[04:09:08] Swyper: though I did define x
[04:09:36] nchambers: can you update the gist?
[04:09:59] braincrash: has joined #ruby
[04:10:14] Swyper: https://gist.github.com/RickArora/4047a57d4e1337c9c0a58f9bb0aa86b9
[04:10:43] nchambers: return goes between those two end's
[04:10:57] nchambers: that second end is the end of the function
[04:11:08] headius: has joined #ruby
[04:13:02] Swyper: https://gist.github.com/RickArora/6e8c9fa792feee530df4605f755da6e1
[04:13:06] Swyper: new error xD
[04:13:40] Swyper: why would it say the constant A is not intiailized.. isnt the range clear to ruby ? o-o
[04:13:51] nchambers: ["A".."Z"] == el
[04:13:54] nchambers: ["A".."Z"] === el
[04:13:56] nchambers: the second one
[04:14:05] nchambers: btw it needs to be that order, not the other way around
[04:14:34] nchambers: === performs blackmagic based on the left hand side
[04:14:51] Emmanuel_Chanel: has joined #ruby
[04:15:02] MoritaShinobu: has joined #ruby
[04:15:07] Swyper: i guess ill have to read the post you were talking about earliar, should I google it or do you want to post a link :P?
[04:16:01] nchambers: https://medium.com/rubyinside/triple-equals-black-magic-d934936a6379
[04:16:50] Swyper: https://gist.github.com/RickArora/3d0b954c216654c442c5e7f48c93ba4a - updated gist, still the same error
[04:17:15] nchambers: missing quotes around the A and Z
[04:18:50] Swyper: does Ruby not have a standard IDE like Java or C# ? xD
[04:19:04] nchambers: i like sublime personally
[04:19:10] nchambers: theres also the rubocop linter
[04:20:50] Inline: has joined #ruby
[04:22:50] Inline: has joined #ruby
[04:23:34] Swyper: now X is returning an empty string
[04:26:31] Swyper: https://gist.github.com/RickArora/7131f995cd52dd1b4afa91af65dab94a
[04:27:00] Swyper: nchambers:
[04:28:57] nchambers: so like i said im new, so im not sure what the difference between ("A".."Z") and ["A".."Z"] is, but ("A".."Z") works for me: https://clbin.com/o90Og
[04:29:05] MyMind: has joined #ruby
[04:29:09] nchambers: but ["A".."Z"] doesn't work for me either
[04:29:55] nchambers: its because ["A".."Z"] is an array of one element (that range object)
[04:30:21] nchambers: ("A".."Z") is an actual range
[04:31:44] Swyper: interesting
[04:32:41] Swyper: thank you very much
[04:32:45] Swyper: where did you learn ruby from ?
[04:33:07] nchambers: mostly from reading my companie's developers code
[04:33:10] nchambers: and idling in here
[04:34:22] nchambers: i learned a lot reading articles from https://medium.com/@farsi_mehdi as well
[04:44:15] marz_d`ghostman: has joined #ruby
[04:44:49] marz_d`ghostman: Is there an alternative for stub_const in rspec to override constants for the whole test? Like I have a constnat defined for the directory where logs are stored and I want to override that during tests
[04:45:08] Xeago_: has joined #ruby
[04:49:27] queip: has joined #ruby
[04:50:01] Exuma: has joined #ruby
[04:50:17] roshanavand1: has joined #ruby
[04:51:59] baweaver: Don't use === explicitly in code, it makes for a mess.
[04:52:38] baweaver: marz_d`ghostman: Don't make something like that a constant
[04:52:43] baweaver: Make it a configurable
[04:53:05] baweaver: DIR = 'abc'; def initialize(dir: DIR) ...
[04:53:17] baweaver: That way you can inject values to change that and not have it hardcoded
[04:53:46] baweaver: ACTION starts reading through backlogs
[04:54:07] marz_d`ghostman: baweaver: thanks, I'll look into it
[04:55:08] baweaver: Swyper no Swyping
[04:55:16] baweaver: Also don't use === explicitly
[04:55:31] Swyper: https://gist.github.com/RickArora/330a7ec7f7854b1bccd3c7b9041e1d16
[04:55:31] baweaver: use `include?` instead, it's clearer what you're doing
[04:56:12] Swyper: so right now my function is returning “dd” instead of “cd” when given an input of ("abcdef")
[04:56:28] Swyper: so i’m presuming the floor function is not working as I intended
[04:57:04] baweaver: Considering length is an integer
[04:57:09] baweaver: it's truncating
[04:57:45] baweaver: &>> { truncated: 5 / 2, non_truncated: 5 / 2.to_f }
[04:57:46] rubydoc: # => {:truncated=>2, :non_truncated=>2.5} (https://carc.in/#/r/5kot)
[04:58:07] baweaver: I'd check if the length were even or odd and go from there
[05:00:46] Swyper: I do that already no ?
[05:01:18] baweaver: &&> 2.even?
[05:01:19] rubydoc: did not understand that, parser error @ char position 0
[05:01:26] baweaver: &>> 2.even?
[05:01:27] rubydoc: # => true (https://carc.in/#/r/5kox)
[05:02:44] baweaver: the str.chars bit is redundant
[05:02:47] baweaver: strings can be sliced
[05:03:04] baweaver: &>> '(hi!)'[1..-2]
[05:03:05] rubydoc: # => "hi!" (https://carc.in/#/r/5kp1)
[05:04:07] Swyper: https://gist.github.com/RickArora/96c71af14dcbed36d7cc817dbfc2d6aa
[05:04:15] Swyper: updated code, same error
[05:04:44] Swyper: dosent make much sense though if its truncates it to a number then I subtract one the index should be the number below the number it already rounded to o-o
[05:06:10] Exuma: has joined #ruby
[05:07:06] baweaver: What's the error?
[05:08:02] baweaver: https://gist.github.com/RickArora/330a7ec7f7854b1bccd3c7b9041e1d16#gistcomment-2763932
[05:08:09] baweaver: Ranges work for string slices as well
[05:10:24] sagax: has joined #ruby
[05:10:31] bambanx: has joined #ruby
[05:12:22] Swyper: thanks aha
[05:12:29] Swyper: took the liberty of following you on github aswell ;o
[05:14:47] baweaver: Want a fun read?
[05:15:12] baweaver: Try this one out: https://medium.com/@baweaver/reducing-enumerable-part-one-the-journey-begins-ddc1d4108490
[05:15:19] baweaver: nchambers: You'll probably enjoy it too.
[05:15:37] nchambers: thanks, i've been meaning to go through that one
[05:15:38] sheepman: has joined #ruby
[05:15:44] baweaver: I took my entire talk from RubyConf and converted it into a multi-part story.
[05:15:56] baweaver: Including every single one of the major illustrations
[05:16:07] nchambers: i saw the lemur stickers on twitter
[05:16:13] baweaver: Speaking of I need to finish that danged Christmas talk already.
[05:16:15] nchambers: those looked really cool
[05:16:26] baweaver: We had a lot of fun with that one :D
[05:16:40] baweaver: havenwood was getting jumped at the Square booth for sticker prizes XD
[05:18:29] baweaver: Back to sketchy sketch time
[05:18:56] baweaver: The lemurs are saving Christmas, and Indigo and Escher cat are bending the fabric of reality to make it happen
[05:19:08] baweaver: (see part three to meet Escher)
[05:21:57] baweaver: https://twitter.com/keystonelemur/status/1064750537294389249
[05:22:06] baweaver: There's the first preview image to make its way out
[05:29:31] sauvin: has joined #ruby
[05:33:43] bairyn: has joined #ruby
[05:35:18] Emmanuel_Chanel: has joined #ruby
[05:37:53] patr0clus: has joined #ruby
[05:46:02] jetchisel: has joined #ruby
[05:46:02] marmotini_: has joined #ruby
[05:55:06] marz_d`ghostman: In plain ruby, how do I know if my script is being run in development/production/test(rspec)?
[06:01:44] marz_d`ghostman: baweaver: I created this config class:http://termbin.com/kj12 how do I populate different values based when it is run in production and in rspec though?
[06:02:14] reber: has joined #ruby
[06:04:00] marz_d`ghostman: Created a config/initializer/config.rb file in my project root to define the settings. e.g. App.configure do |config| log_dir = '/var/logs' end.
[06:04:07] marz_d`ghostman: but I want to set a different dir when testing
[06:04:31] marz_d`ghostman: Is there an environment variable set so I could define the corresponding values based on it is run on test or not?
[06:04:38] elphe: has joined #ruby
[06:09:08] marmotini_: has joined #ruby
[06:13:53] dellavg_: has joined #ruby
[06:16:00] reber__: has joined #ruby
[06:16:46] marmotini_: has joined #ruby
[06:23:40] Phenotype-A: has joined #ruby
[06:32:56] LightStalker: has joined #ruby
[06:35:02] jcarl43: has joined #ruby
[06:36:44] conta: has joined #ruby
[06:46:51] jordanm: has joined #ruby
[06:47:40] queip: has joined #ruby
[06:50:55] dbz: has joined #ruby
[06:54:09] luminous: has joined #ruby
[06:58:05] Emmanuel_Chanel: has joined #ruby
[06:58:21] aupadhye: has joined #ruby
[07:03:43] zenspider: marz_d`ghostman: everything you're describing is arbitrary. make it up
[07:08:44] gix: has joined #ruby
[07:08:48] Emmanuel_Chanel: has joined #ruby
[07:21:23] nowhere_man: has joined #ruby
[07:28:23] phaul: has joined #ruby
[07:36:10] _whitelogger: has joined #ruby
[07:36:18] jordanm: has joined #ruby
[07:42:27] planigan: has joined #ruby
[07:44:50] whysthatso: has joined #ruby
[07:50:18] queip: has joined #ruby
[07:56:46] aufi: has joined #ruby
[08:11:17] dkmueller: has joined #ruby
[08:14:13] pskosinski: has joined #ruby
[08:16:44] clemens3: has joined #ruby
[08:20:27] BH23: has joined #ruby
[08:27:22] aufi_: has joined #ruby
[08:28:21] marz_d`ghostman: zenspider: How do you run a file like /config/initializer/test.rb in rspec_helper?
[08:33:34] OrangeManBad: has joined #ruby
[08:34:58] AlexeyX: has joined #ruby
[08:35:57] AlexeyX: I'm trying to install a provider for vagrant... but something wrong with i18n...
[08:36:03] AlexeyX: Conflicting dependency chains:
[08:36:03] AlexeyX: i18n (= 1.1.1), 1.1.1 activated
[08:36:10] AlexeyX: vagrant-vmware-esxi (> 0), 1.0.1 activated, depends on
[08:36:10] AlexeyX: i18n (~> 0.6)
[08:36:33] AlexeyX: conflicting dependencies i18n (~> 0.6) and i18n (= 1.1.1)
[08:36:33] AlexeyX: Activated i18n-1.1.1
[08:36:33] AlexeyX: which does not match conflicting dependency (~> 0.6)
[08:36:59] AlexeyX: I tried to install i18n 0.7.0 via - gem install i18n --version 0.7.0
[08:37:16] AlexeyX: but it doesn't help
[08:37:32] AlexeyX: How to activate another version of i18n oO ?
[08:46:53] maufart__: has joined #ruby
[08:51:19] camilasan: has joined #ruby
[08:51:59] yohji: has joined #ruby
[08:52:02] vondruch: has joined #ruby
[08:52:24] queip: has joined #ruby
[08:57:01] dbz: has joined #ruby
[08:57:16] burgestrand: has joined #ruby
[09:12:10] voolik: has joined #ruby
[09:12:45] jokke1: has joined #ruby
[09:16:40] asphyxia: has joined #ruby
[09:20:33] jp: has joined #ruby
[09:25:42] ellcs: has joined #ruby
[09:35:12] lomex: has joined #ruby
[09:37:35] crankhar1er: has joined #ruby
[09:38:48] BH23: has joined #ruby
[09:40:17] venmx: has joined #ruby
[09:48:23] Nicmavr: has joined #ruby
[09:49:29] queip: has joined #ruby
[09:51:59] lomex: has joined #ruby
[09:57:42] clemens3: has joined #ruby
[09:58:12] roshanavand: has joined #ruby
[10:00:36] Guest61808: has joined #ruby
[10:01:19] dhollin3: has joined #ruby
[10:04:14] jordila: has joined #ruby
[10:11:38] jetchisel: has joined #ruby
[10:13:43] elphe: has joined #ruby
[10:14:40] rkoller: has joined #ruby
[10:18:45] gregf_: has joined #ruby
[10:25:34] marmotini_: has joined #ruby
[10:41:10] dkmueller: has joined #ruby
[10:48:38] queip: has joined #ruby
[10:58:19] dbz: has joined #ruby
[11:18:42] luminous: has joined #ruby
[11:34:05] dkmueller: has joined #ruby
[11:37:40] ua: has joined #ruby
[11:38:14] marmotini: has joined #ruby
[11:39:11] BTRE: has joined #ruby
[11:39:12] Nicmavr: has joined #ruby
[11:40:21] marmotini: has joined #ruby
[11:46:36] marmotini: has joined #ruby
[11:47:36] goatish: has joined #ruby
[11:51:20] GodFather: has joined #ruby
[11:52:23] keden: has joined #ruby
[11:52:27] keden: join #go-nuts
[11:54:43] queip: has joined #ruby
[12:00:34] quipa_: has joined #ruby
[12:03:26] keden: has joined #ruby
[12:05:10] dbz: has joined #ruby
[12:05:56] keden: has joined #ruby
[12:09:44] maximjaffe: has joined #ruby
[12:25:21] voolik: has joined #ruby
[12:32:24] al2o3-cr: if i allocate an arbitrary amount of bytes e.g `fp = Pointer.malloc 8, RUBY_FREE` now, do i have to explicitly call fp.free or will it be implicilty called when ruby's gc is run?
[12:34:10] cmhobbs: has joined #ruby
[12:35:33] LinuxKnight: has joined #ruby
[12:37:39] AJA4350: has joined #ruby
[12:38:00] reber: has joined #ruby
[12:38:57] asphyxia: has joined #ruby
[12:41:27] dkmueller: has joined #ruby
[12:46:58] Arkantos: has joined #ruby
[13:05:10] cow[moo]: has joined #ruby
[13:09:38] jottr: has joined #ruby
[13:14:42] vondruch: has joined #ruby
[13:16:05] bmurt: has joined #ruby
[13:17:19] marz_d`ghostman: has joined #ruby
[13:18:15] marz_d`ghostman: I'm trying to test that a file is being created with File.open. However, I have two File.open statement in my script and the first File.open statement is handled first which will make my expect test fail. How do I bypass the first one
[13:18:32] marmotini_: has joined #ruby
[13:22:01] phaul: I think you can trust File.open to work in almost all cases. no need to test
[13:22:48] phaul: unless you are the implementor of File
[13:35:05] dkmueller: has joined #ruby
[13:36:39] JamieD: has joined #ruby
[13:37:14] Guest61808: has joined #ruby
[13:40:25] marz_d`ghostman: I want to define a double and let it be the return value of a method. Like allow(SyncLog).to receive(:new).and_return(double()). How do I do it in a describe block scope instead of having to repeat it inside multiple "it".
[13:40:56] marz_d`ghostman: phaul: Oh, my script is conditional so I have to test that if this condition is met it creates the File. Thus, I'm testing if the File.open has been invoked
[13:42:25] crankhar1er: has joined #ruby
[13:43:26] phaul: marz_d`ghostman: that makes sense. testing if it was invoked is fine. You can create doubles in let blocks.. then you can share them between examples
[13:43:46] marz_d`ghostman: phaul: I'll try the let blocks, thanks
[13:53:26] dbz: has joined #ruby
[14:04:28] za1b1tsu: has joined #ruby
[14:05:09] hutch: has joined #ruby
[14:08:04] aupadhye: has joined #ruby
[14:08:08] dbz: has joined #ruby
[14:13:51] jhass: if they come back, they either want .and_return(a, b) to return a for the first call and b for the second or setup one or two mocks that are restricted with .with() to the particular argument
[14:20:28] marz_d`ghostman: has joined #ruby
[14:21:19] marz_d`ghostman: I'm testing every method call in isolation. So my first it block goes like it 'should create a new instance of logger' do expect(SyncLog).to receive(:new). How do I end the test with just that so that it won't continue to execute the script?
[14:30:26] sagax: has joined #ruby
[14:30:44] donofrio: has joined #ruby
[14:31:59] lomex: has joined #ruby
[14:32:55] roshanavand: has joined #ruby
[14:35:19] ixti: has joined #ruby
[14:37:23] im0nde: has joined #ruby
[14:37:54] kapil____: has joined #ruby
[14:53:50] Inline: has joined #ruby
[14:54:03] queip: has joined #ruby
[14:56:17] rippa: has joined #ruby
[14:57:04] jottr_: has joined #ruby
[15:02:38] jhass: structure your code in a way that you can run just the relevant part from your tests
[15:02:45] jhass: that is extract to classes & methods
[15:04:58] jottr: has joined #ruby
[15:10:23] blackmesa: has joined #ruby
[15:10:39] roshanavand: has joined #ruby
[15:10:46] Arkantos: has joined #ruby
[15:19:48] Guest61808: has joined #ruby
[15:29:56] Arkantos: has joined #ruby
[15:30:13] Guest61808: has joined #ruby
[15:38:23] eblip: has joined #ruby
[15:38:24] za1b1tsu: has joined #ruby
[15:38:53] voolik: has joined #ruby
[15:38:59] eb0t: has joined #ruby
[15:42:23] im0nde: has joined #ruby
[15:44:09] roshanavand: has joined #ruby
[15:45:09] nowhere_man: has joined #ruby
[15:48:27] MoritaShinobu: has joined #ruby
[15:48:45] Inline: has joined #ruby
[15:49:17] crankharder: has joined #ruby
[15:50:12] marmotini_: has joined #ruby
[15:51:31] luminous: has joined #ruby
[15:52:08] queip: has joined #ruby
[15:55:00] marmotini_: has joined #ruby
[15:56:30] dbz: has joined #ruby
[15:57:56] leitz: has joined #ruby
[16:09:32] nchambers: has joined #ruby
[16:12:58] KevinSjoberg: has joined #ruby
[16:15:05] za1b1tsu: has joined #ruby
[16:28:07] Arkantos: has joined #ruby
[16:28:36] dbz: has joined #ruby
[16:34:42] za1b1tsu: has joined #ruby
[16:36:14] Emmanuel_Chanel: has joined #ruby
[16:41:46] arup_r: has joined #ruby
[16:41:53] jottr: has joined #ruby
[16:48:05] code_zombie: has joined #ruby
[16:49:50] queip: has joined #ruby
[16:51:18] JasonO: Hello, I am receiving the error "SystemStackError: stack level too deep" when calling on a method
[16:51:26] dkmueller: has joined #ruby
[16:53:08] phaul: Hi JasonO, you probably have an infinite recursion in that method, depends on your code. Can you paste your code somewhere?
[16:53:33] blackmesa: has joined #ruby
[16:54:21] dkmueller: has joined #ruby
[16:58:25] JasonO: phaul: sure
[17:01:29] minimal_life: has joined #ruby
[17:02:04] akaiiro: has joined #ruby
[17:02:18] JasonO: phaul: trying to find a place. any suggestions?
[17:02:43] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[17:03:08] phaul: also dpaste.de
[17:03:30] JasonO: I'll go with dpaste.de as I don't need an account
[17:07:27] JasonO: phaul: https://dpaste.de/WTef#L7
[17:08:51] phaul: thanks, and can you paste the error message as well please
[17:09:58] phaul: I mean including the full stack, line numbers, file names etc
[17:11:45] JasonO: phaul: https://dpaste.de/ykwu
[17:15:37] nfk: has joined #ruby
[17:15:46] dbz: has joined #ruby
[17:19:02] phaul: my Rails atm is really rusty, but those double has_many relations with the same name are suspect to me
[17:19:50] phaul: has_many :pictures
[17:19:53] phaul: has_many :pictures, through: :comments
[17:22:37] JasonO: phaul: so I should only list one has_many association? I've this for comments as well in the same Class. I am trying to provide the user access. Per the association docs https://guides.rubyonrails.org/images/has_many_through.png
[17:22:57] JasonO: .comments to see comments from the user
[17:24:28] JasonO: *user.first.comments
[17:26:09] phaul: so does the User have pictures directly as well as through comments? or just via comments?
[17:28:10] JasonO: phaul: I realized my mistake after reading your last response
[17:28:17] JasonO: phaul: I removed " # has_many :pictures, through: :comments
[17:28:25] JasonO: now it works. thanks!
[17:28:32] phaul: ah, ok. yw
[17:32:44] Arkantos: has joined #ruby
[17:35:09] al2o3-cr: anyone know a little bit about argon2 here?
[17:36:57] al2o3-cr: i'm getting "memory cost is too small" with 2**N
[17:37:10] al2o3-cr: anything other than that is fine.
[17:41:51] burgestrand: has joined #ruby
[17:46:22] Dbugger: has joined #ruby
[17:47:24] elphe: has joined #ruby
[17:49:22] oft_gegong: has joined #ruby
[17:51:12] oft_gegong: so @instanceVariable, @@staticClassVariable ???
[17:51:13] cow[moo]: has joined #ruby
[17:51:49] oft_gegong: I'm coming from a java background
[17:52:22] queip: has joined #ruby
[17:55:21] beowuff: has joined #ruby
[17:55:36] phaul: oft_gegong: unfortunately it's not that simple
[17:55:52] krawchyk: has joined #ruby
[17:56:04] dinfuehr: has joined #ruby
[17:56:18] oft_gegong: darn. Training in a new language is a tough hurdle, *goes back to googling*
[17:56:25] phaul: are you ok with a ~ 1 hr youtube video about the Ruby object model?
[17:57:01] kapil____: oft_gegong: welcome
[17:57:02] sanscoeur: has joined #ruby
[17:57:15] phaul: https://www.youtube.com/watch?v=X2sgQ38UDVY
[17:58:54] phaul: the actual explanation starts at about 10 minutes in, up to that he is ridiculing other languages. but the rest is good
[18:00:14] doubledup: has joined #ruby
[18:01:05] dinfuehr: has joined #ruby
[18:03:14] jaddison: has joined #ruby
[18:03:37] jaddison: I can't get Rubymine (2018.3 RC) + vagrant (ubuntu xenial) + rvm (ruby 2.4.2, not system) to debug. It can't/won't install the debugging tool `ruby-debug-ide`
[18:04:14] jaddison: In Rubymine, I can add the rvm ruby 2.4.2 sdk fine. I can 'Run' (ie. not Debug) just fine, but I can't Debug.
[18:04:26] jaddison: Error message: "Error running 'Development: dna': Cannot start debugger. Gem 'ruby-debug-ide' isn't installed or its executable script 'rdebug-ide' doesn't exist."
[18:04:39] jaddison: Rubymine attempts to install it, but fails.
[18:05:12] jaddison: Thoughts? I'm just getting started on a Rails project I've inherited, and debugging it would make grokking it easier.
[18:05:22] jaddison: (that, and I'm relatively new to Ruby itself)
[18:08:29] roshanavand: has joined #ruby
[18:09:10] \void: has joined #ruby
[18:19:34] crankhar1er: has joined #ruby
[18:23:36] Inline: has joined #ruby
[18:23:59] mroutis: has joined #ruby
[18:28:15] SeepingN: has joined #ruby
[18:46:06] Exuma: has joined #ruby
[18:48:38] keden: has joined #ruby
[18:48:43] dviola: has joined #ruby
[18:50:55] queip: has joined #ruby
[18:51:43] OrangeManBad: has joined #ruby
[18:57:36] aarkerio: has joined #ruby
[18:59:07] aarkerio: hi! newbie question: if I'm inside the directory "foo" and I have the classes Foo::MyClass and Foo::MyOtherClass
[18:59:29] aarkerio: should I call Foo::MyOtherClass or MyOtherClass inside Foo::MyClass ??
[19:00:19] aarkerio: I mean, if the other class is in the same namespace
[19:00:49] aarkerio: even so need I the "Foo::" part ?
[19:01:19] donofrio: has joined #ruby
[19:04:33] rrichardsr3: has joined #ruby
[19:06:16] jottr: has joined #ruby
[19:07:38] ule: has joined #ruby
[19:15:39] Exuma: has joined #ruby
[19:15:56] Mike11: has joined #ruby
[19:23:56] dbz: has joined #ruby
[19:27:17] jcarl43: has joined #ruby
[19:28:37] lxsameer: has joined #ruby
[19:37:37] non_AI: has joined #ruby
[19:38:11] clemens3: has joined #ruby
[19:39:02] non_AI: hi guys, i am a python guy
[19:39:10] conta: has joined #ruby
[19:39:14] non_AI: but would like to learn ruby for web purpose
[19:39:47] non_AI: as cpanel offers ruby on rails
[19:40:06] non_AI: do you consider this to be good
[19:40:20] non_AI: does ruby offer flexibility as python does
[19:40:43] havenwood: non_AI: Rails is quite popular and has been widely copied. It's quite a nice option for webapps.
[19:40:59] reber: has joined #ruby
[19:41:06] havenwood: non_AI: I think of Ruby as more flexible than Python, for better or worse.
[19:41:13] non_AI: that's good
[19:41:19] jordila: has joined #ruby
[19:41:22] non_AI: so i have plenty of space with databases?
[19:41:33] havenwood: non_AI: Unless you mean flexible with GUI and mathematics libraries. :P
[19:41:51] havenwood: non_AI: What do you mean by "space with databases"?
[19:42:07] non_AI: python has some pretty cool libraries to access databases
[19:42:13] non_AI: how is ruby with that?
[19:43:14] havenwood: non_AI: it's great - lots of libs
[19:43:16] ua_: has joined #ruby
[19:43:21] non_AI: one more question
[19:43:29] non_AI: what about html
[19:43:37] havenwood: non_AI: Sequel and ActiveRecord are both extremely popular and have adapters to about everything.
[19:43:40] baweaver: ACTION wanders in
[19:43:50] havenwood: non_AI: what about HTMLL?
[19:43:50] non_AI: django does jinja for html
[19:44:05] non_AI: you know for dynamic html
[19:44:06] baweaver: Haml, ERB, Slim, and a few other ways of doing it.
[19:44:10] non_AI: what about rubby
[19:44:15] baweaver: ERB is the most typical
[19:44:23] baweaver: Haml will feel a ton like Python
[19:44:29] havenwood: non_AI: Rails uses ERB templates by default. It doesn't have a Rails-specific templating language like the Django-specific onne.
[19:44:51] baweaver: ERB looks a decent amount like Jinja and Handlebars.
[19:45:01] non_AI: so if i learn ruby on rails, it's a win win for doing webpages in cpanel, with database aps?
[19:45:03] havenwood: My ll and nn keys sticking for two lletters is drivinng me nnuts
[19:45:32] havenwood: non_AI: What are you thinking when you say "webpage"?
[19:46:59] baweaver: I think the thing you'll find is that you can make a webpage in any language, just depends on what you're most comfortable in
[19:52:27] non_AI: yes but i would prefer to work in cpanel
[19:52:34] bheesham: has joined #ruby
[19:55:03] queip: has joined #ruby
[19:57:25] whysthatso_: has joined #ruby
[20:01:07] SeepingN: has joined #ruby
[20:02:21] leah2: has joined #ruby
[20:02:41] Azure|dc: has joined #ruby
[20:02:47] jaddison: Any input on my RubyMine + vagrant + rvm + ruby 2.4.2 problem with debugging?
[20:03:17] havenwood: jaddison: What's the error when ruby-debug-ide installation fails?
[20:04:09] jaddison: "Cannot start debugger. Gem 'ruby-debug-ide' isn't installed or its executable script 'rdebug-ide' doesn't exist." (you can see my original comments in the channel logs here https://freenode.irclog.whitequark.org/ruby/2018-11-20#23526641)
[20:04:19] jaddison: havenwood ^
[20:05:14] jaddison: havenwood I have successfully manually installed ruby-debug-ide with the system ruby as well as the desired rvm ruby version, inside the vagrant
[20:05:25] jaddison: but it still isn't recognized by rubymine
[20:08:15] bambanx: has joined #ruby
[20:09:43] mzo: has joined #ruby
[20:13:21] rrichardsr3: has joined #ruby
[20:19:52] roshanavand: has joined #ruby
[20:20:28] marmotini_: has joined #ruby
[20:21:09] paulscoder: has joined #ruby
[20:26:29] havenwood: So RubyMine doesn't show the gem failure error? Hrm.
[20:26:43] havenwood: I wonder why it's installation isn't successful.
[20:26:47] dbz: has joined #ruby
[20:27:52] havenwood: jaddison: You're sure that RuyMine is using RVM 2.4.2 Ruby and that `gem install ruby-debug-ide` worked on that Ruby?
[20:28:22] jaddison: Yes, but I'll verify, havenwood
[20:28:32] havenwood: jaddison: Maybe RubyMine wants a specific version? Have you installed the exact version from the project Gemfile.lock?
[20:28:59] havenwood: jaddison: Another possibility is that RVM Gemsets are involved in the confusion.
[20:29:11] jaddison: havenwood it actually looks like RubyMine 'successfully installs' the debugger - but it installs it on my HOST machine, not in the vagrant box
[20:29:20] jaddison: (from the log file)
[20:30:11] havenwood: jaddison: An aside, but bump your 2.4 from 2.4.2 to 2.4.5 :)
[20:33:24] jaddison: ha ha, yes, I should. I'm just trying to get this project working locally according to how it's deployed in production
[20:33:47] jaddison: inheriting the project, not uber familiar with ruby or rails == uphill battle
[20:36:05] dbz: has joined #ruby
[20:38:26] mzo: has joined #ruby
[20:41:31] jaddison: havenwood I played with and without gemsets, no difference
[20:43:04] havenwood: jaddison: Sanity check that it's really the same Ruby that RubyMine is using. I personally always disable Gemsets.
[20:43:09] havenwood: jaddison: chruby with a text editor is super simple to setup
[20:43:15] havenwood: jaddison: rvm with an ide is tougher
[20:43:38] havenwood: jaddison: but i see your point about wanting ide and debugger assistance with an unfamiliar lang
[20:44:34] havenwood: unfamiliar app**
[20:44:36] jaddison: havenwood Yes, I'm super familiar with PyCharm, so RubyMine was logical for me. Atom doesn't have quite the toolset/workflow I'm looking for
[20:45:16] jaddison: havenwood, in desperation, I've created https://youtrack.jetbrains.com/issue/RUBY-23074
[20:45:24] havenwood: I don't use RubyMine, but sure would be nice if it'd show the gem installation error...
[20:45:38] havenwood: Is there like a debug mode for RubyMine?
[20:45:53] jaddison: Only log file, that I can see.
[20:46:15] havenwood: Does it have the gem installation error message?
[20:46:16] jaddison: which shows it successfully installing the debugger on the HOST, not the vagrant GUEST
[20:48:02] havenwood: jaddison: I don't know enough about RubyMine to know how to configure it with vagrant. The jetbrains issue ticket is the best I'd know.
[20:48:14] jaddison: Going to try updating rvm ruby version
[20:49:18] dbz: has joined #ruby
[20:52:41] queip: has joined #ruby
[20:55:39] venmx: has joined #ruby
[20:59:10] Exuma: has joined #ruby
[21:00:36] dbz: has joined #ruby
[21:02:18] gix: has joined #ruby
[21:04:12] elphe: has joined #ruby
[21:08:02] keden: has joined #ruby
[21:08:38] hutch: has joined #ruby
[21:12:15] dbz: has joined #ruby
[21:18:02] jaddison: no difference
[21:18:52] dbz: has joined #ruby
[21:18:59] minimal_life: has joined #ruby
[21:21:54] ellcs: has joined #ruby
[21:22:51] minimal_life: has joined #ruby
[21:25:13] claudiuinberlin: has joined #ruby
[21:27:59] OrangeManBad: has joined #ruby
[21:28:03] lomex: has joined #ruby
[21:32:48] venmx: has joined #ruby
[21:49:48] queip: has joined #ruby
[21:52:24] asphyxia: has joined #ruby
[21:53:44] darthfork: has joined #ruby
[21:55:30] Exuma: has joined #ruby
[21:59:38] BTRE: has joined #ruby
[22:04:00] Exuma: has joined #ruby
[22:07:38] darthfork: has joined #ruby
[22:15:10] Nicmavr: has joined #ruby
[22:16:19] mroutis: has joined #ruby
[22:20:22] brandonkal: has joined #ruby
[22:21:25] brandonkal: I am having a weird issue where `gem install csscss` works but then bash cannot find the command. MacOS. Any pointers would be appreciated.
[22:28:08] nchambers: what does `echo "$PATH"` say?
[22:28:11] nchambers: without the `'s
[22:32:58] BTRE: has joined #ruby
[22:47:15] BTRE: has joined #ruby
[22:49:01] brandonkal: I had `/usr/local/bin/ruby` in the path but I needed to add `/usr/local/lib/ruby/gems/2.5.0/bin`
[22:50:06] nchambers: fwiw, these are all the paths I have on my macbook: https://clbin.com/z3okA
[22:52:22] queip: has joined #ruby
[22:53:38] brandonkal: Interesting. Different paths. A bit confusing because `/usr/local/lib/ruby/` has `gems/2.5.0/gems` and also `2.5.0` but `ruby --version is 2.5.3
[22:55:36] nchambers: are you sourcing the rvm file?
[22:56:07] nchambers: something involving ~/.rvm/scripts/rvm
[23:00:52] nchambers: oh wait, did you install it with homebrew?
[23:00:52] ruby[bot]: has joined #ruby
[23:00:52] ChanServ: +o ruby[bot]
[23:01:04] nchambers: if so, don't listen to me, i thought i was looking at rvm paths
[23:01:24] nchambers: (although i would recommend switching to rvm)
[23:02:02] dbz: has joined #ruby
[23:06:09] nicesignal: has joined #ruby
[23:08:54] Tom-_: has joined #ruby
[23:09:04] dbz: has joined #ruby
[23:09:46] dbz_: has joined #ruby
[23:13:21] mochiyoda: has joined #ruby
[23:29:43] BTRE: has joined #ruby
[23:40:26] AJA4350: has joined #ruby
[23:46:50] Arkantos: has joined #ruby
[23:49:28] zapata: has joined #ruby
[23:51:29] queip: has joined #ruby
[23:57:19] bambanx: has joined #ruby