« Back to channel list

#ruby - 14 August 2015

« Back 1 day Forward 1 day »
[00:01:19] blue_deref: has joined #ruby
[00:02:48] user1138: has joined #ruby
[00:03:13] lannonbr: has joined #ruby
[00:05:15] Rubie: has joined #ruby
[00:06:51] northfurr: has joined #ruby
[00:07:38] paulcsmith: has joined #ruby
[00:07:47] frozen3: has joined #ruby
[00:07:54] Me: has joined #ruby
[00:08:00] blueOxigen: has joined #ruby
[00:09:11] baweaver: has joined #ruby
[00:09:52] djbkd: has joined #ruby
[00:11:20] juanpablo__: has joined #ruby
[00:14:42] bruno-: has joined #ruby
[00:16:08] renderful: has joined #ruby
[00:17:29] atomical: has joined #ruby
[00:22:29] Vile`: has joined #ruby
[00:24:12] baweaver: has joined #ruby
[00:26:04] casadei_: has joined #ruby
[00:29:14] rickmasta: has joined #ruby
[00:29:25] bodie__: has joined #ruby
[00:29:35] _seanc_: has joined #ruby
[00:29:45] workmad3: has joined #ruby
[00:30:26] baweaver: pontiki - I'll let you know what I find out on it.
[00:30:34] Oog: has joined #ruby
[00:30:46] baweaver: would pm, but you have that turned off.
[00:31:30] dr3w: has joined #ruby
[00:33:29] keen____: has joined #ruby
[00:34:25] jpfuentes2: has joined #ruby
[00:34:54] dopamean_: has joined #ruby
[00:35:30] rehat: has joined #ruby
[00:35:45] hays: hey im trying to use http://www.rubydoc.info/gems/rmodbus/ModBus/TCPClient such that i can have mutiple threads access the connection, but still have the connection itself gracefully fail and try to re-establish. i've no idea how to actually do this.. can someone point me in the right direction
[00:36:04] Oog: has joined #ruby
[00:37:12] Oog: has joined #ruby
[00:37:44] Oog: has joined #ruby
[00:38:10] dr3w: has joined #ruby
[00:38:47] jobewan: has joined #ruby
[00:39:16] hays: right now if the connection fails it raises an exception
[00:40:13] hays: so you can write a do loop that catches the connection and re-establishes
[00:40:41] drbrain: hays: to start, you have mutual exclusion around access to the connection, right?
[00:41:14] drbrain: but for your original question, you'll need to add an accessor that rescues the failure, re-establishes the connection, then retries
[00:41:22] drbrain: ruby has syntax for that part:
[00:41:50] drbrain: begin; try_to_send_a_thing; rescue ConnectionFailure; re_establish_connection; retry; end
[00:42:00] drbrain: you'll want a counter around retries
[00:42:02] hays: drbrain: yeah i think ive figured out the semaphore part
[00:42:22] Musashi007: has joined #ruby
[00:42:31] timanema: has joined #ruby
[00:42:31] lucyinthesky: has joined #ruby
[00:42:39] hays: so the accessor will be what catches the exception ok
[00:43:41] drbrain: yeah, s/accessor/method that accesses the socket
[00:44:04] hays: is "cl" the socket
[00:44:13] lucyinthesky: has left #ruby: ("Leaving")
[00:44:26] hays: in the example code
[00:44:44] hays: TCPClient.connect('127.0.0.1', 502) do |cl|
[00:44:55] _seanc_: has joined #ruby
[00:44:58] s2013: has joined #ruby
[00:45:19] hays: so that socket is a private member basically
[00:45:21] drbrain: I suppose they use it as short for "client" in this example
[00:46:04] drbrain: you can usually operate without the block as well
[00:46:06] hays: and i control access by whenever i access it, wrap it in a mutex and catch the exceptions to reattempt connection
[00:46:08] drbrain: but I didn't read the source
[00:46:24] hays: cool. makes sense. i will try that
[00:50:26] lwu: has joined #ruby
[00:50:32] RegulationD: has joined #ruby
[00:51:18] ivanf: has joined #ruby
[00:53:02] Oog_: has joined #ruby
[00:53:57] speakingcode: has joined #ruby
[00:54:14] howdoico1: has joined #ruby
[00:55:41] Zamyatin: has joined #ruby
[00:56:04] cgrieger^away: has joined #ruby
[00:57:10] psayian: has joined #ruby
[00:57:19] foureight84: has joined #ruby
[00:57:37] michaeldeol: has joined #ruby
[00:57:50] psayian: Anyone have any books the recommend for a beginner learning ruby.
[00:59:29] Feyn: has joined #ruby
[00:59:53] lannonbr: has joined #ruby
[00:59:54] Pupeno: has joined #ruby
[01:00:20] saddad: has joined #ruby
[01:00:33] hays: psayian: shrug i've kinda discovered that books aren't really ruby's thing
[01:00:52] hays: there's the programming ruby book that is online
[01:00:53] psayian: hays: How do you suggestgoing about it, I am a book person. I prefer them over videos
[01:01:12] psayian: hays: Do you have a link for that? I heard eloquent ruby was good.
[01:01:25] atomical: has joined #ruby
[01:01:27] hays: http://ruby-doc.com/docs/ProgrammingRuby/
[01:01:44] Pupeno_: has joined #ruby
[01:02:22] Chau: has joined #ruby
[01:03:32] sdwrage: has joined #ruby
[01:03:45] hays: there is this weird chestnut http://mislav.uniqpath.com/poignant-guide/book/chapter-1.html
[01:05:21] Pupeno: has joined #ruby
[01:05:22] coban2k: has joined #ruby
[01:06:21] banister: has joined #ruby
[01:07:08] Pupeno: has joined #ruby
[01:08:03] Scripore: has joined #ruby
[01:08:07] Rubie: has joined #ruby
[01:08:18] blarghlarghl: has joined #ruby
[01:08:58] rubie_: has joined #ruby
[01:09:10] nettoweb: has joined #ruby
[01:09:31] blarghlarghl: Hi all. I got a question about rake and tests. I have a heroku app and a scheduled heroku task, 'rake refresh'. My rakefile also includes "RSpec::Core::RakeTask.new(:spec)", with the require 'rspec/core/rake_task' as well. However running this Rakefile dies in production since the require dies - since rspec is not in the production Gemfile group.
[01:09:45] blarghlarghl: So, how do I write my Rakefile so that it doesn't choke on the require?
[01:09:47] Rubie: has joined #ruby
[01:10:35] Rubie: has joined #ruby
[01:10:58] mary5030: has joined #ruby
[01:11:25] Rubie: has joined #ruby
[01:11:58] nofxx: blarghlarghl, guess you'll need some sort of env var to check... `if ENV['production']`
[01:12:05] juanpablo__: has joined #ruby
[01:12:13] pragmatism: has joined #ruby
[01:12:14] Rubie: has joined #ruby
[01:12:58] nofxx: any idea what kinda of voodoo these strings might be encoded if? https://gist.github.com/nofxx/1da8cd45c2fbcb62c194
[01:13:04] Rubie: has joined #ruby
[01:13:07] blarghlarghl: nofxx: So there's no way to create a rake test task using the task :spec do syntax?
[01:13:25] blarghlarghl: nofxx: Then I could put the require in the task :spec block, and be done ith it
[01:13:54] Rubie: has joined #ruby
[01:14:15] dr3w: has joined #ruby
[01:14:43] Rubie: has joined #ruby
[01:15:33] Rubie: has joined #ruby
[01:15:46] hays: im surprised that 1/3 in ruby evaluates to 0
[01:16:06] hays: and not some infinite precistion 1/3 thing
[01:16:21] Rubie: has joined #ruby
[01:16:29] hays: yeah that feels so C
[01:17:08] Ox0dea: hays: Why is that bad?
[01:17:11] Rubie: has joined #ruby
[01:17:15] Ox0dea: >> require 'mathn'; 1 / 3 # hays
[01:17:16] Mon_Ouie: 1/3r evaluates to what you want
[01:17:17] ruboto: Ox0dea # => (1/3) (https://eval.in/416516)
[01:17:32] pdoherty: has joined #ruby
[01:17:36] frozen3: has joined #ruby
[01:17:57] Ox0dea: nofxx: Do you promise that these mysterious strings are not of your making?
[01:18:00] Rubie: has joined #ruby
[01:18:01] tkuchiki: has joined #ruby
[01:18:10] framling: has joined #ruby
[01:18:31] hays: Ox0dea: not really bad, its a language wart im well used to
[01:18:42] Ox0dea: Why do you consider it a wart, though?
[01:18:50] Rubie: has joined #ruby
[01:18:52] pyon: has joined #ruby
[01:18:58] hays: it requires awareness of integers vs. floats
[01:19:40] rubie_: has joined #ruby
[01:19:48] Pupeno: has joined #ruby
[01:19:51] hays: and its a lot of implicit casting to just get a fraction. but i get it. no real clean solution without swallowing the infinite precision baby whole
[01:20:08] Ox0dea: What casting?
[01:20:11] hays: im really just surprised. not in a bad way at all
[01:20:29] Rubie: has joined #ruby
[01:21:15] hays: well ruby's version of casting anyway
[01:21:18] swgillespie: has joined #ruby
[01:21:19] rubie_: has joined #ruby
[01:21:37] Ox0dea: Ruby provides as complete a numerical tower as any other language; you're bickering about syntax without realizing it, I think.
[01:22:07] Rubie: has joined #ruby
[01:22:13] northfurr: has joined #ruby
[01:22:22] hays: im really just surprised
[01:22:56] Rubie: has joined #ruby
[01:23:46] Rubie: has joined #ruby
[01:23:46] bustrarm: has joined #ruby
[01:23:49] Ox0dea: In any case, here's something I think Ruby really does get wrong:
[01:23:50] Ox0dea: >> 'xaxbx'.split('x')
[01:23:51] ruboto: Ox0dea # => ["", "a", "b"] (https://eval.in/416519)
[01:24:16] Ox0dea: Why keep the initial empty string, but not the last?
[01:24:18] seggy: has joined #ruby
[01:24:36] Rubie: has joined #ruby
[01:24:38] hal_9000_: has joined #ruby
[01:24:48] Ox0dea: >> "a \n b".split(' ') # also "wrong"
[01:24:49] ruboto: Ox0dea # => ["a", "b"] (https://eval.in/416520)
[01:24:55] shmilan: has joined #ruby
[01:24:56] hays: >>'axbx'.split('x')
[01:24:57] ruboto: hays # => ["a", "b"] (https://eval.in/416521)
[01:25:14] bstrarm: has joined #ruby
[01:25:17] Pupeno: has joined #ruby
[01:25:24] Rubie: has joined #ruby
[01:25:27] hays: >>'axbxx'.split('x')
[01:25:28] ruboto: hays # => ["a", "b"] (https://eval.in/416522)
[01:25:41] Ox0dea: Wow, this language a shit.
[01:25:44] hays: it seems to chomp it
[01:25:57] gwendall: has joined #ruby
[01:26:14] Rubie: has joined #ruby
[01:26:51] duderonomy: has joined #ruby
[01:27:02] gambl0re: has joined #ruby
[01:27:03] Rubie: has joined #ruby
[01:27:05] northfurr: has joined #ruby
[01:27:13] Pupeno_: has joined #ruby
[01:27:52] Rubie: has joined #ruby
[01:28:33] bstrrm: has joined #ruby
[01:28:42] Rubie: has joined #ruby
[01:29:32] rubie_: has joined #ruby
[01:30:03] hays: >>"xaxbx.split('x',-1)
[01:30:04] beefcakeba: has joined #ruby
[01:30:04] ruboto: hays # => /tmp/execpad-8732af49fe3b/source-8732af49fe3b:6:in `raise': exception object expected (TypeError) ...check link for more (https://eval.in/416523)
[01:30:11] hays: >>"xaxbx".split('x',-1)
[01:30:12] ruboto: hays # => ["", "a", "b", ""] (https://eval.in/416524)
[01:30:21] Rubie: has joined #ruby
[01:30:45] Pupeno: has joined #ruby
[01:31:10] Rubie: has joined #ruby
[01:31:59] Rubie: has joined #ruby
[01:32:30] Pupeno: has joined #ruby
[01:32:49] tmtwd: has joined #ruby
[01:32:49] Rubie: has joined #ruby
[01:32:58] babyarm: has joined #ruby
[01:33:46] rubie_: has joined #ruby
[01:34:13] NeverDie: has joined #ruby
[01:34:25] tubulife-: has joined #ruby
[01:34:29] Rubie: has joined #ruby
[01:34:44] godzillaenlacasa: has joined #ruby
[01:35:19] rubie_: has joined #ruby
[01:35:34] shevy: you are back
[01:35:38] Ox0dea: I'm back!
[01:35:57] busterarm: has joined #ruby
[01:36:08] Rubie: has joined #ruby
[01:36:11] surfs^: has joined #ruby
[01:36:15] s2013: has joined #ruby
[01:36:57] Rubie: has joined #ruby
[01:37:21] blarghlarghl: has left #ruby: ()
[01:37:46] Rubie: has joined #ruby
[01:37:55] radgeRayden_: has joined #ruby
[01:38:21] Yzguy: has joined #ruby
[01:38:36] bustrarm: has joined #ruby
[01:38:36] Rubie: has joined #ruby
[01:39:25] Rubie: has joined #ruby
[01:40:16] Rubie: has joined #ruby
[01:41:07] rubie_: has joined #ruby
[01:41:24] shmilan: has joined #ruby
[01:41:54] Rubie: has joined #ruby
[01:42:15] bstrarm: has joined #ruby
[01:42:31] chipotle: has joined #ruby
[01:42:44] Rubie: has joined #ruby
[01:43:27] Pupeno: has joined #ruby
[01:43:34] Rubie: has joined #ruby
[01:44:24] rubie_: has joined #ruby
[01:45:08] Scripore: has joined #ruby
[01:45:12] Rubie: has joined #ruby
[01:45:19] phutchins: has joined #ruby
[01:45:28] Ox0dea: shevy: Did you see this craziness? https://github.com/ruby/ruby/commit/d311b7
[01:45:35] rickmasta: has joined #ruby
[01:46:00] zenspider: has joined #ruby
[01:46:01] Rubie: has joined #ruby
[01:46:27] phutchins1: has joined #ruby
[01:46:51] Rubie: has joined #ruby
[01:47:41] Rubie: has joined #ruby
[01:48:35] Rubie: has joined #ruby
[01:48:57] mleung: has joined #ruby
[01:49:00] ivanskie: has joined #ruby
[01:49:08] miah: interesting
[01:49:20] Rubie: has joined #ruby
[01:50:10] Rubie: has joined #ruby
[01:50:23] Cache_Money: has joined #ruby
[01:50:38] Ox0dea: has joined #ruby
[01:50:41] Pupeno: has joined #ruby
[01:50:47] basmoura: has joined #ruby
[01:50:59] Rubie: has joined #ruby
[01:51:09] busterarm: has joined #ruby
[01:51:48] rubie_: has joined #ruby
[01:52:27] Pupeno: has joined #ruby
[01:52:36] Rubie: has joined #ruby
[01:53:26] Rubie: has joined #ruby
[01:54:06] jtdowney: has joined #ruby
[01:54:12] TheNet: has joined #ruby
[01:54:14] Rubie: has joined #ruby
[01:54:28] carlosoliveira: has joined #ruby
[01:55:04] Rubie: has joined #ruby
[01:55:55] rubie_: has joined #ruby
[01:55:59] Pupeno_: has joined #ruby
[01:56:44] Rubie: has joined #ruby
[01:56:59] neruda: has joined #ruby
[01:57:28] neruda: hi, any rails gurus that can help with strong_parameters issue would be greatly appreciated: https://gist.github.com/anonymous/6b2211c4fbc1830fa472
[01:57:33] Rubie: has joined #ruby
[01:58:23] rubie_: has joined #ruby
[01:58:54] bruno-: has joined #ruby
[01:58:55] avahey: has joined #ruby
[01:59:13] Rubie: has joined #ruby
[02:00:03] Rubie: has joined #ruby
[02:00:35] shevy: Ox0dea I don't quite understand this
[02:00:41] Ox0dea: shevy: No, nor I.
[02:00:51] Rubie: has joined #ruby
[02:01:27] Ox0dea: ~ $ cat wtf.rb && ruby wtf.rb
[02:01:29] Ox0dea: class C D E end
[02:01:31] Ox0dea: wtf.rb:1:in `<class:C>': uninitialized constant C::E (NameError)
[02:01:31] shevy: I don't think I have even found all new things in ruby 2.2.2p95 yet
[02:01:33] Ox0dea: What even?
[02:01:41] Rubie: has joined #ruby
[02:02:09] Ox0dea: I suppose nobu had ample reason to mark it EXPERIMENTAL.
[02:02:17] Ox0dea: Still, I'm not even sure what he's really going for.
[02:02:30] Rubie: has joined #ruby
[02:02:31] shevy: probably something strange
[02:02:43] shevy: the japanese dudes can use the dark side of the brain
[02:02:48] Ox0dea: What does "optional superclass" even mean, though?
[02:03:10] shevy: perhaps it may or may not have one
[02:03:19] Rubie: has joined #ruby
[02:03:22] shevy: sometimes it has one
[02:03:24] shevy: sometimes it don't
[02:03:27] shevy: and you never know beforehand!
[02:03:40] jhack: has joined #ruby
[02:03:46] jhack: has joined #ruby
[02:03:56] VeganGreg: has left #ruby: ("WeeChat 1.2")
[02:04:08] Rubie: has joined #ruby
[02:04:58] Rubie: has joined #ruby
[02:05:29] rakm: has joined #ruby
[02:05:47] Rubie: has joined #ruby
[02:06:34] rbennacer: has joined #ruby
[02:06:36] Rubie: has joined #ruby
[02:06:59] Pupeno: has joined #ruby
[02:07:26] Rubie: has joined #ruby
[02:07:54] Ropeney: has joined #ruby
[02:08:15] Rubie: has joined #ruby
[02:09:05] Rubie: has joined #ruby
[02:09:55] rubie_: has joined #ruby
[02:10:44] Rubie: has joined #ruby
[02:11:34] Rubie: has joined #ruby
[02:11:34] Mon_Ouie: I I think he's just make the semicolon optional, class C something end becomes the same as class C; something; end
[02:12:22] Rubie: has joined #ruby
[02:12:46] sevenseacat: has joined #ruby
[02:12:59] Oog: has joined #ruby
[02:13:12] Rubie: has joined #ruby
[02:14:03] Rubie: has joined #ruby
[02:14:09] ivanskie: has joined #ruby
[02:14:52] Rubie: has joined #ruby
[02:15:11] Ox0dea: Mon_Ouie: What do you suppose is the rationale?
[02:15:27] Ox0dea: Why not also do it for `module` and `def`, for instance?
[02:15:42] Rubie: has joined #ruby
[02:16:31] Rubie: has joined #ruby
[02:16:51] iamninja: has joined #ruby
[02:17:21] Rubie: has joined #ruby
[02:17:48] Pupeno: has joined #ruby
[02:17:52] rideh: has joined #ruby
[02:18:10] Rubie: has joined #ruby
[02:18:25] workmad3: has joined #ruby
[02:18:44] Mon_Ouie: No idea, maybe there's some related discussion on a mailing list that would clear things up?
[02:19:01] Rubie: has joined #ruby
[02:19:26] aldodelgado: has joined #ruby
[02:19:31] Ox0dea: Perhaps, but my late realization that `module` already behaves this way was fairly illuminating.
[02:19:44] foureight84: has joined #ruby
[02:19:50] Rubie: has joined #ruby
[02:20:39] Rubie: has joined #ruby
[02:21:14] frozen3: has joined #ruby
[02:21:29] Rubie: has joined #ruby
[02:21:30] Pupeno_: has joined #ruby
[02:22:17] Rubie: has joined #ruby
[02:23:09] rubie_: has joined #ruby
[02:23:40] _seanc_: has joined #ruby
[02:23:57] Rubie: has joined #ruby
[02:24:00] northfurr: has joined #ruby
[02:24:21] bustrarm: has joined #ruby
[02:24:46] Rubie: has joined #ruby
[02:25:36] rubie_: has joined #ruby
[02:26:26] Rubie: has joined #ruby
[02:27:16] rubie_: has joined #ruby
[02:27:48] josh: has joined #ruby
[02:28:05] Rubie: has joined #ruby
[02:28:14] devbug: has joined #ruby
[02:28:34] Chau: has joined #ruby
[02:28:53] Rubie: has joined #ruby
[02:29:44] rubie_: has joined #ruby
[02:30:32] Rubie: has joined #ruby
[02:31:21] Rubie: has joined #ruby
[02:31:45] Scripore: has joined #ruby
[02:32:10] Rubie: has joined #ruby
[02:32:24] Pupeno: has joined #ruby
[02:32:59] rubie_: has joined #ruby
[02:33:12] umgrosscol: has joined #ruby
[02:33:50] Rubie: has joined #ruby
[02:34:39] Rubie: has joined #ruby
[02:35:12] TheNet: has joined #ruby
[02:35:21] bootstrappm: has left #ruby: ()
[02:35:28] Rubie: has joined #ruby
[02:36:18] Rubie: has joined #ruby
[02:36:38] jpfuentes2: has joined #ruby
[02:37:09] Rubie: has joined #ruby
[02:37:58] rubie_: has joined #ruby
[02:37:59] Pupeno: has joined #ruby
[02:38:19] psayian: hays: The reference you gave me refers to ruby 1.6. Does anyone know of a good ruby book that is more current.
[02:38:46] Rubie: has joined #ruby
[02:39:04] northfurr: has joined #ruby
[02:39:35] Rubie: has joined #ruby
[02:40:08] axl_: has joined #ruby
[02:40:14] sevenseacat: psayian: http://manning.com/black3
[02:40:22] lannonbr_: has joined #ruby
[02:40:24] Rubie: has joined #ruby
[02:40:45] psayian: sevenseacat: Is this good fro a beginner in ruby?
[02:41:14] Rubie: has joined #ruby
[02:41:19] sevenseacat: psayian: its good for everyone.
[02:41:26] Pupeno: has joined #ruby
[02:41:35] freerobby: has joined #ruby
[02:42:04] Rubie: has joined #ruby
[02:42:15] freerobby1: has joined #ruby
[02:42:54] Rubie: has joined #ruby
[02:43:00] c_nick: has joined #ruby
[02:43:41] Rubie: has joined #ruby
[02:43:47] hydrozen: has joined #ruby
[02:44:32] Rubie: has joined #ruby
[02:45:05] Pupeno_: has joined #ruby
[02:45:23] Rubie: has joined #ruby
[02:46:07] Ox0dea: Since when is 1.6 not best Ruby?
[02:46:29] fedexo: has joined #ruby
[02:46:55] Pupeno: has joined #ruby
[02:47:59] Rubie: has joined #ruby
[02:49:53] cabreraM516: has joined #ruby
[02:50:24] baweaver: has joined #ruby
[02:50:47] psayian: Thanks sevenseacat
[02:52:02] c_nick: has joined #ruby
[02:52:29] c_nick: I am executing an Excel worksheet through my Ruby Framework using COM, My binaries are 64-bit, my Excel is 64 bit do i need Ruby 64 bit too ?
[02:54:52] TheNet: has joined #ruby
[02:55:16] northfurr: has joined #ruby
[02:55:18] RickHull: Ox0dea: i'm guessing 2003
[02:55:19] c_nick: i mean ideally it should but y
[02:55:32] RickHull: 2005 maybe?
[02:55:36] Ox0dea: c_nick: Why not?
[02:55:39] Ox0dea: RickHull: Nonsense.
[02:55:49] Ox0dea: 1.6 has everything you need and nothing you don't.
[02:56:10] Ox0dea: With the added bonus of compiling in an eyeblink or two.
[02:56:28] jtdoncas: you can say that about assembly!
[02:56:31] RickHull: i need oniguruma and sytactic sugar for hash key symbols
[02:56:52] c_nick: Ox0dea: because ruby is just executing the sheet i mean ofcorse it should but i am not sure why
[02:57:12] ascarter: has joined #ruby
[02:57:25] Ox0dea: jtdoncas: And I do! :P
[02:57:37] Ox0dea: c_nick: Well, are you on a 64-bit platform?
[02:57:44] Pupeno: has joined #ruby
[02:57:48] Ox0dea: Case closed, I reckon.
[02:58:27] michael_mbp: has joined #ruby
[02:59:24] nofxx: Ox0dea, I promise... hehe, sorry had to leave. They are supposedly a 44 digit [0-9] key followed by a pipe | followed by some chars that doesn't have use
[02:59:35] nofxx: https://gist.github.com/nofxx/1da8cd45c2fbcb62c194
[03:00:09] RickHull: looks like base64 maybe
[03:00:16] RickHull: that gist is not digits only
[03:00:22] nofxx: RickHull, tryed w/o luck....
[03:00:45] iateadonut: has joined #ruby
[03:00:50] juanpablo__: has joined #ruby
[03:00:56] clarkenciel: has joined #ruby
[03:01:07] c_nick: Ox0dea: ok thanks will use Rubyx64
[03:01:22] milesforrest: has joined #ruby
[03:02:23] c_nick: has left #ruby: ()
[03:04:49] j4cknewt: has joined #ruby
[03:06:17] njr: has joined #ruby
[03:06:48] Pupeno: has joined #ruby
[03:07:16] chipotle: has joined #ruby
[03:08:32] chouhoulis: has joined #ruby
[03:08:35] LMity: has joined #ruby
[03:08:38] Pupeno_: has joined #ruby
[03:11:12] _seanc_: has joined #ruby
[03:11:21] lannonbr: has joined #ruby
[03:13:24] braincrash: has joined #ruby
[03:14:32] code1o6: has joined #ruby
[03:15:36] hololeap: has joined #ruby
[03:17:01] nahtnam: has joined #ruby
[03:20:51] rehat: is there a difference with hashes between ruby 2.2.1 and 2.1.4? not sure why my script errors out
[03:22:27] Ox0dea: nofxx: Why are they both of length 200?
[03:22:33] Ox0dea: rehat: What sort of error are you getting?
[03:23:00] Pupeno: has joined #ruby
[03:23:59] jenrzzz: has joined #ruby
[03:24:07] arescorpio: has joined #ruby
[03:24:11] rehat: I get an error with this hash https://gist.github.com/rehat/b78e40adb1494b6c03d7 on ruby 2.1.4 but not on 2.2.1
[03:24:28] michael_mbp: has joined #ruby
[03:24:31] rehat: I guess symbols in hashes are different, but idk kinda new with ruby
[03:26:48] darkf: has joined #ruby
[03:28:02] nofxx: has joined #ruby
[03:28:22] Pupeno: has joined #ruby
[03:28:43] Musashi007: has joined #ruby
[03:28:51] monoprotic: rehat: http://stackoverflow.com/questions/10004158/is-hash-rocket-deprecated/10004344#10004344 does this answer it?
[03:29:00] monoprotic: particularly: You must use the rocket for symbols that require quoting: :'where.is' => x is valid but 'where.is': x is not. Ruby 2.2 has fixed this problem so you can say 'where.is': x in Ruby 2.2+.
[03:31:35] rehat: monoprotic: ok cool thanks. I copied that from Programming Collective Intelligence which is in python and I was surprised that still worked in ruby on my work computer but I ran into that error on my personal computer. :)
[03:31:53] linuxboytoo: has joined #ruby
[03:32:05] RickHull: at work, it works. on personal, it gets personal ;)
[03:32:44] toretore: it was not a bug that was fixed; it was an additional feature added in 2.2
[03:33:02] bweston92: has joined #ruby
[03:33:29] toretore: => is still the main syntax for hash literals; the key: syntax is syntax sugar that translates to `:key =>`
[03:33:50] wheresmyjetpack: has joined #ruby
[03:33:56] fumduq: has joined #ruby
[03:34:07] monoprotic: oh, i thought you had typed "accidental"
[03:34:09] toretore: 2.2 added `'key':` -> `:'key' =>`
[03:35:09] eam: has joined #ruby
[03:35:48] wheresmyjetpack: how would you initialize an array as an instance var that calls a function on all values pushed to it?
[03:36:00] gregf_: has joined #ruby
[03:36:05] hagabaka: has joined #ruby
[03:36:31] toretore: wheresmyjetpack: elaborate. what is the purpose?
[03:36:46] LBRapid: has joined #ruby
[03:36:52] twohlix: has joined #ruby
[03:36:52] shtirlic: has joined #ruby
[03:37:24] havenwood: has joined #ruby
[03:37:35] RickHull: wheresmyjetpack: write a class. probably composition rather than inheritance
[03:37:51] Hanmac: wheresmyjetpack: @var = [*inputarray].map { |x| my_method(x) }
[03:38:08] Ox0dea: toretore: I think it was a bug.
[03:38:09] wheresmyjetpack: hanmac: thats exactly what i wanted thank you
[03:38:29] RickHull: wheresmyjetpack: really? it doesn't match at all
[03:38:43] howdoico1: has joined #ruby
[03:38:44] RickHull: that won't do shit if you @var.push(val)
[03:38:44] toretore: Ox0dea: what makes you think that?
[03:39:10] Hanmac: wheresmyjetpack: PS: " [*inputarray] " also shows that i meaned an array, inputarray.map also works
[03:39:26] Ox0dea: toretore: The Symbol syntax for Hashes didn't work for all Symbols? Definitely a bug.
[03:39:46] wheresmyjetpack: RickHull: what doesn't match
[03:39:48] toretore: it wasn't meant to work for all symbols
[03:39:55] toretore: i doubt it was an oversight in 2.1
[03:39:57] Ox0dea: wheresmyjetpack: You indicated that you wanted the function called on new elements as well.
[03:40:07] toretore: it would have been very obvious
[03:40:19] Ox0dea: You'd be surprised, I guess.
[03:40:22] Hanmac: RickHull: he might only want to do that while initialize the variable for what my thing is enough. if he wants to do it in the future with other elements too, than its not enough
[03:40:39] Ox0dea: > on all values pushed to it
[03:41:18] RickHull: hanmac: wheresmyjetpack: sure, not my problem :) but the solution does not match the problem statement imho
[03:41:29] s00pcan: has joined #ruby
[03:41:31] Scripore: has joined #ruby
[03:41:55] wheresmyjetpack: RickHull no you're right. i am pushing to the array after initialization
[03:42:03] wheresmyjetpack: jumped the gun there
[03:42:14] toretore: wheresmyjetpack: what is this for?
[03:43:06] tmtwd: has joined #ruby
[03:43:12] Ox0dea: wheresmyjetpack: Define either #push or #<< on the array's singleton class, and define it in terms of the other.
[03:43:13] wheresmyjetpack: toretore i am passing a child class into parent.array, and would like the parent to update the parent reference inside of the child
[03:43:37] Ox0dea: wheresmyjetpack: Arrays are already passed by reference.
[03:43:41] toretore: you shouldn't manipulate the parent's internal data structures from the child
[03:43:58] toretore: def add_child
[03:44:32] toretore: or from outside the parent instance, i should say
[03:44:34] RickHull: wheresmyjetpack: here is what i think matches your problem statement https://gist.github.com/rickhull/ecc930aa1ed52adca350
[03:44:51] Ox0dea: > ActiveArray
[03:44:54] shmilan: has joined #ruby
[03:46:05] michaeldeol: has joined #ruby
[03:46:13] RickHull: you could also pass a block to your push, though that leaves the func definition to the caller
[03:48:07] Ox0dea: wheresmyjetpack: https://gist.github.com/0x0dea/cc4b9f725589e85b6124
[03:49:32] wheresmyjetpack: toretore: RickHull: ok that helps. i was not manipulating the parent from within the child. the child just needed to refer back to the parent
[03:50:51] RickHull: Ox0dea: yeah, i should have named it ActiveResource
[03:51:52] toretore: wheresmyjetpack: you shouldn't be manipulating the array from outside the instance is what i should have said
[03:52:08] s00pcan: has joined #ruby
[03:52:13] wheresmyjetpack: toretore: i see
[03:52:16] axl_: has joined #ruby
[03:52:20] toretore: i.e. do `parent.add_child(child)` instead of `parent.children << child`
[03:52:44] toretore: that way, the parent gets to define what "adding a child" means
[03:53:03] toretore: and you don't have the problem any more
[03:53:40] wheresmyjetpack: toretore: ok thats super helpful. not sure why i didn't come to that on my own.
[03:55:48] ascarter: has joined #ruby
[03:56:06] RickHull: it's because you've lost your jet pack
[03:57:01] TheNet: has joined #ruby
[03:59:30] howdoico1: has joined #ruby
[03:59:50] bronson: has joined #ruby
[04:00:45] sevvie: has joined #ruby
[04:00:51] DTSCode: has joined #ruby
[04:01:15] DTSCode: irb(main):050:0* ("1 2 3".split) .each { |s| s.to_i }
[04:01:15] DTSCode: => ["1", "2", "3"]
[04:01:20] DTSCode: why does this return strings?
[04:01:36] Meow-J: has joined #ruby
[04:01:39] chipotle: has joined #ruby
[04:01:50] sevenseacat: because the each returns the array you called it in
[04:01:53] gix: has joined #ruby
[04:01:54] pontiki: you used "each" instead of "map"
[04:01:57] sevenseacat: you probably wanted map, not each
[04:02:09] DTSCode: alright thanks
[04:02:19] sevenseacat: >> "1 2 3".split.map(&:to_i)
[04:02:20] ruboto: sevenseacat # => [1, 2, 3] (https://eval.in/416543)
[04:02:53] DTSCode: has left #ruby: ("Leaving")
[04:03:29] khebbie: has joined #ruby
[04:05:08] fedexo: has joined #ruby
[04:05:37] djbkd: has joined #ruby
[04:07:09] christiandsg: has joined #ruby
[04:07:13] workmad3: has joined #ruby
[04:08:18] tubulife-: has joined #ruby
[04:12:43] IHaveAIDS: has joined #ruby
[04:13:00] IHaveAIDS: I have AIDS!
[04:13:19] sectionm1: has joined #ruby
[04:13:25] RickHull: here's a BAND-AID
[04:13:43] gambl0re: has joined #ruby
[04:15:23] wldcordeiro: has joined #ruby
[04:16:04] jenrzzz: has joined #ruby
[04:17:09] rickmasta: has joined #ruby
[04:17:44] iamninja: has joined #ruby
[04:22:55] AccordsLTN: has joined #ruby
[04:23:06] Ropeney: has joined #ruby
[04:23:41] bigmac: has joined #ruby
[04:25:32] davedev24: has joined #ruby
[04:25:44] arta82: has joined #ruby
[04:25:48] Vile`: has joined #ruby
[04:27:04] Torrieri: has joined #ruby
[04:27:04] Torrieri: has joined #ruby
[04:28:32] jenrzzz: has joined #ruby
[04:28:47] axl_: has joined #ruby
[04:35:40] hahuang65_: has joined #ruby
[04:37:44] ruby-lang678: has joined #ruby
[04:38:21] foureight84: has joined #ruby
[04:38:26] ruby-lang678: is @rob_ around?
[04:41:06] Musashi007: has joined #ruby
[04:41:12] RickHull: Ox0dea I have a current example of google not being faithful to quoted terms
[04:41:18] RickHull: if you are still interested
[04:41:22] RickHull: mac outlook attach "/tmp"
[04:41:28] Ox0dea: Punctuation.
[04:41:30] RickHull: ctrl-f temp
[04:41:48] RickHull: punctuation?
[04:42:03] christia1: has joined #ruby
[04:42:57] michael_mbp: has joined #ruby
[04:43:00] Ox0dea: Yes, '/' is a "punctuation" character, for which Google makes much less stringent guarantees.
[04:43:19] Ox0dea: You'll note, for instance, that removing the slash prevents "temporary" being considered a literal match.
[04:44:17] RickHull: that's funny
[04:44:25] RickHull: because technical queries are where fuzzy matches suck
[04:44:51] RickHull: my previous example was: blah blah "Debian" where it matched (and highlighted / bolded) Linux
[04:44:57] RickHull: but i can't make it do that anymore
[04:45:17] khebbie: has joined #ruby
[04:45:36] RickHull: dunno if i was caught in an A/B treatment at that time
[04:45:57] Ox0dea: In any case, you weren't *full* of shit, so I'd like to offer an apology for being so abrasive on the matter.
[04:46:12] RickHull: no worries, fully accepted and not needed :)
[04:46:19] RickHull: I needled you pretty good in response ;)
[04:48:52] Wolland: has joined #ruby
[04:49:36] juanpablo__: has joined #ruby
[04:50:01] Thomas-0725: has joined #ruby
[04:50:11] Aeyrix: High quantity of memes in this sector.
[04:51:07] howdoico1: has joined #ruby
[04:51:36] Ox0dea: Aeyrix! <3
[04:51:58] RegulationD: has joined #ruby
[04:52:17] Aeyrix: I'm trying to decide between private IRC net or Slack
[04:52:22] Aeyrix: because my old one got a nice ddos
[04:52:31] GnuYawk: has joined #ruby
[04:52:31] GnuYawk: has joined #ruby
[04:52:42] RickHull: free Slack is pretty damn good
[04:52:48] RickHull: we use it at $work
[04:52:51] Ox0dea: Aeyrix: Y U NO ufw?
[04:52:57] Aeyrix: wtf is ufw
[04:53:00] Aeyrix: Slack is p good yeah
[04:53:09] Aeyrix: but the barrier to entry is slightly higher than IRC for my group of people
[04:53:13] Aeyrix: security focussed / conscious
[04:53:17] Ox0dea: ufw is iptables for retards. /s
[04:53:18] RickHull: that's kind of funny
[04:53:34] Aeyrix: In my experience people are less likely to log in to Slack than IRC, because they're probably in other IRC nets
[04:53:39] Aeyrix: Ox0dea: oh right
[04:53:45] RickHull: yeah, so the barrier is cultural rather than technical
[04:53:49] RickHull: that is sensible enough
[04:53:49] Aeyrix: also iptables master race
[04:53:53] Ox0dea: Confirmed.
[04:54:05] Aeyrix: iptables wouldn't help against
[04:54:07] nofxx: Aeyrix, grove?
[04:54:12] Aeyrix: multi-gbit ddos
[04:54:47] Aeyrix: nofxx: maybe maybe
[04:54:50] Aeyrix: i do have one running
[04:54:52] Aeyrix: irc net, that is
[04:55:01] Aeyrix: i'm torn between how nice Slack is and how much control you have on an IRC net
[04:55:16] Aeyrix: it was about 150 people last time
[04:55:25] nofxx: Aeyrix, yeah, we need a solid good web client irc, but there ain't one
[04:55:39] yosafbridge: has joined #ruby
[04:55:41] Aeyrix: I use IRCCloud for multi-server client.
[04:55:41] fedexo: has joined #ruby
[04:55:43] RickHull: i say start with IRC. if you run into headaches, either with users or sysadmin, then try Slack
[04:55:52] _seanc_: has joined #ruby
[04:56:14] Aeyrix: I'm just conscious of shifting people
[04:56:16] Aeyrix: and them getting irritated
[04:56:19] RickHull: or what about ejabberd?
[04:56:26] Aeyrix: multi user chats with XMPP are hell
[04:56:58] Aeyrix: realistically it's just a (large) group of people trying to reach terminal memelocity
[04:57:08] Aeyrix: but we also talk about software engineering / security a lot
[04:57:49] nofxx: also, slack should be rolling out the irc bridge anytime now
[04:57:56] Aeyrix: It's out, it's just
[04:57:58] Aeyrix: t r a s h
[04:58:32] Aeyrix: Like if I were to recommend Slack, I'd sufface that by saying "don't use the IRC bridge though"
[04:58:36] Aeyrix: it really is bad
[04:58:48] sevenseacat: yeah I've tried it before. it's quite bad.
[04:58:52] Aeyrix: That's not Slack's fault, that's just how feature-rich Slack is versus IRC>
[04:59:05] yardenbar: has joined #ruby
[05:00:59] j4cknewt: has joined #ruby
[05:02:33] nofxx: Aeyrix, have some examples?
[05:02:51] nofxx: features left of on irc
[05:03:03] Aeyrix: Anything media-rich.
[05:03:13] Aeyrix: Emojis, inline uploads, etc
[05:03:16] Aeyrix: they're just not send by the bridge
[05:03:55] fedexo: has joined #ruby
[05:03:59] nofxx: damn..irc can do files haha, almost forgot this. I remember ppl using this for porn.
[05:04:17] nofxx: DCD ? DCC DDC .. anyways, not implemented in slack bridge than
[05:04:27] sevenseacat: any integrations, things like reactions, etc.
[05:05:44] nofxx: can irc transfer files behind nat?
[05:08:38] nofxx: Aeyrix, you are using irccloud? It's possible to get ppl to login directly on it? As in give a link to someone and he's talking in a channel in my private server.
[05:09:02] Aeyrix: You can give people a link that, post-signup, will put them in the channel
[05:09:08] Aeyrix: but there's no direct link a la KiwiIRC or Mibbit.
[05:09:25] Aeyrix: idk what I'll do if I move back to Slack
[05:09:29] Aeyrix: I'll gravitate off IRC most likely.
[05:10:08] nofxx: irccloud signup, email and pass. Hm at least some google fb oauth would be nice than.
[05:11:02] Aeyrix: I wish I knew what Slack's stack was.
[05:11:09] Aeyrix: I know some of it due to selective probing, but not all of it.
[05:11:17] Aeyrix: I want to know how their backend functions. They won't tell me. :(
[05:14:28] dhjondoh: has joined #ruby
[05:17:03] lwu: has joined #ruby
[05:19:27] mpicci: has joined #ruby
[05:20:18] BigRubyFan: has joined #ruby
[05:21:02] BigRubyFan: I have a question. My form is saving this select tag properly, but on page reload, it's not loading the selected option in the select dropdown by default.
[05:21:05] BigRubyFan: The saved option, that is.
[05:21:08] BigRubyFan: https://gist.github.com/anonymous/8059ccd7a419a86b2651
[05:21:12] BigRubyFan: That's the code.
[05:21:44] BigRubyFan: I researched :selected =>, but I'm reading that's depreciated. I also tried simply using current_user.profile.choice_1 at the end of the select tag, after options_for_select, and that throws an exception
[05:22:28] BigRubyFan: Anyone familiar? It's because I'm using an options_for_select where a user has a dropdown consisting of "Bread", "Cheese", and "Steak", but the value is an integer, 1, 2, and 3 respectively
[05:22:49] frozen3: has joined #ruby
[05:23:22] tkuchiki: has joined #ruby
[05:23:31] Aeyrix: BigRubyFan: Hit up #rubyonrails fam.
[05:23:37] Aeyrix: Much more likely able to help you.
[05:23:44] Aeyrix: The overlap is here but some domain expertise is only in #ror.
[05:23:57] BigRubyFan: Ahh, thank you.
[05:24:49] aganov: has joined #ruby
[05:25:08] j4d: has joined #ruby
[05:25:19] mpicci: Aeyrix: hey irccloud is really nice client. Got even inline gists! I'm nofxx
[05:25:31] Aeyrix: Yeah it's pretty good.
[05:25:36] Aeyrix: Some bugs to iron out that I've found but mostly pretty nice.
[05:25:54] mpicci: Aeyrix: how this file upload works? clickable for folks to download?
[05:26:11] Aeyrix: I'll be honest, I'm unsure. Never used.
[05:28:09] Aeyrix: BigRubyFan never joined #rubyonrails.
[05:28:13] Aeyrix: I even went to go look for a solution. (:
[05:28:31] symm-: has joined #ruby
[05:30:39] warmonk: has joined #ruby
[05:30:55] mpicci: Aeyrix: yeah, only one way if you think of. browser -> irccloud:80 -> irc -> url://
[05:31:35] Aeyrix: mpicci: I just have a domain combined with a small app I wrote to upload images.
[05:31:38] Aeyrix: Deletes the images after 7 days.
[05:31:45] mpicci: very fancy, would even give it a try, but I'll need to login everytime it seems. 2 hours inactivity on free accounts.
[05:32:02] Aeyrix: You get 7 days of free permanent presence.
[05:32:07] dseitz: has joined #ruby
[05:32:11] Aeyrix: I just pay the $5/mo because I'm on a bunch of networks all the time.
[05:33:10] warmonk: has joined #ruby
[05:33:54] Oog: has joined #ruby
[05:34:17] foureight84: has joined #ruby
[05:34:32] sectionme: has joined #ruby
[05:35:11] shock_one: has joined #ruby
[05:39:39] AlexRussia: has joined #ruby
[05:40:28] rbowlby: has joined #ruby
[05:40:56] Psi-Jack: has joined #ruby
[05:41:42] Billias: has joined #ruby
[05:41:46] Psi-Jack: Hmm.. What would be the proper way to actually determine if a variable is not defined, in an if statement expecting to be true or false, or similar? So far, I have if (defined?(event[:check][:type])).nil?, but that looks silly, to me.
[05:42:09] Psi-Jack: But, it's the only way, I've found so far, to actually do it, and run the code within that condition result.
[05:43:34] sectionm1: has joined #ruby
[05:43:52] Rubie: has joined #ruby
[05:45:37] Psi-Jack: Hmm. Though, unless might work, if I can tack on an elsif in there?
[05:45:52] Ox0dea: Psi-Jack: Never combine `unless` and `elsif`.
[05:45:55] sbhatore: has joined #ruby
[05:45:59] Ox0dea: Or indeed `unless` and `else`.
[05:46:34] skakri: has joined #ruby
[05:47:02] Psi-Jack: I'm comparing three things, so this is what I have as-is now: http://paste.linux-help.org/view/8ac2c0ac
[05:47:04] Ox0dea: You're keying a Hash, which already returns nil for nonexistent keys, so why do you feel you need to use `defined?`?
[05:48:33] Aeyrix: I'd venture a lack of knowledge pertaining to the intricacies of the Hash object.
[05:48:36] Psi-Jack: Hmm. So, elsif event[:check][:type].nil? would be better for line 5?
[05:48:40] Psi-Jack: Aeyrix: Bingo.
[05:48:57] Aeyrix: Psi-Jack: "line 5"? Did you ever show code?
[05:49:02] Aeyrix: I can't see it. :x
[05:49:10] Psi-Jack: http://paste.linux-help.org/view/8ac2c0ac
[05:49:34] Aeyrix: elseif event[:check][:type].nil?
[05:49:36] Aeyrix: should be fine
[05:49:45] yfeldblum: has joined #ruby
[05:49:51] Aeyrix: So long as event[:check] is always going to exist.
[05:50:21] Psi-Jack: It should, yes. ;)
[05:50:29] Aeyrix: Otherwise you'll field a NoMethodError, because event[:check] would be nil, and NilClass doesn't have `[]` as a function.
[05:50:33] Aeyrix: s/function/method.
[05:50:44] Psi-Jack: Standard sensu event object always has event[:client] and event[:check] at least.
[05:50:49] sectionme: has joined #ruby
[05:51:19] Psi-Jack: Just that... event[:check][:type] isn't always defined, though it should be, (bug report already filed).
[05:51:25] xcesariox: has joined #ruby
[05:51:31] Aeyrix: Yeah that's what my code will catch.
[05:53:01] Psi-Jack: Writing Sensu extensions, plugins, and bridges, to better fill my knowledge of ruby. So far my ruby knowledge has only come from Chef, so, still learning.
[05:53:14] Aeyrix: Good on you.
[05:53:32] Aeyrix: RickHull Ox0dea
[05:53:37] Aeyrix: Another thing Slack does well: Inline code.
[05:53:46] Aeyrix: It's lovely tbqh.
[05:53:58] postmodern: has joined #ruby
[05:53:59] Psi-Jack: So, cool, yeah. just event[:check][:type].nil? is good. Cleaner.
[05:54:07] Ox0dea: ACTION realizes he should've added syntax highlighting to WeeChat ages ago.
[05:54:22] Aeyrix: I had someone tell me irssi was a proper client today.
[05:54:26] Psi-Jack: And covers future cases where event[:check][:type] might actually have something else. ;)
[05:54:29] Aeyrix: Following on from "I can't click this link."
[05:54:48] Psi-Jack: Heh, in Konsole, even in irssi, a link would be clickable. :)
[05:54:54] Psi-Jack: ACTION ducks.
[05:54:58] Aeyrix: I can only assume it was cmd irssi
[05:55:02] Psi-Jack: But, I don't use irssi, I use konversation. :)
[05:55:07] Aeyrix: Konversation is great.
[05:55:12] Aeyrix: KDE as a whole is great tbh.
[05:55:14] Ox0dea: Psi-Jack: Are you sure this won't suffice? https://gist.github.com/0x0dea/ee4834e3e57eb0491779
[05:55:59] workmad3: has joined #ruby
[05:56:01] Psi-Jack: Ox0dea: Well, not quite. I've got more logic yet to work on, hence why it's in if, elsif, else.
[05:56:11] Psi-Jack: This is all going into a Proc.new for an EventMachine.
[05:56:14] khebbie: has joined #ruby
[05:56:42] Ox0dea: Sure, but `defined?` is almost certainly overkill.
[05:57:04] Hanmac: Psi-Jack: hm if you have more logic, isnt the case when for you too?
[05:57:05] Psi-Jack: I've fixed that with: elsif event[:check][:type].nil?
[05:57:06] Ox0dea: Plus, `defined?` doesn't actually do what you must think it does for nonexistent keys.
[05:57:17] coban2k: has joined #ruby
[05:57:44] khebbie: has joined #ruby
[05:57:59] Ox0dea: >> a = {}; defined?(a[:foo])
[05:58:00] ruboto: Ox0dea # => "method" (https://eval.in/416548)
[05:58:04] Ox0dea: `defined?` a shit.
[05:58:33] Hanmac: my variant: https://gist.github.com/Hanmac/76f13882b9bad7ccd950
[05:58:43] Hanmac: is similar to Ox0dea ones
[05:59:12] Ox0dea: hanmac: Single quotes + interpolation = bad time.
[05:59:18] Psi-Jack: Okay, Both have valid points, and could be used more effectively.
[05:59:34] Hanmac: Ox0dea: yeah ok i ddint checked that too
[05:59:41] Hanmac: is am still sleepy
[05:59:42] araujo: has joined #ruby
[06:00:15] Psi-Jack: Afterall, my logic changes whether it's "metric" or "standard", for "unknown" I'll be tossing anyway since I won't know how to handle a new check type specifically until it's actually available. :)
[06:00:19] bruno-: has joined #ruby
[06:00:20] Psi-Jack: IF ever. :)
[06:00:36] Musashi007: has joined #ruby
[06:00:43] Psi-Jack: The File.write is pretty much just for debugging.
[06:01:07] Ox0dea: Psi-Jack: In that case, `return unless event[:check][:type]` should make things cleaner.
[06:01:20] Psi-Jack: Seeing the raw json event dump directly so I could see things like,... well, event[:check][:type] not being set for standard checks. :)
[06:01:50] Psi-Jack: Ox0dea: But, I will be handling "metric" /and/ "standard" (but standard is nil)
[06:02:04] foureight84: has joined #ruby
[06:02:14] Psi-Jack: yeah.. I know.. It's stupid.. :)
[06:03:11] Ox0dea: Psi-Jack: I think you want `Hash#has_key?`.
[06:03:13] Psi-Jack: Threw me off when I was trying to get "standard" check types, and not being able to catch it in the hash as expected. But, standard checks are the default checks, in Sensu. metric checks do basically the same thing, but handle the event differently.
[06:03:41] Ox0dea: You can't differentiate between nonexistence and a nil value with Hash#[].
[06:04:00] Ox0dea: >> foo = {a: nil}; foo[:a] == foo[:b] # Psi-Jack
[06:04:00] ruboto: Ox0dea # => true (https://eval.in/416549)
[06:05:29] User458764: has joined #ruby
[06:05:29] Psi-Jack: Well, no WONDER people aren't writing good extensions for this thing. So, based on what I said... event[:check][:type] can be "metric", or without a value (standard), or possibly soemthing else in the future but I don't care about those IF they exist, future-proofing.
[06:06:20] youngbaks: has joined #ruby
[06:06:53] Hanmac: Psi-Jack: ActiveSupport has something for that ... i think it was called try ... but i dont like ActiveSupport
[06:07:00] Ox0dea: Psi-Jack: So you want `return if event[:check][:type] unless event[:check][:type] == 'metric'`, which is a little crazy.
[06:07:39] Psi-Jack: Ox0dea: Hmm, but if event[:check][:type] is not a key, I still need to handle it, treating it as "standard".
[06:08:06] Psi-Jack: I want to handle both "metric" and "standard" but not anything else. heh
[06:08:35] Ox0dea: Psi-Jack: But where "standard" is indicated with a nil value for event[:check][:type]?
[06:08:51] shock_one: has joined #ruby
[06:08:58] Psi-Jack: I guess, technically it's not nil if it's just not defined as a hash key, correct?
[06:09:15] Ox0dea: Well, therein lies the rub.
[06:09:57] Psi-Jack: I mean, I'm pesturing the sensu devs about why the heck type isn't being defined for "standard" when it should be, since it's in the spec.
[06:10:40] Ox0dea: Psi-Jack: My most recent suggestion will bail early if event[:check][:type] has any value at all *unless* its value is 'metric', which seems to be the behavior you're after.
[06:11:43] Psi-Jack: Well, again, no.. I want to handle both "metric" and if event[:check][:type] doesn't exist, but if event[:check][:type] isn't "metric" and isn't defined (or set, or is a key), to stop processing.
[06:12:22] Psi-Jack: And possibly, if event[:check][:type] is not defined OR is "standard", for in case they fix this. LOL
[06:14:12] Oog: has joined #ruby
[06:14:39] leat: has joined #ruby
[06:15:28] TomyLobo: has joined #ruby
[06:15:31] Philipp__: has joined #ruby
[06:16:38] nhhagen: has joined #ruby
[06:17:37] Psi-Jack: Hmmm, so, if event[:check].has_key?("type"); type = event[:check][:type]; else type = "standard"
[06:18:07] ekleog: has joined #ruby
[06:18:50] iamninja: has joined #ruby
[06:19:47] eGGsha: has joined #ruby
[06:20:26] Psi-Jack: There, that works very nicely, and lets me route accordingly.
[06:20:50] nhhagen_: has joined #ruby
[06:21:29] Askilada: has joined #ruby
[06:22:31] Psi-Jack: That being this: https://gist.github.com/erenfro/e42b972199a9e8d0da56
[06:22:36] demophoon: has joined #ruby
[06:22:50] pepperbreath: has joined #ruby
[06:23:02] Psi-Jack: Which that File.open... stuff will be changing to functions to handle different types accordingly.
[06:24:05] pepperbreath: has joined #ruby
[06:24:20] Stan: has joined #ruby
[06:25:22] Psi-Jack: Hmm... But that's... Not writing to my files. :/
[06:26:40] Ox0dea: Psi-Jack: You may need to flush.
[06:26:49] roolo: has joined #ruby
[06:28:35] Psi-Jack: This is what I've been originally hacking from: https://github.com/sensu/sensu/blob/master/spec/extensions/bridges/file.rb
[06:28:43] [spoiler]: flush the ruby IO buffer into the OS buffer
[06:28:52] [spoiler]: (didn't look at the code)
[06:29:17] Psi-Jack: Oh, no. I restarted sensu with the new code in place which was working until the code change.
[06:31:53] Psi-Jack: Heh, with how many things my sensu already monitors, both metrics and standard checks, those files would be flooding with stuff. And hmmm.. Moved my if..else..end into the Proc.new portion of code, and I get a lovely NoMethodError. :/
[06:31:58] Psi-Jack: for has_key.
[06:34:14] hs366: has joined #ruby
[06:34:51] Ox0dea: Psi-Jack: You forgot the question mark.
[06:35:51] audiodude: has joined #ruby
[06:35:52] nhhagen: has joined #ruby
[06:35:57] Psi-Jack: Yeah, that was it. Thank you.
[06:36:07] Ox0dea: Sure thing.
[06:36:10] audiodude: has left #ruby: ()
[06:37:09] Psi-Jack: Hmm, though. now it's just writing everything to /tmp/sensu_standard.json, instead.
[06:37:11] swgillespie: has joined #ruby
[06:38:23] juanpablo__: has joined #ruby
[06:39:10] RickHull: Aeyrix: i must admit to being happy with slack's markdown features, certainly w.r.t. inline code or `cmdline snippets`
[06:39:48] bzf: has left #ruby: ("WeeChat 1.2")
[06:40:43] Psi-Jack: if event[:check].has_key?("type") <-- So this isn't ever finding itself to be true. :/
[06:41:07] Psi-Jack: Even when event[:check][:type] == "metric" is true.
[06:42:01] apeiros: Psi-Jack: "type" and :type are not the same key
[06:42:38] apeiros: >> hash = {"x" => "I'm a String"; :x => "I'm a Symbol"}; hash["x"]
[06:42:39] ruboto: apeiros # => /tmp/execpad-c83fbc7e36b8/source-c83fbc7e36b8:2: syntax error, unexpected ';', expecting '}' ...check link for more (https://eval.in/416570)
[06:42:47] apeiros: >> hash = {"x" => "I'm a String", :x => "I'm a Symbol"}; hash["x"]
[06:42:48] ruboto: apeiros # => "I'm a String" (https://eval.in/416571)
[06:42:52] apeiros: (whoopsie)
[06:42:53] vondruch: has joined #ruby
[06:42:53] Psi-Jack: That should be .has_key?(:type) ?
[06:43:45] ChasedSpade: has joined #ruby
[06:43:46] Trynemjoel: has joined #ruby
[06:43:46] Psi-Jack: Well well. Interesting..
[06:44:57] Psi-Jack: And, .has_key? should be just .key? as has_key? is deprecated?
[06:45:53] apeiros: I don't know anything about has_key? being deprecated
[06:46:03] apeiros: no warning on $VERBOSE, nothing in the docs. where do you have that from?
[06:46:12] apeiros: oh, back in ~20min
[06:46:43] Psi-Jack: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/43765
[06:46:46] sectionme: has joined #ruby
[06:48:39] jenrzzz: has joined #ruby
[06:48:44] Psi-Jack: .key?(:type) certainly works. Leading me to believe that .has_key? might actually definitely believe it according to searching has_key deprecated. ;)
[06:48:48] GeissT: has joined #ruby
[06:49:53] Ox0dea: Psi-Jack: #key? is just an alias for #has_key?, but the latter "reads" better and is unlikely to be removed from the language any time soon.
[06:50:10] greenarrow: has joined #ruby
[06:50:11] djbkd: has joined #ruby
[06:50:48] Ox0dea: #include? is yet another alias for #has_key?, and I do believe this is the only standard method with three distinct names, so maybe one of them will go eventually.
[06:51:12] Ox0dea: Make that four! There's also #member?.
[06:51:16] Ox0dea: Utter madness.
[06:54:20] Psi-Jack: Cool. Progress..
[06:54:37] Psi-Jack: Now sleepy time. Thank you all for your help. Have a better understanding of hashes in general from this. :)
[06:55:07] Psi-Jack: I know many languages, just every language has their specifics. :)
[06:55:54] sectionm1: has joined #ruby
[06:56:50] code1o6: has joined #ruby
[06:58:22] mary5030: has joined #ruby
[06:59:01] Psi-Jack: On a side note. Totally random. I cured myself of some insanity. One of my two monitors kept constantly tripping up and cycling through video inputs. DVI->VGA.. OSD would pop up as if the button to switch was hit, and cycled until it stopped long enough to select, sometimes causing the display to switch to VGA input. Cracked the sucker open and found a little dustball on the circuit board to the buttons.. Problem solved. :D
[07:00:54] jack_rabbit: has joined #ruby
[07:01:03] [spoiler]: Psi-Jack: damn
[07:01:04] AlexRussia: has joined #ruby
[07:01:17] RickHull: dustballs can't melt fuel beams
[07:01:23] dh64: has joined #ruby
[07:01:42] Psi-Jack: Hours... And hours... of frustration solved.
[07:02:04] [spoiler]: I'd probably decide the monitor is shit and buy a new one
[07:02:19] [spoiler]: Yours is a much more economically efficient solution :P
[07:02:26] lessless: has joined #ruby
[07:02:36] Musashi007: has joined #ruby
[07:02:36] rht: has joined #ruby
[07:03:20] jack_rabbit: has joined #ruby
[07:06:22] arooni-mobile: has joined #ruby
[07:08:03] Maletor: has joined #ruby
[07:14:38] Macaveli: has joined #ruby
[07:16:25] iamninja: has joined #ruby
[07:16:42] ljarvis: RickHull: i'd certainly consider it
[07:18:52] Psi-Jack: [spoiler]: LOL. I almost tossed it, but I have these handy dandy tools to gently pry open snapped-together frames, like monitors and tablets tend to use.
[07:18:53] arup_r: has joined #ruby
[07:19:32] Psi-Jack: Plastic shivs/pries basically. SO I put them to the test. I've also repaired my own monitors before. Capaciters sometimes blow making you think it's an unrepairable issue, but really a $2 fix.
[07:21:41] towski_: has joined #ruby
[07:22:51] [spoiler]: Psi-Jack: Hmm, I'd actually be most afraid of breaking stuff while I open it up
[07:23:11] [spoiler]: I tend to overestimate sturdiness of things
[07:24:43] cibs: has joined #ruby
[07:28:04] dseitz: has joined #ruby
[07:28:07] tomphp: has joined #ruby
[07:28:13] arta82: has joined #ruby
[07:30:07] bernardio: has joined #ruby
[07:30:10] DLSteve: has joined #ruby
[07:32:10] ytti: i got some suggestions yesterday from thermatix and darix on graphing timeseries (x/y, like mrtg) in ruby
[07:32:22] ytti: http://effectif.com/ruby/manor/data-visualisation-with-ruby
[07:32:23] arta82: has joined #ruby
[07:32:31] ytti: http://sciruby.com/blog/2014/08/23/nyaplot-interactive-plots-generateor-with-ruby/
[07:32:40] ytti: and grafana were suggested
[07:33:03] ytti: i'm really looking just ruby library, to which I can feed data points, and have it puke PNG
[07:35:15] Pathfinder: has joined #ruby
[07:36:22] curses: has joined #ruby
[07:37:00] [spoiler]: ytti: I am not aware of a gem that does it; you could always make one! :)
[07:37:26] Ox0dea: "Be the change you wish to see in the world."
[07:38:24] nhhagen: has joined #ruby
[07:38:43] [spoiler]: Ox0dea: that is a nice saying
[07:39:30] Ox0dea: [spoiler]: Gandhi was pretty good for that.
[07:39:31] ytti: [spoiler], no way i'd get work hours sanctioned to do that
[07:39:47] Ox0dea: ytti: And shelling out is out of the question?
[07:39:57] RickHull: i'm a big fan of that maxim. particularly in social situations
[07:39:58] ytti: i'll probably do something with gnuplot
[07:40:04] RickHull: be the party you want to see/have
[07:40:25] RickHull: make this party *the* party. it's up to you, and noone else
[07:40:56] Ox0dea: I don't think that survives anything but cursory scrutiny, but I'll hold my tongue beyond that.
[07:41:15] Ox0dea: thank mr skeltal
[07:41:41] RickHull: look, nerds can be social and don't you dare deny it
[07:42:06] [spoiler]: RickHull: what does social mean? Sounds like a disease...
[07:42:20] RickHull: you have to watch out for contagions
[07:42:24] RickHull: especially maymays
[07:42:26] Ox0dea: RickHull: That's certainly not the pillar of your theory I would've gone after.
[07:42:39] [spoiler]: ytti: make it a gem
[07:43:00] [spoiler]: and open-source it, maybe someone else is looking for something similar
[07:43:19] terlar: has joined #ruby
[07:43:26] RickHull: be the change you're looking for. that's all i'm saying. i agree with Ox
[07:44:07] arta82: has joined #ruby
[07:44:28] RickHull: someone has to step up and ringlead the circus. it may as well be you, so long as you can hold their attention
[07:44:42] workmad3: has joined #ruby
[07:44:48] Musashi007: has joined #ruby
[07:44:51] quimrstorres: has joined #ruby
[07:44:55] [spoiler]: RickHull: I don't like monkeys
[07:45:04] RickHull: what about bears on roller skates?
[07:45:04] [spoiler]: they can keep their fucking circus
[07:45:15] RickHull: ice skates, even?
[07:45:18] sinkensabe: has joined #ruby
[07:45:41] RickHull: what about electric skateboards, or hoverboards, even?
[07:46:06] ytti: [spoiler], i just need the results, i don't have time to productize it
[07:46:19] ytti: [spoiler], i wish i had, i'd be happy to do it, if someone paid me to do it :)
[07:46:32] bruno-: has joined #ruby
[07:46:45] RickHull: open source =/= productizing
[07:47:03] RickHull: often times you can get a dev boost, i.e. unpaid labor, by open sourcing
[07:47:28] bronson: has joined #ruby
[07:47:48] RickHull: not something to count on -- by far most open source projects have a single developer
[07:47:50] nhhagen: has joined #ruby
[07:47:58] Ox0dea: > =/= in a programming channel
[07:48:19] RickHull: > quoating meam arrows
[07:48:43] jenrzzz: has joined #ruby
[07:48:47] Ox0dea: > failing to greentext
[07:50:19] workmad3: has joined #ruby
[07:50:49] RickHull: ok, i have to head home. some of us actually sleep, uknow
[07:50:49] cibs: has joined #ruby
[07:51:07] RickHull: has left #ruby: ()
[07:51:47] MatthewRock: has joined #ruby
[07:52:36] krz: has joined #ruby
[07:55:51] olistik: has joined #ruby
[07:56:48] anisha: has joined #ruby
[07:57:01] MatthewRock: Hello. I'm new to ruby. I want to do the following: given path /some/path/keyword/rest/of/path/file.extension, I want to get /rest/of/path -> so path after keyword, without file. I know how to use sed to alter string like that, but I don't know how to call sed in Ruby on string.
[07:57:19] MatthewRock: So is there a way to use sed like that, or does ruby has something similar?
[07:58:10] conor_: has joined #ruby
[07:59:06] ljarvis: MatthewRock: File.dirname(path).split("keyword").last
[07:59:51] shock_one: has joined #ruby
[08:00:27] Ox0dea: >> '/some/path/keyword/rest/of/path/file.extension'[%r'keyword(/.+)/', 1] # MatthewRock
[08:00:28] ruboto: Ox0dea # => "/rest/of/path" (https://eval.in/416618)
[08:00:29] mikecmpbll: has joined #ruby
[08:00:34] MatthewRock: wow, thanks ljarvis
[08:00:46] MatthewRock: It's really simple
[08:01:09] MatthewRock: And thanks Ox0dea, but I think i'll go with split and last
[08:01:16] Ox0dea: Yay, more method calls! :P
[08:01:41] MatthewRock: If I wanted it to be fast, I wouldn't use ruby anyway :p
[08:01:55] vondruch: has joined #ruby
[08:02:27] rakm: has joined #ruby
[08:04:07] bernardio: has joined #ruby
[08:04:28] bascht: has joined #ruby
[08:06:21] tomphp: has joined #ruby
[08:07:30] troulouliou_div2: has joined #ruby
[08:07:51] bumbar_: has joined #ruby
[08:07:52] troulouliou_divn: has joined #ruby
[08:09:07] arta82: has joined #ruby
[08:10:31] Pathfinder_: has joined #ruby
[08:11:57] Musashi007: has joined #ruby
[08:12:15] joonty: has joined #ruby
[08:13:05] flegercovateam: has joined #ruby
[08:13:33] cajone: has joined #ruby
[08:17:14] j3r0: has joined #ruby
[08:17:37] jenrzzz: has joined #ruby
[08:18:24] charliesome: has joined #ruby
[08:18:27] xcesariox: has joined #ruby
[08:18:52] tomphp: has joined #ruby
[08:19:42] Pupeno: has joined #ruby
[08:25:53] shock_one: has joined #ruby
[08:27:09] juanpablo__: has joined #ruby
[08:28:41] olistik: has joined #ruby
[08:29:15] rdark: has joined #ruby
[08:29:36] [spoiler]: yorickpeterse: yorning
[08:30:02] [spoiler]: Brainfart. I wanted to type "morning, yorick"
[08:30:20] [spoiler]: yorick<tab>* that is
[08:30:20] apeiros: morickpeterse: yorning ?
[08:30:30] djbkd_: has joined #ruby
[08:30:51] skinofstars: has joined #ruby
[08:30:56] [spoiler]: apeiros: Lol! :-)
[08:30:57] yfeldblum: has joined #ruby
[08:31:53] sectionme: has joined #ruby
[08:32:02] apeiros: harrr, friday
[08:32:09] cibs: has joined #ruby
[08:32:13] apeiros: week-end, anytime soon???
[08:34:38] [spoiler]: awyis; + I was supposed to work tomorrow, but it's also a holiday, so I don't work, which means I get 2 free weekends in a row! boom
[08:35:22] adaedra: ashleyhindle: maybe it's time to shave your armpits
[08:35:44] adaedra: [spoiler]: your work 6 days a week?
[08:36:34] [spoiler]: adaedra: It's a 5 days + 2 weekends, but those 2 days are about 30 minutes shorter, so I work 7.5 hours instead of 8 ours a day.
[08:36:59] ashleyhindle: adaedra: I'll live my life how I want!!
[08:40:16] codecop: has joined #ruby
[08:40:27] workmad3: has joined #ruby
[08:40:28] [spoiler]: adaedra, ashleyhindle: I thought that was like the force/magic/biotics/whatever
[08:40:42] ashleyhindle: It's water! He's drowning, and you didn't save him
[08:40:46] ashleyhindle: Now who's the bad guy?!
[08:40:57] [spoiler]: Oooh, water
[08:41:04] duncannz: has joined #ruby
[08:41:15] jhass: you for throwing him into the water?
[08:41:46] adaedra: http://i3.kym-cdn.com/photos/images/original/000/292/872/175.jpg
[08:41:56] Trynemjoel: has joined #ruby
[08:42:10] rdark: has joined #ruby
[08:42:22] apeiros: oh dear deary me??? why do I do this all wrong again???
[08:42:26] dionysus69: has joined #ruby
[08:42:38] xcesariox: has joined #ruby
[08:42:42] apeiros: anybody know how to get the directory of a gem via ruby code?
[08:42:57] apeiros: i.e. similar to how Gem.datadir("gemname") gets you the data directory
[08:43:05] shredding: has joined #ruby
[08:43:23] chichou: has joined #ruby
[08:44:30] yh: has joined #ruby
[08:44:41] bodgix: has joined #ruby
[08:45:00] einarj: has joined #ruby
[08:45:28] f4cl3y: has joined #ruby
[08:45:52] leafybasil: has joined #ruby
[08:48:25] flegercovateam: has joined #ruby
[08:48:39] quimrstorres: has joined #ruby
[08:49:08] senayar: has joined #ruby
[08:49:54] jhass: datadir is File.join spec.full_gem_path, "data", gem_name
[08:49:57] user1138: has joined #ruby
[08:51:32] jhass: so Gem.loaded_specs[gem].full_gem_path ?
[08:52:11] apeiros: got distracted
[08:52:16] apeiros: ACTION tries that
[08:52:28] yh: has joined #ruby
[08:52:50] apeiros: that works
[08:53:25] apeiros: great. now on to emulate rails' "lets add all directories under <gem>/app to the load path" (though, rails actually adds it to its own autoloading mechanism)
[08:53:35] RegulationD: has joined #ruby
[08:53:52] apeiros: rabbit holes??? I should learn to recognize them and not go down???
[08:54:35] Ox0dea: apeiros: https://github.com/jarmo/require_all
[08:55:19] face: has joined #ruby
[08:55:33] tomphp: has joined #ruby
[08:55:40] marr: has joined #ruby
[08:56:11] apeiros: Ox0dea: that too has the prerequisite of me knowing the path of that stuff ;-)
[08:56:22] kortes: has joined #ruby
[08:56:31] jenrzzz: has joined #ruby
[08:56:31] apeiros: and I can live without autoloading. I find that a bad idea anyway.
[08:56:59] adaedra: ACTION autoloads apeiros
[08:57:14] apeiros: oh wow, nokogiri segfaults? long time no see???
[08:59:18] rdark: has joined #ruby
[09:00:19] apeiros: *requiring* nokogiri segfaults
[09:00:27] apeiros: what. the. fuck.
[09:00:52] apeiros: just `pry -rnokogiri` doesn't segfault
[09:00:57] [k-: has joined #ruby
[09:01:06] apeiros: but within the project, when I loaded everything and then require nokogiri, it segfaults.
[09:01:35] bernardio: has joined #ruby
[09:01:50] lessless: has joined #ruby
[09:02:42] apeiros: and unless webrick/rack come with native extensions nowadays, everything is just plain ruby code
[09:02:53] dhjondoh: has joined #ruby
[09:03:09] ljarvis: rm nokogiri; add oga
[09:03:28] apeiros: if this problem persists, I might even.
[09:03:49] apeiros: ok. reinstalling doesn't help.
[09:04:18] apeiros: and it is the newest version.
[09:04:43] adaedra: let oga fill your dreams
[09:06:12] shock_one: has joined #ruby
[09:07:13] acosonic: has joined #ruby
[09:07:44] apeiros: random segfaults??? trying to isolate it and it goes away.
[09:07:47] apeiros: fucking heisenbugs
[09:07:56] acosonic: Hi, trying to restart puma with pumactl on windows, but keep getting bad URI(is not URI?): no matter what I do
[09:08:14] Oog: has joined #ruby
[09:08:24] Frem: has joined #ruby
[09:08:52] Oog: has joined #ruby
[09:09:44] apeiros: I'm at the same code again as before which in 100% of all cases produced a segfault. and now it doesn't segfault anymore.
[09:09:48] apeiros: yorickpeterse: oga is 100% ruby?
[09:10:29] yorickpeterse: apeiros: about 91% per Github
[09:10:38] bernardio: has joined #ruby
[09:10:44] yorickpeterse: The other ~10% is C/Java
[09:10:53] yorickpeterse: https://github.com/YorickPeterse/oga/tree/master/ext basically just this
[09:11:02] yorickpeterse: same goes for the ruby-ll dependency
[09:11:02] acosonic: any ideas about what should I do with puma windows, how to restart it?
[09:11:13] [k-: so it uses a lot of memory then
[09:11:31] apeiros: yorickpeterse: that's a ragel lexer?
[09:12:02] j4cknewt: has joined #ruby
[09:12:03] apeiros: I assume the ruby lexer generated from ragel is too slow?
[09:12:06] dhjondoh: has joined #ruby
[09:13:00] yorickpeterse: Yes, it used to be pure Ruby
[09:13:10] yorickpeterse: But in that case lexing 10MB of XML would take something like 5 seconds
[09:13:13] yorickpeterse: whereas now it takes ~500 ms
[09:13:25] apeiros: ok, was going to ask that
[09:13:25] yorickpeterse: of which ~450 ms is Ruby itself
[09:13:38] yorickpeterse: (Ragel itself is stupid fast)
[09:14:03] apeiros: tbh, I find 50ms for 10MB of data still quite a lot
[09:14:21] apeiros: that boils down to 200MB/s
[09:14:32] leafybasil: has joined #ruby
[09:14:45] yorickpeterse: It might've been less, IIRC I calculated it to ~2GB/s
[09:15:01] apeiros: ok, that sounds more reasonable
[09:15:15] yorickpeterse: the moment you call a single Ruby method that goes up to around 100ms
[09:15:41] troulouliou_div2: has joined #ruby
[09:15:47] yorickpeterse: https://github.com/YorickPeterse/oga/commit/2689d3f65ae065323dd44f49f3f070d7f88035b3 explains the rationale for the move
[09:15:54] apeiros: method call overhead is insane
[09:16:01] apeiros: I still have iso8601 parsing C code
[09:16:09] apeiros: parses ~3mio datetimes per second
[09:16:20] apeiros: the moment you add ruby to it, that number is destroyed.
[09:16:54] jhass: time to move to crystal <3 :P
[09:16:58] TheHodge: has joined #ruby
[09:17:08] apeiros: jhass: I know.
[09:17:23] jhass: (I'm mostly j/k ;) )
[09:17:32] apeiros: jhass: if you team up with me to write a crystal version of my framework's back-end :D
[09:17:33] Karpah: has joined #ruby
[09:17:44] yorickpeterse: maybe once Crystal has a proper GC
[09:18:10] jhass: plug one in https://github.com/manastech/crystal/blob/master/src/gc/boehm.cr
[09:18:15] jhass: that's all there's to it
[09:18:20] yorickpeterse: Boehm is anything but proper
[09:18:36] yorickpeterse: and last I checked doing a concurrent GC of sorts in LLVM is stupid hard
[09:19:00] yorickpeterse: HLVM or w/e it was called did it, but they had to replace a large chunk of the usual LLVM code with their own to support it
[09:19:30] banister: has joined #ruby
[09:19:42] olistik: has joined #ruby
[09:19:45] yorickpeterse: apeiros: anyway, how come you're interested in Oga being 100% Ruby? Need it in Opal :P
[09:19:55] yorickpeterse: (it doesn't run in Opal btw, I tried at some point)
[09:19:59] apeiros: yorickpeterse: no. considering dropping nokogiri.
[09:20:06] troulouliou_div2: has joined #ruby
[09:20:13] apeiros: and the reason is random segfaults.
[09:20:19] yorickpeterse: Well, Oga doesn't segfault
[09:20:19] apeiros: but if oga has C code too??? :-S
[09:20:42] yorickpeterse: https://github.com/YorickPeterse/oga/commit/32b75bf62c0c1770b68e7e1a9918718943d1c04c there's this concurrency issue that I still have to release though, probably should do that this weekend
[09:20:55] yorickpeterse: euh yeah, if Oga segfaults I'll buy you a beer
[09:21:01] apeiros: bro, I work in a company which is 90% sales force. I learned not to trust salesmen ;-p
[09:21:15] yorickpeterse: Well, I don't sell enterprise contracts so you're safe
[09:21:23] yorickpeterse: and my EULA doesn't forbid reverse engineering either
[09:21:47] Zackio: has joined #ruby
[09:21:56] apeiros: yorickpeterse: no security by oracle?
[09:22:00] charliesome: has joined #ruby
[09:22:02] apeiros: I can't trust your software then!
[09:22:06] [k-: desperation
[09:22:36] [k-: Oracle doesn't even write good software
[09:22:38] Oog: has joined #ruby
[09:22:46] DaniG2k: has joined #ruby
[09:22:51] apeiros: [k-: for realsies? :D
[09:22:52] [k-: look how heath.gov turned out
[09:23:19] adaedra: THANKS OBAMA
[09:23:32] yorickpeterse: apeiros: in all seriousness, if it segfaults I'll buy you a beer
[09:23:38] yorickpeterse: Hm, maybe I should put that in the README
[09:23:43] apeiros: [k-: I had experiences like sqlite3 on my local machine outperforming oracle on a 256GB RAM + 16 core machine by a factor of 50
[09:23:58] apeiros: yorickpeterse: that's a bad deal. I don't drink beer.
[09:24:03] yorickpeterse: apeiros: fine, tea
[09:24:17] frozen3: has joined #ruby
[09:24:17] yorickpeterse: also what's this, a Swiss not drinking beer?
[09:24:20] dangerousdave: has joined #ruby
[09:24:23] apeiros: [k-: oh, and that was NOT by using an in-memory db. plain normal disk based table.
[09:24:25] yorickpeterse: next you're telling me you don't wear lederhosen too
[09:24:49] [k-: sounds horrible, those cheats!
[09:24:50] apeiros: yorickpeterse: lederhosen is our northern brethren
[09:25:02] apeiros: munich, that's germany, not switzerland :)
[09:25:17] joonty: has joined #ruby
[09:25:19] [k-: I'm going to take a nap
[09:25:26] jhass: switzerland is clocks, cheese, chocolate & money
[09:25:40] adaedra: It's a crime ???
[09:25:44] yorickpeterse: apeiros: thatsthejoke.jpg
[09:26:03] apeiros: anyway, [k- yes, oracle sucks. hard. fuck them.
[09:26:07] leat: has joined #ruby
[09:26:19] yorickpeterse: sssh careful now, they might void your contract
[09:26:24] adaedra: think of the stds you can catch :X
[09:26:27] yorickpeterse: Pretty sure the EULA doesn't allow you to insult Oracle
[09:26:31] apeiros: adaedra: lol
[09:26:37] apeiros: *metaphorically* of course!
[09:26:48] apeiros: figuratively?
[09:27:16] lessless: has joined #ruby
[09:27:33] rikkipitt: has joined #ruby
[09:27:41] adaedra: There's a guy that tried "I'll fuck you" on Twitter to national train company, one driver responded with "You better prepare, we're 60000."
[09:28:09] apeiros: that'd give a nasty burn
[09:28:31] yorickpeterse: apeiros: so the one thing with Oga, parsing will be slower
[09:28:37] yorickpeterse: but xpath/css querying will soon be faster
[09:28:41] yorickpeterse: so hopefully the two even out nicely
[09:28:47] yorickpeterse: (faster than nokogiri that is)
[09:28:55] yorickpeterse: and much faster than what Oga currently has
[09:29:15] apeiros: last time I tried css/xpath on nokogiri on a large document I had to force-kill ruby :D
[09:29:22] apeiros: *with nokogiri
[09:29:36] apeiros: was a bit disappointed, to say the least.
[09:29:42] khebbie_: has joined #ruby
[09:30:04] yorickpeterse: Right now Oga too will shit itself
[09:30:09] yorickpeterse: but the new setup will be a shit ton better
[09:30:42] apeiros: good to hear. regardless of whether I'll actually use oga. competition is always good :)
[09:30:46] maloik: is that metric, or freedom units?
[09:30:59] apeiros: haha, freedom units
[09:31:02] maloik: you're so inclusive <3
[09:31:13] apeiros: 5 mile* run (*freedom units)
[09:31:28] Diabolik: sup everyone
[09:31:35] yorickpeterse: HAHA, I'm such a dumbass:
[09:31:35] apeiros: Diabolik: lunch
[09:31:43] yorickpeterse: "Why does this script not reduce the amount of reviews without a language"
[09:31:51] yorickpeterse: query: " ... WHERE language IS NOT NULL ... "
[09:31:56] yorickpeterse: ACTION bangs head
[09:32:02] yorickpeterse: that took me...a week to figure out
[09:32:34] apeiros: ACTION still hates how NULL interacts with comparison operators :-(
[09:32:44] acosonic: Hi, trying to restart puma with pumactl on windows, but keep getting bad URI(is not URI?): no matter what I do
[09:32:52] apeiros: WHERE foo <> "bar" OR foo IS NULL
[09:33:42] yorickpeterse: acosonic: might want to report that as a bug at github.com/puma/puma, probably faster to get an answer
[09:34:03] yorickpeterse: apeiros: I actually wouldn't mind something like `IS BLANK`
[09:34:21] yorickpeterse: which would basically be `(where X is null OR X = '')`
[09:34:25] acosonic: yorickpeterse, thnx I'll try
[09:34:39] yorickpeterse: though in Pg I could just define a function for that
[09:34:48] apeiros: yorickpeterse: wouldn't help with the <> clause
[09:34:55] conor_: has joined #ruby
[09:35:36] apeiros: ora> SELECT CASE WHEN 'foo' <> NULL THEN 'unequal' ELSE 'equal' END x FROM dual; -- >> 'equal'
[09:35:46] apeiros: because that makes so much sense >.<
[09:36:04] apeiros: <me> (???`????)=???)`????) <oracle>
[09:36:10] apeiros: well, actually sql in this case.
[09:36:19] _blizzy_: has joined #ruby
[09:36:23] yorickpeterse: Allrighty, time to deploy Rails 4 everywhere
[09:36:26] yorickpeterse: this can only go right
[09:36:33] apeiros: good luck.
[09:36:35] adaedra: apeiros: that's not allowed by the EULA
[09:36:47] DaniG2k: has anyone used raspberry pi as a webserver?
[09:36:52] DaniG2k: in this channel, I mean
[09:36:56] DaniG2k: not in the multiverse @_@
[09:36:56] apeiros: jhass: have you?
[09:37:08] ruboto: Just ask your question, if anyone has or can, they will respond.
[09:37:15] jhass: kinda, yes
[09:37:15] DaniG2k: that was my question :P
[09:37:22] DaniG2k: i just want to know if it's good or bad
[09:37:24] ruboto: jhass is anybody
[09:37:27] apeiros: DaniG2k: yes, yes, that was not what I was looking for :)
[09:37:40] yorickpeterse: DaniG2k: how do you know people in here don't co-exist in multiple universes?
[09:37:45] apeiros: ah, damn. anybody not anyone.
[09:37:45] DaniG2k: seems they're sold out in the UK though...jeez
[09:37:58] jhass: apeiros: you didn't want them equal!
[09:38:13] DaniG2k: yorickpeterse: rubyists can barely multi-thread let alone co-exist in multiple universes
[09:38:17] adaedra: DaniG2k: possible, but don't expect performance.
[09:38:21] jhass: DaniG2k: "webserver" is not particularly well defined
[09:38:31] yorickpeterse: DaniG2k: oooooooh, right in the kisser
[09:38:36] DaniG2k: jhass: good point
[09:38:42] DaniG2k: adaedra: good point
[09:38:45] apeiros: jhass: something which speaks HTTP?
[09:38:48] adaedra: ACTION gives yorickpeterse some cold water
[09:38:59] jhass: apeiros: like curl?
[09:39:02] adaedra: HTTP/1.1 GET /hello
[09:39:13] jhass: or ... wget?
[09:39:24] symm-: has joined #ruby
[09:39:27] apeiros: jhass: something which speaks HTTP and can read a HTTP request and respond with an HTTP response?
[09:39:30] jhass: adaedra: other way around, no?
[09:39:47] adaedra: I mixed query and answer
[09:39:58] jhass: apeiros: I tend to use http server as the general term
[09:40:11] jhass: point is people mean all sorts of stuff when they say webserver
[09:41:41] DaniG2k: i meant what aperios said
[09:41:52] ruboto: I don't know anything about aperios
[09:41:54] bernardio: has joined #ruby
[09:42:02] DaniG2k: grrr vowels
[09:42:08] apeiros: ?tabnick DaniG2k
[09:42:09] ruboto: DaniG2k, pro-tip - use tab completion for nicks. avoids typos in nicks.
[09:42:19] DaniG2k: ruboto: hi
[09:42:34] aperios: has joined #ruby
[09:42:37] ruboto: I'm just a bot. You don't need to address me.
[09:42:42] ruboto: hi DaniG2k
[09:42:43] aperios: let's see how that goes
[09:42:52] apeiros: LUNCH! cya
[09:42:56] rdark: has joined #ruby
[09:43:03] DaniG2k: soon everything will be run by robots
[09:43:09] apeiros: .!kick aperios nooooo!
[09:43:22] DaniG2k: they actually had a documentary on this on Al Jazeera
[09:43:25] adaedra: apeiros: tbf, my tab doesn't work if I put the ? :(
[09:44:11] jhass: DaniG2k: so the answer is sure, I bet many did
[09:44:16] `derpy: You have a problem with robots?
[09:44:39] DaniG2k: http://img1.wikia.nocookie.net/__cb20100204104514/terminator/images/archive/4/49/20100204104618!Terminator.jpg
[09:44:43] _blizzy_: has joined #ruby
[09:46:13] iateadonut: has joined #ruby
[09:48:44] DaniG2k: i hate people
[09:48:47] DaniG2k: http://motherboard.vice.com/read/by-2100-everything-you-know-about-the-ocean-will-be-wrong
[09:48:54] DaniG2k: changing our oceans
[09:49:12] dhjondoh: has joined #ruby
[09:49:59] ruboto: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[09:50:45] LMity: has joined #ruby
[09:52:06] lucyinthesky: has joined #ruby
[09:53:39] rdark: has joined #ruby
[09:53:54] bernardio: has joined #ruby
[09:57:49] vrinek: has joined #ruby
[09:58:29] vrinek: hi, I???m trying to debug a timezone-related issue
[09:58:32] Trynemjoel: has joined #ruby
[09:58:37] lucyinthesky: has left #ruby: ("Leaving")
[09:58:37] olistik: has joined #ruby
[09:58:53] vrinek: seems like my ruby 2.2.2 reports Uruguay as observing DST
[09:59:10] vrinek: but on codeship (not 100% sure but looks like it???s 2.2.2) does not
[09:59:30] vrinek: last month Uruguay decided to not observe DST anymore
[09:59:32] arup_r: has joined #ruby
[09:59:37] vrinek: and ruby 2.2.2 dates back to april
[09:59:50] vrinek: so obviously it could not include this info
[10:00:10] spider-mario: has joined #ruby
[10:00:13] vrinek: any ideas where ruby sources the timezone info from?
[10:02:09] yorickpeterse: IIRC it uses your system's tzdata database
[10:02:14] joonty: has joined #ruby
[10:02:22] sigurding: has joined #ruby
[10:03:09] vrinek: thanks, I???ll look into it
[10:04:32] Trynemjoel: has joined #ruby
[10:04:59] sigurding: Hey guys, short question I am adding a gauge (https://github.com/johnewart/ruby-metrics/) to a hash, but instead the value changing the value remains the https://gist.github.com/jhiemer/df46b3880d62d7c1f1d9 the same. Could anyone explain me why?
[10:11:46] mclee: has joined #ruby
[10:15:15] jhass: sigurding: http://dilbert.com/strip/2001-10-25 ?
[10:15:15] sideshowcoder: has joined #ruby
[10:15:40] adaedra: we need a ?random
[10:16:15] juanpablo__: has joined #ruby
[10:16:49] sdothum: has joined #ruby
[10:16:51] ashleyhindle: Change ?ot to ?rot (random off topic)
[10:16:56] ashleyhindle: Also ?rot sounds cool
[10:17:23] workmad3: has joined #ruby
[10:17:39] sigurding: but that does not help. So any idea?
[10:18:15] lokulin: has joined #ruby
[10:18:45] olistik: has joined #ruby
[10:20:11] charliesome: has joined #ruby
[10:20:26] rickmasta: has joined #ruby
[10:20:56] charliesome: has joined #ruby
[10:21:22] conor_: has joined #ruby
[10:21:38] DaniG2k: has joined #ruby
[10:21:54] DaniG2k: hey guys how can I add some metaprogramming magic to dry up these methods
[10:21:55] charliesome: has joined #ruby
[10:21:57] DaniG2k: https://gist.github.com/DaniG2k/62cf27520992c83a5f01
[10:22:05] arup_r: http://ruby-doc.org/core-2.2.2/IO.html#method-i-lineno gives currnt line number, what is there to get the current file pointer position ?
[10:22:27] DaniG2k: they are basically all the same in that they check if @tknz; do something, else set_tokens and do something
[10:22:42] DaniG2k: I want to basically write one method that can define these on the fly if possible
[10:22:44] ruboto: Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[10:22:52] ljarvis: DaniG2k: just set_tokens before you ever call any of those methods
[10:23:09] DaniG2k: ljarvis: I tried that but it turns out that doesnt do what I expected
[10:23:11] jhass: DaniG2k: rename set_tokens to tokens and use only it to access
[10:23:26] Oog: has joined #ruby
[10:23:41] DaniG2k: yorickpeterse girls and boys
[10:24:11] sevenseacat: its not the first time you've been hit with that factoid DaniG2k
[10:25:47] terlar: has joined #ruby
[10:26:26] Tempesta: has joined #ruby
[10:29:18] Meow-J: has joined #ruby
[10:30:23] olistik: has joined #ruby
[10:30:43] cornerma1: has joined #ruby
[10:31:37] khebbie: has joined #ruby
[10:32:11] sectionme: has joined #ruby
[10:32:38] stamina: has joined #ruby
[10:32:42] DaniG2k: ok thanks guys
[10:32:44] chichou: has joined #ruby
[10:32:51] DaniG2k: will try using define_method in a clever way :)
[10:33:08] terlar: has joined #ruby
[10:35:11] Ropeney: has joined #ruby
[10:37:21] sevenseacat: no seriously.
[10:37:48] Oog: has joined #ruby
[10:37:53] ashleyhindle: Some guys never learn :(
[10:37:54] apeiros: that actually marks the first time I ponder a ban based on ?guys.
[10:38:14] terlar: has joined #ruby
[10:40:35] apeiros: anyway, DaniG2k, you're cutting yourself off of a lot of goodwill by your behavior. at least for me you're one of those people I'll probably not help.
[10:41:54] bruno-: has joined #ruby
[10:42:12] abdoudjanifresh: has joined #ruby
[10:43:09] conor_: has joined #ruby
[10:47:46] einarj: has joined #ruby
[10:48:01] kidoz: has joined #ruby
[10:48:07] Oog: has joined #ruby
[10:50:28] phutchins: has joined #ruby
[10:50:31] phutchins1: has joined #ruby
[10:50:38] ekleog: Hi there! Is there a way for object A to modify a variable internal to object B, if both belong to the same class? I'm hurt by the "unexpected tIVAR" syntax error :/
[10:50:56] Vile`: has joined #ruby
[10:51:12] apeiros: ekleog: only via a method
[10:52:07] apeiros: i.e., provide a method to perform that modification. if only objects from the same class should be able to call that method, mark the method as protected.
[10:52:27] guardian: has joined #ruby
[10:53:20] guardian: hello I need a quick hand with httparty. I want to issue a post request http://example.com?foo=bar -- should I inject "?foo=bar" myself to the URL or should I use :query ?
[10:53:30] jimms: has joined #ruby
[10:54:57] ekleog: apeiros: Thanks!
[10:55:23] shock_one: has joined #ruby
[10:55:32] apeiros: ekleog: yw
[10:55:57] chipotle: has joined #ruby
[10:56:02] apeiros: guardian: if httparty provides a method to generate the url params, use that
[10:56:11] apeiros: it'll correctly encode it and all
[10:56:13] [spoiler]: guardian: I think when you use the methods, it will encode them
[10:56:20] [spoiler]: what he said ^
[10:58:01] rodfersou: has joined #ruby
[10:59:42] sarkyniin: has joined #ruby
[11:00:51] guardian: yep apparently when you use :query it forges a query string
[11:01:01] guardian: damn this gem is so poorly documented :/
[11:01:25] guardian: also it seems setting :query to something and at the same time :body to nil makes it not forge the query string
[11:01:35] adaedra: it's not a party if you don't have FUN!
[11:04:29] guardian: it's definitely not one :)
[11:04:49] robh71: has joined #ruby
[11:09:14] lele: has joined #ruby
[11:09:48] youngbaks: has joined #ruby
[11:12:36] Trynemjoel: has joined #ruby
[11:13:17] sectionme: has joined #ruby
[11:15:07] krz: has joined #ruby
[11:16:17] robh71: has joined #ruby
[11:17:01] Ropeney: has joined #ruby
[11:17:02] User458764: has joined #ruby
[11:19:38] wedgwood: has joined #ruby
[11:19:55] solars: has joined #ruby
[11:20:58] phutchins: has joined #ruby
[11:22:52] mattp_: has joined #ruby
[11:23:28] mattp_: has left #ruby: ()
[11:24:02] VeganGreg: has joined #ruby
[11:25:15] nettoweb: has joined #ruby
[11:26:29] user1138: has joined #ruby
[11:26:32] pyon: has joined #ruby
[11:26:53] j4cknewt: has joined #ruby
[11:26:59] robh71: has joined #ruby
[11:28:14] Ropeney: has joined #ruby
[11:29:28] thiagovsk: has joined #ruby
[11:30:26] user1138: has joined #ruby
[11:31:55] sigurding: has joined #ruby
[11:32:55] sectionm1: has joined #ruby
[11:34:43] rickmasta: has joined #ruby
[11:36:00] lucyinthesky: has joined #ruby
[11:36:59] but3k4: has joined #ruby
[11:43:08] ekleog: Already back: I use assert_output from Minitest to check that a given function outputs something. However, I just changed the function from using puts to print ; and suddenly assert_output finds there is nothing outputted. Do you know why ?
[11:44:56] [spoiler]: ekem: did you flush?
[11:45:04] [spoiler]: ekleog: * oops
[11:45:50] faces: has joined #ruby
[11:46:33] faces: has joined #ruby
[11:48:44] iamninja: has joined #ruby
[11:49:12] bmurt: has joined #ruby
[11:49:16] bronson: has joined #ruby
[11:49:52] Tuxero: has joined #ruby
[11:51:21] bruno-: has joined #ruby
[11:51:39] hs366: has joined #ruby
[11:52:57] millerti: has joined #ruby
[11:56:10] banister: has joined #ruby
[11:56:22] robh71: has joined #ruby
[11:57:00] intuxicated: has joined #ruby
[12:03:39] [k-_: has joined #ruby
[12:03:53] Zackio: has joined #ruby
[12:04:14] robh71: has joined #ruby
[12:04:31] atmosx: ekleog: does print add a newline ? \n
[12:04:41] juanpablo__: has joined #ruby
[12:04:41] atmosx: can't recall
[12:05:08] shevy: print just prints without modification
[12:05:16] ldnunes: has joined #ruby
[12:05:33] atmosx: then this might be the problem (or maybe not, try adding a newline manually and see what happens)
[12:05:37] basmoura: has joined #ruby
[12:05:40] atmosx: shevy: how's life?
[12:06:02] flou: has joined #ruby
[12:06:33] lannonbr: has joined #ruby
[12:08:26] ekleog: atmosx: Actually that was the point of switching to print ; and assert_output gives me a diff that shows nothing is displayed ; but now debugging I seem to have much deeper problems in my code (eg. a theoretically minor change just made a seemingly trivial test infinite-loop...)
[12:08:45] bluOxigen: has joined #ruby
[12:09:05] atmosx: ekleog: awesome -P
[12:09:30] basmoura_: has joined #ruby
[12:10:17] ekleog: Oh. My. God.
[12:10:39] ekleog: Switching from print to puts just makes the infinite loop go away
[12:11:09] ekleog: Now I just wonder wtf is going on
[12:11:28] apeiros: ?code ekleog
[12:11:28] ruboto: ekleog, We can't help you without your code, please post it to https://gist.github.com
[12:11:47] nveselinov: has joined #ruby
[12:11:51] skinofstars: has joined #ruby
[12:13:14] nettoweb: has joined #ruby
[12:13:23] sdwrage: has joined #ruby
[12:13:29] quimrstorres: has joined #ruby
[12:16:15] Oog: has joined #ruby
[12:18:02] twohlix: has joined #ruby
[12:18:02] unver: has joined #ruby
[12:20:34] VeganGreg: has joined #ruby
[12:21:02] yh: has joined #ruby
[12:24:47] mujou: has joined #ruby
[12:25:14] Pumukel: has joined #ruby
[12:26:51] rbennacer: has joined #ruby
[12:27:10] leat: has joined #ruby
[12:27:26] [k-_: is he goonneeee
[12:30:21] mary5030: has joined #ruby
[12:30:24] conor_: has joined #ruby
[12:31:39] ekleog: (no, just trying to find a minimal non-working example)
[12:32:14] [k-_: you can just point us to the part that is causing the error
[12:32:28] [k-_: additional code surrounding it might help, who knows?
[12:35:27] uwa667: has joined #ruby
[12:35:34] atomical: has joined #ruby
[12:37:01] olistik: has joined #ruby
[12:37:06] j3r0: has joined #ruby
[12:38:57] shevy: atmosx it's way too hot here
[12:39:17] shevy: atmosx 34.6?C I can't code at such a temperature
[12:39:28] shevy: and that isn't even peak for today :(
[12:39:43] [k-_: where does you live
[12:39:56] [k-_: i predict northern hemisphere!
[12:39:58] apeiros: shevy: aren't you in austria?
[12:39:58] shevy: central europe - there is an ongoing heatwave
[12:40:01] [k-_: at low altitudes!
[12:40:12] [k-_: far away from the sea!
[12:40:16] apeiros: wow, didn't know it's that much hotter over there
[12:40:23] [k-_: with low cloud cover!
[12:40:26] shevy: Zurich: Temperature 21?C I envy you guys :(
[12:40:38] apeiros: shevy: yeah, that's just today
[12:40:38] shevy: [k-_ I miss Hong Kong
[12:40:48] apeiros: but indeed, I'm happy temperatures finally fell
[12:41:10] [k-_: that is because the sun's ray strikes the earth's surface at an angle
[12:41:43] [k-_: and the earth is tilted on it's axis at 23.5 deg C
[12:42:14] sepp2k: has joined #ruby
[12:42:19] [k-_: in august, the northern hemisphere will be tilted towards the sun, as the earth revolves around the sun
[12:42:27] ruboto: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[12:42:45] [k-_: but shevy isnt in ot :(
[12:44:35] ishahnaz: has joined #ruby
[12:44:51] ekleog: OMG just found why ; stupid mistake...
[12:45:03] _blizzy_: has joined #ruby
[12:45:19] ekleog: My lambda was calling print, but located inside a member function called print...
[12:46:32] d10n-work: has joined #ruby
[12:46:47] sgambino: has joined #ruby
[12:48:28] ekleog: ACTION feels stupid
[12:49:15] ghoti: has joined #ruby
[12:50:18] [k-_: dont name things things that are used in kernel then
[12:51:35] bruno-: has joined #ruby
[12:53:08] _blizzy_: has joined #ruby
[12:53:51] jhass: >> Kernel.print "Why not?"
[12:53:52] ruboto: jhass # => Why not?nil (https://eval.in/416746)
[12:55:03] frozen3: has joined #ruby
[12:55:27] RegulationD: has joined #ruby
[12:56:14] [k-_: not that anyone would remember unless they are careful
[12:56:18] ljarvis: >> Kernel.loop.to_enum.to_enum.method(:loop).to_enum
[12:56:19] ruboto: ljarvis # => #<Enumerator: #<Method: Enumerator(Kernel)#loop>:each> (https://eval.in/416747)
[12:57:14] devoldmx: has joined #ruby
[12:57:27] dgutierrez1287: has joined #ruby
[12:58:04] ljarvis: >> method(:loop).[]{break}
[12:58:05] ruboto: ljarvis # => nil (https://eval.in/416748)
[12:58:09] ljarvis: ACTION waiting for shit to compile
[12:58:57] Guest50: has joined #ruby
[12:59:45] nwhirschfeld: has joined #ruby
[13:00:05] [k-_: wait, you can closure using .[], but not []?
[13:01:42] hal_9000_: has joined #ruby
[13:03:48] maloik: what's the best (easiest?) way to compare memory usage when using %x(), Kernel#system, Kernel#` and a couple Chef-specific things?
[13:04:20] maloik: my colleagues suspect that some of the ones they use completely duplicate the process making the server go out of memory, but I'm actually not sure of how to compare them
[13:05:01] jhass: launch your script in a memory accounting cgroup and watch that ones memory usage
[13:05:14] sectionme: has joined #ruby
[13:05:25] jhass: that's not the easiest way, but the most reliable one to get a significant number
[13:05:28] juanpablo__: has joined #ruby
[13:07:10] dorei: has joined #ruby
[13:07:49] maloik: sounds somewhat hard, especially considering we're talking about chef runs in this case
[13:07:57] maloik: any other options come to mind?
[13:08:38] cabreraM516: has joined #ruby
[13:09:27] jhass: well, it's a couple cgexec calls and then watching /sys/fs/cgroup/.../measure/memory.usage_in_bytes
[13:09:35] [k-_: this sounds like the kind of things people would write in a blogpost hm
[13:10:04] [k-_: they probably will be a good resource!
[13:10:10] rippa: has joined #ruby
[13:10:35] jhass: https://wiki.archlinux.org/index.php/Cgroups#Simple_usage
[13:11:25] jhass: systemd can make it a bit nicer of course
[13:11:39] arta82: has joined #ruby
[13:14:48] dblessing: has joined #ruby
[13:17:28] Ropeney: has joined #ruby
[13:17:32] unver: Hi, what's a good way to check two arrays for shared values?
[13:17:42] christiandsg: has joined #ruby
[13:18:05] maloik: [k-_: im not sure what to make of your comment :D
[13:18:09] nettoweb: has joined #ruby
[13:19:09] [k-_: it wasnt meant to be "do your research" kind of thing
[13:19:14] unver: nm, I just discovered the & operator
[13:19:25] allcentury: has joined #ruby
[13:19:40] jobewan: has joined #ruby
[13:19:51] cabreraM516: has joined #ruby
[13:20:00] [k-_: people spell nevermind with just two letters now :(
[13:20:24] unver: just how people don't capitalize or use punctuation for sentences :(
[13:21:52] fgo: has joined #ruby
[13:22:02] maloik: [k-_: ha that's what I was wondering :D cause I did try to look around a little but with little luck
[13:22:50] [k-_: so no one wrote blogposts? inconceivable
[13:23:05] [k-_: I *would* expect at least one ??\_(???)_/??
[13:23:10] maloik: well I suppose people did, just didn't find them (yet)
[13:23:10] JoshL: has joined #ruby
[13:23:29] jerius: has joined #ruby
[13:23:29] al2o3-cr: has joined #ruby
[13:24:31] francois_: has joined #ruby
[13:24:46] maloik: crossposted to the chef channel, it's probably more at home there
[13:27:31] DoubleMalt: has joined #ruby
[13:27:49] Guest50: has joined #ruby
[13:28:41] whippythellama: has joined #ruby
[13:29:12] hal_9000_: has joined #ruby
[13:30:29] victortyau: has joined #ruby
[13:31:19] sigurding: has joined #ruby
[13:32:31] quimrstorres: has joined #ruby
[13:32:47] decoponio: has joined #ruby
[13:33:54] lucyinthesky: has joined #ruby
[13:34:16] devdazed: has joined #ruby
[13:35:08] hs366: has joined #ruby
[13:36:11] hinbody: has joined #ruby
[13:37:16] DexterLB: has joined #ruby
[13:38:50] The_Phoenix: has joined #ruby
[13:39:14] frozen3: has joined #ruby
[13:39:27] jimms: has joined #ruby
[13:40:13] hashrocket: has joined #ruby
[13:42:52] nzst: has joined #ruby
[13:44:22] casadei_: has joined #ruby
[13:45:04] doodleha_: has joined #ruby
[13:46:17] chouhoulis: has joined #ruby
[13:47:09] cpruitt: has joined #ruby
[13:47:18] chouhoulis: has joined #ruby
[13:47:37] yalue: has joined #ruby
[13:47:42] nerdist: has joined #ruby
[13:47:47] umgrosscol: has joined #ruby
[13:47:48] socialjackie: has joined #ruby
[13:48:03] Polysics: has joined #ruby
[13:49:29] fmcgeough: has joined #ruby
[13:50:10] juanpaucar: has joined #ruby
[13:50:16] momomomomo: has joined #ruby
[13:51:05] timanema: has joined #ruby
[13:51:13] freerobby: has joined #ruby
[13:51:39] revoohc: has joined #ruby
[13:52:07] conor_: has joined #ruby
[13:52:55] ruby-lang817: has joined #ruby
[13:53:34] ruby-lang817: how do we override, the eql? in a certain class?
[13:53:47] platzhirsch: has joined #ruby
[13:54:01] bodgix: has joined #ruby
[13:54:24] bruno-: has joined #ruby
[13:55:15] socialjackie: ruby-lang817, like this?
[13:55:16] socialjackie: class Foo; def eql?(other); ... ; end; end
[13:56:26] ruby-lang817: ok kool, no aother anotation is needed like java or something
[13:56:27] apeiros: ruby-lang817: don't forget that if you change #eql?, you MUST implement #hash accordingly.
[13:57:07] apeiros: eql? is used in tandem with hash in many cases. most popular case is when the object is used as a hash key.
[13:57:38] apeiros: but also in things like Array#uniq, or Array#& (which internally use a Hash too)
[13:57:39] ruby-lang817: obejcts will be saved in a set
[13:57:48] apeiros: yepp. Set is backed by Hash.
[13:58:05] apeiros: so it won't work properly if you don't define both methods appropriately
[13:58:08] ruby-lang817: ok, any advice on how to implement the hash
[13:58:18] socialjackie: apeiros, which is why checking if an object is in a set is O(1) ?
[13:58:29] apeiros: socialjackie: yes
[13:59:11] sectionm1: has joined #ruby
[13:59:17] apeiros: ruby-lang817: if you do e.g. def eql?(other); self.class == other.class && @foo == other.foo; end
[13:59:28] apeiros: then you define hash as: def hash; [self.class, @foo].hash; end
[14:00:22] ruby-lang817: seems straight forward,
[14:00:47] Rubie: has joined #ruby
[14:01:01] apeiros: yupp, that's all.
[14:01:11] ruby-lang817: apeiros: always great help, thank you, socialjackie thank you as well....
[14:01:17] apeiros: just make sure that everything which is checked in eql? is also used in generating #hash
[14:01:17] conor_: has joined #ruby
[14:01:27] ruby-lang817: ok, understood
[14:01:37] ruby-lang817: I have few variables, so I will add them all the the hash as well
[14:01:42] apeiros: and the cheap way is to just reuse Array#hash :)
[14:02:08] ruby-lang817: sounds great to me, many thanks
[14:05:39] dgutierrez1287: has joined #ruby
[14:05:56] ljarvis: yay for deleting code
[14:06:06] yorickpeterse: tis the best thing
[14:06:07] bruno-: has joined #ruby
[14:06:15] juanpablo__: has joined #ruby
[14:06:52] Scripore: has joined #ruby
[14:06:56] ruby-lang817: one last question apeiros , the order of overriding these two methods is not important I assume?
[14:07:11] christiandsg: has joined #ruby
[14:07:27] ndrei: has joined #ruby
[14:08:17] socialjackie: ruby-lang817, as long as they don't call each other it should be fine :)
[14:08:28] sectionme: has joined #ruby
[14:08:30] silkfox: has joined #ruby
[14:09:31] rbennacer: has joined #ruby
[14:09:36] Tempesta: has joined #ruby
[14:09:38] hashrocket: has joined #ruby
[14:09:38] saddad: has joined #ruby
[14:11:14] RegulationD: has joined #ruby
[14:11:33] shock_one: has joined #ruby
[14:12:47] mrtg9970: has joined #ruby
[14:13:12] juanpablo__: has joined #ruby
[14:13:31] sectionm1: has joined #ruby
[14:15:12] v0n: has joined #ruby
[14:16:08] mrtg9970: has joined #ruby
[14:19:11] sectionme: has joined #ruby
[14:19:44] shmilan: has joined #ruby
[14:19:45] poguez_: has joined #ruby
[14:19:54] dayatz: has joined #ruby
[14:20:28] Uuku: has joined #ruby
[14:20:55] dtzitz: has joined #ruby
[14:22:44] nerdist: has joined #ruby
[14:23:30] Guest50: has joined #ruby
[14:23:44] gregf: has joined #ruby
[14:24:00] juanpablo__: has joined #ruby
[14:24:14] Zamyatin: has joined #ruby
[14:24:41] dtzitz: has left #ruby: ()
[14:26:04] dopie: has joined #ruby
[14:26:11] Zamyatin: has joined #ruby
[14:26:18] spectra: has joined #ruby
[14:26:31] khebbie: has joined #ruby
[14:27:11] apeiros: ruby-lang817: nope. order of definition doesn't matter.
[14:27:16] dblessing: has joined #ruby
[14:28:20] conor_: has joined #ruby
[14:28:25] machinewar: has joined #ruby
[14:31:33] lessless: has joined #ruby
[14:31:40] havenwood: has joined #ruby
[14:32:11] foureight84: has joined #ruby
[14:32:31] banister: has joined #ruby
[14:33:22] terlar: has joined #ruby
[14:35:18] Trynemjoel: has joined #ruby
[14:35:53] jpfuentes2: has joined #ruby
[14:36:41] gard: has joined #ruby
[14:36:48] MasterPiece: has joined #ruby
[14:37:23] lucyinthesky: has left #ruby: ("Leaving")
[14:37:28] joonty: has joined #ruby
[14:37:51] Kalov: has joined #ruby
[14:38:44] mrtg9970: has joined #ruby
[14:39:02] shmilan: has joined #ruby
[14:39:08] The_Phoenix: has joined #ruby
[14:40:15] skinofstars: has left #ruby: ()
[14:41:53] kies: has joined #ruby
[14:44:21] jpfuentes2: has joined #ruby
[14:45:30] michael_mbp: has joined #ruby
[14:46:03] spectra: has joined #ruby
[14:46:45] RegulationD: has joined #ruby
[14:47:23] olistik: has joined #ruby
[14:47:30] soc42: has joined #ruby
[14:50:16] coban2k: has joined #ruby
[14:50:37] chouhoul_: has joined #ruby
[14:51:37] Torrieri: has joined #ruby
[14:51:37] Torrieri: has joined #ruby
[14:52:38] clarkenciel: has joined #ruby
[14:53:07] chouhoul_: has joined #ruby
[14:53:47] mrtg9971: has joined #ruby
[14:54:20] TheNet: has joined #ruby
[14:54:34] mrtg9970: has joined #ruby
[14:54:39] Thomas-0725: has joined #ruby
[14:55:27] jgpawletko: has joined #ruby
[14:56:16] sectionm1: has joined #ruby
[14:58:13] blackoperat: has joined #ruby
[14:58:19] shevy: http://www.trelford.com/blog/post/funsharp.aspx <- do we have something like this in ruby? especially the turtle-move one
[15:00:25] umgrosscol: has joined #ruby
[15:00:35] lwu: has joined #ruby
[15:01:36] freerobby: has joined #ruby
[15:01:43] khebbie: has joined #ruby
[15:01:45] northfurr: has joined #ruby
[15:02:31] lwu: has joined #ruby
[15:02:59] socialjackie: https://github.com/jashkenas/ruby-processing ?
[15:03:21] j5s7: has joined #ruby
[15:05:17] lucyinthesky: has joined #ruby
[15:05:26] [k-_: a turtle would be that hackety thingie
[15:05:33] tkuchiki: has joined #ruby
[15:05:48] socialjackie: http://www.hackety.com/
[15:06:47] m8: has joined #ruby
[15:07:01] jtdowney: has joined #ruby
[15:07:43] rbennacer: has joined #ruby
[15:08:14] shevy: _why designed like a kid
[15:08:50] j5s7: has joined #ruby
[15:08:53] socialjackie: shevy, the drawings?
[15:09:57] northfurr: has joined #ruby
[15:10:32] jds: has joined #ruby
[15:10:53] cschneid_: has joined #ruby
[15:11:32] blackmesa: has joined #ruby
[15:11:36] niko: has joined #ruby
[15:12:15] shevy: socialjackie yeah but also the old whycats
[15:12:29] lwu: has joined #ruby
[15:12:40] socialjackie: i loved the poignant guide.
[15:12:46] shevy: https://tctechcrunch2011.files.wordpress.com/2013/01/the-foxes-4c.png?w=286
[15:13:59] socialjackie: http://mislav.uniqpath.com/poignant-guide/images/the.foxes-4g.png
[15:14:25] jtdowney: has joined #ruby
[15:14:25] jtdowney: has joined #ruby
[15:14:33] kaikazou: has joined #ruby
[15:14:58] NeverDie: has joined #ruby
[15:15:29] bodgix: has left #ruby: ()
[15:15:31] rbennacer: has joined #ruby
[15:16:21] hashrocket: has joined #ruby
[15:16:40] msnyon: has joined #ruby
[15:18:06] CorySimmons: has joined #ruby
[15:18:12] keen_____: has joined #ruby
[15:18:19] shmilan: Hello, everyone. I was wondering if there was a way to not return to an "if" statement when iterating through an array during an if/elsif loop once the elsif statement has been reached?
[15:19:07] socialjackie: Can you post an example?
[15:19:09] [k-_: "not to return to an \"if\" statement?"
[15:20:36] lucyinthesky: has left #ruby: ("Leaving")
[15:20:53] jobewan: has joined #ruby
[15:21:02] shmilan: Sure. Can I link to github the example I am working with?
[15:21:37] sectionme: has joined #ruby
[15:22:43] Maletor: has joined #ruby
[15:22:53] shmilan: https://github.com/lynchd2/TOP-Ruby-Programming/blob/master/test.rb
[15:22:54] finisherr: has joined #ruby
[15:22:59] Chau: has joined #ruby
[15:23:31] finisherr: Quick question. When I assign a var to a var, am i copying that value or assining by reference?
[15:23:54] Rubie: has joined #ruby
[15:24:03] finisherr: so if the value of one var changes, both change correct?
[15:24:10] machinewar: yep you will indeed update the referenced object if you do that, be careful
[15:24:18] machinewar: might want to clone or dup
[15:24:27] finisherr: just as suspected. Thanks!
[15:24:55] _blizzy_: has joined #ruby
[15:25:36] socialjackie: shmilan, do you mean the `break` statement?
[15:26:39] Helheim: has joined #ruby
[15:30:06] tkuchiki: has joined #ruby
[15:30:45] shmilan: I tried using it but I don't think it works to what I am trying to do.. I think I need to rework the method.
[15:31:29] [k-_: what are you trying to do
[15:32:04] rcvalle: has joined #ruby
[15:32:12] khebbie: has joined #ruby
[15:32:33] nettoweb: has joined #ruby
[15:32:36] _blizzy_: has joined #ruby
[15:33:14] coban2k: has joined #ruby
[15:33:34] psy: has joined #ruby
[15:33:48] christiandsg: has joined #ruby
[15:33:48] coban2k_: has joined #ruby
[15:33:55] northfurr: has joined #ruby
[15:34:38] psy: has joined #ruby
[15:34:44] blue_deref: has joined #ruby
[15:35:10] shmilan: I'm checking to see if one array has the same symbol in the same index as a second array, or if they have the same symbols but different indexes.
[15:35:48] Cache_Money: has joined #ruby
[15:35:59] bruno-: has joined #ruby
[15:36:04] lwu: has joined #ruby
[15:36:14] nertzy: has joined #ruby
[15:36:47] [k-_: Array.index(object)
[15:36:55] [k-_: &ri Array#index
[15:36:55] `derpy: http://www.rubydoc.info/stdlib/core/Array#index-instance_method
[15:39:15] dgutierrez1287: has joined #ruby
[15:42:26] michaeldeol: has joined #ruby
[15:42:58] TomyLobo: has joined #ruby
[15:43:44] hobodave: has joined #ruby
[15:43:59] jeadr: has joined #ruby
[15:44:28] [k-: experiment with it, shmilan
[15:44:35] socialjackie: shmilan, does this help? https://gist.github.com/jackwillis/c2f9d17e570188b5e90b
[15:45:14] dfockler: has joined #ruby
[15:45:32] [k-: interesting solution, socialjackie!
[15:45:39] ghoti: has joined #ruby
[15:45:48] [k-: you'd be great in functional!
[15:45:52] dr3w: has joined #ruby
[15:45:54] hobodave: has joined #ruby
[15:45:59] gambl0re: has joined #ruby
[15:46:48] PaulCapestany: has joined #ruby
[15:47:40] mandarinkin: has joined #ruby
[15:47:53] jhass: shmilan: what's your actual problem? Do you want to know if there is a difference? do you want to know what the difference is? where it is?
[15:47:55] aredridel: has joined #ruby
[15:48:08] UtkarshRay: has joined #ruby
[15:48:14] DoubleMalt: has joined #ruby
[15:48:38] jhass: also that you call your colors numbers is kinda confusing :P
[15:49:39] soc42: has joined #ruby
[15:50:34] shevy: shmilan wins the jhass-confusion-day prize!
[15:50:41] shmilan: Thank you for that documentation, [k-_! I'm working through it..
[15:50:41] ghoti: has joined #ruby
[15:51:06] [k-: >> a = %i[blue purple green blue red]; b = a.shuffle; a.map.with_index { |item,i| [item,b.index(item) == i] }
[15:51:06] rehat_: has joined #ruby
[15:51:06] bronson: has joined #ruby
[15:51:07] ruboto: [k- # => [[:blue, true], [:purple, false], [:green, false], [:blue, false], [:red, false]] (https://eval.in/416840)
[15:51:21] shmilan: Socialjackie, I am going to be honest and say that that solution is a bit over my head :). I am going to work through it and try to understand it
[15:52:28] nonparfumee: has joined #ruby
[15:52:36] sectionm1: has joined #ruby
[15:52:37] shmilan: Lol jhass, I was working with numbers and switched to colors. That would be my fault.
[15:52:39] rsl: has joined #ruby
[15:52:51] [k-: >> [(a = %i[blue purple green blue red]; b = a.shuffle; a.map.with_index { |item,i| [item,b.index(item) == i] }), a, b]
[15:52:52] ruboto: [k- # => [[[:blue, false], [:purple, true], [:green, false], [:blue, false], [:red, false]], [:blue, :purple, ...check link for more (https://eval.in/416843)
[15:53:02] jhass: shmilan: you should answer my question nonetheless ;)
[15:53:23] ruboto: momomomomo # => true (https://eval.in/416845)
[15:53:52] momomomomo: 2/3 > .333333333333333333333333333333333
[15:53:53] [k-: yes momomomomo? does your ruby not return true?
[15:54:04] momomomomo: nah just bored
[15:54:09] momomomomo: ah my cluster is up now :D
[15:54:35] pdoherty: has joined #ruby
[15:54:42] jhass: momomomomo: we got a hangman game over in #ruby-offtopic for those occasions ;)
[15:54:42] [k-: it's worth noting that index returns the first index
[15:54:43] shmilan: I want to count two main similarities between the two arrays; if they have the same symbol and index, and if they have the same symbols but different indexes.
[15:55:29] shmilan: I am sorry if I am being confusing. I am a beginner, but everyone here is being very tolerable of me and I appreciate that.
[15:55:38] [k-: same symbols would be using & and checking the length
[15:55:47] momomomomo: shmilan: this might help
[15:55:50] LMity: has joined #ruby
[15:55:51] momomomomo: shmilan: !ask
[15:55:51] helpa: shmilan: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[15:55:53] [k-: index would require iterating
[15:55:57] jhass: shmilan: try to be precise, what specific answer do you want for what input? eg, compare([:blue, :red], [:blue, :orange]) #=> 1 or #=> false or ...?
[15:55:58] ghoti: has joined #ruby
[15:56:01] momomomomo: shmilan: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[15:56:11] jhass: ?help momomomomo
[15:56:11] ruboto: momomomomo, You can find an overview of my commands at http://ruby-community.com/ruboto/commands
[15:56:18] [k-: ?ask jhass
[15:56:18] ruboto: jhass, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[15:56:22] momomomomo: jhass: the ask isn't the same
[15:56:26] [k-: ?answers jhass
[15:56:26] ruboto: jhass, How to ask the right questions to get you the right answer: https://www.mikeash.com/getting_answers.html
[15:56:29] chouhoulis: has joined #ruby
[15:56:32] momomomomo: which IMO is silly
[15:56:36] momomomomo: see that's just silly
[15:56:39] momomomomo: why change the command
[15:56:54] machinewar: http://ruby-doc.org/core-2.2.0/Array.html#method-i-find_index
[15:56:58] machinewar: checkout that method out could be helpful
[15:57:18] machinewar: prob need to account for multiple instances of that symbol though
[15:57:22] blackoperat: has joined #ruby
[15:57:22] [k-: its the same method i linked, in a different representation
[15:57:33] coban2k: has joined #ruby
[15:57:33] [k-: i think rubydocs does aliases well
[15:57:40] [k-: yardoc makes it look crazy
[15:57:43] devoldmx: has joined #ruby
[15:57:49] machinewar: [k-: sorry didn't see yours, at work and just jumped into this convo lol
[15:57:57] Aswebb_: has joined #ruby
[15:59:49] [k-: machinewar:https://eval.in/416843
[15:59:58] shmilan: jhass: For input I would like an integer for the total number of times it was counted for.
[16:00:13] jhass: shmilan: try again, I don't understand a word
[16:00:18] [k-: output?
[16:00:30] jhass: shmilan: make examples with concrete ruby values for inputs and result
[16:01:04] shmilan: Thanks for the article, ruboto and momomomomo.
[16:01:12] jhass: ?justabot
[16:01:12] ruboto: I'm just a bot. You don't need to address me.
[16:01:32] dopie: has joined #ruby
[16:02:19] sectionme: has joined #ruby
[16:02:53] Scripore: has joined #ruby
[16:02:55] towski_: has joined #ruby
[16:03:28] RTG`: has joined #ruby
[16:04:23] tvw: has joined #ruby
[16:04:32] troyready: has joined #ruby
[16:04:41] psye: has joined #ruby
[16:04:42] shock_one: has joined #ruby
[16:05:34] amclain: has joined #ruby
[16:07:32] pragmatism: has joined #ruby
[16:07:45] pauly_oc: has joined #ruby
[16:10:30] lwu: has joined #ruby
[16:10:43] pothibo: has joined #ruby
[16:11:28] mleung: has joined #ruby
[16:12:33] gwendall: has joined #ruby
[16:14:16] JoshL: has joined #ruby
[16:14:44] rakm: has joined #ruby
[16:15:08] wldcordeiro: has joined #ruby
[16:16:01] rbennacer: has joined #ruby
[16:16:28] ramfjord: has joined #ruby
[16:16:33] Senjai: has joined #ruby
[16:17:50] darkxploit: has joined #ruby
[16:18:11] greedo: yes jhass /win fail
[16:18:17] sectionme: has joined #ruby
[16:18:56] basmoura: has joined #ruby
[16:20:20] ghoti_: has joined #ruby
[16:22:51] Nilium: ruboto is just shy.
[16:23:21] swgillespie: has joined #ruby
[16:24:24] tens0r: has joined #ruby
[16:24:53] Hanmac: has joined #ruby
[16:27:09] [Butch]: has joined #ruby
[16:27:25] leafybasil: has joined #ruby
[16:30:15] jeadr: has joined #ruby
[16:30:28] einarj: has joined #ruby
[16:31:31] mikecmpbll: has joined #ruby
[16:32:40] DelDotB: has joined #ruby
[16:34:28] rakm: has joined #ruby
[16:34:33] victortyau: has joined #ruby
[16:35:26] pietr0: has joined #ruby
[16:35:52] symm-: has joined #ruby
[16:37:03] luckyme: has joined #ruby
[16:37:03] michaeldeol: has joined #ruby
[16:37:29] Rubie: has joined #ruby
[16:37:49] lannonbr: has joined #ruby
[16:40:24] fantazo: has joined #ruby
[16:41:01] bricker: has joined #ruby
[16:41:31] VeganGreg: has joined #ruby
[16:45:09] RegulationD: has joined #ruby
[16:45:20] wldcordeiro: has joined #ruby
[16:45:53] juanpaucar: has joined #ruby
[16:46:16] juanpaucar: has joined #ruby
[16:47:20] benlieb: has joined #ruby
[16:48:59] Seich: has joined #ruby
[16:49:50] jpfuentes2: has joined #ruby
[16:50:31] bmurt: has joined #ruby
[16:50:36] clarkenciel: has joined #ruby
[16:51:26] Jackneill: has joined #ruby
[16:52:01] DoubleMalt: has joined #ruby
[16:52:20] shevy: a truly modest bot
[16:53:37] cschneid_: If I make a regex a constant, it'll be only compiled once, and then reused, but if it's a literal in the code path, it'll get recompiled every time?
[16:53:54] DanielI: has joined #ruby
[16:54:10] Vile`: has joined #ruby
[16:54:27] tens0r: has joined #ruby
[16:55:23] shevy: not sure if compile is the right word but I believe it will be set anew when you have it as a variable assignment every time you assign to the variable, whereas if you stored it in a constant, you probably only just refer to the same value lateron again
[16:55:55] StevenXL: has joined #ruby
[16:56:02] rbennacer: has joined #ruby
[16:56:22] Musashi007: has joined #ruby
[16:57:13] cschneid_: shevy: well, regexes get parsed & compiled into the state machine. But I want to use the same regex over and over, so it'd make sense to only do that once
[16:57:17] cschneid_: a constant will probably do it.
[16:57:26] cschneid_: TRAILING_SPACES = /\s+$/.freeze for instance
[16:58:15] cschneid_: I just remember something about new versions of ruby auto-reusing strings or something if you froze them
[16:58:21] ellisTAA: has joined #ruby
[16:59:24] j4cknewt: has joined #ruby
[16:59:40] tvw: has joined #ruby
[17:02:07] jbw: has joined #ruby
[17:02:32] kirun: has joined #ruby
[17:03:20] lele: has joined #ruby
[17:04:07] arta82: has joined #ruby
[17:04:17] Torrieri: has joined #ruby
[17:04:25] Rutix: has joined #ruby
[17:04:25] Rutix: has joined #ruby
[17:05:02] baroquebobcat: has joined #ruby
[17:07:52] pengin: has joined #ruby
[17:08:02] baroquebobcat_: has joined #ruby
[17:09:02] ascarter: has joined #ruby
[17:09:43] dseitz: has joined #ruby
[17:09:59] shock_one: has joined #ruby
[17:10:15] laudo: has joined #ruby
[17:12:19] axl_: has joined #ruby
[17:16:46] alakra: has joined #ruby
[17:17:16] carlosoliveira: has joined #ruby
[17:19:40] codecop: has joined #ruby
[17:20:06] chipotle: has joined #ruby
[17:22:14] Thomas-0725: has joined #ruby
[17:22:39] unver: has joined #ruby
[17:22:51] christiandsg: has joined #ruby
[17:23:05] unver: I really dislike this structure, http://hastebin.com/emalapiwij.rb, is a better way?
[17:23:41] unver: I'd like to prevent any errors from raising, maybe I should just barrel in and use begin / rescues
[17:24:12] jackjackdripper: has joined #ruby
[17:24:35] BraddPitt: that is why begin/rescue was created
[17:24:54] BraddPitt: but overall, that really isnt /that/ unclean unver
[17:25:08] tubbo: if you didn't break the law of demeter it would be a bit easier
[17:25:32] tubbo: event.try(:venue_name) || Rcms::EventVenue.find_by(event_id: event.id).venue.try(:name)
[17:25:43] jhass: why would it find something via the join model if the association fails?
[17:25:50] tubbo: event.try(:venue_name) || Rcms::EventVenue.find_by(event_id: event.id).try(:venue_name)
[17:25:57] krz: so @product.small_image_url.include?('/tmp/') returns true. why does [@product.small_image_url, @product.medium_image_url, @product.large_image_url].include?('/tmp/') return false?
[17:26:28] unver: tubbo: thanks, I'll consider using an || structure
[17:26:29] [k-: unclosed [
[17:26:31] jhass: krz: because Array#include? isn't String#include?
[17:26:39] [k-: oh it's closed
[17:26:58] jhass: krz: check Array#grep
[17:27:05] runinsquares: has joined #ruby
[17:27:06] platzhirsch: has left #ruby: ()
[17:27:08] krz: ok thanks
[17:27:45] jbw: has joined #ruby
[17:28:20] vondruch: has joined #ruby
[17:28:28] tacotaco_: has left #ruby: ()
[17:28:54] krz: jhass: so if i wanted to search form "/temp/", it would look like .grep(/\/tmp\//) right?
[17:29:09] krz: form=for
[17:29:16] jhass: yeah, %r{/tmp/} for some less ugly regex literal
[17:29:26] krz: ah kk ty
[17:29:39] jackjackdripper: has joined #ruby
[17:30:21] apeiros: tmp vs. temp
[17:30:33] apeiros: not that you trip over a typo ;-)
[17:31:36] iamse7en: has joined #ruby
[17:31:50] tvw: has joined #ruby
[17:31:57] Aswebb_: has joined #ruby
[17:32:12] iamse7en: Is there a way to round to the nearest .5? e.g. 1.1 becomes 1 and 1.3 becomes 1.5?
[17:32:55] Mon_Ouie: Yes, #round
[17:33:05] juanpaucar: has joined #ruby
[17:33:08] Mon_Ouie: Oh, sorry I misread
[17:33:16] darix: uhm math rules are saying differently though
[17:33:40] iamse7en: i guess I'll just have to make my own method and spell it all out
[17:33:43] braincrash: has joined #ruby
[17:33:47] shmilan: (x*2.0).round / 2.0, where x is your number
[17:33:54] [Butch]: has joined #ruby
[17:34:57] gregf_: krz: grep is on an enumerable, not a string :/
[17:35:57] apeiros: iamse7en: ^ what shmilan said
[17:36:35] gregf_: krz: like so: ["foo bar /tmp/", "quux" ].grep(%r{/tmp/}) and for a string: "foo bar /tmp/" =~ %r{/tmp/}
[17:37:23] socialjackie: shmilan, there's also Numeric#fdiv for float division: (x*2).round.fdiv(2)
[17:37:33] iamse7en: shmilan: awesome, working great, thanks!
[17:41:15] [k-: since the first number, x, is already a float, the .0 is redundant
[17:41:38] [k-: in the second case, it is not
[17:41:49] bmurt: has joined #ruby
[17:42:47] dr3w: has joined #ruby
[17:42:54] nettoweb: has joined #ruby
[17:43:43] shmilan: ^^ you're correct, [k-
[17:43:50] iamse7en: right, thanks
[17:44:23] lkba: has joined #ruby
[17:44:28] baweaver: has joined #ruby
[17:44:31] Musashi007: has joined #ruby
[17:44:32] shmilan: iamse7en: no problem
[17:45:34] baweaver: has joined #ruby
[17:45:53] mpistone: has joined #ruby
[17:46:44] ascarter: has joined #ruby
[17:49:52] wviana: has joined #ruby
[17:50:06] jobewan: has joined #ruby
[17:50:20] wviana: Hi, could you help me to get what's wrong with it ? <%= l.bandeira.try(:nome) << l.especificidade_loja_hb ? " HB" : ""%>
[17:51:25] jhass: wviana: what do you think << does?
[17:52:05] wviana: jhass: concatenate strings, doesn't ?
[17:52:09] hobodave: has joined #ruby
[17:52:41] jhass: what does .try return?
[17:52:43] socialjackie: what if l.bandeira.try(:nome) is nil?
[17:52:58] rbennacer: has joined #ruby
[17:53:15] wviana: jhass, socialjackie: It's a string.
[17:53:24] [k-: :o try is a monad
[17:53:27] djbkd: has joined #ruby
[17:53:30] socialjackie: but try sometimes returns nil.
[17:53:34] [k-: well somewhat
[17:53:49] [k-: actually im talking nonsense
[17:54:21] jhass: any news captain obvious?
[17:54:33] wviana: socialjackie: What if I do l.bandeira.nome ? It could return nil too.
[17:54:57] socialjackie: If l.bandeira is nil, l.bandeira.try(:nome) would be nil instead of blowing up. That's why try exists
[17:55:05] jhass: wviana: I think that expression doesn't make a whole lot of sense even if we get the errors out
[17:55:11] [k-: yes, it's like maybe
[17:55:11] jhass: wviana: what do you want to do?
[17:55:47] wviana: jhass: concatenate the " HB" if l.especificidade_loja_hb is true
[17:55:47] djbkd: has joined #ruby
[17:56:36] socialjackie: would this work? l.especificidade_loja_hb ? "#{l.bandeira.nome} HB" : l.bandeira.nome
[17:57:01] [k-: better.
[17:57:03] jhass: wviana: just <%= l.banderia.try(:nome) %><%= "HB" if l.especificidade_loja_hb %>
[17:57:04] wviana: socialjackie: yeap
[17:57:21] wviana: socialjackie: Thank you very much
[17:57:28] socialjackie: that works too
[17:57:51] benlieb: has joined #ruby
[17:58:06] wviana: jhass: a good one too.
[17:58:11] ruby-lang727: has joined #ruby
[17:58:12] wviana: thank you guys
[17:58:17] jhass: ?guys wviana
[17:58:18] ruboto: wviana, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[17:58:30] devoldmx: has joined #ruby
[17:58:32] prudi-ruby: has joined #ruby
[17:58:50] [k-: not everything has to be written in an overly complex/clever way
[17:59:23] [k-: ((.).(.).(.)) is something you can do in haskell, and it is complex
[17:59:30] bricker: [k-: unless you're a java developer
[17:59:44] jhass: [k-: why don't you join #haskell already
[17:59:46] [k-: java code isnt clever
[17:59:57] tens0r: has joined #ruby
[18:00:00] vondruch: has joined #ruby
[18:00:00] [k-: haskell is toomuchtext4me
[18:00:10] jhass: then stop bringing it up?
[18:00:25] [k-: it was just an example
[18:00:33] jhass: no, not just one
[18:00:41] jhass: you're talking about nothing else for days
[18:00:51] jhass: it's nice that you learn haskell
[18:00:55] jhass: but this channel is about ruby
[18:01:02] sgambino: has joined #ruby
[18:01:28] lordkryss: has joined #ruby
[18:01:40] [k-: it's the most complex code that is the shortest i know of :/
[18:02:55] vondruch: has joined #ruby
[18:03:06] millerti: has joined #ruby
[18:03:43] prudi-ruby: Hi! When do a Task must depend on :enviroment?
[18:03:53] jhass: ?rails prudi-ruby
[18:03:53] ruboto: prudi-ruby, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[18:04:12] thiagovsk: has joined #ruby
[18:04:13] prudi-ruby: My mistake! Sorry!
[18:04:16] mephistophocles: has joined #ruby
[18:04:38] symm-: has joined #ruby
[18:05:13] mephistophocles: has joined #ruby
[18:08:08] knrz: has joined #ruby
[18:10:02] ramfjord: has joined #ruby
[18:10:39] prudi: has joined #ruby
[18:10:48] jeadr: has joined #ruby
[18:12:13] nzst: has joined #ruby
[18:12:28] dopie: has joined #ruby
[18:15:25] swgillespie: has joined #ruby
[18:16:14] towski_: has joined #ruby
[18:17:07] cball: has joined #ruby
[18:18:24] postmodern: has joined #ruby
[18:18:38] baweaver: has joined #ruby
[18:18:54] RobertBirnie: has joined #ruby
[18:19:05] DLSteve: has joined #ruby
[18:19:29] DLSteve: has joined #ruby
[18:20:10] ghoti_: has joined #ruby
[18:20:17] lessless: has joined #ruby
[18:23:37] benlieb: has joined #ruby
[18:23:41] renanoronfle: has joined #ruby
[18:24:15] lwu_: has joined #ruby
[18:25:47] ndrei_: has joined #ruby
[18:26:11] NeverDie: has joined #ruby
[18:28:03] christiandsg: has joined #ruby
[18:29:14] hobodave: has joined #ruby
[18:29:51] csmb: has joined #ruby
[18:30:18] momomomomo: has joined #ruby
[18:30:48] ndrei: has joined #ruby
[18:31:35] nofxx: has joined #ruby
[18:35:02] RobertBirnie: has joined #ruby
[18:35:35] kies: has joined #ruby
[18:38:37] s2013: has joined #ruby
[18:41:26] Axy: has joined #ruby
[18:41:26] Axy: has joined #ruby
[18:42:01] rbowlby: has joined #ruby
[18:42:48] freerobby: has joined #ruby
[18:42:56] VeganGreg: has joined #ruby
[18:43:55] Quandl: has joined #ruby
[18:44:05] ta: has joined #ruby
[18:44:16] einarj: has joined #ruby
[18:44:23] jerius_: has joined #ruby
[18:44:50] Me: has joined #ruby
[18:45:50] yfeldblum: has joined #ruby
[18:45:51] djbkd: has joined #ruby
[18:46:00] beef-wellington: has joined #ruby
[18:46:16] chouhoul_: has joined #ruby
[18:46:21] alphaatom: has joined #ruby
[18:47:37] RobertBirnie: has joined #ruby
[18:47:45] l3ck: has joined #ruby
[18:48:51] swgillespie: has joined #ruby
[18:50:04] Rubie: has joined #ruby
[18:50:52] toretore: has joined #ruby
[18:52:38] mephistophocles: has joined #ruby
[18:52:41] chouhoulis: has joined #ruby
[18:52:53] bronson: has joined #ruby
[18:53:24] mephistophocles: has joined #ruby
[18:54:05] Trynemjoel: has joined #ruby
[18:54:06] RobertBirnie: has joined #ruby
[18:55:51] cabreraM516: has joined #ruby
[18:56:34] northfurr: has joined #ruby
[18:56:38] Spami: has joined #ruby
[18:56:45] gwendall: has joined #ruby
[18:57:06] kies: has joined #ruby
[18:57:20] vondruch: has joined #ruby
[18:58:25] dEPy: has joined #ruby
[18:58:48] chabil: has joined #ruby
[18:58:56] benlieb: has joined #ruby
[18:59:29] vondruch: has joined #ruby
[18:59:50] jackjackdripper: has joined #ruby
[19:00:17] nhhagen: has joined #ruby
[19:00:33] vondruch: has joined #ruby
[19:00:41] apeiros: don't define a method called `color` in toplevel in pry
[19:00:43] RobertBirnie: has joined #ruby
[19:00:44] apeiros: kills it cold
[19:00:56] DoubleMalt: has joined #ruby
[19:01:21] jeadr: has joined #ruby
[19:01:36] vondruch: has joined #ruby
[19:02:22] youngbaks: has joined #ruby
[19:02:43] vondruch: has joined #ruby
[19:02:55] havenwood: apeiros: def color; :eek! end; color # :eek!
[19:03:08] havenwood: apeiros: it survived
[19:03:27] apeiros: havenwood: let me see, maybe it's awesome_print which crashes
[19:03:33] gwendall: has joined #ruby
[19:03:42] mozzarella: now do 'test'
[19:03:44] havenwood: apeiros: ah, yeah I don't use
[19:03:53] apeiros: [1] pry(main)> def color(a,b); end
[19:03:53] apeiros: (pry):1:in `color': wrong number of arguments (0 for 2) (ArgumentError)
[19:03:53] apeiros: from /Users/stefan/.rvm/gems/ruby-2.2.2/gems/pry-0.10.1/lib/pry/output.rb:35:in `decolorize_maybe'
[19:03:58] apeiros: seems to be pry itself
[19:04:09] Scripore: has joined #ruby
[19:04:17] michaeldeol: has joined #ruby
[19:04:21] apeiros: most recent pry version too
[19:04:27] kellray: has joined #ruby
[19:04:36] miah: same, i get a crash too: Pry version 0.10.1 on Ruby 2.2.2
[19:04:40] apeiros: havenwood: ah, yours survived because arg count was correct
[19:04:51] mozzarella: it seems to be using a color function??? for coloring text
[19:05:07] havenwood: apeiros: ah, yup, reproduced :O
[19:05:07] rideh: has joined #ruby
[19:05:09] ghoti: has joined #ruby
[19:05:24] nettoweb: has joined #ruby
[19:05:28] mozzarella: do "def color; end" and the color is gone
[19:05:31] vondruch: has joined #ruby
[19:05:36] Spami: has joined #ruby
[19:05:47] Guest50: has joined #ruby
[19:05:49] jhass: it's a feature!
[19:05:49] apeiros: private def color helps
[19:05:58] bluOxigen: has joined #ruby
[19:06:00] apeiros: obviously the method is invoked via method missing
[19:06:57] apeiros: another less known trick is to define toplevel methods in the singleton_class of toplevel
[19:07:58] diegoviola: has joined #ruby
[19:08:34] jhass: or do color = Module.new { def color; ...; end; }.method(:color) !
[19:08:44] jhass: er, instance_method
[19:08:48] jhass: you get the idea
[19:08:59] lele: has joined #ruby
[19:09:01] jackjackdripper1: has joined #ruby
[19:09:13] apeiros: also doesn't work
[19:09:19] Bobsz: has joined #ruby
[19:09:28] apeiros: unless I don't get the idea
[19:09:59] foureight84: has joined #ruby
[19:10:27] jhass: >> color = Module.new { def self.color; puts "yay!"; end; }.method(:color); color.()
[19:10:28] ruboto: jhass # => yay! ...check link for more (https://eval.in/416896)
[19:10:29] Bobsz: Howdy, I am using optparse, but my system needs to be able to take arbitray options. That is there are so many that we can't predefine them but can assume good use input. Is there anyway to do that?
[19:10:48] apeiros: jhass: yeah, then I got you correctly. can't be used in another method :)
[19:11:01] mwlang: has joined #ruby
[19:11:09] apeiros: Bobsz: I don't think optparse can do that
[19:11:13] jhass: pff, details
[19:11:14] shmilan: has joined #ruby
[19:11:27] apeiros: might be that you can trigger the tokenizing yourself, though
[19:11:27] jhass: just use a constant
[19:11:45] apeiros: jhass: then I'd have to rewrite the code which uses the method, so nope :)
[19:11:52] apeiros: I prefer just using private
[19:12:08] miah: ARGV is just an array, parse away =)
[19:12:09] jhass: you know I'm not serious?
[19:12:23] Bobsz: miah: yes but it's nicer to use optparse
[19:12:34] apeiros: jhass: it's friday evening, my non-serious detector is even less functional than normally
[19:12:41] arup_r: has joined #ruby
[19:13:20] aperios: ACTION slaps apeiros' seriousness detector
[19:13:37] apeiros: why do you break it? :(
[19:13:52] jhass: who? you did it all on your own!
[19:13:57] apeiros: I know it's no good, but it worked at least sometimes
[19:14:25] apeiros: jhass: can't fool me. you've colored nicks.
[19:14:34] jhass: same color here
[19:14:40] apeiros: haha, yeah, sure
[19:15:00] jhass: http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20150814_211452.png
[19:15:13] ljarvis: Bobsz: yeah it's not possible, Slop lets you do it though
[19:15:15] apeiros: psssshhh??? how bad
[19:16:14] Bobsz: ljarvis: what's that? slop
[19:16:29] vondruch: has joined #ruby
[19:16:29] jhass: Bobsz: https://rubygems.org
[19:16:29] ljarvis: some ruby option parser, i heard its quite good
[19:16:45] NeverDie: has joined #ruby
[19:17:08] jhass: Bobsz: but I mean, consider reading a config file or something
[19:17:29] ljarvis: yeah you really should just define possibilities
[19:17:33] jhass: doesn't sound like ARGV is the right job if you get tired of enumerating the options
[19:17:41] sarkyniin: has joined #ruby
[19:18:12] yuung: has joined #ruby
[19:18:31] Bobsz: ljarvis: it's close to 150k
[19:18:49] ljarvis: yeah you don't want options
[19:18:52] axl_: has joined #ruby
[19:18:59] ljarvis: yeah srsly
[19:19:09] jhass: more like, a database
[19:19:12] miah: 150k options? how is that even possible.
[19:19:33] Bobsz: the data is in a database, we are writing a script to query the database
[19:19:42] apeiros: aaa..zzz are all valid options? :D
[19:19:46] yuung: what is this syntax? https://gist.github.com/johnmarinelli/f95f290332f3b6ddc3ea
[19:19:50] ruboto: apeiros # => 11881376 (https://eval.in/416902)
[19:19:59] TheNet: has joined #ruby
[19:20:02] Bobsz: apeiros: no
[19:20:15] jhass: miah: 4294967295 since linux 2.6.23
[19:20:35] miah: arg_max goes that hi? neat.
[19:20:40] apeiros: yuung: it's calling a method
[19:20:42] dfockler: yuung: it's using a mix in and calling a method called 'base_uri'
[19:20:49] yuung: ah i see. thanks
[19:20:52] dfockler: with an argument 'google.com'
[19:21:06] Bobsz: There are metrics in a database and then you just give the script the metric and the item you watch to check and it sends the query. It's rather simple
[19:21:13] apeiros: from which we can conclude that HTTParty does evil things on self.included
[19:21:39] jenrzzz: has joined #ruby
[19:21:43] vondruch: has joined #ruby
[19:22:45] miah: https://rubygems.org/gems/gem-shut-the-fuck-up
[19:22:51] mephistophocles: has joined #ruby
[19:23:30] jhass: I think bundler ships something to disable that now, at least for bundle install
[19:24:09] yqt: has joined #ruby
[19:24:13] jhass: https://github.com/bundler/bundler/blob/master/CHANGELOG.md#1100pre-2015-05-03
[19:25:24] northfurr: has joined #ruby
[19:25:39] miah: apeiros: fyi https://github.com/pry/pry/issues/1460
[19:26:38] jhass: Bobsz: so why bother with complex ARGV parsing, ARGV.each_slice(2) do |metric, item| done
[19:26:42] rbennacer: has joined #ruby
[19:27:09] Bobsz: ljarvis: do you know what the function is called in slop to get arbitrary options? Having trouble finding it in the manual
[19:27:36] Frem: has joined #ruby
[19:27:37] leafybasil: has joined #ruby
[19:27:59] ljarvis: Bobsz: you need to use v3 and see the autocreate method. It creates options on the fly. That said, I still think this isn't what you need
[19:28:47] ljarvis: https://github.com/leejarvis/slop/tree/v3#autocreate
[19:29:16] jackjackdripper: has joined #ruby
[19:29:31] Bobsz: so V4 doesn't have it?
[19:29:41] ljarvis: no I removed it because it's a bad idea
[19:30:00] vondruch: has joined #ruby
[19:30:51] michaeldeol: has joined #ruby
[19:31:33] dgutierrez1287: has joined #ruby
[19:32:53] hinbody_: has joined #ruby
[19:33:12] michaeldeol: has joined #ruby
[19:35:01] symbol: has joined #ruby
[19:35:41] troyready: has joined #ruby
[19:36:08] Bobsz: ljarvis: any other ideas, I wont be able to install v3
[19:36:21] Swappticon: has joined #ruby
[19:37:39] Maletor: has joined #ruby
[19:38:30] jhass: Bobsz: simplify your argument format so you can just iterate over (chunks of) ARGV
[19:39:50] vondruch: has joined #ruby
[19:40:23] robh71: has joined #ruby
[19:42:08] n_blownapart: has joined #ruby
[19:42:22] baweaver: has joined #ruby
[19:43:01] robh71: has joined #ruby
[19:43:40] kidoz: has joined #ruby
[19:44:06] ruby-lang730: has joined #ruby
[19:44:33] Torrieri: has joined #ruby
[19:44:53] nonparfumee: has joined #ruby
[19:45:03] yorickpeterse: Ah yes, post install messages
[19:45:05] einarj: has joined #ruby
[19:45:07] yorickpeterse: everybody's #1 feature
[19:46:18] slash_nick: yorickpeterse: there's a gem for that
[19:46:20] mesamoo: has joined #ruby
[19:46:24] danman: has joined #ruby
[19:46:28] slash_nick: yorickpeterse: https://rubygems.org/gems/gem-shut-the-fuck-up
[19:46:31] yorickpeterse: slash_nick: I know, it was a ref to the above
[19:46:50] slash_nick: ACTION needs to ignore joins/parts/quits
[19:47:22] Bobsz: Thanks jhass
[19:47:52] shinnya: has joined #ruby
[19:49:06] sigurding: has joined #ruby
[19:49:16] northfurr: has joined #ruby
[19:49:25] kangarooo: has joined #ruby
[19:49:27] kangarooo: shoking video about islamic state, must watch: https://www.youtube.com/watch?v=df4KB30K0UU
[19:49:29] kangarooo: has left #ruby: ()
[19:49:47] yorickpeterse: it's a video in which they are nice to people?
[19:50:11] michaeldeol: has joined #ruby
[19:50:38] Rubie: has joined #ruby
[19:51:50] hobodave: has joined #ruby
[19:52:01] Scripore: has joined #ruby
[19:52:41] jpiche: has joined #ruby
[19:53:52] atomical: has joined #ruby
[19:54:03] shmilan: has joined #ruby
[19:58:02] hubcaps: has joined #ruby
[19:59:12] devoldmx: has joined #ruby
[19:59:45] workmad3: has joined #ruby
[19:59:57] mrtg9970: has joined #ruby
[20:00:05] gusrub: has joined #ruby
[20:00:37] yorickpeterse: what? That would be shocking no?
[20:00:40] Oka: has joined #ruby
[20:00:42] wldcordeiro: has joined #ruby
[20:00:55] yorickpeterse: "Here we see IS handing out cookies at the local homeless shelter"
[20:01:00] yorickpeterse: "and here we see IS helping refugees"
[20:01:38] volsus: has joined #ruby
[20:02:05] shock_one: has joined #ruby
[20:03:25] ellisTAA: has joined #ruby
[20:04:20] banisterfiend: yorickpeterse i got the 30% ruling \o/
[20:04:30] yorickpeterse: you lucky ass mofo
[20:04:41] banisterfiend: making phat stacks
[20:05:26] banisterfiend: stupidily i oculd have applied 2 years ago, but left it until now..
[20:06:12] quimrstorres: has joined #ruby
[20:06:20] apeiros: miah: oh, heh, thank :D
[20:06:38] blackmesa: has joined #ruby
[20:07:03] swgillespie: has joined #ruby
[20:07:48] hololeap: has joined #ruby
[20:07:56] runinsquares: has left #ruby: ("Leaving")
[20:08:42] davedev24: has joined #ruby
[20:08:43] yorickpeterse: when you httparty you party hard
[20:09:23] mrtg9972: has joined #ruby
[20:09:27] yorickpeterse: Thank you for installing HAML 4.0, a few things changes: ...
[20:09:32] chadwtaylor: has joined #ruby
[20:09:38] miah: but are you only HTT partying then? and what is a HTT?
[20:09:52] yorickpeterse: it's a hyper text transfer party
[20:10:12] Kallis: has joined #ruby
[20:10:15] Uuku: has joined #ruby
[20:10:34] yorickpeterse: HTTParty 412: No Bros Allowed
[20:11:09] dfockler: what should I learn to be a pro ruby grammer?
[20:11:59] gwendall: has joined #ruby
[20:12:02] yorickpeterse: start with Practical Bro-Oriented Design in Ruby
[20:12:20] yorickpeterse: There's also the Broaxe, but it's a bit dated
[20:12:37] dfockler: I'm reading through the PBOD - peanut butter oriented design, right now
[20:12:52] yorickpeterse: ACTION is trying to scan something in Linux
[20:12:55] yorickpeterse: needless to say it's a PITA
[20:13:02] jhass: simple-scan <3
[20:13:13] yorickpeterse: stupid zoom doesn't work reliably in iscan
[20:13:14] Iskarlar: has joined #ruby
[20:13:32] jhass: https://launchpad.net/simple-scan
[20:13:57] dfockler: I need to write a gem, but I'm too happy of a person and I can't think of any code that I hate
[20:14:16] baweaver: has joined #ruby
[20:14:24] yorickpeterse: dfockler: https://github.com/YorickPeterse/oga/issues?q=is%3Aopen+is%3Aissue+label%3ABug
[20:14:49] dfockler: hey good idea!
[20:15:11] dfockler: dang github forks got a lot faster
[20:15:17] jhass: dfockler: port oga to Crystal :P
[20:15:27] dfockler: that sounds scary
[20:15:33] jackjackdripper: has joined #ruby
[20:15:35] Kallis: has joined #ruby
[20:16:50] christiandsg: has joined #ruby
[20:16:51] yorickpeterse: actually everything but the Ragel code probably isn't too hard to port
[20:17:02] yorickpeterse: though I'm not sure how well the current setup would work in a statically typed language
[20:17:23] yorickpeterse: would probably involve a crap ton of type casts
[20:17:33] benlieb: has joined #ruby
[20:18:09] gard: has joined #ruby
[20:18:10] apeiros: jhass: is there a ragel for crystal?
[20:18:24] jhass: they like hand written parsers :P
[20:19:43] yorickpeterse: e.g. XML::NodeSet can contain instances of XML::Element, XML::Text, XML::Comment, XML::Attribute, etc
[20:19:44] gwendall: has joined #ruby
[20:19:52] yorickpeterse: of those all _except_ XML::Attribute inherit from XML::Node
[20:19:57] towski_: has joined #ruby
[20:19:57] hazelux: has joined #ruby
[20:20:06] michaeldeol: has joined #ruby
[20:20:33] RTG`: has joined #ruby
[20:20:37] Thermatix: has joined #ruby
[20:21:07] ljarvis: NodeSet can contain an Attribute?
[20:21:31] ljarvis: aren't attributes all inside nodes?
[20:21:38] jamesaxl: has joined #ruby
[20:21:49] imperator: has joined #ruby
[20:22:25] jerius: has joined #ruby
[20:23:09] imperator: is there a more idiomatic way to do this json dump? https://gist.github.com/djberg96/914f56018f6b08224353
[20:23:52] yorickpeterse: in xpath you can query a list of attributes from an element
[20:24:01] tvon: has joined #ruby
[20:24:10] yorickpeterse: Attributes are attached to an element, sure, but you can query/use them separately
[20:24:23] yorickpeterse: e.g. foo/@class would get you a list of all "class" attributes of all "foo" nodes
[20:24:34] jhass: imperator: Rails/AS?
[20:24:46] imperator: jhass, nah, sending a request to the azure api
[20:25:04] imperator: using rest-client under the hood
[20:25:08] psye: has joined #ruby
[20:25:29] jhass: data = {location: location}; data[:tags] = tags if tags; data.to_json is what I'd do
[20:26:09] ljarvis: yorickpeterse: right yeah i know they can be queried separately but i guess i expected that to do a nested query into the nodes to search for and map attributes, but i guess that makes little sense
[20:26:16] psye: has joined #ruby
[20:26:36] Musashi007: has joined #ruby
[20:26:37] imperator: hah, forgot about .to_json
[20:27:04] yorickpeterse: ljarvis: it basically does that
[20:27:30] yorickpeterse: it's like `attr_set = NodeSet.new; foo.attributes.each { |attr| ...; attr_set << attr }
[20:27:57] ljarvis: yorickpeterse: is that to make querying attributes easier/faster?
[20:28:04] radgeRayden_: has joined #ruby
[20:28:13] yorickpeterse: No, that's "just" how it works
[20:28:21] yorickpeterse: There are basically two types of node sets in Oga:
[20:28:22] jhass: but yeah, in Crystal you'd probably do convenience methods that do some casting, node_by_xpath, attribute_by_xpath etc
[20:28:25] yorickpeterse: 1) regular node sets
[20:28:28] yorickpeterse: 2) owned node sets
[20:28:37] yorickpeterse: owned sets are those that belong directly to an XML::Node
[20:28:41] yorickpeterse: e.g. the child elements of another element
[20:28:50] yorickpeterse: in such a case the NodeSet is owned by the parent element
[20:28:54] ljarvis: right yeah
[20:28:59] yorickpeterse: XPath queries produce regular NodeSet instances
[20:29:07] yorickpeterse: that just contain references to the actual objects
[20:29:51] yorickpeterse: The reason XML::Attribute is not a child of XML::Node is because Node has methods such as "parent", "next", "previous", etc, which make no sense for attributes
[20:30:40] tommek: has joined #ruby
[20:30:40] apeiros: yorickpeterse: are xml attributes not considered to be ordered?
[20:30:48] apeiros: (parent could be the node owning the attribute)
[20:32:04] yorickpeterse: ordered yes, but they don't have parents for example
[20:32:08] yorickpeterse: so next/previous would make some sense
[20:32:20] yorickpeterse: but I've yet to see somebody do something like getting attribute 1, then calling "next" on it
[20:32:47] gwendall: has joined #ruby
[20:32:49] apeiros: I'd more expect people to rely on something like attributes being reproduced in the same order
[20:32:54] yorickpeterse: There are also a bunch of other methods in Node that don't make sense for Attribute
[20:33:07] yorickpeterse: some don't even belong in Node, such as "children" :/
[20:33:09] yorickpeterse: but can't change that now
[20:33:21] yorickpeterse: apeiros: attributes are stored in an array internally
[20:33:44] stallmen: has joined #ruby
[20:33:48] stallmen: how should i learn ruby
[20:33:51] apeiros: ok, so order is retained
[20:33:59] ljarvis: ?books stallmen
[20:33:59] ruboto: stallmen, I don't know anything about books
[20:34:12] yorickpeterse: IIRC I didn't pick Hash because of some potential caching conflicts
[20:34:14] ruboto: I don't know anything about learn
[20:34:22] yorickpeterse: If you'd update the attribute name you'd also have to update the Hash key
[20:34:27] ljarvis: no botsnack today
[20:34:44] yorickpeterse: which _could_ mess up the order
[20:35:03] yorickpeterse: stallmen: https://rubymonk.com/ is a good start
[20:36:05] yorickpeterse: https://github.com/YorickPeterse/oga/commit/d5569ead0b1fd84e9d6525f1003c078712268df1 explains the rationale for Arrays
[20:36:25] jgpawletko: has joined #ruby
[20:36:45] Iskarlar: has joined #ruby
[20:36:47] yorickpeterse: days like these is when I thank past-me for not just writing commit message "use arrays for attributes"
[20:36:48] flak: has joined #ruby
[20:36:53] apeiros: ljarvis: you're an op. just !fact add
[20:36:55] yorickpeterse: or "changed stuff"
[20:37:08] ljarvis: apeiros: yes I know but someone add one recently but i dont remember the name of it :(
[20:37:42] avitzurel: has joined #ruby
[20:38:22] jhass: ?learning
[20:38:22] ruboto: How learning something works: http://i.imgur.com/l2mInq8.webm
[20:38:22] sarkyniin: has joined #ruby
[20:38:35] ljarvis: lol at that
[20:38:48] lucyinthesky: has joined #ruby
[20:39:46] Mon_Ouie: We have some in ?links
[20:39:58] Mon_Ouie: ?links ljarvis
[20:39:58] ruboto: ljarvis, http://ruby-community.com/pages/links
[20:40:04] yorickpeterse: dfockler: oh fair warning, I'm super fucking pedantic so expect me to even notice extra spaces in any PRs and what not
[20:40:08] ljarvis: Mon_Ouie: ta
[20:40:14] ljarvis: ?links stallmen
[20:40:15] ruboto: stallmen, http://ruby-community.com/pages/links
[20:40:15] dfockler: yorickpeterse: alright
[20:40:35] northfurr: has joined #ruby
[20:40:38] ljarvis: dfockler: and use explicit returns or you'll be crucified
[20:41:02] yorickpeterse: ljarvis: I moved away from that
[20:41:06] dfockler: are we writing python over here?
[20:41:06] yorickpeterse: stay up to date man
[20:41:19] yorickpeterse: ljarvis: https://github.com/YorickPeterse/oga/commit/b6d34a406d1017f752a64a9315f60742ed01de74
[20:41:35] ljarvis: it's a christmas miracle
[20:42:22] f0ster: has joined #ruby
[20:42:25] yorickpeterse: I mainly stick to certain patterns because breaking away from them is too painful after years
[20:42:31] quimrstorres: has joined #ruby
[20:43:00] yorickpeterse: the next step will be deciding on cutting down YARD crap
[20:43:21] ljarvis: meh, I poke fun but apart from the insane amount of YARD (which I don't really like anyway), oga is very well written
[20:43:30] yorickpeterse: e.g. I want a way to remind my future self (and others) what input/output types an object can operate on, but YARD tags are starting to annoy me too much
[20:43:45] yorickpeterse: I've yet to find a decent way, hence I'm sticking with YARD atm
[20:43:52] howdoico1: has joined #ruby
[20:44:15] yorickpeterse: for some code it's really not obvious what the input is by just looking at the method
[20:44:48] yorickpeterse: https://github.com/YorickPeterse/oga/blob/xpath-compiler/lib/oga/xpath/compiler.rb#L276 e.g. without looking at the YARD tags, try guessing what "input" would be
[20:44:53] yorickpeterse: or "ast" for that matter
[20:45:31] NeverDie: has joined #ruby
[20:45:36] ljarvis: it's ruby. *anything*!!
[20:45:43] yorickpeterse: well, sadly no :P
[20:46:03] yorickpeterse: I also really need to cut down the indent levels in the compiler somehow
[20:46:10] Me: has joined #ruby
[20:46:19] ljarvis: I mean I'd just name it node or input_node or something
[20:46:31] yorickpeterse: ljarvis: the trick here is that there are different nodes
[20:46:38] yorickpeterse: e.g. there's AST::Node from the "ast" Gem
[20:46:42] yorickpeterse: but there's also Oga::Ruby::Node
[20:46:45] yorickpeterse: both are quite different
[20:46:55] mwlang: in Jekyll templates, is it possible to include a dynamically constructed path? I???m working on versioned documentation where I generate the documentation for each gem version released. So, instead of {% include toc.html %} I have page.version (on the page???s front-matter) like ???v0.4???. and I want to include the toc.html for v0.4, so {% include ???v0.4/??? + footer.html %} or something along these lines???
[20:47:07] ledestin: has joined #ruby
[20:48:07] yorickpeterse: if YARD wasn't dumb as a brick I could probably cut down a lot of @return tags
[20:48:37] ljarvis: meh you have some patience, I just flat out refuse to use yard
[20:48:38] tubbo: it would be nice if YARD could somehow evaluate my code as well as statically analyze it
[20:48:40] yorickpeterse: https://github.com/YorickPeterse/oga/blob/xpath-compiler/lib/oga/xpath/compiler.rb#L615 e.g. this shouldn't be needed
[20:48:46] ljarvis: I *really* dislike it
[20:48:51] yorickpeterse: it should be able to determine that based on what the false() method returns
[20:48:54] amclain: has joined #ruby
[20:49:00] yorickpeterse: ljarvis: the HTML output is blergh
[20:49:07] tubbo: ljarvis: what do you use to document code? we've been resorting to the Slate middleman template for our APIs and just a regular middleman site for the guides
[20:49:10] yorickpeterse: But I prefer the tags over the freeform style of rdoc/tomdoc
[20:49:10] ljarvis: it's all blergh for me
[20:49:19] Musashi007: has joined #ruby
[20:49:32] hasB4K: has left #ruby: ("WeeChat 1.2")
[20:49:46] ljarvis: tubbo: I use tomdoc but I don't care much about the HTML output and have a custom rdoc generator
[20:49:48] tubbo: RABID: Really? A Better and more Informative Documentation
[20:50:11] ljarvis: yeah I really like the freeform style
[20:50:30] sigurding: has joined #ruby
[20:50:31] ljarvis: but probably cause I usually read documentation inside the code
[20:50:39] yorickpeterse: ljarvis: the problem I have with it is that one person will write "This method returns XXXX" while somebody else will, somewhere at the bottom of a docblock, write "returns XXXX"
[20:50:42] ljarvis: and not some shitty html template
[20:50:45] yorickpeterse: so scanning for what it actually returns can be hard at times
[20:50:51] tubbo: i'm a huge fan of tomdoc
[20:50:58] ljarvis: yeah I agree there's pitfalls
[20:51:03] yorickpeterse: ACTION actually has comments folded by default
[20:51:20] ljarvis: THis is pseudo tomdoc https://github.com/leejarvis/slop/blob/master/lib/slop.rb
[20:51:28] ljarvis: but again I don't conform to it exactly
[20:52:00] yorickpeterse: something something I'd like for this to be part of the language, aka gradual typing
[20:52:40] Pathfinder: has joined #ruby
[20:53:34] yorickpeterse: I also hate how the example tags work in YARD
[20:53:43] yorickpeterse: [one-space] code here
[20:53:49] shmilan: has joined #ruby
[20:54:31] alphaatom: has joined #ruby
[20:55:40] yorickpeterse: On the other hand, YARD is pretty useful for API docs
[20:55:58] yorickpeterse: http://developer.olery.com/documentation/apis/companies/company_review_ratings/ this for example is all pulled from YARD docs/tags
[20:56:13] yorickpeterse: well, basically YARD DB -> JSON -> nanoc Markdown -> HTML
[20:56:19] bougyman: has joined #ruby
[20:56:51] ljarvis: ruboto: ObjectJSON object containing ratings data.
[20:57:20] ljarvis: R Object JSON ....
[20:57:38] yorickpeterse: "In all cases ???R??? is replaced by a rating topic (e.g. ???overall???). There can be multiple rating topics in a single object. Each rating object has the following fields:"
[20:57:42] NeverDie: has joined #ruby
[20:58:02] yorickpeterse: There's no clear way to describe that sadly. I thought about using JSON schemas, but those are a PITA to read
[20:58:05] ljarvis: ah I didn't get that far
[20:58:08] yorickpeterse: and I've yet to find a good visualization tool for it
[20:59:02] ljarvis: k it's been 13 hours, im getting off the computer
[20:59:05] ljarvis: for a bit..
[20:59:17] lagweezle: has joined #ruby
[20:59:50] yorickpeterse: https://github.com/YorickPeterse/oga/blob/xpath-compiler/lib/oga/xpath/compiler.rb#L826-L844
[21:00:30] sigurding_: has joined #ruby
[21:00:38] lagweezle: From what I'm reading in the docs, File.open('/file_that_does_not_exist', 'w') should create a new file, but I instead get "Errno::ENOENT: No such file or directory" ... What am I missing? >.<
[21:01:05] ljarvis: probably a directory doesn't exist that you're going into
[21:01:05] chabil: has joined #ruby
[21:01:09] ljarvis: k actually going
[21:01:30] mwlang: nevermind, it???s just liquid (didn???t realize that right away!). So setting a toc_file_path variable in the page???s front matter makes it work.
[21:02:46] blarghlarghl: has joined #ruby
[21:03:06] lagweezle: Oh. I feel rather silly now. Thank you, ljarvis ...
[21:04:06] benlieb: has joined #ruby
[21:04:16] phutchins: has joined #ruby
[21:04:32] s00pcan: has joined #ruby
[21:04:59] chipotle: has joined #ruby
[21:06:09] rippa: has joined #ruby
[21:06:34] blarghlarghl: I have a lot of rspec files all over the place. Our codebase is rather large. Is there a smart way to have a 'run all tests' rake task?
[21:06:34] imperator: has left #ruby: ("Leaving")
[21:07:21] yorickpeterse: blarghlarghl: dump them in spec/project-name
[21:07:25] yorickpeterse: then run "rspec spec"
[21:07:39] yorickpeterse: alternatively run "rspec directory1 directory2 directory3"
[21:08:44] blarghlarghl: yorickpeterse: yeah, i was thinking of moving them into one 'spec' directory in the root, i.e. /spec/module1, /spec/module2, etc.
[21:09:08] blarghlarghl: yorickpeterse: will rspec spec then run all specs in those subdirectories too?
[21:09:15] Yzguy: has joined #ruby
[21:09:19] yorickpeterse: It grabs all *_spec.rb files recursively
[21:09:24] blarghlarghl: yorickpeterse: great, i'll go and do that then.
[21:09:55] decaff_: has joined #ruby
[21:10:01] Ox0dea: has joined #ruby
[21:11:49] phutchins: has joined #ruby
[21:12:18] Iskarlar: has joined #ruby
[21:15:29] yfeldblum: has joined #ruby
[21:16:14] gard: has joined #ruby
[21:17:17] dcarmich: has joined #ruby
[21:19:47] pothibo: has joined #ruby
[21:21:25] crankharder: has joined #ruby
[21:21:44] j4cknewt: has joined #ruby
[21:23:25] Pathfinder_: has joined #ruby
[21:25:01] Guest50: has joined #ruby
[21:25:01] jgpawletko: has joined #ruby
[21:25:25] juanpablo___: has joined #ruby
[21:26:26] ruurd: has joined #ruby
[21:27:16] Yzguy: has joined #ruby
[21:28:55] axl_: has joined #ruby
[21:29:13] roolo: has joined #ruby
[21:29:30] Kallis: has joined #ruby
[21:30:34] Kallis: has joined #ruby
[21:32:40] avitzurel: has joined #ruby
[21:33:53] FernandoBasso: has joined #ruby
[21:34:36] gizmore: has joined #ruby
[21:34:49] blackmesa: has joined #ruby
[21:36:47] Pathfinder: has joined #ruby
[21:36:59] kt2: has joined #ruby
[21:41:43] ruurd: has joined #ruby
[21:43:39] chadwtaylor: has joined #ruby
[21:44:30] Rubie: has joined #ruby
[21:46:09] einarj: has joined #ruby
[21:46:20] lucyinthesky: has joined #ruby
[21:46:44] rehat_: is there a way to pass a method as an argument
[21:47:03] episage: has joined #ruby
[21:47:04] darix: why would you need that?
[21:47:09] Me: has joined #ruby
[21:47:12] darix: and i would probably just use a block
[21:48:08] workmad3: has joined #ruby
[21:48:31] rehat_: I have a ranking class with two different ranking method options and I would like to be able to specify what method to use
[21:49:25] chills42: has joined #ruby
[21:49:30] darix: pass the name in as a symbol
[21:49:44] darix: and then use send(namesymbol, args )
[21:49:54] rehat_: ahh send I was using call
[21:49:58] rehat_: let me try that
[21:50:14] baweaver: Use an if branch
[21:50:24] baweaver: if you don't need send don't use it, it'll be slower.
[21:50:39] baweaver: and chances are you already have a branch there to determine that area so just use that
[21:51:08] ruurd_: has joined #ruby
[21:51:31] baweaver: If there are two distinct cases you need to decide between, that's exactly what conditionals are for.
[21:51:52] baweaver: assume that send does not exist until you've used Ruby for a year or two
[21:51:56] rehat_: https://gist.github.com/rehat/84c6a2ccdaba1a14baed sorry for the crap code I'm new, but I would like to call rank_people_by_distance_method(:sim_distance)
[21:51:56] chipotle: has joined #ruby
[21:52:04] baweaver: and metaprogramming does not exist for at least 3-4 years
[21:52:05] lkba: has joined #ruby
[21:52:08] lucyinthesky: has left #ruby: ("Leaving")
[21:52:11] baweaver: you'll save yourself nightmares later.
[21:52:35] baweaver: Too many new people to Ruby jump on those fancy features and blow their foot off.
[21:53:14] rehat_: ok so just use a string and a condition on which method to use
[21:53:16] baweaver: First observation, don't use 'string': value
[21:53:27] baweaver: use symbol: value
[21:53:40] baweaver: it's not json, just looks like it.
[21:53:55] baweaver: use two space indentation
[21:53:59] rehat_: oh that was just me copy pasting the hash from this book I am reading in python lol
[21:54:58] baweaver: >> {correct: 1}
[21:54:59] ruboto: baweaver # => {:correct=>1} (https://eval.in/416929)
[21:55:00] abdulrehman: has joined #ruby
[21:55:07] rehat_: is there a way to setup sublime so that it uses two spaces for tabs or should I just physically use two spacebars?
[21:55:10] baweaver: notice it's a symbol there.
[21:55:18] baweaver: bottom right
[21:55:20] bougyman: gotta be a way
[21:55:23] baweaver: next to language
[21:55:28] baweaver: then in default settings
[21:55:35] baweaver: which is under the application menu iirc
[21:55:36] choke: has joined #ruby
[21:55:43] apeiros: rehat_: yes, you can config sublime to convert tab to spaces
[21:55:58] apeiros: don't remember where to set it globally
[21:56:05] rehat_: apeiros: sweet I'll look into it
[21:56:15] apeiros: but for a single file: bottom right where it e.g. says "2 spaces". click on it to get a menu.
[21:56:30] apeiros: there choose at the top "indent using spaces"
[21:56:43] rakm: has joined #ruby
[21:57:10] apeiros: rehat_: ah, I have it in user config: "translate_tabs_to_spaces": true, and "tab_size": 2,
[21:57:42] rehat_: nice thanks
[21:57:45] s00pcan: has joined #ruby
[21:58:43] Spami: has joined #ruby
[21:59:47] j4cknewt: has joined #ruby
[21:59:57] devoldmx: has joined #ruby
[22:00:45] LMity: has joined #ruby
[22:00:52] raucao-cccamp15: has joined #ruby
[22:00:57] baweaver: rehat_: read into Enumerable for Ruby, especially map, reduce, and select
[22:01:15] lucyinthesky: has joined #ruby
[22:02:33] baweaver: simplified the first method for you a bit: https://gist.github.com/rehat/84c6a2ccdaba1a14baed#gistcomment-1551450
[22:02:39] rehat_: baweaver: ahh, ok. Yeah I had a feeling that I wasn't using the correct ruby way of iteration through those hashes
[22:02:48] baweaver: well each is fine
[22:02:59] baweaver: select allows you to select elements that meet a condition
[22:03:19] baweaver: >> (1..10).select { |v| v % 2 == 0 }
[22:03:20] ruboto: baweaver # => [2, 4, 6, 8, 10] (https://eval.in/416930)
[22:03:29] baweaver: (yes I know shorthand, not the point)
[22:03:44] baweaver: map allows you to transform every element of a list with a block (function)
[22:03:50] rehat_: nah, that helps me thanks
[22:03:55] baweaver: >> (1..10).map { |v| v * 2 }
[22:03:56] ruboto: baweaver # => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] (https://eval.in/416931)
[22:04:07] baweaver: No, that comment was for other people that would nail me for longhanding that
[22:04:18] baweaver: reduce takes a list and reduces it to a single element
[22:04:39] baweaver: >> (1..10).reduce (0) { |accumulator, i| accumulator + i }
[22:04:40] ruboto: baweaver # => 55 (https://eval.in/416932)
[22:05:02] Ox0dea: baweaver: Tell him about lazy Enumerators.
[22:05:04] baweaver: so for every run of reduce, the accumulator is the result of the last block
[22:05:17] baweaver: shorthand that I was referring to:
[22:05:26] baweaver: >> (1..10).select(&:even?)
[22:05:27] ruboto: baweaver # => [2, 4, 6, 8, 10] (https://eval.in/416933)
[22:05:36] baweaver: >> (1..10).reduce(0, :+)
[22:05:36] christiandsg: has joined #ruby
[22:05:37] ruboto: baweaver # => 55 (https://eval.in/416934)
[22:06:08] baweaver: You know those three at least and you have a lot more power in Ruby to use
[22:06:13] baweaver: reduce will take a bit to get used to though
[22:06:27] sarkyniin: has joined #ruby
[22:06:38] baweaver: You might look into Haskell or another functional language for a better understanding of the source of those ones
[22:06:46] Ox0dea: I think you meant Lisp.
[22:06:47] baweaver: though reduce is normally called FoldLeft in those ones
[22:06:53] lucyinthesky: has left #ruby: ("Leaving")
[22:07:04] baweaver: the pedantics among us would say lisp isn't functional per se
[22:07:07] baweaver: depending on the variant
[22:07:10] Ox0dea: This guy. :P
[22:07:11] baweaver: scheme moreso than others.
[22:07:22] baweaver: I've had that rant before :P
[22:07:48] baweaver: Only with Lisp can I describe myself as a Schemer and a Racketeer
[22:07:58] Ox0dea: This is by design.
[22:07:59] baweaver: or in real life itself, but I digress
[22:08:41] jeadr: has joined #ruby
[22:08:52] baweaver: anyways, ping @baweaver on github if you want a look over on any code.
[22:09:09] baweaver: I probably won't be online much tonight, Rocket League tournament at $WORK :D
[22:09:30] rehat_: baweaver: sweet, thanks dude
[22:09:36] baweaver: the other methods could be shortened down to a few lines as well
[22:09:42] Ox0dea: >> (1234567890..9876543210).lazy.select { |n| n.to_s.chars.uniq.size == 10 }.first(5) # rehat_
[22:09:43] ruboto: Ox0dea # => [1234567890, 1234567908, 1234567980, 1234568079, 1234568097] (https://eval.in/416935)
[22:09:46] Ox0dea: Ruby is magic. <3
[22:09:46] baweaver: Ox0dea can make them into one liners but he lies
[22:09:51] baweaver: don't trust anything he says
[22:10:10] baweaver: He makes Ruby do...... interesting things
[22:10:16] Ox0dea: "Terrible, but great."
[22:10:26] baweaver: Uncle Ben said something about that
[22:10:33] Ox0dea: baweaver: Did you know that "Ollivander's" is an anagram of "Ronald lives"?
[22:10:49] Trynemjoel: has joined #ruby
[22:10:57] Ox0dea: Book 7 spoiler in one of the first chapters of the entire series.
[22:11:04] sivsushruth: has joined #ruby
[22:11:26] baweaver: >> "Ollivanders".downcase.chars.sort == "Ronaldlives".downcase.chars.sort
[22:11:27] ruboto: baweaver # => true (https://eval.in/416936)
[22:11:39] baweaver: (yes there are better ways)
[22:12:12] lucyinthesky: has joined #ruby
[22:12:27] rehat_: Ox0dea: wow no idea how to read that
[22:12:28] Ox0dea: About that...
[22:12:30] Ox0dea: >> @_,$_,@__=->_,__{_==''?_:(__[_[$_-$_]]?_[$_-$_]:'')+@_[_[$_..-$_],__]},$$/$$,@__=->_{__,___=_[$_-$_],_[$_..-$_];_==''?_:@__[@_[___,->_{_<__}]]+__+@__[@_[___,->_{_>=__}]]};($__=->*_{__=@__[_[$.]];$*[$_-$_]==__ ?_:$*<<__;_[$.+=$_]?$__[*_]:!$*[$_]})['ollivanders', 'ronaldlives']
[22:12:31] ruboto: Ox0dea # => true (https://eval.in/416937)
[22:12:45] baweaver: there we go
[22:12:45] Ox0dea: rehat_: ^ That's why I'm not to be trusted.
[22:12:53] baweaver: see what you did rehat_? You got him excited again
[22:13:34] Ox0dea: rehat_: It finds the first five pandigital numbers, but lazily so that it doesn't take ages.
[22:13:58] baweaver: Ox0dea: what's bad is I can read that as a one liner now...
[22:14:07] michaeldeol: has joined #ruby
[22:14:07] baweaver: gist it and shoot me a tag later
[22:14:09] Ox0dea: rehat_: That 9876543210 could actually have been Float::INFINITY without changing the result.
[22:14:21] baweaver: probably disappearing soon
[22:14:23] Ox0dea: baweaver: Huh? You've already Muggled the anagram one, no?
[22:14:30] d5sx43: has joined #ruby
[22:14:31] baweaver: I lose track
[22:14:45] baweaver: I think we might have scared them off O_O
[22:15:01] Ox0dea: Ah, nope, seems you didn't.
[22:15:01] baweaver: Ox0dea: You heard them
[22:15:06] baweaver: still work to do
[22:15:38] Coldblackice: has joined #ruby
[22:15:42] Ox0dea: FizzBuzz, String#reverse, Caesar cipher, RPN calculator, and Time#new are the ones you've Muggled.
[22:16:16] baweaver: Well down I go, tournament time :D
[22:16:19] Ox0dea: Godspeed.
[22:16:31] rbowlby: has joined #ruby
[22:19:49] _blizzy_: has joined #ruby
[22:20:06] crazydiamond: has joined #ruby
[22:20:24] sepp2k: has joined #ruby
[22:21:06] mephistophocles: has joined #ruby
[22:22:20] Trynemjoel: has joined #ruby
[22:22:40] choke: has joined #ruby
[22:23:23] michaeldeol: has joined #ruby
[22:25:01] hololeap: has joined #ruby
[22:25:43] Zamyatin: has joined #ruby
[22:25:59] j4cknewt: has joined #ruby
[22:26:07] yfeldblum: has joined #ruby
[22:26:34] rbowlby: has joined #ruby
[22:27:37] _blizzy_: has joined #ruby
[22:27:38] Rubie: has joined #ruby
[22:28:11] bruno-: has joined #ruby
[22:28:53] ZeeNoodleyGamer: Anyone here use Passenger?
[22:29:55] loly0: has joined #ruby
[22:30:07] casadei_: has joined #ruby
[22:30:13] j4cknewt: has joined #ruby
[22:30:52] skade: has joined #ruby
[22:30:56] ZeeNoodleyGamer: I'm having trouble getting anything to show up, I can see the index, but the index file(index.rb) doesn't show, and any file just downloads instead of runs, and they are all executable
[22:31:11] mary5030: has joined #ruby
[22:31:50] dgutierrez1287: has joined #ruby
[22:31:52] ZeeNoodleyGamer: I have apache, and have tried going through all the docs for passenger, but to no avail
[22:33:48] sparrk: has joined #ruby
[22:34:15] sparrk: Quick question. Why does URI report that '/' as relative?
[22:34:33] sparrk: isn't that an absolute uri?
[22:34:51] loly0: has left #ruby: ()
[22:34:57] Ox0dea: sparrk: How do you mean?
[22:35:00] darwingr: has joined #ruby
[22:35:20] ZeeNoodleyGamer: I always thought absolute meant with the domain, and relative, is within the / but without the domain
[22:35:47] Ox0dea: Aye, I believe sparrk has conflated URIs with filesystem paths.
[22:35:54] sparrk: I mean like this: https://gist.github.com/zachaysan/74020b8775148678276c
[22:36:08] Ox0dea: Yes, the aforementioned conflation has occurred.
[22:36:18] robh71: has joined #ruby
[22:36:32] sparrk: well if I'm going through an HTML document, and someone has an href="/" doesn't that take me to the host?
[22:36:47] sparrk: even if I'm on, say, youtube.com/watch/
[22:37:09] ZeeNoodleyGamer: my whole life is a lie
[22:37:32] sparrk: Mine may be as well.
[22:37:43] Ox0dea: Sorry. It seems I was mistaken. :/
[22:38:05] wldcordeiro: has joined #ruby
[22:38:20] Ox0dea: But I'm almost certain there's some gotcha to beware of with href="/".
[22:39:05] sparrk: Whew. Well I'm happy to learn a gotcha, but now I'm calling into question things like relative and absolute. Writing a web crawler has been very crazy. (did you guys know about the <base> element?!)
[22:39:30] sparrk: Ok, I'll ask one of the URI maintainers for further instructions. Thanks for the help!
[22:39:46] Ox0dea: sparrk: URI#relative? is not behaving incorrectly.
[22:39:53] ZeeNoodleyGamer: sivsushruth: any input on my perdicament?
[22:40:13] Ox0dea: sparrk: It's returning whether the URI in question is "domain-relative".
[22:40:40] sparrk: Thank you
[22:40:40] sivsushruth: ZeeNoodleyGamer: hold on
[22:40:44] Ox0dea: Sure thing.
[22:40:44] chills42: has joined #ruby
[22:41:08] sivsushruth: ZeeNoodleyGamer: it should be index.html.erb
[22:41:12] darkxploit: has joined #ruby
[22:41:16] sivsushruth: and remove the index.html from public/
[22:41:43] jeadr: has joined #ruby
[22:41:57] Ox0dea: sparrk: More specifically, #relative? is defined as !#absolute?, which returns whether the URI has any scheme at all.
[22:42:23] Ox0dea: >> require 'uri'; URI('http:').relative? # sparrk
[22:42:24] ruboto: Ox0dea # => false (https://eval.in/416984)
[22:44:01] [spoiler]: sparrk: an absolute URI must contain the scheme, authority (which consist of an optional username, password and a mandatory hostname), and a path;
[22:44:17] Ox0dea: [spoiler]: Not according to Ruby's URI library.
[22:44:37] Ox0dea: >> require 'uri'; URI('a:').absolute?
[22:44:38] ruboto: Ox0dea # => true (https://eval.in/416985)
[22:45:18] RobertBirnie: has joined #ruby
[22:45:21] ZeeNoodleyGamer: almost looks like it just looks for a :
[22:45:30] [spoiler]: so, like this: [scheme:]//[username[:password]]hostname[:port]/path[?=query][#fragment]
[22:45:54] [spoiler]: ZeeNoodleyGamer: scheme:something could be considered an URI, but hmm
[22:46:04] drbrain: data:text/html,hello
[22:46:24] drbrain: mailto:drbrain@segment7.net?subject=hello
[22:46:52] einarj: has joined #ruby
[22:47:02] sparrk: [spoiler] Thanks for the explanation. I assumed that I could treat what "relative" and "absolute" mean in the browser.
[22:47:10] workmad3: has joined #ruby
[22:48:29] Ox0dea: sparrk: Your assumption was correct?
[22:48:44] Ox0dea: The existence of a scheme is what makes a URI absolute.
[22:49:08] [spoiler]: sparrk: might be that I am going off from an outdated URI RFC (I read it a long time ago), maybe it was updated; or maybe I just incorrectly remember which parts were mandatory
[22:49:27] [spoiler]: (for it to be considered absolute)
[22:50:03] ndrei: has joined #ruby
[22:50:07] Ox0dea: [spoiler]: A service could register the "a" protocol and consider the empty string to be valid, in which case rejecting "a:" as a valid URI would be incorrect.
[22:50:12] dfockler: has joined #ruby
[22:50:37] [spoiler]: Ox0dea: good point
[22:51:37] ZeeNoodleyGamer: amazon could do some weird stuff
[22:51:47] ZeeNoodleyGamer: being their getting into different things
[22:52:52] robh71: has joined #ruby
[22:53:15] [spoiler]: Ox0dea: yes you're right, I was talking about the original URI proposal, which is was obsoleted a few times in the past two decades :/
[22:53:34] wldcordeiro: has joined #ruby
[22:53:50] Mon_Ouie: For some reason I read "past two weeks" and was quite confused
[22:54:15] [spoiler]: Mon_Ouie: that's jsut for websockets :P
[22:55:38] [spoiler]: RFC1738 seems to be the latest one (+ updates in RFC3986, RFC6874 and RFC7320)
[22:55:50] [spoiler]: <scheme>:<scheme-specific-part>
[22:56:14] nfk: has joined #ruby
[22:56:24] [spoiler]: Only the scheme is mandatory for the path to be considered absolute (for a generic URI)
[22:56:36] [spoiler]: what I said is still valid for HTTP URIs
[23:00:14] Motoservo: has joined #ruby
[23:01:10] havenwood: has joined #ruby
[23:02:11] Yzguy: has joined #ruby
[23:02:33] decoponio: has joined #ruby
[23:03:53] Thomas-0725: has joined #ruby
[23:03:57] foureight84_: has joined #ruby
[23:06:14] s00pcan: has joined #ruby
[23:06:42] tsvenson: has joined #ruby
[23:06:57] Ox0dea: >> Errno::EDOOFUS # shevy
[23:06:58] ruboto: Ox0dea # => Errno::NOERROR (https://eval.in/416988)
[23:07:17] Ox0dea: It's a FreeBSD thing, apparently.
[23:07:21] sparrk: has left #ruby: ("Leaving")
[23:07:26] yuung: has joined #ruby
[23:07:42] yuung: if my parent class has a mixin, will the child inherit the mixin methods?
[23:07:52] Ox0dea: ?try yuung
[23:07:52] ruboto: yuung, Why don't you try it and see for yourself?
[23:08:24] yuung: .............okay, so it doesn't
[23:08:24] Ox0dea: >> Class.new(Array).include? Enumerable # yuung
[23:08:25] ruboto: Ox0dea # => true (https://eval.in/416989)
[23:08:34] yuung: then i must be doing something wrong
[23:08:54] soulcake: has joined #ruby
[23:13:06] s2013: has joined #ruby
[23:14:46] [spoiler]: yuung: you could show us what you're doing, maybe we can give some insight
[23:14:50] matcouto: has joined #ruby
[23:14:56] workmad3: has joined #ruby
[23:15:06] surfs^: has joined #ruby
[23:15:37] Torrieri: has joined #ruby
[23:15:39] AccordLTN: has joined #ruby
[23:16:21] chills42: has joined #ruby
[23:16:53] phutchins: has joined #ruby
[23:17:06] baweaver: has joined #ruby
[23:17:29] phutchins: has joined #ruby
[23:17:30] cornerma1: has joined #ruby
[23:17:48] yuung: [spoiler], https://gist.github.com/johnmarinelli/05881902ddf8f8deaf63. just wondering why i need to call Base.get instead of self.get
[23:17:52] Vile`: has joined #ruby
[23:18:41] shevy: perhaps self.class.get?
[23:18:52] jenrzzz: has joined #ruby
[23:19:37] yuung: shevy ah, that worked, heh
[23:20:00] yuung: does self.class look up the inheritance heirarchy where just self doesn't?
[23:20:01] dimasg: has joined #ruby
[23:20:22] [spoiler]: self.class returns the class of the object
[23:20:33] [spoiler]: >> "thing".class
[23:20:34] ruboto: [spoiler] # => String (https://eval.in/416990)
[23:20:49] Ox0dea: yuung: Module#include brings in instance methods, not class methods.
[23:21:30] Ox0dea: yuung: This should help clarify a bit: https://gist.github.com/0x0dea/9941d489b540eb8937c1
[23:21:43] [spoiler]: yuung: if you want to use a module's instance methods inside a class, use extend
[23:21:57] mary5030: has joined #ruby
[23:22:07] yuung: ahh, okay
[23:22:19] j4cknewt: has joined #ruby
[23:23:31] [spoiler]: I kinda phrased that awkwardly, so here's the documentation: http://ruby-doc.org/core-2.2.2/Object.html#method-i-extend
[23:23:54] [spoiler]: yuung: you can use `extend` inside a class body, too
[23:24:13] Ox0dea: You can use #extend anywhere. :)
[23:24:13] yuung: [spoiler], Ox0dea, shevy, thanks
[23:24:31] Musashi007: has joined #ruby
[23:24:33] [spoiler]: Erm sorry i linked the wrong thing *sigh*
[23:25:11] [spoiler]: but yes the point still stands
[23:25:25] shevy: it's getting late again
[23:25:33] shevy: [spoiler] may omit some individual characters
[23:26:15] [spoiler]: shevy: It's pretty much like being speech impaired in a digital sense.
[23:26:19] ellisTAA: has joined #ruby
[23:26:27] [spoiler]: type-impaired
[23:26:58] modern: has joined #ruby
[23:31:49] TheNet: has joined #ruby
[23:34:33] xoron: has joined #ruby
[23:34:53] Encapsulation: has joined #ruby
[23:38:40] jeadr: has joined #ruby
[23:39:09] stardiviner: has joined #ruby
[23:39:25] ff7f00: has joined #ruby
[23:40:45] lannonbr: has joined #ruby
[23:40:48] ff7f00: Hi #ruby, I was wondering if anyone has heard of efforts to implement afl-fuzz instrumentation for Ruby code (similar to python-afl https://bitbucket.org/jwilk/python-afl)?
[23:40:49] sivsushruth: has joined #ruby
[23:42:44] redpants: has joined #ruby
[23:44:12] pengin: has joined #ruby
[23:44:40] avitzurel: has joined #ruby
[23:44:58] howdoico1: has joined #ruby
[23:45:08] jtdoncas: has joined #ruby
[23:48:40] troulouliou_div2: has joined #ruby
[23:48:46] troulouliou_div2: has joined #ruby
[23:49:07] benlieb: has joined #ruby
[23:50:51] sepp2k: has joined #ruby
[23:54:17] christiandsg: has joined #ruby
[23:56:01] michael_mbp: has joined #ruby
[23:57:53] blackmesa: has joined #ruby
[23:58:34] luckyme: has joined #ruby
[23:59:27] redpants: has left #ruby: ()
[23:59:57] yh: has joined #ruby