« Back to channel list

#ruby - 14 April 2017

« Back 1 day Forward 1 day »
[00:02:03] outreachdan: has joined #ruby
[00:03:54] domgetter: has joined #ruby
[00:08:43] alan_w: has joined #ruby
[00:10:02] Fridtjof: has joined #ruby
[00:11:04] Channel6: has joined #ruby
[00:12:20] pickle_: has joined #ruby
[00:16:38] rakm: has joined #ruby
[00:17:55] ineb: has joined #ruby
[00:18:44] outreachdan: has joined #ruby
[00:27:14] Silthias: has joined #ruby
[00:28:31] rgr_: has joined #ruby
[00:38:08] mim1k: has joined #ruby
[00:39:52] gusrub: has joined #ruby
[00:42:28] gravyflex: has joined #ruby
[00:43:29] Silthias1: has joined #ruby
[00:46:06] esObe: has joined #ruby
[00:47:19] impermanence: has joined #ruby
[00:48:48] duderonomy: has joined #ruby
[00:49:42] outreachdan: has joined #ruby
[00:50:59] mrconfused: has joined #ruby
[00:52:14] mooser: has joined #ruby
[00:56:34] maattdd: has joined #ruby
[01:05:26] juggler: has joined #ruby
[01:10:20] Rodya_: has joined #ruby
[01:14:08] bronson: has joined #ruby
[01:21:34] impermanence: I took this code from a book. And I'm pretty sure it doesn't work because it essentially tries to open a variable (not quite sure if that's the right way to phrase it). Just want to check with the experts before I contact the author:
[01:21:34] impermanence: https://gist.github.com/jonassteinberg1/44ab6b63b584b42d9c26df58c901e26a
[01:22:29] impermanence: It doesn't work for me. Either by script or in irb. But if I write() to it and then open it it works. This is of course only one solution. But either way I'm pretty sure its dead as is.
[01:23:45] esObe: has joined #ruby
[01:24:20] SteenJobs_: has joined #ruby
[01:24:43] impermanence: has joined #ruby
[01:24:52] impermanence: Sorry if this already came thru: I couldn't tell if I was connected or not.
[01:24:59] impermanence: I took this code from a book. And I'm pretty sure it doesn't work because it essentially tries to open a variable (not quite sure if that's the right way to phrase it). Just want to check with the experts before I contact the author:
[01:25:04] impermanence: https://gist.github.com/jonassteinberg1/44ab6b63b584b42d9c26df58c901e26a
[01:25:39] pickle_: has joined #ruby
[01:27:35] lel: has joined #ruby
[01:30:51] karapetyan: has joined #ruby
[01:31:03] cerulean: how do i know if ive written the most advanced twitter/api consumer irc bot
[01:31:05] cerulean: i think i have
[01:31:18] cerulean: it supports 90% of REST features and the LiveStream API
[01:31:27] cerulean: also it can search bing
[01:31:44] joneshf-laptop: has joined #ruby
[01:33:39] mrconfused: has joined #ruby
[01:33:49] ghornet: has joined #ruby
[01:35:49] esObe: has joined #ruby
[01:39:42] cyphase: has joined #ruby
[01:39:52] lel: has joined #ruby
[01:40:14] rakm_: has joined #ruby
[01:49:23] hndk: has joined #ruby
[01:54:10] ryan_notabot: has joined #ruby
[01:55:39] milardovich: has joined #ruby
[01:57:23] bonhoeffer_: has joined #ruby
[01:57:41] maattdd: has joined #ruby
[01:58:36] hutch34_: has joined #ruby
[02:01:55] impermanence: cerulean: will you confirm that this code doesn't work? https://gist.github.com/jonassteinberg1/44ab6b63b584b42d9c26df58c901e26a
[02:02:17] impermanence: cerulean: I know it's trivial for an experienced programmer, but the author is debating me that it does and I can't get it to go.
[02:03:16] impermanence: cerulean: just run the script with some command line positional parameter like myfile.txt
[02:04:07] cerulean: impermanence: that code is fine. are you quoting the path argument?
[02:04:09] cerulean: whats the error
[02:04:30] impermanence: cerulean: hm. maybe that's it? let me check.
[02:04:44] cerulean: ARGV seperates by spaces
[02:04:47] pickle_: has joined #ruby
[02:05:13] impermanence: cerulean: hm. nope can't get it. I'll post exactly what I'm entering at the CLI.
[02:05:29] cerulean: when you run the script like this
[02:05:36] cerulean: ruby script.rb <path>
[02:05:42] cerulean: ARGV.first is script.rb
[02:05:44] cerulean: and not <path>
[02:06:49] impermanence: cerulean: this is copy and pasted directly from the author's text. this is how his book says to run it: ruby ex15.rb ex15_sample.txt
[02:06:52] impermanence: now here's my gist
[02:06:59] impermanence: https://gist.github.com/jonassteinberg1/c7fa54bef2c5ea432e3fd27d06ee3e26
[02:07:49] havenwood: you can have more than one file per gist, it makes it easier to look at the whole picture
[02:07:52] cerulean: it can't find the file because you need to provide the full path
[02:08:08] cerulean: simply provide the full path to the file when you run it
[02:08:28] cerulean: /Home/impermanence/development/personal/git/ruby/io/ext15_sample.txt
[02:08:48] impermanence: cerulean: yep. will do.
[02:09:11] impermanence: cerulean: same.
[02:09:23] cerulean: check that the path is correct
[02:09:26] cerulean: open /Home/impermanence/development/personal/git/ruby/io/ext15_sample.txt
[02:09:38] cerulean: if it opens the text file, the path is correct
[02:09:48] impermanence: ext15_sample.txt doesn't exist. maybe his instructions say to create it.
[02:10:19] cerulean: you can't open a file that doesn't exist unless you use +w and maybe +a flags when you open it i think
[02:10:39] impermanence: cerulean: I don't think his instructions say to create the file first.
[02:10:55] cerulean: a - Append to a file.The file is created if it does not exist.
[02:11:05] cerulean: you were lied to
[02:11:09] cerulean: you can't open a nonexist file
[02:11:12] cerulean: sorry just can't
[02:11:16] cerulean: unless you use a or a+ modes
[02:11:17] Jameser: has joined #ruby
[02:11:19] cerulean: which will create it
[02:11:35] cerulean: create it with touch ex15_sample.txt
[02:11:58] impermanence: that was the problem. I didn't read his instructions carefully enough. He implies that you need to write the file first, write some stuff to it and then work with his code.
[02:12:04] cerulean: touch is an old unix command which lets you create an empty unix file
[02:12:10] cerulean: since that program tries to output
[02:12:11] cerulean: you might wanna
[02:12:22] cerulean: echo "stuff" >> ex15_sample.txt
[02:12:27] cerulean: so you see something when you run it
[02:13:29] cerulean: if you're feeling real adventurous go here http://stackoverflow.com/questions/7911669/create-file-in-ruby and learn how to use ruby to write to the file and create if necessary
[02:14:36] impermanence: cerulean: I think that was the problem. I often just read what he says once and then go to the ruby core and stdlib docs because I'm comfortable doing that.
[02:15:02] impermanence: cerulean: so I always end up writing my own code which almost always doesn't follow his logic (I learn it better that way.)
[02:15:02] cerulean: thats good, dont miss out on stack. authors make mistakes
[02:15:08] cerulean: always google the error message
[02:15:11] impermanence: cerulean: totally.
[02:15:26] cerulean: always better to write your own code
[02:15:28] impermanence: cerulean: yeah so I've been using fileutils and kernel and etc. etc.
[02:15:36] cerulean: dont be like an english teacher who cant speak good english
[02:15:50] cerulean: use it up, ruby is the best tool
[02:16:10] impermanence: cerulean: to his credit he got back to me and was patient. he was not a dick.
[02:16:14] andrewvee: has joined #ruby
[02:18:44] impermanence: thanks for the second set of eyes. always a help.
[02:19:00] Nilium: ACTION wishes he had more eyes
[02:20:30] genpaku: has joined #ruby
[02:22:02] jaequery: has joined #ruby
[02:23:37] cerulean: ive used ruby since 2010
[02:23:53] zipkid: has joined #ruby
[02:26:03] chichou: has joined #ruby
[02:26:10] ghornet: has joined #ruby
[02:26:17] Channel6: has joined #ruby
[02:29:09] pickle_: has joined #ruby
[02:35:30] hutch34_: has joined #ruby
[02:38:35] mim1k: has joined #ruby
[02:39:04] pickle__: has joined #ruby
[02:39:13] JeanCarloMachado: has joined #ruby
[02:42:56] spicerack: has joined #ruby
[02:43:17] jetpackjoe: has joined #ruby
[02:46:36] MicaFox[m]: has left #ruby: ("User left")
[02:50:39] maattdd: has joined #ruby
[02:51:56] sleetdrop: has joined #ruby
[02:53:45] charliesome: has joined #ruby
[02:54:19] sleetdrop: has joined #ruby
[02:55:52] toretore: has joined #ruby
[02:56:18] jane_booty_doe: has joined #ruby
[02:57:44] maattdd: has joined #ruby
[03:01:02] AlexRussia: has joined #ruby
[03:06:50] gravyflex: has joined #ruby
[03:08:39] mrconfused: has joined #ruby
[03:09:59] GodFather: has joined #ruby
[03:12:35] AlexRussia: has joined #ruby
[03:14:20] ahrs: has joined #ruby
[03:20:32] Jayson_Virissimo: has joined #ruby
[03:21:04] impermanence: has joined #ruby
[03:21:12] enterprisey: has joined #ruby
[03:21:18] gottcha: has joined #ruby
[03:25:29] BSab: has joined #ruby
[03:25:29] AnoHito: has joined #ruby
[03:25:34] Silthias: has joined #ruby
[03:28:26] Trynemjoel: has joined #ruby
[03:30:28] gix: has joined #ruby
[03:39:52] esObe: has joined #ruby
[03:43:44] hinbody: has joined #ruby
[03:45:42] AlexRussia: has joined #ruby
[03:46:53] impermanence: has joined #ruby
[03:46:55] impermanence: has left #ruby: ()
[03:48:09] mooser: has joined #ruby
[03:49:45] maattdd: has joined #ruby
[03:52:55] AlexRussia: has joined #ruby
[03:59:19] esObe: has joined #ruby
[03:59:49] maattdd: has joined #ruby
[04:02:13] enterprisey: has joined #ruby
[04:04:57] gix: has joined #ruby
[04:05:05] wkoszek: has joined #ruby
[04:09:56] pickle__: has joined #ruby
[04:17:52] astrobunny: has joined #ruby
[04:19:09] rakm: has joined #ruby
[04:28:13] raul782: has joined #ruby
[04:29:25] milardovich: has joined #ruby
[04:35:33] renchan: has joined #ruby
[04:37:34] hutch34_: has joined #ruby
[04:39:04] mim1k: has joined #ruby
[04:41:03] esObe: has joined #ruby
[04:43:34] charliesome: has joined #ruby
[04:44:01] bkxd: has joined #ruby
[04:46:08] Silthias: has joined #ruby
[04:56:57] ejnahc: has joined #ruby
[04:57:09] jetpackjoe: has left #ruby: ()
[04:57:47] maattdd: has joined #ruby
[05:03:48] gusrub: has joined #ruby
[05:07:42] Bock: has joined #ruby
[05:12:45] __Yiota: has joined #ruby
[05:15:08] gusrub: has joined #ruby
[05:16:44] Pumukel: has joined #ruby
[05:16:54] mooser: has joined #ruby
[05:19:53] PorcoRex: has joined #ruby
[05:20:01] PorcoRex: Good evening!
[05:20:53] havenwood: >> alias g p; g'eve'
[05:20:54] ruby[bot]: havenwood: # => "eve" ...check link for more (https://eval.in/776348)
[05:26:29] Silthias: has joined #ruby
[05:29:09] ericmathison: has joined #ruby
[05:33:06] gusrub: has joined #ruby
[05:35:41] minimalism: has joined #ruby
[05:37:59] mim1k: has joined #ruby
[05:43:45] BTRE: has joined #ruby
[05:48:30] Cohedrin: has joined #ruby
[05:49:33] gusrub: has joined #ruby
[05:51:47] JeanCarloMachado: has joined #ruby
[06:00:58] StoneCypher: has joined #ruby
[06:05:33] esObe: has joined #ruby
[06:06:19] haraoka: has joined #ruby
[06:09:29] cfec0b8d: has joined #ruby
[06:11:04] gusrub: has joined #ruby
[06:11:53] jaequery: has joined #ruby
[06:17:36] muelleme_: has joined #ruby
[06:27:16] AlexRussia: has joined #ruby
[06:27:22] patarr: has joined #ruby
[06:27:28] chichou: has joined #ruby
[06:28:44] howdoi: has joined #ruby
[06:38:50] hutch34_: has joined #ruby
[06:41:39] Silthias1: has joined #ruby
[06:53:44] ericmathison: has joined #ruby
[06:54:08] Guest96: has joined #ruby
[07:05:44] Paradox: has joined #ruby
[07:05:59] astrobunny: has joined #ruby
[07:06:46] twistedpixels_: has joined #ruby
[07:08:51] mooser: has joined #ruby
[07:08:51] surrounder: has joined #ruby
[07:09:00] djbkd_: has joined #ruby
[07:10:49] jgnagy: has joined #ruby
[07:11:43] AlexRussia: has joined #ruby
[07:12:02] jaequery: has joined #ruby
[07:16:11] burgestrand: has joined #ruby
[07:19:43] Pacco: has joined #ruby
[07:21:43] jaequery: has joined #ruby
[07:22:07] Pacco: has left #ruby: ()
[07:25:08] Pacco: has joined #ruby
[07:25:13] Pacco: has left #ruby: ("Be back later...")
[07:25:19] AnoHito: has joined #ruby
[07:27:24] AnoHito: has joined #ruby
[07:28:29] mark_66: has joined #ruby
[07:34:09] Pacco: has joined #ruby
[07:41:16] mint: has joined #ruby
[07:47:29] AlexRussia: has joined #ruby
[07:48:49] rgtk: has joined #ruby
[07:50:11] jaequery: has joined #ruby
[07:57:01] esObe: has joined #ruby
[07:59:17] xall: has joined #ruby
[08:01:34] StoneCypher: has joined #ruby
[08:05:55] User458764: has joined #ruby
[08:13:22] Silthias: has joined #ruby
[08:14:39] mint: has joined #ruby
[08:15:49] claw: has joined #ruby
[08:20:36] chichou: has joined #ruby
[08:24:15] mim1k: has joined #ruby
[08:26:06] _mak: has joined #ruby
[08:26:23] _mak: how can I avoid the char 'ü' from converting to its unicode value?
[08:26:43] _mak: when I try to write this char in a file it will convert to a huge number of unicode values
[08:27:01] _mak: I've tried adding # coding: utf-8 to the first line of the script but it did not work
[08:27:12] _mak: it was working alright on linux, but I'm getting this now on windows
[08:28:13] patarr: has joined #ruby
[08:30:09] maattdd: has joined #ruby
[08:32:51] kassav_: has joined #ruby
[08:38:46] mint: has joined #ruby
[08:39:02] claw: has joined #ruby
[08:39:39] hutch34_: has joined #ruby
[08:41:38] mooser: has joined #ruby
[08:43:18] karapetyan: has joined #ruby
[08:44:44] maattdd_: has joined #ruby
[08:44:52] ledestin: has joined #ruby
[08:46:32] _mak: https://gist.github.com/makdisse/b857d8831ced9a9a95adb429ba6f0848 this shows the issue
[08:46:39] _mak: the before and after value
[08:46:49] JoshS: has joined #ruby
[08:48:24] marr: has joined #ruby
[08:51:19] jhass: _mak: first of all what's your ruby version?
[08:51:43] _mak: jhass: ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]
[08:52:06] jhass: okay, can you show the code that writes it and the one that reads it back?
[08:52:36] chichou: has joined #ruby
[08:52:42] _mak: jhass: I get the value from the DB and use f.write to write to a file
[08:53:02] jhass: what kind of DB?
[08:53:14] cyphase: has joined #ruby
[08:53:21] _mak: utf_general_ci
[08:53:23] _mak: enconding
[08:53:31] jhass: that's the collation ;)
[08:53:40] jhass: on the column and connection too?
[08:54:32] _mak: I do not specify anything on the connection... not sure how to see the encoding for the column
[08:54:42] lxsameer: has joined #ruby
[08:54:51] _mak: I connect with Mysql2::Client.new(:host => @db_ip, :username => "root", :password => @db_password)
[08:55:17] jhass: (MySQL allows to override the encoding and collation per column but if you didn't set anything it should inherit it from the table and if that's not set from the db)
[08:55:19] govg: has joined #ruby
[08:56:22] jhass: try passing :encoding => "utf8" to the connect call too
[08:56:28] jhass: and do not do any encode calls
[08:57:04] jhass: they shouldn't be necessary if you have the input with right encoding specified and the output specified with the right encoding
[08:57:21] _mak: jhass: same results
[08:57:22] jhass: so open the file with :encoding => "UTF-8" too
[08:58:03] _mak: it is actually a new file: File.new("#{json_dir}/#{table}.json","w", :encoding => "UTF-8")
[08:58:22] jhass: sure that's fine
[08:58:32] jhass: open and new are just aliases
[08:59:34] _mak: jhass: same issue
[08:59:41] jhass: ok, time to dig into the db
[09:00:03] jhass: a common issue especially with mysql is that the data was written with the wrong encoding into the db in the first place
[09:00:29] _mak: should I find out the encoding of the column then
[09:01:05] jhass: so say it's UTF-8, mysql thinks it's ISO something and tries to convert the UTF-8 into UTF-8 for your connection by interpreting it as ISO something
[09:01:12] jhass: stuff like this
[09:01:29] _mak: I've just found out the column encoding: uft8
[09:01:46] jhass: http://stackoverflow.com/a/8662921/2199687
[09:01:56] dhollin3: has joined #ruby
[09:02:03] astrobun_: has joined #ruby
[09:02:03] jhass: how's the data written into the DB?
[09:02:06] Guest24_: has joined #ruby
[09:02:29] AlexRussia: has joined #ruby
[09:03:01] _mak: jhass: what do you mean?
[09:03:10] _mak: normal insert I would say
[09:03:29] jhass: yeah sorry, I mean by what kind of environment
[09:03:45] jhass: what programming language running on what kind of OS
[09:04:05] jhass: potentially getting its input itself from where
[09:04:19] jhass: also if you do a select on the mysql console does it display correctly actually?
[09:04:41] _mak: ah right, it was inserted in an ubuntu OS, ruby as well (can't remember the version), the input was taken from a json API
[09:05:07] _mak: I'm using a mysql client, let me check if it shows correct on the console
[09:05:52] _mak: shit, I don't have the mysql client on my windows
[09:06:11] _mak: I thought I could not be related to the console because it is writting incorrectly to the file as well
[09:06:30] _mak: so it can't be just a matter of not being able to display it correctly
[09:09:05] jhass: well, what I really want to know is whether there's anything that gets it out correctly
[09:09:23] jhass: but I guess you already said its fine when you run the same script on linux?
[09:09:41] _mak: jhass: what if I run a select on irb
[09:09:48] _mak: would that be a good test?
[09:09:55] Pumukel: has joined #ruby
[09:09:57] jhass: I wouldn't expect much difference tbh
[09:10:08] dionysus69: has joined #ruby
[09:10:36] jhass: I'd run the script in the same version as you run it on linux but with the added :encoding => params to both the connection and the file
[09:10:45] jhass: and then make sure to open it in a UTF-8 aware editor on windows
[09:12:25] _mak: I can't remember what version I had on the linux machine... so you say I could try installing an older ruby version to test?
[09:12:32] _mak: I'm using sublime
[09:14:21] Guest52610: has joined #ruby
[09:14:39] jhass: older ruby versions generally only make encoding matters worse ;)
[09:14:53] jhass: 2.0 was the first one where general sanity was achieved
[09:15:30] _mak: jhass: I've just noticed that if I select that row from irb the quantity of unicode chars is just one: => {"publisher_id"=>7582, "name"=>"VS Verlag f\u00FCr Sozialwissenschaften"}
[09:15:48] _mak: so there must be something that is multiplying the quantity somewhere
[09:16:35] jhass: \u00FC is UTF-8 ü fwiw
[09:17:39] _mak: so what could be converting this char into that big sequence of unicodes
[09:17:55] adgtl-: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[09:17:58] jhass: what does ruby think that string in irb is? (check its .encoding)
[09:18:34] _mak: #<Encoding:UTF-8>
[09:18:46] jhass: so it just thinks it can't display it to you
[09:19:06] _mak: but why when it get writtent to the file is goes crazy?
[09:19:16] _mak: *written
[09:19:17] jhass: what if you do File.write("test", that_thing, encoding: "UTF-8") in irb?
[09:19:33] jhass: and open test in sublime text
[09:19:54] mim1k: has joined #ruby
[09:19:55] _mak: {"publisher_id"=>7582, "name"=>"VS Verlag f\u00FCr Sozialwissenschaften"}
[09:20:09] jhass: sorry I meant ["name"]
[09:20:37] _mak: jhass: aha! VS Verlag für Sozialwissenschaften
[09:20:41] _mak: how come
[09:20:52] jhass: so something messes it up in your real script
[09:20:59] karapetyan: has joined #ruby
[09:21:03] jhass: and it should be neither the reading nor the writing stage
[09:21:15] _mak: it must be the json conversion then
[09:21:26] mikecmpb_: has joined #ruby
[09:21:37] jhass: maybe, let's experiment further in irb
[09:21:53] jhass: File.write("test", foo.to_json, encoding: "UTF-8")
[09:22:16] _mak: oh man! {"publisher_id":7582,"name":"VS Verlag für Sozialwissenschaften"}
[09:22:39] _mak: ACTION is totally confused now :)
[09:23:28] jhass: okay let's make sure it's now on how you invoke, make a new ruby script that just does the minimal stuff you did in irb and see if it's still ok when you do ruby that.rb
[09:24:06] esObe: has joined #ruby
[09:26:16] _mak: jhass: it works correctly
[09:26:32] _mak: so it must be something else in my script
[09:26:32] jhass: so there's gotta be something else you do besides converting to json ;)
[09:26:43] _mak: what could I look for
[09:26:54] _mak: file.read? and stuff like that?
[09:27:10] jhass: idk, that you do json conversion at all was news to me until you mentioned it ;)
[09:27:15] jhass: no idea what you script really does
[09:27:40] _mak: ok then, I'll try to find it
[09:27:42] _mak: thanks a lot mate
[09:28:11] jhass: expanding that minimal example step by step to include all the steps you do in your real thing might be a good way forward
[09:35:18] biberu: has joined #ruby
[09:42:46] Guest24_: has joined #ruby
[09:43:14] mooser: has joined #ruby
[09:46:45] darwish: has joined #ruby
[09:46:57] darwish: Hello. Does ruby support assignment in argument list?
[09:47:10] darwish: That is, def f(a, b, c) end
[09:47:17] darwish: f(a = 2, c = 3, b = 1)
[09:47:31] herwin: have you tried it?
[09:48:47] darwish: oh, seems it does not
[09:48:54] darwish: This was trigirred by rubocop
[09:49:32] ljarvis: darwish: this is the closest thing to what you want: https://robots.thoughtbot.com/ruby-2-keyword-arguments
[09:50:38] darwish: ljarvis, thanks a lot! that's what I needed indeed :-)
[09:55:38] ferr: has joined #ruby
[09:55:53] grh: has joined #ruby
[09:56:00] Guest96: has joined #ruby
[09:57:19] Guest24_: has joined #ruby
[10:02:07] StoneCypher: has joined #ruby
[10:03:14] CloCkWeRX: has joined #ruby
[10:06:44] zenguy_pc: has joined #ruby
[10:09:53] Guest96: has joined #ruby
[10:25:00] binaryplease: has joined #ruby
[10:25:31] User458764: has joined #ruby
[10:25:33] Jameser: has joined #ruby
[10:25:38] esObe: has joined #ruby
[10:26:10] User458764: has joined #ruby
[10:29:06] patarr: has joined #ruby
[10:29:39] flying: has joined #ruby
[10:36:37] hutch34_: has joined #ruby
[10:42:31] t-recx: has joined #ruby
[10:46:27] flips: Huh, in irb 'require "crack/xml" returns true, in pry I get "LoadError: cannot load such file"
[10:46:28] darwish: rubocop complains about "while true": W: Literal true appeared in a condition.
[10:46:35] darwish: Any better alternative?
[10:47:26] matthewd: darwish: rubocop defaults to enforcing https://github.com/bbatsov/ruby-style-guide
[10:47:34] ljarvis: darwish: loop { }
[10:48:26] nickjj: has joined #ruby
[10:49:08] papillom: has joined #ruby
[10:50:04] darwish: ljarvis, thanks again!
[10:50:46] Jackneill: has joined #ruby
[10:54:31] al2o3-cr: has joined #ruby
[10:55:48] bodgix: has joined #ruby
[11:02:39] jhass: flips: maybe they're using different rubies?
[11:04:36] papillom: has joined #ruby
[11:09:15] loechel: has joined #ruby
[11:09:40] flips: jhass: running pry from a dir with .ruby-version and .ruby-gemset defined
[11:12:38] s3m1s0n1c: has joined #ruby
[11:12:49] s3m1s0n1c: Hey guys...
[11:12:57] pankaj_: has joined #ruby
[11:13:10] s3m1s0n1c: How does one read a fifo mpeg file..
[11:13:17] s3m1s0n1c: Using pipe_named doesn’t work
[11:13:27] s3m1s0n1c: with ruby-mumble
[11:14:59] bonhoeffer_: has joined #ruby
[11:16:02] s3m1s0n1c: has left #ruby: ()
[11:17:12] karapetyan: has joined #ruby
[11:19:47] Emmanuel_Chanel: has joined #ruby
[11:22:37] sepp2k: has joined #ruby
[11:23:32] foxmask: has joined #ruby
[11:25:36] alazred: has joined #ruby
[11:29:48] acalycine: has joined #ruby
[11:42:03] adgtl-: has joined #ruby
[11:44:08] jamesaxl: has joined #ruby
[11:46:53] pickle_: has joined #ruby
[11:51:27] nadir: has joined #ruby
[11:52:35] patarr: has joined #ruby
[11:54:51] astrobunny: has joined #ruby
[11:54:56] nomenkun: has joined #ruby
[11:56:17] AlexRussia: has joined #ruby
[11:56:17] synthroid: has joined #ruby
[11:58:15] Arpanet69: has joined #ruby
[11:58:42] synthroid: has joined #ruby
[12:02:28] StoneCypher: has joined #ruby
[12:09:55] nomenkun: has joined #ruby
[12:09:57] mooser: has joined #ruby
[12:11:54] SteenJobs_: has joined #ruby
[12:12:22] nomenkun: has joined #ruby
[12:13:25] synthroid: has joined #ruby
[12:15:24] Sammichmaker: has joined #ruby
[12:15:46] yurikoles: has joined #ruby
[12:17:13] jdm: has joined #ruby
[12:19:52] pupsicle: has joined #ruby
[12:24:40] DARPA: has joined #ruby
[12:27:09] esObe: has joined #ruby
[12:29:31] ramfjord: has joined #ruby
[12:29:57] Arpanet69: has joined #ruby
[12:31:48] __Yiota: has joined #ruby
[12:32:01] singalaut: has joined #ruby
[12:35:38] DARPA: has joined #ruby
[12:38:30] ebanoid: has joined #ruby
[12:45:01] gnufied: has joined #ruby
[12:49:09] JeanCarloMachado: has joined #ruby
[12:50:14] Pumukel: has joined #ruby
[12:51:08] Pumukel: has joined #ruby
[12:58:37] chichou: has joined #ruby
[12:59:29] arquebus: has joined #ruby
[13:01:23] flips: importing values from an XML file, the booleans ends up as string "true" and "false" ... Is there an easy way to "boolify" the strings? :) (Assuming it might not, as true and false are object, that might have to write a conditional test)
[13:01:27] StoneCypher: has joined #ruby
[13:02:18] jhass: value = true if value == "true"; value = false if value == "false"
[13:02:36] supergeek: has joined #ruby
[13:03:11] Jameser: has joined #ruby
[13:05:00] Mon_Ouie: has joined #ruby
[13:05:17] arquebus: has joined #ruby
[13:05:18] karapetyan: has joined #ruby
[13:08:29] supergeek: has joined #ruby
[13:09:26] nemish: has joined #ruby
[13:09:45] elomatreb: jhass: Or just value = value == "true"?
[13:10:21] jhass: elomatreb: that assumes the only other valid value is "false"
[13:10:33] ghornet: has joined #ruby
[13:10:37] Hanmac: flips: what should it return if its neither true or false?
[13:12:22] nyuszika7h: has joined #ruby
[13:15:52] flips: Hm, I do want the field to be only true or false, boolean style. I'm saving to the xml file myself using xmlsimple (or crack, is the plan)
[13:16:29] mim1k: has joined #ruby
[13:16:52] pupsicle: >> 'true'.to_s == 'true' && true.to_s == 'true'
[13:16:53] ruby[bot]: pupsicle: # => true (https://eval.in/776562)
[13:17:11] pupsicle: >> 'false'.to_s == 'true' || false.to_s == 'true'
[13:17:12] ruby[bot]: pupsicle: # => false (https://eval.in/776563)
[13:23:34] houhoulis: has joined #ruby
[13:24:19] chouhoulis: has joined #ruby
[13:24:43] sepp2k: has joined #ruby
[13:25:59] bigkevmcd: has joined #ruby
[13:26:17] flips: elomatreb: That was compact syntax :) So ... value should point/be assigned to value's object if value == "true" (and then point to false if value is something else)?
[13:26:39] flips: (Yep, the syntax worked very well) :)
[13:27:10] jhass: it just assigns the value of the expression value == "true" back to value
[13:27:29] jhass: there's no "if"
[13:27:58] flips: and no parenthesis :)
[13:28:07] jhass: but if this is all in your hands, did you consider just using json as it has a native boolean type?
[13:28:34] rippa: has joined #ruby
[13:28:59] flips: I tried asking yesterday if I should consider json, xml or haml in addition to yaml ... Now you gave me a good reason for json
[13:29:40] flips: I'm just experimenting for learning anyways :)
[13:30:39] flips: I know crack has json, but should I consider some other module/gem?
[13:31:29] jhass: tbh I don't get the purpose of crack
[13:31:39] jhass: how's it better than require "json"; JSON.parse
[13:31:50] jhass: given json is in the stdlib
[13:32:28] flips: ok, it showed up when I searched for xml parsing tools :)
[13:33:10] jhass: the standard xml parsing library is nokogiri with oga gaining momentum
[13:36:45] flips: I tried nokogiri, but ended up a very complex hash ... Russ Olsen mentions xmlsimple in his book :)
[13:36:49] mint: has joined #ruby
[13:37:09] jhass: well you shouldn't use nokogiri to pull out a hash
[13:37:19] jhass: but rather stick to its API as long as possible
[13:37:33] jhass: using .css or .xpath to get at the nodes you want
[13:43:53] harfangk: has joined #ruby
[13:44:38] mooser: has joined #ruby
[13:45:00] poikon: has joined #ruby
[13:46:11] mrconfused: has joined #ruby
[13:48:45] papillom: has joined #ruby
[13:48:51] s2013: has joined #ruby
[13:49:37] jrm: has joined #ruby
[13:51:27] Pumukel: has joined #ruby
[13:53:18] bmurt: has joined #ruby
[13:53:56] erlend: has joined #ruby
[13:57:13] govg: has joined #ruby
[14:02:18] sleetdrop: has joined #ruby
[14:04:10] shinnya: has joined #ruby
[14:04:28] bronson: has joined #ruby
[14:04:38] flips: json seems simpler for such data I'm storing :)
[14:05:52] ineb: has joined #ruby
[14:09:24] rakm: has joined #ruby
[14:09:44] ghornet: has joined #ruby
[14:10:18] patarr: has joined #ruby
[14:13:10] Guest96: has joined #ruby
[14:13:15] karapetyan: has joined #ruby
[14:13:34] synthroid: has joined #ruby
[14:17:30] LastWhisper____: has joined #ruby
[14:17:52] claudevandort: has joined #ruby
[14:19:31] Bob8989|2: has joined #ruby
[14:20:20] millerti: has joined #ruby
[14:20:25] yurikoles: has joined #ruby
[14:20:59] ptx0: has joined #ruby
[14:25:55] ghornet: has joined #ruby
[14:26:39] jhass: more often than not it is ;)
[14:27:26] shwouchk: has joined #ruby
[14:28:20] esObe: has joined #ruby
[14:33:28] Rodya_: has joined #ruby
[14:33:54] grh: has joined #ruby
[14:35:40] karapetyan: has joined #ruby
[14:38:32] ptx0: has joined #ruby
[14:39:30] mrconfused: has joined #ruby
[14:41:40] kf: has joined #ruby
[14:44:44] charliesome: has joined #ruby
[14:45:10] millerti: has joined #ruby
[14:47:34] mint: has joined #ruby
[14:49:50] bigkevmcd: has joined #ruby
[14:52:42] mrconfused: has joined #ruby
[14:55:02] ghornet: has joined #ruby
[14:56:07] GSilva: has joined #ruby
[14:56:19] allisio: We can turn `x = x + 1` into `x += 1`, but not `x = x == other` into `x === other`, at least not in the general case.
[14:57:01] allisio: Or, well, not in any case, I guess; things can't be #replace'd to booleans. :/
[14:57:02] snockerton: has joined #ruby
[14:57:04] Guest96: has joined #ruby
[14:58:04] SuperLag_: has joined #ruby
[14:59:45] SuperLag: has joined #ruby
[15:00:32] ozcanesen: has joined #ruby
[15:03:02] flips: When I do a @myhash = JSON.parse(myfile, opts...) in a class method, then @file="/path/to/myfile.json" ends up in my hash after the data I wanted (hash created by myhash = MyClass.new and myhash.load_item_from_file)
[15:03:23] karapetyan: has joined #ruby
[15:03:25] flips: I assume my logic is wrong ;)
[15:04:29] jhass: gist your code?
[15:04:42] despai: has joined #ruby
[15:05:42] joelwallis: has joined #ruby
[15:05:43] apeiros: ACTION guesses scope confusion
[15:05:49] apeiros: but yeah, code
[15:06:38] ptx0: has joined #ruby
[15:07:32] despai: has joined #ruby
[15:07:41] Jameser: has joined #ruby
[15:11:04] karapetyan: has joined #ruby
[15:11:27] gravyflex: has joined #ruby
[15:12:21] flips: I'm guessing that, too, I'm trying to move working code into class/subclass... ;) https://eval.in/776594 (It's a mix of other copied&pasted code, but list = List.new, and list.load_items seems to work, but list contains a layer too much or something
[15:15:33] karapetyan: has joined #ruby
[15:16:55] millerti: has joined #ruby
[15:18:03] jhass: flips: JSON.parse is for reading json into a hash, to turn a hash back into json before writing it into a file just call .to_json on it
[15:18:10] mrconfused: has joined #ruby
[15:18:43] jhass: however note that neither will automagically handle the nested Item class
[15:19:14] Silthias1: has joined #ruby
[15:19:17] elomatreb: Or use JSON.dump, which can also directly dump directly into a file (http://ruby-doc.org/stdlib-2.4.1/libdoc/json/rdoc/JSON.html#method-i-dump)
[15:19:21] cdg: has joined #ruby
[15:19:36] synthroid: has joined #ruby
[15:20:15] Jameser: has joined #ruby
[15:23:07] flips: I haven't looked into the saving yet (it's copied and pasted/confused with code from a working array example), I thought I would learn more about hashes by rewriting it and also test json/xml etc .. So the input file looks valid and works in a plain example (no classes, just load from file and puts)
[15:29:33] HalcyonicStorm: has joined #ruby
[15:29:58] esObe: has joined #ruby
[15:30:48] FastJack: has joined #ruby
[15:31:05] flips: This code worked for parsing/reading the json file: https://eval.in/776600
[15:31:35] elomatreb: gist.github.com is better to read usually if you don't need/want your code to be executed
[15:32:00] flips: *noted* :)
[15:32:52] elomatreb: Also, optional arguments in Ruby don't work like they do in Python, they're still just positional
[15:33:09] elomatreb: You're assigning to a never-used local variable "opts" in line 11
[15:33:26] jgnagy: has joined #ruby
[15:33:30] jamesaxl: has joined #ruby
[15:35:14] StoneCypher: has joined #ruby
[15:35:39] flips: I thought that opts were known/expected by JSON.parse, it does symbolize the names :)
[15:36:11] elomatreb: It is an optional argument, it only works because variable assignment returns the assigned value
[15:36:31] elomatreb: `JSON.parse(File.read(file), { :symbolize_names => true })` does the same
[15:36:51] ytti: happy zombie jesus day
[15:37:01] flips: I see, just an anonymous hash instead
[15:38:51] mooser: has joined #ruby
[15:42:01] adam_: has joined #ruby
[15:42:09] Rodya_: has joined #ruby
[15:42:16] bodgix: has joined #ruby
[15:42:58] chouhoulis: has joined #ruby
[15:43:36] blackwind_123: has joined #ruby
[15:45:36] mrconfused: has joined #ruby
[15:46:12] polishdub: has joined #ruby
[15:48:54] millerti: has joined #ruby
[15:50:37] JoshS: has joined #ruby
[15:51:00] ramfjord: has left #ruby: ()
[15:52:02] dviola: has joined #ruby
[15:53:28] Guest96: has joined #ruby
[15:53:50] User458764: Hi, I would like to modify the keys of a hash and replace every '-' by '_' how do I do that?
[15:54:57] ghornet: has joined #ruby
[15:56:16] ljarvis: User458764: what did you try?
[15:56:42] gravyflex: has joined #ruby
[15:58:15] amclain: has joined #ruby
[16:00:48] GSilva: has joined #ruby
[16:02:38] User458764: ljarvis I simplify my problem I just need to modify an array values now, does a gsub('-', '_') is a good way
[16:02:43] ineb: User458764: if on rails, you have Hash#transform_keys
[16:02:49] BSaboia: has joined #ruby
[16:02:58] User458764: ineb I am on rails thanks
[16:04:51] ineb: User458764: for your array problem, you could do arr = arr.map {|s| s.gsub('-', '_')}
[16:05:47] Xiti: has joined #ruby
[16:07:58] rakm: has joined #ruby
[16:08:00] jhass: no need to gsub, tr is just good enough here
[16:09:01] jdm: has joined #ruby
[16:12:25] raul782: has joined #ruby
[16:13:33] despai: has joined #ruby
[16:14:23] raul7821: has joined #ruby
[16:15:29] p0p0pr37: has joined #ruby
[16:15:29] p0p0pr37: has joined #ruby
[16:17:04] yokel: has joined #ruby
[16:18:28] User458764: Thanks for help but I think my problem is in my model I need to map the attributes with an underscore to the same but with a dash it is a Rails question :)
[16:19:06] nitric: has joined #ruby
[16:19:41] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[16:19:44] raul782: has joined #ruby
[16:21:46] FastJack: has joined #ruby
[16:22:58] cerulean: what is Ruby on Rails?
[16:23:30] millerti: has joined #ruby
[16:24:33] Arpanet69: has joined #ruby
[16:26:04] Rodya_: has joined #ruby
[16:28:11] mrconfused: has joined #ruby
[16:31:21] esObe: has joined #ruby
[16:31:54] mikecmpbll: has joined #ruby
[16:32:08] mazeinmaze_: has joined #ruby
[16:35:32] Silthias: has joined #ruby
[16:37:16] millerti: has joined #ruby
[16:37:51] jgt: has joined #ruby
[16:39:35] bronson: has joined #ruby
[16:42:02] karapetyan: has joined #ruby
[16:43:26] mim1k: has joined #ruby
[16:44:34] snickers: has joined #ruby
[16:46:06] bodgix: has joined #ruby
[16:46:23] DWSR: has joined #ruby
[16:46:41] DWSR: *Disclaimer: I'm an ops person* Hey all, I'm currently trying to build a project with Grunt, but I'm having some issues with grunt not being able to locate gems that are located in GEM_PATH. Specific output is https://gist.github.com/DWSR/b2103ce5a8dada807e6b23dbebc81c75 I know this isn't directly a ruby question, but I've already asked in #grunt, which seems dead.
[16:48:01] allisio: Is this okay? https://eval.in/776619
[16:48:08] despai: has joined #ruby
[16:49:39] rgiscard: has joined #ruby
[16:49:56] outreachdan: has joined #ruby
[16:51:51] shwouchk: has joined #ruby
[16:54:35] tubbo: has joined #ruby
[16:54:56] tubbo: i have a ruby application that is extremely inefficient when starting up
[16:55:20] tubbo: in fact, it takes so long to start up that we have a `sleep 120` call as part of the deploy process, to give some breathing room for sidekiq to start up. it doesn't actually take 2 minutes to load, that's just a high watermark
[16:55:29] tubbo: it takes about 20-45 seconds to get the app booted
[16:55:58] tubbo: i would really like to improve that by compiling my .rb code into .rbc. this happens to be a rails app with lots of files, and i'm not sure how feasible that is.
[16:56:34] tubbo: this would also only happen in deployed environments, so cache_classes is on and all code is eager-loaded
[16:58:16] tubbo: (actually...are .rbc files only available in Rubinius?)
[16:59:36] millerti: has joined #ruby
[17:00:08] chichou: has joined #ruby
[17:00:46] cdg: has joined #ruby
[17:03:37] mooser: has joined #ruby
[17:04:00] gravyflex: has joined #ruby
[17:05:51] raul782: has joined #ruby
[17:08:08] bmurt: has joined #ruby
[17:08:34] mrconfused: has joined #ruby
[17:09:09] darwish: has left #ruby: ("Leaving")
[17:11:46] esObe: has joined #ruby
[17:17:24] enterprisey: has joined #ruby
[17:21:05] pifon: has joined #ruby
[17:21:46] Jameser: has joined #ruby
[17:22:50] havenwood: tu, where tubbo go?!
[17:23:43] havenwood: https://github.com/ko1/yomikomu
[17:25:01] agent_white: has joined #ruby
[17:25:49] singalaut: has left #ruby: ("nuhun")
[17:26:04] kies: has joined #ruby
[17:27:53] Cohedrin: has joined #ruby
[17:29:27] jamesaxl: has joined #ruby
[17:29:31] modin: has joined #ruby
[17:30:09] Dry_Lips: has joined #ruby
[17:30:10] Dry_Lips: has joined #ruby
[17:31:37] DARPA: has joined #ruby
[17:31:47] mooser: has joined #ruby
[17:32:20] millerti: has joined #ruby
[17:32:29] j2k: has joined #ruby
[17:32:54] jaequery: has joined #ruby
[17:35:59] DWSR: *Disclaimer: I'm an ops person* Hey all, I'm currently trying to build a project with Grunt, but I'm having some issues with grunt not being able to locate gems that are located in GEM_PATH. Specific output is https://gist.github.com/DWSR/b2103ce5a8dada807e6b23dbebc81c75 I know this isn't directly a ruby question, but I've already asked in #grunt, which seems dead.
[17:37:21] StoneCypher: DWSR: why are you using an obsolete js build tool for ruby
[17:37:34] DWSR: StoneCypher: I don't get to make these decisions.
[17:37:51] DWSR: StoneCypher: I'm trying to get automated builds to work properly inside Atlassian Bamboo so that I can do automated deploys.
[17:41:11] tolerablyjake: has joined #ruby
[17:43:04] JeanCarloMachado: has joined #ruby
[17:47:16] maattdd: has joined #ruby
[17:47:26] edgr: has joined #ruby
[17:47:48] claudevandort: has joined #ruby
[17:49:56] SeepingN: has joined #ruby
[17:53:25] mrconfused: has joined #ruby
[17:56:33] pupsicle: @DWSR what is the output of gem list ffi
[17:58:02] duderonomy: has joined #ruby
[17:59:15] mzo: has joined #ruby
[18:02:02] s2013: has joined #ruby
[18:04:32] GodFather: has joined #ruby
[18:05:13] patarr1: has joined #ruby
[18:08:47] bandu: has joined #ruby
[18:09:49] cfec0b8d: has joined #ruby
[18:09:55] binaryplease: has joined #ruby
[18:10:24] tolerablyjake: has joined #ruby
[18:10:28] coyo: has joined #ruby
[18:10:29] ericmathison: has joined #ruby
[18:11:56] s2013: has joined #ruby
[18:13:03] esObe: has joined #ruby
[18:17:15] cerulean: why do I get Permission denied @ rb_sysopen - djforestflame.pstore on my linux server but not in development?
[18:17:26] cerulean: i pass the full path to pstore
[18:18:28] raul782: has joined #ruby
[18:19:03] jhass: because the ruby process does not have read permissions on the file
[18:22:04] Arpanet69: has joined #ruby
[18:23:54] DWSR: pupsicle: I figured it out, I was specifying the path incorrectly.
[18:24:11] pupsicle: ah good to hear
[18:24:22] DWSR: pupsicle: I was specifying the same directory that I passed to bundle, which isn't what grunt is expecting when it looks for gems.
[18:27:27] karapetyan: has joined #ruby
[18:34:21] cerulean: jhass, the file isnt getting created at all
[18:34:28] cerulean: im running ruby as the same user in a user directory
[18:34:35] cerulean: shouldnt it have permissions to open and write the pstore there?
[18:34:41] jhass: well then you lack write permissions on the directory
[18:34:44] cerulean: i have to create the pstore myself?
[18:34:56] cerulean: i made the directory with git as that user, how can that be?
[18:35:19] jhass: well I guess it's trying to do it somewhere else than you think it does
[18:35:57] cerulean: that's what i thought. doesnt make any sense. it seems like a bug
[18:36:04] cerulean: i'm running 2.4 on OSX here and 2.4 on linux there
[18:36:17] jphase: has joined #ruby
[18:36:22] cerulean: i tried a bunch of ways of forcing the path but doesnt work
[18:37:04] despai: has left #ruby: ()
[18:41:49] jhack: has joined #ruby
[18:43:35] jared_nyc: has joined #ruby
[18:43:42] mim1k: has joined #ruby
[18:44:28] ramfjord: has joined #ruby
[18:44:58] AndBobsYourUncle: has joined #ruby
[18:57:22] StoneCyp1er: has joined #ruby
[18:58:08] amenjesus: has joined #ruby
[18:58:12] amenjesus: has left #ruby: ()
[18:58:50] ozcanesen: has joined #ruby
[19:03:14] rgiscard: has joined #ruby
[19:08:10] lxsameer: has joined #ruby
[19:09:37] raul782: has joined #ruby
[19:13:54] SteenJobs_: has joined #ruby
[19:15:02] theunraveler: has joined #ruby
[19:16:08] dionysus69: has joined #ruby
[19:16:33] jgt: has joined #ruby
[19:21:31] jamesaxl: has joined #ruby
[19:22:33] fusta: has joined #ruby
[19:27:48] chichou: has joined #ruby
[19:27:55] saida: has joined #ruby
[19:28:11] Guest96: has joined #ruby
[19:28:12] adam12: saida: o/
[19:28:51] saida: I am trying to see if someone can help me with finding the gems that a given ruby process is using, to troubleshoot an issue
[19:29:23] saida: gems are in various folders and I am not certain which gems my process is using
[19:29:43] adam12: saida: Does your project include a Gemfile?
[19:30:38] saida: Gem.use_paths(nil, Gem.path << "/opt/myagent/vendor")
[19:30:53] havenwood: saida: binding.pry into your project and check: $LOADED_FEATURES
[19:31:19] havenwood: saida: can you look in that vendor dir?
[19:32:47] saida: I did @havenwood but there are many gems with different versions
[19:34:09] saida: havenwood: how does binding.pry work?
[19:34:15] ruby[bot]: saida: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[19:34:44] havenwood: saida: put `require 'pry'` in your code then a `binding.pry` where you want to jump to pry when you run the program
[19:34:55] havenwood: or `binding.irb` with Ruby 2.4 if you prefer
[19:35:20] galeido: has joined #ruby
[19:35:41] saida: havenwood: thanks for trying to help me, and I appreciate your help.
[19:35:59] davic: has joined #ruby
[19:37:04] saida: problem here is that, it is intermittent issue, and I do not want to restart the process, as restarting it might resolve the issue
[19:37:51] saida: havenwood: is there a way to check the gems path or gems used by the currently running ruby process?
[19:39:01] mooser: has joined #ruby
[19:39:15] havenwood: saida: sure, you can look at the file descriptors the process is using
[19:39:17] mrconfused: has joined #ruby
[19:39:46] saida: havenwood: can you please tell me how?
[19:41:24] havenwood: saida: what os/distro?
[19:41:34] saida: havenwood: I got it, let me try
[19:44:39] saida: havenwood: thanks much, so this gives the files being used by a given process
[19:46:36] matthewd: The gems' files shouldn't still be open, though
[19:47:05] Rodya_: has joined #ruby
[19:47:09] havenwood: matthewd: good point, just stdlib would be
[19:47:14] SeepingN: has joined #ruby
[19:47:26] JeanCarloMachado: has joined #ruby
[19:47:32] matthewd: Yeah, you'd get hints for any .so files, but most gems are pure .rb, so that won't help
[19:48:04] matthewd: The "real" answer is probably to attach gdb and then evaluate $".. but that's not trivial
[19:48:32] saida: havenwood: matthewd I see that why I dont see any
[19:48:54] saida: matthewd: is it tough to do ?
[19:49:05] saida: is there a likn you can suggest?
[19:49:33] karapetyan: has joined #ruby
[19:49:40] jdawgaz: has joined #ruby
[19:49:44] matthewd: https://robots.thoughtbot.com/using-gdb-to-inspect-a-running-ruby-process maybe
[19:50:06] matthewd: You eventually want to run the ruby code 'p $"'
[19:50:21] matthewd: (you can run that in irb first, to see what it should show)
[19:51:42] saida: got you, thanks, let me test this
[19:55:45] karapetyan: has joined #ruby
[19:55:52] flips: This gist explains my issue (scoping or what the problem is) of importing a json data structure/hash correctly: https://gist.github.com/flips/95f0eea0afd8347c514256d654655697 <-- all feedback welcome
[19:56:10] griff: has joined #ruby
[19:58:06] jhass: flips: no, @file is not part of @list anywhere
[19:58:22] AlexRussia: has joined #ruby
[19:58:53] jhass: it's only part of your instance of the List class but not it's instance variable @list
[20:00:34] karapetyan: has joined #ruby
[20:01:35] flips: Hm, I have trouble accessing the array/hash inside (and list.load_items also seemingly overwrote/removed the method list.add_item, when I had it defined)
[20:02:20] matthewd: flips: I see no add_item method in that gist
[20:02:49] jhass: also we can't hint at what you're doing wrong without seeing your attempts
[20:02:51] matthewd: Are you sure it wasn't your keyboard that did the overwriting?
[20:03:26] jhass: damn keyboards, always messing up the code!
[20:04:35] jhass: let's go back to good old punching cards
[20:04:43] bronson: has joined #ruby
[20:04:47] flips: I was trying to isolate one issue at the time ... so first try to fetch data from that list
[20:05:30] karapetyan: has joined #ruby
[20:05:38] saida: matthewd: now I am at 4th step
[20:06:13] saida: dont think I understood what I need to run there
[20:06:49] jgt: has joined #ruby
[20:06:59] matthewd: ruby_eval('$"')
[20:07:55] saida: (gdb) ruby_eval('$"') Invalid character constant.
[20:08:22] matthewd: "$\"" maybe?
[20:09:43] flips: jhass: in my first working program, I can fetch list[:item][2] and so on, in my attempt to structure it into classes and use methods I just get "undefined method `[]'" ... So I'm trying to understand the data structure ...
[20:10:13] jhass: inside methods of your List class you can just access @list
[20:10:38] jhass: if you want to access the data outside of your class you need to expose @list or operations on it through defining a method that does so
[20:10:38] matthewd: flips: You haven't shown what you're running, but it sounds like `list` is now your List class -- not the hash.
[20:13:58] karapetyan: has joined #ruby
[20:14:12] esObe: has joined #ruby
[20:15:34] flips: Not sure what you mean I'm not showing, but as in the gist, it runs 'list = List.new' and the 'list.load_items', I'm doing that in pry and poking around. Yes, it's reported as List class (see last 2 lines), so somehow it's now an instance of the class, hm. So I need a way to expose the hash, then
[20:16:16] Rodya_: has joined #ruby
[20:17:51] saida: matthewd: I do not see any file creating in /tmp
[20:18:11] skweek: has joined #ruby
[20:19:47] saida: matthewd: let me take it back
[20:19:49] saida: I do see it
[20:20:07] saida: thanks for you help matthewd really appreciate it
[20:21:18] matthewd: You're welcome! Did it get you the answer you needed?
[20:21:44] saida: yes, indeed
[20:29:36] cagomez: has joined #ruby
[20:31:24] chichou: has joined #ruby
[20:32:33] j2k: has joined #ruby
[20:35:59] nowhere_man: has joined #ruby
[20:36:21] sagax: has joined #ruby
[20:36:54] mooser: has joined #ruby
[20:38:40] ahrs: has joined #ruby
[20:39:23] SeepingN: has joined #ruby
[20:39:29] jaequery: has joined #ruby
[20:39:33] FifthWall: has joined #ruby
[20:40:20] flips: Added some pry output to the gist, maybe that shows what happens at 'list.load_items'/why it's becoming a pointer to the Class instead of containing the hash. Thankful for any hint as to how I could/should expose/fetch the hash ... (I'm trying to learn this stuff) :)
[20:42:13] claudevandort: has joined #ruby
[20:42:36] ben_h: has joined #ruby
[20:44:16] mim1k: has joined #ruby
[20:45:05] chrisgopher: has joined #ruby
[20:48:21] swills: has joined #ruby
[20:48:24] jhass: flips: by adding methods to the class that work on or return @list
[20:54:41] raul782: has joined #ruby
[20:55:07] millerti: has joined #ruby
[20:58:34] domgetter: has joined #ruby
[20:59:07] enterprisey: has joined #ruby
[21:04:07] rakm: has joined #ruby
[21:09:28] Xiti: has joined #ruby
[21:14:03] pilne: has joined #ruby
[21:15:43] esObe: has joined #ruby
[21:18:56] mim1k: has joined #ruby
[21:20:37] grh: has joined #ruby
[21:22:37] mrconfused: has joined #ruby
[21:25:09] millerti: has joined #ruby
[21:27:23] jdawgaz: has joined #ruby
[21:27:55] icarus: has joined #ruby
[21:29:18] flips: Adding a "return @list" to load_items didn't help/change anything, also maybe load_items should be a private method ... I need some sleep
[21:29:28] ovaltine: does anyone have any gripes with 'rspec-its' or can I feel ok using it because i like it
[21:32:27] ShadowX: has joined #ruby
[21:41:41] flips: if I do 'list2 = list.load_item' list2 gets the hash I want, so I'm not that far off, I guess ... :)
[21:44:32] swills: has joined #ruby
[21:52:15] matthewd: flips: That rather defeats the point of creating a class in the first place, though
[21:52:30] esObe: has joined #ruby
[21:53:35] ineb: ovaltine: its a matter of taste. there is also https://github.com/jimweirich/rspec-given
[21:53:56] ineb: i usually stick with whatever the core team is suggesting.
[21:55:17] rakm: has joined #ruby
[21:56:26] nickjj_: has joined #ruby
[21:57:21] flips: matthewd: yes, I feel there's some basic flaw in my logic/understanding. I wrote this program for an array based structure first, and that works nicely ... I missed something trying to convert to using a hash structure instead.
[21:59:44] pwnd_nsfw`: has joined #ruby
[21:59:55] outreachdan: has joined #ruby
[21:59:59] rgtk: has joined #ruby
[22:03:26] outreachdan: has joined #ruby
[22:03:49] hutch34_: has joined #ruby
[22:04:31] t-recx: has joined #ruby
[22:05:26] stee_3: has joined #ruby
[22:05:47] raul782: has joined #ruby
[22:08:18] StoneCypher: has joined #ruby
[22:10:04] ben_h: has joined #ruby
[22:16:29] mostlybadfly: has joined #ruby
[22:20:14] mrconfused_: has joined #ruby
[22:24:22] preyalone: has joined #ruby
[22:26:52] Trynemjoel: has joined #ruby
[22:33:05] chichou: has joined #ruby
[22:35:55] bdonnahue: has joined #ruby
[22:37:15] chichouw: has joined #ruby
[22:37:53] mooser: has joined #ruby
[22:45:42] outreachdan: has joined #ruby
[22:52:04] jdawgaz: has joined #ruby
[22:53:12] captain_: has joined #ruby
[22:53:46] esObe: has joined #ruby
[22:54:01] captain_: how do I purge all my ruby gems
[22:54:45] nofxxx: captain_, if you don't have rubygems keys `rm -rf ~/.gems`
[22:55:09] nofxxx: if you do just <tab> and you'll get it
[22:55:17] captain_: thanks boss
[22:55:18] Mint_: has joined #ruby
[22:56:15] nofxxx: captain_, there's `gem clean` for old versions, but guess you know it
[22:56:26] nofxxx: but nothing like a purge day =D
[22:58:54] nofxxx: Got a C code doing some bit polishing and returning me 2 floats, what's a good way to receive this in ruby? *Not* writing to disk?
[23:00:03] captain_: "Fetching: hitimes-1.2.4.gem (100%)
[23:00:04] captain_: ERROR: Error installing rubydns:
[23:00:04] captain_: hitimes requires Ruby version >= 1.9.3.
[23:00:08] captain_: what do papi
[23:00:37] nofxxx: you got a really old version.... what ruby -v gives? what OS?
[23:00:47] cerulean: get a newer version of ruby
[23:00:53] cerulean: www.ruby-lang.org download
[23:01:37] captain_: ruby 1.9.2p330 (2014-08-07 revision 47094) [x86_64-linux]
[23:01:42] captain_: how did this happen
[23:04:28] SeepingN: get yer 2.x on
[23:04:33] StoneCypher: has joined #ruby
[23:06:10] captain_: https://pastebin.com/cWXcNbqs
[23:06:11] ruby[bot]: captain_: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[23:06:52] captain_: https://gist.github.com/anonymous/77c5c379e8201f020ad932e32c83fc51
[23:12:23] havenwood: captain_: That's a version of the json gem from 2013 that doesn't work with modern Rubies: https://github.com/flori/json/blob/master/CHANGES.md#2013-05-13-181
[23:12:56] havenwood: captain_: Use a newer version of the json gem, such as the one that shipped with your Ruby or newer.
[23:13:20] captain_: the thing im trying to install requires that version though
[23:13:26] havenwood: captain_: bundle update json
[23:13:36] havenwood: (Assuming it's an app with a Gemfile.)
[23:13:49] kent\n: has joined #ruby
[23:13:58] shwouchk: has joined #ruby
[23:14:21] captain_: its more that when i bundle install it requres me to install that version of json
[23:14:56] havenwood: captain_: After deleting the Gemfile.lock or the less severe `bundle update json`?
[23:15:12] havenwood: Or more conservative yet: bundle update json --conservative
[23:15:34] BTRE: has joined #ruby
[23:16:07] havenwood: captain_: The way Gemfile.lock files work is you don't get a fresh one with `bundle` or its alias `bundle install`. It installs the exact versions from the Gemfile.lock that were produced when someone first ran `bundle`.
[23:16:16] captain_: i just edited it out of the gemlock
[23:16:33] agent_white: has joined #ruby
[23:16:55] havenwood: captain_: One typically edits the Gemfile, then runs commands to generate or change the Gemfile.lock.
[23:17:49] havenwood: captain_: https://bundler.io/v1.14/updating_gems.html
[23:19:42] justinmcp: has joined #ruby
[23:20:08] agent_white: has joined #ruby
[23:20:44] ElDoggo: has joined #ruby
[23:24:45] workmad3: has joined #ruby
[23:25:13] enterprisey: has joined #ruby
[23:25:23] gravyflex: has joined #ruby
[23:26:04] AndBobsYourUncle: has joined #ruby
[23:28:34] Trynemjoel: has joined #ruby
[23:35:15] Cohedrin: has joined #ruby
[23:36:39] SteenJobs: has joined #ruby
[23:37:02] Trynemjoel: has joined #ruby
[23:37:58] jdawgaz: has joined #ruby
[23:38:31] outreachdan: has joined #ruby
[23:42:46] outreachdan: has joined #ruby
[23:48:24] mooser: has joined #ruby
[23:50:00] patarr: has joined #ruby
[23:51:03] bronson: has joined #ruby
[23:53:17] CloCkWeRX: has joined #ruby
[23:53:56] dar123: has joined #ruby
[23:54:16] dar123: has joined #ruby
[23:54:19] justinmcp: has joined #ruby
[23:55:10] esObe: has joined #ruby
[23:58:21] bkxd: has joined #ruby
[23:59:32] mooser: has joined #ruby