« Back to channel list

#ruby - 31 May 2016

« Back 1 day Forward 1 day »
[00:01:14] bouncehouse: has joined #ruby
[00:01:30] tristanp_: has joined #ruby
[00:01:31] wald0: has joined #ruby
[00:01:37] bouncehouse: #ruby and #ruby-lang channels are one and the same, right?
[00:02:33] spudowiar1: has joined #ruby
[00:03:06] panpainter: has joined #ruby
[00:05:15] tristanp: has joined #ruby
[00:05:34] eljimador: has joined #ruby
[00:06:05] pwnd_nsfw`: has joined #ruby
[00:06:24] eljimmy: has joined #ruby
[00:08:56] bodgix: has joined #ruby
[00:08:57] pawnbox: has joined #ruby
[00:09:05] Arcaire: has joined #ruby
[00:09:11] mistym: has joined #ruby
[00:09:11] mistym: has joined #ruby
[00:09:49] Trieste: has joined #ruby
[00:09:50] st1gma: has joined #ruby
[00:11:06] Klumben: has joined #ruby
[00:11:24] roamingdog: has joined #ruby
[00:12:31] thoraxe: has joined #ruby
[00:13:15] tgeeky: has joined #ruby
[00:13:19] roamingdog: has joined #ruby
[00:21:48] dar123: has joined #ruby
[00:21:57] kobain: has joined #ruby
[00:23:15] Kus: has joined #ruby
[00:23:15] aupadhye: has joined #ruby
[00:25:33] allcentury: has joined #ruby
[00:29:32] Oclair_: has joined #ruby
[00:29:41] maletor2: has joined #ruby
[00:31:56] alexander: has joined #ruby
[00:33:00] tristanp_: has joined #ruby
[00:33:01] jancel: has joined #ruby
[00:35:12] tristanp: has joined #ruby
[00:37:08] skolman_: has joined #ruby
[00:37:10] tristanp: has joined #ruby
[00:37:26] nankyokusei: has joined #ruby
[00:37:29] LoneHermit: has joined #ruby
[00:38:00] Ropeney: has joined #ruby
[00:41:39] mudbox: has joined #ruby
[00:42:07] paradisaeidae_: has joined #ruby
[00:43:10] DynamicM`: has joined #ruby
[00:43:23] jaguarmagenta: has joined #ruby
[00:44:45] pawnbox: has joined #ruby
[00:45:11] mudbox: has joined #ruby
[00:47:56] tristanp_: has joined #ruby
[00:49:55] mattwashere: has joined #ruby
[00:50:04] tristanp: has joined #ruby
[00:51:55] tristanm_: has joined #ruby
[00:52:17] nofxx: shevy, did you found out? I remember some obscure regex option... or maybe #match
[00:52:38] nofxx: or I'm jus dazzled and confused
[00:54:30] tristanp_: has joined #ruby
[00:59:25] uncertainty: has joined #ruby
[01:07:05] jancel: has joined #ruby
[01:08:29] weaksauce: has joined #ruby
[01:09:12] gigetoo: has joined #ruby
[01:12:49] pat: has joined #ruby
[01:14:34] skweek: has joined #ruby
[01:18:27] tristanp: has joined #ruby
[01:19:14] ferr: has joined #ruby
[01:21:27] gfvcastro: has joined #ruby
[01:21:40] tristanp_: has joined #ruby
[01:22:02] Es0teric: has joined #ruby
[01:22:35] thejamespinto: has joined #ruby
[01:22:45] ramfjord: has joined #ruby
[01:23:58] tristanp: has joined #ruby
[01:24:08] arlek: has joined #ruby
[01:25:21] DynamicM`: has joined #ruby
[01:25:29] Akagi201: has joined #ruby
[01:26:21] norc_: has joined #ruby
[01:27:45] jancel: has joined #ruby
[01:30:28] maletor2: has joined #ruby
[01:31:43] Alazoral: has joined #ruby
[01:32:54] PlasmaStar: has joined #ruby
[01:37:05] xkapastel: has left #ruby: ()
[01:39:15] pawnbox: has joined #ruby
[01:39:30] tristanp: has joined #ruby
[01:42:01] roamingdog: has joined #ruby
[01:42:05] jackjackdripper: has joined #ruby
[01:43:21] MrBusiness: has joined #ruby
[01:43:35] RegulationD: has joined #ruby
[01:45:15] crdpink: has joined #ruby
[01:47:57] sdrew: has joined #ruby
[01:50:05] elifoster: has joined #ruby
[01:50:13] blackmesa: has joined #ruby
[01:50:33] dkam_: has joined #ruby
[01:52:06] dar123: has joined #ruby
[01:54:09] jackjackdripper: has joined #ruby
[01:55:19] duckpuppy: has joined #ruby
[01:58:12] lightt: has joined #ruby
[01:58:21] Spami_: has joined #ruby
[01:59:15] kraken: has joined #ruby
[01:59:52] Guest25390: Ok, so as far as local variables go, they are local to 1: the method they are in OR 2: the loop they are in
[02:00:14] uncertainty: has joined #ruby
[02:00:16] Guest25390: BUT a local variable will not be local to the if statement that it is in, only local the the whoel method
[02:01:13] tristanp: has joined #ruby
[02:01:31] panpainter: has joined #ruby
[02:04:30] jackjackdripper: has joined #ruby
[02:07:01] duckpuppy: has joined #ruby
[02:08:43] GriffinHeart: has joined #ruby
[02:09:47] GriffinHeart: Hi everyone, for a module that is not supposed to be included anywhere what is the practical difference between `mattr_accessor :var` vs `class << self; attr_accessor :var; end`?
[02:11:17] GriffinHeart: Trying to figure out an alternative where rubocop doesn't complain about `@@user_model = nil # rubocop:disable Style/ClassVars`
[02:11:51] _kraken: are variable declared in a loop in ruby suppsoed to be local to that loop? I'm not finding this to be true
[02:13:06] banister: has joined #ruby
[02:13:20] adgtl: has joined #ruby
[02:14:39] gfvcastro: has joined #ruby
[02:17:05] arescorpio: has joined #ruby
[02:19:07] Kilo`byte: has joined #ruby
[02:19:45] Yzguy: has joined #ruby
[02:21:11] Radar: It'd be nice if kraken actually stayed around for the answer.
[02:21:58] d0nn1e: has joined #ruby
[02:21:59] tristanp_: has joined #ruby
[02:24:46] tristanp: has joined #ruby
[02:25:53] LoneHermit: has joined #ruby
[02:26:14] thejamespinto: kraken is always around http://vignette2.wikia.nocookie.net/reddits-world/images/8/8e/Kraken_v2_by_elmisa-d70nmt4.jpg/revision/latest?cb=20140922042121
[02:26:52] GriffinHeart: has joined #ruby
[02:28:01] czerasz: has joined #ruby
[02:30:07] Lord_of_Life: has joined #ruby
[02:31:16] maletor2: has joined #ruby
[02:31:17] pawnbox: has joined #ruby
[02:33:00] grill: has joined #ruby
[02:33:33] karmatr0_: has joined #ruby
[02:34:46] grill: has joined #ruby
[02:35:21] jackjackdripper: has joined #ruby
[02:37:41] Caelum: has joined #ruby
[02:38:19] nankyokusei: has joined #ruby
[02:38:59] karmatr0n: has joined #ruby
[02:40:26] tristanp: has joined #ruby
[02:41:22] rkazak: has joined #ruby
[02:41:32] houhoulis: has joined #ruby
[02:43:44] safe: has joined #ruby
[02:44:08] jaguarmagenta: has joined #ruby
[02:45:58] JJM: has joined #ruby
[02:46:08] karmatr0_: has joined #ruby
[02:46:36] GriffinHeart: has joined #ruby
[02:47:14] karmatr0_: has joined #ruby
[02:51:36] blackmesa: has joined #ruby
[02:52:43] tristanp: has joined #ruby
[02:52:45] ensyde__: has joined #ruby
[02:57:30] jackjackdripper: has joined #ruby
[03:00:58] uncertainty: has joined #ruby
[03:04:20] karmatr0n: has joined #ruby
[03:06:03] karmatr0n: has joined #ruby
[03:07:20] pawnbox: has joined #ruby
[03:07:43] hahuang65: has joined #ruby
[03:08:09] tristanp: has joined #ruby
[03:08:19] jancel: has joined #ruby
[03:10:09] braincrash: has joined #ruby
[03:13:22] dar123: has joined #ruby
[03:13:33] stardiviner: has joined #ruby
[03:14:30] allcentury: has joined #ruby
[03:21:43] k3rn31: has joined #ruby
[03:23:59] moeabdol1: has joined #ruby
[03:26:55] tristanp_: has joined #ruby
[03:29:23] nando293921: has joined #ruby
[03:30:59] tristanp: has joined #ruby
[03:32:03] maletor2: has joined #ruby
[03:32:04] Anderson69s: has joined #ruby
[03:32:11] sixer1: has joined #ruby
[03:32:34] tvon: has joined #ruby
[03:32:48] jancel: has joined #ruby
[03:33:50] hugoxrosa: has joined #ruby
[03:33:51] tvon: has joined #ruby
[03:34:27] howdoi: has joined #ruby
[03:35:10] jenrzzz: has joined #ruby
[03:35:29] LoneHerm_: has joined #ruby
[03:35:40] Bugboy1028: has joined #ruby
[03:37:15] matp: has joined #ruby
[03:38:04] tristanp: has joined #ruby
[03:39:13] Guest38693: has joined #ruby
[03:45:28] kraken: has joined #ruby
[03:45:47] ramfjord: has joined #ruby
[03:46:24] Guest44627: Is there a method for a string that searches through the string for each instance of a parameter, then does something with what is finds via do |x| or something
[03:51:21] kgrz: has joined #ruby
[03:51:36] Yzguy: has joined #ruby
[03:53:02] blackmesa: has joined #ruby
[03:55:12] astrobunny: has joined #ruby
[03:56:11] Radar: Guest44627: Do you have an example of how this method might be used?
[03:56:27] tristanp_: has joined #ruby
[03:58:08] gix: has joined #ruby
[03:59:43] auzty: has joined #ruby
[04:01:27] kareeoleez: has joined #ruby
[04:01:41] uncertainty: has joined #ruby
[04:02:22] pawnbox: has joined #ruby
[04:02:23] kareeole_: has joined #ruby
[04:02:44] k3rn31: has joined #ruby
[04:05:47] jancel: has joined #ruby
[04:06:07] GriffinHeart: has joined #ruby
[04:09:29] lightt: has joined #ruby
[04:10:44] greenride: has left #ruby: ()
[04:11:54] dkam_: has joined #ruby
[04:14:03] jancel: has joined #ruby
[04:14:25] GriffinHeart: has joined #ruby
[04:15:10] SilverKey: has joined #ruby
[04:15:29] hk238: has joined #ruby
[04:19:40] bzb: has joined #ruby
[04:22:20] jancel: has joined #ruby
[04:23:08] allcentury: has joined #ruby
[04:25:04] kraken: has joined #ruby
[04:26:07] Anderson69s: has joined #ruby
[04:30:51] vdamewood: has joined #ruby
[04:31:05] Guest38693: has joined #ruby
[04:32:23] r4z3r: has joined #ruby
[04:32:45] maletor2: has joined #ruby
[04:39:07] tristanp: has joined #ruby
[04:39:09] nankyokusei: has joined #ruby
[04:40:10] jackjackdripper: has joined #ruby
[04:41:07] sdrew: has joined #ruby
[04:44:56] jaguarmagenta: has joined #ruby
[04:48:59] etehtsea: has joined #ruby
[04:50:56] aries_liuxueyang: has joined #ruby
[04:53:00] pawnbox: has joined #ruby
[04:54:03] blackmesa: has joined #ruby
[04:54:56] emilkarl: has joined #ruby
[04:56:13] tristanp_: has joined #ruby
[04:58:09] tAn: has joined #ruby
[04:59:13] lxsameer: has joined #ruby
[05:00:04] blackgoat: has joined #ruby
[05:00:11] mattwashere: has joined #ruby
[05:01:02] craigp: has joined #ruby
[05:01:37] Walter-4: has joined #ruby
[05:02:26] uncertainty: has joined #ruby
[05:03:47] Guest14270: has joined #ruby
[05:04:36] ozzloy: has joined #ruby
[05:08:14] Yiota: has joined #ruby
[05:08:27] justapersona: has joined #ruby
[05:09:45] hahuang65: has joined #ruby
[05:11:04] chipotle: has joined #ruby
[05:12:07] GriffinHeart: has joined #ruby
[05:12:34] Cohedrin: has joined #ruby
[05:14:38] dionysus69: has joined #ruby
[05:15:52] rickmasta: has joined #ruby
[05:18:06] ferr: has joined #ruby
[05:18:16] tmtwd: has joined #ruby
[05:19:53] pawnbox: has joined #ruby
[05:21:00] kgrz: has joined #ruby
[05:21:19] emilkarl: has joined #ruby
[05:22:33] Yiota: has joined #ruby
[05:23:05] cats: has joined #ruby
[05:23:38] jenrzzz: has joined #ruby
[05:23:54] jenrzzz: has joined #ruby
[05:24:27] fenre: has joined #ruby
[05:26:25] LoneHermit: has joined #ruby
[05:27:59] aupadhye: has joined #ruby
[05:28:11] tristanp: has joined #ruby
[05:29:11] pawnbox_: has joined #ruby
[05:29:11] ssiris: has joined #ruby
[05:33:07] tristanp_: has joined #ruby
[05:33:12] tie: has joined #ruby
[05:33:32] maletor2: has joined #ruby
[05:34:20] tie: I'm looking to input/output from/to a standard text file 8 letters at a time. How would I go around doing that?
[05:38:23] tristanp: has joined #ruby
[05:41:32] tier: has joined #ruby
[05:42:42] moeabdol: has joined #ruby
[05:43:14] Arcaire: tie: https://gist.github.com/Arcaire/c23253df56b511e24134a923bc376ef7
[05:43:28] lightt: has joined #ruby
[05:44:03] hahuang65: has joined #ruby
[05:44:33] Arcaire: This is reading bytes, though. You may have some issues if you're using, say, UTF-16 or UTF-32 encoding.
[05:44:43] Arcaire: Since they have code units that are two and four bytes long, respectively.
[05:44:48] Arcaire: If you don't know what that is, then you're probably fine.
[05:45:54] last_staff: has joined #ruby
[05:47:42] tier: I'm actually not trying to read in bytes. Im trying to do letters. I will have a few hundred 1s and 0s printed in the file, but i want to read in 8 at a time as a string.
[05:48:05] Arcaire: one character is one byte in UTF-8 encoding.
[05:48:14] tier: I'm doing it this way so it will be easier to present. Not for functionality.
[05:48:33] tier: Alright, i'll try it out. Thanks.
[05:49:01] Arcaire: mmm wait i'm wrong i think
[05:49:24] Arcaire: i mean if it's 1 and 0 it's fine
[05:49:32] Arcaire: if you were using things like ø you'd have an issue
[05:49:46] domgetter: A character can be more than one byte in UTF-8, to my understanding
[05:49:52] Arcaire: Between one and four, yes.
[05:49:55] tier: i just mean the ascii value of 1s and 0s
[05:49:56] etehtsea: has joined #ruby
[05:50:15] Arcaire: Yeah they're one byte a piece.
[05:50:23] domgetter: UTF-8 is more like a linked list of characters
[05:50:31] tier: standart ASCIi only has 256 different values so that should be one byte
[05:51:16] tier: Could you explain the two variables you passed in to .open please?
[05:52:02] ytti: not to be anal but ascii is 7bits
[05:52:27] domgetter: The first parameter to open is the filename, and the second is the mode. 'r' means 'read', so that file can only be read from. If you had passed 'w', you could write to it (and overwrite what's ther)
[05:52:28] Yzguy: has joined #ruby
[05:53:00] domgetter: http://ruby-doc.org/core-2.2.0/File.html#method-c-open
[05:53:29] tier: ytti: My apologies, I meand extended ascii
[05:54:14] terminalrecluse: has joined #ruby
[05:55:08] jenrzzz: has joined #ruby
[05:55:22] tristanp: has joined #ruby
[05:55:26] blackmesa: has joined #ruby
[05:55:43] kareeoleez: has joined #ruby
[05:57:51] Yiota: has joined #ruby
[05:58:23] Walter-4`: has joined #ruby
[05:59:31] jaguarmagenta: has joined #ruby
[06:00:25] tier: It was nice to find a text to binary that enters spaces after each letter. I dont need to read in by size now, simply through a delimiter.
[06:03:10] uncertainty: has joined #ruby
[06:03:47] tier: Arcaire: The way you wrote that gist, it looks like a while loop. Will that loop until the eof is found
[06:04:36] allcentury: has joined #ruby
[06:04:49] tier: perfect.
[06:04:58] tier: Thats exactly what I need.
[06:05:26] tier: This is the fourth language i've learned and this community is by far my favorite.
[06:06:39] domgetter: You should learn Forth next and confuse people when telling them the order of languages
[06:07:36] mikar: has joined #ruby
[06:08:07] tier: Dear lord... Man, i'm already bogged down with all the languages. I've had to work on Python, Prolog, Scheme, Java, and Ruby, all in the span of three months. Prolog is Satans incarnate.
[06:08:34] tier: Do I need to include the file extension in the name? Or is it defaulted to .txt
[06:09:45] pld: has joined #ruby
[06:09:45] pld: has joined #ruby
[06:09:50] n1x-nz: has joined #ruby
[06:10:10] domgetter: tie_ what operating system are you on?
[06:10:37] tier: Windows 8
[06:10:46] JesseH: has joined #ruby
[06:10:51] tier: Dont judge >.<
[06:11:00] domgetter: To open a file, you need to tell Ruby the entire filename, and "filename.txt" would be the whole thing
[06:11:29] domgetter: s'all good, I'm on Win7 for my desktop. I can help you with ruby windows pain
[06:12:43] tier: I'm my colleges dorm internet technician so I need to stay on 8.1
[06:12:48] Zarthus: Ruby Windows pain is pretty limited untill you start needing native extensions
[06:12:52] karmatr0n: has joined #ruby
[06:13:25] tristanp_: has joined #ruby
[06:14:19] phredus: has joined #ruby
[06:14:23] tier: I'm looking for a delimited input like 'text = gets(" ")' but I cant seem to find it online.
[06:14:37] scepticulous: has joined #ruby
[06:14:43] Zarthus: text = gets.chomp.split(" ")
[06:15:01] tier: That wont effect the eof check?
[06:15:12] Zarthus: I haven't read up too far to know what the EOF check is
[06:15:20] Zarthus: probably not.
[06:15:38] tier: End of File. Just wherever the pointer is for the current read is.
[06:15:53] Zarthus: then no, not sure why you'd think it would
[06:16:04] Zarthus: granted, you want to call gets on the file handler
[06:16:19] Zarthus: which is more like a loop
[06:16:36] tier: Just thought there might be a possibility it reads the whole line and using the delimiter deletes everything past the first instance
[06:17:03] raeoks: has joined #ruby
[06:17:11] tristanp: has joined #ruby
[06:18:46] domgetter: tie_ when you pass a string to gets, it doesn't "delete" the rest, it just saves it for later
[06:19:24] domgetter: in irb try gets(" ") and then type <Space>asdf<Enter> and then run gets()
[06:19:46] domgetter: it will return " asdf\n"
[06:19:52] lightt: has joined #ruby
[06:20:01] tier: I'm pretty new to this. irb?
[06:20:26] domgetter: from the command prompt, run irb
[06:20:47] domgetter: you can get there quickly from WindowsKey+R cmd<Enter>
[06:21:21] tristanp_: has joined #ruby
[06:21:25] fenre: has joined #ruby
[06:21:31] domgetter: irb is ruby but you can input one line at a time, and it will evaluate the line and spit back the answer
[06:21:59] domgetter: It's called a "Repl" or "read, evaluate, print, loop", and it's very useful for exploring and testing out things
[06:22:07] tier: oh nice. That would have been good to know a few days ago. I created a while new program just to try that stuff out.
[06:22:19] yfeldblum: has joined #ruby
[06:22:23] tier: TestPrograms.rb has gotten more love then my main program :(
[06:22:52] domgetter: You wrote a ruby script that was a repl?
[06:23:10] domgetter: If so, that's awesome.
[06:23:32] tier: Maybe? Sure, lest go with that!
[06:23:46] ytti: no rubyist should walk without 'pry'
[06:23:50] ytti: superior REPL to irb
[06:24:17] domgetter: ytti: I agree, but tie_ should at least get used to irb to know why pry is superior :)
[06:24:18] ytti: particularly because you can start in at arbitrary part of code in arbitrary code, with 'binding.pry'
[06:24:25] uncertainty: has joined #ruby
[06:24:31] ytti: once execution hits that, it'll open pry REPL shell, exitting will continue program execution
[06:24:49] Es0teric: has joined #ruby
[06:24:55] tier: Your talking nerdy to me and I feel bad.
[06:24:59] tier: https://gist.github.com/anonymous/434af33540ede95f4c0676bfa96f8396
[06:25:07] tier: I'm guessing line 2 is wrong.
[06:25:33] tristanp: has joined #ruby
[06:25:36] domgetter: what is it you want it to do?
[06:25:55] tier: read until a space is found and set it to plaintext
[06:26:51] domgetter: test.read will read a whole line at a time, and split will chop it up at each space and make a list of strings for you
[06:26:53] Caerus: plaintext should be just text, thats the arg name you're passing to the block tie_
[06:26:55] jhass: .gets(" ") was the right approach then
[06:27:09] Caerus: does it run?
[06:28:29] tier: https://gist.github.com/anonymous/cd8ce0dfe3f2d908f7955bced537998f
[06:28:32] Caerus: i mean nvm, shouldnt 'test.read' be 'text.read' ?
[06:28:44] domgetter: oops, read will read the whole file in at once.
[06:29:00] tier: I hope that gist clears some things up
[06:29:47] domgetter: tie_: does Ruby_Plaintext.txt contain literal 1's and 0's ?
[06:29:49] digneety: has joined #ruby
[06:30:04] tier: ASCII 1s and 0s.
[06:32:47] idefine: has joined #ruby
[06:34:17] tier: Got it to read in an array space delimited. I guess that'll do
[06:34:20] maletor2: has joined #ruby
[06:34:22] Gasher: has joined #ruby
[06:34:24] domgetter: well you have several options and they depends on the specific constraints of the problem
[06:34:55] domgetter: if you know for a fact that there will always be 8 characters followed by a space, you can do text.read(8); text.read(1)
[06:35:08] hightower3: has joined #ruby
[06:36:46] domgetter: If you're "allowed" to, I would just do text.gets.chomp.split(" ") for every line in the file. This is fine as long as lines are short, since it reads the whole line into memory at once. If any line in the file is very very long, the will cause you to use a lot of ram at once.
[06:37:23] fenre: has joined #ruby
[06:37:25] tier: It's just for a presentation so it wont be very large. Just a sentence
[06:38:03] domgetter: another way to do it would be to text.read(1) one character at a time, check if it's a space, and store it in a string if it's not, and then work on the string you're building up once you hit a space character.
[06:38:35] tier: Hey, one second. I think i'm on to something. I'll post what im doing in a sec
[06:38:57] domgetter: that is the most imperative way to go about it, and not very ruby-ish
[06:40:01] nankyokusei: has joined #ruby
[06:42:20] tier: https://gist.github.com/anonymous/1c98d915f088dcdf58d566bafa424905
[06:43:11] tristanp_: has joined #ruby
[06:44:02] mark_66: has joined #ruby
[06:44:17] domgetter: tie_ here it is using the #each method of arrays: https://gist.github.com/domgetter/984365bcb8d5ab15034bc04189aad558
[06:44:45] domgetter: that way you don't have to worry about referring to an index of the list, you can just go over each one
[06:45:28] tier: Ohh, I remember learning about the .each one time but I completely forgot about that.
[06:46:18] jhass: also if you're going to read the whole thing into memory anyway, just use File.read("Ruby_Plaintext.txt").split(" ")
[06:46:30] domgetter: what .each will do is go over the list, and store each element into the variable you put between the |...| and then run the code inside for that element
[06:46:55] last_staff: has joined #ruby
[06:46:57] jhass: puts File.read("Ruby_Plaintext.txt").split(" ").map {|byte| encrypt(byte, key) }.join(" ")
[06:46:57] tier: Yeah, I remember now. Thank you for the pointer
[06:47:51] tier: jhass: I think ill keep it to several lines as this is a presentation. But that is really neat that I can do that in Ruby.
[06:48:26] tier: So I found this. File.open(yourfile, 'w') { |file| file.write("your text") }
[06:48:39] tristanp: has joined #ruby
[06:48:46] jhass: you can make a new line before each . and indent it nicely
[06:48:50] tier: But I feel this would be inefficient opening and closing a file every time I go in the loop
[06:49:04] conta: has joined #ruby
[06:49:28] DoubleMalt: has joined #ruby
[06:49:33] domgetter: tie_ yea, you can save your work to a string and then write that as a whole to the file after you do the read
[06:49:58] ur5us: has joined #ruby
[06:50:03] Caerus: File.new will keep it opened, accessible from an object instance of FILE
[06:51:24] jhass: always use the block form though, put your loop inside
[06:51:54] tristanp_: has joined #ruby
[06:52:28] tier: https://gist.github.com/anonymous/a3cbd4674ea16e5411aeba7c4f343a1d
[06:52:34] tier: Could I do something like this?
[06:52:58] andikr: has joined #ruby
[06:53:04] hahuang65: has joined #ruby
[06:53:58] jackjackdripper: has joined #ruby
[06:54:13] duncannz: has joined #ruby
[06:54:22] tristanp: has joined #ruby
[06:54:53] terlar: has joined #ruby
[06:55:03] pawnbox: has joined #ruby
[06:55:06] duncannz: has joined #ruby
[06:56:01] duncannz: has joined #ruby
[06:56:14] sinpai: has joined #ruby
[06:56:18] tristanm_: has joined #ruby
[06:56:52] jackjackdripper: has joined #ruby
[06:58:17] blackmesa: has joined #ruby
[07:02:35] czerasz2: has joined #ruby
[07:02:58] TomyWork: has joined #ruby
[07:04:02] jhass: tie_: yes, as you already correctly use the blockform of File.open, the output.close should of course be an end to close the block
[07:04:21] domgetter: tie_ line 5 should be output = File.open(...)
[07:04:30] jhass: domgetter: no.
[07:05:20] domgetter: jhass it's either that or add do end which is missing
[07:05:23] Couch: has joined #ruby
[07:05:23] jhass: single statement version: File.write("Ruby_Ciphertext.txt", File.read("Ruby_Plaintext.txt").split(" ").map {|byte| encrypt(byte, key) }.join(" "))
[07:05:37] jhass: domgetter: as I said, and adding an end is to highly prefer
[07:06:34] domgetter: jhass: the code is syntactically incorrect. I was only providing the shortest path to correctness
[07:06:48] GriffinH_: has joined #ruby
[07:06:53] dn5: has joined #ruby
[07:06:58] jhass: replacing output.close with end hardly takes any longer
[07:07:13] jhass: oh, well there's a missing do too
[07:07:17] jhass: still to prefer
[07:07:31] rbr: has joined #ruby
[07:08:15] jhass: tie_: oh and it's cipher, not cypher ;)
[07:09:31] tie: has joined #ruby
[07:09:48] tie: Whoops, thanks for the catch.
[07:12:26] bluOxigen: has joined #ruby
[07:12:29] jhass: tie: multiple lines version ;) https://p.jhass.eu/28.rb
[07:12:47] p0p0pr37_: has joined #ruby
[07:12:50] tie: So I did it domgetters way. It seems to be running perfectly now.
[07:13:11] jhass: tie: it's bad style though
[07:13:33] tie: https://gist.github.com/anonymous/7c85e8f8bd63c1651d5d7c46361cf2f5
[07:13:33] domgetter: tie: when you get a chance, be sure to explore how to use blocks and also how to use the .map method
[07:13:35] jhass: if an exception happens you leave the file open, the block form or the class level methods make sure to handle that for you
[07:13:36] tie: I meant this
[07:14:20] jhass: ah yeah, that last gist looks a bit better
[07:14:35] troulouliou_div2: has joined #ruby
[07:14:51] jhass: still, that's just the verbose variant of File.write ;)
[07:14:51] LoneHermit: has joined #ruby
[07:15:09] aganov: has joined #ruby
[07:15:21] tie: I agree. But if I cant explain every line perfectly then it would be a pretty useless presentation.
[07:15:52] jhass: you can't explain File.write("Ruby_Ciphertext.txt", output) ?
[07:16:35] biberu: has joined #ruby
[07:16:46] tie: No, lines 1, 5, and 7 I cant
[07:17:16] tie: I'm pretty sure i know what they do, but not well enough to present on them.
[07:17:19] jhass: oh you meant in my version
[07:17:48] Caerus: if your presentation is about ruby then you should really use jhass idiomatic version
[07:17:53] jhass: I was talking about replacing https://gist.github.com/anonymous/7c85e8f8bd63c1651d5d7c46361cf2f5#file-gistfile1-txt-L12
[07:17:57] Caerus: if not, then yours is fine.
[07:17:59] kraken: has joined #ruby
[07:18:09] emilkarl: has joined #ruby
[07:18:33] krakenr: Jesus Chirst being able to write methods which take code blocks as arguments makes my head spin with all the different possibilites
[07:18:42] tie: My presentation is in 8 hours and I still need to create the powerpoint and sleep.
[07:19:11] jhass: kraken_: it's awesome, isn't it?
[07:19:14] krakenr: so much potential for abstraction
[07:19:23] domgetter: kraken_ here's some fun: square = lambda {|n| n*n}; [1,2,3,4,5].map(&square)
[07:19:26] Caerus: kraken_, i know the feeling happens to me too
[07:20:13] jhass: square = ->(n) { n**2 } pls :P
[07:20:16] CausaMortis: has joined #ruby
[07:20:22] krakenr: I feel like its a 'with great power comes great responsibility' thing. I feel like there are so many high level ways of doing things now, and I have to think of them
[07:20:43] domgetter: I finally got my head around blocks when I implemented #each myself
[07:20:44] Caerus: oh my, functional ruby :o
[07:20:47] hightower2: has joined #ruby
[07:21:05] jhass: domgetter: now do the whole of Enumerable :P
[07:21:06] domgetter: it's just a loop that does the busywork for you
[07:22:02] jhass: kraken_: yet the real dangerous parts of ruby into that direction are probably still to discover for you :P
[07:22:05] madgen: has joined #ruby
[07:22:38] krakenr: <jhass>: Give me one word on what is to come
[07:23:21] jhass: .send, Class.new, .define_method, .instance_variable_set/get, ...
[07:24:08] jhass: method_missing, method_added, included
[07:24:14] domgetter: i.e. all the hooks?
[07:24:36] domgetter: ObjectSpace is always fun
[07:25:03] jhass: well and I guess the highest level is hacking MRI with Fiddle
[07:26:32] krakenr: quick question, so is a code block and object?
[07:26:40] norc: has joined #ruby
[07:26:43] krakenr: what isn't an object in ruby besides nil?
[07:26:44] tristanp: has joined #ruby
[07:26:49] domgetter: kraken_ sor tof
[07:26:52] jhass: nil is an object
[07:26:59] norc: kraken_: The only thing that is not an object is blocks.
[07:27:04] norc: kraken_: And keywords.
[07:27:21] jhass: well and methods, Method is only a representation
[07:27:25] domgetter: it saddens me that method definitions are not objects
[07:27:29] Caerus: what about symbols, are they considered objects?
[07:27:29] jaruga___: has joined #ruby
[07:27:45] jhass: >> :symbol.is_a?(Object)
[07:27:46] ruby[bot]: jhass: # => true (https://eval.in/579980)
[07:27:51] jhass: ruby things so
[07:27:55] jhass: thinks, even
[07:28:07] tie: Well guys. I'm finally done with my project. Thank you so much for all of your help over the past few days. I've really enjoyed Ruby and I hope to work on it more sometime. Here is my final project.
[07:28:08] tie: https://gist.github.com/anonymous/756a1ff2a5de9c6babfa989e6d090341
[07:28:29] krakenr: When you pass a block into a method, you can .call it, so does that mean it becomes an object once you pass it into a method?
[07:28:38] krakenr: but not before?
[07:28:38] jhass: kraken_: so, as for "values", only methods but you can get Method objects representing them and blocks, but you can get Proc objects representing them
[07:28:44] coffeecupp: has joined #ruby
[07:28:51] norc: kraken_: You can either use yield to call the block, or you have to procify it.
[07:28:54] domgetter: >> inc = 1.method(:+); [4,5,6].map(&inc)
[07:28:54] ruby[bot]: domgetter: # => [5, 6, 7] (https://eval.in/579982)
[07:29:00] domgetter: ooh that's dirty
[07:29:15] jhass: kraken_: def foo(&block) does convert the block into a Proc object; def foo; yield does not
[07:29:29] krakenr: thanks you!
[07:29:32] krakenr: thank you*
[07:29:39] norc: jhass: well the more correct term would be is that the block is attached to the proc. :p
[07:30:01] norc: (Internally it allocates and initializes a proc object, and then sets the block ptr)
[07:30:08] domgetter: also, variables aren't objects in Ruby
[07:30:14] jhass: others tell me it's the same really, from a user perspective I think convert fits just best though ;)
[07:30:20] baweaver: >> [4,5,6].map(&:next)
[07:30:21] ruby[bot]: baweaver: # => [5, 6, 7] (https://eval.in/579987)
[07:30:30] jhass: if MRI is tricky internally to make it faster, all the better, but I shouldn't care
[07:30:38] norc: jhass: the overhead of creating a proc is extremely minimal. Essentially it is just allocating a couple of bytes.
[07:30:44] edwinvdgraaf: has joined #ruby
[07:30:50] domgetter: >> double = 2.method(:*); [4,5,6].map(&double)
[07:30:51] ruby[bot]: domgetter: # => [8, 10, 12] (https://eval.in/579992)
[07:32:22] baweaver: >> multiplier = -> x { -> y { x * y } }; [4,5,6].map(&multiplier[5])
[07:32:23] ruby[bot]: baweaver: # => [20, 25, 30] (https://eval.in/579993)
[07:32:31] tristanp: has joined #ruby
[07:32:52] krakenr: goodnight all
[07:32:59] jhass: ACTION waits for the y/z combinator again
[07:33:09] baweaver: release the kraken!
[07:33:43] baweaver: I'll save the ornithology for later.
[07:34:08] domgetter: >> multiplier = -> x, y { x * y }.curry; [4,5,6].map(&multiplier[5])
[07:34:09] ruby[bot]: domgetter: # => [20, 25, 30] (https://eval.in/579994)
[07:34:30] baweaver: We like Curry here.
[07:35:08] maletor2: has joined #ruby
[07:35:15] baweaver: now that's technically a multi-faceted pun. Either the food or the basketball player.
[07:35:18] GriffinHeart: has joined #ruby
[07:35:26] baweaver: or Haskell Curry himself
[07:36:07] troulouliou_div2: has joined #ruby
[07:36:46] tristanp_: has joined #ruby
[07:38:30] the_drow: has joined #ruby
[07:38:59] domgetter: The only thing I don't like about Proc#curry is that it doesn't play nice with keyword arguments
[07:39:05] domgetter: it expects all of them at once
[07:39:08] TvL2386: has joined #ruby
[07:39:18] djbkd: has joined #ruby
[07:39:30] domgetter: >> multiplier = -> x:, y: { x * y }.curry; multiplier[x: 5][y: 2]
[07:39:31] ruby[bot]: domgetter: # => missing keyword: y (ArgumentError) ...check link for more (https://eval.in/579999)
[07:39:40] domgetter: >> multiplier = -> x:, y: { x * y }.curry; multiplier[x: 5, y: 2]
[07:39:41] ruby[bot]: domgetter: # => 10 (https://eval.in/580000)
[07:41:12] yfeldblum: has joined #ruby
[07:41:55] mtkd: has joined #ruby
[07:43:56] mattwashere: has joined #ruby
[07:44:45] tristanp: has joined #ruby
[07:44:59] snowy: has joined #ruby
[07:46:19] pabloh: has joined #ruby
[07:48:32] aufi: has joined #ruby
[07:50:49] bluOxigen: has joined #ruby
[07:51:02] joystick: has joined #ruby
[07:51:53] Guest82080: Hi, looking for some help with AR and scopes.
[07:52:50] Guest82080: I'm using mongoid (without rails) to get data for daily reports.
[07:53:42] tristanp: has joined #ruby
[07:54:13] einarj: has joined #ruby
[07:55:06] pLaToOn: has joined #ruby
[07:55:33] GriffinHeart: has joined #ruby
[07:56:07] kies: has joined #ruby
[07:56:47] tristanp_: has joined #ruby
[07:57:10] karmatr0n: has joined #ruby
[07:57:14] Guest82080: Can I enlighten me please what Model.where returns?
[07:59:20] tristanp: has joined #ruby
[07:59:39] blackmesa: has joined #ruby
[08:00:12] terlar: has joined #ruby
[08:01:53] tristanm_: has joined #ruby
[08:03:09] domgetter: Guest82080 try ##rubyonrails for Ruby on Rails questions
[08:03:40] skweek: has joined #ruby
[08:04:15] tristanp_: has joined #ruby
[08:06:48] tax: has joined #ruby
[08:07:01] tristanp: has joined #ruby
[08:07:02] Guest82080: domgetter: I'm not using rails. Just mongoid without rails. Thanks anyway, will ask there.
[08:07:05] Guest14270: has joined #ruby
[08:07:15] Guest82080: \join #rubyonrails
[08:07:18] domgetter: They'll be able to answer active record questions
[08:07:52] Guest82080: Great, will try.
[08:08:49] paradisaeidae_: has joined #ruby
[08:09:51] TvL2386: has joined #ruby
[08:11:03] ocbtec: has joined #ruby
[08:11:58] Guest82080: has left #ruby: ()
[08:15:22] evidex: has joined #ruby
[08:17:13] postmodern: has joined #ruby
[08:20:30] czerasz: has joined #ruby
[08:21:52] jenrzzz: has joined #ruby
[08:21:52] jenrzzz: has joined #ruby
[08:22:35] jhass: ACTION fixes Alazoral ! key
[08:22:47] jhass: there, shouldn't get stuck anymore. Any other issues we can help with?
[08:23:24] mark_66: has joined #ruby
[08:24:23] tvw: has joined #ruby
[08:26:29] Alazoral: yes!!!!!!!!!!!!!
[08:29:38] Akagi201: has joined #ruby
[08:30:47] ferr: has joined #ruby
[08:33:52] CorOne: has joined #ruby
[08:35:52] maletor2: has joined #ruby
[08:37:30] weckl: has joined #ruby
[08:37:52] symm-: has joined #ruby
[08:38:36] blackmesa: has joined #ruby
[08:38:42] the_drow: has joined #ruby
[08:38:59] weckl: has joined #ruby
[08:39:53] weckl: has joined #ruby
[08:40:44] weckl: has joined #ruby
[08:40:53] nankyokusei: has joined #ruby
[08:43:39] colegatron: has joined #ruby
[08:43:40] jaguarmagenta: has joined #ruby
[08:44:08] GriffinHeart: has joined #ruby
[08:44:41] colegatron: has joined #ruby
[08:45:17] colegatron_origi: has joined #ruby
[08:45:32] lightt: has joined #ruby
[08:45:45] codecop: has joined #ruby
[08:45:52] joonty: has joined #ruby
[08:47:28] tristanp_: has joined #ruby
[08:47:45] AlexJakeGreen: has joined #ruby
[08:49:13] panpainter: has joined #ruby
[08:49:13] uncertainty: has joined #ruby
[08:50:52] Spami_: has joined #ruby
[08:50:54] TheCreepyPickle: has joined #ruby
[08:51:41] tristanp: has joined #ruby
[08:54:46] tristanp: has joined #ruby
[08:58:20] pawnbox: has joined #ruby
[09:00:44] platzhirsch: has joined #ruby
[09:01:15] GriffinHeart: has joined #ruby
[09:02:16] madgen: has joined #ruby
[09:03:24] LoneHerm_: has joined #ruby
[09:04:43] eGGshke: has joined #ruby
[09:07:19] TheCreepyPickle: has left #ruby: ()
[09:09:21] symm-: has joined #ruby
[09:09:50] anisha: has joined #ruby
[09:10:34] Guest14270: has joined #ruby
[09:13:28] lxsameer: has joined #ruby
[09:15:20] GriffinHeart: has joined #ruby
[09:16:28] norc: has joined #ruby
[09:19:02] workmad3: has joined #ruby
[09:24:13] senayar: has joined #ruby
[09:24:13] senayar: has joined #ruby
[09:25:13] acosonic_: has joined #ruby
[09:25:24] acosonic_: Hi, is there something like this http://stackoverflow.com/questions/4223980/the-ultimate-clean-secure-function done in Ruby ?
[09:26:22] tobiasvl: acosonic_: maybe in #RubyOnRails
[09:26:44] phatypus: has joined #ruby
[09:27:31] norc: acosonic_: Any kind of sanitization is domain specific.
[09:27:36] depesz_: is there anything in ruby that would check for things like usage of undefined variables at compile time, and not runtime?
[09:27:41] domgetter: acosonic_ the first two answers in that thread have the right idea that it's silly to sanitize a string in ways you don't need to.
[09:27:48] norc: Hello depesz_! What brings you over to this world?
[09:27:56] depesz_: norc: i'm learning ruby
[09:28:08] tobiasvl: depesz_: how are you compiling?
[09:28:10] norc: depesz_: To answer your question, no.
[09:28:17] depesz_: tobiasvl: executing.
[09:28:24] binaryplease1: has joined #ruby
[09:28:24] domgetter: depesz_ not really. Ruby's type system is dynamic, so symbols are resolved at runtime
[09:28:28] norc: depesz_: There are things like ruby-lint that you can take a look at though.
[09:28:32] depesz_: tobiasvl / norc: basically i'm looking for perl's "use strict" in ruby
[09:28:41] norc: depesz_: The closest thing would be to lint.
[09:28:44] tristanp_: has joined #ruby
[09:28:56] acosonic_: norc: check this http://www.redmine.org/issues/22897#change-71193
[09:29:17] depesz_: norc: ok. thanks.
[09:29:19] domgetter: depesz_: it's possible for an undefined variable to get defined by the time it's used
[09:29:56] norc: domgetter: Ruby initializes all variables to nil.
[09:30:14] ruby[bot]: domgetter: # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/580093)
[09:30:22] blaxter: has joined #ruby
[09:30:31] norc: >> if false; a = 0; end; puts a # domgetter
[09:30:32] ruby[bot]: norc: # => ...check link for more (https://eval.in/580095)
[09:30:40] evidex: has joined #ruby
[09:31:26] tristanp: has joined #ruby
[09:31:43] c0mrad3: has joined #ruby
[09:32:23] norc: domgetter: So by showing an assignment to the lexer (even in dead code), you declare the variable. Ruby automatically then initializes it to nil.
[09:33:09] ishe_ua: has joined #ruby
[09:33:59] norc: depesz_: Knowing where you come from, do you have any postgres related goals in mind if you don't mind my asking?
[09:34:13] depesz_: for now? not really.
[09:34:23] depesz_: especially the ruby thing is unrelated
[09:34:44] norc: Fair enough. :)
[09:34:46] tristanp_: has joined #ruby
[09:36:43] maletor2: has joined #ruby
[09:39:05] domgetter: "No package cowsay available." Seriously CentOS??
[09:40:01] flughafen: is anybody here familiar with the jenkins_api_client?
[09:40:22] allcentury: has joined #ruby
[09:41:57] tristanp: has joined #ruby
[09:42:40] acosonic_: has joined #ruby
[09:45:44] giz|work: has joined #ruby
[09:48:03] ksmutthu: has joined #ruby
[09:51:39] ruby-lang593: has joined #ruby
[09:56:37] antgel: has joined #ruby
[09:59:46] tax: has joined #ruby
[09:59:56] karmatr0n: has joined #ruby
[09:59:58] RegulationD: has joined #ruby
[10:01:05] blackgoat: has joined #ruby
[10:04:32] tvw: has joined #ruby
[10:07:23] antgel: has joined #ruby
[10:09:32] idefine: has joined #ruby
[10:09:36] GriffinHeart: has joined #ruby
[10:10:55] tristanp_: has joined #ruby
[10:11:26] the_drow: has joined #ruby
[10:13:57] tristanp: has joined #ruby
[10:19:02] tristanp_: has joined #ruby
[10:21:04] madgen: has joined #ruby
[10:23:55] tristanp: has joined #ruby
[10:25:54] c355E3B: has joined #ruby
[10:28:22] idefine: has joined #ruby
[10:29:00] lxsameer: has joined #ruby
[10:32:23] Chair: has joined #ruby
[10:37:29] maletor2: has joined #ruby
[10:38:20] millerti: has joined #ruby
[10:39:43] toretore: has joined #ruby
[10:39:47] tier: has joined #ruby
[10:41:44] nankyokusei: has joined #ruby
[10:43:15] armyriad: has joined #ruby
[10:43:37] weckl: has joined #ruby
[10:44:28] jaguarmagenta: has joined #ruby
[10:44:40] rodfersou: has joined #ruby
[10:44:42] skade: has joined #ruby
[10:45:01] aupadhye: has joined #ruby
[10:45:13] tristanp_: has joined #ruby
[10:45:21] weckl: has joined #ruby
[10:46:31] Shashikant86: has joined #ruby
[10:47:52] tristanp: has joined #ruby
[10:48:48] weckl: has joined #ruby
[10:49:09] allcentury: has joined #ruby
[10:49:23] weckl: has joined #ruby
[10:50:30] weckl: has joined #ruby
[10:51:23] LoneHermit: has joined #ruby
[10:52:16] weckl: has joined #ruby
[10:52:52] weckl: has joined #ruby
[10:53:54] tristanp_: has joined #ruby
[10:55:00] tier: For shits and giggles I tested out how long it would take to encrypt 1KB of information using my algorithm in C++. How would i go about doing the same? Preferably in this format.
[10:55:01] tier: https://gist.github.com/anonymous/f6a773c898afdb75e430d6af8fd4e076
[10:55:14] emilkarl: has joined #ruby
[10:55:14] tier: Does ruby have that functionality?
[10:57:38] ur5us: has joined #ruby
[10:58:47] AlexRussia: has joined #ruby
[11:01:07] karmatr0n: has joined #ruby
[11:02:27] tier: Does Time.now use CPU time or clock time?
[11:03:07] ruurd: what is cpu time?
[11:03:11] ruurd: what is clock time?
[11:03:29] ruurd: Time.now uses the seconds since era as maintained by your operating system.
[11:04:56] tvw: has joined #ruby
[11:05:21] tobiasvl: I assume tie_ is asking if it uses the hw or sw clock in linux? maybe?
[11:05:25] tobiasvl: http://tldp.org/HOWTO/Clock-2.html
[11:05:28] tobiasvl: I don't rightly know
[11:05:47] depesz: has joined #ruby
[11:05:52] uncertainty: has joined #ruby
[11:06:25] tier: When i mean CPU time, i mean the time that has passed relating to the frequency of the CPU clock
[11:06:43] tier: clock time I mean by the actual OS clock
[11:06:52] tobiasvl: ok, so hw vs sw clock
[11:07:03] tobiasvl: I assumed correctly
[11:07:04] tier: No clue but lets go with that :)
[11:07:10] tobiasvl: CPU = hardware, OS = software
[11:07:21] tier: there we go. That
[11:07:52] tier: Does Time.now use hardware or software?
[11:08:04] sdothum: has joined #ruby
[11:08:06] sepp2k: has joined #ruby
[11:08:48] ruurd: No it uses the number of seconds since era as maintained by the OS.
[11:08:54] tobiasvl: so software
[11:09:31] tier: Perfect, thank you.
[11:09:37] ruurd: Which is initialized first by the time of the RTC clock on your motherboard and then adjusted and maintained by NTP if you installed that (which I advise)
[11:09:59] ruurd: AFAIK it has millisecond accuraracy.
[11:12:25] tier: So heres a nice ego boost for you Ruby lovers. After 6 months of C++ programming I wrote my encryption program i wrote it in 454 lines. After taking a 9 hour tutorial on Ruby I wrote it in 300 lines.
[11:12:53] tier: C++ took 16.341 seconds to encrypt 10KB of information. Ruby took 2.265 seconds
[11:13:38] janebootydoe: has joined #ruby
[11:16:00] Fernando-Basso: has joined #ruby
[11:16:33] tier: Sorry for the butchered english. Its 4am here
[11:18:23] hk238: has joined #ruby
[11:19:19] nowhere_man: has joined #ruby
[11:20:21] i5pranay: has joined #ruby
[11:21:50] tristanp: has joined #ruby
[11:22:21] i5pranay: hi everyone
[11:22:35] i5pranay: i am facing problem in installing rvm on ubuntu
[11:22:50] GodFather: has joined #ruby
[11:24:07] skade: has joined #ruby
[11:24:12] tristanp_: has joined #ruby
[11:25:12] Ropeney: has joined #ruby
[11:25:56] emilkarl: has joined #ruby
[11:26:06] GodFather: has joined #ruby
[11:26:08] norc: i5pranay: Take a look at the link behind "Ask good questions" in the topic.
[11:26:54] norc: And regarding tie_'s message.. Im not sure whether that speaks for Ruby or his C++ skills...
[11:27:18] Caerus: specially since he probably wasn't using jruby
[11:28:57] k3rn31: has joined #ruby
[11:29:56] terlar: has joined #ruby
[11:30:42] i5pranay: i am using command :\curl -sSL https://get.rvm.io | bash -s stable --ruby
[11:30:48] i5pranay: but i keep getting error
[11:31:03] i5pranay: :error:GPG signature verification failed for '/home/pranay/.rvm/archives/rvm-1.27.0.tgz' - 'https://github.com/rvm/rvm/releases/ download/1.27.0/1.27.0.tar.gz.asc'! try downloading the signatures: gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
[11:31:19] i5pranay: i tried running gpg2
[11:31:30] i5pranay: still wont fix
[11:31:59] i5pranay: also tried :curl -#LO https://rvm.io/mpapis.asc gpg --import mpapis.asc error:gpg: can't open `/home/pranay/.gnupg/pubring.gpg' gpg: keydb_get_keyblock failed: eof gpg: no writable keyring found: eof gpg: error reading `mpapis.asc': general error gpg: import from `mpapis.asc' failed: general error gpg: Total number processed: 0
[11:32:13] tier: has joined #ruby
[11:33:13] tier: norc: I do need to say that I wrote my encryption in C++ to be memory efficient so granted it should be a little slower. But not 7 times slower.
[11:33:56] sergey_makagon: has joined #ruby
[11:34:18] norc: tie_: Have you profiled your code?
[11:35:04] norc: tie_: In the end Ruby cannot possibly be more efficient than a clean C or C++ implementation, for the simple reason that Ruby has lots of overhead to implement the VM.
[11:35:24] norc: That isn't to say Ruby is inherently slow, but it just means your C++ implementation sucks.
[11:35:40] mikecmpbll: has joined #ruby
[11:36:36] i5pranay: has left #ruby: ()
[11:37:17] tier: Oh, i know. I wrote it a year ago. For encryption, i should have programmed it for speed. But I programmed it for memory (Which is kind of pointless) meaning I put a lot more into some things that I probably shouldnt have.
[11:37:45] tier: But no, I havent profiled it.
[11:37:50] kies: has joined #ruby
[11:38:12] maletor2: has joined #ruby
[11:38:35] ur5us: has joined #ruby
[11:39:05] domgetter: Hopping back between Ruby and a C/C++ library can cost more than doing the whole thing in Ruby
[11:39:17] ldnunes: has joined #ruby
[11:39:26] domgetter: It's best to have a bunch of work for C/C++ to do, and have it do it all at once
[11:39:37] aries_liuxueyang: has joined #ruby
[11:40:09] tier: Im not sure I know what you mean.
[11:40:16] uncertainty: has joined #ruby
[11:40:40] norc: domgetter: Hopping back between Ruby and C incurs no overhead since you can simply call C functions directly.
[11:40:56] GodFather: has joined #ruby
[11:42:43] johnmilton: has joined #ruby
[11:43:39] blackmesa: has joined #ruby
[11:44:14] dn5: has joined #ruby
[11:44:27] joonty: has joined #ruby
[11:44:35] domgetter: norc: I don't think that's true. You have to use FFI or Fiddle to bolt the C functions to a method
[11:44:36] gnufied: has joined #ruby
[11:45:12] mattwashere: has joined #ruby
[11:45:38] norc: domgetter: Essentially you just need to load the object somehow once and map it to a method which is a fairly low one time cost.
[11:46:13] domgetter: Calling the method incurs a cost at the call site, does it not?
[11:46:39] norc: domgetter: Only the same overhead that calling any method does, as you need to invoke Rubys dispatch mechanism.
[11:47:07] norc: C functions are considerably cheaper to call, which is why all of Rubys core is implemented in C functions.
[11:47:24] domgetter: Consider a C function that just does 1 + 1. I submit that using FFI or Fiddle to bolt that to an add_1_and_1 method and then calling that method 10000000 times would take longer than just calling 1 + 1 10000000 times in Ruby
[11:49:52] norc: domgetter: perhaps ffi might suck for this I dont know. But you can just provide a native extension just as easily.
[11:50:14] norc: That last one I promise you will beat any Ruby implementation that cannot be optimized by the Ruby bytecode compiler.
[11:50:29] domgetter: I ahven't tried it with native extensions. It may be the case that the overhead is the same as any other method call
[11:51:18] domgetter: I do agree that if the C function adds 1 + 1 a million times, that *that* will be faster than adding 1 + 1 a million times in Ruby
[11:51:46] panpainter: has joined #ruby
[11:52:00] davedev24: has joined #ruby
[11:54:52] diegoaguilar: has joined #ruby
[11:55:33] maucar: has joined #ruby
[11:56:33] maucar: has joined #ruby
[11:56:44] tristanp: has joined #ruby
[11:56:55] norc: domgetter: There is no overhead to calling a native C function other than what Rubys method dispatch incurs *anyway*.
[11:57:08] norc: As I said - that is the reason why the entire core library is written in C.
[11:57:33] Ropeney: has joined #ruby
[11:58:09] Hanmac: has joined #ruby
[12:01:03] RegulationD: has joined #ruby
[12:02:05] karmatr0n: has joined #ruby
[12:04:46] weckl: has joined #ruby
[12:06:50] GodFather: has joined #ruby
[12:08:38] Caerus: norc, How do you call native c from ruby? I've read and used inline but that was on a 1.8.7 book. Is that still used?
[12:08:42] kgrz: has joined #ruby
[12:09:48] norc: Caerus: No. Either you build a native extension or you use a foreign function interface like Fiddle
[12:10:00] norc: There are some other solutions as well, but those are the common solutions to the problem.
[12:10:05] uncertainty: has joined #ruby
[12:10:22] nfk: has joined #ruby
[12:12:06] chip_: has joined #ruby
[12:12:10] shevy: norc I didn't finish to try yesterday, it was already very late and I was tired
[12:12:13] Caerus: I tried the inline 1 + 1 times 10000000 and ruby did beat c. prolly too much overhead with that gem.
[12:12:20] Hanmac: i prefer building native extensions ... because if done right you might get better Error handling ... also FFI does not work so good when you have C++ stuff
[12:13:07] tristanp_: has joined #ruby
[12:13:56] Alazoral: has joined #ruby
[12:14:17] GinoManWorks: has joined #ruby
[12:14:35] lxsameer: has joined #ruby
[12:14:49] kgrz: has joined #ruby
[12:15:42] synthroid: has joined #ruby
[12:16:02] tristanp: has joined #ruby
[12:16:14] shevy: hanmac is not a big fan of FFI and swig :D
[12:17:00] GodFather: has joined #ruby
[12:17:01] Hanmac: i need to search for the crite but i have seen somewhere that even the creator of swig dont like it
[12:18:23] norc: hanmac: ffi is nice if you want to hack something together real quick.
[12:18:25] blackmesa: has joined #ruby
[12:18:27] norc: But beyond that...
[12:19:08] tristanp_: has joined #ruby
[12:19:55] Hanmac: norc specially if you have seen some of my macros i did use for my wx binding https://github.com/Hanmac/rwx some of them are very funky (like what macro_attr does do)
[12:20:51] Corrosive_: has joined #ruby
[12:21:39] codecop: has joined #ruby
[12:23:17] norc: hanmac: I think you might get less headaches if you provide a C wrapper for Ruby. :o)
[12:23:30] maucar: has joined #ruby
[12:24:29] tristanp: has joined #ruby
[12:25:35] maucar: has joined #ruby
[12:26:47] grios: has joined #ruby
[12:30:18] Kim^J: has left #ruby: ()
[12:33:48] isxek: has joined #ruby
[12:34:47] djcp: has joined #ruby
[12:35:51] mattwashere: has joined #ruby
[12:36:22] nhhc: has joined #ruby
[12:36:44] CausaMortis: has joined #ruby
[12:37:04] fmcgeough: has joined #ruby
[12:39:01] maletor2: has joined #ruby
[12:40:27] pawnbox: has joined #ruby
[12:40:54] jmignault: has joined #ruby
[12:42:33] nankyokusei: has joined #ruby
[12:45:14] jaguarmagenta: has joined #ruby
[12:45:22] deadnull_: has joined #ruby
[12:46:56] chipotle_: has joined #ruby
[12:49:35] karmatr0n: has joined #ruby
[12:49:57] kobain: has joined #ruby
[12:50:53] karmatr0n: has joined #ruby
[12:51:25] hutch34_: has joined #ruby
[12:51:34] karmatr0_: has joined #ruby
[12:52:11] ramfjord: has joined #ruby
[12:53:16] bkxd: has joined #ruby
[12:54:22] nettoweb: has joined #ruby
[12:54:49] ruby-lang142: has joined #ruby
[12:55:40] giz|work: has joined #ruby
[12:55:40] ramortegui: has joined #ruby
[12:56:57] futilegames: has joined #ruby
[12:58:20] minimalism: has joined #ruby
[12:58:22] futilegames: has joined #ruby
[12:58:27] tristanp_: has joined #ruby
[13:00:27] tristanm_: has joined #ruby
[13:02:05] ChiefAlexander: has joined #ruby
[13:02:16] tristanp: has joined #ruby
[13:02:29] nettoweb: has joined #ruby
[13:02:57] allcentury: has joined #ruby
[13:04:12] GodFather: has joined #ruby
[13:04:40] shevy: hanmac likes c++!
[13:04:45] uncertainty: has joined #ruby
[13:05:34] tknz: has joined #ruby
[13:05:55] stardiviner: has joined #ruby
[13:06:26] sepp2k: has joined #ruby
[13:07:03] bkxd: has joined #ruby
[13:09:22] cdg: has joined #ruby
[13:10:34] lightt: has joined #ruby
[13:10:59] lightt: has joined #ruby
[13:11:52] toretore: shevy likes milhouse
[13:11:54] tristanp: has joined #ruby
[13:13:15] panpainter: has joined #ruby
[13:14:47] madgen: has joined #ruby
[13:15:26] hutch34: has joined #ruby
[13:18:54] thejamespinto: has joined #ruby
[13:22:20] anisha: has joined #ruby
[13:22:32] ZeroeSparticus: has joined #ruby
[13:23:12] giz|work: has joined #ruby
[13:26:24] surrounder: has joined #ruby
[13:26:47] aegis3121: has joined #ruby
[13:27:45] felltir: has joined #ruby
[13:27:49] CausaMortis: has joined #ruby
[13:28:20] shevy: is that the dude from the simpsons?
[13:30:31] kareeoleez: has joined #ruby
[13:30:55] lightt: has joined #ruby
[13:31:48] malconis: has joined #ruby
[13:32:18] haxrbyte: has joined #ruby
[13:33:48] duckpuppy: has joined #ruby
[13:35:15] malconis: has joined #ruby
[13:37:03] jrafanie: has joined #ruby
[13:39:35] toretore: shevy: https://www.youtube.com/watch?v=zz9kqzjf68k
[13:39:48] maletor2: has joined #ruby
[13:40:27] eljimmy: has joined #ruby
[13:41:29] tristanp_: has joined #ruby
[13:42:06] ZeroeSparticus: Haha. Poor Millhouse
[13:43:52] eljimmy: has joined #ruby
[13:46:03] k3rn31: has joined #ruby
[13:46:30] mattwashere: has joined #ruby
[13:47:26] CJKinni``: has joined #ruby
[13:47:31] tristanp: has joined #ruby
[13:50:51] idefine: has joined #ruby
[13:51:57] SilverKey: has joined #ruby
[13:52:10] madgen: has joined #ruby
[13:53:53] mattwashere: has joined #ruby
[13:53:58] LithiumZero: has joined #ruby
[13:54:12] JJM: has joined #ruby
[13:54:15] LithiumZero: has left #ruby: ("Leaving")
[13:55:07] tristanp: has joined #ruby
[13:57:58] sami: has joined #ruby
[13:58:04] DanyC: has joined #ruby
[13:59:21] grill: has joined #ruby
[14:01:16] uncertainty: has joined #ruby
[14:01:36] grill: has joined #ruby
[14:01:58] pawnbox: has joined #ruby
[14:02:33] ZeroeSparticus: has joined #ruby
[14:07:13] duderonomy: has joined #ruby
[14:07:27] etehtsea: has joined #ruby
[14:07:39] idefine_: has joined #ruby
[14:07:50] agent_white: has joined #ruby
[14:08:08] kgrz: has joined #ruby
[14:08:18] shevy: coffeescript reads a bit like ruby http://abagames.sakura.ne.jp/html5/iao/main.coffee
[14:08:35] norc: s/ruby/python/
[14:08:51] idefine_: has joined #ruby
[14:08:53] norc: Good afternoon, agent_white.
[14:09:44] flughafen_: has joined #ruby
[14:11:00] weckl: has joined #ruby
[14:12:16] dhollinger: has joined #ruby
[14:17:32] MrBusiness2: has joined #ruby
[14:17:41] kareeoleez: has joined #ruby
[14:18:59] SilverKey: has joined #ruby
[14:22:37] kyrose: has joined #ruby
[14:22:42] giz|work: has joined #ruby
[14:24:17] kyrose: Hi, I'm new to Ruby. Is ruby good for Linux desktop application development? My target is only to Ubuntu or generally Linux system.
[14:24:48] jhass: if we're honest it's not its strongest suit
[14:24:51] norc: kyrose: It wouldn't be my first language because your options for GUI frameworks are limited at best.
[14:25:06] jhass: ruby-gir looks fairly usable/stable though
[14:25:27] norc: jhass: Do you know of any stable qt bindings?
[14:26:08] ChiefAlexander: has joined #ruby
[14:26:14] freerobby: has joined #ruby
[14:26:26] fenre: has joined #ruby
[14:26:30] jhass: kyrose: https://github.com/mvz/gir_ffi-gtk
[14:26:32] kyrose: jhass: so it's a gobject binding library?
[14:27:31] freerobby: has joined #ruby
[14:27:32] kyrose: How about ruby-gtk 2/3? Abandoned project?
[14:28:07] jhass: slow to progress from what I've seen at least, I recommend the gir stuff because it seems actively developed
[14:28:46] jhass: and I think the approach makes them easier to follow upstream
[14:28:58] jhass: opposed to manually binding everything like ruby-gtk tries
[14:29:17] kyrose: norc: but I believe it's good enough for sysadmin and command line application at least? I wanted to port some Python (cli) apps and libraries into ruby, and I hope it scales well.
[14:29:37] jhass: CLI apps work very well for ruby
[14:29:40] sergey_makagon: has joined #ruby
[14:29:41] jhass: vibrant ecosystem there
[14:29:43] chouhoulis: has joined #ruby
[14:30:58] kyrose: jhass: yay, I'm feel happy now. I'm afraid Ruby is moving itself towards 80% of web development. I'm not really into that, however. What I can confirm, Ruby is fun.
[14:31:35] chouhoulis: has joined #ruby
[14:32:03] TomyWork: i like how you can make a functional web service in 4 lines in ruby :)
[14:32:20] frem_: has joined #ruby
[14:32:25] TomyWork: but i haven't used rails yet
[14:32:37] kyrose: TomyWork: wait what? You mean binding into .erb right?
[14:33:04] TomyWork: www.sinatrarb.com <-- those 4 lines :)
[14:33:38] kyrose: Oh! Awesome! I hope heroku supports sinatra.
[14:36:12] kyrose: I also tried to get myself into rails (just curious), but it's painful at beginning.
[14:36:29] jhass: heroku supports anything that starts a HTTP server on $PORT ;)
[14:37:05] kyrose: Yeah! Good to know that!
[14:37:40] idefine: has joined #ruby
[14:38:21] aufi: has joined #ruby
[14:38:27] kyrose: talking about heroku, how do you access the log file in the application anyway? Says, writing a file dynamically whenever visitors visit the website? Is there anyway to get/view the log without requiring the paid addon?
[14:38:48] fedexo: has joined #ruby
[14:38:48] gtsai: has joined #ruby
[14:39:01] eljimmy: has joined #ruby
[14:40:35] maletor2: has joined #ruby
[14:41:25] jhass: heroku logs
[14:42:00] jhass: there's a #heroku btw
[14:42:53] kyrose: Oh yeah, thanks for the reference.
[14:42:57] qinguan: has joined #ruby
[14:43:30] nankyokusei: has joined #ruby
[14:43:37] dionysus69: has joined #ruby
[14:43:49] croberts: has joined #ruby
[14:44:09] poguez_: has joined #ruby
[14:47:13] Yiota: has joined #ruby
[14:47:55] mdw: has joined #ruby
[14:48:22] hutch34_: has joined #ruby
[14:48:48] panpainter: has joined #ruby
[14:49:12] biox: has joined #ruby
[14:51:24] allcentury: has joined #ruby
[14:51:40] triangles2: has joined #ruby
[14:53:33] prestorium: has joined #ruby
[14:54:02] idefine: has joined #ruby
[14:54:23] morenoh149: has joined #ruby
[14:54:59] JakFrist: has joined #ruby
[14:56:37] aredridel: has joined #ruby
[14:57:48] mark_66: has left #ruby: ("PART #RubyOnRails :PART #elixir-lang :PART #crystal-lang :PING 1464706668")
[14:58:16] eGGshke: has joined #ruby
[14:58:50] scepticulous: has joined #ruby
[14:58:56] evidex: has joined #ruby
[14:59:01] ChiefAlexander: has joined #ruby
[15:00:04] jhack: has joined #ruby
[15:01:11] _panpainter: has joined #ruby
[15:01:33] idefine: has joined #ruby
[15:02:09] hutch34_: has joined #ruby
[15:02:22] uncertainty: has joined #ruby
[15:03:21] grill: has joined #ruby
[15:03:33] harrymoreno: has joined #ruby
[15:04:15] gtsai: has joined #ruby
[15:04:32] idefine_: has joined #ruby
[15:05:40] Bugboy1028: has joined #ruby
[15:05:43] gtsai_: has joined #ruby
[15:06:00] TomyLobo: has joined #ruby
[15:06:35] polishdub: has joined #ruby
[15:07:00] shevy: my thoughts are so much faster than my hands :(
[15:07:11] rippa: has joined #ruby
[15:08:41] jhbs: your hands must be slow
[15:09:05] Es0teric: has joined #ruby
[15:10:39] Bugboy1028: has joined #ruby
[15:11:03] jackjackdripper: has joined #ruby
[15:12:18] aegis3121: has joined #ruby
[15:15:00] SilverKey: has joined #ruby
[15:15:19] ywvyeu: has joined #ruby
[15:15:33] shevy: they are!
[15:15:39] Bugboy1028: has joined #ruby
[15:15:59] shevy: I already had lots of thoughts today while walking and traveling via the subway... now I am at home again and implementing things will take hours if not days
[15:15:59] freerobby: has joined #ruby
[15:16:55] snebel: has joined #ruby
[15:18:24] pawnbox_: has joined #ruby
[15:18:51] jhack: has joined #ruby
[15:19:10] snebel: A quick question I have a ruby project (not rails) under lib/ directory all my classes and modules, I'd like to add a method to Array class, where should I place that array.rb file to be correct?
[15:19:26] snebel: in the root of lib?
[15:19:45] snebel: lib/something/arrary.rb ?
[15:20:33] tildes_: has joined #ruby
[15:20:43] vilsonacneto: has joined #ruby
[15:21:11] platzhirsch: has joined #ruby
[15:21:53] Hanmac: snebel: hm lib/core/array.rb does looks good, but imo it might not be the best idea to add things to core classes (hm might need to checkout if there is not an better way)
[15:22:11] arlek: has joined #ruby
[15:22:15] freerobby: has joined #ruby
[15:22:21] Seeq: has joined #ruby
[15:22:28] Hanmac: also checkout Redefinement i didn't used them myself before but they might be better than adding stuff to Array directly
[15:23:05] jhass: snebel: the common convention is lib/gemname/core_ext/array.rb, but ^
[15:23:06] ksmutthu: has joined #ruby
[15:23:30] snebel: Mmmm thanks for the answer, the idea I have at this moment is to create a .to_Myobject method
[15:23:42] snebel: so I can convert arrays of strings to my object structure
[15:23:53] snebel: may be is not the best way
[15:24:00] snebel: of doing this..
[15:24:25] jhass: doesn't sound like it tbh
[15:25:34] snebel: any suggestion on how doing it more compliant, elegant is welcome! :-)
[15:25:47] openstruct: has joined #ruby
[15:28:49] kies: has joined #ruby
[15:29:47] shevy: hmm quick question, just gut feeling - if we have two different very large datasets, may marshalling it be better than storing it into a single yaml file?
[15:29:51] hutch34: has joined #ruby
[15:30:02] shevy: (for reading it lateron)
[15:30:19] craigp: has joined #ruby
[15:30:20] idefine: has joined #ruby
[15:31:00] idefine: has joined #ruby
[15:31:18] ruby-lang142: snebel: may be you wont serialize you object? http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/
[15:31:35] Devalo: has joined #ruby
[15:32:43] snebel: thanks everybody. I'll take a look to all those links and try to figure out in my own how to do it :-)
[15:33:26] kareeoleez: has joined #ruby
[15:33:34] elomatreb: has joined #ruby
[15:34:17] mikecmpbll: has joined #ruby
[15:34:40] rbr: has joined #ruby
[15:35:19] morenoh149: has left #ruby: ("WeeChat 1.4")
[15:35:29] Ropeney: has joined #ruby
[15:38:14] Yiota: has joined #ruby
[15:39:04] Dimik: has joined #ruby
[15:39:42] justapersona: has joined #ruby
[15:39:53] sarbs: has joined #ruby
[15:40:25] wrkrcoop: has joined #ruby
[15:41:19] maletor2: has joined #ruby
[15:43:03] idefine: has joined #ruby
[15:44:29] jhass: shevy: I expect it to be faster and more memory efficient, but just benchmark it?
[15:44:46] moeabdol: has joined #ruby
[15:46:12] flughafen_: has joined #ruby
[15:46:37] felltir: has joined #ruby
[15:46:44] scottschecter: has joined #ruby
[15:46:46] yfeldblum: has joined #ruby
[15:47:37] felltir: has joined #ruby
[15:47:56] yfeldblum: has joined #ruby
[15:49:27] dar123: has joined #ruby
[15:49:33] evidex: has joined #ruby
[15:49:33] RegulationD: has joined #ruby
[15:49:42] diegoaguilar: has joined #ruby
[15:55:28] skolman_: has joined #ruby
[15:58:08] conta: has joined #ruby
[15:58:40] synthroid: has joined #ruby
[16:00:05] dfockler: has joined #ruby
[16:00:09] Cohedrin: has joined #ruby
[16:00:43] c0mrad3: has joined #ruby
[16:00:50] ZeroeSparticus: has joined #ruby
[16:01:33] amclain: has joined #ruby
[16:04:04] aegis3121: has joined #ruby
[16:05:01] Madplatypus: has joined #ruby
[16:05:16] Devalo: has joined #ruby
[16:05:56] senayar: has joined #ruby
[16:06:51] ChiefAlexander: has joined #ruby
[16:06:59] dar123: has joined #ruby
[16:07:24] douglascorrea: has joined #ruby
[16:07:49] etehtsea: has joined #ruby
[16:08:01] douglascorrea: has joined #ruby
[16:08:15] whathappens: has joined #ruby
[16:08:30] blackmesa: has joined #ruby
[16:08:56] Jardayn: has joined #ruby
[16:10:58] shevy: I need me to write a ruby bot that does do these things for me!
[16:11:21] SilverKey: has joined #ruby
[16:12:48] cpup: has joined #ruby
[16:14:26] smathy: has joined #ruby
[16:16:49] uncertainty: has joined #ruby
[16:16:55] rueben_: has joined #ruby
[16:17:36] last_staff: has joined #ruby
[16:17:45] dhollinger: has joined #ruby
[16:19:27] CoderPuppy: has joined #ruby
[16:20:51] smathy: has joined #ruby
[16:21:05] Insty: has joined #ruby
[16:22:35] elifoster: has joined #ruby
[16:23:54] flashpoint9: has joined #ruby
[16:25:09] moei: has joined #ruby
[16:25:54] lxsameer: has joined #ruby
[16:26:07] mtkd: has joined #ruby
[16:27:24] murican: has joined #ruby
[16:28:03] kyrose: Is ruby good for data mining, eg. scraping?
[16:28:16] bougyman: it doesn't suck
[16:29:02] dfockler: kyrose: python has scrapy if you need a full-featured framework
[16:29:29] havenwood: kyrose: yes
[16:29:32] wrkrcoop: when i run OpenSSL::Digest.new('sha1')
[16:29:45] wrkrcoop: in irb, it says uninitialized constant OpenSSL
[16:29:52] wrkrcoop: how do i get access to openssl?
[16:29:53] havenwood: wrkrcoop: require 'openssl'
[16:29:53] adaedra: require it
[16:29:58] mleung: has joined #ruby
[16:30:07] wrkrcoop: havenwood: ty
[16:30:11] wrkrcoop: i forgot the quotes
[16:30:27] pietr0: has joined #ruby
[16:30:34] whathappens: has joined #ruby
[16:30:45] kyrose: oh okay thanks, but I don't wanna use scrapy, I wanted to try it in Ruby. Is there anyway to do simple scraping without importing nokogiri and stuff.
[16:31:49] shevy: hmm wasn't there some stock exchange tool in ruby-gnome that would also sync with external data for that
[16:31:56] dfockler: kyrose: you'll definitely want some sort of HTML parsing library
[16:32:07] dfockler: or XML to be more specific
[16:32:35] jhass: HTML != XML
[16:32:41] kyrose: Ruby have that? If not, I have to manually rewirte the http library I guess for this task.
[16:32:52] kareeoleez: has joined #ruby
[16:33:03] jhass: kyrose: have a look at the mechanize gem
[16:34:53] RobertBirnie: has joined #ruby
[16:35:06] kyrose: thanks jhass
[16:35:12] Coldblackice: has joined #ruby
[16:35:21] skolman_: has joined #ruby
[16:36:42] shevy: mechanize depends on nokogiri :)
[16:37:07] al2o3-cr: shevy: isn't that the other way round?
[16:37:39] dfockler: that's right, mechanize uses nokogiri
[16:37:43] SCHAAP137: has joined #ruby
[16:37:57] anisha: has joined #ruby
[16:38:00] al2o3-cr: ah, maybe not
[16:38:33] shevy: al2o3-cr nah, I remember a long time ago that there was a change in mechanize. back then nokogiri was added, and it failed to compile for me (must be like 5 years ago or even longer than that now)
[16:38:54] ico: has joined #ruby
[16:40:09] hutch34_: has joined #ruby
[16:41:07] al2o3-cr: shevy: have you used it since?
[16:41:50] shevy: al2o3-cr hehehe
[16:42:05] shevy: I mean, I need something like mechanize
[16:42:07] maletor2: has joined #ruby
[16:42:24] shevy: but failing to get it to run wasn't a lot of fun
[16:42:26] havenwood: kyrose: https://www.ruby-toolbox.com/categories/Web_Content_Scrapers
[16:42:51] babblebre: has joined #ruby
[16:42:52] shevy: I will eventually need some way to simulate me clicking on buttons (after login) when I am not awake
[16:42:55] havenwood: kyrose: https://github.com/postmodern/spidr#readme
[16:43:08] al2o3-cr: the only time i ever used it, was making a script to change channels on the router :)
[16:44:00] ramfjord: has joined #ruby
[16:44:17] nankyokusei: has joined #ruby
[16:44:30] senayar: has joined #ruby
[16:44:51] Gasher: has joined #ruby
[16:46:27] hutch34: has joined #ruby
[16:46:39] kyrose889: has joined #ruby
[16:47:06] JesseH2: has joined #ruby
[16:47:17] shinnya: has joined #ruby
[16:48:23] hutch34__: has joined #ruby
[16:49:45] uncertainty: has joined #ruby
[16:49:47] mikecmpbll: has joined #ruby
[16:51:03] tjt263: has joined #ruby
[16:51:07] kareeoleez: has joined #ruby
[16:52:05] SilverKey: has joined #ruby
[16:52:15] tjt263: any ideas on how to resolve this?
[16:52:16] tjt263: http://sprunge.us/jOSE
[16:52:16] tjt263: i dont really speak ruby
[16:53:33] toretore: tjt263: need more context
[16:55:28] maletor2: has joined #ruby
[16:57:21] tjt263: you can ask me anything you like about it toretore, im not sure what additional information i can give you right off the bat
[16:57:44] binaryplease1: has joined #ruby
[16:58:16] cpup: has joined #ruby
[16:58:40] SilverKey: has joined #ruby
[16:58:49] jhass: ?metasploit
[16:58:49] ruby[bot]: Please join #metasploit for help with it.
[16:58:56] tjt263: like; im not sure whats useful info regarding this
[16:59:27] jackjackdripper: has joined #ruby
[17:00:11] tjt263: jhass: yeah i was there first
[17:00:42] jackjackdripper: has joined #ruby
[17:01:43] tjt263: before i came to you guys
[17:03:28] SilverKey: has joined #ruby
[17:04:37] aegis3121: has joined #ruby
[17:04:50] wrkrcoop: getting this error: Could not find gem 'manticore' in any of the gem sources listed in your Gemfile or available on this machine.
[17:04:57] elomatreb: tjt263: That #engines method appears to have been deprecated in Rails 3.0.9?
[17:05:08] wrkrcoop: but manticore is on rubygems, and all other gems are getting downloaded
[17:05:43] jhass: wrkrcoop: all releases have platform: java
[17:05:54] jhass: https://rubygems.org/gems/manticore/versions
[17:05:55] wrkrcoop: jhass: what does that mean?
[17:05:57] skade: has joined #ruby
[17:05:59] jhass: jruby only
[17:06:09] wrkrcoop: oh ok. im using jruby
[17:06:20] elomatreb: wrkrcoop: Is it in your Gemfile.lock?
[17:06:20] jhass: sure your bundler does too?
[17:06:31] wrkrcoop: jhass: idk about the bundler ...
[17:06:37] wrkrcoop: elomatreb: mmm what does that mean?
[17:06:40] jhass: bundle exec ruby -v ?
[17:07:03] jhass: or head -n1 $(which bundle)
[17:07:13] elomatreb: In a terminal: cat Gemfile.lock | grep manticore
[17:07:14] wrkrcoop: bundle exec ruby -v doesn’t output anything
[17:07:23] jhass: it should :o
[17:07:25] elomatreb: Are you using RVM?
[17:07:30] wrkrcoop: : bundle exec ruby -v nvm
[17:07:31] wrkrcoop: jruby 9.0.0.0 (2.2.2) 2016-05-10 e10ec96 Java HotSpot(TM) 64-Bit Server VM 25.91-b14 on 1.8.0_91-b14 +jit [darwin-x86_64]
[17:07:43] jhass: what about the former?
[17:07:54] skade: has joined #ruby
[17:08:03] wrkrcoop: sorry bundle exec ruby -v worked
[17:08:15] jhass: er, latter I mean
[17:08:26] Jardayn_two: has joined #ruby
[17:08:28] wrkrcoop: #!/usr/bin/env jruby_executable_hooks
[17:08:40] jhass: maybe try your luck in #jruby
[17:09:11] kareeoleez: has joined #ruby
[17:09:23] tristanp: has joined #ruby
[17:10:00] wrkrcoop: i switched to ruby, ran bundle install, then switched to jruby and ran bundle install .. and it worked
[17:10:04] wrkrcoop: dont know why but :D
[17:12:24] nanoz: has joined #ruby
[17:12:24] nanoz: has joined #ruby
[17:13:36] idefine: has joined #ruby
[17:14:45] djbkd: has joined #ruby
[17:14:55] ZeroeSparticus: has joined #ruby
[17:16:13] spider-mario: has joined #ruby
[17:16:37] jhack: has joined #ruby
[17:16:37] idefine_: has joined #ruby
[17:16:47] ElderFain: has joined #ruby
[17:19:09] kareeoleez: has joined #ruby
[17:20:49] mosh: has joined #ruby
[17:20:59] mdw: has joined #ruby
[17:21:27] wrkrcoop: im supposed to hit an API endpoint, and the documentation says include these in the headers
[17:21:53] wrkrcoop: im using httparty and in an example it has options = {query: {}}
[17:22:12] wrkrcoop: would i put the headers in query? or options = {headers: {}}
[17:23:49] edwinvdgraaf: has joined #ruby
[17:24:16] toretore: https://github.com/jnunemaker/httparty/blob/master/examples/headers_and_user_agents.rb
[17:27:17] skade: has joined #ruby
[17:29:13] wrkrcoop: toretore: thanks :D
[17:29:43] hutch34__: has joined #ruby
[17:29:46] deadnull_: has joined #ruby
[17:29:50] maloik: has joined #ruby
[17:30:20] kareeoleez: has joined #ruby
[17:30:32] chouhoul_: has joined #ruby
[17:31:02] kirun: has joined #ruby
[17:31:49] postmodern: has joined #ruby
[17:32:21] chouhoul_: has joined #ruby
[17:32:22] hahuang65: has joined #ruby
[17:33:26] ixti: has joined #ruby
[17:33:43] mikecmpbll: has joined #ruby
[17:33:50] skolman_: has joined #ruby
[17:33:54] whathapp_: has joined #ruby
[17:34:29] chouhoulis: has joined #ruby
[17:34:35] gtsai: has joined #ruby
[17:36:02] rcvalle: has joined #ruby
[17:36:08] kgrz: has joined #ruby
[17:37:01] madgen: has joined #ruby
[17:38:18] xsdg: has joined #ruby
[17:40:51] idefine: has joined #ruby
[17:46:11] al2o3-cr: what's the deal with so many http errors when using mechanize?
[17:47:20] uncertainty: has joined #ruby
[17:47:23] sreenivas: has joined #ruby
[17:47:32] wrkrcoop: im creating a module called Utilities
[17:47:42] al2o3-cr: this to be exact: Net::HTTP::Persistent::Error: too many bad responses after 0 requests on 29893700, last used 30.830248182 seconds ago
[17:47:43] wrkrcoop: then i put a method in there called def gen_hmac
[17:47:56] wrkrcoop: and when i called Utilities.gen_hmac it says undefined method …
[17:48:06] al2o3-cr: wrkrcoop: self.def
[17:48:33] MrBusiness3: has joined #ruby
[17:49:16] al2o3-cr: wrkrcoop: or use module_function for best of both worlds :P
[17:49:57] wrkrcoop: module_function?
[17:50:05] d0nn1e: has joined #ruby
[17:50:37] al2o3-cr: &ri Module#module_function
[17:50:37] `derpy: http://ruby-doc.org/core-2.3.0/Module.html#method-i-module_function
[17:50:51] Seeq: has joined #ruby
[17:51:04] al2o3-cr: wrkrcoop: it's how to Math module works
[17:51:16] wrkrcoop: hmmm ok ill look into it
[17:52:14] al2o3-cr: wrkrcoop: btw it's def self.gen_hmac not self.def
[17:52:44] idefine_: has joined #ruby
[17:54:25] nankyokusei: has joined #ruby
[17:54:54] ChiefAlexander: has joined #ruby
[17:56:48] idefine: has joined #ruby
[17:56:58] chouhoul_: has joined #ruby
[17:58:25] skolman_: has joined #ruby
[17:59:08] neanderslob: has joined #ruby
[17:59:11] mac10: has joined #ruby
[17:59:27] MrBusiness2: has joined #ruby
[18:00:11] mac10: hey guys! question about APIS and heroku (for ruby).
[18:00:40] mac10: my weather api works on localhost, however it doesnt seem to work on Heroku. Do i need a specfic gem to get it to work? thanks!
[18:02:04] ruby[bot]: Just ask your question, if anyone has or can, they will respond.
[18:02:13] al2o3-cr: oops ignore
[18:02:38] jtdowney: has joined #ruby
[18:02:38] jtdowney: has joined #ruby
[18:04:08] ramfjord_: has joined #ruby
[18:06:51] nando294021: has joined #ruby
[18:07:21] mac10: how do i get me API to work on Heroku?
[18:07:26] tildes_: has joined #ruby
[18:09:01] havenwood: mac10: A rack app? Which adapter if any?
[18:09:05] havenwood: mac10: Rails?
[18:09:31] mac10: a static sites in ruby with rack
[18:09:34] havenwood: mac10: https://devcenter.heroku.com/articles/rack
[18:10:01] mac10: havenwood: thank you
[18:10:07] nando293921: has joined #ruby
[18:10:11] havenwood: mac10: you're welcome
[18:13:27] jmignault: has joined #ruby
[18:16:22] gtsai: has joined #ruby
[18:17:11] infinitone: has joined #ruby
[18:17:47] darkxploit: has joined #ruby
[18:18:05] jmignault: has joined #ruby
[18:19:17] mac10: havenwood: this doesnt explain the api part, however I found something . can you take a look ? https://github.com/heroku/heroku.rb
[18:19:21] jhack: has joined #ruby
[18:19:37] mac10: havenwood: does require ‘heroku-api’ belong on the config.ru file?
[18:19:58] infinito_: has joined #ruby
[18:20:23] jhack_: has joined #ruby
[18:21:18] ruby-newby: has joined #ruby
[18:21:56] ruby-newby: hey guys - is anyone knowledgable about oauth?
[18:22:14] ruby[bot]: Just ask your question, if anyone has or can, they will respond.
[18:22:30] jhack_: has joined #ruby
[18:24:00] jhack32: has joined #ruby
[18:24:03] ruby-newby: some background: I'm making a twitter app which would require the automatic management of followers, even when the user is not "logged in" to the app via twitter. Once i get an oauth token from twitter for the user, can i use that token to make API requests on their behalf even when they arent logged in?
[18:24:10] edwinvdgraaf: has joined #ruby
[18:24:30] chouhoulis: has joined #ruby
[18:28:39] infinitone: has joined #ruby
[18:29:48] Yiota: has joined #ruby
[18:30:13] havenwood: mac10: I think that gem is outdated. Rack apps should "just work." Heroku has "buildpacks" these days: https://devcenter.heroku.com/articles/buildpacks#officially-supported-buildpacks
[18:30:26] jhass: ruby-newby: yes
[18:30:32] havenwood: mac10: I think there's an unofficial heroku channel around here somewhere.
[18:30:52] mac10: havenwood: yeah i went to #heroku but its quity empty and quiet.
[18:31:06] mac10: all i want to do it make my weather api work on heroku :(
[18:31:11] ruby-newby: jhass: so i can just store the token and use it whenever i need?
[18:31:28] mac10: havenwood: it works on my localhost but not on heroku. im new to api and i cant find an example of it
[18:31:33] jhass: ruby-newby: it expires, so you need to make sure refresh it from time to time, but yes
[18:31:45] futilegames: has joined #ruby
[18:31:52] jhass: ruby-newby: that's why you get two tokens, the access token and the refresh token
[18:31:53] havenwood: mac10: Try the Rack example they give verbatim. Does that work?
[18:32:29] ruby-newby: does the user need to be involved in refreshing of the token (give permission)? or can i just like run some cron task to refresh the tokens of my userbase every week or something
[18:32:34] flashpoint9: has joined #ruby
[18:32:43] jhass: the latter
[18:32:53] jhass: you need the user for initial authentication or when you need new scopes
[18:33:04] havenwood: mac10: Does it deploy but not respond to requests? Are you sure you're hitting it correctly? Gist the config.ru?
[18:33:25] mac10: havenwood: see thats why i’m unsure about. I believe im missing that but i can’t find an example of how to do it
[18:33:43] mac10: my config.ru page doesnt really have anything API in it
[18:33:52] havenwood: mac10: What do the logs show?
[18:33:53] multi_io: has joined #ruby
[18:34:00] mac10: havenwood: I’m trying to find a sample code of putting an api
[18:34:06] havenwood: mac10: Watch them: heroku logs -t
[18:34:25] jmignault: has joined #ruby
[18:34:34] infinitone: anyone know a better alternative than pgadmin for Windows?
[18:34:43] Yiota: has joined #ruby
[18:35:00] mac10: havenwood: what am i looking for in it?
[18:35:36] mac10: havenwood: they only thing i have in config.ru is https://jsfiddle.net/77sosdhr/
[18:35:38] Yiota: has joined #ruby
[18:36:03] havenwood: mac10: Do you see the request being made? What is the response?
[18:36:56] mac10: havenwood: i dont thin so
[18:37:46] uncertainty: has joined #ruby
[18:39:21] jenrzzz: has joined #ruby
[18:39:28] jmignault: has joined #ruby
[18:40:33] chip_: has joined #ruby
[18:42:00] electrostat: has joined #ruby
[18:42:12] hahuang65: has joined #ruby
[18:42:53] Regulati_: has joined #ruby
[18:43:15] sneakerhax: has joined #ruby
[18:44:28] Ishido: has joined #ruby
[18:46:23] mac10: havenwood: ok i think I found something, however I have a question about where to put code in which file
[18:46:47] mac10: havenwood: https://github.com/coderhs/ruby_open_weather_map which file do i put “current weather information API” in ?
[18:47:16] mac10: havenwood: and also “Using the API key” which file do i put these code in
[18:47:39] karapetyan: has joined #ruby
[18:49:44] madgen: has joined #ruby
[18:51:33] last_staff: has joined #ruby
[18:53:05] aswen: has joined #ruby
[18:58:17] A124: has joined #ruby
[18:58:51] Seeq: has joined #ruby
[19:00:37] Yiota: has joined #ruby
[19:01:00] idefine: has joined #ruby
[19:01:18] nton: has joined #ruby
[19:01:18] Yiota: has joined #ruby
[19:02:02] Yiota: has joined #ruby
[19:06:24] last_staff: has joined #ruby
[19:07:47] havenwood: mac10: It works locally? Where are you putting the files locally? How are you testing it? Why no logs of the request
[19:09:49] mac10: havenwood: the only time i used the api is in public/javascript/js file
[19:09:55] BlackHatJack: has joined #ruby
[19:10:00] mac10: havenwood: may i ask where I am suppose to use the API key?
[19:10:10] nadir: has joined #ruby
[19:10:37] idefine: has joined #ruby
[19:10:50] ico: has joined #ruby
[19:10:55] millerti: has joined #ruby
[19:11:01] bluOxigen: has joined #ruby
[19:11:59] havenwood: mac10: So it's not working locally in development?
[19:12:11] havenwood: mac10: The API docs show how to use the API key.
[19:12:22] mac10: havenwood: it doesn’t tell me which file to use it in
[19:12:29] mac10: havenwood: i guess thats where I’m mainly confused about
[19:13:03] havenwood: It seems you know where the API is being called. That's the place.
[19:14:39] zeroDi: has joined #ruby
[19:15:34] aegis3121: has joined #ruby
[19:16:03] havenwood: (Responded by PM since the key is publicly exposed.)
[19:16:40] norc_: Regarding the oauth topic earlier.. people who do not understand oauth in the slightest should not be using it.
[19:17:23] lacrosse: has joined #ruby
[19:17:49] norc_: I mean eventually such people might figure out how to "get it working" but making subtle (or not-so-subtle) mistakes, removing any security you were hoping to gain..
[19:18:59] idefine: has joined #ruby
[19:19:14] daxroc: How would you add whats in one hash to another where keys match ?
[19:20:15] norc_: daxroc, can you be more specific?
[19:20:37] norc_: ("Adding" does not make sense when the keys match)
[19:22:08] daxroc: merge, x = { :a => { :b => "abc" } } ; n = { :a => { :c => "def" } } ; What I want is { :a => { :b => ..., :c => ... } }
[19:23:13] shevy: so something like an inner merge
[19:23:25] |meta: has joined #ruby
[19:23:42] karapetyan: has joined #ruby
[19:24:37] norc_: daxroc, http://apidock.com/rails/v2.3.8/ActiveSupport/CoreExtensions/Hash/DeepMerge/deep_merge
[19:24:57] norc_: Look at the implementation (click Show source)
[19:25:36] felipecvo: has joined #ruby
[19:26:00] replay: has joined #ruby
[19:27:31] sarbs: has joined #ruby
[19:28:32] daxroc: Awesome many thanks
[19:28:52] Vlat-: has joined #ruby
[19:28:57] sarbs: has joined #ruby
[19:29:07] daxroc: Curious why it's not on stdlib Hash ?
[19:29:45] norc_: daxroc, the standard library only contains the functionality that is deemed commonly needed.
[19:29:52] idefine: has joined #ruby
[19:29:55] troulouliou_dev: has joined #ruby
[19:29:59] vikaton: has joined #ruby
[19:30:03] yqt: has joined #ruby
[19:30:11] norc_: daxroc, if you feel this could be useful enough to hand it to the millions of ruby developers out there, feel free to make a feature request on the bug tracker.
[19:31:00] shevy: daxroc you may have been the first one in 5 years who asked for this here quite likely :)
[19:31:27] norc_: Hardly. I see this being asked in here from time to time.
[19:33:00] shevy: when was the last time?
[19:34:58] al2o3-cr: daxroc: x.merge(n) { |k, o, n| o.merge(n) }
[19:36:19] jenrzzz: has joined #ruby
[19:36:19] jenrzzz: has joined #ruby
[19:36:37] tAn: Hola, I'm trying to "run" a script in a string as if it was a file - simple example: `puts Open3.capture3("#!/usr/bin/env ruby\nputs 1\n").inspect`... is that doable at all?
[19:37:05] codecop: has joined #ruby
[19:37:32] al2o3-cr: >> x = { :a => { :b => "abc" } }; n = { :a => { :c => "def" } }; x.merge(n) { |k, o, n| o.merge(n) }
[19:37:33] ruby[bot]: al2o3-cr: # => {:a=>{:b=>"abc", :c=>"def"}} (https://eval.in/580682)
[19:37:36] norc_: shevy, why don't you use the log yourself.
[19:37:48] al2o3-cr: daxroc: if that's what you mean
[19:38:08] norc_: al2o3-cr, oh well. That works if the Hash is only one level deep.. ;-)
[19:38:27] daxroc: Worked :D
[19:38:30] shevy: norc_ you made a claim and you could not back it up
[19:38:44] norc_: shevy, there is a huge difference between not being able to back it up, and not doing the work for you.
[19:38:59] joonty: has joined #ruby
[19:39:07] norc_: shevy, if you want to argue for the sake of it, go spend your time digging through logs to prove me wrong. I have better things to do.
[19:39:10] al2o3-cr: whoa, chill peeps :)
[19:39:10] shevy: norc_ ok so allow me to reply - your statement is incorrect
[19:40:59] _djbkd: has joined #ruby
[19:42:08] idefine: has joined #ruby
[19:43:09] wrkrcoop: whats the best way to turn xml into json?
[19:43:34] ramfjord: has joined #ruby
[19:43:35] dmr8: has joined #ruby
[19:45:08] norc_: wrkrcoop, using code.
[19:45:57] norc_: wrkrcoop, xml is a markup language, json is javascript object notation. They are not the same or even similar enough to consider a generalized transformation from one into the other.
[19:45:58] xpt: just rename file noone will see the difference
[19:46:19] wrkrcoop: im getting xml and trying to interact with it
[19:46:33] hxegon: wrkrcoop: listen to xpt, that is industry standard
[19:46:45] hxegon: but for real tho, wrkrcoop http://www.nokogiri.org/tutorials/parsing_an_html_xml_document.html
[19:47:00] wrkrcoop: hxegon: ah good idea … i used crack.
[19:47:08] wrkrcoop: do u think nokogiri is better .. ?
[19:47:25] mleung: has joined #ruby
[19:47:26] hxegon: I mean that's one coping strategy for dealing with xml
[19:47:39] norc_: wrkrcoop, nokogiri is the most popular choice in that domain.
[19:47:40] hxegon: wrkrcoop: not experienced enough to say
[19:47:46] xpt: oh, i just realised that it's not #ruby-offtopic sorry
[19:47:46] norc_: Whether it is better depends on your goals.
[19:47:52] hxegon: wrkrcoop: but yeah, what norc_ said
[19:49:45] SCHAAP137: has joined #ruby
[19:51:34] millerti: has joined #ruby
[19:52:01] tildes_: has joined #ruby
[19:59:09] yqt: has joined #ruby
[20:02:42] postmodern: has joined #ruby
[20:05:44] AlexRussia: has joined #ruby
[20:06:19] futilegames: has joined #ruby
[20:07:46] Devalo: has joined #ruby
[20:08:29] mdw: has joined #ruby
[20:09:52] sepp2k: has joined #ruby
[20:11:43] ferr: has joined #ruby
[20:12:12] djbkd: has joined #ruby
[20:13:36] GodFather: has joined #ruby
[20:15:16] millerti: has joined #ruby
[20:15:59] wrkrcoop: has joined #ruby
[20:17:02] tvw: has joined #ruby
[20:17:18] idefine: has joined #ruby
[20:19:08] bmbouter: has joined #ruby
[20:19:29] bmbouter: I'm a Python dev getting into Ruby, what is the Ruby equivalent to Python's virtualenv?
[20:19:43] bmbouter: I want to contain and isolate a single gem that is available
[20:19:48] jaiks: has joined #ruby
[20:19:51] norc_: bmbouter, bundler.
[20:20:27] jhack: has joined #ruby
[20:22:17] marr: has joined #ruby
[20:24:39] jhack: has joined #ruby
[20:25:38] djbkd: has joined #ruby
[20:26:16] idefine: has joined #ruby
[20:26:53] idefine: has joined #ruby
[20:28:21] ChiefAlexander: has joined #ruby
[20:28:40] blackgoat: has joined #ruby
[20:29:48] bmbouter: norc_: thanks
[20:30:00] darkxploit: has joined #ruby
[20:30:58] SilverKey: has joined #ruby
[20:31:10] norc_: bmbouter, https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-python/
[20:31:13] norc_: might be of interest to you.
[20:31:30] jaiks: has joined #ruby
[20:31:31] lightt: has joined #ruby
[20:31:33] bmbouter: norc_: it is and thanks
[20:31:36] bmbouter: ACTION reads
[20:37:35] jnoob22: has joined #ruby
[20:41:25] chouhoul_: has joined #ruby
[20:44:57] daxroc: Can you dump all data from erb binding in the template ?
[20:45:17] wrkrcoop: has joined #ruby
[20:46:03] bmbouter: has left #ruby: ("WeeChat 1.2")
[20:48:03] MrBusiness3: has joined #ruby
[20:52:09] arooni: has joined #ruby
[20:52:30] MrBusiness2: has joined #ruby
[20:53:21] ramfjord: has joined #ruby
[20:53:44] millerti: has joined #ruby
[20:54:22] jhass: daxroc: try local_variables.zip(local_variables.map(&binding.method(:local_variable_get))).to_h
[20:54:54] havenwood: >> local_variables.zip(local_variables.map(&binding.method(:local_variable_get))).to_h
[20:54:55] ruby[bot]: havenwood: # => {} (https://eval.in/580783)
[20:55:16] art-solopov: has joined #ruby
[20:56:58] RegulationD: has joined #ruby
[21:00:50] electrostat: has joined #ruby
[21:02:06] fenre: has joined #ruby
[21:03:26] blackmesa: has joined #ruby
[21:03:59] al2o3-cr: has joined #ruby
[21:05:01] zapata: has joined #ruby
[21:05:46] ur5us: has joined #ruby
[21:07:41] eljimmy: has joined #ruby
[21:10:42] edavis: has joined #ruby
[21:11:35] whathappens: has joined #ruby
[21:12:13] xdexter: has joined #ruby
[21:12:33] xdexter: Hello, i have this error "`check_options': unrecognized option: read_timeout (ArgumentError)" someone help me please? (http://pastebin.com/bJaC0Qd0)
[21:12:34] ruby[bot]: xdexter: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/80c8987986debe2b7a8f7bad910f2c9a
[21:12:34] ruby[bot]: xdexter: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[21:12:42] Laos: has joined #ruby
[21:14:22] smathy: has joined #ruby
[21:16:36] GBrawl: has joined #ruby
[21:17:39] jhass: xdexter: stdlib uri doesn't even have a URI#read, but it's pretty clear that wherever it's coming from doesn't take that option
[21:17:47] arlek: has joined #ruby
[21:18:12] babblebre: has joined #ruby
[21:19:17] Devalo: has joined #ruby
[21:20:18] xdexter: jhass, hm, if i paste the full script is easier to you help me?
[21:22:01] jhass: perhaps, tbh your globals use makes me a little afraid of the full thing
[21:22:06] bobbycvi: has joined #ruby
[21:23:57] xdexter: jhass, ok, http://pastebin.com/CDuHBPj4
[21:23:57] ruby[bot]: xdexter: as I told you already, please use https://gist.github.com
[21:24:07] xdexter: sorry sorry
[21:24:37] xdexter: https://gist.github.com/xdexter/44bd67f898bc76acf0f2a36a50cfa698
[21:25:54] workmad3: has joined #ruby
[21:26:55] aeterne: has joined #ruby
[21:27:25] whathapp_: has joined #ruby
[21:27:47] jhass: oh, open-uri defines that? interesting
[21:28:19] xdexter: jhass, sorry, i don't know
[21:28:30] wrkrcoop: has joined #ruby
[21:28:55] xdexter: This is a monitoring script to zabbix, was not I who have developed, I'm just using.
[21:29:12] djbkd: has joined #ruby
[21:29:13] tax: has joined #ruby
[21:29:28] Laos: has joined #ruby
[21:30:43] jhass: xdexter: what's your ruby version?
[21:31:08] xdexter: ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
[21:31:29] BackEndCoder: has joined #ruby
[21:31:33] lightt: has joined #ruby
[21:32:37] jhass: can you gist the full error output?
[21:33:06] jhack: has joined #ruby
[21:33:20] xdexter: https://gist.github.com/xdexter/3f6425976b20d7ad1f02bf9edc1310f1
[21:33:47] jhass: you're using Ruby 1.8, not 2.1 there
[21:34:07] jhass: the option was added in 1.9 from the looks of it
[21:34:32] xdexter: hmm, but why?
[21:34:36] xdexter: RVM: =* ruby-2.1.5 [ x86_64 ]
[21:34:41] wrkrcoop: has joined #ruby
[21:34:44] xdexter: [root@puppet suporte]# ruby -v
[21:34:44] xdexter: ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
[21:35:08] jhass: i don't know
[21:35:14] jhass: and would defer that question to #zabbix
[21:35:20] jhass: or #puppet apparently
[21:36:04] xdexter: is there any way I can force the use of a version in ruby?
[21:36:10] skolman_: has joined #ruby
[21:36:12] ChiefAlexander: has joined #ruby
[21:36:36] xdexter: hmm, understand now
[21:40:08] johnmilton: has joined #ruby
[21:40:28] whiteline: has joined #ruby
[21:43:07] tvw: has joined #ruby
[21:51:02] Azure: has joined #ruby
[21:51:29] skade: has joined #ruby
[21:53:38] electrostat: has joined #ruby
[21:55:13] edwinvdgraaf: has joined #ruby
[21:55:22] whiteline: has joined #ruby
[21:55:38] sid_fules: has joined #ruby
[21:55:57] matp: has joined #ruby
[21:59:04] solars: has joined #ruby
[21:59:38] meatflaps: has joined #ruby
[22:01:34] mac10: has joined #ruby
[22:02:18] SilverKey: has joined #ruby
[22:02:44] skweek: has joined #ruby
[22:04:49] ocbtec: has joined #ruby
[22:05:29] der-landgraf: has joined #ruby
[22:07:01] firstdayonthejob: has joined #ruby
[22:07:55] deweydb: has joined #ruby
[22:07:56] jancel: has joined #ruby
[22:08:07] deweydb: can anyone tell me what my dumbass is doing wrong here?
[22:08:08] deweydb: http://termbin.com/dfop
[22:09:24] aegis3121: I imagine we'd need to see at least some portion of your script.
[22:09:45] deweydb: not my script
[22:09:45] deweydb: https://github.com/wpscanteam/wpscan
[22:10:19] deweydb: but what i mean is, why is it saying i've got ruby 1.9.3 when rvm list says 2.3.1
[22:11:38] skade: has joined #ruby
[22:12:57] aegis3121: It's probably defaulting to your system ruby.
[22:12:59] infinitone: has joined #ruby
[22:13:10] sid_fules: has joined #ruby
[22:13:15] diegoviola: has joined #ruby
[22:13:16] aegis3121: meaning: when you run the script, the system uses its ruby vs what you're telling it to use via rvm
[22:14:11] electrostat: has joined #ruby
[22:14:12] havenwood: deweydb: try without any `sudo`s
[22:14:29] havenwood: deweydb: or if you must, replace `sudo` with `rvmsudo` so your env is preserved
[22:14:30] diegoaguilar: has joined #ruby
[22:14:42] madgen: has joined #ruby
[22:15:34] diegoaguilar: has joined #ruby
[22:15:35] jancel: has joined #ruby
[22:16:13] mikecmpbll: memory question: i'm using ruby 2.1 and what (little) i understood of forking processes is that 'copy-on-write' means they share memory? i'm experiencing memory increasing vastly with each fork
[22:16:58] diegoaguilar: has joined #ruby
[22:17:37] mikecmpbll: "Instead of allocating duplicate memory when a process is forked, COW allows multiple processes to share the same memory until one of the processes needs to modify a piece of information."
[22:17:45] diegoaguilar: has joined #ruby
[22:17:46] eam: mikecmpbll: that's correct
[22:17:47] mikecmpbll: i'm not sure what it means by "modify a piece of information"
[22:18:04] eam: memory is separated into pages -- on linux, either 4k, 2m or 1g
[22:18:33] eam: when you fork, the newly forked process has references to the parent's pages. As soon as any modifications to the page occur the page is copied
[22:18:56] diegoaguilar: has joined #ruby
[22:19:11] eam: if you fork and do nothing in the parent or child, no significant memory will be allocated. But if either touch a page, it makes a copy for each
[22:19:59] mikecmpbll: eam : ah .. hm. my process uses about 5GB of memory before forking, the vast majority of which is loaded activerecord objects, do you know of anything in activerecord that causes the memory to be copied? (not yet googled on this angle)
[22:20:08] diegoaguilar: has joined #ruby
[22:20:08] mikecmpbll: i'm not modifying the records.
[22:21:10] diegoaguilar: has joined #ruby
[22:21:18] eam: there's no clear or reliable way to reason about memory pages at the ruby level
[22:21:35] nankyokusei: has joined #ruby
[22:22:41] eam: the most common place where COW is useful is when you fork, then exec, immediately replacing the child process (so you don't make a copy of the parent to immediately throw it away)
[22:23:14] eam: best answer is probably: poke around with /proc and see what your process is doing
[22:24:10] mikecmpbll: eam : thanks for your help! :)
[22:24:27] eam: mikecmpbll: I also wonder how you're measuring memory being used
[22:24:52] mikecmpbll: eam : free -m, and the process crashing because i run out of memory :d
[22:25:20] eam: free isn't going to accurately reflect memory use
[22:25:29] fnodeuser: has joined #ruby
[22:25:46] fnodeuser: hi, how can i make '--js-flags=--expose-gc' work to be able to initiate garbage collection manually from the console? i'm using the latest stable chrome version, entering window.gc() or gc() just makes the console to display 'undefined'
[22:26:08] eam: mikecmpbll: take a look at the
[22:26:17] eam: "smaps" file in https://www.kernel.org/doc/Documentation/filesystems/proc.txt
[22:28:05] electrostat: has joined #ruby
[22:28:50] palms: has joined #ruby
[22:29:46] mikecmpbll: eam : thanks for the link. what's the reason free won't be accurate?
[22:30:03] palms: has left #ruby: ()
[22:31:01] lightt: has joined #ruby
[22:32:34] arooni: has joined #ruby
[22:39:30] Yiota: has joined #ruby
[22:40:25] marxarelli: has joined #ruby
[22:40:54] Parko: has joined #ruby
[22:40:56] water: has joined #ruby
[22:46:56] micahf: has joined #ruby
[22:47:20] ZeroeSparticus_: has joined #ruby
[22:47:53] xpt: has joined #ruby
[22:48:44] tinhajj: If I've required a gem in a gemspec using add_runtime_dependency such as nokogiri I wouldn't need to do require 'nokogiri' in my files right?
[22:49:12] pipework: tinhajj: of course you would.
[22:49:24] pipework: you should, too!
[22:49:53] tinhajj: alright interesting something on rubygems doc is confusing me then 1 sec
[22:51:03] m_antis: has joined #ruby
[22:52:09] jancel: has joined #ruby
[22:52:10] tinhajj: alright so right here is what maybe tripped me up: http://guides.rubygems.org/patterns/#dont-use-gem-from-within-your-gem
[22:53:04] tinhajj: it says use gemspec to handle dependencies so I just assumed the dependency took care of requiring the gem, but thats not the case then? gemspec will only take care of versioning and the documentation is just saying that versioning should be in the gemspec
[22:53:13] tinhajj: does that sound right?
[22:53:39] hxegon: I think it's saying don't use a gemfile except to require the .gemspec, as I've seen that pattern a few times. Could be wrong though tinhajj
[22:55:01] hxegon: here tinhajj: http://b.j15e.com/ruby/2013/06/28/gemfile-gemspec-explained.html
[22:57:05] tinhajj: tyvm I'll check it out
[22:57:06] CJKinni: has joined #ruby
[22:57:55] rkazak: has joined #ruby
[22:58:11] pipework: tinhajj: It means literally don't use the `gem` method/thing in your gemspec. You can use Bundler and bundler can use `gemspec` inside the Gemfile just fine.
[22:59:22] Seeq: has joined #ruby
[23:00:33] tildes_: has joined #ruby
[23:03:13] RobertBirnie: has joined #ruby
[23:04:16] arlek: has joined #ruby
[23:06:21] solocshaw: has joined #ruby
[23:07:02] ramfjord: has joined #ruby
[23:07:08] electrostat: has joined #ruby
[23:10:40] edavis: has joined #ruby
[23:11:59] millerti: has joined #ruby
[23:14:24] eam: mikecmpbll: /win 3
[23:15:16] eam: mikecmpbll: there are a couple different ways to account for memory, what you see in free comes with a bunch of caveats
[23:15:18] whathappens: has joined #ruby
[23:15:53] eam: if you're trying to show how much memory is shared / not shared between two processes you'll want to look at their mappings in detail
[23:16:48] smathy_: has joined #ruby
[23:20:48] Devalo: has joined #ruby
[23:21:21] maletor3: has joined #ruby
[23:21:56] madgen: has joined #ruby
[23:23:53] Liothen: has joined #ruby
[23:26:11] valkyr1e: has joined #ruby
[23:27:55] Liothen: has joined #ruby
[23:30:54] phredus: has joined #ruby
[23:31:53] bhaak: has joined #ruby
[23:35:51] Seeq: has joined #ruby
[23:36:54] Kus: has joined #ruby
[23:38:23] flashpoint9: has joined #ruby
[23:38:40] diegoaguilar: has joined #ruby
[23:40:28] diegoaguilar: has joined #ruby
[23:41:11] diegoaguilar: has joined #ruby
[23:41:59] diegoaguilar: has joined #ruby
[23:42:27] valkyr1e: has joined #ruby
[23:42:47] diegoaguilar: has joined #ruby
[23:43:22] domgetter: has joined #ruby
[23:43:35] diegoaguilar: has joined #ruby
[23:44:36] diegoaguilar: has joined #ruby
[23:45:18] Vile`: has joined #ruby
[23:45:26] Ropeney: has joined #ruby
[23:47:51] hutch34__: has joined #ruby
[23:48:06] ramfjord_: has joined #ruby
[23:49:51] koooge: has joined #ruby
[23:52:34] throwaway9999999: has left #ruby: ()
[23:54:05] valkyr1e: has joined #ruby
[23:55:25] jancel: has joined #ruby
[23:56:45] sid_fules: has joined #ruby
[23:57:38] y2mq37: has joined #ruby
[23:57:59] justapersona: has joined #ruby
[23:58:10] Ropeney: has joined #ruby
[23:58:17] finisherr: has joined #ruby