« Back to channel list

#ruby - 02 July 2018

« Back 1 day Forward 1 day »
[00:07:03] cagomez: has joined #ruby
[00:09:02] karapetyan: has joined #ruby
[00:13:35] jaequery: has joined #ruby
[00:14:31] za1b1tsu: has joined #ruby
[00:14:55] nowhere_man: has joined #ruby
[00:15:12] wilbert: has joined #ruby
[00:20:16] chouhoulis: has joined #ruby
[00:22:42] cschneid: has joined #ruby
[00:32:36] lxsameer: has joined #ruby
[00:34:12] et09: has joined #ruby
[00:34:37] et09: editing someone else's code - he defined a class getter 'payer_cost' and also defines that as a variable in a method
[00:34:49] et09: in that same method, the local one takes precedence, right?
[00:39:07] et09: looks like that's a yes
[00:45:39] chouhoulis: has joined #ruby
[00:58:59] jaequery: has joined #ruby
[01:01:39] BloopMonster: has joined #ruby
[01:01:51] za1b1tsu: has joined #ruby
[01:02:40] graphene: has joined #ruby
[01:07:48] tdy: has joined #ruby
[01:09:16] redlegion: has joined #ruby
[01:10:32] cadillac_: has joined #ruby
[01:12:01] gizmore: has joined #ruby
[01:13:08] bjpenn: has joined #ruby
[01:16:10] mupt: has joined #ruby
[01:17:36] lxsameer: has joined #ruby
[01:26:13] Lyubo1: has joined #ruby
[01:36:24] Radar: depends on the variable
[01:46:12] nicht: has joined #ruby
[01:47:15] taylorzr: has joined #ruby
[01:52:17] Azure: has joined #ruby
[01:53:40] dreamthese: has joined #ruby
[01:54:37] roamingdog: has joined #ruby
[01:56:34] za1b1tsu: has joined #ruby
[01:57:38] lxsameer: has joined #ruby
[02:03:28] graphene: has joined #ruby
[02:06:14] roamingdog: has joined #ruby
[02:07:39] lxsameer: has joined #ruby
[02:09:18] graphene: has joined #ruby
[02:10:24] graphene: has joined #ruby
[02:11:15] meinside: has joined #ruby
[02:17:49] lxsameer: has joined #ruby
[02:17:50] jordanm: has joined #ruby
[02:27:57] lxsameer: has joined #ruby
[02:28:36] graphene: has joined #ruby
[02:33:46] wilbert: has joined #ruby
[02:38:11] lxsameer: has joined #ruby
[02:39:21] graphene: has joined #ruby
[02:48:28] lxsameer: has joined #ruby
[02:49:49] za1b1tsu: has joined #ruby
[02:55:50] kapil___: has joined #ruby
[02:58:36] lxsameer: has joined #ruby
[03:00:20] cadillac_: has joined #ruby
[03:08:50] lxsameer: has joined #ruby
[03:09:31] braincrash: has joined #ruby
[03:19:02] lxsameer: has joined #ruby
[03:19:13] RougeR: anyone fancy giving me a hand with a tech interview
[03:19:17] RougeR: im really fekin close
[03:19:25] RougeR: im just tierd and been at work all day
[03:19:25] RougeR: https://gist.github.com/CodePint/238bbc4603b15f45e78517936e44d538
[03:24:52] wontruefree: has joined #ruby
[03:27:41] nowhere_man: has joined #ruby
[03:29:23] lxsameer: has joined #ruby
[03:35:03] Nicmavr: has joined #ruby
[03:35:50] SeepingN: has joined #ruby
[03:39:24] lxsameer: has joined #ruby
[03:45:03] nowhere_man: has joined #ruby
[03:46:17] gix-: has joined #ruby
[03:49:35] lxsameer: has joined #ruby
[03:59:45] lxsameer: has joined #ruby
[04:00:35] havenwood: RougeR: Congrats on slogging through it!
[04:00:46] RougeR: havenwood: ty
[04:00:48] RougeR: ugh its 5am
[04:00:51] RougeR: getting there
[04:01:12] wizkid238: has joined #ruby
[04:02:12] havenwood: RougeR: Whenever you see an if statement with true/false, it's likely you can just use the truthiness of the statement and discard the logic: https://gist.github.com/CodePint/238bbc4603b15f45e78517936e44d538#file-poker-rb-L245-L249
[04:02:52] havenwood: RougeR: This already returns `true` or `false`: (number_only_cards & low_straight) == low_straight
[04:03:24] RougeR: yeah ytou are aright havenwood
[04:03:32] RougeR: i musta missed that one, i did it for all the others
[04:03:43] RougeR: im stuck on another bit
[04:03:44] havenwood: RougeR: nice
[04:03:45] RougeR: the kickers
[04:03:52] RougeR: given two arrays
[04:04:09] RougeR: array1 = [7, 12, 9, 6]
[04:04:22] RougeR: array2= [12, 10, 7, 6]
[04:04:30] RougeR: youll have to find which wins
[04:05:11] RougeR: single highest number = winner
[04:05:29] RougeR: ill fix it
[04:06:17] RougeR: i can find the highest then pop it out if they match
[04:10:02] lxsameer: has joined #ruby
[04:17:33] BloopMonster: has joined #ruby
[04:18:30] cschneid: has joined #ruby
[04:20:28] lxsameer: has joined #ruby
[04:30:22] lxsameer: has joined #ruby
[04:31:39] dinfuehr: has joined #ruby
[04:32:57] conta: has joined #ruby
[04:33:52] za1b1tsu: has joined #ruby
[04:39:09] dinfuehr: has joined #ruby
[04:40:34] lxsameer: has joined #ruby
[04:42:56] taylorzr: has joined #ruby
[04:43:39] orbyt_: has joined #ruby
[04:43:51] caleBOT: has joined #ruby
[04:45:25] ogres: has joined #ruby
[04:50:42] TinkerT: has joined #ruby
[04:50:44] lxsameer: has joined #ruby
[04:51:58] d^sh: has joined #ruby
[05:00:58] lxsameer: has joined #ruby
[05:01:22] __goodnight__: has joined #ruby
[05:11:08] lxsameer: has joined #ruby
[05:15:40] SeepingN: has joined #ruby
[05:21:20] lxsameer: has joined #ruby
[05:29:22] anisha: has joined #ruby
[05:29:22] RougeR: havenwood: finished it
[05:31:32] cschneid: has joined #ruby
[05:31:34] lxsameer: has joined #ruby
[05:40:09] wontruefree: has joined #ruby
[05:41:46] lxsameer: has joined #ruby
[05:43:33] cschneid: has joined #ruby
[05:50:21] roamingdog: has joined #ruby
[05:51:11] roamingdog: has joined #ruby
[05:51:54] lxsameer: has joined #ruby
[05:52:01] roamingdog: has joined #ruby
[05:52:45] roamingdog: has joined #ruby
[05:54:21] ellcs: has joined #ruby
[05:57:18] za1b1tsu: has joined #ruby
[05:59:56] aupadhye: has joined #ruby
[06:02:06] lxsameer: has joined #ruby
[06:03:25] amar: has joined #ruby
[06:09:25] amar: has joined #ruby
[06:12:19] lxsameer: has joined #ruby
[06:12:39] apeiros: has joined #ruby
[06:14:26] amar: has joined #ruby
[06:18:46] Venomen: has joined #ruby
[06:18:47] Venomen: has joined #ruby
[06:22:33] lxsameer: has joined #ruby
[06:32:46] lxsameer: has joined #ruby
[06:39:18] schleppel: has joined #ruby
[06:43:00] lxsameer: has joined #ruby
[06:48:03] andikr: has joined #ruby
[06:53:10] lxsameer: has joined #ruby
[06:56:07] yohji: has joined #ruby
[06:58:39] wilbert_: has joined #ruby
[07:01:34] aufi: has joined #ruby
[07:03:14] aufi_: has joined #ruby
[07:03:21] lxsameer: has joined #ruby
[07:09:06] tvw: has joined #ruby
[07:10:37] claudiuinberlin: has joined #ruby
[07:13:29] lxsameer: has joined #ruby
[07:14:00] BloopMonster: has joined #ruby
[07:14:52] TomyWork: has joined #ruby
[07:18:30] n13z: has joined #ruby
[07:19:31] sysvalve: has joined #ruby
[07:23:43] lxsameer: has joined #ruby
[07:25:23] amar: has joined #ruby
[07:28:44] vondruch: has joined #ruby
[07:30:09] Megamos: has joined #ruby
[07:33:40] RougeR: has joined #ruby
[07:33:40] RougeR: has joined #ruby
[07:33:51] lxsameer: has joined #ruby
[07:34:47] burgestrand: has joined #ruby
[07:37:37] graphene: has joined #ruby
[07:42:33] __nightw0lf: has joined #ruby
[07:44:11] lxsameer: has joined #ruby
[07:50:26] lxsameer: has joined #ruby
[08:02:14] Mike11: has joined #ruby
[08:03:48] bjpenn: has joined #ruby
[08:04:10] burgestrand: has joined #ruby
[08:07:32] Beams: has joined #ruby
[08:14:13] amar: has joined #ruby
[08:14:54] Megamos: has joined #ruby
[08:15:38] conta: has joined #ruby
[08:21:34] clemens3: has joined #ruby
[08:23:14] nowhere_man: has joined #ruby
[08:26:29] guille-moe: has joined #ruby
[08:29:42] konos5__: has joined #ruby
[08:36:16] CrazyEddy: has joined #ruby
[08:39:33] Crackville: has joined #ruby
[08:41:22] konos5__: Hi, everyone! Quick question: The ruby eigenclass diagram suggests that `BasicObject.singleton_class.singleton_class.superclass` is `Class` (Please see the link: https://www.dropbox.com/s/rmcdzjgb9c4ljsw/ruby-eigenclass-diagram-edit.png?dl=0) . However it using a ruby interpreter I found out that it's #Class and not Class. Which one is true?
[08:47:50] konos5__: has joined #ruby
[09:01:16] dhollin3: has joined #ruby
[09:03:59] Guest41035: has joined #ruby
[09:05:37] graphene: has joined #ruby
[09:08:15] karapetyan: has joined #ruby
[09:18:48] Es0teric: has joined #ruby
[09:29:05] reber: has joined #ruby
[09:33:02] inukshuk_: has joined #ruby
[09:43:23] quobo: has joined #ruby
[09:45:16] sonOfRa: has joined #ruby
[09:52:43] konsolebox: > BasicObject.singleton_class.singleton_class.singleton_class.class
[09:52:51] konsolebox: >> BasicObject.singleton_class.singleton_class.singleton_class.class
[09:52:52] ruby[bot]: konsolebox: # => Class (https://eval.in/1030340)
[09:54:22] konsolebox: konos5__: that "#Class" is probably just output of "inspect"
[09:55:08] naftilos76: has joined #ruby
[09:55:39] konos5__: You just run `BasicObject.singleton_class.singleton_class.singleton_class.class` instead of `BasicObject.singleton_class.singleton_class.singleton_class.superclass`
[09:56:04] konos5__: ooops my apologies.
[09:56:54] konos5__: should just be `BasicObject.singleton_class.singleton_class.superclass`
[09:56:55] konsolebox: you're it should be literally Class
[09:57:00] konsolebox: *you're saying
[09:57:08] konos5__: that should return `#<Class:Class>`
[09:57:14] karapetyan: has joined #ruby
[09:57:33] konos5__: which it does, but the diagram suggests otherwise
[09:58:35] konos5__: I'm saying that the diagram suggests that it should literally be `Class` but the interpreter says `#<Class:Class>`
[09:59:13] vondruch_: has joined #ruby
[09:59:13] konsolebox: yes i get what you mean
[09:59:22] konos5__: it can't be both true. ...and the interpreter usually doesn't make mistakes... so... why is the diagram "wrong"?
[09:59:33] konos5__: maybe it refers to a previous version of Ruby..?
[10:00:01] konsolebox: perhaps Ruby have some forms of specialization when it comes to singleton classes
[10:00:37] konos5__: ...carry on
[10:01:03] konsolebox: konos5__: i no other thoughts more than that
[10:02:44] amar: has joined #ruby
[10:03:45] konos5__: Thanks anyway, I'll try again later on today...
[10:04:24] biberu: has joined #ruby
[10:04:41] apeiros: has joined #ruby
[10:16:58] DeepIO: has joined #ruby
[10:19:26] roamingdog: has joined #ruby
[10:26:15] apeiros: has joined #ruby
[10:28:44] BloopMonster: has joined #ruby
[10:29:41] burgestrand: has joined #ruby
[10:34:45] konsolebox: konos5__: as i observed, singleton classes of normal objects inherit differently from those of classes. e.g `Object.new.singleton_class.superclass == Object`, but `Object.singleton_class.superclass == BasicObject.singleton_class`. One thing to note is that the superclass of BasicObject's singleton_class is Class, and singleton class of Class is #<Class:Class>, that is why it is what you get with BasicObject.singleton_class.singleton_class.superclass
[10:36:38] feelx-: has joined #ruby
[10:38:27] konsolebox: >> BasicObject.singleton_class.superclass == Class && BasicObject.singleton_class.singleton_class.superclass == Class.singleton_class
[10:38:28] ruby[bot]: konsolebox: # => true (https://eval.in/1030370)
[10:49:45] karapetyan: has joined #ruby
[10:51:03] konos5__: Thanks I get that and I see what's going on. However the diagram disagrees with you and has been quoted here multiple times.
[10:52:09] konos5__: I mean the output of irb makes perfect sense and is -in my eyes- totally justified. The diagram isn't
[10:54:39] graphene: has joined #ruby
[10:55:04] konsolebox: konos5__: i agree
[10:55:29] lxsameer: has joined #ruby
[10:56:08] graphene: has joined #ruby
[10:57:29] drale2k_: has joined #ruby
[11:01:06] graphene: has joined #ruby
[11:11:43] yokel: has joined #ruby
[11:13:09] konsolebox: konos5__: where did you get the diagram though?
[11:13:33] konos5__: can't really remember the user...
[11:13:40] konos5__: could be @apeiros
[11:14:08] konos5__: but can't really remember...it's been 5 to 6 months ago...
[11:16:44] KaffeeJunky123: has joined #ruby
[11:18:48] InfinityFye: has joined #ruby
[11:19:01] punnie: has joined #ruby
[11:22:05] KaffeeJunky123: has left #ruby: ()
[11:23:24] KaffeeJunky123: has joined #ruby
[11:25:25] KaffeeJunky123: I can't seem to use the ruby standard library in irb, it doesn't find any of the standard library modules when I try to either write its fullname or use include, I've ruby 2.3.3 installed here.
[11:25:39] KaffeeJunky123: Any ideas what might be wrong?
[11:25:58] tbuehlmann: KaffeeJunky123: you need to require first. did you do that?
[11:26:18] KaffeeJunky123: tbuehlmann: yes it does not find any of the standard library modules, the core ones work
[11:26:27] KaffeeJunky123: eg Math works but Matrix does not
[11:26:37] KaffeeJunky123: Which should be present in this version of ruby
[11:26:48] KaffeeJunky123: I'm on Debian and installed ruby-full, if that helps
[11:27:03] konsolebox: KaffeeJunky123: `require 'matrix'` doesn't work?
[11:28:00] KaffeeJunky123: konsolebox: Thank you so much, I made the mistake of capitalizing matrix
[11:29:07] BTRE: has joined #ruby
[11:32:34] KaffeeJunky123: but now I wonder if storing the state of a game of tic tac toe in a matrix is really a good idea
[11:35:11] mjolnird: has joined #ruby
[11:36:40] ldnunes: has joined #ruby
[11:37:57] nowhere_man: has joined #ruby
[11:40:52] gigetoo: has joined #ruby
[11:43:32] samosaphile: has joined #ruby
[11:45:40] burgestrand: has joined #ruby
[11:46:29] mjolnird: has joined #ruby
[11:47:37] kbl: has joined #ruby
[11:48:29] conta: has joined #ruby
[11:48:31] samosaphile: has left #ruby: ()
[11:56:44] burgestrand: has joined #ruby
[11:57:18] drale2k_: has joined #ruby
[11:58:01] AJA4350: has joined #ruby
[11:59:17] minimal_life: has joined #ruby
[12:02:20] konsolebox: KaffeeJunky123: i think it's a good start
[12:03:14] yokel: has joined #ruby
[12:04:59] synthroid: has joined #ruby
[12:06:28] shinnya: has joined #ruby
[12:09:18] fmcgeough: has joined #ruby
[12:11:18] mjolnird: has joined #ruby
[12:12:11] rprimus: has joined #ruby
[12:12:12] maufart__: has joined #ruby
[12:19:04] FrankyCyborg: has joined #ruby
[12:31:37] mjolnird: has joined #ruby
[12:31:48] vondruch: has joined #ruby
[12:38:18] vondruch: has joined #ruby
[12:54:24] fmcgeough: has joined #ruby
[12:55:00] reber: has joined #ruby
[13:00:21] ciscam: has joined #ruby
[13:02:43] clemens3: has joined #ruby
[13:04:19] yqt: has joined #ruby
[13:05:25] jcalla: has joined #ruby
[13:11:03] cadillac_: has joined #ruby
[13:13:42] aufi_: has joined #ruby
[13:14:01] Furai: has joined #ruby
[13:17:32] mupt: has joined #ruby
[13:18:43] maufart__: has joined #ruby
[13:21:58] reber: has joined #ruby
[13:23:12] caleBOT_: has joined #ruby
[13:24:50] Alina-malina: has joined #ruby
[13:29:46] aufi_: has joined #ruby
[13:37:14] nowhere_man: has joined #ruby
[13:45:14] rafadc: has joined #ruby
[13:46:00] bruce_lee: has joined #ruby
[13:46:01] bruce_lee: has joined #ruby
[13:52:26] guille-moe: has joined #ruby
[13:56:42] nicht: has joined #ruby
[13:56:51] synthroid: has joined #ruby
[13:57:01] kapil___: has joined #ruby
[13:58:25] ogres: has joined #ruby
[13:58:27] karapetyan: has joined #ruby
[14:00:11] dionysus69: has joined #ruby
[14:03:15] gnufied: has joined #ruby
[14:05:48] Inline: has joined #ruby
[14:14:34] synthroid: has joined #ruby
[14:14:38] vondruch: has joined #ruby
[14:14:48] Nicmavr: has joined #ruby
[14:19:20] conta1: has joined #ruby
[14:21:21] Rapture: has joined #ruby
[14:23:44] caleBOT__: has joined #ruby
[14:24:12] Sylario: has joined #ruby
[14:24:52] caleBOT_: has joined #ruby
[14:26:36] caleBOT__: has joined #ruby
[14:28:05] cantsleep: has joined #ruby
[14:28:52] caleBOT__: has joined #ruby
[14:30:44] gnufied: has joined #ruby
[14:31:43] rshetty: has joined #ruby
[14:38:06] caleBOT_: has joined #ruby
[14:39:08] alex``: has joined #ruby
[14:41:18] za1b1tsu: has joined #ruby
[14:44:51] cow[home]: has joined #ruby
[14:46:32] SeepingN: has joined #ruby
[14:49:23] cschneid: has joined #ruby
[14:51:26] za1b1tsu: has joined #ruby
[14:51:53] cschneid_: has joined #ruby
[14:52:07] pauliesaint: has joined #ruby
[14:53:24] codymj: has joined #ruby
[14:54:22] croberts: hi, im trying to figure out where to put the end in this, i have tried inside and outside the {} but rubocop is not happy eitherway https://paste.fedoraproject.org/paste/4PAfiLPGwzN~t0bxo0m4lQ
[14:55:34] agent_white: has joined #ruby
[14:55:41] agent_white: has left #ruby: ()
[14:57:01] apeiros: croberts: why do you have an "if" there in the first place? ternary doesn't use one.
[14:57:23] anisha: has joined #ruby
[15:01:00] bradleyp_: has joined #ruby
[15:01:49] croberts: apeiros: had this orginally and the person in sugggested it that way, https://paste.fedoraproject.org/paste/tvVf2~KVT2CcVkpbtA11fw
[15:01:57] croberts: in the foreman-dev group
[15:02:49] SeepingN: = needs to be ==
[15:02:54] apeiros: that makes even less sense
[15:03:11] SeepingN: but also, what in the world
[15:03:14] apeiros: what SeepingN said, and `volumes.index(volume) +=`
[15:03:22] apeiros: and the if outside the loop…
[15:04:00] croberts: yeah in vmware if index is 7 that is reserverd for a internal device id so it has to skip that one
[15:04:04] apeiros: anyway, "I had X before" is not really an explanation for why you now have a ternary + if. but from that code I'd assume you're still a rookie learning the syntax?
[15:04:05] croberts: for the disk
[15:04:13] croberts: still a noob
[15:04:17] ellcs1: has joined #ruby
[15:04:57] apeiros: well, `a = condition ? if_truthy_this : if_falsy_that` is how ternary goes. no if. e.g. `a = true ? 1 : 2` will assign 1 to a.
[15:05:09] yokel: has joined #ruby
[15:05:25] BloopMonster: has joined #ruby
[15:05:39] apeiros: and don't use map if you want the side-effect. map is if you want the return value of map.
[15:05:41] croberts: sorry for the awful code, like i said still trying to learn
[15:06:43] apeiros: e.g. `array.each do |item| puts item end` instead of `array.map do |item| puts item end`
[15:08:56] croberts: ok ty again
[15:10:22] Liothen: has joined #ruby
[15:10:23] Liothen: has joined #ruby
[15:11:42] psychicist__: has joined #ruby
[15:12:08] anisha: has joined #ruby
[15:12:48] chouhoulis: has joined #ruby
[15:14:00] gizmore: has joined #ruby
[15:15:23] guille-moe: has joined #ruby
[15:15:29] synthroid: has joined #ruby
[15:16:40] Mike11: has joined #ruby
[15:19:40] yokel: has joined #ruby
[15:21:29] AlHafoudh: has joined #ruby
[15:22:25] foxxx0: has joined #ruby
[15:22:59] gix: has joined #ruby
[15:31:12] jenrzzz: has joined #ruby
[15:31:12] jenrzzz: has joined #ruby
[15:32:49] r29v: has joined #ruby
[15:33:15] sriehl: has joined #ruby
[15:33:16] sriehl: has joined #ruby
[15:35:18] shinnya: has joined #ruby
[15:40:14] cagomez: has joined #ruby
[15:41:08] p0s1x: has joined #ruby
[15:44:33] Ropeney: has joined #ruby
[15:44:45] mmattice: has joined #ruby
[15:46:02] FernandoBasso: has joined #ruby
[15:47:10] KaffeeJunky123: convention wise, how should I name an instance method that modifies the objects state and returns a boolean? Is this even a good idea? It's a method on my tic tac toe games board class, I called it move for now, but I'm somehow unhappy with the name.
[15:47:44] gizmore: like foo.bar?
[15:47:58] gizmore: KaffeeJunky123: modifieng and returning eh?
[15:48:17] amar_: has joined #ruby
[15:49:17] gizmore: KaffeeJunky123: in my project i chose _foo for getters and foo(foo); self; for setters (chain)
[15:51:01] caleBOT: has joined #ruby
[15:52:10] KaffeeJunky123: gizmore: I don't think it makes sense to chain on this method, it takes the indice of the field as argument and marks it for the current player or returns false if it's an illegal turn
[15:52:33] gizmore: i did a major design pattern on my project
[15:52:41] gizmore: _foo (getters)
[15:52:48] gizmore: foo(foo) setters
[15:53:06] mupt: has joined #ruby
[15:53:15] gizmore: _foo (being public getters)
[15:58:12] Zarthus: why not just use attr_accessor
[15:59:56] ciscam: has joined #ruby
[16:00:29] Mrgoose2: has joined #ruby
[16:01:16] karapetyan: has joined #ruby
[16:03:36] gizmore: Zarthus: good question
[16:03:48] gizmore: i dont like this decorator
[16:04:07] Zarthus: i'd imagine ruby allows you to override the decorator (or at least include your own)
[16:04:24] mroutis: has joined #ruby
[16:04:33] gizmore: why deal with those internals of attr_* when you can just define your own to be sure
[16:05:31] sina: has joined #ruby
[16:06:26] Zarthus: because they're convienient
[16:06:45] Zarthus: and t's waht everyone expects you'll be using
[16:06:54] Zarthus: why write in ruby when you could be writing in c
[16:07:47] Puffball: has joined #ruby
[16:08:21] herbmillerjr: has joined #ruby
[16:08:35] konsolebox: KaffeeJunky123: an action method returning boolean is pretty ok to me
[16:09:42] loincloth: has joined #ruby
[16:11:29] [Butch]: has joined #ruby
[16:14:17] karapetyan: has joined #ruby
[16:15:53] contradictioned: has joined #ruby
[16:16:24] KaffeeJunky123: now I'm trying to think of a fancy way to create this array [[0,0,1], [0,1,0], [1,0,0]]
[16:17:26] Zarthus: KaffeeJunky123: keep cloning [0,0,1] and shuffle until desired result 😁
[16:19:14] bradleyprice: has joined #ruby
[16:20:11] mupt: has joined #ruby
[16:20:29] amar_: has joined #ruby
[16:20:37] llua: has joined #ruby
[16:23:02] amar_: has joined #ruby
[16:23:14] synthroid: has joined #ruby
[16:26:33] wontruefree: has joined #ruby
[16:26:43] synthroid: has joined #ruby
[16:28:29] konsolebox: >> require 'matrix'; Matrix.diagonal(1, 1, 1).to_a.reverse # KaffeeJunky123
[16:28:30] ruby[bot]: konsolebox: # => [[0, 0, 1], [0, 1, 0], [1, 0, 0]] (https://eval.in/1030530)
[16:29:01] KaffeeJunky123: konsolebox: and back to matrix
[16:29:20] KaffeeJunky123: konsolebox: This is a permutation matrix i need
[16:30:17] synthroid: has joined #ruby
[16:30:39] KaffeeJunky123: in theory this matrix should swap row 1 and 3 of 3x3 matrix, unless my math is wrong
[16:30:45] foxxx0: has joined #ruby
[16:30:49] darkhanb: has joined #ruby
[16:31:27] KaffeeJunky123: konsolebox: at that point it's shorter to just spell it out completely
[16:32:31] chmurifree: has joined #ruby
[16:32:44] KaffeeJunky123: Matrix[Matrix.diagonal(1,1,1).to_a.reverse] vs Matrix[ [0, 0, 1], [0, 1, 0] [1, 0, 0] ]
[16:32:56] wontruefree: has left #ruby: ("this is not the client you are looking for")
[16:33:08] rshetty: has joined #ruby
[16:33:56] KaffeeJunky123: konsolebox: actually I can just write identity(3) instead of diagonal(1,1,1) to shorten it down
[16:37:29] synthroid: has joined #ruby
[16:37:41] roamingdog: has joined #ruby
[16:39:12] synthroid: has joined #ruby
[16:41:52] caleBOT: has joined #ruby
[16:42:37] rafadc: has joined #ruby
[16:43:53] jrich523: has joined #ruby
[16:44:11] catbusters: has joined #ruby
[16:45:07] bradleyprice: has joined #ruby
[16:45:55] jrich523: hey guys, any suggestions on how to expose rules to a user via a file config? that would allow basic logic
[16:46:01] jrich523: its for resource rules
[16:47:05] jrich523: host.totalcpu > host.usedcpu - 2 or something simple like that
[16:47:11] eckhardt_: has joined #ruby
[16:48:46] akaiiro: has joined #ruby
[16:56:31] nowhere_man: has joined #ruby
[17:02:14] dbugger_: has joined #ruby
[17:05:19] claudiuinberlin: has joined #ruby
[17:07:50] dviola: has joined #ruby
[17:16:08] mupt: has joined #ruby
[17:19:12] bjpenn: has joined #ruby
[17:20:58] fluxAeon_: has joined #ruby
[17:21:20] ohcibi: has joined #ruby
[17:21:40] karapetyan: has joined #ruby
[17:22:47] foxxx0: has joined #ruby
[17:23:12] alex``: has joined #ruby
[17:23:55] AlHafoudh: has joined #ruby
[17:27:21] qwebirc70579: has joined #ruby
[17:30:23] sameerynho: has joined #ruby
[17:32:36] deadnull: has joined #ruby
[17:33:32] mupt: has joined #ruby
[17:35:28] RougeR: has joined #ruby
[17:35:29] RougeR: has joined #ruby
[17:40:06] claudiuinberlin: has joined #ruby
[17:43:08] nima_m: has joined #ruby
[17:49:56] Megamos: has joined #ruby
[17:53:24] jenrzzz: has joined #ruby
[17:53:25] jenrzzz: has joined #ruby
[17:53:39] caleBOT_: has joined #ruby
[17:55:20] pauliesaint_: has joined #ruby
[17:55:54] ramfjord: has joined #ruby
[17:56:12] KaffeeJunky123: wow, I spent hours on this silly matrix stuff and yet my code looks like this https://ideone.com/iZW8C1
[17:56:26] NeedHelp: has joined #ruby
[17:57:30] \void: has joined #ruby
[17:57:36] NeedHelp: Hi channel. I need to do a join (many-to-many relationship) togheter with or where. What is the best way to do it? Raw sql or ActiveRecords built in functions?
[17:58:08] KaffeeJunky123: this acutally means I want people to look at my code and state their opinion
[17:59:33] NeedHelp: Ok here is a gist: https://gist.github.com/warna720/5f302c1921c9e503bce2622e0f9174e3
[17:59:47] KaffeeJunky123: needhelp: try the built in function and look at the SQL it produces
[18:00:13] kapil___: has joined #ruby
[18:00:16] NeedHelp: well ofc i can write my own raw sql. I was wondering, is there any built in?
[18:00:40] havenwood: KaffeeJunky123: This line doesn't do anything (it just returns `#=> false`): @pc_turn != @pc_turn
[18:00:50] KaffeeJunky123: needhelp: Oh sorry, I missunderstood your question then, I thought you already had an ORM
[18:00:51] depesz: has joined #ruby
[18:01:14] depesz: how can I quickly/sensibly get owner of current stdin? basically what "who -m" does to show user logged on terminal.
[18:01:16] KaffeeJunky123: havenwood: tyvm
[18:01:25] graphene: has joined #ruby
[18:01:32] NeedHelp: well I am using built in functions but it will be bugs when using pagination
[18:01:33] depesz: I'm doing now File.stat('/proc/self/fd/0').uid, but it doesn't look nice.
[18:05:15] roamingdog: has joined #ruby
[18:05:41] KaffeeJunky123: needhelp: your github link is a 404 by the way
[18:12:55] conta1: has joined #ruby
[18:23:14] agent_white: has joined #ruby
[18:23:47] bradleyprice: has joined #ruby
[18:25:29] StarSeed0000: has joined #ruby
[18:25:35] agent_white: has joined #ruby
[18:26:16] caleBOT_: has joined #ruby
[18:29:21] crankharder: has joined #ruby
[18:32:29] TinkerT: has joined #ruby
[18:33:03] jenrzzz: has joined #ruby
[18:33:03] jenrzzz: has joined #ruby
[18:33:15] cschneid_: has joined #ruby
[18:35:57] graphene: has joined #ruby
[18:36:15] quobo: has joined #ruby
[18:40:28] zachk: has joined #ruby
[18:40:29] zachk: has joined #ruby
[18:41:06] jamesaxl: has joined #ruby
[18:41:46] karapetyan: has joined #ruby
[18:43:24] wilbert_: has joined #ruby
[18:44:22] cagomez: has joined #ruby
[18:45:01] mupt: has joined #ruby
[18:45:25] KaffeeJunky123: has left #ruby: ()
[18:45:55] konsolebox: has joined #ruby
[18:49:28] ramfjord_: has joined #ruby
[18:56:40] apeiros: has joined #ruby
[19:05:55] roamingdog: has joined #ruby
[19:10:32] dionysus69: has joined #ruby
[19:12:16] ramfjord: has joined #ruby
[19:17:38] Hanmac: has left #ruby: ()
[19:18:07] ramfjord: has joined #ruby
[19:18:44] amar: has joined #ruby
[19:19:37] codymj: has joined #ruby
[19:23:04] amar_: has joined #ruby
[19:23:57] ramfjord: has joined #ruby
[19:35:42] baweaver: ooo, matrix, that'd be a lot of fun.
[19:35:53] baweaver: I should do a writeup on that later.
[19:36:19] mcritchlow: has joined #ruby
[19:36:19] amar: has joined #ruby
[19:37:32] jenrzzz: has joined #ruby
[19:37:32] jenrzzz: has joined #ruby
[19:40:23] pnkl: has joined #ruby
[19:40:42] ramfjord: has joined #ruby
[19:40:44] dtzuzu: has joined #ruby
[19:47:54] jenrzzz: has joined #ruby
[19:47:55] jenrzzz: has joined #ruby
[19:50:07] ciscam: has joined #ruby
[20:00:58] roamingdog: has joined #ruby
[20:01:05] mupt: has joined #ruby
[20:03:03] claudiuinberlin: has joined #ruby
[20:04:24] amar_: has joined #ruby
[20:05:31] Mike11: has joined #ruby
[20:14:40] SeepingN: has joined #ruby
[20:15:23] rshetty: has joined #ruby
[20:16:04] havenwood: baweaver: i love that the matrix fibonacci one-liners even works properly for negatives: https://gist.github.com/havenwood/02cf291b809327d96a3f
[20:16:11] graphene: has joined #ruby
[20:16:28] havenwood: (Matrix[[0, 1], [1, 1]] ** n.pred)[1, 1].to_i
[20:19:19] mattp__: has joined #ruby
[20:19:23] fluxAeon_: has joined #ruby
[20:20:45] havenwood: baweaver: or a stochastic matrix opens the door to markov puns
[20:23:58] havenwood: #ruby channel logs for "markov" show: "markov my words" "markov twain" "markoved for death" "markey markov" "markov the beast" "markov zuckerberg" "markov polo" "markov get set go"
[20:25:46] graphene: has joined #ruby
[20:29:34] MagePsycho: has joined #ruby
[20:33:47] harmaahylje: has joined #ruby
[20:34:14] MagePsycho: run "find #{release_path}/var #{release_path}/vendor #{release_path}/pub/static #{shared_path}/pub/media #{release_path}/app/etc -type f -exec chmod g+w {} \;"
[20:34:16] Matthew1: has joined #ruby
[20:34:21] MagePsycho: is valid in ruby?
[20:35:20] cmhobbs: has joined #ruby
[20:35:51] cmhobbs: is there a less gross way to define one line predicate methods than this? def foo?; !!@foo end
[20:36:07] havenwood: MagePsycho: The `run "..."` part is valid Ruby. The shell script you're running isn't Ruby at all.
[20:36:25] havenwood: cmhobbs: That doesn't seem gross to me. Seems fine.
[20:36:46] cmhobbs: just doesn't really flow
[20:36:47] havenwood: cmhobbs: Alternatively: def foo?; @foo end
[20:36:48] MagePsycho: inside run “” we can run shell commands right
[20:36:53] cmhobbs: s'ok, it's functional
[20:37:07] cmhobbs: havenwood: that won't force true or false, though. what if foo is nil or "bar"
[20:37:26] havenwood: cmhobbs: Not all predicate methods return `true` or `false`, just something truthy and `nil` or `false`.
[20:37:28] havenwood: >> 42.nonzero?
[20:37:29] ruby[bot]: havenwood: # => 42 (https://eval.in/1030603)
[20:37:35] havenwood: >> 0.nonzero?
[20:37:36] ruby[bot]: havenwood: # => nil (https://eval.in/1030604)
[20:37:39] havenwood: cmhobbs: has ^
[20:37:56] cmhobbs: interesting. i just assumed it was the expected behaviour of a predicate method
[20:38:28] MagePsycho: execute :chmod, "+x #{release_path}/bin/magento" -> what about this?
[20:38:55] Zarthus: MagePsycho: Why can't you try it and see?
[20:39:26] havenwood: MagePsycho: The Ruby parts aren't the interesting parts of these. You could always turn your shell scripts into pure Ruby.
[20:39:29] MagePsycho: just wanted to check the best practices
[20:39:42] MagePsycho: run vs execute
[20:39:54] Zarthus: the best practice would probably be to just use bash, there's nothing in here that requires ruby ;P
[20:40:07] MagePsycho: I am using capistrano which is ruby based
[20:40:37] Zarthus: fair enough
[20:40:56] havenwood: MagePsycho: So you want to know whether to use Cap's #execute or Rake's #run? That's what you're asking?
[20:41:17] David_H_Smith: has joined #ruby
[20:41:58] fmcgeough: has joined #ruby
[20:42:05] havenwood: MagePsycho: https://github.com/capistrano/sshkit#the-command-map
[20:43:32] karapetyan: has joined #ruby
[20:43:45] cmhobbs: has left #ruby: ("WeeChat 1.6")
[20:44:45] havenwood: MagePsycho: I'd vote: execute :chmod, '+x', File.join(release_path, 'bin', 'magento')
[20:45:37] MagePsycho: File.join(#{release_path}, 'bin', 'magento')
[20:45:47] MagePsycho: release_path is a variable
[20:45:59] havenwood: MagePsycho: Yes: File.join(release_path, 'bin', 'magento')
[20:46:25] MagePsycho: whats the , in ruby? concatenation?
[20:46:33] MagePsycho: sorry I am new to ruby so
[20:46:51] havenwood: >> release_path = "/x/y/z"; File.join(release_path, 'MagePSycho')
[20:46:51] ruby[bot]: havenwood: # => "/x/y/z/MagePSycho" (https://eval.in/1030609)
[20:47:50] havenwood: MagePsycho: In shelling out, it's often better to provide the individual arguments. That way your programming language can run the command directly, without shelling out to get shellword splitting.
[20:48:08] havenwood: MagePsycho: So: system 'ls', '-la'
[20:48:14] havenwood: MagePsycho: Instead of: systme 'ls -la'
[20:48:51] MagePsycho: @havenwood Thanks
[20:49:39] havenwood: MagePsycho: Compare `system 'echo *'` and `system 'echo', '*'`.
[20:49:54] havenwood: https://ruby-doc.org/core/Kernel.html#method-i-system
[20:53:46] cschneid: has joined #ruby
[20:54:50] duderonomy: has joined #ruby
[20:56:00] jenrzzz: has joined #ruby
[20:56:01] jenrzzz: has joined #ruby
[20:56:53] MagePsycho: has joined #ruby
[20:57:16] MagePsycho: has joined #ruby
[20:58:44] StarSeed0000: If I have a user model with a profile, and that profile belongs to a color - if I were writing an api would it make any sense to put an update to /profile/color or would it just be an update to /profile?
[20:59:24] StarSeed0000: I feel like updating to color implies I am updating the color itself, not the relationship.
[20:59:51] AKPWD: has joined #ruby
[20:59:58] StarSeed0000: But from an api standpoint it isn't clear to update color you would request /profile
[21:00:31] StarSeed0000: Would it make more sense to PUT to a color_relationship path or something?
[21:00:50] StarSeed0000: What is best practice there?
[21:06:36] shinnya: has joined #ruby
[21:07:12] vindvaki: has joined #ruby
[21:07:41] dkmueller: has joined #ruby
[21:10:29] GodFather: has joined #ruby
[21:12:08] caleBOT: has joined #ruby
[21:13:36] havenwood: ?rails starseed0000
[21:13:36] ruby[bot]: starseed0000: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[21:14:58] havenwood: starseed0000: I'd assume a PATCH to /profile
[21:16:50] sauvin: has joined #ruby
[21:26:33] fmcgeough: has joined #ruby
[21:29:23] karapetyan: has joined #ruby
[21:30:05] jenrzzz: has joined #ruby
[21:30:06] jenrzzz: has joined #ruby
[21:35:17] sameerynho: has joined #ruby
[21:35:51] eckhardt_: has joined #ruby
[21:36:04] nowhere_man: has joined #ruby
[21:45:25] FernandoBasso: has joined #ruby
[21:47:44] tty: has joined #ruby
[21:52:10] drale2k_: has joined #ruby
[22:03:12] eckhardt_: has joined #ruby
[22:05:10] bradleyprice: has joined #ruby
[22:07:23] baweaver: Hrm, matrixes are immutable it seems. Interesting.
[22:07:45] baweaver: I will say the varying ways of iteration are nice though
[22:08:03] rafadc: has joined #ruby
[22:08:57] jenrzzz: has joined #ruby
[22:08:57] jenrzzz: has joined #ruby
[22:09:19] baweaver: >> require 'matrix'; Matrix[%w(x o x), %w(x o -), %(x - o)].each(:upper).to_a
[22:09:21] ruby[bot]: baweaver: # => can't convert String into an Array (undefined method `to_ary' for "x - o":String ...check link for more (https://eval.in/1030630)
[22:09:22] jrich523: hey guys, need to store 'rules' for VM provisioning, and was wondering what the best way would be to save those as a configuration
[22:09:46] baweaver: Heh, whoops.
[22:09:47] baweaver: >> require 'matrix'; Matrix[%w(x o x), %w(x o -), %w(x - o)].each(:upper).to_a
[22:09:48] ruby[bot]: baweaver: # => ["x", "o", "x", "o", "-", "o"] (https://eval.in/1030631)
[22:09:59] baweaver: Likely YAML or JSON.
[22:11:26] jrich523: the most complex rule that comes to mind is Host.usedCPU < Host.TotalCPU - 2
[22:11:53] jrich523: i considered yaml, since there are 3 areas for rules (objects) KVM (host), Cabinet, Pod
[22:12:39] jrich523: but its more so the rule processinging, and not the storage
[22:14:09] jrich523: cuz if i did yaml, i could make it look something like kvm: \n - usedcpu < total - 2
[22:14:19] Zarthus: would it? that sounds illogical.
[22:14:34] jrich523: yeah i dont like it, thats why im here :)
[22:15:07] jrich523: i looked for some rule type gems, saw a couple, mostly really old, and many of which are specific to rails (ActiveRecords)
[22:15:43] Zarthus: it sounds like you're just writing literal strings as a rule rather than applying some sort of scheme to it
[22:16:32] jrich523: im not sure i follow, i want them in a config file so that some ops guy could change it if he had to
[22:16:44] jrich523: so yeah, strings
[22:16:59] bradleyprice: has joined #ruby
[22:17:25] Zarthus: I mean something like https://gist.github.com/Zarthus/8abf3d957a16a5382106dd35eccb23fd
[22:17:37] jhack: has joined #ruby
[22:17:42] jrich523: well thats too simple
[22:17:51] jrich523: my "simple" rule was actually a complex one :)
[22:18:01] Zarthus: ¯\_(ツ)_/¯ you can define multiple restrictions
[22:18:02] jrich523: they want to make sure that the number of vcpu is 2 less than total
[22:18:20] jrich523: systems vary so i cant use a simple 98 of 100, since some are 100 some are 240
[22:18:35] jrich523: so the rub here is that it needs to support math
[22:18:41] Zarthus: it doesn't sound like you're using yaml if you're really just putting a bunch of strings in it
[22:18:49] jrich523: im not using anything yet :)
[22:18:53] jrich523: was trying to work backwards
[22:18:56] jrich523: figure out how i'd process it first
[22:18:59] jrich523: and then deal with storage
[22:19:21] Zarthus: how about letting them write ruby instead?
[22:19:44] Zarthus: a programming language already supports maths by default.
[22:20:08] jrich523: well, i guess how do i do that?
[22:20:22] jrich523: so if lets say, i want to have it as its own file rules.rb
[22:20:38] Zarthus: not much different from a yaml file, instead of YAML.loads you just call require
[22:21:06] jrich523: let me think on that a moment before i ask stupid follow up questions :)
[22:21:06] Zarthus: you can define a common interface for a class and let them have at it.
[22:21:25] Zarthus: (it's just a suggestion, there's drawbacks to the ruby solution, most notably that they need to have ruby installed.)
[22:21:37] jrich523: oh well this is just a deployment script
[22:21:46] jrich523: its big and stupid, and im charged with making it worse :)
[22:21:56] Zarthus: ruby expertise, in a well defined environment, isn't really necessary (i.e. Vagrant does fine)
[22:21:57] jrich523: so its ruby all around
[22:22:26] jrich523: and as it stands today, they run the script via bundler
[22:22:32] jrich523: but to the guys using it, its just a cli
[22:22:42] jrich523: they could probably figure out VERY basic ruby
[22:22:44] Zarthus: just for reference, a random vagrant file: https://github.com/adlawson/vagrantfiles/blob/master/ruby/Vagrantfile
[22:22:49] jrich523: but these are ops/support guys
[22:22:59] Zarthus: it doesn't really require knowledge of ruby, just decent documentation
[22:23:04] jrich523: i guess i should add that they run it from a server
[22:23:17] jrich523: so setup etc isnt too big of a deal
[22:23:41] jrich523: right now the process is they ssh to a box, run a script provision -application jrich -env dev -guestcount 5
[22:24:00] Zarthus: anyway, this is all just a suggestion, but rather than implementing a whole system to handle parsing of rules, you might as well rely on ruby *shrug*
[22:24:21] jrich523: well the reason im looking at this is the rules the company wants changes often
[22:24:32] jrich523: right now that means telling me, i do an update/PR and push a deployment
[22:24:35] jrich523: sorta horrible to change rules
[22:24:43] jrich523: so i wanted to expose that so they can do it as they need it
[22:25:03] Zarthus: are you writing something like saltstack?
[22:25:19] jrich523: this actually directly talks to Foreman
[22:25:29] jrich523: foreman/puppet handle all the config etc
[22:25:40] jrich523: they dont like the foreman gui (it doesnt have all they need)
[22:25:45] Zarthus: fair enough
[22:25:59] jrich523: thats my next task actually, to decomission this script in favor of a gui plugin (lets see how many ages that takes)
[22:26:30] jrich523: so, on the foreman side, its react, i can create a rule page and process it howeveer i want
[22:27:05] jrich523: or rather, i can easier control the input with a react page, where as with this, its harder to control
[22:27:26] jrich523: and i've been trying to nicely say, the idiots run this
[22:27:29] jrich523: so it has to be super simple
[22:27:43] jrich523: so having them edit a class of ruby, probably not a good idea :)
[22:28:08] Zarthus: i would expect even a junior sysadmin to manage a small ruby config :)
[22:28:16] jrich523: i would too :-/
[22:28:30] jrich523: my expectations, and reality have clashed
[22:28:40] ohcibi: has joined #ruby
[22:29:08] Zarthus: i guess that's why they hired you to do it rather than let them do it themselves huh
[22:29:27] Zarthus: Smells like job security.
[22:29:42] jrich523: this place is so banged up its the opposite
[22:29:48] jrich523: people leaving left and right cuz they are fed up
[22:30:00] Zarthus: smells like even more job security.
[22:30:12] jrich523: lol sorta i guess
[22:30:19] jrich523: i typically do like 1-2 month contracts
[22:30:24] jrich523: i think im up to 14 months now
[22:30:35] zenspider: "needs to support maths" => write an interpreter
[22:30:49] zenspider: or yeah, give them full access to ruby or whatever.
[22:30:55] jrich523: well, thats the thing, i was hoping there was something sort of ready to go :)
[22:31:11] Zarthus: I couldn't think of anything simpler than ruby for this, tbh
[22:31:31] zenspider: jrich523: something ready to go, for your particular and peculiar needs?
[22:31:52] jrich523: well can i do a rule.rb thats like one function def rules(kvm,cabinet,pod)
[22:32:06] jrich523: no, a general parser that i could feed stuff to
[22:32:38] Zarthus: ACTION shrugs, and would recommend the Vagrantfile config style over a dedicated function
[22:32:53] zenspider: there's always eval. and now you have 2 problems and a disfunctional server
[22:33:08] jrich523: yeah i think im leaning towards that method too
[22:33:19] zenspider: that's really dumb... you've been warned.
[22:33:21] jrich523: wait, isnt for regex? :)
[22:34:13] Zarthus: if you have enough disfunctional servers the number of problems start to reduce
[22:34:19] Zarthus: they grow in size but not in quantity
[22:34:24] foxxx0: has joined #ruby
[22:34:28] zenspider: if you want something slighly more secure, you could use ruby_parser + sexp_processor to write a simple interpreter for a subset of ruby and limit the expressions you allow
[22:34:53] jrich523: right now im thinking more like the vagrant config
[22:36:03] jrich523: the rules i'll have to put in there should make it easy for anyone to tweak later on
[22:36:54] Zarthus: whatever you end up going with, good luck
[22:37:03] Zarthus: i'm off to bed.
[22:37:08] jrich523: have a good one!
[22:39:27] AlHafoudh: has joined #ruby
[22:42:17] jhack: has joined #ruby
[22:44:31] jenrzzz: has joined #ruby
[22:44:31] jenrzzz: has joined #ruby
[22:47:12] AJA4350: has joined #ruby
[22:49:24] pauliesaint: has joined #ruby
[22:51:58] mmattice: has joined #ruby
[22:54:00] pauliesaint: has joined #ruby
[22:56:18] jhack: has joined #ruby
[22:56:47] ellcs: has joined #ruby
[22:57:14] caleBOT: has joined #ruby
[23:02:42] feelx: has joined #ruby
[23:05:19] cseder: has joined #ruby
[23:06:53] cseder: has left #ruby: ()
[23:11:14] AlHafoudh: has joined #ruby
[23:11:40] foxxx0: has joined #ruby
[23:13:02] ruby[bot]: -b *!*@189.173.125.146$#ruby-banned
[23:14:01] graphene: has joined #ruby
[23:15:09] jenrzzz: has joined #ruby
[23:15:10] jenrzzz: has joined #ruby
[23:25:39] karapetyan: has joined #ruby
[23:28:43] lavamind: has joined #ruby
[23:29:18] mmattice: has joined #ruby
[23:29:59] lavamind: hello, ruby newbie here, I'm trying my hand at beaker-rspec but am having trouble with it running vagrant. it's installed on my Debian 9 system through the package manager but it says "can't find executable" when doing "bundle exec vagrant"
[23:30:31] lavamind: however when I do "bundle exec which vagrant" it says "/usr/bin/vagrant" which is correct
[23:31:07] lavamind: really don't know what's going on here, see full error message http://paste.debian.net/1031778/
[23:31:44] taylorzr: has joined #ruby
[23:36:47] drale2k_: has joined #ruby
[23:38:24] mynameisdebian: has joined #ruby
[23:40:43] havenwood: lavamind: Does it still happen with the latest RubyGems and Bundler versions?
[23:41:20] havenwood: lavamind: gem update --system && gem update bundler && bundle exec vagrant
[23:41:37] lavamind: havenwood: I'm under ruby-bundler 1.16 from my package manager
[23:41:54] lavamind: and rubygems-intergrations, also from the package manager, v 1.11
[23:42:47] havenwood: lavamind: Latest versions are RubyGems 2.7.7 and Bundler 1.16.1.
[23:43:15] havenwood: lavamind: So it seems like your Bundler is near the most recent version.
[23:43:24] taylorzr: has joined #ruby
[23:43:54] apparition47: has joined #ruby
[23:44:21] havenwood: lavamind: maybe related to?: https://github.com/bundler/bundler/issues/4602
[23:45:17] eckhardt_: has joined #ruby
[23:45:44] ElFerna: has joined #ruby
[23:46:02] lavamind: havenwood: that bug report seems quite complex, and afaict I'm not running in any nested fashion
[23:47:16] havenwood: lavamind: Just curious, but what's the result if you: RUBYGEMS_GEMDEPS=- vagrant
[23:47:37] lavamind: havenwood: I ran sudo gem update --system, which install RubyGems 2.7.7, and that didn't change anything
[23:48:05] havenwood: lavamind: Does running `vagrant` by itself work?
[23:48:20] havenwood: lavamind: Does running `RUBYGEMS_GEMDEPS=- vagrant` work?
[23:48:34] lavamind: (as an aside, after doing sudo gem uninstall rubygems-update, it leaves the executable /usr/bin/bundle2.3 around)
[23:48:51] lavamind: havenwood: yes vagrant is working, I use it in other non-ruby projects
[23:49:23] havenwood: lavamind: So you mean the command only fails with `bundle exec` prefixed on this project? Does it work with RUBYGEMS_EXEC instead?
[23:49:24] lavamind: RUBYGEMS_GEMDEPS=- vagrant output the same error message
[23:49:34] lavamind: but just "vagrant" works...
[23:50:13] havenwood: lavamind: I'm curious, what's: head -n1 "$(command -v vagrant)"
[23:50:26] mynameisdebian: I have this code: https://gist.github.com/rrdein/e680003c7938836fd0e3495ba8ecde45 . On line 37 it prints some variables. A section of the output looks like this: https://gist.github.com/rrdein/a0b67129fae044c6d7ab52b81a986142 . You can see that when i goes from 0 to 1 that cidrs[0][1] (the fourth column) continues to change in the output, even though the value of i should never again be 0 to change
[23:50:26] mynameisdebian: cidrs[0][1] on line 34. I have commented line 34 and confirmed that it is the only line accessing cidrs[0][1]. Can anyone see how “cidrs[0][1]” can keep changing from the line “cidrs[i][1] += 1” when I no longer equals 1?
[23:50:32] coderphive: has joined #ruby
[23:50:38] havenwood: lavamind: head -n1 /usr/bin/vagrant
[23:50:39] lavamind: havenwood: #!/usr/bin/ruby
[23:50:43] havenwood: lavamind: mm
[23:51:08] havenwood: lavamind: Is that as expected? Matches?: command -v ruby
[23:51:18] lavamind: dpkg -S /usr/bin/ruby -> ruby: /usr/bin/ruby
[23:51:42] lavamind: ruby package version 1:2.3.3
[23:51:42] havenwood: lavamind: hrmmm
[23:51:58] havenwood: lavamind: I've not seen this one before.
[23:52:35] havenwood: mynameisdebian: You don't need to `require 'rubygems'` these days.
[23:52:44] lavamind: havenwood: just to make sure, I shouldnt need to have "vagrant" in my Gemfile correct?
[23:52:55] r29v: has joined #ruby
[23:53:38] havenwood: lavamind: Yes, you should have it in your gemfile if you want to prefix `bundle exec` or `RUBYGEMS_GEMDEPS=-`.
[23:53:41] havenwood: lavamind: Both of those limit gem choices to those found in the Gemfile.lock
[23:54:27] havenwood: mynameisdebian: Seems like no reason to set ARGV.first to a thing - just directly: File.open('test.plist')
[23:54:45] mynameisdebian: havenwood: it's for testing
[23:55:01] havenwood: mynameisdebian: We really don't use `for` in Ruby.
[23:55:11] darix: JFYI: we already have an opensuse package for 2.6 testing
[23:55:39] havenwood: mynameisdebian: Forever. Are you familiar with #each?
[23:55:51] havenwood: darix: nice
[23:55:59] darix: mynameisdebian: most people will probably use yourenumrable.each {|e| ... }
[23:56:02] lavamind: havenwood: I see no sign of this in the beaker-rspec documentation tough, and I noticed it pulls in beaker-vagrant which is supposed to handle interfacing with vagrant
[23:56:26] mynameisdebian: yes but i need an iterating variable as well so I use the built-in for command designed for that purpose
[23:56:37] mozzarella: has joined #ruby
[23:56:47] lavamind: maybe it's just a coincidence that running the beaker testsuite outputs the same error as "bundle exec vagrant" ?
[23:56:47] havenwood: mynameisdebian: There is *always* a better way.
[23:57:10] mynameisdebian: havenwood: do you have any comment on my original question?
[23:57:15] havenwood: mynameisdebian: I've never seen `for` legitimately used in Ruby.
[23:57:15] darix: mynameisdebian: #each is also builtin :P
[23:57:57] havenwood: mynameisdebian: cidr_list_length.times do |i|
[23:58:05] mmattice: has joined #ruby