#ruby - 02 April 2016
« Back 1 day Forward 1 day »
[00:13:34] postmodern: if you're parsing time/dates in a library, should one use Time.parse or DateTime.parse?
[00:16:42] smathy: postmodern, depends whether you want a Time or DateTime object, ready the start of http://ruby-doc.org/stdlib-2.3.0/libdoc/date/rdoc/DateTime.html
[02:22:30] josephan_: So all my classes live in separate files in the same directory, and are all under the module namespace. How should I make it so that the constants in the module are accessible by the classes in seperate files and their tests?
[02:30:15] shevy: gizmore lol I am way too scared to check it out... I tried ponycorns before yesterday ... and I think it requires unicode so I only saw some colours and weird chars... ok the name is ponysay http://erkin.co/ponysay/
[02:37:43] smathy: josephan_, put the constants into one file, can just be a module file, doesn't have to have a class, and require that file anywhere the constants are needed.
[02:47:24] josephan_: smathy, oh perfect! Thank you! Sorry I was tabbed out I just saw your message. Have a great day.
[03:58:17] brentw: I'm having trouble w/ this program, It looks like the @touched_pos hash is storing a list of Fixnums instead of instances of nodes representing a nodes children. can't seem to figure out how the hash is getting pushed a fixnum. https://gist.github.com/brentgsw/c1dffb36f91ae781c6749a536b9178a7
[04:03:19] havenwood: sudomarize: Ruby has no macros. It's a compile-time thing. I'd suggest taking a look at Elixir and Crystal macros.
[04:07:05] havenwood: sudomarize: Like a general way to change the code's abstract syntax tree, whatever the syntax, at compile-time.
[04:08:40] havenwood: sudomarize: Matz always has a witty retort at RubyConf when asked if he'll ever add Macros.
[05:30:08] ruby[bot]: +bb shevy!*@*$#ruby-banned *!*@2a02:8388:1600:3280:be5f:f4ff:fecd:7cb2$#ruby-banned
[05:30:09] ruby[bot]: ruby[bot] kicked shevy: offense, see http://ruby-community.com/pages/user_rules
[05:31:22] ruby[bot]: -bb shevy!*@*$#ruby-banned *!*@2a02:8388:1600:3280:be5f:f4ff:fecd:7cb2$#ruby-banned
[05:34:31] shevy: ah if I would have known that before, we could have set up the bot with an april message
[06:26:54] roelof: How can I check if a character is in a range . I tried : (!word.start_with? ('a','e','i','o','u')) but then I see runtime errors on the first "," ?
[07:15:11] arup_r: We have File::basename. so File.basename("/home/gumby/work/ruby.rb") #=> "ruby.rb", but when I have File.new("/home/gumby/work/ruby.rb").what_method will give me the name of the file?
[07:19:13] arup_r: for now I did like, file = File.new("/home/gumby/work/ruby.rb"); File.basename(file.path) .. and it worked. Let me know if better way to get it..
[07:31:47] smathy: arup_r, `f = Pathname.new "/home/gumby/work/ruby.rb"` and then you can `f.basename` and `File.new f`
[08:11:31] ruby[bot]: forcer: ops currently in #ruby: adaedra, aredridel, havenwood, My_Hearing, Radar, apeiros, drbrain, jhass, ljarvis, miah, ruby[bot] and workmad3
[08:12:33] chrislansing: oh sorry i meant to paste this link http://sh.st/Y8b6V they look so similar
[08:12:58] ruby[bot]: +bbb $a:chrislansing$#ruby-banned chrislansing!*@*$#ruby-banned *!*@gateway/web/freenode/ip.184.108.40.206$#ruby-banned
[08:12:58] ruby[bot]: ruby[bot] kicked chrislansing: is a bannable offense, see http://ruby-community.com/pages/user_rules
[08:16:27] Mon_Ouie: I wanted to pick something unusual, so I picked something with a space and a non-ascii character (ï). Then I just adapted it for IRC.
[09:17:25] ruurd: OK help me please how on earth can I get rid of the libv8 dependency. Every time I want to use it it breaks building the native extensions. What is that? A gaping quality problem?
[09:22:21] workmad3: and less needs either therubyracer on MRI or therubyrhino on jruby... it can't use node.js or other external JS runtimes last time I checked
[09:29:54] ruurd: workmad3 I'm using OSX and when I have a look at brew it says v8 is version 4.9.something
[09:32:05] workmad3: ruurd: latest seems to be 220.127.116.11 in rubygems: https://rubygems.org/gems/libv8
[09:33:19] workmad3: or it could be therubyracer is locked to an ancient version because it hasn't been updated in ages
[09:34:22] workmad3: ruurd: personally, I prefer to never delete Gemfile.lock... if I'm curious about something not updating, I find opening it and searching for that gem to be more useful (as the lockfile will list version restrictions underneath the gem they're a dependency of :) )
[10:20:03] ruby[bot]: +bb Guest_98765!*@*$#ruby-banned *!*@gateway/web/cgi-irc/kiwiirc.com/ip.18.104.22.168$#ruby-banned
[10:20:03] ruby[bot]: ruby[bot] kicked Guest_98765: is a bannable offense, see http://ruby-community.com/pages/user_rules
[11:13:10] steve: hey, i did "gem install bundler" and it seems to be working, but when i do "gem list" i don't see bundler's dependencies (e.g. mustache) installed
[11:52:35] ruby[bot]: +bb Guest42536!*@*$#ruby-banned *!*@gateway/web/cgi-irc/kiwiirc.com/ip.22.214.171.124$#ruby-banned
[11:52:36] ruby[bot]: ruby[bot] kicked Guest42536: is a bannable offense, see http://ruby-community.com/pages/user_rules
[11:52:51] ruby[bot]: -bb *!*@gateway/web/freenode/ip.126.96.36.199$#ruby-banned *NIGG3R*!*@*$#ruby-banned
[12:14:22] tom39291: I want to learn Ruby. I know multiple other languages (Python, JS, Scala). Can anyone recommend a suitable resource for learning Ruby that doesn't spend pages explaining if/while/OOP/etc.
[12:21:50] steve: tom39291: http://www.amazon.co.uk/Eloquent-Ruby-Addison-Wesley-Professional-Series-ebook/dp/B004MMEJ36 is good
[13:49:38] roelof: Can someone help me with this problem : https://gist.github.com/rwobben/f27dc15ed4b5204d90c7c017c888bd93
[13:50:06] ruby[bot]: amincd: # => undefined method `iso8601' for 2016-04-02 13:50:05 +0000:Time (NoMethodError) ...check link for more (https://eval.in/546771)
[15:49:14] greengriminal: How do you use Regexp with a gloabl modifier. on the ruby docs: http://ruby-doc.org/core-2.3.0/Regexp.html#method-c-new it supports: Regexp::EXTENDED, Regexp::IGNORECASE, and Regexp::MULTILINE should there not be one for Regexp::GLOBAL?
[16:19:22] shevy: If I redefine an existing method, I will get a warning such as: "warning: method redefined; discarding old initialize", such as in https://gist.github.com/shevegen/4c1bd71facbf7219133d8f5da3a86929 - is there a simple way to modify an existing method without incurring such a warning?
[16:21:57] shevy: I can use undef_method to get rid of an already existing method, but can I get a copy of an old method too?
[16:26:17] shevy: now I narrowed it down to this "foo.rb:22: warning: undefining `initialize' may cause serious problems" hahaha
[16:48:25] smathy: shevy, !fake - your code works fine with no error when pasted into a pry session.
[16:58:04] smathy: Oh, no, I didn't realize you were running in warnings mode, you must have mentioned that before I joined.
[16:58:49] smathy: (or does this channel view `-w` as some sort of "proper" way to run the interpreter? I'm still new here)
[16:58:52] shevy: Hmm I actually forgot to mention that; I also don't see who joins or leaves, sorry
[17:07:05] chridal: We've got a Ruby stack and I need to write some sort of algorithm to rank content that will be displayed in a feed.
[17:07:32] chridal: I will be using Postgres, Redis and Neo4J with different approaches to determine what content might be interesting for you
[17:07:54] chridal: Here's my question; have any of you solved anything like this with Ruby before, and in that case; do you have any resources you'd like to point out?
[17:08:41] chridal: It's a social network and we have different interactions like viewing content, writing comments, and following users
[21:07:18] redasus: I've installed rails, passenger and nginx on an aws ec2 ubuntu server. I've followed the tutorials and started the nginx server. but I'm getting a 404 error when I try to go to the home page.
[21:09:05] smathy: jakelovesvivi, it's off topic, head on over to #rubyonrails if you want to talk about it with redasus
[21:11:19] jakelovesvivi: Im trying to install ruby 2.x, I'm using mint cinnamon and apt-get gives me 1.9.8, I'm a huge linux noob and would like advice, I suppose I'm going to try using a tarball, don't know how yet, but if anybody has an easy fix it would be appreciated
[21:11:57] smathy: jakelovesvivi, yeah, use one of the ruby version tools, although I'd recommend chruby over rvm.
[21:21:59] maranza: begginer...i want to learn it by actually app development...i have programming background though.
[21:24:23] adaedra: http://ruby-community.org/pages/links — maranza: there's some websites with exercices on them to train yourself, like exercism and the koans.
[22:34:59] gemking: I tried pasting my program in the chat but I got banned by accident since I thought the person trying to help me wanted me to put it in the topic
[22:47:32] smathy: ...so you thought "I know what I'll do, I'll ask about C programming in some other totally unrelated channel...." - ffs!