« Back to channel list

#ruby - 08 June 2016

« Back 1 day Forward 1 day »
[00:00:01] jhack: has joined #ruby
[00:01:27] GinoMan2440: has joined #ruby
[00:06:26] RushPL: has joined #ruby
[00:10:47] zeroDi: has joined #ruby
[00:12:15] t1mxg0d: has joined #ruby
[00:12:35] millerti: has joined #ruby
[00:13:32] millerti: In C, I could do something like int myarr[] = { \n #include "somefile.c" \n }; Is something equivalent in Ruby that would let me drop a file's contents into the middle of arbitrary code?
[00:14:39] certainty: has joined #ruby
[00:14:42] tax: has joined #ruby
[00:15:13] smathy: millerti, load
[00:15:42] millerti: smathy: I just got a syntax error when I tried that.
[00:15:55] millerti: smathy: Because it was between brackets.
[00:16:43] triangles: has joined #ruby
[00:17:48] millerti: This did it: eval "$xa=[#{File.read("arr.rb")}]"
[00:18:52] nankyokusei: has joined #ruby
[00:18:55] benlieb: has joined #ruby
[00:19:40] nisstyre: has joined #ruby
[00:19:49] nadir: has joined #ruby
[00:22:44] Vingador: has joined #ruby
[00:26:01] rkazak: has joined #ruby
[00:26:59] karmatr0n: has joined #ruby
[00:29:01] MrBusiness3: has joined #ruby
[00:30:54] mistermocha: has joined #ruby
[00:33:00] amincd: has joined #ruby
[00:33:39] cdg: has joined #ruby
[00:33:48] mistermocha: has joined #ruby
[00:33:55] amincd: hi, if I do a: hash.each do |var| .... end; is var an array?
[00:34:43] mistermocha: has joined #ruby
[00:35:52] al2o3-cr: amincd: yes
[00:36:23] harfangk: has joined #ruby
[00:36:32] amincd: al2o3-cr: thanks
[00:36:45] zeroDi: has joined #ruby
[00:37:10] amincd: because the reference only gives examples of a key, value pair cited as variables: http://ruby-doc.org/core-1.8.7/Hash.html#method-i-each
[00:38:07] lightt: has joined #ruby
[00:38:34] skweek: has joined #ruby
[00:40:51] tjohnson: has joined #ruby
[00:41:41] mistermo_: has joined #ruby
[00:41:49] allcentu1: has joined #ruby
[00:43:28] al2o3-cr: amincd: btw, the documentation is prehistoric (nearly) :p
[00:43:37] mistermocha: has joined #ruby
[00:43:54] amincd: al2o3-cr: ah right.. I just noticed
[00:44:35] mistermocha: has joined #ruby
[00:46:31] Elvin: has joined #ruby
[00:46:42] David_H_Smith: has joined #ruby
[00:47:27] ekinmur: has joined #ruby
[00:47:56] shevy: amincd if it helps you and you already have a hash in the first place, perhaps consider using .each_pair {|key, value| I found that the latter often helps me simply from the name of the method alone ("each_pair")
[00:48:17] amincd: shevy: noted
[00:48:27] amincd: shevy: noted
[00:48:29] mistermo_: has joined #ruby
[00:48:52] CloCkWeRX: has joined #ruby
[00:49:03] David_H_Smith: has joined #ruby
[00:49:11] baweaver: Fun thing I've remembered of the day, each case when branch supports multiple conditions
[00:49:40] baweaver: >> case 1; when Float,Integer then 1 else 0 end
[00:49:41] ruby[bot]: baweaver: # => 1 (https://eval.in/584846)
[00:49:57] baweaver: >> case 1.0; when Float,Integer then 1 else 0 end
[00:49:58] ruby[bot]: baweaver: # => 1 (https://eval.in/584847)
[00:50:28] mistermocha: has joined #ruby
[00:52:32] benlieb: has joined #ruby
[00:54:58] sumobob: has joined #ruby
[00:55:54] jaguarmagenta: has joined #ruby
[00:57:13] MrBusiness3: has joined #ruby
[00:58:14] aberen: has joined #ruby
[00:58:38] kgrz: has joined #ruby
[01:01:55] MrBusiness2: has joined #ruby
[01:02:33] andrew9183: has joined #ruby
[01:02:47] andrew9183: stupid question, can you truncate a hash like you slice an array ?
[01:03:34] banister: has joined #ruby
[01:03:59] eljimbo: has joined #ruby
[01:04:10] mistermocha: has joined #ruby
[01:08:12] mistermo_: has joined #ruby
[01:09:03] moei: has joined #ruby
[01:09:12] mistermocha: has joined #ruby
[01:12:53] SilverKey: has joined #ruby
[01:13:07] mistermocha: has joined #ruby
[01:15:06] mistermocha: has joined #ruby
[01:15:28] certainty: has joined #ruby
[01:17:49] shakes: has joined #ruby
[01:18:19] sarlalian: has joined #ruby
[01:21:29] Ropeney_: has joined #ruby
[01:21:36] ElFerna: has joined #ruby
[01:21:57] mistermocha: has joined #ruby
[01:22:57] mistermocha: has joined #ruby
[01:23:59] scorphus: has joined #ruby
[01:24:29] lightt: has joined #ruby
[01:25:45] yfeldblum: has joined #ruby
[01:25:53] mistermo_: has joined #ruby
[01:26:49] mistermo_: has joined #ruby
[01:27:53] mistermocha: has joined #ruby
[01:28:45] scorphus: has joined #ruby
[01:29:04] rkazak: has joined #ruby
[01:31:14] Fredrich_: has joined #ruby
[01:34:19] dkam: has joined #ruby
[01:36:15] ekinmur: has joined #ruby
[01:37:23] skweek: has joined #ruby
[01:40:24] ensyde__: has joined #ruby
[01:40:39] mistermocha: has joined #ruby
[01:42:24] ensyde: has joined #ruby
[01:42:36] scorphus: has joined #ruby
[01:42:39] mistermocha: has joined #ruby
[01:42:54] karmatr0n: has joined #ruby
[01:44:22] flashpoint9: has joined #ruby
[01:45:32] mistermo_: has joined #ruby
[01:51:46] patrick_star_3: has joined #ruby
[01:52:18] nando293921: has joined #ruby
[01:52:26] mistermocha: has joined #ruby
[01:54:52] aufi: has joined #ruby
[01:55:48] weemsledeux: has joined #ruby
[01:57:54] pepee: has joined #ruby
[01:58:51] aberen: has joined #ruby
[01:59:37] jancel: has joined #ruby
[02:00:52] harfangk: has joined #ruby
[02:03:40] Rodya_: has joined #ruby
[02:05:32] Coldblackice: has joined #ruby
[02:09:01] postmodern: has joined #ruby
[02:09:12] nando293921: has joined #ruby
[02:09:56] charliesome: has joined #ruby
[02:10:14] Arsin: has joined #ruby
[02:10:35] LoneHermit: has joined #ruby
[02:10:49] LinuxPenT: has joined #ruby
[02:11:21] Arsin: Can someone help me with asciidoctor? I'm trying to compile -> https://github.com/bitcoinbook/bitcoinbook
[02:12:20] havenwood: Arsin: what trouble are you running into?
[02:12:45] havenwood: Arsin: Getting an error?
[02:12:48] Arsin: I found many tutorials for single page documents, but I don't know how to complie with anymore than one
[02:13:11] mistermocha: has joined #ruby
[02:13:58] Arsin: I'm just trying to compile the bugger
[02:15:36] havenwood: Arsin: What's the command you're running? Do you want it to run for every file in a directory or recursively in subdirectories as well?
[02:16:13] certainty: has joined #ruby
[02:16:57] jrafanie: has joined #ruby
[02:16:58] Arsin: There are subdirectories, I do want it to run just one command. I don't want to make multiple PDFs then combine, I feel like there's a way to automate collecting resources and making one PDF
[02:17:37] Arsin: The standard command to take it to HTML is just "asciidoctor FILENAME", right now I'm trying to dig up tutorials to get a PDF output
[02:17:54] ElFerna: has joined #ruby
[02:18:07] Arsin: "asciidoctor-pdf FILENAME.EXTENSION"
[02:19:18] Spami: has joined #ruby
[02:19:45] nankyokusei: has joined #ruby
[02:24:26] gamov: has joined #ruby
[02:26:51] flashpoint9: has joined #ruby
[02:26:53] lightt: has joined #ruby
[02:29:43] mistermocha: has joined #ruby
[02:31:27] karmatr0n: has joined #ruby
[02:32:15] meinside: has joined #ruby
[02:32:49] mistermo_: has joined #ruby
[02:33:26] cdg: has joined #ruby
[02:33:41] mistermo_: has joined #ruby
[02:34:40] mistermocha: has joined #ruby
[02:39:36] mistermocha: has joined #ruby
[02:39:54] sp4rrow: has joined #ruby
[02:40:07] aupadhye: has joined #ruby
[02:40:40] mistermo_: has joined #ruby
[02:42:12] pelegreno: has joined #ruby
[02:42:31] mistermo_: has joined #ruby
[02:43:37] mistermo_: has joined #ruby
[02:45:36] mistermocha: has joined #ruby
[02:47:28] mistermo_: has joined #ruby
[02:48:25] mistermocha: has joined #ruby
[02:48:36] assgrass: has joined #ruby
[02:49:27] mistermo_: has joined #ruby
[02:49:44] assgrass: has joined #ruby
[02:52:27] mistermo_: has joined #ruby
[02:53:27] mistermocha: has joined #ruby
[02:54:27] mistermocha: has joined #ruby
[02:54:43] Spami: has joined #ruby
[02:56:35] jaguarmagenta: has joined #ruby
[02:58:05] woodruffw: has joined #ruby
[02:58:51] ur5us: has joined #ruby
[03:00:08] aberen: has joined #ruby
[03:00:14] sandstrom: has joined #ruby
[03:00:51] jancel: has joined #ruby
[03:02:51] ellisTAA: has joined #ruby
[03:03:28] ellisTAA: how would you define a 10x programmer?
[03:03:46] chopin: has joined #ruby
[03:03:56] elomatreb: As someone who uses meaningless buzzwords :P
[03:04:56] ellisTAA: elomatreb: what is the non buzzword for 10x programmer
[03:07:12] elomatreb: ellistaa: It probably just means someone who is good at their job
[03:07:40] ellisTAA: what would make a progrmmer top knotch
[03:09:29] Soraroxasxion: has joined #ruby
[03:11:02] sp4rrow: has joined #ruby
[03:11:11] Soraroxasxion: Hello, How would I in ruby make an if statement that is If A is true unless B is true
[03:13:57] postmodern: has joined #ruby
[03:16:01] ellisTAA: has joined #ruby
[03:16:55] certainty: has joined #ruby
[03:17:06] elifoster: has joined #ruby
[03:17:51] braincrash: has joined #ruby
[03:19:24] agentmeerkat: has joined #ruby
[03:19:50] Nawn: has joined #ruby
[03:20:53] k3rn31: has joined #ruby
[03:22:10] Soraroxasxion: in ruby is || and?
[03:22:30] elomatreb: || is boolean or
[03:22:43] elomatreb: && is boolean and
[03:22:48] harfangk: has joined #ruby
[03:26:11] Soraroxasxion: So in an if statement to say both a and b need to be true it would be if (statement a) && (statement b)?
[03:26:11] odigity: has joined #ruby
[03:26:36] odigity: I'm in a python project (not my choice), and need to encode a list of string literals. Does anyone know if Python has an equivalent to ruby's %w operator?
[03:27:12] elomatreb: Soraroxasxion: correct
[03:28:25] Soraroxasxion: Hey it worked! thanks, (was getting an error missing method so adding && !SceneManager.scene_is?(Scene_Gameover) fixed my problem
[03:28:48] Soraroxasxion: not that that makes any sense out of context.
[03:29:03] MadeInChina: has joined #ruby
[03:29:14] elomatreb: Few errors do :)
[03:30:26] ElFerna: has joined #ruby
[03:31:20] Soraroxasxion: it was basically trying to load a map that didn't exist before the default death scene was interupted fully.
[03:31:37] Soraroxasxion: that tells it not to load the map if the current map is the game over screen
[03:31:49] elomatreb: Gamedev in Ruby? Sounds nice!
[03:32:21] Soraroxasxion: well it's rpg maker, just had to make a small edit to fix an error in a script conflict
[03:32:46] Soraroxasxion: Good news is i'm learning.
[03:33:42] elomatreb: odigity: I don't know if Python has a direct equivalent, but it does have multiline strings. Maybe create one of those and split on the newline?
[03:34:28] odigity: elomatreb, that's creative, but doesn't feel better to me than simply using the straightforward method of writing a list of string literals
[03:34:50] odigity: it's ok, I was prepared to be disappointed; there's a reason I prefer ruby to python, afterall :)
[03:35:21] Soraroxasxion: don't know to much but this seems to be somebody asking the same question (and it lookes answered) https://bytes.com/topic/python/answers/540221-ruby-w-equivalent
[03:36:56] elomatreb: lol @ how they moan about ruby syntax in that thread
[03:37:39] Soraroxasxion: does it at least help though?
[03:37:41] jancel: has joined #ruby
[03:40:04] elomatreb: As soon as two competing programming languages are the subject of a thread you get flamewars
[03:40:31] Soraroxasxion: yeah it just looked like the first answer was serious, sorry if it wasn't any help
[03:43:48] Soraroxasxion: How would I explain to my friend who knows almost nothing how bad nil values being passed usually are?
[03:45:34] Yiota: has joined #ruby
[03:46:32] elomatreb: The best way to learn about being careful with nil values is having to debug errors caused by them
[03:47:06] Soraroxasxion: Yeah but how do I explain to my non coder friend about that.
[03:47:51] elomatreb: Maybe like this: nil means "no value". Can you do anything with "no value"?
[03:48:40] gix: has joined #ruby
[03:48:51] dsea: elomatreb, The flaming is probably because ruby could be good if they didn't make it into perl for grownups
[03:49:24] elomatreb: I really don't want to argue about Ruby vs. Python vs. Perl
[03:49:37] elomatreb: Almost as useless as Tabs vs. Spaces
[03:50:05] Arcaire: Have you considered arguing about vim vs emacs?
[03:50:14] elomatreb: Windows vs. Unix?
[03:50:52] Arcaire: That one's easy though
[03:50:56] Arcaire: "I play video games"
[03:50:57] Arcaire: end of argument
[03:50:59] elomatreb: Throw some PHP into the mix and you're ready to waste hours arguing with strangers on the internet
[03:51:23] dsea: Isn't that what the internet is for?
[03:51:28] Arcaire: ACTION waits for someone to link that utterly atrocious blog post by eevee about PHP being a "fractal of bad design".
[03:52:21] elomatreb: Anyone been to 32C3? There was a Perl talk which was basically this debate, plus funny camel pictures
[03:52:39] Arcaire: But that puts me in the same room as ioerror
[03:52:40] Arcaire: why would i want that
[03:52:54] Soraroxasxion: is this good enough for you https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
[03:52:55] ellisTAA: has joined #ruby
[03:53:09] Arcaire: Soraroxasxion: That's the one! :D
[03:53:21] Arcaire: Bad post, parroted by people who probably don't even know what the word 'fractal' means.
[03:53:39] elomatreb: Arcaire: But also in the same room as hundreds of actually awesome people. I like the C3
[03:53:49] Arcaire: elomatreb: tbh i just can't take the time off to go to Berlin
[03:54:11] Arcaire: I do, however, watch any interesting talks online later.
[03:54:23] elomatreb: It's in Hamburg, but I get your point. I'm fortunate enough to live in driving distance
[03:54:27] kareeoleez: has joined #ruby
[03:54:51] Soraroxasxion: Hey, you said you where waiting for it.
[03:55:18] hk238: has joined #ruby
[03:55:44] elomatreb: That article is actually a good read, no language is immune from criticicsm
[03:56:20] dsea: The 32c3 speeches on perl are great as well, thank you
[03:56:26] kknight: has joined #ruby
[03:56:47] elomatreb: Ruby also has it's weak points. Excessive metaprogramming makes code as unreadable as some PHP method names
[03:57:21] kspencer: has joined #ruby
[03:59:03] pwnd_nsfw: has joined #ruby
[03:59:07] nando293921: has joined #ruby
[03:59:17] Vingador: has joined #ruby
[04:00:54] aberen: has joined #ruby
[04:01:49] Soraroxasxion: So what are the strong and weak points of ruby? I know every coding language has there own.
[04:02:06] rkazak: has joined #ruby
[04:02:26] tmtwd: has joined #ruby
[04:03:25] elomatreb: You're not going to get many actual answers for that. Everything aside from a few low-level concerns is pure opinion
[04:03:37] Arcaire: elomatreb: it's not a good read
[04:03:47] Arcaire: it's mostly incorrect or "this doesn't do what i want it to do so it's wrong"
[04:03:57] Arcaire: eevee is mostly a pretty cool person but that post is just garbage through and through
[04:04:06] LoneHerm_: has joined #ruby
[04:04:47] jancel: has joined #ruby
[04:04:53] Arcaire: i wish everything in ruby wasn't a dsl
[04:04:56] Arcaire: just write ruby dammit
[04:05:09] elomatreb: Arcaire: I wouldn't take it at face value, but it can be useful to have posts like that to notice inconsistent or unintuitive behaviour in a language
[04:05:24] Arcaire: http://phpsadness.com/
[04:05:26] nirix: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[04:06:14] elomatreb: I agree on the DSL thing. It's really difficult to write actually good DSLs
[04:07:47] tjbiddle: has joined #ruby
[04:08:13] Soraroxasxion: Who want's to hear a programing joke I found?
[04:08:44] charliesome: has joined #ruby
[04:09:03] Soraroxasxion: You shoot yourself in the foot.
[04:09:13] Soraroxasxion: You accidently create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying "That's me, over there."
[04:09:55] elomatreb: Isn't there an entire list of jokes about languages like that? IIRC there even is a ruby one
[04:10:45] nando293921: has joined #ruby
[04:10:49] Soraroxasxion: it's just the first one If ound
[04:11:58] LinuxPenT: anyone even mildly interested in metasploit development? just curious
[04:12:55] elomatreb: Ah, found it: https://www-users.cs.york.ac.uk/susan/joke/foot.htm
[04:14:04] hahuang61: has joined #ruby
[04:14:15] Arcaire: LinuxPenT: yes
[04:15:37] weemsledeux: has joined #ruby
[04:16:05] djbkd: has joined #ruby
[04:16:11] LinuxPenT: Arcaire: how familiar are you with the framework? i was doing some testing last night and noticed a ton of areas of potential improvement. literally too many to work on alone, though. most of the issues i came across had to do with post-exploitation on android
[04:17:51] certainty: has joined #ruby
[04:18:05] chouhoulis: has joined #ruby
[04:18:22] Arcaire: are you sure they were areas of potential improvement or just areas you happened to be misusing the framework
[04:18:36] Arcaire: I ask because there's over 300 contributors to metasploit.
[04:19:33] hahuang61: has joined #ruby
[04:20:38] nankyokusei: has joined #ruby
[04:23:03] Soraroxasxion: Anyways peace.
[04:24:20] LinuxPenT: lol given that android isn't "officially" supported i'd classify them as idiosyncrasies of the current stage of development. for example, when dropping a meterpreter shell on windows or linux boxes we have modules for persistent access, but no such option on the phones. there were no modules for imaging and downloading the contents of an sd card in its entirety for forensic analysis with other linux utilities. to download pics i ha
[04:24:20] LinuxPenT: d to traverse to the directory and download individually, which was time-consuming. also seemingly lacking were modules for privilege escalation on the android platform. what would you classify that as?
[04:24:24] craigp: has joined #ruby
[04:24:41] armyriad: has joined #ruby
[04:24:46] yfeldblum: has joined #ruby
[04:25:22] yatish27: has joined #ruby
[04:26:53] LinuxPenT: i'd personally much prefer to be able to image the card and conduct forensic analysis to retrieve deleted information. that'd be pretty cool, right?
[04:26:55] chouhoulis: has joined #ruby
[04:30:17] odigity: I keep writing 'puts' in this python script.
[04:31:32] duncannz: has joined #ruby
[04:36:01] Cohedrin: has joined #ruby
[04:39:01] harfangk: has joined #ruby
[04:39:03] dsea: LinuxPenT, then just write a script that iterates over what ever exploit your using for each item, not really that time consuming
[04:39:37] dsea: odigity, then use a for loop to do it whatever put your doing for you x amount of times until you get the desired result
[04:41:13] dcunit3d: has joined #ruby
[04:44:00] dcunit3d: has joined #ruby
[04:47:07] kgrz: has joined #ruby
[04:51:11] nofxx: has joined #ruby
[04:51:29] DTZUBDUB: has joined #ruby
[04:53:13] SilverKey: has joined #ruby
[04:54:09] tildes_: has joined #ruby
[04:54:35] MrBusiness3: has joined #ruby
[04:56:54] nando294221: has joined #ruby
[04:57:29] jaguarmagenta: has joined #ruby
[04:59:54] braincra-: has joined #ruby
[05:01:38] aberen: has joined #ruby
[05:08:28] pawnbox: has joined #ruby
[05:12:09] nando294021: has joined #ruby
[05:16:55] GinoManWorks_: has joined #ruby
[05:18:25] certainty: has joined #ruby
[05:18:27] alfiemax: has joined #ruby
[05:20:37] raeoks: has joined #ruby
[05:22:18] David_H_Smith: has joined #ruby
[05:22:43] sauvin: has joined #ruby
[05:23:43] pawnbox: has joined #ruby
[05:24:09] jas02: has joined #ruby
[05:25:25] roamingdog: has joined #ruby
[05:28:53] LoneHerm_: has joined #ruby
[05:30:34] pawnbox: has joined #ruby
[05:31:43] tubbo: has joined #ruby
[05:37:44] platzhirsch: has joined #ruby
[05:38:08] lightt: has joined #ruby
[05:39:08] anisha: has joined #ruby
[05:43:09] thamster_: has joined #ruby
[05:49:05] dionysus69: has joined #ruby
[05:50:05] last_staff: has joined #ruby
[05:52:38] ruby-lang892: has joined #ruby
[05:53:55] ruby-lang892: anyone here uses shoes?
[05:54:24] diasp: has joined #ruby
[05:55:50] pawnbox: has joined #ruby
[05:56:32] emilkarl: has joined #ruby
[05:58:20] psmolen: has joined #ruby
[06:02:29] aberen: has joined #ruby
[06:04:20] agit0: has joined #ruby
[06:07:16] pawnbox_: has joined #ruby
[06:07:52] alfiemax: has joined #ruby
[06:11:48] Wolland: has joined #ruby
[06:12:45] gagrio_: has joined #ruby
[06:13:30] yardenbar: has joined #ruby
[06:13:43] LaT0rtue: has joined #ruby
[06:13:44] kareeoleez: has joined #ruby
[06:14:14] certainty: has joined #ruby
[06:14:48] craigp: has joined #ruby
[06:15:23] platzhirsch: has joined #ruby
[06:15:43] blaxter: has joined #ruby
[06:16:14] axxyhtrx: has joined #ruby
[06:16:43] emilkarl: has joined #ruby
[06:17:57] ponga: has joined #ruby
[06:18:16] solars: has joined #ruby
[06:19:21] GinoManWorks: has joined #ruby
[06:21:07] aberen: has joined #ruby
[06:21:29] nankyokusei: has joined #ruby
[06:26:20] aganov: has joined #ruby
[06:30:02] astrobunny: has joined #ruby
[06:30:15] c0mrad3: has joined #ruby
[06:30:26] lxsameer: has joined #ruby
[06:30:27] codecop: has joined #ruby
[06:32:42] firstdayonthejob: has joined #ruby
[06:35:01] Spami: has joined #ruby
[06:39:03] tjbiddle: has joined #ruby
[06:39:08] karmatr0n: has joined #ruby
[06:40:55] pawnbox: has joined #ruby
[06:42:44] djbkd: has joined #ruby
[06:43:11] fenre: has joined #ruby
[06:43:14] darkxploit: has joined #ruby
[06:44:52] fenre: has joined #ruby
[06:48:03] TomyWork: has joined #ruby
[06:50:16] sandstrom: has joined #ruby
[06:52:33] arlek: has joined #ruby
[06:56:09] Guest2: has joined #ruby
[06:57:46] k3rn31: has joined #ruby
[06:58:06] jaguarmagenta: has joined #ruby
[06:58:34] lalalaaa: has joined #ruby
[07:01:07] blockchan: has joined #ruby
[07:03:20] flughafen_: has joined #ruby
[07:09:49] dcunit3d: has joined #ruby
[07:11:34] andikr: has joined #ruby
[07:12:58] moei: has joined #ruby
[07:16:22] edwinvdgraaf: has joined #ruby
[07:16:51] Couch: has joined #ruby
[07:17:43] ur5us: has joined #ruby
[07:21:11] jaruga___: has joined #ruby
[07:21:22] hightower3: has joined #ruby
[07:21:48] aberen: has joined #ruby
[07:22:05] jaruga___: has joined #ruby
[07:22:32] antgel: has joined #ruby
[07:24:04] pawnbox: has joined #ruby
[07:25:38] fenre: has joined #ruby
[07:26:01] MrBusiness2: has joined #ruby
[07:28:09] shevy: ruby-lang892 I used to use it when _why was in charge
[07:28:32] Macaveli: has joined #ruby
[07:33:46] tmtwd: has joined #ruby
[07:35:30] Gasher: has joined #ruby
[07:36:25] n1x-nz: has joined #ruby
[07:38:09] Pip: has joined #ruby
[07:39:43] Pip: Is Ruby is healthy growing?
[07:40:00] karmatr0n: has joined #ruby
[07:40:37] ur5us: has joined #ruby
[07:41:01] n1x-nz: has joined #ruby
[07:41:11] shevy: http://www.tiobe.com/tiobe_index rank 10
[07:44:10] qasaur: has joined #ruby
[07:45:31] sandstrom: has joined #ruby
[07:46:19] Silthias: has joined #ruby
[07:47:19] Silthias2: has joined #ruby
[07:49:29] psmolen: has joined #ruby
[07:50:38] bweston92: has joined #ruby
[07:51:09] einarj: has joined #ruby
[07:51:23] skade: has joined #ruby
[07:51:52] charliesome: has joined #ruby
[07:52:30] Pip: Assembly language is climbing up, jesus
[07:53:10] einarj: has joined #ruby
[07:55:18] pandaant: has joined #ruby
[07:56:39] pawnbox: has joined #ruby
[07:57:16] ishe_ua: has joined #ruby
[07:59:07] snath: has joined #ruby
[08:00:02] platzhirsch: has joined #ruby
[08:02:49] fenre: has joined #ruby
[08:03:26] blur3d: has joined #ruby
[08:04:16] LoneHermit: has joined #ruby
[08:04:43] Pip: has left #ruby: ("Leaving")
[08:06:03] yfeldblum: has joined #ruby
[08:06:34] DaniG2k: has joined #ruby
[08:08:36] mikecmpbll: has joined #ruby
[08:08:42] marr: has joined #ruby
[08:11:50] harfangk: has joined #ruby
[08:13:44] tmi: has joined #ruby
[08:17:24] matp: has joined #ruby
[08:17:48] alfiemax: has joined #ruby
[08:18:36] blackmesa: has joined #ruby
[08:18:51] nerium: has joined #ruby
[08:19:21] CloCkWeRX: has joined #ruby
[08:19:24] mark_66: has joined #ruby
[08:22:19] nankyokusei: has joined #ruby
[08:23:33] terlar: has joined #ruby
[08:23:47] aberen: has joined #ruby
[08:24:10] kraken: has joined #ruby
[08:24:40] krakenr: is it looked down upon to use for loops in ruby? It just makes more sense to me when working with arrays instead of each loops
[08:25:04] Veejay: Not looked down upon
[08:25:07] Veejay: But surely uncommon
[08:25:18] j416: has joined #ruby
[08:25:19] Veejay: Array are Enumerable objects
[08:25:51] Veejay: So you would usually the methods available on Enumerable such as each, map, reduce, select, reject, etc.
[08:26:01] Veejay: Why do you think for loops make "more sense"?
[08:26:04] Veejay: Matter of habit?
[08:26:35] krakenr: I think it's a matter of habit, and I'm replacing specific elements in an array at specfic points and I'm scared of using the each method for that
[08:26:45] certainty: has joined #ruby
[08:26:51] Veejay: Do you need a for loop for that?
[08:27:03] krakenr: I'm going to write a few lines of code
[08:27:08] krakenr: givve me a couple minutes
[08:27:20] krakenr: Then can you let me know if it could be done better?
[08:27:44] Zarthus: Generally the #each method or an infinite loop is everything I've needed
[08:28:02] Zarthus: for other normal for loops there's Ranges.
[08:28:29] Zarthus: 10.times do ...
[08:28:31] krakenr: I'm using for loops with ranges such as for i in 0...nums.size
[08:28:57] Veejay: nums.size - 1?
[08:28:57] joonty: has joined #ruby
[08:29:05] Veejay: Or there will be some wonkiness
[08:29:17] krakenr: I think the ... discludes nums.size
[08:29:29] krakenr: .. would leave wonkiness, right?
[08:29:41] Veejay: I read ..
[08:29:57] krakenr: I guess my code isn't very rubyist :(
[08:30:18] Veejay: It's best to be idiomatic, but it's not like it you're going to prison
[08:30:56] Veejay: You gotta try to understand why those idioms became idioms in the first place and play to the strengths of the language you're using
[08:31:22] Veejay: Enumerable#each is nice because you do not have to think in terms of bounds
[08:31:34] haxrbyte: has joined #ruby
[08:31:40] Veejay: It's simpler, more individual construct in my mind
[08:31:45] moei: has joined #ruby
[08:31:54] Veejay: You think of what you need to do to each element and that's it
[08:32:58] certainty: has joined #ruby
[08:33:35] nofxx: kraken_, also, there's each.with_index, if you're worried about using the index
[08:33:43] krakenr: that's true
[08:34:05] nofxx: but, dont loop! its ugly =D
[08:34:34] jhass: kraken_: for is actually quit looked down upon. These days it's a bit slower than each, its scoping rules are not what you expect from other languages, polluting the outer scope (contrary to .each and companions) and in fact it just calls .each under the hood
[08:35:11] Kedare: has joined #ruby
[08:35:15] jhass: kraken_: for index iteration you can for example do Array#each_index or 0.upto(array.size/2) do |i| and stuff like that
[08:35:15] krakenr: I'm going to post a code block in a sec
[08:35:32] krakenr: Oh I like 0.upto
[08:35:47] Veejay: There's downto as well IIRC
[08:37:03] jhass: still do post your code though, usually there's even a higher level way of doing it than index iteration ;)
[08:38:05] krakenr: Alright, so I'm guessing this is not a very ruby way of doing things:
[08:38:06] krakenr: https://gist.github.com/KrakenHH/b00ef184cf2330f926c017da0b273af4
[08:38:07] Platini: has joined #ruby
[08:38:46] pawnbox: has joined #ruby
[08:38:51] jhass: how do you initialize @answer_array?
[08:39:00] krakenr: it was initialized a while back
[08:39:11] p0p0pr37: has joined #ruby
[08:39:11] jhass: is it... a password check?
[08:39:16] krakenr: @answer_array = []; @secret_word_letters.size.times { @answer_array << "_" }
[08:39:49] jhass: okay I see
[08:40:04] krakenr: It's hangman!
[08:40:26] jhass: is user_input_letters guaranteed the same size as @secret_word_letters?
[08:40:47] Veejay: Unless the player is not very good at hangman I guess so
[08:41:01] karmatr0n: has joined #ruby
[08:41:04] jhass: that's not guaranteed then ;)
[08:41:15] krakenr: oh I just realized I did this wrong
[08:41:25] krakenr: user input letters is litterally 1 letter
[08:41:50] Veejay: Ah yes, *I* am actually not very good at hangman
[08:41:59] Veejay: You do give answers letter by ltter
[08:42:02] krakenr: it works but this is superfluous as hell
[08:42:31] houhoulis: has joined #ruby
[08:42:43] jhass: kraken_: assuming the answer would have been yes, here's a better @answer_array = Array.new(@secret_word_letters.size) {|i| letter = @secret_word_letters[i]; user_input_letters[i] == letter ? letter : "_" }
[08:43:23] krakenr: I like that
[08:43:41] krakenr: thanks jhass
[08:43:53] jhass: but let's find a good one for the actual issue
[08:44:04] jhass: why is user_input_letters an array if it's only ever a single char?
[08:44:23] krakenr: Because it's 4 am and I need to go to bed :(
[08:44:32] Veejay: IS THIS HOMEWORK?
[08:44:42] Veejay: It is though, right?
[08:44:53] krakenr: It's definitely not
[08:45:12] krakenr: That will be python
[08:45:16] jhass: mh, looking at the above, a even butter one might be @answer_letters = @secret_word_letters.map.with_index {|letter, i| user_input_letters[i] == letter ? letter : "_" }
[08:45:17] krakenr: I wish I got ruby homework
[08:45:53] krakenr: Are any colleges teaching ruby these days? UT likes hitting me with python
[08:46:06] jhass: and that already gets you towards a good solution for your actual problem too ;)
[08:46:23] jhass: basically remove stuff from it
[08:46:23] siovene: has joined #ruby
[08:46:52] Veejay: That's map_with_index
[08:47:01] krakenr: I like it alot jhass , very succinct
[08:47:05] Veejay: And make sure you have a recent version of Ruby if you want to use it
[08:47:11] krakenr: I'm going to bed now
[08:47:13] jhass: Veejay: there's no map_with_index ;)
[08:47:20] jhass: sleep well
[08:47:25] Veejay: jhass: There's a .with_index?
[08:47:40] jhass: Enumerator#with_index
[08:47:48] Veejay: I thought map_with_index looked strange in the first place, but I thought it was a typo
[08:48:12] Veejay: So basically it will return the enumerator
[08:48:19] Veejay: With an index baked in
[08:48:30] Veejay: Didn't even know that existed
[08:48:50] jhass: if you want your brain spinning have a look at Enumerator#lazy :P
[08:49:04] jhass: I'll go do something else in the meantime
[08:49:13] Veejay: That's old too, damn
[08:49:21] Veejay: It's not like it's a recent addition
[08:49:22] tvw: has joined #ruby
[08:49:35] Veejay: I usually have no use for indices but it's nice to know
[08:50:11] Bish: hi, how do i redefine an instance method?
[08:50:23] jhass: just do it
[08:50:29] Bish: jhass: wait!
[08:50:35] Bish: sure i can do def x.y ... end
[08:50:45] Bish: bot what if i want to want to call "y" inside my new method
[08:50:57] jhass: it shadows it actually
[08:51:08] Bish: well, but that is only if i use inheritance, no?
[08:51:08] jhass: defines an instance method on the objects singleton class
[08:51:14] Bish: oh.. i get it.
[08:51:21] Bish: so it's like a mini inheritance
[08:51:55] jhass: quite full blown, every object in ruby has its own implicit anonymous class, called the singleton class
[08:52:12] Bish: >> class T; def y; puts "1"; end; end; T.new.y; def T.y; puts "2"; super; end;
[08:52:13] ruby[bot]: Bish: # => 1 ...check link for more (https://eval.in/584955)
[08:52:26] Bish: >> class T; def y; puts "1"; end; end; T.new.y; def T.y; puts "2"; super; end;T.new.y
[08:52:27] ruby[bot]: Bish: # => 1 ...check link for more (https://eval.in/584956)
[08:52:46] Bish: jhass: yeah i knew about that
[08:52:51] Bish: but i can't seem to "use" it
[08:53:06] jhass: there you define y on the singleton class of T, not an instance of T
[08:53:16] jhass: same as class T; def self.y; ....
[08:53:25] Bish: ah yeah, im stupid
[08:53:42] jhass: Bish: only do this for long-lived objects, it's slow otherwise
[08:53:48] ByronJohnson: has joined #ruby
[08:53:54] bruce_lee: has joined #ruby
[08:53:58] ByronJohnson: has joined #ruby
[08:53:58] bruce_lee: has joined #ruby
[08:54:05] Bish: jhass: yah i figured
[08:54:15] jhass: for everything else you're better of with SimpleDelegator or the like
[08:54:32] Bish: well, i won't use it anyways, i was just curious
[08:54:52] Bish: >> class T; def y; puts "1"; end; end; T.new.y; class T; def y;puts "2"; super; end;T.new.y
[08:54:53] ruby[bot]: Bish: # => /tmp/execpad-8b197c48c89c/source-8b197c48c89c:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/584958)
[08:54:57] jhass: ?experiment Bish
[08:54:57] ruby[bot]: Bish: Please use your local irb or pry (see ?pry) to experiment, ruby[bot]'s eval functionality is for demonstration purposes only.
[08:55:00] Bish: ACTION stops to spam
[08:56:22] Nuck: has joined #ruby
[08:57:23] CloCkWeRX: has joined #ruby
[08:57:54] Bish: jhass: it doesn't seem to work the way you told me
[08:58:06] Bish: super: no superclass method `y'
[08:58:12] araujo: has joined #ruby
[08:58:43] ur5us: has joined #ruby
[08:58:54] jaguarmagenta: has joined #ruby
[08:59:12] der-landgraf: has joined #ruby
[08:59:12] der-landgraf: has joined #ruby
[09:00:46] Gasher: has joined #ruby
[09:01:13] giz|work: has joined #ruby
[09:06:13] norc: has joined #ruby
[09:06:32] troulouliou_div2: has joined #ruby
[09:08:19] AlexJakeGreen: has joined #ruby
[09:08:27] blockchan: has joined #ruby
[09:10:34] binaryplease1: has joined #ruby
[09:12:30] ocbtec: has joined #ruby
[09:12:52] jhass: >> class T; def y; 1; end; end; t = T.new; def t.y; super + 2; end; [T.new.y, t.y]
[09:12:53] ruby[bot]: jhass: # => [1, 3] (https://eval.in/584997)
[09:15:08] Bish: that is of a single object, yah
[09:15:18] Bish: but i want to change the instance method at runtime for ALL future instances
[09:15:43] Bish: but keep the behaviour of the old one, super-ish
[09:15:45] jhass: then you have to make a backup of the previous definition
[09:15:52] Bish: yeah exactly that is my problem
[09:16:00] jhass: or move it into a module and Module#prepend
[09:16:05] Bish: because #instance_method(:y) has no .to_proc
[09:16:22] Bish: since it's unbound i guess
[09:16:26] jhass: but a .bind and then a .call
[09:16:26] norc: Bish: The Ruby dispatch mechanism does not allow for what you are asking. :(
[09:16:40] ur5us: has joined #ruby
[09:16:46] norc: Bish: Unless you change Klass#new
[09:16:52] jhass: Rails introduced alias_method_chain for this kind of problem
[09:17:10] Bish: first thing i encountered ruby seems not be able to do
[09:17:18] Bish: but having to use this sounds like bad software architecture at all
[09:17:26] jhass: I offered you at least two solutions already
[09:17:27] Bish: anyways*
[09:17:49] Bish: both are very hacky, and i don't get that .bind one
[09:18:21] norc: Bish: What you could do is reimplement what Module#prepend does under the hood.
[09:18:31] Bish: by the way, if i include 2 modules with definition of :x, which ones wins?
[09:18:34] isxek: has joined #ruby
[09:18:40] jhass: the last one
[09:18:48] skade: has joined #ruby
[09:19:01] jhass: Bish: do it and compare .ancestors at each step
[09:19:21] Bish: okay cool, but i will stick with proper modelling :D
[09:19:42] nirix: has joined #ruby
[09:19:43] jhass: doesn't hurt to understand this part of Ruby anyway
[09:19:49] Bish: yep, thats why i am asking
[09:19:54] Bish: i nearly did it that way
[09:20:33] norc: Bish: Meaning if you have some kind of "proxy" class that facilitates construction of an object of type A, you could have it switch to construction of an derived type B. I think that would be the ruby way to have new methods for all future objects.
[09:20:44] norc: Well, Factory class I suppose.
[09:22:32] Bish: well sounds like a performance issue, though
[09:23:46] Bish: pry makes writing ruby so nice
[09:24:14] norc: What I really want is a ruby debugger that can be attached to a running Ruby application.
[09:24:36] Bish: yah that'd be cool
[09:25:00] mtkd: has joined #ruby
[09:25:18] Bish: but actually i rarely needed that
[09:25:52] Bish: like 2 times in a project, where a adding a binding.pry didn't hurt
[09:26:10] Bish: didn't rubinius had such a thingie?
[09:26:14] MrBusiness2: has joined #ruby
[09:27:15] norc: Bish: Well I noticed this problem heavily with Rails.
[09:27:23] Macaveli: has joined #ruby
[09:27:48] mdw: has joined #ruby
[09:28:24] Bish: ACTION is not a rails fan
[09:28:27] norc: Bish: Without you inserting a rack middleware that gives you byebug to then set breakpoints the way you need them to, there are some things you just cannot debug.
[09:28:35] Bish: it tells me to much what to do /opinion
[09:28:51] hightower3: has joined #ruby
[09:31:25] chussenot: has joined #ruby
[09:32:43] MrBusiness3: has joined #ruby
[09:34:00] Xentil: has joined #ruby
[09:38:46] shevy: Bish you are funny :D
[09:40:36] Bish: shevy: how?
[09:40:47] Bish: but thanks i think that's good
[09:42:06] shevy: hehe the /opinion part
[09:42:26] Bish: yeah well, i know flamewars, they tend to lead nowhere :D
[09:42:49] Bish: and basicially in #ruby there is not much other choice than rails, sure there is sinatra and such,but most people will be here because of rails
[09:42:54] joonty: has joined #ruby
[09:44:14] norc: Bish: Most people are here because they have no friends.
[09:45:16] gregf_: thats not entirely true ;)
[09:45:53] DTZUBDUB: has joined #ruby
[09:46:43] Bish: norc: are u serious?
[09:47:00] Bish: weird nerd stereotype do you have there
[09:47:42] Bish: offofftopic: can i use ensure to FORCE a method to return smth no matter what error might come?
[09:48:06] norc: Bish: use "ensure"
[09:48:13] dn`: has joined #ruby
[09:48:19] norc: Bish: just be sure the ensure block is exception safe if you really rely on it.
[09:48:34] Bish: norc: that's what i asked :D
[09:48:39] norc: What is?
[09:48:40] Bish: > can i use ensure to...
[09:49:03] mdw7: has joined #ruby
[09:49:05] Bish: so i can use "ensure" without "rescue" to do that?
[09:49:09] norc: Bish: yes.
[09:49:10] workmad3: has joined #ruby
[09:49:19] norc: Bish: Ruby guarantees that the ensure block is executed no matter what.
[09:49:23] norc: Short of ruby segfaulting.
[09:49:40] norc: Or using catch/throw to avoid it.
[09:49:50] Bish: so, any error will be caught in some sort of explicit rescue block?
[09:50:01] norc: Bish: no
[09:50:25] norc: Bish: begin; a; ensure; b; end
[09:50:34] norc: No rescue block there.
[09:50:50] mdw7_: has joined #ruby
[09:50:54] Bish: s/explicit/implicit
[09:51:02] allcentu1: has joined #ruby
[09:51:26] lupine: ensure doesn't alter the return value of a block does it?
[09:51:29] norc: asm>> begin; a; ensure; b; end
[09:51:30] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/585087
[09:51:39] norc: lupine: it does
[09:51:52] norc: I think..
[09:52:00] Bish: >> def x; throw "whoo~";"hi"; ensure "ho"; end; puts x;
[09:52:02] ruby[bot]: Bish: # => uncaught throw "whoo~" (UncaughtThrowError) ...check link for more (https://eval.in/585088)
[09:52:08] lupine: irb(main):006:0> begin ; 1 ; ensure ; 2 ; end => 1
[09:52:14] certainty: has joined #ruby
[09:52:15] norc: Bish: Don't confuse throw with fail/raise by the way.
[09:52:24] Bish: oh i didn't i just wrote that brainded
[09:52:26] norc: throw is basically a stripped down jump
[09:53:15] norc: Bish: look at my assembly code above
[09:53:21] lupine: begin ; a = 1 ; a ; ensure ; a = 2 ; end => 1
[09:53:22] norc: Bish: It shows that no rescue symbol is made available.
[09:53:35] lupine: you can't even do golang defer style return alteration
[09:53:35] norc: asm>> begin; a; rescue; ensure; b; end
[09:53:36] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/585089
[09:53:49] norc: Bish: there your catch table has a rescue symbol.
[09:54:04] norc: (And yes exceptions essentially use catch/throw under the hood)
[09:54:08] alfiemax: has joined #ruby
[09:56:00] Bish: ensure doesn't seem to change the return value :/
[09:56:36] Bish: wait, will ensure not be executed if there is no error?
[09:56:44] Bish: what is actually the noun for something raised
[09:56:50] lupine: ensure is always executed
[09:56:55] norc: lupine: woah! The interaction between return and ensure is quite interesting.
[09:56:58] norc: lupine: yes it is.
[09:57:00] lupine: if you want to catch a raise error, you use rescue
[09:57:14] Bish: well so if i do ensure; "hi"; end; "hi" will always be the return value?
[09:57:19] Bish: since that doesn't seem to work for me
[09:57:19] lupine: unlike ensure, rescue *can* alter the return value
[09:57:24] lupine: Bish: ensure doesn't alter the return value
[09:57:31] lupine: that's what the code snippets above were showing
[09:57:36] isxek: has joined #ruby
[09:57:37] norc: Bish: the return value is the last expression from the regular block.
[09:57:46] norc: Bish: Unless your ensure block invokes an explicit return.
[09:57:58] Bish: that sucks :/
[09:58:00] giz|work: has joined #ruby
[09:58:04] norc: Bish: it is actually awesome.
[09:58:16] lupine: begin ; 1 ; ensure ; return 2 ; end => LocalJumpError: unexpected return
[09:58:21] lupine: not universally applicable ^^
[09:58:30] lupine: just... don't try to rely on this
[09:58:32] Bish: well a block doesn't have return
[09:58:34] norc: lupine: you are probably trying to do this in a block.
[09:58:41] norc: >> Class.new { def f; 23; ensure; return 42; end; }.new.f
[09:58:42] ruby[bot]: norc: # => 42 (https://eval.in/585093)
[09:58:52] lupine: sure, my point was that it's not universally applicable
[09:59:08] norc: lupine: the point is you are trying to use return in a block. It is universally applicable. :p
[09:59:31] lupine: except for where it isn't, it is
[09:59:50] Bish: well i am overloading a sequel method "add_recipient"
[10:00:00] ruid: has joined #ruby
[10:00:05] flashpoint9: has joined #ruby
[10:00:16] Bish: so i did "ret = super; doStuffThatMaybeRaisesError; ensure ret; end;"
[10:00:25] Bish: i wanted ensure to make SURE ret is returned
[10:00:40] norc: lupine: Im not sure what your point is.
[10:00:42] Bish: sure i can do ensure return ret; but thats ugly isn#t it
[10:01:02] norc: lupine: if you want to return from this, use lambda.
[10:01:10] norc: >> lambda{ return 1 }.call
[10:01:11] ruby[bot]: norc: # => 1 (https://eval.in/585095)
[10:01:46] Bish: norc: why is the last expression of rescue chaning the return value
[10:02:05] norc: Bish: because rescue is part of normal execution flow.
[10:02:14] Bish: and ensure isn't why?
[10:02:33] lupine: Bish: you want rescue, not ensure, for that
[10:02:35] norc: Bish: because its special.
[10:02:38] senayar: has joined #ruby
[10:02:38] senayar: has joined #ruby
[10:02:43] Bish: i can't see the use case for ensure
[10:02:50] norc: Bish: release resources
[10:03:08] norc: Bish: say you open a file descriptor, in your ensure block you could release it no matter whether an exception is thrown.
[10:03:08] lupine: its use case is stuff like: def foo ; x = File.new( ... ) ; ensure ; x.close ; end
[10:03:14] Bish: but i end up writing my return value multiple times
[10:03:25] Bish: otherwise
[10:03:26] norc: Bish: no. the ensure is not for return values.
[10:03:29] kyrose: has joined #ruby
[10:03:30] norc: Bish: it is for clean up code.
[10:03:33] mdw: has joined #ruby
[10:03:34] lupine: what you're looking for is x = begin ; doAThing ; rescue ; defaultValue ; end
[10:03:45] Bish: yeah i understand but otherwise i am writing it multiple times
[10:03:48] Bish: that's not DRY isn't it
[10:03:52] norc: Bish: what?
[10:04:21] Bish: def something; ret = super; doStuff; ret; end;
[10:04:36] Bish: if doStuff raises an error, how do i still make sure "ret" is the return value of the method
[10:05:02] Bish: def something; ret = super; doStuff; ensure; ret; end; <= would be beautiful, wouldn't it?
[10:05:44] norc: Bish: you can use an explicit return in ensure.
[10:06:02] norc: >> lambda{begin; ensure; return 1; end}.call
[10:06:03] ruby[bot]: norc: # => 1 (https://eval.in/585097)
[10:06:03] Bish: yeah and that does look stupid :p
[10:06:10] soLucien: is there RVM for Windows
[10:06:13] norc: Bish: it is quite explicit about what you want to do.
[10:06:16] soLucien: without cygwin?
[10:06:17] gregf: has joined #ruby
[10:06:19] norc: Bish: You want to "ensure that you return a value"
[10:06:19] soLucien: or some alternatice?
[10:06:27] soLucien: alternative
[10:06:30] ddv: soLucien: use a nix for rails development
[10:06:30] kyrose: Hi guys, how can I call a system command directly without system method or using ``. Is there an alternative?
[10:06:33] Bish: norc: is it considered clean?
[10:06:50] Bish: soLucien: to windows? yeah :p
[10:07:05] shevy: kyrose popen probably
[10:07:06] norc: Bish: https://gist.github.com/anonymous/d2bfc97ca2d7c626bcaafde3c0d0c769
[10:07:08] norc: Bish: how is that not?
[10:07:09] soLucien: ddv it is not possible, as i am writing a windows-specific tool
[10:07:14] ddv: soLucien: oh
[10:07:34] Bish: norc: but occuring errors will be caught, and invisible, right?
[10:07:38] kyrose: shevy: thanks. Googling only giving the `` quote and system method.
[10:08:02] soLucien: so is there any rvm-like software that i can use to manage runtimes on Windows ?
[10:08:23] lightt: has joined #ruby
[10:08:33] norc: Bish: You cant have both buddy.
[10:08:35] soLucien: if there isn't i will simply use the system version. I have no other ruby applications
[10:08:45] Bish: norc: well, im asking out of curiousity
[10:08:54] Bish: soLucien: for developement or production?
[10:09:00] soLucien: development
[10:09:09] duoi: has joined #ruby
[10:09:12] norc: Bish: https://gist.github.com/anonymous/c31cb92da7d636615b951b7fcad88e78
[10:09:16] Bish: have you considered docker? might be overkill, but it would integrate seemingly i think
[10:09:16] norc: Bish: That is quite clean too.
[10:09:32] norc: soLucien: if you are serious about developing under windows, use docker indeed.
[10:09:42] Bish: soLucien: i don't think something like that exists
[10:09:43] kyrose: I honestly think Ruby is good enough to do development on Windows, unless you *heavily* using gems.
[10:09:53] norc: kyrose: or use threads
[10:10:07] Bish: threads suck either way on ruby :p i thought we were d'accor on that by now
[10:10:17] norc: Bish: they are fine for I/O stuff...
[10:10:28] norc: Which is a huge portion of what threads are commonly used for.
[10:10:32] soLucien: i am developing a Vagrant plugin, and i need to do this https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-Source
[10:10:35] Bish: not if the I/O stuff is so heavy that it needs 100% cpu :)
[10:10:48] norc: Bish: that statement made absolutely no sense.
[10:10:51] kyrose: I will use Jruby on windows, since I can access the huge Java library
[10:11:25] norc: kyrose: Sounds like a good plan. :)
[10:11:26] Bish: well not absolutely but not much :D
[10:13:15] norc: Bish: plus most of the time people really just need concurrency, not parallelism.
[10:13:21] norc: Which is why the issue about the GVL is not that huge.
[10:14:27] norc: If whatever you are doing is so CPU intensive that you need thread parallelism, Ruby is probably the wrong language to begin with.
[10:14:40] Bish: for me it is
[10:15:27] kyrose: I would try Dlang, C, C++ or even the 'not so new' Golang for concurrency. It's goroutines is awesome.
[10:16:03] soLucien: c# is also quite good
[10:16:07] soLucien: supports async-await
[10:16:34] Bish: i tried c#, i never felt so betrayed, because monodevelop actually looked good
[10:16:43] kyrose: true, if you're on windows. I'm currently on linux, using mono on linux that using .net is weird.
[10:17:18] mdw: has joined #ruby
[10:18:08] soLucien: i believe Microsoft made the CLR open source , and compatible with linux
[10:18:17] Bish: c# sucks is either way
[10:18:27] Bish: that's what i meant by betrayed
[10:18:50] soLucien: i am very biased.
[10:19:01] Bish: i usually start by writing a socket program, like a chatserver
[10:19:26] Bish: 1. look at me, im c#, i call methods like java, but with capital letter to begin with
[10:19:29] Bish: .WhatTheFuck
[10:19:42] soLucien: you can call methods whatever you want
[10:19:53] soLucien: irrelevant *
[10:19:55] Bish: 2. i have to create 5 objects to make a socket connection <= broken
[10:20:01] kyrose: Hey please, don't start a flamewar.
[10:20:40] Bish: ACTION goes eating either way, but he hopes he can see sharp!
[10:21:06] soLucien: Bish it depends on the level of abstraction you want to use
[10:21:17] soLucien: i am sure there's someone somewhere on github
[10:21:32] kyrose: hey soLucien, are you on Windows?
[10:21:33] norc: ?offtopic
[10:21:33] ruby[bot]: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[10:21:38] soLucien: who has created a SocketConnection.cs that you can use
[10:21:52] Bish: it depends if you are a f** masochist
[10:22:06] Bish: im out :D sorry
[10:22:14] nando293921: has joined #ruby
[10:22:33] kyrose: soLucien, how you experience with Ruby? I didn't touch Windows like almost 2-3 years already.
[10:22:37] soLucien: enjoy your meal
[10:22:42] AlexRussia: has joined #ruby
[10:22:53] soLucien: horrible, kyrose ..
[10:23:10] soLucien: i haven't tried Docker yet
[10:23:13] nankyokusei: has joined #ruby
[10:23:23] soLucien: but the win support is very bad
[10:23:47] norc: soLucien: The main problem with Windows is native extensions really.
[10:23:54] kyrose: soLucien, the container? and yes, I always see complaints on ruby from windows users.
[10:24:18] norc: Aside from threads Ruby core runs just fine on Windows.
[10:24:22] soLucien: yes, at some point you have to interact with the OS, and i think it uses mingw
[10:24:40] norc: soLucien: Hah it is quite awesome that you can call the Win32 API from Ruby.. natively.
[10:24:47] norc: Without any gems or extensions!
[10:24:57] norc: That is one of the upsides.
[10:25:32] soLucien: i like strongly typed things ..
[10:25:34] kyrose: norc, is ruby-inline, rice, or ffi supported on Windows? It could be easy for the users on that platform to access some Windows API.
[10:25:55] shevy: I thought ffi would be?
[10:26:22] shevy: https://github.com/ffi/ffi/wiki/Windows-Examples
[10:26:36] kyrose: Oh yeah, ty
[10:26:55] shevy: lots of details of those APIs :(
[10:27:06] shevy: attach_function :keybd_event, [ :uchar, :uchar, :int, :pointer ], :void
[10:27:41] nerium: has joined #ruby
[10:27:54] kyrose: it's detailed indeed
[10:28:03] marr: has joined #ruby
[10:28:11] soLucien: this is too low level i think
[10:28:20] soLucien: it's cool that you can use this API
[10:28:45] norc: kyrose: Though the original https://github.com/cosmo0920/win32-api is far more useful.
[10:28:53] kyrose: [ :uchar, :uchar, :int, :pointer ], :void <- I don't really understand that. Is this equal to void someFunction(uchar arg1, uchar arg2, int arg3, ?)
[10:29:10] shevy: yeah... reminds me of ruby-gnome. I like it, I use it a lot, but it also is very much a 1:1 mapping... which is not always bad, I can google for C gtk and get results :D but it's not "ideal ruby" ... things such as gtk_window_new(); in C because Gtk::Window.new ... that's about it
[10:29:39] kyrose: ruby gnome is fun, and that ruby gtk2,gtk3 is actively developing in Github
[10:29:50] lightt: has joined #ruby
[10:29:56] soLucien: .NET has a lot nicer classes built on top of these
[10:30:26] kyrose: but .NET on Linux for GUI is not that great however. I really wanted to use it on Linux.
[10:30:26] pLaToOn: has joined #ruby
[10:31:02] soLucien: i don't think it actually works on linux .. or it's a very old version
[10:31:28] wimplash: has joined #ruby
[10:31:39] kyrose: .NET works, for most classes I believe.
[10:31:56] kyrose: Hey, talking about Windows, you tried IronRuby yet?
[10:32:08] soLucien: no, heard it's dead
[10:32:10] soLucien: i wanted to
[10:32:47] charliesome: has joined #ruby
[10:33:00] soLucien: March 13, 2011
[10:33:00] soLucien: IronRuby 1.1.3 is released.
[10:33:10] soLucien: that stopped me
[10:33:11] karmatr0n: has joined #ruby
[10:33:16] soLucien: from trying it out
[10:33:37] troulouliou_div2: his what is the recommended virtual environment for ruby : rvm or rbenv ?
[10:33:47] kyrose: I prefer rvm
[10:34:35] ruid: has joined #ruby
[10:34:35] ruid: has joined #ruby
[10:34:51] troulouliou_div2: kyrose, yes using that one since ages too but i m facing a boring issue here ruby 2.2.2 won't compil due to openssl api changes and i only find how to patch wirh rbenv :)
[10:35:28] kyrose: soLucien, I don't know about .NET on Windows as much as you do, but I believe IronRuby use current .NET (installed) as the library.
[10:35:46] kyrose: Maybe, it's same as Jruby (using installed JRE)
[10:36:28] kyrose: but I could be wrong.
[10:37:15] emilkarl: has joined #ruby
[10:37:53] blockchan: has joined #ruby
[10:38:08] harfangk: has joined #ruby
[10:39:00] nadir: has joined #ruby
[10:39:24] kyrose: Omg, Python and Ruby implementations are funny somehow. While JRuby is actively in development, Jython release now slower, and got a lot of bugs, while IronPython is active, IronRuby now is 'quiet' for a while.
[10:39:51] jtkovf: has joined #ruby
[10:40:54] fergal: has joined #ruby
[10:41:51] fergal: hi guys, if i have “x=2”, how can i write a regex to match that x is either 0 or 2?
[10:42:08] nerium: has joined #ruby
[10:42:18] fergal: do i need to convert x to a string before matching?
[10:44:14] joonty: has joined #ruby
[10:44:43] arlek: has joined #ruby
[10:45:55] tlaxkit: has joined #ruby
[10:46:21] jhass: fergal: why do you want to use a regex for this?
[10:46:31] kyrose: fergal: will this do ? /2/ =~ x.to_s
[10:46:48] fergal: jhass: it’s a simplified version of a bigger problem
[10:47:00] jhass: fergal: then elaborate on the bigger problem
[10:47:02] ruby[bot]: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[10:47:16] jhass: fergal: don't use apply kyrose's suggestion
[10:48:22] kyrose: then how to properly regex it. If it's heavy looping and conditionals, I might understand.
[10:48:29] fergal: kyrose: to_s was what i went with in the end, is it absolutely necessary to use to_s before trying to match against integers?
[10:49:02] tesuji: has joined #ruby
[10:49:23] jhass: fergal: the desire to match integers with regex indicates a heavy design failure tbh
[10:50:21] kyrose: jhass is right. For simple thing, use if else, case, when is more favorable.
[10:51:53] aries_liuxueyang: has joined #ruby
[10:53:04] certainty: has joined #ruby
[10:53:30] LoneHerm_: has joined #ruby
[10:54:27] kyrose: hey jhass, is there any tutorial on Ruby regex? I wanted to learn it thoroughly. The ruby-doc site did show you the way to use regex, however, is there any other source, that I can learn from? I'm using heavy system callbacks and a lot of text-to-file formatting. Really don't want to use awk just for this.
[10:55:11] jhass: Regexp's documentation is pretty throughout, I think it mentions about every feature
[10:55:37] jhass: mmh, except for possessive quantifiers and atomic groups probably
[10:56:12] jhass: ah atomic groups are there
[10:56:19] soLucien: kyrose what do you mean ruby regexp ?
[10:56:28] soLucien: isn't it the same as any other regexp ?
[10:56:42] kyrose: soLucien, almost similar to Perl 5 regex
[10:56:42] apeiros: soLucien: haha
[10:56:52] apeiros: soLucien: that's the innocent beginnings :D
[10:56:56] jhass: and possessive quantifiers are mentioned under repetition
[10:57:03] apeiros: soLucien: no, regex engines differ wildly
[10:57:11] soLucien: syntactically
[10:57:27] kyrose: jhass: I see
[10:57:34] jhass: kyrose: http://www.regular-expressions.info/ is a good general resource that's more verbose in the examples and usecases
[10:57:42] jhass: and has the Ruby specifics incorporated
[10:57:43] apeiros: soLucien: syntactically and also semantically
[10:57:52] jmignault: has joined #ruby
[10:57:53] kyrose: thanks jhass
[10:58:12] jhass: kyrose: and for some general brain teasing https://regexcrossword.com/ is fun ;)
[10:58:26] soLucien: hmm what can it semantically do different than regular expressions ?
[10:58:33] soLucien: can it parse context-free grammars ?
[10:58:38] apeiros: "different than"? makes no sense
[10:58:50] apeiros: semantically different means same regex does something different
[10:58:56] apeiros: example: \w
[10:59:00] johnDoe111: has joined #ruby
[10:59:17] kyrose: hey jhass: ty so much
[10:59:19] jhass: soLucien: simple example, Ruby's ^ $ and . and /m behave differently than most other engines
[10:59:29] apeiros: and yes, I think perl's regex engine can. but that'd be because it has additional syntax, not different semantics.
[10:59:33] kyrose: bookmarked it
[10:59:35] chussenot: has joined #ruby
[10:59:47] soLucien: that's synthax .. you write \w but you can find a 1 to 1 mapping to other regexes
[10:59:58] apeiros: soLucien: no
[10:59:59] soLucien: semantics means you are able to do more things with it
[11:00:13] apeiros: you should probably consult a dictionary.
[11:00:26] TheHodge: has joined #ruby
[11:00:27] kyrose: I believe semantic means "what it will do".
[11:00:29] madgen: has joined #ruby
[11:00:34] johnDoe111: has joined #ruby
[11:00:35] kyrose: or "what it means".
[11:00:41] apeiros: semantics: the meaning of something. so what \w *means* is *semantical*
[11:01:05] apeiros: not syntactical. syntactical is that you use \<char> as escape sequence
[11:01:09] soLucien: ok, you are probably right
[11:01:11] Hyuk: has joined #ruby
[11:01:38] kyrose: say on linux, this is semantically same:
[11:01:47] mdw: has joined #ruby
[11:02:20] rodfersou: has joined #ruby
[11:02:55] kyrose: sed: 's/word_target/after_changed/g' file and perl5 's/word_target/after_chaned/g' file . However, not every languages do the same semantic with same syntaxes.
[11:04:10] Hyuk: has joined #ruby
[11:04:24] soLucien: yes you are right
[11:06:23] Pumukel: has joined #ruby
[11:06:38] CloCkWeRX: has joined #ruby
[11:07:14] kyrose: soLucien, do you use Ruby for fun or you really using it for sysadmin/development/website?
[11:07:38] soLucien: i use it for Vagrant and Puppet
[11:07:57] soLucien: can't say i like it too much, but i have no other options
[11:09:22] kyrose: can I ask a quick question if you don't mind, what is puppet used for? Till today, I still don't really understand about DevOps.
[11:09:48] lupine: configuration management
[11:10:24] lupine: you have N servers, you want them to be set up in a certain way, so you write puppet recipes to declare how they should be set up
[11:10:30] soLucien: you use puppet to bring a machine to a desired configuration in an unattended way
[11:10:33] lupine: puppet then tries to run them, fails, blows up and destroys everything
[11:10:38] johnDoe111: has joined #ruby
[11:10:50] blackmesa: has joined #ruby
[11:10:59] bobix: has joined #ruby
[11:11:03] soLucien: lupine you test the things first in your VM lab
[11:11:04] lupine: and then they release a new version that doesn't run any of your old recipes
[11:11:08] sandstrom: has joined #ruby
[11:11:25] lupine: if you persist in trying to use it even after that, they send a specialist hitman round to stop you
[11:11:25] soLucien: yes that is true
[11:11:35] kyrose: lupine, what makes it better than writing script for the server in non dsl.
[11:11:55] toretore: has joined #ruby
[11:12:06] lupine: kyrose: the general principle of configuration management is excellent and easy to justify
[11:12:10] lupine: puppet's implementation of it is not
[11:12:19] soLucien: lupine which one is ?
[11:12:37] lupine: ansible is probably the one I have least beef with
[11:12:46] lupine: haven't used chef in any capacity
[11:13:35] lupine: it all boils down to running scripts on servers, of course
[11:13:53] lupine: for large fleets you want golden images rather than this kind of thing, IMO
[11:13:54] soLucien: i have not used either Chef or Ansible, so i cannot tell anything about it
[11:14:17] soLucien: what i can say is that Ansible has very little support with Vagrant
[11:14:19] lupine: (by large, I guess I mean n > 50 or so)
[11:14:21] madgen_: has joined #ruby
[11:14:43] Vingador: has joined #ruby
[11:14:51] lupine: eh, I've successfully used ansible with vagrant to provision 10-machine setups before for testing stuff
[11:14:55] davedev24: has joined #ruby
[11:15:05] lupine: it seemed featureful and good, but I haven't touched much vagrant generally
[11:15:12] soLucien: ok, they are working on it, but it's experimental
[11:15:46] soLucien: i am sure ansible is better
[11:15:47] lupine: it's just "write this inventory file, run this binary"
[11:15:51] soLucien: after all, it's Python
[11:17:35] soLucien: lupine i actually agree with you, it takes a huge effort to learn puppet
[11:17:44] soLucien: and some of the things are like WTF
[11:17:51] k3rn31: has joined #ruby
[11:18:05] soLucien: they create like 13123 different kinds of abstractions
[11:18:10] lupine: the idea of it being a declarative language is a really good one, it's exactly what you need for configuration management
[11:18:18] lupine: they just didn't do a very good job
[11:18:28] soLucien: it's like they started off with something
[11:18:33] soLucien: then they realized they have issues
[11:18:39] soLucien: so they introduced new stuff to it
[11:18:49] soLucien: seems like they were simply putting off fires
[11:18:52] lupine: asterisk has similar trouble
[11:19:00] lupine: it has maybe 3? 4? complete configuration languages
[11:19:04] Ropeney_: has joined #ruby
[11:19:09] soLucien: and ended up with 6 different programs
[11:19:25] soLucien: puppet, facter, hiera, filebucket
[11:19:28] soLucien: puppet-master
[11:19:29] lupine: sometimes a bit of upfront design goes a long way
[11:19:37] soLucien: and 3242343 things i have not read about
[11:20:08] soLucien: oh. we have a problem. let's add caching to it
[11:20:25] soLucien: oh. we added caching. now we need to fix cache invalidation issues
[11:21:09] soLucien: oh. let's fix cache invalidation. let's make nodes talk to each other .
[11:21:24] soLucien: oh. nodes need to talk to each other. let's write a protocol for that
[11:21:34] soLucien: and it goes on forever
[11:21:44] soLucien: they keep adding stuff to the stack .. as you said
[11:21:54] soLucien: the hitman is coming for you
[11:22:17] johnDoe111: has joined #ruby
[11:22:33] kknight: has joined #ruby
[11:22:43] kyrose: I'm don't really know about these DevOps since at the moment I don't need to use it, but maybe, in the future I'll try it.
[11:23:01] flashpoint9: has joined #ruby
[11:23:22] soLucien: i'm not into it either, but someone has to do it in my organization, and it ended up being me
[11:23:39] millerti: has joined #ruby
[11:23:42] kyrose: OH! I got 'apt-get install puppet'. Gonna try it now haha.
[11:23:52] soLucien: the alternative is spending half the time configuring VMs and servers manually
[11:24:06] sepp2k: has joined #ruby
[11:24:16] LaT0rtue: has joined #ruby
[11:24:21] kyrose: soLucien, hmm, what the project/org about?
[11:24:22] soLucien: the other half writing code
[11:24:35] certainty: has joined #ruby
[11:24:39] kyrose: is it for Open source, or for commercial?
[11:24:59] soLucien: my current project is oss , but it's for a commercial task
[11:25:01] kyrose: you remind me to that fun cloud9.io with docker.
[11:25:13] kyrose: soLucien, I see.
[11:25:35] soLucien: once i finish it, i will release it as a Vagrant/puppet plugin
[11:25:41] soLucien: but the task i have to solve relies on it
[11:26:17] itguru: has joined #ruby
[11:26:56] kyrose: good luck on your task friend.
[11:27:06] kyrose: May Ruby force be with you.
[11:27:20] chussenot: has joined #ruby
[11:30:08] mtkd: has joined #ruby
[11:30:27] johnDoe111: has joined #ruby
[11:30:51] johnDoe111: has joined #ruby
[11:31:53] ByronJohnson: has joined #ruby
[11:32:17] k3rn31: has joined #ruby
[11:32:25] emilkarl: has joined #ruby
[11:34:36] madgen: has joined #ruby
[11:36:43] Fuzai: has joined #ruby
[11:37:45] ldnunes: has joined #ruby
[11:39:00] last_staff1: has joined #ruby
[11:39:49] senayar: has joined #ruby
[11:39:51] snowy: has joined #ruby
[11:42:15] achamian: has joined #ruby
[11:42:49] mdw7: has joined #ruby
[11:43:07] johnDoe111^: has joined #ruby
[11:44:19] duoi: has joined #ruby
[11:44:35] phredus: has joined #ruby
[11:45:06] senayar: has joined #ruby
[11:45:06] senayar: has joined #ruby
[11:45:25] dionysus69: has joined #ruby
[11:45:41] johnDoe111^: has joined #ruby
[11:50:17] johnmilton: has joined #ruby
[11:50:19] sdothum: has joined #ruby
[11:50:42] kgrz: has joined #ruby
[11:52:46] kyrose: has joined #ruby
[11:55:26] Hanmac: has joined #ruby
[11:55:39] jrafanie: has joined #ruby
[11:55:55] Macaveli: has joined #ruby
[11:56:02] Yiota: has joined #ruby
[11:56:19] Wolland: has joined #ruby
[11:56:32] itguru1: has joined #ruby
[11:56:38] madgen_: has joined #ruby
[11:56:49] emilkarl: has joined #ruby
[11:57:40] itguru1: has joined #ruby
[11:59:23] joonty: has joined #ruby
[12:00:40] gregf: has joined #ruby
[12:00:54] chouhoulis: has joined #ruby
[12:01:38] pierrehoudyer: has joined #ruby
[12:03:13] gregf: has joined #ruby
[12:03:40] ruid: has joined #ruby
[12:04:41] roamingdog: has joined #ruby
[12:04:55] kedare1: has joined #ruby
[12:06:26] bobix: has joined #ruby
[12:08:08] johnDoe111: has joined #ruby
[12:08:51] CloCkWeRX: has joined #ruby
[12:09:57] zeroDi: has joined #ruby
[12:12:33] rubyhatesme: has joined #ruby
[12:12:48] johnDoe111^: has joined #ruby
[12:12:57] kyrose: has joined #ruby
[12:13:29] synthroid: has joined #ruby
[12:13:49] bobix: has joined #ruby
[12:15:13] araujo_: has joined #ruby
[12:16:30] ElFerna: has joined #ruby
[12:17:49] araujo_: has joined #ruby
[12:19:09] nando293921: has joined #ruby
[12:20:09] bkxd: has joined #ruby
[12:24:03] nankyokusei: has joined #ruby
[12:24:34] AlexRussia: has joined #ruby
[12:26:45] Yiota: has joined #ruby
[12:27:40] gheegh: has joined #ruby
[12:27:48] flashpoint9: has joined #ruby
[12:29:14] harfangk: has joined #ruby
[12:30:56] edwinvdgraaf: has joined #ruby
[12:31:26] k3dare: has joined #ruby
[12:32:34] madgen: has joined #ruby
[12:36:05] chussenot: has joined #ruby
[12:37:22] pLaToOn: has joined #ruby
[12:39:11] Ishido: has joined #ruby
[12:40:10] malconis: has joined #ruby
[12:41:00] tknz: has joined #ruby
[12:41:37] skade: has joined #ruby
[12:41:37] madgen_: has joined #ruby
[12:41:45] adaedra: ACTION runs
[12:41:52] LoneHermit: has joined #ruby
[12:42:06] bhaak: I'm confused about the behavior of Array.new with a block and Array.new(size, default). from the description it sounds as if it would behave similar to Hash.new
[12:42:19] certainty: has joined #ruby
[12:42:20] jhass: oh, not at all
[12:42:37] bhaak: but it seems only to take the default for initialisation
[12:42:49] emilkarl: has joined #ruby
[12:42:51] adaedra: >> a = Array.new(2, ""); b = Array.new(2) { "" }; a[0] << "a"; b[0] << "a"; [a, b]
[12:42:53] ruby[bot]: adaedra: # => [["a", "a"], ["a", ""]] (https://eval.in/585419)
[12:42:58] adaedra: here is the difference
[12:43:13] adaedra: with a parameter, it just copies the reference
[12:43:30] jhass: I don't think we arrived at the difference between block and non-block yet ...
[12:43:38] jhass: the question was comparing to Hash.new
[12:43:39] bhaak: that's the same gotcha as with Hash.new but I meant something else
[12:43:51] adaedra: "I'm confused about the behavior of Array.new with a block and Array.new(size, default)"
[12:44:05] jhass: okay, nvm
[12:44:06] bhaak: a = Array.new(2, 1) => [1, 1]; a[2] => nil
[12:44:08] jhass: ACTION grabs more food
[12:44:13] norc: jhass: bring me some too.
[12:44:29] jhass: ?cookie norc
[12:44:29] ruby[bot]: norc: here's your cookie: 🍪
[12:44:30] adaedra: bhaak: it's just used for initialization in both cases afaik.
[12:44:53] bhaak: yeah, that seems to be the case but that's unfortunate
[12:45:01] norc: Array::new with a block is one of these things I know about but rarely see out there.
[12:45:15] swills: has joined #ruby
[12:45:16] adaedra: People seems to prefer n.times.map
[12:46:15] jhass: ACTION doesn't
[12:46:20] elomatreb: I think it's a chicken/egg thing. People don't know what it does because they don't see it often and they don't use it often because they don't know that it does
[12:46:21] c355E3B: has joined #ruby
[12:46:44] norc: elomatreb: For most of my problems I never needed pre-initialized arrays.
[12:46:46] adaedra: Array.new(n) > n.times.map
[12:47:00] adaedra: But people may not know about Array.new :x
[12:47:03] norc: elomatreb: at least not with a dynamic initialization.
[12:47:22] certainty: has joined #ruby
[12:47:34] elomatreb: That's probably also true :)
[12:48:08] bhaak: I wanted it for tracking some counts without knowing what the maximal index would be
[12:48:12] nhhc: has joined #ruby
[12:48:42] adaedra: arrays are different to hashes because they fill the void on assignation
[12:48:43] bhaak: that's not 100% true though. i'm looking at unicode codepoints so the index is actually limited
[12:48:50] norc: elomatreb: Another thing is that I stopped using these compact forms of code that Ruby offers because it can easily lead to the Python effect.
[12:48:51] adaedra: >> a = [1]; a[10] = 2; a
[12:48:52] ruby[bot]: adaedra: # => [1, nil, nil, nil, nil, nil, nil, nil, nil, nil, 2] (https://eval.in/585424)
[12:49:04] norc: "assignation"
[12:49:09] norc: That is an amusing word adaedra. :o)
[12:49:11] madgen: has joined #ruby
[12:49:22] karmatr0n: has joined #ruby
[12:49:30] adaedra: norc: désolé
[12:49:40] adaedra: language, all of that
[12:49:42] elomatreb: norc: "The Python Effect" sounds like a bad horror movie
[12:49:55] bhaak: I haven't benchmarked it but I would have guessed that array access is faster in arrays than in hashes
[12:50:16] Skelz0r: has joined #ruby
[12:50:18] norc: elomatreb: Despite similarities the language was not based on the movie!
[12:51:02] norc: bhaak: Unless you have: a) written code that works, b) written tests, c) profiled your code, and d) determined that this code requires optimization, you should not talk about performance.
[12:51:13] rubyhatesme: anyone had any success using rubymine 2016 with ruby 1.8.7
[12:51:17] rubyhatesme: on a vagrant box
[12:52:02] adaedra: 1.8.7 is long time dead now, you're aware of that?
[12:52:44] norc: Not a single day goes by without someone asking about 1.8.x :)
[12:53:15] adaedra: Necromancy, so hot right now.
[12:53:16] jhass: perhaps we should direct all of them to their own club
[12:53:35] elomatreb: Is it still the version you get when you apt-get install ruby?
[12:53:36] jhass: #ruby-necromancers would indeed be a good channel name I guess
[12:53:44] jhass: elomatreb: rarely
[12:53:48] jhass: in oldoldstable
[12:53:51] adaedra: elomatreb: depend on your system.
[12:53:54] rubyhatesme: i know adaedra, but it's what this site uses
[12:53:56] rubyhatesme: and i need to debug it
[12:54:23] elomatreb: You should really switch away from that. It doesn't even get security support anymore
[12:54:37] rubyhatesme: rubymine keeps saying that there are gems that havent been downloaded/installed
[12:54:51] rubyhatesme: but i dont know why it keeps trying to install these gems when i dont have them in my gemfile
[12:55:13] jhass: because they're in your Gemfile.lock ?
[12:55:29] madgen_: has joined #ruby
[12:55:51] jhass: Gemfile is your wishlist, Gemfile.lock is computed from it and what's taken action from
[12:55:52] norc: Or perhaps as dependencies?
[12:55:52] bhaak: norc: yeah, that's why I explicitly said I haven't done any benchmarks. but arrays and hashes have different big O values so there should be a difference.
[12:56:17] rubyhatesme: yeah but they're not ;/
[12:56:27] pcboy: has joined #ruby
[12:56:30] norc: bhaak: Hash table access is O(1)
[12:56:36] norc: bhaak: How is that different from an Array?
[12:56:42] bhaak: only on average
[12:56:54] jhass: no, on worst case
[12:57:00] Wolland: has joined #ruby
[12:57:07] rubyhatesme: yeah, they're not in my gemlock
[12:57:10] jhass: the useful comparison here is only on actual times and memory complexity
[12:57:17] rubyhatesme: i dont get it, is it rubymine trying to add them
[12:57:29] bhaak: no, on worst case, hash is O(n)
[12:57:46] jhass: bhaak: say you actually need like 1% of the values of the available range, the question is whether the needed time to allocate the array is less than the overhead you spent computing the hash and iterating through the bucket
[12:57:46] bhaak: think of a hashing algorithm that puts every item on the same slot
[12:57:50] elomatreb: does the version of rubymine you're using maybe require default libraries that aren't there yet in 1.8.7?
[12:57:50] norc: jhass: bhaak is right.
[12:58:09] elomatreb: rubyhatesme: Can you give us some of the gems it's complaining about?
[12:58:32] norc: jhass: In worst case all your elements are in one bucket, so you are then forced to do a linear search, which is O(n).
[12:58:34] rubyhatesme: yeah, one called guard
[12:58:41] rubyhatesme: it's downloading gems again, damn it does this every time
[12:58:44] jhass: mh, right
[12:58:45] bhaak: jhass: yes. also in the case of ruby, the dynamic re-allocation of the array needs to be considered
[12:59:16] hutch34: has joined #ruby
[12:59:27] duoi: has joined #ruby
[12:59:38] elomatreb: rubyhatesme: guard is usually a development tool, production doesn't need that normally.
[12:59:42] norc: bhaak: but on the upside hash tables offer O(1) insertion, update, deletion.., while these operations are O(n) with an array.... on average.
[12:59:57] norc: bhaak: So if anything hash tables generally perform better than arrays at these tasks.
[13:00:11] banister: has joined #ruby
[13:00:27] rubyhatesme: elomatreb: this is to get rubymine debugger working on it
[13:00:49] pcboy: Hello guys. I have a small question. What's the ruby equivalent of pack("<Q", 0x7ffff7b9c0bf) in python? (gives back "\xbf\xc0\xb9\xf7\xff\x7f\x00\x00" in python)
[13:01:17] norc: bhaak: Though! If you had a cuckoo hash, then even worst case gives you O(1)
[13:01:34] elomatreb: rubyhatesme: OK, that explains that. Which version of guard is it trying to install?
[13:01:49] jhass: >> [0x7ffff7b9c0bf].pack("<Q") # pcboy
[13:01:50] ruby[bot]: jhass: # => "\xBF\xC0\xB9\xF7\xFF\x7F\x00\x00" (https://eval.in/585430)
[13:02:32] bhaak: norc: update should be O(1) as well. but I don't need the other tasks. if all you use is numbers, it's not obvious that a hash should be faster.
[13:02:43] pcboy: jhass: Of course, I was stupidly trying to do 0x7ffff7b9c0bf.pack("<Q") before!. Thank you! =D
[13:02:57] norc: bhaak: faster and complexity are not necessarily the same thing.
[13:03:23] dionysus69: has joined #ruby
[13:04:11] nando293921: has joined #ruby
[13:04:39] ChiefAlexander: has joined #ruby
[13:04:50] norc: bhaak: Interestingly, I even had a use case for cuckoo hashing when implementing a CORBA on a hard real time operating system.
[13:04:59] tAn: has joined #ruby
[13:05:04] ramortegui: has joined #ruby
[13:05:59] madgen: has joined #ruby
[13:06:49] bhaak: norc: implementing a CORBA? that sounds nasty
[13:07:01] benlieb: has joined #ruby
[13:07:02] norc: *A CORBA ORB
[13:07:38] bhaak: still nasty :)
[13:07:53] norc: It's actually quite nice.
[13:08:07] shevy: did not someone drop corba lately
[13:08:33] shevy: I can't remember anything from reddit for more than 2 days :(
[13:08:59] symm-: has joined #ruby
[13:09:00] norc: bhaak: The nasty part was doing some patches on the TCP stack..
[13:09:13] bhaak: I remember a long time ago when doing some internship, that I found out the hard way that the c++ corba implementation of a company wasn't able to talk to the java corba implementation of the same company ... m(
[13:09:29] norc: bhaak: then the implementation was corba conform.
[13:09:41] norc: The whole idea of CORBA is to provide interoperability.
[13:10:00] rubyhatesme: elomatreb: it's trying to install erm
[13:10:04] bhaak: sure, I know that, you know that, the company probably knew it as well
[13:10:19] rubyhatesme: it's still going with downloading gems
[13:10:25] bhaak: but when you have a product, you have to ship it!!!!111eleven
[13:10:27] rubyhatesme: damn, it does this every time.
[13:10:30] sandstrom: has joined #ruby
[13:10:42] aegis3121: has joined #ruby
[13:10:48] chouhoulis: has joined #ruby
[13:11:04] elomatreb: rubyhatesme: Can you maybe gist the output of your command?
[13:11:57] rubyhatesme: its' not a command, it's using rubymine debugger
[13:12:06] norc: bhaak: Hehe. Well the use case was pretty interesting since it was for a complex network of avionics systems running on different hardware, different firmware/operating systems - CORBA facilitated integrating a simple x86 computer to collect data. :)
[13:12:06] soc42: has joined #ruby
[13:12:12] rubyhatesme: i need to wait for it to finish doing it's download gems
[13:12:18] rubyhatesme: it does this everytime i open it up
[13:13:29] norc: bhaak: And since the OS was hard realtime, constant time operations were a must.
[13:13:30] elomatreb: People in this channel are always talking about their avionics system/other cool/complex stuff and I'm just sitting here writing CSS
[13:13:56] norc: bhaak: (Hard OS will just reset and reboot if you don't stay in your timeslots)
[13:14:04] norc: *Hard RT OS
[13:14:18] rubyhatesme: how do you debug ruby / rails apps elomatreb , are you on windows?
[13:14:21] shevy: elomatreb lol I shall add this to my epic quote collection
[13:14:34] millerti: has joined #ruby
[13:14:49] davedev24: has joined #ruby
[13:14:54] elomatreb: rubyhatesme: On Linux, sorry.
[13:14:56] norc: rubyhatesme: same way we would debug any application. with byebug and pry.
[13:15:06] norc: And error logs.
[13:15:11] elomatreb: Does byebug even work on 1.8.7?
[13:15:35] elomatreb: Also it's probably some dependency related error
[13:15:45] norc: elomatreb: No.
[13:15:49] norc: elomatreb: 2.0.0 is required.
[13:15:55] rubyhatesme: bah, also, what does named_scope in regards to named_scope :featured, :conditions => { :featured => true } mean
[13:15:59] shevy: rubyhatesme lol what kind of nick did you pick there
[13:16:02] bhaak: norc: was it obvious from the start that corba would not have too much overhead?
[13:16:14] Yiota: has joined #ruby
[13:16:20] bhaak: I mean, corba is also not the most lightweight protocol there is
[13:16:21] jhass: rubyhatesme: it calls the method called named_scopes
[13:16:30] norc: bhaak: CORBA is quite slim if you dont implement and use all the features.
[13:16:33] jhass: sans the s
[13:17:24] k3rn31: has joined #ruby
[13:18:30] norc: bhaak: Plus another factor was that we had the CORBA experience because it was used for important reasons in 2 other related projects.
[13:18:41] elomatreb: I just realized 1.8.7 doesn't even have the "new" hash syntax D:
[13:18:42] norc: So it was just a matter of learning VxWorks 653.
[13:19:04] jhass: elomatreb: wait till you realize what String#[] on 1.8 returns
[13:19:10] davedev24: has joined #ruby
[13:20:45] rubyhatesme: is it basically saying that where featured => true right?
[13:21:32] jhass: perhaps? this isn't #RubyOnRails, not that you mentioned your rails version anyway
[13:21:32] lupine: rubyhatesme: there's a #rubyonrails too, which might be helpful
[13:21:35] norc: jhass: Didn't it return the character code of the character on that position?
[13:21:53] jhass: norc: and that in turn probably was the justification for the ?a literal
[13:22:10] norc: jhass: Why is that?
[13:22:13] elomatreb: I just tried to install 1.8.7 using rvm and it won't even compile
[13:22:20] duckpuppy: has joined #ruby
[13:22:21] jhass: given it changed from codepoint to string literal too
[13:22:32] jhass: 18>> "foo"[0] == ?f
[13:22:33] ruby[bot]: jhass: # => true (https://eval.in/585475)
[13:22:38] jhass: 19>> "foo"[0] == ?f
[13:22:39] ruby[bot]: jhass: # => true (https://eval.in/585476)
[13:22:42] lupine: anyway, a named scope is an SQL query generator in activerecord. that one will generate a scope with the name featured with an SQL WHERE fragment like "... AND featured = 't'"
[13:23:07] tao_: has joined #ruby
[13:23:08] freerobby: has joined #ruby
[13:23:16] ponga: is 'on' reserved keyword in ruby, i see this in a few code example, but can not find what it actually is
[13:23:26] jhass: ponga: nope
[13:23:26] norc: ponga: no.
[13:23:46] ponga: then i guessed it right, its Cinch gem specific word then
[13:23:54] jhass: method even
[13:24:06] norc: ponga: If you want a list of keywords, refer to the source code, parse.y
[13:24:20] jhass: ponga: http://www.rubydoc.info/gems/cinch/Cinch/Bot#on-instance_method
[13:24:25] mdw: has joined #ruby
[13:24:40] ponga: jhass: you are always a winner friend
[13:25:10] mdw: has joined #ruby
[13:25:22] norc: ponga: https://github.com/ruby/ruby/blob/trunk/parse.y#L797-L845
[13:25:28] norc: ponga: Those are the keywords on Ruby (trunk)
[13:26:11] ponga: that's quite a small number of keywords
[13:26:29] fenre: has joined #ruby
[13:27:00] cdg: has joined #ruby
[13:27:01] norc: ponga: Actually, while I think the content is the same, this is the better place: https://github.com/ruby/ruby/blob/trunk/parse.y#L2022-L2033
[13:27:16] norc: (This is what the parser checks against)
[13:27:36] diegoviola: has joined #ruby
[13:28:10] elomatreb: My laptop really does not enjoy these large files on github :(
[13:28:18] acher: has joined #ruby
[13:28:45] glcx: has joined #ruby
[13:28:45] glcx: has joined #ruby
[13:28:49] jhass: right redo
[13:28:53] malconis: has joined #ruby
[13:28:55] jhass: always forget about that one
[13:28:59] jhass: anyone ever saw it used?
[13:29:11] lxsameer: has joined #ruby
[13:29:19] shevy: hmmm not that I can remember
[13:29:23] bhaak: only in tutorials
[13:29:25] shevy: I saw ensure... retry...
[13:29:49] axxyhtrx: has joined #ruby
[13:29:51] elomatreb: redo does the iteration again without checking the loop condition, right?
[13:30:15] karmatr0n: has joined #ruby
[13:30:20] jhass: I don't even remember
[13:30:44] jhass: btw there's http://ruby-doc.org/core-2.3.1/doc/keywords_rdoc.html too
[13:30:52] shevy: something to add to crystal!
[13:30:58] kgrz: has joined #ruby
[13:30:58] norc: jhass: I can assure you that probably less than 10 people in this channel even know about the flip flop operator in ruby.
[13:31:02] lupine: no no no no no no no
[13:31:14] jhass: http://ruby-doc.org/core-2.3.1/doc/syntax/control_expressions_rdoc.html#label-redo+Statement
[13:31:26] norc: jhass: and out of these probably only half know what it does exactly.
[13:31:49] jhass: flip flop probably has more usecases than redo though
[13:32:17] norc: jhass: A while ago someone pulled all gems on rubygems, and found a total of like 10 lines using flip flop.
[13:32:19] chussenot: has joined #ruby
[13:32:30] mdw: has joined #ruby
[13:32:40] norc: Some of which were actually not working properly.
[13:32:43] elomatreb: That looks really hard to read. I was constantly thinking it does something with ranges
[13:32:54] jhass: it's great how my last link only mentions using redo in a (while) loop and the keywords doc I linked before that only mentions redo in blocks
[13:33:01] norc: jhass: http://chrisseaton.com/rubytruffle/flip-flops/
[13:34:08] Axy: has joined #ruby
[13:34:43] harai: has joined #ruby
[13:36:03] pmyjavec: has joined #ruby
[13:36:05] shevy: the ruby documentation is a thing of beauty
[13:36:07] jhass: chrisseaton: ^ if you around do that analysis for redo please :P
[13:36:10] pawnbox: has joined #ruby
[13:36:44] madgen: has joined #ruby
[13:37:31] chrisseaton: jhass: I can easily grep for patterns in a couple of hours
[13:37:46] chrisseaton: Filtering false positives is the problem - comments, string literals, etc
[13:37:47] adaedra: norc: I do! In theory only, but I do! :D
[13:38:21] chrisseaton: jhass: redo is fairly common isn't it? I could manually look at all uses of flip-flops, but I couldn't make any sense of hundreds of thousands of redos
[13:39:40] fenre_: has joined #ruby
[13:40:08] dcluna: has joined #ruby
[13:40:53] fenre_: has joined #ruby
[13:40:58] jhass: chrisseaton: is it? I've only seen retry used in the code I've read so far, not a single redo
[13:41:11] jhass: that's basically what I'm wondering, if it's used at all
[13:41:19] mtkd: has joined #ruby
[13:41:25] pmyjavec: Hello all, if I have a collection of Sructs, how would I go about implementing functionality similar to a hash lookup? For instance Collection['alison'] would the Stuct with name = 'alison' ?
[13:41:56] norc: jhass: But there many lots of strings and comments containing the word "redo". I think he meant it would be a lot of work to filter those out.
[13:42:03] pmyjavec: my collection is just including enumerable now, maybe I should inherit struct though ?
[13:42:16] jhass: chrisseaton: ^\s*redo(?:\s|$) should be good enough
[13:42:38] jhass: might catch a few heredocs or multiline comments
[13:42:39] adaedra: pmyjavec: def [](name); find { |o| o.name == name }; end
[13:42:59] madgen: has joined #ruby
[13:43:31] pmyjavec: adaedra, ok, thank you
[13:43:37] norc: pmyjavec: Inheritance is for when you can say: "A car is a vehicle"
[13:43:53] norc: Just getting access to another classes methods is a bad reason to inherit.
[13:44:05] pmyjavec: Yup, you're totally right
[13:44:16] pmyjavec: just having built a collection for some time so little rusty
[13:44:33] pmyjavec: I would like my collection to act like a hash
[13:44:47] adaedra: defining [] is the way to go then
[13:44:52] pmyjavec: not necessarily be a type of hash
[13:44:56] adaedra: and []=, if you want to be writable
[13:44:56] lupine: inheritance is almost always a bad idea
[13:45:08] adaedra: it costs you a lot in taxes.
[13:45:56] pmyjavec: thanks a lot of the suggestions
[13:46:10] ekinmur: has joined #ruby
[13:47:10] alfiemax: has joined #ruby
[13:48:00] achamian: has joined #ruby
[13:48:28] aufi: has joined #ruby
[13:48:35] MrBusiness3: has joined #ruby
[13:49:29] omphe: has joined #ruby
[13:50:23] palms: has joined #ruby
[13:50:37] SMackMyBitchUp: has joined #ruby
[13:50:48] chrisseaton: jhass: I'll run that
[13:51:19] jhass: chrisseaton: I'm more interested in the real world uses anyhow, so if you catch me the first 10 that'd be nice already :)
[13:52:19] SMackMyBitchUp: Hello World, I'm working on a small TCP Socket Server-client thingy, but cant figureout how I can read a "timeout". I send a command to the server but sometimes it cant send a respond, how can I check if no respond arrive in x mSecs?
[13:53:25] certainty: has joined #ruby
[13:53:29] sergey_makagon: has joined #ruby
[13:53:47] Tristan-Speccy: has joined #ruby
[13:54:26] anisha: has joined #ruby
[13:54:50] toretore: SmackMyBitchUp: gist your code
[13:55:58] jhass: mmh, wth does @socket's read_timeout= come from? https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L911
[13:56:48] norc: jhass: https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L652 ?
[13:57:00] jhass: no, not the value, the method
[13:57:54] jhass: ah, https://github.com/ruby/ruby/blob/trunk/lib/net/protocol.rb#L73
[13:58:02] SMackMyBitchUp: @toretore https://gist.github.com/anonymous/4c957a4ee8a7577b841adfe6e82bab09
[13:58:26] chrisseaton: jhass: it's used a lot - first minute or so of output https://gist.github.com/chrisseaton/48629e162b42e48e7a233e4e989c139e
[13:58:52] toretore: SmackMyBitchUp: so you're writing a client, not a server?
[13:58:53] norc: jhass: https://github.com/ruby/ruby/blob/trunk/lib/net/protocol.rb#L73
[13:58:59] jhass: SmackMyBitchUp: so do http://devdocs.io/ruby~2.3/io#method-i-wait_readable before you read
[13:59:03] norc: I am too slow. Again.
[13:59:04] Wolland: has joined #ruby
[13:59:10] jhass: chrisseaton: mkay, thanks!
[13:59:22] chrisseaton: jhass: do you want the full list?
[13:59:31] jhass: nah, that's good, thanks
[14:01:32] Macaveli: has joined #ruby
[14:02:05] banister: has joined #ruby
[14:02:52] dionysus70: has joined #ruby
[14:02:55] jerematic: has joined #ruby
[14:03:03] maya-migo: has joined #ruby
[14:05:11] rodfersou: has joined #ruby
[14:05:57] JJM: has joined #ruby
[14:06:49] kgrz: has joined #ruby
[14:08:08] jhack: has joined #ruby
[14:09:33] jhack_: has joined #ruby
[14:12:06] kgrz: has joined #ruby
[14:13:16] symm-: has joined #ruby
[14:14:56] Infra-Red: has joined #ruby
[14:15:53] mostlybadfly: has joined #ruby
[14:16:12] araujo: has joined #ruby
[14:16:12] araujo: has joined #ruby
[14:17:54] pawnbox: has joined #ruby
[14:17:56] hutch34: has joined #ruby
[14:20:22] mistermocha: has joined #ruby
[14:22:57] kies: has joined #ruby
[14:23:57] helpa: has joined #ruby
[14:23:59] Vingador: has joined #ruby
[14:24:09] frem_: has joined #ruby
[14:24:12] JesseH: has joined #ruby
[14:24:53] nankyokusei: has joined #ruby
[14:25:15] certainty: has joined #ruby
[14:25:27] SilverKey: has joined #ruby
[14:25:33] harai: has joined #ruby
[14:25:43] last_staff: has joined #ruby
[14:27:45] CJKinni: has joined #ruby
[14:28:29] vondruch: has joined #ruby
[14:28:38] ChiefAlexander: has joined #ruby
[14:30:24] _Tristan-Speccy_: has joined #ruby
[14:31:16] tmtwd: has joined #ruby
[14:31:54] Yiota: has joined #ruby
[14:32:28] cschneid: has joined #ruby
[14:32:58] lxsameer: has joined #ruby
[14:33:17] hutch34: has joined #ruby
[14:33:37] chussenot: has joined #ruby
[14:34:21] swills: has joined #ruby
[14:35:10] terlar: has joined #ruby
[14:35:28] kaleido: has left #ruby: ()
[14:35:33] cschneid: has joined #ruby
[14:35:36] banister_: has joined #ruby
[14:36:01] eserror_: has joined #ruby
[14:36:36] agent_white: has joined #ruby
[14:36:56] aufi: has joined #ruby
[14:38:04] malconis: has joined #ruby
[14:38:37] fmcgeough: has joined #ruby
[14:38:54] shevy: we keep on getting funny nicks here today
[14:40:32] aufi: has joined #ruby
[14:42:52] babblebre: has joined #ruby
[14:42:58] polishdub: has joined #ruby
[14:43:51] harfangk: has joined #ruby
[14:43:56] rippa: has joined #ruby
[14:44:47] snath: has joined #ruby
[14:46:48] urbanmonk: has joined #ruby
[14:48:11] maya-migo: has joined #ruby
[14:48:39] duoi: has joined #ruby
[14:48:47] DacHoliday: has joined #ruby
[14:50:03] DacHoliday: Anyone here able to get Foundation's switches to work with a boolean on a Rails form?
[14:50:21] swills: has joined #ruby
[14:50:29] dopamean_: has joined #ruby
[14:50:56] ash_workz: has joined #ruby
[14:51:21] ash_workz: I need some guidance regarding installation
[14:51:59] toretore: ?rails DacHoliday
[14:51:59] ruby[bot]: DacHoliday: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[14:52:39] ash_workz: I am trying to correct my mentality of how to approach software installation on ubuntu
[14:52:51] DacHoliday: has left #ruby: ()
[14:53:55] ash_workz: so, I want to install jekyll, and it tells me it can't install because of some load error `/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)`
[14:54:12] shevy: you must solve the ubuntu problems in ubuntu
[14:54:16] ash_workz: so I looked it up, and most people say they solved it by installing ruby-dev
[14:54:32] shevy: yes the ubuntu guys add more work to you by removing mkmf by default
[14:55:05] sandstrom: has joined #ruby
[14:55:22] ash_workz: so I installed it and then it said, "you need ruby >= 2.0.0
[14:55:32] ash_workz: so I was like, hmm.... I upgraded the package already...
[14:56:03] shevy: you have to match the version ash_workz
[14:56:10] shevy: mkmf is part of ruby stdlib normally ruby-doc.org/stdlib/libdoc/mkmf/rdoc/MakeMakefile.html
[14:56:28] ash_workz: so I went to #ubuntu and someone found it in a snap by searching the software center (I think, they referred to it as the package manager, but then they also described a search box) for ruby and got a ruby2.0 hit
[14:56:42] SilverKey: has joined #ruby
[14:56:52] shevy: in my old days, I used something like "aptitude install ruby1.9.1-dev; apt-get install ruby-all-dev" but that has not been updated in years so it probably does not work
[14:57:01] shevy: (my alias that is)
[14:57:17] shevy: yeah then that is probably the name
[14:57:33] shevy: perhaps that one https://launchpad.net/ubuntu/trusty/+package/ruby2.0-dev
[14:57:55] ash_workz: firstly, that doesn't show up for me... I don't know why... when I look the *closest* thing I could see as a tip off was ruby2.0-tcltk
[14:58:20] ash_workz: secondly, I was thinking, "so, *should* I be searching the software center first?"
[14:58:34] ash_workz: anyway, that was not really helpful.
[14:59:19] ash_workz: so googling `ubuntu install ruby` yields a bunch of rails hits; inevitably they suggest rbenv...
[14:59:53] Wolland: has joined #ruby
[14:59:59] hxegon: ash_workz: you could try googling with '-rails' in the search to get rid of the rails results
[15:00:11] ash_workz: hxegon: I did, that was even worse
[15:00:38] shevy: I remember I did that too
[15:00:49] shevy: I got those two commands from some random blog
[15:00:57] shevy: or possibly two different blogs, actually
[15:00:57] JJM: has joined #ruby
[15:00:58] ash_workz: my point is
[15:01:02] ChiefAlexander: has joined #ruby
[15:01:20] SilverKey: has joined #ruby
[15:01:40] ash_workz: I am so tired of f-ing up my system because I followed some random ass advice on the internet because I haven't adopted some clearly necessary mentality for installing software
[15:02:38] d08z: has joined #ruby
[15:02:40] shevy: yes the #ubuntu philsophy
[15:02:56] ash_workz: when you go to the ruby-lang.org, the first thing for installing for ubuntu says: "If you cannot compile your own Ruby, and you do not want to use a third-party tool, you can use your system’s package manager to install Ruby." ...
[15:03:26] shevy: quite a daring comment from them
[15:03:30] ash_workz: which would subtly imply that you should use the package manager as a last resort
[15:03:38] hxegon: ash_workz: because you should
[15:03:46] d08z: hi, what would be the best way to "return object method value if the method exists else return a default value", something like puts x.blah() || "default" (if x has no "blah" method)
[15:04:14] shevy: ash_workz a big impetus for things such as rvm rbenv chruby and all these other thingies was because of people who run on problems with debian, centos and so forth
[15:04:52] hxegon: d08z: you could try rescueing NoMethodError
[15:05:07] hxegon: but there is probably a better way to do it
[15:05:18] d08z: hxegon: i should add "using only one line"
[15:05:19] jhack: has joined #ruby
[15:05:48] ash_workz: shevy: yes; when I was dealing with node I was getting frustrated as well; then I went to #Node.js and someone made it clear to just install nvm and let nvm handle it
[15:06:42] hxegon: >> begin; 1.blah; rescue NoMethodError; "default"; end # d08z
[15:06:43] ruby[bot]: hxegon: # => "default" (https://eval.in/585552)
[15:06:47] ash_workz: shevy: and so I did; and then I made the #bash guys crap their pants with the terrible code that I got from nvm
[15:07:08] ellisTAA: has joined #ruby
[15:07:08] d08z: hxegon: is there a more elegant way ala hash.fetch("x", "default_x")
[15:07:11] ash_workz: shevy: but that got me thinking... should I be first looking to install the defacto package manager?
[15:07:37] kgrz: has joined #ruby
[15:08:37] shevy: ash_workz dunno, if you know how to get things to work smoothly
[15:08:39] hxegon: >> defined? 1.blah ? 1.blah ? "default"
[15:08:40] ruby[bot]: hxegon: # => /tmp/execpad-97e036b1b086/source-97e036b1b086:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/585554)
[15:08:51] shevy: on the particular distribution
[15:09:05] shevy: if you would use arch then jhass could give you a happy link with a lot of information on how to get ruby to work on arch!
[15:09:16] hxegon: >> defined?(1.blah) ? 1.blah : "default" # d08z
[15:09:17] ruby[bot]: hxegon: # => "default" (https://eval.in/585555)
[15:09:42] jhass: shevy: s/ruby/multiple rubies/, a single one works fine out of the box
[15:09:49] d08z: hxegon: ok thanks
[15:09:52] shevy: yes that is even better
[15:09:55] ash_workz: shevy: I'm on 14.04... not sure exactly what archlinux is
[15:09:58] SilverKey: >> 1&.blah || "default"
[15:09:58] shevy: ash_workz multiple rubies!
[15:09:59] ruby[bot]: SilverKey: # => undefined method `blah' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/585556)
[15:10:35] shevy: ash_workz hanmac here actually use ubuntu too and the latest ruby... but perhaps from this brightbox packages orw hatever the name was
[15:11:44] ash_workz: I don't want to think that the best practice for installing particular software is at odds with the best practices for generally installing software
[15:11:54] chouhoulis: has joined #ruby
[15:12:13] spiette: has joined #ruby
[15:12:27] ash_workz: in any case hxegon mentioned that it's ideal (as implied by the installation page) to compile ruby
[15:12:28] shevy: well you should be able to get the particular ruby version to work that comes with 14.04
[15:13:00] shevy: http://packages.ubuntu.com/trusty/ruby2.0
[15:13:04] shevy: is that old.... yeah
[15:13:17] shevy: I begin to see the cycle that leads to chruby and rbenv and rvm!
[15:13:26] whiteline: has joined #ruby
[15:14:26] ash_workz: shevy: but not just that... I mean... granted, my first choice was not to look at the software center and just use apt
[15:15:42] hxegon: ash_workz: well, I meant it's ideal to use a ruby manager like rbenv, rvm, chruby, but it's still better IMO to compile ruby than use the package manager
[15:16:01] hxegon: ash_workz: https://stackoverflow.com/questions/16222738/how-do-i-install-ruby-2-0-0-correctly-on-ubuntu-12-04
[15:16:54] raeoks: has joined #ruby
[15:17:01] hxegon: use a different ruby version, but I think those commands will work otherwise
[15:17:15] havenwood: Nice that Brightbox maintains Ruby packages for Ubuntu: https://www.brightbox.com/docs/ruby/ubuntu/
[15:18:05] chopin: has joined #ruby
[15:18:20] griffindy: has joined #ruby
[15:18:30] pandaant: has joined #ruby
[15:19:46] ash_workz: hxegon: I hope you can appreciate my hesitation to take advice from stackoverflow
[15:20:12] ash_workz: hxegon: at least when it comes to getting software working
[15:21:04] aries_liuxueyang: has joined #ruby
[15:21:11] vondruch: has joined #ruby
[15:21:38] ash_workz: hxegon: the problem is that someone who gets it working by shoving things in places that weren't meant to have things shoved into them says gives their experience of how they did it and then the asker is all, "good enough for me"
[15:21:51] araujo: has joined #ruby
[15:21:51] araujo: has joined #ruby
[15:22:54] SilverKey: has joined #ruby
[15:22:57] jhack: has joined #ruby
[15:23:16] hxegon: I totally understand, just putting up a last resort type option. I would try havenwood's suggestion first ash_workz
[15:24:08] ash_workz: hxegon: yeah, it's better to have people endorse a github repo, but it's kind of only *after* that do I feel like that's an option
[15:24:10] hxegon: if there is a maintained version, and you seem to be hesitant to go with a manager, then that would probably be a better option. Didn't know there was a separately maintained source for ubuntu
[15:24:34] ash_workz: hxegon: oh, I'm not adverse to a manager
[15:24:37] ash_workz: hxegon: in fact
[15:24:43] tildes_: has joined #ruby
[15:24:57] ash_workz: hxegon: I am thinking about possibly adopting the mentality of looking for a manager *first*
[15:25:25] ash_workz: :: room gasps ::
[15:25:37] borodin: has joined #ruby
[15:25:41] ash_workz: at least for languages
[15:26:40] skweek: has joined #ruby
[15:26:57] ash_workz: that said; hxegon , shevy : what OSes are you on?
[15:27:19] hxegon: OS X, but I use rbenv so kind of a moot point
[15:27:36] ash_workz: hxegon: not at all
[15:27:48] ash_workz: s/(all)/\1 a moot point
[15:27:59] hxegon: also work on deb/ubuntu/arch vms and vpss
[15:28:28] tatsuo: has joined #ruby
[15:28:30] ash_workz: vms = VMs = virtual machine(s) ?
[15:28:46] hxegon: yeah, vpss = virtual personal servers
[15:28:57] ash_workz: vpss = VPSes = Virtual Private Server(s)?
[15:29:20] hxegon: wasn't quite sure how to pluralize that one
[15:29:32] shevy: ash_workz slackware right now
[15:29:54] ash_workz: yeah, I would do "es" since I would pronounce it "vee pee es iz"
[15:30:23] ash_workz: shevy: how long have you been on slackware? Also, what is slackware?
[15:31:04] al2o3-cr: slackware really
[15:31:24] aegis3121: has joined #ruby
[15:31:26] shevy: ash_workz perhaps 2 years or so. it is so old that it does not change everything all the time
[15:31:49] hxegon: shevy: is that a 'compile everything' distro?
[15:31:58] Tricon: has joined #ruby
[15:32:44] craigp: has joined #ruby
[15:33:53] shevy: hxegon hah sorta
[15:34:29] shevy: there are those slack packages http://www.slackpkg.org/
[15:34:40] shevy: it's like the archlinux of the old days!
[15:35:22] hxegon: I kind of miss reading aur comments
[15:35:48] hxegon: "200 days ago: FKSTAR says: "something broke, i'll fix it tonight.""
[15:35:50] shevy: ash_workz so many people are OSXers here
[15:36:45] ruby[bot]: -b *!*@178.169.87.12$#ruby-banned
[15:37:12] JohnBat26: has joined #ruby
[15:39:00] RobertBirnie: has joined #ruby
[15:39:02] TomyLobo: has joined #ruby
[15:39:23] tricon_: has joined #ruby
[15:40:27] tricon_: has joined #ruby
[15:41:51] ash_workz: any package manager recommends for ubuntu?
[15:42:06] toretore: has joined #ruby
[15:42:37] chouhoulis: has joined #ruby
[15:43:48] hobodave: has joined #ruby
[15:44:05] LoneHermit: has joined #ruby
[15:45:05] jancel: has joined #ruby
[15:45:47] yfeldblum: has joined #ruby
[15:46:56] hxegon: like recommended packages? sl, tree, ag
[15:47:23] kgrz: has joined #ruby
[15:49:17] synthroid: has joined #ruby
[15:49:35] diegoaguilar: has joined #ruby
[15:51:20] triangles: has joined #ruby
[15:52:11] Yiota: has joined #ruby
[15:52:28] amclain: has joined #ruby
[15:52:56] Yiota: has joined #ruby
[15:53:46] nocco: has joined #ruby
[15:54:38] vondruch: has joined #ruby
[15:55:19] kareeoleez: has joined #ruby
[15:56:25] noobsu: has joined #ruby
[15:56:40] kareeoleez: has joined #ruby
[15:57:31] aufi: has joined #ruby
[15:58:40] kith: has joined #ruby
[15:59:39] definiv: has joined #ruby
[16:00:34] Wolland: has joined #ruby
[16:01:52] definiv: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[16:02:36] phrozen77: has joined #ruby
[16:03:49] ash_workz: hxegon: I mean rbenv vs rvm vs chruby etc?
[16:04:15] havenwood: ash_workz: chruby is the simplest if you just want to switch between Rubies
[16:04:31] havenwood: ash_workz: If you don't need to switch between Rubies you don't need a Ruby switcher.
[16:04:51] ash_workz: havenwood: kinda want one that'll install various
[16:05:03] havenwood: ash_workz: ryan bigg ubuntu chruby
[16:05:11] havenwood: ash_workz: or rather: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you//
[16:05:29] ash_workz: havenwood: does that install rubies? or just change them?
[16:05:45] ash_workz: (like would I have to compile or use apt?
[16:05:54] havenwood: ash_workz: ruby-install installs Rubies
[16:06:00] havenwood: ash_workz: like: ruby-install --latest ruby
[16:06:00] weemsledeux: has joined #ruby
[16:06:06] havenwood: ash_workz: or: ruby-install --latest jruby
[16:06:31] Gasher: has joined #ruby
[16:06:37] Cohedrin: has joined #ruby
[16:06:38] ash_workz: does rvm cover that?
[16:06:48] havenwood: ash_workz: https://github.com/postmodern/ruby-install#readme
[16:07:03] RobertBirnie: has joined #ruby
[16:07:15] havenwood: ash_workz: RVM does that and much more. It's tens of thousands of lines of more shell.
[16:07:55] ash_workz: I suppose maybe it was a bad idea to go ahead an install rbenv already :\
[16:08:25] hxegon: ash_workz: rbenv can use ruby-build too
[16:08:39] havenwood: ash_workz: rm -rf `rbenv root`
[16:08:52] ash_workz: I don't know what the implication of that feature is
[16:09:43] hxegon: ash_workz: I mean you can use a plugin to install rub(ys,ies?,yies?)
[16:10:09] dionysus69: has joined #ruby
[16:10:30] havenwood: ash_workz: If you just want to install a single arbitrary Ruby, check if your package manager has it and if not use ruby-install.
[16:10:48] hxegon: ash_workz: but I've heard lots of praise for chruby, so you are in good hands eithere way IMO.
[16:10:56] tjbiddle: has joined #ruby
[16:11:05] havenwood: ash_workz: If you want to switch between Rubies with flexibility to choose package manager Rubies or those you've built yourself or installed with ruby-install, use chruby.
[16:11:56] hxegon: havenwood: do you dislike rbenv?
[16:12:32] havenwood: hxegon: I do. I don't like maintaining a garden of shims. But ruby-build bothers me more. Not installing package dependencies and shipping a standalone openssl irks me.
[16:13:08] havenwood: hxegon: I've seen folk multiple times not realize ruby-build needs to be updated to get a fresh openssl, assuming it's using an updated openssl package - but it's not!
[16:13:30] hxegon: ooh, that is kind of gross. chruby installs package deps?
[16:13:37] terminal_: has joined #ruby
[16:14:24] havenwood: hxegon: Yeah, ruby-install will install openssl with your package manager if it's missing or if it's already installed use the package manager version.
[16:14:46] havenwood: hxegon: But ruby-build ignores the package manager openssl, and ships its own. :O
[16:15:04] havenwood: hxegon: And doesn't install the other deps, so folk often have to rebuild after doing so manually.
[16:15:32] tjbiddle_: has joined #ruby
[16:15:33] djbkd: has joined #ruby
[16:15:36] havenwood: hxegon: It's easy to use ruby-install instead of ruby-build with rbenv, but yeah I prefer chruby.
[16:15:59] p337rB: has joined #ruby
[16:16:26] havenwood: hxegon: Unless you have a very strange shell, that's a time for shims.
[16:17:24] havenwood: There's a fish port of chruby but the csh/mksh branch has a few blockers to be merged. Most chruby users are on bash or zsh.
[16:17:49] kgrz: has joined #ruby
[16:18:06] havenwood: hxegon: Simplest thing that can possible work. :) This is the whole script: https://github.com/postmodern/chruby/blob/master/share/chruby/chruby.sh
[16:18:46] havenwood: hxegon: And for example, rbenv ships a C-ext replacement for a shell builtin, to deal with speed issues from the way they've done it.
[16:18:57] havenwood: Not nearly so simple. Simple made easy.
[16:19:24] havenwood: Also, I refuse to "groom" my environment. NO!
[16:19:35] fenre: has joined #ruby
[16:19:50] hxegon: you sound like a clojure dev ;) I'll check chruby out a bit more, see if I want to switch over
[16:19:54] havenwood: https://github.com/rbenv/rbenv/tree/master/src
[16:21:04] jhack: has joined #ruby
[16:21:40] jackjackdripper: has joined #ruby
[16:21:42] danostrowski: has joined #ruby
[16:21:49] terminal_: has joined #ruby
[16:22:03] mistermocha: has joined #ruby
[16:22:15] certainty: has joined #ruby
[16:22:40] nobitanobi: has joined #ruby
[16:22:48] mistermocha: has joined #ruby
[16:25:45] nankyokusei: has joined #ruby
[16:25:57] adgtl: has joined #ruby
[16:27:01] BTRE: has joined #ruby
[16:28:15] l3ck: has joined #ruby
[16:30:57] mistermocha: has joined #ruby
[16:36:24] pawnbox: has joined #ruby
[16:37:16] fenre: has joined #ruby
[16:37:41] [Butch]: has joined #ruby
[16:38:36] mistermocha: has joined #ruby
[16:39:22] ekinmur: has joined #ruby
[16:41:25] mleung: has joined #ruby
[16:41:29] [Butch]_: has joined #ruby
[16:41:43] phredus: has joined #ruby
[16:42:30] mistermocha: has joined #ruby
[16:43:03] SilverKey: has joined #ruby
[16:45:33] pilne: has joined #ruby
[16:45:45] flashpoint9: has joined #ruby
[16:46:26] sumobob: has joined #ruby
[16:47:36] whathappens: has joined #ruby
[16:48:10] diegoviola: has joined #ruby
[16:51:22] dorje_: has joined #ruby
[16:55:36] nobitano_: has joined #ruby
[16:57:22] ash_workz: I am selfishly glad havenwood and hxegon had that exchange
[17:00:36] ekinmur: has joined #ruby
[17:01:18] govg: has joined #ruby
[17:01:22] Wolland: has joined #ruby
[17:01:24] shinnya: has joined #ruby
[17:01:47] jrafanie: has joined #ruby
[17:01:51] jaguarmagenta: has joined #ruby
[17:02:31] ash_workz: does it matter from what directory you execute ruby-install ruby ?
[17:02:35] blockchan: has joined #ruby
[17:02:52] wldcordeiro: has joined #ruby
[17:05:01] mistermocha: has joined #ruby
[17:05:37] deadnull_: has joined #ruby
[17:05:38] kgrz: I guess not. Any specific case you're looking at?
[17:06:24] duoi: has joined #ruby
[17:06:24] plll: has joined #ruby
[17:08:39] djbkd: has joined #ruby
[17:10:11] sankarshanmudkav: has joined #ruby
[17:11:05] pepee: has joined #ruby
[17:12:30] jrafanie: has joined #ruby
[17:12:44] blackmesa: has joined #ruby
[17:12:53] rcvalle: has joined #ruby
[17:14:36] danostrowski: has joined #ruby
[17:14:58] SCHAAP137: has joined #ruby
[17:15:00] nobitanobi: has joined #ruby
[17:15:22] mikecmpbll: has joined #ruby
[17:15:53] nobitanobi: has joined #ruby
[17:16:49] firstdayonthejob: has joined #ruby
[17:18:01] ash_workz: kgrz: me? um.... so I did ruby-install --latest ruby and then when I did ruby -v it said: The program 'ruby' can be found in the following packages: * ruby * ruby1.8
[17:19:11] ash_workz: kgrz: then I did `ruby-install ruby` and it appeared to do much more work than I anticipated... I just wanted to make sure I wasn't installing it locally everywhere
[17:19:46] hahuang61: has joined #ruby
[17:20:40] ash_workz: from ruby-install ">>> Successfully installed ruby 2.3.1 into /home/dprocaccini/.rubies/ruby-2.3.1"
[17:21:09] ash_workz: can one install ruby globally?
[17:21:27] ash_workz: ~ le sigh ~
[17:21:28] hxegon: ash_workz: that should work from anywhere
[17:21:51] ash_workz: hxegon: well, I'm getting a message asking me to use apt
[17:22:05] hxegon: ash_workz: did you set chruby up?
[17:22:26] ash_workz: hxegon: is that necessary?
[17:22:31] scorphus: hey, I'm curious about the way `rvm-auto` turns on auto activation. For what I can tell, it doesn't change any file in my working dir. How does it work?
[17:22:35] ekinmur: has joined #ruby
[17:22:36] ash_workz: hxegon: I thought that was only if you wanted to be switching rubies a lot
[17:22:54] certainty: has joined #ruby
[17:23:01] ash_workz: scorphus: s/For/From
[17:23:15] scorphus: sure! sorry
[17:23:44] edwinvdgraaf: has joined #ruby
[17:23:48] scorphus: you know... second language
[17:23:58] ash_workz: no apology needed. I don't care really, I just thought *I'd* want to know if it were me
[17:23:59] scorphus: and thanks, ash_workz
[17:24:03] hxegon: ash_workz: well you need to switch from the system ruby to the newly installed ruby.
[17:24:09] jancel: has joined #ruby
[17:24:10] scorphus: ash_workz: absolutely
[17:24:25] cwenner: has joined #ruby
[17:24:30] hxegon: ash_workz: but my understanding of chruby/ruby-install is 0, so I'm probably not the best person to help with that
[17:24:34] aegis3121: has joined #ruby
[17:25:05] havenwood: ash_workz: A you did it it just installed Ruby locally in the ~/.rubies dir. You can install to /usr/local if that's in your PATH and you prefer a global install: ruby-install --latest --system ruby
[17:25:27] aufi: has joined #ruby
[17:25:41] firstdayonthejob: has joined #ruby
[17:26:15] smathy: has joined #ruby
[17:26:42] ash_workz: havenwood: wait wait.... so, cd to /usr/local and ruby-install --latest --system ruby?
[17:27:01] havenwood: ash_workz: you can run that command from any dir, just prefix: sudo
[17:27:20] ash_workz: havenwood: so you're just saying that's where it will install to?
[17:27:31] havenwood: ash_workz: Or chruby will autodetect the ~/.rubies install.
[17:27:50] havenwood: ash_workz: Yeah, as you initially ran it it installed to ~/.rubies (which isn't in your PATH).
[17:27:50] ash_workz: is that more ideal in your opinion?
[17:28:08] havenwood: ash_workz: If you want one and only one Ruby, say for a server, then I think a /usr/local install is ideal.
[17:29:07] havenwood: ash_workz: Alternatively install chruby, source chruby.sh and auto.sh and put a .ruby-version file in your $HOME dir that specifies a fuzzy match Ruby engine and version, like: ruby-2.3
[17:29:14] eserror: has joined #ruby
[17:29:20] havenwood: ash_workz: ^ If you want multiple Rubies to switch between.
[17:29:44] SilverKey: has joined #ruby
[17:29:54] havenwood: ash_workz: Then you could run `chruby jruby-9` or the like to switch to another Ruby engine/version.
[17:30:24] ash_workz: havenwood: sounds maybe like a better option
[17:30:45] ash_workz: in this case anyway
[17:30:49] havenwood: ash_workz: Yeah, chruby does all the env var niceties like properly setting GEM_HOME and GEM_PATH, etc.
[17:30:49] ash_workz: thanks a lot for clarifying
[17:30:55] havenwood: You're welcome.
[17:31:18] ash_workz: I particularly appreciated you drawing a contrast for /usr/local on a server.
[17:31:26] yfeldblum: has joined #ruby
[17:31:33] plll: has joined #ruby
[17:32:19] Pumukel: has joined #ruby
[17:32:27] plll: has joined #ruby
[17:33:12] ash_workz: havenwood: "source chruby.sh and auto.sh and put a .ruby-version file in your $HOME dir" << is that in docs? I'd like to know that if you weren't around, I could get that info from docs
[17:34:04] havenwood: ash_workz: https://github.com/postmodern/chruby#auto-switching
[17:37:04] cstl: has joined #ruby
[17:37:11] mistermo_: has joined #ruby
[17:41:26] Coldblackice: has joined #ruby
[17:43:31] danostrowski: has joined #ruby
[17:43:41] CJKinni`: has joined #ruby
[17:43:50] harai: has joined #ruby
[17:46:25] d5sx43: has joined #ruby
[17:47:42] mustmodify_: has joined #ruby
[17:48:05] mustmodify_: can I set up the stdev logger to rotate files every day? Or do I need to do that on the OS level?
[17:48:25] mustmodify_: Or is there a logger gem that has the same interface and will rotate for me?
[17:48:28] mustmodify_: Or should I have lunch?
[17:48:45] mustmodify: changed nicks
[17:49:51] polll: has joined #ruby
[17:50:21] mustmodify: Ah, I see it accepts a "shift age". But the name is a string so I guess it chooses the new filename, rather than letting me set it to something like udp.20160607.log
[17:50:48] ElFerna: has joined #ruby
[17:51:19] polll: has left #ruby: ()
[17:54:19] codecop: has joined #ruby
[17:54:22] A124: has joined #ruby
[17:54:24] harai: has joined #ruby
[17:55:41] johnDoe111: has joined #ruby
[17:55:53] aryaching: has joined #ruby
[17:56:02] benzrf_: has joined #ruby
[17:56:21] aberen: has joined #ruby
[17:57:26] benzrf_: if i say 'module Foo::Bar::Baz; ...; end;', that saves nesting, but requires 'Foo::Bar' to already exist. if i say 'module Foo; module Bar; module Baz; ...; end; end; end;', that saves dependency stuff, but it causes tons of nesting
[17:57:39] benzrf_: is there a good convention to avoid both complex file dependencies and too much nesting?
[17:57:49] mustmodify: interesting. I saw a message saying that I "cannot join channel (+i) ... but just now, after I've been here for like 10 minutes.
[17:58:00] SilverKey: has joined #ruby
[17:58:18] mustmodify: benzrf_: auto-loading from ... what is it.... ActiveSupport ?
[17:58:22] mustmodify: ActionSupport
[17:58:38] mustmodify: however Rails does class-implies-filename loading.
[17:59:28] nando293921: has joined #ruby
[17:59:38] blaxter: has joined #ruby
[18:00:00] aufi: has joined #ruby
[18:00:58] dionysus69: has joined #ruby
[18:01:57] GreyKite: has joined #ruby
[18:02:15] Wolland: has joined #ruby
[18:02:40] prestorium: has joined #ruby
[18:02:51] mistermocha: has joined #ruby
[18:02:56] dmr8: has joined #ruby
[18:06:25] mikecmpbll: has joined #ruby
[18:07:13] hahuang65: has joined #ruby
[18:08:24] lxsameer: has joined #ruby
[18:08:27] mistermocha: has joined #ruby
[18:08:30] sergio_101: has joined #ruby
[18:09:19] ChiefAlexander: has joined #ruby
[18:09:46] hahuang61: has joined #ruby
[18:09:48] GreyKite: Question: Best way to pass a variable needed to be modified by multiple instances of a method?
[18:10:48] prestorium: has joined #ruby
[18:11:00] mistermocha: has joined #ruby
[18:12:20] toretore: GreyKite: code?
[18:12:37] achamian: has joined #ruby
[18:13:13] polll: has joined #ruby
[18:13:14] minimalism: has joined #ruby
[18:14:20] Dimik: has joined #ruby
[18:14:32] GreyKite: https://gist.github.com/anonymous/c67bd49fbd6b5727f3efd71dcefdda49
[18:14:45] GreyKite: trying to increment a variable instead of puts
[18:15:20] CBX: has joined #ruby
[18:15:44] GreyKite: It's not really recursion so I can't pass it back up the chain and from what I googled, I don't think I can pass a pointer like in C
[18:17:20] palms: has joined #ruby
[18:19:54] arooni: has joined #ruby
[18:20:01] ramfjord: has joined #ruby
[18:20:26] solocshaw: has joined #ruby
[18:21:08] Kneecaps: has joined #ruby
[18:23:18] toretore: GreyKite: if it's not recursion why are you using it?
[18:23:29] blackmesa: has joined #ruby
[18:23:53] certainty: has joined #ruby
[18:24:20] toretore: GreyKite: you basically have two options: 1) make it recursive so that each call to runner returns something meaningful, or 2) convert to using iteration
[18:25:32] GreyKite: because I need to know how many paths are found. It currently outputs the correct number of possible paths through a grid
[18:25:58] arlek: has joined #ruby
[18:26:06] GreyKite: I could use iteration on a fixed size grid but calling the method this way allows me to step over a variable size grid
[18:26:40] nankyokusei: has joined #ruby
[18:27:27] polll: has joined #ruby
[18:27:50] symm-: has joined #ruby
[18:28:00] toretore: GreyKite: so the return value you're looking for is the one at `puts "Path found"`?
[18:28:36] GreyKite: right, I want that to instead of putting "Path found", increment a global variable that I can puts later
[18:28:49] chipotle: has joined #ruby
[18:29:12] kies: has joined #ruby
[18:29:53] toretore: GreyKite: i don't see how it could ever have more than a single result
[18:30:43] toretore: you're incrementing x and y intil they both == size
[18:31:44] GreyKite: It has a single number of possible paths per given size, but that number is different for each size. If size = 3 then it puts "Path Found" 6 times
[18:32:22] GreyKite: so iteration is the way to go then
[18:33:11] toretore: i don't really know because i don't understand exactly what it's supposed to do
[18:34:06] SilverKey: has joined #ruby
[18:34:37] GreyKite: Starts at the top-left point of a grid and then steps only down or right and finds all possible paths to the bottom right point
[18:35:32] GreyKite: The final version is planned to not know the size of the grid
[18:36:06] deadnull_: has joined #ruby
[18:36:17] thoraxe: has joined #ruby
[18:36:46] polll: has joined #ruby
[18:37:23] nobitanobi: has joined #ruby
[18:37:56] edwinvdgraaf: has joined #ruby
[18:38:01] aberen: has joined #ruby
[18:38:25] n_blownapart: has joined #ruby
[18:39:41] polll: has joined #ruby
[18:39:54] sp4rrow: has joined #ruby
[18:40:24] jhack: has joined #ruby
[18:40:31] chouhoul_: has joined #ruby
[18:40:32] multi_io: has joined #ruby
[18:40:56] GinoManWorks: has joined #ruby
[18:40:57] fenre: has joined #ruby
[18:41:32] harai54: has joined #ruby
[18:42:36] [Butch]_: has joined #ruby
[18:43:25] mistermocha: has joined #ruby
[18:47:06] jancel: has joined #ruby
[18:47:17] sartan: has joined #ruby
[18:48:09] sartan: Hi there! Can I ask RVM questions in here? sure i can. I'm trying to get a ruby-rvm script to run under cron, so i'm creating a batch wrapper. I found a document at rvm.io/integration/cron that 'implies' i can just run /home/user/.rvm/environments/PROJECTALIAS/ruby /path/to/script -- this works, but it doesn't use the default rvm gemset i have activated for that project.
[18:48:14] sartan: s/default/custom
[18:48:52] toretore: sartan: rvm + cron = bad time
[18:49:28] apeiros: toretore: saywhat? that works fine
[18:49:31] sartan: i doni't realy have other options. i need ruby 2.1+ (using 2.3.1) for a project but centos only ships 1.8
[18:50:08] apeiros: sartan: #rvm has been helpful in the past. iirc rvm generates a standard wrapper, plus has a command to generate gemset+ruby specific wrappers.
[18:50:21] palms: has joined #ruby
[18:50:28] sartan: Thanks, i'll wander on there
[18:50:42] wrkrcoop: has joined #ruby
[18:50:44] toretore: GreyKite: so it's definitely a recursive problem, i don't know the details of the algorithm you are going to use to say how to gather the data, but it usually takes the form of `result_so_far + recursive_call()`
[18:50:57] wrkrcoop: how do i get and set class variables?
[18:51:14] toretore: @@var = value
[18:52:00] toretore: apeiros: i'm being a little dramatic; i'm sure it works fine if you know exactly how to set up the environment that rvm expects
[18:52:07] djbkd: has joined #ruby
[18:52:16] wrkrcoop: toretore: but how do i set it?
[18:52:17] toretore: but i prefer not having to deal with it
[18:52:37] toretore: wrkrcoop: need more context
[18:52:41] toretore: what are you trying to do?
[18:52:59] wrkrcoop: i have to allow an instance to set the class variable
[18:52:59] toretore: setting a variable is always `<varname> = <value>`
[18:53:01] apeiros: toretore: rvm provides a command to get you that
[18:53:08] wrkrcoop: or … maybe not
[18:53:09] GreyKite: toretore: I don't know why, but when you wrote something I had just been looking at like 5 min ago it all came together. Thanks
[18:53:12] LaT0rtue: has joined #ruby
[18:53:25] mistermocha: has joined #ruby
[18:53:36] apeiros: toretore: and the same can be said about all version switchers - unless you have one which works with pixie-dust
[18:54:05] dionysus69: has joined #ruby
[18:55:07] CJKinni``: has joined #ruby
[18:55:26] toretore: apeiros: i'm sure they do, i just don't think that it's the appropriate solution to deploy a ruby application
[18:56:15] apeiros: toretore: but that's a different "venue" (since you're not really making an argument) than "you have to have the setup correctly"
[18:56:31] toretore: apeiros: this is true
[18:56:59] toretore: i'm just coming up with things to say so that i don't have to deal with my own deployment issues
[18:57:33] apeiros: my deployment issue is that we use capistrano and it seems to be unnecessarily convoluted. not necessarily capistranos fault.
[18:58:18] apeiros: I mean we have like hundreds of lines of ruby code, not counting the libs we also use - for almost the same of what I do privately with ~20 lines of bash :-/
[18:58:26] apeiros: (and I hate bash for scripting)
[18:58:31] toretore: i gave up on that stuff years ago
[18:59:08] toretore: (and now i'm struggling with ad-hoc deployment scripting that i've had to do)
[18:59:36] blockchan: has joined #ruby
[18:59:44] toretore: i wish i could use kubernetes already :(
[19:00:25] apeiros: I wish I had the time to dig a bit into docker. if it's what I think it is, it might be salvation
[19:00:47] toretore: it is to a large degree
[19:00:54] aberen: has joined #ruby
[19:01:02] giz|work: has joined #ruby
[19:01:08] choke: has joined #ruby
[19:01:20] toretore: i'm not planning on making anything that doesn't run in a container any more
[19:01:46] alfiemax: has joined #ruby
[19:01:50] toretore: now if i could actually take the server part out of the picture too i'd be set
[19:02:00] apeiros: I dream of vm's which basically just run a single micro-service (or service, doesn't even need to be micro). no overhead. no process scheduling (or only little).
[19:02:14] toretore: that's what docker does
[19:02:34] toretore: - the vm part, because vms have overhead while docker has very little
[19:02:35] jaguarmagenta: has joined #ruby
[19:02:42] kareeoleez: has joined #ruby
[19:02:48] Wolland: has joined #ruby
[19:03:13] mistermocha: has joined #ruby
[19:03:38] apeiros: though afaik vm overhead can be reduced to very little with modern CPU architectures which have guest systems in mind
[19:03:42] sankarshanmudkav: has joined #ruby
[19:04:19] toretore: that's true, but i think docker gets us 99% of what vms do anyway
[19:04:56] eam: s/docker/lxc/
[19:05:07] eam: docker doesn't actually do anything
[19:05:08] toretore: docker is much more than that though
[19:05:16] toretore: docker does a lot of things
[19:05:20] eam: on its own? no
[19:05:40] eam: docker is a little bit of business logic and a set of interfaces and standards
[19:05:41] toretore: that's like saying rails doesn't do anything, ruby is the one doing all the work
[19:05:44] eam: file formats and so on
[19:05:52] eam: no, rails has a good deal of code that's important
[19:05:59] urbanmonk: has joined #ruby
[19:06:02] eam: none of the functional code in docker is part of the docker project
[19:06:26] eam: it's all just scripts to glue together other layers -- 100% business logic
[19:06:31] toretore: like what? the cgroups and namespaces?
[19:07:02] eam: and it's not just "little" overhead it's actually zero
[19:07:07] toretore: i'm not going to use those directly to deploy my hundreds of containers
[19:07:15] eam: why not? I do
[19:07:23] toretore: well, kudos to you then :P
[19:07:28] aberen: has joined #ruby
[19:07:35] eam: hey I'm not saying it's useless to have a common format
[19:07:47] toretore: it's imperative in most cases
[19:07:57] toretore: common interfaces = gold
[19:08:10] toretore: implementation is not very important
[19:08:11] eam: sure -- that's what docker does
[19:08:31] rueben_: has joined #ruby
[19:08:32] eam: no, the implementation is exclusively important when the subject is performance -- which it is here
[19:08:39] eam: docker is irrelevant to performance
[19:08:43] eam: because it's not implementation
[19:09:19] toretore: i don't actually think performance is that imporant in most cases where docker is used
[19:09:35] toretore: what's imporant is isolation and ease of deployment
[19:09:36] eam: that's a bit of a separate question isn't it
[19:10:05] palms: has joined #ruby
[19:10:16] eam: you get a lot less isolation with docker vs a vm
[19:10:25] mistermocha: has joined #ruby
[19:10:27] eam: usually that's desirable
[19:10:36] duoi: has joined #ruby
[19:10:45] toretore: yes, but also much easier deployment
[19:11:30] weemsledeux: has joined #ruby
[19:11:32] toretore: actually yes, you're right about the isolation; some things you want to share in containers
[19:11:59] toretore: and the fact that you can choose allows for flexbility
[19:12:21] urbanmonk: has joined #ruby
[19:12:22] yqt: has joined #ruby
[19:12:25] chopin: has joined #ruby
[19:12:28] eam: when we use lxc directly, one of the use cases is to cgroup an app but still allow it full access to share a filesystem with another app
[19:12:58] eam: so we can do things like partition the linux VM behavior and memory/cpu allocations, but otherwise treat it as a normal multi-tenancy machine
[19:13:11] toretore: which you can do with docker afaik?
[19:13:28] jenrzzz: has joined #ruby
[19:13:29] jenrzzz: has joined #ruby
[19:13:31] eam: oh probably. part of why we're not using docker is because we've been doing this long before docker existed
[19:13:45] toretore: i do think docker is trying to do a lot of things that it shouldn't necessarily concern itself with
[19:13:59] toretore: like trying to be systemd
[19:14:18] eam: both seem to be suffering from lack of architectural guidance
[19:14:28] eam: and feature/scope creep
[19:14:39] toretore: docker maybe, but i think systemd is doing well
[19:15:50] toretore: i know lots of people disagree, but i think creating some order in the linux world is a good thing
[19:16:06] djbkd: has joined #ruby
[19:16:21] shevy: yep a lot of people disagree there
[19:17:13] eam: it's not that the idea of work in that area doesn't have merit -- but that's a separate question from whether the work is constructive
[19:17:14] toretore: their taking away are freedoms
[19:17:58] eam: well, it suffers from a functionally poor design, lack of oversight, various fundamental misunderstandings, security flubs
[19:18:28] eam: but sure, there's a problem somewhere in that domain that needs solving
[19:18:37] eam: toretore: well, it could've just not been init, for one
[19:18:45] eam: the RC system is a different thing from the init system
[19:19:10] toretore: how are they different?
[19:19:36] eam: init is pid 1, it's the parent of everything, it reaps zombies, it starts RC, and it needs to be super simple and stable
[19:20:00] eam: the RC system is /etc/rc and takes several forms across various unixes. It starts daemons and is messy and complex
[19:20:18] danostrowski: has joined #ruby
[19:20:27] eam: most people mean rc when they say init, because they don't really understand how it all works together
[19:20:35] eam: rc replacements have existed for decades
[19:20:54] eam: the old way of doing this was modular -- systemd kills that
[19:20:59] eam: and without any good reason
[19:21:15] eam: in terms of fundamental misunderstandings, here's a nice example: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825394
[19:21:16] toretore: so what you're saying is systemd shouldn't be pid 1?
[19:21:31] eam: toretore: yes - few would object if they'd make it an also-have
[19:21:42] toretore: isn't process/service supervision intrinsic to init too?
[19:21:47] shevy: systemd tries to be all the things, more than just an init replacement
[19:22:02] eam: toretore: look at runit/daemontools as a counter example
[19:22:07] duoi: has joined #ruby
[19:22:13] toretore: yes i heard about the bug you mentioned, and i don't see it as a bug
[19:22:49] eam: toretore: there's also stuff like https://lists.dns-oarc.net/pipermail/dns-operations/2016-June/014964.html
[19:22:50] aufi: has joined #ruby
[19:22:54] toretore: just because "this is the way it's always been" doesn't mean it is therefore the right way and has to stay that way forever
[19:23:03] GreyKite: I like *BSD's way of doing it
[19:23:05] whathapp_: has joined #ruby
[19:23:26] eam: toretore: so you think you should require root access to run a program after logging out? I think you're maybe not thinking this through
[19:23:37] shevy: just because "we need something new" doesn't mean it has to be the right way and has to change the old way
[19:23:38] jhass: can somebody please ask a ruby question so I can ?offtopic y'all?
[19:23:54] eam: jhass: are there any init replacements written in ruby?
[19:23:58] eam: in rails, perchance?
[19:23:59] GreyKite: I could ask my question again
[19:24:08] GreyKite: I thought I had but i guess not
[19:24:15] toretore: eam: i think it's functionality that's missing from systemd
[19:24:18] whathapp_: has joined #ruby
[19:24:24] certainty: has joined #ruby
[19:25:07] sandstrom: has joined #ruby
[19:25:13] whathapp_: has joined #ruby
[19:25:27] moos3: has joined #ruby
[19:25:35] shevy: perhaps they will embed mruby!
[19:25:53] toretore: eam: fwiw, and this kind of goes back to our "interface vs implementation" from above, i think that room will be made to replace components
[19:26:13] aberen: has joined #ruby
[19:27:31] eam: something's going to change, that's for sure
[19:27:49] GreyKite: Ok yeah I got a ruby question: How does ruby handle two different methods coming back out of recursion to the same place?
[19:28:07] toretore: eam: and also, i admit to seeing this more from a common user's perspective and not a bofh that's been administering unix systems since i was 5
[19:28:31] eam: toretore: the changes make a lot of sense for a personal single-user desktop computer
[19:28:38] jhass: there we go!
[19:28:46] shevy: a ruby question
[19:28:46] jhass: ?offtopic eam toretore shevy
[19:28:46] ruby[bot]: eam: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[19:28:59] shevy: jhass but ... mruby!
[19:29:11] eam: m'ruby *tips hat*
[19:29:37] shevy: we have a ruby question lingering in the room now
[19:29:54] jhass: GreyKite: not sure I follow your question though, got an example?
[19:30:08] duckpuppy: has joined #ruby
[19:30:45] toretore: GreyKite: in general, there is no difference between how recursion works in ruby and other languages
[19:30:47] k3rn31: has joined #ruby
[19:30:51] GreyKite: https://gist.github.com/anonymous/edcc55be663d21a989a10bf58cf6c03f
[19:31:21] GreyKite: So I have two method that come back to the same place but I'm not sure how the timing works out on resolution
[19:31:49] jhass: I only see one method
[19:31:57] toretore: there is no timing issue as long as these methods are being run synchronously, which they are in this example
[19:31:58] jhass: do you mean the two recursive calls in line 17?
[19:32:10] GreyKite: yeah that's what I meant
[19:32:15] johnmilton: has joined #ruby
[19:32:16] GreyKite: two instances of the same method
[19:32:21] toretore: GreyKite: all your recursive calls form a tree with a single common ancestor
[19:32:42] jhass: GreyKite: let me shuffle it around a bit real quick
[19:33:31] GreyKite: so it would hang around at each split for both calls to resolve?
[19:33:41] rueben_: has joined #ruby
[19:33:44] jhass: https://p.jhass.eu/2m.rb so this is still equivalent, clear?
[19:34:36] jhass: first the call in now line 4 has to return, including all recursive calls it makes itself, then the same for the one in line 5
[19:35:19] zeroDi: has joined #ruby
[19:35:38] jhass: GreyKite: another way is to see + as a method call (it actually is in fact), so num.+(runner(...).+(runner(...))
[19:36:03] jhass: as with every other method call, the expressions passed to it as argument are resolved first
[19:36:11] lightt: has joined #ruby
[19:36:36] GreyKite: so then puts sum at the end will add up all the found paths?
[19:36:37] jhass: num.+(runner(...)).+(runner(...)) of course, forgot a paren
[19:37:01] jhass: not sure what you mean
[19:37:36] GreyKite: Right. it currently has puts num but the sum is stored in sum
[19:37:59] dhollinger: has joined #ruby
[19:38:06] jhass: well right you have no sensical return value atm
[19:38:30] jhass: puts returns nil so except for the else case your method will always return nil
[19:39:26] jhass: perhaps you meant something like https://p.jhass.eu/2n.rb
[19:39:46] jhass: (I didn't try to understand what problem the code is supposed to solve yet)
[19:40:22] GreyKite: I don't blame you, I'm bad at explaining and coding
[19:41:52] GreyKite: Do I even need the num in the method call?
[19:42:22] allcentu1: has joined #ruby
[19:42:25] jhass: that would go into the problem domain to solve
[19:42:57] aberen: has joined #ruby
[19:43:04] jhass: but to make something clear, modifying num won't change it for the parent call (the iteration that invoked the current one)
[19:43:10] polishdub: has joined #ruby
[19:43:20] jhass: and num + isn't modifying it anyway
[19:43:31] rueben_: has joined #ruby
[19:43:42] haxrbyte: has joined #ruby
[19:44:50] jhass: did you look at and understood the classic recursive fibonacci and/or factorial implementations yet?
[19:45:25] GreyKite: If I've got a single line going down, then following that single line back up, it makes more sense to me
[19:45:49] Keltia: has joined #ruby
[19:45:59] GreyKite: my problem comes in when it comes to how the multiple instances interact
[19:46:19] jhass: there are no multiple instances
[19:46:57] GreyKite: Then therein lies my fundemental misunderstanding
[19:47:04] GreyKite: or misuse of a word
[19:47:06] haxrbyte: has joined #ruby
[19:47:11] jhass: think back to fibonacci
[19:47:25] MrBusiness2: has joined #ruby
[19:47:38] jhass: it too called itself multiple times
[19:47:50] jhass: but neither there nor here it happens at the same time
[19:47:56] aberen: has joined #ruby
[19:48:10] jhass: first the first call happens, only when that one returns the second one starts executing
[19:48:31] rueben_: has joined #ruby
[19:49:11] GreyKite: so in the line sum = runner + runner, it would resolve the last runner, then start the + method, then the first runner, then the = operation
[19:49:37] blackmesa: has joined #ruby
[19:50:23] jhass: right path, just details wrong
[19:50:34] jhass: recall what I said about .+ being a method
[19:50:47] jhass: say I would write sum.foo(runner).foo(runner)
[19:51:05] mtkd: has joined #ruby
[19:51:09] jhass: how would it run?
[19:51:56] GreyKite: last runner, last foo, first runner, first foo, sum?
[19:52:11] cschneid: has joined #ruby
[19:52:20] jhass: well that's what you said and then I started all this :P
[19:52:34] jhass: no, execution order is still left to right
[19:52:44] SilverKey: has joined #ruby
[19:52:44] jhass: but to pass an argument to a method you need to know its value
[19:53:43] chopin: has joined #ruby
[19:54:01] jhass: so the first runner is run, the result of that is passed to foo (or +) that then returns a new object/value. On that the second foo (+) is run, which too needs an argument, That argument is the second runner, which is thus fully run and its return value is passed to the second foo (+).
[19:54:58] flashpoint9: has joined #ruby
[19:55:35] [Butch]: has joined #ruby
[19:56:52] mistermocha: has joined #ruby
[19:57:17] mistermocha: has joined #ruby
[19:57:19] GreyKite: so sum looks at first foo, first foo says I need runner, runner does his thing, then sum asks if we are ready yet, and second foo says I need runner2, so runner 2 does his thing, then sum asks how things are going and first_foo says I have runner, second_foo says I have runner2, and sum does it's thing
[20:00:18] shevy: have you folks still not answered the ruby question
[20:00:23] rueben_: has joined #ruby
[20:00:52] GreyKite: I'm gonna call it done if you want to start talking about systemd again
[20:01:21] wrkrcoop: has joined #ruby
[20:01:35] DTZUBDUB: has joined #ruby
[20:01:40] shevy: I did not mention the s word!
[20:02:52] chopin: has joined #ruby
[20:03:35] Wolland: has joined #ruby
[20:03:37] ash_workz: havenwood: do you have to put a .ruby-version file in your $HOME dir that specifies a fuzzy match for each version of ruby you want to switch between?
[20:03:47] kareeoleez: has joined #ruby
[20:03:56] aberen: has joined #ruby
[20:04:20] havenwood: ash_workz: No, that's just to set a default other than your system Ruby.
[20:04:44] mustmodify: I have an app that gets some images from another app. The second app requires authentication. I don't want to have to login to the other app to get those images. But neither do I want to leave it open to the interwebz. Are there any best practices for inter-app authentication? I'm guessing just create a long string and keep it in an env variable on production servers for both machines?
[20:04:50] mustmodify: sorry, both apps?
[20:04:53] havenwood: ash_workz: To switch yourself you can do `chruby ruby-2.3` or `chruby ruby-2.2` or `chruby jruby` or whatever.
[20:05:22] mustmodify: updating that seems like a pain but I don't know that it would need updating except in rare circumstances.
[20:05:22] havenwood: mustmodify: What kind of app? Rack, Sinatra, Rails or other?
[20:05:24] dionysus69: has joined #ruby
[20:05:55] mustmodify: Both Rails, though I have a sinatra app and a rack app that may also need cross-app auth at some point.
[20:06:03] havenwood: mustmodify: JWT is nice these days.
[20:06:29] havenwood: https://tools.ietf.org/html/rfc7519
[20:06:31] havenwood: https://github.com/jwt/ruby-jwt
[20:06:32] ash_workz: sorry, it took so long for me to respond, I got distracted by this concept in bash: y='x=3,y=2,5'; ((x=y-y+x)); # x=6, y=3
[20:07:15] havenwood: mustmodify: I've been enjoying reading through Rodauth code: http://rodauth.jeremyevans.net
[20:07:31] cdg: has joined #ruby
[20:07:33] mdw: has joined #ruby
[20:07:50] danostrowski: has joined #ruby
[20:07:56] MrBusiness3: has joined #ruby
[20:08:38] havenwood: mustmodify: I dunno if you're familiar with JWTs but here's an insecure plain text JWT in a few lines of Ruby just for fun: https://gist.github.com/havenwood/3b98192d6122a4c9b1a4
[20:08:43] ash_workz: havenwood: so supposing I want just run the latest version of ruby, whatever that is, I would just do chruby ruby ?
[20:08:53] sp4rrow: has joined #ruby
[20:08:58] mustmodify: Oh blah. Just building this idea in my head and realized an important requirement. Or ... aspect. Currently the URL for the image points to the other app. So any authentication would either have to be "in public and we don't care" or some kind of public-private situation.
[20:08:59] havenwood: ash_workz: yup: chruby ruby
[20:09:01] cdg: has joined #ruby
[20:09:17] ash_workz: command not found
[20:09:24] havenwood: ash_workz: Or add `ruby` to a .ruby-version file in your $HOME or root dir.
[20:09:32] havenwood: ash_workz: Restart your terminal or source your dotfile.
[20:09:34] mustmodify: ash_workz: `which chruby`
[20:09:53] ash_workz: havenwood: oh that worked
[20:09:54] havenwood: ash_workz: source ~/.bashrc # or whatever dotfile you put chruby.sh and auto.sh in
[20:09:57] jhass: GreyKite: https://p.jhass.eu/2o.rb
[20:10:10] weemsledeux: has joined #ruby
[20:10:21] ash_workz: I didn't know that's how you reset that
[20:10:38] babblebre: has joined #ruby
[20:11:15] bumao: has joined #ruby
[20:11:23] ash_workz: havenwood: does ruby need to be enclosed in back-ticks?
[20:11:34] duckpuppy: has joined #ruby
[20:11:43] havenwood: ash_workz: that's just meaning "here's the code part"
[20:12:03] ash_workz: right, okay
[20:12:03] havenwood: ash_workz: echo ruby > ~/.ruby-version
[20:12:10] ash_workz: so chruby doesn't output an error
[20:12:22] ash_workz: but gem install -- gem: command not found
[20:12:37] GreyKite: jhass: Thanks, that makes more sense to me
[20:12:55] havenwood: ash_workz: If you type just `chruby` what's the return value?
[20:13:12] kareeoleez: has joined #ruby
[20:13:12] ash_workz: havenwood: * ruby-2.3.1
[20:13:18] havenwood: ash_workz: Perfect.
[20:13:34] havenwood: ash_workz: and what output for?: command -v ruby
[20:13:52] ash_workz: ~/.rubies/ruby-2.3.1/bin/ruby
[20:14:12] havenwood: ash_workz: great. how about?: command -v gem
[20:14:32] ash_workz: ~/.rubies/ruby-2.3.1/bin/gem
[20:14:34] dorje: has joined #ruby
[20:14:37] achamian: has joined #ruby
[20:14:44] kareeole_: has joined #ruby
[20:14:50] ash_workz: doesn't play nice with sudo?
[20:14:59] havenwood: ash_workz: Nope, sudo drops env.
[20:15:09] ur5us: has joined #ruby
[20:15:12] havenwood: ash_workz: Check your $PATH, $GEM_HOME, $GEM_PATH etc with and without sudo.
[20:15:33] havenwood: ash_workz: With a local Ruby install like that though you should be good without sudo. :)
[20:15:38] polll: has joined #ruby
[20:15:56] [Butch]: has joined #ruby
[20:16:02] ash_workz: thanks havenwood
[20:16:15] havenwood: ash_workz: you're welcome
[20:16:15] mute: has joined #ruby
[20:16:33] duckpupp1: has joined #ruby
[20:17:20] jhass: GreyKite: cool anyway, since I wrote it up https://p.jhass.eu/2p.rb
[20:17:23] Madplatypus: has joined #ruby
[20:18:21] mute: how would one remove a trailing substring without side effect? a="foobar" i want b="foo", removing trailing bar
[20:18:58] adaedra: >> "foobar".sub(/bar\z/, '')
[20:18:59] havenwood: mute: b = a.chomp 'bar'
[20:19:00] ruby[bot]: adaedra: # => "foo" (https://eval.in/585687)
[20:19:10] adaedra: Ah yes, there's chomp too :>
[20:19:18] havenwood: chomp chomp nom
[20:20:18] jhass: >> b = "foobar".chop.chop.chop; b # ignore me
[20:20:19] ruby[bot]: jhass: # => "foo" (https://eval.in/585688)
[20:20:46] duoi: has joined #ruby
[20:21:02] sartan: hi guys - looking for a bit of advise here. i'm using yaml to import a config file - working great. i'd like to search if certain information exists properly in the file without having to write up a long, ugly, complicated k,v test. https://gist.github.com/anonymous/0782eff1fb232480adbff584230b0a17
[20:21:17] sartan: this could be really ugly
[20:21:33] mustmodify: havenwood: So currently the images are at /clouds/heart_rate.svg -- so I would encode the parameters OAuth style and pass that along as a token?
[20:22:21] mustmodify: sartan: `grep username: xyz` ?
[20:22:34] sartan: specifically i need to check all of the attributes at hte same time
[20:22:35] duncannz: has joined #ruby
[20:22:52] jhass: well then the answer is no
[20:23:00] jhass: I find that fairly concise btw
[20:23:09] sartan: I'm probably not asking this very well but is there a better way to test this rather than kludging out a long accounts.include? {"value"=>test, "value2"->test2} construct?
[20:23:13] toretore: sartan: how do you suppose you would check for 3 attributes without actually writing out those 3 attributes?
[20:23:15] duncannz: has joined #ruby
[20:23:20] jhass: sartan: if you could make up the syntax, what would you dream look like?
[20:23:26] jhass: *dream solution
[20:23:27] toretore: sartan: in other words: what you're doing is fine
[20:23:33] Yiota: has joined #ruby
[20:23:34] sartan: okay. this is fine. thank you
[20:23:43] sartan: not familiar with ruby so just catching up here
[20:24:07] duncannz: has joined #ruby
[20:24:35] duncannz: has joined #ruby
[20:25:12] certainty: has joined #ruby
[20:25:16] toretore: sartan, i would do: accounts.any?{|a| a['domain'] == 'CONTOSO' && a['username'] == 'Administrator' && a['description'] == 'Some user' }
[20:25:22] jackjackdripper: has joined #ruby
[20:25:45] yatish27: has joined #ruby
[20:26:04] toretore: this makes it explicit, and is resilient to additional attributes being added to the account structure
[20:26:13] sartan: right. :) would the .include work if values maybe did not account for extra attributes?
[20:26:22] sartan: -^ right.. that was really the root of what i was asking but i didn't know how to say it
[20:26:38] sartan: .any seems more reslient than .include in this case. Thank you very much toretore
[20:26:52] johnmilton: has joined #ruby
[20:27:01] karmatr0n: has joined #ruby
[20:27:13] mustmodify: havenwood: did you see my Q?
[20:27:29] nankyokusei: has joined #ruby
[20:28:26] duderonomy: has joined #ruby
[20:28:44] allcentury: has joined #ruby
[20:29:04] LinuxPenT: has joined #ruby
[20:29:21] havenwood: mustmodify: yeah, just distracted with pesky work - maybe signed url for the image and authenticate requesting token? warning my brain is mush at the moment and i haven't had time to actually read your question carefully!
[20:30:39] wrkrcoop: has joined #ruby
[20:31:08] havenwood: mustmodify: not sure if my ramblings are on the right track at all! i'll reread and ponder in a few. :)
[20:31:11] tercenya: has joined #ruby
[20:31:25] dorje: has joined #ruby
[20:31:38] mustmodify: no, I'll read your gist in more detail. Go back to work. :P
[20:32:45] kareeoleez: has joined #ruby
[20:33:46] bumao: has joined #ruby
[20:34:05] swills: has joined #ruby
[20:34:17] diegoviola: has joined #ruby
[20:34:42] blackmesa: has joined #ruby
[20:35:27] roamingdog: has joined #ruby
[20:36:01] dorje: has joined #ruby
[20:36:24] nando293921: has joined #ruby
[20:41:02] jhack: has joined #ruby
[20:42:44] shevy: back to work with him
[20:43:25] cajone: has joined #ruby
[20:43:39] johnmilton: has joined #ruby
[20:48:07] chipotle: has joined #ruby
[20:49:54] Ishido: has joined #ruby
[20:50:44] kareeoleez: has joined #ruby
[20:51:31] mute: havenwood: thanks!
[20:51:59] nofxx: has joined #ruby
[20:52:53] kareeole_: has joined #ruby
[20:54:05] sdothum: has joined #ruby
[20:55:38] art-solopov: has joined #ruby
[20:56:01] blackgoat: has joined #ruby
[20:56:28] agit0: has joined #ruby
[20:58:51] zapata: has joined #ruby
[20:59:35] aberen: has joined #ruby
[21:01:03] jenrzzz_: has joined #ruby
[21:01:55] maloik: has joined #ruby
[21:02:25] sp4rrow: has joined #ruby
[21:02:42] Gasher: has joined #ruby
[21:02:56] noobsu: has joined #ruby
[21:03:21] jaguarmagenta: has joined #ruby
[21:03:36] kareeoleez: has joined #ruby
[21:03:47] danostrowski: has joined #ruby
[21:04:22] Wolland: has joined #ruby
[21:05:25] bobbycvi: has joined #ruby
[21:06:16] solars: has joined #ruby
[21:06:41] diegoaguilar: has joined #ruby
[21:07:13] dorje: has joined #ruby
[21:08:23] karmatr0n: has joined #ruby
[21:08:44] SilverKey: has joined #ruby
[21:09:38] neanderslob: has joined #ruby
[21:13:31] SilverKey: has joined #ruby
[21:14:38] kareeoleez: has joined #ruby
[21:17:44] CJKinni: has joined #ruby
[21:19:18] lopin: has joined #ruby
[21:19:29] lopin: s -m irc.shadow-network.net
[21:19:37] mute: has left #ruby: ("WeeChat 1.4")
[21:19:48] jenrzzz: has joined #ruby
[21:19:48] jenrzzz: has joined #ruby
[21:20:04] harai54: has joined #ruby
[21:20:52] wrkrcoop: has joined #ruby
[21:21:35] alexandernst: has joined #ruby
[21:22:11] alexandernst: What is the difference between backtrace.select { |s| ! (s =~ /bundle/ || s =~ /gems/)} and backtrace.select { |s| s =~ /bundle/ || s =~ /gems/} ?
[21:22:41] aegis3121: Well, I would imagine the !
[21:23:12] alexandernst: yes, but what do both things do?
[21:23:32] alexandernst: I mean, in the first case the select will return only strings that don't have bundle or gems
[21:25:08] bruce_lee: has joined #ruby
[21:25:14] bumao: has joined #ruby
[21:25:54] certainty: has joined #ruby
[21:26:25] mdw: has joined #ruby
[21:27:07] shevy: cool... seems as if rubygems.org now shows "Required Ruby Version:" and "Required Rubygems Version:" ... or I did not notice this before
[21:27:31] shevy: or perhaps not... but I could swear that something changed in the display
[21:27:42] mdw7: has joined #ruby
[21:29:40] Fuzai: has left #ruby: ()
[21:29:57] flashpoint9: has joined #ruby
[21:31:41] mahlon: has joined #ruby
[21:32:35] kareeoleez: has joined #ruby
[21:34:28] ips|malc: has joined #ruby
[21:35:32] Cohedrin: has joined #ruby
[21:36:32] qasaur: has joined #ruby
[21:37:15] dorje: has joined #ruby
[21:39:06] kareeoleez: has joined #ruby
[21:39:55] spider-mario: has joined #ruby
[21:40:27] mdw: has joined #ruby
[21:41:06] juanfra: has joined #ruby
[21:42:31] hahuang65: has joined #ruby
[21:43:10] Wolland: has joined #ruby
[21:43:12] TinkerTyper: has joined #ruby
[21:45:33] aberen: has joined #ruby
[21:45:43] kalopsian: has joined #ruby
[21:47:09] Xentil: has joined #ruby
[21:48:20] hahuang65: has joined #ruby
[21:49:02] sandstrom: has joined #ruby
[21:49:33] aibot: has joined #ruby
[21:49:59] thoraxe: hmm... not sure if this is a better question for rubygems specifically, but i'm trying to install charlock_holmes on centos7 and i feel like I've got all the right deps but to no avail
[21:50:03] thoraxe: https://gist.github.com/thoraxe/771212b86b9179a9f6efa05db241cf39
[21:50:35] thoraxe: i have libicu-devel installed
[21:50:46] thoraxe: i'm using bundler: bundle install --without test --without development --deployment
[21:51:21] lightt: has joined #ruby
[21:51:41] jhass: thoraxe: install the which command
[21:52:01] thoraxe: installing
[21:52:07] vdamewood: has joined #ruby
[21:52:08] thoraxe: jhass: is something bundler doing trying to use that?
[21:52:38] thoraxe: this is also inside a docker container (Extra fun) so yeah which wasn't installed.
[21:52:53] thoraxe: there we go!
[21:53:06] thoraxe: Installing charlock_holmes 0.7.3 with native extensions
[21:53:36] jhass: not bundler, the mkmf/extconf rather
[21:53:43] alexandernst: How is it possible that some random code is returning *foo*, but when I debug it line-by-line with proy debugger, I get *bar*?
[21:54:31] jhass: it's impossible and can have 100 reasons at the same tiem
[21:54:40] mustmodify: has left #ruby: ()
[21:54:40] jhass: sorry but there's just not enough context
[21:54:41] Azure: has joined #ruby
[21:55:11] thoraxe: jhass: ahh. gotcha. thanks!
[21:55:57] nocco: has joined #ruby
[21:56:21] mtkd: has joined #ruby
[21:56:23] bumao: has joined #ruby
[21:56:44] jenrzzz: alexandernst: i'm gonna go with solar flares
[21:56:46] Synthead: is there a way to get the network mask address from an IPAddr object? It looks like fog extends IPAddr with .mask_string, but I want to remove fog from my Gemfile
[21:57:00] alexandernst: jenrzzz: checked, not the source of the problem :)
[21:57:06] alexandernst: jenrzzz: next idea!
[21:57:21] jenrzzz: alexandernst: your computer may be haunted. you should pour holy water on it
[21:57:41] alexandernst: hmmm... I suspect that might not fix the problem but actually make it worse
[21:57:46] Rasi: has joined #ruby
[21:57:56] jenrzzz: gotta go down to go up
[21:58:04] Synthead: patch the kernel to make all random numbers be 5
[21:58:07] Synthead: that'll fix it for sure
[21:58:14] alexandernst: anyways, I just restart RoR and it seems now it's returning *bar*
[21:58:28] hahuang65: has joined #ruby
[21:58:32] sp4rrow: has joined #ruby
[21:58:42] alexandernst: weird, I have all those no-cache and reload-classes-always options in my development env
[21:59:12] ElFerna: has joined #ruby
[21:59:35] highbass: has joined #ruby
[22:00:09] Synthead: alexandernst: are you using spring?
[22:00:22] alexandernst: Synthead: no idea what that is, sorry
[22:00:39] Synthead: alexandernst: its a lib that caches RoR environments
[22:00:40] highbass: im a ruby newby ... had a qustion regarding "Asset Pipeline" ... for some reason when i do a precompile for assets it creates the assets in public/assets folder but it also removes some of the status assets in my project (assets it pulls from other folders) during precompilation... is this normal behaviour?
[22:00:55] alexandernst: Synthead: would that appear somewhere in the Gemfile ?
[22:01:05] Synthead: alexandernst: you might check if your project is using it. if so, disable it and see if the oddities go away.
[22:01:11] Synthead: alexandernst: I think so
[22:01:39] Synthead: highbass: do you mean static assets?
[22:01:47] highbass: Synthead: yes
[22:01:49] alexandernst: Synthead: yup, spring here
[22:01:54] alexandernst: let me research how to disable that
[22:01:58] jhass: ?rails highbass
[22:01:59] ruby[bot]: highbass: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[22:02:33] Synthead: alexandernst: I think if you just pull the gem out and run "bundle", it'll work. there'll also be a spring daemon running on your box (I think), so you might kill it
[22:03:14] alexandernst: Synthead: can't touch the Gemfile nor modify gems. Work project, limited write perms, etc...
[22:03:32] Synthead: alexandernst: ultimately, development is quicker with spring, so you'll probably want to figure out why it's causing issues and fix that instead of permanently disabling spring (which is ultimately a workaround)
[22:03:53] Synthead: alexandernst: spring runs as a daemon on your machine, so I imagine you could probably run "rails s" without it
[22:04:15] alexandernst: maybe spring has some "scan and reload files on chages" option?
[22:04:38] Synthead: alexandernst: I think it's "DISABLE_SPRING=1 rails s"
[22:04:57] Synthead: alexandernst: yeah maybe. tbh, I've disabled spring (what I suggested against) :D
[22:05:18] alexandernst: Actually the file I'm woring on is in config/initializers/application.rb
[22:05:27] alexandernst: could be that spring just can't reload that file?
[22:05:34] Synthead: I'm not sure :)
[22:05:42] Synthead: ACTION doesn't use spring
[22:05:50] Synthead: ACTION should probably use spring, though
[22:06:10] bumao: has joined #ruby
[22:06:14] Synthead: ACTION brb
[22:06:44] alexandernst: Synthead: as I thought https://github.com/rails/spring/issues/378
[22:07:04] alexandernst: so... there's just nothing I can do about that, I should restart the app a few times until I patch the code
[22:07:35] symm-: has joined #ruby
[22:08:29] shevy: ].map { |x| /\A#{Rails.root.join(x)}\//.freeze }.freeze
[22:08:38] shevy: is that common practice in rails, the double freez?
[22:09:10] cdg: has joined #ruby
[22:12:16] skweek: has joined #ruby
[22:13:54] wrkrcoop: has joined #ruby
[22:15:03] dorje: has joined #ruby
[22:15:14] achamian: has joined #ruby
[22:16:17] Synthead: alexandernst: huzzah!
[22:17:46] Gasher: has joined #ruby
[22:18:41] Synthead: how can I get the netmask address from an IPAddr object?
[22:20:00] Guest38: has joined #ruby
[22:20:19] lupine: Synthead: IPAddr is generally rubbish, the ipaddress gem does better
[22:21:06] havenwood: shevy: freezing the array doesn't freeze each string inside, hence they deep freeze to freeze it through and through
[22:22:35] benlieb: has joined #ruby
[22:22:56] kalopsian: has joined #ruby
[22:23:02] Synthead: lupine: beautiful, there's a .netmask method that does exactly what I want
[22:24:38] binaryplease1: has joined #ruby
[22:24:58] hahuang65: has joined #ruby
[22:25:16] lupine: Synthead: here's the closest I got to getting 'ipaddr' to do the thing: IPAddr.new(IPAddr.new("10.0.0.0/24").instance_variable_get("@mask_addr"), Socket::AF_INET).to_s
[22:25:30] lupine: (don't ever do this)
[22:25:32] Synthead: yeah that's smelly
[22:25:53] Synthead: do NOT! ... go in there!
[22:25:56] wldcordeiro: has joined #ruby
[22:25:58] Synthead: woooOOOOOOOOooooooo
[22:26:27] Synthead: https://www.youtube.com/watch?v=GUfS_2UGftg
[22:26:42] certainty: has joined #ruby
[22:28:21] nankyokusei: has joined #ruby
[22:30:53] choke: has joined #ruby
[22:31:18] n_blownapart: has joined #ruby
[22:31:33] bumao: has joined #ruby
[22:35:17] snath: has joined #ruby
[22:35:51] sp4rrow: has joined #ruby
[22:38:22] mwlang: has joined #ruby
[22:39:57] malconis: has joined #ruby
[22:40:46] andybernard: has joined #ruby
[22:41:29] benlieb: has joined #ruby
[22:46:18] aberen: has joined #ruby
[22:49:04] tAn: has joined #ruby
[22:52:27] mistermocha: has joined #ruby
[22:53:54] kwatz: has joined #ruby
[22:54:09] destructure: has joined #ruby
[22:54:58] al2o3-cr: has joined #ruby
[22:56:47] LoneHermit: has joined #ruby
[22:58:09] skade: has joined #ruby
[23:00:40] tildes_: has joined #ruby
[23:02:04] dorje: has joined #ruby
[23:04:06] jaguarmagenta: has joined #ruby
[23:04:20] n_blownapart: has joined #ruby
[23:04:46] kies: has joined #ruby
[23:05:10] edwinvdgraaf: has joined #ruby
[23:08:50] nocco: has joined #ruby
[23:09:10] lxsameer: has joined #ruby
[23:09:12] seitensei: has joined #ruby
[23:09:33] Didac: has joined #ruby
[23:09:40] choke: has joined #ruby
[23:10:11] yfeldblum: has joined #ruby
[23:10:48] n_blownapart: has joined #ruby
[23:11:54] weemsledeux: has joined #ruby
[23:12:22] whathappens: has joined #ruby
[23:13:46] Asher: has joined #ruby
[23:22:05] djbkd: has joined #ruby
[23:23:08] djbkd: has joined #ruby
[23:23:23] pilne: i think i've found my perfect combination for now... ruby with go being used for bottlenecks instead of c (or rust if i need to get even tighter). SO HAPPY!
[23:23:50] jhass: looked at Crystal yet? :P
[23:23:56] n_blownapart: has joined #ruby
[23:24:31] jackjackdripper: has joined #ruby
[23:24:58] pilne: i have, a lot, i keep as up to date as I can :)
[23:25:48] kalopsian: has joined #ruby
[23:27:26] certainty: has joined #ruby
[23:28:20] pilne: i'd just not rather have "c" be something I have to work with for external libraries tbh, i'm a bit of a chickenshit when it comes to c and c++ honestly.
[23:28:32] SilverKey: has joined #ruby
[23:29:08] binaryplease1: has joined #ruby
[23:30:29] n_blownapart: has joined #ruby
[23:39:04] paulca: has joined #ruby
[23:39:39] koooge: has joined #ruby
[23:43:18] rkazak: has joined #ruby
[23:44:59] Darkman738: has joined #ruby
[23:46:02] cdg: has joined #ruby
[23:47:39] Darkman738: hi guys, quick question that I think the answer is no to. I've got some string 's = "#{first_name}, welcome..." being returned from a class where 'first_name' doesn't exist in that class, but does where I'm going to use it. I'm assuming there's no way to do interpolation this way?
[23:48:12] jhass: darkman738: right, you have to pass first_name as a parameter
[23:48:17] aberen: has joined #ruby
[23:48:22] jhass: in some way or another
[23:48:43] diegoviola: has joined #ruby
[23:48:47] Darkman738: that's what I expected, trying to figure out how best to handle this issue
[23:49:09] jackjackdripper: has joined #ruby
[23:49:16] jhass: showing your real code, both the class and the call side, could yield some suggestions
[23:49:18] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[23:49:42] Darkman738: I've got strings like this but I won't necessarily know whether it needs to be say first_name or last_name, etc
[23:50:10] Darkman738: I suppose I could just use a regex replace, but was looking to see if there was an easier way
[23:50:14] nocco: has joined #ruby
[23:50:16] benlieb: has joined #ruby
[23:50:19] flashpoint9: has joined #ruby
[23:51:03] jhass: looking for String#%?
[23:52:17] n_blownapart: has joined #ruby
[23:52:22] bmorrison: has joined #ruby
[23:52:47] Darkman738: yeah so I'll have a list of pre-fabed strings like "{first_name} says hello", "{first_name} {last_name} lives at {address}", etc
[23:52:55] Darkman738: I get to pick the format and such
[23:54:01] Darkman738: and there will be a finite elements (first_name, last_name, etc) so those aren't going to be out of control, I just need to figure out some way of putting the correct info into the string, which could be in any order and multiple elements
[23:54:28] Darkman738: but I guess I'll just go with some {} regex pattern
[23:54:55] Darkman738: does it in a few lines, just iterate over a hash of elements I guess
[23:54:56] vikaton: has joined #ruby
[23:55:34] jhass: >> "%{first_name}, welcome" % {first_name: "darkman738"}
[23:55:35] ruby[bot]: jhass: # => "darkman738, welcome" (https://eval.in/585774)
[23:55:44] terminal_: has joined #ruby
[23:56:28] rueben: has joined #ruby
[23:56:50] ruby[bot]: -bbb $a:|2701$#ruby-banned |meta!*@*$#ruby-banned |2701!*@*$#ruby-banned
[23:57:38] shevy: I never saw "%{first_name}, welcome" % {first_name: "darkman738"} before I think
[23:58:00] jhass: I explained it here at least a dozen times already...
[23:58:00] Darkman738: that's kinda neat
[23:58:20] Darkman738: sorry to make you repeat yourself
[23:58:26] wrkrcoop: if an error occurs do i want to use begin rescue end?
[23:58:36] jhass: no worries, was more responding to shevy
[23:58:54] jhass: wrkrcoop: if you can recover from it
[23:59:06] Darkman738: I'm a bit of a ruby n00b (as may be evident)
[23:59:58] wrkrcoop: jhass: hmmm well things depend on it so … i guess i couldn’t continue …