#ruby - 12 May 2017
« Back 1 day Forward 1 day »
[00:18:38] zenspider: need (more) input on this structural matching thing I'm working on https://gist.github.com/db8c3e98815371748036c4ea2585cf0c
[00:19:31] zenspider: specifically not sure of the last line... should === be more like Regexp.=~ or more like == ?
[00:58:56] ruby[bot]: +bbb $a:railsForDaiz$#ruby-fix-your-connection railsForDaiz!*@*$#ruby-fix-your-connection *!*@2c0f:f8f0:ef0d:0:1cf0:26f5:4e42:8462$#ruby-fix-your-connection
[01:10:11] jaegerca_: Does anyone have an opinion on naming convention with files in ruby - I am considering calling some of my files like this: blog.routes.rb, simply to differentiate when I am searching for them. Any purists want to tell me that's a horrible idea?
[01:14:05] elomatreb: Well, my opinion would be "I never had that problem so I wouldn't feel comfortable with breaking the convention (and possibly the autoloading?)"
[01:15:57] jaegerca: elomatreb: Autoloading is a good point - although in this case these files have no class names and are being explicitly required and evaled.
[01:33:13] dar123: hey guyz new to ruby, would be ruby equivalent of blabla | egrep ^Gi | grep up | wc -l
[06:39:20] knamehost: this >>> Make sure that `gem install rex-core -v '0.1.10'` succeeds before bundling.
[07:07:21] dminuoso: We'd be annoyed to the point where some wont bother to look at it, or others mock you.
[08:14:03] dionysus69: I am setting up rails dev envrironment setup script, does anyone want to help whoever is good with bash?
[09:01:52] konsolebox: kke: perhaps the internal function immediately exits when no element is passed. checking for the validity of the index is bypassed. or perhaps it is handled by another function that is only called when the index is already needed. or perhaps to be exact, it is only at that time where the real value of the (VALUE) object is interpreted.
[09:02:32] konsolebox: the error you get when you pass another argument is 'TypeError: no implicit conversion of String into Integer'
[09:05:58] kke: "If x is not a Fixnum , Float , or Bignum object, it attempts to implicit type conversion by x.to_int."
[09:09:18] dminuoso: Because if there's nothing to be inserted, it's pointless to even try and compute the index.
[09:13:31] dminuoso: It's possibly just some type error. Though it's conceivable that .insert(Exception.new, something) could be useful.
[11:45:10] cryingfreeman: Hi! I have a RoR webapp that uses the DAYNAMES constant to render weekday names, in english. I would like to re-define the DAYNAMES constant in my code to ugly hack translate them into another language. I know almost nothing about Ruby, so can anyone help me with how I should do this?
[12:00:48] dminuoso: cryingfreeman: secondly the concept you are looking for is called "internationalization", or short "18n"
[12:01:56] dminuoso: cryingfreeman: For i18n there are a multitude of gems and packages available. For rails you could look into rails-i18n.
[12:47:17] cryingfreeman: dminuoso, sorry for a late reply, but thanks for your help :) I'll post the question in the right channel!
[12:47:58] dminuoso: Don't worry, we expect patience from the folks that come in here, it's only fair to be patient outselves.
[12:59:45] kke: args = args.first if args.first.is_a?(Array) <-- i find myself doing a lot of something like this with methods that take splats
[13:12:22] andrew9184: i need to do recursion with a json array, what’s the valid constructor to use in the argument? ie get_items(nextpage, jsonArray= ?)
[13:13:38] ljarvis: andrew9184: could you elaborate? in Ruby, what is your json array? is it json, or a ruby array?
[13:14:47] rodd: I'm trying to set the value of a variable to a return from a shell command in rake, i.e.: composer = execute('which composer'), what's the right way to do this?
[13:14:55] andrew9184: hmm, but i think faraday has a middleware that attaches to response.body such that you can do response.body.to_json
[15:17:56] valkyrka: hi guys, I’m struggling with a regex and I can’t seem to get it right, I have the strings - ‘test-valkyrka-web-croncom’ and ‘test-valkyrka-web-cronuk’ what regex should I use to match cron*?
[16:52:34] patarr: Hello - why does an error thrown when I do enumerator.next only have a one line stack trace? I have no idea where to start debugging this issue
[16:58:52] xco: can someone point me in reject some string from an array. think i forgot something. i’m getting “Undefind method `reject` for "three":String” in this https://gist.github.com/siaw23/0275d3d54c1edeaf1c01f0083f57fe09
[17:10:11] xco: al2o3-cr: riiiiiight! just wrote this complicated less elegant one :( https://gist.github.com/siaw23/0275d3d54c1edeaf1c01f0083f57fe09 but work. but #select is what i wanted
[17:11:04] ljarvis: it's confusion, because .each returns the list anyway, so you're just doing `it = list`
[17:18:06] xco: baweaver: i know. i saw that link. but it’s not here: https://ruby-doc.org/core-2.4.0/Array.html
[17:19:05] ljarvis: and other stuff (e.g. your own custom classes can include Enumerable and merely implement #each)
[17:56:04] evenix: Would it be a good thing to use a class variable to store an Object that will be accessible to every subclass; but where the value might need to be updated when the parent context changes?
[18:24:54] anomaly: using books like The well grounded Rubyist and Ruby from Beginner to Professional cite 1.8/9. will that translate with current Ruby or best to find another book?
[18:26:20] matthewd: I'd say 1.9 should be near enough, with a few missing features; 1.8 you're more likely to see things that are actively different
[19:29:04] anomaly: baweaver, I had seen it yes. problem was the books I could have at hand were using 1.8/9 which prompted my question.
[20:26:33] xdexter: Hello, i'm trying use a script to download a log file with aws api but i have a error when i run, https://pastebin.com/4VWEXgQk, someone can help me please?
[20:54:38] xdexter: Hello, i'm trying use a script to download a log file with aws api but i have a error when i run, https://gist.github.com/anonymous/71e88b40546f8a19ec20fc8c8e371d06, someone can help me please?
[21:46:14] Pierreb: trying to fetch info from db and want to use in a array and print parts of it, anyone know how to do it? https://paste.linux.community/view/a3b545dc
[22:59:13] zenspider: how would you want this (=~ vs ===) to work? https://gist.github.com/zenspider/db8c3e98815371748036c4ea2585cf0c
[23:08:26] zenspider: xco: if you look at the sidebar on the Array doco there is a section for "Included Modules"... Always poke at those.
[23:30:46] assembledbits: Can someone help me refactor this? https://gist.github.com/j0ntsang/1871e29cef04cb246a7bf7fce5918dcc