« Back to channel list

#ruby - 24 March 2016

« Back 1 day Forward 1 day »
[00:00:12] uglybandersnatch: has joined #ruby
[00:02:01] havenwood: mykeura: Here's a nice setup on Arch with chruby: https://gist.github.com/jhass/8839655bb038e829fba1
[00:02:23] havenwood: mykeura: https://github.com/postmodern/chruby#readme
[00:02:24] toretore: shevy: i'd say module, if it is purely to act as a namespace
[00:03:26] mykeura: Thanks havenwood.
[00:03:49] cjbottaro: has joined #ruby
[00:05:30] JoshGlzBrk: has joined #ruby
[00:07:00] chouhoulis: has joined #ruby
[00:07:12] ascarter: has joined #ruby
[00:10:58] jackjackdripper: has joined #ruby
[00:11:11] skweek: has joined #ruby
[00:11:45] jjturner: has joined #ruby
[00:13:22] CloCkWeRX: has joined #ruby
[00:13:24] cdg_: has joined #ruby
[00:16:07] Inside: has joined #ruby
[00:16:07] Inside: has joined #ruby
[00:16:18] n008f4g_: has joined #ruby
[00:17:32] agentmeerkat: has joined #ruby
[00:20:27] wldcordeiro: has joined #ruby
[00:23:17] northfurr: has joined #ruby
[00:24:59] A124: has joined #ruby
[00:25:31] mistermocha: has joined #ruby
[00:25:53] bob434: has joined #ruby
[00:26:41] idefine: has joined #ruby
[00:27:28] drewo: has joined #ruby
[00:29:27] BtcBen: has joined #ruby
[00:31:43] Azure: has joined #ruby
[00:33:20] someish: has joined #ruby
[00:35:24] someish: I’m just getting back into ruby after being away for a few years. I wanted to refresh my memory and learn some new tricks by reading someone elses code. Is there a gem that I would want to look at that is considered canon?
[00:35:50] Radar: someish: https://learnxinyminutes.com/docs/ruby/?
[00:36:19] someish: Radar: Looks concise. Thanks!
[00:37:46] diegoaguilar: has joined #ruby
[00:39:12] pawnbox: has joined #ruby
[00:40:42] Musashi007: has joined #ruby
[00:42:15] shevy: someish you could have a look at the source code of rack
[00:42:44] someish: shevy: Thanks. I’ll take a look at that after.
[00:42:49] Cohedrin: has joined #ruby
[00:45:09] Devalo: has joined #ruby
[00:48:46] rkazak: has joined #ruby
[00:49:29] jdawgaz: has joined #ruby
[00:50:04] baweaver: has joined #ruby
[00:52:43] lessless: has joined #ruby
[00:54:04] cjbottaro: has joined #ruby
[00:55:04] toretore: has joined #ruby
[00:55:18] havenwood: someish: Here's a Ruby quick ref as well: http://www.zenspider.com/Languages/Ruby/QuickRef.html
[00:55:35] barajasfab: has joined #ruby
[00:56:27] Salve: has joined #ruby
[00:57:00] bob434: has joined #ruby
[01:00:00] havenwood: someish: As for code here's a good read: https://github.com/jeremyevans/roda
[01:00:13] clorisu: anyone know whats going on here https://ghostbin.com/paste/nadh4
[01:00:29] Radar: ?rails clorisu
[01:00:29] ruby[bot]: clorisu: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[01:00:45] Radar: clorisu: What's that on line 3 of your model?
[01:01:09] clorisu: looks like a hashed password
[01:01:51] htmldrum: has joined #ruby
[01:01:52] htmldrum_: has joined #ruby
[01:03:21] chouhoulis: has joined #ruby
[01:04:08] idefine: has joined #ruby
[01:04:52] ledestin: has joined #ruby
[01:06:11] patrick-sartent: has joined #ruby
[01:08:09] jottr: has joined #ruby
[01:08:25] freerobby: has joined #ruby
[01:08:43] hotpancakes: has joined #ruby
[01:09:20] yoshie902a: has joined #ruby
[01:12:01] halfamind: has joined #ruby
[01:13:31] rbennacer: has joined #ruby
[01:14:06] blackgoat: has joined #ruby
[01:14:37] yeoh: has joined #ruby
[01:17:04] avenj: has joined #ruby
[01:17:29] northfurr: has joined #ruby
[01:18:49] kam270: has joined #ruby
[01:19:02] baweaver: has joined #ruby
[01:20:19] drewo: has joined #ruby
[01:20:48] nchambers: has joined #ruby
[01:21:18] bougyman: ok, why have I never had to do this before?
[01:21:45] bougyman: how do subtract a time (from a timer, not from wall time) from another? google just shows me DateTime/Time stuff.
[01:22:08] bougyman: but that doesn't help for "this took 1:27.16, that took 4:31.12", what's the difference in seconds?
[01:22:16] yoshie902a: has left #ruby: ()
[01:22:33] bougyman: I've used postgres ::interval math for this before, but never ruby
[01:23:13] bougyman: manveru: ^ ?
[01:23:33] bougyman: oh hell it's early in the morning hours for him.
[01:24:07] snowy: has joined #ruby
[01:24:32] mistermocha: has joined #ruby
[01:24:33] Tref: has joined #ruby
[01:24:35] monoprotic: bougyman cant you subtract Time objects
[01:24:55] bougyman: yes but this is 1 minute, 27.16 seconds
[01:25:09] bougyman: from 4 minutes, 31.22 seconds
[01:25:18] bougyman: I guess I could coerce them into full Time objects.
[01:25:48] monoprotic: you could use math to represent the time in seconds if you'd rather do that
[01:25:50] monoprotic: then subtract
[01:26:09] mallu: has joined #ruby
[01:28:30] vikas027: has joined #ruby
[01:28:55] bougyman: Time.parse('0:4:03.21') - Time.parse('0:1:47.22')
[01:29:00] bougyman: it's the right answer
[01:29:05] bougyman: just looks so wrong
[01:30:42] monoprotic: add 0s in the string ot make it look more normal if you want
[01:30:47] patrick-sartent: has joined #ruby
[01:31:20] chipotle: has joined #ruby
[01:33:20] uglybandersnatch: has joined #ruby
[01:35:02] tpendragon: has joined #ruby
[01:35:04] shevy: bougyman don't you have wrong formatting there?
[01:38:21] idefine: has joined #ruby
[01:39:03] Es0teric: has joined #ruby
[01:40:39] nchambers: has joined #ruby
[01:40:51] Musashi007: has joined #ruby
[01:42:19] jdawgaz: has joined #ruby
[01:47:28] elifoster: has joined #ruby
[01:49:48] hotpancakes: has joined #ruby
[01:51:43] kam270: has joined #ruby
[01:54:53] nchambers: has joined #ruby
[01:54:55] Maletor: has joined #ruby
[01:56:38] graffix: has joined #ruby
[01:57:28] sneakerhax: has joined #ruby
[01:59:24] hotpancakes: has joined #ruby
[02:01:15] pabs: has joined #ruby
[02:01:41] cjheath: has joined #ruby
[02:02:01] cjheath: Upgraded to Ruby 2.2.2, seeing strange issues with class << self (exception “wrong argument type nil (expected Symbol)”). Fixed it in my code by calling singleton_class, but now it’s biting in RSpec. Anyone else seen this?
[02:05:08] rbennacer: has joined #ruby
[02:07:27] htmldrum: has joined #ruby
[02:07:28] htmldrum_: has joined #ruby
[02:09:08] pawnbox: has joined #ruby
[02:10:22] watersoul: has joined #ruby
[02:11:13] patrick-sartent: has joined #ruby
[02:11:31] leon_e: has joined #ruby
[02:13:56] BtcBen: has joined #ruby
[02:14:07] stannard: has joined #ruby
[02:17:39] Tref: has joined #ruby
[02:18:31] Gasher: has joined #ruby
[02:18:37] Regulati_: has joined #ruby
[02:22:25] kobain: has joined #ruby
[02:23:15] northfurr: has joined #ruby
[02:24:12] dc2: has joined #ruby
[02:24:21] snowy: has joined #ruby
[02:24:59] Uber|Dragon: has joined #ruby
[02:29:54] mank: has joined #ruby
[02:30:30] razer_: has joined #ruby
[02:31:06] User458764: has joined #ruby
[02:31:07] razer_: Has anyone made a program for mac that can package a ruby file in a .app folder structure?
[02:31:19] razer_: I found a general purpose program that could do any scripts, but it didn't work.
[02:31:33] htmldrum: has joined #ruby
[02:31:34] htmldrum_: has joined #ruby
[02:31:43] razer_: I also tried replacing other folder with my ruby file and fixing things and it would tell me my app was powerpc
[02:32:28] razer_: That is cool there is a ruby image in the background somehow. I didn't know IRC could do that.
[02:36:11] `tim`: has joined #ruby
[02:36:57] jeffreylevesque: has joined #ruby
[02:38:25] jeffreylevesque: has left #ruby: ()
[02:38:38] Musashi007: has joined #ruby
[02:39:23] andywojo: has joined #ruby
[02:40:45] cdg: has joined #ruby
[02:40:47] KnownSyntax: has joined #ruby
[02:40:50] KnownSyntax: has joined #ruby
[02:44:35] Ox0dea: has joined #ruby
[02:44:50] Gasher: has joined #ruby
[02:45:12] halfamind: has joined #ruby
[02:45:44] devbug: has joined #ruby
[02:46:06] Devalo: has joined #ruby
[02:47:07] northfurr: has joined #ruby
[02:51:19] Melpaws: has joined #ruby
[02:51:37] nanoz: has joined #ruby
[02:52:29] Melpaws: hi. Can i get schooled in some regex matching for a string ? Gist of the code and content i'm attempting https://gist.github.com/dylnnlsn/fd2a47ad95b1e59b93cd .
[02:52:44] silentpost: has joined #ruby
[02:52:49] Melpaws: cannot seem to get what i'm looking for :(
[02:53:57] Ox0dea: Melpaws: You've got unescaped *s in your values.
[02:54:18] Radar: TIL: Tempfile.new in Ruby 2.3 accepts no args, but in 2.2 it must be supplied with at least 1.
[02:54:57] jcdesimp: has joined #ruby
[02:55:14] Melpaws: would i escape those in the variables (value1 and value2) ?
[02:56:05] Ox0dea: Radar: Can't confirm?
[02:56:21] Radar: ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin15]
[02:56:21] diegoaguilar: has joined #ruby
[02:56:43] Radar: Or maybe I did 2.2.2?
[02:57:06] Radar: Nope, 2.2.4 requires Tempfile.new to be passed one arg.
[02:57:08] Ox0dea: Well, Tempfile.new still takes an argument on 2.3.
[02:57:21] Radar: I had a test pass on my machine (running 2.3) but fail on CI (running 2.2)
[02:57:38] Ox0dea: Ah, I misinterpreted "accepts no args".
[02:58:13] Ox0dea: Melpaws: Probably best to use Regexp.escape where you're interpolating them.
[02:58:30] patrick-sartent: has joined #ruby
[02:59:05] toretore: Melpaws: https://eval.in/541604
[03:00:42] Melpaws: ah . Beautiful
[03:02:06] Ox0dea: Melpaws: Regexp.union(value1, '(.+?)', value2) is a little less noisy, but the principle's the same.
[03:02:20] Ox0dea: Er, ignore that.
[03:03:44] Ox0dea: It does do the escaping, but you just want concatenation here, which isn't quite what that method does.
[03:04:33] Melpaws: thanks . I will further into it . Regex makes my head spin sometimes ^>^
[03:04:53] Ox0dea: It's really a programming language all its own.
[03:06:20] Ox0dea: >> :!@ == '!@'.to_sym
[03:06:22] ruby[bot]: Ox0dea: # => false (https://eval.in/541605)
[03:06:38] Es0teric: has joined #ruby
[03:06:58] djbkd: has joined #ruby
[03:08:41] drewo: has joined #ruby
[03:11:44] David27: has joined #ruby
[03:12:09] uglybandersnatch: has joined #ruby
[03:12:38] duncannz: has joined #ruby
[03:13:28] blackmesa: has joined #ruby
[03:13:45] statelesscode: has joined #ruby
[03:13:51] patrick-sartent: has joined #ruby
[03:14:19] safe: has joined #ruby
[03:17:29] mondok: has joined #ruby
[03:18:39] Eiam: has joined #ruby
[03:19:46] pawnbox: has joined #ruby
[03:19:53] baweaver: has joined #ruby
[03:20:38] idefine: has joined #ruby
[03:21:04] halfamind: has joined #ruby
[03:22:29] SenpaiSilver: has joined #ruby
[03:24:48] ruby[bot]: -bb lq!*@*$#ruby-banned *!*@gateway/web/cgi-irc/kiwiirc.com/ip.119.157.142.112$#ruby-banned
[03:27:22] Yzguy: has joined #ruby
[03:27:38] Caerus: has joined #ruby
[03:28:53] patrick-sartent: has joined #ruby
[03:29:22] fedexo: has joined #ruby
[03:29:46] graffix: has left #ruby: ()
[03:30:01] BrunoSaboia: has joined #ruby
[03:30:50] wilbert: has joined #ruby
[03:32:33] bopr: has joined #ruby
[03:33:24] bopr: i'm having the strangest behavior in my "gets"
[03:34:00] freerobby: has joined #ruby
[03:34:02] bopr: when i print something to the screen followed by a gets, the console is blank, but after the next instruction comes in, then the program continues
[03:34:14] arescorpio: has joined #ruby
[03:35:48] ramfjord: has joined #ruby
[03:35:57] blackgoat: has joined #ruby
[03:37:25] SenpaiSilver: has joined #ruby
[03:39:05] jdawgaz: has joined #ruby
[03:40:09] kinduff: has joined #ruby
[03:40:40] Ox0dea: bopr: Could you post a minimal example which doesn't behave as you expect?
[03:40:45] rubynewbie: has joined #ruby
[03:42:20] bopr: Ox0dea: basically I have a puts statement before a gets, and when i run the program i don't see the puts statement until i hit return. really weird. https://gyazo.com/25dd0d640f95a45dc8c48bd2a471c446
[03:42:21] rubynewbie: I need help with control flow on this guessing game that I am building. Even if you guess the proper number, it will continue to play the game and ask you to guess again. Here is my source code: http://pastebin.com/hdZA0hUN
[03:42:22] ruby[bot]: rubynewbie: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/bb1cce633d9f58973c9f
[03:42:23] ruby[bot]: rubynewbie: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[03:43:00] codecop: has joined #ruby
[03:43:02] mank: has joined #ruby
[03:43:53] bopr: Ox0dea: i've narrowed it down to the puts that is causing issues. Working on something more complex with a prompt right now, and i can't see any puts "results" until i quit the program. infuriating.
[03:44:02] shevy: rubynewbie I tried your code. it exited when I input the right number
[03:44:23] rubynewbie: shevy: Did you run it from the command line?
[03:44:25] bopr: i have ruby 2.2.4p230 on windows 10 x64
[03:44:28] shevy: rubynewbie yeah always
[03:44:37] shevy: rubynewbie what I do not understand is why you add +1 to the number
[03:44:38] rubynewbie: I ran the program on command prompt. Windows 10
[03:45:01] rubynewbie: shevy: I actually made a dice rolling program right before and deleted it.
[03:45:14] rubynewbie: shevy: It is made in the same file
[03:45:23] rubynewbie: So I had a rolling method
[03:45:29] kalimotxo: has joined #ruby
[03:45:56] rubynewbie: I just didn't erase that part. Thanks for catching it
[03:46:05] shevy: yeah that one works because rand(6) will also return 0 sometimes
[03:46:47] rubynewbie: Oh yeah! I gotta add the rand in there for this program still
[03:47:22] rubynewbie: So it should look like this: number_to_guess = 1 + (max_number)
[03:47:55] rubynewbie: number_to_guess = 1 + rand(max_number)
[03:48:10] ericn81: has joined #ruby
[03:48:35] shevy: I don't understand you
[03:49:29] shevy: you ask the user for a number, then you add +1 to it
[03:49:42] Ox0dea: bopr: Post code.
[03:49:45] bopr: Ox0dea: I've narrowed down the problem to the command prompt. basically "Git bash" which i'm using now for some reason likes the "gets" to execute before "puts" but it works fine in command prompt
[03:49:48] rubynewbie: Because it is going to generate a number between 1 and the max number
[03:50:00] Maletor: has joined #ruby
[03:50:10] rubynewbie: shevy: The max number part is to make the program easier/harder, depending on the difficulty the user wants.
[03:50:26] rubynewbie: So they can make it a random number between 1-10 or 1-10000 if they wanted
[03:50:49] patrick-sartent: has joined #ruby
[03:51:46] bopr: Ox0dea: the window on the right is waiting for input, the one on the left first printed "what is your name" and is waiting for input. window on the right isn't displaying the "what is your name":
[03:52:16] patrick-sartent: has joined #ruby
[03:52:18] abort: has joined #ruby
[03:53:01] Ox0dea: bopr: The problem is either your environment or the code on the lines you didn't show in that image.
[03:53:56] bopr: Ox0dea: it's definitely the environment that's messing it up. Can you recommend me a better command prompt for windows? I like to be able to resize text size easily
[03:54:10] fullofca_: has joined #ruby
[03:55:44] Ox0dea: bopr: Are you sure? If you posted the full program that's giving you trouble, I could help you check that assumption.
[03:56:53] Ox0dea: rubynewbie: Yes, you'll want to use something like `rand(1..max_number)`, but your loop logic is way off.
[03:56:59] bopr: Ox0dea: the other lines were just debug that i 100% commented out. The program is literally 3 lines. After i did the side by side comparison i am confident the prompt that i was using was messing with the input
[03:57:13] Ox0dea: rubynewbie: For starters, you're checking the guess against `max_number` rather than `number_to_guess`.
[03:57:34] bopr: really appreciate your help though! I'm totally in love with ruby. When i learned hash tables can be created with one line I was in love
[03:58:31] bopr: everything is working perfectly in cmd!
[03:58:55] abort: has joined #ruby
[03:59:18] Ox0dea: bopr: Try putting a `STDOUT.flush` in after the first #puts call.
[03:59:24] binaryplease2: has joined #ruby
[03:59:34] patrick-sartent: has joined #ruby
[03:59:51] Inside: has joined #ruby
[03:59:51] Inside: has joined #ruby
[04:00:08] bopr: wow Ox0dea that actaully worked!
[04:00:18] Ox0dea: Yay! Your terminal's buffering semantics are weird.
[04:00:42] bopr: Ox0dea: what terminal are you using? I wanna be pro like you
[04:00:48] abort: has joined #ruby
[04:00:55] fullofcaffeine: has joined #ruby
[04:01:18] Ox0dea: bopr: I use st, but that's largely irrelevant. Most terminals are line-buffered by default, but maybe yours has a setting or something.
[04:02:26] TheNet: has joined #ruby
[04:02:32] leon_e: has joined #ruby
[04:02:41] bopr: Ox0dea: it's an "xterm" terminal on MINGW64 and i don't see any buffer options unfortunately
[04:02:47] drewo: has joined #ruby
[04:04:26] joneshf-laptop: has joined #ruby
[04:04:44] bopr: Ox0dea: thank you so much for your help, i won't forget :)
[04:04:58] Ox0dea: bopr: The "real" xterm is pretty sane, but it does observe various escape sequences which change the mode it's in; maybe that's what happened? Hard to say from here.
[04:05:36] Ox0dea: Anyhow, glad you got it sorted. :) Probably figure out how to get your terminal to be line-buffered before proceeding; having to preemptively flush stdout after every write "just in case" is full of suck.
[04:06:09] DonOtreply: has joined #ruby
[04:06:57] bopr: Ox0dea: i'm gonna fix my vagrant lubuntu environment and go full linux in the future. can't stand the stupid "automatic updates need a restart" of w10
[04:07:06] baweaver: has joined #ruby
[04:07:50] Ox0dea: bopr: I think that's a great idea.
[04:08:20] abort: has joined #ruby
[04:11:22] dexteryy: has joined #ruby
[04:13:06] dexteryy: has joined #ruby
[04:13:17] cjbottaro: has joined #ruby
[04:14:18] Musashi007: has joined #ruby
[04:14:36] moei: has joined #ruby
[04:14:40] braincrash: has joined #ruby
[04:15:14] dexteryy: has joined #ruby
[04:16:17] abort: has joined #ruby
[04:16:42] dexteryy: has left #ruby: ()
[04:22:13] shevy: w10 is a good starter for linux!
[04:23:06] nhhc: has joined #ruby
[04:23:42] leon_e: has joined #ruby
[04:23:49] treaki__: has joined #ruby
[04:26:09] agentmeerkat: has joined #ruby
[04:26:55] mistermocha: has joined #ruby
[04:27:00] crowell: has joined #ruby
[04:27:33] andywojo: has joined #ruby
[04:28:22] abort: has joined #ruby
[04:29:55] aspiers: has joined #ruby
[04:30:28] brentw: has joined #ruby
[04:30:42] brentw: Hi, had a question regarding accessing an instance variable from one class, inside another class
[04:33:34] brentw: I have a board class w/ an @grid to represent the board. I want to access @grid in a method in another class to make a list of all the possible [row, col] combinations
[04:33:54] Hue_: has joined #ruby
[04:34:11] shevy: you access through a method
[04:34:22] Hue_: Anyone online rn?
[04:34:45] pawnbox: has joined #ruby
[04:35:14] brentw: can you elaborate
[04:35:20] brentw: @grid is an attr_accesor
[04:37:03] shevy: attr_accessor is still a method
[04:37:17] pawnbox: has joined #ruby
[04:37:48] shevy: brent_ good explanation here http://stackoverflow.com/a/4371458/722915
[04:37:55] brentw: so both the board and player class are initialized as parameters when you initialize the game class
[04:38:03] shevy: yes that is one way
[04:39:45] Yzguy: has joined #ruby
[04:42:14] brentw: shevy http://hastebin.com/wuratuhaqa.rb this is the player class and how the game glass is created with it and board
[04:42:41] brentw: how do i reference the board instance in the player class?
[04:43:46] brentw: is how i did workable, 'board.grid'
[04:44:21] merida: has joined #ruby
[04:44:47] howdoi: has joined #ruby
[04:45:02] stannard: has joined #ruby
[04:45:15] shevy: yes you invoke the method called .grid there
[04:45:38] brentw: i understand that part
[04:45:52] shevy: ok but you have no method called board there
[04:46:02] shevy: so board.grid will evaluate to nil.grid
[04:46:18] brentw: in my mind board should be the instance of the Board class it's calling .grid on
[04:46:30] gix: has joined #ruby
[04:46:32] shevy: yes you try that via @board = board
[04:46:38] shevy: but then you don't make use of @board
[04:46:54] shevy: you probably forgot a attr_accessor :board
[04:47:35] brentw: so my question is, if i added :board to attr_accessor
[04:47:38] brentw: and left the rest as is
[04:47:51] shevy: brent_ it may be easier if you write a class called Game that will handle all the different classes
[04:48:01] brentw: would it reference the correct board, even though I"m not passing a board instance as an argument to ComputerPLayer?
[04:48:04] shevy: you only need one instance of the game board
[04:48:20] shevy: you are not passing the board to ComputerPlayer
[04:48:24] shevy: so how can it know about it?
[04:48:46] dc2: has joined #ruby
[04:49:08] brentw: so i'm only initializing ComputerPLayer inside the game class, which has attr_accessor :player :board
[04:49:13] shevy: store @board as class level instance variable on class Game and call to it
[04:49:25] griffindy: has joined #ruby
[04:50:02] shevy: you can then access to it via Game.board, then you no longer need to use @board elsewhere
[04:52:51] brentw: so what if i did inside Game: def self.board_grid; @board.grid;end
[04:53:24] Ox0dea: Well, that's exactly what #attr_reader is for.
[04:54:00] shevy: brent_ yes that will work but you have to make sure that @board is initialized too
[04:54:13] brentw: then I could call Game.board_grid.each_with_index
[04:54:33] brentw: so board is initialized at the when you initialize Game
[04:59:13] yatish27: has joined #ruby
[04:59:34] pawnbox: has joined #ruby
[05:01:16] DiCablo: has joined #ruby
[05:03:11] codecop: has joined #ruby
[05:04:47] nocontrol: has joined #ruby
[05:05:15] Musashi007: has joined #ruby
[05:05:28] krz: has joined #ruby
[05:06:31] brentw: appreciate your help shevy
[05:07:44] brentw: so the fact that Board and PLayer are being initialized at the same time within game, should allow the Player to access Game.board_grid within it's methods w/out having been passed any instance of Game/Board
[05:08:00] abort: has joined #ruby
[05:08:18] aspiers_: has joined #ruby
[05:10:33] sauvin: has joined #ruby
[05:12:05] shevy: yeah that is one way
[05:12:20] shevy: you could also pass the instance to each player when you invoke .new
[05:12:25] shevy: and there are probably more ways still
[05:12:31] shevy: you could even use $vars!
[05:12:41] abort: has joined #ruby
[05:12:56] TheNet: has joined #ruby
[05:12:57] shevy: or @@vars ... but these I hate
[05:13:14] rrrepsaj: has joined #ruby
[05:13:32] dionysus69: has joined #ruby
[05:13:58] tildes: has joined #ruby
[05:14:12] blackmesa: has joined #ruby
[05:14:43] ascarter: has joined #ruby
[05:14:45] pawnbox: has joined #ruby
[05:14:57] abort: has joined #ruby
[05:15:04] mleung: has joined #ruby
[05:16:05] brentw: so the reason i didn't want to pass an instance of board to player is because they're being initialized at the same time as arguments to another method
[05:16:23] LoneHermit: has joined #ruby
[05:16:34] brentw: so Game.new(Player.new, Board.new)
[05:17:42] jamw: has joined #ruby
[05:18:30] abort: has joined #ruby
[05:18:45] hotpancakes: has joined #ruby
[05:21:04] brentw: @@vars are class variables, right? and $var global?
[05:21:56] abort: has joined #ruby
[05:22:34] fullofcaffeine: has joined #ruby
[05:23:52] Yzguy: has joined #ruby
[05:25:56] guatajuk: has joined #ruby
[05:26:08] leon_e: has joined #ruby
[05:26:20] hotpancakes: has joined #ruby
[05:27:40] ascarter: has joined #ruby
[05:27:55] Ox0dea: brent_: Player shouldn't have to know anything about Board; use Game to coordinate them.
[05:28:58] brentw: thats what i'm going for
[05:29:34] brentw: so is my above Game class method to return @board.grid the best solution?
[05:32:18] Ox0dea: brent_: Board just needs an `attr_reader :grid`, unless I've missed some nuance.
[05:32:29] hk238: has joined #ruby
[05:33:25] brentw: it does have that
[05:33:41] brentw: so how would reference that inside another class?
[05:33:56] brentw: i'm just struggling to get my head around this concept
[05:34:28] krz: has joined #ruby
[05:34:46] ninjaaron: has joined #ruby
[05:35:38] ninjaaron: Is there an easy way to unpack array items for printf()?
[05:36:31] ninjaaron: kind of like str.format(*mylist) would do in python.
[05:36:32] brentw: 0x0dea http://hastebin.com/ililobolem.rb Has the different classes in 1 file
[05:36:41] brentw: i split the files by a hash line
[05:37:55] Ox0dea: >> '%d %f' % [42, 3.14] # ninjaaron
[05:37:56] ruby[bot]: Ox0dea: # => "42 3.140000" (https://eval.in/541629)
[05:38:20] ninjaaron: Ox0dea: thanks. great.
[05:38:27] Ox0dea: Sure thing.
[05:42:15] ericli: has joined #ruby
[05:42:18] Ox0dea: brent_: A simpler game for demonstration purposes: https://eval.in/541630
[05:42:30] finisherr: has joined #ruby
[05:42:41] ericli: Hi, which class is to run command and capture output/check return value etc.. ?
[05:42:53] ur5us: has joined #ruby
[05:43:12] ascarter: has joined #ruby
[05:43:30] Ox0dea: Structuring it such that the computer is just a subclass of Player with custom logic for making a move keeps things pretty clean.
[05:44:19] Ox0dea: &ri Open3 ericli
[05:44:19] `derpy: ericli: http://ruby-doc.org/stdlib-2.3.0/libdoc/open3/rdoc/Open3.html
[05:45:03] ninjaaron: Ox0dea: I'm always trying to use perl idioms in ruby, because people always talk about the influence of perl syntax on ruby (which is significant), but a lot of things are at lot more like python. Maybe I should just do a tutorial and learn ruby for real...
[05:45:18] Ox0dea: ninjaaron: Yeah, that seems like a good idea. :)
[05:45:24] Musashi007: has joined #ruby
[05:45:30] ericli: I saw someone is using Mixlib::ShellOut
[05:45:48] ramfjord: has joined #ruby
[05:45:57] LoneHermit: has joined #ruby
[05:46:08] Ox0dea: ninjaaron: Ruby is quite the hodge-podge, but *good* Ruby code tends to let the Smalltalk and Lisp influences shine through over the Perl one.
[05:47:11] Ox0dea: ericli: If you want an external dependency for what a standard library can do just as well, that's entirely your prerogative. Mixlib does provide various conveniences, but are you sure you need them?
[05:47:54] ericli: Ox0dea, I need to run a command then print out the output also check the return value
[05:48:08] Ox0dea: ericli: Yep, I read that part.
[05:48:13] ninjaaron: Ox0dea: I kind of like perl. I know that makes me a bad person, but I can't help it. I started programming with BASH, and perl is sort of like bash+sed+awk with more helpful types.
[05:50:14] ur5us: has joined #ruby
[05:50:21] Ox0dea: ninjaaron: No, I don't see why that should make you a bad person. It's a tool like any other, and I'm sure the strengths and weaknesses balance, give or take.
[05:50:29] brentw: 0x0dea, i appreaciate your help, i have to go, but may try and bug you about this again next time i see you on
[05:50:51] Ox0dea: brent_: No worries. I'll see you around. :)
[05:51:22] drewo: has joined #ruby
[05:51:27] brentw: have a good night
[05:52:07] ninjaaron: Ox0dea: yeah. Perl doesn't scale super well, but for short scripts, it's pretty great. It's almost like the shorter the script is, the more awesome perl becomes, especially if the task is related to text transformation.
[05:53:01] uglybandersnatch: has joined #ruby
[05:54:08] Ropeney: ninjaaron, untill you need to remember how it does what it does
[05:54:17] Ox0dea: ninjaaron: Ruby was rather explicitly designed to ensure it met that niche, and I think it does so quite well.
[06:03:53] Salve: has joined #ruby
[06:04:39] vqrs: has joined #ruby
[06:04:47] Disavowed: has joined #ruby
[06:06:21] ericli: hi, how do I know what external Modules do I have in my ruby env?
[06:08:45] mgorbach: has joined #ruby
[06:09:20] astrobun_: has joined #ruby
[06:10:04] the_drow: has joined #ruby
[06:10:47] valetudo: has joined #ruby
[06:10:50] fdisc: has joined #ruby
[06:11:37] ericli: Ox0dea, seems I cannot use open3
[06:11:56] ericli: Open3.capture2("factor", :stdin_data=>"42") , uninitialized constant Open3 (NameError)
[06:12:11] ericli: is that a standard module or I have to install it?
[06:13:07] Ox0dea: ericli: It's part of the standard library; you have to `require` it.
[06:13:13] dionysus69: has joined #ruby
[06:13:17] htmldrum: has joined #ruby
[06:13:19] htmldrum_: has joined #ruby
[06:13:27] ericli: Ox0dea, how do I know what modules do I have in my env?
[06:13:55] Ox0dea: ericli: You want the list of all instances of the Module class in your currently running program?
[06:14:20] jamw: has joined #ruby
[06:14:45] ericli: Ox0dea, well, I would like to know what modules I have installed in my ruby env
[06:15:01] blackmesa: has joined #ruby
[06:15:19] Ox0dea: ericli: I think you want `gem list`?
[06:15:42] andywojo: has joined #ruby
[06:17:01] pablo: has joined #ruby
[06:17:23] pablo: which is the simplest active representer gem, these days?
[06:18:47] Musashi007: has joined #ruby
[06:18:53] Ox0dea: pablo: Roar seems to fit the bill.
[06:19:13] agentmeerkat: has joined #ruby
[06:20:02] pablo: Roar, seems like a serializing/deserializing gem to me
[06:20:03] cjbottaro: has joined #ruby
[06:20:17] Es0teric: has joined #ruby
[06:20:34] pablo: 0xdea, so far I have found this: https://github.com/neighborland/pres
[06:24:16] rmulligan: has joined #ruby
[06:25:09] ericli: Ox0dea, I am using ruby 1.8.7 and I can do require 'open3' but could don't use any method: http://fpaste.org/344481/88006961/
[06:25:11] Ox0dea: pablo: Ah, you meant "presenter", then. Have you found that one to be deficient, or?
[06:25:19] Ox0dea: ericli: Why 1.8.7?
[06:25:29] fullofcaffeine: has joined #ruby
[06:25:29] Radar: ericli: Capital O.
[06:26:00] ericli: Radar, no, even Open3 still does not work.
[06:26:13] ericli: Ox0dea, it'a RHEL machine and just using 1.8.7
[06:26:22] ericli: any idea why this does not work?
[06:26:39] merida_: has joined #ruby
[06:26:45] Radar: What happens when you try capital o
[06:27:07] ericli: NoMethodError: undefined method `capture2e' for Open3:Module
[06:27:46] Radar: Likely that the method was only added in a recent version of Ruby
[06:27:49] Ox0dea: ericli: It's called `poutput2e` on 1.8.7.
[06:27:50] Radar: Upgrade your Ruby version
[06:27:52] Radar: And with that, goodnight.
[06:28:41] Macaveli: has joined #ruby
[06:29:14] ericli: Ox0dea, where can I find poutput2e doc?
[06:29:49] Ox0dea: ericli: It's the same method as `capture2e`, it's just been renamed since 1.8.7.
[06:29:53] cd-rum: has joined #ruby
[06:30:08] Ox0dea: You really should consider upgrading unless you're a masochist.
[06:30:15] Ox0dea: And even then, there are better hurts to be had.
[06:30:24] ericli: Ox0dea, okay.. so what about other methods in open3? I think it would be better to get a doc.
[06:34:23] TheNet: has joined #ruby
[06:35:38] Dimik: has joined #ruby
[06:37:14] yfeldblum: has joined #ruby
[06:38:37] patrick-sartent: has joined #ruby
[06:40:17] ericli: thanks, I updated
[06:42:54] pablo: Ox0dea, seems underdocumented also, uses method missing, which I don't like.
[06:43:08] haraoka: has joined #ruby
[06:43:49] LoneHerm_: has joined #ruby
[06:44:38] toretore: why don't you like method_missing?
[06:45:11] djbkd: has joined #ruby
[06:46:46] pablo: I rather have the least possible magic, although you probably end up using indirectly somewhere...
[06:46:53] htmldrum: has joined #ruby
[06:46:55] htmldrum_: has joined #ruby
[06:47:54] Dimik: hey guyze
[06:48:18] tAn: has joined #ruby
[06:48:49] JohnBat26: has joined #ruby
[06:48:51] Dimik: maybe some one awake i'm thinking of how to convert basketball time string "3rd 9:59" to seconds integer
[06:49:03] ayonkhan: has joined #ruby
[06:49:05] Dimik: where "3rd" is 3rd quater of the game
[06:50:07] Dimik: so that'd be something like 12(60) + 12(60) + 9(60) + 59
[06:50:30] Ox0dea: Seems like you've got everything you need?
[06:50:50] Dimik: pretty much exept for not a clue on how to put it together
[06:51:14] UKn0Me: has joined #ruby
[06:51:48] Dimik: for instance how to let ruby know thar "3rd" means 12(60) + 12(60)
[06:51:57] djbkd: has joined #ruby
[06:52:18] Ox0dea: >> p, m, s = '3rd 9:59'.scan(/\d+/).map(&:to_i); p.pred * 720 + m * 60 + s # Dimik
[06:52:19] ruby[bot]: Ox0dea: # => 2039 (https://eval.in/541655)
[06:52:37] toretore: so you can have a string that starts with "1st", "2nd", "3rd" or "4th"
[06:52:43] Ox0dea: Dimik: But, er, what exactly does that represent?
[06:52:50] Ox0dea: That's neither elapsed time nor time remaining.
[06:52:58] Dimik: those are the quarters of the game, each quarter is 12 minutes
[06:53:04] toretore: then a space, and then two numbers representing minutes and seconds separated by a :
[06:54:02] hightower3: has joined #ruby
[06:54:04] Dimik: you guys are genius, i want to be just like you when i grow up
[06:54:09] toretore: to simplify, you can say that the "quarter" and "elapsed time" parts are separated by a string
[06:54:45] toretore: by a space, i mean
[06:55:06] Ox0dea: Alternatively, just pluck out the numbers...
[06:55:14] Dimik: yeah that'd be great
[06:55:39] toretore: which is like using Time.parse, crossing your fingers and hoping for the best ;)
[06:55:43] mr_robot_: has joined #ruby
[06:56:03] toretore: to be successful at computer you must think like computer
[06:56:16] uglybandersnatch: has joined #ruby
[06:56:52] toretore: computer think only concrete, discrete thing, human think abstract and vague
[06:57:17] ericli: how do I check if a string matches a regexp pattern? seems if str =~ /exp/ does not work.
[06:57:33] Ox0dea: ericli: Like that.
[06:58:05] toretore: >> "string" =~ /str/
[06:58:07] ruby[bot]: toretore: # => 0 (https://eval.in/541657)
[06:59:04] ericli: >> "pid 7702 exit 0" =~ /exit 0/
[06:59:20] ericli: does not work?
[07:00:04] toretore: >> "pid 7702 exit 0" =~ /exit 0/
[07:00:05] ruby[bot]: toretore: # => 9 (https://eval.in/541658)
[07:03:38] ericli: so what I'm trying to do is to get the exit status by using Open3.capture2e
[07:03:48] ericli: but the doc does not mention how to get exit status
[07:03:49] jorum: has joined #ruby
[07:03:51] toretore: gist your code
[07:04:16] ericli: toretore, fixed already, using .to_i == 0 to check
[07:04:27] ericli: but I'm confused that the doc does not mention that
[07:04:34] ericli: I googled some then I know.
[07:05:27] nocontrol: has joined #ruby
[07:06:08] Ox0dea: ericli: Process::Status has #success?, for what that's worth.
[07:06:13] pawnbox: has joined #ruby
[07:06:14] poguez_: has joined #ruby
[07:06:28] Ox0dea: >> ['.success?', '.to_i == 0'].map(&:size)
[07:06:29] ruby[bot]: Ox0dea: # => [9, 10] (https://eval.in/541665)
[07:06:33] Ox0dea: And it's even shorter!
[07:06:42] Ox0dea: Ruby loves you and wants you to be happy.
[07:06:42] Devalo: has joined #ruby
[07:06:50] ericli: Ox0dea, I am using .to_i to check the exit code, is that reliable?
[07:07:06] ericli: rollback_msg, ollback_status = Open3.capture2e("#{rollback_cmd}")
[07:07:24] ericli: if yinst_rollback_status.to_i == 0
[07:07:34] Ox0dea: ericli: If you want the actual exit code, sure, but you're just checking whether or not the command succeeded.
[07:07:40] ericli: is that okay?
[07:07:54] ericli: Ox0dea, yes, just wanna know if it is succeeded.
[07:08:05] Ox0dea: ericli: There's a method for that. :P
[07:08:15] hotpancakes: has joined #ruby
[07:08:24] ericli: Ox0dea, you mean to_i == 0 ?
[07:09:53] cdikny: has joined #ruby
[07:11:57] lkba: has joined #ruby
[07:13:27] futilegames: has joined #ruby
[07:16:32] nocontrol: has joined #ruby
[07:16:48] leon_e: has joined #ruby
[07:19:47] jamw: has joined #ruby
[07:20:20] hotpancakes: has joined #ruby
[07:21:52] stardiviner: has joined #ruby
[07:21:54] Guest67598: has joined #ruby
[07:22:03] PaulCape_: has joined #ruby
[07:24:21] [Tyrant]: anyone in charge awake?
[07:26:22] rrrepsaj: has joined #ruby
[07:26:31] UKn0Me: happy easter
[07:29:02] lurch_: has joined #ruby
[07:30:14] skade: has joined #ruby
[07:32:05] pwnd_nsfw: has joined #ruby
[07:32:30] Guest61911: has joined #ruby
[07:34:20] Disavowed: has joined #ruby
[07:34:48] Mon_Ouie: has joined #ruby
[07:36:56] Disavowed: How would I access a module level variable from another class? I've declared like this? module A @var = 'test' but I can't get to it with A.var or A::var and now I'm questioning what little I know about scoping in Ruby.
[07:37:25] scepticulous: has joined #ruby
[07:37:37] toretore: `module A; @var = 'test'; end` doesn't make any sense. what are you trying to do?
[07:37:39] firstdayonthejob: has joined #ruby
[07:37:44] Ox0dea: Sure it does.
[07:37:46] PaulCapestany: has joined #ruby
[07:38:00] Ox0dea: Module-level instance variables are a perfectly reasonable thing to use.
[07:38:53] Disavowed: toretore: 0x0dea if it's not idiomatic I guess I could put it in a class, but that feels boilerplate-y
[07:39:23] Ox0dea: It's not unidiomatic, but it still might not be the right thing.
[07:39:43] Ox0dea: Disavowed: Here's a couple ways to do it: https://eval.in/541670
[07:39:54] toretore: Ox0dea: you're right, for some cases it would make sense
[07:40:18] JohnBat26: has joined #ruby
[07:40:45] toretore: but it's not something i've ever done
[07:41:08] Disavowed: 0x0dea: Fantastic! TIL singleton_class and attr_reader!
[07:41:58] solars: has joined #ruby
[07:42:17] Disavowed: Thank you both
[07:42:25] Disavowed: Although it sounds like I'm doing it wrong!
[07:42:36] danielz: has joined #ruby
[07:42:51] Disavowed: I'm going to reevaluate my approach. Thank you both again
[07:42:56] Ox0dea: You may well be. Say more about what you're trying to do?
[07:44:29] Ox0dea: I only ever use module-level ivars as a way to avoid using globals.
[07:45:09] Ox0dea: `MyNamespace.thing_which_needs_to_be_assignable_from_wherever = foo`
[07:45:44] Disavowed: 0x0dea: That seems like a good use case. My one does not. Let me knock up a pastebin explaining it better.
[07:48:36] [Tyrant]: can someone remind me of Radar’s other ROR chan, i dont log...
[07:49:25] Ox0dea: [Tyrant]: #RubyOnRails?
[07:49:34] Disavowed: Here's an undoubtedly awful approach to what I was trying to do: https://eval.in/541672
[07:50:08] Cohedrin: has joined #ruby
[07:50:15] [Tyrant]: who goes by pipework these days
[07:50:16] rmulligan: has joined #ruby
[07:50:43] Ox0dea: pipework still goes by pipework.
[07:50:54] kp666: has joined #ruby
[07:51:08] Ox0dea: Disavowed: I'm intrigued. ^_^
[07:51:22] Disavowed: 0x0dea: That can't be a good sign!
[07:52:05] [Tyrant]: im banned from #rubyonrails because of radar
[07:52:33] [Tyrant]: he is dramatic
[07:53:13] tAn: has joined #ruby
[07:53:20] Rahul_Roy: has joined #ruby
[07:53:28] [Tyrant]: so i was invited to another chan
[07:53:38] [Tyrant]: i cant remember it this late
[07:54:03] Ox0dea: Disavowed: I reckon the most idiomatic approach here would be to keep track of subclasses of Algorithm.
[07:54:43] Ox0dea: But, well, MergeSort shouldn't really be a class, so that'd be a little egregious.
[07:54:58] mark4: has joined #ruby
[07:55:44] Disavowed: 0x0dea: If it helps, it's just to show code on a front end; there's no plans to run it (yet!)
[07:55:55] toretore: i usually use constants for this purpose
[07:56:01] skade: has joined #ruby
[07:56:04] toretore: Algorithms::MERGESORT
[07:56:50] aufi: has joined #ruby
[07:57:01] Disavowed: toretore: I think that's what I was hopelessly trying to do. It feels more natural. Then again, I'm new to Ruby, so take that with a pinch of salt.
[07:58:01] devbug: has joined #ruby
[07:58:08] Disavowed: 0x0dea: Would keeping track of subclasses just require me to use .ancestors and .descendants, or is there something more logical?
[07:58:08] noname: has joined #ruby
[07:58:18] toretore: Algorithms.mergesort "looks nicer", but it is still effectively a constant
[07:59:01] modin: has joined #ruby
[07:59:02] Ropeney: has joined #ruby
[08:00:01] Ox0dea: Disavowed: The #inherited hook fires during subclassing.
[08:00:17] Disavowed: 0x0dea: Nice. I'll look into that now.
[08:00:27] andikr: has joined #ruby
[08:00:33] JohnBat26: has joined #ruby
[08:01:25] Ox0dea: Disavowed: This "works", but the necessity of the `this` there should let you know that it's pretty not great: https://eval.in/541673
[08:04:01] andywojo: has joined #ruby
[08:05:27] Disavowed: 0x0dea: TIL define_singleton_method and p; I should come here more often!
[08:06:40] TheGreatGudsby: ACTION has quit (K-Lined)
[08:07:38] aganov: has joined #ruby
[08:07:52] Blue_Ice: has joined #ruby
[08:07:52] Blue_Ice: has joined #ruby
[08:10:42] flughafen: has joined #ruby
[08:11:11] Disavowed: Alright, off to work to half-heartedly sling Python :( Thanks for all your help 0x0dea and toretore, appreciate you both taking the time.
[08:11:39] JohnBat26: has joined #ruby
[08:12:17] n008f4g_: has joined #ruby
[08:12:43] A124: has joined #ruby
[08:12:53] Ox0dea: Disavowed: Python has the vast majority of Ruby's goodness hiding under the covers, but I'm fine with that being kept a secret. :P
[08:14:22] Disavowed: 0x0dea: Have you tried metaprogramming in Python?! I've only been doing Ruby about 3 weeks now but I'm consistently impressed with the thought that has gone into designing it. I think I'm leaving Python!
[08:14:43] noname: has joined #ruby
[08:14:49] Disavowed: 0x0dea: Also I don't think we have method_missing, which looks pretty incredible
[08:15:01] Ox0dea: Disavowed: I freely concede that metaprogramming is *significantly* more pleasant in Ruby.
[08:15:08] Disavowed: 0x0dea: or dynamic dispatch, unless you bully a dict lookup I guess
[08:15:44] Ox0dea: Disavowed: You'd be surprised just how much of Ruby and Python is "dict bullying".
[08:15:46] blackmesa: has joined #ruby
[08:15:57] Disavowed: 0x0dea: I'm reading metaprogramming Ruby currently and I feel like I didn't know what metaprogramming was, coming from Python!
[08:16:09] Disavowed: 0x0dea: You're probably right.
[08:16:23] Ox0dea: Ha! That's a fair assessment, I think; it's not really the done thing there.
[08:16:38] Ox0dea: It's not hidden either, mind, you just have to dig a little past the surface.
[08:16:56] Ox0dea: Well, it's not hidden *well*. :P
[08:17:06] Ox0dea: __sore_thumb__
[08:17:43] Disavowed: 0x0dea: Even the Google Python Style Guide discourages using it in any form, which should tell you something.
[08:17:50] hotpancakes: has joined #ruby
[08:17:51] Disavowed: I don't miss __this_thing__ at all.
[08:18:01] Disavowed: Alright, later. Thanks again!
[08:18:06] Ox0dea: Au revoir!
[08:18:40] tvw: has joined #ruby
[08:19:04] cd-rum: has joined #ruby
[08:22:15] leon_e: has joined #ruby
[08:22:52] jaruga: has joined #ruby
[08:22:52] benlieb: has joined #ruby
[08:23:21] symm-: has joined #ruby
[08:23:57] Tyrant: has joined #ruby
[08:26:04] pawnbox: has joined #ruby
[08:26:48] skade: has joined #ruby
[08:28:57] gh: has joined #ruby
[08:29:39] the_drow: has joined #ruby
[08:32:16] RalfJ: has left #ruby: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[08:32:33] merida: has joined #ruby
[08:33:38] hotpancakes: has joined #ruby
[08:34:28] davee_: has joined #ruby
[08:35:41] mfaeh: has joined #ruby
[08:35:48] jorum: has joined #ruby
[08:36:01] leon_e: has joined #ruby
[08:36:18] Queitsch: has joined #ruby
[08:36:40] DoubleMalt: has joined #ruby
[08:39:09] Ropeney: hello adaedra
[08:40:33] Couch: has joined #ruby
[08:40:55] finisherr: has joined #ruby
[08:42:39] lxsameer: has joined #ruby
[08:45:00] rmulligan: has joined #ruby
[08:46:28] jaruga: has joined #ruby
[08:49:32] astrobun_: has joined #ruby
[08:50:17] rmulligan: has joined #ruby
[08:50:18] skade: has joined #ruby
[08:55:07] MonsterMunch: has joined #ruby
[08:58:06] Pumukel: has joined #ruby
[08:58:14] ReK2: has joined #ruby
[08:59:20] ledestin: has joined #ruby
[08:59:52] sergey_makagon: has joined #ruby
[09:00:54] madhatter: has joined #ruby
[09:01:39] futilegames: has joined #ruby
[09:02:18] pandaant: has joined #ruby
[09:02:57] patrick-sartent: has joined #ruby
[09:03:33] mank: has joined #ruby
[09:04:03] JohnBat26: has joined #ruby
[09:06:14] cpup: has joined #ruby
[09:07:38] ramfjord: has joined #ruby
[09:08:21] cjheath_: has joined #ruby
[09:08:22] SCHAAP137: has joined #ruby
[09:11:24] marr: has joined #ruby
[09:12:32] terminalrecluse: has joined #ruby
[09:13:04] tenderlove: has joined #ruby
[09:14:15] uglybandersnatch: has joined #ruby
[09:14:33] joonty: has joined #ruby
[09:15:01] hotpancakes: has joined #ruby
[09:17:44] the_drow: has joined #ruby
[09:18:21] TheNet: has joined #ruby
[09:18:43] tristanp: has joined #ruby
[09:18:44] snowy: has joined #ruby
[09:23:20] joonty: has joined #ruby
[09:23:47] ferr: has joined #ruby
[09:25:58] djellemah: has joined #ruby
[09:26:35] pandaant: has joined #ruby
[09:31:24] yfeldblum: has joined #ruby
[09:31:28] mrgrieves: has joined #ruby
[09:32:02] bluOxigen: has joined #ruby
[09:33:01] JohnBat26: has joined #ruby
[09:33:14] hotpancakes: has joined #ruby
[09:33:59] nettoweb: has joined #ruby
[09:34:06] mank: has joined #ruby
[09:35:26] kam270: has joined #ruby
[09:35:27] blackmesa: has joined #ruby
[09:38:17] mdw: has joined #ruby
[09:38:33] FooMunki: has joined #ruby
[09:38:37] kam270: has joined #ruby
[09:39:16] tenderlove: has joined #ruby
[09:46:44] stardiviner: I found DCI paradigm in this link: http://www.sitepoint.com/dci-the-evolution-of-the-object-oriented-paradigm/ , I found it has "include Context", I don't know where the "Context" from?
[09:46:45] parduse: has joined #ruby
[09:48:31] pawnbox: has joined #ruby
[09:48:43] JohnBat26: has joined #ruby
[09:52:11] andywojo: has joined #ruby
[09:52:24] f4cl3y: has joined #ruby
[09:52:37] dsivia: has joined #ruby
[09:55:48] GreyHands: has joined #ruby
[09:55:56] apeiros: what the heck?
[09:55:59] mfaeh: has joined #ruby
[09:55:59] apeiros: >> nil[:x] = 1
[09:56:01] ruby[bot]: apeiros: # => nil (https://eval.in/541747)
[09:56:07] apeiros: >> nil.method(:[]=)
[09:56:08] ruby[bot]: apeiros: # => undefined method `[]=' for class `NilClass' (NameError) ...check link for more (https://eval.in/541748)
[09:56:13] yfeldblum: has joined #ruby
[09:56:18] apeiros: ACTION wonders whether this is a parser oddity…
[09:56:25] mfaeh: has joined #ruby
[09:56:28] apeiros: though… no. it's the same with a variable
[09:59:07] apeiros: maybe a bug introduced with the save navigation operator?
[09:59:22] JohnBat26: has joined #ruby
[10:00:09] bricker: has joined #ruby
[10:01:23] yosafbridge: has joined #ruby
[10:01:43] skade: has joined #ruby
[10:05:16] hightower3: Hey, what's some good OAuth2.0 server in Ruby?
[10:05:57] Musashi007: has joined #ruby
[10:06:17] workmad3: has joined #ruby
[10:12:11] jamw: has joined #ruby
[10:12:38] chipotle: has joined #ruby
[10:14:43] sepp2k: has joined #ruby
[10:16:44] Ox0dea: apeiros: https://github.com/ruby/ruby/commit/c79402
[10:16:53] evidex: has joined #ruby
[10:18:25] fexilal: has joined #ruby
[10:18:38] apeiros: Ox0dea: why am I not surprised that I get an answer from you on that :D
[10:19:20] futilegames: has joined #ruby
[10:19:20] Ox0dea: You know me to be a creature of curiosity?
[10:19:37] User458764: has joined #ruby
[10:20:13] tAn: has joined #ruby
[10:20:32] stardiviner: has joined #ruby
[10:20:35] Bugboy1028: has joined #ruby
[10:20:44] apeiros: do I read that correctly as being a bugfix?
[10:20:53] apeiros: curiosity is an understatement
[10:21:24] Ox0dea: I remembered seeing it on the issue tracker. `git blame ChangeLog` + /aset == mystery solved.
[10:21:45] beatdown: has joined #ruby
[10:22:07] Ox0dea: Well, it's certainly not intended behavior.
[10:22:18] MonsterMunch: has left #ruby: ()
[10:24:23] araujo: has joined #ruby
[10:24:24] araujo: has joined #ruby
[10:24:32] Ox0dea: >> :!@ == '!@'.to_sym # What the heck? ;)
[10:24:33] ruby[bot]: Ox0dea: # => false (https://eval.in/541795)
[10:24:52] adaedra: You already got this one yesterday iirc
[10:25:41] Ox0dea: I hadn't shown apeiros yet.
[10:26:08] araujo: has joined #ruby
[10:26:15] ruby[bot]: apeiros: # => :! (https://eval.in/541800)
[10:26:30] ruby[bot]: apeiros: I have parsed your code, the result is at https://eval.in/541801
[10:26:32] apeiros: what's the @ in there?
[10:26:39] Ox0dea: Unary operator.
[10:27:01] Ox0dea: >> %i[+@ -@ !@ ~@]
[10:27:03] ruby[bot]: Ox0dea: # => [:+@, :-@, :"!@", :"~@"] (https://eval.in/541804)
[10:27:05] apeiros: no I mean, why does ruby parse it as :!, and omit the @
[10:27:28] Ox0dea: It's done quite deliberately in the parser in order to prevent #! and #~ being defined as binary operators.
[10:27:36] apeiros: I'd understand it if you have to quote it, but how come a trailing plain @ is not giving a syntax error?
[10:27:39] Ox0dea: I think it's a bad move, but there's surely some historical rationale.
[10:27:44] ruby[bot]: apeiros: # => :"!@" (https://eval.in/541805)
[10:27:51] ruby[bot]: apeiros: # => :! (https://eval.in/541806)
[10:28:19] apeiros: look at the return value. the @ is dropped. but if it's not considered to be part of the symbol literal, then how come it's not a syntax error?
[10:28:23] adaedra: !@ and ! is the same for ruby, apparently
[10:28:34] Ox0dea: Lemme find the spot in parse.y.
[10:28:58] bhaak: has anybody tried to mock/overwrite I18n.translate?
[10:28:58] moeabdol: has joined #ruby
[10:29:18] apeiros: bhaak: anybody is corrently not online. maybe just ask your question?
[10:29:28] ruby[bot]: jhass is anybody
[10:29:42] apeiros: though, potentially you'd be better of asking in #rubyonrails
[10:29:46] Ox0dea: https://git.io/vaNjs
[10:30:09] bhaak: I wanted to do that for a test but ran into problems as it is implemented as "module I18n; extend(Module.new {def translate; ...; end } ... "
[10:30:33] bhaak: apeiros: nope, I mean the ruby gem, not the stuff used by rails.
[10:30:46] Ox0dea: bhaak: You want to get hold of an anonymous Module?
[10:31:10] apeiros: I don't see why it'd matter from where a method is coming in order to mock it
[10:31:42] apeiros: and you can always get hold of the owner of a method easily: I18n.method(:translate).owner
[10:32:37] yosafbridge: has joined #ruby
[10:33:07] hotpancakes: has joined #ruby
[10:33:12] bhaak: apeiros: yeah, I got as far but it didn't work when I tried to overwrite the translate method for this module, it didn't stick. the original one was still being called
[10:33:32] apeiros: then maybe it's not called via I18n.translate
[10:34:50] bhaak: maybe, I'd have to test again if I checked every case because of the alias :t :translate
[10:36:27] bhaak: in the end I did I18n.extend(Module.new { def t!(key, options={}); ...; end }) in the before and redefining it back in the after block. but that feels dirty and I don't have a clue why it didn't work the other way
[10:37:18] Ox0dea: bhaak: Maybe look into Module#prepend.
[10:39:36] tenderlove: has joined #ruby
[10:40:08] bhaak: Ox0dea: prepend always gives me headaches. every time I read it up I think I understand and then run into problems using it. :-/
[10:40:35] bhaak: but I'll have to do a proper minimal example first. I just wanted to be sure that I didn't overlook something obvious and simple.
[10:40:44] gregf_: hello. is there a limit on how many thread can be running at the same time?
[10:41:44] gregf_: i've got a 16 cpu machine. if i start 100 threads .. they launch.. but if i start 200 .. nothing moves forward :|
[10:43:10] mark4: has left #ruby: ("PART #jquery :PART ##javascript :PONG :sendak.freenode.net")
[10:43:17] yfeldblum: has joined #ruby
[10:43:37] waxxy: has joined #ruby
[10:43:38] bhaak: gregf_: how does the load of your machine look like?
[10:44:04] Ox0dea: bhaak: It's pretty straightforward, really; the prepended Module goes at the front of the ancestor chain and is thus first in line for deciding whether or not to respond to a given method.
[10:44:22] Ox0dea: You can `super` up into the original, and use #remove_method to get out of the way entirely.
[10:44:55] apeiros: gregf_: threads use filehandles, so if your OS limits a process' number of filehandles, then that'd be an issue.
[10:45:18] apeiros: also since ruby now backs threads with OS native threads, the OS might directly limit the number of threads too
[10:45:39] snowy: has joined #ruby
[10:46:16] gregf_: oh, nevrmind. problem with my coe :|
[10:46:35] gregf_: s/doce/code/
[10:47:00] User458764: has joined #ruby
[10:47:19] gregf_: apeiros: bhaak thanks anyways!
[10:48:51] bhaak: Ox0dea: that's how I think it should work but I seem to more often than not get it wrong anyway. but the idea with #remove_method could be handy sometimes. thanks
[10:50:00] Ox0dea: bhaak: No worries. It's usually much better than mucking about with alias chains and the like.
[10:50:34] Ox0dea: #unprepend would be nice, but that'd pave the way for full-on ancestor modification.
[10:53:30] scepticulous: I am using bundle install --deployment to create a production ready version of my app locally (for building a docker image) and all gems are written to vendor/bundle correctly but, using bundle exec always complains about the executable not being there. So bundle exec rails s fails because it does not find rails
[10:54:02] lq: has joined #ruby
[10:54:10] lq: Website Address Views Money Earned Action Earned Today
[10:54:10] lq: http://shrinkmy.com/ZFmSN1C6
[10:54:11] lq: has left #ruby: ()
[10:56:40] scepticulous: I think my question is ruby related, since it seems to be a bundler question and less rails related. Just as a note
[10:57:49] yorickpeterse: scepticulous: make sure you also include the .bundle/.bundler (can't remember which one it was) directory
[10:57:56] yorickpeterse: since that actually tells bundler to use vendor/...
[10:59:18] jamw: has joined #ruby
[10:59:28] scepticulous: yorickpeterse: I will try that, thanks.
[11:00:09] cd-rum: has joined #ruby
[11:00:28] Devalo: has joined #ruby
[11:02:47] finisherr: has joined #ruby
[11:05:12] noname: has joined #ruby
[11:06:14] Salve: has joined #ruby
[11:10:34] ceej: has joined #ruby
[11:10:56] bakedb: has joined #ruby
[11:14:38] mrgrieves: has joined #ruby
[11:14:46] hotpancakes: has joined #ruby
[11:15:09] ramfjord: has joined #ruby
[11:16:00] valetudo: has joined #ruby
[11:19:27] Spami: has joined #ruby
[11:21:02] n008f4g_: has joined #ruby
[11:22:56] lkba: has joined #ruby
[11:24:49] biberu: has joined #ruby
[11:26:12] weckl: has joined #ruby
[11:32:58] hotpancakes: has joined #ruby
[11:33:24] User458764: has joined #ruby
[11:34:14] jorum: has joined #ruby
[11:39:35] MonsterMunch_: has joined #ruby
[11:40:51] blackgoat: has joined #ruby
[11:40:56] ldnunes: has joined #ruby
[11:41:04] codebeef: has joined #ruby
[11:42:26] tristanp_: has joined #ruby
[11:44:38] trinaldi: has joined #ruby
[11:46:44] MonsterMunch: has joined #ruby
[11:47:18] sdothum: has joined #ruby
[11:47:39] but3k4: has joined #ruby
[11:48:01] B4daBing73: has joined #ruby
[11:50:46] mrgrieves: has joined #ruby
[11:52:16] chridal: has joined #ruby
[11:53:12] MonsterMunch_: has joined #ruby
[11:57:35] stardiviner: has joined #ruby
[11:59:57] MonsterMunch_: has joined #ruby
[12:04:25] bricker: has joined #ruby
[12:05:11] tristanp: has joined #ruby
[12:06:08] Gasher: has joined #ruby
[12:09:01] dionysus69: has joined #ruby
[12:12:12] nirakara: has joined #ruby
[12:12:17] nirakara: has left #ruby: ("Leaving")
[12:12:24] skade: has joined #ruby
[12:12:26] Synthead: has joined #ruby
[12:14:24] shevy: is something awesome going on right now
[12:14:28] hotpancakes: has joined #ruby
[12:14:43] Vile`: has joined #ruby
[12:19:10] ayonkhan: has joined #ruby
[12:19:43] Pip: has joined #ruby
[12:19:56] Pip: So how is Ruby today?
[12:20:30] araujo_: has joined #ruby
[12:21:21] wethu: has joined #ruby
[12:22:36] araujo_: has joined #ruby
[12:22:47] shevy: I dunno, I am still trying to wake up
[12:24:19] trifling-jest: has joined #ruby
[12:26:21] lkba_: has joined #ruby
[12:26:44] merida: has joined #ruby
[12:27:36] chihhsin: has joined #ruby
[12:29:09] abort: has joined #ruby
[12:29:46] halfamind: has joined #ruby
[12:30:35] ruby-lang959: has joined #ruby
[12:31:19] TvL2386: has joined #ruby
[12:31:56] mistermocha: has joined #ruby
[12:33:45] oliver___: has joined #ruby
[12:35:29] ruby-lang959: looking for a way to encrypt an html file using ruby... any pointers?
[12:37:13] mfaeh: has joined #ruby
[12:37:15] mondok: has joined #ruby
[12:38:03] FooMunki: has joined #ruby
[12:38:13] Pip: ruby-lang959, No, I know almost nothing about ruby
[12:38:50] but3k4: has joined #ruby
[12:40:13] shevy: ruby-lang959 lol
[12:40:43] abort: has joined #ruby
[12:41:15] deuterium: has joined #ruby
[12:41:17] Mon_Ouie: has joined #ruby
[12:41:44] davedev24: has joined #ruby
[12:42:38] tvw: has joined #ruby
[12:42:49] CloCkWeRX: has joined #ruby
[12:42:50] kobain: has joined #ruby
[12:43:10] mank: has joined #ruby
[12:43:14] nfk|laptop: has joined #ruby
[12:43:17] krz: has joined #ruby
[12:43:32] abort: has joined #ruby
[12:44:10] mank: has joined #ruby
[12:44:45] waxxy: has joined #ruby
[12:44:54] someish: has joined #ruby
[12:45:16] mank: has joined #ruby
[12:45:21] jgpawletko: has joined #ruby
[12:45:55] cpup: has joined #ruby
[12:46:13] mank: has joined #ruby
[12:46:58] evidex: has joined #ruby
[12:47:19] mank: has joined #ruby
[12:48:45] mank: has joined #ruby
[12:49:59] abort: has joined #ruby
[12:50:00] blackmesa: has joined #ruby
[12:50:32] Pip: shevy, what's funny?
[12:51:15] shevy: Pip how anyone could come up with something as random as "encrypt a .html file using ruby"
[12:52:24] halfamind: has joined #ruby
[12:53:18] olspookishmagus: how does one run ruby in interpreter fashion like that? http://pastie.org/pastes/10772326/text
[12:53:53] olspookishmagus: ah, "irb" it is
[12:54:07] davedev24: has joined #ruby
[12:55:22] stannard: has joined #ruby
[12:55:52] MonsterMunch_: has left #ruby: ()
[12:55:59] hotpancakes: has joined #ruby
[12:56:11] olspookishmagus: Well it does not look exactly like what I showcased, but seems to be working as expected.
[12:56:14] olspookishmagus: http://pastie.org/pastes/10772330/text
[12:56:34] j3r0: has joined #ruby
[12:56:52] ChiefAlexander: has joined #ruby
[12:57:08] shevy: olspookishmagus you can redefine the IRB prompt to have the same output
[12:57:23] moos3: has joined #ruby
[12:57:25] davedev24: has joined #ruby
[12:58:19] artmann: has joined #ruby
[12:58:25] shevy: in particular the entry for IRB.conf[:PROMPT]
[12:58:43] edwinvdgraaf: has joined #ruby
[12:58:52] olspookishmagus: ok, thanks shevy
[12:59:13] shevy: like http://pastie.org/10772333
[13:00:06] jamw: has joined #ruby
[13:00:36] cpup: has joined #ruby
[13:00:42] johnmilton: has joined #ruby
[13:01:17] skade: has joined #ruby
[13:02:48] plonk: has joined #ruby
[13:02:48] plonk: has joined #ruby
[13:03:45] JakFrist: has joined #ruby
[13:04:22] Pip: shevy, I don't see that's funny at all, but serious
[13:04:28] andywojo: has joined #ruby
[13:04:35] shevy: Pip lol was it you?
[13:04:59] Pip: No, of course not
[13:05:38] cpup: has joined #ruby
[13:05:42] rodfersou: has joined #ruby
[13:06:12] Pip: shevy, I'm a ruby newbie that wouldn't ask such a professional question like that
[13:06:50] shevy: Pip now you are winging it
[13:08:38] DexterLB: has left #ruby: ("Leaving")
[13:09:03] jolts: has joined #ruby
[13:09:03] anisha: has joined #ruby
[13:09:44] Mon_Ouie: has joined #ruby
[13:09:53] Pip: shevy, I thought Ruby 4.0 has been out
[13:09:54] Pip: That's why I came here to take a look today
[13:10:05] jolts: has joined #ruby
[13:10:11] shevy: Pip come on man
[13:10:11] adaedra: Ruby 4 is not planned out before a long time iirc
[13:10:47] stardiviner: has joined #ruby
[13:10:57] jolts: has joined #ruby
[13:11:34] joonty: has joined #ruby
[13:11:55] jolts: has joined #ruby
[13:14:08] terminalrecluse: has joined #ruby
[13:14:09] Pip: So the goddamn forum lied to me
[13:15:49] Pip: Maybe it was Rails
[13:16:02] adaedra: People do that, go to the internet and tell lies!?
[13:16:36] adaedra: Rails is on 4.2.6 right now, and 5 is supposed to be coming soon
[13:16:48] nanoz: has joined #ruby
[13:22:08] gmas: has joined #ruby
[13:22:17] nando293921: has joined #ruby
[13:24:10] fmcgeough: has joined #ruby
[13:24:35] CloCkWeRX: has left #ruby: ()
[13:27:13] tAn: has joined #ruby
[13:27:25] fmcgeough_: has joined #ruby
[13:27:56] shevy: php jumped over one version, ruby can jump over two!
[13:28:11] adaedra: php is not a model.
[13:28:53] Pip: I bet Ruby 6 will be more powerful than C++2020
[13:29:14] deuterium: has joined #ruby
[13:31:08] binaryplease: has joined #ruby
[13:31:09] skislak: has joined #ruby
[13:31:43] shevy: then ruby will be at perl version
[13:32:49] mistermocha: has joined #ruby
[13:34:47] hotpancakes: has joined #ruby
[13:36:18] but3k4: has joined #ruby
[13:37:21] swills: has joined #ruby
[13:37:22] marr: has joined #ruby
[13:37:53] skislak_: has joined #ruby
[13:38:57] `tim`: has joined #ruby
[13:39:41] sarbs: has joined #ruby
[13:41:53] malconis: has joined #ruby
[13:41:54] mleung: has joined #ruby
[13:42:58] hgl: has joined #ruby
[13:44:02] JohnBat26: has joined #ruby
[13:44:05] hgl: has joined #ruby
[13:44:27] malconis: has joined #ruby
[13:45:46] stannard: has joined #ruby
[13:48:23] vdamewood: has joined #ruby
[13:50:47] linux99x: has joined #ruby
[13:52:03] stannard: has joined #ruby
[13:53:09] floatingpoint: has joined #ruby
[13:56:07] vdamewood: has joined #ruby
[13:56:08] ChiefAlexander: has joined #ruby
[13:57:22] Pip: has joined #ruby
[13:58:33] rbennacer: has joined #ruby
[13:59:19] hotpancakes: has joined #ruby
[13:59:28] rbennacer: has joined #ruby
[14:00:28] Uber|Dragon: has joined #ruby
[14:00:54] heinrich5991: has joined #ruby
[14:03:22] clorisu: has joined #ruby
[14:03:47] zotherstupidguy: has joined #ruby
[14:05:05] fullofcaffeine: has joined #ruby
[14:05:37] lkba: has joined #ruby
[14:05:45] wilbert: has joined #ruby
[14:06:06] cpruitt: has joined #ruby
[14:07:32] bricker: has joined #ruby
[14:09:41] lessless: has joined #ruby
[14:13:09] idletask: has joined #ruby
[14:13:45] JakFrist: has joined #ruby
[14:14:18] callen92: has joined #ruby
[14:14:37] moeabdol: has joined #ruby
[14:15:41] Karix: has joined #ruby
[14:15:54] haraoka: has joined #ruby
[14:16:16] whippythellama: has joined #ruby
[14:18:17] Guest-ru: has joined #ruby
[14:18:45] perlgod: has joined #ruby
[14:19:04] Vile`: has joined #ruby
[14:21:26] wilbert: has joined #ruby
[14:21:51] bry4n: has joined #ruby
[14:21:56] uglybandersnatch: has joined #ruby
[14:22:57] cwenner: has joined #ruby
[14:23:21] freerobby: has joined #ruby
[14:24:12] zacts: hello rubyists
[14:25:25] blandflakes: has joined #ruby
[14:28:01] scepticulous: has joined #ruby
[14:28:50] mbff: has joined #ruby
[14:29:00] ixti: has joined #ruby
[14:29:30] fullofcaffeine: has joined #ruby
[14:29:36] mbff: What am I doing wrong here: https://gist.github.com/marshallford/16fd8a40d7793f4795ea This is a route in my Sinatra app. I get the error: ArgumentError at /api/v1/links wrong number of arguments (given 1, expected 2..4)
[14:29:52] mbff: In all the guides I have seen know one passes other args
[14:29:59] LoneHerm_: has joined #ruby
[14:30:30] blandflakes: has joined #ruby
[14:31:07] fullofca_: has joined #ruby
[14:31:51] bricker: has joined #ruby
[14:33:19] hotpancakes: has joined #ruby
[14:33:45] mistermocha: has joined #ruby
[14:33:47] _stu_: has joined #ruby
[14:34:14] dfas: has joined #ruby
[14:34:37] iwmrby: has joined #ruby
[14:35:22] dfas: has anyone here read Practical Object-Oriented Design in Ruby by Metz?
[14:35:46] smathy: has joined #ruby
[14:37:07] rbennacer: has joined #ruby
[14:37:48] RegulationD: has joined #ruby
[14:38:01] rbennacer: has joined #ruby
[14:38:11] ascarter: has joined #ruby
[14:38:20] blandflakes: has joined #ruby
[14:38:35] mary5030: has joined #ruby
[14:38:41] roshanavand1: has joined #ruby
[14:39:32] diegoaguilar: has joined #ruby
[14:40:13] andikr: has joined #ruby
[14:40:24] mary5030: has joined #ruby
[14:40:26] Blaze_Boy: has joined #ruby
[14:40:32] kies: has joined #ruby
[14:40:45] cpup: has joined #ruby
[14:41:43] weemsledeux: has joined #ruby
[14:42:08] haylon: has joined #ruby
[14:42:38] neilhwatson: has joined #ruby
[14:42:47] clorisu: has joined #ruby
[14:43:29] hotpancakes: has joined #ruby
[14:46:57] cjbottaro: has joined #ruby
[14:48:36] abort: dfas: great, great book
[14:48:45] diegoaguilar: has joined #ruby
[14:50:28] crazydiamond: has joined #ruby
[14:50:55] mrgrieves: has joined #ruby
[14:53:35] acosonic: has joined #ruby
[14:53:51] acosonic: Hi all, how in code should I access following variable: http://prntscr.com/aje40q
[14:53:54] ChiefAlexander: has joined #ruby
[14:57:05] apeiros: ?crosspost acosonic
[14:57:06] ruby[bot]: acosonic: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
[14:58:40] bricker: has joined #ruby
[14:58:51] gregf_: class/static/globals variables can really mess up threads :|
[14:59:34] apeiros: no. improperly accessing them otoh can.
[15:00:08] hotpancakes: has joined #ruby
[15:00:15] klaas: has joined #ruby
[15:00:53] jamw: has joined #ruby
[15:02:47] gregf_: apeiros: yes
[15:02:54] astrobunny: has joined #ruby
[15:03:06] gregf_: i just tried this : https://gist.github.com/anonymous/d6363d5b74be0e4b24aa
[15:03:59] gregf_: i've written a client that uses Net::HTTP for making 1000 requests in 1000 threads with a sleep. and the sleep always ended up as 1000 save for some few
[15:04:20] gregf_: stress testing a Java conversion service
[15:04:30] prestorium: has joined #ruby
[15:05:24] yorickpeterse1: has joined #ruby
[15:05:47] Console: has joined #ruby
[15:06:28] Es0teric: has joined #ruby
[15:07:00] rippa: has joined #ruby
[15:07:27] dionysus69: has joined #ruby
[15:08:32] connor_g1odwolf: has joined #ruby
[15:08:48] dn`: has joined #ruby
[15:11:17] Gasher: has joined #ruby
[15:11:48] kenichi_: has joined #ruby
[15:11:59] nocontrol: has joined #ruby
[15:12:00] j416_: has joined #ruby
[15:12:05] hyperdri-: has joined #ruby
[15:12:06] pjaspers: has joined #ruby
[15:12:13] df-: has joined #ruby
[15:12:45] D9-: has joined #ruby
[15:13:22] waxjar: gregf_ stress-testing using ruby?
[15:13:27] chouhoulis: has joined #ruby
[15:14:07] gregf_: well, yeah. so i used threads
[15:14:12] Brando753: has joined #ruby
[15:14:16] gregf_: just making http requests
[15:14:17] JRod: has joined #ruby
[15:14:36] griffindy: has joined #ruby
[15:14:37] scepticulous: has joined #ruby
[15:18:13] riceandbeans: has joined #ruby
[15:18:19] lkba: has joined #ruby
[15:19:16] cdg: has joined #ruby
[15:19:37] nocontrol: has joined #ruby
[15:19:45] Es0teric: has joined #ruby
[15:19:46] David27: has joined #ruby
[15:20:05] dikaio: has joined #ruby
[15:21:43] acosonic: has joined #ruby
[15:23:58] Es0teric: has joined #ruby
[15:24:50] AlexRussia: has joined #ruby
[15:25:32] Cyrus: has joined #ruby
[15:25:42] shevy: global variables mess up threads as well gregf_?
[15:25:47] floatingpoint: has joined #ruby
[15:25:48] duderonomy: has joined #ruby
[15:25:50] skweek: has joined #ruby
[15:26:30] dopie: how do i update my system ruby to the most recent version?
[15:27:06] j2k: dopie Depends on your system
[15:27:18] dopie: mac osx 10
[15:27:20] mary5030_: has joined #ruby
[15:27:44] lagweezle: homebrew! <3
[15:27:52] perlgod_: has joined #ruby
[15:28:08] dopie: lagweezle: im trying to update the system one because vim keeps on using it...
[15:28:10] shevy: dopie come to linux!
[15:28:28] dopie: shevy: I did... I prefer mac osx better honestly
[15:28:35] dopie: i actually switched from linux to mac
[15:28:38] Devalo: has joined #ruby
[15:28:51] neilhwatson: ACTION is going to be assigned a mac book next week and will miss linux :(
[15:28:53] jhn: has joined #ruby
[15:29:41] abort: has joined #ruby
[15:29:41] mfaeh: has joined #ruby
[15:29:41] DoubleMalt: has joined #ruby
[15:29:41] joneshf-laptop: has joined #ruby
[15:29:41] nofxx: has joined #ruby
[15:29:41] ozzloy_: has joined #ruby
[15:29:41] alnewkirk: has joined #ruby
[15:29:41] RTG`: has joined #ruby
[15:29:41] edwardly: has joined #ruby
[15:29:41] axisys: has joined #ruby
[15:29:42] tw1sted: has joined #ruby
[15:29:42] berserk_ren: has joined #ruby
[15:29:42] reaVer: has joined #ruby
[15:29:42] callumacrae: has joined #ruby
[15:29:42] linduxed: has joined #ruby
[15:29:42] skakri: has joined #ruby
[15:29:42] bitemyapp: has joined #ruby
[15:29:42] m4rCsi_: has joined #ruby
[15:29:42] Kim^J: has joined #ruby
[15:29:42] z3uS: has joined #ruby
[15:29:43] merida: has joined #ruby
[15:30:01] poguez_: has joined #ruby
[15:30:36] Trynemjoel: has joined #ruby
[15:31:18] JakFrist: has joined #ruby
[15:31:36] workmad3_: has joined #ruby
[15:31:50] neilhwatson: dopie: https://en.wikibooks.org/wiki/Ruby_Programming/Installing_Ruby#Mac_OS_X
[15:34:02] audiodude: has joined #ruby
[15:34:26] Blaze_Boy: has joined #ruby
[15:34:28] ijij: has joined #ruby
[15:34:31] mary5030: has joined #ruby
[15:35:56] shevy: "If you want to install a more recent version of Ruby, you can:"
[15:36:03] shevy: "Buy the latest version of Mac OS X, which may have a more recent version of Ruby."
[15:36:20] cdg_: has joined #ruby
[15:36:26] Canar: wow, the documentation for to_yaml options is really bad
[15:36:36] Canar: seems to be known but unfixed for years
[15:36:59] Sadin: has joined #ruby
[15:36:59] shevy: here is the way to improve on it: file a request at https://bugs.ruby-lang.org/projects/ruby-trunk/issues?set_filter=1&tracker_id=2
[15:37:48] callumacrae: has joined #ruby
[15:37:52] JohnBat26: has joined #ruby
[15:38:53] armyriad: has joined #ruby
[15:39:00] polishdub: has joined #ruby
[15:39:38] Norrin: has joined #ruby
[15:41:10] gregf_: neilhwatson: doesn't a mac use a linux kernel?
[15:41:21] Canar: not linux
[15:41:23] Canar: bsd-based
[15:41:23] gregf_: just that the keyboard is messed up
[15:42:24] gregf_: *cares very little about microsoft, apple and oracle* :|
[15:43:06] acosonic: has joined #ruby
[15:43:17] bougyman: anyone know of a lib that adds stopwatch times?
[15:43:32] Canar: "stopwatch" times?
[15:43:37] bougyman: 1:33.44 + 7:42.12 where that''s Minutes:Seconds.Precision
[15:43:47] bougyman: I can't google for it cause I just get Time operations
[15:43:52] bougyman: I don't know what else to call it
[15:44:06] Canar: yeah well it's pretty easy to transform a Time object to that format
[15:44:20] bougyman: this seems like it wouldn't be uncommon
[15:44:24] amargherio: has joined #ruby
[15:44:33] bougyman: I know when I've done it before I converted to seconds first then did math then converted back.
[15:44:47] Ox0dea: That's the right approach.
[15:44:47] bougyman: just figured someone would have made an EasyButton lib for it at some point
[15:45:09] chouhoulis: has joined #ruby
[15:45:10] Canar: http://stackoverflow.com/questions/1679266/can-ruby-print-out-time-difference-duration-readily
[15:45:13] Canar: lists a few gems
[15:45:21] dionysus69: has joined #ruby
[15:45:24] Canar: as well as good discussion on how to diy
[15:46:59] bougyman: Canar: that's not quite it.
[15:47:06] bougyman: I can't make a time object out of just intervals
[15:47:08] drale2k: has joined #ruby
[15:47:40] Canar: if you say so
[15:47:46] bougyman: Canar: how could I?
[15:48:01] Canar: Did you even read the replies?
[15:48:05] bougyman: there's no 'Time' in : it took an hour and 40 minutes and 12.21 seconds.
[15:48:13] rattatmatt: has joined #ruby
[15:48:28] Canar: Well then, I'm sorry, I don't have the time to explain further.
[15:49:39] User458764: has joined #ruby
[15:50:31] nando293921: has joined #ruby
[15:52:52] vasilakisFiL: has joined #ruby
[15:53:03] vasilakisFiL: a closure in Ruby (and other languages) encapsulates the environment that is defined on.. how can I achieve the opposite? I want do define something in place A, call it in place B and reference variables from place B
[15:53:40] Trynemjoel: has joined #ruby
[15:55:05] adaedra: vasilakisfil: you can change the context of a lambda with instance_exec
[15:55:40] kfpratt: has joined #ruby
[15:55:45] adaedra: but it won't work with variables, only instance variables/methods/self
[15:55:48] marxarelli: has joined #ruby
[15:55:51] adaedra: there may be something in binding tho
[15:56:03] dikaio_: has joined #ruby
[15:57:45] Shaboum: has joined #ruby
[15:59:35] Salve: has joined #ruby
[16:00:40] amclain: has joined #ruby
[16:02:42] moeabdol: has joined #ruby
[16:04:53] KINGSABRI: has joined #ruby
[16:04:57] halfamind: has joined #ruby
[16:06:27] ascarter: has joined #ruby
[16:06:57] lagweezle: bougyman: could try using the word 'interval' maybe?
[16:07:10] KINGSABRI: Hello! I'm using Fiddle importer to interact with some Windows API and it works well but I cant parse with it's retrun which is something line that #<Fiddle::Pointer:0x1e87fb0 ptr=0x7678ea71 size=0 free=0x000000>
[16:07:21] KINGSABRI: I need the ptr value
[16:07:46] KINGSABRI: so if I but prt method it gives me another value
[16:08:39] KINGSABRI: is there any parser or a way to parse that Fiddle::Pointer object ?
[16:10:34] Hanmac: did you guys hear that story from that AI from Microsoft? it was a chatbot which was programmed to learn, but after the Bot does say that it hates feminists, she got "reprogrammed" ;P
[16:11:12] rattatmatt: has joined #ruby
[16:11:43] Ox0dea: KINGSABRI: It's not perfectly clear what you're asking. If you're trying to go from that Fiddle::Pointer to a Ruby object, you want #to_value.
[16:12:01] Canar: hanmac: They found a loophole that they could use to get it to repeat content verbatim.
[16:13:40] KINGSABRI: @0x0dea I'm asking if I can parse the returned Fiddle::Pointer object
[16:13:46] shevy: an AI with a loophole! fear skynet 3.0!!!
[16:14:08] halfamind: has joined #ruby
[16:14:22] KINGSABRI: 0x0dea so I can have an access to "ptr=0x7678ea71" value
[16:14:49] Ox0dea: KINGSABRI: You can just call #ptr on it...
[16:14:57] KINGSABRI: I don't want to convert it to string using inspect then parse it as string and use regex
[16:14:59] howdoi: has joined #ruby
[16:15:05] Ox0dea: Yeah, don't do that.
[16:15:15] araujo: has joined #ruby
[16:17:05] marr: has joined #ruby
[16:17:07] halfamind1: has joined #ruby
[16:17:25] KINGSABRI: if I use .ptr it returns me another object #<Fiddle::Pointer:0x12bff68 ptr=0x77d8050b size=0 free=0x000000> with a new ptr value
[16:18:18] LoneHermit: has joined #ruby
[16:18:47] d0nn1e: has joined #ruby
[16:18:47] nobitanobi: has joined #ruby
[16:18:55] JoshGlzBrk: has joined #ruby
[16:20:14] KINGSABRI: 0xdea so the same issue remains
[16:20:35] Ox0dea: KINGSABRI: Right, sorry. `ptr.to_value.object_id` should do the trick.
[16:22:56] KINGSABRI: 0x0dea I tried it and it returns wrong value
[16:23:24] Ox0dea: KINGSABRI: Are you sure?
[16:23:56] Maletor: has joined #ruby
[16:24:35] ascarter: has joined #ruby
[16:25:34] Ox0dea: KINGSABRI: Whoops. You'll need to double it as well. https://eval.in/541942
[16:25:47] pawnbox: has joined #ruby
[16:26:03] blandflakes: has joined #ruby
[16:26:07] vasilakisFiL: interesting! thanks adaedra. it worked like a charm! Changing the context of a lambda is not an expensive operation, is it ?
[16:26:35] PaulePanter: Hi. Do you know of a current article comparing rescue use in Ruby 2.1 or 2.2?
[16:26:42] PaulePanter: http://technicaldebt.com/the-cost-of-using-rubys-rescue-as-logic/
[16:26:49] zapata: has joined #ruby
[16:27:01] PaulePanter: … showed that if the exception is the exception, that it’s faster than if.
[16:28:38] blandflakes: has joined #ruby
[16:29:25] baweaver: has joined #ruby
[16:29:40] KINGSABRI: 0x0dea: https://eval.in/private/6047edbbb07a05
[16:29:45] KINGSABRI: that's is the core idea
[16:30:09] KINGSABRI: it's windows base example, ofcourse
[16:30:54] lagweezle: PaulePanter: Good! I hate Python's use of exceptions as standard flow control mechanisms.
[16:31:48] PaulePanter: lagweezle: What is good? It looks like, if it’s really an exception, then that should be also used with Ruby.
[16:32:01] tjohnson: has joined #ruby
[16:32:08] PaulePanter: http://paste.debian.net/418583/
[16:32:09] hightower2: has joined #ruby
[16:32:13] PaulePanter: … and still the same with Ruby 2.2.
[16:32:16] halfamind: has joined #ruby
[16:32:23] ytti: lagweezle, python and ruby code idiomatically use exceptions in very similar manner
[16:32:44] Maletor: has joined #ruby
[16:32:51] smathy: PaulePanter, if you're worried about tenths of a second over millions of iterations, Ruby's the wrong language for you.
[16:33:25] PaulePanter: smathy: Very true. ;-)
[16:33:36] Rubie: has joined #ruby
[16:33:43] havenwood: PaulePanter: A quick benchmark-ips shows the lonely person operator from Ruby 2.3 is faster than rescue.
[16:33:46] lagweezle: PaulePanter: I like that the article is saying that the use of exception handling as a flow-control mechanism is bad(-ish), because I dislike the idiom of try/except (or rescue) in place of if-statements, and such.
[16:33:55] smathy: ...and also, nodes&.first ftw - yay 2.3
[16:34:03] ericli: has joined #ruby
[16:34:10] scepticulous: has joined #ruby
[16:34:42] lagweezle: ytti: I've not encountered that in Ruby yet. Lucky me? ;)
[16:34:42] smathy: lagweezle, yeah, they're called "exceptions" for a reason.
[16:35:27] mistermocha: has joined #ruby
[16:35:37] PaulePanter: Thank you everyone! As always you helped me quite a lot!
[16:35:46] lagweezle: They take it a step (or many?) towards worse at work, too, and wrap a ton of lines in the 'try' part, with 'except Exception' at the end of the entire mess... -.-
[16:35:46] snockerton: has joined #ruby
[16:35:50] PaulePanter: ACTION unfortunately still uses Ruby 2.1.5.
[16:37:06] havenwood: PaulePanter: Anyways, don't use exceptions for flow control!: https://gist.github.com/havenwood/6e21d98015aab10dcb8a
[16:38:14] PaulePanter: havenwood: I won’t.
[16:38:51] M-shine: has joined #ruby
[16:38:56] havenwood: PaulePanter: It's a good idea to at least bump to the latest teeny 2.1.8 if you're on 2.1.
[16:39:08] nocontrol: has joined #ruby
[16:39:24] havenwood: "We are planning to release Ruby 2.1.9 by the end of March. After the release, we will end the normal maintenance phase of 2.1, and start the security maintenance phase of it."
[16:39:33] PaulePanter: havenwood: I use the Debian stable package, which carries the security fixes.
[16:39:34] htmldrum: has joined #ruby
[16:39:37] htmldrum_: has joined #ruby
[16:39:39] havenwood: PaulePanter: Ah, good. :)
[16:40:03] PaulePanter: havenwood: Your example only tried the case, when the exception occurs, right?
[16:40:16] PaulePanter: The standard case should be, when no exception occurs.
[16:41:49] lagweezle: ytti: Just to make sure, did you mean they both use them for if-else flow control, or the general "do things that might blow up then rescue when they do blow up" ?
[16:42:12] DarkBushido: has joined #ruby
[16:42:12] DarkBushido: has joined #ruby
[16:42:16] ytti: lagweezle, idiomatic python and ruby code does not use it for if-else
[16:42:44] ytti: (i must confess, i sometimes do, but my says girls like bad boys)
[16:43:07] havenwood: PaulePanter: Same speed in that case.
[16:43:42] floatingpoint: yo. I should see the string printed when I use: case some_string; when /.+\(3\),$/; puts some_string; if some_string = "beep (3),", right?
[16:44:03] havenwood: PaulePanter: Though a better warmup for rescue.
[16:44:07] KensoDev: has joined #ruby
[16:45:00] halfamind: has joined #ruby
[16:45:01] havenwood: PaulePanter: Here's an Array versus nil: https://gist.github.com/havenwood/6e21d98015aab10dcb8a
[16:45:07] lagweezle: ytti: Er, https://docs.python.org/2/glossary.html entry for EAFP suggests otherwise.
[16:45:30] cjbottaro: has joined #ruby
[16:45:36] rcvalle: has joined #ruby
[16:45:46] pawnbox: has joined #ruby
[16:47:07] rbennacer: has joined #ruby
[16:48:00] alexherbo2: has joined #ruby
[16:48:13] M-Kodo: has joined #ruby
[16:48:13] PaulePanter: havenwood: http://paste.debian.net/418587/
[16:48:41] Apocalypse: has joined #ruby
[16:49:13] nanoz: has joined #ruby
[16:51:24] akp: has joined #ruby
[16:51:32] silentpost: has joined #ruby
[16:51:40] akp: hello. this is probably a stupid question, but how does one install jruby?
[16:51:55] ytti: lagweezle, my python exposure is thin, so maybe i'm wrong, but i've not seen that used more commonly in python than in ruby
[16:52:07] mr_blue: has joined #ruby
[16:52:21] perlgod: has joined #ruby
[16:52:33] PaulePanter: akp: You can use a Ruby manager like RVM.
[16:52:37] ytti: lagweezle, but the example of existance of keys is good point, python does not return false value when accessing non-existing keys
[16:52:49] havenwood: akp: Through your package manager, install it yourself or use a tool like ruby-install or RVM.
[16:52:51] lagweezle: ytti: Sadly it seems to be somewhat common practice in Python. It makes my skin crawl.
[16:52:58] havenwood: akp: The #jruby channel is helpful as well.
[16:53:01] PaulePanter: akp: Depending on your needs it might be packaged in your distribution.
[16:53:07] PaulePanter: akp: apt install jruby
[16:53:16] nobitanobi: has joined #ruby
[16:53:22] ytti: generally that's huge complaint i have in python, it just does not feel high level language
[16:53:23] ytti: heck, rust has more convenience methods/functions in standard
[16:53:23] ytti: in python you need to reimplement super common stuff yourself
[16:53:23] Cone3: has joined #ruby
[16:53:42] perlgod: has joined #ruby
[16:54:20] akp: is there an rvm package for centos?
[16:54:31] scepticulous: has joined #ruby
[16:54:37] ytti: i'm not sure why python maintains this, rich high quality methods in standard objects in ruby is huge selling point to me
[16:54:39] havenwood: akp: If there is, don't use it.
[16:54:48] akp: or can i do gem install rvm?
[16:54:56] cpup: has joined #ruby
[16:55:07] havenwood: akp: The typical install these days is from a shell script: \curl -sSL https://get.rvm.io | bash
[16:55:08] mr_blue: I'am wondering if there is a way to fetch value from a hash with a key that can be a String or a Symbole ?
[16:55:08] mr_blue: for now I have to check to h['k'] and h[:k]
[16:55:16] havenwood: akp: https://rvm.io/rvm/install
[16:55:19] cjbottaro: has joined #ruby
[16:55:49] havenwood: akp: If you just need one Ruby, ruby-install is simpler: https://github.com/postmodern/ruby-install#readme
[16:56:17] havenwood: akp: sudo ruby-install --latest --system jruby
[16:56:40] havenwood: akp: ^ install latest JRuby to /usr/local
[16:56:48] lagweezle: I'm with you there. Things like len() being a global, except not really, because you need to implement __len__ for your class ... bleah.
[16:56:57] akp: package managers on top of package managers on top of package manageres
[16:57:08] lagweezle: I'm with you there. Things like len() being a global, except not really, because you need to implement __len__ for your class ... bleah. (meant as reply to ytti)
[16:57:27] drewo: has joined #ruby
[16:57:29] havenwood: akp: ruby-install and chruby are simple shell scripts that each do one thing, and one thing well
[16:57:33] pfg__: has joined #ruby
[16:57:44] iamvery: has joined #ruby
[16:59:29] JakFrist: has joined #ruby
[17:00:14] finisherr: has joined #ruby
[17:00:14] David27_: has joined #ruby
[17:01:12] nocontrol: has joined #ruby
[17:01:42] jamw: has joined #ruby
[17:01:53] Don_John: has joined #ruby
[17:01:59] akp: well ruby-install seems to fail to download anything....
[17:02:15] choke: has joined #ruby
[17:02:31] shevy: wget ftp://ftp.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.xz
[17:02:34] akp: → ruby-install jruby JOBS: 0
[17:02:34] akp: >>> Updating jruby versions ...
[17:02:34] akp: !!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/jruby/versions.txt to /home/apatel/.cache/ruby-install/jruby/versions.txt!
[17:02:34] havenwood: akp: What command are you running and what's the error?
[17:02:36] akp: !!! Failed to download jruby versions!
[17:03:16] headius: that file downloads ok for me
[17:03:19] havenwood: akp: sudo ruby-install --latest
[17:03:26] Eiam: has joined #ruby
[17:03:46] akp: it fails to download the txt files for all of them
[17:03:53] akp: is there away to force it to use curl?
[17:04:21] Don_John: has joined #ruby
[17:04:41] akp: !!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/ruby/versions.txt to /root/.cache/ruby-install/ruby/versions.txt!
[17:04:54] akp: and the same for jruby, rbx, maglev, and mruby
[17:05:00] adaedra: akp: and if you curl the file it downloads fine?
[17:05:06] havenwood: akp: Can you not wget or curl those same files?
[17:05:20] ramfjord: has joined #ruby
[17:05:47] LoganG: has joined #ruby
[17:05:48] akp: i can with wget, but i need to use the --no-check-cert option
[17:05:54] akp: curl doesn't seemt o care
[17:06:25] havenwood: akp: Can you install the ca-certificates package with your package manager?
[17:07:04] benlieb: has joined #ruby
[17:07:13] nettoweb: has joined #ruby
[17:07:54] axl__: has joined #ruby
[17:08:12] weaksauce: has joined #ruby
[17:08:29] wldcordeiro: has joined #ruby
[17:08:31] akp: yeah i can install them
[17:08:38] akp: but it still doesn't help
[17:09:43] havenwood: akp: Eek, no up-to-date certs? Hard to check authenticity of SSL connections that way!
[17:09:57] akp: havenwood: i've installed the certs
[17:10:06] akp: but wget still doesn't seem to car
[17:10:38] akp: ERROR: certificate common name “www.github.com” doesn’t match requested host name “raw.githubusercontent.com”.
[17:10:43] akp: has to do with that
[17:11:44] havenwood: akp: I have to relocate now, I'm late, but I'll look into it!
[17:12:11] havenwood: akp: If you have time you might start an Issue ticket on the Githubs but understood if you just want to move on. ;)
[17:12:11] Balzrael: has joined #ruby
[17:12:16] akp: i'm just going to add the -no-check-certificate option in right now to the ruby-install.sh
[17:12:24] symm-: has joined #ruby
[17:12:25] ChiefAlexander: has joined #ruby
[17:12:39] akp: gonna have to hack and move, spent to much time mucking around trying to install jruby =/
[17:13:33] cjbottaro: has joined #ruby
[17:13:43] headius: akp: maybe you should just download the JRuby tarball and install it that way
[17:13:48] headius: your environment seems to be having problems
[17:13:49] M-mistake: has joined #ruby
[17:13:59] havenwood: akp: ^ that's a nice thing about JRuby!
[17:14:12] headius: download, unpacke, put bin in PATH, that's about it
[17:14:25] akp: i just added the no-check-certficate option to the ruby-install.sh script
[17:14:33] akp: it work and jruby is now installed.
[17:15:25] nocontrol: has joined #ruby
[17:15:25] mdw: has joined #ruby
[17:16:31] jamw: has joined #ruby
[17:16:41] ruby-lang106: has joined #ruby
[17:17:22] shinnya: has joined #ruby
[17:17:38] Sadin: has joined #ruby
[17:18:47] JohnBat26: has joined #ruby
[17:19:15] snockerton: has joined #ruby
[17:22:09] jottr: has joined #ruby
[17:22:39] polyidus: has joined #ruby
[17:24:06] kobain: has joined #ruby
[17:24:34] ascarter: has joined #ruby
[17:24:48] nocontrol: has joined #ruby
[17:24:59] kobain: has joined #ruby
[17:25:04] KINGSABRI: is Win32API is deprecated and will be removed ?
[17:25:27] SCHAAP137: has joined #ruby
[17:25:56] KINGSABRI: because I can't find any good documentation for it but still exist in Ruby 2.2.3p173
[17:26:16] shevy: http://ruby-doc.org/stdlib-1.9.2/libdoc/dl/rdoc/Win32/Registry.html
[17:26:25] shevy: ^^^ exists
[17:26:26] shevy: http://ruby-doc.org/stdlib-2.3.0/libdoc/dl/rdoc/Win32/Registry.html
[17:26:28] shevy: ^^^ does not exist
[17:26:43] shevy: might be dl to fiddle?
[17:27:38] M-Technic: has joined #ruby
[17:27:58] KINGSABRI: shevy, yeah I found many poeple talking about Win32 and DL and moving to Fiddle
[17:28:04] smathy: I suspect they meant http://ruby-doc.org/stdlib-2.0.0/libdoc/dl/rdoc/Win32API.html shevy
[17:28:10] wldcordeiro: has joined #ruby
[17:28:31] KensoDev: has joined #ruby
[17:28:47] KINGSABRI: yea it's almost zero documentation
[17:29:09] KINGSABRI: and it doesn't exist in 2.2.x
[17:29:13] KINGSABRI: http://ruby-doc.org/stdlib-2.2.0/libdoc/dl/rdoc/Win32API.html
[17:29:14] acosonic: has joined #ruby
[17:29:15] djellemah: has joined #ruby
[17:29:37] smathy: KINGSABRI, you looked at the gem, it's meant to be better: https://rubygems.org/gems/win32-api/
[17:29:48] KINGSABRI: but I've ran an example using Win32API on ruby 2.2.3p173
[17:30:14] Devalo: has joined #ruby
[17:30:38] User458764: has joined #ruby
[17:30:43] shevy: guess it died
[17:32:34] KINGSABRI: smath, I heard about Win32-api but I needed to write 50-lines script form very small task and avoiding external libs was important
[17:32:37] ascarter: has joined #ruby
[17:32:44] ericli: in ruby, which var to show the first/second/third parameter in command line?
[17:33:26] KINGSABRI: ericli, do you mean, ARGV ?
[17:33:54] JohnBat26|2: has joined #ruby
[17:34:13] KINGSABRI: ericli, like : var1, var2, var3 = ARGV
[17:34:14] blandflakes: has joined #ruby
[17:34:14] smathy: KINGSABRI, it's one C file, just vendor it if necessary.
[17:34:30] ericli: KINGSABRI, yes
[17:35:40] KINGSABRI: ericli that was my answer if I understand your question
[17:35:50] wreet: has joined #ruby
[17:36:01] mistermocha: has joined #ruby
[17:36:15] wreet: has left #ruby: ()
[17:36:20] ericli: KINGSABRI, that's right, thanks
[17:36:20] ericli: KINGSABRI, is there doc about the ruby internal var list?
[17:37:10] skade: has joined #ruby
[17:37:44] Ox0dea: ?quickref ericli
[17:38:05] Ox0dea: ericli: Loads of good stuff in here: http://www.zenspider.com/Languages/Ruby/QuickRef.html
[17:38:31] KINGSABRI: http://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/variable.html
[17:38:41] sneakerhax: has joined #ruby
[17:39:07] jenrzzz: has joined #ruby
[17:39:12] ericli: nice, thanks Ox0dea KINGSABRI
[17:40:16] mdw: has joined #ruby
[17:40:20] joonty: has joined #ruby
[17:40:40] acosonic: has joined #ruby
[17:43:08] nocontrol: has joined #ruby
[17:43:49] baweaver: has joined #ruby
[17:43:57] slawrence00: has joined #ruby
[17:44:07] JohnBat26|2: has joined #ruby
[17:44:59] halfamind1: has joined #ruby
[17:45:05] dopie: has joined #ruby
[17:46:34] n008f4g_: has joined #ruby
[17:49:32] johnny56: has joined #ruby
[17:50:30] moeabdol: has joined #ruby
[17:50:39] davedev24: has joined #ruby
[17:51:34] ramfjord: has joined #ruby
[17:51:35] dopie: has joined #ruby
[17:53:04] nocontrol: has joined #ruby
[17:53:46] codecop: has joined #ruby
[17:53:47] codecop_: has joined #ruby
[17:54:16] djbkd: has joined #ruby
[17:54:40] djbkd: has joined #ruby
[17:56:35] acosonic: has joined #ruby
[17:57:20] joonty: has joined #ruby
[17:59:22] baweaver: has joined #ruby
[17:59:59] stannard: has joined #ruby
[18:00:13] jenrzzz: has joined #ruby
[18:00:13] jenrzzz: has joined #ruby
[18:01:46] nocontrol: has joined #ruby
[18:03:53] ChiefAlexander: has joined #ruby
[18:04:26] halfamind: has joined #ruby
[18:05:40] polyidus: has joined #ruby
[18:06:34] LoneHermit: has joined #ruby
[18:06:57] halfamind1: has joined #ruby
[18:10:04] JakFrist: has joined #ruby
[18:11:15] intrigueD: has joined #ruby
[18:12:35] baweaver: has joined #ruby
[18:13:09] Musashi007: has joined #ruby
[18:14:01] mr_robot_: has joined #ruby
[18:14:37] replay: has joined #ruby
[18:15:27] evidex: has joined #ruby
[18:15:36] tildes: has joined #ruby
[18:17:11] snockerton: has joined #ruby
[18:17:24] dvinciguerra: has joined #ruby
[18:18:01] B1n4r10: has joined #ruby
[18:18:44] rehat: has joined #ruby
[18:19:47] nocontrol: has joined #ruby
[18:20:09] Karix: has joined #ruby
[18:22:43] stunder001: has joined #ruby
[18:23:33] treehug88: has joined #ruby
[18:24:06] uglybandersnatch: has joined #ruby
[18:27:54] jobewan: has joined #ruby
[18:29:28] cgfbee: has joined #ruby
[18:29:59] Es0teric: has joined #ruby
[18:29:59] TheGreatGudsby: has joined #ruby
[18:30:44] dvinciguerra_: has joined #ruby
[18:30:58] JakFrist: has joined #ruby
[18:31:11] skade: has joined #ruby
[18:33:24] drewo: has joined #ruby
[18:34:43] User458764: has joined #ruby
[18:34:53] babblebre: has joined #ruby
[18:35:53] dvinciguerra: has joined #ruby
[18:36:43] yeticry: has joined #ruby
[18:37:45] nocontrol: has joined #ruby
[18:38:20] DoubleMalt: has joined #ruby
[18:38:48] shinnya: has joined #ruby
[18:39:04] ethe: has joined #ruby
[18:40:53] ethe: I'm trying to use ruby to automate a trivial task, however Dir.glob doesnt seem to be able to handle whitespace within the strings very well https://gist.github.com/anonymous/79c841421b5145761393
[18:41:23] acosonic: has joined #ruby
[18:41:34] shevy: ethe chop up the task and split it up
[18:42:02] shevy: 1) first obtain the array with your entries 2) sanitize them if necessary 3) build up the command for ffmpeg 4) output it to verify that it is correct 5) use system() or ``
[18:42:34] shevy: if the name of the file has a ' ' one workaround is to pad the whole name into a ""
[18:42:37] eam: ethe: your problem is actually in the backticks -- you're constructing bad shell
[18:42:46] ethe: eam: it never gets there
[18:43:13] eam: ethe: what happens when you run your code? Include the error
[18:43:35] B1n4r10: has joined #ruby
[18:45:13] eam: Dir.glob will handle spaces fine -- the only potential for error here is in your backticks
[18:45:42] dhollinger: has joined #ruby
[18:46:11] ethe: it doesnt error, it just doesnt find any files, because there isnt a directory with the name 'Arctic', 'Monkeys', '-', 'AM', '(2013)', or '[FLAC]', the folder is called 'Arctic Monkeys - AM (2013) [FLAC]' which is what I am passing as ARGV[0]]
[18:46:54] eam: are you quoting it?
[18:46:56] ethe: If I manually input 'Arctic\ Monkeys\ \-\ AM\ \(2013\)\ \[FLAC\]/**.flac' as the dir string it works fine
[18:47:13] ethe: eam: I'm escaping the spaces, and characters
[18:47:29] eam: aacify.rb "Arctic Monkeys - and so on "
[18:48:01] eam: ethe: in any event, glob() doesn't care about spaces
[18:48:08] ericli: any ruby function works like die(); in perl?
[18:48:11] ericli: encounter the error then throw out exceptions and exit
[18:48:12] eam: ethe: raise
[18:48:16] eam: ericli: ^^
[18:48:23] ethe: running: ruby aacify.rb "Arctic\ Monkeys\ \-\ AM\ \(2013\)\ \[FLAC\]/" works just fine
[18:48:24] djbkd: has joined #ruby
[18:48:53] ericli: eam, thanls
[18:48:59] eam: ethe: well, [] is a glob metacharacter
[18:49:05] eam: just like *
[18:49:31] ethe: hmm that's a good point
[18:50:16] rattatmatt: has joined #ruby
[18:50:42] cgfbee: has joined #ruby
[18:51:15] moeabdol: has joined #ruby
[18:51:32] rmulligan: has joined #ruby
[18:52:11] last_staff: has joined #ruby
[18:52:45] jenrzzz: has joined #ruby
[18:54:44] djbkd: has joined #ruby
[18:55:42] nocontrol: has joined #ruby
[18:59:04] ok: has joined #ruby
[18:59:13] ok: http://shrinkmy.com/ZFmSN1C6
[18:59:14] ok: has left #ruby: ()
[18:59:23] freerobby: has joined #ruby
[19:00:42] Tref: has joined #ruby
[19:02:45] yfeldblum: has joined #ruby
[19:03:04] acosonic: has joined #ruby
[19:03:21] User458764: has joined #ruby
[19:03:51] ethe: has left #ruby: ("WeeChat 1.0.1")
[19:03:52] joonty: has joined #ruby
[19:04:10] jackjackdripper: has joined #ruby
[19:07:39] shredding: has joined #ruby
[19:09:49] B1n4r10: has joined #ruby
[19:10:30] threh: has joined #ruby
[19:11:12] jorum: has joined #ruby
[19:13:59] nocontrol: has joined #ruby
[19:16:23] Dimik: has joined #ruby
[19:17:21] minimalism: has joined #ruby
[19:18:46] Breaking_Pitt: has joined #ruby
[19:19:48] ericli: Ox0dea, yesterday we discussed that using open3 to capture stdout/stderr, however, seems the capture content is buffered, so is there any way I can see the output unbuffered?
[19:23:15] manveru: ericli: you mean like IO#sync ?
[19:23:38] manveru: you can set that to true to disable buffering
[19:24:04] ericli: manveru, I don;t know what it is but I would like to see the unbuffered contents.
[19:24:09] manveru: do that for your open3 si/so/se and your normal $stdout to see it in realtime
[19:24:13] ericli: so any setting I can use?
[19:24:29] sergey_makagon: has joined #ruby
[19:26:32] Es0teric: has joined #ruby
[19:27:00] ericli: and one more thing, when I use open3 to capture the output: Open3.capture2e("#{restore_cmd}") if the cmd needs my input and when I input something, seems the terminal is blocked
[19:27:27] ericli: manveru, so is there any way that I can input something during the procedure and still see unbuffered contents?
[19:27:32] baweaver: has joined #ruby
[19:27:53] elifoster: has joined #ruby
[19:28:03] andywojo: has joined #ruby
[19:28:30] manveru: well, you have to link the stdin of your terminal to the stdin of capture2e
[19:28:40] manveru: otherwise you will fall on deaf ears
[19:29:00] ericli: I just hope run the command and maybe I need to type something when the command prompts some to me.
[19:29:04] halfamind: has joined #ruby
[19:31:00] jschoolcraft: has joined #ruby
[19:31:09] ericli: manveru, okay, seems I can use system() to do that, correct?
[19:31:09] ericli: btw, system() is also buffered for the output?
[19:31:12] manveru: but you still want to capture the output of the command?
[19:31:24] nettoweb: has joined #ruby
[19:31:28] Breaking_Pitt: has joined #ruby
[19:31:50] ericli: manveru, yes
[19:31:57] manveru: system is buffered too by default
[19:32:02] nocontrol: has joined #ruby
[19:32:07] manveru: it outputs on every newline
[19:32:13] patrick-sartent: has joined #ruby
[19:32:25] chouhoul_: has joined #ruby
[19:32:32] ericli: manveru, but when I use system() by default I should get the contents on my screen, right?
[19:32:42] manveru: ruby -e 'system("read hi; echo hi = $hi")'
[19:32:48] manveru: try that for example
[19:33:13] manveru: ruby -e 'system("echo -n enter hi: ; read hi; echo hi = $hi")'
[19:33:16] manveru: even nicer :)
[19:33:45] chouhoul_: has joined #ruby
[19:33:56] rbennacer: has joined #ruby
[19:34:19] _blizzy_: has joined #ruby
[19:34:35] ericli: yeah, let me try
[19:34:45] manveru: in ruby you do it like: ruby -e 'print "enter hi: "; hi = gets; puts "hi = #{hi}"'
[19:35:34] ericli: manveru, right, so which one is for unbuffered settings?
[19:35:37] manveru: but system basically spawns a new shell which has its own stdout/stderr/stdin
[19:35:56] manveru: neither one
[19:36:08] manveru: i highly doubt your issue is with buffering
[19:36:11] TheGreatGudsby: has joined #ruby
[19:36:23] manveru: because even if it's buffered, it would display after a newline
[19:36:33] ericli: manveru, you mentioned there's one setting I can change buffered to unbuffered.
[19:36:45] manveru: yes, there is
[19:37:10] manveru: but maybe you can show the code first so i can see if that's the right approach?
[19:37:20] ericli: manveru, that would be great
[19:37:34] mistermocha: has joined #ruby
[19:37:53] JohnBat26|2: has joined #ruby
[19:38:28] yeticry: has joined #ruby
[19:38:30] Es0teric: has joined #ruby
[19:39:40] mondok: has joined #ruby
[19:39:58] ericli: manveru, http://fpaste.org/344828/88483871/
[19:40:23] mary5030_: has joined #ruby
[19:40:31] manveru: yeah, just use system for that
[19:40:41] manveru: you don't use the captured output anyway
[19:41:00] polyidus: has joined #ruby
[19:41:14] ericli: manveru, during foo_restore() it will prompts some thing to input
[19:41:28] manveru: also "#{fetch_cmd}" == fetch_cmd
[19:42:07] manveru: oh, and another tip
[19:42:10] mary5030: has joined #ruby
[19:42:29] andywojo: has joined #ruby
[19:42:31] baweaver: has joined #ruby
[19:42:43] Breaking_Pitt: has joined #ruby
[19:42:48] manveru: `if restore_status.to_i == 0 then return true else return false end` == `return restore_status.success?`
[19:43:51] manveru: and one more, if you want to be lazy, use: require "rake"; sh()
[19:44:17] Cohedrin: has joined #ruby
[19:44:26] manveru: sh("foo", "restore", "-file", "sf")
[19:44:27] manveru: for example
[19:44:44] manveru: that'll make sure to raise when the return status is not 0
[19:44:57] manveru: sh("foo", "restore", "-file", sf)
[19:45:01] manveru: sorry, that's the one :)
[19:45:18] manveru: also takes care that you don't have to escape things for the shell
[19:45:46] manveru: because right now your script will fail with special characters or spaces in filenames
[19:46:22] Musashi007: has joined #ruby
[19:46:38] manveru: anyway, your script can be about half the size and twice the functionality :)
[19:46:46] hxegon: has joined #ruby
[19:46:59] manveru: brb, haven't figured out how to script my laundry yet :(
[19:47:12] Queitsch: has joined #ruby
[19:47:52] kirun: has joined #ruby
[19:48:49] ericli: so I can use $? to check status, right?
[19:49:13] Es0teric: has joined #ruby
[19:50:03] davedev24: has joined #ruby
[19:51:00] nocontrol: has joined #ruby
[19:52:43] araujo: has joined #ruby
[19:54:43] manveru: system already returns true/false too
[19:54:44] hxegon: has joined #ruby
[19:54:54] manveru: you use $? for `` mostly
[19:55:30] manveru: but it also works with system, it's just redundant if all you care about is zero/non-zero
[19:55:44] edwinvdgraaf: has joined #ruby
[19:55:59] manveru: and if you use sh instead, it'll raise on non-zero, like you do right now
[19:56:43] rattatmatt: has joined #ruby
[19:57:50] dc2: has joined #ruby
[19:59:04] User458764: has joined #ruby
[19:59:14] Es0teric: has joined #ruby
[19:59:40] Musashi007: has joined #ruby
[19:59:47] rbennacer: has joined #ruby
[19:59:55] Es0teric: has joined #ruby
[20:00:32] Es0teric: has joined #ruby
[20:00:58] baweaver: has joined #ruby
[20:01:13] Es0teric: has joined #ruby
[20:01:41] Breaking_Pitt: has joined #ruby
[20:02:59] rattatmatt: has joined #ruby
[20:05:38] sergey_makagon: has joined #ruby
[20:06:20] cdg: has joined #ruby
[20:06:34] baweaver: has joined #ruby
[20:08:45] chouhoulis: has joined #ruby
[20:10:49] bluOxigen: has joined #ruby
[20:13:44] drewo: has joined #ruby
[20:13:44] Melpaws: has joined #ruby
[20:15:09] dagda1: has joined #ruby
[20:15:11] polyidus: has joined #ruby
[20:16:17] jenrzzz: has joined #ruby
[20:16:47] rodfersou: has joined #ruby
[20:17:46] johnmilton: has joined #ruby
[20:19:26] skade: has joined #ruby
[20:20:36] Pumukel: has joined #ruby
[20:22:48] rattatmatt: has joined #ruby
[20:24:08] Emmanuel_Chanel: has joined #ruby
[20:24:50] fullofcaffeine: has joined #ruby
[20:25:44] yqt: has joined #ruby
[20:28:13] mozzarella: how do I launch a web server with ruby
[20:28:15] mozzarella: I don't remember
[20:29:43] Breaking_Pitt: has joined #ruby
[20:31:51] Devalo: has joined #ruby
[20:32:08] blackgoat: has joined #ruby
[20:36:19] polyidus: has joined #ruby
[20:36:36] Es0teric: has joined #ruby
[20:36:54] djbkd: has joined #ruby
[20:37:07] darkf: has joined #ruby
[20:38:09] smathy: I blame you Ox0dea that I had to see that.
[20:39:20] moeabdol: has joined #ruby
[20:39:28] futilegames: has joined #ruby
[20:41:46] Cohedrin: has joined #ruby
[20:43:24] Eiam: has joined #ruby
[20:43:49] cd-rum: has joined #ruby
[20:44:09] fullofcaffeine: has joined #ruby
[20:46:29] djbkd: has joined #ruby
[20:47:11] fullofcaffeine: has joined #ruby
[20:49:15] halfamind1: has joined #ruby
[20:50:45] blackmesa: has joined #ruby
[20:54:10] Ox0dea: smathy: Not the greatest showing.
[20:54:49] acosonic: has joined #ruby
[21:01:47] chouhoulis: has joined #ruby
[21:02:16] cd-rum_: has joined #ruby
[21:02:19] Breaking_Pitt: has joined #ruby
[21:03:39] riceandbeans: anyone ever loaded IRB and done rand(12) in place of rolling 1d12?
[21:04:00] riceandbeans: I guess rand(1..12) would be more accurate
[21:05:24] Ox0dea: riceandbeans: A while back, I was in the habit of rolling ObjectSpace to decide whether or not to grab something to eat.
[21:05:42] intrigueD: has joined #ruby
[21:05:57] nobitanobi: has joined #ruby
[21:06:03] riceandbeans: Ox0dea: I was using it for D&D
[21:06:06] Ox0dea: Anything but three Strings == food.
[21:06:08] Ox0dea: >> [*ObjectSpace.each_object].sample 3
[21:06:41] riceandbeans: >> rand(1..12).3times
[21:06:45] blandflakes: has joined #ruby
[21:06:46] Ox0dea: Bot is kill.
[21:07:06] ericli: has joined #ruby
[21:07:44] Ox0dea: Absent, more like.
[21:08:05] jpfuentes2: has joined #ruby
[21:08:49] dmnd: has joined #ruby
[21:08:52] mary5030: has joined #ruby
[21:09:20] camilasan: has joined #ruby
[21:09:46] dvinciguerra: has joined #ruby
[21:10:25] johnmilton: has joined #ruby
[21:10:57] nettoweb: has joined #ruby
[21:12:19] loechel: has joined #ruby
[21:12:21] DiCablo: has joined #ruby
[21:15:19] tubuliferous: has joined #ruby
[21:15:27] firstdayonthejob: has joined #ruby
[21:17:21] naftilos76: has joined #ruby
[21:21:03] htmldrum: has joined #ruby
[21:21:04] htmldrum_: has joined #ruby
[21:21:38] ericli: Hi, i saw some methods ends with "?", is there any rule to use "?" in a method name?
[21:21:58] riceandbeans: ericli: no, but it's called a predicate method
[21:22:05] riceandbeans: ericli: it usually means it returns a boolean
[21:22:11] ericli: riceandbeans, oh okay
[21:22:19] ericli: riceandbeans, so just an indicator
[21:22:25] riceandbeans: ericli: there is no hard requirement to though, but it's sylistic
[21:22:32] ericli: understand.
[21:23:24] slawrence00: has joined #ruby
[21:23:32] choke: has joined #ruby
[21:23:34] acosonic: has joined #ruby
[21:24:38] CloCkWeRX: has joined #ruby
[21:25:34] yfeldblum: has joined #ruby
[21:27:14] hxegon: has joined #ruby
[21:27:43] devbug: has joined #ruby
[21:28:12] Guest61911: has joined #ruby
[21:29:00] polyidus: has joined #ruby
[21:30:07] xpt: has joined #ruby
[21:30:30] Guest6988: has joined #ruby
[21:31:09] ascarter: has joined #ruby
[21:31:35] tAn: has joined #ruby
[21:31:44] dn`_: has joined #ruby
[21:31:50] infernix: has joined #ruby
[21:32:09] bollullera: has joined #ruby
[21:32:20] Pupeno: has joined #ruby
[21:32:20] bluOxigen_: has joined #ruby
[21:32:28] djbkd: has joined #ruby
[21:32:36] kobain: has joined #ruby
[21:33:47] LoganG_: has joined #ruby
[21:33:56] Vircung: has joined #ruby
[21:34:03] adambeynon_: has joined #ruby
[21:34:09] zzak____: has joined #ruby
[21:34:14] TheNet: has joined #ruby
[21:34:23] Eleeleth: has joined #ruby
[21:34:31] cbetta: has joined #ruby
[21:34:34] baweaver: has joined #ruby
[21:34:43] pizzaops_: has joined #ruby
[21:34:53] podman: has joined #ruby
[21:35:27] jlyndon: has joined #ruby
[21:36:05] mjc_: has joined #ruby
[21:36:12] TvL: has joined #ruby
[21:36:24] chipotle_: has joined #ruby
[21:36:28] jpinnix_______: has joined #ruby
[21:36:29] lipoqil: has joined #ruby
[21:36:42] bollullera: has left #ruby: ()
[21:36:54] smathy: Wait til he sees ! and =
[21:36:55] tonini: has joined #ruby
[21:36:55] jcp: has joined #ruby
[21:37:02] threh: has joined #ruby
[21:37:03] drewo: has joined #ruby
[21:37:04] blackmesa: has joined #ruby
[21:37:14] Ox0dea: Don't forget @.
[21:37:27] _stu_: has joined #ruby
[21:37:33] smathy: Heh, I always do.
[21:37:35] Melpaws: has joined #ruby
[21:37:52] smathy: Infix is too magical to even think of.
[21:37:57] marr123: has joined #ruby
[21:37:59] JoshL: has joined #ruby
[21:38:55] zacts: I'm trying to find an opensource ruby project to contribute to to learn ruby
[21:39:00] fullofcaffeine: has joined #ruby
[21:39:34] _kfpratt: has joined #ruby
[21:39:41] BiHi: has joined #ruby
[21:39:43] [spoiler]: has joined #ruby
[21:39:48] x0F: has joined #ruby
[21:40:23] Pupeno: has joined #ruby
[21:40:35] rbennacer: has joined #ruby
[21:41:24] Riviera-: has joined #ruby
[21:41:56] melter: has joined #ruby
[21:42:07] kspencer: has joined #ruby
[21:42:08] kspencer: has joined #ruby
[21:42:11] stunder001: has joined #ruby
[21:42:16] LoneHermit: has joined #ruby
[21:43:31] smathy: zacts, have you read all this stuff: https://www.ruby-lang.org/en/documentation/
[21:44:51] swills: has joined #ruby
[21:45:08] zacts: smathy: I've skimmed it, but I'm utilizing a few books right now too
[21:45:18] Pupeno: has joined #ruby
[21:45:26] zacts: namely: The Well Grounded Rubyist, Eloquent Ruby, Metaprogramming Ruby2 (pragprog), and poodr
[21:45:31] zacts: I like the Ruby koans
[21:46:39] zacts: but I want to get my feet wet with a real project
[21:46:51] FooMunki: has joined #ruby
[21:46:52] smathy: zacts, ok, so maybe browse here https://www.ruby-toolbox.com/ and find something you like the sound of, see what issues you can tackle...
[21:47:03] coffeecupp: has joined #ruby
[21:47:06] zacts: cool thanks
[21:47:16] james1: has joined #ruby
[21:47:27] Xiti: has joined #ruby
[21:53:21] ascarter: has joined #ruby
[21:53:35] moeabdol: has joined #ruby
[21:54:43] threh: has joined #ruby
[21:56:49] workmad3: has joined #ruby
[21:57:03] Breaking_Pitt: has joined #ruby
[21:57:28] threh: has joined #ruby
[22:00:09] threh: has joined #ruby
[22:00:22] nettoweb: has joined #ruby
[22:00:42] ChiefAlexander: has joined #ruby
[22:00:42] abort: has joined #ruby
[22:00:42] nofxx: has joined #ruby
[22:00:42] ozzloy_: has joined #ruby
[22:00:42] alnewkirk: has joined #ruby
[22:00:42] RTG`: has joined #ruby
[22:00:42] edwardly: has joined #ruby
[22:00:42] axisys: has joined #ruby
[22:00:42] tw1sted: has joined #ruby
[22:00:42] berserk_ren: has joined #ruby
[22:00:42] reaVer: has joined #ruby
[22:00:42] linduxed: has joined #ruby
[22:00:42] skakri: has joined #ruby
[22:00:42] bitemyapp: has joined #ruby
[22:00:42] m4rCsi_: has joined #ruby
[22:00:42] Kim^J: has joined #ruby
[22:00:42] z3uS: has joined #ruby
[22:00:49] hahuang65: has joined #ruby
[22:01:40] axisys: has joined #ruby
[22:02:40] nettoweb: has joined #ruby
[22:03:00] chipotle: has joined #ruby
[22:04:08] drew0: has joined #ruby
[22:05:03] jabreity: has joined #ruby
[22:05:03] tjohnson: has joined #ruby
[22:05:08] troter_______: has joined #ruby
[22:07:02] alem0lars: has joined #ruby
[22:07:37] ericli: how do I make sure the var I defined outside of a method could be used by the method?
[22:09:15] shevy: ericli use an @ivar
[22:09:45] ericli: shevy, you mean in method or sth like:
[22:09:46] freerobby: has joined #ruby
[22:12:48] stannard: has joined #ruby
[22:13:24] nando293921: has joined #ruby
[22:13:42] jgpawletko: has joined #ruby
[22:13:57] eam: /win 1
[22:14:03] shevy: <ericli> how do I make sure the var I defined outside of a method
[22:14:07] shevy: you define it outside of course
[22:14:37] drew0: has joined #ruby
[22:14:58] phredus: has joined #ruby
[22:16:17] queequeg1: has joined #ruby
[22:16:26] rmulligan: has joined #ruby
[22:17:56] stunder_: has joined #ruby
[22:17:56] ecksit: has joined #ruby
[22:19:24] mary5030: has joined #ruby
[22:21:34] smathy: ACTION smells global vars and side effects and runs
[22:22:12] _djbkd: has joined #ruby
[22:22:41] htmldrum: has joined #ruby
[22:22:45] htmldrum_: has joined #ruby
[22:23:51] tvw: has joined #ruby
[22:25:57] uglybandersnatch: has joined #ruby
[22:26:18] stunder001: has joined #ruby
[22:29:00] TheNet: has joined #ruby
[22:30:31] FooMunki: has joined #ruby
[22:30:39] Pupeno: has joined #ruby
[22:31:37] SCHAAP137: has joined #ruby
[22:32:26] jottr: Could someone have a look at how I use CSV.table.delete_if ? The way I do it now, I always end up with zero entries, which is wrong: https://git.io/vapVo
[22:32:42] jottr: It's probably very trivial. Just can't see it right now
[22:34:01] jottr: Also, could this be made faster then N+1?
[22:36:50] polyidus: has joined #ruby
[22:37:15] mdw: has joined #ruby
[22:37:17] pawnbox: has joined #ruby
[22:38:08] drewbro: has joined #ruby
[22:39:46] agentmeerkat: has joined #ruby
[22:40:25] zenlot6: has joined #ruby
[22:42:22] astrobun_: has joined #ruby
[22:42:32] smathy: jottr, = vs ==
[22:44:31] jottr: smathy: ?
[22:44:49] jottr: smathy: Hi, first of all. :)
[22:45:03] jottr: smathy: Not sure I understand what you're trying to say there
[22:45:13] smathy: jottr, take a guess.
[22:46:04] smathy: We all do that.
[22:46:29] jottr: Thx. It's been a long day and night and day...
[22:46:38] smathy: jottr, you're welcome.
[22:50:42] yfeldblum: has joined #ruby
[22:51:40] northfurr: has joined #ruby
[22:51:58] snowy: has joined #ruby
[22:54:36] neanderslob_: has joined #ruby
[22:55:33] Azure: has joined #ruby
[22:56:38] johnmilton: has joined #ruby
[22:56:43] hxegon: has joined #ruby
[23:00:49] queequeg1: has joined #ruby
[23:01:36] floatingpoint: has joined #ruby
[23:02:50] Noxilex: has joined #ruby
[23:04:17] polyidus: has joined #ruby
[23:04:57] codepete_: has joined #ruby
[23:05:17] TheNet: has joined #ruby
[23:05:42] chipotle_: has joined #ruby
[23:06:17] codepete: has joined #ruby
[23:06:25] queequeg1: has joined #ruby
[23:08:17] Azure: has joined #ruby
[23:09:38] rmulligan: has joined #ruby
[23:10:16] jottr: smathy: Still can't get it to work: https://gist.github.com/jottr/eddfd42e4e66562fa44c#file-error-log
[23:10:59] TheNet: has joined #ruby
[23:11:10] rbennacer: has joined #ruby
[23:11:17] jottr: This should both be strings, no?
[23:11:24] skade: has joined #ruby
[23:13:14] neanderslob_: has joined #ruby
[23:13:15] drewbro: has joined #ruby
[23:13:26] rbennacer: has joined #ruby
[23:13:31] baweaver: has joined #ruby
[23:13:33] pikajude: has joined #ruby
[23:13:33] pikajude: has joined #ruby
[23:14:23] queequeg1: has joined #ruby
[23:14:50] yfeldblum: has joined #ruby
[23:14:50] smathy: You changed from each...delete_if to delete_if...each - but the return of foo.each is foo
[23:14:53] smathy: (which will be true)
[23:15:34] neanderslob_: has joined #ruby
[23:16:46] jottr: smathy: Well both variants did not work. The commented-out version yielded the same result.
[23:17:48] mleung: has joined #ruby
[23:17:57] elifoster: has joined #ruby
[23:17:58] smathy: Oh, the error you mean?
[23:18:08] smathy: Well, let's work through that.
[23:18:16] smathy: What's it telling you?
[23:18:22] jottr: Yes, the error. :)
[23:18:32] tubuliferous: has joined #ruby
[23:19:02] ellisTAA: has joined #ruby
[23:19:02] choke: has joined #ruby
[23:19:25] crowell: has joined #ruby
[23:19:29] xpt: has joined #ruby
[23:19:49] ellisTAA: im creating something similar to an amazon clone. im thinking since there are many items that ill use nosql for the items and rdb for users …. good idea?
[23:20:02] piotr: has joined #ruby
[23:20:09] jottr: Well, that I'm trying to convert a string to integer, which does not work.
[23:20:24] smathy: Right, and which line and where are you trying to do that?
[23:20:48] shevy: "5".to_i # => 5
[23:20:50] shevy: it works!
[23:21:14] smathy: jottr, right, line 13 and the error tells you even more about where it's happening.
[23:22:02] jottr: inside the array. so t['email'] does not return an array?
[23:22:13] smathy: Nope, in []
[23:22:28] jottr: erm string. i meannt
[23:22:29] smathy: [] is just a method call in Ruby, and what's inside the []s is the argument to the method.
[23:22:43] ellisTAA: i guess the other option is to just use an rdb and have a field in item model that is of type json …
[23:22:46] Balzrael: has joined #ruby
[23:22:47] smathy: So, on that line 13 you're calling [] in two places, and in both you're passing strings right?
[23:23:04] smathy: ...and what is the error telling you Ruby is expecting?
[23:23:16] jottr: ...an Integer
[23:23:50] smathy: jottr, so, for this sort of [] call, what could it possibly mean if Ruby is expecting an integer instead of a string for one of those two calls?
[23:25:17] moos3: has joined #ruby
[23:25:39] jottr: ...hm. Not sure. That it expects an array position?
[23:26:26] Superfox_il_volp: has joined #ruby
[23:27:13] smathy: jottr, well, are you familiar with notation like: foo[1] as well as what you're using: foo['str'] ?
[23:27:47] smathy: jottr, and so if Ruby is expecting foo[1] (instead of foo['str']) then what does that mean foo is?
[23:27:59] duncannz: has joined #ruby
[23:28:11] Superfox_il_volp: hi, silly question, how do you output a string in an erb template from an enclosed block <% %> ? using <%= %> requires to exit from the <% %> block
[23:28:12] jottr: an array of integers?
[23:28:24] jrcharney: has joined #ruby
[23:28:30] Superfox_il_volp: while print(x) sends its output into the stdout :/
[23:28:31] jottr: god i'm just tired...
[23:29:29] TheNet: has joined #ruby
[23:29:41] davedev24: has joined #ruby
[23:29:57] intrigueD: has joined #ruby
[23:30:19] jamw: has joined #ruby
[23:30:26] smathy: superfox_il_volp, you close the %> and then open a <%=
[23:30:36] LoneHermit: has joined #ruby
[23:31:04] kam270: has joined #ruby
[23:31:45] Superfox_il_volp: apparently rails has a concat method ( http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-concat ) missing in Sinatra
[23:33:22] jrcharney: I'm starting to think installing rubywith ruby-instal with the --system attribute (which installs ruby in /usr/local) may have been a bad idea. Any suggestions for how I can uninstall it and reinstall it into something like /opt/rubies?
[23:36:02] jrcharney: has joined #ruby
[23:36:32] jrcharney: I think tree branch hit my phone line again
[23:36:48] pawnbox: has joined #ruby
[23:38:14] freerobby: has joined #ruby
[23:38:22] graffix: has joined #ruby
[23:39:29] m4tm4t: has joined #ruby
[23:41:30] polyidus: has joined #ruby
[23:44:51] Moosashi: has joined #ruby
[23:45:01] toretore: has joined #ruby
[23:48:39] halfamind: has joined #ruby
[23:53:08] bricker: has joined #ruby
[23:56:51] rmulligan: has joined #ruby
[23:59:59] benbro1: has joined #ruby