« Back to channel list

#ruby - 19 May 2016

« Back 1 day Forward 1 day »
[00:03:17] mozzarella: can I ask gem to install binaries elsewhere?
[00:05:04] ramfjord: has joined #ruby
[00:08:23] jaguarmagenta: has joined #ruby
[00:10:49] PlasmaStar: has joined #ruby
[00:12:24] akiTendo: has joined #ruby
[00:12:41] qasaur: has joined #ruby
[00:12:46] maxdoubt: has joined #ruby
[00:14:35] rkoller: has joined #ruby
[00:16:16] rbennacer: has joined #ruby
[00:17:14] rkazak: has joined #ruby
[00:21:08] cooldavid: has joined #ruby
[00:21:41] cooldavid: I'm trying to rewrite the flatten method, any ideas for where to look?
[00:22:41] cooldavid: I understand how flatten works, I just don't see how I can reimplement it
[00:26:26] diegoviola: has joined #ruby
[00:28:03] gregf: has joined #ruby
[00:28:07] stunder001: has joined #ruby
[00:28:30] stardiviner: has joined #ruby
[00:30:03] _Tariq: has joined #ruby
[00:34:35] nankyokusei: has joined #ruby
[00:37:25] crystal77: has joined #ruby
[00:43:30] gregf: has joined #ruby
[00:44:47] d0nn1e: has joined #ruby
[00:45:03] swills: has joined #ruby
[00:46:39] flashpoint9: has joined #ruby
[00:47:27] nettoweb: has joined #ruby
[00:47:35] baweaver: To understand recursion, you must first understand recursion
[00:48:07] baweaver: basically you're diving through a tree, pulling up all the nodes
[00:49:23] baweaver: if item is an array, recurse, else concat value to accumulating array
[00:50:40] cooldavid: thanks, I'll look at how #flatten is implemented also
[00:51:07] _Tariq: Hello, I don't know where I can ask this question, so please forgive me if this sounds very stupid. But I'm building a Ruby server
[00:51:19] maxdoubt: has joined #ruby
[00:51:24] _Tariq: Ruby web server
[00:52:01] _Tariq: I am able to send HTTP headers such as "Set-Cookie: _ga=GA1.1.1476691770.1461799040; count=0"
[00:52:08] _Tariq: but it seems to ignore that HTTP header
[00:52:14] _Tariq: and doesn't actually set a cookie
[00:52:22] _Tariq: and I don't know why
[00:52:34] aries_liuxueyang: has joined #ruby
[00:54:04] maxdoubt: has joined #ruby
[00:56:33] konsolebox: has joined #ruby
[00:57:01] halfamind: has joined #ruby
[00:57:48] maxdoubt: has joined #ruby
[00:58:15] imperator: has joined #ruby
[01:00:01] maxdoubt: has joined #ruby
[01:01:27] dessm: has joined #ruby
[01:01:49] Xiti: has joined #ruby
[01:03:08] wldcordeiro: has joined #ruby
[01:03:25] Musashi007: has joined #ruby
[01:04:14] dessm: Hi, I'm not sure if it's okay to ask questions here, so apologies if I'm breaching etiquette. I'm doing the Ruby koans and was wondering why, if I have an array=[1,2,3], array[3,0] == [], but array[4,0] == nil? Since both start indices are beyond the indeces of the array wouldn't one expect them to return the same value? Thank you.
[01:05:38] purrkode: has joined #ruby
[01:06:53] centrx: has joined #ruby
[01:11:16] davedev24: has joined #ruby
[01:14:37] jaguarmagenta: has joined #ruby
[01:14:49] s00pcan_: has joined #ruby
[01:15:29] mistermocha: has joined #ruby
[01:17:07] benzrf: hey dessm
[01:18:20] imperator: dessm, https://www.ruby-forum.com/topic/1393096 - look for the answer from Gary Wright
[01:18:35] aeontech: has joined #ruby
[01:18:35] benzrf: questions are welcomed, btw =)
[01:19:06] benzrf: imperator: oh, i inferred that and was about to explain it
[01:19:11] benzrf: but without nice diagrams <.<
[01:19:34] imperator: (short version, the semantics for array[x] and array[x,y] are different)
[01:20:31] dessm: Cool, thank you both very much
[01:22:03] _Tariq: Where do I go to debug a HTTP Header? :(
[01:22:03] imperator: weakref question - why doesn't this fail? https://gist.github.com/djberg96/649c423d6a338d6b4694b5cbde77205c
[01:22:18] _Tariq: Because I can't go here
[01:22:23] Kyhz: has joined #ruby
[01:23:39] youch: has joined #ruby
[01:24:06] maxdoubt: has joined #ruby
[01:26:43] pawnbox: has joined #ruby
[01:28:37] spacemud: has joined #ruby
[01:30:32] `tim`: has joined #ruby
[01:32:30] steve: has joined #ruby
[01:34:44] nando293921: has joined #ruby
[01:36:38] spacemud: has joined #ruby
[01:36:58] Ropeney: has joined #ruby
[01:37:00] saltsa: has joined #ruby
[01:37:00] TTilus: has joined #ruby
[01:40:50] juanfra: has joined #ruby
[01:42:14] Yzguy: has joined #ruby
[01:43:35] rkazak: has joined #ruby
[01:45:05] A5101: has joined #ruby
[01:46:09] jenrzzz: has joined #ruby
[01:46:49] curses: has joined #ruby
[01:47:55] malconis: has joined #ruby
[01:49:11] jancel: has joined #ruby
[01:53:25] auzty: has joined #ruby
[01:58:24] centrx: has joined #ruby
[01:58:51] sondr3: has joined #ruby
[02:02:26] pawnbox: has joined #ruby
[02:03:23] Tempesta: has joined #ruby
[02:06:32] stardiviner: has joined #ruby
[02:06:45] jaguarmagenta: has joined #ruby
[02:10:21] jaguarmagenta: has joined #ruby
[02:10:37] aghalarp: has joined #ruby
[02:11:13] Vingador: has joined #ruby
[02:11:15] Fredrich010: has joined #ruby
[02:11:49] maxdoubt: has joined #ruby
[02:12:36] bsharitt: has joined #ruby
[02:13:48] halfamind: has joined #ruby
[02:20:43] mistermocha: has joined #ruby
[02:25:23] chouhoulis: has joined #ruby
[02:26:19] chouhoul_: has joined #ruby
[02:26:23] AnoHito: has joined #ruby
[02:28:19] Musashi007: has joined #ruby
[02:29:44] joneshf-laptop: has joined #ruby
[02:34:36] arlek_: has joined #ruby
[02:35:26] nankyokusei: has joined #ruby
[02:36:20] eljimmy: has joined #ruby
[02:37:57] jancel: has joined #ruby
[02:38:59] nanothief: has joined #ruby
[02:39:16] nando293921: has joined #ruby
[02:42:51] kgrz: has joined #ruby
[02:42:58] chipotle: has joined #ruby
[02:45:01] `tim`: has joined #ruby
[02:45:20] youch: has joined #ruby
[02:47:47] mistermocha: has joined #ruby
[02:50:53] mistermocha: has joined #ruby
[02:54:06] pawnbox: has joined #ruby
[02:55:07] jancel: has joined #ruby
[03:02:40] Musashi007: has joined #ruby
[03:03:58] nibbo: has joined #ruby
[03:04:01] nemish: has joined #ruby
[03:05:12] gtsai: has joined #ruby
[03:07:39] RegulationD: has joined #ruby
[03:11:13] Xeago: has joined #ruby
[03:12:19] postmodern: has joined #ruby
[03:13:47] gix: has joined #ruby
[03:16:08] braincrash: has joined #ruby
[03:17:23] nettoweb: has joined #ruby
[03:18:12] purrkode: has joined #ruby
[03:19:21] Xiti: has joined #ruby
[03:20:18] CJKinni: has joined #ruby
[03:23:32] pawnbox: has joined #ruby
[03:27:56] Musashi007: has joined #ruby
[03:28:42] aghalarp: has joined #ruby
[03:29:21] shakes: has joined #ruby
[03:30:23] maxdoubt: has joined #ruby
[03:34:21] LoneHerm_: has joined #ruby
[03:35:33] mog: has joined #ruby
[03:36:02] mog: how does ffi_lib find libraries? i have libcurl.so installed but ffi_lib says it cant find it
[03:37:07] impermanence: has joined #ruby
[03:44:23] mistermocha: has joined #ruby
[03:44:32] ereslibre: has joined #ruby
[03:44:32] ereslibre: has joined #ruby
[03:47:10] gomix: has joined #ruby
[03:47:59] halfamind: has joined #ruby
[03:48:08] bluOxigen: has joined #ruby
[03:49:36] bronson: has joined #ruby
[03:49:54] humd1ng3r: has joined #ruby
[03:50:22] mog: figured it out i needed to change my ld_library_path
[03:50:29] aries_liuxueyang: has joined #ruby
[03:53:40] aries_liuxueyang: has joined #ruby
[03:55:16] zzak: has joined #ruby
[03:56:18] hk238: has joined #ruby
[03:57:04] elifoster: has joined #ruby
[03:58:41] noService: has joined #ruby
[04:00:33] sondr3: has joined #ruby
[04:00:53] aries_liuxueyang: has joined #ruby
[04:01:47] Madplatypus: has joined #ruby
[04:04:19] nettoweb: has joined #ruby
[04:05:29] crystal77: has joined #ruby
[04:06:07] LBRapid: has joined #ruby
[04:06:57] edev: has joined #ruby
[04:07:22] kareeoleez: has joined #ruby
[04:08:37] Alcon: has joined #ruby
[04:09:16] kareeoleez: has joined #ruby
[04:11:50] djbkd: has joined #ruby
[04:13:08] LBRapid: has joined #ruby
[04:17:33] rkazak: has joined #ruby
[04:18:59] M-mistake: has joined #ruby
[04:20:20] unsymbol: has joined #ruby
[04:21:23] aeontech: has joined #ruby
[04:23:01] passbe: has joined #ruby
[04:24:10] flashpoint9: has joined #ruby
[04:25:08] aries_liuxueyang: has joined #ruby
[04:31:31] pawnbox: has joined #ruby
[04:32:13] duncannz: has joined #ruby
[04:33:01] aghalarp: has joined #ruby
[04:35:00] Macaveli: has joined #ruby
[04:35:15] aries_liuxueyang: has joined #ruby
[04:36:17] nankyokusei: has joined #ruby
[04:40:23] aeontech: has joined #ruby
[04:40:25] tmtwd: has joined #ruby
[04:41:13] k3rn31: has joined #ruby
[04:49:12] rbennacer: has joined #ruby
[04:52:10] Devalo: has joined #ruby
[04:55:08] k3rn31: has joined #ruby
[04:55:21] jaguarmagenta: has joined #ruby
[04:55:36] goodfella: has joined #ruby
[04:56:20] aries_liuxueyang: has joined #ruby
[04:56:30] goodfella: I am taking the Rails Tutorial
[04:57:10] goodfella: i have never step foot in a text editor / IDE
[04:57:27] duncannz: has joined #ruby
[04:57:29] goodfella: so it is fairly difficult for me
[04:58:18] goodfella: Last time I spent time coding I was using BASIC on DOS back in 1992
[04:58:31] nando294121: has joined #ruby
[04:58:39] rbennacer: has joined #ruby
[04:59:57] goodfella: I think I saw you earlier today...?
[05:00:16] goodfella: at starbucks
[05:00:30] goodfella: probably not
[05:01:06] Musashi007: has joined #ruby
[05:02:00] qasaur: has joined #ruby
[05:02:16] goodfella: has anyone here used cloud9?
[05:02:42] moeabdol: has joined #ruby
[05:03:12] Radar: ?rails goodfella
[05:03:12] ruby[bot]: goodfella: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[05:03:28] Radar: goodfella: If you hand around for an hour or two, EU people will wake up and will be able to answer your questions.
[05:04:47] hahuang65: has joined #ruby
[05:05:19] sauvin: has joined #ruby
[05:12:27] rbennacer: has joined #ruby
[05:13:11] fmcgeough: has joined #ruby
[05:15:39] kareeoleez: has joined #ruby
[05:16:14] mistermocha: has joined #ruby
[05:18:25] chopin: has joined #ruby
[05:18:48] aeontech: has joined #ruby
[05:19:35] _kraken: if I wanted to take an attribute_accesor that the user inputs, and capitalize it, how would I do that?
[05:20:22] Radar: _kraken: Do you have an example of your code so far?
[05:20:52] _kraken: class Book
[05:20:56] _kraken: attr_accessor :name
[05:22:40] Radar: How would you capitalise the book title "rails 4 in action"?
[05:22:50] Radar: https://gist.github.com/radar/514b29ae6e78ed18c20cbbb8e8d6cbba
[05:23:41] BTRE: has joined #ruby
[05:24:05] moeabdol: has joined #ruby
[05:27:35] ramfjord: has joined #ruby
[05:27:47] insanedreamer: has joined #ruby
[05:30:10] yfeldblum: has joined #ruby
[05:31:19] yfeldblum: has joined #ruby
[05:31:56] iamvery: has joined #ruby
[05:34:13] chopin: If I want to stub requests to an API with webmock but I need to test for a handful of responses, what's the best way to do that? My first hacky though was that you can set something unique in the headers to key in on but it leads me to write terrible code like this:
[05:34:19] chopin: https://gist.github.com/BradleyJohnson/fa21cb145996bbeb70adaf44650ff464
[05:34:33] chopin: There must be a better way. Any thoughts?
[05:36:01] shevy: Radar how about also adding a - :D "Rails 4 - in Action" ... with the - I would capitalize two words. not sure if it would make much sense without the '-' though to capitalize
[05:39:02] LoneHerm_: has joined #ruby
[05:39:49] d0nn1e: has joined #ruby
[05:40:54] xall: has joined #ruby
[05:43:00] troys: has joined #ruby
[05:45:04] djbkd: has joined #ruby
[05:45:41] emilkarl: has joined #ruby
[05:48:16] curses: has joined #ruby
[05:48:43] xall_: has joined #ruby
[05:49:45] Dimik: has joined #ruby
[05:50:27] mog: has left #ruby: ("Leaving")
[05:51:40] bronson: has joined #ruby
[05:54:16] n1x-nz: has joined #ruby
[05:54:26] Polysics_: has joined #ruby
[05:56:41] A5101: has joined #ruby
[05:57:10] janebootydoe: has joined #ruby
[05:58:30] aagdbl: has joined #ruby
[06:02:07] sondr3: has joined #ruby
[06:02:28] fckyoufreenode: has joined #ruby
[06:02:43] aeontech: has joined #ruby
[06:06:02] ur5us: has joined #ruby
[06:06:03] chouhoulis: has joined #ruby
[06:06:26] hahuang65: has joined #ruby
[06:06:42] aghalarp: has joined #ruby
[06:06:54] colegatron: has joined #ruby
[06:08:32] d0lph1n98: has joined #ruby
[06:09:42] n1x-nz: has joined #ruby
[06:10:07] kareeoleez: has joined #ruby
[06:11:02] n1x-nz: has joined #ruby
[06:11:05] Dimik: has joined #ruby
[06:12:21] n1x-nz: has joined #ruby
[06:14:00] jancel: has joined #ruby
[06:14:10] tildes_: has joined #ruby
[06:16:17] Alina-malina: has joined #ruby
[06:16:20] TomyLobo: has joined #ruby
[06:16:40] Alina-malina: has joined #ruby
[06:17:24] Amnez777: has joined #ruby
[06:17:44] Alina-malina: has joined #ruby
[06:17:44] Alina-malina: has joined #ruby
[06:24:13] _kraken: radar: Thank you!
[06:26:41] mistermocha: has joined #ruby
[06:27:00] aeontech: has joined #ruby
[06:27:05] Oog: has joined #ruby
[06:28:27] skade: has joined #ruby
[06:30:19] firstdayonthejob: has joined #ruby
[06:30:26] agent_white: has joined #ruby
[06:31:52] Alcon`: has joined #ruby
[06:34:10] bluOxigen: has joined #ruby
[06:34:27] _kraken: So are you not able to change objects using the .each method? But you are able to change them with methods you can use ! with
[06:35:41] skakri: has joined #ruby
[06:37:09] nankyokusei: has joined #ruby
[06:42:00] tvw: has joined #ruby
[06:42:30] aeontech: has joined #ruby
[06:44:42] anisha: has joined #ruby
[06:45:22] Amnez777: has joined #ruby
[06:47:06] tmtwd: has joined #ruby
[06:47:31] bluOxigen: has joined #ruby
[06:49:02] tildes: has joined #ruby
[06:49:07] skakri: has joined #ruby
[06:57:57] kgrz: has joined #ruby
[06:58:14] aghalarp: has joined #ruby
[06:59:52] ur5us: has joined #ruby
[07:03:02] cbliard: has joined #ruby
[07:04:12] Janky: has joined #ruby
[07:04:45] cbliard: Hi, I have an issue with `bundle exec rspec`, it won't load some gems in the :test group and I can't remember what changed in my configuration (it used to work). Can anybody help me finding out what's going on?
[07:05:15] cbliard: the error is "/home/cbliard/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/formatters.rb:222:in `require': cannot load such file -- fuubar"
[07:06:20] cbliard: if I remove the `gem 'fuubar'` from group :test (so it has no group), it loads properly but then it fails with another gem (simplecov)
[07:06:38] janebootydoe: cbliard, does it load in other groups?
[07:06:39] neanderslob: has joined #ruby
[07:07:43] cbliard: and I use rvm. I tried to remove all my ruby and gems, and reinstall everything, but I still have the same behavior.
[07:08:30] cbliard: One weird thing when I moved from group :test to group :development is that the gem 'fuubar' was not installed. I had to run `bundle install` again to install it.
[07:08:47] cbliard: so the gem is invisible to "bundle exec", but also to "bundle install"
[07:09:06] RegulationD: has joined #ruby
[07:09:31] janebootydoe: cbliard, have a repo link?
[07:09:43] cbliard: not a public one :/
[07:10:00] fbandov: has joined #ruby
[07:10:57] cbliard: I'm making a gist
[07:11:36] skade: has joined #ruby
[07:16:36] TomyWork: has joined #ruby
[07:16:49] lewis1711: has joined #ruby
[07:17:35] p1k: has joined #ruby
[07:18:11] tildes: has joined #ruby
[07:19:47] cbliard: Ok, I found the problem. I once ran "--without test", and as this is a sticky config option, it created a .bundle/config with "BUNDLE_WITHOUT: test". I deleted it and it now works correctly
[07:22:25] Ishido: has joined #ruby
[07:22:58] aganov: has joined #ruby
[07:23:03] antgel: has joined #ruby
[07:23:09] lewis1711: is there anything like "#take" for arrays that mutates them in place?
[07:24:15] cbliard: lewis1711: #shift
[07:24:22] lewis1711: for some inexplicable reason, #pop removes from the end of an array, but pop(n) removes from the front
[07:24:28] lewis1711: ah, thanks cbliard
[07:24:55] codecop: has joined #ruby
[07:25:02] cbliard: #pop should remove from the end
[07:25:12] cbliard: [9] pry(main)> a = [1, 2, 3, 4, 5]
[07:25:12] cbliard: => [1, 2, 3, 4, 5]
[07:25:13] cbliard: [10] pry(main)> a.pop(2)
[07:25:13] cbliard: [11] pry(main)> a
[07:25:13] cbliard: => [1, 2, 3]
[07:25:16] apeiros: lewis1711: um, no, pop(n) removes from the end too
[07:25:48] apeiros: shift(n) and shift remove from the front
[07:26:06] lewis1711: I'm having a slow day. it returns what it removes..
[07:26:14] p1k: has joined #ruby
[07:27:02] the_drow: has joined #ruby
[07:27:44] the_drow: has joined #ruby
[07:27:47] terlar: has joined #ruby
[07:30:58] tildes: has joined #ruby
[07:32:18] aufi: has joined #ruby
[07:33:14] LoneHerm_: has joined #ruby
[07:35:13] skade: has joined #ruby
[07:40:29] Polysics: has joined #ruby
[07:42:46] tmtwd: has joined #ruby
[07:43:27] mic_e: has joined #ruby
[07:44:01] jaruga___: has joined #ruby
[07:45:45] pawnbox: has joined #ruby
[07:49:08] curses: has joined #ruby
[07:49:15] n_blownapart: has joined #ruby
[07:49:50] CausaMortis: has joined #ruby
[07:49:58] noobsu: has joined #ruby
[07:50:02] last_staff: has joined #ruby
[07:50:06] tatsuo: has joined #ruby
[07:53:09] norc: has joined #ruby
[07:53:19] bronson: has joined #ruby
[07:54:17] TomyWork: jhass cheers for pointing me at hash.dig yesterday. i couldnt take a look at it due to net outage, but that looks exactly like what i need
[07:54:29] TomyWork: and with https://github.com/Invoca/ruby_dig/blob/master/lib/ruby_dig.rb i can even use it on older ruby versions :)
[07:54:38] noobsu: has joined #ruby
[07:55:08] tax: has joined #ruby
[07:55:41] Couch: has joined #ruby
[07:57:44] n_blownapart: has joined #ruby
[08:00:50] edwinvdgraaf: has joined #ruby
[08:02:36] jancel: has joined #ruby
[08:02:42] konsolebox: has joined #ruby
[08:02:55] xall: has joined #ruby
[08:03:24] sondr3: has joined #ruby
[08:03:57] coffeecupp: has joined #ruby
[08:09:19] hightower3: has joined #ruby
[08:09:54] hahuang65: has joined #ruby
[08:09:56] mistermocha: has joined #ruby
[08:12:33] pwnd_nsfw: has joined #ruby
[08:12:33] blackmesa: has joined #ruby
[08:13:02] marr: has joined #ruby
[08:14:21] Ch4rAss: has joined #ruby
[08:15:05] flughafen: hey shevy i'm still grounded!
[08:15:20] n_blownapart: has joined #ruby
[08:15:59] yfeldblum: has joined #ruby
[08:16:07] n1x-nz: has joined #ruby
[08:16:39] Hanmac: flughafen: so you are not an AIRport? ;P
[08:19:14] tomphp: has joined #ruby
[08:21:38] Trieste: has joined #ruby
[08:23:10] jenrzzz: has joined #ruby
[08:23:12] senayar: has joined #ruby
[08:23:25] n_blownapart: has joined #ruby
[08:25:30] mtkd: has joined #ruby
[08:26:32] noobsu: has joined #ruby
[08:27:10] kam270: has joined #ruby
[08:28:33] coffeecupp: has joined #ruby
[08:30:19] kam270: has joined #ruby
[08:30:26] tAn: has joined #ruby
[08:35:06] Ch4rAss: has joined #ruby
[08:35:19] araujo: has joined #ruby
[08:35:51] n_blownapart: has joined #ruby
[08:36:22] valeri_ufo: has joined #ruby
[08:38:01] nankyokusei: has joined #ruby
[08:38:31] aries_liuxueyang: has joined #ruby
[08:39:26] mistermocha: has joined #ruby
[08:40:26] Ropeney: has joined #ruby
[08:40:42] Pupeno: has joined #ruby
[08:41:45] n_blownapart: has joined #ruby
[08:45:59] aupadhye: has joined #ruby
[08:46:48] skade: has joined #ruby
[08:50:41] weckl: has joined #ruby
[08:51:01] joonty: has joined #ruby
[08:51:10] startupality: has joined #ruby
[08:53:56] pawnbox: has joined #ruby
[08:56:44] MrSamuel: has joined #ruby
[08:56:46] Coldblackice: has joined #ruby
[08:56:55] snowy: has joined #ruby
[08:57:09] blaxter: has joined #ruby
[08:57:42] workmad3: has joined #ruby
[08:59:49] lewis1712: has joined #ruby
[09:00:17] n_blownapart: has joined #ruby
[09:00:20] jenrzzz: has joined #ruby
[09:00:26] moeabdol: has joined #ruby
[09:00:42] ur5us: has joined #ruby
[09:01:51] startupality: has joined #ruby
[09:04:12] emilkarl: has joined #ruby
[09:04:18] louis1711: has joined #ruby
[09:04:49] biberu: has joined #ruby
[09:09:49] pawnbox: has joined #ruby
[09:10:24] skade: has joined #ruby
[09:13:17] mdw: has joined #ruby
[09:13:53] mic_e: has joined #ruby
[09:14:34] coffeecupp: has joined #ruby
[09:15:23] n_blownapart: has joined #ruby
[09:22:47] n_blownapart: has joined #ruby
[09:25:10] lewis1712: has joined #ruby
[09:25:40] edwinvdgraaf: has joined #ruby
[09:27:04] skade: has joined #ruby
[09:27:30] sphex_: has joined #ruby
[09:27:53] moeabdol: has joined #ruby
[09:29:44] mooru: has joined #ruby
[09:32:58] mark_66: has joined #ruby
[09:33:13] Trieste: has joined #ruby
[09:33:20] n_blownapart: has joined #ruby
[09:34:34] Macaveli: has joined #ruby
[09:35:57] skade: has joined #ruby
[09:36:07] yfeldblum: has joined #ruby
[09:37:09] devyn: has joined #ruby
[09:37:32] startupality: has joined #ruby
[09:38:16] Trieste: has joined #ruby
[09:39:01] neanderslob: has joined #ruby
[09:39:24] ferr: has joined #ruby
[09:41:07] evidex: has joined #ruby
[09:41:37] coffeecupp: has joined #ruby
[09:42:11] n_blownapart: has joined #ruby
[09:43:09] toretore: has joined #ruby
[09:43:48] zenguy_pc: has joined #ruby
[09:47:55] aghalarp: has joined #ruby
[09:48:32] pawnbox_: has joined #ruby
[09:49:25] araujo: has joined #ruby
[09:49:25] araujo: has joined #ruby
[09:49:54] curses: has joined #ruby
[09:50:17] mdw: has joined #ruby
[09:51:23] gregf_: https://gist.github.com/anonymous/4b3617465bb590db8edd4c412d725875 <== che
[09:51:31] gregf_: oops - sorry wrong chat :/
[09:52:18] n_blownapart: has joined #ruby
[09:55:42] bronson: has joined #ruby
[09:55:43] crystal77: has joined #ruby
[09:55:54] thomas: has joined #ruby
[09:57:58] Pumukel: has joined #ruby
[09:59:28] Macaveli: has joined #ruby
[10:00:45] Trieste: has joined #ruby
[10:01:41] aghalarp: has joined #ruby
[10:05:17] sondr3: has joined #ruby
[10:06:15] Trieste: has joined #ruby
[10:07:13] leitz: has joined #ruby
[10:08:29] leitz: Should you be able to use @variable.gsub in an initialize method?
[10:08:54] n_blownapart: has joined #ruby
[10:10:46] Trieste: has joined #ruby
[10:11:16] hahuang65: has joined #ruby
[10:12:34] centrx: has joined #ruby
[10:13:29] leitz: https://gist.github.com/LeamHall/8b13ac6361e0ccaf77585d2c79f1ec3a
[10:15:21] Trieste: has joined #ruby
[10:17:07] noService: has joined #ruby
[10:17:46] olspookishmagus: has joined #ruby
[10:17:56] apeiros: leitz: sure. why do you ask?
[10:17:59] gregf_: >> foo = "bar"; baz = foo.gsub("r","z"); p baz
[10:18:01] ruby[bot]: gregf_: # => "baz" ...check link for more (https://eval.in/573678)
[10:18:29] apeiros: leitz: ah, error on bottom - nil.gsub can't be called. regardless of where
[10:19:02] apeiros: leitz: you do know how to read "./read_pm.rb:11:in `initialize': private method `gsub' called for nil:NilClass (NoMethodError)"?
[10:19:26] skakri: has joined #ruby
[10:20:17] Trieste: has joined #ruby
[10:21:45] d0lph1n98: has joined #ruby
[10:22:00] Polysics_: has joined #ruby
[10:24:23] Trieste: has joined #ruby
[10:26:55] sameerynho: has joined #ruby
[10:28:14] JonasOSDever: has joined #ruby
[10:29:31] devyn: has joined #ruby
[10:30:58] MrSamuel: has joined #ruby
[10:33:44] gregf: has joined #ruby
[10:34:13] n_blownapart: has joined #ruby
[10:36:36] fbandov: has joined #ruby
[10:36:47] lewis1712: has left #ruby: ("Ex-Chat")
[10:38:59] nankyokusei: has joined #ruby
[10:39:10] leitz: apeiros, I'm not sure.
[10:39:40] apeiros: leitz: "./read_pm.rb:11" tells you what?
[10:39:43] leitz: Is it because gsub is in a different class/namespace?
[10:40:11] apeiros: ah, what were you referring to with "not sure"? I thought "not sure how to read the error message"
[10:40:57] n_blownapart: has joined #ruby
[10:41:35] leitz: yes. I tested the gsub line in irb, but it fails in the initialize.
[10:43:22] apeiros: and the exception tells you why
[10:43:31] apeiros: hence my question whether you know how to read the message
[10:43:34] nettoweb: has joined #ruby
[10:44:38] umdstu: has joined #ruby
[10:44:53] leitz: Not well, and fixing to be late for work. Guess I know what I'm going to be focusing on today!
[10:45:07] modin: has joined #ruby
[10:46:26] pawnbox: has joined #ruby
[10:46:45] ur5us: has joined #ruby
[10:49:47] pawnbox: has joined #ruby
[10:53:16] mozzarella: has joined #ruby
[10:54:05] n_blownapart: has joined #ruby
[10:54:37] ReK2GnULinuX: has joined #ruby
[10:55:51] hays_: has joined #ruby
[10:56:42] vondruch_: has joined #ruby
[10:56:54] elavee: has joined #ruby
[10:57:12] mg^: has joined #ruby
[10:57:25] jgt: has joined #ruby
[10:58:08] Kus: has joined #ruby
[11:00:36] gnufied: has joined #ruby
[11:01:02] M-Kodo: has joined #ruby
[11:02:05] M-mistake: has joined #ruby
[11:02:16] startupality: has joined #ruby
[11:06:35] johnmilton: has joined #ruby
[11:07:25] pawnbox: has joined #ruby
[11:08:54] rodfersou: has joined #ruby
[11:09:06] Macaveli: has joined #ruby
[11:10:45] RegulationD: has joined #ruby
[11:11:19] pawnbox: has joined #ruby
[11:11:24] n_blownapart: has joined #ruby
[11:11:57] hahuang65: has joined #ruby
[11:14:21] emilkarl: has joined #ruby
[11:19:46] n_blownapart: has joined #ruby
[11:20:48] ponga: has joined #ruby
[11:20:55] fergal: has joined #ruby
[11:21:36] valeri_ufo: has joined #ruby
[11:21:50] Dysp: has joined #ruby
[11:23:31] fergal: hi guys, if i want to poll a server for a build finishing every 2 seconds, but also want to print a message that i am polling the server once every 60 seconds so i dont flood stdout, what is the best approach for doing this? so essentially, i want my script to poll the build server once every 2 seconds, and then once every minute print out something like “polling the build server every 2 seconds”. would it jsut be a case of looping, sleeping every 2 seconds
[11:23:32] fergal: and then every 30th iteration, print polling?
[11:24:44] apeiros: assuming your polling does not take time, or assuming that a skew in time is acceptable - yes
[11:26:32] n_blownapart: has joined #ruby
[11:27:20] UKn0Meh: has joined #ruby
[11:27:23] ldnunes: has joined #ruby
[11:30:03] vedu: has joined #ruby
[11:31:37] skade: has joined #ruby
[11:31:49] vedu: Hello. I want to POST to my slack webhook but I am getting a 400 response. The same request is working from postman and curl. Code and response: https://gist.github.com/vedant1811/68018643a380fe9e9e58d822904c611f
[11:32:04] c355E3B: has joined #ruby
[11:33:24] nadir: has joined #ruby
[11:34:56] toretore: vedu: what is the equivalent curl command that works?
[11:35:01] modin: has joined #ruby
[11:35:06] jhass: vedu: mitmproxy.org proves as a good tool to compare the generated requests in depth, my first guess would be on setting the Content-Type header correctly or something like that
[11:35:57] hk238: has joined #ruby
[11:35:58] davedev24: has joined #ruby
[11:36:43] Amnez777: has joined #ruby
[11:37:01] UKn0Me: has joined #ruby
[11:37:10] jancel: has joined #ruby
[11:37:32] Gasher: has joined #ruby
[11:37:38] giz|work: has joined #ruby
[11:37:56] k3rn31: has joined #ruby
[11:38:04] maucar: has joined #ruby
[11:38:58] vedu: toretore: curl -X POST --data-urlencode 'payload={"text": "This is posted to #non-tech and comes from a bot named webhookbot."}' https://hooks.slack.com/services/...
[11:39:42] jhass: vedu: well that's obviously quite different, where did the payload parameter go in your code?
[11:39:56] jhass: vedu: have a look at http://devdocs.io/ruby~2.3/net/http#method-c-post_form
[11:40:33] vedu: jhass: yeah, let me go through it :)
[11:43:18] vedu: jhass: okay I got it working using Net::HTTP.post_form uri, "payload" => '{"text": "This is a line of text in a channel.\nAnd this is another line of text."}'. thanks :)
[11:43:44] rubirc: Is there something like .map for hashes?
[11:43:58] rubirc: I just want to create a new hash on the fly from the old one
[11:44:03] toretore: yes, there is Hash#map
[11:44:25] rubirc: yeah it gets a key and a value as an argument
[11:44:28] toretore: if you want to create a Hash and not an Array, use inject or each?with?object
[11:44:31] rubirc: what do i need to return so it creates a hash again?
[11:44:40] flashpoint9: has joined #ruby
[11:45:04] vondruch: has joined #ruby
[11:45:11] toretore: each_with_object ..
[11:45:48] jhass: or just return two element arrays from Hash#map and call Array#to_h
[11:46:08] jhass: >> {foo: 1, bar: 2}.map {|k, v| [k.to_s, v] }.to_h
[11:46:08] rubirc: jhass: that sounds like the dirties hack
[11:46:09] ruby[bot]: jhass: # => {"foo"=>1, "bar"=>2} (https://eval.in/573710)
[11:46:09] n_blownapart: has joined #ruby
[11:46:14] rubirc: i will probably use it
[11:47:39] jhass: >> {foo: 1, bar: 2}.each_with_object({}) {|(k, v), h| h[k.to_s] = v] } # more efficient but also more verbose
[11:47:40] ruby[bot]: jhass: # => /tmp/execpad-8bef5dfdf448/source-8bef5dfdf448:2: syntax error, unexpected ']', expecting '}' ...check link for more (https://eval.in/573711)
[11:47:47] jhass: >> {foo: 1, bar: 2}.each_with_object({}) {|(k, v), h| h[k.to_s] = v } # more efficient but also more verbose
[11:47:48] ruby[bot]: jhass: # => {"foo"=>1, "bar"=>2} (https://eval.in/573712)
[11:48:07] jhass: please don't use and recommend inject/reduce for building hashes
[11:48:18] joonty: has joined #ruby
[11:48:36] tAn: has joined #ruby
[11:48:44] senayar: has joined #ruby
[11:48:47] grs: has joined #ruby
[11:48:56] rubirc: jhass: why not?
[11:49:18] hutch34: has joined #ruby
[11:49:24] jhass: it's error prone and more verbose than each_with_object
[11:49:43] deadnull: has joined #ruby
[11:50:45] curses: has joined #ruby
[11:50:53] swills: has joined #ruby
[11:50:55] rubirc: so each_with_object is the best one?
[11:51:29] terlar: has joined #ruby
[11:52:15] KantonKid: has joined #ruby
[11:52:22] |2701: has joined #ruby
[11:53:15] centrx: each_with_object is not more efficient, or at least it didn’t used to be
[11:53:51] centrx: map with .to_h is the best as I recall
[11:54:25] Shashikant86: has joined #ruby
[11:57:15] rubirc: jhass: you are always here in the channel, how come you have so much time to help?
[11:57:56] bronson: has joined #ruby
[11:58:12] sepp2k: has joined #ruby
[11:58:45] n_blownapart: has joined #ruby
[11:58:46] p1k: is the webrick server part of ruby core ?
[11:59:36] skade: has joined #ruby
[12:00:15] d0lph1n98: has joined #ruby
[12:00:28] jhass: rubirc: coincidence with you watching the channel?
[12:00:48] jhass: centrx: how is creating n two element arrays better than not to?
[12:01:26] Hanmac: has joined #ruby
[12:01:50] Yiota: has joined #ruby
[12:04:25] p1k: {}..stringify_keys is in active_support ?
[12:04:36] jhass: p1k: both yes
[12:05:01] n_blownapart: has joined #ruby
[12:05:06] despai: has joined #ruby
[12:05:10] sdothum: has joined #ruby
[12:05:15] p1k: jhass: so memory leak w/ webrick server gets reported on the ruby langs bug tracker?
[12:05:32] centrx: jhass: I don’t know why it is, but https://gist.github.com/davydovanton/dd0ba7930bf6725146171363c99aace3
[12:05:46] jhass: p1k: if you can make a minimal example reproducing it using just the standard library, sure
[12:05:53] centrx: jhass: seems like each_with_object is just implemented slowly
[12:06:22] jhass: centrx: it still wins against doing .to_h afterwards though on my machine
[12:06:51] centrx: ok that makes sense
[12:07:17] despai: Hello. Anybody knows how to make an rake application that uses ActiveRecord to use the mocked objects from FactoryGirl. I have a suite of tests that test the api from outside, I have an api running in "test" environment. The FactoryGirl mocks are working in the test suite, but when the running "test" api retrieves a record, it uses the original ActiveRecord objects instead of the FactoryGirl mocks, so my tests don't validate. Do you have an idea h
[12:07:17] despai: ow to connect the mocked FactoryGirl object to be used also in the api?
[12:07:48] p1k: jhass: ugh
[12:07:59] jhass: centrx: and is just as fast as reduce/inject
[12:08:16] p1k: one of these evenings I'll try
[12:08:41] flips: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[12:08:47] p1k: it would be nice if valgrind was better supported
[12:08:48] centrx: jhass: It could be much better on 2.3 vs 2.0 or whatever it was when it was much slower. I can’t find the article
[12:09:19] centrx: I withdraw all previous statements
[12:09:52] jhass: 2.0 didn't have Array#to_h, so ...
[12:10:08] jhass: let's try 2.1
[12:10:08] LoneHermit: has joined #ruby
[12:10:57] jhass: reduce seems slightly faster there but within error margin of each_with_object
[12:11:09] binaryplease: has joined #ruby
[12:12:00] blackmesa: has joined #ruby
[12:12:06] n_blownapart: has joined #ruby
[12:12:46] senayar: has joined #ruby
[12:13:10] flashpoint9: has joined #ruby
[12:15:01] synthroid: has joined #ruby
[12:15:02] jhass: despai: you're looking into doing integration tests with that setup?
[12:16:09] despai: jhass yes
[12:16:56] despai: In my tests I reset my database using DatabaseCleaner, however, the other part, the api running in "test" environment is not using my FactoryGirl mocks that I setup in my tests
[12:17:33] jhass: despai: you call .create on the factories and have transactional fixtures turned off?
[12:17:37] KantonKid: has joined #ruby
[12:17:38] jhass: btw it's rack, not rake
[12:17:41] despai: There are 2 things. 1 The api running in "test" environment. 2 The tests running against that api (here I mock FactoryGirl records for every test)
[12:17:44] fbandov: has joined #ruby
[12:17:54] despai: yes, rack
[12:17:57] despai: let me check that
[12:18:04] pawnbox: has joined #ruby
[12:18:21] jhass: stop saying "FactoryGirl mock" or "mock FactoryGirl", it's wrong and makes no sense
[12:19:43] djcp: has joined #ruby
[12:19:48] jhass: FactoryGirl is for generating test data and returning the real model instances, persisted with .create or not persisted with .build
[12:20:15] jhass: as you want to write test data into the database for your appserver to fetch again, you have to use .create
[12:20:34] jhass: and make sure it happens outside a transaction so the other database connection can actually see the data
[12:21:29] despai: I'm using create
[12:21:40] despai: the records are created when I print them in my tests afterwards
[12:22:00] despai: however in the test database the records are always empty
[12:23:23] despai: config.use_transactional_fixtures in my spec helpers is undefined. I'm not using Rails
[12:23:24] jhass: sounds like transactional fixtures is still on
[12:23:38] jhass: set it to false explicitly, just to be sure
[12:23:53] jhass: also make sure your database_cleaner mode is not using a transaction
[12:24:01] davedev24: has joined #ruby
[12:24:24] despai: http://pastebin.com/CQJR2dVY
[12:24:25] ruby[bot]: despai: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/ed7b776cb5bbd2a87287004cd523c748
[12:24:25] ruby[bot]: despai: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[12:24:26] CausaMortis: has joined #ruby
[12:24:49] n_blownapart: has joined #ruby
[12:24:51] despai: config.use_transactional_fixtures is undefined if I uncomment it
[12:24:56] despai: let me check the databasecleaner
[12:25:07] jhass: https://github.com/DatabaseCleaner/database_cleaner#what-strategy-is-fastest
[12:25:49] despai: DatabaseCleaner.strategy = :transaction
[12:25:55] despai: this is how is setted up
[12:26:33] jhass: see the link, that's your issue
[12:26:44] despai: yes, reading
[12:27:41] despai: OMG!!! it works
[12:27:53] despai: but what I don't understand is how these mocks are shared between processes
[12:28:00] despai: tasty magic?
[12:29:22] jhass: despai: see above, there are no mocks
[12:29:58] despai: stub, mocks, fake data, however you want to call it
[12:30:13] hutch34_: has joined #ruby
[12:30:15] despai: how is these data shared from the process running the tests to the other api process
[12:30:37] jhass: conflating these concepts is your issue
[12:30:53] jhass: it's test data and in this case that data is persisted to the database
[12:31:29] despai: ah? I see. So it reaches the db
[12:31:32] despai: now I got it
[12:31:35] despai: thanks for your help
[12:33:22] mdw: has joined #ruby
[12:34:06] Macaveli: has joined #ruby
[12:34:07] akiTendo: has joined #ruby
[12:36:05] skade: has joined #ruby
[12:38:17] jancel: has joined #ruby
[12:38:32] n_blownapart: has joined #ruby
[12:39:43] nankyokusei: has joined #ruby
[12:42:15] ferr1: has joined #ruby
[12:44:11] mlehrer: has joined #ruby
[12:46:38] skade: has joined #ruby
[12:47:37] zenguy_pc: has joined #ruby
[12:48:23] |ifei5g00d: has joined #ruby
[12:48:39] crystal77: has joined #ruby
[12:50:29] Shashikant86: has joined #ruby
[12:51:12] n_blownapart: has joined #ruby
[12:55:27] lilvim: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[12:56:30] fergal: has joined #ruby
[12:57:00] Madplatypus: has joined #ruby
[12:57:41] MrSamuel: has joined #ruby
[13:01:29] ramortegui: has joined #ruby
[13:03:43] n_blownapart: has joined #ruby
[13:04:21] crystal77: has joined #ruby
[13:05:05] ChiefAlexander: has joined #ruby
[13:05:37] Biopandemic: has joined #ruby
[13:07:11] pandaant: has joined #ruby
[13:11:00] n_blownapart: has joined #ruby
[13:11:15] dgynn_: has joined #ruby
[13:11:38] sameerynho: has joined #ruby
[13:11:51] RegulationD: has joined #ruby
[13:13:02] hahuang65: has joined #ruby
[13:14:12] wilsonc91: has joined #ruby
[13:15:58] aegis3121: has joined #ruby
[13:17:16] n_blownapart: has joined #ruby
[13:18:37] davedev24: has joined #ruby
[13:19:24] blackmesa: has joined #ruby
[13:19:42] pawnbox_: has joined #ruby
[13:19:57] skade: has joined #ruby
[13:20:50] halfamind: has joined #ruby
[13:21:28] aegis3121: has joined #ruby
[13:23:28] ocbtec: has joined #ruby
[13:24:17] kobain: has joined #ruby
[13:25:27] VeryBewitching: has joined #ruby
[13:26:18] kareeole_: has joined #ruby
[13:28:04] platzhirsch: has joined #ruby
[13:30:34] JakFrist: has joined #ruby
[13:30:51] Macaveli: has joined #ruby
[13:33:33] prestorium: has joined #ruby
[13:34:07] noobsu: has joined #ruby
[13:34:35] araujo: has joined #ruby
[13:34:46] Danielpk: has joined #ruby
[13:34:59] noobsu: has joined #ruby
[13:36:39] tlaxkit: has joined #ruby
[13:36:56] malconis: has joined #ruby
[13:37:15] n_blownapart: has joined #ruby
[13:37:19] shibly: has joined #ruby
[13:37:55] shibly: has left #ruby: ("Leaving")
[13:38:30] jaguarmagenta: has joined #ruby
[13:39:34] pawnbox: has joined #ruby
[13:41:16] pawnbox: has joined #ruby
[13:42:08] araujo_: has joined #ruby
[13:42:34] vedu: has left #ruby: ("Konversation terminated!")
[13:43:10] diegoaguilar: has joined #ruby
[13:43:40] araujo__: has joined #ruby
[13:44:18] LoneHerm_: has joined #ruby
[13:44:51] n_blownapart: has joined #ruby
[13:45:54] araujo__: has joined #ruby
[13:46:54] duderonomy: has joined #ruby
[13:47:20] arajakul: has joined #ruby
[13:47:37] arajakul: anyone have any good guides to understanding key hashes?
[13:47:58] jhass: what exactly are you referring to? how Hash works?
[13:48:53] giz|work: has joined #ruby
[13:49:44] Hanmac: arajakul: i think the most important thing you need to know is that String and Symbol are not the as keys in Hashs
[13:50:58] arajakul: jhass, yes any easy way to visualize the hash?
[13:51:02] skade: has joined #ruby
[13:51:26] curses: has joined #ruby
[13:52:00] Hanmac: ACTION is confused about the visualize word
[13:52:18] jhass: ACTION is confused about that too and "the as keys"
[13:52:29] zotherstupidguy: has joined #ruby
[13:52:40] moeabdol: has joined #ruby
[13:52:50] malconis: has joined #ruby
[13:52:54] jhass: arajakul: what open question do you have after reading http://ruby-doc.org/core-2.3.1/Hash.html ?
[13:54:41] jancel: has joined #ruby
[13:55:48] rbennacer: has joined #ruby
[13:55:57] truenito: has joined #ruby
[13:56:11] rbennacer: has joined #ruby
[13:56:21] n_blownapart: has joined #ruby
[13:56:27] noService: has joined #ruby
[13:56:42] mic_e: has joined #ruby
[13:56:55] MrSamuel: has joined #ruby
[13:57:23] rbennacer: has joined #ruby
[13:57:31] startupality: has joined #ruby
[13:59:19] davedev24: has joined #ruby
[14:00:31] cerrar: has joined #ruby
[14:01:16] idefine: has joined #ruby
[14:02:23] k3rn31: has joined #ruby
[14:03:57] Ch4rAss: has joined #ruby
[14:05:18] perlgod: has joined #ruby
[14:05:59] govg: has joined #ruby
[14:06:05] Shashikant86: has joined #ruby
[14:07:16] Azure: has joined #ruby
[14:08:09] Nimonas: has joined #ruby
[14:08:16] marr: has joined #ruby
[14:12:13] xcesariox: has joined #ruby
[14:12:15] chouhoulis: has joined #ruby
[14:13:08] Stan: has joined #ruby
[14:13:41] hahuang65: has joined #ruby
[14:13:47] yqt: has joined #ruby
[14:14:54] skade: has joined #ruby
[14:15:14] snowy: has joined #ruby
[14:15:18] n_blownapart: has joined #ruby
[14:17:16] LoneHermit: has joined #ruby
[14:17:20] tacit7: has joined #ruby
[14:17:32] shevy: just got back... I feel like going to sleep right away ... :(
[14:19:16] helpa: has joined #ruby
[14:19:35] pwnd_nsfw: has joined #ruby
[14:19:45] Hanmac: shevy did you get the big ruby news from weekend yet? Fixnum and Bignum became one ;P
[14:21:35] pawnbox_: has joined #ruby
[14:21:57] jhass: uh, that's a good idea?
[14:22:07] jhass: well I guess at least the ugly autopromiting is gone
[14:22:09] blackmesa: has joined #ruby
[14:22:13] jhass: *promoting
[14:22:57] kareeoleez: can someone tell me why can't I get an exception to be raised https://gist.github.com/chrisvel/c21cd0aa208c449ee2abe85b14cb984e ?
[14:23:35] grs: has joined #ruby
[14:25:45] mostlybadfly: has joined #ruby
[14:26:05] shevy: hanmac yeah I read that in the changelog but I did not understand it yet
[14:26:11] n_blownapart: has joined #ruby
[14:26:31] Hanmac: shevy: [Integer, Fixnum, Bignum] # => [Integer, Integer, Integer]
[14:26:34] giz|work: has joined #ruby
[14:26:38] shevy: I find it increasingly hard to keep up with ruby-related changes though, I seem to have less and less time available :(
[14:26:49] suchness: has joined #ruby
[14:27:04] |2701: sure would be nice to have some kind of standard to rely on
[14:27:12] suchness: Does anyone know what this syntax is actually called? <<-EOF a bunch of text EOF
[14:27:13] |2701: instead of "MRI is always right"
[14:27:46] Hanmac: suchness: HEREDOC ?
[14:28:06] suchness: Oh cool! Thanks!
[14:28:18] shevy: hanmac isn't that quite confusing though? If they still remain
[14:28:37] biberu: has joined #ruby
[14:28:39] Hanmac: shevy they only remain for compatibiliy
[14:30:13] aegis3121: kareeoleez : What IS the output of your code? Because my guess is that @status is true.
[14:30:14] duracrisis: has joined #ruby
[14:31:12] kareeoleez: If you create a virtual interface more than one time then it fails
[14:31:16] kareeoleez: and returns false
[14:31:27] kareeoleez: aegis3121: with ifconfig: SIOCIFCREATE: File exists
[14:31:45] TomyWork: has joined #ruby
[14:34:24] aegis3121: Meaning that's when a duplicate is attempted to be created?
[14:34:24] axl_: has joined #ruby
[14:34:31] aegis3121: er, when you attempted to create a duplicate*
[14:35:06] n_blownapart: has joined #ruby
[14:35:40] Es0teric: has joined #ruby
[14:35:42] maxdoubt: has joined #ruby
[14:39:00] synthroid: has joined #ruby
[14:39:22] eljimmy: has joined #ruby
[14:40:33] wilsonc91: has joined #ruby
[14:40:39] nankyokusei: has joined #ruby
[14:41:26] pwnd_nsfw: has joined #ruby
[14:41:28] polishdub: has joined #ruby
[14:41:36] cdg: has joined #ruby
[14:41:47] aegis3121: Well, it kind of sounds like that's the value of @stderr.to_s, which is what's being passed to the RuntimeError. You're immediately rescuing, so that's the output of puts "#{e}". It sounds like it IS raising, and is immediately rescued.
[14:41:52] monoprotic: has joined #ruby
[14:42:04] skade: has joined #ruby
[14:44:54] chipotle_: has joined #ruby
[14:46:23] rippa: has joined #ruby
[14:46:33] n_blownapart: has joined #ruby
[14:46:42] noService: has joined #ruby
[14:47:09] TomyWork: has joined #ruby
[14:48:51] fergal: has joined #ruby
[14:49:57] CausaMortis: has joined #ruby
[14:50:03] grs: has joined #ruby
[14:50:24] halfamind: has joined #ruby
[14:50:52] halfamind: has joined #ruby
[14:51:51] ChiefAlexander: has joined #ruby
[14:52:12] senayar: has joined #ruby
[14:52:12] senayar: has joined #ruby
[14:54:48] noService: has joined #ruby
[14:54:55] skade: has joined #ruby
[14:55:23] n_blownapart: has joined #ruby
[14:56:46] mistermocha: has joined #ruby
[14:57:41] mjuszczak: has joined #ruby
[14:57:53] mroth: has joined #ruby
[14:57:53] mroth: has joined #ruby
[14:58:47] Danielpk: has joined #ruby
[14:59:49] rkazak: has joined #ruby
[15:00:50] bronson: has joined #ruby
[15:00:51] stannard: has joined #ruby
[15:01:48] jhack: has joined #ruby
[15:03:12] Danielpk: has joined #ruby
[15:04:27] Devalo: has joined #ruby
[15:05:22] Ch4rAss: has joined #ruby
[15:05:28] mistermocha: has joined #ruby
[15:06:12] n_blownapart: has joined #ruby
[15:07:38] aagdbl: has joined #ruby
[15:09:34] ejnahc: has joined #ruby
[15:09:57] adambeynon: has joined #ruby
[15:11:53] synthroid: has joined #ruby
[15:13:55] nettoweb: has joined #ruby
[15:15:36] chouhoul_: has joined #ruby
[15:15:44] hobodave: has joined #ruby
[15:16:38] zast: has joined #ruby
[15:16:41] Es0teric: has joined #ruby
[15:16:43] haylon: has joined #ruby
[15:17:37] nando294021: has joined #ruby
[15:18:32] flughafen_: has joined #ruby
[15:19:10] mdw: has joined #ruby
[15:19:44] ramortegui: has joined #ruby
[15:21:23] n_blownapart: has joined #ruby
[15:22:54] kies: has joined #ruby
[15:24:00] Yiota: has joined #ruby
[15:24:48] crissae: has joined #ruby
[15:25:24] tmtwd: has joined #ruby
[15:26:22] CJKinni: has joined #ruby
[15:26:23] halfamind1: has joined #ruby
[15:26:28] noService: has joined #ruby
[15:26:44] giz|work: has joined #ruby
[15:29:41] moei: has joined #ruby
[15:30:02] skweek: has joined #ruby
[15:30:41] smathy: has joined #ruby
[15:31:26] sameerynho: has joined #ruby
[15:32:10] mjuszczak: has joined #ruby
[15:32:14] kareeoleez: has joined #ruby
[15:33:23] fergal_: has joined #ruby
[15:34:35] gtsai: has joined #ruby
[15:34:46] CJKinni: has joined #ruby
[15:34:51] stannard: has joined #ruby
[15:36:08] duoi: has joined #ruby
[15:36:31] bluOxigen: has joined #ruby
[15:37:14] postmodern: has joined #ruby
[15:38:35] bluOxigen: has left #ruby: ()
[15:39:00] n_blownapart: has joined #ruby
[15:39:16] jaguarmagenta: has joined #ruby
[15:40:07] [Butch]: has joined #ruby
[15:42:21] chipotle: has joined #ruby
[15:43:55] JesseH: has joined #ruby
[15:45:43] frem_: has joined #ruby
[15:45:44] anna`: has joined #ruby
[15:48:33] cpup: has joined #ruby
[15:48:58] araujo: has joined #ruby
[15:49:22] bluOxigen: has joined #ruby
[15:50:20] araujo: has joined #ruby
[15:50:42] norc: has joined #ruby
[15:51:37] kareeoleez: has joined #ruby
[15:52:24] [Butch]: has joined #ruby
[15:52:26] curses: has joined #ruby
[15:53:23] n_blownapart: has joined #ruby
[15:54:50] nando294021: has joined #ruby
[15:54:52] Guest38: has joined #ruby
[15:55:28] nettoweb: has joined #ruby
[15:57:34] blandflakes: has joined #ruby
[15:57:40] amclain: has joined #ruby
[16:00:38] chouhoul_: has joined #ruby
[16:01:45] Yiota: has joined #ruby
[16:03:15] kareeoleez: has joined #ruby
[16:04:00] blackmesa: has joined #ruby
[16:04:58] danostrowski: has joined #ruby
[16:05:01] mistermocha: has joined #ruby
[16:06:06] n_blownapart: has joined #ruby
[16:08:54] lacce: has joined #ruby
[16:09:29] insanedreamer: has joined #ruby
[16:10:01] stannard: has joined #ruby
[16:10:20] kies: has joined #ruby
[16:11:55] iamvery: has joined #ruby
[16:12:13] symm-: has joined #ruby
[16:14:50] kgrz: has joined #ruby
[16:14:56] n_blownapart: has joined #ruby
[16:15:19] centrx: has joined #ruby
[16:15:29] hahuang65: has joined #ruby
[16:17:28] tomchapin: has joined #ruby
[16:17:51] pglombardo: has joined #ruby
[16:18:58] zenguy_pc: has joined #ruby
[16:19:50] synthroid: has joined #ruby
[16:20:47] agent_white: has joined #ruby
[16:21:29] kareeoleez: has joined #ruby
[16:23:29] gtsai_: has joined #ruby
[16:25:17] kgrz: has joined #ruby
[16:26:45] noobsu: has joined #ruby
[16:28:19] RegulationD: has joined #ruby
[16:29:30] finisherr: has joined #ruby
[16:31:26] kareeoleez: has joined #ruby
[16:31:38] isxek: has joined #ruby
[16:31:40] dml337ira: has joined #ruby
[16:31:56] noService: has joined #ruby
[16:32:09] aagdbl: has joined #ruby
[16:32:58] biberu: has joined #ruby
[16:33:20] Regulati_: has joined #ruby
[16:36:23] n_blownapart: has joined #ruby
[16:36:23] danostrowski: has joined #ruby
[16:37:21] rbennacer: has joined #ruby
[16:37:42] emilkarl: has joined #ruby
[16:38:34] arajakul2: has joined #ruby
[16:40:53] skade: has joined #ruby
[16:41:31] nankyokusei: has joined #ruby
[16:42:28] n_blownapart: has joined #ruby
[16:43:15] noobsu_: has joined #ruby
[16:44:58] konsolebox: has joined #ruby
[16:45:45] startupality: has joined #ruby
[16:45:50] Cohedrin: has joined #ruby
[16:46:06] nareiber: has joined #ruby
[16:46:28] curses: has joined #ruby
[16:46:43] mistermocha: has joined #ruby
[16:48:55] n_blownapart: has joined #ruby
[16:51:02] roelof: has joined #ruby
[16:51:51] roelof: I have some 10 hashes, now I want to store them in one object. What can I use the best a array or some nested hashes ?
[16:52:21] zast: has joined #ruby
[16:53:26] elifoster: has joined #ruby
[16:53:57] eam: roelof: depends on how you want to access them
[16:54:05] mistermocha: has joined #ruby
[16:54:37] roelof: eam : I want to iterate later to display the data on a view
[16:55:12] eam: if you're just going to iterate them in sequence an array is fine
[16:55:15] biberu\: has joined #ruby
[16:55:56] roelof: oke, and why when I do array << hash It looks like it's one item. ruby does not put a , between it
[16:55:58] stannard: has joined #ruby
[16:56:21] roelof: so array.first does not work
[16:56:46] araujo: has joined #ruby
[16:56:49] wilsonc91: has joined #ruby
[16:57:31] eam: roelof: can you share code? It's not clear what you're describing
[16:59:34] qasaur: has joined #ruby
[16:59:41] skolman_: has joined #ruby
[17:00:54] spooq: has joined #ruby
[17:01:03] adgtl: has joined #ruby
[17:01:03] adgtl: has joined #ruby
[17:01:52] adgtl: Thinking of updating this Ruby gem https://rubygems.org/gems/this
[17:01:59] adgtl: to print something valuable
[17:02:04] adgtl: Anyone got ideas?
[17:02:14] n_blownapart: has joined #ruby
[17:02:28] adgtl: I mean, currently it prints Zen of Ruby.. when done require 'this' from IRB
[17:02:29] mistermo_: has joined #ruby
[17:02:36] adgtl: but want something better
[17:02:37] jhack: has joined #ruby
[17:03:13] bronson: has joined #ruby
[17:03:25] stannard: has joined #ruby
[17:03:28] hahuang65: has joined #ruby
[17:03:46] elifoster: has joined #ruby
[17:05:23] sneakerhax: has joined #ruby
[17:07:34] roelof: eam : moment, I can make a gist of my problem
[17:07:46] doug23424234: has joined #ruby
[17:08:46] stanlord: has joined #ruby
[17:08:57] ramfjord: has joined #ruby
[17:09:53] eL_bAmba: has joined #ruby
[17:11:02] adgtl: https://bugs.ruby-lang.org/issues/12400
[17:11:10] adgtl: Retweet or spread the news!
[17:11:18] adgtl: Lets make it better.
[17:11:20] Xiti: has joined #ruby
[17:11:29] adgtl: It will be simple idea, but effective in long term.
[17:12:05] roelof: eam : here you have a very simple made code to let you see : when I have 2 hashes , the output looks like what I pasted in the output : https://gist.github.com/rwobben/59416cd263bb853481fb291422e451e8
[17:12:34] roelof: and not as 1 array
[17:12:58] jhass: roelof: you modify and add the _same_ hash over and over again
[17:13:08] doug23424234: Quick question: https://www.reddit.com/r/ruby/comments/4k3h83/my_strings_are_displaying_with_the_beginning_of/
[17:13:09] aegis3121: has joined #ruby
[17:13:25] doug23424234: Thanks guys! I'm new and loving ruby so far. :-)
[17:13:42] shevy: odd problem
[17:13:43] roelof: jhass : oke, so I have to delete the hash on every iteration ?
[17:13:47] shevy: what is .red doing exactly?
[17:14:04] toretore: doug23424234: ?code
[17:14:10] toretore: ?code doug23424234
[17:14:11] ruby[bot]: doug23424234: We can't help you without your code, please post it to https://gist.github.com
[17:14:12] n_blownapart: has joined #ruby
[17:14:22] jhass: roelof: just data_painting = all_numbers.map {|number| {"name" => ..., "title" => ..., "images" => ...} }
[17:14:23] shevy: doug23424234 the code there seems to be some partially escaped ansi sequence
[17:14:57] doug23424234: https://gist.github.com/douglance/fb228a82004126fa898600a252699577
[17:15:04] doug23424234: Now I'm trying to use the Rainbow gem.
[17:15:13] doug23424234: It doesn't have the exact same problem, but there is no color change.
[17:15:27] postmodern: regarding thread pools, is it better to roll your own, or use some popular threading gem?
[17:16:04] toretore: postmodern: best bet right now is probably concurrent-ruby
[17:16:31] toretore: it doesn't really matter if you roll your own or not, you're going to have issues anyway
[17:17:33] doug23424234: What is strange to me, is that later in the same code, it says color=red and that works. But if I use the same format earlier in the code where I want it, it doesn't work.
[17:17:38] doug23424234: Maybe I'm getting the format wrong?
[17:18:23] centrx: has joined #ruby
[17:18:29] toretore: doug23424234: where is the output from?
[17:18:44] TomyLobo: has joined #ruby
[17:18:45] toretore: the screenshot
[17:19:08] doug23424234: In my menu bar. It's Bitbar (http://getbitbar.com)
[17:19:40] toretore: does that support ansi escape sequences?
[17:20:42] mrgrieves: has joined #ruby
[17:21:21] chouhoulis: has joined #ruby
[17:21:24] doug23424234: I'm not sure.
[17:21:32] doug23424234: Do you see later in the gist where it says code=red?
[17:21:36] doug23424234: That is functional.
[17:21:44] toretore: then use that instead
[17:21:52] toretore: don't use any of the ansi color gems
[17:22:01] toretore: https://github.com/matryer/bitbar#writing-plugins
[17:22:15] toretore: follow that for formatting ^
[17:22:26] doug23424234: I tried using that first.
[17:22:37] doug23424234: How would I style that line using the same technique as later in the code?
[17:22:43] sepp2k: has joined #ruby
[17:23:03] toretore: style which line?
[17:23:03] kareeoleez: has joined #ruby
[17:23:12] codecop: has joined #ruby
[17:23:30] doug23424234: puts "#{item['title']} | href=#{item['originId']}"
[17:23:59] toretore: add a | color=x ?
[17:24:18] doug23424234: but where!? :D
[17:24:33] toretore: there is no such thing as a universal "make this text red"; it depends on the output format
[17:24:41] roelof: jhasss : still the same problem. See https://gist.github.com/rwobben/a345c095db393d683bf4678aa26a31af
[17:25:01] mdw: has joined #ruby
[17:25:03] qasaur: has joined #ruby
[17:25:16] toretore: doug23424234: i suggest trying to output some simple strings at first to learn how the bitwhatever formatting works
[17:25:37] toretore: puts "some text | color=#123456"
[17:25:48] toretore: don't try to do everything at once
[17:25:59] doug23424234: I have been testing stuff.
[17:26:09] doug23424234: Trying to figure it out.
[17:26:14] doug23424234: I came here as a last resort.
[17:26:23] n_blownapart: has joined #ruby
[17:26:23] toretore: i don't understand then what the problem is
[17:26:40] doug23424234: puts "#{item['title']} | href=#{item['originId']} | color=red"
[17:26:40] doug23424234: puts "test | color=red"
[17:26:46] doug23424234: The first line is white. The second line is red.
[17:26:49] doug23424234: That's the problem.
[17:27:00] doug23424234: I don't understand why.
[17:27:06] toretore: ok, then it's something to do with the bitbar formatting
[17:27:14] jhass: roelof: you should replace the each with map, not at the map within it
[17:27:18] toretore: ruby just prints the text
[17:27:21] jhass: roelof: did you at all try to understand what map does?
[17:28:05] doug23424234: I see. Thanks for your help!
[17:28:49] danostrowski: has joined #ruby
[17:29:11] Devalo: has joined #ruby
[17:29:59] kgrz: has joined #ruby
[17:30:32] jhass: it's probably "text | param=value param=value" not "text | param=value | param=value"
[17:30:52] jancel: has joined #ruby
[17:31:36] shinnya: has joined #ruby
[17:31:36] momomomomo: has joined #ruby
[17:32:41] doug23424234: jhass: That fixed it!
[17:32:51] doug23424234: I just facepalmed so hard.
[17:32:54] qasaur: has joined #ruby
[17:32:55] wrkrcoop: has joined #ruby
[17:33:06] wrkrcoop: how do i remove all new lines \n in a string?
[17:33:18] jhass: .delete("\n")
[17:33:24] Kim^J: has joined #ruby
[17:33:30] wrkrcoop: i tried mystring.gsub!(“\n”, “”)
[17:33:38] wrkrcoop: jhass: does that delete em all?
[17:34:02] Kim^J: Yo! Writing a Sinatra application and running it via Unicorn. Is there a way to make Unicorn update stuff when I update my app.rb file?
[17:34:10] Kim^J: Or should I not use unicorn when devving?
[17:34:48] jhass: ?try wrkrcoop
[17:34:48] ruby[bot]: wrkrcoop: Why don't you try it and see for yourself?
[17:35:02] malconis: has joined #ruby
[17:35:29] wrkrcoop: i did it didnt work
[17:36:17] jhass: >> "it \ndoes \nwork".delete("\n")
[17:36:19] ruby[bot]: jhass: # => "it does work" (https://eval.in/573914)
[17:37:55] biberu: has joined #ruby
[17:38:13] Kyhz: has joined #ruby
[17:38:41] ruby[bot]: benzrf: # => :ping (https://eval.in/573915)
[17:39:13] giz|work: has joined #ruby
[17:39:22] Vingador: has joined #ruby
[17:39:54] ferr1: has joined #ruby
[17:39:59] jaguarmagenta: has joined #ruby
[17:40:36] n_blownapart: has joined #ruby
[17:40:42] Ballo: OK, I have a question about class variables. I have defined a @@tminutes in a superclass and have a few subclasses, ONE of which has changed it to a different value. The odd thing is when using the subclass which does NOT change the value, the value was still changed
[17:40:42] phredus: has joined #ruby
[17:40:44] warreng_: has joined #ruby
[17:41:02] warreng_: has joined #ruby
[17:41:10] qasaur: has joined #ruby
[17:41:11] roelof: jhasss : I know what map does
[17:41:15] jhass: Ballo: that's expected behavior and why class variables are generally discouraged in Ruby
[17:41:18] warreng_: i don't understand this syntax, what's happening here: @rx_queue << (query, deferrable = @tx_queue.shift)
[17:41:25] Terens: has left #ruby: ()
[17:41:32] Ballo: ok, weird
[17:41:40] roelof: but how can I then first read the contents which a url sends to me when I do not know the number so far
[17:41:41] warreng_: @rx_queue is an array that's getting something pushed... but query isn't defined, and how do the parans work?
[17:41:55] Ballo: jhass, can I define object variables outside the methods/
[17:41:57] roelof: and how do I read things then ?
[17:42:04] warreng_: ohhh.... query,deferable are two new variables getting set to what's coming off of @tx_queue
[17:42:04] Ballo: or do I HAVE to use the initializer
[17:42:36] jhass: warreng_: yup it's multi assign, and quite ugly indeed
[17:43:04] Ballo: 'cause it's now looking like I have to use the initializer.
[17:43:11] toretore: Ballo: what's the use case?
[17:43:22] Ballo: it's just a constant for every subclass
[17:43:35] Ballo: it tells me when I need to discard the object based on a relative time
[17:43:43] jhass: Ballo: so use a constant, you can access the subclass constant from the parent class though self.class::FOO
[17:43:53] gtsai: has joined #ruby
[17:43:57] stannard: has joined #ruby
[17:43:59] teslax: has joined #ruby
[17:44:34] Ballo: jhass, yes, but my question is do I have to set it in the initializer
[17:44:37] teslax: I know STDIN.getch gets a character, but is there a STDIN method that gets ANY key... so I can pause the console and wait for ANY key on the keyboard to be clicked prior to termination???
[17:44:50] Ballo: ACTION is getting used to the Ruby quirks 
[17:44:58] jhass: Ballo: the constant? no
[17:45:03] rcc: has joined #ruby
[17:45:07] eam: Tesla_: not a STDIN method, but there are ways to do it by interacting with the terminal
[17:45:16] Ballo: 'cause it doesn't appear to work...
[17:45:26] jhass: ?code Ballo
[17:45:27] ruby[bot]: Ballo: We can't help you without your code, please post it to https://gist.github.com
[17:45:39] eam: the kernel does input buffering to a terminal, so there aren't character by character semantics available without reconfiguring your terminal
[17:45:40] teslax: eam: such as <example/tutorialLink>?
[17:45:52] Ballo: I have the @tminutes = 60 but not in the initializer and it doesn't exist in the subclass
[17:45:58] skylerto: has joined #ruby
[17:46:45] jhass: roelof: you realize you're truncating to two items with all_numbers = all_paintings.map { |item| item["objectNumber"] }[0..1] ?
[17:47:14] eam: Tesla_: well actually, by "any key" do you also mean modifier keys?
[17:47:16] mtkd: has joined #ruby
[17:47:22] eam: like shift, control, etc?
[17:47:24] jhass: Ballo: yes, that's a class level instance variable, not a constant as suggested
[17:47:28] AnoHito_: has joined #ruby
[17:47:41] eam: if you've found #getch that's the best you can do inside a terminal
[17:47:41] teslax: eam: I mean... I click any button on my keyboard and console terminates...
[17:47:49] teslax: eam: so yes
[17:47:53] edwinvdgraaf: has joined #ruby
[17:47:53] eam: Tesla_: you can't do that through a console
[17:48:01] eam: you need to write something that sees scan codes
[17:48:03] Ballo: https://gist.github.com/anonymous/1d1d77eab8bd601a4005285f1d8bfc77
[17:48:06] teslax: eam: meh ok I'll just stick to getch
[17:48:11] eam: and interacts with the keyboard directly without going via a terminal
[17:48:15] eam: games would do that, for example
[17:48:24] teslax: eam: could I use Tcl/Tk for that?
[17:48:27] roelof: oke, what I tried to do is getting the first two objectNumbers of the all-paintings
[17:48:28] jhass: Ballo: yes, again very much expected so
[17:48:33] eam: Tesla_: not sure
[17:48:43] teslax: eam: Not for console, but say using a custom window
[17:48:48] Ballo: expected for ruby programmers yes
[17:48:58] toretore: Ballo: what's the *actual* use case?
[17:49:01] eam: Tesla_: maybe, possibly
[17:49:08] jhass: Ballo: the upper @tminutes is a instance variable in Superclass' singleton class
[17:49:09] eam: Tesla_: for sure, the game frameworks for ruby will let you
[17:49:16] wilsonc91: has joined #ruby
[17:49:29] roelof: that part is right I see then 2 objectNumbers : ["SK-C-1368", "SK-A-1718"]
[17:49:46] Ballo: so again my question is do I have to put this in the initalalizer
[17:49:47] teslax: eam: ?? for sure what? Custom window, or do I need something other than Tk to get keypresses & keyreleases?
[17:50:02] eam: in terms of interfaces, it'll need to be talking to the native OS windowing interfaces and not via the tty abstraction that terminals provide (character streams)
[17:50:10] zenlot: has joined #ruby
[17:50:27] eam: Tesla_: I'm not familiar with the Tk interface for ruby
[17:50:35] eam: but if it lets you see key up/down events, then yes
[17:50:36] roelof: jhass : so after it I try to get some info on both numbers and the image_urls and put them into a hash. Right ?
[17:50:37] jhass: Ballo: for the specific example you gave, yes. Whether this is at all suitable or recommended for your actual usecase, who knows
[17:50:42] teslax: eam: apparently it
[17:50:47] Ballo: toretore: As I explained, it's a constant to know when to get rid of the object
[17:50:51] teslax: eam: it's Java's swing library
[17:50:58] jhass: roelof: I guess?
[17:50:58] toretore: Ballo: let's see some real code
[17:51:03] eam: tcl/tk is different from swing
[17:51:11] Ballo: toretore: sorry can't
[17:51:24] jancel: has joined #ruby
[17:51:36] roelof: so data_painting is first containing the name, title and the download links of the first one
[17:51:38] teslax: eam: in what way?
[17:51:49] toretore: Ballo: it's very difficult to give advice because you're asking a very specific question when you should be asking a broader one
[17:51:52] roelof: and then I needs to have the content of the second image
[17:52:03] roelof: and that it does, I checked that
[17:52:03] eam: Tesla_: Tcl is a completely different language from Java. Tk is a completely different windowing framework from Swing
[17:52:06] Ballo: that's the world we live in
[17:52:15] jhass: ?xy Ballo
[17:52:15] ruby[bot]: Ballo: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[17:52:21] jhass: that's what toretore is getting at
[17:52:24] roelof: but I cannot make 1 array containg both paintings :(
[17:52:31] RenatoSilva: has joined #ruby
[17:52:39] Ballo: toretore: I just need a value to check to know whether to discard the object based on relative time
[17:52:44] teslax: eam: about the keypresses, wouldn't this be a solution (in consoles of all things too)?: https://gist.github.com/acook/4190379
[17:52:53] RenatoSilva: has left #ruby: ("http://renatosilva.net - Renato Silva")
[17:52:54] toretore: Ballo: that doesn't actually mean anything at all to us
[17:52:58] eam: Tesla_: no
[17:52:59] toretore: Ballo: context is missing
[17:53:02] jhass: roelof: did you try my suggestion of replacing your each with the map I suggested yet (plus fetching data inside it of course)
[17:53:20] eam: terminals do not see scan codes generated by modifier keys -- they only see character streams
[17:53:26] n_blownapart: has joined #ruby
[17:53:30] roelof: I tried but I do not see how I can work .
[17:53:38] roelof: jhass ^^^^
[17:53:46] teslax: eam: so what is that example?
[17:53:50] Ballo: toretore: it's just a value associated with the object. Just trying to implement this with a minimum amount of boilerplate
[17:53:56] eam: that code example will let you respond to any character (like "a") instead of having to read a full line
[17:53:57] ramfjord: has joined #ruby
[17:54:04] ramortegui: has joined #ruby
[17:54:05] eam: but it won't let you respond to the shift key being pressed
[17:54:16] jhass: roelof: what did you try?
[17:54:20] jhass: show the latest try
[17:54:21] teslax: eam: but what does it mean by escape, tab and other keys?
[17:54:38] eam: terminals would see "a" or "A" -- but not "keydown-lshift, keydown "a", keyup "a", keyup "lshift"
[17:54:46] roelof: with your suggestion ; nothing. I do not see how I can make the fetching and so on work within the map
[17:54:50] eam: escape and tab send characters
[17:54:51] teslax: eam: oh ok
[17:54:59] eam: modifers like control, shift and alt do not
[17:55:00] toretore: Ballo: again, that doesn't mean anything to me. it means something to you because you know the context and you know what the end goal is, but i don't
[17:55:04] jhass: Ballo: so, why is my initial suggestion of using a constant and fetching it through self.class::FOO not working out for you?
[17:55:33] toretore: Ballo: most likely there is a much better solution to the actual problem than the one you're trying to implement
[17:55:35] Ballo: I was just trying to avoid having to type def initialize for every subclass
[17:55:49] jhass: roelof: you already have it working inside each, right? just do the same inside map
[17:55:58] jhass: and return the hash literal from the map
[17:56:01] roelof: jhasss : I think the code will be very messy and unreadable
[17:56:08] nofxx: has joined #ruby
[17:56:11] jhass: not anymore than your current code
[17:56:13] Ballo: toretore: More likely you think this is a lot more complicated than it actually is
[17:56:15] centrx: has joined #ruby
[17:56:18] maxdoubt: has joined #ruby
[17:56:37] smathy: Ballo, not having your actual code isn't a problem, having code that doesn't even compile is.
[17:56:52] toretore: Ballo: no way to know because i don't know anything about the problem you're trying to solve
[17:56:56] roelof: jhasss : but how can I get something when I have not a objectcode , Without it I cannot fetch a thing
[17:57:02] nofxx: having a code that compile is the problem...
[17:57:16] jhass: roelof: you have everything you have inside your each inside the map too
[17:57:21] nofxx: gcc problem =D
[17:57:44] jhass: Ballo: my suggestion doesn't require a def initialize
[17:57:55] jwren: has joined #ruby
[17:59:38] teslax: eam: Is there something like Tk that's also cross-platform, not too complex like an entire game engine / framework, that allows somewhat easy-to-learn interaction with input devices?
[17:59:48] teslax: eam: That you'd know?
[18:00:23] Ballo: jhass, looking up the syntax...
[18:00:25] Cyrus: has joined #ruby
[18:01:09] rcc: has joined #ruby
[18:01:59] nofxx: Tesla_, I was hoping for a atom/cromeless browser way for GUIs on Ruby, but, nobody cares about GUIs on ruby. That's the truth.
[18:02:24] nofxx: you mean USB devices of some sort? Or keyboard/mice?
[18:02:34] jhack: has joined #ruby
[18:02:35] Ballo: jhass, the problem is I don't see how it's overloaded. If you don't define it in the subclass it seems you have to know to look at the superclass constant
[18:02:35] teslax: I want to build something standalone, not browser, and keyboard/mice
[18:03:09] nofxx: Tesla_, it is standalone... kinda the old firefox prism, remember? The 'browser' is bundled in the 10Mb or so download.
[18:03:13] sameerynho: has joined #ruby
[18:03:58] smathy: Tesla_, take a look at wx: https://www.wxwidgets.org/
[18:04:01] teslax: nofxx: nope, idk... I mean like, I could package an .exe launcher, scripts, gems and the ruby interpreter for anyone to download and run
[18:04:15] teslax: smathy: ok
[18:04:34] jhass: Ballo: https://carc.in/#/r/ywg Ruby's constant resolution looks into parent classes
[18:05:22] n_blownapart: has joined #ruby
[18:05:34] chouhoulis: has joined #ruby
[18:05:42] Ballo: jhass, I just tested it. constants don't get overloaded
[18:06:03] jhass: I have no idea what you mean with that
[18:06:20] smathy: Tesla_, also, if your focus is mobile (I wasn't sure when you said "devices") you might like http://www.rubymotion.com/ - although its only target on the desktop is OSX.
[18:06:28] Ballo: I defined TMINUTES in the subclass and the superclass getter function uses the superclass constant
[18:06:31] Ballo: so that isn't a solution
[18:06:40] teslax: smathy: no I mean input devices, e.g. keyboard / mouse
[18:06:47] teslax: smathy: get keypresses, keyreleases on both etc
[18:06:54] crystal77: has joined #ruby
[18:07:59] Ballo: jhass: oh sorry, I get what you're saying now
[18:08:38] Ballo: my code works now. Thank you
[18:08:38] roelof: jhasss : thanks, I will experiment with it
[18:08:59] teslax: How can I install a gem on windows? :O
[18:09:14] teslax: or can I put into a folder and require it or smnthn? :T
[18:09:57] Ballo: good, that eliminated a lot of boilerplate
[18:10:38] Ballo: I almost don't miss python ;)
[18:10:46] n_blownapart: has joined #ruby
[18:12:04] icarus: has joined #ruby
[18:12:54] GodFather: has joined #ruby
[18:16:00] Devalo: has joined #ruby
[18:16:29] jackjackdripper: has joined #ruby
[18:16:38] jackjackdripper1: has joined #ruby
[18:17:12] kappy: has joined #ruby
[18:17:23] troulouliou_div2: has joined #ruby
[18:18:30] kgrz: has joined #ruby
[18:19:23] halfamind: has joined #ruby
[18:19:35] GodFather: has joined #ruby
[18:20:28] norc: has joined #ruby
[18:21:45] stannard: has joined #ruby
[18:24:07] _orangejuice: has joined #ruby
[18:25:47] PatJ: has joined #ruby
[18:25:58] halfamind: has joined #ruby
[18:25:59] arlek_: has joined #ruby
[18:25:59] jhass: meh, now roelof quit
[18:26:24] GodFather: has joined #ruby
[18:26:39] Liothen: has joined #ruby
[18:26:39] Liothen: has joined #ruby
[18:26:40] UserInneed: has joined #ruby
[18:26:40] linc01n: has joined #ruby
[18:26:43] staticfox: has joined #ruby
[18:26:44] jzigmund: has joined #ruby
[18:26:44] moshee: has joined #ruby
[18:26:45] moshee: has joined #ruby
[18:26:46] gregf_: has joined #ruby
[18:26:47] Drakx: has joined #ruby
[18:26:48] Puffball: has joined #ruby
[18:26:48] Kim^J: has joined #ruby
[18:26:49] majjoha: has joined #ruby
[18:26:50] headius: has joined #ruby
[18:26:50] samuelkadolph: has joined #ruby
[18:26:50] SirFunk: has joined #ruby
[18:26:52] Nilium: has joined #ruby
[18:26:56] genpaku: has joined #ruby
[18:26:57] sarbs: has joined #ruby
[18:27:03] n_blownapart: has joined #ruby
[18:27:04] xMopxShell: has joined #ruby
[18:27:07] csmb: has joined #ruby
[18:27:10] timmow: has joined #ruby
[18:27:12] Dimik: has joined #ruby
[18:27:13] umdstu: time to disable irc client sounds
[18:27:14] sulky: has joined #ruby
[18:27:15] Rutix: has joined #ruby
[18:27:15] Rutix: has joined #ruby
[18:27:22] Rasi: has joined #ruby
[18:27:27] PaulCapestany: has joined #ruby
[18:27:27] voodoofish430: has joined #ruby
[18:27:30] dn`: has joined #ruby
[18:27:47] tw1sted: has joined #ruby
[18:28:11] bodie_: has joined #ruby
[18:28:44] adaedra: IRC client sounds, really?
[18:28:56] jpterry: has joined #ruby
[18:29:29] Danielpk: has joined #ruby
[18:29:37] basic: has joined #ruby
[18:30:02] synthroid: has joined #ruby
[18:30:17] adaedra: ACTION is is dinged
[18:30:25] blackwell: has joined #ruby
[18:31:47] nemish: has joined #ruby
[18:32:07] skolman: has joined #ruby
[18:32:14] nibbo: has joined #ruby
[18:32:27] spider-mario: has joined #ruby
[18:33:00] k3rn31: has joined #ruby
[18:33:15] Zackio: has joined #ruby
[18:33:39] frode15243: has joined #ruby
[18:33:45] lipoqil: has joined #ruby
[18:34:02] knowtheory: has joined #ruby
[18:34:03] avdi: has joined #ruby
[18:34:12] davedev24: has joined #ruby
[18:34:12] olivierjanss: has joined #ruby
[18:34:24] zzak___: has joined #ruby
[18:35:13] speakingcode: has joined #ruby
[18:36:13] swein: has joined #ruby
[18:36:53] skylerto: has joined #ruby
[18:38:05] hightower3: has joined #ruby
[18:39:10] RegulationD: has joined #ruby
[18:39:43] kirun: has joined #ruby
[18:41:13] cpup: has joined #ruby
[18:42:18] nankyokusei: has joined #ruby
[18:42:32] kgrz: has joined #ruby
[18:44:27] n_blownapart: has joined #ruby
[18:44:41] yfeldblum: has joined #ruby
[18:45:25] arajakul: has joined #ruby
[18:49:13] pawnbox: has joined #ruby
[18:51:13] cpup: has joined #ruby
[18:54:58] stannard: has joined #ruby
[18:57:01] n_blownapart: has joined #ruby
[18:58:30] wrkrcoop: when i do let(:user) {User.new} i try to print out :user using p :user and it doesnt log anything …
[18:59:06] jhass: p user, let creates a method named after the symbol you pass it
[18:59:41] wrkrcoop: oh it creates a method, not an object?
[19:00:09] jhass: it creates a method that returns an object
[19:00:21] jhass: well that returns whatever the return value of the block you pass it is
[19:00:36] wrkrcoop: so i would call user() to get the isntance?
[19:00:56] jhass: the parens are unnecessary, but yes
[19:01:07] eam: Does ruby have a mechanism to read or list signal handlers? Or can they only be set?
[19:02:15] arlek_: has joined #ruby
[19:03:40] k3rn31: has joined #ruby
[19:04:03] ChiefAlexander: has joined #ruby
[19:05:31] bronson: has joined #ruby
[19:07:04] momomomomo: has joined #ruby
[19:08:19] arthurl: has joined #ruby
[19:08:37] hutch34_: has joined #ruby
[19:09:15] zotherstupidguy: has joined #ruby
[19:09:43] Danielpk: has joined #ruby
[19:10:03] Vingador: has joined #ruby
[19:11:17] tristanp: has joined #ruby
[19:11:25] n_blownapart: has joined #ruby
[19:12:03] kgrz: eam: unix signal handlers?
[19:12:53] bronson: has joined #ruby
[19:13:14] LoneHerm_: has joined #ruby
[19:13:36] hutch34_: has joined #ruby
[19:13:54] danostrowski: has joined #ruby
[19:14:37] kareeole_: has joined #ruby
[19:15:07] diegoaguilar: has joined #ruby
[19:16:12] toretore: eam: (Signal.list.keys-%w[ILL FPE KILL BUS SEGV STOP VTALRM]).map{|s| h=Signal.trap(s, nil); Signal.trap(s, h); h } # :P
[19:16:34] phredus: has joined #ruby
[19:16:58] toretore: there probably exists reasons why not to do that
[19:17:29] phredus_: has joined #ruby
[19:17:57] blackmesa: has joined #ruby
[19:18:11] momomomomo: has joined #ruby
[19:18:58] stannard: has joined #ruby
[19:21:10] eam: kgrz: yeah. toretore: hah, does that read and unset, then re-set them all?
[19:22:40] n_blownapart: has joined #ruby
[19:23:05] eam: Signal ought to have a non-intrusive way to just list 'em =/
[19:23:26] eam: should be easy to add I suppose
[19:23:50] toretore: i guess ruby maintains an internal list of handlers
[19:24:06] eam: I'm guessing ruby doesn't actually look to see if any were set via other means
[19:24:31] gtsai_: has joined #ruby
[19:24:31] babblebre: has joined #ruby
[19:26:15] xapak: has joined #ruby
[19:26:53] xapak: Hey, I’ve got a general Linux inquiry. It’s about the TERM environment variable (if you have resources to better understand it, the better)
[19:27:07] xapak: I have it right now as TERM=rxvt-unicode-256color. I have this Ruby code that runs system("#{ENV['EDITOR']} file"), which should pick up vim, which is the value of my EDITOR variable. Problem is, if I leave my TERM as is, it ends up loading vi instead of vim. If I do export TERM to something like xterm-color, then it loads vim correctly. Would you happen to know why?
[19:27:46] grs: has joined #ruby
[19:30:17] brianpWins: has joined #ruby
[19:30:18] noobsu: has joined #ruby
[19:31:15] eam: xapak: how are you determining that it loads vi instead of vim? Is vi not just a link to vim on your system?
[19:32:06] Vingador: has joined #ruby
[19:32:10] eam: xapak: is it possible that it's loading vim in both cases, but you're getting a vim without color in one case?
[19:32:41] skolman_: has joined #ruby
[19:32:44] xapak: Hmm, it might be vim, but not just without colors, it’s like it’s vi-compatible all the way. Let me see how can I check which one is it.
[19:33:31] qasaur: has joined #ruby
[19:34:58] ruby488: has joined #ruby
[19:35:05] n_blownapart: has joined #ruby
[19:35:12] ruby-lang390: has joined #ruby
[19:35:26] aeterne: has joined #ruby
[19:36:24] xapak: Now it’s working even when switching back the TERM... :tableflip:
[19:36:38] k3rn31: has joined #ruby
[19:36:42] xapak: Let me reboot. I refuse to believe this to be luck.
[19:37:04] bigwavejake: has joined #ruby
[19:37:28] bigwavejake: has left #ruby: ()
[19:37:33] noobsu: has joined #ruby
[19:37:35] jenrzzz: has joined #ruby
[19:37:52] matp: has joined #ruby
[19:37:53] stannard: has joined #ruby
[19:38:19] tomphp: has joined #ruby
[19:38:20] cpup: has joined #ruby
[19:38:49] xenthree3: has joined #ruby
[19:40:39] wrkrcoop: has joined #ruby
[19:42:48] Coldblackice: has joined #ruby
[19:43:47] nettoweb: has joined #ruby
[19:44:27] xapak: Anyways, thanks. :P
[19:44:59] tAn: has joined #ruby
[19:45:20] xapak: has left #ruby: ()
[19:46:33] Kallis: has joined #ruby
[19:46:34] n_blownapart: has joined #ruby
[19:49:51] kirillow: has joined #ruby
[19:50:16] wrkrcoop: im trying to figure out how to test if a instance method has an arugment, i’m trying user.should_receive(:get_info)with(id)
[19:50:41] wrkrcoop: but its not working
[19:52:02] sameerynho: has joined #ruby
[19:52:04] mtkd: has joined #ruby
[19:52:35] jhass: ?didntwork
[19:52:36] ruby[bot]: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[19:53:30] kirillow: Method `collect_files` is reading files in a directory and turning them into objects of `kind`. Class `kind` stores every initialized `kind` in an array `@kind`. How do I get this array without initializing another `kind`?
[19:54:05] skade: has joined #ruby
[19:54:32] ruby[bot]: We can't help you without your code, please post it to https://gist.github.com
[19:55:37] wrkrcoop: is that the correct way to test if a method takes an argument?
[19:55:54] wrkrcoop: user.should_receive(:get_data).with(id)?
[19:56:07] wrkrcoop: get data being the method an id being the argument?
[19:56:33] kirillow: https://gist.github.com/anonymous/ff9e556487ecf88a53e062d2fbea68d6
[19:56:43] jhass: wrkrcoop: yes
[19:56:50] n_blownapart: has joined #ruby
[19:56:51] wrkrcoop: hm interesting
[19:58:09] tomchapin: has joined #ruby
[19:58:46] Es0teric: has joined #ruby
[19:59:43] jhass: kirillow: dangerous path, but anyway. "class methods" should have access to the class variable
[19:59:49] swein: Wish i could help, I'm a rubynewby
[19:59:58] jhass: the code is quite different to what your question states btw
[20:00:16] centrx: has joined #ruby
[20:00:18] tomphp: has joined #ruby
[20:00:49] kirillow: why is it dangerous?
[20:01:24] apeiros: module DangerZone; …put all your dangerous code here…; end
[20:01:24] danostrowski: has joined #ruby
[20:01:28] kirillow: ive have been switching things around a lot
[20:02:02] jhass: kirillow: https://carc.in/#/r/ywh
[20:02:53] kirillow: before that i stored the objects in an array outside of class but that ultimately had some downsides
[20:02:58] mdw: has joined #ruby
[20:03:00] jhass: because class variables, handing out references to self in initialize, potential memory leaks, multiple concerns in a single class
[20:03:08] kirillow: im really uncertain of how you do "this"
[20:03:24] cpup: has joined #ruby
[20:03:38] jhass: I'd consider a PostsRepository that manages them actually, possibly as a singleton class
[20:03:40] nando294021: has joined #ruby
[20:05:05] jenrzzz: has joined #ruby
[20:05:36] jhass: kirillow: btw in your collect_files the each is a bit weird given you'll only ever handle the first file found
[20:05:44] havenwood: >> 42.abs.magnitude.to_int.to_i.ord.floor.ceil.round.truncate.numerator.+@.nonzero?.real.conjugate.conj.freeze.itself.taint.untaint.untrust.trust
[20:05:45] ruby[bot]: havenwood: # => 42 (https://eval.in/573993)
[20:06:18] jhass: aka havenwood is bored
[20:07:45] wrkrcoop: i have this method that calls a method on one of my isntance variables, if i want my spec to not call that method, would i stub out that method?
[20:07:48] xenthree3: has joined #ruby
[20:07:49] xenthree3: has left #ruby: ()
[20:08:21] Gasher: has joined #ruby
[20:08:30] jhass: most likely
[20:08:31] havenwood: >> 'boredom? never!'.unicode_normalize.unicode_normalize!.shellescape.encode.encode!.+@.-@.scrub.scrub!.downcase.freeze.rstrip.chomp.strip.squeeze.lstrip.to_str.to_s.b.clone.dup.itself.taint.untaint.untrust.trust
[20:08:32] eL_bAmba: has joined #ruby
[20:08:33] ruby[bot]: havenwood: # => undefined method `shellescape' for "boredom? never!":String (NoMethodError) ...check link for more (https://eval.in/573994)
[20:08:48] havenwood: oops, too aggressive
[20:08:51] havenwood: a require away
[20:09:32] havenwood: >> 'better?'.unicode_normalize.unicode_normalize!.encode.encode!.+@.-@.scrub.scrub!.downcase.freeze.rstrip.chomp.strip.lstrip.to_str.to_s.b.clone.dup.itself.taint.untaint.untrust.trust
[20:09:35] fergal: has joined #ruby
[20:09:39] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[20:09:40] havenwood: okay, i'lll stop spamming >.>
[20:09:48] qasaur: has joined #ruby
[20:09:52] havenwood: but that "works"
[20:13:16] skade: has joined #ruby
[20:15:03] bronson: has joined #ruby
[20:15:05] _aeris_: has joined #ruby
[20:17:20] LoneHerm_: has joined #ruby
[20:17:29] jhack: has joined #ruby
[20:18:53] syndikate: has joined #ruby
[20:19:37] syndikate: Hello guys, I was writing a small application and used sprintf to print formatted output, but it is not printing anything, where as printf does...could anybody help understand why it is?
[20:20:17] n_blownapart: has joined #ruby
[20:21:41] n_blownapart: has joined #ruby
[20:21:43] tobiasvl: syndikate: sprintf returns a string, printf prints
[20:21:45] havenwood: syndikate: #sprintf returns a String: http://ruby-doc.org/core/Kernel.html#method-i-sprintf
[20:21:59] emilkarl: has joined #ruby
[20:23:34] eL_bAmba: has joined #ruby
[20:23:42] syndikate: thanks a lot tobiasvl and havenwood
[20:23:47] syndikate: I should have been more careful reading it
[20:27:47] halfamind: has joined #ruby
[20:28:15] halfamind1: has joined #ruby
[20:28:16] eam: what's the best way to parse apart a string that looks like FOO BAR1 BAR2 BAR3 into foo => [bar1, bar2, ...] where I might have one or more BAR elements
[20:28:16] ivanskie: has joined #ruby
[20:28:49] zeroDi: has joined #ruby
[20:29:34] cdg: has joined #ruby
[20:31:55] jhass: I think I would go with lines.map {|line| key, *values = line.split; [key, values] }.to_h
[20:31:57] rrichardsr3: has joined #ruby
[20:32:02] kgrz: heh, I had a similar usecase yesterday and used CSV.parse for the heck of it :D (My data has comma as the delimiter vs space in this question)
[20:32:28] Macaveli: has joined #ruby
[20:32:29] kgrz: >> "FOO BAR1 BAR2 BAR3".split.map(&:downcase)
[20:32:30] ruby[bot]: kgrz: # => ["foo", "bar1", "bar2", "bar3"] (https://eval.in/574008)
[20:32:35] eam: well I just realized my dumb error
[20:32:38] Oog: has joined #ruby
[20:32:47] eam: [\n- ] is not the same as [\n -]
[20:33:23] qasaur: has joined #ruby
[20:33:35] eam: jhass: I didn't realize split could return the regex match
[20:33:39] eam: that's exactly what I want
[20:34:11] eam: I had originally split on the single separator but then I was like "crap I need it and can't fetch it"
[20:35:22] eam: oh you know what, that's not gonna work
[20:35:51] eam: I didn't really call it out in my example, but FOO and BAR are all complex multi-line structures
[20:36:17] eam: I have unique patterns for each, but no surrounding structure to tokenize on
[20:37:40] startupality: has joined #ruby
[20:37:42] halfamind: has joined #ruby
[20:39:10] marr: has joined #ruby
[20:39:27] eam: what I have right now looks kinda like this (removed identifying constant strings)
[20:39:27] eam: blob.scan(/([a-z]{3}\d+.foobar.domain):SUCCESS: .*?((?:[\n -]*\/path\/to\/[^\/]+\/thing[^\n]+[\n -]*)+)/m) {|host, paths| host = paths.split "stuff" }
[20:41:31] ryoshu: has joined #ruby
[20:41:40] ryoshu: how to fix: Your Ruby version is 2.2.5, but your Gemfile specified 2.2.1
[20:41:53] johnmilton: has joined #ruby
[20:42:40] ramfjord: well, you can either downgrade your local ruby version to 2.2.1
[20:42:51] ramfjord: or tell your gemfile to use 2.2.5
[20:43:01] wrkrcoop: has joined #ruby
[20:43:14] nankyokusei: has joined #ruby
[20:43:17] ramfjord: you should probably be using rvm or rbenv to manage your ruby versions in development, and you can have a copy of 2.2.1 in addition to 2.2.5
[20:43:51] ryoshu: https://github.com/fulcrum-agile/fulcrum I'm trying to install it, I don't know ruby
[20:43:57] ryoshu: my host is netbsd with pkgsrc
[20:44:33] arlek_: has joined #ruby
[20:45:06] havenwood: ryoshu: Dunno why they pegged it to a single old version but 2.2.5 is the best 2.2: https://github.com/fulcrum-agile/fulcrum/blob/master/Gemfile#L3
[20:45:28] ryoshu: havenwood ah! I will try to install ruby 2.2.x
[20:45:50] havenwood: ryoshu: If you already have 2.2.5 just change the Gemfile line ^
[20:45:55] havenwood: ryoshu: then: bundle
[20:46:06] Devalo: has joined #ruby
[20:46:25] cpup: has joined #ruby
[20:46:46] havenwood: ryoshu: Seems the Bundle is a bit stale and in need of a refresh.
[20:46:47] ryoshu: do you mean to change Gemfile in root directory of fulcrum?
[20:46:52] havenwood: ryoshu: yes
[20:47:06] diegoviola: has joined #ruby
[20:47:19] qasaur: has joined #ruby
[20:47:32] ryoshu: or, traying
[20:47:50] fergal_: has joined #ruby
[20:47:53] duracrisis: has joined #ruby
[20:48:00] ur5us: has joined #ruby
[20:48:06] ryoshu: it installs something i18n json etc
[20:48:14] arlek_: has joined #ruby
[20:49:06] Guest11915: has joined #ruby
[20:49:54] qasaur: has joined #ruby
[20:50:48] ryoshu: http://paste.asie.pl/DAlm some errors, but progress, thanks
[20:50:50] mjuszczak: has joined #ruby
[20:52:19] havenwood: ryoshu: Installed the mysql package with pkgsrc yet?
[20:52:24] ryoshu: ACTION installing mysql and postgres
[20:53:23] diego2: has joined #ruby
[20:53:29] diego2: has joined #ruby
[20:54:05] snowy: has joined #ruby
[20:56:36] skylerto: has joined #ruby
[20:58:41] diegoaguilar: has joined #ruby
[20:59:47] qasaur: has joined #ruby
[21:01:00] johnmilton: has joined #ruby
[21:01:21] diego2: has joined #ruby
[21:02:15] danostrowski: has joined #ruby
[21:03:05] stannard: has joined #ruby
[21:03:21] wrkrcoop: has joined #ruby
[21:03:49] chip_: has joined #ruby
[21:04:12] diego2: has joined #ruby
[21:04:21] mistermocha: has joined #ruby
[21:04:41] solars: has joined #ruby
[21:04:56] cpup: has joined #ruby
[21:06:19] sdwrage: has joined #ruby
[21:07:11] blandflakes: has joined #ruby
[21:08:56] GodFather: has joined #ruby
[21:11:04] diego2: has joined #ruby
[21:13:10] s2013: has joined #ruby
[21:16:08] Evans: has joined #ruby
[21:16:45] monod: has joined #ruby
[21:20:39] eljimmy: has joined #ruby
[21:20:54] tomphp: has joined #ruby
[21:22:10] ur5us_: has joined #ruby
[21:22:17] noobsu: has joined #ruby
[21:24:21] n_blownapart: has joined #ruby
[21:24:50] bobbycvi: has joined #ruby
[21:24:59] yfeldblum: has joined #ruby
[21:25:37] ur5us: has joined #ruby
[21:28:22] firstdayonthejob: has joined #ruby
[21:30:04] swills: has joined #ruby
[21:33:30] noobsu_: has joined #ruby
[21:39:54] qasaur: has joined #ruby
[21:39:59] ixti: has joined #ruby
[21:41:19] jaguarmagenta: has joined #ruby
[21:41:22] JesseH: has joined #ruby
[21:41:24] qasaur: has joined #ruby
[21:42:34] qasaur: has joined #ruby
[21:43:28] ryoshu: bundle worked.. rake not http://paste.asie.pl/hnP7
[21:43:38] ryoshu: I'm looking for execjs in pkgsrc?
[21:44:19] noobsu: has joined #ruby
[21:47:41] Devalo: has joined #ruby
[21:48:29] elementaru: has joined #ruby
[21:48:45] elementaru: hello, can't get a line right
[21:48:48] jhass: ryoshu: nodejs rather
[21:49:00] rbennacer: has joined #ruby
[21:49:09] elementaru: a>b ? puts 'text' : puts 'text2'
[21:49:15] elementaru: what's missing?
[21:49:22] jhass: ryoshu: execjs is a gem that runs an available javascript runtime, one of which is nodejs
[21:49:37] ryoshu: ruby-execjs installs nodejs
[21:50:13] jhass: makes sense, still bundler installs execjs already so installing just nodejs would be fine
[21:51:04] jhass: elementaru: some parens, puts('text') : puts('text2')
[21:51:20] wald0: has joined #ruby
[21:51:34] jhass: note most people prefer if/else for control flow and use ternary only when they're interested in the value of the expression
[21:51:35] baweaver: puts a > b ? 'text' : 'text2'
[21:51:41] Kus: has joined #ruby
[21:51:48] jhass: like baweaver's example demonstrates
[21:51:56] minot: has joined #ruby
[21:52:08] mistermocha: has joined #ruby
[21:52:28] joelwallis: has joined #ruby
[21:52:33] stannard: has joined #ruby
[21:53:08] LoneHermit: has joined #ruby
[21:53:44] tatsuo: has joined #ruby
[21:54:36] elementaru: baweaver but how do I get that to print to the screen?
[21:54:53] jhass: elementaru: notice the puts in front
[21:55:03] danostrowski: has joined #ruby
[21:55:51] jaruga___: has joined #ruby
[21:56:18] mtkd: has joined #ruby
[21:56:24] s2013: has joined #ruby
[21:57:21] LoneHerm_: has joined #ruby
[22:01:12] LoneHermit: has joined #ruby
[22:02:06] whathappens: has joined #ruby
[22:05:19] wrkrcoop: has joined #ruby
[22:06:18] ledestin: has joined #ruby
[22:06:26] Xiti: has joined #ruby
[22:11:23] A124: has joined #ruby
[22:19:29] ss_much: has joined #ruby
[22:21:08] Yiota: has joined #ruby
[22:22:28] Evans: has joined #ruby
[22:23:25] ramfjord_: has joined #ruby
[22:24:49] Ballo: can err_arr.select{|t| !t.test?} be shortened to something like err_arr.reject{&:test?}
[22:25:19] nickjj: has joined #ruby
[22:25:34] startupality: has joined #ruby
[22:26:31] havenwood: Ballo: err_arr.reject &:test?
[22:27:12] Ballo: oh yea, parentheses...
[22:28:44] Ballo: is I wanted to keep the select ! instead of reject, would it be err_arr.select &:!test
[22:29:10] havenwood: Ballo: nope
[22:29:15] tobiasvl: why would you want that anyway
[22:29:15] Ballo: or err_arr.select !&:test?
[22:29:50] havenwood: Ballo: The long form you initially wrote.
[22:30:21] Ballo: so you're saying I can't modify the result
[22:30:34] tobiasvl: you can't negate a proc symbol
[22:30:39] tobiasvl: it doesn't make sense
[22:30:55] jhass: there's no such thing as "proc symbol"
[22:30:58] jhass: it's just a symbol
[22:31:44] hahuang61: has joined #ruby
[22:31:54] Ballo: ACTION is trying to figure out why ruby has these block things instead of function objects
[22:32:39] jhass: Ballo: so the :test? in &:test? is just a Symbol, the & operator calls to_proc on it and Symbol#to_proc happens to return a useful proc (one calling the method named by the symbol on its first argument)
[22:32:42] qasaur_: has joined #ruby
[22:32:57] tobiasvl: Ballo: you mean in addition to? (if you mean method instead of function)
[22:33:11] havenwood: Ballo: You can pass a lambda, proc or method as a block as well by prefixing the &.
[22:33:32] Ballo: so far as I can see, ruby doesn't have functions. Period
[22:33:32] jhass: well, Method object
[22:33:38] tobiasvl: Ballo: you're right. it has methods
[22:33:40] havenwood: Ballo: It does.
[22:33:50] Ballo: javascript has functions as does python
[22:33:53] havenwood: Ballo: Method, functions, block, procs, lambdas, and bears.
[22:33:57] Ballo: and you can pass them to other functions
[22:33:58] havenwood: Ballo: Ruby has functions...
[22:34:03] havenwood: Ballo: As you can with any modern lang.
[22:34:09] tobiasvl: Ballo: http://www.amazon.com/dp/B0001WO7GK
[22:34:19] tobiasvl: Ballo: http://ruby-doc.org/core-2.2.0/Method.html
[22:35:14] Ballo: right, so no functions
[22:35:21] havenwood: Ballo: Incorrect.
[22:35:37] Ballo: I don't see any functions there
[22:35:40] havenwood: Ballo: Blocks are something else. Not representing a lack of functions.
[22:35:43] havenwood: Ballo: http://yehudakatz.com/2012/01/10/javascript-needs-blocks/
[22:36:01] zenlot6: has joined #ruby
[22:36:20] havenwood: Functions with a module as a receiver for example.
[22:36:59] havenwood: Ballo: Anyways, just because you have a block sugar syntax or whatever you want to call it doesn't preclude passing methods/functions/procs/lambdas around.
[22:37:05] havenwood: In a non-block way.
[22:37:43] havenwood: Ballo: There are plenty of talks. Here's one that's fun: https://www.youtube.com/watch?v=FITJMJjASUs
[22:37:51] Ballo: I don't see what you're calling a "function"
[22:38:15] tobiasvl: Ballo: what is, in your view, the differences between a function and a method?
[22:38:37] tobiasvl: a lambda and a proc are not invoked on an object. are they functions in your opinion?
[22:38:56] havenwood: Ballo: Maybe you're getting confused because Ruby has more options than just one type of function. There are reasons!
[22:39:19] axl__: has joined #ruby
[22:40:28] havenwood: See the talk above. It's an interesting look at lambdas in Ruby.
[22:41:19] havenwood: Or if you're looking for a particular locality of return, or binding or non-binding or whatever, just say what exactly.
[22:41:27] smathy: RIP Jim, such a sad loss, he was a good guy.
[22:41:55] havenwood: smathy: Indeed.
[22:43:38] tobiasvl: weirich? or did someone else pass?
[22:43:47] havenwood: Ballo: It's Ruby so if it makes you more comfortable: Function = Proc # :P
[22:43:53] smathy: Yeah, Weirich.
[22:43:58] smathy: ...the video above.
[22:44:05] nankyokusei: has joined #ruby
[22:44:58] tobiasvl: Ballo: basically, procs and lambdas are what you could call functions in ruby. they're not invoked on an object (although they ARE objects, or first class functions) but can have closures
[22:45:21] tobiasvl: ...basically.
[22:46:30] qasaur: has joined #ruby
[22:46:47] tobiasvl: a block obviously is also a closure.
[22:47:13] tobiasvl: if you want something else from a "function" than that then please elaborate
[22:48:00] Omen: has joined #ruby
[22:49:12] rbennacer: has joined #ruby
[22:53:09] stannard: has joined #ruby
[22:53:10] dopie: has joined #ruby
[22:54:11] |2701: that is such a good talk
[22:55:10] havenwood: |2701: it is! this was the fun i had after last watching it: https://gist.github.com/havenwood/fd96e63ec60c15e07af85fc2f76f8ed7
[22:55:13] nerium: has joined #ruby
[22:55:41] havenwood: the symmetry is hypnotizing: https://gist.github.com/havenwood/9af042826d7288f52df8da396235951b
[22:56:41] nerium: Any recommendations on a tool/lib that can travarse a page where only unique resources are visited? So if /posts/1 is visited, /posts/2 shouldn’t
[22:57:11] havenwood: nerium: most crawlers would have an option to not duplicate visits
[22:57:26] blackmesa: has joined #ruby
[22:57:47] |2701: ive never enjoyed ruby's pointy lambdas
[22:57:49] nerium: That’s not really the case here. I don’t want it to visit duplicate resources, not urls
[22:58:00] hightower2: has joined #ruby
[22:58:00] havenwood: |2701: stabby stab stab!
[22:59:01] havenwood: nerium: Rails-specific or just in general?
[22:59:14] nerium: General would be good, but rails workls
[22:59:37] tax: has joined #ruby
[22:59:45] |2701: surely mechanize has something like that...?
[22:59:59] smathy: "only unique resources" doesn't match with "if /posts/1 is visited, /posts/2 shouldn’t"
[23:00:10] axl_: has joined #ruby
[23:00:19] smathy: ... /posts/1 and /posts/2 are unique resources.
[23:00:26] dopie: has joined #ruby
[23:00:47] |2701: he meant unique groups of resources, I think. so /users/*, /pages/*, /stuff/* etc
[23:00:50] nerium: Okay, I would call /posts a resource, but I get what you mean
[23:01:21] smathy: nerium, so what about /posts/1/comments ?
[23:01:40] maxdoubt: has joined #ruby
[23:01:51] smathy: ...and if /posts is visited, you want to skip any individual /posts/1 ?
[23:01:51] jwren: has joined #ruby
[23:02:09] sameerynho: has joined #ruby
[23:02:18] nerium: That’s correct. The idea is to verify that all views works (200 response)
[23:02:19] smathy: So ambiguity, much unknown.
[23:02:36] smathy: nerium, well if that's correct, then you DON
[23:02:42] smathy: DON'T want to skip /posts/1
[23:03:28] smathy: Are you going to assume totally restful routes? So /posts/some_category couldn't exist?
[23:03:51] smathy: If this is testing your own app I'd just make a list of URLs to test/check.
[23:04:11] nerium: Yes, this is my owen site
[23:04:28] nerium: Was hoping to avloid doing this manually
[23:04:43] nerium: but maybe that’s the way to go
[23:04:58] blackgoat: has joined #ruby
[23:06:27] nerium: Maybe I can just look at the most visited urls in the log and use them
[23:06:30] Symbiosisz: has joined #ruby
[23:06:53] smathy: It would only be reliable with very ordinary/restful routes anyway, and if your routes are like that then spitting out `rake routes` and using conventions to map to models and just pulling up `ThatModel.first` or something to grab an id will probably be simpler and more reliable than scraping and trying to work backwards to identify unique controller/action combinations.
[23:06:56] rbennacer: has joined #ruby
[23:07:19] smathy: Well that won't ensure any level of your "uniqueness" (I wouldn't expect).
[23:07:49] nerium: It would with some filtering
[23:07:51] smathy: ...or if you know you never delete records maybe you just always use `1`
[23:08:23] nerium: Yeah, but then we might have /posts/1/comments/194
[23:08:25] smathy: Yep. I'd go the other way, taking the URLs and substituting - but the filtering would work ok too.
[23:08:48] nerium: Yeah, just looking at what my users already uses would work
[23:09:14] smathy: Not sure which approach that was a "but" to, but in both situation nested routes will just require some additional filtering or substitution.
[23:09:16] swein: has joined #ruby
[23:09:57] qasaur: has joined #ruby
[23:10:22] nerium: Tried that a few years ago. (using resources and existing data to generate a list) and it was to much work and error prone
[23:11:14] nerium: I mean, using rake routes and appplying data to routes by doing user_path(User.first)
[23:12:04] akiTendo: has joined #ruby
[23:12:56] insanedreamer: has joined #ruby
[23:14:56] momomomomo: has joined #ruby
[23:15:22] LoneHermit: has joined #ruby
[23:16:16] JesseH: has joined #ruby
[23:16:40] tomchapin: has joined #ruby
[23:17:10] chouhoulis: has joined #ruby
[23:18:05] swills: has joined #ruby
[23:18:52] chouhoul_: has joined #ruby
[23:20:32] koooge: has joined #ruby
[23:21:06] wrkrcoop: anyone see anything wrong with this: expect(client.get_file([],{})).to raise ArgumentError
[23:21:42] wrkrcoop: code is raise ArgumentError if !xis_a?(String) || !y.is_a?(String)
[23:21:59] tpendragon: If you're expecting an exception it needs to be in a block.
[23:22:16] flashpoint9: has joined #ruby
[23:22:30] tpendragon: So expect{client.get_file([], {})}.to raise_error ArgumentError
[23:23:10] tpendragon: (Also, consider duck typing)
[23:23:11] sdwrage: has joined #ruby
[23:23:29] wrkrcoop: tpendragon: can u elaborate on the duck typing part
[23:23:33] wrkrcoop: thank you for the help that worked
[23:23:47] tpendragon: It's almost never a good idea to check for a class. Just send it a method and if it responds, great.
[23:26:11] wrkrcoop: tpendragon: but if u dont return an error then how will the user know what went wrong?
[23:26:22] wald0: has joined #ruby
[23:26:28] skolman: has joined #ruby
[23:26:36] tpendragon: Your code will try to send the message and it will explode if they send a bad thing.
[23:27:01] wrkrcoop: tpendragon: and isnt that bad for your server?
[23:27:15] qasaur: has joined #ruby
[23:27:28] tpendragon: No..? ArgumentError's no more useful than NoMethodException, I wouldn't think.
[23:27:36] mtkd: has joined #ruby
[23:28:35] nando293921: has joined #ruby
[23:28:53] wrkrcoop: tpendragon: what if u dont raise and error but send a response, if u dont send a response wont your server crash?
[23:29:26] tpendragon: So...don't send it bad things?
[23:29:41] swein: has joined #ruby
[23:29:50] qasaur: has joined #ruby
[23:30:10] wrkrcoop: tpendragon: thanks for the help, much appreciated
[23:30:19] wrkrcoop: why did i have to use a block instead of parentheses?
[23:30:39] tpendragon: It's just the only way rspec has to know to capture the exception.
[23:31:05] tpendragon: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/raise-error-matcher
[23:31:46] tpendragon: (the block's only run when the matcher decides to run it, so it can do something like begin; block.call; rescue Exception => e; record_exception; end;)
[23:31:58] wald0: has joined #ruby
[23:32:14] jokke: has joined #ruby
[23:32:22] qasaur: has joined #ruby
[23:34:18] zenlot6: has joined #ruby
[23:35:34] wilsonc91: has joined #ruby
[23:36:29] al2o3-cr: it's late [*1..4].flat_map { |n| [*1..4].combination(n).to_a }.group_by(&:size).map { |_, v| v.size }
[23:36:58] dsferreira: has joined #ruby
[23:37:04] tfitts: has joined #ruby
[23:38:17] al2o3-cr: am i over complicating things
[23:38:17] al2o3-cr: so 4 singles, 6 doubles, 4 trebles and a 4 timer
[23:39:29] vdamewood: has joined #ruby
[23:39:42] al2o3-cr: for a total of 15 bets?
[23:42:13] jaguarmagenta: has joined #ruby
[23:46:16] aghalarp: has joined #ruby
[23:48:33] amclain: has joined #ruby
[23:48:45] |ifei5g00d: has joined #ruby
[23:49:24] CJKinni: has joined #ruby
[23:50:30] swein: has joined #ruby
[23:54:18] LoneHerm_: has joined #ruby
[23:55:39] ur5us: has joined #ruby
[23:56:10] flashpoint9: has joined #ruby
[23:59:06] aghalarp: has joined #ruby