« Back to channel list

#ruby - 23 October 2018

« Back 1 day Forward 1 day »
[00:02:44] Rapture: has joined #ruby
[00:03:17] marmotini_: has joined #ruby
[00:23:24] camilasan: has joined #ruby
[00:27:30] orbyt_: has joined #ruby
[00:33:47] orbyt_: has joined #ruby
[00:51:07] cesario: has joined #ruby
[00:54:01] Nicmavr: has joined #ruby
[01:18:22] marmotini_: has joined #ruby
[01:56:21] jidar: has joined #ruby
[02:00:43] marmotini_: has joined #ruby
[02:10:27] Hanmac: has joined #ruby
[02:12:21] esrse: has joined #ruby
[02:20:29] luckyruby: has joined #ruby
[02:26:58] jidar: has joined #ruby
[02:38:08] graphene: has joined #ruby
[03:02:48] GodFather: has joined #ruby
[03:10:46] braincrash: has joined #ruby
[03:24:40] graphene: has joined #ruby
[03:26:57] graphene: has joined #ruby
[03:30:40] jp: has joined #ruby
[03:34:36] graphene: has joined #ruby
[03:40:49] sauvin: has joined #ruby
[03:43:29] dellavg_: has joined #ruby
[03:54:09] graphene: has joined #ruby
[04:20:45] wojnar: has joined #ruby
[04:32:13] danguita: has joined #ruby
[04:35:59] whysthatso: has joined #ruby
[04:47:07] arescorpio: has joined #ruby
[04:48:25] al2o3-cr: has joined #ruby
[04:57:45] MoritaShinobu: has joined #ruby
[05:07:34] FastJack: has joined #ruby
[05:18:53] SuperL4g: has joined #ruby
[05:24:13] Sup3rLurk: has joined #ruby
[05:27:06] kapil____: has joined #ruby
[05:39:33] vondruch: has joined #ruby
[05:42:50] tuor: has joined #ruby
[05:46:56] idiocrash: has joined #ruby
[05:47:30] anubhav996: has joined #ruby
[05:47:52] Furai: has joined #ruby
[05:51:02] uplime: has joined #ruby
[05:51:24] uplime: has left #ruby: ()
[05:57:41] cloaked1: has joined #ruby
[05:59:17] reber: has joined #ruby
[06:05:13] drale2k_: has joined #ruby
[06:09:32] zapata: has joined #ruby
[06:11:32] ponga: has joined #ruby
[06:15:50] aupadhye: has joined #ruby
[06:28:04] vondruch: has joined #ruby
[06:40:44] venmx: has joined #ruby
[07:02:43] wojnar: has joined #ruby
[07:05:14] graphene: has joined #ruby
[07:05:38] clemens3: has joined #ruby
[07:13:43] dionysus69: has joined #ruby
[07:28:39] darkhanb: has joined #ruby
[07:32:51] ineb: has joined #ruby
[07:43:09] stemid: has joined #ruby
[07:43:54] stemid: hey forgive me but I have no desire to learn ruby I just want to run a small piece of code and I can't figure out how to import Sidekiq::ScheduledSet because I keep getting the error "uninitialized constant Sidekiq::ScheduledSet (NameError)" from this code https://bpaste.net/show/2ce55dbea5a1
[07:52:13] stemid: think I figured it out require 'sidekiq/api'
[07:57:23] lxsameer: has joined #ruby
[08:05:10] mikecmpbll: has joined #ruby
[08:22:01] jp: has joined #ruby
[08:28:03] venmx: has joined #ruby
[08:50:45] Bish: to the windoow \o\
[08:52:21] Bish: stemid: what's wrong with ruby >:|
[08:52:48] status402: has joined #ruby
[08:54:31] tdy: has joined #ruby
[08:57:21] stemid: the name is too feminine
[08:57:23] stemid: has left #ruby: ()
[08:59:52] snowy: has joined #ruby
[09:11:59] phaul: has joined #ruby
[09:19:05] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(50).map { |x| y = 1 << x; dr.(y) } # physical
[09:19:30] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(50).map { |x| y = 1 << x; dr.(y) }.each_cons(2).map { |n| dr.(n.sum) } # non-physical
[09:19:46] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(50).map { |x| y = 1 << x; dr.(y) }.each_cons(2).map { |n| dr.(n.sum) }.each_cons(2).map(&:sum) # unknown-entity
[10:03:40] vondruch: has joined #ruby
[10:38:34] al2o3-cr: has joined #ruby
[10:41:05] xfbs: has joined #ruby
[10:46:26] al2o3-cr: has joined #ruby
[10:46:46] whysthatso: has joined #ruby
[10:46:59] beefjoe: has joined #ruby
[10:54:01] drale2k_: has joined #ruby
[10:56:44] troulouliou_div2: has joined #ruby
[11:02:31] whysthatso: has joined #ruby
[11:03:06] vondruch_: has joined #ruby
[11:04:17] AJA4350: has joined #ruby
[11:07:10] tdy: has joined #ruby
[11:22:33] marmotini_: has joined #ruby
[11:24:47] jsc: has joined #ruby
[11:33:08] kurko_: has joined #ruby
[11:33:45] Nicmavr: has joined #ruby
[11:40:50] apparition47: has joined #ruby
[11:42:35] vondruch: has joined #ruby
[11:50:38] surrounder: has joined #ruby
[11:51:44] ldnunes: has joined #ruby
[12:02:20] status402: has joined #ruby
[12:16:22] discopatrick: has joined #ruby
[12:17:09] gr33n7007h: has joined #ruby
[12:22:57] kapil____: has joined #ruby
[12:30:55] znz_jp: has joined #ruby
[12:33:11] status402: has joined #ruby
[12:36:44] k0mpa: has joined #ruby
[12:37:45] status402: has joined #ruby
[12:37:51] Fusl: has joined #ruby
[12:39:09] megabozz: has joined #ruby
[12:43:02] Puffball: has joined #ruby
[12:43:46] nowhere_man: has joined #ruby
[12:49:36] bak1an: has joined #ruby
[12:50:15] thejamespinto: has joined #ruby
[12:50:49] ua: has joined #ruby
[12:55:34] snowy: has joined #ruby
[13:12:49] mostlybadfly: has joined #ruby
[13:13:21] drale2k_: has joined #ruby
[13:13:52] jottr: has joined #ruby
[13:22:32] tdy: has joined #ruby
[13:29:17] drale2k_: has joined #ruby
[13:29:42] snowy: has joined #ruby
[13:35:42] Puffball: has joined #ruby
[13:48:55] darkxploit: has joined #ruby
[13:49:05] rubydoc: has joined #ruby
[13:51:41] darkxploit: hello, i want to install the latest development version of NET-SSH which is a ruby implementation of SSH from https://github.com/net-ssh/net-ssh. How do i make the installation from source ?
[13:53:46] darkxploit: there is both a gemfile and a rakefile inside the source code
[13:54:23] status402: has joined #ruby
[13:54:44] phaul: execute `bundle install` then execute `bundle exec rake build`
[13:55:07] darkxploit: phaul: can you please tell me what will the command bundle install do
[13:55:26] phaul: darkxploit: install the gem dependencies
[13:55:50] darkxploit: and bundle exec rake build
[13:55:55] darkxploit: will it build it from source
[13:56:31] phaul: build a .gem file that the gem utility can install
[13:56:47] darkxploit: imagine i modify the source code
[13:56:56] phaul: the compilation should be part of rake build
[13:56:59] Rapture: has joined #ruby
[13:57:50] darkxploit: thanks .. just did a snapshot of the machine.. and launched a bundle install..
[13:58:54] darkxploit: phaul: ok bunlde exec rake build is succesful
[13:59:22] cd: has joined #ruby
[14:00:05] phaul: gem install <yournewlybuilt.gem>
[14:00:43] phaul: is the last step to make it useable on the system
[14:02:59] beefjoe: has joined #ruby
[14:07:54] darkxploit: phaul: i dont find a new .gem file in the directory
[14:09:40] ogres: has joined #ruby
[14:10:26] darkxploit: sorry its in pkg directory where it was built by bundle exec rake
[14:11:22] darkxploit: phaul: now it says i gem installed
[14:12:31] phaul: darkxploit: so I expect the gem to be installed and functioning at this point
[14:13:44] darkxploit: phaul: thank you sir
[14:13:58] phaul: you are welcome
[14:14:21] darkxploit: phaul: how do i uninstall everything
[14:15:30] phaul: gem list --local lists what you have installed. gem uninstall gemname uninstalls it
[14:16:36] darkxploit: hmm okay,,,, easy
[14:24:38] orbyt_: has joined #ruby
[14:28:53] LiftLeft: has joined #ruby
[14:35:45] Puffball: has joined #ruby
[14:39:15] marmotini_: has joined #ruby
[14:39:50] snowy: has joined #ruby
[15:00:58] tdy: has joined #ruby
[15:02:17] Aces1up: has joined #ruby
[15:02:45] Aces1up: i know this isnt an active record channel but not getting a response on those chnnels for the issue im having maybe someone here can help https://paste.ofcode.org/XuBbAx3Jq2g6RQxCQkFY6E
[15:02:48] Aces1up: is my code.
[15:02:58] Aces1up: trying to get a has_many association to work
[15:03:21] bmurt: has joined #ruby
[15:06:49] conta1: has joined #ruby
[15:07:12] al2o3-cr: has joined #ruby
[15:07:23] phaul: aces1up: is /ruby/bot_framework_gem/lib/util/utility.rb your file or one of your dependencies?
[15:08:09] Aces1up: hrmm yes could be let me check
[15:09:39] phaul: did you write that source file or it's coming from a gem?
[15:09:41] Aces1up: hrmm didnt notice it was referencing my framework.. just assumed it was coming from AR
[15:09:53] Aces1up: thanks i will fix that up and see what happens.
[15:12:25] Aces1up: yep that fixed it man
[15:12:35] Aces1up: was looking at it so long didnt see that lol
[15:13:44] venmx: has joined #ruby
[15:17:02] xfbs: has joined #ruby
[15:21:38] mkroman: has joined #ruby
[15:30:58] tdy: has joined #ruby
[15:31:21] Inline: has joined #ruby
[15:42:21] nowhere_man: has joined #ruby
[15:44:43] dbugger_: has joined #ruby
[15:48:47] ivanskie: has joined #ruby
[15:56:15] kurko_: has joined #ruby
[16:04:56] SteenJobs: has joined #ruby
[16:06:32] xfbs: has joined #ruby
[16:07:20] GodFather: has joined #ruby
[16:07:53] SteenJobs: Hi all - been reading through the various different ways to execute system/shell commands, and I still can’t quite figure out which methods execute the given commands in a subshell vs as a subprocess (akin to python’s `shell=false`), so was hoping someone could help me clear things up
[16:10:27] jcarl43: has joined #ruby
[16:10:46] jp: has joined #ruby
[16:19:21] al2o3-cr: SteenJobs: Kernel#system executes in a subshell
[16:20:46] al2o3-cr: spawn, exec etc.. subprocesses.
[16:24:49] nowhere_man: has joined #ruby
[16:27:49] kurko_: has joined #ruby
[16:32:32] Rapture: has joined #ruby
[16:35:54] c0ncealed3: has joined #ruby
[16:36:38] SteenJobs: al2o3-cr: Great, thanks! - so in my script, i want to run a couple git commands, (1) `git fetch` and (2) `git pull`, and then (3) check `git status` - it seems like Open3#capture2 is a great candidate for (3), but for (1) and (2) I see no reason to execute in a subshell, but `exec` will replace the current process rather than creating a subprocess, so what would be a good option for (1) and (2)?
[16:37:42] SteenJobs: ugh *i’m writing the script based on a python script from a coworker, where the (1) and (2) equivalent is called using `subprocess.call` to provide some context
[16:37:58] kurko__: has joined #ruby
[16:39:46] al2o3-cr: SteenJobs: then use Process.spawn for #1 and #2; Open3#* are just an easy to use wrapper around Process.spawn if that helps.
[16:42:05] al2o3-cr: SteenJobs: do you want to capture stderr too?
[16:43:18] al2o3-cr: SteenJobs: if so use Open3.capture2e/3
[16:44:08] al2o3-cr: you know what open3 was written by the man himself.
[16:46:14] darkhanb: has joined #ruby
[16:46:45] GodFather: has joined #ruby
[16:47:15] avelldiroll: has joined #ruby
[16:49:37] al2o3-cr: SteenJobs: anything your not sure about just ask ;)
[16:49:53] SteenJobs: haha typing rn, ironing out my thoughts/questions, very much appreciated :)
[16:50:14] SteenJobs: al2o3-cr: my understanding is the parent process will inherit stderr when using Open3.capture2e/3, and i don’t really need to do anything with stderr other than display it and exit the script (which I understand I can do using the status object)
[16:50:45] SteenJobs: as for Process.spawn, it looks like the execution is done asynchronously without explicitly calling Process.wait, is that correct?
[16:52:06] jp: has joined #ruby
[16:52:07] SteenJobs: is the same true for Open3?
[16:53:05] SteenJobs: asking with regards to both Open3.capture* and Open3.popen*
[16:53:21] SteenJobs: ah ok - what exactly is the `wait_thr` param that gets passed into the block for the popen* methods?
[16:53:25] al2o3-cr: well, specifically not with caputre but popen you get a thread
[16:53:35] rippa: has joined #ruby
[16:54:06] al2o3-cr: the process
[16:55:14] cloaked1: has joined #ruby
[16:55:25] al2o3-cr: wht_thr is a Process::Status object with is just basically a thread.
[16:55:53] zapata: has joined #ruby
[16:57:21] al2o3-cr: returns a p/s object when called
[16:57:25] mfunkmann: has joined #ruby
[16:57:59] SteenJobs: ok got it, yea wasn’t sure what the object type was
[16:58:30] SteenJobs: so out of curiosity, if Open3 is by default synchronous, how would one use Open3 methods asynchronously? (not applicable to my use case since i need synchronous execution)
[16:58:39] al2o3-cr: sorry Process::Waiter my bad
[16:59:35] al2o3-cr: fork/thead them.
[17:01:35] zapata: has joined #ruby
[17:02:37] SteenJobs: hmm just pulled up the Process::Waiter docs and looks like pid is its only instance method - but the docs for Open3 show `wait_thr.value` returning a Process::Status object
[17:03:41] gigetoo: has joined #ruby
[17:03:55] GodFather: has joined #ruby
[17:05:17] zapata: has joined #ruby
[17:05:20] onkelhotte: has joined #ruby
[17:08:06] ivanskie: I have a little bit of code that checks if an executable out of an array exists, then gives me version number. Just spent half an hour googling a way to regex out the version number to no avail.
[17:08:20] bougyman: what's the version number?
[17:08:25] bougyman: I mean, what's an example?
[17:08:29] ivanskie: but then realized wait.. i can just do. string.split(' ')[1]
[17:08:34] al2o3-cr: SteenJobs: because inherits from Thread
[17:08:46] dbugger__: has joined #ruby
[17:08:50] SteenJobs: ah ok, missed that bit
[17:08:51] ivanskie: pip --version, python --version, etc
[17:08:53] al2o3-cr: Thread#value
[17:08:54] ivanskie: so far the only edge case is gcc
[17:09:27] ivanskie: good thing i don't care about gcc
[17:11:08] al2o3-cr: SteenJobs: the # refers to instance methods btw
[17:11:33] jetchisel: has joined #ruby
[17:11:52] SteenJobs: al2o3-cr: i’ll look thru the docs - it does seem that Kernel#system is probably the most straightforward way for (1) and (2) above, and since there’s no input, i guess there’s no potential issue with running a subshell
[17:12:41] al2o3-cr: SteenJobs: for that, sure.
[17:13:01] al2o3-cr: well, #1 and #2 anyway.
[17:13:53] al2o3-cr: ivanskie: what does this string look like?
[17:14:12] ivanskie: pip 18.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
[17:14:20] ivanskie: curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.4 zlib/1.2.
[17:14:26] SteenJobs: al2o3-cr: do any of the methods for executing commands bubble up exceptions such that the parent process will simply fail and terminate execution without explicitly checking the Process::Status object?
[17:14:42] ivanskie: or Python 2.7.15
[17:14:50] al2o3-cr: Open3 methods?
[17:14:58] ivanskie: from open3 yes
[17:15:12] al2o3-cr: ivanskie: thats for SteenJobs
[17:15:29] ivanskie: ACTION slowly turns around and walks away
[17:16:26] bmurt: has joined #ruby
[17:17:01] SteenJobs: al2o3-cr: for either Open3 or Kernel (are Kernel#spawn and Process#spawn identical?)
[17:17:28] al2o3-cr: yeah, identical.
[17:19:50] al2o3-cr: obviously only if the command doesn't exist
[17:20:36] al2o3-cr: and that'll be Error.
[17:20:49] al2o3-cr: and that'll be Error::ENOENT
[17:21:48] al2o3-cr: ivanskie: what string?
[17:21:49] SteenJobs: i guess for example if the subprocess executes a `git fetch` and for whatever reason origin doesn’t exist or something occured that would cause `git fetch` to fail, would all the methods we discussed require explicitly checking the status object?
[17:22:13] al2o3-cr: SteenJobs: yes.
[17:22:19] ivanskie: "pip 18.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)" or "curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.4 zlib/1.2." etc...
[17:23:01] al2o3-cr: but for 1 and 2 just use system. it will either return true or false.
[17:24:07] SteenJobs: Ok cool - oneeee last q - with Open3.capture*, if stderr is inherited, what exactly does that mean? I assume it means that the subprocess shares the same stderr as the parent process, so in the `git fetch` case, if the child process has a non-zero exit status, would that cause the parent process (the containing script) to stop execution?
[17:24:30] SteenJobs: but yea, in practice i’ll use system for 1 and 2
[17:26:53] al2o3-cr: stderr will be captured in the same stream as stdout using c2/e, c3 will be two seperate streams.
[17:29:08] al2o3-cr: SteenJobs: oh yeah sorry. yes.
[17:29:15] mikecmpbll: has joined #ruby
[17:31:10] al2o3-cr: you can check with t.value.exitstatus.
[17:32:22] wojnar: has joined #ruby
[17:33:18] mangold: has joined #ruby
[17:35:23] al2o3-cr: what versoin you after?
[17:37:34] al2o3-cr: how can you split(' ')[1]?
[17:45:10] conta1: has joined #ruby
[17:47:13] al2o3-cr: what's is everybodys thoughts on (-1..)? for infinte ragne?
[17:47:50] siaw23: has joined #ruby
[17:48:24] al2o3-cr: i think it's brilliant myself
[17:48:49] al2o3-cr: oh and yield_self is alaised to then.]
[17:48:55] siaw23: good eve everyone! what’s be the easiest way to grab the second string. eg: “some cat”
[17:49:00] siaw23: i want to grab “cat” only
[17:49:05] siaw23: currently i’m using
[17:49:14] siaw23: string[] which i don’t want to
[17:49:22] siaw23: will there be an easier way?
[17:50:19] siaw23: so the way i’m doing it is like string[first_string.length + 1, string.length - first_string + 1]
[17:50:32] siaw23: which is too long and i feel there’s an easier way
[17:50:52] al2o3-cr: split.[]/first?
[17:50:59] al2o3-cr: split.[]/last?
[17:51:26] woodruffw: if the string is exactly two words, String#split and Array#last are what you want
[17:51:37] woodruffw: otherwise, String#split and then get the first element
[17:51:44] woodruffw: err, second element, index 1
[17:52:57] mfunkmann: Hey, which GUI Framework would you guys use for a ruby macOS Desktop App?
[17:53:25] al2o3-cr: "some cat"[/\S+\z/]
[17:53:49] siaw23: woodruffw: sounds like a good idea
[17:55:01] al2o3-cr: shit i forget more ruby i used to nkow.
[17:56:57] ptx0: has joined #ruby
[17:57:40] al2o3-cr: other than that waht woodruffw said. ;)
[17:58:30] al2o3-cr: ACTION pissed up agian forgive me
[17:59:13] SeepingN: has joined #ruby
[17:59:14] siaw23: yeah got it
[17:59:22] al2o3-cr: how small this screen going be?
[17:59:34] dellavg_: has joined #ruby
[17:59:51] al2o3-cr: x270 thinkpad i ant see on this now
[18:00:58] al2o3-cr: siaw23: ak, cool.
[18:01:09] snowy: has joined #ruby
[18:01:16] phaul: oh ffs. https://github.com/guidomb/app_configuration#customize-your-configuration of course it's instance evaled on an object that doesn't even respond to those methods. But it gets them with method_missing, and then does nothing.
[18:02:52] al2o3-cr: phaul: think of 3, 6 and 9.
[18:03:14] al2o3-cr: tesla was clam
[18:03:56] al2o3-cr: he was a genius by many,.
[18:04:14] al2o3-cr: that dude, WOW.
[18:05:17] al2o3-cr: the univerese is number
[18:09:09] phaul: also it doesnt bother implementing respond_to_missing. I shouldn't use that library....
[18:09:36] baweaver: mfunkmann - https://saveriomiroddi.github.io/An-overview-of-ruby-gui-development-in-2018/
[18:10:02] mfunkmann: baweaver: Thank you very much, sir.
[18:10:16] baweaver: I will warn you though that it's not incredibly common
[18:10:28] baweaver: So finding resources may be interesting.
[18:11:16] al2o3-cr: bin nums to ^ 2 = each con 1 2 4 8 5 7 -> digital root -> 6 3 - > each con -> 9 then sum given (49) = 432 wow 432 ^ 2 == speed light
[18:11:46] phaul: al2o3-cr: ok
[18:11:57] phaul: :) if you say so
[18:12:15] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(49).map { |x| y = 1 << x; dr.(y) }.each_cons(2).map { |n| dr.(n.sum) }.each_cons(2).map(&:sum).sum
[18:12:33] al2o3-cr: very interesting to me,
[18:12:58] al2o3-cr: 432 ** 2 = 186....
[18:13:38] phaul: looks pretty much random to me. what is this
[18:14:04] al2o3-cr: phaul: random? wtf ;)
[18:14:53] baweaver: It's too early for me to try and figure that out
[18:16:01] baweaver: al2o3-cr: the last three could be flatten.sum, no?
[18:16:15] al2o3-cr: baweaver: no.
[18:16:44] al2o3-cr: baweaver: one sec i give you my 3 dimensoins
[18:16:52] baweaver: dr = -> n { 1 + (n - 1) % 9 }; 0.step(49).map { |x| y = 1 << x; dr.(y) }.each_cons(2).sum { |n| dr.(n.sum) }
[18:17:13] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(49).map { |x| y = 1 << x; dr.(y) }
[18:17:24] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(49).map { |x| y = 1 << x; dr.(y) }.each_cons(2).sum
[18:17:46] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(49).map { |x| y = 1 << x; dr.(y) }.each_cons(2).sum { |n| dr.(n.sum) }
[18:18:09] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(49).map { |x| y = 1 << x; dr.(y) }.each_cons(2).sum { |n| dr.(n.sum) }.map(&:sum)
[18:18:17] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(49).map { |x| y = 1 << x; dr.(y) }.each_cons(2).sum { |n| dr.(n.sum) }.map(&:sum).sum
[18:18:24] al2o3-cr: dr = -> n { 1 + (n - 1) % 9 }; 0.step(49).map { |x| y = 1 << x; dr.(y) }.each_cons(2).sum { |n| dr.(n.sum) }.map(&:sum).sum ** 2
[18:18:44] baweaver: ACTION goes to get coffee
[18:22:22] phaul: I must have missed the begining of the conversation because this makes 0 sense to me :)
[18:22:41] al2o3-cr: phaul: tesla 3,6 and 9
[18:23:38] phaul: yeah, that cleared it up
[18:23:40] al2o3-cr: i'd explain it but to drunk ;)
[18:24:06] al2o3-cr: that was before +)
[18:24:36] phaul: no problemo :)
[18:25:04] al2o3-cr: that was ctrl+r it doesn't even make senes to me naw :)
[18:29:52] al2o3-cr: base 2 to infinite and beyond
[18:30:59] al2o3-cr: i should of litsened in mathematics.
[18:33:58] al2o3-cr: Complex(3,4) * Complex(3,4).conj # real / imaginary pythag.
[18:34:56] al2o3-cr: Complex numbers + - + -
[18:35:19] al2o3-cr: wow so difficlut
[18:35:38] whysthatso: has joined #ruby
[18:36:31] al2o3-cr: axis this axis that.
[18:37:02] al2o3-cr: i should of listened instead of pissing about.
[18:37:58] al2o3-cr: baweaver: have some coffee for me too ;)
[18:40:42] voiceftp: has joined #ruby
[18:40:43] voice_ftp: has joined #ruby
[18:41:47] voiceftp: has joined #ruby
[18:41:53] voice_ftp: has joined #ruby
[18:43:32] siaw23: has joined #ruby
[18:43:44] siaw23: has left #ruby: ()
[18:48:54] al2o3-cr: (1..10).select &-> n { n > 3 }.curry
[18:49:20] al2o3-cr: that's the best currt in the worl.xd
[18:49:35] al2o3-cr: *curyy sorry
[18:50:23] al2o3-cr: the lang is just amazing"!!!!!!
[19:01:00] al2o3-cr: Process.arv0 still f*ck'd
[19:01:38] sameerynho: has joined #ruby
[19:08:40] x0F: has joined #ruby
[19:09:53] snowy: has joined #ruby
[19:16:37] al2o3-cr: Etc.nprocessors >> 1 # who has here as the most physical processors?
[19:17:13] al2o3-cr: i'll go first 128
[19:17:51] al2o3-cr: with hyperthraeding 64
[19:18:31] dogweather: has joined #ruby
[19:18:51] cthulchu_: so we've been discussing ops
[19:19:21] cthulchu_: and we decided that the less an op uses their power, the better op they are
[19:19:37] cthulchu_: also best channels seem to have no ops at all
[19:20:16] al2o3-cr: cthulchu_: how are you dude?#
[19:22:45] cthulchu_: I'm good, thanks
[19:23:19] al2o3-cr: i got a blazing fast laptop here, faster than rust. you just wouldtn beleive it ;+)]
[19:23:34] cthulchu_: hehe, where did you get it from? :)
[19:23:59] al2o3-cr: it's was given to me
[19:24:18] dogweather: has joined #ruby
[19:24:33] al2o3-cr: the local church.
[19:24:48] cthulchu_: congrats on that
[19:25:19] al2o3-cr: but need upgrade naw
[19:26:01] al2o3-cr: i need a x270
[19:26:14] al2o3-cr: x280 no good.
[19:27:10] al2o3-cr: im on t430s still good but..
[19:28:07] al2o3-cr: the samsing ssd probably worth more than this now.
[19:28:56] al2o3-cr: i reckon if sell 125
[19:30:35] al2o3-cr: cthulchu_: what you running on ?
[19:37:41] x0F: has joined #ruby
[19:47:34] snowy: has joined #ruby
[19:53:14] eckhardt_: has joined #ruby
[19:53:50] voolik: has joined #ruby
[19:58:17] kurko_: has joined #ruby
[19:58:48] venmx: has joined #ruby
[20:04:44] akosednar: has joined #ruby
[20:05:43] thejs: has joined #ruby
[20:06:58] voolik: has joined #ruby
[20:16:35] BH23: has joined #ruby
[20:18:07] baweaver: cthulchu_: Depends on whether or not the usage is warranted.
[20:19:21] cthulchu_: I believe you can always justify usage
[20:19:29] cthulchu_: the opposite is true too
[20:19:34] cthulchu_: you can always avoid usage
[20:27:21] baweaver: If someone's disrupting the channel or breaking the rules we do something about it.
[20:34:42] SteenJobs: has joined #ruby
[20:38:04] mangold: has joined #ruby
[20:42:30] kurko_: has joined #ruby
[20:51:13] SteenJobs: al2o3-cr: thanks for the help before, sorry i suddenly disappeared, totally lost track of time and had to bolt to an appointment haha
[20:54:16] al2o3-cr: SteenJobs: wt. yw.
[21:01:17] al2o3-cr: baweaver: best wishes
[21:02:05] al2o3-cr: baweaver: best wishes dude!
[21:02:33] SteenJobs: has joined #ruby
[21:09:46] rubydoc: has joined #ruby
[21:11:25] eddof13: has joined #ruby
[21:11:57] al2o3-cr: baweaver: "amFzb24gbXllcnM=" unpack this string (base64)
[21:13:16] al2o3-cr: using String#unpack
[21:19:30] al2o3-cr: "amFzb24gbXllcnM=".unpack1('m0') == %(jason myers)
[21:20:44] al2o3-cr: the michaels brothre
[21:25:48] al2o3-cr: baweaver: you need to get ya pecking sweet!
[21:25:57] leitz: has joined #ruby
[21:37:46] pharma_joe: has joined #ruby
[21:50:14] baweaver: al2o3-cr: easy on the juice.
[21:52:44] al2o3-cr: baweaver: sweeto ;)
[21:55:07] al2o3-cr: ok, i.m ko np.
[21:56:52] phaul: don't forget to hydrate yourself. large glass of water will help. you will be thankful tomorrow :)
[21:58:10] al2o3-cr: phaul: too true.]
[21:59:02] al2o3-cr: big water tomos.
[21:59:28] al2o3-cr: never break the chain.
[22:00:38] BlaDe^: has joined #ruby
[22:00:48] BlaDe^: with the erb command line tool, how can I define an array?
[22:07:53] al2o3-cr: BlaDe^: var=arrzy that'll do it.
[22:08:34] al2o3-cr: no spaces tho
[22:09:30] al2o3-cr: arr=[blha,blah,blah]
[22:10:09] al2o3-cr: gets reads until \n
[22:10:58] BlaDe^: oh, easy. What about an object? .. so foo[:bar]
[22:11:17] al2o3-cr: ok, no probs
[22:13:55] al2o3-cr: BlaDe^: what have you tried oin the command line??
[22:14:03] Nicmavr: has joined #ruby
[22:14:32] BlaDe^: well, right now I'm trying to do erb -r ./env.rb config.erb
[22:14:51] BlaDe^: and I get undefined local variable or method `node' for main:Object (NameError) .. when defining node = {:environment => 'local'} in env.rb
[22:16:47] al2o3-cr: BlaDe^: your env.eb isn't relative then.
[22:17:03] BlaDe^: it is picking up the .rb for sure because if I make a syntax error it barfs
[22:17:37] al2o3-cr: a systax error?
[22:17:49] SteenJobs: has joined #ruby
[22:18:04] BlaDe^: yeah, instead of => if I do = I get: env.rb:2: syntax error, unexpected '=', expecting => (SyntaxError)
[22:18:08] BlaDe^: so it is reading the correct file..
[22:19:18] al2o3-cr: BlaDe^: so you got a syntax error somewhere
[22:19:45] BlaDe^: I made that on purpose to prove the env.rb is relative and is being loaded by erb
[22:20:09] BlaDe^: the real issue I'm facing is why it thinks `node` is undefined when I'm setting node = { ... } in the .rb file
[22:20:18] al2o3-cr: well its not finding node]
[22:20:28] pharma_joe: has joined #ruby
[22:20:48] BlaDe^: yeah :( any ideas why?
[22:21:30] al2o3-cr: it'll help if you can show your code? (if possible)
[22:22:28] _phaul: has joined #ruby
[22:22:58] xfbs: has joined #ruby
[22:23:02] al2o3-cr: just psate in
[22:23:10] fluxAeon: has joined #ruby
[22:24:54] BlaDe^: al2o3-cr: https://pastebin.com/raw/2ybWBsy4
[22:24:54] ruby[bot]: BlaDe^: as I told you already, please use https://gist.github.com
[22:25:02] BlaDe^: wow, aggressive bot :p
[22:26:12] BlaDe^: I don't have my 2FA right now to login to github to gist :X
[22:27:26] al2o3-cr: that basically telling you there is no method at top level.
[22:27:55] nicesignal: has joined #ruby
[22:28:04] BlaDe^: how should I go about that? the .erb is fine when I run via my chef cookbook
[22:28:12] BlaDe^: I'm trying to share the .erb with a local setup and just run erb against a .env file
[22:28:50] al2o3-cr: paste config.lua.erg
[22:28:57] al2o3-cr: paste config.lua.er*b
[22:30:00] al2o3-cr: your namespacing is no good.
[22:30:09] BlaDe^: it's a huge lua file with <%= node[:var] %> and <% unless node[:environment] == 'prod' %> blocks in it -- i don't _have_ any namespacing in the .erb file itself
[22:30:31] BlaDe^: I didn't setup our chef stuff, so I don't really know how it works.. I'm just trying to make the .erb file render without a full chef run, locally
[22:32:08] al2o3-cr: you sure that definitly name is right?
[22:33:00] al2o3-cr: just check please.
[22:35:12] BlaDe^: the .env.rb i pasted is raw from my text editor - not changed at all, and I apsted the 3 lines from .config.erb .. Let me play a little
[22:35:49] al2o3-cr: BlaDe^: node doesn't exist.
[22:35:54] im0nde: has joined #ruby
[22:37:15] BlaDe^: $ head -1 env.rb ---> node = {
[22:37:26] BlaDe^: do i have to... export it or something?
[22:38:05] phaul: use instance variables
[22:38:14] phaul: @node = { ...
[22:38:21] phaul: and @node in the erb file
[22:39:08] al2o3-cr: phaul: they dont't have to, if it's in the namespace they're saying.....
[22:39:58] al2o3-cr: braincrash: -O
[22:40:38] al2o3-cr: braincrash: sorry, shit tab-comp
[22:41:40] al2o3-cr: BlaDe^: that should see it.
[22:41:56] al2o3-cr: are you a dir down?
[22:42:32] phaul: can we try it though? I bet it will fix it
[22:43:35] al2o3-cr: phaul: globals will fix it too.#
[22:43:52] al2o3-cr: that's not the point.
[22:44:24] BlaDe^: if I use @node I get config.lua.erb:26:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)
[22:44:36] BlaDe^: al2o3-cr: actually I am a dir down.... that matters?!
[22:45:34] BlaDe^: i have .env.rb and app/config.lua.erb ... expect that erb -r .env.rb app/config.lua.erb would work..
[22:46:29] al2o3-cr: BlaDe^: what does pwd
[22:47:03] BlaDe^: https://pastebin.com/88kvx31D
[22:47:03] ruby[bot]: BlaDe^: as I told you already, please use https://gist.github.com
[22:48:11] al2o3-cr: BlaDe^: that should work. really.
[22:48:13] BlaDe^: pwd is /Users/admin/demo/ ... which houses .env.erb and app/config.lua.erb
[22:49:29] BlaDe^: yeah, that's my thinking too?!
[22:49:52] SeepingN_: has joined #ruby
[22:49:58] BlaDe^: I just added .env.rb -- @test = 'foo' and <%= @test %> to the .erb and it passes fine, still barfs on the node line
[22:50:31] BlaDe^: but test = 'foo and <%= test %> doesn't work for probably an unrelated reason config.lua.erb:7:in `test': wrong number of arguments (given 0, expected 2..3) (ArgumentError)
[22:51:55] al2o3-cr: i'll have to see config
[22:53:38] BlaDe^: al2o3-cr: this is actually SUPER easy to repro
[22:54:01] BlaDe^: echo "node = { :environment => 'foo' }" >> foo.rb; echo "<%= node[:environment] %>" >> bar.erb ; erb -r ./foo.rb bar.erb
[22:54:30] BlaDe^: bar.erb:1:in `<main>': undefined local variable or method `node' for main:Object (NameError)
[23:00:58] al2o3-cr: BlaDe^: SUPER clueless.
[23:01:08] BlaDe^: al2o3-cr: im glad i'm not crazy, at least
[23:01:25] phaul: al2o3-cr: I don't think it's supposed to work with local vars
[23:01:52] phaul: use instance vars. as I already suggested. That *will* fix it
[23:02:46] BlaDe^: yeah... the @ does help - but then I can't use the same file in chef and locally, which is... kind of what im striving for
[23:03:28] phaul: well you could define methods :) def node ...
[23:04:03] phaul: that should also fix it
[23:04:05] BlaDe^: huh? a method can be treated like an object?
[23:04:24] BlaDe^: I basically hammer chef cookbooks until they do what I want, and have no real idea how anything works in ruby land
[23:04:27] phenom: has joined #ruby
[23:04:28] al2o3-cr: a method can retrun anytink
[23:04:46] phaul: def node ; { environment: 'foo' }; end
[23:04:51] BlaDe^: return.. right.. but wouldn't I need to call it to access the resulting object? so it wouldn't be the same erb
[23:04:58] BlaDe^: ACTION tests
[23:05:51] al2o3-cr: that should of worked regardless.
[23:05:52] BlaDe^: woah, that works
[23:06:02] BlaDe^: WHY DOES THAT WORK. lol.
[23:06:32] bak1an: has joined #ruby
[23:07:47] al2o3-cr: BlaDe^: instance variables and shit.
[23:09:01] hitchhikingcoder: has joined #ruby
[23:09:05] BlaDe^: thanks al2o3-cr & phaul
[23:10:33] eddof13: has joined #ruby
[23:10:59] al2o3-cr: BlaDe^: don't thank me. thank phaul !:)
[23:11:28] hitchhikingcoder: has joined #ruby
[23:12:43] al2o3-cr: that should work. wtf.
[23:13:16] BlaDe^: but you provided emotional support in the form of making me feel like less of a dumbass
[23:14:18] leitz: has joined #ruby
[23:14:20] eckhardt_: has joined #ruby
[23:14:30] phaul: al2o3-cr: I see the code getting the top level binding being passed into erb. but how does it get the top level of the -r file? isn't thata separate lexical scope anyways?
[23:14:33] al2o3-cr: BlaDe^: tomorrow i test this out.
[23:14:51] hitchhikingcoder: has joined #ruby
[23:14:59] BlaDe^: ha ok I am intrigued to hear more
[23:15:37] phaul: I mean is this broken, .... ?
[23:16:40] al2o3-cr: phaul: BlaDe^ I FIX THIS,]
[23:18:01] jetchisel: has joined #ruby
[23:18:55] phaul: https://www.ruby-forum.com/t/setting-local-variables-for-erb-command-line-tool/197444/2
[23:19:00] phaul: this is from 2010
[23:19:21] phaul: so hard to beleive that it was ever working like that
[23:21:32] al2o3-cr: too much drink tnight. i cee tmos.
[23:21:59] phaul: take care mate
[23:22:43] nexraf1: has joined #ruby
[23:22:43] al2o3-cr: you too. ruby elite ;)
[23:26:46] hitchhikingcoder: has joined #ruby
[23:29:27] darthfork: has joined #ruby
[23:29:45] Eiam: has joined #ruby
[23:45:54] dnewkerk: has joined #ruby
[23:53:36] orbyt_: has joined #ruby
[23:57:20] ziggylazer: has joined #ruby
[23:58:22] phaul: fwiw this also works TOPLEVEL_BINDING.local_variable_set(:node, {... , the difference has to be that the required file does not run in TOPLEVEL. I am guessing though, can anyone confirm?