« Back to channel list

#ruby - 11 October 2015

« Back 1 day Forward 1 day »
[00:02:12] wallerdev: has joined #ruby
[00:03:18] Azure: has joined #ruby
[00:03:19] nk8: has joined #ruby
[00:04:22] arescorpio: has joined #ruby
[00:05:37] maletor_: has joined #ruby
[00:08:13] decoponio: has joined #ruby
[00:09:01] tkuchiki: has joined #ruby
[00:10:07] northfurr: has joined #ruby
[00:10:18] decoponyo: has joined #ruby
[00:14:45] decoponio: has joined #ruby
[00:17:27] jsuth: has joined #ruby
[00:19:04] Zamyatin: has joined #ruby
[00:19:41] mdih: has joined #ruby
[00:20:13] user1138: has joined #ruby
[00:20:20] mdih: has joined #ruby
[00:21:45] califerno: has joined #ruby
[00:22:01] rushed: has joined #ruby
[00:24:43] prestorium: has joined #ruby
[00:26:55] mistermocha: has joined #ruby
[00:28:52] decoponio: has joined #ruby
[00:28:57] jamto11: has joined #ruby
[00:31:14] kalusn: has joined #ruby
[00:34:27] nk8: has joined #ruby
[00:34:48] CloCkWeRX: has joined #ruby
[00:35:46] dikaio: has joined #ruby
[00:35:57] maletor_: has joined #ruby
[00:38:08] jenrzzz: has joined #ruby
[00:40:20] porfa: has joined #ruby
[00:40:42] RainBowww: has joined #ruby
[00:41:00] nk8: has joined #ruby
[00:41:06] jun_: has joined #ruby
[00:43:56] riotjones: has joined #ruby
[00:44:54] riotjones: has joined #ruby
[00:45:16] jun_: has joined #ruby
[00:45:43] iamjarvo_: has joined #ruby
[00:46:05] nk8: has joined #ruby
[00:46:28] dikaio: has joined #ruby
[00:47:42] mistermocha: has joined #ruby
[00:47:53] raazdaan: has joined #ruby
[00:51:17] tier: has joined #ruby
[00:53:04] l_tonz: has joined #ruby
[00:55:55] Zamyatin: has joined #ruby
[00:56:14] jamto11: has joined #ruby
[00:59:16] jenrzzz: has joined #ruby
[01:00:48] nk8: has joined #ruby
[01:00:53] wildlander: has joined #ruby
[01:01:12] Musashi007: has joined #ruby
[01:01:15] YankNYC_: has joined #ruby
[01:03:30] RegulationD: has joined #ruby
[01:04:08] speakingcode: has joined #ruby
[01:04:56] michael_mbp: has joined #ruby
[01:05:14] wildlander: has joined #ruby
[01:09:31] _blizzy_: has joined #ruby
[01:09:51] shevy: has joined #ruby
[01:09:52] tkuchiki: has joined #ruby
[01:16:28] mikecmpbll: has joined #ruby
[01:17:22] maletor_: has joined #ruby
[01:19:53] UtkarshRay: has joined #ruby
[01:20:18] pocketprotector-: has joined #ruby
[01:22:39] tier: has joined #ruby
[01:24:10] mmb: has joined #ruby
[01:25:16] stardiviner: has joined #ruby
[01:26:05] l_tonz: has joined #ruby
[01:27:31] Alina-malina: has joined #ruby
[01:28:39] raazdaan: has joined #ruby
[01:32:22] shevy: Is there a gem-inbuilt way to find out where the "credentials" file will be stored at?
[01:33:54] wildlander: has joined #ruby
[01:35:07] oetjenj: has joined #ruby
[01:38:50] nettoweb: has joined #ruby
[01:39:49] tier: has joined #ruby
[01:40:01] porfa: has joined #ruby
[01:40:13] tkuchiki: has joined #ruby
[01:40:35] diegoaguilar: has joined #ruby
[01:41:08] kies^: has joined #ruby
[01:42:52] mikecmpbll: has joined #ruby
[01:44:01] nk8: has joined #ruby
[01:45:39] riotjones: has joined #ruby
[01:45:44] samukasmk: has joined #ruby
[01:48:46] tmtwd: has joined #ruby
[01:50:33] samukasmk__: has joined #ruby
[01:51:18] zotherstupidguy: has joined #ruby
[01:52:14] charliesome: has joined #ruby
[01:52:28] zotherstupidguy: how to get the indices of a certain character in a String?
[01:53:36] oetjenj: has joined #ruby
[01:53:53] iateadonut: has joined #ruby
[01:54:07] shevy: one way would be via regex, then you have the start location
[01:54:24] zotherstupidguy: "stuff".index("f") returns 3
[01:55:32] shevy: starts at 0
[01:55:34] shevy: >> "stuff" =~ /f/
[01:55:35] ruboto: shevy # => 3 (https://eval.in/448498)
[01:56:06] zotherstupidguy: i still dont know how to get the other f
[01:57:04] zotherstupidguy: slice then run again??
[01:57:35] zotherstupidguy: not a very happy ruby moment
[01:59:42] RegulationD: has joined #ruby
[02:00:57] shevy: there is probably a simple way
[02:01:13] shevy: but if everything fails, you could always manually iterate over your string and store the indices in an array upon a match
[02:02:10] [k-: here's a funny solution:
[02:02:18] zotherstupidguy: thats what i am too lazy to do :)
[02:02:20] [k-: just let me type it out first
[02:02:57] shevy: zotherstupidguy you may well be even lazier than me!
[02:05:27] [k-: is there a scanl in Ruby?
[02:06:00] shevy: what is a scanl doing? is it like ripper?
[02:07:46] [k-: it incrementally builds up an array
[02:07:56] Zamyatin: has joined #ruby
[02:08:33] zotherstupidguy: shouldnt be there a fucntion that just returns a hash of the letters and their indices in a string!
[02:09:04] mikecmpbll: has joined #ruby
[02:09:23] jamto11: has joined #ruby
[02:09:36] diego1: has joined #ruby
[02:10:15] nettoweb: has joined #ruby
[02:10:40] mondayrain: has joined #ruby
[02:11:40] zotherstupidguy: "ABC".indices :)
[02:11:44] Ox0dea: has joined #ruby
[02:12:02] RainBowww: has left #ruby: ("Leaving")
[02:12:05] Ox0dea: >> 'abc'.each_char.with_index.to_a # zotherstupidguy
[02:12:06] ruboto: Ox0dea # => [["a", 0], ["b", 1], ["c", 2]] (https://eval.in/448513)
[02:12:40] maletor_: has joined #ruby
[02:13:06] ValicekB: has joined #ruby
[02:13:19] patdohere: has joined #ruby
[02:13:52] Ox0dea: >> 'foobar'.each_char.with_index.group_by(&:first).map { |c, i| [c, i.map(&:last)] }.to_h
[02:13:53] ruboto: Ox0dea # => {"f"=>[0], "o"=>[1, 2], "b"=>[3], "a"=>[4], "r"=>[5]} (https://eval.in/448514)
[02:14:00] Ox0dea: zotherstupidguy: That one's more in line with exactly what you asked for.
[02:14:12] Ox0dea: It is a shame there isn't a cleaner way to do it. :<
[02:14:42] zotherstupidguy: yeah, a more direct way!
[02:15:29] jdawgaz: has joined #ruby
[02:15:30] Ox0dea: But hey, we can define methods!
[02:16:46] patdohere: has joined #ruby
[02:16:46] [k-: Ox0dea !
[02:17:06] [k-: >> o = "abdbfsktnskffndmtlepdlfleflejrkef".split(?f).map { |a| a.length + 1 }; Array.new(o.length) { |i| o[0..i].reduce(:+) }
[02:17:07] ruboto: [k- # => [5, 12, 13, 23, 26, 33] (https://eval.in/448517)
[02:17:13] [k-: i was trying out this
[02:17:20] [k-: but it isnt really correct
[02:17:44] [k-: and it is not an optimal solution
[02:18:19] bruno-: has joined #ruby
[02:19:12] Ox0dea: What even.
[02:19:32] Ox0dea: How is that a map of characters to their indices?
[02:20:14] shevy: this is the haskell solution
[02:20:38] [k-: Ox0dea: he only wanted the indices of a character
[02:21:12] Ox0dea: > shouldnt be there a fucntion that just returns a hash of the letters and their indices in a string!
[02:21:46] aaeron: has joined #ruby
[02:21:48] [k-: i began on the solution before he decided to change his requirements
[02:22:06] zotherstupidguy: [k- my first time to read .reduce, thanks for that :) cheers
[02:22:55] [k-: it is also known as inject, but reduce is a better name!
[02:23:15] [k-: >> o = "abdbfsktnskffndmtlepdlfleflejrkef".split(?f).map { |a| a.length + 1 }; Array.new(o.length) { |i| o[0..i].reduce(:+) - 1 }
[02:23:16] ruboto: [k- # => [4, 11, 12, 22, 25, 32] (https://eval.in/448518)
[02:23:24] [k-: i guess this will be more correct
[02:24:04] shevy: it started a bit earlier
[02:24:06] shevy: <zotherstupidguy> how to get the indices of a certain character in a String?
[02:25:14] mikecmpbll: has joined #ruby
[02:25:21] Ox0dea: > Where you walk in, you get injected, inspected, detected, infected Neglected and selected.
[02:25:43] mary5030: has joined #ruby
[02:26:03] Ox0dea: "Alice's Restaurant Massacree" is the origin of many of Smalltalk's Enumerable methods, and thus Ruby's.
[02:26:05] Ox0dea: Who knew?
[02:26:34] [k-_: has joined #ruby
[02:27:02] Ox0dea: [k-: Haskell was supposed to have taught you to worship generality by now.
[02:27:26] [k-_: i could also do a recursive solution
[02:27:35] PhantomSpank: has joined #ruby
[02:27:38] [k-_: that might be more efficient
[02:27:53] [k-_: Ox0dea: generalisation comes at a cost
[02:28:12] Ox0dea: Have you started learning C or something
[02:28:24] diegoaguilar: has joined #ruby
[02:28:59] leafybasil: has joined #ruby
[02:29:24] Ox0dea: I wonder if it's possible for an object to determine when and if it's being returned or yielded.
[02:29:31] [k-: but i got state under my belt
[02:29:40] Ox0dea: I think there might should ought to maybe probably be some such hook(s).
[02:29:47] nateberkopec: has joined #ruby
[02:29:53] [k-: https://gist.github.com/SkyBirdSoar/a604e40acf661d4e6212
[02:30:13] [k-: Ox0dea: the overhead would be enormous
[02:30:22] Ox0dea: rollDie feeds rollDie, you say?
[02:30:28] tkuchiki: has joined #ruby
[02:30:45] Ox0dea: [k-: I don't see why that should be so. A patch landed not too awful long ago to make the did_you_mean gem acceptably performant.
[02:31:37] [k-: Ox0dea, >> means then
[02:31:39] shevy: did_you_mean that really Ox0dea
[02:31:53] [k-: do_this (then >>) do_this
[02:32:02] shevy: what is that... that's not ruby
[02:32:08] Ox0dea: But it could be.
[02:32:28] [k-: you also arent ruby but we love you all the same, shevy
[02:33:11] baweaver: has joined #ruby
[02:33:12] ruboto: shevy is the hound of baskerville (see http://irclog.whitequark.org/ruby/2015-08-13#13699759)
[02:33:20] Ox0dea: shevy: https://bugs.ruby-lang.org/issues/10881
[02:33:30] Ox0dea: Not a massive change, of course, but there nonetheless.
[02:34:13] Ox0dea: I suppose it didn't end up mattering much on account of nobu's rewriting the extension bits to be incredibly concise and elegant for such a useful feature.
[02:36:23] nitrix-: has joined #ruby
[02:36:30] bonhoeffer: has joined #ruby
[02:37:28] Ox0dea: Is it possible to invoke instance methods of singleton classes?
[02:37:48] ksteck: has joined #ruby
[02:37:48] shevy: I don't understand the change
[02:38:02] cmoneylulz: has joined #ruby
[02:38:31] nk8: has joined #ruby
[02:38:32] shevy: then again I also don't understand the did_you_mean gem either
[02:38:37] [k-: >> Array.singleton_class.[](1,2,3)
[02:38:37] shevy: but it seems to be fairly minor
[02:38:38] ruboto: [k- # => undefined method `[]' for #<Class:Array> (NoMethodError) ...check link for more (https://eval.in/448519)
[02:38:47] [k-: it is defined!
[02:38:48] shevy: Ox0dea have you finally embraced frozen strings with your full heart?
[02:38:54] Ox0dea: shevy: No, of course not.
[02:38:56] Ox0dea: >> ('foo'.bar rescue $!).receiver
[02:38:57] ruboto: Ox0dea # => undefined method `receiver' for #<NoMethodError: undefined method `bar' for "foo":String> (NoMethodE ...check link for more (https://eval.in/448520)
[02:39:02] Ox0dea: shevy: That's "foo" in 2.3+.
[02:39:22] Ox0dea: That did_you_mean can just hook NameErrors and NoMethodErrors to determine the object on which to search for corrections is pretty convenient.
[02:39:26] [k-: >> Array.singleton_class.new(3)
[02:39:27] ruboto: [k- # => can't create instance of singleton class (TypeError) ...check link for more (https://eval.in/448521)
[02:39:28] patdohere: has joined #ruby
[02:39:38] Ox0dea: [k-: You simply cannot create instances of singleton classes, mate.
[02:39:54] Ox0dea: But we can define instance methods just fine: `class << Class.new; def foo; end; end`.
[02:40:00] Ox0dea: So how to call the damned things?!
[02:40:44] Ox0dea: Guess whose face.
[02:40:50] [k-: >> Math.sin(1.0/0x0dea)
[02:40:51] ruboto: [k- # => 0.00028074115296576846 (https://eval.in/448522)
[02:41:00] Ox0dea: It's not the worst number.
[02:41:07] v4n: has joined #ruby
[02:41:07] jun_: has joined #ruby
[02:41:10] mikecmpbll: has joined #ruby
[02:41:36] Ox0dea: >> 2236081408416666 ** 2 # [k-
[02:41:37] ruboto: Ox0dea # => 5000060065066660656065066555556 (https://eval.in/448523)
[02:41:39] Ox0dea: I like that one.
[02:41:53] Ox0dea: It's one of the precious few single-element OEIS sequences.
[02:42:04] Ox0dea: In this case, the numbers which are squares containing only {0,5,6}.
[02:42:48] Ox0dea: https://oeis.org/A058446
[02:43:16] [k-: >> 1/998001
[02:43:17] ruboto: [k- # => 0 (https://eval.in/448524)
[02:43:22] [k-: >> 1/998001.0
[02:43:23] ruboto: [k- # => 1.002003004005006e-06 (https://eval.in/448525)
[02:43:33] jsuth: has joined #ruby
[02:44:09] maletor_: has joined #ruby
[02:44:13] ruboto: [k- # => 0 (https://eval.in/448526)
[02:44:17] [k-: >> 1/9.0
[02:44:18] ruboto: [k- # => 0.1111111111111111 (https://eval.in/448527)
[02:44:29] [k-: >> 1/99.0
[02:44:30] ruboto: [k- # => 0.010101010101010102 (https://eval.in/448528)
[02:45:14] ziggles: has joined #ruby
[02:45:26] [k-: 98, 9801, 998001, 99980001, 9999800001
[02:46:55] sdothum: has joined #ruby
[02:48:14] mistermocha: has joined #ruby
[02:53:19] tkuchiki: has joined #ruby
[02:57:35] mikecmpbll: has joined #ruby
[02:58:05] bonhoeffer: if i have a mitee.h file and i want to access those functions ??? can i use ffi directly, or do i need a .o to work with
[02:58:27] rewzn: has joined #ruby
[02:58:31] sankaber: has joined #ruby
[02:59:56] michael_mbp: has joined #ruby
[03:00:44] gener1c_: has joined #ruby
[03:00:51] alxndr: has joined #ruby
[03:01:14] ELCALOR: has joined #ruby
[03:01:24] Ox0dea: bonhoeffer: That would be translation, really, not FFI.
[03:01:38] mrtomme: has joined #ruby
[03:01:43] bonhoeffer: the question is if i need to write c application code ??? or can i work with the C interface
[03:02:03] Ox0dea: You've failed to clarify anything.
[03:02:16] avdi: has joined #ruby
[03:02:19] pfg: has joined #ruby
[03:02:29] bonhoeffer: here it looks like I can???t include or call anything without writing the application code: https://github.com/ffi/ffi/wiki/Examples
[03:03:18] bonhoeffer: in that example: /* mylibrary.h */ has ???double calculate_something(int a, float b);??? ??? i would like to call this function in ruby
[03:03:47] bonhoeffer: but the ffi_lib is ffi_lib "path/to/mylibrary.so" ??? not to the header file
[03:04:22] Channel6: has joined #ruby
[03:04:24] Ox0dea: has joined #ruby
[03:05:01] Ox0dea: bonhoeffer: Yes, you need an object file, otherwise you'd be asking for a C-to-Ruby translator.
[03:05:06] user1138_: has joined #ruby
[03:05:27] bonhoeffer: got it ??? so the object file might do nothing more than include the header
[03:05:43] Ox0dea: For what it's worth, you shouldn't be defining functions in header files.
[03:05:48] Ox0dea: Declaring, sure.
[03:05:57] Oog: has joined #ruby
[03:06:19] cek: has joined #ruby
[03:06:21] kellabyte: has joined #ruby
[03:06:34] Ox0dea: Macros are fine in header files, but those "compile away" except where they're used.
[03:06:38] jun_: has joined #ruby
[03:06:39] zenguy_pc: has joined #ruby
[03:07:12] bonhoeffer: i???m hoping to have the methods defined in this file: https://github.com/mit-nlp/MITIE/blob/master/mitielib/include/mitie.h
[03:07:49] Ox0dea: bonhoeffer: These are all function declarations, not definitions.
[03:08:16] Ox0dea: https://github.com/mit-nlp/MITIE/blob/master/mitielib/src/mitie.cpp
[03:08:19] bonhoeffer: so no logic in this file ??? just declarations
[03:08:38] yaogwai: has joined #ruby
[03:08:40] Ox0dea: Well, function declarations give them their types, which is arguably "logic" after a fashion.
[03:08:57] Ox0dea: The C++ file I linked contains the function definitions.
[03:09:08] Ox0dea: I don't know whether you'll be able to compile it standalone, though.
[03:10:10] bonhoeffer: there are definitions in here: https://github.com/mit-nlp/MITIE/blob/master/mitielib/include/mitie/approximate_substring_set.h
[03:10:16] bonhoeffer: in the include directory
[03:11:05] Ox0dea: In any case, the Makefile does compile mitie.cpp into mitie.o, so you may well be able to use just those functions you're interested in.
[03:11:14] dopie: has joined #ruby
[03:11:28] nitrix: has joined #ruby
[03:11:41] pizzaops: has joined #ruby
[03:11:45] bonhoeffer: ah ??? so it looks like the functions are all written in cpp
[03:11:54] charles81: has joined #ruby
[03:12:19] n1ftyn8_: has joined #ruby
[03:12:25] Ox0dea: An immaterial detail for your purposes, I would imagine, but yes.
[03:13:26] Musashi007: has joined #ruby
[03:14:04] mikecmpbll: has joined #ruby
[03:14:20] Ox0dea: bonhoeffer: Eh, I can't get mitie.cpp to build standalone + shared. :/
[03:14:51] bonhoeffer: sorry ??? i think you have to use the makefile
[03:15:03] Ox0dea: Right, but that won't give you a standalone shared object.
[03:15:30] weemsledeux: has joined #ruby
[03:15:45] braincrash: has joined #ruby
[03:15:59] gix: has joined #ruby
[03:16:50] bonhoeffer: hmm . . . good point ??? they call it from python though
[03:16:57] Vile`: has joined #ruby
[03:17:06] bonhoeffer: https://github.com/mit-nlp/MITIE/tree/master/examples/python
[03:18:14] mary5030: has joined #ruby
[03:18:22] Ox0dea: bonhoeffer: Aye, but they're bringing in the entirety of libmitie.
[03:18:28] Ox0dea: Not just those functions in mitie.cpp.
[03:18:40] bonhoeffer: how would one do that with ruby?
[03:18:46] bonhoeffer: "bringing in the entirety of libmitie"
[03:19:01] Ox0dea: Build MITIE with its Makefile, find libmitie.so, and feed that to FFI.
[03:19:06] jun_: has joined #ruby
[03:20:00] Ox0dea: bonhoeffer: http://git.io/vCn4I
[03:20:43] bonhoeffer: got it ??? ok
[03:20:50] Ox0dea: Dynamic libraries are .so on Linux, .dylib on OS X, and .dll on Windows.
[03:21:17] Ox0dea: Be advised that libmitie is much, *much* more than just the functions in mitie.cpp.
[03:21:27] bonhoeffer: what kind of other stuff?
[03:21:42] Zamyatin: has joined #ruby
[03:21:57] Ox0dea: ~ $ find MITIE/dlib/dlib/ | wc -l
[03:22:07] bonhoeffer: i???ll poke at it
[03:22:18] bonhoeffer: so i could use ffi to pull in the so functions
[03:22:35] bonhoeffer: on my mac: /usr/local/lib/libmitie.so
[03:22:41] bnagy: not really how ffi works
[03:22:56] bnagy: you define ruby FFI funcs and ruby calls into the binary directly
[03:23:12] bonhoeffer: not: ffi_lib ???./usr/local/lib/libmitie.so???
[03:23:17] cmoneylulz: has joined #ruby
[03:23:22] Ox0dea: bnagy: Dynamic libraries are "binaries", for all intensive porpoises, mind.
[03:23:45] bnagy: so you'll need to make ruby-level wrappers for all the functions you want to use
[03:23:47] bonhoeffer: and then i should be able to do: attach_function
[03:23:56] bonhoeffer: ok ??? got it
[03:23:59] bonhoeffer: thanks so much
[03:24:04] Ox0dea: Happy to have helped.
[03:24:08] bnagy: you can often munge the .h to do that
[03:24:14] bonhoeffer: very appreciative
[03:24:20] bnagy: especially for simple function signatures
[03:24:25] darkf: has joined #ruby
[03:24:49] mistermocha: has joined #ruby
[03:25:07] popnfloss: has joined #ruby
[03:25:39] bnagy: btw if it's a C++ API you might have a lot of trouble unless they expose a C-style API as well
[03:25:54] popnfloss: ruby on rails? more like ruby on fails! amirite??? :D :D :D
[03:25:58] bnagy: you can try swig but you might also accidentally open a portal to azathoth
[03:26:07] mistermocha: has joined #ruby
[03:27:08] jeregrine: has joined #ruby
[03:28:21] bcavileer: has joined #ruby
[03:28:22] cardoni: has joined #ruby
[03:28:47] Ox0dea: popnfloss: Please elaborate.
[03:28:56] Ox0dea: Ah, I did forget about name mangling. :<
[03:29:28] leafybasil: has joined #ruby
[03:30:29] mikecmpbll: has joined #ruby
[03:31:21] shevy: mame nangling?
[03:31:54] theery: has joined #ruby
[03:32:09] raazdaan: has joined #ruby
[03:32:43] Ox0dea: shevy: Polymorphic compiled languages like C++ have to differentiate between functions of the same name with different signatures.
[03:32:58] Ox0dea: They do so by attaching the necessary additional information to the name, thus "mangling" it.
[03:34:32] jun_: has joined #ruby
[03:35:35] swgillespie: has joined #ruby
[03:37:55] zenguy_pc: has joined #ruby
[03:40:01] riotjones: has joined #ruby
[03:43:30] prestorium: has joined #ruby
[03:46:42] bluOxigen: has joined #ruby
[03:46:54] mikecmpbll: has joined #ruby
[03:47:26] thesheff17: has joined #ruby
[03:47:51] noethics: note that overloading isn't necessarily a language feature in every polymorphic compiled language ^_^
[03:48:28] noethics: or even restricted to polymorphic or compiled languages
[03:48:46] unclouded: has joined #ruby
[03:49:18] noethics: and.. name mangling isn't the only solution.. but this is the limit of my pedantry
[03:50:22] v4n: has joined #ruby
[03:51:34] lipoqil: has joined #ruby
[03:51:37] mistermocha: has joined #ruby
[03:51:46] adambeynon: has joined #ruby
[03:51:49] hellschreiber: has joined #ruby
[03:51:55] Cyther: has joined #ruby
[03:52:56] jun_: has joined #ruby
[03:53:04] gyre007: has joined #ruby
[03:58:25] deimos_: has joined #ruby
[04:00:27] simplyianm: has joined #ruby
[04:01:34] bjeanes: has joined #ruby
[04:02:10] tonini: has joined #ruby
[04:02:50] pili: has joined #ruby
[04:03:48] mikecmpbll: has joined #ruby
[04:04:32] rfv: has joined #ruby
[04:05:46] skmp: has joined #ruby
[04:06:02] bryancp: has joined #ruby
[04:10:34] mclee_: has joined #ruby
[04:11:00] mistermocha: has joined #ruby
[04:12:40] coetry: has joined #ruby
[04:13:18] jun_: has joined #ruby
[04:13:56] zzak: has joined #ruby
[04:13:56] system64: has joined #ruby
[04:14:12] bonhoeffer: has joined #ruby
[04:16:20] uberjar: has joined #ruby
[04:17:11] tejasmanohar: has joined #ruby
[04:19:05] mikecmpbll: has joined #ruby
[04:19:13] CloCkWeRX: has joined #ruby
[04:20:21] vcoinminer: has joined #ruby
[04:22:49] aaeron: has joined #ruby
[04:25:01] YankNYC: has joined #ruby
[04:25:02] halfdan: has joined #ruby
[04:25:12] nyandoge: has joined #ruby
[04:25:16] braincra-: has joined #ruby
[04:30:20] leafybasil: has joined #ruby
[04:32:21] jun_: has joined #ruby
[04:32:25] l_tonz: has joined #ruby
[04:33:52] keen__________10: has joined #ruby
[04:35:02] jsuth: has joined #ruby
[04:36:31] justin_pdx: has joined #ruby
[04:36:50] jpfuente_: has joined #ruby
[04:37:05] dc_: has joined #ruby
[04:38:02] jun_: has joined #ruby
[04:38:02] sanjayu: has joined #ruby
[04:38:21] djbender: has joined #ruby
[04:39:38] mikecmpbll: has joined #ruby
[04:40:47] riotjones: has joined #ruby
[04:41:13] s00pcan: has joined #ruby
[04:42:02] jsuth: has joined #ruby
[04:42:04] jun_: has joined #ruby
[04:42:31] patrick_star: has joined #ruby
[04:43:08] bruno-: has joined #ruby
[04:43:20] dikaio: has joined #ruby
[04:43:32] mistermocha: has joined #ruby
[04:44:44] diego1: has joined #ruby
[04:44:52] diego1: has joined #ruby
[04:45:38] manveru: has joined #ruby
[04:47:03] nk8: has joined #ruby
[04:47:26] michael_mbp: has joined #ruby
[04:47:38] Oog: has joined #ruby
[04:49:29] beauby: has joined #ruby
[04:51:46] Zamyatin: has joined #ruby
[04:51:52] ledestin: has joined #ruby
[04:52:21] yaogwai: has left #ruby: ("Using Circe, the loveliest of all IRC clients")
[04:53:49] aaeron: has joined #ruby
[04:56:44] nk8: has joined #ruby
[05:01:02] wldcordeiro: has joined #ruby
[05:01:11] mikecmpbll: has joined #ruby
[05:02:36] simplyianm: has joined #ruby
[05:07:17] schaary: has joined #ruby
[05:07:44] jpfuente_: has joined #ruby
[05:09:15] jun_: has joined #ruby
[05:09:52] awakpig: has joined #ruby
[05:10:08] baweaver: has joined #ruby
[05:10:23] awakpig: has left #ruby: ()
[05:11:03] diegoviola: has joined #ruby
[05:12:11] jun_: has joined #ruby
[05:12:59] tkuchiki: has joined #ruby
[05:14:55] jun_: has joined #ruby
[05:15:19] pawnbox: has joined #ruby
[05:20:34] Dopagod: has joined #ruby
[05:20:43] [k-: has joined #ruby
[05:23:20] chrisseaton: has joined #ruby
[05:25:17] MiracleBlue: has joined #ruby
[05:26:16] cstrahan: has joined #ruby
[05:27:04] mikecmpbll: has joined #ruby
[05:31:41] greister_: has joined #ruby
[05:34:49] justin_pdx: has joined #ruby
[05:35:12] Zamyatin: has joined #ruby
[05:36:10] arup_r: has joined #ruby
[05:36:36] robbyoconnor: has joined #ruby
[05:36:57] moeabdol: has joined #ruby
[05:37:36] robbyoconnor: has joined #ruby
[05:39:45] UtkarshRay: has joined #ruby
[05:41:35] riotjones: has joined #ruby
[05:42:05] grzegorz: has joined #ruby
[05:42:46] sanjayu: has joined #ruby
[05:42:50] KoolKidzKlub: has joined #ruby
[05:43:04] KoolKidzKlub: what is the tdifference between object literal and constructor
[05:43:30] mikecmpbll: has joined #ruby
[05:43:50] jamto11: has joined #ruby
[05:45:48] solocshaw: has joined #ruby
[05:47:07] claw: has joined #ruby
[05:51:04] pili-t: has joined #ruby
[05:52:47] SylarRuby: has joined #ruby
[05:55:24] aaeron: has joined #ruby
[05:57:21] lxsameer: has joined #ruby
[05:57:40] robbyoconnor: has joined #ruby
[05:59:52] karapetyan: has joined #ruby
[05:59:53] mikecmpbll: has joined #ruby
[05:59:57] yeshacker: has joined #ruby
[06:05:10] last_staff: has joined #ruby
[06:06:29] yardenbar: has joined #ruby
[06:07:21] sanjayu: has joined #ruby
[06:08:10] Oog: has joined #ruby
[06:10:36] Zamyatin: has joined #ruby
[06:15:19] mloy_: has joined #ruby
[06:16:04] mikecmpbll: has joined #ruby
[06:16:58] Guest36: has joined #ruby
[06:17:15] v4n: has joined #ruby
[06:17:42] yeticry: has joined #ruby
[06:17:56] Ambidexter: Anyone in here have experience setting ruby on rails up on a cpanel wbhost?
[06:18:44] arup_r: has joined #ruby
[06:19:52] mozzarella: I thought it was a php-only thing
[06:20:29] Ambidexter: I mean it has the option
[06:20:36] Ambidexter: but it seems to be a real pain in the ass
[06:20:54] Ambidexter: and im not getting any straight results.
[06:21:09] Ambidexter: although ruby is very similar to php
[06:22:29] solocshaw: has joined #ruby
[06:23:48] Ambidexter: another dead end
[06:24:00] Ambidexter: guess im not using it on my personal website lol
[06:25:55] mistermocha: has joined #ruby
[06:27:27] Ambidexter: hah well thanks.
[06:34:08] finisherr: has joined #ruby
[06:34:16] Channel6: has joined #ruby
[06:39:22] bruno-: has joined #ruby
[06:41:04] Radar: Diabolik: Get the 2nd edition
[06:41:15] Radar: Diabolik: 2nd edition has the most up-to-date content :)
[06:42:28] riotjones: has joined #ruby
[06:43:07] rippa: has joined #ruby
[06:43:35] Ambidexter: because its just on my host
[06:44:14] Ambidexter: is there a better alternative than cpanel on a different host, excluding like heroku.
[06:45:30] pocketprotector-: has joined #ruby
[06:45:34] Ambidexter: can you be more specific please?
[06:47:16] houhoulis: has joined #ruby
[06:52:54] htmldrum: has joined #ruby
[06:53:12] nk8: has joined #ruby
[06:55:51] Spami: has joined #ruby
[06:55:59] xcesariox: has joined #ruby
[06:58:54] vdamewood: has joined #ruby
[07:00:16] jamto11: has joined #ruby
[07:01:13] leafybasil: has joined #ruby
[07:01:30] maletor_: has joined #ruby
[07:01:34] pawnbox: has joined #ruby
[07:02:10] psy: has joined #ruby
[07:02:36] pawnbox: has joined #ruby
[07:08:41] heyimwill: has joined #ruby
[07:12:13] jun_: has joined #ruby
[07:12:38] tkuchiki: has joined #ruby
[07:16:57] psy: has joined #ruby
[07:18:11] Guest36: has joined #ruby
[07:20:15] benlieb: has joined #ruby
[07:21:31] whois: is heroku the best place to configure rails?
[07:24:04] blackmesa: has joined #ruby
[07:30:53] finisherr: has joined #ruby
[07:32:19] stardiviner: has joined #ruby
[07:32:21] firstdayonthejob: has joined #ruby
[07:33:10] Gnomethrower: has joined #ruby
[07:34:27] oetjenj: has joined #ruby
[07:37:40] arup_r: has joined #ruby
[07:39:00] blackmesa: has joined #ruby
[07:40:06] MasterNayru: has joined #ruby
[07:40:13] krasnus: has joined #ruby
[07:43:13] CloCkWeRX: has joined #ruby
[07:47:26] k3asd`: has joined #ruby
[07:50:09] rbowlby: has joined #ruby
[07:51:37] jamesaxl: has joined #ruby
[07:56:08] solocshaw: has joined #ruby
[08:01:33] rickmasta: has joined #ruby
[08:01:52] leafybasil: has joined #ruby
[08:02:29] blackmesa: has joined #ruby
[08:04:33] rbowlby: has joined #ruby
[08:13:05] triangles2: has joined #ruby
[08:15:39] kalusn: has joined #ruby
[08:20:22] Soda: has joined #ruby
[08:22:49] pawnbox: has joined #ruby
[08:23:59] dc_: has joined #ruby
[08:25:58] michael_mbp: has joined #ruby
[08:29:14] Sheperson: has joined #ruby
[08:32:57] blackmesa: has joined #ruby
[08:35:31] Guest36: has joined #ruby
[08:36:26] pili-h: has joined #ruby
[08:36:51] bruno-: has joined #ruby
[08:37:28] karapetyan: has joined #ruby
[08:38:06] vcoinminer: has joined #ruby
[08:38:24] avdi: has joined #ruby
[08:38:35] jeregrine: has joined #ruby
[08:39:14] jun_: has joined #ruby
[08:39:35] freezevee: has joined #ruby
[08:39:37] bjeanes: has joined #ruby
[08:40:07] alxndr: has joined #ruby
[08:40:13] freezevee: I have an array a = [2,4,6,8] and I am trying to iterate for all elements except a[2]
[08:40:22] freezevee: how can I do it ?
[08:40:34] pawnbox: has joined #ruby
[08:40:52] schaary: has joined #ruby
[08:40:59] adambeynon: has joined #ruby
[08:41:26] system64: has joined #ruby
[08:41:27] hellschreiber: has joined #ruby
[08:41:45] freezevee: I can do a.reject {|k| k == 2 } but I can't iterate over the results in place(.each) without saving the changes (.reject!)
[08:42:30] Mon_Ouie: You can use each (or each__with_index) and just use 'next' to skip an element that meets some condition
[08:43:10] jgt: has joined #ruby
[08:43:12] pizzaops: has joined #ruby
[08:44:18] n1ftyn8_: has joined #ruby
[08:45:00] sagittarian: has joined #ruby
[08:45:19] freezevee: you mean a simple conditional ? like running .each and if index == 2 continue to next iteration ?
[08:45:27] gyre007: has joined #ruby
[08:45:41] lipoqil: has joined #ruby
[08:46:40] ELCALOR: has joined #ruby
[08:47:29] Shoutsid: has joined #ruby
[08:47:35] bryancp: has joined #ruby
[08:47:50] cek: has joined #ruby
[08:47:51] weihan: has joined #ruby
[08:47:53] Mon_Ouie: next is a keyword that skips the next element
[08:47:56] deimos_: has joined #ruby
[08:48:02] Mon_Ouie: that skips to the next element*
[08:48:47] Mon_Ouie: (Which is the same as just warping the entire rest of the block in a big if)
[08:49:06] charles81: has joined #ruby
[08:49:12] halfdan: has joined #ruby
[08:49:17] bcavileer: has joined #ruby
[08:49:22] manveru: has joined #ruby
[08:49:26] Sheperson: Date, DateTime, Time and String objects respond to to_time
[08:49:41] Sheperson: is there any other class that responds to to_time?
[08:50:00] freezevee: Mon_Ouie: thank you
[08:50:31] crdpink: has joined #ruby
[08:50:43] Mon_Ouie: >> "foo".to_time
[08:50:44] ruboto: Mon_Ouie # => undefined method `to_time' for "foo":String (NoMethodError) ...check link for more (https://eval.in/448594)
[08:50:56] kellabyte: has joined #ruby
[08:50:56] apeiros: String#to_time is rails
[08:51:08] apeiros: and there, the AS Time classes also respond to to_time iirc
[08:51:14] Sheperson: any other classes?
[08:51:19] n008f4g_: has joined #ruby
[08:51:26] djbender: has joined #ruby
[08:51:29] rfv: has joined #ruby
[08:51:43] darkxploit: has joined #ruby
[08:51:47] crdpink: has joined #ruby
[08:52:00] apeiros: sheperson: ObjectSpace.each_object(Class).select { |c| c.method_defined?(:to_time) }
[08:52:33] skmp: has joined #ruby
[08:54:04] charliesome: has joined #ruby
[08:54:06] cstrahan: has joined #ruby
[08:54:39] MiracleBlue: has joined #ruby
[08:55:27] chrisseaton: has joined #ruby
[08:55:31] l_tonz: has joined #ruby
[08:55:59] yeshacker: has joined #ruby
[08:57:08] nyandoge: has joined #ruby
[08:57:33] pfg: has joined #ruby
[08:58:03] speakingcode: has joined #ruby
[08:58:28] l_tonz: has joined #ruby
[09:01:09] tonini: has joined #ruby
[09:02:41] jamto11: has joined #ruby
[09:02:59] pawnbox: has joined #ruby
[09:03:57] Helius: has joined #ruby
[09:04:27] Peteykun: has joined #ruby
[09:05:21] pawnbox_: has joined #ruby
[09:05:43] cardoni: has joined #ruby
[09:06:41] zzak: has joined #ruby
[09:07:01] AlexRussia: has joined #ruby
[09:07:03] DEA7TH: has joined #ruby
[09:10:49] solocshaw: has joined #ruby
[09:11:50] YankNYC: has joined #ruby
[09:13:46] [k-: :o i would have used respond_to? there and then
[09:13:58] [k-: that wouldn't have worked though
[09:14:26] prateekp: has joined #ruby
[09:14:57] prateekp: i have a gem which has dependency on rake for installation
[09:15:18] prateekp: how can i make sure that if rake is not installed on the system it throws error
[09:15:39] prateekp: i am calling from extconf.rb in system("rake mytask")
[09:16:17] _blizzy_: has joined #ruby
[09:17:00] Jackneill: has joined #ruby
[09:18:44] AlexRussia: has joined #ruby
[09:22:22] blackmesa: has joined #ruby
[09:24:34] _blizzy_: has joined #ruby
[09:24:44] grzegorz: prateekp you can do "require 'rake'" and something like "raise RuntimeError, 'missing rake' unless defined?(Rake)
[09:25:21] grzegorz: but if you add rake as dependency to your gemspec, it should be installed when your gem is installed
[09:25:41] grzegorz: so there should never be a situation where rake is not present in the system, right?
[09:25:42] prateekp: so how should i do that
[09:26:16] prateekp: i can do without rake as well. But rake makes thing look good
[09:26:37] grzegorz: hmm, but calling "system('rake')" might not be the best idea
[09:26:48] grzegorz: for example, I use "bundle exec rake" to select the proper rake version
[09:27:14] prateekp: ahh "system('rake')" is not good?
[09:27:42] grzegorz: I think you should rather use "Rake::Task['mytask'].invoke"
[09:27:42] ndrei: has joined #ruby
[09:28:03] karapetyan: has joined #ruby
[09:28:12] prateekp: hmm yeah i should try it
[09:28:18] jhass: prateekp: extracting things so that you can do MyGem::ExtensionBuilder.build in both the task and extconf.rb would certainly be a lot nicer
[09:28:46] prateekp: jhass: i dint get that
[09:29:07] houhoulis: has joined #ruby
[09:29:19] jhass: build a class that does whatever your task currently does, call it from the task and extconf.rb directly
[09:29:34] tejasmanohar: has joined #ruby
[09:29:53] prateekp: hmm seems nice
[09:30:17] prateekp: and that class should be somewhere in lib/ ?
[09:30:34] jhass: somewhere in lib/your_gem to be specific
[09:31:17] prateekp: i am currently having only one file in lib/
[09:31:29] prateekp: is that the wrong way to go abt it
[09:31:56] prateekp: though i can make lib/your_gem and require that lib/your_gem/file in lib/mygem.rb
[09:32:09] prateekp: which is a better way to do
[09:32:09] jhass: http://guides.rubygems.org/name-your-gem/
[09:32:19] jhass: it's not wrong
[09:32:31] jhass: if you add stuff it should just be inside your namespace
[09:33:31] prateekp: so in that case i should add some utility class in my gem's namespace
[09:33:50] prateekp: and then call it from both extconf and rakefile
[09:34:06] Pro|: has joined #ruby
[09:38:44] prateekp: but that class should be private
[09:38:49] prateekp: and not public
[09:39:40] KensoDev: has joined #ruby
[09:40:22] Shoutsid: has joined #ruby
[09:40:31] sanjayu: has joined #ruby
[09:43:13] SCHAAP137: has joined #ruby
[09:45:12] karapetyan: https://projecteuler.net/problem=44
[09:45:20] karapetyan: does anyone know how to solve it?
[09:46:22] Shoutsid: has joined #ruby
[09:49:42] bowl323: has joined #ruby
[09:51:10] bowl323: has left #ruby: ()
[09:52:34] Shoutsid: has joined #ruby
[09:53:17] jhass: karapetyan: there's probably some math trick for it, but why don't you start with a naive iterative approach?
[09:55:16] bubbys: has joined #ruby
[09:55:47] subscope: has joined #ruby
[09:57:16] xcesariox: has joined #ruby
[09:58:09] prateekp: hi jhass: i am getting bit confused
[09:58:15] prateekp: where should i make the class
[09:58:56] Shoutsid: has joined #ruby
[09:58:57] prateekp: and using system('rake mytask') in extconf.rb does nothing when rake is not present
[09:59:06] prateekp: it does not throw error as well
[09:59:31] prateekp: how can i make sure rake is installed by user along with gem
[09:59:41] prateekp: should i add it in runtime dependency?
[10:00:44] karapetyan: jhass: cause it's endless sequence and when i generating new member of sequence i can't compare with element's that was not generated yet
[10:01:27] solocshaw1: has joined #ruby
[10:01:57] jhass: prateekp: the point of introducing a class is to get rid of system("rake") or any Rake dependency
[10:02:13] sdothum: has joined #ruby
[10:02:41] jhass: karapetyan: write me a method that returns Pn for a given n
[10:03:16] jamto11: has joined #ruby
[10:04:00] prateekp: jhass: should i define the class in extconf itslef
[10:04:27] Shoutsid: has joined #ruby
[10:05:07] jhass: prateekp: unless you want to keep your rake task too that's a possibility
[10:05:38] sameerynho: has joined #ruby
[10:06:15] prateekp: ok suppose i make a class in lib/mygem/util.rb, then how would i access it in extconf
[10:06:25] prateekp: by using require 'mygem'
[10:07:04] karapetyan: jhass: https://gist.github.com/karapetyan/0284d4fe6d9616f52da2
[10:07:20] stamina: has joined #ruby
[10:07:23] jhass: prateekp: with require_relative
[10:07:43] jhass: karapetyan: not what I asked for
[10:08:17] khebbie: has joined #ruby
[10:09:02] prateekp: jhass: now tell me the best location to keep such class
[10:09:33] apt-get: has joined #ruby
[10:09:36] jhass: lib/foo/extension_builder.rb? depends on what you want to name it
[10:10:43] karapetyan: jhass: https://gist.github.com/karapetyan/8cf3cd9627fe52df99bf
[10:12:07] jhass: karapetyan: that's a class printing it to stdout, not a method returning it
[10:12:39] kies^: has joined #ruby
[10:12:42] karapetyan: jhass: https://gist.github.com/karapetyan/3887c24c66ff59ee2ca9
[10:13:32] mmb: has joined #ruby
[10:15:18] jhass: karapetyan: still a class for no reason
[10:15:34] jhass: pe will have no useful value
[10:15:57] karapetyan: jhass: what next? :)
[10:16:36] jhass: karapetyan: memoize the computation, eg. cache the results in a hash. Setting Hash#default_proc might come in handy
[10:17:58] Salehi: has joined #ruby
[10:18:03] jhass: remember, cache
[10:19:36] voker57: has joined #ruby
[10:20:07] karapety_: has joined #ruby
[10:20:40] spider-mario: has joined #ruby
[10:21:46] nfk: has joined #ruby
[10:22:56] roshanavand: has joined #ruby
[10:24:14] decoponio: has joined #ruby
[10:28:23] prateekp: jhass: i added class and removed rake.
[10:28:33] prateekp: but now tell me a good place to keep this class
[10:28:44] prateekp: should i keep in it in lib/
[10:28:50] prateekp: or what about bin/ ?
[10:29:00] prateekp: whats the best practice?
[10:29:50] jhass: prateekp: didn't I already?
[10:30:46] prateekp: actually files in lib/ belong to gem, right?
[10:30:49] PaulCape_: has joined #ruby
[10:31:01] prateekp: so i was a bit confused
[10:31:40] prateekp: hmm but its ok i think
[10:31:58] prateekp: lets go with lib/util/extenion_builder.rb
[10:32:29] bruno-: has joined #ruby
[10:33:59] roshanav_: has joined #ruby
[10:34:12] Diabolik: Radar, around?
[10:34:31] Diabolik: I didn't see your reply because i got too many messages :(
[10:38:43] ruboto: You can find a log of this channel at http://irclog.whitequark.org/ruby/
[10:42:14] Chau: has joined #ruby
[10:43:21] jgt: has joined #ruby
[10:45:18] doddok: has joined #ruby
[10:46:15] blueOxigen: has joined #ruby
[10:46:40] vedis: has joined #ruby
[10:48:18] joonty: has joined #ruby
[10:48:20] BTRE: has joined #ruby
[10:50:53] tkuchiki: has joined #ruby
[10:51:58] rosenberg: has joined #ruby
[10:51:59] mikecmpbll: has joined #ruby
[10:52:20] rosenberg: has left #ruby: ()
[10:55:34] UtkarshRay: has joined #ruby
[11:04:12] jamto11: has joined #ruby
[11:06:02] lolmaus: has joined #ruby
[11:06:38] PhantomS_: has joined #ruby
[11:11:55] ohcibi: has joined #ruby
[11:12:01] skade: has joined #ruby
[11:12:38] shevy: <Radar> Diabolik: Get the 2nd edition
[11:12:38] shevy: <Radar> Diabolik: 2nd edition has the most up-to-date content :)
[11:13:37] ohcibi: hi, i have a time like "13:00" and i want to add minutes... i'm not adding more than 200 minutes, so there is no daychange involved and I dont need to mess with timezones or anything, i just want to be able to 13:00 + 80 = 14:20.. can I do this with the Time class somehow? all i'm finding is adding or deleting times to a specific date
[11:13:50] pawnbox: has joined #ruby
[11:13:51] Diabolik: shit i just bough the first edition :(
[11:14:14] jhass: ohcibi: https://github.com/hpoydar/chronic_duration
[11:14:17] shevy: ohcibi you can use + for seconds
[11:14:28] jhass: ohcibi: or simply strptime it
[11:15:09] shevy: so 80 minutes would be (80 * 60) seconds
[11:15:39] mmb: has joined #ruby
[11:16:06] ohcibi: shevy: read what I wrote.... i'm asking how to do this without referencing a specific date and time, which is all I found in google..
[11:16:30] apeiros: nonono @strptime
[11:16:45] apeiros: Time != Duration, and "13:00" in the sense of "13 hours" is a duration, not a time.
[11:17:09] beauby: has joined #ruby
[11:17:19] karapetyan: has joined #ruby
[11:17:33] jhass: ohcibi: might be 13:00 o'clock, question was vague in that regard
[11:17:39] jhass: er, apeiros ^
[11:17:48] ohcibi: its NOT 13 o clock
[11:17:55] ohcibi: its 13 hours and zero minutes
[11:18:00] apeiros: jhass: ok, true. but now we have clarification :)
[11:18:19] ohcibi: 13 hours and zero minutes can usually be displayed as 13:00
[11:18:27] ohcibi: same as 13 o clock would be displayed
[11:18:37] jhass: 13 minutes and 0 seconds is too
[11:18:54] ohcibi: so i want to add 20 minutes to 13 hours and zero minutes and not to 13 o clock
[11:19:23] jhass: well see my link and add :00 to make it unambiguous
[11:19:39] shevy: I needed something like that for calculating how much video to cut away via ffmpeg once
[11:20:54] ohcibi: so there is no builtin class that can deal with this, is this kind of math hardcoded into the Time class? i'd expect that the Time class uses some independent module to do such calculations?
[11:21:30] jhass: doesn't it use libc for most of that stuff?
[11:21:47] jhass: so no, there isn't
[11:21:55] jhass: Time deals with points in time only, not duration
[11:21:58] ohcibi: idk... its terribly hard to google for this, as 99% is related to "Time" and not "Duration" problems
[11:22:27] shevy: didn't apeiros have some gem called chronos or so for that?
[11:22:40] ohcibi: nah i dont want to use an extra gem
[11:23:03] ohcibi: i'm writing a rakefile and the only thing I want to expect from the users is that they have ruby installed
[11:23:07] jhass: hours, minutes = .split(":").map(&:to_i) works too I guess
[11:23:44] ohcibi: what I need is the other way around, but yes, it'll work
[11:24:02] jhass: "the other way around" is a simple divmod
[11:24:18] ohcibi: but i dont need to do this when dealing with Time
[11:24:36] ohcibi: so i've asked if this is possible with durations but not with Time
[11:24:37] jhass: you're not dealing with times though, you're dealing with durations
[11:24:55] ohcibi: thats what we learned some lines above 8-)
[11:24:56] jhass: and the answer is no, stdlib doesn't have any duration handling
[11:25:08] shevy: stdlib understands time though!
[11:25:25] ohcibi: jhass: youve already told me that 8-)
[11:25:40] shevy: jhass: you already told him that several times!
[11:25:43] jhass: then why are we still talking?
[11:25:57] ohcibi: jhass: idk
[11:26:15] ohcibi: shevy: time but not duration
[11:26:50] shevy: perhaps a Time.duration method
[11:26:54] Sheperson: has joined #ruby
[11:26:55] mllie: has joined #ruby
[11:26:59] shevy: but duration is not time!
[11:27:19] shevy: assumingly ruby core would not want to add a new Duration toplevel namespace either
[11:27:19] jhass: the question is if Time#-(Time) is duration
[11:27:30] bowl323: has joined #ruby
[11:27:41] jhass: shevy: in Crystal we're calling it Time::Span for now
[11:28:04] bowl323: I'm looking to learn either Ruby or Python, which is the better choice?
[11:28:25] jhass: bowl323: Ruby. Now ask #python and get Python as reply.
[11:28:46] shevy: bowl323 http://www.artima.com/intv/ruby.html
[11:28:57] mllie: Hello! I've just updated rvm and got some warnings: http://pastebin.com/eYTdeUw6. What's that?
[11:28:57] ruboto: mllie, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/5adba66e501412b33d41
[11:28:58] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[11:29:01] shevy: no idea if python has such an interview
[11:29:44] shevy: I still wonder what would have been different if I would have picked python back then
[11:29:52] tkuchiki: has joined #ruby
[11:30:05] jhass: mllie: seems pretty clear, any questions?
[11:30:28] jhass: ?better bowl323
[11:30:28] ruboto: bowl323, "Best" and "better" are subjective. Try to use a different term.
[11:30:51] Shoutsid: has joined #ruby
[11:31:14] shevy: you could also try to go with perl 6 past 2015 bowl323 :)
[11:31:24] mllie: jhass: Yes, for example what does rvm cleanup all?
[11:31:26] shevy: larry wall's keynote was all about hobbits
[11:32:31] pawnbox: has joined #ruby
[11:32:33] havenn: mllie: You can read about the `rvm cleanup all` command with `rvm help cleanup`.
[11:32:37] jhass: mllie: I would expect rvm help cleanup explains it
[11:32:48] leafybasil: has joined #ruby
[11:33:01] lkba: has joined #ruby
[11:33:15] havenn: shevy: hobbitses do make good programmers
[11:33:47] mllie: jhass: Alright, and what do I need to fix for these warnings then? And how do I recheck if I've done right?
[11:34:09] jhass: you did read them, right?
[11:34:18] tknz: has joined #ruby
[11:34:36] bowl323: has left #ruby: ()
[11:34:59] bonhoeffer: has joined #ruby
[11:35:00] mllie: jhass: yes
[11:35:16] jhass: so what do you think you would need to do?
[11:35:28] mllie: jhass: And I also think it's look a bit weird in my path variable with all these rvm-paths. Is that correct?
[11:36:39] jhass: isn't RVM just telling you it isn't?
[11:37:34] roshanavand: has joined #ruby
[11:37:38] zotherstupidguy: has joined #ruby
[11:39:24] mllie: jhass:true
[11:39:30] karapetyan: has joined #ruby
[11:40:02] riotjones: has joined #ruby
[11:40:09] havenn: mllie: `PATH="$PATH:/stuff"` is appending to PATH. `PATH="/stuff:$PATH"` is prepending to PATH. One of the RVM warnings is that you're nuking PATH like `PATH="/stuff:/existing/path/ignored"`.
[11:40:31] havenn: mllie: ^ Make any sense?
[11:41:19] mllie: havenn: Yes. That's fixed now
[11:41:33] mllie: havenn: This is the last warning though: Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set, see: https://github.com/wayneeseguin/rvm/issues/3212
[11:41:41] charliesome: has joined #ruby
[11:42:39] khebbie: has joined #ruby
[11:45:08] Sheperson: The each_with_object method has been deprecated in Rails and moved to Ruby, am I right?
[11:45:31] Sheperson: not moved, added
[11:46:45] Mon_Ouie: It's been part of Ruby since 1.9.something
[11:47:29] havenn: mllie: You might consider rerunning the install script to setup your dotfiles for you: rvm get head --auto-dotfiles
[11:47:40] roshanav_: has joined #ruby
[11:48:58] mllie: havenn: Tried it before, but now it worked also :D
[11:49:08] havenn: mllie: \o/
[11:49:12] phutchins: has joined #ruby
[11:49:14] htmldrum: has joined #ruby
[11:49:19] mllie: havenn: How do you do to auto change gemset + ruby when changing directory?
[11:49:23] pandaant: has joined #ruby
[11:50:00] havenn: mllie: Use a .ruby-version and if you like a .ruby-gemset file.
[11:50:07] havenn: ACTION mllie: https://rvm.io/workflow/projects#project-file-ruby-version
[11:50:10] mllie: havenn: I have that
[11:50:28] bougyman: using rvm or chruby or rbenv?
[11:51:14] CloCkWeRX: has joined #ruby
[11:52:00] mllie: havenn: Haha, lol. Now it works... So much magic you provided :D
[11:52:06] mllie: Thanks havenn and jhass !!
[11:52:12] havenn: bougyman: Twas RVM.
[11:52:59] tkuchiki: has joined #ruby
[11:53:22] tkuchiki_: has joined #ruby
[11:53:42] roshanavand: has joined #ruby
[11:56:46] pili: has joined #ruby
[11:57:07] skade: has joined #ruby
[11:59:07] kalusn: has joined #ruby
[11:59:35] Peteykun: has joined #ruby
[12:00:38] PaulCapestany: has joined #ruby
[12:01:35] Shoutsid: has joined #ruby
[12:03:28] michael_mbp: has joined #ruby
[12:04:15] bonhoeffer: has joined #ruby
[12:04:44] jamto11: has joined #ruby
[12:06:28] mllie: havenn: do you know ruby on rails as well?
[12:06:54] yie: has joined #ruby
[12:07:01] Janno: has joined #ruby
[12:07:19] Affix: has joined #ruby
[12:07:47] async_prince: has joined #ruby
[12:07:59] jhass: ?rails mllie
[12:07:59] ruboto: mllie, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[12:08:10] dvarrui: has joined #ruby
[12:09:35] roshanav_: has joined #ruby
[12:11:19] andykingking: has joined #ruby
[12:12:07] Shoutsid: has joined #ruby
[12:13:47] codecop: has joined #ruby
[12:14:51] PaulCape_: has joined #ruby
[12:17:30] Shoutsid: has joined #ruby
[12:18:18] Azure: has joined #ruby
[12:18:26] roshanavand: has joined #ruby
[12:20:31] noethics: D: ruby's json functionality sucks
[12:20:47] roshanav_: has joined #ruby
[12:21:20] Shoutsid: has joined #ruby
[12:22:06] leafybasil: has joined #ruby
[12:22:48] shevy: you so evil!
[12:24:26] [k-: did i hear evil???
[12:24:30] noethics: what is the preferred method of encoding arbitrary objects to json
[12:25:34] bluOxigen: has joined #ruby
[12:26:33] rewzn: has joined #ruby
[12:29:42] noethics: bnagy, pls i need the socratic method
[12:30:26] noethics: fwiw i'm amazed that .to_json doesn't actually introspect my object
[12:30:42] noethics: how is it even useful
[12:32:21] Shoutsid: has joined #ruby
[12:34:41] weihan: has joined #ruby
[12:34:42] tier: has joined #ruby
[12:36:37] mfb2: has joined #ruby
[12:38:09] shevy: to pass strings over the www!
[12:38:45] stardiviner: has joined #ruby
[12:38:55] noethics: so long as your object is a hash or array!
[12:38:55] weihan: has joined #ruby
[12:39:08] _blizzy_: has joined #ruby
[12:39:18] nettoweb: has joined #ruby
[12:39:21] noethics: otherwise you get a lovely to_s
[12:40:11] karapetyan: has joined #ruby
[12:40:56] xcesariox: has joined #ruby
[12:41:42] amystephen: has joined #ruby
[12:42:49] Shoutsid: has joined #ruby
[12:46:14] _blizzy_: has joined #ruby
[12:46:17] rodfersou: has joined #ruby
[12:48:24] Shoutsid: has joined #ruby
[12:51:21] mmb: has joined #ruby
[12:52:05] Kendos-Kenlen: has joined #ruby
[12:52:41] stardiviner: has joined #ruby
[12:53:29] nettoweb: has joined #ruby
[12:54:06] acke: has joined #ruby
[12:54:11] [k-: ruby doesn't even know what is the purpose of your object
[12:54:29] [k-: and json doesn't know the way your object should be represented
[12:54:48] [k-: how do you expect a representation to pop out of nowhere?
[12:57:13] psy: has joined #ruby
[12:57:40] shevy: we want intelligent systems
[12:57:49] shredding: has joined #ruby
[12:59:02] Shoutsid: has joined #ruby
[13:01:30] rgtk: has joined #ruby
[13:03:34] Kendos-Kenlen: has joined #ruby
[13:05:33] jamto11: has joined #ruby
[13:05:59] odt: has left #ruby: ("Leaving")
[13:11:43] jdawgaz: has joined #ruby
[13:11:45] bonhoeffer: has joined #ruby
[13:12:13] ndrei: has joined #ruby
[13:12:28] ItSANgo: has joined #ruby
[13:14:12] ndrei: has joined #ruby
[13:14:30] DEA7TH: has joined #ruby
[13:14:57] The_Phoenix: has joined #ruby
[13:15:59] Shoutsid: has joined #ruby
[13:16:03] rgtk_: has joined #ruby
[13:20:05] roshanavand: has joined #ruby
[13:21:09] Kendos-Kenlen: has joined #ruby
[13:22:05] _blizzy_: has joined #ruby
[13:24:03] mistermocha: has joined #ruby
[13:27:12] sgambino: has joined #ruby
[13:28:13] Bellthoven: has joined #ruby
[13:29:59] arup_r: has joined #ruby
[13:30:50] nanoz: has joined #ruby
[13:30:53] bonhoeffer: has joined #ruby
[13:31:29] atomical: has joined #ruby
[13:32:17] David27: has joined #ruby
[13:32:23] Encapsulation: has joined #ruby
[13:38:06] leafybasil: has joined #ruby
[13:38:17] Kendos-Kenlen: has joined #ruby
[13:40:01] jessemcgilallen: has joined #ruby
[13:42:34] karapetyan: has joined #ruby
[13:44:46] gambl0re: has joined #ruby
[13:45:11] CrazyEddy: has joined #ruby
[13:45:20] roshanavand: has joined #ruby
[13:46:07] dawkirst: has joined #ruby
[13:46:55] khebbie: has joined #ruby
[13:47:15] yeticry: has joined #ruby
[13:51:19] dorei: has joined #ruby
[13:52:25] acke: has joined #ruby
[13:53:59] michael_mbp: has joined #ruby
[13:54:42] AustinMatherne: has joined #ruby
[13:55:14] noethics: same way serializing to json works in like every other language ;p
[13:56:12] davidt: has joined #ruby
[13:56:26] bonhoeffer: does anyone know what might be going on here: https://gist.github.com/tbbooher/ffff9e6a5d4cc63da00a
[13:56:46] bonhoeffer: i get this as an output: ??????+??????
[13:57:40] spider-mario: has joined #ruby
[13:57:52] mdst: has joined #ruby
[13:59:25] zapata: has joined #ruby
[14:00:30] michael_mbp: has joined #ruby
[14:02:14] jamesaxl|2: has joined #ruby
[14:04:01] DoubleMalt: has joined #ruby
[14:05:58] brunto: has joined #ruby
[14:06:27] jamto11: has joined #ruby
[14:07:02] PaulCapestany: has joined #ruby
[14:07:07] lkba_: has joined #ruby
[14:11:12] PaulCapestany: has joined #ruby
[14:13:14] Zamyatin: has joined #ruby
[14:14:48] DoubleMalt: has joined #ruby
[14:20:49] grzegorz: has joined #ruby
[14:20:56] ericjphillips: has joined #ruby
[14:21:00] arup_r: has joined #ruby
[14:22:01] The_Phoenix: has joined #ruby
[14:23:18] The_Phoenix: has joined #ruby
[14:23:20] yardenbar: Hi all, can anyone suggest how to connvet from a ruby 1.8.6 script(yep, can't upgrade) to a Vertica node?
[14:23:38] shevy: what is a vertica node
[14:24:39] The_Phoenix1: has joined #ruby
[14:26:49] ericjphillips: has joined #ruby
[14:29:32] mmb: has joined #ruby
[14:30:18] [k-: we don't even know if such a thing as a vertical node exists
[14:30:31] [k-: and all these weird nomenclature floating around doesnt help!
[14:32:58] shevy: yeah and people using 1.8.6
[14:33:15] shevy: it's like the past comes alive!
[14:33:39] shinnya: has joined #ruby
[14:37:06] yardenbar: I meant HP Vertica
[14:38:01] ruurd: has joined #ruby
[14:38:38] jdawgaz: has joined #ruby
[14:39:00] jamto11: has joined #ruby
[14:39:54] freezevee: has joined #ruby
[14:40:42] karapetyan: has joined #ruby
[14:41:10] noethics: step 1. find someone who knows ruby and vertica
[14:41:12] noethics: step 2. hire them
[14:41:54] freezevee: has joined #ruby
[14:42:41] roshanavand: has joined #ruby
[14:44:46] apt-get: has joined #ruby
[14:47:48] ruurd: has joined #ruby
[14:49:07] Emmanuel_Chanel: has joined #ruby
[14:49:59] Emmanuel_Chanel: Hello! Is there a good web explanation how to save IMAP folder's mails into local Maildir?
[14:50:12] bougyman: what did you google for?
[14:50:24] bougyman: fetchmail should be able to cut that pretty easily.
[14:50:41] bougyman: are you looking for a ruby solution, or just a solution?
[14:52:05] Emmanuel_Chanel: I saw some ruby scripts. And I edited one into my own script reading an IMAP folder and saving them into my local IMAP server.
[14:52:35] Emmanuel_Chanel: It categorize those mails to some. But I don't want to show my local shell password.
[14:52:56] jhass: fetchmail + sieve ?
[14:53:46] jhass: for example pigeonhole for dovecot
[14:59:16] shevy: yardenbar well when it comes to ruby, such as syntax problems, you can always put problematic code on a pastie and people can try to help; HP Vertica though, I don't think many people know it, I never heard of it before for instance
[14:59:40] lolmaus: has joined #ruby
[15:02:03] yardenbar: shevy, thank you, I'll persue a solution through Vertica and not deal with ruby stuff
[15:02:05] guardianL: has joined #ruby
[15:02:14] yardenbar: Its not a must
[15:02:24] guardianL: has left #ruby: ()
[15:07:10] DEA7TH: def A.bar '' end - after I did that, can I undo it?
[15:07:33] grenierm: has joined #ruby
[15:07:34] DEA7TH: I need to mock a method, but instead of returning a constant value, I want the output to depend on the input
[15:08:02] adaedra: You can override it by re-defining it again
[15:09:25] noethics: if i had a module embedded in a class, how do i access stuff inside the module with an instance of the class?
[15:09:26] DEA7TH: I want to restore the original implementation, but I don't want to copypaste it.
[15:10:16] shevy: DEA7TH you can knock out methods; remove_method; undefine_method, however had if you have not captured the original implementation somewhere then there is no way to restore to it
[15:10:39] noethics: >> class A; module B; def C(); puts 'o'; end; end; end; a = new A::B; a.C()
[15:10:40] ruboto: noethics # => undefined method `new' for main:Object (NoMethodError) ...check link for more (https://eval.in/448628)
[15:10:41] acke_: has joined #ruby
[15:11:06] shevy: a non-ruby user!!!
[15:11:10] noethics: >> class A; module B; def C(); puts 'o'; end; end; end; a = A.new; a::B.C()
[15:11:11] ruboto: noethics # => #<A:0x4083bd60> is not a class/module (TypeError) ...check link for more (https://eval.in/448629)
[15:11:19] shevy: he put the new on the left side !
[15:11:38] fon: has joined #ruby
[15:11:43] tier_: has joined #ruby
[15:11:56] riskish: has joined #ruby
[15:12:02] fon: In Ruby, what exactly is the top-level scope? Is it a class? A module?
[15:12:43] sankaber: has joined #ruby
[15:13:04] jhass: fon: an anonymous instance of Object called main
[15:13:04] noethics: you pretty much do what you want
[15:13:30] sankaber: has joined #ruby
[15:13:37] adaedra: >> p self # fon
[15:13:38] ruboto: adaedra # => main ...check link for more (https://eval.in/448630)
[15:13:40] shevy: anonymous with a name ...
[15:14:06] adaedra: meh, thought there would me more shown :|
[15:14:09] jhass: shevy: anonymous in the sense that you don't have an identifier to refer to except the toplevel self
[15:14:15] fon: So the code at the top-level scope is essentially inside an instance?
[15:14:24] jhass: >> self.class
[15:14:26] ruboto: jhass # => Object (https://eval.in/448631)
[15:14:37] shevy: fon the mother of everything! class Object!
[15:14:37] noethics: https://repl.it/BP30
[15:14:51] jhass: dunno, I don't do repl.it, it's horrible
[15:15:03] noethics: well i put the code here
[15:15:23] shevy: how can a.B. work there noethics
[15:15:32] adaedra: that's not modules work
[15:15:32] shevy: B is not a method
[15:15:41] noethics: idk, i legit have no idea how to access C
[15:15:59] jhass: include or extend B somewhere
[15:16:26] jhass: &ri Module#include Module#extend Module#prepend
[15:16:27] `derpy: http://www.rubydoc.info/stdlib/core/Module#include-instance_method, http://www.rubydoc.info/stdlib/core/Object#extend-instance_method, http://www.rubydoc.info/stdlib/core/Module#prepend-instance_method
[15:16:43] shevy: `derpy! you are back!
[15:17:09] roshanavand: has joined #ruby
[15:17:10] adaedra: shevy: it was gone?
[15:17:37] fon: shevy: I don't quite get this. Where can I learn more about this?
[15:17:47] shevy: we need more bots that can show links!
[15:17:57] noethics: i need a bot to show me code to use C
[15:18:06] jhass: fon: do you have some more specific question perhaps?
[15:18:27] shevy: fon there https://banisterfiend.wordpress.com/2010/11/23/what-is-the-ruby-top-level/
[15:18:30] adaedra: noethics: C is a module, you have to include it somewhere to use methods inside.
[15:18:33] noethics: ive read these docs
[15:18:40] noethics: but they dont show an instance like this
[15:18:47] apt-get: has joined #ruby
[15:18:51] noethics: do i refer to it with A::B and extend that?
[15:19:10] fon: jhass: I just don't understand how the top-level scope is an instance of Object. That must mean the code at the top-level is being writting inside an instance of Object. How can we write code inside an instance?
[15:19:28] noethics: ruby is like the wild west of languages
[15:19:48] jhass: &ri Object#instance_eval @fon
[15:19:48] `derpy: fon: http://www.rubydoc.info/stdlib/core/BasicObject#instance_eval-instance_method
[15:19:49] noethics: you do whatever you want legit
[15:20:01] DEA7TH: Am I supposed to use remove_method like this https://gist.github.com/VelizarHristov/ab6e11db75f4c41aea95
[15:20:14] noethics: "Am i supposed to".... yes
[15:20:25] noethics: jk ignore me
[15:20:26] DEA7TH: my goal is to restore to 'Original'
[15:20:33] jhass: noethics: don't drink and IRC
[15:20:34] fon: I want to read The Programming Language by Matz but it's too old.
[15:20:43] fon: The Ruby Programming Language*
[15:21:22] jhass: DEA7TH: Write delegator and unwrap. See SimpleDelegator in the delegate stdlib
[15:21:34] jhass: Write a *
[15:21:36] lubarch: has joined #ruby
[15:22:04] fon: jhass: Okay what happens when we require a file? Does the file get executed in a top-level scope that's above the main scope?
[15:22:40] moeabdol: has joined #ruby
[15:22:53] jhass: fon: each file gets its own main instance, local variables are local to a file
[15:22:53] DEA7TH: jhass: that only seems to work for instances, but I'm using a class method
[15:23:07] shevy: if we have class Foo; end, and two different modules, can we uninclude one module, then attach the second one, then remove the second one again, and attach the first one? like module flip-flopping?
[15:23:15] diegoaguilar: has joined #ruby
[15:23:16] justin_pdx: has joined #ruby
[15:23:23] jhass: fon: the definee is Object, so constants get childs of the Object namespace, methods get private methods on Object
[15:23:41] jhass: DEA7TH: a class is just an instance of Class
[15:24:09] jhass: shevy: delegator for you too
[15:24:20] noethics: ok team i did it
[15:24:30] noethics: i dont understand why the author of this code decided to do this
[15:24:35] jhass: solve your problems with composition, not inheritance
[15:24:40] noethics: https://repl.it/BP30/1
[15:24:58] DEA7TH: ugh. Is there a simple way to stub a method so that it returns a value depending on the input? And then unstub it
[15:25:21] jhass: DEA7TH: are you doing this for testing?
[15:25:29] noethics: whats the point of putting a module in a class if you can't reference the module with an instance of the class
[15:25:49] pawnbox: has joined #ruby
[15:25:51] noethics: are there legitimate use cases?
[15:25:59] jhass: noethics: the fact that it's a class is irrelevant, it's simply used as a namespace here
[15:26:22] DEA7TH: jhass: Yes. The tested method takes an array and saves the adjacency matrix for its elements. Internally it uses a class to query Google Maps API in order to get the distances.
[15:26:45] DEA7TH: I want to stub the internal class so that it returns certain things, which then I expect to be saved to the DB
[15:27:43] DEA7TH: It sometimes recursively calls itself, and I don't want to tightly couple tests to that. I want to test for correct behavior only
[15:28:24] DEA7TH: But I have a simple solution as long as I can make a dynamic stub
[15:28:43] ruurd: has joined #ruby
[15:29:56] jhass: DEA7TH: ideally you would make that class a parameter so you could pass a stub one in your class. But which testing framework?
[15:30:07] jhass: * in your tests
[15:30:47] DEA7TH: jhass: TestUnit with shoulda-context, mocha and factory girl.
[15:31:01] candelabra: has joined #ruby
[15:31:02] shevy: aha so all of them
[15:31:48] candelabra: If I'm trying to programatically access the data at this url: https://transcription.si.edu/json/October062015TransGeo.json and I have the username and password it's asking for, whats the best approach? What would you call that type of authentication?
[15:32:43] jhass: DEA7TH: so use mocha?
[15:33:12] DEA7TH: will try that
[15:33:18] jhass: candelabra: that's called basic auth most commonly
[15:34:06] Xiti: has joined #ruby
[15:34:06] candelabra: jhass: Would I use net/http for that? open-uri?
[15:34:13] jhass: I *think* most convenience wrappers will parse it in formats like https://user:password@transcript....
[15:34:40] jhass: &ri Net::HTTP.get_response
[15:34:40] `derpy: http://www.rubydoc.info/stdlib/net/Net/HTTP#get_response-class_method
[15:34:56] jhass: worth a shot ^
[15:35:19] jhass: the variant that takes an URI of course
[15:35:21] jhass: ?guys candelabra
[15:35:22] ruboto: candelabra, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[15:36:10] candelabra: thanks everyone*
[15:36:28] candelabra: i immediately said guys and almost said "and/or gals" and should have
[15:36:43] candelabra: but everyone, folks, all would have been better
[15:38:55] jhass: it's fine, no worries
[15:39:43] roshanavand: has joined #ruby
[15:41:39] Dopagod: has joined #ruby
[15:42:41] jhass: shevy: hey ponycorn
[15:44:05] DEA7TH: Solved it! http://stackoverflow.com/questions/7892508/un-monkey-patching-a-class-method-in-ruby
[15:44:29] shevy: we have really strange terms in ruby
[15:44:32] shevy: "Un-monkey patching"
[15:44:40] jhass: DEA7TH: so throw out mocha and implement your own mocking framework I guess
[15:45:02] DEA7TH: jhass: I hope that for the remaining 99%, it will work fine
[15:45:08] jhass: because not invented here or something
[15:45:20] jhass: if it doesn't work for that it's a worthless pile of junk
[15:45:22] dorei: is monkey patching a subtle reference to monkeys typing random stuff that'll eventually type shakespear's works? :D
[15:45:23] DEA7TH: jhass: mocha didn't support that use case
[15:45:49] DEA7TH: it was a very obscure use of recursion where each recursive call won't call itself again. And I wanted to test in a certain way.
[15:46:21] jhass: sounds like you test implementation instead of observable behavior
[15:47:25] shevy: dorei good question, not entirely sure how it originated. I think monkeys are awesome but it's often used as if it were a bad thing to be able to modify core behaviour (except for not being able to restore to the tabula rasa state, I think ruby should offer that for core/stdlib components)
[15:48:38] EminenceHC: has joined #ruby
[15:48:56] s00pcan: has joined #ruby
[15:48:58] simplyianm: has joined #ruby
[15:49:00] cashnguns: has joined #ruby
[15:49:40] shevy: one day monkeys may be able to program
[15:49:54] shevy: bonobos can do sign language, for about 300 or 400 elements
[15:50:18] shevy: hmm nope... I meant to say, they can *understand* it... I don't think they can do so on their own
[15:50:52] bonhoeffer: has joined #ruby
[15:51:59] tkuchiki: has joined #ruby
[15:52:44] noethics: they can play games on ipads
[15:52:47] vdamewood: has joined #ruby
[15:52:54] shevy: I see them in the subway!
[15:54:05] DEA7TH: (Actually I had to use Foo.singleton_class.send(:alias_method, :old_bar, :bar) for class methods but it works now)
[15:55:12] fooxbar: has joined #ruby
[15:55:59] noethics: i'm not sure that i like ruby at all
[15:56:05] noethics: everything feels like i'm doing reflection
[15:58:50] patdohere: has joined #ruby
[15:59:01] SylarRuby: has joined #ruby
[15:59:34] Peteykun: has joined #ruby
[15:59:38] rippa: has joined #ruby
[16:00:52] shevy: reflection?
[16:00:57] CloCkWeRX: has joined #ruby
[16:02:04] noethics: "Foo.singleton_class", "Foo.class_eval", "Foo.instance_methods"
[16:02:39] noethics: like i'm referring to runtime variables because of limitations in the language or something
[16:02:51] soosfarm: has joined #ruby
[16:04:13] noethics: i feel like maybe if i wrote this codebase then i could design it the way i want and not have to rely on this stuff though
[16:04:18] DEA7TH: it is a rare use case
[16:04:20] noethics: so maybe slightly biased opinion
[16:04:40] kalusn: has joined #ruby
[16:04:44] acke: has joined #ruby
[16:05:10] The_Phoenix: has joined #ruby
[16:05:21] soosfarm: has joined #ruby
[16:05:33] noethics: i learn ruby again every 6 months it seems like
[16:05:42] shevy: the names can be strange yeah
[16:06:03] shevy: .instance_eval versus .class_eval
[16:06:17] noethics: like the fact that using that is even a thing
[16:06:39] noethics: i could see if you were doing it for serialization or instrumentation
[16:06:40] shevy: I don't think I ever had to do Foo.singleton_class though
[16:06:48] [spoiler]: they can be useful
[16:06:50] noethics: but it's totally normal to use these runtime thingies in common code
[16:07:05] noethics: which seems bad to me intuitively
[16:07:54] [spoiler]: instance_eval can be useful when you're making a DSL, altho other than that I'd not use it unless it's debugging
[16:08:31] tmtwd: has joined #ruby
[16:11:48] jsuth: has joined #ruby
[16:13:17] noethics: fwiw .to_json should do whatever YAML::dump does. i ended up dumping to YAML, passing it to a proper language, parsing the YAML and dumping the json
[16:14:09] shevy: yaml is different to json isn't it?
[16:14:46] noethics: you can represent everything that YAML::dump marshals as json
[16:15:53] ellisTAA: has joined #ruby
[16:16:52] jessemcgilallen: has joined #ruby
[16:17:28] Kerber0s: has joined #ruby
[16:18:32] shevy: hah https://github.com/cosmologicon/pywat
[16:18:41] shevy: we need that in ruby too, noethics will be the main author :)
[16:18:46] jamto11: has joined #ruby
[16:19:40] noethics: " based on whether the language makes it difficult for its developers to write error-free code"
[16:21:22] shevy: computers should program
[16:21:56] sczizzo: has joined #ruby
[16:22:20] jamto11_: has joined #ruby
[16:23:15] Shoutsid: has joined #ruby
[16:23:21] tier_: has joined #ruby
[16:25:09] mistermocha: has joined #ruby
[16:25:42] nerium: has joined #ruby
[16:25:46] Kerber0s: has joined #ruby
[16:25:49] jhass: yaml is a superset of json these days
[16:25:58] mistermocha: has joined #ruby
[16:26:08] PaulCape_: has joined #ruby
[16:26:37] jgt: has joined #ruby
[16:27:06] nerium: If I have a pam file (SSL root certificate), do I need to add it to my servers list of certificates or can I just pass it a long when doing the request?
[16:29:49] karapetyan: has joined #ruby
[16:29:49] _Kerber0s_: has joined #ruby
[16:30:48] tmtwd: has joined #ruby
[16:31:20] jhass: I like to peek into faraday for a quickref of what one can set in a http library, https://github.com/lostisland/faraday/blob/master/lib/faraday/adapter/net_http.rb#L98-L109
[16:32:54] bigmac: has joined #ruby
[16:33:27] DEA7TH: A lot of pywhat makes sense. Some is really weird. `False == False in [False]` returns True
[16:33:56] lubarch: has joined #ruby
[16:34:02] Shoutsid: has joined #ruby
[16:34:11] jhass: well, that's just precedence rules?
[16:36:39] DEA7TH: all possible precedence would return False
[16:37:44] tmtwd: has left #ruby: ("Leaving")
[16:39:39] UtkarshRay: has joined #ruby
[16:42:47] Jardayn: has joined #ruby
[16:45:17] mistermocha: has joined #ruby
[16:46:55] shevy: it's the way of the slithering scales
[16:47:07] Shoutsid: has joined #ruby
[16:47:22] bonhoeffer: has joined #ruby
[16:48:25] _blizzy_: has joined #ruby
[16:49:13] sepp2k: has joined #ruby
[16:49:51] Or1on: has joined #ruby
[16:50:58] karapetyan: has joined #ruby
[16:51:13] darkxploit: has joined #ruby
[16:51:52] Shoutsid: has joined #ruby
[16:53:02] tkuchiki: has joined #ruby
[16:54:03] havenn: good mornin'
[16:54:33] northfurr: has joined #ruby
[16:55:00] RobertBirnie: has joined #ruby
[16:57:17] codecop: has joined #ruby
[16:57:20] _blizzy_: has joined #ruby
[16:58:14] tmtwd: has joined #ruby
[16:58:29] Kendos-Kenlen: has joined #ruby
[17:00:42] Zamyatin: has joined #ruby
[17:01:00] karapetyan: has joined #ruby
[17:04:12] benlieb: has joined #ruby
[17:05:45] shredding: has joined #ruby
[17:07:22] havenwood: has joined #ruby
[17:07:26] lapide_viridi: has joined #ruby
[17:07:50] pawnbox: has joined #ruby
[17:08:08] ruurd: has joined #ruby
[17:08:53] karapetyan: has joined #ruby
[17:10:17] ndrei: has joined #ruby
[17:13:58] lubarch: has joined #ruby
[17:14:33] havenwood: has joined #ruby
[17:15:35] maletor_: has joined #ruby
[17:15:48] davedev24: has joined #ruby
[17:16:02] last_staff: has joined #ruby
[17:16:43] Hanmac: has joined #ruby
[17:18:12] bonhoeffer: are there any docs for ffi inputs, etc ??? for example, should [:string] stand for an array that contains a tokenized copy of the input text
[17:20:52] karapetyan: has joined #ruby
[17:20:53] stamina: has joined #ruby
[17:20:56] Kendos-Kenlen: has joined #ruby
[17:21:54] speakingcode: has joined #ruby
[17:22:24] otherj: has joined #ruby
[17:22:28] Zamyatin: has joined #ruby
[17:22:55] ruurd: has joined #ruby
[17:23:01] grzegorz: has joined #ruby
[17:25:12] atmosx: has joined #ruby
[17:26:24] karapetyan: has joined #ruby
[17:26:28] mistermocha: has joined #ruby
[17:26:35] aaeron: has joined #ruby
[17:28:20] framling: has joined #ruby
[17:28:56] bonhoeffer: has joined #ruby
[17:29:57] karapetyan: has joined #ruby
[17:30:55] bonhoeffer: what does output like this mean: 8a????????? ??? i???m exporting char** to :string in ffi
[17:31:11] dionysus69: has joined #ruby
[17:31:49] inteq: has joined #ruby
[17:35:39] beauby: has joined #ruby
[17:36:32] grenierm: has joined #ruby
[17:36:38] exadeci: has joined #ruby
[17:36:54] swgillespie: has joined #ruby
[17:42:10] ruurd: has joined #ruby
[17:42:44] Zamyatin: has joined #ruby
[17:42:59] lokson: has joined #ruby
[17:44:15] jamto11: has joined #ruby
[17:45:19] roshanavand: has joined #ruby
[17:46:37] nerium: jhass: Sorry, missed your message.
[17:47:08] jamto11: has joined #ruby
[17:47:11] nerium: jhass: Yeah, that must be the same thing as adding the certificate to the server directly
[17:47:45] jhass: CertStore is in memory iirc
[17:47:52] nk8: has joined #ruby
[17:48:13] finisherr: has joined #ruby
[17:49:00] mehwork: i'm really confused about when to use 'and' vs '&&' and this is making it more confusing https://github.com/bbatsov/ruby-style-guide/commit/5920497452c1f6f604742a735f5684e86d4c0003
[17:49:17] bonhoeffer: has joined #ruby
[17:49:27] mehwork: they seem to be doing the same things in ruby 2.2.3 for me
[17:49:51] benlieb: has joined #ruby
[17:49:57] jhass: mehwork: I have an easy rule for myself: never use and for anything, always use && :P
[17:50:35] jhass: the difference is precedence
[17:50:55] dopie: has joined #ruby
[17:51:18] grenierm: has joined #ruby
[17:51:29] jhass: >> [(foo = 1 && 2), foo, (bar = 1 and 2), bar]
[17:51:29] mehwork: hmm puts 3 and 5 and 7 and false and 9 says 3 and puts 3 && 5 && 7 && false && 9 says false
[17:51:30] ruboto: jhass # => [2, 2, 2, 1] (https://eval.in/448666)
[17:52:06] Cache_Money: has joined #ruby
[17:52:35] northfurr: has joined #ruby
[17:52:52] mehwork: shouldn't what i did print 7 or false if it's short circuiting once it reaches something false
[17:52:53] jhass: yup, former is (puts 3) and 5 ..., latter is puts(3 && 7 ...)
[17:53:14] Cache_Money: How do I get rid of all of these notifications when I run a Ruby file? https://gist.github.com/anonymous/2c790b691e6b92de3b1c
[17:53:26] jhass: mehwork: you're just discovering why "and is just not worth it" :P
[17:53:49] mehwork: oh it's parens, this says false: puts (3 and 5 and 7 and false and 9)
[17:53:52] jhass: Cache_Money: did you "try"?
[17:54:03] mehwork: alright thanks
[17:54:30] michael_mbp: has joined #ruby
[17:54:31] gregoriokusowski: has joined #ruby
[17:55:06] atomical: has joined #ruby
[17:55:20] ruurd: has joined #ruby
[17:56:21] rakm: has joined #ruby
[17:57:14] prateekp: has joined #ruby
[17:57:24] Cache_Money: jhass: yes, still looking...
[17:57:35] prateekp: i wanted to add documentation to my gem page
[17:57:59] bonhoeffer_: has joined #ruby
[17:58:05] prateekp: but on clicking documentation link rubygems.org/mygem it does not generate documentation
[17:58:16] shevy: it usually takes a while
[17:58:22] prateekp: how can i link my lib file
[17:58:30] shevy: drink a wine and look again tomorrow
[17:58:31] Cache_Money: jhass: is it a simple solution?
[17:58:36] Coldblackice_: has joined #ruby
[17:58:39] shevy: check on the documentation link prateekp - what is the name of the gem?
[17:58:47] jhass: Cache_Money: the message contains a suggestion
[17:58:50] havenwood: I did the PR to make the Try suggestion runnable but it'd be nice to make a single copy-pasteable block.
[17:58:52] chipotle: has joined #ruby
[17:58:57] blackmesa: has joined #ruby
[17:59:11] prateekp: http://www.rubydoc.info/gems/v8eval/0.1.0.5
[17:59:44] prateekp: it just puts README.md which i am passing through extra_rdoc_files option in gempec
[17:59:59] ericjphillips: has joined #ruby
[18:00:22] Cache_Money: jhass: I tried `gem pristine --all` didn't work. I've tried running `gem prestine <gem>` before and it didn't get rid of the notifications
[18:00:27] prateekp: i think the reason is that the directory of source is differnect
[18:00:39] prateekp: its like project/dir/ruby/lib/*
[18:00:58] prateekp: projectdir/ruby/lib/*
[18:01:26] toretore: has joined #ruby
[18:01:35] havenwood: Cache_Money: Try my comment on your gist.
[18:02:31] prateekp: shevy: can i specifically build only project/dir/ruby/lib/* sources documentation
[18:03:03] jhass: prateekp: why not put your C stuff into ext and have everything in ruby/ at the root?
[18:03:04] ramfjord: has joined #ruby
[18:03:18] Cache_Money: havenwood: I tried `gem pristine eventmachine --version 1.0.3` and got `ERROR: While executing gem ... (Gem::Exception) Failed to find gems ["eventmachine"] = 1.0.3`
[18:03:19] jhass: that be a much more standard structure and give you less similar surprises
[18:03:49] shredding: has joined #ruby
[18:03:54] beast: has joined #ruby
[18:04:30] shevy: ah, a C-gem. no idea how to work with C-gems really
[18:04:46] havenwood: Cache_Money: Did EM 1.0.3 get uninstalled since you did the initial gist?
[18:04:48] tier_: has joined #ruby
[18:04:58] havenwood: Cache_Money: Update your gist with the latest output.
[18:05:01] prateekp: can i hide documentation link?
[18:05:09] jhass: I don't think so
[18:05:20] k3asd`: has joined #ruby
[18:05:27] shinnya: has joined #ruby
[18:06:20] roshanavand: has joined #ruby
[18:08:13] Cache_Money: havenwood: No, I haven't uninstalled EM since the initial gist. Here's the output again (looks the same as before) https://gist.github.com/anonymous/6eb8a6e3e65dbd043735
[18:08:35] havenwood: Cache_Money: I don't see EventMachine in your update.
[18:09:26] havenwood: Cache_Money: Commented.
[18:09:40] Cache_Money: havenwood: you're right. maybe when I ran `gem pristine eventmachine --version 1.0.3` it worked?
[18:10:33] Zamyatin: has joined #ruby
[18:11:45] Cache_Money: havenwood: Is there a reason why `gem pristine --all` didn't work?
[18:13:52] ruurd: has joined #ruby
[18:14:16] kimegede: has joined #ruby
[18:14:45] dagda1_: has joined #ruby
[18:14:47] havenwood: Cache_Money: It's hard to say without seeing the exact output from the command.
[18:14:53] kimegede: Hey, which ruby manager should I use on my mac? rbenv or rvm?
[18:15:01] havenwood: kimegede: chruby
[18:15:14] kimegede: havenwood: Will take a look thanks
[18:15:23] havenwood: kimegede: using Homebrew?
[18:15:30] tomphp: has joined #ruby
[18:15:55] kimegede: havenwood: Yeah, looking on it. Should I remove the 2 others? I apparently got both them installed.
[18:16:23] kimegede: (Yes I got brew love it! :))
[18:16:46] havenwood: kimegede: Yeah, `rvm implode` then `rm -rf ~/.rvm` and `rm -rf ~/.rbenv` and remove any traces from your dotfiles.
[18:16:48] ishikawa91: has joined #ruby
[18:17:00] havenwood: kimegede: brew install chruby --HEAD
[18:17:26] Cache_Money: havenwood: running all of the those commands got rid of them
[18:17:44] havenwood: kimegede: Then setup your dotfiles for chruby: https://github.com/postmodern/chruby#auto-switching
[18:17:52] mozzarella: has joined #ruby
[18:18:08] leafybas_: has joined #ruby
[18:18:14] havenwood: kimegede: Then install Rubies with ruby-install: brew install ruby-install --HEAD
[18:18:48] devbug: has joined #ruby
[18:19:42] roshanavand: has joined #ruby
[18:19:44] havenwood: kimegede: For Ruby 2.2.3: ruby-install ruby
[18:20:15] kimegede: Thanks havenwood almost there
[18:20:25] bluOxigen: has joined #ruby
[18:20:37] havenwood: kimegede: Just restart your terminal for chruby to detect newly installed Rubies.
[18:21:40] havenwood: kimegede: If you want to set Ruby 2.2.3 as your default Ruby in your home dir: echo "ruby-2.2.3" > ~/.ruby-version
[18:21:58] havenwood: kimegede: It'll autoswitch when .ruby-version files are detected.
[18:22:15] havenwood: It does fuzzy matching so you can: ruby-2.2
[18:22:20] kimegede: Yeah I got that setuped by rbenv but with my double ruby it got fuzzy
[18:22:35] kimegede: havenwood: https://gist.github.com/kimegede/c4e9d2642bd7ba3347ff
[18:22:40] kimegede: Ran it to this one
[18:22:46] mehwork: speaking of rbenv, is there a way to make it rehash automatically somehow? I hate having to type 'rbenv rehash' every time i install any command
[18:23:02] havenwood: kimegede: This way no shims to have to reshim and it uses your Homebrew OpenSSL.
[18:23:13] havenwood: mehwork: Switch to chruby? :P
[18:23:25] mehwork: i just switched to rbenv from rvm
[18:23:45] havenwood: mehwork: You can even use your rbenv-installed Rubies still if you'd like: RUBIES+=(~/.rbenv/versions/*)
[18:23:47] mehwork: how do i know switching to chruby won't require switchign to somehing else in a week :p
[18:24:22] havenwood: mehwork: It's a 100 lines shell script. It just works. It'll keep working.
[18:24:27] yardenbar: has joined #ruby
[18:24:45] mehwork: all i hear is 100 lines of hell
[18:25:00] havenwood: mehwork: Better than > 10,000 lines of hell. :P
[18:25:02] mehwork: i use zsh, will that matter?
[18:25:08] havenwood: mehwork: Fully supported.
[18:25:17] havenwood: mehwork: I use zsh and test chruby and ruby-install against it.
[18:25:20] mehwork: i guess i'll try it after i upgrade to el capitan
[18:25:25] oetjenj: has joined #ruby
[18:25:30] havenwood: mehwork: Tested with El Capitan as well.
[18:25:34] havenwood: mehwork: Actually has tests!
[18:27:30] matugm: has joined #ruby
[18:27:36] Kendos-Kenlen: has joined #ruby
[18:28:55] kalusn: has joined #ruby
[18:29:33] ruurd: has joined #ruby
[18:30:21] kalusn: has joined #ruby
[18:31:28] eikood: has joined #ruby
[18:32:04] kies^: has joined #ruby
[18:33:00] shevy: got a question
[18:33:10] shevy: >> '1.14.3' < '1.14.2'
[18:33:11] ruboto: shevy # => false (https://eval.in/448673)
[18:33:26] shevy: I can understand why it works for numbers, but why can we actually compare strings to one another?
[18:33:38] DEA7TH: shevy: alphabetical ordering?
[18:33:42] speakingcode: has joined #ruby
[18:33:49] jhass: more ASCII ordering
[18:34:06] DEA7TH: those are similar
[18:35:38] symm-: has joined #ruby
[18:36:04] framlinqp: has joined #ruby
[18:36:05] kimegede: havenwood: Got issues with openssl - https://gist.github.com/kimegede/c4e9d2642bd7ba3347ff
[18:36:47] diegoaguilar: has joined #ruby
[18:37:05] jhass: well, actually whatever encoding the strings are in
[18:37:34] shevy: so I could sort by unicode snowman
[18:37:49] jhass: shevy: it's a.each_codepoint.zip(b.each_codepoint).all? {|a, b| a < b } essentially
[18:38:07] shevy: I don't think I have ever seen .each_codepoint before
[18:38:08] jhass: + some border conditions if a.size != b.size
[18:38:29] jhass: >> "1.14.3".codepoints
[18:38:30] ruboto: jhass # => [49, 46, 49, 52, 46, 51] (https://eval.in/448674)
[18:39:27] kimegede: havenwood: Fixed it, uninstalled openssl and installed it again.
[18:42:56] finisherr: has left #ruby: ()
[18:43:51] eikood: has joined #ruby
[18:44:15] tier_: has joined #ruby
[18:45:07] ruurd: has joined #ruby
[18:45:38] benlieb: can I pipe code to execute to ruby?
[18:45:49] ruboto: Why don't you try it and see for yourself?
[18:45:51] benlieb: I know about -e, but
[18:45:59] benlieb: jhass: don't be silly
[18:46:01] benlieb: the question is how
[18:46:02] apeiros: jhass: in ruby I it's always .each_byte, even with unicode
[18:46:05] shevy: I shall declare - the next year will be the year of Hurd, with systemd AND the desktop of the year!
[18:46:22] jhass: benlieb: I don't think you tried
[18:46:27] benlieb: jhass: jesus
[18:46:33] shevy: jhass: god
[18:46:48] shevy: just wanted to get spiritual :-)
[18:47:11] jhass: there's only one godess and its Eris
[18:47:15] jhass: I'm a pope though
[18:47:45] eikood: has joined #ruby
[18:47:48] apeiros: benlieb: your question literally was "can I". and yes, you can. and how - the same way piping works with all other exes, with a | sign.
[18:48:08] apeiros: benlieb: so jhass ?try was a quite adequate answer.
[18:50:59] l_tonz: has joined #ruby
[18:51:12] jun_: has joined #ruby
[18:53:48] tkuchiki: has joined #ruby
[18:54:28] bonhoeffer: has joined #ruby
[18:55:56] eikood: has joined #ruby
[18:56:05] gregf: has joined #ruby
[18:56:19] framlinqp: has joined #ruby
[18:56:32] shevy: benlieb there is a cool way to pipe ruby code on the commandline and have it colourized, via the gem "coderay", this should work when code is installed: "cat foo.rb | coderay -ruby"
[18:57:31] leafybasil: has joined #ruby
[19:04:35] Shoutsid: has joined #ruby
[19:05:21] mozzarella: has joined #ruby
[19:07:00] Alina-malina: has joined #ruby
[19:08:53] l_tonz: has joined #ruby
[19:11:59] zapata: has joined #ruby
[19:12:50] patdohere: has joined #ruby
[19:13:17] devbug_: has joined #ruby
[19:13:21] jamto11: has joined #ruby
[19:17:40] Shoutsid: has joined #ruby
[19:18:40] karapetyan: has joined #ruby
[19:20:35] jun_: has joined #ruby
[19:20:54] nettoweb: has joined #ruby
[19:21:04] roshanavand: has joined #ruby
[19:21:46] fastAndSlow: has joined #ruby
[19:22:00] dorei: i've got a hash and i want to compare it with another hash for equality but dont take into account one the keys, what's the most elegant way to do it?
[19:24:27] toretore: you should do it the other way around probably: explicitly enumerat the keys you want to compare
[19:25:01] toretore: %w[foo bar baz].all?{|k| h1[k] == h2[k] }
[19:25:12] havenwood: >> {aim: true, ignore: true}.tap { |h| h.delete :ignore } == {aim: true}
[19:25:13] ruboto: havenwood # => true (https://eval.in/448694)
[19:26:24] havenwood: i guess you don't want to mutate the Hash >.>
[19:27:00] some_body: has joined #ruby
[19:27:10] dorei: it's part of a spec for a rest service and i can't possibly know beforehand what id will be assigned to it
[19:27:48] some_body: im trying to read a regular .txt file with File.readlines, but I'm getting an invalid byte sequence in US-ASCII error, and I'm trying to call .split on each line
[19:28:41] some_body: my code also has the magic comment # encoding: utf-8, so how can I read a txt file in as utf8?
[19:28:42] patdohere: has joined #ruby
[19:29:15] havenwood: >> {aim: true, ignore: true}.reject { |k, _| k == :ignore } == {aim: true}
[19:29:15] toretore: some_body: put the entire file on gist.github.com and link here
[19:29:16] ruboto: havenwood # => true (https://eval.in/448695)
[19:29:30] havenwood: dorei: How about #reject the key you don't want then compare?
[19:30:40] finisherr: has joined #ruby
[19:30:42] dorei: havenwood: yeah, i'm doing that, but i'm looking for something more elegant, bcoz i dont want to repeat that for almost every expect in the spec
[19:31:02] finisherr: How can I get option parser to give me summary info about ARGV[1]?
[19:31:10] mloy_: has joined #ruby
[19:31:12] Shoutsid: has joined #ruby
[19:31:22] some_body: toretore: https://gist.github.com/logicrime/baab936efa748bbcb55b
[19:32:30] Channel6: has joined #ruby
[19:32:30] havenwood: dorei: I don't understand what the rules for them being equal are. You have a Hash. You want to check if all of its keys/value pairs are present in another Hash? Can the other Hash have unlimited additional key/value pairs you don't know about and you don't care?
[19:32:38] eikood: has joined #ruby
[19:33:17] havenwood: dorei: Or are there only certain additional keys allowed? Say more?
[19:33:26] beauby: has joined #ruby
[19:33:32] wallerdev: has joined #ruby
[19:35:11] havenwood: dorei: Or Gist examples.
[19:35:17] dorei: havenwood: i want all the values be equal except for the value of :id keys which i dont know beforehand
[19:35:19] dstarh: has joined #ruby
[19:35:41] havenwood: dorei: so the :id key should be there but you don't know the value?
[19:36:19] Kerber0s: has joined #ruby
[19:36:20] kimegede: havenwood: After upgrading to 2.2.3 I need to reinstall all gems right?
[19:36:40] finisherr: I???m just going to have it be a param to a flag and call it a day
[19:37:16] yorickpeterse: After spending the weekend continueing work on porting Addrinfo to Rubinius, I can see why people drink
[19:37:42] odt: has joined #ruby
[19:37:48] havenwood: kimegede: I'd suggest installing gems fresh in your case. If you set `gem: "--env-shebang"` in your ~/.gemrc you'll not need to reinstall gems with 2.2.4 but you'll always need to with MINOR version bumps like this Christmas with 2.3.0.
[19:38:11] havenwood: kimegede: If you don't need local docs might as well also skip that to make it go quickly: gem: "--no-document --env-shebang"
[19:38:21] casadei: has joined #ruby
[19:38:23] havenwood: yorickpeterse: hi
[19:38:33] odt: would i be correct in assuming ERB is the way to go to convert yaml into some other format, ie. m3u file?
[19:38:44] karapetyan: what's wrong with that solution: https://gist.github.com/karapetyan/901ce0b98983ae41f833
[19:38:54] karapetyan: https://projecteuler.net/problem=44
[19:38:56] dorei: havenwood: hmm, i think i've found a solution :) i'll make it a configuration option so that method will return the hash without that key :)
[19:38:59] havenwood: karapetyan: Does it work?
[19:39:06] karapetyan: havenwood: no.
[19:39:17] alexherbo2: has joined #ruby
[19:39:25] jenrzzz: has joined #ruby
[19:40:07] riotjones: has joined #ruby
[19:40:57] kimegede: havenwood: Okay cool makes sense.
[19:41:02] kimegede: Thanks again
[19:41:20] havenwood: kimegede: You're welcome
[19:41:40] havenwood: kimegede: Happy coding!
[19:41:44] toretore: some_body: and journal.txt ?
[19:41:48] jhass: &ri Fixnum#abs @karapetyan
[19:41:48] `derpy: karapetyan: http://www.rubydoc.info/stdlib/core/Fixnum#abs-instance_method
[19:43:07] karapetyan: sorry don't understand
[19:43:13] karapetyan: why i need use absolute value?
[19:43:19] lxsameer: has joined #ruby
[19:43:29] devoldmx: has joined #ruby
[19:43:51] jhass: >> 10 - 12
[19:43:52] ruboto: jhass # => -2 (https://eval.in/448696)
[19:45:50] rickmasta: has joined #ruby
[19:46:29] mistermocha: has joined #ruby
[19:46:29] jhass: btw no need for the ugly for, use Range#each or Fixnum#upto
[19:47:25] some_body: toretore: its plain text, and my journal. nothing but ascii and newlines
[19:47:30] arabellatrix: has joined #ruby
[19:48:12] patdohere: has joined #ruby
[19:49:19] toretore: some_body: can you gist *something* that will reproduce the error?
[19:49:27] patdohere: has joined #ruby
[19:49:41] jhass: karapetyan: mmh, it might work actually, just take forever since you do _a lot_ of work twice
[19:49:50] roshanavand: has joined #ruby
[19:50:40] patdohere: has joined #ruby
[19:51:19] karapetyan: jhass: when i run app it's just hangs
[19:51:23] towski_: has joined #ruby
[19:51:26] gregoriokusowski: has joined #ruby
[19:51:28] tier_: has joined #ruby
[19:51:29] karapetyan: jhass: and no any output i don't know why
[19:51:40] karapetyan: jhass: do you know how to optimize it?
[19:51:42] jhass: karapetyan: well, you only have output when you found it
[19:51:49] craysiii: has joined #ruby
[19:51:53] jhass: karapetyan: don't do stuff over and over again
[19:51:53] kobain: has joined #ruby
[19:52:02] some_body: toretore: i just confirmed that not all files produce the error, but what characters could be responsible?
[19:52:05] jun_: has joined #ruby
[19:52:11] some_body: its got punctuation and quotes, parens, etc
[19:52:25] jhass: karapetyan: when your iteration didn't find a result you add an item and start all over again testing all the things you know already
[19:52:38] benlieb: has joined #ruby
[19:52:49] jhass: well, you memoize already, just don't start over
[19:53:16] arabellatrix: has left #ruby: ()
[19:53:26] karapetyan: jhass: actually i have no experience and i wonder how to develop this alghorithm :(
[19:54:07] jhass: for each j in 1 to infinity test P(j) with each
[19:54:09] simplyianm: has joined #ruby
[19:54:15] jhass: er, sorry hit enter too early
[19:54:42] toretore: some_body: non-ascii
[19:54:52] jhass: for each j in 1 to infinity test P(j)+P(k) and P(j)-P(k) with k from 1 to j
[19:54:59] jhass: karapetyan: ^
[19:55:14] some_body: yeah but why is ruby reading it as ascii instead of utf8? when I do 'locale' on my machine, its all utf 8
[19:56:10] jhass: karapetyan: currently you reiterate j after computing the next P(j)
[19:56:18] roshanavand: has joined #ruby
[19:58:19] patdohere: has joined #ruby
[20:03:17] Shoutsid: has joined #ruby
[20:04:48] simplyianm: has joined #ruby
[20:06:14] odt: so is there a ruby way to do this instead of all the brackets? 10 puts "#{source["name"]} #{source["url"]} #{source["type"]}"
[20:08:20] dionysus69: has joined #ruby
[20:08:57] karapetyan: jhass: sorry, but i don't understand this: for each j in 1 to infinity test P(j)+P(k) and P(j)-P(k) with k from 1 to j
[20:08:59] Kerber0s_: has joined #ruby
[20:09:14] Cyther: has joined #ruby
[20:11:40] jhass: karapetyan: "I don't understand this" is not useful, try to ask a specific question
[20:11:55] dstarh: has joined #ruby
[20:12:05] rakm: has joined #ruby
[20:12:36] sabesto: has joined #ruby
[20:12:41] sabesto: has left #ruby: ()
[20:13:16] mozzarella: odt: something like this? ['name', 'url', 'type'].map { |x| source[x] }.join(' ')
[20:13:20] maletor_: has joined #ruby
[20:13:46] dstarh: has joined #ruby
[20:14:08] jhass: %w[name url type]
[20:14:15] jamto11: has joined #ruby
[20:14:20] VeryBewitching: has joined #ruby
[20:14:39] mozzarella: yeah, you could also use that
[20:14:46] odt: that looks sexy, thanks
[20:14:46] apt-get: has joined #ruby
[20:14:53] mozzarella: I can never remember which letter it is, though, do you have a trick to remember?
[20:15:38] dstarh: has joined #ruby
[20:15:41] mozzarella: %w(name url type).map { |x| source[x] }.join(' ')
[20:15:44] jhass: source.values_at(*%w[name url type]).join(" ")
[20:16:00] jhass: and no, gotta memorize that
[20:16:01] phutchins: has joined #ruby
[20:16:20] simplyianm: has joined #ruby
[20:17:04] ruurd: has joined #ruby
[20:17:05] toretore: w for words
[20:17:23] jhass: r for regexp, but q, i?
[20:17:48] apt-get_: has joined #ruby
[20:19:22] jgt: has joined #ruby
[20:19:29] l_tonz: has joined #ruby
[20:20:29] jun_: has joined #ruby
[20:22:28] simplyianm: has joined #ruby
[20:23:26] wildlander: has joined #ruby
[20:24:07] l_tonz_: has joined #ruby
[20:25:48] acke: has joined #ruby
[20:26:43] tier_: has joined #ruby
[20:31:04] Shoutsid: has joined #ruby
[20:32:02] weemsledeux: has joined #ruby
[20:34:06] khebbie: has joined #ruby
[20:35:06] chipotle: has joined #ruby
[20:35:19] dc_: has joined #ruby
[20:35:42] eikood: has joined #ruby
[20:38:44] Vile`: has joined #ruby
[20:39:39] Shoutsid: has joined #ruby
[20:39:54] ruurd: has joined #ruby
[20:40:54] riotjones: has joined #ruby
[20:43:30] l_tonz: has joined #ruby
[20:43:54] Soda: has joined #ruby
[20:45:59] swgillespie: has joined #ruby
[20:47:18] saddad: has joined #ruby
[20:51:41] yardenbar: has joined #ruby
[20:52:56] dc_: has joined #ruby
[20:54:32] tkuchiki: has joined #ruby
[20:55:38] mbff: has joined #ruby
[20:55:52] karapetyan: has joined #ruby
[20:56:02] sagittarian: has joined #ruby
[20:56:21] mbff: Hello! I am trying to get guard to run when any .rb file changes recursively. How can I do this?
[20:56:40] natevick: has joined #ruby
[20:56:42] ruurd: has joined #ruby
[20:56:59] blackmesa: has joined #ruby
[21:01:18] Zamyatin: has joined #ruby
[21:03:54] roshanavand: has joined #ruby
[21:06:00] michael_mbp: has joined #ruby
[21:06:44] platzhirsch: has joined #ruby
[21:06:46] alexherbo2: has joined #ruby
[21:08:59] Zamyatin: has joined #ruby
[21:09:51] mbff: Any ideas?
[21:10:17] dc_: has joined #ruby
[21:10:41] nerium: has joined #ruby
[21:11:13] Guest36: has joined #ruby
[21:11:42] ruurd: has joined #ruby
[21:12:19] kimegede: has joined #ruby
[21:12:43] dagda1_: has joined #ruby
[21:14:22] jessemcgilallen: has joined #ruby
[21:15:26] jamto11: has joined #ruby
[21:16:52] jhass: "recursively"?
[21:17:26] luckyme: has joined #ruby
[21:18:39] yfeldblum: has joined #ruby
[21:18:40] patdohere: has joined #ruby
[21:18:56] davedev24: has joined #ruby
[21:20:47] nerium: has joined #ruby
[21:23:02] shinnya: has joined #ruby
[21:24:11] ramfjord: has joined #ruby
[21:24:56] dagda1_: has joined #ruby
[21:25:08] cornerman: has joined #ruby
[21:29:15] ruurd: has joined #ruby
[21:30:03] Limix: has joined #ruby
[21:30:41] simplyianm: has joined #ruby
[21:31:39] Guest36: anyone have a guide of making an app with rails?
[21:31:39] devbug: has joined #ruby
[21:31:57] nerium: has joined #ruby
[21:31:58] mbff: jhass, as in every folder level including root
[21:32:08] mbff: root of project...
[21:33:28] jhass: it does so by default?
[21:33:35] Rollabunna: has joined #ruby
[21:33:42] sepp2k1: has joined #ruby
[21:33:47] jhass: ?rails Guest36
[21:33:47] ruboto: Guest36, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[21:34:29] solocshaw: has joined #ruby
[21:34:31] mbff: jhass, guard watch defaults to that?
[21:35:16] jhass: pretty sure it does
[21:36:06] mbff: can you give an example? Like I said before guard watch all rb files.
[21:36:35] jhass: how about we rather look at your current Guardfile to find out why it doesn't?
[21:37:34] mbff: jhass, https://gist.github.com/marshallford/c03ee703a2ba7e7f0263
[21:37:59] jhass: mbff: it's a regular expression, not a glob pattern
[21:38:17] jhass: or .+\.rb
[21:40:30] Zamyatin: has joined #ruby
[21:40:40] toretore: >> clearing :on; guard :minitest do; watch(%r{*.rb); end
[21:40:41] ruboto: toretore # => /tmp/execpad-91748c3e4883/source-91748c3e4883:2: unterminated regexp meets end of file ...check link for more (https://eval.in/448716)
[21:41:04] MasterNayru: has joined #ruby
[21:41:23] simplyianm: has joined #ruby
[21:41:28] jhass: yeah, also that
[21:41:43] riotjones: has joined #ruby
[21:42:10] ndrei: has joined #ruby
[21:42:13] mbff: true....
[21:42:28] califerno: has joined #ruby
[21:42:38] riotjones: has joined #ruby
[21:43:14] nerium: has joined #ruby
[21:43:40] riotjones: has joined #ruby
[21:44:51] simplyianm: has joined #ruby
[21:45:05] Kerber0s: has joined #ruby
[21:46:37] RobertBirnie: has joined #ruby
[21:46:43] gwendall: has joined #ruby
[21:47:13] jun_: has joined #ruby
[21:49:14] l_tonz: has joined #ruby
[21:50:39] rakm: has joined #ruby
[21:50:54] MasterNayru: has joined #ruby
[21:51:38] RobertBirnie: has joined #ruby
[21:51:45] fastAndSlow: has joined #ruby
[21:52:22] Kerber0s: has joined #ruby
[21:53:18] diegoaguilar: has joined #ruby
[21:54:23] nerium: has joined #ruby
[21:54:31] Sheperson: has joined #ruby
[21:54:55] baroquebobcat: has joined #ruby
[21:54:55] Sheperson: I am really confused
[21:55:30] Sheperson: I have a class, with attr_accessor :data
[21:55:32] marr: has joined #ruby
[21:55:44] Sheperson: and in the initializer I set the data to hash
[21:55:56] Sheperson: but when I try to read it, it is nil
[21:59:15] l_tonz: has joined #ruby
[21:59:24] charliesome: has joined #ruby
[21:59:31] MasterNayru: has joined #ruby
[21:59:57] patdohere: has joined #ruby
[22:02:24] rushed: has joined #ruby
[22:02:30] swgillespie: has joined #ruby
[22:03:03] podman: has joined #ruby
[22:03:09] monod: has joined #ruby
[22:03:12] jobewan: has joined #ruby
[22:04:26] cdolan: has joined #ruby
[22:04:37] shevy: not possible
[22:04:40] shevy: show code
[22:05:16] Zamyatin: has joined #ruby
[22:05:28] nerium: has joined #ruby
[22:07:27] sheperson_: has joined #ruby
[22:09:15] l_tonz: has joined #ruby
[22:09:23] jokke: has joined #ruby
[22:10:18] tkuchiki: has joined #ruby
[22:12:14] bb010g: has joined #ruby
[22:13:01] perturbation: has joined #ruby
[22:14:16] SenpaiSilver: has joined #ruby
[22:14:40] benlieb_: has joined #ruby
[22:16:00] naftilos76: has joined #ruby
[22:18:46] nateberkopec: has joined #ruby
[22:18:51] S_Walker: has joined #ruby
[22:19:17] l_tonz: has joined #ruby
[22:20:17] matp: has joined #ruby
[22:21:10] matp: has joined #ruby
[22:21:58] tubuliferous: has joined #ruby
[22:23:00] haylon: has joined #ruby
[22:29:15] l_tonz: has joined #ruby
[22:29:43] Vile`: has joined #ruby
[22:29:48] basil: has joined #ruby
[22:32:32] mistermocha: has joined #ruby
[22:33:33] skweek: has joined #ruby
[22:35:06] eikood: has joined #ruby
[22:36:02] baweaver: has joined #ruby
[22:39:17] l_tonz: has joined #ruby
[22:40:21] xrlabs: has joined #ruby
[22:42:23] joneshf-laptop: has joined #ruby
[22:42:34] rakm: has joined #ruby
[22:44:26] riotjones: has joined #ruby
[22:44:40] yfeldblum: has joined #ruby
[22:45:41] blueOxigen: has joined #ruby
[22:45:54] andykingking: has joined #ruby
[22:46:51] baroquebobcat_: has joined #ruby
[22:48:42] Guest36: has joined #ruby
[22:49:46] l_tonz: has joined #ruby
[22:49:46] bkulbida: has joined #ruby
[22:50:09] devbug: has joined #ruby
[22:54:01] mgorbach: has joined #ruby
[22:54:04] l_tonz: has joined #ruby
[22:59:13] hakunin: has joined #ruby
[22:59:20] l_tonz: has joined #ruby
[23:00:54] hakunin: has left #ruby: ()
[23:04:29] htmldrum: has joined #ruby
[23:04:59] based_pdev_: has joined #ruby
[23:05:14] hakunin_: has joined #ruby
[23:05:27] johnzorn_: has joined #ruby
[23:06:22] hakunin_: has left #ruby: ()
[23:07:01] patdohere: has joined #ruby
[23:07:37] headius: has joined #ruby
[23:09:28] towski_: has joined #ruby
[23:09:42] neanderslob: has joined #ruby
[23:09:50] Igorshp: has joined #ruby
[23:10:04] l_tonz: has joined #ruby
[23:10:46] rushed: has joined #ruby
[23:11:55] ruurd: has joined #ruby
[23:13:45] shmilan: has joined #ruby
[23:17:47] user1138: has joined #ruby
[23:19:04] moeabdol: has joined #ruby
[23:19:20] DarthGandalf: has joined #ruby
[23:19:49] jokke: has joined #ruby
[23:20:08] l_tonz: has joined #ruby
[23:20:39] solocshaw: has joined #ruby
[23:25:26] shevy: hmm a simpler way to do .delete('-').delete(':').delete('/') ?
[23:25:38] towski_: has joined #ruby
[23:26:20] patdohere: has joined #ruby
[23:30:25] l_tonz: has joined #ruby
[23:30:59] charliesome: has joined #ruby
[23:31:04] Ropeney: has joined #ruby
[23:31:42] kalusn: has joined #ruby
[23:32:14] dcunit3d: has joined #ruby
[23:33:50] Igorshp: has joined #ruby
[23:34:26] platzhirsch: has left #ruby: ()
[23:34:51] snapcase: .tr('-:/', '')
[23:34:54] Rollabunna: has joined #ruby
[23:35:11] dc_: has joined #ruby
[23:36:41] l_tonz: has joined #ruby
[23:37:07] snapcase: >> "t-e:s/t".tr('-:/', '')
[23:37:09] ruboto: snapcase # => "test" (https://eval.in/448733)
[23:37:19] shevy: cool thanks
[23:37:37] Coraline: Oh, I thought you were dealing with an array for some reason.
[23:38:44] shevy: both of you said .tr anyway :)
[23:39:17] solocshaw1: has joined #ruby
[23:39:32] l_tonz: has joined #ruby
[23:40:03] l_tonz: has joined #ruby
[23:40:25] didier: has joined #ruby
[23:40:25] didier: has left #ruby: ("Leaving")
[23:41:05] jaygen: has joined #ruby
[23:43:24] bkulbida: has joined #ruby
[23:45:17] riotjones: has joined #ruby
[23:46:10] sdothum: has joined #ruby
[23:47:47] jdawgaz: has joined #ruby
[23:48:03] patdohere: has joined #ruby
[23:49:42] f1dget: has joined #ruby
[23:50:07] CloCkWeRX: has joined #ruby
[23:51:16] stardiviner: has joined #ruby
[23:53:27] root____5: has joined #ruby
[23:53:50] l_tonz_: has joined #ruby
[23:55:32] dorei: >> "az by df in xf"[/(.*) (by|in)/]
[23:55:33] ruboto: dorei # => "az by df in" (https://eval.in/448734)
[23:55:45] root____5: has joined #ruby
[23:55:46] dorei: is there a way to make it stop at by and not in?
[23:55:53] candelabra: has joined #ruby
[23:56:03] tkuchiki: has joined #ruby
[23:56:08] trodai: has joined #ruby
[23:56:22] chipotle: has joined #ruby
[23:56:33] bnagy: >> "az by df in xf"[/(.*?) (by|in)/]
[23:56:34] ruboto: bnagy # => "az by" (https://eval.in/448735)
[23:56:54] bnagy: non-greedy
[23:57:37] dorei: oh, let me try it :)
[23:58:09] dorei: it works :) thanx bnagy
[23:58:17] arescorpio: has joined #ruby
[23:58:30] allcentury: has joined #ruby