« Back to channel list

#ruby - 08 March 2016

« Back 1 day Forward 1 day »
[00:02:16] BrunoSaboia: has joined #ruby
[00:04:13] jordanm: has joined #ruby
[00:04:36] charliesome: has joined #ruby
[00:06:34] ensyde__: has joined #ruby
[00:08:37] symm-: has joined #ruby
[00:08:41] conail: has joined #ruby
[00:09:16] idefine: has joined #ruby
[00:09:27] idefine: has joined #ruby
[00:10:16] rmulligan: has joined #ruby
[00:11:26] snowy: has joined #ruby
[00:11:47] uglybandersnatch: has joined #ruby
[00:12:43] fpedroso: has joined #ruby
[00:14:29] zenguy_pc: has joined #ruby
[00:15:58] Ropeney: has joined #ruby
[00:16:13] ebbflowgo: has joined #ruby
[00:18:00] Wicaeed: has joined #ruby
[00:18:50] bronson: has joined #ruby
[00:19:15] charliesome: has joined #ruby
[00:19:27] rickmasta: has joined #ruby
[00:20:41] stunder001: has joined #ruby
[00:20:55] kies: has joined #ruby
[00:25:01] freerobby: has joined #ruby
[00:26:59] stunder001: has joined #ruby
[00:28:13] jericon: Is there a way to use the Ruby Logger to output to a file if invoked by cron, but output to stdout if invoked by a person?
[00:30:06] confused123: has joined #ruby
[00:30:13] confused123: Anyone alive in here?
[00:30:17] confused123: I need help with RSpec
[00:30:28] confused123: I've created a class under my spec/ folder called FileMock
[00:30:31] confused123: Sitting in file_mock.rb
[00:30:33] axl_: has joined #ruby
[00:30:39] confused123: In this class, I call "allow"
[00:30:48] confused123: allow(File).to receive(:open) do |path|
[00:31:08] confused123: I'm getting a NoMethodError
[00:31:08] confused123: undefined method `allow'
[00:31:26] confused123: I'm creating FileMock in a before :each clause in RSpec
[00:31:49] confused123: And if I don't use FileMock and call allow in a global method, there's no issues
[00:33:09] uglybandersnatch: has joined #ruby
[00:33:23] bronson: has joined #ruby
[00:34:17] adit: jericon yes, there are a lot of ways to do that
[00:34:22] baweaver: has joined #ruby
[00:34:44] adit: for example you could set an env var when invoking by cron:
[00:34:58] adit: FOO=1 ruby my_script.rb
[00:35:21] adit: then check if ENV["FOO"] is set in your script
[00:36:09] mlehrer: has joined #ruby
[00:36:23] charliesome: has joined #ruby
[00:37:20] eregi_: has joined #ruby
[00:38:42] dasher^0_o: has joined #ruby
[00:38:54] arescorpio: has joined #ruby
[00:41:24] uglybandersnatch: has joined #ruby
[00:41:34] skade: has joined #ruby
[00:43:08] idefine: has joined #ruby
[00:43:56] Kryptonical: has joined #ruby
[00:44:37] DLSteve: has joined #ruby
[00:45:29] kam270: has joined #ruby
[00:47:30] CloCkWeRX: has joined #ruby
[00:47:50] Krypt: has joined #ruby
[00:49:00] Synthead: has joined #ruby
[00:49:00] Kryptonical: has joined #ruby
[00:49:50] nanoz: has joined #ruby
[00:52:04] pawnbox: has joined #ruby
[00:52:42] lemur: has joined #ruby
[00:53:02] lyoshajapan: has joined #ruby
[00:53:35] yuung: has joined #ruby
[00:54:31] safe: has joined #ruby
[00:56:49] lyoshaja_: has joined #ruby
[00:58:55] robbyoconnor: has joined #ruby
[01:01:32] gbgdev: has joined #ruby
[01:01:41] aeontech: has joined #ruby
[01:02:57] ivanskie_work_: has joined #ruby
[01:04:28] rmulligan: has joined #ruby
[01:06:08] Mojo_Nixon: has joined #ruby
[01:07:01] aeontech: has joined #ruby
[01:07:02] vishwa: has joined #ruby
[01:08:09] safe: has joined #ruby
[01:10:08] n008f4g_: has joined #ruby
[01:14:18] krobzaur: has joined #ruby
[01:16:10] alphaatom: has joined #ruby
[01:16:25] RegulationD: has joined #ruby
[01:17:18] wnd: has joined #ruby
[01:19:19] baweaver: has joined #ruby
[01:19:30] Synthead: has joined #ruby
[01:19:37] johnmilton: has joined #ruby
[01:20:22] lyoshajapan: has joined #ruby
[01:22:21] idefine: has joined #ruby
[01:26:23] araujo: has joined #ruby
[01:28:40] araujo: has joined #ruby
[01:31:02] but3k4: has joined #ruby
[01:33:10] aspiers: has joined #ruby
[01:33:46] moos3: has joined #ruby
[01:33:52] stunder001: has joined #ruby
[01:37:54] idefine: has joined #ruby
[01:38:31] Mia: has joined #ruby
[01:38:31] Mia: has joined #ruby
[01:41:18] Rodya_: has joined #ruby
[01:41:32] juanfra: has joined #ruby
[01:41:50] pawnbox: has joined #ruby
[01:43:52] PaulCapestany: has joined #ruby
[01:46:12] duckpuppy: has joined #ruby
[01:47:54] eregi: has joined #ruby
[01:48:08] statelesscode: has joined #ruby
[01:48:18] ebbflowgo: has joined #ruby
[01:51:16] A124: has joined #ruby
[01:52:25] CloCkWeRX: has joined #ruby
[01:52:34] freerobby: has joined #ruby
[01:53:27] duckpuppy: has joined #ruby
[01:54:09] jenrzzz: has joined #ruby
[01:56:30] juanfra: has joined #ruby
[01:58:36] rmulligan: has joined #ruby
[01:59:03] justbleed: has joined #ruby
[01:59:36] wename: has joined #ruby
[01:59:43] wename: https://www.youtube.com/watch?v=O1rT6Vi5Ln4 (nsfw)
[02:00:16] sucks: has joined #ruby
[02:00:57] havenwood: !troll wename
[02:00:57] ruby[bot]: +bbbb $a:wename$#ruby-banned KliKK!*@*$#ruby-banned wename!*@*$#ruby-banned *!*@gateway/web/freenode/ip.108.214.81.103$#ruby-banned
[02:00:57] ruby[bot]: ruby[bot] kicked wename: is a bannable offense, see http://ruby-community.com/pages/user_rules
[02:00:59] ruby[bot]: -b DEATHTOINFIDEL!*@*$#ruby-banned
[02:01:35] polyidus: has joined #ruby
[02:01:47] aeontech: has joined #ruby
[02:02:40] arlek: has joined #ruby
[02:03:49] bronson: has joined #ruby
[02:06:23] DoubleMalt: has joined #ruby
[02:07:09] cyclonis: has joined #ruby
[02:08:33] niksrc_: has joined #ruby
[02:09:27] aeontech: has joined #ruby
[02:13:21] Mon_Ouie: has joined #ruby
[02:15:40] trosborn: has joined #ruby
[02:17:17] boontdustie: has joined #ruby
[02:18:19] cpup: has joined #ruby
[02:18:45] tjbiddle: has joined #ruby
[02:22:12] jayc0b0: has joined #ruby
[02:23:31] veduardo: has joined #ruby
[02:25:19] Tricon: has joined #ruby
[02:25:24] devbug: has joined #ruby
[02:26:07] cyclonis: has joined #ruby
[02:26:17] baweaver: has joined #ruby
[02:28:21] boontdustie: has joined #ruby
[02:28:46] norc_: has joined #ruby
[02:29:25] sucks: has joined #ruby
[02:31:28] pawnbox: has joined #ruby
[02:32:05] moos3: has joined #ruby
[02:33:00] rattatmatt: has joined #ruby
[02:33:34] auzty: has joined #ruby
[02:37:20] chouhoulis: has joined #ruby
[02:40:33] Tempesta: has joined #ruby
[02:40:35] boontdustie: has joined #ruby
[02:41:10] floatingpoint: has joined #ruby
[02:44:45] norc-2: has joined #ruby
[02:45:32] sarbs: has joined #ruby
[02:46:19] lyoshajapan: has joined #ruby
[02:46:24] shadoi: has joined #ruby
[02:46:59] chouhoulis: has joined #ruby
[02:47:51] cyclonis: has joined #ruby
[02:48:02] kam270: has joined #ruby
[02:51:01] uglybandersnatch: has joined #ruby
[02:52:41] rmulligan: has joined #ruby
[02:53:27] baweaver: has joined #ruby
[02:53:39] boontdustie: has joined #ruby
[02:55:49] ESpiney: has joined #ruby
[02:56:40] Moosashi: has joined #ruby
[02:59:55] boontdustie: has joined #ruby
[03:01:11] pawnbox: has joined #ruby
[03:01:44] jottr: has joined #ruby
[03:02:06] DmitryBochkarev: has joined #ruby
[03:03:41] davejlong: has joined #ruby
[03:03:52] rattatmatt: has joined #ruby
[03:04:00] boontdustie: has joined #ruby
[03:05:01] rkazak: has joined #ruby
[03:10:59] shevy: long live ruby!
[03:14:38] jud: has joined #ruby
[03:15:27] Es0teric: has joined #ruby
[03:15:48] Anon988: has joined #ruby
[03:17:06] norc_: has joined #ruby
[03:17:28] ramfjord: has joined #ruby
[03:19:17] Limix: has joined #ruby
[03:19:27] HalcyonicStorm: has joined #ruby
[03:19:48] boontdustie: has joined #ruby
[03:20:11] jayc0b0: has joined #ruby
[03:21:14] zarubin: has joined #ruby
[03:23:43] treaki_: has joined #ruby
[03:26:12] cyclonis: has joined #ruby
[03:29:42] Moosashi: has joined #ruby
[03:31:58] but3k4: has joined #ruby
[03:33:08] hxegon: has joined #ruby
[03:33:26] x77686d: has joined #ruby
[03:38:06] kfpratt: has joined #ruby
[03:38:35] ivanskie: has joined #ruby
[03:42:05] Graphettion: has joined #ruby
[03:42:43] lyoshajapan: has joined #ruby
[03:46:22] sneakerhax: has joined #ruby
[03:46:49] rmulligan: has joined #ruby
[03:48:21] chipotle: has joined #ruby
[03:50:11] sucks: has joined #ruby
[03:50:47] hxegon: has joined #ruby
[03:50:50] krz: has joined #ruby
[03:51:22] pawnbox: has joined #ruby
[03:53:07] idefine: has joined #ruby
[03:58:02] s00pcan: has joined #ruby
[04:02:15] treaki_: has joined #ruby
[04:04:58] duncannz: has joined #ruby
[04:06:15] Rodya_: has joined #ruby
[04:08:29] CBX: has joined #ruby
[04:08:49] zast: has joined #ruby
[04:08:58] gix: has joined #ruby
[04:10:22] DoubleMalt: has joined #ruby
[04:11:55] stardiviner: has joined #ruby
[04:13:07] djbkd: has joined #ruby
[04:15:29] pawnbox: has joined #ruby
[04:15:54] Rodya_: has joined #ruby
[04:16:32] braincrash: has joined #ruby
[04:17:42] lyoshajapan: has joined #ruby
[04:19:15] boontdustie: has joined #ruby
[04:19:36] lyoshajapan: has joined #ruby
[04:21:27] spleeze: has joined #ruby
[04:21:29] lyoshajapan: has joined #ruby
[04:21:30] svankmajer: has joined #ruby
[04:21:37] Moosashi: has joined #ruby
[04:23:18] lyoshajapan: has joined #ruby
[04:23:22] lyoshaja_: has joined #ruby
[04:23:22] hxegon: has joined #ruby
[04:23:26] tjbiddle: has joined #ruby
[04:23:29] mallu: has joined #ruby
[04:24:31] quazimodo: has joined #ruby
[04:25:38] havenwood: quazimodo: hi
[04:26:06] bry4n: has joined #ruby
[04:26:27] dcope: has joined #ruby
[04:26:39] dcope: with net http, how can i set a query string?
[04:26:53] dcope: i can't find any applicable properties on Net::HTTP::Get
[04:27:02] arescorpio: has joined #ruby
[04:27:16] Radar: http://stackoverflow.com/questions/5138666/in-ruby-using-net-http-we-have-to-join-the-url-and-query-using-a-ourselv
[04:27:37] Radar: dcope: Do you have to use Net::HTTP or are you doing it because of masochistic tendencies?
[04:28:14] dcope: Radar: i'm just using net:http to keep it simple. this is just a simple shell script i'm playing with. :)
[04:28:19] pawnbox: has joined #ruby
[04:28:30] Radar: Net::HTTP is not "simple"
[04:28:36] microt: has left #ruby: ("WeeChat 1.3")
[04:28:41] Radar: I recommend using Excon or HTTParty so that you don't have to battle with Net::HTTP's crap API
[04:28:58] dcope: Radar: well, simple to setup. i was just trying to stick in with built in libraries.
[04:29:04] dcope: request_uri did the trick though! thank you :D
[04:29:15] svankmajer: I've a Hash with three keys: a, b, and c. I want to map their elements like this: `a.flat_map { |i| b.flat_map { |j| c.map {|k| [i, j, k] } } }`. Now, how could I do this, not knowing how many keys the Hash has? How can one nest those `map`s "dynamically", based on a number of collections? Jesus. I don't know anymore if this is making any sense whatsoever.
[04:29:49] svankmajer: their values, which are arrays* (e.g. of integers)
[04:30:06] polyidus: has joined #ruby
[04:30:13] ghormoon: has joined #ruby
[04:31:18] devbug_: has joined #ruby
[04:35:24] Tricon: has joined #ruby
[04:38:18] Ox0dea: svankmajer: It's not entirely clear what you're asking, but I suspect you want something from Ruby's limited supply of combinatorics.
[04:39:06] sarlalian: has joined #ruby
[04:39:29] treaki__: has joined #ruby
[04:39:53] nicnilov: has joined #ruby
[04:40:00] havenwood: svankmajer: h.values.reduce(&:product).map(&:flatten)
[04:40:36] tjbiddle: has joined #ruby
[04:40:57] rmulligan: has joined #ruby
[04:41:18] voidsta: has joined #ruby
[04:42:25] toretore: has joined #ruby
[04:42:42] sarlalian: has joined #ruby
[04:45:34] Ox0dea: svankmajer: https://eval.in/532335
[04:46:01] havenwood: >> {a: [1, 2, 3], b: [5, 7], c: [3, 1, 6]}.values.reduce(&:product).map(&:flatten)
[04:46:03] ruby[bot]: havenwood: # => [[1, 5, 3], [1, 5, 1], [1, 5, 6], [1, 7, 3], [1, 7, 1], [1, 7, 6], [2, 5, 3], [2, 5, 1], [2, 5, 6], ...check link for more (https://eval.in/532338)
[04:46:30] Ox0dea: A reduction is kinda wasteful here, no?
[04:46:36] Ox0dea: #product can take any number of arguments.
[04:46:39] krz: has joined #ruby
[04:47:58] havenwood: head, *tail = h.values; head.product(*tail)
[04:48:07] havenwood: Ox0dea: roger that!
[04:49:12] Macaveli: has joined #ruby
[04:50:13] Ox0dea: Is there a name for applying some operation *to* the head *with* the tail as arguments?
[04:50:14] svankmajer: havenwood: Ox0dea: Wow. Thanks for taking the time. I didn't know about #product. I'm playing with it on the repl now.
[04:51:04] Ox0dea: I feel like Factor had some name for it, but there's idiosyncrasy all over the place there.
[04:51:38] ponga: has joined #ruby
[04:52:32] djellemah: has joined #ruby
[04:52:37] aupadhye: has joined #ruby
[04:59:19] brentw: has joined #ruby
[04:59:40] ruby-lang851: has joined #ruby
[05:00:14] brentw: HI, i had a question regarding passing a hash as an argument
[05:01:35] brentw: the test case they gave me is basically Dictionary.new.add("fish" => "water"), and i need to add that to the instance variable hash
[05:02:07] eregi: has joined #ruby
[05:02:26] Ox0dea: brent_: A Hash is in fact being passed as an argument there.
[05:02:29] brentw: i'm confused on how they give the argument... add("fish" => "water"), and don't put it between {}
[05:02:48] Ox0dea: You can have an "implicit Hash" as the last argument in a method call.
[05:02:50] sauvin: has joined #ruby
[05:03:20] brentw: 0x0dea okay, so in my add method i can pull the key and value like it's a normal hash
[05:04:14] Ox0dea: brent_: https://eval.in/532339
[05:06:11] brentw: 0x0dea thanks for the confirmation
[05:06:41] Ox0dea: Sure thing.
[05:07:27] gix: has joined #ruby
[05:08:49] rmulligan: has joined #ruby
[05:10:53] Ox0dea: brent_: A neat trick: https://eval.in/532340
[05:11:35] hk238: has joined #ruby
[05:13:02] Tricon: has joined #ruby
[05:15:27] brentw: 0x0dea interesting, so the (k, v), = *entry assigns the key/values?
[05:15:42] brentw: no need to iterate through?
[05:16:30] baweaver: has joined #ruby
[05:16:31] Lucky_ABA: has joined #ruby
[05:17:46] rmulligan: has joined #ruby
[05:17:57] RegulationD: has joined #ruby
[05:18:02] Ox0dea: brent_: Well, no, it only assigns the first key-value pair; that dangling comma ignores the rest.
[05:18:15] statelesscode: has joined #ruby
[05:18:56] Ox0dea: It certainly makes sense for your #add method to be able to handle multiple new definitions, so probably ignore that trick for now. :)
[05:19:04] brentw: yeah i agree
[05:19:18] brentw: it looks like there is test cases for single arguments as well which you then have to assign it a value of nil
[05:20:05] brentw: if entry.is_a?(Hash)
[05:20:17] brentw: seem like the best way to go aobut it
[05:20:49] brentw: else; @dict[entry] = nil
[05:21:12] Ox0dea: Seems fine.
[05:22:19] eregi: has joined #ruby
[05:22:50] krz: has joined #ruby
[05:26:39] vishwa: has joined #ruby
[05:28:21] DmitryBochkarev: has joined #ruby
[05:29:19] A124: has joined #ruby
[05:30:18] lxsameer: has joined #ruby
[05:32:01] BtcBen: has joined #ruby
[05:35:04] kp666: has joined #ruby
[05:36:39] darkxploit: has joined #ruby
[05:48:05] djbkd: has joined #ruby
[05:50:16] sauvin: has joined #ruby
[05:50:40] moeabdol3: has joined #ruby
[05:50:59] quazimodo: has joined #ruby
[05:52:49] ArtursL: has joined #ruby
[05:55:06] rmulligan: has joined #ruby
[05:57:54] crankharder: has joined #ruby
[06:00:22] djbkd: has joined #ruby
[06:01:48] nicnilov: has joined #ruby
[06:01:54] abhi_rsd: has joined #ruby
[06:04:55] sp4rrow: has joined #ruby
[06:05:23] roshanavand: has joined #ruby
[06:06:39] sarlalian: has joined #ruby
[06:08:01] Hobbyboy: has joined #ruby
[06:12:12] paatalaBhairavi: has joined #ruby
[06:13:41] sarlalian: has joined #ruby
[06:21:18] Es0teric: has joined #ruby
[06:25:37] nicnilov: has joined #ruby
[06:26:56] araujo_: has joined #ruby
[06:27:34] steffkes: has joined #ruby
[06:27:57] eregi: has joined #ruby
[06:28:46] tjbiddle: has joined #ruby
[06:28:56] ixti: has joined #ruby
[06:30:11] bronson: has joined #ruby
[06:31:52] solocshaw: has joined #ruby
[06:32:01] KensoDev: has joined #ruby
[06:35:59] symm-_: has joined #ruby
[06:37:16] floatingpoint: has joined #ruby
[06:42:25] coffeecupp: has joined #ruby
[06:44:49] thor_: has joined #ruby
[06:47:12] dede: has joined #ruby
[06:51:47] solars: has joined #ruby
[06:55:36] TinkerTyper: has joined #ruby
[06:57:10] coffeecupp: has joined #ruby
[06:57:16] pawnbox: has joined #ruby
[07:00:55] charliesome: has joined #ruby
[07:01:37] krz: has joined #ruby
[07:03:14] skydiver: has joined #ruby
[07:03:21] crdpink2: has joined #ruby
[07:03:48] ohaibbq: has joined #ruby
[07:04:12] skydiver: has joined #ruby
[07:04:55] TinkerTyper: has joined #ruby
[07:05:18] aganov: has joined #ruby
[07:05:41] Kryptonical: has joined #ruby
[07:05:51] skydiver: has joined #ruby
[07:08:47] siaW: has joined #ruby
[07:09:01] tjbiddle: has joined #ruby
[07:09:03] rippa: has joined #ruby
[07:10:08] quazimodo: has joined #ruby
[07:10:49] eregi: has joined #ruby
[07:11:53] TinkerTyper: has joined #ruby
[07:16:02] firstdayonthejob: has joined #ruby
[07:16:57] krz: has joined #ruby
[07:18:17] sandstrom: has joined #ruby
[07:23:09] d0nn1e: has joined #ruby
[07:23:10] krzkrz: has joined #ruby
[07:24:35] the_drow: has joined #ruby
[07:28:51] skydiver: has joined #ruby
[07:29:15] uglybandersnatch: has joined #ruby
[07:30:07] anisha: has joined #ruby
[07:30:20] skade: has joined #ruby
[07:31:57] skydiver: has joined #ruby
[07:33:33] Es0teric: has joined #ruby
[07:33:48] but3k4: has joined #ruby
[07:34:25] skydiver: has joined #ruby
[07:34:37] jottr: has joined #ruby
[07:35:41] copperb0lt: has joined #ruby
[07:36:20] hahuang61: has joined #ruby
[07:36:40] skydiver: has joined #ruby
[07:38:41] charliesome: has joined #ruby
[07:38:59] jas02: has joined #ruby
[07:40:24] peteyg: has joined #ruby
[07:40:35] rkazak: has joined #ruby
[07:42:50] andikr: has joined #ruby
[07:44:47] the_drow: has joined #ruby
[07:46:55] Macaveli: has joined #ruby
[07:47:45] konsolebox: has joined #ruby
[07:48:54] sandstrom: has joined #ruby
[07:51:07] krzkrzkrz: has joined #ruby
[07:52:18] pawnbox: has joined #ruby
[07:52:58] rdark: has joined #ruby
[07:54:31] tAn: has joined #ruby
[08:01:09] arthurix: has joined #ruby
[08:02:07] uglybandersnatch: has joined #ruby
[08:05:24] jeanlinux: has joined #ruby
[08:07:02] codecop: has joined #ruby
[08:07:07] codecop_: has joined #ruby
[08:09:30] Couch: has joined #ruby
[08:10:29] copperb0lt: has joined #ruby
[08:14:22] aufi: has joined #ruby
[08:17:29] djellemah: I'm looking for a more generic version of something like this
[08:17:29] djellemah: ary.reduce([]){|totals,item| totals << (totals.last || 0) + item}
[08:17:29] djellemah: afaics, it's one way to do what Haskell calls scanl. Anybody know of ruby implementations? I want to see how the possible wrinkles are handled. I can only find some snippets on stackoverflow.
[08:18:36] vondruch: has joined #ruby
[08:19:05] jhass: I'd use each_with_object but that's about as good as it gets
[08:20:35] jaruga: has joined #ruby
[08:21:36] neanderslob: has joined #ruby
[08:22:03] jeanlinux: has joined #ruby
[08:22:27] apeiros: meh, I'd probably do ary.map(&:last).compact.inject(:+)
[08:23:04] apeiros: misread. you push to an array.
[08:23:05] jhass: apeiros: I think you misread it :)
[08:23:23] apeiros: yeah. it's still early morning. not had my caffeine yet :D
[08:23:47] jhass: sure there's a mathematical term for that, cumulative sequence or something?
[08:23:47] apeiros: looks like a running total?
[08:24:09] djellemah: yup - prefix sum, cumulative sum
[08:24:38] apeiros: total=0; ary.map { |item| total+item }
[08:25:00] apeiros: total=0; ary.map { |item| total+=item }
[08:25:30] tvw: has joined #ruby
[08:25:54] LoneHerm_: has joined #ruby
[08:26:40] djellemah: that as well. I'm wondering if there's any point in having the totals collection (and the last total) passed around via reduce or each_with_object. Or if it's easier to just have them as locals like ^
[08:26:51] maner: has joined #ruby
[08:27:26] pawnbox: has joined #ruby
[08:27:39] jhass: boils down to preference I'd say
[08:27:57] djellemah: I can't really think of anything more solid than that either ;-)
[08:29:00] sandstrom: has joined #ruby
[08:29:47] Es0teric: has joined #ruby
[08:30:30] copperb0lt: has joined #ruby
[08:30:31] Es0teric: has joined #ruby
[08:31:13] Es0teric: has joined #ruby
[08:31:39] bronson: has joined #ruby
[08:31:48] Es0teric: has joined #ruby
[08:33:39] SCHAAP137: has joined #ruby
[08:34:08] terlar: has joined #ruby
[08:34:27] shredding: has joined #ruby
[08:36:02] gbgdev: has joined #ruby
[08:37:39] hahuang61: has joined #ruby
[08:40:32] jeanlinux: has joined #ruby
[08:42:31] binaryplease1: has joined #ruby
[08:43:03] biberu: has joined #ruby
[08:43:59] morfin: apeiros, i thought you can collect
[08:45:20] electriv: has joined #ruby
[08:48:36] morfin: oh no, not collect but inject/reduce
[08:50:23] morfin: >> [56,873,234,89,345,96,68].reduce(:+)
[08:50:24] ruby[bot]: morfin: # => 1761 (https://eval.in/532431)
[08:56:53] igam: has joined #ruby
[09:00:12] anisha_: has joined #ruby
[09:01:01] araujo: has joined #ruby
[09:01:02] araujo: has joined #ruby
[09:01:19] minimalism: has joined #ruby
[09:01:46] araujo: has joined #ruby
[09:02:43] the_drow: has joined #ruby
[09:04:15] anisha_: has joined #ruby
[09:05:07] atmosx: has joined #ruby
[09:05:13] pawnbox: has joined #ruby
[09:07:22] drptbl: has joined #ruby
[09:08:16] c0x: has joined #ruby
[09:08:32] Es0teric: has joined #ruby
[09:09:06] krzkrzkrz: has joined #ruby
[09:09:46] c0x: Hello People!!
[09:09:51] wldcordeiro: has joined #ruby
[09:10:32] FooMunki: has joined #ruby
[09:11:01] araujo: has joined #ruby
[09:13:02] nerium: has joined #ruby
[09:14:41] mark2: has joined #ruby
[09:15:50] nobitanobi: has joined #ruby
[09:16:55] lipoqil: has joined #ruby
[09:17:19] vondruch: has joined #ruby
[09:17:34] sarlalia1: has joined #ruby
[09:18:25] sergey_makagon: has joined #ruby
[09:19:04] neanderslob_: has joined #ruby
[09:19:18] Xeago: has joined #ruby
[09:19:34] RegulationD: has joined #ruby
[09:19:47] mikhael_k33hl: has left #ruby: ("Leaving")
[09:20:39] eregi: has joined #ruby
[09:20:44] CloCkWeRX: has joined #ruby
[09:21:04] GBrawl: has joined #ruby
[09:21:09] malcolmva: has joined #ruby
[09:21:17] snowy: has joined #ruby
[09:23:32] BLuEGoD: has joined #ruby
[09:29:57] joonty: has joined #ruby
[09:30:51] aufi_: has joined #ruby
[09:31:23] skade: has joined #ruby
[09:31:37] sandstrom: has joined #ruby
[09:34:16] LoneHermit: has joined #ruby
[09:34:32] but3k4: has joined #ruby
[09:34:58] paatalaBhairavi: has joined #ruby
[09:35:54] Stan: has joined #ruby
[09:40:46] morfin: that thing with foo.each(&:bar) confusing me
[09:40:58] morfin: >> 10.to_proc
[09:40:59] ruby[bot]: morfin: # => undefined method `to_proc' for 10:Fixnum ...check link for more (https://eval.in/532491)
[09:41:24] Trioxin: has joined #ruby
[09:42:40] Trioxin: I'm new to ruby. I installed rbenv via my distro's package manager. should I be using rbenv as root when installing a ruby or from the my user context?
[09:43:00] troulouliou_div2: has joined #ruby
[09:43:42] Trioxin: none of the install tutorials mention this
[09:43:45] f4cl3y: has joined #ruby
[09:44:34] morfin: you can install for your user only
[09:45:00] mfaeh: has joined #ruby
[09:45:26] morfin: basically all ruby stuff located in ~/.rbenv
[09:45:28] sepp2k: has joined #ruby
[09:45:40] Trioxin: is it going to drop it into whatever directory im in?
[09:46:04] baweaver: has joined #ruby
[09:47:24] morfin: into /home/username/.rbenv
[09:47:41] Trioxin: hrm. it's showing the latest version it has is 2.2.0-preview1
[09:47:58] Trioxin: probably because I used apt-get?
[09:48:08] morfin: you can install rbenv not from apt-get
[09:50:11] aupadhye: has joined #ruby
[09:50:34] morfin: that gives some freedom - i think you can even run your projects in jail without problems(one project - one jail)
[09:51:04] djellemah: :downcase.to_proc.call("STRING")
[09:51:07] Moosashi: has joined #ruby
[09:51:37] M-shine: has joined #ruby
[09:51:40] glcx: has joined #ruby
[09:51:40] glcx: has joined #ruby
[09:52:05] djellemah: >> :downcase.to_proc.call("STRING") #morfin
[09:52:06] ruby[bot]: djellemah: # => "string" (https://eval.in/532499)
[09:54:20] djellemah: to_proc for Symbol does that ^. Doesn't do the same thing for Fixnum.
[09:54:26] morfin: oh i forgot &:foo means :foo.to_proc done
[09:54:48] morfin: but how that done in context of object?
[09:55:15] morfin: >> &:foo.to_proc
[09:55:16] ruby[bot]: morfin: # => /tmp/execpad-9a902b798b2d/source-9a902b798b2d:2: syntax error, unexpected & ...check link for more (https://eval.in/532502)
[09:55:46] morfin: i mean how &:foo expanded to someobject.foo with to_proc
[09:56:14] djellemah: >> def big_letters; yield "UPPERCASE STRING"; end; big_letters(&:downcase)
[09:56:15] ruby[bot]: djellemah: # => "uppercase string" (https://eval.in/532505)
[09:56:29] morfin: [1,4,6,2,7].each(&:float)
[09:56:32] morfin: >> [1,4,6,2,7].each(&:float)
[09:56:33] ruby[bot]: morfin: # => undefined method `float' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/532506)
[09:56:41] morfin: >> [1,4,6,2,7].each(&:to_float)
[09:56:42] ruby[bot]: morfin: # => undefined method `to_float' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/532507)
[09:56:50] lele: has joined #ruby
[09:56:59] morfin: >> [1,4,6,2,7].each(&:to_f)
[09:57:00] ruby[bot]: morfin: # => [1, 4, 6, 2, 7] (https://eval.in/532508)
[09:57:19] djellemah: each returns the original array. map does what you want there.
[09:57:25] morfin: >> [1,4,6,2,7].map(&:to_float)
[09:57:29] morfin: >> [1,4,6,2,7].map(&:to_f)
[09:57:38] ferr1: has joined #ruby
[09:57:55] uglybandersnatch: has joined #ruby
[09:58:59] morfin: >> [1,4,6,2,7].map(&:to_f)
[09:59:00] ruby[bot]: morfin: # => [1.0, 4.0, 6.0, 2.0, 7.0] (https://eval.in/532510)
[09:59:28] morfin: see it do something like {|value| value.to_f}
[09:59:46] M-Kodo: has joined #ruby
[10:00:20] djellemah: >> :to_f.to_proc.call(42)
[10:00:21] snowy: has joined #ruby
[10:00:21] ruby[bot]: djellemah: # => 42.0 (https://eval.in/532511)
[10:01:30] jhass: morfin: class Symbol; def to_proc; proc {|x| x.send(self) }; end; basically
[10:01:32] morfin: idk why but i remembered one discu7ssion in C++ channel about f(x) and x.f()
[10:02:05] morfin: and in Ruby somehow you called f(x) and it was like x.f()
[10:02:47] jhass: no, ruby doesn't support uniform call syntax (that's what it's called)
[10:02:54] pandaant: has joined #ruby
[10:03:46] igam: But instead of x.f(1,2) you can write (x.f 1,2)
[10:03:48] morfin: so it just creates proc sending message to x
[10:03:50] last_staff: has joined #ruby
[10:04:08] morfin: >> (10.to_f)
[10:04:09] ruby[bot]: morfin: # => 10.0 (https://eval.in/532513)
[10:04:13] jhass: igam: the outer parens are pretty meaningless there
[10:04:23] igam: Not to a lisper :-)
[10:04:26] jhass: just a grouping expression
[10:04:42] igam: Quite useful with paredit in emacs actually.
[10:04:55] krzkrzkrz: has joined #ruby
[10:04:58] morfin: you can want do something like (x.f 1,2).bar :foo
[10:05:15] jhass: ugh, that's ugly
[10:05:24] jhass: in that case just x.f(1, 2).bar :foo
[10:05:38] Es0teric: has joined #ruby
[10:06:24] igam: x.f(1, 2).bar :foo is harder to read. Now you have to know priority levels and to parse them.
[10:06:42] jhass: I disagree
[10:06:51] igam: with ((x.f 1,2).bar :foo) you don't have to think, the parentheses tell it all. Lisp is nice.
[10:06:56] jhass: there's no precedence rules needed there
[10:07:06] morfin: i heard in Lisp you count parentheses to be fine )
[10:07:07] jhass: then go write lisp instead of ruby
[10:07:25] igam: I wish, but because of you, ruby is installed everywhere instead of lisp.
[10:07:27] jhass: don't try to write ruby like it's lisp
[10:07:49] jhass: are you trying to troll? because that's not welcome here
[10:07:58] TomyLobo: has joined #ruby
[10:08:06] igam: Then modify the syntax of ruby. I can, so I will.
[10:10:28] marr: has joined #ruby
[10:10:52] sandstrom: has joined #ruby
[10:11:15] DaniG2k: has joined #ruby
[10:12:06] marr: has joined #ruby
[10:15:27] glcx: has joined #ruby
[10:15:27] glcx: has joined #ruby
[10:17:00] haxrbyte: has joined #ruby
[10:17:22] yardenbar: has joined #ruby
[10:18:13] lxsameer: has joined #ruby
[10:20:29] djellemah: pythonistas indent their 'end' lines, c++/java folks use {} for all blocks, lispers and ocamlers say (obj.method arg). Javascripters never leave out the () and ; brainfuckers use only symbols
[10:20:38] workmad3: has joined #ruby
[10:20:42] ext0: has joined #ruby
[10:22:14] M-mistake: has joined #ruby
[10:22:39] Guest34101: has joined #ruby
[10:23:15] yorickpeterse: x.f(1, 2).bar :foo is no harder to read than (x.f 1,2).bar :foo
[10:23:37] yorickpeterse: In fact, I'd argue the latter is harder to read as it relies on explicitly defined precedences
[10:23:42] yorickpeterse: whereas the former is just the natural way of writing it
[10:24:13] yorickpeterse: And people like jhass aren't the reason Ruby is installed everywhere. The reason is because Ruby actually works, is widely used and useful to many
[10:24:24] yorickpeterse: Meanwhile Lisp users continue to brag about how great it is, yet it's a fraction of the industry
[10:25:19] gregf_: lisp is quite unreadable imo, prolly a write once language
[10:25:25] gbgdev: has joined #ruby
[10:26:30] gbgdev: has joined #ruby
[10:28:12] jeanlinux: has joined #ruby
[10:28:50] sandstrom: has joined #ruby
[10:30:01] pawnbox: has joined #ruby
[10:32:29] n008f4g_: has joined #ruby
[10:33:58] moeabdol3: has joined #ruby
[10:34:26] djellemah: I find джэллемах quite hard to read. But there are lots of people who find it very easy.
[10:35:04] whiteline: has joined #ruby
[10:36:20] troulouliou_div2: has joined #ruby
[10:37:09] pawnbox: has joined #ruby
[10:37:35] Trioxin: should I be able to run script coded in 2.1..5 on 2.3.0?
[10:37:51] nw: has left #ruby: ("WeeChat 1.3")
[10:39:03] adaedra: You should, yes.
[10:39:14] eregi: has joined #ruby
[10:39:16] gnagh: has joined #ruby
[10:39:33] hahuang61: has joined #ruby
[10:41:03] mg^: has joined #ruby
[10:42:50] jeanlinux: has joined #ruby
[10:43:40] charlemagne: has joined #ruby
[10:45:23] crdpink2: has joined #ruby
[10:47:09] jenrzzz: has joined #ruby
[10:49:13] gnagh: ACTION 
[10:49:32] shredding: has joined #ruby
[10:52:56] wolfedale: has joined #ruby
[10:52:58] mfaeh: has joined #ruby
[10:53:11] krzkrzkrz: has joined #ruby
[10:53:38] wolfedale: Anyone is using gem: mail? (mikel)
[10:54:02] astrobun_: has joined #ruby
[10:56:09] Xeago: has joined #ruby
[10:56:28] rodfersou: has joined #ruby
[10:56:57] Ishido: has joined #ruby
[10:58:53] siaW: has joined #ruby
[10:58:59] DaniG2k: universa1: good call on checking out the SQL, thanks for that
[10:59:36] siaW: what would be a more elegant way to write this
[10:59:44] Xeago_: has joined #ruby
[10:59:46] siaW: i want to capitalize each word in the “msg” variable
[10:59:49] gnagh: has joined #ruby
[11:01:38] nicnilov: has joined #ruby
[11:02:29] drptbl: has joined #ruby
[11:03:13] adaedra: What do you have already?
[11:04:02] jhass: wolfedale: quite a lot of people do
[11:05:09] wolfedale: siaw: "msg".upcase (not sure if I understand your question).
[11:05:32] y2mq37: has joined #ruby
[11:05:43] wolfedale: jhass: it works great for me but just figure out BCC is not working at all. I'm not sure if I'm using it correctly.
[11:05:47] siaW: adaedra: forgot to post what i have already https://gist.github.com/siaw23/e21afcedb36e2e8c133b
[11:06:21] siaW: adaedra: no, not that
[11:06:33] siaW: adaedra: i don’t want to capitalize all letters in all words
[11:06:44] adaedra: Yeah, I saw it
[11:06:45] siaW: “hello world”
[11:06:46] siaW: should be
[11:06:51] siaW: “Hello World”
[11:06:55] siaW: and this
[11:07:02] siaW: “hello sweet america"
[11:07:02] charlemagne: has joined #ruby
[11:07:04] siaW: should be
[11:07:11] siaW: “Hello Sweet America”
[11:07:16] adaedra: >> "The quick brown fox jumps over the lazy dog".split.map(&:capitalize).join(" ") # But this one won't preserve extra spaces
[11:07:17] ruby[bot]: adaedra: # => "The Quick Brown Fox Jumps Over The Lazy Dog" (https://eval.in/532555)
[11:08:09] dangerousdave: has joined #ruby
[11:08:12] adaedra: >> "The quick brown fox jumps over the lazy dog".gsub(/($|\b)[a-z]/) { |a| a.upcase }
[11:08:13] ruby[bot]: adaedra: # => "The Quick Brown Fox Jumps Over The Lazy Dog" (https://eval.in/532558)
[11:09:02] siaW: that works for me
[11:09:04] siaW: adaedra: :)
[11:09:20] n008f4g_: has joined #ruby
[11:10:08] adaedra: You weren't so far away, though.
[11:10:31] siaW: i just thought i was over thinking
[11:10:38] Xeago: has joined #ruby
[11:10:50] adaedra: the $ has nothing to do here, though, in the regexp one
[11:11:14] adaedra: It's /\b[a-z]/
[11:11:38] siaW: i need to learn regex by heart anyway
[11:12:14] adaedra: the first one was rather close from your try at least, do you understand how it works?
[11:15:31] evidex: has joined #ruby
[11:16:56] Abrin_AWAY: has joined #ruby
[11:17:39] Aviio: has joined #ruby
[11:19:27] siaW: adaedra: yeap
[11:19:31] siaW: i do undestand :)
[11:19:40] charliesome: has joined #ruby
[11:20:31] chouhoulis: has joined #ruby
[11:20:34] mg^: has joined #ruby
[11:20:48] UtkarshRay: has joined #ruby
[11:26:51] ebbflowgo: has joined #ruby
[11:27:44] symm-: has joined #ruby
[11:30:06] ziprar: has joined #ruby
[11:31:21] but3k4: has joined #ruby
[11:31:38] c355E3B: has joined #ruby
[11:32:10] trosborn: has joined #ruby
[11:32:13] ldnunes: has joined #ruby
[11:33:05] mikar: has joined #ruby
[11:34:06] mikeiniowa: has joined #ruby
[11:34:42] but3k4: has joined #ruby
[11:35:08] mikar: has joined #ruby
[11:35:29] mondok: has joined #ruby
[11:35:33] wolfedale: According to this: https://github.com/mikel/mail/blob/6343e70be5ef5cc373f460933477fb1a6d751bf8/lib/mail/fields/bcc_field.rb
[11:35:45] wolfedale: mail.bcc should return address.
[11:35:53] wolfedale: And it's returning Nil in my case (all the time).
[11:36:02] charliesome: has joined #ruby
[11:36:11] wolfedale: I checked Mail.new and Mail.read(mail) and so on.
[11:36:14] trinaldi: has joined #ruby
[11:36:28] wolfedale: Any clue how to check bcc address from STDIN?
[11:36:31] mikar: is there some sort of shorthand that translates weeks/days/hours into seconds? i'd like a timeout in seconds and a variable input of something like "2:hours" or "3.5:minutes"
[11:36:42] openstruct: has joined #ruby
[11:38:05] crdpink2: has joined #ruby
[11:38:42] adaedra: I don't think there's something directly, but you could have something like `UNIT = { second: 1, minute: 60, hour: 3600 }` and `second_duration = duration * UNIT[unit]`
[11:41:10] sdothum: has joined #ruby
[11:42:05] djellemah: mikar: active_support/core_ext/numeric/time.rb has methods for that. Maybe one of the other time gems has something as well.
[11:43:05] f4cl3y: Hey guys, I know this is rather trivial question for most of you, but this my first project. I was wondering if there a "best practice" to handle configurations in Ruby?
[11:43:48] f4cl3y: And if anyone would recommend using Thor for CLI stuff?
[11:44:12] f4cl3y: http://whatisthor.com/
[11:44:41] adaedra: Use what suits you best
[11:44:49] mikar: adaedra, djellemah: thanks
[11:46:35] mostlybadfly: has joined #ruby
[11:46:37] jhass: f4cl3y: I believe configuration is highly specific to your project, target environment and userbase and thus there's no universal best solution possible
[11:47:09] baweaver: has joined #ruby
[11:47:41] f4cl3y: jhass: Thank you!
[11:50:41] ebbflowgo: has joined #ruby
[11:51:22] callen92: has joined #ruby
[11:51:53] blackms: has joined #ruby
[11:53:54] lxsameer: has joined #ruby
[11:55:04] Xeago: has joined #ruby
[11:56:08] UtkarshRay: has joined #ruby
[11:57:19] moeabdol3: has joined #ruby
[11:59:55] Takumo: Hi all, how do I set the background fill color for a page in PrawnPDF?
[12:01:24] jeanlinux: has joined #ruby
[12:02:53] johnmilton: has joined #ruby
[12:03:46] Slice^: has joined #ruby
[12:05:36] pawnbox_: has joined #ruby
[12:06:25] dgncn: has joined #ruby
[12:07:45] DmitryBochkarev: has joined #ruby
[12:08:25] charlemagne: has joined #ruby
[12:09:28] skade: has joined #ruby
[12:10:10] chocoelho: has joined #ruby
[12:10:28] evidex: has joined #ruby
[12:10:41] sandstrom: has joined #ruby
[12:10:42] Shaboum: has joined #ruby
[12:12:55] dgncn: has joined #ruby
[12:13:11] sgambino: has joined #ruby
[12:15:22] pawnbox: has joined #ruby
[12:15:46] electriv: has joined #ruby
[12:16:03] niksrc: has joined #ruby
[12:16:36] wolfedale: hmm, how to execute something like this from ruby?
[12:16:43] wolfedale: /usr/sbin/sendmail -G -i "$@" < @mail
[12:16:55] wolfedale: Where only @mail is a ruby object.
[12:17:12] pawnbox: has joined #ruby
[12:17:25] duckpuppy: has joined #ruby
[12:19:32] p1k: has joined #ruby
[12:20:22] Macaveli: has joined #ruby
[12:20:24] charlemagne: has joined #ruby
[12:20:35] p1k: is there a ruby sort equivalen to python's e.g. key = lambda a: a[0] ? I see that sort takes a block but that seems like a full fledged compare
[12:20:53] Hanmac: p1k checkout sort_by
[12:21:18] p1k: thanks that's exactly what I was looking for
[12:21:45] chouhoulis: has joined #ruby
[12:23:04] helpa: has joined #ruby
[12:25:29] jeanlinux: has joined #ruby
[12:25:38] moos3: has joined #ruby
[12:26:01] shevy: wolfedale I don't know what is $@ but you can do everything with system() `` or popen*
[12:27:19] eregi: has joined #ruby
[12:28:42] chridal: The Resque poll timer is set to every 5 seconds but this slows down our workers by a lot
[12:28:55] chridal: Would there be a drawback to setting this to for instance 0.1s?
[12:29:37] troulouliou_div2: has joined #ruby
[12:30:04] jhass: wolfedale: hint: Kernel#system takes the same argument forms as documented on Kernel#spawn
[12:30:32] cyclonis: has joined #ruby
[12:31:45] Domaldel: has joined #ruby
[12:32:38] n008f4g_: has joined #ruby
[12:32:49] diegoviola: has joined #ruby
[12:32:57] aryaching: has joined #ruby
[12:32:59] GBrawl: has joined #ruby
[12:33:23] bronson: has joined #ruby
[12:35:15] snowy: has joined #ruby
[12:36:23] wolfedale: jhass: I'm trying but still not sure how to do it :(
[12:37:38] trinaldi: has joined #ruby
[12:38:36] charlemagne: has joined #ruby
[12:38:46] jeanlinux: has joined #ruby
[12:38:57] but3k4: has joined #ruby
[12:40:17] hahuang61: has joined #ruby
[12:45:57] jhass: well, what did you try so far?
[12:47:37] tvon: has joined #ruby
[12:49:29] charlema_: has joined #ruby
[12:56:07] joonty: has joined #ruby
[12:56:11] jottr: has joined #ruby
[12:57:47] RegulationD: has joined #ruby
[13:03:08] aufi_: has joined #ruby
[13:03:49] rickmasta: has joined #ruby
[13:04:46] mfaeh: has joined #ruby
[13:05:18] moeabdol3: has joined #ruby
[13:06:40] gbgdev: has joined #ruby
[13:08:14] synthroid: has joined #ruby
[13:12:14] jottr: has joined #ruby
[13:13:49] UtkarshRay: has joined #ruby
[13:18:15] fexilal: has joined #ruby
[13:22:45] chouhoulis: has joined #ruby
[13:23:58] Ishido: has joined #ruby
[13:27:17] solars: has joined #ruby
[13:34:47] leventix: has joined #ruby
[13:35:11] Ropeney: has joined #ruby
[13:36:32] hxegon: has joined #ruby
[13:36:35] Spami: has joined #ruby
[13:40:17] Xeago: has joined #ruby
[13:41:15] tungd: has joined #ruby
[13:42:44] kam270: has joined #ruby
[13:44:48] zotherstupidguy: has joined #ruby
[13:48:07] haxrbyte: has joined #ruby
[13:48:21] haylon: has joined #ruby
[13:48:29] haxrbyte: has joined #ruby
[13:48:50] leventix_: has joined #ruby
[13:48:53] malconis: has joined #ruby
[13:49:15] baweaver: has joined #ruby
[13:49:16] leventix_: has left #ruby: ()
[13:49:39] malconis: has joined #ruby
[13:53:23] vishwa: has joined #ruby
[13:53:58] howdoi: has joined #ruby
[13:54:26] ramortegui: has joined #ruby
[13:54:39] freerobby: has joined #ruby
[13:54:58] leventix_: has joined #ruby
[13:55:51] dstarh: has joined #ruby
[13:56:24] nennes: has joined #ruby
[13:56:53] hs366: has joined #ruby
[13:57:29] shevy: has joined #ruby
[13:58:20] bluOxigen_: has joined #ruby
[13:59:10] snowy: has joined #ruby
[14:01:49] canton7: has joined #ruby
[14:03:14] Trioxin: has left #ruby: ("Konversation terminated!")
[14:04:41] last_staff: has joined #ruby
[14:06:25] vikas027: has joined #ruby
[14:06:43] vikas027: has left #ruby: ()
[14:07:12] joonty: has joined #ruby
[14:08:23] nando293921: has joined #ruby
[14:08:54] jyaworski: has joined #ruby
[14:12:01] Macaveli: has joined #ruby
[14:13:57] drptbl: has joined #ruby
[14:14:23] Ishido: has joined #ruby
[14:14:35] dima_: has joined #ruby
[14:15:20] UtkarshRay: has joined #ruby
[14:15:27] eregi: has joined #ruby
[14:16:14] trinaldi: has joined #ruby
[14:16:43] CustosLimen: has joined #ruby
[14:19:33] shevy: has joined #ruby
[14:21:09] bmalum: has joined #ruby
[14:21:25] nando293921: has joined #ruby
[14:22:11] hxegon: has joined #ruby
[14:23:30] chouhoulis: has joined #ruby
[14:24:20] unl0ckd: has joined #ruby
[14:24:59] nobitanobi: has joined #ruby
[14:25:52] Jardayn: has joined #ruby
[14:26:17] Xeago: has joined #ruby
[14:28:35] kristofferR: has joined #ruby
[14:28:36] danjack: has joined #ruby
[14:29:12] dfinninger: has joined #ruby
[14:29:39] danjack: if i parse [a,b,c] from yaml to ruby, it will give me an array of strings [:a, :b, :c], is there a way to define a one line yaml array of symbols?
[14:30:06] Prominent: has joined #ruby
[14:30:30] Xeago_: has joined #ruby
[14:30:32] r4z3r: has joined #ruby
[14:30:35] n008f4g_: has joined #ruby
[14:30:49] justbleed: has joined #ruby
[14:32:30] Xeago: has joined #ruby
[14:33:03] r4z3r: has joined #ruby
[14:33:19] freerobby: has joined #ruby
[14:35:45] Xeago: has joined #ruby
[14:38:20] aegis3121: has joined #ruby
[14:38:33] shanemcd: has joined #ruby
[14:38:48] mary5030: has joined #ruby
[14:39:51] sandstrom: has joined #ruby
[14:41:02] hahuang61: has joined #ruby
[14:42:22] Guest34101: has joined #ruby
[14:43:27] jhass: your example is an array of symbols, but anyway, yaml doesn't know symbols
[14:44:23] shevy: danjack you should be able to store symbols in yaml e. g. via "- !ruby/symbol a" for :a or rather an array with :a
[14:45:05] jhass: ah right, that weird stuff
[14:45:24] jhass: note it's incompatible with other yaml parsers than psych
[14:45:34] jhass: I wouldn't recommend to rely on it
[14:47:14] leventix_: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[14:47:33] chouhoulis: has joined #ruby
[14:48:00] zapata: has joined #ruby
[14:48:14] jhass: mmh interesting
[14:48:23] jhass: >> require "yaml"; YAML.dump [:a]
[14:48:24] ruby[bot]: jhass: # => "---\n- :a\n" (https://eval.in/532711)
[14:48:39] jhass: would've thought it dumps it as - a
[14:49:17] cdg: has joined #ruby
[14:49:40] Hanmac: 18>> require "yaml"; YAML.dump [:a]
[14:49:41] ruby[bot]: hanmac: # => "--- \n- :a\n" (https://eval.in/532712)
[14:49:49] krobzaur: has joined #ruby
[14:49:54] idefine: has joined #ruby
[14:50:12] Yiota: has joined #ruby
[14:50:29] jhass: also nice asymmetry here
[14:50:42] jhass: >> require "yaml"; YAML.load YAML.dump :a
[14:50:43] ruby[bot]: jhass: # => :a (https://eval.in/532713)
[14:50:56] jhass: er nvm I' dumb
[14:53:22] JiKa: has joined #ruby
[14:53:24] svankmajer: has joined #ruby
[14:54:47] emilkarl: has joined #ruby
[14:57:00] floatingpoint: has joined #ruby
[14:57:26] Slice^: has joined #ruby
[14:58:38] HalcyonicStorm: has joined #ruby
[14:59:02] snowy: has joined #ruby
[14:59:20] RegulationD: has joined #ruby
[15:00:34] solars: has joined #ruby
[15:01:10] babblebre: has joined #ruby
[15:01:30] gbgdev: has joined #ruby
[15:01:50] Rodya_: has joined #ruby
[15:02:06] cpup: has joined #ruby
[15:02:19] griffindy: has joined #ruby
[15:03:13] uglybandersnatch: has joined #ruby
[15:03:31] Slice^: has joined #ruby
[15:04:01] danjack: somehow the ruby yaml implementation can store an array of symbols in multiple lines, but i was not able to store it in one line
[15:04:40] danjack: makes me sad, but ill just let ruby convert some specific paths in the from yaml converted ruby objects with map(&:to_sym)
[15:05:26] gnagh: has joined #ruby
[15:05:36] jhass: feels like you try to keep user data as symbols
[15:05:38] Tricon: has joined #ruby
[15:05:42] jhass: which is a smell in itself
[15:06:08] stannard: has joined #ruby
[15:10:31] Anderson69s_Deb: has joined #ruby
[15:11:45] danjack: im just trying to figure out how to make the yaml config file simple
[15:12:20] shevy: danjack why must it be on one line?
[15:12:36] danjack: having it specify as symbols is probably a bad idea indeed
[15:12:43] danjack: shevy: its easier to read in one line
[15:12:58] danjack: format: [nick, ip, id, geoip]
[15:13:11] shevy: these are not symbols!
[15:13:15] danjack: ill just map it with ruby to symbols and then use them internally
[15:13:17] x77686d: has joined #ruby
[15:13:17] chouhoulis: has joined #ruby
[15:14:16] Infra-Red: has joined #ruby
[15:14:34] Infra-Red: has joined #ruby
[15:15:54] jhass: why do you need symbols?
[15:16:07] decoponio: has joined #ruby
[15:16:50] cyclonis: has joined #ruby
[15:18:16] danjack: because my ruby code uses symbols internally
[15:18:42] jhass: that's not a good reason ;)
[15:18:49] nofacade: has joined #ruby
[15:18:52] danjack: yeah i know, ill just map it to symbols in my own code
[15:19:12] jhass: that is what I consider the smell ;)
[15:19:12] danjack: i just got curious if it is possible to save it as symbols in a one liner yaml definition
[15:19:16] Slice^: has joined #ruby
[15:20:58] Xeago: has joined #ruby
[15:21:00] B1n4r10: has joined #ruby
[15:23:04] n008f4g_: has joined #ruby
[15:24:20] sdothum: has joined #ruby
[15:25:19] Hammy_Work: has joined #ruby
[15:29:05] bry4n: has joined #ruby
[15:29:08] jhack: has joined #ruby
[15:31:52] jyaworski_: has joined #ruby
[15:32:17] pawnbox: has joined #ruby
[15:33:15] tricon_: has joined #ruby
[15:33:31] pawnbox: has joined #ruby
[15:33:44] rkazak: has joined #ruby
[15:34:54] JiKa: has joined #ruby
[15:35:31] Renich: has joined #ruby
[15:36:02] mallu: has joined #ruby
[15:36:35] shevy: I guess in principle you could extend yaml to allow for that
[15:37:02] shevy: ruby code would strike me as even shorter than the yaml though, if you only have one-word things to store %i( a b c ) # => [:a, :b, :c]
[15:38:10] configged: has joined #ruby
[15:38:15] configged-: has joined #ruby
[15:39:00] sandstrom: has joined #ruby
[15:39:11] The_Phoenix: has joined #ruby
[15:40:07] Tricon: has joined #ruby
[15:40:50] aufi: has joined #ruby
[15:44:08] gbgdev: has joined #ruby
[15:48:44] openstruct: has joined #ruby
[15:49:58] baweaver: has joined #ruby
[15:54:16] solars: has joined #ruby
[15:56:23] evidex: has joined #ruby
[15:57:56] eregi: has joined #ruby
[15:58:44] glcx: has joined #ruby
[16:00:31] Rodya_: has joined #ruby
[16:02:24] jhack: has joined #ruby
[16:02:24] prefix: has joined #ruby
[16:02:53] Rubie: has joined #ruby
[16:02:53] Rodya_: has joined #ruby
[16:04:09] marxarelli: has joined #ruby
[16:05:37] Rubie: hi all: i have a scale that goes from -50 to 50 but i need to fit that inside a range of 0-255 (rgb colors), so when my scale is -50 i get 0 and when the scale is 50 i would get 250, any ideas how to solve this?
[16:05:42] jyaworski_: has joined #ruby
[16:05:52] jhass: with math
[16:07:03] Rubie: is there any particular kind of math that would work best?
[16:07:24] ljarvis: multiplication and divisionz
[16:08:30] trinaldi_: has joined #ruby
[16:08:47] gregf_: -50 to 50 is 100 , so divide 255 by 100?
[16:08:59] gregf_: s/255/256/
[16:09:03] igam: rubie: depends also on how you want to map your range. Linearly? Quadratically? Exponentially? etc
[16:10:52] aufi: has joined #ruby
[16:11:06] jhass: >> (-50..50).map {|n| [n, (n + 50) * 2.55).round] }.to_h
[16:11:08] ruby[bot]: jhass: # => /tmp/execpad-ad8853dbc784/source-ad8853dbc784:2: syntax error, unexpected ')', expecting ']' ...check link for more (https://eval.in/532777)
[16:11:19] jhass: >> (-50..50).map {|n| [n, ((n + 50) * 2.55).round] }.to_h
[16:11:20] ruby[bot]: jhass: # => {-50=>0, -49=>3, -48=>5, -47=>8, -46=>10, -45=>13, -44=>15, -43=>18, -42=>20, -41=>23, -40=>26, -39= ...check link for more (https://eval.in/532778)
[16:13:41] dfinninger: has joined #ruby
[16:14:52] aegis3121: has joined #ruby
[16:16:29] Hanmac: jhass: your solution is mathematical! xD
[16:18:09] igam: Notice that for colors, using a linear scale is often not the right thing to do…
[16:18:19] Rubie: igam: what do you mean?
[16:18:45] boontdustie: has joined #ruby
[16:19:14] igam: I mean that the transformation must depend on where the [-50,+50] comes from.
[16:19:16] shinnya: has joined #ruby
[16:19:34] stunder: has joined #ruby
[16:21:45] jhack: has joined #ruby
[16:21:46] amargherio: has joined #ruby
[16:22:31] tomchapin: has joined #ruby
[16:22:47] xaxisx: has joined #ruby
[16:24:40] B1n4r10: has joined #ruby
[16:24:54] barajasfab: has joined #ruby
[16:26:01] decoponio: has joined #ruby
[16:26:02] svankmajer: has joined #ruby
[16:26:40] Macaveli: has joined #ruby
[16:27:22] Macaveli: has joined #ruby
[16:28:29] djbkd: has joined #ruby
[16:29:05] paul98_: has joined #ruby
[16:30:17] dantevergil: has joined #ruby
[16:31:38] ElSif: has joined #ruby
[16:31:43] Infra-Red: has joined #ruby
[16:33:21] cyclonis: has joined #ruby
[16:33:21] Infra-Red: has joined #ruby
[16:34:42] momomomomo: has joined #ruby
[16:34:51] binaryplease1: has joined #ruby
[16:34:57] al2o3-cr: has joined #ruby
[16:35:05] pandaant: has joined #ruby
[16:35:24] bronson: has joined #ruby
[16:37:56] aeontech: has joined #ruby
[16:38:08] elifoster: has joined #ruby
[16:39:50] Xeago: has joined #ruby
[16:41:46] hahuang61: has joined #ruby
[16:42:42] jaruga: has joined #ruby
[16:44:43] Xeago_: has joined #ruby
[16:45:50] siaW: has joined #ruby
[16:49:14] shanemcd: has joined #ruby
[16:50:37] skade: has joined #ruby
[16:53:42] bmalum: has joined #ruby
[16:54:10] ixti: has joined #ruby
[16:54:15] darkf: has joined #ruby
[16:56:48] roshanavand: has joined #ruby
[16:59:54] codecop: has joined #ruby
[17:01:34] momomomomo: has joined #ruby
[17:03:00] amclain: has joined #ruby
[17:03:49] Xeago: has joined #ruby
[17:04:15] mfaeh: has joined #ruby
[17:05:36] Don_John: has joined #ruby
[17:05:48] binaryplease1: has joined #ruby
[17:06:12] binaryplease: has joined #ruby
[17:07:24] f4cl3y: has joined #ruby
[17:07:47] vipaca: has joined #ruby
[17:08:58] edwinvdgraaf: has joined #ruby
[17:10:37] Macaveli_: has joined #ruby
[17:11:15] synthroid: has joined #ruby
[17:11:46] eregi: has joined #ruby
[17:11:50] shanemcd_: has joined #ruby
[17:12:10] pushcx: the cubehelix color scheme is a good way to do gradients: https://www.mrao.cam.ac.uk/~dag/CUBEHELIX/
[17:12:27] edwinvdgraaf: has joined #ruby
[17:12:50] pushcx: humans are more sensitive to green than red and especially blue, so if you just linearly ramp over all three your colors will not be accurately understood
[17:12:50] terminalrecluse: has joined #ruby
[17:13:00] roshanavand: has joined #ruby
[17:13:44] Guest38: has joined #ruby
[17:13:56] sandstrom: has joined #ruby
[17:14:50] greenhat: has joined #ruby
[17:15:26] SCHAAP137: has joined #ruby
[17:19:21] jaruga: has joined #ruby
[17:19:31] Maletor: has joined #ruby
[17:20:25] atmosx: has joined #ruby
[17:20:33] TomyLobo: has joined #ruby
[17:20:52] baweaver: has joined #ruby
[17:21:52] connor_goodwolf: has joined #ruby
[17:22:07] ivanskie: has joined #ruby
[17:22:22] poguez_: has joined #ruby
[17:23:26] JohnBat26: has joined #ruby
[17:24:04] neanderslob_: has joined #ruby
[17:25:53] ixti: has joined #ruby
[17:26:57] st0mar: has joined #ruby
[17:31:27] roshanavand: has joined #ruby
[17:32:44] symm-: has joined #ruby
[17:34:31] cyclonis: has joined #ruby
[17:36:06] kfpratt: has joined #ruby
[17:36:18] skade: has joined #ruby
[17:38:28] shevy: I use marque + pink
[17:39:05] sneakerhax: has joined #ruby
[17:39:50] roshanavand: has joined #ruby
[17:40:47] st0mar: has joined #ruby
[17:41:14] bob_f: Hi, is there a nice Ruby idiom for setting a default argument on a method and catching whether the value is the default, or a value passed in by the caller ?
[17:41:31] bob_f: I need to differentiate between `nil` and `no value` so `nil` is not an appropriate sentinel value.
[17:41:49] kriskropd: has joined #ruby
[17:41:49] bob_f: I have just done `class Sentinel; end; def foo(arg = Sentinel)` but wondering if there is a cleaner way.
[17:42:33] Lucky_ABA: has joined #ruby
[17:42:37] boontdustie: has joined #ruby
[17:42:41] erts: has joined #ruby
[17:43:17] AnoHito: has joined #ruby
[17:44:03] dangerousdave: has joined #ruby
[17:45:09] erts: has joined #ruby
[17:45:54] shevy: bob_f nothing in built
[17:46:02] jhass: bob_f: IME the real issue is that you need to differentiate it, it hints that your API is either too complex or not well designed
[17:46:32] Mon_Ouie: has joined #ruby
[17:46:34] hahuang61: has joined #ruby
[17:46:35] kfpratt: has joined #ruby
[17:46:50] bob_f: jhass: In this case, I pass the argument to hash.fetch(foo, default) so if I use `default = nil` then I never know if the value was absent.
[17:47:23] jhass: wrong, you can just .has_key?(foo)
[17:47:36] bob_f: Sure, but then that's two (admittedly fast) lookups. It's not very clean.
[17:47:37] jhass: but that you need to know is still a smell IMO
[17:47:55] bob_f: Fixing one smell with another isn't much of a solution. ;)
[17:48:25] shevy: I smell flowers in the air
[17:48:40] jhass: what would be the other smell? I mean how is not needing to know whether it was the default or not a smell?
[17:49:40] cyclonis: has joined #ruby
[17:49:51] asmodlol: has joined #ruby
[17:49:51] bob_f: jhass: I'm saying that I need to pass a caller-provided argument as the default to hash.fetch and then act accordingly if the result is not found in the hash. You're saying that this is a smell (I believe).
[17:50:16] bob_f: Using .has_key? is not a good solution - if the implementation changes to (e.g.) a database lookup, then I have two slow calls when I only need one.
[17:50:36] jhass: having a default and needing to know whether it's in use is a smell IMO
[17:50:51] RegulationD: has joined #ruby
[17:50:51] niksrc: has joined #ruby
[17:51:06] jhass: at best it hints a bad or incomplete default
[17:51:11] bob_f: So I'm wondering if there is a nicer way to do hash.fetch with a default argument, but still know whether the result is the [user-supplied] default (which could be `nil`) or that the result was not found.
[17:51:28] jhass: I'm questioning that you need to know
[17:52:14] treehug88: has joined #ruby
[17:52:25] allcentury: has joined #ruby
[17:52:26] bob_f: Because if the value is not found, then it means there is a configuration problem and an appropriate error/warning must be raised.
[17:52:51] bob_f: The caller can pass a default if it wants to, but it doesn't have to.
[17:53:41] jackjackdripper: has joined #ruby
[17:54:12] jhass: you probably should just disallow nil as a user provided default or something, I still don't have enough context to get specific
[17:54:29] shevy: ban all the nils!
[17:54:31] dstarh: has joined #ruby
[17:54:32] jhass: or require a default to be provided
[17:55:03] shevy: default to nil!
[17:55:54] bob_f: jhass: Here's a distilled version of the problem: https://bpaste.net/show/6869e3c20df9
[17:56:36] bob_f: And here's a less stupid version ... https://bpaste.net/show/7ae79f640e60
[17:56:38] bob_f: (Long day).
[17:56:52] jhass: I gathered as much, that's not adding any context
[17:57:19] jhass: anyway, one option is to mirror Hash#fetch with a block's API
[17:57:41] bob_f: Well, `nil` is a valid value to be given as a default. There's no getting around that.
[17:57:47] jhass: that has the advantage that the caller can lazily provide an expensive to compute default and gives you block_given?
[17:59:11] hayden_: bob_f: you can create a class for that purpose, that's what rails core does in one if it's fetch methods (https://github.com/rails/rails/blob/e7feaff70f13b56a0507e9f4dfaf3ebc361cb8e6/actionpack/lib/action_dispatch/request/session.rb#L133-L140)
[17:59:33] KensoDev: has joined #ruby
[17:59:37] hayden_: not a class, an object
[17:59:50] bob_f: FWIW, here's the legit code: https://bpaste.net/show/0800bff26093
[17:59:56] bob_f: hayden_: Ah, that's what I did.
[17:59:58] jhass: def fetch_config_value(key); value = config[key]; if value.nil?; if block_given?; value = yield; else; raise ConfigError; end
[18:00:08] bronson: has joined #ruby
[18:00:20] jhass: that's still stupid as nil can't be a valid configuration value there but a valid default
[18:00:30] bob_f: https://bpaste.net/show/2f85b6868fd7
[18:00:44] jhass: has_key? is the only actual way to know whether the value existed
[18:00:48] bob_f: jhass: I'm not sure I understand what you mean ?
[18:01:00] Macaveli: has joined #ruby
[18:01:05] firstdayonthejob: has joined #ruby
[18:01:09] bob_f: And I don't know if that's true - calling Hash#fetch with no default raises KeyError, so you also know that way.
[18:01:19] bob_f: And you guarantee one lookup.
[18:01:27] jhass: well, or def fetch_config_value(key); config.fetch(key) { block_given? ? yield : raise ConfigError }
[18:01:28] DynamicMetaFlow: has joined #ruby
[18:01:52] bob_f: I'm not obsessed with an O(1) lookup, but the flow just smells bad, and I prefer a bespoke sentinel approach to that.
[18:02:45] idefine: has joined #ruby
[18:02:45] bob_f: jhass: Sorry, if you don't mind, could you elaborate on "that's still stupid as nil ..." ?
[18:02:50] bob_f: I didn't understand what you meant.
[18:03:03] jhass: ignore it, take the last version I showed
[18:03:36] bob_f: Ah, I thought you were referring to my code.
[18:03:42] jhass: provide the default via a block, a tiny bit more verbose but gives you a single lookup and lazy default computation for the caller
[18:04:33] Infra-Red: has joined #ruby
[18:04:42] bob_f: Yeah, it's certainly cleaner, in the implementation, but I gotta say I find the block requirement a bit crufty and un-Rubyish.
[18:04:57] gizmore: has joined #ruby
[18:05:10] jhass: &ri Hash#fetch
[18:05:10] `derpy: http://ruby-doc.org/core-2.3.0/Hash.html#method-i-fetch
[18:05:14] bob_f: I'd expect to be able to pass both an absolute value as well as a block. Seems a bit mean to pass the cruft on to the caller instead of hiding it in one place. :)
[18:05:21] jhass: it's a pattern used in core
[18:05:33] bob_f: Sure, but it's common to accept both absolute and block, in my experience.
[18:06:02] jhass: then you have to use has_key? to get to a sane implementation
[18:06:06] aeontech: has joined #ruby
[18:06:16] bob_f: I guess I'll just stick with what I have, in that case.
[18:06:32] bob_f: Don't want to ruin someone's day if they decide to move the config to a web service.
[18:06:42] jhass: I find it very ugly, but just my opinion I guess
[18:06:42] idefine_: has joined #ruby
[18:06:46] bob_f: Thanks for the help regardless.
[18:07:06] zast: has joined #ruby
[18:07:12] bob_f: Yeah, me too, was hoping there'd be some Rubytastic version. The `fetch` call with a block is likely something I'll use at some point though so thanks for the tip.
[18:10:09] peaches: has joined #ruby
[18:10:43] idefine: has joined #ruby
[18:11:11] Es0teric: has joined #ruby
[18:11:28] arthurix_: has joined #ruby
[18:12:21] jackjackdripper: has joined #ruby
[18:12:43] B1n4r10: has joined #ruby
[18:13:04] Infra-Red: has joined #ruby
[18:13:20] Guest34101: has joined #ruby
[18:15:50] yokel: has joined #ruby
[18:16:22] roshanavand: has joined #ruby
[18:16:51] ArtursL: has joined #ruby
[18:17:18] naftilos76: has joined #ruby
[18:17:40] boontdustie: has joined #ruby
[18:17:56] wldcordeiro: has joined #ruby
[18:18:42] st0mar: has joined #ruby
[18:19:06] sergey_makagon: has joined #ruby
[18:19:40] shanemcd_: has joined #ruby
[18:20:33] tvw: has joined #ruby
[18:22:04] cyclonis: has joined #ruby
[18:22:12] jhack: has joined #ruby
[18:24:29] pawnbox: has joined #ruby
[18:26:02] arlek: has joined #ruby
[18:27:14] gizmore: 'evening'; %w can i store a block that remembers class_eval somehow?
[18:28:31] jhass: you can store a block that class evals another block
[18:28:59] gizmore: so the class_eval inside that block would work
[18:29:06] gizmore: redundancy... but a way
[18:29:19] sp4rrow: has joined #ruby
[18:31:28] apeiros: you can also just store the block
[18:31:39] apeiros: gizmore: and class_eval that at any time
[18:35:13] solars: has joined #ruby
[18:35:40] gizmore: apeiros: greetings... what i would need: class_eval(klass_name) do |klass| now i am inside klass / klass_name
[18:36:06] jmarinelli: has joined #ruby
[18:36:13] apeiros: um, class_eval is klass.class_eval do … end
[18:36:26] Rubie: has joined #ruby
[18:36:31] apeiros: see Object.const_get and Module#class_eval
[18:37:05] kgirthofer: has joined #ruby
[18:37:22] yuung: i'm trying to use VCR in my rails app, and in the method i'm trying to test, i use Hash#transform_keys which is a Rails method. it seems that when i test with VCR, this method isn't added. how can i amend this?
[18:37:35] julieeharshaw: has joined #ruby
[18:39:39] siaW: has joined #ruby
[18:39:41] edwinvdg_: has joined #ruby
[18:40:26] kaleido: yuung: #rubyonrails
[18:40:31] kaleido: they will have better answers
[18:40:40] gizmore: apeiros: nvm... just was just a bug / typo :) ignore
[18:41:44] skade: has joined #ruby
[18:43:56] uxp: has joined #ruby
[18:44:05] zast: has joined #ruby
[18:44:42] Rubie: has joined #ruby
[18:44:45] kies: has joined #ruby
[18:46:39] Wicaeed: has joined #ruby
[18:47:58] shevy: I am all in favour of .klass_eval
[18:48:03] shevy: strong german words!
[18:48:05] [Butch]: has joined #ruby
[18:49:01] al2o3-cr: has joined #ruby
[18:49:24] chipotle: has joined #ruby
[18:49:29] robbyoconnor: has joined #ruby
[18:50:33] spider-mario: has joined #ruby
[18:50:40] sp4rrow: has joined #ruby
[18:51:22] baweaver: has joined #ruby
[18:51:49] shanemcd_: has joined #ruby
[18:51:50] cb: has joined #ruby
[18:52:17] intrigueD: has joined #ruby
[18:52:52] Canar: deutsch ist verboten
[18:52:59] idefine: has joined #ruby
[18:53:03] cb: Hi there, I am new to ruby and looking for an scheduler which i can manage from my Rails-Application. So that a User could change the Timings of certain Tasks. Any recommendations?
[18:54:50] eregi: has joined #ruby
[18:55:07] momomomomo: has joined #ruby
[18:56:06] Xiti: has joined #ruby
[18:56:25] yqt: has joined #ruby
[19:00:19] dravine: has joined #ruby
[19:00:41] aeontech: has joined #ruby
[19:01:36] cwenner: has joined #ruby
[19:02:40] wilbert: has joined #ruby
[19:05:56] edwinvdgraaf: has joined #ruby
[19:08:04] Es0teric: has joined #ruby
[19:08:06] Abrin_AWAY: has joined #ruby
[19:08:23] dopie: has joined #ruby
[19:08:27] roshanavand: has joined #ruby
[19:10:19] ldnunes: has joined #ruby
[19:10:19] ramfjord: has joined #ruby
[19:10:23] aeontech: has joined #ruby
[19:10:28] nando294021: has joined #ruby
[19:10:47] shadoi: has joined #ruby
[19:11:59] fostertheweb: has joined #ruby
[19:12:02] shanemcd_: has joined #ruby
[19:12:02] snowy: has joined #ruby
[19:13:43] neanderslob_: has joined #ruby
[19:15:31] Infra-Red: has joined #ruby
[19:15:52] x77686d: has joined #ruby
[19:16:55] aegis3121: has joined #ruby
[19:17:29] vdamewood: has joined #ruby
[19:17:37] st0mar: has joined #ruby
[19:17:46] idefine: has joined #ruby
[19:18:09] thevaliantx: has joined #ruby
[19:19:57] B1n4r10: has joined #ruby
[19:21:22] al2o3-cr: has joined #ruby
[19:21:36] cyclonis: has joined #ruby
[19:22:15] jgpawletko: has joined #ruby
[19:24:03] mdw: has joined #ruby
[19:25:42] trosborn: has joined #ruby
[19:25:54] TomyLobo: has joined #ruby
[19:26:27] mdw7: has joined #ruby
[19:28:24] idefine_: has joined #ruby
[19:29:00] theery: has joined #ruby
[19:29:33] tAn: has joined #ruby
[19:30:04] Infra-Red: has joined #ruby
[19:30:06] momomomomo: has joined #ruby
[19:30:10] devbug: has joined #ruby
[19:32:16] idefine: has joined #ruby
[19:32:34] kgirthofer: hey all - new to developing ruby gems, I'm updating an old gem to start and I'd like to update some of the deps in Gemfile.lock - how do I update them? seems everytime I run bundler it overwrites
[19:32:55] jottr: has joined #ruby
[19:35:10] dcunit3d: has joined #ruby
[19:35:45] jenrzzz: has joined #ruby
[19:36:17] n008f4g_: has joined #ruby
[19:37:50] idefine_: has joined #ruby
[19:39:16] djbkd: has joined #ruby
[19:40:13] BtcBen: has joined #ruby
[19:40:43] mondok: has joined #ruby
[19:41:04] mallu: has joined #ruby
[19:41:21] gizmore: woho :) uncaught throw #<ActiveRecord::Magic::MissingDependency: ActiveRecord::Magic::Spec::User depends on {:"ActiveRecord::Magic::Gender"=>1}>
[19:41:44] gizmore: now i simply can annotate update steps and depend on them :)
[19:41:56] gizmore: stupid rails migrations are too bloated
[19:42:02] baweaver: has joined #ruby
[19:43:09] gizmore: ActiveRecord::Magic also features a global object cache... where each row is always the same instance
[19:43:40] gizmore: and it´s my first spec driven development project
[19:44:29] medicate: has joined #ruby
[19:44:56] gizmore: helper classes for code reload at runtime. a logfile system that closes rarely used logfiles after a few minutes, and some more stuff i will depend my new ruby chatbot on \o/
[19:45:37] gizmore: and a new proof that p == np
[19:47:07] jottr_: has joined #ruby
[19:47:08] shanemcd_: has joined #ruby
[19:47:54] idefine: has joined #ruby
[19:48:20] openstruct: has joined #ruby
[19:49:10] xpt: there is a proof that p == np already?
[19:49:23] xpt: Someone else took mine 1 million dollars?
[19:49:33] cwenner: /ignore gizmore
[19:49:59] mary5030: has joined #ruby
[19:51:03] gizmore: xpt: http://cxg.de/_a0a77a.htm (p = np) ... and sorry for my bloat :)
[19:53:36] faelkle: has joined #ruby
[19:54:13] dopie: has joined #ruby
[19:54:19] kfpratt: has joined #ruby
[19:56:25] shadoi: has joined #ruby
[19:57:03] SuperDave: has joined #ruby
[19:57:43] casadei: has joined #ruby
[19:58:58] roshanavand: has joined #ruby
[19:59:43] SuperDave: commands not working, or big lag?
[20:04:26] dcunit3d: has joined #ruby
[20:04:58] shanemcd: has joined #ruby
[20:05:42] roshanavand: has joined #ruby
[20:06:40] rht: has joined #ruby
[20:06:42] lemur: has joined #ruby
[20:07:16] baweaver_: has joined #ruby
[20:07:38] trosborn: has joined #ruby
[20:08:33] apeiros: kgirthofer: you update the version spec in the Gemfile and then run "bundle update"
[20:08:49] apeiros: that will update all gems to the newest version still satisfying the spec
[20:09:08] apeiros: SuperDave: those aren't commands here. what makes you think they were? wrong channel?
[20:10:00] SuperDave: oh i'm not on the channel i thought i was
[20:10:20] binaryplease: has joined #ruby
[20:10:28] jottr_: has joined #ruby
[20:11:45] rickmasta: has joined #ruby
[20:11:46] zeroDivisible: has joined #ruby
[20:11:48] trosborn: has joined #ruby
[20:13:25] SuperDave: has left #ruby: ()
[20:13:42] tvsutton: has joined #ruby
[20:14:36] rmulligan: has joined #ruby
[20:14:41] A124: has joined #ruby
[20:16:59] rmulligan: has joined #ruby
[20:20:49] futilegames: has joined #ruby
[20:20:51] trosborn: has joined #ruby
[20:21:55] B3rg3lm1r: has joined #ruby
[20:22:25] Coldblackice: has joined #ruby
[20:22:51] rickmasta: has joined #ruby
[20:23:01] codecop: has joined #ruby
[20:23:04] codecop_: has joined #ruby
[20:24:07] ivanskie_work: has joined #ruby
[20:24:09] pawnbox: has joined #ruby
[20:24:54] kirun: has joined #ruby
[20:25:13] nullwarp: has joined #ruby
[20:25:32] eurialo: has joined #ruby
[20:25:58] rattatmatt: has joined #ruby
[20:26:21] pawnbox: has joined #ruby
[20:27:09] mdw: has joined #ruby
[20:27:16] uglybandersnatch: has joined #ruby
[20:27:17] neohunter: has joined #ruby
[20:27:55] Cohedrin: has joined #ruby
[20:28:33] safe: has joined #ruby
[20:28:46] fostertheweb: has joined #ruby
[20:28:48] faelkle: has joined #ruby
[20:29:37] xpt: gizmore: np (or should I say p?)
[20:32:40] vishwa: has joined #ruby
[20:32:45] pawnbox: has joined #ruby
[20:32:51] moos3: has joined #ruby
[20:33:45] sandstrom: has joined #ruby
[20:33:46] mdw: has joined #ruby
[20:34:01] shanemcd: has joined #ruby
[20:37:19] shadoi: has joined #ruby
[20:38:02] shanemcd: has joined #ruby
[20:39:56] aegis3121: has joined #ruby
[20:41:13] st0mar: has joined #ruby
[20:41:42] glcx: has joined #ruby
[20:41:49] FernandoBasso: has joined #ruby
[20:43:06] rickmasta: has joined #ruby
[20:43:54] d0nn1e: has joined #ruby
[20:44:50] gizmore: http://cxg.de/_32e44b.htm (cache spec test)
[20:45:11] julieeharshaw: has joined #ruby
[20:45:49] intrigueD: has joined #ruby
[20:45:49] intrigueD: has joined #ruby
[20:46:06] uglybandersnatch: has joined #ruby
[20:47:04] Infra-Red: has joined #ruby
[20:47:46] x77686d: has joined #ruby
[20:51:10] jackjackdripper1: has joined #ruby
[20:51:44] ixti: has joined #ruby
[20:51:51] rodferso1: has joined #ruby
[20:52:30] momomomomo: has joined #ruby
[20:53:35] casadei: has joined #ruby
[20:54:46] jenrzzz: has joined #ruby
[20:54:53] binaryplease1: has joined #ruby
[20:55:49] lightheaded: has joined #ruby
[20:57:39] Infra-Red: has joined #ruby
[20:59:17] ramfjord: has joined #ruby
[20:59:21] freerobby: has joined #ruby
[20:59:32] dcunit3d: has joined #ruby
[21:00:07] moos3: has joined #ruby
[21:02:06] KnownSyntax: has joined #ruby
[21:02:08] KnownSyntax: has joined #ruby
[21:04:43] Infra-Red: has joined #ruby
[21:05:36] shanemcd: has joined #ruby
[21:07:31] bronson: has joined #ruby
[21:08:07] roger_rabbit: has joined #ruby
[21:10:11] skade: has joined #ruby
[21:13:28] glcx_: has joined #ruby
[21:15:11] DylanJ: has joined #ruby
[21:15:56] shanemcd: has joined #ruby
[21:16:43] moos3: has joined #ruby
[21:17:07] SCHAAP137: has joined #ruby
[21:17:43] moos3: has joined #ruby
[21:18:42] eregi_: has joined #ruby
[21:19:03] jackjackdripper: has joined #ruby
[21:19:15] shanemcd: has joined #ruby
[21:19:23] shanemcd_: has joined #ruby
[21:20:05] momomomomo: has joined #ruby
[21:25:16] bronson: has joined #ruby
[21:26:11] steffkes: has joined #ruby
[21:26:45] glcx: has joined #ruby
[21:27:45] mondok: has joined #ruby
[21:28:48] gbgdev: has joined #ruby
[21:30:25] BSaboia: has joined #ruby
[21:31:42] trosborn: has joined #ruby
[21:32:54] BtcBen: has joined #ruby
[21:34:27] ivanskie_work_: has joined #ruby
[21:37:44] n008f4g_: has joined #ruby
[21:40:51] moos3: has joined #ruby
[21:42:18] shlomocomputer: has joined #ruby
[21:42:46] idefine_: has joined #ruby
[21:42:57] shlomocomputer: Hi. Why, when I run ruby -pe '$_ + "Hello"', does Ruby never append Hello to the lines I pipe in?
[21:43:14] vishwa: has joined #ruby
[21:43:20] hangelo: has joined #ruby
[21:43:29] A124: has joined #ruby
[21:45:10] zack6849: has joined #ruby
[21:45:10] zack6849: has joined #ruby
[21:46:29] futilegames: has joined #ruby
[21:46:32] shadoi: has joined #ruby
[21:47:00] gizmore: http://railsbin.wechall.net/pastes/8 (my first spec \o/)
[21:48:36] pwnd_nsfw: Grats gizmore !
[21:48:55] gizmore: thanks ... it feels so much more sane to do test driven
[21:49:15] gizmore: the arm_cache is quite slim in v4
[21:49:33] cyclonis: has joined #ruby
[21:50:25] gizmore: http://railsbin.wechall.net/pastes/9 (monkey patch activerecord to make use of a cache filter)
[21:50:29] uglybandersnatch: has joined #ruby
[21:51:59] gizmore: i bet it wont work nicely with memcached or whatnot... but it guarantees fancy unique/same records/object_id across your whole app
[21:52:16] bluOxigen: has joined #ruby
[21:52:32] gizmore: its not for rails... but could be used there
[21:54:37] julieeharshaw: has joined #ruby
[21:56:04] crankharder: has joined #ruby
[21:56:15] replay: has joined #ruby
[21:57:10] zapata: has joined #ruby
[21:59:17] aeontech: has joined #ruby
[22:00:31] djbkd: has joined #ruby
[22:01:59] moeabdol4: has joined #ruby
[22:02:13] shanemcd: has joined #ruby
[22:04:16] araujo: has joined #ruby
[22:05:25] quazimodo: has joined #ruby
[22:07:38] sp4rrow: has joined #ruby
[22:08:43] theRealAlexz: has joined #ruby
[22:11:53] adaedra: wohoo, first communication between a C++ program and mruby
[22:12:59] Moosashi: has joined #ruby
[22:15:11] vishwa: has joined #ruby
[22:16:39] mistermocha: has joined #ruby
[22:21:12] trinaldi: has joined #ruby
[22:21:56] elifoster: has joined #ruby
[22:22:22] Twitty: has joined #ruby
[22:24:19] tonyynot: has joined #ruby
[22:26:07] shanemcd: has joined #ruby
[22:29:34] chipotle: has joined #ruby
[22:29:50] swills: has joined #ruby
[22:31:26] yuung: has joined #ruby
[22:31:57] yuung: i'd like to test a method that returns an object in its `rescue` clause. how can i do this with rspec?
[22:32:53] Cohedrin: yuung if you return the object in the rescue clause of the method
[22:33:13] Cohedrin: it will return it from the object, just like it would if you normally returned it
[22:33:25] aegis3121: Make sure you raise the error that will be rescued at some point.
[22:33:28] Cohedrin: return it from the method*
[22:33:52] yuung: Cohedrin, aegis3121, yeah - i want to know how i can raise this exception in a test?
[22:34:04] Cohedrin: depends on your exception
[22:34:08] Cohedrin: what are you trying to raise
[22:34:15] yuung: Cohedrin OpenURI::HTTPError
[22:34:31] aegis3121: yuung I assume you're calling some method that raises that error, yes?
[22:34:39] yuung: aegis3121 yep
[22:34:49] SaintAardvark: has joined #ruby
[22:35:19] aegis3121: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/raise-error-matcher
[22:35:35] Cohedrin: as far as I know theres no way to have rspec raise an error without raising it in your code
[22:35:38] aegis3121: except using `allow` syntax vs `expect`
[22:35:54] Cohedrin: normally you would cause the method to raise the error by passing invalid params, etc
[22:35:55] aegis3121: allow(Receiver).to receive(:message).and_raise(SomeError)
[22:36:03] Cohedrin: but since you're trying to raise an http method
[22:36:13] Cohedrin: you can use webmock, https://github.com/bblimke/webmock
[22:36:15] aegis3121: I lied about the matcher, sorry. I didn't realize until I wrote out the syntax.
[22:36:18] SaintAardvark: Hi all -- I've got a Rakefile that does some jsonlinting on files, and I want that task to be run when I run "rake test". Is there a way to do this?
[22:36:22] Cohedrin: and stub that request to return an erorr
[22:36:34] SaintAardvark: so far the docs I've seen have been focused on running spec tests, which isn't what I'm after here
[22:36:38] aegis3121: (or just stub whatever method it is to raise)
[22:37:32] yuung: aegis3121, Cohedrin, hm - so i don't think i'll really be able to simulate the way i'd like. but i'll take what you said into consideration. thanks!
[22:37:44] idefine: has joined #ruby
[22:37:57] yuung: SaintAardvark, http://stackoverflow.com/questions/15707940/rake-before-task-hook might help
[22:38:24] x77686d: has joined #ruby
[22:38:46] SaintAardvark: yuung: thanks, looking now
[22:39:06] st1gma: has joined #ruby
[22:39:30] kriskropd: has joined #ruby
[22:39:47] volty: has joined #ruby
[22:40:34] mostlybadfly: has joined #ruby
[22:40:41] idefine: has joined #ruby
[22:40:53] idefine: has joined #ruby
[22:42:17] Ox0dea: SaintAardvark: Rake is a dependency resolution system; you should be able to just declare your lint task as a dependency of your test task.
[22:42:26] Ox0dea: It's not entirely clear why you'd do that, mind.
[22:42:38] SaintAardvark: 0x0dea: thanks
[22:42:43] zenlot: has joined #ruby
[22:42:47] rattatmatt: has joined #ruby
[22:43:01] SaintAardvark: in this case, I'm using Rake to automate some tasks as a way of learning Rake/Ruby
[22:43:35] SaintAardvark: the larger purpose is to make some updates based on json files, and I want to lint those files before attempting to make changes
[22:43:58] SaintAardvark: it seems test-ish, so I'm going with that for now :)
[22:44:13] htmldrum: has joined #ruby
[22:44:27] SaintAardvark: the problem I'm running into is that if I name the task 'jsonlint' and run it, it picks up errors -- quickly barfs on a bad json file
[22:44:51] SaintAardvark: whereas if I name the task 'test', it does no such thing -- exit code 0, seems to be saying everything's fine
[22:46:11] SaintAardvark: Rakefile is here: https://gist.github.com/saintaardvark/b010958b4c347345aeca
[22:47:30] SaintAardvark: shell output is here: https://gist.github.com/saintaardvark/bb720eb96ea48462e68f
[22:48:13] htmldrum: has joined #ruby
[22:48:14] idefine: has joined #ruby
[22:48:28] Ox0dea: It's probably the case that your test task isn't actually the one being invoked there.
[22:49:59] SaintAardvark: 0x0dea: not sure I understand - are you saying that there's another test task somewhere that's being included somehow?
[22:50:52] cyclonis: has joined #ruby
[22:50:56] Ox0dea: SaintAardvark: Well, given that you've defined your :test and :jsonlint tasks identically, that they don't behave identically is certainly suspicious.
[22:51:26] SaintAardvark: yeah, couldn't figure that out...was wondering if 'test' was a special keyword for Rakefiles or some such
[22:51:36] iooner: has joined #ruby
[22:51:46] Ox0dea: It's not; it's just a convention, but those can bite you too.
[22:52:12] SaintAardvark: ACTION just noticed that the nick is Ox0dea, not the other way around
[22:52:37] Ox0dea: Leading digits aren't permitted here. :(
[22:53:10] idefine: has joined #ruby
[22:53:11] robbyoconnor: has joined #ruby
[22:53:16] SaintAardvark: ok, managed to get around this by adding "task test: ['jsonlint']" to the Rakefile...that now invokes jsonlint, which barfs on a bad file
[22:54:17] Ox0dea: Aye, that's what I suggested from the first. :P
[22:55:55] skade: has joined #ruby
[22:56:06] nb_bez___: has joined #ruby
[22:56:56] aeontech: has joined #ruby
[22:57:42] SaintAardvark: I need to pay more attention :-)
[22:58:23] tAn: has joined #ruby
[23:00:15] Ox0dea: Can't speak as to why jsonlint is barfing other than to suggest you're probably feeding it some not-JSON.
[23:01:26] cyclonis: has joined #ruby
[23:01:27] cdg: has joined #ruby
[23:01:48] snockerton: has joined #ruby
[23:02:32] cdg_: has joined #ruby
[23:03:09] SaintAardvark: ah, that was because I'd deliberately borked one of the json files in order to make sure I was catching errors
[23:05:47] shanemcd: has joined #ruby
[23:07:53] gizmore: http://railsbin.wechall.net/pastes/10 :)
[23:07:54] n1colas: has joined #ruby
[23:17:56] shanemcd: has joined #ruby
[23:18:50] stunder: has joined #ruby
[23:20:48] fostertheweb: has joined #ruby
[23:21:06] hahuang61: has joined #ruby
[23:22:07] alphaatom: has joined #ruby
[23:22:41] charliesome: has joined #ruby
[23:24:14] aeon_: has joined #ruby
[23:24:37] DarthGandalf: has joined #ruby
[23:24:41] GBrawl: has joined #ruby
[23:24:55] alphaatom: has joined #ruby
[23:25:08] Moosashi: has joined #ruby
[23:26:27] stunder: has joined #ruby
[23:27:28] crystal77: has joined #ruby
[23:31:27] [Butch]: has joined #ruby
[23:32:02] sp4rrow: has joined #ruby
[23:33:20] ramfjord_: has joined #ruby
[23:36:20] trosborn: has joined #ruby
[23:41:28] toretore: has joined #ruby
[23:42:39] alphaatom: has joined #ruby
[23:46:56] al2o3-cr: has joined #ruby
[23:47:50] swills: has joined #ruby
[23:48:09] gbgdev: has joined #ruby
[23:49:33] tAn: has joined #ruby
[23:49:39] sp4rrow: has joined #ruby
[23:52:02] uglybandersnatch: has joined #ruby
[23:53:19] ramfjord: has joined #ruby
[23:54:11] nfk|laptop: has joined #ruby
[23:56:55] gregf: has joined #ruby
[23:59:08] yuung: SaintAardvark, http://stackoverflow.com/questions/15707940/rake-before-task-hook might help
[23:59:20] yuung: accident, my bad.
[23:59:32] cdg: has joined #ruby