« Back to channel list

#ruby - 02 July 2015

« Back 1 day Forward 1 day »
[00:00:38] drewvans1one: has joined #ruby
[00:01:00] eggoez: has joined #ruby
[00:01:52] GnuYawk: has joined #ruby
[00:01:52] GnuYawk: has joined #ruby
[00:02:33] cbz: has joined #ruby
[00:02:54] CBke: has joined #ruby
[00:06:06] jenrzzz: has joined #ruby
[00:07:25] dseitz: has joined #ruby
[00:09:19] zacstewart: has joined #ruby
[00:09:27] kinduff: trying to reduce this as much as I can
[00:09:29] kinduff: https://gist.github.com/kinduff/a86471d2740e7be08980
[00:10:56] bjornar: has joined #ruby
[00:11:12] kinduff: it's a solving math game by timer
[00:12:08] sarkyniin: has joined #ruby
[00:14:19] Akagi201: has joined #ruby
[00:14:35] Ox0dea: has joined #ruby
[00:14:44] Ox0dea: kinduff: To be clear, you're golfing, right?
[00:15:01] kinduff: any tips? new to this
[00:15:27] mozzarella: { } instead of do end
[00:16:46] al2o3-cr: kinduff: that could possibly be half that
[00:17:44] symm-: has joined #ruby
[00:18:16] al2o3-cr: with practice
[00:18:53] dgutierrez1287: has joined #ruby
[00:19:34] al2o3-cr: kinduff: hackers don't hack into banks by giving up do they?
[00:19:40] snowkidind: has joined #ruby
[00:20:06] snowkidind: poll: to SASS or not to SASS?
[00:20:16] kinduff: al2o3-cr: i wish i was a banker
[00:20:41] bradleyprice: has joined #ruby
[00:21:09] al2o3-cr: kinduff: don't we all
[00:22:35] sevenseacat: has joined #ruby
[00:23:26] CloCkWeRX: has joined #ruby
[00:23:56] al2o3-cr: kinduff: perseverence :)
[00:23:59] grey_beards: has joined #ruby
[00:26:49] snowkidind: has left #ruby: ()
[00:27:06] vikaton: has joined #ruby
[00:27:13] serivichi: has joined #ruby
[00:28:58] zacstewart: has joined #ruby
[00:29:07] ellisTAA: has joined #ruby
[00:29:33] sharpmachine: has joined #ruby
[00:29:56] isxek: has joined #ruby
[00:32:42] howdoicomputer: has joined #ruby
[00:36:37] CBke: has joined #ruby
[00:37:00] Akagi201: has joined #ruby
[00:38:18] stardiviner: has joined #ruby
[00:40:31] gigetoo: has joined #ruby
[00:41:55] roolo_: has joined #ruby
[00:42:01] sankaber: has joined #ruby
[00:43:00] CBke: has joined #ruby
[00:43:00] CBke: has joined #ruby
[00:43:12] jbourassa: has joined #ruby
[00:43:37] ramfjord: has joined #ruby
[00:46:26] Scripore: has joined #ruby
[00:47:35] luckyno7: has joined #ruby
[00:47:42] Spami: has joined #ruby
[00:48:14] zacstewart: has joined #ruby
[00:49:55] zemmihates: has joined #ruby
[00:49:55] jlast: has joined #ruby
[00:51:30] bruno-: has joined #ruby
[00:53:05] Ox0dea: al2o3-cr: I got it down to 167.
[00:53:33] Guest16735: has joined #ruby
[00:54:03] chouhoulis: has joined #ruby
[00:54:49] jpfuentes2: has joined #ruby
[00:55:38] al2o3-cr: Ox0dea: awesome, what was it from?
[00:56:01] dgutierrez1287: has joined #ruby
[00:56:08] baweaver: I smell shenanigans afoot
[00:56:32] Ox0dea: al2o3-cr: It was 350-something when he first posted the link, but he's revised it down to 305 at the moment.
[00:56:54] Ox0dea: baweaver: I solemnly swear that I am up to no good: https://gist.github.com/kinduff/a86471d2740e7be08980
[00:57:08] Ox0dea: Also, I did another one. ^_^
[00:57:12] icarus_: has joined #ruby
[00:57:21] Radar: ACTION loves this recurring theme so much
[00:57:21] Ox0dea: Do you reckon you could still decipher these if I didn't first show an example invocation?
[00:57:57] mrmargolis: has joined #ruby
[00:58:02] JDiPierro: has joined #ruby
[00:58:16] al2o3-cr: Ox0dea: decipher, give over
[00:59:02] s2013: has joined #ruby
[00:59:11] baweaver: I won't eval it at all
[00:59:21] zacstewart: has joined #ruby
[00:59:38] Ox0dea: al2o3-cr: Hm? I was referring to the little non-alphanumeric snippets I've been doing as of late.
[01:00:08] Ox0dea: baweaver: @_=[*?/...?:][(_=$$/$$)..-_]*'';(@__=->__{$_=__[_-_];@_[$_]?$*<<(@_=~/#$_/):(___,$__=$*[-_-_,_+_];$*[-_-_,_+_]=$_[?+]?___+$__:$_[?-]?___-$__:$_[?*]?___*$__:$_[?/]?___/$__:_);__[_]?@__[__[_..-_]]:$*})
[01:00:37] Ox0dea: baweaver: One clue: it takes a string argument.
[01:00:55] RegulationD: has joined #ruby
[01:01:13] al2o3-cr: Ox0dea: you've been doing a lot of them lately
[01:01:21] Ox0dea: This is the fourth.
[01:05:04] Ox0dea: al2o3-cr: Really? It is actually kind of obvious if you happen to spot a certain pattern.
[01:05:34] al2o3-cr: well, you stated the obvious :p
[01:06:16] Ox0dea: Nah, none of the others were as "formulaic" as this one.
[01:06:50] al2o3-cr: so how long did it take you to come up with this one?
[01:06:54] j4cknewt: has joined #ruby
[01:08:19] al2o3-cr: must of took a bit of time considering you are not a computer :P
[01:08:32] ghormoon: has joined #ruby
[01:08:40] Ox0dea: The original took about five minutes, but I knew I was going to give it to baweaver without providing an example, so I spent some time making it more confusing than necessary. :)
[01:09:03] baweaver: already halfway through anyways
[01:09:11] Akagi201: has joined #ruby
[01:09:21] Ox0dea: baweaver: Do you already know what it does?
[01:09:21] baweaver: Not sure what $* is but it starts as an empty array at least.
[01:09:30] Ox0dea: It's a synonym for ARGV.
[01:09:30] al2o3-cr: baweaver: argv
[01:09:51] Ox0dea: I'm glad it didn't prove to be read-only. :)
[01:09:54] al2o3-cr: $$ current process
[01:10:01] lolmaus: has joined #ruby
[01:10:27] al2o3-cr: baweaver: what $@
[01:10:49] baweaver: I'm not playing quiz show while solving this
[01:19:30] baweaver: Trying to figure out what ?+ is achieving with its friends there
[01:20:01] jlast: has joined #ruby
[01:20:28] Radar: That could be the literal character "+"
[01:20:30] baweaver: I want to say it just reverses the string and those are there to be a pain and return nil
[01:20:42] baweaver: yeah, though tha....
[01:20:46] baweaver: son of a gun
[01:21:06] baweaver: did you just make a stack calculator?
[01:21:14] sphex: has joined #ruby
[01:21:15] sevenseacat: rpn or something?
[01:23:04] Ox0dea: It is indeed an RPN calculator.
[01:23:18] Ox0dea: >> @_=[*?/...?:][(_=$$/$$)..-_]*'';(@__=->__{$_=__[_-_];@_[$_]?$*<<(@_=~/#$_/):(___,$__=$*[-_-_,_+_];$*[-_-_,_+_]=$_[?+]?___+$__:$_[?-]?___-$__:$_[?*]?___*$__:$_[?/]?___/$__:_);__[_]?@__[__[_..-_]]:$*})['24+3/3*52+*']
[01:23:19] ruboto: Ox0dea # => [42] (https://eval.in/390719)
[01:23:35] Ox0dea: It's limited to single-digit operands, though. :/
[01:23:54] baweaver: took until I hit the ternary to be able to tell that's what you did
[01:23:57] Ox0dea: I know how to implement #to_i, of course, but handling operator padding made it really ugly.
[01:24:00] baweaver: I was thinking in alpha context
[01:24:44] Ox0dea: It's more of a "quinary", really.
[01:24:56] nettoweb: has joined #ruby
[01:24:57] j416_: has joined #ruby
[01:25:13] Musashi007: has joined #ruby
[01:25:18] Ox0dea: There's *got* to be some way to invoke `eval` or even #send without alphanumerics, but I can't see it. :(
[01:26:02] sevenseacat: I hope you're making a GitHub repo of all of these things Ox0dea, or at least saving them somewhere for people to marvel at
[01:26:19] al2o3-cr: another yusuke endoh, hey
[01:26:48] al2o3-cr: Ox0dea: my got boy, you got talent
[01:28:01] pgatt: has joined #ruby
[01:28:37] nettoweb_: has joined #ruby
[01:28:45] baweaver: https://gist.github.com/baweaver/692dd102a3970bc70ea4
[01:28:54] baweaver: I'll have to clean it up when I get home though
[01:29:06] JeramyRR: has joined #ruby
[01:29:15] Akagi201: has joined #ruby
[01:30:03] al2o3-cr: baweaver: massive applaud (honestly)
[01:30:20] baweaver: I think he's trying to give me a headache now :P
[01:30:20] sharpmachine: has joined #ruby
[01:30:54] Ox0dea: al2o3-cr: No, certainly not. I bow humbly before the likes of Endoh-san.
[01:31:08] al2o3-cr: baweaver: seriously, well done on that
[01:31:16] Radar: baweaver for prex
[01:31:16] Ox0dea: I only used "quinary" to indicate that the branch has five possible targets.
[01:31:23] baweaver: it'll need some cleanup, forgot a ternary on there :D
[01:31:28] Ox0dea: baweaver: Your explanation is not entirely correct. :/
[01:31:38] baweaver: hence the cleanup comment
[01:31:38] Ox0dea: It's not characters that are being pushed into the $* array.
[01:31:57] djbkd: has joined #ruby
[01:31:59] baweaver: that was a quick "I'm at work" lookover.
[01:32:24] Ox0dea: >> d = '8'; '0123456789' =~ /#{d}/
[01:32:25] ruboto: Ox0dea # => 8 (https://eval.in/390732)
[01:32:34] Ox0dea: I'm using that trick to turn digit characters into their actual values.
[01:32:39] baweaver: yeah, position of the chara...
[01:32:48] baweaver: that's one way to do it
[01:32:54] i8igmac: has joined #ruby
[01:32:57] Ox0dea: Isn't it the only way?
[01:33:23] freerobby: has joined #ruby
[01:33:23] Ox0dea: I mean, I could build an actual lookup table, but that'd be much more verbose.
[01:33:40] Ox0dea: > the last two characters of the array $*
[01:33:41] CBke: has joined #ruby
[01:33:44] CBke: has joined #ruby
[01:33:48] Ox0dea: $* never contains characters, was the point I meant to make.
[01:33:54] baweaver: yeah, I caught it.
[01:34:40] al2o3-cr: Ox0dea: and that took 5 minutes?
[01:34:51] baweaver: nth fibbonaci would be a bit easy, trying to think of a more interesting one.
[01:35:04] Ox0dea: I think I'll give your DL suggestion a go.
[01:35:18] Ox0dea: Damerau-Levenshtein?
[01:35:27] baweaver: god speed, that'll be hard.
[01:35:32] baweaver: and requires a wordlist
[01:36:34] sevenseacat: levenshtein doesnt require a wordlist
[01:36:40] baweaver: the DL algorithm just gets the distance between two words
[01:36:42] tuelz: has joined #ruby
[01:36:44] sevenseacat: just comparing each char of two words
[01:36:53] sevenseacat: (dont know what the damerau part is)
[01:36:58] baweaver: transposition
[01:37:07] sevenseacat: that makes it harder
[01:37:12] baweaver: the original didn't have it
[01:38:04] Ox0dea: I won't be able to demonstrate it via ruboto, since it'll need to receive the word list as an argument.
[01:38:14] baweaver: it won't need it
[01:38:22] baweaver: only needs to find distance between two words
[01:38:47] baweaver: such as lev_distance('foo', 'moo') -> 1
[01:39:13] bonhoeffer: has joined #ruby
[01:39:16] Ox0dea: Yeah, I was wondering why you'd mentioned requiring a word list, actually.
[01:39:38] baweaver: half asleep
[01:39:45] baweaver: >> require 'levenshtein'
[01:39:46] ruboto: baweaver # => cannot load such file -- levenshtein (LoadError) ...check link for more (https://eval.in/390734)
[01:39:53] baweaver: didn't think so
[01:40:05] Radar: it's available here https://rubygems.org/gems/text
[01:40:19] Oog: has joined #ruby
[01:40:25] baweaver: levenshtein-ffi as well
[01:40:32] baweaver: I thought there might have been a built in
[01:40:43] sevenseacat: i thought there was
[01:40:51] Ox0dea: Well, there's one in RubyGems.
[01:41:10] sevenseacat: it appears its not, but theres lots of gems for it
[01:41:19] sevenseacat: including https://rubygems.org/gems/damerau-levenshtein/versions/1.1.0
[01:41:34] baweaver: require 'text'
[01:41:37] baweaver: >> require 'text'
[01:41:38] ruboto: baweaver # => cannot load such file -- text (LoadError) ...check link for more (https://eval.in/390735)
[01:41:51] Ox0dea: >> require 'rubygems/text'
[01:41:52] ruboto: Ox0dea # => true (https://eval.in/390736)
[01:42:15] Eiam: has joined #ruby
[01:42:21] baweaver: >> require 'rubygems/text'; Text::Levenshtein.distance('test', 'test')
[01:42:22] ruboto: baweaver # => uninitialized constant Text (NameError) ...check link for more (https://eval.in/390737)
[01:42:45] baweaver: ACTION shrugs
[01:42:51] Ox0dea: >> require 'rubygems/text'; include Gem::Text; levenshtein_distance('foo', 'moo')
[01:42:53] ruboto: Ox0dea # => 1 (https://eval.in/390738)
[01:42:57] baweaver: well, time for me to head home and get some food stuffs
[01:43:05] baweaver: I swear you know black magic
[01:43:12] Ox0dea: Enjoy your foodstuffs.
[01:45:09] phutchins1: has joined #ruby
[01:45:15] auzty: has joined #ruby
[01:45:37] _kfpratt: has joined #ruby
[01:48:24] lolmaus: has joined #ruby
[01:48:53] Eiam: has joined #ruby
[01:50:26] tkuchiki_: has joined #ruby
[01:50:30] Musashi007: has joined #ruby
[01:53:15] momomomomo: has joined #ruby
[01:55:35] nofxx: is there some way to run all tasks in a namespace? in their order
[01:55:53] Radar: nofxx: not without defining another task that explicitly calls them afaik
[01:56:24] nofxx: Radar, boring... I'm using a not so beautiful trick: an :all task inside, so I dont need to namespace each task from outside
[01:56:40] nofxx: I mean, outside: 'namespace:task' , inside: :task , way better
[01:57:21] nofxx: all that so rake -T looks good... foo foo:a foo:b instead of foo:all foo:a foo:b
[01:58:00] nofxx: well, and the actual USE too.. hehe
[01:59:04] Ox0dea: >> "#{1.0/9899}".scan(/\d\d/).map(&:to_i)
[01:59:05] ruboto: Ox0dea # => [0, 1, 1, 2, 3, 5, 8, 13, 21, 35] (https://eval.in/390739)
[01:59:07] chihhsin: has joined #ruby
[01:59:13] Ox0dea: I think that's neat.
[01:59:45] CloCkWeRX: has joined #ruby
[01:59:45] serivichi: has joined #ruby
[01:59:54] Radar: Too bad the last number is wrong.
[02:00:00] Ox0dea: God-damned floating point.
[02:00:02] Ox0dea: sevenseacat: http://www.futilitycloset.com/2015/06/28/made-to-order-4/
[02:00:32] Ox0dea: Essentially, you can just keep adding a 9 at either end of the divisor to get more and more Fibonacci numbers.
[02:00:52] sevenseacat: thats..... I am amazed.
[02:00:58] sevenseacat: who *finds* this shit?
[02:01:33] Ox0dea: Math is frighteningly elegant.
[02:02:57] bruno-: has joined #ruby
[02:04:39] Jarboe: has joined #ruby
[02:05:54] Ox0dea: I can't make BigDecimal do the big one. :/
[02:07:15] Ox0dea: >> require 'bigdecimal'; (BigDecimal.new('1', 10000) / 999999999999999999999998999999999999999999999999).to_s('F').size
[02:07:16] ruboto: Ox0dea # => 146 (https://eval.in/390751)
[02:07:31] Aryasam: has joined #ruby
[02:07:33] jeanlinux: has joined #ruby
[02:07:54] Ox0dea: > A limit of 0, the default, means no upper limit.
[02:09:08] aphprentice_: has joined #ruby
[02:11:22] CBke: has joined #ruby
[02:11:22] CBke: has joined #ruby
[02:13:55] Ox0dea: >> require 'bigdecimal'; BigDecimal.new('1').div(('9'*47).tap{|s|s[23,0]='8'}.to_i, 1000).to_s('F').scan(/\d{24}/).map(&:to_i)
[02:13:56] AHMED-: has joined #ruby
[02:13:56] ruboto: Ox0dea # => [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17 ...check link for more (https://eval.in/390752)
[02:14:31] AHMED-: has left #ruby: ()
[02:17:46] Nilium: Oh dear, is Ox0dea doing it again
[02:17:56] Ox0dea: Nilium: You missed it.
[02:18:18] Aeyrix: Nilium: You say that like it's a bad thing.
[02:18:20] Aeyrix: I think it's hilarious.
[02:18:46] Nilium: At this point, I think this might be what I look forward to when I come home from work.
[02:19:44] dgutierrez1287: has joined #ruby
[02:20:07] grey_beard: has joined #ruby
[02:20:51] jtdoncas: has joined #ruby
[02:21:58] gambl0re: is ruby similar to python?
[02:22:15] gambl0re: did they copy python?
[02:22:38] charliesome: has joined #ruby
[02:22:51] bf4: has joined #ruby
[02:23:00] Nilium: Yes. Obviously.
[02:23:01] Aeyrix: it copied python p hard
[02:23:07] Aeyrix: sevenseacat: lol it's 100% python
[02:23:10] Aeyrix: obviously
[02:23:12] Nilium: Ruby is actually implemented in PHP.
[02:23:14] Aeyrix: self.selfselfselfself(self)
[02:23:36] Aeyrix: Nilium: Everyone I know uses the variant implemented in Erlang though.
[02:23:38] Aeyrix: It's faster.
[02:23:57] Nilium: I know a few people using the runtime that was implemented in asm.php
[02:24:02] Aeyrix: Wow really?
[02:24:07] Aeyrix: I should get on that.
[02:24:09] Nilium: Supposedly it's web scale.
[02:24:11] Aeyrix: Pure assembly, wow.
[02:24:29] gambl0re: why did ruby decide to copy pyhthon?
[02:24:35] gambl0re: for what reason specifically?
[02:24:38] Aeyrix: Python was a dumb name.
[02:24:46] chouhoulis: has joined #ruby
[02:24:56] sevenseacat: let's not be too stupid. Ruby did not 'copy python'.
[02:25:00] Nilium: They decided that calling themselves pythonistas was really stuck and honestly insane, so they renamed it and changed the syntax.
[02:25:04] Nilium: *stuck up
[02:25:06] Aeyrix: Nilium: kek
[02:25:12] cashnguns: has joined #ruby
[02:25:14] Aeyrix: So now we call ourselves Rubyists.
[02:25:26] gambl0re: they syntax is very simialr i noticed...
[02:25:32] Nilium: That's why Go copied Ruby and started calling themselves gophers, just to be ironic.
[02:25:39] Aeyrix: gambl0re: Somewhat, but that's a side effect of being easy to read.
[02:25:43] Nilium: And then PHP copied Go.
[02:25:45] Aeyrix: It's not super similar, you'd be surprised.
[02:26:21] Nilium: I just assume anyone saying Ruby copied something is not sincere in their questioning.
[02:27:29] Nilium: Oh, for the first time today someone saw my left leg and asked what happened to it
[02:27:38] Nilium: I've been waiting 26 years for someone to do that
[02:27:42] Oog: has joined #ruby
[02:27:43] Aeyrix: What happened to it?
[02:27:51] sevenseacat: err, whats with your left leg?
[02:27:51] Nilium: Well, I was born, and that happened to it
[02:28:01] Aeyrix: You don't have a left leg?
[02:28:03] Aeyrix: Are you all right now?
[02:28:14] Nilium: The skin color on it is different from the rest of my body.
[02:28:27] Aeyrix: I got nothing.
[02:28:35] Nilium: Not like drastically different, but it's either all red or all purple most of the time.
[02:28:41] Aeyrix: Birthmark
[02:28:51] Nilium: Port-wine stain or whatever.
[02:29:40] kfpratt: has joined #ruby
[02:29:48] Nilium: I rarely wear shorts, so most people never see it.
[02:30:05] Aeyrix: I don't wear shorts either, but just because I prefer longer pants.
[02:30:06] Nilium: But it's too freakin' hot lately
[02:30:12] Aeyrix: Despite the fact that shorts are
[02:30:15] Aeyrix: and easy to wear
[02:30:22] Aeyrix: I still prefer longer pants.
[02:30:27] Aeyrix: gambl0re: https://gist.github.com/Aeyrix/f8442f17c35e3a25df0f
[02:30:30] Aeyrix: Python vs Ruby.
[02:30:34] Aeyrix: Just a very, very simple example.
[02:30:39] drewvanstone: has joined #ruby
[02:30:42] Nilium: Needs more generators
[02:30:54] Aeyrix: I picked literally the simplest example I can think of that didn't involve memes.
[02:31:26] ooesili: has joined #ruby
[02:31:26] sharpmachine: has joined #ruby
[02:31:48] bmurt: has joined #ruby
[02:31:51] jbw: has joined #ruby
[02:32:21] Nilium: >> puts %w[ banana apple mango ].map { |f| "Current fruit: #{f}" }
[02:32:22] ruboto: Nilium # => Current fruit: banana ...check link for more (https://eval.in/390754)
[02:33:19] Aeyrix: >> 10.times do |That's a fucking mess though.
[02:33:21] ruboto: Aeyrix # => /tmp/execpad-a9b6f85c95d5/source-a9b6f85c95d5:2: formal argument cannot be a constant ...check link for more (https://eval.in/390755)
[02:33:26] Aeyrix: thanks clipboard
[02:33:50] Aeyrix: >> 10.times {|i| puts i }
[02:33:51] ruboto: Aeyrix # => 0 ...check link for more (https://eval.in/390756)
[02:33:54] Aeyrix: nothing like that in Python. :^)
[02:34:43] Nilium: I think you could do print("\n".join("Current fruit: %s" % f for f in ['banana', 'apple', 'mango'])) in python
[02:34:54] sevenseacat: jesus wtf is that
[02:34:57] Nilium: I don't remember what the not-politically-volatile string formatting thing in Python is
[02:34:58] Aeyrix: absolutelydisgusting.jpg
[02:35:13] Aeyrix: We need a bot that takes those and turns them into images.
[02:35:23] Ox0dea: The keyboard I use doesn't have any numbers or letters on it, so I have to go to great lengths to copy the characters I need when programming in Python.
[02:35:28] Ox0dea: Ruby, of course does not give me that problem.
[02:36:03] Nilium: I see you follow the _why school of keyboarding.
[02:36:40] Aeyrix: When Ox does a oneliner it's awesome, when anyone does a Python oneliner it's horrendous.
[02:36:49] Aeyrix: Also lol mandatory whitespace
[02:37:10] sevenseacat: i dont mind mandatory whitespace.
[02:37:25] Nilium: I do, but that's just because I prefer curly braces
[02:37:28] Aeyrix: Encouraged but not mandatory.
[02:37:37] Aeyrix: I can also see why tabs are a good idea.
[02:37:43] Nilium: I think Python has a flag that lets you use curly braces
[02:37:43] Aeyrix: It means you can allow people to set their own indentation width.
[02:38:01] Ox0dea: Nilium: It's a joke.
[02:38:04] Aeyrix: If someone wants to read a codebase with indentation set to eight spaces, more power to them.
[02:38:15] Nilium: Ox0dea: Nothing is a joke if I can turn it on
[02:38:17] sevenseacat: but then people inevitably mix tabs and spaces, and shit goes to hell.
[02:38:29] Ox0dea: >>> from __future__ import braces
[02:38:29] ruboto: Ox0dea # => /tmp/execpad-f17f2045b445/source-f17f2045b445:2: syntax error, unexpected '>' ...check link for more (https://eval.in/390757)
[02:38:30] chipotle: has joined #ruby
[02:38:30] Ox0dea: File "<stdin>", line 1
[02:38:32] Ox0dea: SyntaxError: not a chance
[02:38:47] Nilium: Can you catch it?
[02:38:50] Aeyrix: sevenseacat: There's a git flag for that.
[02:39:03] Aeyrix: sevenseacat: Which imo should be default.
[02:39:12] slash_nick: Aeyrix: can you point me to that?
[02:39:13] Nilium: Insert my usual praise for gofmt here
[02:39:18] Ox0dea: Nilium: It doesn't actually import anything...
[02:39:25] Nilium: Ox0dea: I'll make it ???_???
[02:39:37] Nilium: If I can give Python people nightmares, it's worth it.
[02:39:43] Aeyrix: slash_nick: Courtesy of a friend - https://gist.github.com/eevee/6721177
[02:39:49] ejnahc: has joined #ruby
[02:40:07] Ox0dea: Aeyrix: Do you know Alex well?
[02:40:19] Aeyrix: They're pretty cool, I wish I knew them better.
[02:40:33] Aeyrix: But unfortunately I don't use Python enough to interact beyond Twitter. :P
[02:40:36] Aeyrix: Other than the Pokemon stuff.
[02:40:47] slash_nick: Aeyrix: neat... i don't have any real need for it right now, but it piqued my curiousity
[02:40:48] Aeyrix: I used to idle on Veekun IRC a lot but I had little in way of contribution.
[02:41:11] Aeyrix: Ox0dea: You?
[02:41:26] Ox0dea: I've spoken with him on occasion.
[02:41:41] Ox0dea: We got into a spat about Ruby vs. Python many moons ago.
[02:41:46] Aeyrix: I can imagine you would.
[02:41:52] Aeyrix: Alex is a major python fan.
[02:42:14] Ox0dea: It seems he doesn't hate Ruby, but Python just "fits his brain" better.
[02:42:19] Aeyrix: Pretty much.
[02:44:37] Ox0dea: Aeyrix: Dat love pentagon doe.
[02:44:44] Aeyrix: I think that uh
[02:44:46] Aeyrix: cleaned up a bit
[02:44:47] Aeyrix: i'm not sure
[02:44:52] Aeyrix: ACTION checks
[02:44:57] Ox0dea: I have no idea how such a thing could be sustained.
[02:45:09] lessless: has joined #ruby
[02:45:44] Aeyrix: Ox0dea: Nope, still there.
[02:45:46] Aeyrix: http://eev.ee/about/
[02:45:51] Aeyrix: Neither, but props for making it work.
[02:47:43] sevenseacat: "I live in Las Vegas with my ridiculous cat, my partner, her three cats, her husband, his dog, and our boyfriend." wow
[02:48:23] bradleyp_: has joined #ruby
[02:49:15] sevenseacat: I got nothin.
[02:50:45] Musashi007: has joined #ruby
[02:52:21] ivanskie: has joined #ruby
[02:53:31] Ox0dea: sevenseacat: Heh, I forgot that it was a graph.
[02:53:41] Ox0dea: So, five nodes, but not exactly a pentagon.
[02:53:43] darkf: has joined #ruby
[02:53:45] dopie: has joined #ruby
[02:53:48] Ox0dea: Five edges, rather.
[02:54:11] bradleyprice: has joined #ruby
[02:54:14] SpikeMaster: has joined #ruby
[02:54:23] sevenseacat: ACTION trying to wrap brain around that
[02:54:45] Ox0dea: Well, there are four people involved, but one of them ("our boyfriend") is connected twice.
[02:55:13] sevenseacat: the husband must be a hell of a voyeur.
[02:55:20] SpikeMaster: has left #ruby: ("ERC Version 5.3 (IRC client for Emacs)")
[02:56:10] eggoez: has joined #ruby
[02:56:19] Ox0dea: However you cut it, Eevee's an interesting fella.
[02:56:27] sevenseacat: sounds like it
[02:58:10] jack_rabbit: has joined #ruby
[02:59:15] ryba: has joined #ruby
[02:59:45] baweaver: has joined #ruby
[03:00:43] sankaber: has joined #ruby
[03:01:05] RegulationD: has joined #ruby
[03:01:15] scx_: has joined #ruby
[03:01:18] ravensky987: has joined #ruby
[03:02:14] konsolebox: has joined #ruby
[03:02:16] cbz: has joined #ruby
[03:02:16] cbz: has joined #ruby
[03:03:54] vdamewood: has joined #ruby
[03:04:20] isxek: has joined #ruby
[03:07:02] northfurr: has joined #ruby
[03:07:45] zacstewart: has joined #ruby
[03:08:32] jeanlinux: has joined #ruby
[03:08:39] Trynemjoel: has joined #ruby
[03:10:18] braincrash: has joined #ruby
[03:12:36] Musashi007: has joined #ruby
[03:12:45] s2013: has joined #ruby
[03:13:26] CBke: has joined #ruby
[03:13:26] CBke: has joined #ruby
[03:15:11] zacstewart: has joined #ruby
[03:18:02] sarkyniin: has joined #ruby
[03:20:45] nofxx: there this sign cmd tool that asks for password, I'm calling it via rake sh('command...) It's possible to send something to the command STDIN?
[03:20:52] j4cknewt: has joined #ruby
[03:21:34] ravensky987: has left #ruby: ("Leaving")
[03:21:54] nofxx: using #sh... or I'm going to need popen
[03:22:27] MEATCHICKEN: is there a performance difference between a method and a stored proc?
[03:22:50] Ox0dea: nofxx: Are you opposed to just using a pipe in the #sh call?
[03:22:56] nofxx: meatchicken, benchmark a million and let us now. bmbm {}
[03:23:14] MEATCHICKEN: nofxx, good call
[03:23:38] ramfjord: has joined #ruby
[03:24:12] nofxx: Ox0dea, I admit, my dark side shell skills are rusty. Thank, think I got the idea.
[03:24:19] hahuang65: has joined #ruby
[03:25:15] Ox0dea: nofxx: It's not the greatest, but sh("#{input} | command") should do in a pinch.
[03:29:16] gix: has joined #ruby
[03:31:02] Ox0dea: meatchicken: It's unclear what exactly you might've meant by "stored proc", but this should be informative either way: https://gist.github.com/0x0dea/1fb2ef1796ce4a3e8dc5
[03:31:07] yfeldblum: has joined #ruby
[03:31:11] dgutierrez1287: has joined #ruby
[03:31:21] jhooker: has joined #ruby
[03:31:36] kfpratt: has joined #ruby
[03:32:27] sharpmachine: has joined #ruby
[03:39:41] zacstewart: has joined #ruby
[03:40:05] d0lph1n98: has joined #ruby
[03:41:06] luckyno7: has joined #ruby
[03:43:04] bmurt: has joined #ruby
[03:45:24] MEATCHICKEN: nofxx, thanks. Proc is almost double slower
[03:48:00] Scripore: has joined #ruby
[03:48:14] Eiam_: has joined #ruby
[03:48:54] Santana: has joined #ruby
[03:50:06] ponga: has joined #ruby
[03:51:24] jfarmer: meatchicken Why do you think Proc.call is so much slower than calling a method directly?
[03:51:31] jfarmer: Assuming that's what you're benchmarking.
[03:51:43] MEATCHICKEN: jfarmer, there's probably interpreter optimizations for calling a method
[03:51:53] MEATCHICKEN: vs an object-based proc?
[03:52:01] MEATCHICKEN: :P that would be my guess
[03:52:19] jfarmer: e.g., "def test1; return nil; end" and "test1()" vs. "test2 = Proc.new { nil }" and "test2.call()"
[03:52:53] MEATCHICKEN: jfarmer, https://gist.github.com/anonymous/1c1d453718c20cd6f320
[03:53:28] MEATCHICKEN: I don't instantiate the proc
[03:53:31] Ox0dea: meatchicken: You really should use benchmark/ips.
[03:53:34] jfarmer: Yes you do.
[03:53:35] MEATCHICKEN: in the benchmark
[03:53:43] Ox0dea: Instructions per second.
[03:54:02] bruno-: has joined #ruby
[03:54:03] MEATCHICKEN: Ox0dea, I'll take a look at it - is it in the benchmark module?
[03:54:09] Ox0dea: No, it's a gem.
[03:54:20] MEATCHICKEN: jfarmer, for my use-case -> the proc will be pre-declared
[03:54:40] jfarmer: meatchicken Yes, that's what I was assuming you meant.
[03:55:13] MEATCHICKEN: I'll take a look at ips
[03:55:45] Marisa_: has joined #ruby
[03:58:16] hahuang65: has joined #ruby
[04:01:56] havenwood: has joined #ruby
[04:02:11] RegulationD: has joined #ruby
[04:02:57] Spami: has joined #ruby
[04:03:26] hahuang65: has joined #ruby
[04:06:03] m3_del: has joined #ruby
[04:06:13] jpfuentes2: has joined #ruby
[04:07:32] danielpclark: has joined #ruby
[04:07:39] shadoi: has joined #ruby
[04:08:11] icosa1: has joined #ruby
[04:09:16] futilegames: has joined #ruby
[04:11:21] swgillespie: has joined #ruby
[04:12:38] qiukun: has joined #ruby
[04:12:53] zacstewart: has joined #ruby
[04:14:58] Frem: has joined #ruby
[04:15:07] ellisTAA: has joined #ruby
[04:17:50] braincra-: has joined #ruby
[04:18:10] MatthewsFace: has joined #ruby
[04:19:31] towski_: has joined #ruby
[04:22:27] Deele: has joined #ruby
[04:23:50] chinmay_dd: has joined #ruby
[04:24:27] drefined: has joined #ruby
[04:27:53] stoodfarback: has joined #ruby
[04:30:43] kfpratt: has joined #ruby
[04:31:35] jenrzzz: has joined #ruby
[04:31:37] ledestin: has joined #ruby
[04:33:03] sharpmachine: has joined #ruby
[04:33:26] ellisTAA: has joined #ruby
[04:40:02] peter_paule: has joined #ruby
[04:41:35] MrJiks: has joined #ruby
[04:42:19] MrJiks: Is there a pastebin like too for this channel? I saw something similar in nginx channel
[04:42:36] sevenseacat: see the channel topic
[04:43:32] momomomomo: use gist.github.com
[04:43:41] helpa: Read the topic. It contains useful information. Failure to read the topic will result in horrible consequences.
[04:50:06] kfpratt: has joined #ruby
[04:51:26] Sembei: has joined #ruby
[04:54:01] Xeago: has joined #ruby
[04:55:04] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[04:55:29] havenwood: https://github.com/radar/guides/blob/master/using-gist.markdown#readme
[04:56:21] eggoez: has joined #ruby
[04:57:17] konsolebox: quick question: in irb, main is an instance of Object correct? just need verification
[04:57:18] mrmargolis: has joined #ruby
[04:57:22] jeanlinux: has joined #ruby
[04:58:17] havenwood: >> self.instance_of? Object
[04:58:18] ruboto: havenwood # => true (https://eval.in/390780)
[04:58:22] havenwood: konsolebox: https://banisterfiend.wordpress.com/2010/11/23/what-is-the-ruby-top-level/
[04:58:52] jaygen_: has joined #ruby
[04:59:30] ruboto: havenwood # => main (https://eval.in/390781)
[04:59:34] konsolebox: havenwood: thanks. no need for the link self.instance_of? or even just self was all i needed to remember :) lol pretty obvious :)
[04:59:38] keen___________9: has joined #ruby
[05:00:18] kies^: has joined #ruby
[05:00:25] jfarmer: konsolebox Virtually every object in Ruby is an instance of Object
[05:00:28] havenwood: konsolebox: I thought maybe you didn't know how to check yourself since you're asking.
[05:00:37] Ox0dea: jfarmer: "Virtually"?
[05:00:44] Ox0dea: Everything you can call a method on is an instance of Object.
[05:01:24] havenwood: >> BasicObject.instance_of? Object
[05:01:25] ruboto: havenwood # => false (https://eval.in/390782)
[05:01:26] jfarmer: BasicObject
[05:01:42] Ox0dea: >> BasicObject.is_a?(Object)
[05:01:43] ruboto: Ox0dea # => true (https://eval.in/390783)
[05:02:03] jfarmer: An instance of BasicObject wouldn't be descended from Object
[05:02:25] jfarmer: In fact, there wouldn't even be an is_a? method
[05:02:35] jfarmer: >> BasicObject.new.is_a?(Object)
[05:02:36] ruboto: jfarmer # => undefined method `is_a?' for #<BasicObject:0x421b4350> (NoMethodError) ...check link for more (https://eval.in/390784)
[05:02:42] zacstewart: has joined #ruby
[05:02:58] bluOxigen: has joined #ruby
[05:03:41] Ox0dea: Well, 2.3 provides BasicObject.instance, which is_a? Object.
[05:03:49] yosafbridge: has joined #ruby
[05:05:40] jfarmer: what the what
[05:05:51] jfarmer: ACTION shrugs.
[05:05:52] workmad3: has joined #ruby
[05:06:00] qiukun: has joined #ruby
[05:06:20] ferr: has joined #ruby
[05:06:50] jfarmer: konsolebox Net of it is: every referenceable thing you'll deal with in practice is an instance of Object
[05:07:29] jfarmer: I feel like if I said "Every object in Ruby is an instance of Object" someone else would've just piped up and said, "Nut uh! What about BasicObject?!?" Haha.
[05:07:41] konsolebox: jfarmer: i know the deep concepts of Objects and Classes. just forgot about self :)
[05:07:41] skade: has joined #ruby
[05:07:55] Ox0dea: konsolebox: That sounds oxymoronic.
[05:07:59] konsolebox: >> self.class
[05:08:00] ruboto: konsolebox # => Object (https://eval.in/390787)
[05:08:40] jfarmer: konsolebox Yeah, when you're in irb you're in a sort of Object-shaped snow globe.
[05:08:48] penzur: has joined #ruby
[05:08:55] ponga: has joined #ruby
[05:09:00] jfarmer: Pretty literally, since irb is evaluating what you type in the context of some ad hoc Object it creates (I don't know the details).
[05:09:14] Ox0dea: self is main at the top level whether or not you're in irb.
[05:09:28] konsolebox: jfarmer: i actually just need to base it for evaluating user-input code
[05:09:39] jfarmer: Oh, huh. Not sure why I never realized that.
[05:09:47] krz: has joined #ruby
[05:11:14] konsolebox: Ox0dea, jfarmer: now i'm looking for a default global reference to main, and see if i wouldn't need to have $main = self in ::
[05:11:15] EasyCo: has joined #ruby
[05:11:44] jfarmer: (spidey sense is tingling)
[05:11:52] jfarmer: (on high alert)
[05:12:22] konsolebox: because the "evaluator" is in a module
[05:12:25] psyprus: has joined #ruby
[05:13:44] Ox0dea: You shouldn't need that, but of course I'm going to help you find a way.
[05:14:01] Musashi007: has joined #ruby
[05:14:20] Ox0dea: >> class<<self;undef to_s end;def method_missing(m,*a)a.shift.send(m,*a)end; to_i(reverse(to_s(123, 13)))
[05:14:21] ruboto: Ox0dea # => 69 (https://eval.in/390788)
[05:14:24] baweaver: ACTION couldn't help it
[05:14:26] Ox0dea: We Lisp yet?
[05:15:14] jfarmer: konsolebox Waving security and sandboxing issues aside, when you're evaluating dynamically generated code you want to use something like module_eval
[05:15:29] konsolebox: jfarmer: i thought so
[05:15:31] jfarmer: (that's a big wave, too)
[05:15:51] snockerton: has joined #ruby
[05:16:13] konsolebox: jfarmer: first, the application has same level as common userland applications. second it doesn't escalate privileges.
[05:16:28] Ox0dea: konsolebox: That means it can nerf $HOME.
[05:16:29] MatthewsFace: has joined #ruby
[05:16:32] baweaver: well that killed pry
[05:16:35] dseitz: has joined #ruby
[05:16:40] konsolebox: Ox0dea: well, the user has access to $HOME anyway
[05:16:48] jfarmer: konsolebox Yeah, if you're "serious" about this you need isolation at other levels, too.
[05:16:54] jfarmer: As an example...
[05:17:00] konsolebox: i don't believe much in application-level security
[05:17:19] jfarmer: For a long time on Heroku, you could do "console.log(system('ps aux'))"
[05:17:30] haraoka: has joined #ruby
[05:17:32] jfarmer: And see a list of other running processes, go ferret around in their code, and so on
[05:17:48] frenda: has joined #ruby
[05:18:12] baweaver: >> eval(`wget https://gist.githubusercontent.com/baweaver/2fe2b4ae84d521c5f019/raw/193df0b550b7a2b141d56f3d609812997fc10d45/test.rb`)
[05:18:13] ruboto: baweaver # => (https://eval.in/390789)
[05:18:20] konsolebox: guys i'm just porting this software :) http://sourceforge.net/projects/playshell/
[05:18:28] konsolebox: security is not essential to it
[05:18:29] Ox0dea: baweaver: It doesn't network.
[05:18:46] jfarmer: it's a regular wall flower
[05:18:48] baweaver: I was going to shim a microlisp into gist and load it
[05:19:06] Ox0dea: Methinks we could use a few more evaluators around here.
[05:19:25] konsolebox: irb does eval, should you hate it?
[05:20:12] baweaver: pry is better :D
[05:20:28] frenda: http://stackoverflow.com/a/1665023/2871967 --> Here is told to link /var/lib/gem/1.8/... to the PATH. but in my machin I think gems are installed in ~/.gem folder. How can I add it? It's because I get this error when I'm gong to run `rake db:create db:migrate db:seed`
[05:20:29] frenda: bash: rake: command not found
[05:20:50] Ox0dea: frenda: export PATH=~/.gem:$PATH
[05:20:59] Ox0dea: Put that in your .bash_profile, then logout and log back in.
[05:21:37] jfarmer: frenda Any time you're reading an answer on the web be sensitive to the date / timestamp
[05:21:50] frenda: bash_profile or .bashrc! my bash_profile is empty?!
[05:22:07] jfarmer: That answer was posted in 2009 and that alone means the risk of the information being wildly incorrect or out of date is very high.
[05:22:28] Ox0dea: frenda: You get to un-empty it, then! :)
[05:22:33] snockerton: in irb, how can I see what objects are instantiated in memory?
[05:22:50] Ox0dea: frenda: You'll need to go into ~/.gem and figure out the exact path to its bin/ directory, though.
[05:22:58] Ox0dea: That's the one you'll want to prepend to your $PATH.
[05:23:02] jfarmer: snockerton There are a lot, so you likely are looking to ask a more specific question. But broadly the ObjectSpace module gives you access to that sort of thing.
[05:23:10] jfarmer: snockerton http://ruby-doc.org/core-2.2.0/ObjectSpace.html
[05:23:13] frenda: So you mean : <package manager> install rake? @lfarmer
[05:23:25] jfarmer: frenda "gem install rake"
[05:23:34] jeanlinux: has joined #ruby
[05:23:54] jfarmer: If your development environment is set up correctly, that's all that should be necessary.
[05:24:24] jeanlinux: has joined #ruby
[05:24:49] jfarmer: frenda But more broadly, just saying: if you're reading some blog post or SA answer pay close attention to the date.
[05:24:53] niemcu: has joined #ruby
[05:24:54] jfarmer: It's almost always the first thing I look at.
[05:25:13] frenda: By "gem install rake" it solvesd. @jfarmer. tnx
[05:25:48] jfarmer: well that's a pleasant surprise haha
[05:26:14] Xzanron: has joined #ruby
[05:26:22] djbkd: has joined #ruby
[05:26:42] frenda: And 'rails server'! Is it somthing install-able by `gem install`?
[05:27:10] snockerton: jfarmer: exactly what i'm looking for, thanks
[05:27:25] jfarmer: frenda http://guides.rubygems.org/rubygems-basics/
[05:27:47] jfarmer: frenda Actually, start here: http://guides.rubygems.org/
[05:28:01] jfarmer: Oh, that's a weird order.
[05:28:09] frenda: has left #ruby: ()
[05:28:09] jfarmer: Having "RubyGems Basics" before "What is a Gem?" haha
[05:28:42] revath: has joined #ruby
[05:28:47] jeanlinux: has joined #ruby
[05:30:17] lxsameer: has joined #ruby
[05:30:18] lxsameer: has joined #ruby
[05:31:17] astrobunny: has joined #ruby
[05:32:26] futilegames: has joined #ruby
[05:33:14] CBke: has joined #ruby
[05:33:44] fsvehla: has joined #ruby
[05:33:50] sharpmachine: has joined #ruby
[05:34:26] fella5s: has joined #ruby
[05:34:53] tlarevo: has joined #ruby
[05:35:16] abuzze: has joined #ruby
[05:36:10] SOLDIERz: has joined #ruby
[05:36:12] konsolebox: so elementary concepts aside, there's no other way to refer to main from a module or another object's context other than by saving it on a global variable or constant?
[05:43:11] Ox0dea: >> ObjectSpace.each_object.find { |x| !x.is_a?(String) && x.to_s == 'main' rescue next }
[05:43:12] ruboto: Ox0dea # => main (https://eval.in/390798)
[05:43:13] Ox0dea: konsolebox: ^
[05:43:47] tagrudev: has joined #ruby
[05:44:20] ahmetkapikiran: has joined #ruby
[05:45:37] konsolebox: Ox0dea: that's a pretty good one thanks.
[05:45:41] j4cknewt: has joined #ruby
[05:45:47] flughafen: morning everybody
[05:45:53] konsolebox: Ox0dea: so it's official that main.to_s is 'main'?
[05:46:11] Ox0dea: konsolebox: Yes.
[05:46:21] Ox0dea: >> self.to_s
[05:46:22] ruboto: Ox0dea # => "main" (https://eval.in/390801)
[05:46:35] konsolebox: Ox0dea: ok that's one i need. thank you for helping again :)
[05:46:35] Ox0dea: 18>> self.to_s
[05:46:36] ruboto: Ox0dea # => "main" (https://eval.in/390802)
[05:46:41] Ox0dea: konsolebox: My pleasure.
[05:47:28] Ox0dea: konsolebox: You may want to reverse the order of the condition if you'll be calling this a lot.
[05:47:43] Ox0dea: There are fewer things which #to_s to 'main' than there are Strings, I'm sure.
[05:48:51] revath: has joined #ruby
[05:48:51] havenwood: has joined #ruby
[05:49:38] Ox0dea: Nah, I guess it doesn't matter all that much; main is bound to appear quite early in the list.
[05:49:44] konsolebox: Ox0dea: no i'll just need to call it once. i could save it on a class variable. i just don't like running the code somewhere globally, or passing it as an argument to main()
[05:55:33] yardenbar: has joined #ruby
[05:57:50] eGGsha: has joined #ruby
[05:58:02] revath: has joined #ruby
[05:59:35] davedev24_: has joined #ruby
[05:59:37] chinmay_dd: has joined #ruby
[06:01:01] qiukun: has joined #ruby
[06:03:37] olistik: has joined #ruby
[06:03:45] speaking1ode: has joined #ruby
[06:04:26] konsolebox: >> ObjectSpace.each_object.find{ |o| o.class == ::Object and o.to_s == 'main' }.object_id == self.object_id
[06:04:27] ruboto: konsolebox # => true (https://eval.in/390805)
[06:05:33] jeanlinux: has joined #ruby
[06:08:28] jeanlinux: has joined #ruby
[06:12:14] Ox0dea: >> TOPLEVEL_BINDING.receiver
[06:12:15] ruboto: Ox0dea # => main (https://eval.in/390807)
[06:12:16] Ox0dea: konsolebox: ^
[06:12:22] Ox0dea: Now I feel silly.
[06:13:21] Ox0dea: >> class Foo; def bar; TOPLEVEL_BINDING.receiver end end; Foo.new.bar.object_id == object_id
[06:13:22] ruboto: Ox0dea # => true (https://eval.in/390808)
[06:15:32] solars: has joined #ruby
[06:16:49] pen: has joined #ruby
[06:17:43] sigurding: has joined #ruby
[06:18:31] yfeldblum: has joined #ruby
[06:18:42] psyprus: has joined #ruby
[06:18:48] Xiti: has joined #ruby
[06:18:51] rht: has joined #ruby
[06:19:25] cbz: has joined #ruby
[06:21:06] SOLDIERz: hello everyone is somebody using chruby from postmodern?
[06:21:15] konsolebox: Ox0dea: i get undefined method `receiver' for #<Binding:0x000000023fbc48> (NoMethodError). is there anything i should 'require'?
[06:21:27] isxek: has joined #ruby
[06:21:36] tbuehlmann: SOLDIERz, yup!
[06:21:38] Ox0dea: konsolebox: You're using an old version of Ruby. :/
[06:21:52] havenwood: SOLDIERz: Have a chruby question?
[06:21:54] riotjones: has joined #ruby
[06:22:15] oliver3: has joined #ruby
[06:22:23] konsolebox: Ox0dea: needs ruby 22 :) my minimum is 2.0 :) i think i'll just use the former
[06:22:28] howdoi: has joined #ruby
[06:22:39] Ox0dea: konsolebox: You could do `TOPLEVEL_BINDING.eval('self')`.
[06:22:42] Xeago: has joined #ruby
[06:23:47] havenwood: >> TOPLEVEL_BINDING.receiver
[06:23:48] ruboto: havenwood # => main (https://eval.in/390828)
[06:23:52] SOLDIERz: tbuehlmann havenwood Yes. I got the following problem. Got a system where I installed multiple ruby version via RPM (CentOS-System) after updating from one ruby tiny version to another so let's say in my example from 2.2.1 to 2.2.2. I got a really weird issue all the time
[06:24:52] Asher: has joined #ruby
[06:25:27] SOLDIERz: after changing the version with chruby it is bothering me with error while loading shared libraries: libruby.so.2.2 cannot open shared object file: No such file or directory
[06:25:48] GnuYawk: has joined #ruby
[06:25:49] GnuYawk: has joined #ruby
[06:25:56] SOLDIERz: and I don't know why but for some reason chruby is not setting paths correctly
[06:26:02] mike___1234: has joined #ruby
[06:26:43] sandstrom: has joined #ruby
[06:27:20] konsolebox: Ox0dea: yes i could use it too, and perhaps use the former method as fall back if it turns out to be still needed
[06:28:04] ivanskie: has joined #ruby
[06:28:38] msgodf: has joined #ruby
[06:29:15] psyprus: has joined #ruby
[06:31:55] Ox0dea: konsolebox: Either way, I'm happy to have discovered so many alternate ways of obtaining main. :)
[06:32:43] isxek: I'm using this script to filter for email addresses to include in our blacklist: http://pastebin.com/KPcV75gM . However, after running uniq! on the matches array, the output still shows duplicate values. Any suggestions?
[06:32:44] ruboto: isxek, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/4e0eede703ee67bff478
[06:32:44] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[06:32:58] isxek: well, that was fast
[06:33:19] isxek: first time posting to #ruby, sorry
[06:33:45] arup_r: has joined #ruby
[06:34:29] Ox0dea: isxek: Are you sure you want #uniq!? It returns nil if the array was already unique.
[06:34:41] sharpmachine: has joined #ruby
[06:34:51] Ox0dea: >> [[1,2,1].uniq, [1,2].uniq!] #=> [[1, 2], nil]
[06:34:52] ruboto: Ox0dea # => [[1, 2], nil] (https://eval.in/390843)
[06:35:20] isxek: 0x0dea: I've tried just plain uniq, but I'm getting the same results.
[06:35:22] stoodfarback: I got curios from earlier conversation, so I looked up where `main` is defined. Might be interesting for someone else as well: https://github.com/ruby/ruby/blob/ruby_2_2/vm.c#L2820
[06:36:10] shevy: isxek .uniq! will modify in place; in your example, .uniq should be what you may want to have
[06:36:12] jlast: has joined #ruby
[06:36:31] Oog: has joined #ruby
[06:36:45] shevy: btw if you try to obtain all matches, perhaps you want .scan ?
[06:37:23] pithagora: has joined #ruby
[06:37:35] arup_r1: has joined #ruby
[06:37:53] isxek: ACTION takes a look at ruby docs
[06:38:43] Xeago: has joined #ruby
[06:38:57] Ox0dea: isxek: The problem is that you're storing the MatchData objects into the matches array.
[06:39:06] Ox0dea: These are going to be different even if they matched the same string.
[06:39:58] skade: has joined #ruby
[06:40:07] Ox0dea: As shevy suggested, you'd probably be fine just doing `ARGF.read.scan(pattern).uniq`.
[06:40:54] sphex: anyone here did that? http://www.daveperrett.com/articles/2012/05/16/underscores-are-stupid-get-a-japanese-keyboard/
[06:40:55] isxek: 0x0dea: looks like #scan was exactly what I needed. thanks to you both!
[06:41:37] lessless: has joined #ruby
[06:41:38] pithagora: hey all. how can i extract the host port from array entries in such a format https://gist.github.com/vbrinza/d8f285cc1c187b9a3f1d ?
[06:41:40] havenwood: SOLDIERz: You're getting that error with gems you installed on the Ruby before upgrading?
[06:42:20] shevy: sphex huh, they have no underscore?
[06:42:46] SOLDIERz: havenwood no after upgrading
[06:42:48] shevy: it's just shift free
[06:43:05] havenwood: SOLDIERz: Show the full error? The command you're running and all?
[06:43:11] shevy: the traditional keyboards are indeed not really the most intelligent thing... caps lock... how useful is it
[06:43:17] sphex: shevy: they have easier to type underscores. supposedly the key layout of japanese keyboards matches ruby really well.
[06:43:25] dopie: has joined #ruby
[06:43:45] apeiros: sphex: got a twitter handle?
[06:44:18] SOLDIERz: havenwood I'm running: chruby ruby-<%version%> and then it's returning me error while loading shared libraries: libruby.so.2.2 cannot open shared object file: No such file or directory
[06:44:26] apeiros: well then, "via sphex on freenode IRC"
[06:44:35] shevy: sphex yeah that is also good
[06:44:40] sphex: hehe, alright!
[06:45:21] havenwood: SOLDIERz: So?: chruby ruby-2.2
[06:45:35] ndrei: has joined #ruby
[06:46:02] allomov: has joined #ruby
[06:46:12] mrmargolis: has joined #ruby
[06:46:26] isxek: 0x0dea: holy crap, that reduced my script to ~6 lines
[06:47:18] fabrice31: has joined #ruby
[06:47:24] Ox0dea: isxek: Erm... not 2?
[06:47:39] havenwood: SOLDIERz: Once Ruby 2.2. is selected, same error with: ruby -e "0"
[06:47:41] Ox0dea: Ah, never mind. Forgot you're printing the results.
[06:47:55] Ox0dea: isxek: Yes, Ruby is quite expressive. :)
[06:48:20] SOLDIERz: havenwood correct
[06:48:46] wookiehangover: has joined #ruby
[06:48:50] Ox0dea: isxek: Hm... it should just be 4 lines, no?
[06:48:51] havenwood: SOLDIERz: So if you don't source chruby same error?
[06:49:16] havenwood: SOLDIERz: If you: /path/to/the/ruby -e "0"
[06:49:18] pandaant: has joined #ruby
[06:50:39] havenwood: SOLDIERz: Seems like an upstream issue with the Ruby package you're using.
[06:50:48] isxek: 0x0dea: reduced to 4 :)
[06:50:53] havenwood: SOLDIERz: How are you installing Ruby? Where are the packages from?
[06:51:08] Ox0dea: isxek: Nice! Probably don't try to go below that, though. :)
[06:51:11] SOLDIERz: own build rpms with ruby source
[06:51:22] havenwood: SOLDIERz: Yeah, seems not chruby-related.
[06:51:54] SOLDIERz: It also worked before just fine but everytime I update RPMs it doesn't work
[06:51:59] isxek: 0x0dea: does ruby still compile that regex, or is there no need for that?
[06:52:10] SOLDIERz: but the files are there so I don't get it
[06:52:21] isxek: docs says #new is the same as #compile
[06:52:41] wildroman2: has joined #ruby
[06:53:14] wildroman2: has joined #ruby
[06:53:24] havenwood: SOLDIERz: I think I recall folk running into issues with Rubies being moved as part of the RPM process. Look into the `--enable-shared` flag if you're not already using it.
[06:54:20] havenwood: SOLDIERz: ^ should create libruby.so and work.
[06:54:24] fabrice31: has joined #ruby
[06:54:40] workmad3: has joined #ruby
[06:54:47] havenwood: CONFIGURE_OPTS=--enable-shared
[06:54:50] Ox0dea: >> [/foo/, Regexp.new('foo'), Regexp.compile('foo')].uniq
[06:54:51] ruboto: Ox0dea # => [/foo/] (https://eval.in/390863)
[06:55:03] Ox0dea: isxek: ^ Regexp literals are more idiomatic.
[06:55:08] sigurding: has joined #ruby
[06:56:18] kfpratt: has joined #ruby
[06:56:29] isxek: certainly looks easier to read
[06:57:50] Ox0dea: isxek: I can't tell if that was sarcasm. :P
[06:58:03] Xeago: has joined #ruby
[06:58:03] eGGsha: has joined #ruby
[06:58:41] Ox0dea: Regexes of any significant size tend to be supremely illegible; how you instantiate them will be the least of your worries.
[06:58:48] codecop: has joined #ruby
[06:59:09] abuzze: has joined #ruby
[06:59:37] Ox0dea: Editors tend (or can be made) to highlight regex literals differently than other things, which helps for quickly picking them out.
[06:59:44] dgutierrez1287: has joined #ruby
[07:01:00] isxek: Ox0dea: it wasn't sarcasm
[07:01:36] Ox0dea: Then you are becoming one with The Ruby Way.
[07:01:57] fabrice31_: has joined #ruby
[07:02:09] Kneecaps: has joined #ruby
[07:03:40] Ox0dea: The only time you *might* want to resort to Regexp.new is if you're creating a regex from a dynamically constructed string; even then, interpolating (/#{str}/) is probably more common.
[07:03:49] Ox0dea: Alas, the style guide has nothing to say on this matter.
[07:04:37] blue_deref: has joined #ruby
[07:05:41] niemcu: has joined #ruby
[07:06:11] gagrio_: has joined #ruby
[07:06:28] isxek: at any rate, thanks for the leg up - i'm off
[07:06:34] SOLDIERz: havenwood Yeah got that also in my RPM SPEC FILE
[07:06:44] zacstewart: has joined #ruby
[07:07:04] alex88: has joined #ruby
[07:08:58] fabrice31: has joined #ruby
[07:09:17] jeanlinux: has joined #ruby
[07:10:45] sandstrom: has joined #ruby
[07:12:46] jeanlinux: has joined #ruby
[07:13:45] Stan: has joined #ruby
[07:15:40] ahmetkapikiran: has joined #ruby
[07:17:31] Timba-as: has joined #ruby
[07:18:53] msgodf: has joined #ruby
[07:20:10] jenrzzz: has joined #ruby
[07:20:22] MrJiks: has joined #ruby
[07:20:33] ebbflowgo_: has joined #ruby
[07:24:54] railsraider: has joined #ruby
[07:25:19] ryez: has joined #ruby
[07:26:42] apeiros: yay! new rubies finally provide a way to figure out where a constant was defined
[07:26:55] apeiros: simply assign a new value and it'll complain and note where the previous definition was :D
[07:27:57] apeiros: would be nicer if we could programmatically access that information
[07:28:03] Ox0dea: apeiros: This is new?
[07:28:04] apeiros: ACTION still waiting for ::Introspection
[07:28:11] apeiros: Ox0dea: yes, 2.1 or 2.2+ iirc
[07:28:18] apeiros: before it only complained
[07:28:27] apeiros: but didn't reveal info about prior definition
[07:28:31] dhjondoh: has joined #ruby
[07:29:07] sandelius: has joined #ruby
[07:30:12] sigurding: has joined #ruby
[07:31:00] bruno-: has joined #ruby
[07:33:29] revdan: has joined #ruby
[07:35:01] sandstrom: has joined #ruby
[07:35:06] renderful: has joined #ruby
[07:35:26] sharpmachine: has joined #ruby
[07:36:03] KC9YDN: has joined #ruby
[07:36:03] KC9YDN: has joined #ruby
[07:37:27] anisha: has joined #ruby
[07:37:30] futilegames: has joined #ruby
[07:37:44] TinkerTyper: has joined #ruby
[07:38:29] rdark: has joined #ruby
[07:39:20] CloCkWeRX: has joined #ruby
[07:40:24] nodeworm: has joined #ruby
[07:41:03] Contigi: has joined #ruby
[07:42:36] senayar: has joined #ruby
[07:42:36] senayar: has joined #ruby
[07:43:09] nodeworm: has joined #ruby
[07:45:05] krz: has joined #ruby
[07:45:48] revath: has left #ruby: ()
[07:46:07] Scroff: has joined #ruby
[07:47:31] allomov: has joined #ruby
[07:48:15] Ox0dea: apeiros: https://gist.github.com/0x0dea/67eba815d4a22c1c225e
[07:48:48] apeiros: Ox0dea: Thread.exclusive and you're good :D
[07:49:07] Scroff: has joined #ruby
[07:49:18] nodeworm: has joined #ruby
[07:49:30] Ox0dea: Just... around the whole thing, then?
[07:49:59] apeiros: it's for debugging only anyway
[07:50:09] Scroff: has joined #ruby
[07:50:21] nodeworm: has joined #ruby
[07:50:36] apeiros: I'd probably use $stderr.string
[07:50:42] tobyx: has joined #ruby
[07:50:45] apeiros: instead of .read
[07:50:48] Ox0dea: How come?
[07:50:50] apeiros: not sure there's a diff, though
[07:51:18] apeiros: yeah, it's a diff. .read is much more complex :D
[07:51:36] apeiros: .string is simply an accessor. you want the whole string anyway.
[07:51:49] Ox0dea: Ah, you're right.
[07:51:59] apeiros: but I'm a premature optimizer :-|
[07:52:12] Ox0dea: Nah, #read is significantly more complex than #string.
[07:52:18] Ox0dea: I was not expecting that.
[07:52:18] fabrice31_: has joined #ruby
[07:52:33] ahmetkapikiran: has joined #ruby
[07:53:07] Musashi007: has joined #ruby
[07:53:42] TheHodge: has joined #ruby
[07:54:18] fabrice31: has joined #ruby
[07:54:25] braincrash: has joined #ruby
[07:54:39] terlar: has joined #ruby
[07:56:50] Dopagod: has joined #ruby
[07:56:53] nodeworm: has joined #ruby
[07:56:59] Xeago: has joined #ruby
[07:57:52] revdan: has joined #ruby
[07:58:03] andikr: has joined #ruby
[07:58:43] Rarikon: has joined #ruby
[07:59:41] dumdedum: has joined #ruby
[08:00:03] langlands: has joined #ruby
[08:00:29] einarj: has joined #ruby
[08:00:43] ndrei_: has joined #ruby
[08:01:05] langlands: has joined #ruby
[08:01:16] joonty: has joined #ruby
[08:01:46] k3asd`: has joined #ruby
[08:01:52] Hounddog: has joined #ruby
[08:02:52] apeiros: Ox0dea: and: nice one :D
[08:03:38] apeiros: Ox0dea: may I steal it?
[08:04:37] eGGsha: has joined #ruby
[08:05:34] chouhoulis: has joined #ruby
[08:06:02] drPoggs: has joined #ruby
[08:06:11] elektronaut: has joined #ruby
[08:06:22] _whitelogger: has joined #ruby
[08:06:29] Ox0dea: apeiros: Thanks. As for introspection, is there really anything we can't peek into using one or more of ObjectSpace, RubyVM, or the plethora of metaprogramming methods?
[08:06:46] Ox0dea: But of course.
[08:06:48] apeiros: RubyVM is not portable
[08:06:52] apeiros: ObjectSpace is slow
[08:06:54] abyss: has joined #ruby
[08:06:56] apeiros: BasicObject is a huge issue
[08:07:05] apeiros: potential method redefinition is a smaller issue
[08:08:00] mister_solo: has joined #ruby
[08:08:17] judofyr: has joined #ruby
[08:08:23] Zai00: has joined #ruby
[08:09:23] chthon: has joined #ruby
[08:09:54] zenspider: you're trying to figure out where a const is defined?
[08:10:33] apeiros: wrt Introspection, that's only one thing I'd want, though
[08:10:44] zenspider: as in, WHO defines it? or where? or?
[08:10:52] apeiros: source_location equivalent
[08:11:11] apeiros: re Introspection: afaik emulating e.g. BasicObject#instance_variables is impossible :-/
[08:12:02] penzur: has joined #ruby
[08:12:23] Ox0dea: Well, Fiddle probably makes it technically possible, but I wouldn't even know where to begin.
[08:14:01] apeiros: RubyVM probably too
[08:14:05] apeiros: else a native extension might do
[08:15:04] apeiros: also I'd love a universal_eval, allowing you to set all the scopes individually (binding, self, constant lookup - and I always forget the 4th, got something to do with how `def` works???)
[08:15:06] Ox0dea: It'd be interesting if we could assemble RubyVM::InstructionSequences.
[08:15:57] Ox0dea: zenspider: Is there some way to determine who defines a constant other than ObjectSpace?
[08:17:22] txdv: has joined #ruby
[08:17:44] anisha_: has joined #ruby
[08:18:01] aphprentice_: has joined #ruby
[08:21:19] dumdedum: has joined #ruby
[08:21:26] arquebus: has joined #ruby
[08:21:59] axl_: has joined #ruby
[08:22:14] Ox0dea: >> Complex.constants(false)
[08:22:15] ruboto: Ox0dea # => [:compatible, :I] (https://eval.in/390994)
[08:22:41] apeiros: compatible is a nice constant
[08:22:47] apeiros: also fatal
[08:22:55] apeiros: (lowercase first letter too)
[08:23:06] apeiros: they cheat
[08:23:15] speaking1ode: has joined #ruby
[08:23:26] phutchins1: has joined #ruby
[08:23:39] MrJiks: has joined #ruby
[08:24:51] white_bear: has joined #ruby
[08:25:02] Scrofff: has joined #ruby
[08:25:22] mandarinkin: has joined #ruby
[08:25:54] unshadow: has joined #ruby
[08:26:06] zenspider: nope. I got nothing. why do you guys want it?
[08:26:14] Ox0dea: apeiros: I should perhaps clarify that "but of course" conveys the exact opposite of what I meant to say back there.
[08:26:31] rikkipitt: has joined #ruby
[08:26:32] Ox0dea: zenspider: For introspecting all the things?
[08:28:04] Ox0dea: apeiros: Oh, never mind; I thought you'd asked if I minded. As you were.
[08:28:56] zenspider: "introspecting" is a tad vague. obviously you can walk all constants all the way down and know their names and values. that IS introspecting.
[08:29:17] zenspider: I really thought that tracepoint might have something for this, but apparently not
[08:29:30] arup_r: has joined #ruby
[08:29:58] Ox0dea: zenspider: We can't walk constants, though. We have to walk modules.
[08:30:32] zenspider: modules (and classes) are (usually) bound to a name via a constant
[08:31:03] zenspider: constants + const_get + recusion == walk
[08:31:19] MrJiks: Anybody know whats the seed stage of a starup is? Is it when the product is ready or during the idea inception stage?
[08:31:40] lessless: has joined #ruby
[08:31:46] bruno-: has joined #ruby
[08:32:00] zenspider: MrJiks: I thought it was once there was enough mass to start nuclear fission & fusion
[08:32:07] Ox0dea: "They tried to bury us. They didn't know we were seeds."
[08:32:22] arup_r1: has joined #ruby
[08:32:51] Renich: has joined #ruby
[08:35:04] mrmargolis: has joined #ruby
[08:35:33] Ox0dea: I admit the quotation was neither timely nor entirely pertinent, but you've got to grant it's pretty Zen.
[08:35:45] railsraider_: has joined #ruby
[08:36:11] sharpmachine: has joined #ruby
[08:36:31] Oog: has joined #ruby
[08:38:37] MrJiks: zenspider: :p
[08:39:08] tvw: has joined #ruby
[08:41:20] revath: has joined #ruby
[08:42:22] howdoicomputer: has joined #ruby
[08:42:33] sigurding: has joined #ruby
[08:43:30] workmad3: has joined #ruby
[08:44:57] zacts: has joined #ruby
[08:45:29] lxsameer: has joined #ruby
[08:46:20] yorickpeterse: apparently it's going to be 39C today
[08:46:26] yorickpeterse: if so that would be a new record since 1944
[08:46:44] sevenseacat: are you in siberia or something? >_>
[08:46:58] tbuehlmann: going up to 40??C at the weekend
[08:47:04] yorickpeterse: sevenseacat: .nl
[08:47:06] ljarvis: (???_???) / ( ???_???)>??????-??? / (??????_???)
[08:47:59] sevenseacat: sounds like a normal summer's day :P
[08:48:03] yorickpeterse: ???(????????)???
[08:48:27] yorickpeterse: it's super warm for around here
[08:48:43] wasamasa: still don't know what to do for my birthday
[08:48:51] Dopagod: has joined #ruby
[08:48:52] Dopagod: has joined #ruby
[08:49:01] wasamasa: suddenly sitting at home sounds pretty great to me considering these insane heat waves
[08:49:27] wasamasa: why must it be on the warmest day of the week, damnit
[08:50:18] ahmetkapikiran: has joined #ruby
[08:51:05] bigkevmcd: has joined #ruby
[08:51:05] yorickpeterse: http://downloads.yorickpeterse.com/images/screenshot_2015_07_02_10_46_18.png
[08:51:23] abdulsattar: has joined #ruby
[08:51:29] n008f4g_: has joined #ruby
[08:51:49] RegulationD: has joined #ruby
[08:54:17] bonhoeffer: has joined #ruby
[08:55:46] zacstewart: has joined #ruby
[08:58:04] startupality: has joined #ruby
[08:59:38] khebbie: has joined #ruby
[08:59:46] troulouliou_dev: has joined #ruby
[09:01:04] frenda: has joined #ruby
[09:01:17] frenda: https://gist.github.com/diff-/d1d92f6d0250fa4b874f --> Is this kind of an error?!
[09:01:33] xrlabs: has joined #ruby
[09:02:33] frenda: Is it a dependency problem?!
[09:02:39] sevenseacat: why on earth are they requiring capybara in development?
[09:03:06] senayar: has joined #ruby
[09:03:13] senayar: has joined #ruby
[09:03:42] lkba: has joined #ruby
[09:04:06] dseitz: has joined #ruby
[09:04:16] howdoicomputer: has joined #ruby
[09:04:25] sevenseacat: that doesnt even make sense, given they only include capybara in the test env
[09:06:03] frenda: I've installed it by this code: `bundle install --deployment --without development test`
[09:06:20] sevenseacat: well that definitely wont work
[09:06:26] sevenseacat: becase you're running it in development
[09:06:28] chouhoulis: has joined #ruby
[09:06:39] sevenseacat: so you need the development gems
[09:06:54] sevenseacat: remove the `--without development test` part
[09:07:49] abuzze: has joined #ruby
[09:11:52] yorickpeterse: gah, I hate customers that just don't read my support replies
[09:12:00] yorickpeterse: email #23236514: why do we not have all sources?
[09:12:12] yorickpeterse: me: because we can only set up those on which a company actually has a profie
[09:12:18] yorickpeterse: 15 emails later: why do we not have all sources?
[09:12:22] yorickpeterse: (??????????)?????? ?????????
[09:13:07] marr: has joined #ruby
[09:13:23] frenda: has left #ruby: ()
[09:14:16] allomov: has joined #ruby
[09:15:39] allomov_: has joined #ruby
[09:17:10] timonv: has joined #ruby
[09:19:50] lavros: has joined #ruby
[09:22:00] abuzze: has joined #ruby
[09:24:31] Renich: has joined #ruby
[09:27:36] abuzze: has joined #ruby
[09:32:33] bruno-: has joined #ruby
[09:33:02] abuzze: has joined #ruby
[09:33:18] zenspider: hrm... I've got a binding.pry in a module method and when it triggers I'm apparently not in that method. I can't access the locals the way I normally can
[09:33:44] zenspider: any clue what to do?
[09:33:51] workmad3: has joined #ruby
[09:34:04] bhaak: have you an older version of pry and is your binding.pry on the last line of a block/method?
[09:34:22] bhaak: there was a bug when pry stopped _after_ the method returned
[09:34:31] anjen: has joined #ruby
[09:35:13] bhaak: so you were out of the scope you were expecting. a quick workaround was to add a dummy line after the binding.pry, e.g. a=1
[09:36:11] zenspider: pry.... umm....
[09:36:29] zenspider: not in the end of the method. it's right in the middle
[09:36:56] sharpmachine: has joined #ruby
[09:37:06] zenspider: one of the locals was named step, which caused problems :)
[09:37:17] Guest22119: has joined #ruby
[09:37:59] bhaak: ah, yeah, that'll do, too :)
[09:38:00] zenspider: guess I could update it to 0.10.1
[09:38:11] zenspider: still can't see any of the locals
[09:38:41] zenspider: my prompt is the object's class
[09:38:50] zenspider: god rails 4 is soooooo slow
[09:38:51] Aryasam: has joined #ruby
[09:42:36] lolmaus: has joined #ruby
[09:43:20] [spoiler]: has joined #ruby
[09:44:00] anisha: has joined #ruby
[09:44:31] eGGsha: has joined #ruby
[09:47:40] axisys: has joined #ruby
[09:48:08] zenspider: binding.pry, not pry.binding. :P
[09:48:27] pengin: has joined #ruby
[09:49:43] khebbie: has joined #ruby
[09:53:19] jenrzzz: has joined #ruby
[09:54:56] sross07: has joined #ruby
[09:56:19] dhjondoh: has joined #ruby
[09:57:22] alex88: has joined #ruby
[09:57:27] bonhoeffer: has joined #ruby
[09:57:34] lkba_: has joined #ruby
[09:57:45] tvw: has joined #ruby
[09:58:15] musty: Sounds pythonish.
[09:58:18] User458764: has joined #ruby
[09:58:22] musty: Oh, pry, not py.
[09:58:26] musty: I should sleep.
[09:58:34] railsraider_: has joined #ruby
[09:58:36] zotherstupidguy: has joined #ruby
[09:59:46] dgutierrez1287: has joined #ruby
[10:00:47] revdan: has joined #ruby
[10:00:52] sepp2k: has joined #ruby
[10:01:31] stamina: has joined #ruby
[10:01:54] fabrice31: has joined #ruby
[10:02:21] anisha_: has joined #ruby
[10:02:29] Oog: has joined #ruby
[10:04:16] Scroff: has joined #ruby
[10:04:16] Renich: has joined #ruby
[10:07:17] chouhoulis: has joined #ruby
[10:09:43] unshadow_: has joined #ruby
[10:10:51] eGGsha: has joined #ruby
[10:11:04] sdothum: has joined #ruby
[10:12:20] Oka: has joined #ruby
[10:15:27] apeiros: zenspider: I'll draft up an example API of what I'd want an `Introspection` module to do
[10:15:44] kfpratt: has joined #ruby
[10:17:43] chinmay_dd: has joined #ruby
[10:20:03] unshadow: has joined #ruby
[10:20:29] rickmasta: has joined #ruby
[10:22:13] mrmargolis: has joined #ruby
[10:23:48] shredding: has joined #ruby
[10:24:32] bonhoeffer: has joined #ruby
[10:25:31] speaking1ode: has joined #ruby
[10:26:55] zacstewart: has joined #ruby
[10:30:46] zacstewart: has joined #ruby
[10:31:31] northfurr: has joined #ruby
[10:32:08] Ropeney: has joined #ruby
[10:32:59] khebbie: has joined #ruby
[10:33:18] bruno-: has joined #ruby
[10:34:57] Timba-as: has joined #ruby
[10:35:20] danielpclark: has joined #ruby
[10:36:22] Oog: has joined #ruby
[10:37:45] sharpmachine: has joined #ruby
[10:38:22] railsraider_: has joined #ruby
[10:40:35] RegulationD: has joined #ruby
[10:40:36] claw: has joined #ruby
[10:41:35] jeanlinux: has joined #ruby
[10:41:47] lxsameer: has joined #ruby
[10:41:59] qiukun: has joined #ruby
[10:43:16] [gmi]: has joined #ruby
[10:46:17] sankaber: has joined #ruby
[10:48:28] _blizzy_: has joined #ruby
[10:49:14] Oog: has joined #ruby
[10:51:38] sigurding: has joined #ruby
[10:52:02] thelastinuit: has joined #ruby
[10:52:53] Soda: has joined #ruby
[10:54:13] leeyaa: has joined #ruby
[10:54:14] TTilus: has joined #ruby
[10:54:47] leeyaa: trying to build eventmachine on ubuntu 14.04 lts is giving me this error https://bpaste.net/show/f82a7e0009ec any tips what could be the problem ?
[10:55:53] kfpratt: has joined #ruby
[10:55:53] _blizzy_: has joined #ruby
[10:56:46] apeiros: oh, Ox0dea is offline :(
[10:57:18] apeiros: zenspider: actually seems to be quite simple to just implement what I want. I guess I'll open an issue this WE on bugs.ruby-lang.org, asking to add that???
[10:57:25] apeiros: zenspider: https://gist.github.com/apeiros/95ea9d25dbe47ab8abc8 first step :)
[10:57:50] apeiros: allows this: `class Foo < BasicObject; include ::Introspectable; def initialize; @a = 1; @b = 2; end; end; Foo.new.instance_variables` => [:@a, :@b]
[10:58:25] devyn: has joined #ruby
[10:58:44] eGGsha: has joined #ruby
[10:58:54] nettoweb: has joined #ruby
[11:00:04] mattarse: has joined #ruby
[11:00:10] rodfersou: has joined #ruby
[11:00:32] sandstrom: has joined #ruby
[11:00:41] bullcitydev: has joined #ruby
[11:02:13] apeiros: this tab/space indent mix is still horrible :-S
[11:02:18] apeiros: (talking about ruby's C source)
[11:03:29] abdulsattar: has left #ruby: ()
[11:04:16] sandstrom: has joined #ruby
[11:04:48] Xeago: has joined #ruby
[11:06:19] Scrofff: has joined #ruby
[11:06:52] xrlabs: has joined #ruby
[11:07:16] startupality: has joined #ruby
[11:10:41] Aryasam: has joined #ruby
[11:11:35] ndrei: has joined #ruby
[11:11:44] fgo: has joined #ruby
[11:11:47] mikecmpbll: has joined #ruby
[11:11:52] ahmetkapikiran: has joined #ruby
[11:14:26] tkuchiki_: has joined #ruby
[11:15:33] doerteDev: has joined #ruby
[11:15:56] Hounddog: has joined #ruby
[11:18:26] Scroff: has joined #ruby
[11:20:04] jamon_: has joined #ruby
[11:20:30] cajone: has joined #ruby
[11:21:42] d0lph1n98: has joined #ruby
[11:21:55] momomomomo: has joined #ruby
[11:23:10] dumdedum: has joined #ruby
[11:23:26] msnyon: has joined #ruby
[11:23:35] voker57: has joined #ruby
[11:24:56] senayar: has joined #ruby
[11:24:56] senayar: has joined #ruby
[11:25:02] diegoviola: has joined #ruby
[11:25:20] nettoweb: has joined #ruby
[11:25:53] bonhoeffer: i???m having a hard time getting this to work: echo '| workout_done | foo |' | sed -n 's/^\| \(\w+\) .*/\1/p'
[11:26:11] bonhoeffer: is there a way to have ruby run on each line via a pipe?
[11:26:45] xrlabs: Can you please make PHP die forever
[11:27:14] msnyon: has joined #ruby
[11:27:27] Zai00: has joined #ruby
[11:27:37] jhass: xrlabs: k, one sec.... aaand done
[11:28:01] xrlabs: thanks jhass, now I can finally come back to the promised land of shiny red stones
[11:28:23] jhass: bonhoeffer: check popen or the open3 stdlib
[11:29:01] xrlabs: bonhoeffer, is everything in your string a unix command?
[11:29:17] msnyon: has joined #ruby
[11:29:27] xrlabs: what are you trying to do
[11:29:35] bonhoeffer: echo '| workout_done | foo |' | sed -n 's/^\| \(\w+\) .*/\1/p' -> want workout_done
[11:29:48] bonhoeffer: too much trouble with bre ??? i want to use ruby regex
[11:30:03] bonhoeffer: really ??? cat a file and run a ruby command on each line to get the bits i want
[11:30:17] jhass: bonhoeffer: why not let the ruby script open the file
[11:30:18] xrlabs: well then just find the pattern and run a reggae over it
[11:30:25] bonhoeffer: http://www.jstorimer.com/blogs/workingwithcode/7766125-writing-ruby-scripts-that-respect-pipelines
[11:30:36] lessless: has joined #ruby
[11:30:44] bonhoeffer: jhass: yeah ??? so i could write the script easy enough ??? but wanted to learn how to use ruby like sed
[11:31:13] bonhoeffer: or like awk ??? so i don???t have to learn bre and different regex implementations
[11:31:20] bonhoeffer: and can generally do more with ruby
[11:31:20] jhass: $stdout.sync = true; ARGF.each_line do |line| puts line if line.match /foo/ end
[11:32:23] jhass: there's things like ruby -ne but meh
[11:33:45] zacstewart: has joined #ruby
[11:33:50] Ox0dea: has joined #ruby
[11:33:55] bonhoeffer: ok ??? thanks
[11:34:17] Indian: has joined #ruby
[11:36:38] Ox0dea: bonhoeffer: For what it's worth, `cut -d\| -f2` would have been the saner approach at the shell.
[11:37:01] olistik: has joined #ruby
[11:37:18] rickmasta: has joined #ruby
[11:37:22] bonhoeffer: good grief ??? never heard of cut
[11:37:55] fabrice31: has joined #ruby
[11:38:10] Ox0dea: You really ought to familiarize yourself with the coreutils.
[11:38:33] sharpmachine: has joined #ruby
[11:38:57] Ox0dea: Or don't, of course; Ruby is an amazing scripting language.
[11:39:33] Darkwater: still learn coreutils
[11:39:51] jhass: mmh, coreutils hangman...
[11:40:14] Darkwater: guess a letter
[11:40:35] bayed: has joined #ruby
[11:41:37] apeiros: ok, so my Introspectable module patch needs rb_str_quote_unprintable - any sane way to get access to that function? it's defined in string.c and copying over the function and all it needs seems insance???
[11:41:48] apeiros: but it doesn't seem to be exposed via a header
[11:42:18] jeanlinux: has joined #ruby
[11:42:37] bonhoeffer: yeah ??? i want to be able to use ruby instead of coreutils
[11:42:41] Ox0dea: apeiros: You should just be able to use the QUOTE() macro.
[11:42:43] bruno-: has joined #ruby
[11:43:01] jhass: bonhoeffer: I'm sure shevy has the appropriate aliases to do so
[11:43:01] apeiros: Ox0dea: oh, you're back
[11:43:14] apeiros: Ox0dea: ok, but then I have to modify the functions which atm I only copied over
[11:43:24] sonOfRa: has joined #ruby
[11:43:24] Ox0dea: Juse use QUOTE() everywhere?
[11:43:51] apeiros: hm, and I don't actually see where it is invoked? wtf?
[11:44:46] Ox0dea: It's defined in "internal.h".
[11:45:56] Ox0dea: jhass: Do you reckon Ruby is powerful enough that coreutils implementations would be short enough to include in aliases?
[11:46:19] jhass: I reckon that shevy wouldn't care
[11:46:24] apeiros: Ox0dea: so do I copy over internal.h?
[11:46:30] Ox0dea: apeiros: Just #include it.
[11:46:35] serivich: has joined #ruby
[11:46:35] DoubleMalt: has joined #ruby
[11:46:36] apeiros: doesn't find it
[11:46:44] apeiros: isn't quoted include paths relative?
[11:47:11] Ox0dea: They try to be.
[11:47:14] apeiros: ACTION has weak C foo???
[11:47:30] jhass: Ox0dea: also -run and -rshell I guess
[11:47:53] Ox0dea: apeiros: <foo.h> is used as a fallback in the event "foo.h" can't be found nearby.
[11:48:07] apeiros: doesn't find it as <internal.h> either
[11:48:13] apeiros: it does find ruby.h
[11:48:18] apeiros: well, <ruby.h>
[11:48:18] MEATCHICKEN: has joined #ruby
[11:48:19] Ox0dea: No, you definitely want the quoted one.
[11:48:25] kaspernj: has joined #ruby
[11:49:09] apeiros: and from the makefile, it seems it correctly finds the rvm ruby-2.2.2
[11:49:38] apeiros: maybe ruby/intern.h ?
[11:49:43] Ox0dea: Nah, that's a different thing.
[11:49:57] JoshL: has joined #ruby
[11:49:59] Ox0dea: It seems "internal.h" only exists in the source tree; it doesn't get installed as a header. :/
[11:50:41] apeiros: copying it over worked
[11:50:55] apeiros: but at the point of rb_str_quote_unprintable, I get stuck
[11:51:03] apeiros: and I think it's actually invoked via QUOTE :)
[11:51:16] Ox0dea: They're literally synonymous.
[11:51:20] Darkwater: is there a shorter way to write array.map{ |n| n[:foobar] } ?
[11:51:25] Ox0dea: Darkwater: No. :(
[11:51:44] Ox0dea: Wait, I misread.
[11:51:51] pontiki: has joined #ruby
[11:52:00] jhass: Darkwater: you could make your array items e.g. Struct's
[11:52:02] ljarvis: array.map{|n|n[:foobar]}
[11:52:11] radialneon: has joined #ruby
[11:52:46] ksjdflsjldf: has joined #ruby
[11:52:55] Ox0dea: Darkwater: An array of Hashes, then, right?
[11:53:11] Ox0dea: Well, if you made them OpenStructs, you could do array.map(&:foobar).
[11:53:22] Ox0dea: Overkill, though.
[11:53:56] pontiki: morning-ish
[11:54:05] Darkwater: yeah that's not really worth it
[11:54:07] haxrbyte: has joined #ruby
[11:54:09] Ox0dea: No, it's not.
[11:54:11] ksjdflsjldf: newbie for ruby, anybody knows how to install shuttle written by square without buying sidekiq pro?
[11:54:13] apeiros: Ox0dea: https://gist.github.com/apeiros/95ea9d25dbe47ab8abc8 that's my current code
[11:54:15] Mon_Ouie: has joined #ruby
[11:54:24] apeiros: all works except remove_instance_variable with an inexistant variable
[11:54:53] apeiros: then it calls the QUOTE macro which fails
[11:55:49] unsymbol: has joined #ruby
[11:56:17] apeiros: I mean, alternatively I compile my own ruby. after all, it's supposed to be a patch for ruby itself, not an external lib
[11:57:43] Ox0dea: apeiros: The calls to QUOTE() work fine in all the other methods?
[11:58:00] apeiros: maybe I don't trigger them
[11:58:11] Ox0dea: That's gotta be it.
[11:58:15] ldnunes: has joined #ruby
[11:59:06] apeiros: Ox0dea: https://gist.github.com/apeiros/95ea9d25dbe47ab8abc8
[11:59:16] apeiros: that's the full source. just arrange it in ext/ and test/
[11:59:23] Ox0dea: It would certainly be much less of a headache to define Introspectable as a sort of "selective alias" for Kernel.
[11:59:37] apeiros: that fails with dyld: lazy symbol binding failed: Symbol not found: _rb_id_quote_unprintable
[12:00:18] apeiros: well, the point is that it should work for BasicObject
[12:00:23] jhass: ksjdflsjldf: looks like a hard dependency
[12:00:28] apeiros: preferably with a variant which does not require including
[12:00:45] apeiros: i.e. by having class methods on Introspectable which accept the target object as first arg
[12:00:51] apeiros: hrmpf, gotta get back to work :(
[12:01:05] ksjdflsj_: has joined #ruby
[12:02:44] ledestin: has joined #ruby
[12:04:54] ahmetkapikiran: has joined #ruby
[12:05:36] ksjdflsj_: oh, really appreciate your reply
[12:05:50] lee-jon: has joined #ruby
[12:06:16] dgutierrez1287: has joined #ruby
[12:06:29] haxrbyte_: has joined #ruby
[12:07:18] lee-jon: Can anyone explain why this binds to nil?
[12:07:27] lee-jon: 2.2.2 :030> var1
[12:07:27] lee-jon: NameError: undefined local variable or method `var1??? for main:Object
[12:07:29] lee-jon: 2.2.2 :031 > var2
[12:07:31] lee-jon: NameError: undefined local variable or method `var2??? for main:Object
[12:07:32] lee-jon: 2.2.2 :032 > (true) ? var1 = ???true??? : var2=???false???
[12:07:33] lee-jon: => ???true???
[12:07:35] lee-jon: 2.2.2 :033 > var1
[12:07:36] lee-jon: => ???true???
[12:07:37] lee-jon: 2.2.2 :034 > var2
[12:07:49] khebbie: has joined #ruby
[12:08:04] chouhoulis: has joined #ruby
[12:08:26] Mon_Ouie: !fact flood
[12:08:26] ruboto: Please use https://gist.github.com for more than three lines of text!
[12:08:39] lee-jon: Yep my bad - not enough coffee
[12:08:42] Ox0dea: lee-jon: It's little more than an unfortunate quirk of how Ruby works.
[12:08:48] ruboto: Ox0dea # => nil (https://eval.in/391054)
[12:08:56] haxrbyte_: has joined #ruby
[12:09:11] lee-jon: That???s what I thought.
[12:09:12] eGGsha: has joined #ruby
[12:09:16] Mon_Ouie: Also, this is because the ternary operator doesn't create its own scope, so variables you create inside them still appear in the next statements
[12:09:20] Ox0dea: It would be more work for the interpreter to "forget" that it's seen a new variable.
[12:10:33] lee-jon: Makes sense. And I???m not too sure we???re actually write that. But it surprised me.
[12:10:40] Ox0dea: Mon_Ouie: Are you sure it's anything to do with scope and not just a byproduct of how much is going on in Ruby's parser?
[12:11:01] mrmargolis: has joined #ruby
[12:11:16] Mon_Ouie: Yes, constructs that do create their own scope will not "leak" variables like this
[12:11:31] Mon_Ouie: >> def let; yield; end; let { |x| x = 3 }; x
[12:11:32] ruboto: Mon_Ouie # => undefined local variable or method `x' for main:Object (NameError) ...check link for more (https://eval.in/391056)
[12:11:33] elektronaut: has joined #ruby
[12:11:57] drPoggs: has joined #ruby
[12:15:15] Scrofff: has joined #ruby
[12:15:40] Ox0dea: Mon_Ouie: How does that square with the fact that the untaken branch isn't executed?
[12:16:31] Ox0dea: You can put all kinds of (syntactically valid) nonsense in the untaken branch, and Ruby will completely ignore it.
[12:16:54] Ox0dea: So how come the variable definition in the untaken branch there doesn't get the same treatment?
[12:17:19] Mon_Ouie: What do you mean "doesn't get the same treatment"? Both variables got defined
[12:17:36] Ox0dea: But the latter shouldn't have been.
[12:17:42] Mon_Ouie: All the variables that you declare in some scope start existing as soon as you enter that scope
[12:18:04] Ox0dea: >> 1 ? a = 1 : b; b
[12:18:05] ruboto: Ox0dea # => undefined local variable or method `b' for main:Object (NameError) ...check link for more (https://eval.in/391057)
[12:18:21] jhass: yes, nothing defines it there
[12:18:22] Mon_Ouie: You need to assign to a variable for it to be declared
[12:18:32] Ox0dea: Mon_Ouie: That's definition, not declaration.
[12:18:33] Mon_Ouie: Otherwise b is parsed as a method call
[12:18:53] jhass: Ox0dea: in ruby it's declaration when the code is parsed and definition when it's executed, so both
[12:19:05] lolmaus: has joined #ruby
[12:20:11] fabrice31: has joined #ruby
[12:20:18] DEA7TH: has joined #ruby
[12:22:28] lee-jon: Makes total sense. Thanks all.
[12:23:35] choke: has joined #ruby
[12:23:47] Mon_Ouie: has joined #ruby
[12:23:54] lessless: has joined #ruby
[12:24:50] dblessing: has joined #ruby
[12:25:31] ramfjord: has joined #ruby
[12:27:01] fantazo: has joined #ruby
[12:28:41] AlexAltea: has joined #ruby
[12:29:06] but3k4: has joined #ruby
[12:29:29] RegulationD: has joined #ruby
[12:30:11] DEA7TH: A thread initializes something and pauses until someone tells it to proceed (they also need to pass extra arguments). How do I implement that in Ruby? I've looked up mutexes, but this needs to work globally / across applications, if possible.
[12:32:38] DEA7TH: maybe I'll try File.flock
[12:32:42] allomov_: has joined #ruby
[12:32:56] ryba: has joined #ruby
[12:34:19] jhass: that's a bit vague
[12:34:34] jhass: what's the something, what's the arguments and what are the applications?
[12:36:03] DEA7TH: I have a lot of client applications behind internal IPs and I want to be able to *send* them data, that's why I have them connect to the server and constantly listen for data. There is a thread which receives the connection from the client application, and it must be notified when it's time to reply.
[12:36:45] jhass: and who does the notify?
[12:37:04] cajone: has left #ruby: ()
[12:37:09] DEA7TH: Some other processes, for example if they want to send something to the client application.
[12:38:01] jhass: how does that other process input the data to the "server" (or more appropriately "reverse proxy" from what I've gathered)
[12:39:23] sharpmachine: has joined #ruby
[12:39:29] DEA7TH: they're part of the Rails application. It's an unnecessary detail, but: the purpose of this is to enable someone from the Internet to send commands to an internal IP. When that person connects to the server, it will want to send something to the internal IP, and it will do it by telling my thread to reply. Replying is easy, it's just that those are two separate threads.
[12:40:23] micmus: has joined #ruby
[12:40:27] DEA7TH: My problem is in telling the other thread to stop waiting and do its work, while also sending it a string.
[12:40:54] DEA7TH: It must wait until I do that, and I feel that while(true) sleep(1) is not the right thing.
[12:40:57] jhass: well, there's an important detail not clear from your description
[12:41:04] jhass: you're mixing threads and processes
[12:41:32] DEA7TH: oh. I'm not sure which is which, they are separately started then they must be processes, I think
[12:41:35] jhass: in one moment you say "other process" in the other you say essentially "thread inside my rails app"
[12:41:38] drewvanstone: has joined #ruby
[12:42:14] DEA7TH: also neither process is a child of the other, they're independent
[12:42:22] senayar: has joined #ruby
[12:42:28] Kully3xf: has joined #ruby
[12:42:33] jhass: for inter process communication popular communication channels are named pipes, unix sockets or things like Redis
[12:43:17] ndrei: has joined #ruby
[12:43:17] jhass: e.g. the popular Rails background workers Resque & Sidekiq use Redis since that makes it easy to listen to queues
[12:43:17] DEA7TH: I was hoping I would get away without that. Oh well.
[12:44:23] workmad3: DEA7TH: the general term is a communication Channel... and your problem will be that you don't have one :)
[12:44:46] workmad3: ah, jhass did mention that... but yeah you can't do interprocess communication without a channel...
[12:45:05] revdan: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[12:45:45] DEA7TH: oh well, then I'll research and implement it.
[12:45:52] StephenOTT: has joined #ruby
[12:46:05] DEA7TH: Could that work if both processes are activated by web requests to the same Rails application?
[12:46:16] eggoez: has joined #ruby
[12:46:21] jhass: oh, I should highlight the Redis approach has the benefit of being able to have multiple processes consume and push to the queue
[12:46:27] bullcitydev: has joined #ruby
[12:46:45] guillaume-rb: has joined #ruby
[12:46:53] DEA7TH: i.e. first request happens, Rails application pauses (first requester waits for response), second request happens and then the first request is responded to.
[12:47:16] SylarRuby: has joined #ruby
[12:47:20] jhass: you'll run into timeouts and scaling issues with the common rails application servers there
[12:47:22] DEA7TH: I mean the response waits, the app is still running
[12:47:28] workmad3: DEA7TH: you could do that... but it would be much easier conceptually and problem implementation-wise to just use a message queue to have a proper communication channel
[12:47:40] workmad3: s/problem/probably
[12:48:21] DEA7TH: would that require an additional application, other than Rails?
[12:48:35] jhass: DEA7TH: though sounds like you want something that's commonly solved via web sockets these days, a permanent two way communication channel between the browser and the backend
[12:48:37] DEA7TH: I'm using AWS, and setting up multiple things might require some work
[12:49:06] DEA7TH: well I did use sockets
[12:49:23] jhass: if that's the case a google for "Rails websockets" should get you some premade solutions and designs
[12:49:53] DEA7TH: alongside my Rails app? awesome
[12:50:01] workmad3: DEA7TH: tbh, looking back at your original statement of what you're doing, it sounds like you're trying to re-implement socket tunnels
[12:50:01] DEA7TH: ACTION thought it would be harder than that
[12:50:05] Kully3xf: what should I use if I want to make a list of valid choices
[12:50:13] Zai00: has joined #ruby
[12:50:30] Scroff: has joined #ruby
[12:50:37] Kully3xf: I have it in python but IDK in ruby
[12:51:31] DEA7TH: workmad3: I'm not sure what is that, but does it transmit an unprocessed message to the internal IP, from the external user? I don't want that; I want to process it first.
[12:51:37] wasamasa: Kully3xf: you want a set?
[12:51:56] wasamasa: require 'set'
[12:52:01] Kully3xf: cool thanks
[12:52:35] workmad3: DEA7TH: fair enough... there are probably many solutions out there that handle that particular aspect as well, but I don't know what they are :)
[12:56:12] jenrzzz: has joined #ruby
[12:56:58] deviantony: has joined #ruby
[12:57:06] JDiPierro: has joined #ruby
[12:58:09] jerius: has joined #ruby
[12:58:10] jhass: DEA7TH: I have to agree with workmad3, you're most likely reinventing something here, not sure what it is exactly though
[12:58:25] jhass: perhaps AMQP though I think that sucks as actual data transport
[12:58:44] Scrofff: has joined #ruby
[12:59:49] eGGsha: has joined #ruby
[13:00:14] chipotles: has joined #ruby
[13:00:17] chinmay_dd: has joined #ruby
[13:00:21] platzhirsch: has joined #ruby
[13:00:53] symm-: has joined #ruby
[13:01:11] deviantony: is there an easy way to extract the first elements of an IP address?
[13:01:32] Ox0dea: deviantony: ip.split('.').first(2)
[13:01:38] arup_r: has joined #ruby
[13:01:39] deviantony: such as extract 10.10.10. from
[13:01:43] Ox0dea: deviantony: ip.split('.').first(3)
[13:01:48] Oka: has joined #ruby
[13:02:05] jhass: IPAddr from ipaddr stdlib for some more complete handling
[13:02:10] chipotles: has joined #ruby
[13:02:54] deviantony: Ox0dea: thanks
[13:03:13] braidn: has joined #ruby
[13:03:41] slash_nick: >> "2001:db8::ff00:42:8329".split(".").first(3)
[13:03:42] ruboto: slash_nick # => ["2001:db8::ff00:42:8329"] (https://eval.in/391076)
[13:05:19] arup_r: has joined #ruby
[13:05:53] jhass: >> "::ffff:".split(".").first(3)
[13:05:54] ruboto: jhass # => ["::ffff:10", "10", "10"] (https://eval.in/391077)
[13:09:01] ksjdflsjldf: has joined #ruby
[13:09:11] platzhirsch: has left #ruby: ()
[13:10:05] mister_solo: has joined #ruby
[13:12:44] bmurt: has joined #ruby
[13:14:19] allomov: has joined #ruby
[13:15:37] zacstewa_: has joined #ruby
[13:16:23] malconis: has joined #ruby
[13:16:52] izzol: is it possible to compile ruby to the binary ?
[13:17:04] izzol: I'm looking on the mruby but it doens't work for me :(
[13:17:24] jhass: pure ruby, not really
[13:17:58] jhass: you may want to look into stuff like traveling ruby
[13:18:03] jhass: or even crystal
[13:18:53] griffindy: has joined #ruby
[13:19:54] drewvanstone: has joined #ruby
[13:20:28] startupality: has joined #ruby
[13:21:11] izzol: jhass: is it difficult to change the ruby code to the crystal?
[13:21:23] victortyau: has joined #ruby
[13:21:50] jhass: it's anything from just works to basically impossible, depends on the code
[13:22:00] doerteDev: has joined #ruby
[13:23:44] CBke: has joined #ruby
[13:23:47] chouhoulis: has joined #ruby
[13:25:02] drewvanstone: has joined #ruby
[13:26:02] nettoweb: has joined #ruby
[13:26:41] zacstewart: has joined #ruby
[13:27:17] davedev24_: has joined #ruby
[13:28:21] rickmasta: has joined #ruby
[13:29:52] roshanavand: has joined #ruby
[13:29:54] whippythellama: has joined #ruby
[13:29:59] rbennacer: has joined #ruby
[13:30:01] platzhirsch: has joined #ruby
[13:31:23] druznek: has joined #ruby
[13:31:41] Juanchito: has joined #ruby
[13:31:51] drewvans1one: has joined #ruby
[13:32:25] last_staff: has joined #ruby
[13:32:34] i8igmac: has joined #ruby
[13:33:25] kobain: has joined #ruby
[13:33:52] nateberkopec: has joined #ruby
[13:33:56] Polysics: has joined #ruby
[13:34:31] atom3: has joined #ruby
[13:34:56] Scripore: has joined #ruby
[13:35:33] Toska: has joined #ruby
[13:36:12] Toska: can anyone explain to me how to get this working: http://pastie.org/private/tquvxg1qifc1hsmkda (very simple example)
[13:36:22] bf4: has joined #ruby
[13:36:47] allomov: has joined #ruby
[13:36:49] helpa: Toska: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[13:36:59] dhjondoh: has joined #ruby
[13:37:00] momomomomo: Toska: Read this: http://www.mikeash.com/getting_answers.html
[13:37:23] slash_nick: jhass: were you saying "convert it to ipv4 then split it?
[13:37:30] renderful: has joined #ruby
[13:37:45] rickmasta: has joined #ruby
[13:37:49] Toska: has left #ruby: ()
[13:37:56] Toska: has joined #ruby
[13:38:14] Toska: momomomomo: Did you even look at the pastie?
[13:38:19] jhass: slash_nick: no, that's a ipv6 mapped v4 address
[13:38:42] momomomomo: Toska: of course not, you didn't ask your question or explain your situation here
[13:38:50] xrlabs: has joined #ruby
[13:39:19] dhjondoh: has joined #ruby
[13:39:54] yqt: has joined #ruby
[13:39:54] shevy: jhass hmm, aliases alone wouldn't help much, one would need to have the equivalent functionality via ruby tools available as well, and that's quite hard to do. I don't know of any project that, for instance, copies all options of "ls"
[13:39:55] JDiPierro: has joined #ruby
[13:40:06] jlast: has joined #ruby
[13:40:09] jobewan: has joined #ruby
[13:40:10] sharpmachine: has joined #ruby
[13:40:12] JDiPierro: has joined #ruby
[13:40:22] platzhirsch: has joined #ruby
[13:40:58] Toska: Would anyone besides momomomomo be able to explain the best approach for the problem here: http://pastie.org/10269984 ?
[13:41:10] canton7: Toska, not if you don't explain what you're trying to do
[13:41:24] momomomomo: Toska: You might consider checking out the link I sent you
[13:41:35] sevenseacat: has joined #ruby
[13:41:44] shevy: Toska you are using a class var there though right?
[13:41:48] ksjdflsj_: has joined #ruby
[13:41:48] slash_nick: Toska: i'm with momomomomo ... i see your code, but what do you expect?
[13:42:01] Indian: has joined #ruby
[13:42:02] canton7: "subclass class instance" - nowhere do you assign any subclass instances
[13:42:19] momomomomo: *and these are people who actually looked at the pastie*
[13:42:40] Akagi201: has joined #ruby
[13:42:43] Toska: The question is right in the pastie.
[13:43:01] canton7: it may be "right", but that doesn't mean it makes any sense to someone who's not in your head
[13:43:04] shevy: "subclass class instance"
[13:43:16] chinmay_dd: has joined #ruby
[13:43:20] Toska: All of the sudden I remember why I hate IRC. Have fun high up on your horses. Sorry it's so much work to click a link with like 6 lines of code.
[13:43:28] canton7: just because you can understand your own question, doesn't mean that a few token words are enough to convey that information to anyone else..
[13:43:30] Toska: has left #ruby: ()
[13:43:36] shevy: a powerleaver!
[13:43:41] canton7: he really didn't get the point, did he?
[13:44:23] Toska: has joined #ruby
[13:44:38] Toska: canton7: It's not about the question, it's about the shitty attitudes in general.
[13:44:41] Ox0dea: /ignore add Toska
[13:44:52] Toska: I mispoke in the patie, that's my bad.
[13:45:02] canton7: Toska, we're simply telling you that you haven't explained yourself well enough
[13:45:18] Toska: I want to be able to access the class variable in the subclass from the parent class.
[13:45:29] Toska: Or the subclass rather.
[13:45:36] Toska: So TestB.get_attr
[13:45:45] Toska: Should return 'testb'
[13:46:02] Toska: Ox0dea: Please do.
[13:46:03] canton7: oh! nowhere did it say that in your pastie
[13:46:05] jhass: Toska: don't use class variables, use class level instance variables then
[13:46:08] manveru: the best way to use class variables: don't
[13:46:12] canton7: you said Base.get_attr
[13:46:19] Mon_Ouie: has joined #ruby
[13:46:19] Toska: canton7: I said I mispoke
[13:46:37] Toska: The only way I can see, is to replace the class variable with a method that returns 'testb'
[13:46:43] Toska: But it seems hacky.
[13:46:55] sevenseacat: but instead of apologizing for insulting everyone when it was actually you misspeaking
[13:46:58] canton7: ACTION resists the temptation to make a snide comment about high horses :P
[13:47:16] jhass: Toska: if you could do that, it's a CONSTANT
[13:47:21] jhass: self.class::CONSTANT
[13:48:01] jhass: which kinda leads to
[13:48:03] shevy: Toska yeah, a constant; or a variable like @foo on your class, and a method to access that; class Foo; @foo = 5; def self.foo?; @foo; end; end; Foo.foo?
[13:48:04] ruboto: Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
[13:48:23] [H]unt3r: has joined #ruby
[13:48:38] Toska: ruboto: This isn't a problem I am unable to solve, I was just curious what others though.
[13:48:50] Toska: I think jhass is correct, it's better served at a constant.
[13:48:54] shevy: ruboto is a bot
[13:49:20] ruboto: I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
[13:49:29] chouhoulis: has joined #ruby
[13:49:33] Toska: Anyway, thanks for taking a brief moment to look at the pastie.
[13:49:42] Toska: I know it's really hard.
[13:49:43] failshell: has joined #ruby
[13:49:51] jhass: Toska: I could only make my suggestion after your explanation
[13:50:08] momomomomo: Still, check out http://www.mikeash.com/getting_answers.html
[13:50:13] momomomomo: it's not about being on a high horse
[13:50:17] jhass: no idea what the heck you were getting at from the code
[13:50:19] momomomomo: it's about trying to help you ask a question that let's us help you
[13:51:14] canton7: Toska, I looked at the pastie, and I didn't understand it. That's why I asked you further questions
[13:51:21] shevy: yeah, we have to differ
[13:51:28] shevy: some were riding on the high horses, others looked at the pastie!
[13:51:32] Toska: momomomomo: You didn't even click on it, for all you know I had ever bit documented with a thesis at the top. You assumed. I have read your cod many times before, I suggest you click a link before jumping to conclusions about how little information is given.
[13:51:36] canton7: Toska, everyone who talked to you did so after looking at the pastie, and not understanding what you were getting at
[13:51:40] doerteDev: has joined #ruby
[13:51:54] canton7: Toska, I'm willing to bet he did
[13:51:58] sandstrom: has joined #ruby
[13:52:01] momomomomo: no, I didn't assume. I refuse to click on something without you asking the channel (i.e. people) directly your question first
[13:52:05] sevenseacat: Toska: let's turn down the entitlement a little
[13:52:07] doerteDev: has joined #ruby
[13:52:09] Toska: canton7: he literally said he didn't I don't mind follow up questions on those who did.
[13:52:10] sevenseacat: just a little, please.
[13:52:34] Toska: canton7: In fact they are very expected.
[13:52:42] momomomomo: "Hey, I'm wondering how to do this, and I have this code which does X. I think the Z part is doing Y and I'm wondering how to get it to do B. Code is here with comments and explanation: "
[13:52:42] momomomomo: that's a good question
[13:52:43] sevenseacat: we're all here to help each other.
[13:52:54] shevy: momomomomo I could not answer that question you just asked
[13:53:12] momomomomo: shevy: that's because you haven't had your coffee yet
[13:53:14] paulcsmith: has joined #ruby
[13:53:28] shevy: the next pastie that Toska will do, will be a better one
[13:53:29] failshell: in a long running process, i want to stop execution of methods down the chain. exit/abort will make the process exit. return doesn't work. how should i go about doing that/
[13:53:35] rickmasta: has joined #ruby
[13:53:42] zacstewa_: has joined #ruby
[13:53:57] judofyr: failshell: raise an exception and catch it somewhere else.
[13:54:09] judofyr: manveru: one does not simply class variables
[13:54:17] failshell: judofyr: thanks
[13:54:22] jhass: ^ but smells like control flow, maybe there's a way to restructure your code
[13:54:40] judofyr: the smell of control flow!
[13:54:50] sevenseacat: exceptions are not for control flow
[13:54:56] Ox0dea: Watch me.
[13:55:07] shevy: judofyr huh, manveru?
[13:55:13] thiagovsk: has joined #ruby
[13:55:17] shevy: oh wait now I see it
[13:55:20] shevy: he was awake!
[13:55:29] manveru: i'm always awake
[13:55:29] failshell: in my case, it makes sense though. its commands that run with mixlib/shellout. so raising an error does make sense
[13:55:54] sevenseacat: context is a wonderful thing
[13:56:04] cashnguns: has joined #ruby
[13:56:04] judofyr: shevy: I'm just a slow replyer
[13:56:05] shevy: this is one wise cat
[13:56:10] manveru: but hey, who can resist making snide remarks about class variables... they're probably the least useful feature in ruby next to flip flops
[13:56:23] judofyr: I love flip flops
[13:56:27] jhass: failshell: so it's not the common case? your program or infrastructure is broken if it enters that case?
[13:56:32] shevy: are flip flops like sandals?
[13:56:32] Papierkorb: has joined #ruby
[13:56:33] sevenseacat: i like wearing flipflops.
[13:56:48] judofyr: ACTION looks for the fizzbuzz flip flop
[13:56:57] Ox0dea: That was pretty impressive.
[13:57:34] failshell: jhass: its a chatbot handling deployments. if one of the commands sent to system() fail i just want the execution to stop. there's no poing in going further. so raising sounds like a good idea
[13:57:43] judofyr: modifying variables inside a flip-flop is crazy
[13:57:57] judofyr: it's like a state hidden inside a state hidden inside a cookie
[13:58:14] jhass: mmh, but we all like cookies
[13:58:17] shevy: a monad cookie
[13:58:26] shevy: with stuff hidden inside - maybe
[13:58:45] jeanlinux: has joined #ruby
[13:59:06] Ox0dea: Just Maybe?
[13:59:28] ferr: has joined #ruby
[13:59:30] judofyr: >> a=(1..30).select{|x|true unless (a = !a) .. (a = !a)}
[13:59:31] ruboto: judofyr # => [3, 6, 9, 12, 15, 18, 21, 24, 27, 30] (https://eval.in/391095)
[13:59:32] Toska: shevy: Actually this constant doesn't make sense now that I look at it, TESTVAR isn't assigned in Base, so the subclass can't see it: http://pastie.org/private/yysaux6djugdvfxi3higbq And I am back to how it would normally work: http://pastie.org/private/esf4jg9a3qd0ndclrymw I just feel like this is really the wrong way of doing it. Basically I want a shared method in Base to access non-shared 'settings' in the subclass.
[13:59:56] mrmargolis: has joined #ruby
[14:00:09] shevy: well, if it is a constant, you can scope to it anyway through NameOfConstantOne::NAME_OF_THAT_OTHER_CONSTANT_HERE
[14:00:16] jhass: Toska: self.class::FOO
[14:00:24] RegulationD: has joined #ruby
[14:00:28] shevy: jhass also used the :: there as you can see Toska
[14:00:29] jhass: or actually just self::FOO in the class var case
[14:00:49] Toska: But then wouldn't I need to explicitly say in baseclass TestA::TESTVAR
[14:00:59] Toska: I want it to know which constant based on the subclass it is called from
[14:01:01] jhass: Toska: but let me repeat: you're making a generalization where there's none. The best solution depends on the case at hand
[14:01:20] Toska: Alright hold on.
[14:01:22] shevy: well in your current example, you have two different constants anyway; one in TestA, the other in TestB
[14:01:48] izzol: Hmm, my code is doing the job really slow :( Basicialy it's parsing e-mail and looks for encrypted or password protected files. It works ok but slow. When I send 100 e-mails the load is going really high. There is anything that I can improve? (https://gist.github.com/wolfedale/cb670d99d1df97d6da77) :(
[14:01:57] cochise: has joined #ruby
[14:02:16] enebo: has joined #ruby
[14:02:19] judofyr: constant inheritance is really tricky
[14:02:26] judofyr: s/really/surprisingly/
[14:02:36] howardg: has joined #ruby
[14:02:52] howardg: good day. does anyone know how to compare two hashes, disregard the order of keys?
[14:03:15] judofyr: >> {a:1,b:2} == {b:2,a:1}
[14:03:16] ruboto: judofyr # => true (https://eval.in/391096)
[14:03:17] jhass: howardg: Hash#==
[14:04:08] ljarvis: howardg: hashes aren't ordered, hence ^
[14:04:15] howardg: oh that's weird
[14:04:17] ljarvis: and if anyone mentions 1.9 I will kick
[14:04:18] Kully3xf_: has joined #ruby
[14:04:20] Toska: jhass: I have this class: http://pastie.org/private/7gzvlnnrlcg26oua5unsg and this class: http://pastie.org/private/riptpsuoj41hghslorg6q They do nearly identical things, I want to have a base class they inherit from to share functionality. The main thing, is I want to define the @@stop_key in the two subclasses, and have a method in the base class for self.stop that knows the subclasses stop key.
[14:04:21] judofyr: fair point inkjet
[14:04:21] shevy: Toska also when subclassing, I think you'll only subclass for the instance methods or? e. g. the class variable variant that you use in your code, class Base; def self.get_attr, won't be automatically available via TestB.get_attr
[14:04:31] shevy: at least I get an error with the current code
[14:05:35] judofyr: my favorite class variable "feature":
[14:05:54] judofyr: >> class F; @a = 1; end; class Object; @a = 2; end; class F; p @a; end
[14:05:55] ruboto: judofyr # => 1 ...check link for more (https://eval.in/391097)
[14:06:18] judofyr: look, I can't even write class variables
[14:06:19] judofyr: >> class F; @@a = 1; end; class Object; @@a = 2; end; class F; p @@a; end
[14:06:20] ruboto: judofyr # => 2 ...check link for more (https://eval.in/391098)
[14:06:49] slash_nick: I'm back! sorry, fell off my high horse
[14:06:49] Maletor: has joined #ruby
[14:06:52] hinbody: has joined #ruby
[14:07:30] Kully3xf_: can someone explain these variable types real quick - :hn => 'hostname'
[14:07:33] shevy: yeah judofyr
[14:07:35] Toska: slash_nick: Oh you are so funny.
[14:07:36] olistik: has joined #ruby
[14:07:36] Kully3xf_: what kind of variable is that
[14:07:41] shevy: I was wondering... you were hiding the class variable there
[14:07:48] shevy: then I realized... there was no class variable!!!
[14:07:51] NeverDie: has joined #ruby
[14:07:53] slash_nick: oh hey Toska... did you get all sorted out?
[14:07:58] judofyr: Kully3xf_: it's not a variable. it's a Hash.
[14:08:06] Toska: slash_nick: Yeah I just did.
[14:08:11] jhass: Toska: my guts tell me there's a way to make the whole thing proper classes and instances, so you'd have import = StoppableImport.new(FactSet::Import::Tracker::Company, 'company'), import.queue, import.stop etc
[14:08:12] Kully3xf_: why would I use that instead of a variable
[14:08:13] judofyr: Kully3xf_: foo(:bar => 123) is the same as foo({:bar => 123})
[14:08:26] shevy: StoppableImport ...
[14:08:27] KrzaQ: has joined #ruby
[14:08:39] jhass: Toska: but given your examples are modules that inherit...
[14:08:42] judofyr: Kully3xf_: it's often used when you have many (optional) parameters.
[14:08:50] jhass: (= invalid ruby)
[14:09:01] judofyr: Kully3xf_: also, many Rubyists like them because it makes code easier to read
[14:09:06] Toska: slash_nick: I hope you broke your neck. jhass, shevy, thanks you guys, I am just going to refactor the whole thing, I think it needs attention anyway.
[14:09:09] judofyr: Kully3xf_: e.g: render :file => "foo"
[14:09:14] Toska: has left #ruby: ()
[14:09:34] judofyr: Toska: you can't really use class variables in this case. they should be called "class hierarchy variables". in a single hierarchy there is only one variable with a given name.
[14:09:43] mrmargolis: has joined #ruby
[14:10:17] KrzaQ: has joined #ruby
[14:10:18] judofyr: guess you'll never know the secrets of the class variable :(
[14:10:21] eGGsha: has joined #ruby
[14:10:27] judofyr: it's better this way anyway
[14:10:40] tkuchiki: has joined #ruby
[14:10:44] shevy: class variables are just weird
[14:10:48] kaleido: has joined #ruby
[14:10:56] judofyr: not classy at all
[14:11:24] howardg: has left #ruby: ()
[14:11:27] shevy: I once had a bug because of a class variable; when I discovered the bug eventually, I wondered why I was using them in the first place
[14:11:34] jhass: well if you look at the last couple of pasties, that must be a horrible system to work with
[14:11:40] jhass: hidden global state everywhere
[14:11:54] sevenseacat: if Toska comes back, I'd like to propose kicking them out for telling someone to go break their neck
[14:11:55] jamesaxl: has joined #ruby
[14:12:03] KrzaQ: has joined #ruby
[14:12:59] niko: has joined #ruby
[14:13:05] judofyr: "jhass: hidden global state everywhere" <- you just described Rails (hence 95% of all Ruby applications)
[14:13:26] jhass: I guess, but still
[14:13:46] slash_nick: shevy: what would you use in place of a class variable here & here: https://github.com/mbulat/plutus/blob/master/app/models/plutus/equity.rb#L12 && https://github.com/mbulat/plutus/blob/master/app/models/plutus/account.rb#L64
[14:13:48] RegulationD: has joined #ruby
[14:14:15] KrzaQ: has joined #ruby
[14:14:16] shevy: where is the @@ I can't see it
[14:14:35] atom3: has joined #ruby
[14:14:35] slash_nick: ACTION facepalms
[14:14:43] shevy: first judofyr now slash_nick
[14:14:50] shevy: PEOPLE CAN NOT SEE THE INVISIBLE @@!
[14:14:54] mrmargolis: has joined #ruby
[14:15:00] dopie: has joined #ruby
[14:15:04] charliesome: has joined #ruby
[14:15:18] judofyr: hi charliesome
[14:15:22] withnale_: has joined #ruby
[14:15:26] shevy: ohhh charlie!
[14:15:29] jhass: slash_nick: include NormalCreditBalance I guess
[14:15:34] a346: has joined #ruby
[14:16:15] mrmargolis: has joined #ruby
[14:16:16] poguez_: has joined #ruby
[14:16:21] slash_nick: shevy: so that's not a class variable... what is that called?
[14:16:31] jhass: and if that's really a @@class_var behind the scenes it's not doing what you want anyway
[14:16:48] shevy: well a class method that one is I would say
[14:16:56] shevy: but apeiros calls them differently
[14:16:57] jhass: slash_nick: I usually call it class level instance variable
[14:16:59] shevy: so I am confused
[14:17:01] judofyr: I hope it's backed by a instance variable
[14:17:11] judofyr: (at the class level)
[14:17:30] shevy: the ultimate answer can always be provided by looking at how the C source calls those things :)
[14:18:02] slash_nick: ... i think it *is* a class method...
[14:18:26] shevy: wait with the final verdict until apeiros comments!
[14:18:29] jhass: slash_nick: well, technically there isn't even such a thing as class methods, that's something purely conceptual in Ruby
[14:18:43] shevy: see? things just become more complicated
[14:19:06] slash_nick: "it works, it's magic, leave it!"
[14:19:09] judofyr: there's actually not a concept of "methods" in Ruby
[14:19:10] shevy: classes are objects, aren't they?
[14:19:11] KrzaQ: has joined #ruby
[14:19:14] judofyr: Ruby just is
[14:19:17] judofyr: floating around
[14:19:27] jhass: like hot air
[14:19:28] shevy: well, we have module_function right? so ... these aren't methods, they are functions!
[14:19:38] judofyr: classes are objects. objects are instances of classes. everything is just fine.
[14:19:49] shevy: the circle is a square
[14:19:58] jhass: let's make chunky bacon
[14:20:00] shevy: the schroedinger cat is alive
[14:20:03] judofyr: and it inherits from a rectangle
[14:20:10] shevy: jhass what about the vegetarians
[14:20:14] slash_nick: ACTION sticks the cat back in pandora's box
[14:20:19] slash_nick: not sure what's what anymore
[14:20:27] KrzaQ: has joined #ruby
[14:20:43] jhass: shevy: don't be so caught in your definition of bacon
[14:20:50] brettnem: has joined #ruby
[14:21:01] revath: has joined #ruby
[14:21:16] bullcitydev: has joined #ruby
[14:21:32] judofyr: you could *kinda* say that class methods are a specific thing. I mean, actually it's just because singleton classes of classes are tied up in a specific way, but the reason they are structured like that is because of class methods.
[14:22:14] judofyr: long time no IRC (mostly for me I guess)
[14:23:09] shevy: singletons mhmhmh
[14:23:20] shevy: slash_nick now there is another concept now!
[14:23:26] CloCkWeRX: has joined #ruby
[14:24:12] KrzaQ: has joined #ruby
[14:24:16] charliesome: judofyr: yeah! I've mostly just been idling myself
[14:24:33] gambl0re: has joined #ruby
[14:24:37] judofyr: charliesome: doing anything interesting these days? enjoying the summer in front of a bright screen? :)
[14:24:41] decoponio: has joined #ruby
[14:24:44] doerteDev: has joined #ruby
[14:25:25] charliesome: judofyr: just the usual same old :)
[14:26:01] jamesaxl|2: has joined #ruby
[14:26:34] KrzaQ: has joined #ruby
[14:26:57] kies^: has joined #ruby
[14:27:07] DexterLB: has joined #ruby
[14:28:19] Ox0dea: >> _,(_,_,((_,(foo,_)),_)) = [1, [2, [3, 4], [[5, [:target], 6], [7], 8, [9], 10]]]; foo
[14:28:20] ruboto: Ox0dea # => :target (https://eval.in/391144)
[14:28:26] radialneon: has joined #ruby
[14:28:37] jeanlinux: has joined #ruby
[14:28:39] apeiros: Ox0dea: use *
[14:29:01] apeiros: oh, no, that doesn't work with specific lengths
[14:29:11] KrzaQ: has joined #ruby
[14:29:12] apeiros: but for ignoring rest:
[14:29:19] apeiros: >> foo,* = [1,2,3,4]; foo
[14:29:20] ruboto: apeiros # => 1 (https://eval.in/391147)
[14:29:25] Igorshp: has joined #ruby
[14:29:28] Ox0dea: apeiros: And the * isn't even necessary.
[14:30:11] judofyr: >> foo, = [1,2,3,4]; foo
[14:30:11] bullcitydev: has joined #ruby
[14:30:12] ruboto: judofyr # => 1 (https://eval.in/391148)
[14:30:16] apeiros: mhm, sadly. I'd prefer the syntax to be explicit.
[14:30:22] patronus: has joined #ruby
[14:31:06] Ox0dea: Fair enough. I wonder if Ruby'll ever get destructuring for anything but arrays.
[14:31:26] apeiros: Ox0dea: btw., do you have any idea on my Introspectable issue?
[14:31:35] coderhs: has joined #ruby
[14:31:50] Ox0dea: I think compiling your own Ruby would make for significantly fewer headaches. :/
[14:32:09] findaway: has joined #ruby
[14:32:10] apeiros: hrm. lets see then.
[14:32:20] KrzaQ: has joined #ruby
[14:32:26] Kully3xf: has joined #ruby
[14:32:53] NickSpeare: has joined #ruby
[14:33:36] apeiros: cp -R rvm ruby, then ./configure, then make - that should be it, right?
[14:33:39] Ox0dea: It's weird that they didn't figure extensions would ever need to include "internal.h".
[14:34:07] apeiros: probably considered it bad
[14:34:09] KrzaQ: has joined #ruby
[14:34:13] apeiros: i.e. "use the proper ways"
[14:34:36] NickSpeare: hey everybody, i'm trying to figure out how to use classes properly. anybody willing to look at a simple error and help me fix ? http://pastebin.com/ieGdaydB
[14:34:37] ruboto: NickSpeare, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/43fee9c370274bb07173
[14:34:37] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[14:35:25] apeiros: NickSpeare: Project < Redmine does not make it Redmine::Project
[14:35:31] apeiros: it's still just Project, on the toplevel
[14:35:38] brain_shim: has joined #ruby
[14:35:53] apeiros: class Redmine; class Project; end; end # this makes it Redmine::Project
[14:35:54] jpfuentes2: has joined #ruby
[14:36:02] apeiros: (modules are more common as namespaces, though)
[14:36:05] krz: has joined #ruby
[14:36:18] havenwood: has joined #ruby
[14:36:34] Sou|cutter: has joined #ruby
[14:36:36] apeiros: and `def create` defines an instance method. i.e. you need an instance to call it: a_project = Project.new; a_project.create
[14:36:44] Maletor: has joined #ruby
[14:36:48] jlast: has joined #ruby
[14:37:08] dstarh: has joined #ruby
[14:37:12] NickSpeare: apeiros: can I nest the classes?
[14:37:43] apeiros: yes, just as shown.
[14:37:45] Ox0dea: NickSpeare: Classes are not birds; why are you trying to put them in nests?
[14:37:57] bullcitydev: has joined #ruby
[14:38:00] KrzaQ: has joined #ruby
[14:38:33] apeiros: in the code of yours, I don't see why you inherit and namespace in the first place, though
[14:39:00] apeiros: you should have a single toplevel namespace for your whole project. within that, only namespace if necessary.
[14:39:01] NickSpeare: To answer both Ox0dea and apeiros : because I don't know what I am doing...
[14:39:24] AlexRussia: has joined #ruby
[14:39:45] Ox0dea: NickSpeare: Well, that's far from the worst possible answer.
[14:40:13] KrzaQ: has joined #ruby
[14:40:24] Ox0dea: NickSpeare: Redmine should almost certainly be a module, but then you'll need to reconsider how you're using HTTParty.
[14:40:36] shevy: party! let's party
[14:41:45] NickSpeare: Ox0dea: yeah, i was/am not clear on when to use a module vs a class
[14:42:14] DEA7TH: Using Rails, I'm trying to create a webpage which renders whatever another process in the server sends it, via DRb. My code doesn't work: https://gist.github.com/anonymous/020cb386ffa481a3b46e
[14:42:34] DEA7TH: I get DRb::DRbConnError: connection closed when I try to call a method on the object I get via DRb
[14:42:45] Ox0dea: NickSpeare: You create a Thing class when you're going to be making several Things. Modules are just umbrellas under which to put closely related code.
[14:43:13] sharpmachine: has joined #ruby
[14:43:53] Ox0dea: NickSpeare: Enlightenment is knowing when the two should be used in conjunction.
[14:44:44] JDiPierro: has joined #ruby
[14:45:22] jenrzzz: has joined #ruby
[14:45:45] lordkryss: has joined #ruby
[14:46:31] NickSpeare: Ox0dea: thanks for the advice. I will rework what I'm doing...
[14:46:42] DEA7TH: I can read the parameter, but can't call the method. Also I changed the code a bit: https://gist.github.com/anonymous/4beae2b1410282fe3c79
[14:47:14] EagleDelta: has joined #ruby
[14:47:56] freerobby: has joined #ruby
[14:48:02] mary5030: has joined #ruby
[14:48:49] DEA7TH: (I removed the first render call actually)
[14:49:44] mary5030: has joined #ruby
[14:52:56] nfk: has joined #ruby
[14:53:02] chipotles: has joined #ruby
[14:54:14] aryaching: has joined #ruby
[14:54:32] revath: has joined #ruby
[14:55:15] Soda: has joined #ruby
[14:55:33] rippa: has joined #ruby
[14:56:36] KrzaQ: has joined #ruby
[14:57:47] k3asd`: has joined #ruby
[14:59:41] v0n: has joined #ruby
[15:00:45] ylluminarious: has joined #ruby
[15:00:45] Kully3xf: has joined #ruby
[15:01:40] KrzaQ: has joined #ruby
[15:01:40] sharpmachine: has joined #ruby
[15:01:43] dhjondoh: has joined #ruby
[15:01:51] kfpratt: has joined #ruby
[15:02:04] startupality: has joined #ruby
[15:02:05] BTRE: has joined #ruby
[15:02:08] tkuchiki: has joined #ruby
[15:02:34] SylarRuby: has joined #ruby
[15:03:06] revath: has joined #ruby
[15:03:22] dhjondoh: has joined #ruby
[15:04:03] KrzaQ: has joined #ruby
[15:05:04] aryaching: has joined #ruby
[15:06:28] casadei: has joined #ruby
[15:06:41] KrzaQ: has joined #ruby
[15:06:44] senayar: has joined #ruby
[15:06:44] senayar: has joined #ruby
[15:08:10] jlast: has joined #ruby
[15:09:28] KrzaQ: has joined #ruby
[15:09:31] giuseppesolinas: has joined #ruby
[15:10:15] fgo: has joined #ruby
[15:10:53] CatMartyn: has joined #ruby
[15:11:29] ixti: has joined #ruby
[15:12:17] Kully3xf: why does printing --tags 'Name=#{instance[:hn].upcase}#{instance[:iter]}, put the hash "instance[:iter] on a new line
[15:12:51] sivoais: has joined #ruby
[15:12:54] Kully3xf: --tags 'Name=TEST 2,Apps=IDR
[15:12:57] Kully3xf: is the output
[15:13:24] Scripore: has joined #ruby
[15:13:46] Axilla: has joined #ruby
[15:13:51] ayonkhan: has joined #ruby
[15:14:52] mandarinkin: has joined #ruby
[15:15:09] KrzaQ: has joined #ruby
[15:15:16] snockerton: has joined #ruby
[15:15:53] aryaching: has joined #ruby
[15:16:21] chinmay_dd: has joined #ruby
[15:17:24] KrzaQ: has joined #ruby
[15:17:45] apeiros: Kully3xf: um, what?
[15:17:48] apeiros: ?context Kully3xf
[15:17:48] ruboto: Kully3xf, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
[15:18:49] Kully3xf: I am threading the creation of EC2 instances - each instance needs a name. the name was originally store in a hash called :hn as such :hn => 'hostname'
[15:19:07] Kully3xf: now I have a prompt so it's a variable, name and :hn => name,
[15:19:24] Kully3xf: then when the command runs to create the ec2 - it should be name + i.to_s
[15:20:12] Kully3xf: and it works if it's a string, i.e. :hn => 'hostname'+i.to_s and print #{instance[:hn] will print hostname1 hostname2 hostname 3 etc
[15:20:32] chouhoulis: has joined #ruby
[15:20:38] Kully3xf: but if I do it as a passed variable it prints hostname *new line 1 hostname *new line 2 etc
[15:21:00] KrzaQ: has joined #ruby
[15:22:06] tomaz_b: has joined #ruby
[15:22:51] Kully3xf: http://pasted.co/2f0e10d7
[15:22:56] Kully3xf: doesn't work
[15:23:00] KrzaQ: has joined #ruby
[15:23:07] shevy: jhass we are almost at 1100 folks!
[15:23:17] Kully3xf: http://pasted.co/14f09dcc
[15:23:30] Kully3xf: but that will - but it won't be dynamic. user input is ignored
[15:24:10] dfockler: has joined #ruby
[15:25:48] KrzaQ: has joined #ruby
[15:25:48] claws: has joined #ruby
[15:26:07] slumos: has joined #ruby
[15:26:25] apeiros: ok, definitively too hot to make sense of all that
[15:26:36] punkerplunk: has joined #ruby
[15:26:47] apeiros: it *seems* to me like you're asking a question which has absolutely nothing to do with EC2, and only with how puts & string literals work
[15:26:51] allomov: has joined #ruby
[15:27:08] Kully3xf: yea the ec2 is just what's being done w/in the code
[15:27:34] Kully3xf: I just don't understand why :hn => 'string'+i.to_s works and :hn = variable+i.to_s doesn't
[15:28:02] Takumo: Hi all, I'm building an API with Grape, but some some reason my request is being rejected as invalid and I can't actually work out why... because its on an optional String parameter....
[15:28:12] IanV0rn2341: has joined #ruby
[15:28:13] KrzaQ: has joined #ruby
[15:28:16] rcvalle: has joined #ruby
[15:28:19] jhass: Kully3xf: gets.chomp
[15:29:02] polly_wog: has joined #ruby
[15:29:16] A205B064: has joined #ruby
[15:29:32] Kully3xf: lol thank you
[15:29:40] Kully3xf: works! that was frustrating
[15:29:57] Kully3xf: very appreciated!
[15:30:10] Soda: has joined #ruby
[15:30:10] jhass: Kully3xf: now read up on what chomp does and tell me why you need it
[15:30:34] Takumo: chomp chomp chomp
[15:30:50] Kully3xf: ah it reads the
[15:30:56] Kully3xf: "enter" as a char
[15:31:05] allomov: has joined #ruby
[15:31:12] Takumo: gotta love those pesky control characters
[15:31:18] jhass: well, enter produces a newline and you get that returned
[15:31:25] Kully3xf: interesting.
[15:31:33] Kully3xf: only second day with ruby so still so much to learn
[15:32:23] gwendall: has joined #ruby
[15:32:26] Spami: has joined #ruby
[15:33:20] KrzaQ: has joined #ruby
[15:34:08] Takumo: It's also a programming thing, happens in all languages :)
[15:34:39] yorickpeterse: You'll never stop learning
[15:34:42] yorickpeterse: If you do something is wrong
[15:34:47] tuelz: has joined #ruby
[15:34:54] KrzaQ: has joined #ruby
[15:35:49] MuffinPimp: has joined #ruby
[15:38:06] KrzaQ: has joined #ruby
[15:39:07] tuelz1: has joined #ruby
[15:39:24] KrzaQ: has joined #ruby
[15:41:33] ddarkpassenger: has joined #ruby
[15:41:36] KrzaQ: has joined #ruby
[15:42:51] Takumo: or you've managed to memorise wikipedia.
[15:43:18] bullcitydev: has joined #ruby
[15:43:29] KrzaQ: has joined #ruby
[15:44:07] ralku: has joined #ruby
[15:45:58] blaines: has joined #ruby
[15:46:43] sandstrom: has joined #ruby
[15:47:10] KrzaQ: has joined #ruby
[15:47:59] phutchins1: has joined #ruby
[15:48:05] blackmesa: has joined #ruby
[15:48:08] blaines_: has joined #ruby
[15:48:51] Palmer11: has joined #ruby
[15:49:00] pfish: has joined #ruby
[15:49:12] platzhirsch: has joined #ruby
[15:49:34] nolic: has joined #ruby
[15:49:44] senayar: has joined #ruby
[15:50:04] MikeGib: has joined #ruby
[15:50:21] sharpmachine: has joined #ruby
[15:51:03] pfish: So I am building ruby from source to add in some support for a library and whenever I add a line into init.c tcltk give me an error saying it cant find rubysig.h
[15:51:17] rhg135: has joined #ruby
[15:52:11] cashnguns: has joined #ruby
[15:52:46] blackoperat: has joined #ruby
[15:52:51] pfish: is tcltk needed?
[15:53:03] MikeGib: has joined #ruby
[15:53:06] shevy: pfish it is an add-on so you don't need it
[15:55:54] pfish: the worst part is if i build wihtout the line and then rebuild without cleaning it works perfectly fine'
[15:55:55] KrzaQ: has joined #ruby
[15:56:07] pfish: but thanks
[15:57:33] drewo: has joined #ruby
[15:57:58] Maletor: has joined #ruby
[15:58:50] luckyno7: has joined #ruby
[15:59:52] sharpmachine: has joined #ruby
[16:01:48] towski_: has joined #ruby
[16:02:04] revath: has joined #ruby
[16:02:38] paulcsmith: has joined #ruby
[16:02:38] shevy: pfish yeah, the extensions are sometimes a bit strange, I have the very same problem you describe here for openssl
[16:03:01] shevy: the extensions are typically in ext/ subdirectory, so in case of tk, in ext/tk - there you can rebuild the addon lateron, usually it works (for readline for instance; did not work for me with openssl)
[16:03:11] shevy: I have not tried tk in ages though, I am using ruby-gnome :)
[16:03:58] KrzaQ: has joined #ruby
[16:03:59] spider-mario: has joined #ruby
[16:05:09] malconis: has joined #ruby
[16:05:13] baweaver: has joined #ruby
[16:07:08] _blizzy_: has joined #ruby
[16:08:35] dseitz: has joined #ruby
[16:08:49] KrzaQ: has joined #ruby
[16:09:38] radialneon: has joined #ruby
[16:09:51] pfish: im seriously considering just deleting it lol. this is the weirdest error.
[16:10:10] KrzaQ: has joined #ruby
[16:12:33] KrzaQ: has joined #ruby
[16:13:03] platzhirsch: has joined #ruby
[16:13:25] radialneon: has joined #ruby
[16:13:46] mandarinkin: has joined #ruby
[16:14:48] _blizzy_: has joined #ruby
[16:17:11] ddarkpassenger: has joined #ruby
[16:17:37] KrzaQ: has joined #ruby
[16:18:53] tvw: has joined #ruby
[16:20:45] bricker: has joined #ruby
[16:21:08] dionysus69: has joined #ruby
[16:21:10] yxhuvud: has joined #ruby
[16:21:12] swgillespie: has joined #ruby
[16:21:15] dudedudeman: so I have a if/elsif/else statement that is looking for the words yes or no, and it goes through my statements like expected and puts out a result for me based off of whether or not yes or no is the given input. how would i make it continue to loop until i get a yes or no answer?
[16:21:23] a346: has joined #ruby
[16:21:45] zendrix: has joined #ruby
[16:22:00] dudedudeman: would that just be thrown in to a for loop?
[16:22:01] KrzaQ: has joined #ruby
[16:22:26] jpfuentes2: has joined #ruby
[16:22:53] wallerdev: has joined #ruby
[16:23:23] peter_paule: has joined #ruby
[16:23:24] eam: while input != "yes"; input = STDIN.gets.chomp; if ....; end
[16:26:44] Guest1094: has joined #ruby
[16:26:58] arup_r: has joined #ruby
[16:27:48] chinmay_dd: has joined #ruby
[16:28:10] KrzaQ: has joined #ruby
[16:28:30] dudedudeman: putting that in to my code makes it where you have to press enter twice on the command line to return my gets.chomp
[16:28:38] xrlabs: has joined #ruby
[16:28:47] lessless: has joined #ruby
[16:28:49] Ox0dea: while input = gets.chomp; break if input[/yes|no/]; end
[16:29:28] dudedudeman: let me gist it
[16:29:44] shevy: dudedudeman loop { } and break out of it inside the condition; your example sounds like case/when
[16:30:06] KrzaQ: has joined #ruby
[16:30:23] Alayde: has joined #ruby
[16:30:33] dudedudeman: https://gist.github.com/anonymous/e0dd7efe58faa95de911
[16:30:46] DEA7TH: has joined #ruby
[16:31:10] Ox0dea: dudedudeman: This program never terminates.
[16:31:17] dudedudeman: yeah i just noticed that...
[16:31:34] KrzaQ: has joined #ruby
[16:31:38] Ox0dea: Rather, it has the potential to not if the user never says "yes".
[16:31:44] dudedudeman: that's where the break comes in
[16:32:21] MatthewsFace: has joined #ruby
[16:32:25] Scroff: has joined #ruby
[16:32:29] eggoez: has joined #ruby
[16:32:48] dudedudeman: rather, i'd think that's where a break would come in
[16:32:54] KrzaQ: has joined #ruby
[16:33:19] havenwood: This is the code that never ends 'cause it goes on and on my friend... some people started coding it not knowing what it was. And not it goes forever just because. This is the code that never ends.
[16:33:21] yourabi: has joined #ruby
[16:33:22] Ox0dea: dudedudeman: Well, you'll need one for both the "yes" and the "no" clause given the current structure of the code.
[16:34:19] pengin: has joined #ruby
[16:34:34] jenrzzz: has joined #ruby
[16:34:40] slash_nick: Ox0dea: what are the odds the user never says "yes" ;)
[16:34:46] KrzaQ: has joined #ruby
[16:34:50] Ox0dea: slash_nick: I see what you did there.
[16:34:59] dudedudeman: those odds could be high
[16:35:11] Kully3xf: how can I make a very long set in ruby on more than one line
[16:35:11] slash_nick: captive audience
[16:35:25] Ox0dea: Kully3xf: Just put a newline after a comma.
[16:35:44] Ox0dea: Kully3xf: Can't you also do that in Python?
[16:35:52] sgt_yellow: has joined #ruby
[16:35:53] yeticry: has joined #ruby
[16:35:56] Kully3xf: nah in python just put the , and go to new line
[16:36:11] s2013: has joined #ruby
[16:36:19] jack_rabbit: has joined #ruby
[16:36:49] havenwood: Kully3xf: So you have one line you want to break out into many?
[16:36:56] havenwood: Kully3xf: Show the code?
[16:37:19] dudedudeman: shevy: it's true. a case statement might be better here
[16:37:43] dudedudeman: i just want to ask him for yes or no and the program not terminate until he answers one way or the other
[16:37:52] Ox0dea: dudedudeman: You only have three branches; that's a little early to switch to case, in my opinion.
[16:37:53] dudedudeman: he could type in a;sdlkjf;asdk and it would just keep asking for yes or no
[16:38:05] B1n4r10: has joined #ruby
[16:38:09] Kully3xf: http://pasted.co/ccc456b0
[16:38:32] ddarkpassenger: has joined #ruby
[16:38:35] dudedudeman: Ox0dea: that makes sense
[16:39:55] KrzaQ: has joined #ruby
[16:40:02] Ox0dea: dudedudeman: The main problem with your loop is that you're not updating the value of `here`.
[16:40:12] Ox0dea: You only ever obtain input at the very start of the program.
[16:41:58] fantazo: has joined #ruby
[16:42:41] KrzaQ: has joined #ruby
[16:43:05] dudedudeman: ok. let me go pluck around with that
[16:43:18] dudedudeman: Ox0dea: thank you for getting my brain turning a different way
[16:44:23] KrzaQ: has joined #ruby
[16:45:01] RobertBirnie: has joined #ruby
[16:46:02] KrzaQ: has joined #ruby
[16:46:34] tuelz1: has joined #ruby
[16:47:42] dopie: has joined #ruby
[16:49:25] KrzaQ: has joined #ruby
[16:50:01] Ox0dea: dudedudeman: My pleasure. Keep me posted on your progress.
[16:50:07] swgillespie: has joined #ruby
[16:50:35] dudedudeman: i'm plucking away at it now!
[16:51:55] fgo: has joined #ruby
[16:52:26] blackmesa: has joined #ruby
[16:53:07] kerrizor: has joined #ruby
[16:53:32] DEA7TH: has joined #ruby
[16:54:34] Rollabunna: has joined #ruby
[16:55:19] j4cknewt: has joined #ruby
[16:55:32] rikkipitt: has joined #ruby
[16:55:41] diegoviola: Ruby is great, JS is not
[16:56:25] drewo: has joined #ruby
[16:56:33] last_staff: has joined #ruby
[16:56:42] Senjai: Morning ruby
[16:56:58] k3asd`_: has joined #ruby
[16:57:01] shevy: dudedudeman, remember, this is the way of the dude
[16:57:02] jack_rabbit: has joined #ruby
[16:57:11] shevy: simple code for laziness erm I mean efficience!
[16:57:23] dudedudeman: shevy: i'm trying man. sometimes i don't even know how to dude hard enough
[16:58:03] Ox0dea: "Rubyists" who think they think JavaScript sucks don't know either language well enough to speak on the matter.
[16:58:42] shinnya: has joined #ruby
[16:59:03] ChasedSpade: has joined #ruby
[16:59:13] JDiPierro: has joined #ruby
[16:59:47] shevy: dudedudeman I dudetted the code dude http://pastie.org/10270301
[17:00:24] railsraider: has joined #ruby
[17:00:40] shevy: enjoy those simple things dudedudeman ... I am looking at ruby-gnome and it's nooooooot so much fun
[17:00:55] thiagovsk: has joined #ruby
[17:00:56] havenwood: Ox0dea: Who said that?
[17:01:05] shadoi: has joined #ruby
[17:01:07] roolo: has joined #ruby
[17:01:18] Ox0dea: havenwood: I am willing to defend my statement. :P
[17:01:29] shevy: JavaScript sucks
[17:01:52] shevy: https://www.youtube.com/watch?v=FqhZZNUyVFM
[17:02:31] CBke: has joined #ruby
[17:02:31] CBke: has joined #ruby
[17:04:20] dudedudeman: shevy, that is quite nice code. i added in the breaks to get it to jump out of the program afer successful yes/nos
[17:04:32] havenwood: Ox0dea: :P What would you fill in the blank?: JavaScript errors are _.
[17:04:46] Ox0dea: potentially unpleasant
[17:05:10] havenwood: Ox0dea: Google says "bad" with autocomplete. Another option might be "incomprehensible."
[17:05:12] allomov: has joined #ruby
[17:05:32] shevy: dudedudeman \o/ - if you find yourself to use that a lot, consider using Readline; you get cursor support + history through arrow keys
[17:06:59] shevy: and tab completion
[17:07:13] shevy: so you could type y<TAB> and it completes to yes
[17:07:50] Ox0dea: dudedudeman: https://gist.github.com/0x0dea/4b261fc3352c8adb46ec
[17:07:54] peter_paule: has joined #ruby
[17:07:57] wallerdev2: has joined #ruby
[17:08:02] dudedudeman: for this case, i was just trying to ask the guy that's been mentoring me here at work if he could meet today. lol. when i could havej ust gone, hey, you free? lol
[17:08:23] dudedudeman: Ox0dea: now THAT is pretty
[17:08:59] davedev24_: has joined #ruby
[17:09:02] Ox0dea: It's just a skeleton, of course, but I think it demonstrates the beginnings of "separation of concerns" quite well.
[17:09:03] rikkipitt: has joined #ruby
[17:09:31] lkba: has joined #ruby
[17:10:44] bullcitydev: has joined #ruby
[17:11:13] glenab: has joined #ruby
[17:12:22] skyrocker: has joined #ruby
[17:12:49] skyrocker: has left #ruby: ()
[17:13:28] cubicool: has joined #ruby
[17:13:39] anjen: has joined #ruby
[17:13:44] nofxx: has joined #ruby
[17:13:46] gloscombe: has joined #ruby
[17:14:05] cubicool: Is there a way for me to use eval() and have any variables declared therein appear in the surrounding scope?
[17:14:28] cubicool: eval('x = 10') and then reference the symbol 'x' later?
[17:14:32] KrzaQ: has joined #ruby
[17:14:36] shevy: cubicool hmm; I think you can somehow attach a binding object
[17:14:36] Ox0dea: But... why?
[17:14:46] cubicool: Lets call it academic. :)
[17:15:23] hahuang65: has joined #ruby
[17:15:54] Ox0dea: cubicool: Well, you do indeed have to do all the evaluation inside a separate binding.
[17:16:14] Ox0dea: >> b = binding; b.eval('foo = 1'); b.eval('foo')
[17:16:15] ruboto: Ox0dea # => 1 (https://eval.in/391215)
[17:16:54] shevy: cubicles will be happy
[17:17:05] eam: I think it's not possible to pass the current binding though, correct?
[17:17:11] Ox0dea: That's correct.
[17:17:20] Ox0dea: >> TOPLEVEL_BINDING.eval('foo = 1'); foo
[17:17:20] shevy: there must be a way!
[17:17:21] ruboto: Ox0dea # => undefined local variable or method `foo' for main:Object (NameError) ...check link for more (https://eval.in/391216)
[17:17:58] eam: you could walk the binding, find new variables, and create them with instance_variable_set
[17:18:05] dudedudeman: Ox0dea: i took the skeleton and this is my result. thoughts? https://gist.github.com/anonymous/ec56f7061269f7f54e7e
[17:18:16] benlieb: has joined #ruby
[17:19:38] KrzaQ: has joined #ruby
[17:19:47] zzor: has joined #ruby
[17:20:35] mikecmpbll: has joined #ruby
[17:20:40] Ox0dea: dudedudeman: I think it looks great! Did you notice, though, that shevy's approach handled variation in the responses?
[17:20:40] Tarkers34: has joined #ruby
[17:20:56] bradleyprice: has joined #ruby
[17:21:02] havenwood: dudedudeman: If you haven't tried it yet you could capture a keypress of 'y' / 'Y' or 'n' / 'N' with: require 'io/console'; STDIN.getch
[17:21:06] shevy: lazy one letter typing!
[17:21:14] towski_: has joined #ruby
[17:21:19] shevy: havenwood is even lazier
[17:21:24] dblessing: has joined #ruby
[17:21:26] Ox0dea: dudedudeman: Do you reckon you'd be able to add that feature?
[17:21:28] shevy: he optimized the return-key away
[17:21:32] KrzaQ: has joined #ruby
[17:21:33] dudedudeman: Ox0dea: i reckon!
[17:21:34] nodeworm: has joined #ruby
[17:21:42] dudedudeman: i leave for lunch in 9 minutes! lemme pluck away at that
[17:21:49] Ox0dea: Godspeed!
[17:21:53] iateadonut: has joined #ruby
[17:22:23] dudedudeman: berfore i start, i will ask this. can i implement the above without touching the handle_yes/no methods?
[17:22:35] iateadonut: when you're in irb from rails, is there a way to reload so that you can use your new methods but not exit the irb so you still have you history?
[17:22:36] Ox0dea: Absolutely.
[17:23:26] shevy: dudedudeman your methods stay safe as they are; you can think of your loop as an empty plugin-handler, you push in your methods to handle the plugin
[17:23:44] nodeworm: has joined #ruby
[17:23:56] havenwood: iateadonut: Like `reload!`? The best place for Rails console questions is the #RubyOnRails channel.
[17:24:04] dudedudeman: mmmm. my mind hurts. but i like it. it hurts so good
[17:24:10] shevy: the dudedudeman ateadonut
[17:24:34] uri__: has joined #ruby
[17:24:39] shevy: iateadonut I'd also like to know if there is a simple way for that in irb, I don't know if there is one myself
[17:24:40] bradleyprice: has joined #ruby
[17:24:43] dudedudeman: no! no donuts for me. i'm down like 32 pounds!
[17:24:46] Ox0dea: dudedudeman: Think about it, though. It would be quite easy to add a response to "maybe", would it not?
[17:24:57] Scripore: has joined #ruby
[17:25:13] dudedudeman: i would htink so
[17:25:18] shevy: dudedudeman wow, no kidding? 32 pounds? that's damn impressive... I keep on falling back to what I manage to cut down
[17:25:33] dudedudeman: shevy: yeah! started this journey at 300pounds
[17:25:54] dudedudeman: i'm 6'2 ish, so no one really believed me that i was that much, but i stepped on a scale and was like, "it is time"
[17:26:16] dudedudeman: and Ox0dea, i'm going to chew on that. i'm headed to lunch with the mentor here at work! i'll get to pick his brain about this, too :)
[17:26:41] _blizzy_: has joined #ruby
[17:28:32] rikkipitt: has joined #ruby
[17:28:51] Palmer11: has joined #ruby
[17:30:36] nodeworm: has joined #ruby
[17:30:37] gloscombe: has joined #ruby
[17:31:40] balazs: has joined #ruby
[17:33:04] cbrad: has joined #ruby
[17:33:04] cbrad: has joined #ruby
[17:33:27] kirun: has joined #ruby
[17:33:31] _blizzy_: has joined #ruby
[17:34:07] Spami: has joined #ruby
[17:34:40] freeze: has joined #ruby
[17:34:57] alex88: has joined #ruby
[17:35:19] Mon_Ouie: has joined #ruby
[17:36:08] Spami: has joined #ruby
[17:38:38] KrzaQ: has joined #ruby
[17:39:26] renderful: has joined #ruby
[17:40:15] lkba: has joined #ruby
[17:41:14] devdazed: has joined #ruby
[17:42:04] bluOxigen: has joined #ruby
[17:42:11] KrzaQ: has joined #ruby
[17:42:43] snockerton: has joined #ruby
[17:42:54] swgillespie: has joined #ruby
[17:45:38] CBke: has joined #ruby
[17:45:38] CBke: has joined #ruby
[17:45:48] jmhmccr: has joined #ruby
[17:46:25] Jackneill: has joined #ruby
[17:46:31] Wolland: has joined #ruby
[17:47:14] cbortz: has joined #ruby
[17:47:14] cbortz: has joined #ruby
[17:47:19] xxneolithicxx: shevy: theres always a way! now what are we talking about? lol
[17:49:01] shevy: xxneolithicxx cubicool wondered how to pass around eval-ed data
[17:50:14] xxneolithicxx: err ya got me, i only used bindings in a few places and havent bothered to gone back to read its magic
[17:50:18] chouhoul_: has joined #ruby
[17:50:34] shevy: same here actually
[17:51:17] xxneolithicxx: if you want to see some really interesting use of it, read through vagrant codebase. the whole thing is basically nested binding hell lol
[17:51:53] benlieb: has joined #ruby
[17:52:24] xxneolithicxx: or at least i think it was binding, havent read it in a while
[17:52:27] benlieb: has joined #ruby
[17:52:28] shevy: that scares me
[17:52:47] railsraider: has joined #ruby
[17:52:57] gambl0re: has joined #ruby
[17:54:47] voker57: has joined #ruby
[17:55:29] chouhoulis: has joined #ruby
[17:55:49] djbkd: has joined #ruby
[17:56:20] momomomomo: has joined #ruby
[17:56:22] Dopagod: has joined #ruby
[17:56:45] pengin: has joined #ruby
[17:57:00] revath: has joined #ruby
[17:57:05] zendrix: has joined #ruby
[17:58:49] bf4: has joined #ruby
[17:59:09] momomomomo_: has joined #ruby
[18:00:14] balazs: has joined #ruby
[18:02:23] benlieb: At work I???ve been doing ruby / rails / ember projects exclusively, but am now being encouraged to take on some Java-related things. I love ruby / rails and frontend, but java is really unpleasant for me to work with. What???s the general sense of where java is with respect to future ???value??? in a developer???s career?
[18:03:26] corecode: has joined #ruby
[18:04:01] eam: benlieb: it's hugely entrenched in application middleware, and android
[18:04:02] corecode: what would be the quickest way to display some pixel data on X? use some ruby sdl layer?
[18:04:02] Senjai: benlieb: Just stick to waht you enjoy
[18:04:16] Senjai: corecode: Not related to ruby
[18:04:32] iateadonut: has left #ruby: ()
[18:04:59] mleung: has joined #ruby
[18:05:02] bffff_: has joined #ruby
[18:05:38] eam: corecode: yeah. Last time I wanted to do some graphics gosu worked the best
[18:06:08] benlieb: Senjai: I would prefer that, but that might create a bit of team tension. Part of my resistance is feeling that java is on its way ???out???, at least for web app dev. But I could be wrong. It???s hard to feel the pulse of that kind of thing.
[18:06:25] benlieb: I would rather be a ruby dev
[18:06:36] benlieb: I guess my ???ruby
[18:06:42] Senjai: benlieb: Your team is adopting java FROM ruby?
[18:06:42] bricker: benlieb: java is alive and well, let me assure you
[18:06:55] Senjai: benlieb: ^, it's also pointless to use it unless you need to use it
[18:07:02] serivich: has joined #ruby
[18:07:09] benlieb: I guess my ???ruby-related??? question is, is it reasonable to greatly prefer ruby over java in terms of future-proofing my career?
[18:07:20] jackjackdripper: has joined #ruby
[18:07:25] Senjai: benlieb: You future proof your career by not being dumb, and learning how to solve problems
[18:07:30] Senjai: benlieb: Languages can be picked up in a week
[18:07:40] Senjai: benlieb: Knowing a language != software engineering
[18:07:50] snockerton: has joined #ruby
[18:07:55] fmcgeough: has joined #ruby
[18:08:11] psyprus: has joined #ruby
[18:08:15] shevy: corecode xosd perhaps http://sourceforge.net/projects/libxosd/files/libxosd/
[18:08:15] sarkyniin: has joined #ruby
[18:08:20] Senjai: benlieb: You need to know enough to pick the right tool, and the right tool may not be a language you currently know, and that shouldn't matter
[18:08:31] jhass: the more languages and toolkits you know, the quicker you can adapt to new ones and the more your general work benefits. Doesn't get more future proof than that
[18:08:34] shevy: I used it in the past to write randomly coloured text anywhere on the screen
[18:09:07] unshadow: has joined #ruby
[18:10:08] blackmesa: has joined #ruby
[18:12:41] shevy: anyone can recommend a specific library for this: "given a colour x, such as "slateblue", find a slightly lighter colour" - I need it for on-hover effects in a GUI
[18:13:00] blackmes1: has joined #ruby
[18:13:13] charliesome: has joined #ruby
[18:13:33] ytti: shevy, wouldn't it be sufficient just to add 1 to every number in hex code?
[18:13:50] mrmargolis: has joined #ruby
[18:14:02] VictorBjelkholm: has joined #ruby
[18:14:13] shevy: ytti dunno, probably
[18:14:29] shevy: I guess I should just write exactly a gem that does that and nothing more :)
[18:15:05] bhorn1: has joined #ruby
[18:15:33] revath: has joined #ruby
[18:15:59] bhorn1: hey guys quick question about gtk3 in ruby. Is there any built in functions similar to the card layout in java swing that will allow me to easily hide one widget while displaying another at the push of a button?
[18:16:18] Mon_Ouie: If you have something that's just half-red, adding to all components will also make it somewhat blue and somewhat red, i.e. change the hue
[18:16:34] Mon_Ouie: You probably want to change luminance alone
[18:16:46] Kully3xf_: has joined #ruby
[18:16:56] ytti: shevy, ummm
[18:17:03] ytti: shevy, 0xabcdef + 0x111111
[18:17:06] momomomomo: has joined #ruby
[18:17:11] ytti: shevy, bit short code for gem
[18:17:27] shevy: so my red becomes bluish
[18:17:49] Mon_Ouie: somewhat blue and somewhat green (and still mostly red)* is what I meant to say
[18:17:52] ytti: each of the colour gets up the same amount
[18:18:01] ytti: i.e. it becomes 'lighter'
[18:18:25] Mon_Ouie: #7F0000 + #010101 => you used to have 0 green and 0 blue, now you have some green and some blue
[18:19:21] Mon_Ouie: Multiplying all components by something that's greater than 1 one would work
[18:20:10] Mon_Ouie: https://github.com/jfairbank/chroma apparently has lighten, brighten, etc.
[18:20:31] baweaver: has joined #ruby
[18:20:52] a346: has joined #ruby
[18:21:21] shevy: 'red'.paint.lighten(30) \o/
[18:21:51] Musashi007: has joined #ruby
[18:22:08] wikus: has joined #ruby
[18:22:14] j4cknewt: has joined #ruby
[18:22:47] cbz: has joined #ruby
[18:22:47] cbz: has joined #ruby
[18:22:57] sharpmachine: has joined #ruby
[18:23:03] cmisenas: has joined #ruby
[18:23:40] sarkyniin: has joined #ruby
[18:25:30] Kully3xf: has joined #ruby
[18:25:51] allomov: has joined #ruby
[18:26:41] Muhannad: has joined #ruby
[18:27:26] MasterPiece: has joined #ruby
[18:27:34] guillaume-rb: has joined #ruby
[18:28:02] choke: has joined #ruby
[18:34:51] Tarkers34: hey all...how do I extend a class if it's extendor is inside a module? http://pastebin.com/wmRt0bdG
[18:34:52] ruboto: Tarkers34, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/346b57171ced0877a7c3
[18:34:52] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[18:34:57] codecop: has joined #ruby
[18:35:00] wikus: has left #ruby: ("WeeChat 1.3-dev")
[18:36:01] Tarkers34: hey all...how do I extend a class if it's extendor is inside a module? https://gist.github.com/anonymous/346b57171ced0877a7c3 I'm feeling I need to run "MyModule.run", something like that?
[18:36:42] Tarkers34: excite() works perfectly if we're not in a module of course :P
[18:37:07] workmad3: has joined #ruby
[18:37:33] hahuang65: has joined #ruby
[18:38:10] zachrab: has joined #ruby
[18:38:55] zachrab: trying to hit an api endpoint but server uses windows integrated authentication. how can i pass AD creds with ruby?
[18:39:08] a346: has joined #ruby
[18:39:53] rubynewbie123: has joined #ruby
[18:40:05] zendrix: has joined #ruby
[18:40:31] rubynewbie123: im trying to hit an api endpoint which uses windows integrated authentication. How do I pass AD creds with Ruby gem?
[18:40:49] havenwood: Tarkers34: class ::String
[18:41:00] havenwood: Tarkers34: You might want to look into refinements.
[18:41:20] GPrime: has joined #ruby
[18:41:21] senayar: has joined #ruby
[18:41:35] peter_paule: has joined #ruby
[18:41:56] nateberkopec: has joined #ruby
[18:42:53] rubynewbie123: im trying to hit an api endpoint which uses windows integrated authentication. How do I pass AD creds with Ruby gem?
[18:43:05] multi_io: has joined #ruby
[18:43:06] CatMartyn: has joined #ruby
[18:44:15] cbortz: has joined #ruby
[18:44:31] bf4: has joined #ruby
[18:44:55] pfish: Does anyone know how to add a test to the tests ruby does when make test is executed?
[18:46:42] Palmer11: has joined #ruby
[18:47:12] nichtdiebohne: has joined #ruby
[18:48:12] postmodern: has joined #ruby
[18:49:14] Zai00: has joined #ruby
[18:49:15] CatMartyn: has joined #ruby
[18:50:03] KrzaQ: has joined #ruby
[18:50:09] andikr: has joined #ruby
[18:50:35] rubynewbie123: im trying to hit an api endpoint which uses windows integrated authentication. How do I pass AD creds with Ruby gem?\
[18:50:47] guillaume-rb: has joined #ruby
[18:50:53] ddv: rubynewbie123, stop repeating yourself
[18:51:26] sinkensabe: has joined #ruby
[18:51:42] luckyno7: has joined #ruby
[18:52:01] rubynewbie123: ddv: no one is responding
[18:52:17] ddv: rubynewbie123, so?
[18:52:21] mcclurmc: has joined #ruby
[18:52:40] hotpancakes: has joined #ruby
[18:53:00] yqt: has joined #ruby
[18:53:01] ljarvis: rubynewbie123: repeating yourself isn't going to make people respond quicker. It's spamming and you'll be kicked from the channel if you continue. Please wait for a response
[18:53:02] shevy: rubynewbie123 not many here do use windows
[18:53:04] kies^: has joined #ruby
[18:54:55] lkba_: has joined #ruby
[18:55:22] ivanskie: has joined #ruby
[18:55:26] havenwood: rubynewbie123: https://rubygems.org/search?utf8=%E2%9C%93&query=active+directory
[18:57:46] rubynewbie123: havenwood: do you know how i would go about using ruby to hit an endpoint?
[18:57:59] rubynewbie123: which uses WIA
[18:58:12] havenwood: rubynewbie123: I don't know what WIA is.
[18:58:17] rodfersou: has joined #ruby
[18:58:21] rubynewbie123: havenwood: windows integrated authentication
[18:58:28] havenwood: I still don't know what it is.
[18:58:31] rubynewbie123: shevy: you know?
[18:58:38] gambl0re: has joined #ruby
[18:58:43] shevy: rubynewbie123 no, nobody knows man
[18:59:14] havenwood: Is that different than IWA?
[18:59:27] rubynewbie123: havenwood: thats the acronym sorry
[18:59:37] Ox0dea: rubynewbie123: How do you pronounce it?
[19:00:08] Ox0dea: Acronyms are pronounceable; if you just say the letters, it's an initialism.
[19:00:12] chouhoul_: has joined #ruby
[19:00:12] hotpancakes: quick question. how do I find the potential errors a method might raise?
[19:00:16] rubynewbie123: Ox0dea: touche
[19:00:23] Ox0dea: Well met.
[19:00:49] rubynewbie123: Ox0dea: do you have any idea how id send an authorized request to an IWA api
[19:01:01] Ox0dea: rubynewbie123: I'm afraid I touch Windows as little as I can, mate.
[19:01:56] GitGud: has joined #ruby
[19:02:12] bf4: has joined #ruby
[19:02:33] zendrix: has joined #ruby
[19:03:01] Ox0dea: rubynewbie123: Would you like me to Google it for you? :P
[19:03:07] Pupeno: has joined #ruby
[19:03:13] Pupeno: has joined #ruby
[19:04:33] Voker57|2: has joined #ruby
[19:04:34] Scroff: has joined #ruby
[19:05:10] Ox0dea: hotpancakes: By its very nature, Ruby resists the sort of static analysis that would provide such information.
[19:05:41] ChasedSpade: has joined #ruby
[19:06:33] revath: has joined #ruby
[19:07:23] symm-: has joined #ruby
[19:07:24] brain_shim: has joined #ruby
[19:07:27] Tarkers34: havenwood: what do you mean by class ::String
[19:07:48] havenwood: Tarkers34: Try changing where you have `class String` to `class ::String`.
[19:08:11] Tarkers34: yeah tried that, stack level too deep :/
[19:09:48] Tarkers34: https://gist.github.com/anonymous/00666b60e131d5fd04c0
[19:10:00] yardenbar: has joined #ruby
[19:10:10] havenwood: Tarkers34: Can't call the method in the method.
[19:10:39] Tarkers34: what a stupid error not thinking :P
[19:10:46] Ox0dea: Tarkers34: You got triple sixes in your Gist hash.
[19:10:55] gambl0re: has joined #ruby
[19:11:00] Ox0dea: I'd like to talk to you about our lord and savior, Beelzebub.
[19:11:10] tflat: has joined #ruby
[19:11:14] havenwood: 10032 levels... of excite
[19:11:14] Tarkers34: ox0dea haha. I bought some snacks the other day, came to ??6.66
[19:11:16] cout: and e1e1d is _almost_ e i e i o
[19:11:25] cout: er, e131d
[19:11:35] Tarkers34: shop clerk was like "hail satan" under his breath :P
[19:11:44] Tarkers34: havenwood: welcome to the house of fun
[19:14:18] Channel6: has joined #ruby
[19:15:22] gambl0re: has joined #ruby
[19:16:13] Scroff: has joined #ruby
[19:16:27] KrzaQ: has joined #ruby
[19:16:32] knikolov: has joined #ruby
[19:18:47] podman: has joined #ruby
[19:20:32] khebbie: has joined #ruby
[19:20:52] atom3: has joined #ruby
[19:21:33] alphaatom: has joined #ruby
[19:21:35] Scroff: has joined #ruby
[19:21:44] peter_paule: has joined #ruby
[19:23:25] gambl0re: has joined #ruby
[19:23:29] guillaume-rb_: has joined #ruby
[19:23:44] revdan: has joined #ruby
[19:23:49] DoubleMalt: has joined #ruby
[19:24:14] Agoldfish: has joined #ruby
[19:24:40] CorySimmons: has joined #ruby
[19:25:40] jack_rabbit: has joined #ruby
[19:25:41] allomov: has joined #ruby
[19:26:27] blackmes1: has joined #ruby
[19:26:37] ta: has joined #ruby
[19:26:56] mikecmpbll: has joined #ruby
[19:27:22] kies^: has joined #ruby
[19:27:31] sharpmachine: has joined #ruby
[19:29:04] mister_solo: has joined #ruby
[19:29:19] brain_shim: has joined #ruby
[19:29:19] blue_deref: has joined #ruby
[19:29:24] rikkipitt: has joined #ruby
[19:29:25] Frem: has joined #ruby
[19:31:40] rikkipitt: has joined #ruby
[19:32:12] Polysics: has joined #ruby
[19:32:43] bradleyprice: has joined #ruby
[19:33:26] ringarin: has joined #ruby
[19:33:45] baweaver: has joined #ruby
[19:35:05] jeanlinux: has joined #ruby
[19:35:41] gwendall: has joined #ruby
[19:36:47] apofis: has joined #ruby
[19:37:17] baweaver: has joined #ruby
[19:37:32] nym: has joined #ruby
[19:39:19] peter_paule: has joined #ruby
[19:40:10] bradleyprice: has joined #ruby
[19:41:15] sigurding: has joined #ruby
[19:41:23] chinmay_dd: has joined #ruby
[19:42:23] apofis: has joined #ruby
[19:44:32] gianlucadv: has joined #ruby
[19:45:11] saadq: has joined #ruby
[19:45:27] bradleyp_: has joined #ruby
[19:45:33] toretore: has joined #ruby
[19:46:13] lys: has joined #ruby
[19:47:11] lolmaus: has joined #ruby
[19:48:46] chouhoulis: has joined #ruby
[19:49:50] pepperbreath: has joined #ruby
[19:50:13] k3asd`: has joined #ruby
[19:50:51] CaptainCibai: has joined #ruby
[19:51:30] framling: has joined #ruby
[19:54:30] gambl0re: has joined #ruby
[19:55:17] howdoicomputer: has joined #ruby
[19:55:41] Scroff: has joined #ruby
[19:56:19] dblessing: has joined #ruby
[19:56:25] revath: has joined #ruby
[19:56:34] benlieb: has joined #ruby
[19:57:53] blackmes1: has joined #ruby
[19:59:01] djbkd: has joined #ruby
[20:00:35] gambl0re: has joined #ruby
[20:00:55] msnyon: has joined #ruby
[20:01:38] Pwnna: has left #ruby: ("Leaving")
[20:04:28] zendrix: has joined #ruby
[20:04:36] stoodfarback: has joined #ruby
[20:05:30] warreng: has joined #ruby
[20:07:03] findaway: has joined #ruby
[20:07:26] revath: has joined #ruby
[20:08:56] danman: has joined #ruby
[20:08:58] izzol: has joined #ruby
[20:09:12] shevy: I am looking at this code:
[20:09:15] shevy: def init; puts "","",""
[20:09:24] shevy: does anyone happen to know why the author used that?
[20:09:32] brettnem: has joined #ruby
[20:10:11] Ox0dea: shevy: Is there a better way to output three blank lines?
[20:10:27] yorickpeterse: shevy: because they drunk
[20:10:30] Ox0dea: Derp. "\n\n\n"
[20:10:46] shevy: well "better"
[20:11:00] shevy: I think it is the first time that I see puts "","",""
[20:11:29] shevy: you know how things are when you look at something for the first time in your life
[20:11:31] shevy: like perl code!
[20:12:13] Ox0dea: The more Perl-esque approach would've been ?\n*3.
[20:12:39] Ox0dea: But yeah, `puts` can be called with multiple arguments and writes a newline after each one.
[20:12:56] shevy: pretty cool what his script does though http://shevegen.square7.ch/screenshot.png
[20:13:08] Ox0dea: > script .png
[20:13:26] peter_paule: has joined #ruby
[20:14:06] bf4: has joined #ruby
[20:14:54] shevy: lots of weird constants... TopLeft = "\342\224\214"
[20:15:16] Ox0dea: Those are terminal escape codes. Why not just use "\r" to return to the beginning of the line?
[20:15:32] __butch__: has joined #ruby
[20:15:37] Ox0dea: Simplest possible progress bar: 100.times { |i| sleep rand / 10; print "\r#{'#' * i}" }
[20:15:49] DLSteve: has joined #ruby
[20:15:54] shevy: dang... just tried it in xterm, guess it does not work in every terminal type :(
[20:16:03] Muhannad: has joined #ruby
[20:16:28] TheHodge: has joined #ruby
[20:16:36] Ox0dea: What doesn't work in xterm?
[20:16:41] failshell: has joined #ruby
[20:16:47] mozzarella: has joined #ruby
[20:17:34] shevy: that progress bar thing; works fine in kde konsole though
[20:18:00] shevy: the central part works fine, with those teal/blue colours, but the surrounding... box-layers don't work
[20:18:19] shevy: pretty cool that you can use those tokens in konsole
[20:18:21] Soda: has joined #ruby
[20:18:32] shevy: I could make a nethack without ncurses!
[20:20:11] Ox0dea: shevy: You just need to use a better font, mate.
[20:20:12] zendrix: has joined #ruby
[20:20:18] Ox0dea: Those are standard Unicode box drawing characters.
[20:20:22] langlands: has joined #ruby
[20:20:31] gamename: has joined #ruby
[20:20:38] solocsha1: has joined #ruby
[20:20:39] baweaver: has joined #ruby
[20:20:39] Ox0dea: They might even be extended ASCII, but I forget.
[20:20:42] zendrix: has joined #ruby
[20:20:49] jpfuentes2: has joined #ruby
[20:21:00] jack_rabbit: has joined #ruby
[20:21:11] revdan: has joined #ruby
[20:21:14] j4cknewt: has joined #ruby
[20:21:18] Papierkorb: has joined #ruby
[20:21:23] drPoggs: has joined #ruby
[20:21:25] dstarh: has joined #ruby
[20:21:25] elektronaut: has joined #ruby
[20:21:39] _whitelogger: has joined #ruby
[20:21:55] bklane: has joined #ruby
[20:22:20] yfeldblum: has joined #ruby
[20:23:52] solocsha1: has left #ruby: ()
[20:24:14] wallerdev2: has joined #ruby
[20:24:16] scylla: has joined #ruby
[20:24:20] momomomomo: has joined #ruby
[20:24:32] WillAmes: has joined #ruby
[20:25:49] revath: has joined #ruby
[20:25:52] nateberkopec: has joined #ruby
[20:25:56] workmad3: has joined #ruby
[20:26:06] choke: has joined #ruby
[20:26:22] bradleyprice: has joined #ruby
[20:26:44] sphex: TTY box-drawing is a mess. some programs assume the encoding is CP437-like. some use the Unicode code points. and some use the ACS (alternate character set) feature of curses (which looks like a good idea, but doesn't seem to work quite right with all terminals).
[20:27:23] Tarkers34: so are string the only data classes that can have bang methods? And do they use the .replace() method to make their inplace change? Because it seems to me like it it's impossible to extend the symbol class with a bang methof :)
[20:27:40] Tarkers34: :hello.to_s! # impossible! (right)
[20:27:58] shevy: it's pretty cool... this here is a checkbox: puts "\e[32m\342\234\224\e[0m"
[20:27:59] scylla: has left #ruby: ()
[20:28:00] apeiros: no, strings are not the only
[20:28:01] eGGsha: has joined #ruby
[20:28:17] apeiros: Tarkers34: bang methods (usually) are methods which mutate the object
[20:28:27] apeiros: so usually only mutable objects have bang methods
[20:28:37] NeverDie: has joined #ruby
[20:28:56] Ox0dea: Tarkers34: There are many ways other than #replace to mutate a String.
[20:29:01] apeiros: nothing actually stops you from adding a method called to_s! to Symbol. but it'd just be misleading as it can't ever do what its name implies.
[20:29:13] Ox0dea: apeiros: Fiddle. ^_^
[20:29:18] bklane: has joined #ruby
[20:29:35] shevy: how can I find out that "\342\234\224" is a checkbox though? or rather, it's more an arrow
[20:29:40] Zai00: has joined #ruby
[20:30:00] Ox0dea: shevy: Those are just characters encoded in octal.
[20:30:28] sharpmachine: has joined #ruby
[20:30:36] Ox0dea: >> "???".bytes == "\342\234\224".bytes
[20:30:37] ruboto: Ox0dea # => true (https://eval.in/391277)
[20:30:50] scylla: has joined #ruby
[20:31:26] Tarkers34: apeiros: mutable objects are objects whose instance's contents can change? Strings are the only mutable objects? What other native ruby data classes are mutable, out of interest? Integers aren't.
[20:31:44] apeiros: arrays, hashes
[20:31:53] Ox0dea: shevy: "\e[32m" makes the foreground green, and "\e[0m" resets it to the original.
[20:32:36] fgo: has joined #ruby
[20:32:45] workmad3: has joined #ruby
[20:33:35] shevy: yeah, the colour part I could figure out; I am playing around with the symbols, the snowman is working! http://shevegen.square7.ch/screenshot.png
[20:33:53] pengin: has joined #ruby
[20:34:11] Ox0dea: shevy: Have you considered using Rugen?
[20:34:19] drewo: has joined #ruby
[20:34:21] shevy: dunno but I should make a minesweeper variant with that snowman alone
[20:34:34] shevy: I never heard about Rugen before
[20:35:19] Ox0dea: https://github.com/0x0dea/rugen
[20:35:34] Ox0dea: I probably should have just called it named_unicode_literals, but I'm quite proud of the pun.
[20:35:53] Ox0dea: Did you know you can actually handle mouse events in most modern terminals?
[20:35:58] zendrix: has joined #ruby
[20:36:11] j4cknewt: has joined #ruby
[20:36:19] jenrzzz: has joined #ruby
[20:36:31] shevy: I did not know that
[20:36:38] shevy: that means I could on-click cd into a directory?
[20:36:52] kadoppe: has joined #ruby
[20:37:11] Tarkers34: apeiros I'm trying to find a list of mutable object classes but honestly can't find any. Would you say that it? | String, Array, Hash, Set, Queue | ?
[20:37:31] shevy: + 28.000 lines of code https://raw.githubusercontent.com/0x0dea/rugen/master/lib/rugen/maps.rb
[20:37:52] Ox0dea: shevy: "Code" is a stretch.
[20:38:04] shevy: I seem to get a slight delay when I do require 'rugen'
[20:38:04] Ox0dea: Blame the Unicode Consortium.
[20:38:27] shevy: I can tell you let the ruby parser do work extra for the beer!
[20:38:38] shevy: GOTHIC LETTER EIS
[20:38:58] yorickpeterse: Meanwhile I'm writing Ruby code to generate Ruby code
[20:39:13] ytti: go deeper
[20:39:43] shevy: why do you use '' << 0x0002f ? does this convert it into a string or something?
[20:39:54] Ox0dea: I considered making the maps file dynamically generate the hash and replace itself, but that seemed like a naughty thing to do.
[20:39:59] apeiros: Tarkers34: most classes are mutable. it's the default.
[20:40:04] mister_solo: has joined #ruby
[20:40:07] shevy: yorickpeterse yeah I don't know what I was doing, I actually wanted to just collect ASCII stuff, somehow I ended up with the unicode snowman....
[20:40:23] apeiros: Tarkers34: so no, that list is not "it"
[20:40:25] cubicool: has left #ruby: ()
[20:41:14] Ox0dea: shevy: It's a way to ensure the data ends up being correct, insofar as it doesn't rely on the file having any particular encoding.
[20:41:32] izzol: has joined #ruby
[20:41:46] SCHAAP137: has joined #ruby
[20:41:47] Ox0dea: String << Fixnum will shovel the character corresponding to the latter's codepoint into the former.
[20:41:50] Ox0dea: >> '' << 97
[20:41:51] ruboto: Ox0dea # => "a" (https://eval.in/391278)
[20:42:50] Zai00: has joined #ruby
[20:43:13] jhn: has joined #ruby
[20:43:42] Ox0dea: Tarkers34: BasicObject, Symbol, and the various numeric classes are the only ones whose instances can't be modified in some way without resorting to shenanigans.
[20:44:03] Ox0dea: anything.instance_variable_set(:@foo, 1)
[20:44:27] Maletor: has joined #ruby
[20:45:18] Ox0dea: BasicObject because it just doesn't even expose the methods for doing so, and the others because they're little more than pointers under the hood.
[20:45:37] Musashi007: has joined #ruby
[20:45:54] hololeap: has joined #ruby
[20:46:35] casadei: has joined #ruby
[20:46:52] Ox0dea: shevy: What I like about Rugen is that it takes Ruby from being the anomaly that doesn't support named Unicode literals to (probably) the only language that lets you use them outside of a string literal. :)
[20:47:20] scylla: has left #ruby: ()
[20:47:43] scylla: has joined #ruby
[20:47:46] brettnem: has joined #ruby
[20:47:49] scylla: has left #ruby: ()
[20:47:54] scylla: has joined #ruby
[20:50:57] sphex: Ox0dea: perldoc charnames
[20:51:18] Mon_Ouie: has joined #ruby
[20:51:39] Ox0dea: sphex: Yep. Perl, Python, even LOLCODE.
[20:52:23] langlands: has joined #ruby
[20:52:41] mleung: has joined #ruby
[20:53:34] Hanmac: has joined #ruby
[20:54:23] coderhs: has joined #ruby
[20:55:19] mozzarella: has joined #ruby
[20:56:06] agent_white: has joined #ruby
[20:56:23] sphex: Ox0dea: oh wow.. so lolcode has good unicode support? welp. perl has charnames::vianame and charnames::viacode to look them up at run-time, dunno if that's relevant to your "use outside of string literal" features.
[20:57:08] adaedra: kek kekcode
[20:57:37] sphex: ruby seems a little bit shy about unicode. by default regexes don't use the broad unicode character categories for its \w, \s, etc. String#upcase/#downcase don't care about unicode, etc. :/
[20:57:48] dudedudeman: random, but how many ors can i have in a if statement?
[20:57:49] momomomomo: has joined #ruby
[20:57:49] wasamasa: Ox0dea: that should be trivial to implement in CL
[20:58:00] dudedudeman: as in if x || y || z || r?
[20:58:09] toretore: as many as you like
[20:58:18] ytti: sphex, it would be hella slow
[20:58:30] ytti: grep -i takes ages if locales is WTF8
[20:58:31] ivanskie: has joined #ruby
[20:58:44] ytti: huge difference to say locales C
[20:59:07] adaedra: There are also the differences between languages to take into account
[20:59:11] adaedra: i.e. for sort
[20:59:31] toretore: that doesn't have anything to do with encoding
[20:59:45] sphex: yeah, perl (and python AFAIK) don't handle collations by default
[20:59:59] adaedra: C doesn't either iirc
[21:00:05] adaedra: you have to setup it
[21:00:44] zendrix: has joined #ruby
[21:00:53] alexclick: has joined #ruby
[21:00:57] jenrzzz: has joined #ruby
[21:00:59] sphex: ytti: maybe the performance hit wouldn't be as bad with perl/ruby regexp engines? perl's got a lot of optimization for that.
[21:01:02] Ox0dea: sphex: Well, I think lci is the only interpreter that properly implements that part of the spec, but yes.
[21:01:16] alexclick: has left #ruby: ()
[21:01:22] ytti: sphex, i fear not
[21:01:24] Ox0dea: sphex: Using Rugen, you can say `foo = PILE OF POO`, and it does what you'd expect.
[21:01:34] bradleyp_: has joined #ruby
[21:01:35] Ox0dea: I don't think you can do that in any other language.
[21:01:41] ytti: sphex, if we're anal, perl and ruby regexp isn't even regular, academically speaking
[21:01:57] Ox0dea: wasamasa: CL = Common Lisp?
[21:02:10] ytti: sphex, which means you can construct regexpes which take crazy long to solve
[21:02:20] anjen: has joined #ruby
[21:02:20] tvw: has joined #ruby
[21:03:13] ytti: https://swtch.com/~rsc/regexp/regexp1.html - is really good article
[21:04:41] peter_paule: has joined #ruby
[21:04:53] sphex: ytti: oh yeah.. but they did speed up the wide characters matching, even with really sparse character classes (such as certain unicode categories). regexp-heavy perl programs did not become crazy slow after they make them fully unicode-aware by default.
[21:05:06] Ox0dea: agent_white: It's always morning (UGT) when you enter the channel.
[21:05:24] jevs: has joined #ruby
[21:05:25] adaedra: Do you want your regexp /\w/ to catch a? ??? a???????????????????????????? ?
[21:05:34] agent_white: Ox0dea: I know I know :P
[21:05:59] Ox0dea: adaedra: Sometimes. :P
[21:06:11] sphex: ytti: I think the worst part about these kind of regexp engines is that they don't actually guarantee they will find the longest match. if there's an "alternative" in the regexp and the first branch allows to find a match, it'll sometimes stop there. :/
[21:07:49] sphex: adaedra: well.. perl got me used to that and I think it's pretty neat. I guess it doesn't really matter.. IIRC, there are other ways to match full unicode categories with ruby right?
[21:08:20] dfockler: has joined #ruby
[21:08:24] adaedra: ask Ox0dea, he seems to know better about that. His unicode lib is way bigger than mine.
[21:08:27] blackmes1: has joined #ruby
[21:08:41] ytti: sphex, but we trade the predictability for convenieint of advanced features like neagtive lookahead etc
[21:08:54] ytti: sphex, which are orthagonal to regular expressions, academically speaking
[21:09:05] vondruch: has joined #ruby
[21:09:14] ytti: it might be nice, if language would offer per expression choice for engine
[21:09:32] ytti: so that when you don't need advanced features, you could use thompson NFA
[21:09:47] ytti: or perhaps even dynamically switch
[21:10:21] Indian: has joined #ruby
[21:10:36] adaedra: Also, what is \w
[21:11:01] adaedra: (Regex don't hurt me)
[21:11:04] sphex: adaedra, Ox0dea: ok I just looked it up.. /[[:word:]]/ seems to be it. so, looks simple enough.
[21:11:16] jeanlinux: has joined #ruby
[21:11:17] hoelzro: ytti: interesting fact - perl allows you to use different RE engines for different regexes, should you choose
[21:11:41] izzol: has joined #ruby
[21:11:56] ytti: hoelzro, i didn\t know
[21:12:04] dblessing: has joined #ruby
[21:12:15] hoelzro: a lot of people don't know a lot about Perl =)
[21:12:17] adaedra: "Any word character" ??? that's again depending on the language. ?? is valid in SE, not in FR ??? as long as it's common nouns, of course
[21:12:26] hotpancakes: has joined #ruby
[21:12:32] sphex: ytti: hrm. perl allows to switch between its built-in engine and PCRE at run-time. but they are pretty similar I guess.
[21:13:37] IanV0rn2341: has joined #ruby
[21:14:02] sphex: adaedra: in perl, that is fully specified by unicode and locale-independent, "word characters" include stuff from all languages at all times.
[21:14:05] hoelzro: the Perl RE engine is flexible enough that you can do stuff like this: https://www.youtube.com/watch?v=zcSFIUiMgAs&t=165
[21:14:23] adaedra: sphex: that's a lot of characters to match
[21:14:30] hoelzro: sphex: I thought that was only if you have the /u flag on?
[21:14:30] ta: has joined #ruby
[21:15:26] adaedra: Mh, I took the worst example, we have a word in french with ??, fun
[21:15:51] toretore: wouldn't perl's regexes be pcre in any care?
[21:16:20] sphex: hoelzro: nope, it's by default now. this can be changed with lexical pragmas (in which case /u can become meaningful)
[21:16:43] hoelzro: toretore: PCRE strives to be compatible with Perl, but Perl's RE engine does more than PCRE does now
[21:17:07] hoelzro: sphex: really? you don't need a use $VERSION to activate that by default?
[21:17:17] Aswebb_: has joined #ruby
[21:17:18] ponga: has joined #ruby
[21:17:55] sphex: hoelzro: wait. unless I'm wrong because I mostly only use latin-1 characters. :/
[21:18:39] adaedra: Throw emojis at it
[21:18:52] noethics: i code with emojis
[21:18:54] bigkevmcd: has joined #ruby
[21:19:04] ponga: wow u do?
[21:19:06] bronson: has joined #ruby
[21:19:26] adaedra: >> def ????; puts "????"; end; ????
[21:19:27] ruboto: adaedra # => ???? ...check link for more (https://eval.in/391294)
[21:19:43] hoelzro: sphex: you're right (perl 5.22); I guess you have to use /a to deactivate unicode regexes
[21:19:45] Ox0dea: >> define_method('') { :lol }; send('')
[21:19:46] ruboto: Ox0dea # => :lol (https://eval.in/391295)
[21:19:56] lolmaus: has joined #ruby
[21:20:18] adaedra: I hope ruboto lets me do this one
[21:20:23] noethics: i didnt even know what an emoji was until a couple months ago
[21:20:28] noethics: they were always called emoticons
[21:20:50] adaedra: >> def ??; "Hello"; end; ?? #
[21:20:51] ruboto: adaedra # => "Hello" (https://eval.in/391296)
[21:20:53] Ox0dea: adaedra: Rugen is actually a very tiny "library"; it's just defining #method_missing and #const_missing to resolve character names. 99.9% of the "code" is just the map from characters to their names.
[21:21:15] adaedra: Ox0dea: you still map way more characters :>
[21:21:21] Ox0dea: adaedra: All of 'em! :)
[21:21:34] noethics: has anyone tried implementing isomorphic web app code with ruby/opal yet
[21:21:46] noethics: i cannot find code to steal
[21:21:52] adaedra: >> def ??2; 3; end; 2 +??2
[21:21:53] ruboto: adaedra # => 5 (https://eval.in/391297)
[21:22:02] Ox0dea: adaedra: So sneaky!
[21:22:13] adaedra: go home ruboto, you're drunk
[21:22:13] but3k4: has joined #ruby
[21:22:30] Muhannad: has joined #ruby
[21:22:40] sphex: hoelzro: ok yeah, on 5.20 too. but the actual rules seems a bit complicated. :/ "Which character set modifier is in effect?" in perlre(1)
[21:23:05] choke: has joined #ruby
[21:23:22] Senjai: adaedra: That makes sense
[21:23:39] Senjai: No, not really
[21:23:41] Ox0dea: It doesn't not make unsense.
[21:23:52] Senjai: adaedra: Where do you find this stuff
[21:24:16] Ox0dea: >> "def ??2; 3; end; 2 +??2" == "def 2; 3; end; 2 + 2"
[21:24:17] ruboto: Ox0dea # => false (https://eval.in/391298)
[21:24:32] Ox0dea: >> '2spooky4me'.gsub(/\d/, &:succ)
[21:24:33] ruboto: Ox0dea # => "3spooky5me" (https://eval.in/391299)
[21:25:10] choke: has joined #ruby
[21:25:21] adaedra: I like how Senjai went from 'That makes sense' to 'what'
[21:25:58] Senjai: adaedra: <3
[21:26:14] Senjai: at first I thought it would because of Interger#+, and coerce
[21:26:27] Ox0dea: >> Interger
[21:26:28] ruboto: Ox0dea # => uninitialized constant Interger (NameError) ...check link for more (https://eval.in/391300)
[21:26:36] Senjai: you know what I mean
[21:26:40] adaedra: &ri Interger
[21:26:48] adaedra: wait, it's not here
[21:26:51] Senjai: >> Integer
[21:26:52] ruboto: Senjai # => Integer (https://eval.in/391301)
[21:27:01] Senjai: Ox0dea: You so troll
[21:27:07] Ox0dea: I'm nawt trawlin'!
[21:27:17] Ox0dea: Do you actually pronounce it "interger", though?
[21:27:19] Senjai: I didnt even realize my spelling mistake
[21:27:26] echevil: has joined #ruby
[21:27:28] Senjai: No, just typing too fast
[21:27:33] cochise: has joined #ruby
[21:27:34] Ox0dea: Ah, I've heard it said that way is all.
[21:27:41] adaedra: Senjai: and so, you found how it works?
[21:27:56] Senjai: I did not. I had an assumption, but that one doesn't make sense to me
[21:28:12] dudedudeman: ok Ox0dea, after a lovely lunch, and a few hours of work that acutally isn't code(one day), i'm back attacking this thing. here's my most recent gist that I know doesn't work? https://gist.github.com/anonymous/d26f9441bf064648a59a
[21:28:20] nofxx: has joined #ruby
[21:28:22] dudedudeman: well, anyone for that matter
[21:28:29] dudedudeman: the ors. i want all the or statements in the world
[21:28:44] dudedudeman: but i'm stuck on the proper syntax
[21:28:53] Ox0dea: dudedudeman: Nope, definitely the wrong way to go about it.
[21:29:27] SylarRuby: has joined #ruby
[21:29:32] bradleyprice: has joined #ruby
[21:29:32] ahmetkapikiran: has joined #ruby
[21:29:48] Ox0dea: dudedudeman: Utilizing Array#include? would be an immediate improvement.
[21:30:01] dudedudeman: dang it i knew it
[21:30:07] dudedudeman: i seriously was going that route first
[21:30:23] Ox0dea: dudedudeman: Also, what happens if I say "No"?
[21:30:41] dudedudeman: i mean i'm guessing a regex is appropriate here
[21:30:46] Ox0dea: Nah, that'd be overkill.
[21:30:55] Ox0dea: But think about how you might go about ignoring case entirely.
[21:31:30] Ox0dea: dudedudeman: Was that excitement, or the bang method?
[21:31:35] dudedudeman: well, the ! there was to show my excitement. lol
[21:31:44] Ox0dea: Cursed ambiguity.
[21:31:47] shevy: I get excited when I type
[21:31:50] shevy: def action!
[21:31:54] adaedra: He banged excitement
[21:31:55] dudedudeman: i get hyped when shevy types
[21:32:00] dudedudeman: bang all the things!
[21:32:06] dudedudeman: how's that for ambiguity?
[21:32:06] Ox0dea: dudedudeman: I asked because String#downcase! does not behave like you might expect.
[21:32:06] echevil: has left #ruby: ()
[21:32:08] sphex: ytti: thanks for that regexp link BTW. I never quite understood how they worked. it's interesting to have them explained in relation to real, efficient implementations.
[21:32:13] Ox0dea: >> ['foo'.downcase, 'foo'.downcase!]
[21:32:14] ruboto: Ox0dea # => ["foo", nil] (https://eval.in/391302)
[21:32:35] dfockler: it went so far downcase it became nil
[21:32:47] yfeldblum: has joined #ruby
[21:32:58] dblessing: has joined #ruby
[21:32:59] dudedudeman: i see that. it downcases the 0 position in the arrary, but not anything after
[21:32:59] Ox0dea: dudedudeman: I was demonstrating that String#downcase! returns nil if the string was already all lowercase.
[21:33:01] gambl0re: has joined #ruby
[21:33:08] dudedudeman: oh, that makes even more sense
[21:33:39] Ox0dea: It's a good thing, because it lets you use the result in a conditional, but it's definitely surprising at first.
[21:33:44] dudedudeman: would it just be downcase then?
[21:33:57] dudedudeman: which is what i was thinking before i got excited and put ! everywhere
[21:34:23] dudedudeman: which is what you used as well
[21:34:30] Exuma: has joined #ruby
[21:35:12] Ox0dea: #upcase is best case, because then you can capitalize what you'll be comparing with, and that'll make the values stand out more.
[21:35:18] Ox0dea: Either way, though.
[21:36:03] dudedudeman: so in the array that i'm matching against it would be best to have those upcased as well
[21:36:29] Ox0dea: I am of that opinion, but it's certainly not a universal one.
[21:37:47] izzol: has joined #ruby
[21:38:04] Polysics: has joined #ruby
[21:38:32] Ox0dea: dudedudeman: As for your current code, you've misunderstood how Ruby interprets ||.
[21:38:53] Ox0dea: "x == 1 || 2 || 3" reads as "x equals 1 or 2 or 3" to a human being, but the computer doesn't see it that way.
[21:38:56] dudedudeman: ACTION raises hand and admits his folly
[21:39:30] Ox0dea: Each "branch" of the conditional needs to be an expression whose "truthiness" you're interested in.
[21:39:31] baweaver: has joined #ruby
[21:39:35] dudedudeman: you have to separate them out, right? x == 3 || 4, x == 4 || 5, etc?
[21:39:50] Ox0dea: x == 3 || x == 4 || x == 5
[21:40:11] Ox0dea: Each "branch" of the conditional needs to be an expression whose "truthiness" should be taken into account.
[21:40:28] Ox0dea: Everything except nil and false are "true" in Ruby.
[21:41:01] dudedudeman: oh! ok that makes sense
[21:41:20] Ox0dea: dudedudeman: Do you see how to rewrite that unpleasantness above using Array#include??
[21:41:26] blackmesa: has joined #ruby
[21:41:38] hotpancakes: has joined #ruby
[21:41:38] dudedudeman: it's just being explicit about what you're asking ruby to do. x = this or that, x = pie or cake, not... x = this or that or pie or cake
[21:41:41] Scripore: has joined #ruby
[21:41:52] dudedudeman: break handle_quit if input.include?['Q', 'QUIT', 'EXIT']
[21:41:57] Ox0dea: Nailed it!
[21:41:59] dudedudeman: that's the route i was taking?
[21:42:11] hackeron: has joined #ruby
[21:42:14] Ox0dea: >> %w[Q QUIT EXIT]
[21:42:15] ruboto: Ox0dea # => ["Q", "QUIT", "EXIT"] (https://eval.in/391305)
[21:42:24] dudedudeman: ACTION hands Ox0dea a slice of pie
[21:42:25] Ox0dea: Perhaps you don't like it, but that's an alternate way to express an array of "words".
[21:42:38] dudedudeman: is that what the w means there?
[21:42:57] dudedudeman: i've definitely read about and used that in random code before, but not realizing it was meant for words and such
[21:43:13] dudedudeman: or, just words. no such
[21:43:26] Ox0dea: I quoted it because, in this case, Ruby considers a "word" to be any sequence of consecutive non-space characters.
[21:43:57] s2013: has joined #ruby
[21:44:10] radialneon: has joined #ruby
[21:45:48] workmad3: has joined #ruby
[21:46:06] dudedudeman: i get a wrong number of arguments error now
[21:46:28] dudedudeman: but i'm thinking that's because gets.chomp.upcase isn't an array but rather a string?
[21:46:38] Ox0dea: No, it's a string.
[21:46:52] Ox0dea: Erm... I think you've done your order backwards?
[21:47:08] dudedudeman: break handle_yes if input.include?%w[YES Y]
[21:47:25] jlast: has joined #ruby
[21:47:44] Ox0dea: Asking a string if it includes an array sounds a little crazy, no?
[21:48:15] arooni-mobile: has joined #ruby
[21:48:22] Ox0dea: No worries.
[21:48:24] choke: has joined #ruby
[21:49:28] darix: good thing ruby gives us loops
[21:49:38] Scroff: has joined #ruby
[21:52:17] dudedudeman: yeah i'm stumped here
[21:52:29] dudedudeman: my mind wants to keep going back to an or statement here
[21:52:32] dudedudeman: but i don't think that's right
[21:52:36] Ox0dea: Definitely not.
[21:52:53] Ox0dea: >> [2, 4, 6].include?(2)
[21:52:54] ruboto: Ox0dea # => true (https://eval.in/391306)
[21:53:45] snockerton: so when i'm doing an array.map do |x|, it seems that my local methods are undefined?
[21:54:02] snockerton: pry doesn't seem to allow my map subroutine to inherit other methods i've define?
[21:54:26] Ox0dea: >> def plus_1 n; n + 1; end; [1,2,3].map { |x| plus_1 x }
[21:54:27] ruboto: Ox0dea # => [2, 3, 4] (https://eval.in/391307)
[21:54:31] ljarvis: snockerton could you provide an example?
[21:54:49] cajone: has joined #ruby
[21:55:06] cajone: has left #ruby: ()
[21:55:12] nofxx: dudedudeman, you can check if string contains another, from why's : quit unless 'restaurant'.include? 'aura'
[21:55:56] Ox0dea: nofxx: But that is not what his code calls for.
[21:57:03] nofxx: Ox0dea, couldn't miss an oportunity to mention why
[21:57:03] snockerton: https://gist.github.com/adampats/cd142b6d19bce01be8ea
[21:57:28] gwendall: has joined #ruby
[21:57:31] Ox0dea: ?fake snockerton
[21:57:31] ruboto: snockerton, Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
[21:57:59] nofxx: Ox0dea, where are you from?
[21:58:03] Ox0dea: Over there.
[21:58:17] ljarvis: Ox0dea was born inside the matrix
[21:58:38] dudedudeman: Ox0dea is the matrix
[21:58:49] Ox0dea: ??? We all live in a yellow submarine. ???
[21:59:01] dudedudeman: i do love that song
[21:59:10] wasamasa: Ox0dea: sure
[21:59:18] Skizu: has joined #ruby
[21:59:24] Ox0dea: wasamasa: Is that what you meant by CL, though?
[21:59:32] wasamasa: Ox0dea: yes
[21:59:41] nofxx: ljarvis, dudedudeman I'm beginning to think so. He never sleeps, or we share the same sleep hours =P
[21:59:43] Skizu: I'm having a bit of issue setting up some relationships, could someone help me define them if I explain them?
[21:59:51] Ox0dea: Yes, metaprogramming is always going to be easiest in homoiconic languages.
[21:59:53] radialneon: has joined #ruby
[21:59:54] wasamasa: Ox0dea: no, I don't write any
[22:00:15] snockerton: ljarvis: Ox0dea: https://gist.github.com/adampats/cd142b6d19bce01be8ea
[22:00:16] ljarvis: ?ask Skizu
[22:00:16] ruboto: Skizu, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[22:00:21] baweaver: >> def plus(n) -> i { n + i } end; (1..5).map(&plus(5))
[22:00:22] ruboto: baweaver # => [6, 7, 8, 9, 10] (https://eval.in/391308)
[22:00:24] nofxx: Skizu, invite her for a sushi, eat the fish
[22:00:36] choke: has joined #ruby
[22:00:36] ljarvis: snockerton: https://gist.github.com/adampats/cd142b6d19bce01be8ea#file-pry-rb-L2 what is "value" on this line?
[22:00:39] wasamasa: Ox0dea: it's got reader macros, that's why
[22:00:51] Skizu: nofxx: There's sushi?
[22:01:03] Ox0dea: snockerton: Your reference to `value` on Line 2 is the problem.
[22:01:11] tkuchiki: has joined #ruby
[22:01:12] wasamasa: Ox0dea: scheme doesn't really, elisp not at all and clojure has some sort of compromise
[22:01:26] snockerton: ljarvis: an unrelated syntax error
[22:01:27] brain_shim: has joined #ruby
[22:01:37] nofxx: Skizu, I'm kidding, you said 'having a bit of issue setting up some relationships'
[22:01:37] ljarvis: snockerton: no, it's the exact problem
[22:01:51] Skizu: Basically, I've a user, it has many accounts, I have transactions it has a user a source and a destination, source and destination are accounts, what kind of relationships do I need for this?
[22:02:00] ljarvis: Skizu: rails?
[22:02:16] unclouded: has joined #ruby
[22:02:19] Skizu: ljarvis: Indeed
[22:02:25] ljarvis: ?rails Skizu
[22:02:25] ruboto: Skizu, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[22:02:40] nofxx: Skizu, which DB?
[22:03:05] alphaatom: has joined #ruby
[22:03:08] Skizu: Using the active record associations
[22:03:20] Ox0dea: wasamasa: Racket is also very good in that regard.
[22:03:21] skyrocker1: has joined #ruby
[22:03:44] s2013: has joined #ruby
[22:03:48] Ox0dea: Racket is pretty much a "language factory", and it's pretty awesome.
[22:03:51] RobertBirnie: has joined #ruby
[22:04:16] Ox0dea: dudedudeman: Still at an impasse? :/
[22:04:18] nofxx: Skizu, maybe your question is better on the DB you choose channel. If it's a schematic answer you're after.
[22:04:24] dudedudeman: Ox0dea: yes :(
[22:04:32] dudedudeman: though not without trying things
[22:04:36] ljarvis: so... #rubyonrails
[22:04:40] ljarvis: which was already suggested
[22:04:44] Skizu: nofxx: It's an issue of rails, not the specific DB
[22:04:55] _blizzy_: has joined #ruby
[22:05:02] Skizu: ljarvis: Already in there, was just answering when asked :)
[22:05:13] ljarvis: Skizu: yep that wasn't directed at you
[22:05:23] nofxx: Skizu, I see, the schema is ready.
[22:05:34] Ox0dea: dudedudeman: Would you mind having a go at describing what Array#include? does?
[22:05:47] dudedudeman: not at all! let's do it
[22:05:57] Ox0dea: ACTION twiddles thumbs excitedly.
[22:06:11] dudedudeman: oh! i describe it
[22:06:38] radialneon: has joined #ruby
[22:06:41] thiagovsk: has joined #ruby
[22:06:41] dudedudeman: well, this is a public method, yes?
[22:06:52] adaedra: Good night everyone
[22:06:55] Ox0dea: It's an instance method on Array, but never mind all that.
[22:06:55] ljarvis: you tell us, dudedudeman
[22:06:58] Ox0dea: adaedra: Au revoir.
[22:07:03] radialneon: has joined #ruby
[22:07:05] ljarvis: nn adaedra
[22:07:08] adaedra: Have fun Ox0dea
[22:07:39] ljarvis: I'm off too, later
[22:07:52] dudedudeman: i mean, it basically seems that if it returns true if the object(?) you're looking for is within itself?
[22:08:00] Ox0dea: Yes, that's correct.
[22:08:01] jack_rabbit: has joined #ruby
[22:08:11] dudedudeman: and false otherwise of course
[22:08:31] Polysics: has joined #ruby
[22:08:36] Skizu: #RubyOnRails is a lot quieter
[22:08:42] wasamasa: Ox0dea: oh right
[22:08:58] wasamasa: Ox0dea: but I'm less interested in that part of programming
[22:09:20] Ox0dea: You introduced the topic, for what that's worth. :P
[22:09:25] shevy: Skizu because we have cookies here!
[22:09:31] GitGud: has left #ruby: ()
[22:09:43] Ox0dea: dudedudeman: In your case, what should be the array, and what the object?
[22:10:02] GitGud: has joined #ruby
[22:10:56] dudedudeman: the way it's set up now, i'm looking at it that input is the arrary, and i'm looking to see if it includes anything from another array
[22:10:56] wasamasa: Ox0dea: nah, just because I can metaprogram doesn't mean I need to actually use these tools to write other languages with them
[22:11:15] Ox0dea: dudedudeman: How did you end up with two arrays?
[22:11:36] Ox0dea: Your input comes in as a string, and there's no reason to transform it into anything else.
[22:11:59] radialneon: has joined #ruby
[22:12:07] _blizzy_: has joined #ruby
[22:12:10] dudedudeman: wait a minute
[22:12:26] radialneon: has joined #ruby
[22:13:10] blackmesa: has joined #ruby
[22:13:42] dudedudeman: because .include? looks through an array for an object, and currently, my input is a string?
[22:14:00] wildroman2: has joined #ruby
[22:14:12] bougyman: a string is an object.
[22:14:45] choke: has joined #ruby
[22:15:28] dudedudeman: (stepping away from my desk for 2 seconds)
[22:17:20] centrx: has joined #ruby
[22:18:05] zendrix: has joined #ruby
[22:18:45] hotpancakes: has joined #ruby
[22:19:28] hahuang65: has joined #ruby
[22:19:42] gambl0re: has joined #ruby
[22:21:34] phutchins1: has joined #ruby
[22:22:13] Ox0dea: dudedudeman: What are some of the things that [1,2,3,4,5] includes?
[22:22:20] Ox0dea: Name two.
[22:22:29] drewo: has joined #ruby
[22:22:32] dudedudeman: objects and integers
[22:22:59] Ox0dea: Specifically, name two of the things in that array.
[22:23:13] Ox0dea: Now, what are some of the things that 4 includes?
[22:23:13] izzol: has joined #ruby
[22:23:13] Skizu: has left #ruby: ()
[22:23:23] Ox0dea: The question doesn't really make sense, does it?
[22:23:35] dudedudeman: (you're really good at this btw)
[22:24:21] Ox0dea: Aiming the question at strings is a little more troublesome, because strings do "contain" characters, but the principle remains.
[22:24:35] Ox0dea: You don't ask an object whether it is included in an array, you ask the array whether it includes the object.
[22:24:46] dudedudeman: input = 'this be my input"; yes = ['yes', y'
[22:24:59] Ox0dea: But yes, I think you've got the idea.
[22:25:43] dudedudeman: input = 'this be my input"; yes = ['yes', y']; yes.any? { |y| input[y] }
[22:25:45] choke: has joined #ruby
[22:25:50] Ox0dea: Why not just use #include??
[22:26:20] dudedudeman: i guess i wrote that just based on being able to fully process in my mind what i'm learning here
[22:27:01] Ox0dea: #any? is for when you need more advanced behavior; in this case, you need only perform the very simple operation of asking an array if it contains a certain element.
[22:27:44] dudedudeman: break handle_yes if %w[YES Y].include?(input)
[22:28:02] dudedudeman: now i get exactly what you were saying when you said it was backwards
[22:28:06] dgutierrez1287: has joined #ruby
[22:28:18] dudedudeman: i was over here putting the break handle_ after all that lol
[22:28:23] dudedudeman: ok, lemme go do that to all the lines
[22:28:32] dudedudeman: ACTION is in awe and wonder
[22:28:33] mrmargolis: has joined #ruby
[22:28:37] Ox0dea: dudedudeman: Journey > destination.
[22:28:44] Azure: has joined #ruby
[22:28:54] dudedudeman: mmmmm. gimme that sweet, sweet journey
[22:29:12] al2o3-cr: hmmm... someones got a good memory and it isn't me :P
[22:29:29] Ox0dea: ACTION rocks out to "Don't Stop Believin'"
[22:29:52] dudedudeman: piddly piddly piddly wheeeee
[22:29:58] dudedudeman: that's my best impression of a guitar solo on the internet
[22:30:16] rickmasta: has joined #ruby
[22:30:45] sarkyniin: has joined #ruby
[22:31:01] shevy: impressive
[22:31:23] dudedudeman: shevy shevy! i learned things!
[22:31:28] dudedudeman: i'm abiding so hard right now
[22:31:42] dudedudeman: ok Ox0dea, it does indeed all work now!
[22:32:06] Mon_Ouie: has joined #ruby
[22:32:12] shevy: excellent!
[22:32:21] shevy: one day you'll pick up a GUI too, and then you can help me out
[22:32:50] dudedudeman: speaking of gui, one of my favorite tracks right now is by a dude named gui boratto
[22:33:48] Ox0dea: shevy: You're supposed to be using JavaScript for GUIs. /s-ish
[22:33:51] fgo: has joined #ruby
[22:34:01] dudedudeman: i mean, at least opal?
[22:34:11] shevy: I could use php as well but who needs these inferior languages when you have ruby
[22:35:25] dudedudeman: it's so pretty: https://gist.github.com/anonymous/b5546d6c08bfd1dd20f8
[22:35:36] dudedudeman: not really. now i want to do something else fancy to it
[22:35:36] Ox0dea: shevy: None of the GUI toolkits for Ruby even begin to approach idiomaticity.
[22:36:07] shevy: Ox0dea do you use any GUIs in ruby?
[22:36:18] nateberkopec: has joined #ruby
[22:36:30] Ox0dea: I've used gtk2 a few times; it wasn't fun.
[22:36:38] shevy: dudedudeman that looks weird
[22:37:06] shevy: why are these upcased?
[22:37:16] Ox0dea: shevy: To ignore case, silly.
[22:37:24] pgatt: has joined #ruby
[22:37:58] shevy: and they are not downcased?
[22:38:04] Ox0dea: What's the difference?
[22:38:10] centrx: there should be an upyourscase
[22:38:32] B1n4r10: has joined #ruby
[22:38:41] nym: has joined #ruby
[22:38:46] phrozen77: has joined #ruby
[22:39:00] dudedudeman: i do see why you were mentioning that Ox0dea, as i'm staring at the code and my array pops out at me and makes it a wee bit more readable
[22:39:21] Ox0dea: Aye, I think it's a very sensible decision, aesthetically if nothing else.
[22:39:21] shevy: oh that is true, upcased letters are bigger and thus easier to read
[22:39:29] dudedudeman: centrx would that be like a upYOURScase? upcase the middle part of whatever word or phrase you input?
[22:39:34] shevy: i keep my directories UPCASED/
[22:39:51] Ox0dea: That's pretty goofy.
[22:39:54] bonhoeffer: has joined #ruby
[22:40:01] dudedudeman: see, i can't do that with my directories because I have to press shift and the letter(s) before i can start tabbing through them lol
[22:40:03] shevy: UPCASE ALL THE THINGS
[22:40:12] blackmesa: has joined #ruby
[22:40:29] shevy: >> "Ox0dea".upcase
[22:40:30] ruboto: shevy # => "OX0DEA" (https://eval.in/391311)
[22:40:38] shevy: now he appears bigger
[22:40:48] bartj3: has joined #ruby
[22:40:51] MuffinPimp: has joined #ruby
[22:40:53] Ox0dea: But now I'm a three-letter agency. :(
[22:41:08] dudedudeman: what would you guys tell a noob to do next with this? i've got time to kill before i leave work
[22:41:27] dudedudeman: (not asking for the same level of hand holding as previously provided mind you lol)
[22:41:30] cek: has left #ruby: ()
[22:41:46] shevy: true... Drug Enhancements Agency
[22:41:49] Ox0dea: dudedudeman: It feels kinda repetitive, doesn't it?
[22:41:55] dudedudeman: it is not dry, no
[22:42:04] shevy: dudedudeman make it a class!
[22:42:34] Zarthus: has joined #ruby
[22:43:06] jack_rabbit: has joined #ruby
[22:43:20] Centrixx: has joined #ruby
[22:43:21] dudedudeman: would the while loop live inside or outside the class. honest question. i would argue outside
[22:43:30] Riking: has joined #ruby
[22:43:41] shevy: everything into the class!
[22:43:46] ccooke: has joined #ruby
[22:43:54] dudedudeman: imma put you in a class here in a minute
[22:43:55] heftig: has joined #ruby
[22:43:58] sevvie: has joined #ruby
[22:44:03] soahccc: has joined #ruby
[22:44:04] Miron: has joined #ruby
[22:44:17] kalleth: has joined #ruby
[22:44:29] Obfuscate: has joined #ruby
[22:44:31] centrx: the while loop lives IN the computer
[22:44:31] x3cion: has joined #ruby
[22:45:04] tkuchiki: has joined #ruby
[22:45:09] drPoggs: has joined #ruby
[22:45:16] alxndr: has joined #ruby
[22:45:21] atomi: has joined #ruby
[22:45:24] nym: has joined #ruby
[22:45:25] havenwood: has joined #ruby
[22:45:25] phrozen77: has joined #ruby
[22:45:25] chrisseaton: has joined #ruby
[22:45:38] it_tard: has joined #ruby
[22:45:43] camilasan: has joined #ruby
[22:46:04] cbednarski: has joined #ruby
[22:46:16] bf4: has joined #ruby
[22:47:25] scylla: has left #ruby: ()
[22:47:55] solocsha1: has joined #ruby
[22:48:07] bauruine: has joined #ruby
[22:48:45] phat4life: has joined #ruby
[22:49:23] Polysics: has joined #ruby
[22:49:51] msgodf: has joined #ruby
[22:51:16] zotherstupidguy: has joined #ruby
[22:55:12] mister_solo: has joined #ruby
[22:56:01] Ox0dea: dudedudeman: https://gist.github.com/0x0dea/781130fc0bcddc16e177
[22:56:19] dudedudeman: man there you go blowing my mind again
[22:56:22] nodeworm: has joined #ruby
[22:56:29] dudedudeman: there's something i didn't know about
[22:56:49] Ox0dea: dudedudeman: The much more "mind-blowing" part is #send, which is used to dynamically invoke methods.
[22:56:56] iamninja: has joined #ruby
[22:56:58] dudedudeman: it's like you set up a little database for it
[22:57:42] Ox0dea: I hesitated to show you this approach since #send is not very beginner-friendly, but I think you'll be able to grok the overall picture.
[22:57:45] tkuchiki: has joined #ruby
[22:57:50] dudedudeman: no definitely
[22:58:09] blackmesa: has joined #ruby
[22:58:40] dudedudeman: matchers is just a key value hash and you're iterating through that with input to invoke that method using send
[22:59:11] Ox0dea: Yep, that's about the size of it. Well done! :)
[22:59:14] jfarmer: has joined #ruby
[23:00:14] Ox0dea: There are a few very minor details to do with how Hashes behave when enumerated over, but yeah, that was a pretty concise and accurate explanation of what's going on.
[23:01:04] Ox0dea: >> {a: 1, b: 2}.to_a
[23:01:05] ruboto: Ox0dea # => [[:a, 1], [:b, 2]] (https://eval.in/391313)
[23:01:17] dudedudeman: that's trippy
[23:01:38] mister_solo: has joined #ruby
[23:01:44] Alina-malina: has joined #ruby
[23:01:44] Ox0dea: Well, a hash really is just a bunch of key-value pairs, right?
[23:01:55] joshbamboo1: has joined #ruby
[23:02:09] dudedudeman: right, which would you could look at as like, mini arrays?
[23:02:18] Ox0dea: Nah, totally different.
[23:02:44] Ox0dea: It's just the reverse, actually; arrays are "dumbed down" hashes whose keys can only be integer indices.
[23:03:05] Ox0dea: That's not actually how they're implemented in Ruby, of course, but it works as a conceptual framework.
[23:04:19] dudedudeman: >> x = %w[this is an array]; x[2]
[23:04:20] ruboto: dudedudeman # => "an" (https://eval.in/391314)
[23:04:31] CaptainCibai: has joined #ruby
[23:04:37] dudedudeman: ok that makes sense
[23:05:01] Ox0dea: It's a lot easier to see that {name: 'Alice', age: 20} represents a person than ['Alice', 20].
[23:05:35] dudedudeman: class Person; Person.new(name: 'Alice', age: 20)
[23:05:46] Ox0dea: They contain the same data, more or less, but a hash (elsewhere called a "map", not coincidentally) provides a sort of legend for finding what you're looking for.
[23:06:13] jfarmer: dudedudeman If you meant that you could look at a key/value pair as a mini array then I think that's more than fair, it's actually one na??ve way to implement hashes.
[23:06:39] jfarmer: e.g., [('name', 'Alice'), ('age', 20)] (ignoring syntax)
[23:07:12] jfarmer: (look at a _single_ key/value pair, that is)
[23:07:50] jfarmer: dudedudeman An ordered list of elements of a fixed, pre-determined size is called a tuple (https://en.wikipedia.org/wiki/Tuple)
[23:08:26] dudedudeman: tuples. i guess it's time i start given those a once over and doing some reading. i've been avoiding them for months
[23:08:35] jfarmer: Ruby doesn't have first-order support for tuples, so you often see Ruby using 2-element Arrays where a tuple would (conceptually) be more correct.
[23:08:37] Ox0dea: jfarmer: Ah, sorry about that; I misinterpreted "mini array" to mean something similar to but somehow "less than" an actual array, whereas you just meant a tiny one. :)
[23:08:53] dudedudeman: yes! truly a tiny array
[23:08:56] Ox0dea: Yes, key-value pairs are little two-element arrays that, when grouped, represent a hash.
[23:09:09] jfarmer: Some languages (like Python) do have first-order support for tuples and treat them as something distinct from arrays/lists.
[23:09:18] Ox0dea: ACTION hisses.
[23:09:26] gamename: has joined #ruby
[23:09:30] jfarmer: Whoa, is there a snake in here?
[23:09:50] Sou|cutter: you could probably make a tuple factory like Struct...
[23:10:03] Deele: has joined #ruby
[23:10:05] jfarmer: Definitely
[23:10:21] jfarmer: In fact, a struct is to a hash as a tuple is to an array
[23:10:29] jfarmer: (for dudedudeman)
[23:10:37] dudedudeman: i'm following along here. this is great
[23:10:57] zenspider: class Tuple < Array; def initialize(*stuff); super(); self.push(*stuff); self.deepfreeze; end; end
[23:11:01] Ox0dea: dudedudeman: What's that pesky underscore doing on Line 29?
[23:12:22] revdan: has joined #ruby
[23:12:25] Musashi007: has joined #ruby
[23:12:34] dudedudeman: well, you passed it in as a string, so you're interpolating within to pass the appropriate matchers value in to it, there for building the last part of the method you need to invoke it?
[23:12:46] brain_shim: has joined #ruby
[23:13:05] Ox0dea: Ah, sorry, I think I've probably jumped ahead.
[23:13:18] dudedudeman: oh, wait. i was looking at line 30
[23:13:21] cajone: has joined #ruby
[23:13:23] dudedudeman: dang. i was like, i understand that! lol
[23:14:07] Ox0dea: For the record, your explanation of Line 30 was spot-on! :)
[23:15:07] dudedudeman: what we're doing here is one of my favorite types of learning. pushing myself ot figure out a new concept, but recognizing ones that i do know as we go along. helps reinforce the new and the old
[23:15:39] cajone: has left #ruby: ()
[23:17:10] dudedudeman: i'll be honest. i am not under full understanding of what the _ on line 29 does
[23:17:16] dudedudeman: but, i am not thinking that it is pesky
[23:17:55] Muhannad: has joined #ruby
[23:18:17] dudedudeman: does it have to do with account for the _ in handle and matchers?
[23:18:27] Ox0dea: Nah, that's just to match the underscores in the method names.
[23:18:44] apeiros: zenspider: .concat(stuff) - faster than .push(*stuff) :)
[23:18:55] apeiros: or in this case, actually just .replace
[23:20:16] dudedudeman: Ox0dea: man this has been great
[23:20:37] Ox0dea: dudedudeman: I've quite enjoyed watching things click for you. :)
[23:20:38] dudedudeman: i've got to leave work now, but i'm glad you ended up showing me that last example as it leaves me somethign to walk away with and learn later tonight when i get some time to study
[23:21:14] dudedudeman: Ox0dea: Thanks!!! it's been really encouraging. for many reasons(i don't have a job in code, looking for one, and often feel like i might never get there, etc etc)
[23:21:28] dudedudeman: so it's nice to know some things have stuck along the way. this will be one of those as well!
[23:22:09] Ox0dea: All in good time (and practice), my friend.
[23:22:22] dudedudeman: yarp. cheers for now!
[23:23:04] Ox0dea: YARP = Yet Another Ruby Preprocessor, anyone?
[23:23:34] Ox0dea: We could use end+, and wouldn't that be just grand?
[23:25:22] workmad3: has joined #ruby
[23:29:47] hololeap: has joined #ruby
[23:30:30] ecksit: has joined #ruby
[23:31:25] [H]unt3r: has joined #ruby
[23:31:25] markbao: has joined #ruby
[23:33:41] markbao: has joined #ruby
[23:34:45] fgo: has joined #ruby
[23:35:03] mark8773955: has joined #ruby
[23:36:15] bricker: has joined #ruby
[23:36:44] Scroff: has joined #ruby
[23:40:27] gamename: has joined #ruby
[23:40:34] Senjai: Dear ruby
[23:40:41] Senjai: How can I exclude a foldet from a /*/** glob
[23:40:51] Deele: has joined #ruby
[23:40:56] Senjai: e.g. I want spec/javascripts/*/**, but not the spec/javascripts/legacy folder
[23:41:02] CloCkWeRX: has joined #ruby
[23:41:34] bradleyp_: has joined #ruby
[23:42:23] zacts: has joined #ruby
[23:43:09] Senjai: zenspider: Is that the only solution
[23:43:22] havenwood: Senjai: You could look at the Find module: http://ruby-doc.org/stdlib/libdoc/find/rdoc/Find.html
[23:43:41] zenspider: personally, I can't stand the find module and go out of my way to contort globs to avoid it
[23:43:43] Senjai: yeah, but I meant in the glob
[23:43:49] rickmasta: has joined #ruby
[23:43:55] zenspider: clearly written in the 90s
[23:44:33] bonhoeffer: has joined #ruby
[23:45:00] zendrix: has joined #ruby
[23:46:35] serivich: has joined #ruby
[23:47:41] ledestin: has joined #ruby
[23:48:10] AndyBotwin: has joined #ruby
[23:48:20] havenwood: Senjai: You could also glob together multiple globs. Or Rake.
[23:48:42] brain_shim: has joined #ruby
[23:49:05] charliesome: has joined #ruby
[23:49:08] m3_del: has joined #ruby
[23:49:16] Senjai: havenwood: Unfortunately i have to pass in the string that is used as a matcher
[23:49:21] Senjai: Can't pass in raw files
[23:49:23] Senjai: filenames
[23:49:35] havenwood: Senjai: http://ruby-doc.org/stdlib/libdoc/rake/rdoc/Rake/FileList.html
[23:50:10] havenwood: Senjai: Can't just glob it all and toss out the baddies?
[23:50:29] Senjai: Has to be a string that is passed in to whatever the lib uses to glob
[23:50:46] Senjai: Considering opening an issue about the fact I cannot manually pass in files
[23:50:55] Senjai: This is Teaspoon btw
[23:52:32] havenwood: I'd like to be in a code reading group where you pick a gem or part of a gem to read then meet and discuss.
[23:52:56] Senjai: The meet part is hrd
[23:53:07] havenwood: Senjai: Aye, that's the catch.
[23:53:09] blue_deref: has joined #ruby
[23:53:14] Senjai: Google hangouts is not terrible
[23:53:40] zacts: Senjai: does google hangouts require you to own a google account?
[23:53:46] zacts: or can you join as a guest?
[23:55:17] havenwood: zacts: Dunno
[23:55:24] Ox0dea: Senjai: 2_224_981 assertions.
[23:55:38] zacts: I assert that that is too many assertions
[23:55:45] Senjai: StatYou cannot
[23:55:50] Senjai: who doesn't have a google account ;)
[23:56:02] Senjai: Ox0dea: dayum
[23:56:03] havenwood: Ox0dea: But are the tests tested? Test all the waaaaaaay down.
[23:58:00] Aswebb_: has joined #ruby
[23:58:11] Ox0dea: havenwood: minitest has 868 assertions. I reckon that counts for something.
[23:58:20] ponga: has joined #ruby
[23:58:36] havenwood: Ox0dea: Hooah!
[23:59:01] Ox0dea: This feckin' globbing problem of Senjai's!
[23:59:13] Ox0dea: It seems Dir uses some slight modification of the shell syntax.
[23:59:20] Senjai: Ox0dea: Right.
[23:59:30] Senjai: ACTION always bringin dem challenging questions
[23:59:49] Ox0dea: Regardless, it's gonna be ugly as hell.