« Back to channel list

#ruby - 09 August 2015

« Back 1 day Forward 1 day »
[00:01:35] Kallis: has joined #ruby
[00:02:02] decoponio: has joined #ruby
[00:02:11] sdwrage: has joined #ruby
[00:04:19] lwu: has joined #ruby
[00:07:00] pepperbreath: has joined #ruby
[00:08:34] paulcsmith: has joined #ruby
[00:10:43] choke: has joined #ruby
[00:10:51] Kallis: has joined #ruby
[00:10:55] mistermocha: has joined #ruby
[00:11:46] deject3d: has joined #ruby
[00:14:22] nofxx: What's the nice way to add a dev lib folder to load path? bin/foo will require 'foo' from the gems, force it in dev mode to require '../lib/foo'
[00:14:46] nofxx: $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) solves but its ugly change the bin =/
[00:15:24] nngrey: has joined #ruby
[00:15:29] choke: has joined #ruby
[00:17:49] mary5030: has joined #ruby
[00:18:14] arooni-mobile: has joined #ruby
[00:18:33] arooni-mobile__: has joined #ruby
[00:18:53] choke: has joined #ruby
[00:19:33] shevy: I usually define the path to the gem-directory
[00:20:00] shevy: PROJECT_BASE_DIRECTORY = RbConfig::CONFIG['sitelibdir']+'/name_of_gem/'
[00:20:08] shevy: there is a similar, slightly different solution
[00:20:22] shevy: I think it was either using __FILE__ ... or Pathname
[00:21:05] bronson: has joined #ruby
[00:21:21] lannonbr: has joined #ruby
[00:21:46] nofxx: shevy, where that goes ? PROJECT_BASE_DIRECTORY
[00:22:01] shevy: I put it into the main namespace of the gem
[00:22:07] malnek: has joined #ruby
[00:22:25] shevy: like if the gem-name is foobar, I usually have: module Foobar; and inside there, that constant
[00:23:02] workmad3: has joined #ruby
[00:23:07] shevy: you have an executable?
[00:23:25] nofxx: shevy, yup
[00:23:34] shevy: it may be more convenient if you do: require 'foobar' in that executable, and then toggle behaviour as you want to in that file
[00:24:19] nofxx: I add that load_path line to all my projects, just works?, but this is another author, was wondering if there was a non intrusive way
[00:24:51] shevy: no idea, I never needed to manipulate load path so far for gems, neither my own or other people's gem
[00:25:01] shevy: and you are right, that long line is very ugly :)
[00:25:10] Ox0dea: nofxx: Are you not using Bundler?
[00:25:33] tennis_: has joined #ruby
[00:25:58] nofxx: Ox0dea, I not sure it'll work in this hacked scenario of mine: did a dirty change and just want to test it
[00:26:45] nofxx: It loads the git repo from where you are on terminal, so the scneario is: ~/git/gem/bin/foo . (on another folder)
[00:26:55] Ox0dea: Lovely. :P
[00:27:02] sarmiena_: has joined #ruby
[00:27:31] nofxx: hehe =D but I'll spec it to commit , rest sure Ox0dea
[00:27:54] Ox0dea: nofxx: You intend to release this gem that looks for a specific Git repository on the user's system?
[00:28:31] nofxx: Ox0dea, actually it's released. I'm fixing and adding features =D https://github.com/gittalk/git-issues
[00:28:48] mdavid613: has joined #ruby
[00:32:12] sarmiena_: Hi. I???m getting this error when trying to install ruby: $ rvm install --autolibs=openssl 2.2
[00:32:12] sarmiena_: Searching for binary rubies, this might take some time.
[00:32:13] sarmiena_: No binary rubies available for: ubuntu/12.04/i386/ruby-2.2.2.
[00:32:31] sarmiena_: but if i do it without ???autolibs it works. what gives?
[00:33:29] havenwood: sarmiena_: There would still be no binary available. Is there some other error?
[00:33:47] nofxx: sarmiena_, use the repo.. bright.. someone will help or google
[00:34:01] nofxx: there's NO need for RVM for developing/using ruby
[00:34:24] nofxx: sarmiena_, plus no compiling, just download from apt and run. The way it should be.
[00:34:31] sarmiena_: nofxx sorry i don???t follow what you???re saying
[00:34:46] havenwood: sarmiena_: Is this for development or production?
[00:34:51] nofxx: sarmiena_, https://www.brightbox.com/docs/ruby/ubuntu/
[00:34:53] havenwood: sarmiena_: Do you need to be able to switch Rubies?
[00:35:04] sarmiena_: havenwood: yeah i do need to switch rubies
[00:35:15] havenwood: sarmiena_: Production or development?
[00:35:16] nofxx: sarmiena_, between versions?
[00:35:42] Ox0dea: ya all dat plz halp
[00:36:07] nofxx: sarmiena_, out of curiosity, why?
[00:36:16] nofxx: really old rails projects? =D
[00:36:28] doritostains: has joined #ruby
[00:36:45] sarmiena_: havenwood: so you???re saying this that it shoudn???t matter that ???autolibs is used vs not used. it would either say binary isn???t there, or it is there?
[00:36:59] Ox0dea: sarmiena_: Why RVM?
[00:37:09] havenwood: sarmiena_: The precompiled binaries for 2.2.2 haven't been uploaded yet. They have been for 2.2.1.
[00:37:42] sarmiena_: nofxx: before we upgrade ruby, we like to install version & gemset. allows for easy rollback in event of something we hadn???t considered
[00:38:08] havenwood: sarmiena_: If you want to compile and not use the precompiled binary: --disable-binary
[00:38:24] havenwood: which is what happens anyways
[00:38:40] nofxx: sarmiena_, I'd say use a CI for that.
[00:39:21] nofxx: we are cheap bastards here, and their are very expensive either way, so it's running inside, in an relative old i7 we got
[00:39:30] nofxx: gitlab-ci* btw
[00:39:42] ramfjord: has joined #ruby
[00:40:03] devoldmx: has joined #ruby
[00:40:13] deject3d: has joined #ruby
[00:40:38] nofxx: sarmiena_, that way neither dev or production needs to worry with rvm
[00:41:19] h4ckurate: has joined #ruby
[00:42:44] Encapsulation: has joined #ruby
[00:43:34] chouhoulis: has joined #ruby
[00:47:58] Liam`: has joined #ruby
[00:48:05] Cronon: has joined #ruby
[00:48:51] neurotech: has joined #ruby
[00:49:57] neurotech: Hi! I'm coming back to Ruby after spending some time learning some other languages and wanted to know if rbenv is still the best way to work with multiple ruby versions?
[00:50:27] wmoxam: neurotech: it's certainly a popular and well supported way to do it
[00:50:40] havenwood: neurotech: chruby is a very nice alternative
[00:50:54] hotpancakes: has joined #ruby
[00:51:13] neurotech: Ah neat. Thanks
[00:51:56] chouhoulis: has joined #ruby
[00:52:47] j75: has joined #ruby
[00:52:48] mary5030: has joined #ruby
[00:53:37] deject3d: has joined #ruby
[00:55:26] j3r0: has joined #ruby
[00:56:47] shock_one: has joined #ruby
[00:56:48] j75: If i am using a function alias in .bashrc like f() { #!/usr/bin/env ruby <<-EORUBY [ruby code here] EORUBY } how can I call variables such as $1? That way when I run 'f param1' I can have my function read param1
[00:57:06] Ox0dea: But... why?
[00:57:20] j75: just curious how it can be done
[00:57:21] Ox0dea: j75: Do you just not know about Ruby's -e flag?
[00:57:31] j75: yes but and -a
[00:57:41] j75: but i can't seem to get them to pick it up in my .bashrc function
[00:58:02] Ox0dea: I'm afraid I don't follow.
[00:59:13] shock_one: has joined #ruby
[00:59:31] Ox0dea: j75: <<-'EORUBY' ... EORUBY, if you really must.
[01:00:02] j75: .bashrc allows for functions: f() {echo $1} when you run 'f test' from the terminal it will then just output test.
[01:00:25] j75: how do i get <<- 'EORUBY' ... EORUBY to access arguments like $1
[01:01:03] Ox0dea: j75: ARGV?
[01:01:58] j75: doesn't seem to want to read it
[01:02:22] deepu: has joined #ruby
[01:02:57] j75: it puts a size of 0
[01:03:01] j75: it's not actually getting the arguments
[01:03:12] j75: I tried /usr/bin/env ruby <<-EORUBYputs ARGV.sizeputs ARGV.classEORUBY}
[01:06:10] shevy: can this work? ARGV is only available within a .rb file isn't it?
[01:06:32] Jester13: has joined #ruby
[01:06:37] shevy: could you not invoke a ruby script directly by the way, from bash? and just pass it the arguments?
[01:07:53] Ox0dea: j75: Perhaps you might explain why you think you need to do it this way?
[01:08:36] j3r0: has joined #ruby
[01:08:41] j75: It's not entirely necessary just wondering how I could keep my .bashrc file from having to look at external files to run a short ruby script
[01:09:01] Ox0dea: But... why? :'(
[01:09:41] j75: to easily move .bashrc between setups without having to remember where different files are that's all
[01:11:25] shevy: you made Ox0dea so sad now
[01:11:43] Ox0dea: j75: This works: https://gist.github.com/0x0dea/09a800a468818c4c53d1
[01:13:00] arooni-mobile__: has joined #ruby
[01:13:05] arooni-mobile: has joined #ruby
[01:14:01] j75: Ox0dea you are the man thanks! wouldn't not have thought to put $@ after EOR
[01:14:04] hyy: has joined #ruby
[01:14:07] j75: would not*
[01:14:10] Ox0dea: Happy to help.
[01:14:16] hyy: What's the Ruby equivalent for https://docs.python.org/2/library/socketserver.html
[01:14:19] Vile`: has joined #ruby
[01:14:19] hyy: bathroom brea
[01:14:58] mistermocha: has joined #ruby
[01:15:17] omegamike: has joined #ruby
[01:17:47] saddad: has joined #ruby
[01:18:41] Ox0dea: hyy: Still in the bathroom?
[01:18:58] hyy: 0x0dea: I'm back :)
[01:19:01] Ox0dea: >> require 'socket'; ObjectSpace.each_object(Class).select { |c| c.to_s[/Socket$/] }
[01:19:03] ruboto: Ox0dea # => [UNIXSocket, UDPSocket, TCPSocket, IPSocket, Socket, BasicSocket] (https://eval.in/414074)
[01:19:26] Ox0dea: loop { case socket.gets; when foo; end } to turn them into "servers". :P
[01:19:44] Synthead: has joined #ruby
[01:20:22] casadei_: has joined #ruby
[01:20:33] hyy: how do I write a guide for myself to learn Ruby well enough for my router to boot this little program?
[01:21:14] hyy: or receive this file
[01:21:14] shevy: just create a class that does the functionality you require
[01:21:24] hyy: TFTPSender
[01:22:21] hyy: TFTPFileSender sends a single file to a specified host then it crumples itself destroying the server connection and recording how many bytes were transferred
[01:22:23] shevy: Ox0dea lol I just realized the title you used in the shell script... retarded.sh
[01:23:05] Ox0dea: Si vicium in calceus.
[01:23:14] hyy: I'd laugh if you guys pointed me to a learning resource
[01:23:23] hyy: learning the very basics
[01:23:29] polyrob: has joined #ruby
[01:24:18] kith_: has joined #ruby
[01:24:32] Ox0dea: hyy: https://youtu.be/GlKL_EpnSp8?t=28
[01:24:33] fella7s: has joined #ruby
[01:24:39] omfgtora_: has joined #ruby
[01:24:44] Rinzlit1: has joined #ruby
[01:24:59] polyrob: has left #ruby: ("Leaving")
[01:25:13] tenseiten: has joined #ruby
[01:25:14] tenseiten: has joined #ruby
[01:25:15] hyy: 0x0dea: LOL!
[01:25:22] neurotech: What is the recommended gem for running an HTTP server? I'm looking for the ruby equivalent of hapi or express on node
[01:25:47] Ox0dea: neurotech: Everything uses WEBrick.
[01:26:25] neurotech: Right. Typically on node I would put my app(s) behind an nginx reverse proxy
[01:26:28] hyy: I'm ticked. No book.
[01:26:37] Ox0dea: "Ticked"?
[01:26:55] hyy: ok I'm not angry. But I want that book.
[01:27:07] shevy: hyy https://pine.fm/LearnToProgram/chap_01.html is still ok; for books, try the pickaxe3
[01:27:18] hyy: thank you!
[01:27:32] neurotech: Is WEBrick part of the standard library?
[01:27:34] shevy: https://pragprog.com/book/ruby4/programming-ruby-1-9-2-0
[01:27:44] shevy: but it seems as if they stopped to write new books about ruby since then :(
[01:27:49] Ox0dea: Eloquent Ruby > Pickaxe.
[01:28:18] neurotech: What sites/resources does everyone use to stay up to date with what's happening with the language?
[01:28:48] shevy: I look at the changelog :)
[01:28:50] shevy: and ask havenwood
[01:28:57] shevy: those are my two main resources
[01:28:58] Ox0dea: neurotech: The language itself, or library development?
[01:29:05] neurotech: This? https://changelog.com/
[01:29:12] shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog
[01:29:18] Ox0dea: shevy: There's a typo in [k-'s docfix. :/
[01:29:31] shevy: I COULD FIX THAT
[01:29:36] neurotech: Ox0dea: The culture, the community, stuff happening etc
[01:29:58] sarmiena_: ok so using brightbox now. can???t seem to switch the ruby version using ruby-switch. keeps pointing to 1.9.3 (the system install) when using ruby -v
[01:29:59] nofxx: neurotech, you're inside of it
[01:30:27] neurotech: I'm thinking of stuff like http://www.echojs.com/
[01:30:47] shevy: don't think we have that
[01:30:54] shevy: I guess javascript outgrew ruby :(
[01:31:09] charliesome: has joined #ruby
[01:31:17] shevy: 1163 on #javascript
[01:31:42] shevy: neurotech but really ask havenwood here every once in a while, he has some mystic resources
[01:32:18] dimasg: has joined #ruby
[01:33:02] nofxx: neurotech, I remember ruby-inside, check it on my mail once in a while
[01:33:22] neurotech: Okay cool. Thanks all
[01:33:40] j3r0: has joined #ruby
[01:33:43] nofxx: neurotech, and github.. explore/ruby
[01:34:50] countryHick: has joined #ruby
[01:36:18] einarj: has joined #ruby
[01:37:11] lwu: has joined #ruby
[01:37:16] neurotech: nofxx: It looks like there isn't a ruby section on GH explore
[01:37:48] nofxx: neurotech, trending/stars/showcase something like it?
[01:37:59] nofxx: should be a filter somewhere on the sidebar iirc
[01:38:48] neurotech: https://github.com/showcases/search?utf8=%E2%9C%93&q=ruby
[01:39:17] paulcsmith: has joined #ruby
[01:39:36] nofxx: neurotech, trending
[01:40:47] devoldmx: has joined #ruby
[01:41:05] arooni-mobile__: has joined #ruby
[01:41:14] neurotech: ah yes. Thanks!
[01:41:43] arooni-mobile: has joined #ruby
[01:42:02] neurotech: Woah: https://github.com/k0kubun/md2key
[01:43:02] bruno-: has joined #ruby
[01:45:23] arooni-mobile__: has joined #ruby
[01:45:33] mesamoo: has joined #ruby
[01:48:11] Ox0dea: >> !@THEqQUICKbBROWNfFXjJMPSvVLAZYDGgkyz&[%r{\"}mosx,4>6]|?'while(putc 3_0-~$.+=9/2^5;)<18*7and:`#
[01:48:12] ruboto: Ox0dea # => !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~nil (https://eval.in/414077)
[01:48:14] Ox0dea: That program prints and contains each non-control ASCII character exactly once.
[01:49:00] Ox0dea: The IOCCC of Ruby: https://sites.google.com/site/trickcontest2013/
[01:49:01] pepperbreath: has joined #ruby
[01:53:23] djbkd: has joined #ruby
[01:59:28] Musashi007: has joined #ruby
[02:00:25] dtcristo: has joined #ruby
[02:00:58] Vile`: has joined #ruby
[02:03:49] [k-: has joined #ruby
[02:07:09] dented42: has joined #ruby
[02:08:52] chipotle: has joined #ruby
[02:10:43] tmtwd: has joined #ruby
[02:11:04] j4cknewt: has joined #ruby
[02:11:31] GarethAdams: has joined #ruby
[02:11:47] Caius: has joined #ruby
[02:11:47] workmad3: has joined #ruby
[02:15:13] myztic: has joined #ruby
[02:16:11] mistermocha: has joined #ruby
[02:23:04] sarmiena_: has joined #ruby
[02:33:08] dopie: has joined #ruby
[02:35:47] LiquidInsect: has joined #ruby
[02:36:22] casadei_: has joined #ruby
[02:38:05] choke: has joined #ruby
[02:42:38] jonee: has joined #ruby
[02:44:34] Synthead: has joined #ruby
[02:46:16] serivich: has joined #ruby
[02:46:59] fullofcaffeine: has joined #ruby
[02:47:12] cscheib: anyone have a minute to help troubleshoot a gem build issue on OSX 10.11 public beta 4? json-1.8.2 seems to have issues.
[02:48:14] cscheib: it's preventing me from getting my boxen install working... I've already filed an issue report with Boxen upstream. https://github.com/boxen/our-boxen/issues/769
[02:49:11] The_Phoenix: has joined #ruby
[02:51:27] Antiarc: fatal error: 'ruby/config.h' file not found <-- you need ruby-devel or equivalent development headers installed on your system
[02:52:34] cscheib: hrmph. I don't know how to go about doing that for the system ruby install... this is OSX, and I have installed the Xcode utils.
[02:53:10] cscheib: lemme fire up xcode to see if there's extra crap I can install.
[02:53:46] arooni-mobile: has joined #ruby
[02:53:46] arooni-mobile__: has joined #ruby
[02:54:25] Antiarc: "To install them, you need to install the Xcode Tools package."
[02:54:34] cscheib: yea, which I've installed
[02:54:36] Antiarc: (I don't use OS X, I won't be much further help)
[02:54:57] Antiarc: `xcode-select --install` apparently helps
[02:54:57] cscheib: installing xcode installs the tools (these days)
[02:55:10] cscheib: you can either install just the tools or all of xcode
[02:55:21] cscheib: which xcode-select --install gets you
[02:56:01] cscheib: I seem to remember reading somewhere that some libraries may be in different places on 10.11 beta 4, but I can't find that article again
[02:56:11] spacemud: has joined #ruby
[02:58:37] cscheib: (of note: this is a system that was on non-beta before, and everything was working fine and dandy)
[03:00:09] tkuchiki: has joined #ruby
[03:00:26] dtcristo: has joined #ruby
[03:00:34] h4ckurate: has joined #ruby
[03:01:20] CatMartyn: has joined #ruby
[03:01:42] tkuchiki: has joined #ruby
[03:02:06] The_Phoenix: has joined #ruby
[03:02:15] cscheib: I'll probably just move back to 10.10 tomorrow
[03:02:53] Ox0dea: Downgrading is for quitters.
[03:03:21] [k-: ACTION downgrades [k-
[03:04:14] bmurt: has joined #ruby
[03:04:29] cscheib: agreed... but, I use boxen to configure my dev environment on my laptop, and I'd rather not manually configure everything.
[03:04:42] darkf: has joined #ruby
[03:05:14] [k-: configuring is for people who like challenges!
[03:05:16] stoodfarback: has joined #ruby
[03:05:25] [k-: i prefer everything to be done for me
[03:06:26] [k-: PONG: [k-
[03:06:35] dseitz: has joined #ruby
[03:06:59] shevy: Ox0dea> shevy: There's a typo in [k-'s docfix. :/
[03:07:19] shevy: if I fix your typo then we would be on equal commit-parity
[03:07:35] cscheib: [k-: the trolling is unnecessary.
[03:07:53] [k-: that is actually a real fact about me
[03:08:18] [k-: go ahead shevy!
[03:08:32] shevy: I don't know how to do it though
[03:08:49] cscheib: nevermind then. felt like trolling
[03:09:30] [k-: shevy: just fork documenting-ruby
[03:09:30] gix: has joined #ruby
[03:09:33] Radar: cscheib: +1 for moving back to 10.10. I had a junior dev at work who had a hell of a time installing our app's dependencies on 10.11
[03:09:33] cscheib: spent a lot of time working on my boxen/puppet shit, so it wasn't really done for me... but I agree
[03:09:34] [k-: and make changes
[03:09:37] [k-: and pr!
[03:10:03] cscheib: Radar: only things I've really had issues with are the Box drive client and... this
[03:10:31] Radar: cscheib: We spent 4 hours trying to figure out how to install Poltergeist and then found some obscure instructions somewhere that fixed it.
[03:10:33] braincrash: has joined #ruby
[03:10:42] Radar: I personally like to wait for OS releases like the normal folk
[03:11:18] cscheib: well, it's not the end of the world for me... I've got 2 OSX laptops, so I can always pull the other one out (that's why I use boxen to standardize my config)
[03:11:43] cscheib: so I usually run betas, unless there's something critically wrong
[03:15:36] cscheib: the only issue switching is re-generating all of my keys/one-time-passwords
[03:17:50] ccbn: has joined #ruby
[03:18:05] pepperbreath: has joined #ruby
[03:18:43] iamninja: has joined #ruby
[03:20:05] sdothum: has joined #ruby
[03:23:24] ramfjord: has joined #ruby
[03:28:05] hotpancakes: has joined #ruby
[03:29:26] jorgevaldez: has joined #ruby
[03:30:11] jorgevaldez: Hi, is there anyone from Japan here? Please send me a private message
[03:30:25] Ox0dea: Ohaiou gozaimasu!
[03:30:29] devoldmx: has joined #ruby
[03:30:49] Ox0dea: I can't even into Weeaboo. :/
[03:30:55] [k-: Fauxwapanese!
[03:31:01] Synthead: has joined #ruby
[03:31:44] sphex: has joined #ruby
[03:31:52] Ox0dea: jorgevaldez: Watashi no puroguramu wa doko desu ka.
[03:32:19] jorgevaldez: what? english please?
[03:32:35] Ox0dea: This guy.
[03:32:36] fedexo: has joined #ruby
[03:32:43] Ox0dea: shevy: Do you love it? https://gist.github.com/0x0dea/ff98ae33670a5c244815
[03:33:21] Radar: Is that... I am a programmer, what do you do?
[03:33:27] Radar: ACTION knows no Japanese
[03:33:30] [k-: what if i wanted to do 5 <=> 1 <= 6
[03:33:40] Ox0dea: [k-: Then you can fuck right offf.
[03:33:51] Ox0dea: "off and only off"
[03:34:22] Ox0dea: Radar: I said "Where is my program?".
[03:34:24] jackjackdripper: has joined #ruby
[03:34:30] [k-: i still dont see && at all?
[03:34:35] Radar: Ox0dea: ok, I am terrible at interpreting then :D
[03:34:36] Ox0dea: [k-: ":>" is the syntax for Tab in LOLCODE.
[03:34:44] Ox0dea: [k-: Why do you think an && is necessary?
[03:34:48] [k-: self && prev.send (...)?
[03:34:48] dopie: has joined #ruby
[03:34:57] [k-: you must make sure both sides are true?
[03:35:14] Ox0dea: [k-: You're misunderstanding the call to `super`, I reckon.
[03:35:40] [k-: much misunderstand
[03:36:04] Mon_Ouie: That's nasty and kind of cool
[03:36:50] Ox0dea: `1 < 2` sets $1 to "2" and returns `true`, `1 < 2 < 3` is then `true < 3`, which recalls the previous value ("2"), converts it to a Float (to cleanly handle all Numerics), and calls the operator on that with the RHS.
[03:36:57] Ox0dea: [k-: Rinse and repeat.
[03:37:16] jorgevaldez: has joined #ruby
[03:37:36] baweaver: has joined #ruby
[03:38:05] Ox0dea: But yeah, you didn't misunderstand the `super`, just... all the other madness.
[03:38:47] Mon_Ouie: Of course the problem with floats is that 1e500 <= 1e400
[03:39:03] Ox0dea: Aye, needs more BigDecimal.
[03:39:35] [k-: https://eval.in/414090
[03:39:41] [k-: this is supposed to be false
[03:39:48] [k-: 2 is not between 3 and 4
[03:40:02] [k-: this is what i am sayinf
[03:40:29] Ox0dea: Oh, right.
[03:41:11] Ox0dea: Stick a `return false unless self` in there somewhere.
[03:41:37] [k-: i didnt even need to run it!
[03:41:37] Mon_Ouie: Or just define each operation in FalseClass to return false
[03:41:42] ccbn: has left #ruby: ()
[03:41:49] [k-: you didnt even test!
[03:41:52] [k-: much dismay
[03:42:06] mrod: has joined #ruby
[03:43:17] [k-: i even have to write code to prove my point!
[03:43:27] Ox0dea: > and instance
[03:43:52] [k-: this is in violation of the [k--[k--[k--Ox0dea agreement
[03:44:19] Ox0dea: In any case, refining Booleans is insane.
[03:44:42] Ox0dea: Probably not as bad as this !== I've added to my local trunk, though.
[03:45:35] jorgevaldez: guys... i know this is completely out of topic and sorry for that... but just wondering if anyone here can help me find someone that speaks both english and japanese... I'm a ruby developer so that's why I'm looking here
[03:45:44] Ox0dea: Everything works, but I'm having trouble pinning down the semantics, which I suppose would explain its nonexistence.
[03:45:58] Ox0dea: ?guys jorgevaldez
[03:45:58] ruboto: jorgevaldez, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
[03:46:05] Radar: jorgevaldez: Why do you need someone who speaks both English and Japanese?
[03:46:13] Ox0dea: To translate, obviously.
[03:46:21] Radar: but to translate wht?
[03:46:25] jorgevaldez: ok sorry about the guys thing :)
[03:46:26] [k-: self || send(...)
[03:46:38] Ox0dea: Early exit = high performance.
[03:46:50] [k-: yes, exactly
[03:46:56] mrod: I have an object that gets updates from a websocket. I have to pull a snapshot of the original object, then update it with the events from the websocket. The snapshot and the events have sequences so you can download say, snapshot 3, then apply message 4, 5, 6 etc. I want to start the websocket and queue the messages, get a snapshot, then apply any messages whose sequences are higher than that of the snapshot.
[03:47:07] saddad: has joined #ruby
[03:47:18] Ox0dea: mrod: Use ActionCable!
[03:48:32] jorgevaldez: so... a little bit out of topic (sorry) but... I need to get in contact with the owner of an Instagram account to make him an offer ($) for his user name... but he's Japanese and it's kinda hard for me to contact him... I'm willing to pay someone to help me to this negotiation
[03:49:10] mrod: Thanks Ox0dea , I'll check it out
[03:49:17] [k-: this is not related to Ruby
[03:49:26] [k-: you can search somewhere else!
[03:49:31] [k-: off you go!
[03:49:45] Aww: has left #ruby: ("Leaving")
[03:50:02] Ox0dea: jorgevaldez: Stahp.
[03:50:34] [k-: this is like wayyyy off topic
[03:50:45] jorgevaldez: ok sorry... just thought of this as an option because there might be intelligent people here who speak both languages and want to easily earn some money with this... but yeah, I understand... sorry :( nevermind
[03:50:59] [k-: just because Matz is japanese doesnt mean this is related!
[03:51:05] jorgevaldez: yeah i know, lol
[03:51:07] Ox0dea: So lacist.
[03:51:54] [k-: so, english-japanese people elsewhere arent intelligent?
[03:51:57] Ox0dea: Sorry, L and R are right next to each other on my Colemak keyboard.
[03:52:09] jorgevaldez: wtf? that was meant as a compliment for this channel
[03:52:19] [k-: Congrats, Ox0dea, you are an intelligent anglo-japanese!
[03:52:37] DanielI: has joined #ruby
[03:52:45] Ox0dea: I didn't make any preparations for having my ass kissed this evening.
[03:52:46] [k-: jorgevaldez: some things *shouldn't* be said
[03:53:06] jeadr: has joined #ruby
[03:55:17] [k-: watashi [k- desu!
[03:55:31] jorgevaldez: has left #ruby: ()
[03:57:49] Ox0dea: [k-: I once wrote a function for determining the number of common bits between two integers.
[03:58:02] Ox0dea: In the lambda calculus.
[03:58:12] mrod: Ox0dea: looks like it's only for Rails. I really just need to queue websocket messages in an EM loop. I tried using em-priority-queue, but I can't get it to work: https://github.com/mikerodrigues/orderbook/blob/queue/lib/orderbook.rb
[03:58:19] pepperbreath: has joined #ruby
[03:58:23] [k-: i have no concept of what bits are, but ok
[03:58:24] jonee: has joined #ruby
[03:58:34] Ox0dea: [k-: That's so weird, dude.
[03:58:47] [k-: we are young!
[03:58:54] Ox0dea: mrod: Your camera's flash a shit.
[03:59:33] mrod: Ox0dea: What?
[03:59:36] Ox0dea: mrod: What sort of error(s) are you getting?
[03:59:55] bmurt: has joined #ruby
[04:00:28] workmad3: has joined #ruby
[04:01:24] Ox0dea: [k-: Positional number systems should be *really* easy to understand for somebody who already groks the essentials of programming. :/
[04:01:33] mrod: Well, that apply_orderbook_snapshot doesn't seem to run. I'm just instantiating an Orderbook in pry but the queue fills up and it slows down. I'm not getting errors. I try to #join the thread to see what's going on but it just blocks.
[04:02:03] Ox0dea: More guns doesn't make shooting in the dark any more likely to bear fruit.
[04:02:26] Ox0dea: Never mind why we're firing at apple trees.
[04:02:41] [k-: it's not like there is a list of things programmers should know :/
[04:03:20] Ox0dea: Radices are just applied addition, exponentiation, and modular division, doe.
[04:04:23] [k-: do O levels cover that?
[04:07:09] gix: has joined #ruby
[04:07:13] iamjarvo: has joined #ruby
[04:08:12] [k-: https://eval.in/414098
[04:10:45] tkuchiki: has joined #ruby
[04:11:00] [k-: welp, doesnt look like it's in my syllabus
[04:13:17] Ox0dea: [k-: Schoogle admits new students instantaneously and covers the broadest possible range of subjects.
[04:13:35] Ox0dea: > mfw when of course that's a real thing
[04:13:57] [k-: but i would have to attend TWO! schools
[04:14:23] Ox0dea: [k-: Your patch is wasteful; no need to update $1 in the case of falsity, since the rest of the chain must be false.
[04:14:54] Ox0dea: I'd like to generalize it, but storing other's class in $2 (to maintain thread-safety) wouldn't suffice.
[04:15:09] Ox0dea: There's no generalized way to instantiate objects from strings.
[04:15:14] [k-: Thread.current[:things]
[04:15:29] [k-: ACTION knocks Ox0dea's head
[04:15:45] Ox0dea: I'm going to use a module variable and you can't stop me.
[04:16:12] [k-: but that isnt safe!
[04:16:34] [k-: ACTION waits for a "your face" comment
[04:16:37] Ox0dea: Thread#[]= is just another way to spell global variables.
[04:16:52] [k-: but it is thread local
[04:16:57] heftig: fiber local
[04:16:57] wldcordeiro_: has joined #ruby
[04:16:59] Ox0dea: But anybody can access it at any time.
[04:17:10] [k-: Thread.current changes for the current thread
[04:17:15] Ox0dea: I'm aware.
[04:17:22] [k-: anyone can access $1 at any time
[04:17:29] Ox0dea: But that's a scope-local variable.
[04:17:53] [k-: anyone can access module variables at any time
[04:18:18] [k-: ruby is a reflective language!
[04:18:27] Ox0dea: We're not supposed to have to namespace our variables in not-C.
[04:18:32] heftig: fiber-locals are used for recursion guards, for example
[04:19:35] iateadonut: has joined #ruby
[04:20:01] [k-: what do you mean namespacing variables
[04:20:22] mistermocha: has joined #ruby
[04:20:38] Ox0dea: [k-: If I used Thread#[], I'd have to stick some arbitrary prefix on the variable names.
[04:21:43] Ox0dea: Arbitrarity is worst arity.
[04:21:50] [k-: why not (Your Module Name Here)
[04:21:53] Ann: has joined #ruby
[04:23:48] zz_Outlastsheep: has joined #ruby
[04:25:34] Ox0dea: I can redefine the comparison operators on all the modules that include Comparable when my thing is first `using`'d, but I can't hook arbitrary method definitions to pick up new candidates. :/
[04:25:38] Ox0dea: >> Symbol.all_symbols.grep(/core#/).sort.first
[04:25:39] ruboto: Ox0dea # => :"core#define_method" (https://eval.in/414099)
[04:25:53] Ox0dea: It'd be cake if nobu hadn't gimped FrozenCore.
[04:25:55] iamninja: has joined #ruby
[04:26:06] Ox0dea: NOBU, Y U DO DIS?
[04:27:41] [k-: The practice of making software run poorly on a compatitor's hardware.
[04:28:27] [k-: "messed up", "broken",
[04:29:14] Ox0dea: "Made less useful".
[04:30:23] [k-: u2cmplx4me
[04:30:55] Ox0dea: [k-: https://github.com/ruby/ruby/blob/trunk/doc/ChangeLog-2.1.0#L4201-L4202
[04:31:29] hyy: ok guys I need a starting resource for ruby, something to get me started
[04:32:14] [k-: this is ridiculously long
[04:32:28] Ox0dea: [k-: I linked to the relevant lines!
[04:32:29] krz: has joined #ruby
[04:32:35] Ox0dea: You need a GitHub app or some shit.
[04:33:37] [k-: hide the Singleton
[04:33:42] [k-: whatever that means
[04:34:00] hyyper: has joined #ruby
[04:34:24] Peterzky: has joined #ruby
[04:34:24] hyyper: my IRC client crashed
[04:34:36] Ox0dea: [k-: It means it's virtually impossible to hook #core#define_method, which is the method that gets called when methods get defined.
[04:35:00] Ox0dea: The dread commit: https://github.com/ruby/ruby/commit/16095
[04:35:11] Ox0dea: Still don't really understand why he did it. :'(
[04:35:17] [k-: why dont you just get the owners to do it themselves
[04:35:32] [k-: classes are open anyway
[04:35:33] Ox0dea: [k-: Huh? How do I refine classes I don't know about?
[04:35:59] [k-: get the owner to do it!
[04:36:22] hyy: I need a starting out guide to Ruby for beginner programmers
[04:36:30] Ox0dea: hyy: No, you don't. You need a book.
[04:36:34] Ox0dea: We've discussed this.
[04:36:46] Ox0dea: [k-: Not sexy (read: magical) enough.
[04:36:57] hyy: then crap, which book do I buy? I'm ready to buy anything
[04:37:17] [k-: Ox0dea: stupid statw
[04:37:19] Ox0dea: hyy: Project Gutenberg is having a sale this weekend.
[04:37:31] ruboto: http://ruby-community.com/pages/links
[04:37:46] ruboto: I don't know anything about books
[04:37:54] Ox0dea: apeiros: ^
[04:38:01] Radar: hyy: !twgr
[04:38:01] helpa: hyy: Learn Ruby by reading this book - http://manning.com/black3 - The Well-Grounded Rubyist by David A. Black
[04:38:12] Radar: hyy: The Well Grounded Rubyist is a good starting book.
[04:38:19] Radar: hyy: so is Chris Pine's Learn to Program.
[04:38:41] [k-: i am well grounded arent i? /s
[04:39:12] mary5030: has joined #ruby
[04:39:46] michael_mbp: has joined #ruby
[04:40:01] tmtwd: has joined #ruby
[04:40:29] mrod: Ox0dea: I have an actual error message now. I'm getting an ArgumentError when trying to #pop a value out of my EM::PriorityQueue: https://gist.github.com/mikerodrigues/e2c13568bfb14450870e#file-gistfile1-txt
[04:41:03] mrod: Looks like a block isn't getting passed through somewhere but I can't tell where.
[04:41:06] [k-: you aren't supplying the right arguments then
[04:41:27] hyy: 0x0dea: which books do they have on sale?
[04:42:08] Radar: hyy: please ignore Ox0dea. They are in a troll-y mood.
[04:42:54] [k-: Ox0dea: your gender seems suspicious to Radar
[04:43:40] jonee: has joined #ruby
[04:43:41] hyy: LINUX MUST HAVE COME
[04:43:49] slani: can I get value neseted hash kpi[:average]
[04:43:50] slani: => {"Sun, 09 Aug 2015"=>0.4539780114845019}
[04:44:08] slani: without loop
[04:44:09] atomi: has joined #ruby
[04:44:29] mrod: I think it's a bug in em-priority-queue
[04:44:48] hyy: Radar, book suggestion please?
[04:44:50] [k-: kpi[:average]["Sun, 09 Aug 2015"]
[04:44:59] Radar: hyy: I suggested two books. Scroll up.
[04:45:46] slani: [k-: I' don't know a date
[04:45:47] Radar: [k-: drunk?
[04:46:02] [k-: Radar: that's what he wanted!
[04:46:03] jackjackdripper: has joined #ruby
[04:46:35] [k-: slani: what do you want to achieve
[04:46:48] Radar: slani: input + expected output polease
[04:47:09] [k-: your code will be subjected to policing
[04:48:01] slani: [k-: get a vaule, but I don't kown a key of date. Can I get value without knowing a key date. I know only a first key.
[04:48:06] Radar: slani: Code or ban
[04:48:14] Radar: oops i mean "or I will be upset" sorry typo
[04:48:51] arescorpio: has joined #ruby
[04:49:17] [k-: &ri Hash#each Hash#values Hash#pop Hash#values_at Hash#[] Hash#fetch Hash#fetch!
[04:49:17] hyy: Radar, like this? \Radar
[04:49:18] `derpy: http://www.rubydoc.info/stdlib/core/Hash#each-instance_method, http://www.rubydoc.info/stdlib/core/Hash#values-instance_method
[04:49:48] Radar: ACTION has entered the land of crazy it seems
[04:49:55] Respek: has joined #ruby
[04:50:05] [k-: there are literally hundreds of ways to get a value
[04:50:12] [k-: please be more specific
[04:50:14] Radar: ACTION has an idea
[04:50:16] hyy: ACTION must buy Learn to Program by Chris Pine
[04:50:22] Radar: Stop suggesting answers until you know the question?
[04:50:28] Radar: ACTION approves of Radar's idea
[04:50:35] Ox0dea: Simmer down, gals.
[04:50:45] Radar: For it is better to let people think you're a fool than to type into an IRC channel and remove all doubt.
[04:50:57] Ox0dea: "Speak only that you would improve the silence."
[04:51:00] pepperbreath: has joined #ruby
[04:51:02] [k-: Radar: stop suggestings answers until you know the question!
[04:51:14] [k-: ACTION nods
[04:51:14] Radar: +q [k-!*@*
[04:51:19] Radar: Who's next?
[04:51:23] Ox0dea: I'll go with him.
[04:51:31] Radar: [k- is clearly off their rocker and is being disruptive.
[04:51:45] Radar: Great. Take it to #ruby-offtopic if you would kindly :)
[04:51:46] Ox0dea: I think you and him just aren't on the same wavelength. :/
[04:52:20] omegamike: has joined #ruby
[04:53:19] Ox0dea: Radar: Could you clarify which of [k-'s messages you deemed to be "disruptive"?
[04:53:34] bnagy: ACTION sigh
[04:53:47] Radar: [14:47:08] <[k-> your code will be subjected to policing
[04:53:51] Radar: [14:49:17] <[k-> &ri Hash#each Hash#values Hash#pop Hash#values_at Hash#[] Hash#fetch Hash#fetch!
[04:53:54] bronson: has joined #ruby
[04:54:00] Radar: Those are not useful comments to be making.
[04:54:02] ivanskie: has joined #ruby
[04:54:21] Radar: 15 minute timeout.
[04:54:25] Radar: slani: Do you have code you can share with us?
[04:54:27] dgutierrez1287: has joined #ruby
[04:54:40] bnagy: Ox0dea: http://wondermark.com/1k62/
[04:54:57] slani: Radar: i don't have code
[04:55:02] slani: I just have a hash
[04:55:06] Radar: slani: that's code.
[04:55:15] slani: Radar: :D
[04:55:20] nofxx: This is too crazy: this gem using httparty in a self.class.post() on machine A sends a 'GET', machine B sends a 'POST' ... already installed all gems again, any idea?
[04:55:36] amcoder: has joined #ruby
[04:56:00] Radar: nofxx: steps to reproduce plz
[04:56:18] nofxx: https://github.com/NARKOZ/gitlab/blob/master/lib/gitlab/client/issues.rb#L54 and httparty : https://github.com/NARKOZ/gitlab/blob/master/lib/gitlab/request.rb
[04:56:25] nofxx: Radar, well, if you could just install that gem
[04:56:45] Radar: hard for me to reproduce then :)
[04:57:17] nofxx: but boring... =/
[04:57:34] nofxx: but rly, lost 2 hours already... put a binding.pry in every line from that to httparty
[04:57:34] Radar: nofxx: Same versions of httparty on both machines?
[04:57:42] DanielI: has joined #ruby
[04:57:49] nofxx: yes, freshly installed... gonna check again
[04:58:36] Radar: -q [k-!*@*
[04:58:46] slani: Radar: 2.2.2 :060 > k = {:average=>{'Sun, 09 Aug 2015'=>0.4539780114845019}}
[04:59:03] Radar: slani: And you just want to get the value from there? You don't necessarily care about the date?
[04:59:12] slani: I like to get value 0.45
[04:59:16] slani: Radar: yes
[04:59:26] chouhoulis: has joined #ruby
[04:59:27] slani: I know avarge key
[04:59:29] Radar: slani: k[:average].values.first
[04:59:37] slani: Radar: thanks
[05:01:32] Radar: nofxx: I don't know how that could be possible.
[05:03:22] bnagy: is there an strace analog for ruby? That would be awesome.
[05:03:39] nofxx: Radar, that makes two of us. Just tested again, my machine GET, next to me POST. both linux, same ruby
[05:04:13] Radar: nofxx: my initial guess is that something is overriding the post method.
[05:04:21] Radar: nofxx: method(:post).source_location returns the same location on both machines?
[05:04:40] deepu: has joined #ruby
[05:05:07] deepu: has joined #ruby
[05:05:26] tectonic: has joined #ruby
[05:07:12] riotjones: has joined #ruby
[05:07:48] bmurt: has joined #ruby
[05:08:58] halcyone3: has joined #ruby
[05:12:30] slani: what is wrong with this code http://paste.ubuntu.com/12037339/
[05:12:39] wldcordeiro_: has joined #ruby
[05:13:03] Radar: slani: Can you write a small program which reproduces the problem?
[05:13:08] Radar: Hard to know without seeing what kpi is
[05:13:47] Peteykun: has joined #ruby
[05:14:44] slani: Radar: 2.2.2 :100 > kpi = {23=>{'Sun, 09 Aug 2015'=>0.7021276595744681}, 1=>{'Sun, 09 Aug 2015'=>1.0}} => {23=>{"Sun, 09 Aug 2015"=>0.7021276595744681}, 1=>{"Sun, 09 Aug 2015"=>1.0}}
[05:15:07] slani: kpi = {23=>{'Sun, 09 Aug 2015'=>0.7021276595744681}, 1=>{'Sun, 09 Aug 2015'=>1.0}}
[05:15:33] dopie: has joined #ruby
[05:15:35] Radar: and what is e?
[05:15:52] slani: 2.2.2 :086 > e = Hash.new(0)
[05:16:14] devoldmx: has joined #ruby
[05:16:17] hahuang65: has joined #ruby
[05:16:41] swgillespie: has joined #ruby
[05:16:47] rehat: has joined #ruby
[05:17:03] Radar: Silex: You should put a space around the *0.2, so it's * 0.2
[05:17:17] Radar: Otherwise it will interpret it as an argument to .first
[05:17:55] slani: Radar: thanks
[05:18:07] slani: I'm new in Ruby
[05:18:51] Radar: It's an edge case that you've just stumbled across there. Just remember to put spaces either side of your operators +,-,/,*, and you should be ok
[05:19:25] swgillespie: has joined #ruby
[05:21:37] j4cknewt: has joined #ruby
[05:22:46] al2o3-cr: slani: e = kpi.each_with_object(Hash.new(0)) { |(user_id, date), hsh| hsh[user_id] += kpi[user_id].values.first * 0.2 } # this will work to :)
[05:23:27] al2o3-cr: try it out in irb/pry to see why it work :)
[05:24:45] [k-: you do not need to access kpi[user_id]
[05:24:56] [k-: it is provided in date
[05:25:05] al2o3-cr: [k-: good call :)
[05:25:24] Radar: date should then probably be called data instead.
[05:25:41] Ox0dea: I thought that was a style violation.
[05:26:15] al2o3-cr: yeah, that would be a better variable name
[05:26:36] Ox0dea: It's all data.
[05:27:38] Ox0dea: > Variable naming conventions can often turn into a religious war, but I'm entirely confident when I declare The World's Worst Variable Name to be: $data
[05:27:43] Ox0dea: http://archive.oreilly.com/pub/post/the_worlds_two_worst_variable.html
[05:28:01] Radar: Ox0dea: Ok. What's a better name for it than date or data?
[05:28:20] Radar: It's all values.
[05:28:52] [k-: conventions states { |k,v| ... }
[05:29:13] Ox0dea: Radar: I believe you were mistaken in suggesting that slani needed to change it from `date`.
[05:29:24] dc_: has joined #ruby
[05:29:33] Ox0dea: I mean, look at his Has.
[05:29:36] h4ckurate: has joined #ruby
[05:29:41] Ox0dea: The keys are rather obviously dates.
[05:30:19] Radar: Yes, I can see that now.
[05:30:47] Ox0dea: slani: Pardon the disruption.
[05:30:48] psye: has joined #ruby
[05:31:04] blt: has joined #ruby
[05:31:08] al2o3-cr: slani: e = kpi.each_with_object(Hash.new(0)) { |(key, value), hsh| hsh[key] += value.values[0] * 0.2 } # updated
[05:31:24] Ox0dea: But he has user IDs and dates!
[05:32:02] lxsameer: has joined #ruby
[05:32:02] lxsameer: has joined #ruby
[05:32:08] [k-: or you can just map and turn it to a hash later
[05:32:09] al2o3-cr: Ox0dea: He can obviously change them (it's an example)
[05:32:16] [k-: or you can update the hash
[05:32:27] Ox0dea: al2o3-cr: Are you not morally obligated to attempt to lessen the confusion of newcomers?
[05:33:20] al2o3-cr: Ox0dea: I'm pretty sure from the code he gave, he knows what key/values are
[05:33:21] Radar: Well this seems like a fun discussion to be nope'ing out of. Bye.
[05:35:31] [k-: https://d262ilb51hltx0.cloudfront.net/max/800/1*mIrYVuSZtaYe3WJkRwUqwQ.jpeg
[05:35:52] [k-: this actually shows that we can have * in names as well
[05:36:23] AlexRussia: has joined #ruby
[05:37:20] Ox0dea: [k-: Mayhap the Common Lispers are making that trek, but Clojurians in general seem quite happy with theirs.
[05:38:32] einarj: has joined #ruby
[05:38:50] Ox0dea: Haskell sure is on folks' tongues, though: http://git.io/v3T4R
[05:39:29] Ox0dea: https://github.com/Dobiasd/programming-language-subreddits-and-their-choice-of-words#happiness
[05:40:50] sdwrage: has joined #ruby
[05:40:58] slani: al2o3-cr: is there any performance improvemnt
[05:40:59] [k-: all this shows is that everyone wants to move away from java
[05:41:07] [k-: and lua people are quiet
[05:41:49] al2o3-cr: slani: idk have not benchmarked it
[05:43:04] al2o3-cr: [k-: /j #lua they're nutters :)
[05:44:41] bruno-: has joined #ruby
[05:44:54] djbkd: has joined #ruby
[05:46:39] slani: hash.delete(key)
[05:46:45] slani: hash.delete(key1)
[05:46:58] slani: can I do this in one lien
[05:47:28] mary5030: has joined #ruby
[05:47:38] [k-: hash.delete(key1) && hash.delete(key2)
[05:47:50] [k-: do you need to preserve kpi?
[05:48:11] slani: only delete two kesy
[05:48:13] [k-: also note that the above code does not work all the time
[05:48:31] Ox0dea: slani: Do you know what [k- meant by "preserve kpi"?
[05:49:11] workmad3: has joined #ruby
[05:49:15] pontiki: i don't know what that means
[05:49:27] pontiki: "Key Performance Indicator" ?
[05:49:36] Ox0dea: Could well be.
[05:49:51] bnagy: slani: [k1,k2].each {|k| hsh.delete k }, but for two why bother
[05:50:08] nofxx: Radar, found the why: httparty fallback to GET on redirection. Now, both computers are on the same LAN, connecting to the same internet server
[05:50:44] nofxx: somehow one is receiving a redirect, I'm getting two of evertying, every GET, and so every post becomes a GET... the strangest part: server get only 1 request
[05:50:47] slani: Ox0dea: I hope so
[05:51:04] Ox0dea: slani: Hash#delete does not preserve the receiver.
[05:51:21] Ox0dea: >> foo = {a: 1, b: 2, c: 3}; foo.delete_if { |key| %i[a c].include? key }; foo
[05:51:22] ruboto: Ox0dea # => {:b=>2} (https://eval.in/414103)
[05:51:35] [k-: yeah, that is only 1 loop
[05:51:41] slani: I will still have other keys and vale in kpi
[05:51:56] Ox0dea: slani: Yes, but kpi will be mutated.
[05:52:15] [k-: Ox0dea but in the case of a hash, wouldn't a loop be slower
[05:52:47] Ox0dea: [k-: I was only demonstrating #delete{,_if}'s mutative natures.
[05:54:26] nofxx: FUCK! 4 hours of my life... it's the damn httpS! NON-S redirects to HTTPS, httparty fallbacks to GET, I could be riding my bike, stealing and killing but no! 4 hours for an 's'
[05:54:37] nofxx: hate computers, going to the hills live on subsistance agriculture
[05:54:42] al2o3-cr: better to use reject then?
[05:54:51] slani: Ox0dea: what shoul I use then
[05:55:02] Ox0dea: slani: Do or do you not wish to leave kpi in its previous state?
[05:55:18] Ox0dea: Is it okay if the entries you #delete disappear forever?
[05:55:38] slani: yes it is ok for me
[05:55:46] slani: to disappear
[05:55:49] Ox0dea: How many entries do you need to remove? Just the two?
[05:56:10] Ox0dea: Then just use two #deletes on two lines, man.
[05:56:19] devbug: has joined #ruby
[05:57:24] Ox0dea: slani: I see where you were coming from, but optimizing for code height is pretty much never a good idea.
[05:57:45] [k-: not what rubocop thinks
[05:57:50] [k-: curse rubocop!
[05:58:22] slani: Ox0dea: :d
[05:58:25] ndrei: has joined #ruby
[06:00:14] sargas: has joined #ruby
[06:01:22] yardenbar: has joined #ruby
[06:03:14] yardenbar: has joined #ruby
[06:04:59] hyy: has joined #ruby
[06:05:04] null_ref_: has joined #ruby
[06:12:51] bustrarm: has joined #ruby
[06:13:42] banister: has joined #ruby
[06:17:40] hotpancakes: has joined #ruby
[06:21:12] User458764: has joined #ruby
[06:25:29] mistermocha: has joined #ruby
[06:26:03] kies: has joined #ruby
[06:29:38] mistermocha: has joined #ruby
[06:30:55] fullofcaffeine: has joined #ruby
[06:33:06] Shoutsid: has joined #ruby
[06:46:28] slani: how can I round float on 2 decimals
[06:50:07] lxsameer: has joined #ruby
[06:50:07] lxsameer: has joined #ruby
[06:52:04] dimasg: has joined #ruby
[06:52:24] hyy: has joined #ruby
[06:54:09] chris2: has joined #ruby
[06:55:05] tkuchiki: has joined #ruby
[06:57:39] Cust0sLim3n: has joined #ruby
[07:04:08] baroquebobcat: has joined #ruby
[07:05:09] bnizzle: has joined #ruby
[07:08:10] dcarmich: has joined #ruby
[07:08:16] hyy: has joined #ruby
[07:09:00] lxsameer: has joined #ruby
[07:12:07] mary5030: has joined #ruby
[07:17:02] devoldmx: has joined #ruby
[07:17:05] charliesome: has joined #ruby
[07:19:17] yfeldblum: has joined #ruby
[07:19:44] tubulife-: has joined #ruby
[07:20:35] khebbie: has joined #ruby
[07:22:13] dimasg: has joined #ruby
[07:23:01] fullofcaffeine: has joined #ruby
[07:27:48] lxsameer: has joined #ruby
[07:29:29] krz: has joined #ruby
[07:30:12] hotpancakes: has joined #ruby
[07:30:15] sevenseacat: has joined #ruby
[07:34:06] iateadonut: has joined #ruby
[07:35:47] choke: has joined #ruby
[07:35:56] mistermocha: has joined #ruby
[07:38:01] workmad3: has joined #ruby
[07:38:28] jonee: has joined #ruby
[07:39:09] einarj: has joined #ruby
[07:42:11] shock_one: has joined #ruby
[07:43:48] hotpancakes: has joined #ruby
[07:44:32] krz: has joined #ruby
[07:44:36] Jackneill: has joined #ruby
[07:45:27] tkuchiki: has joined #ruby
[07:46:20] lxsameer: has joined #ruby
[07:49:28] roolo: has joined #ruby
[07:49:35] yfeldblum: has joined #ruby
[07:54:33] dgutierrez1287: has joined #ruby
[07:54:56] niemcu: has joined #ruby
[07:58:11] yfeldblum: has joined #ruby
[07:58:29] User458764: has joined #ruby
[08:00:32] halcyone3: has joined #ruby
[08:02:08] cornerma1: has joined #ruby
[08:06:03] jonee: has joined #ruby
[08:09:10] sdwrage: has joined #ruby
[08:09:57] krz: has joined #ruby
[08:10:39] yfeldblum: has joined #ruby
[08:12:54] TomyLobo: has joined #ruby
[08:13:09] stoodfarback: has joined #ruby
[08:15:16] gard: has joined #ruby
[08:16:16] yfeldblum: has joined #ruby
[08:16:52] krz: has joined #ruby
[08:21:09] oliver__: has joined #ruby
[08:22:18] dtcristo: has joined #ruby
[08:24:22] Mendenhall: has joined #ruby
[08:25:45] khebbie: has joined #ruby
[08:26:53] hotpancakes: has joined #ruby
[08:28:06] banister: has joined #ruby
[08:28:15] symm-: has joined #ruby
[08:30:34] Feyn: has joined #ruby
[08:31:26] jonee: has joined #ruby
[08:32:33] Violentr: has joined #ruby
[08:33:20] nofxx: Is there some way to make the .git ext optional, that wont change the <repo> match? /^(ssh:\/\/)?git@github.com:(?<user>[^\/]+)\/(?<repo>.+)\.git$/
[08:33:26] lxsameer: has joined #ruby
[08:34:07] nofxx: if I (\.git)? What was 'repo' will be 'repo.git' .... I may gsub/tr later, but just so I know if there's a better way
[08:35:05] choke: has joined #ruby
[08:37:46] Sembei: has joined #ruby
[08:37:53] mistermocha: has joined #ruby
[08:40:55] glennt: has joined #ruby
[08:41:40] Ox0dea: nofxx: %r'^(ssh://)?git@github.com:(?<user>[^/]+)/(?<repo>.+?)(\.git)?$'
[08:41:46] Ox0dea: It suffices to make the repo match non-greedy.
[08:42:05] haroldwu: has joined #ruby
[08:42:09] rikkipitt: has joined #ruby
[08:43:06] nofxx: Ox0dea, works like a charm, ty!
[08:43:06] dented42: has joined #ruby
[08:43:13] Ox0dea: Happy to help.
[08:44:47] khapa: has joined #ruby
[08:50:22] Trynemjoel: has joined #ruby
[08:50:24] apfeluser: has joined #ruby
[08:50:31] tkuchiki: has joined #ruby
[08:52:14] baroquebobcat: has joined #ruby
[08:52:59] riotjones: has joined #ruby
[08:57:28] rht: has joined #ruby
[08:59:11] yeticry: has joined #ruby
[09:04:34] yeticry: has joined #ruby
[09:04:36] Iskarlar: has joined #ruby
[09:05:34] workmad3: has joined #ruby
[09:12:21] h4ckurate: has joined #ruby
[09:13:12] DoubleMalt: has joined #ruby
[09:13:36] einarj: has joined #ruby
[09:14:16] bweston92: has joined #ruby
[09:17:48] devoldmx: has joined #ruby
[09:24:02] tectonic: has joined #ruby
[09:26:50] _blizzy_: has joined #ruby
[09:28:18] tkuchiki: has joined #ruby
[09:28:23] lapide_viridi: has joined #ruby
[09:29:06] hotpancakes: has joined #ruby
[09:31:09] iamninja: has joined #ruby
[09:31:12] doosy: has joined #ruby
[09:34:55] krz: has joined #ruby
[09:36:58] tkuchiki: has joined #ruby
[09:37:45] decoponio: has joined #ruby
[09:41:17] tkuchiki: has joined #ruby
[09:42:27] mistermocha: has joined #ruby
[09:44:12] tkuchiki: has joined #ruby
[09:45:05] jenrzzz: has joined #ruby
[09:46:14] bruno-: has joined #ruby
[09:49:16] greenarrow: has joined #ruby
[09:53:56] shevy: ncurses 6.0 is out, now we will be able to write kick-ass apps in ruby
[09:54:05] blt: has left #ruby: ("WeeChat 1.2")
[09:59:43] dtcristo: has joined #ruby
[10:01:15] kraljev11: has joined #ruby
[10:01:25] rikkipitt: has joined #ruby
[10:06:59] jonee: has joined #ruby
[10:07:17] halcyone3: has joined #ruby
[10:08:05] krz: is it possible to use do something like try against a hash? i.e. {a:'a'}.try(:a)
[10:10:26] tkuchiki: has joined #ruby
[10:11:37] bweston92: has joined #ruby
[10:12:55] marr: has joined #ruby
[10:13:08] adaedra: krz: what would it do?
[10:13:22] sarkyniin: has joined #ruby
[10:13:52] bweston92: has joined #ruby
[10:14:37] dcarmich: has joined #ruby
[10:14:53] araujo: has joined #ruby
[10:18:32] devoldmx: has joined #ruby
[10:21:36] dgutierrez1287: has joined #ruby
[10:29:09] DexterLB: has joined #ruby
[10:32:15] araujo: has joined #ruby
[10:34:54] jonee: has joined #ruby
[10:35:13] [k-: >> {a: 'a'}.key?(:a)
[10:35:15] ruboto: [k- # => true (https://eval.in/414170)
[10:35:23] einarj: has joined #ruby
[10:35:31] niemcu: has joined #ruby
[10:36:20] davedev24: has joined #ruby
[10:37:31] krz: has joined #ruby
[10:37:38] ndrei: has joined #ruby
[10:41:13] pgatt: has joined #ruby
[10:44:15] SCHAAP137: has joined #ruby
[10:44:34] eGGsha: has joined #ruby
[10:45:24] jenrzzz: has joined #ruby
[10:46:42] shock_one: has joined #ruby
[10:47:08] swgillespie: has joined #ruby
[10:47:50] Gadgetoid: has joined #ruby
[10:48:04] havenwood: has joined #ruby
[10:49:49] doosy: has joined #ruby
[10:49:54] mcgain: has joined #ruby
[10:50:17] mcgain: has joined #ruby
[10:50:36] zanloy: has joined #ruby
[10:50:48] mcgain: has left #ruby: ()
[10:51:15] mcgain: has joined #ruby
[10:52:52] kirun: has joined #ruby
[10:53:49] pyon_: has joined #ruby
[10:54:18] workmad3: has joined #ruby
[10:56:09] DoubleMalt: has joined #ruby
[10:56:34] krz: [k-: sorry was dc'd. im trying to return the value or nil. depending if key is present
[10:56:47] krz: similar to what .try does
[10:57:03] Mon_Ouie: That's already what Hash#[] does
[10:57:23] DoubleMalt: has joined #ruby
[10:58:22] krz: hmmm good point
[10:59:04] [k-: Hash#fetch(key, default_value)
[11:02:18] FernandoBasso: has joined #ruby
[11:07:49] lxsameer: has joined #ruby
[11:07:49] lxsameer: has joined #ruby
[11:08:43] shevy: this is cool https://bugs.ruby-lang.org/issues/11420
[11:13:30] Trynemjoel: has joined #ruby
[11:14:10] oleksandriuzikov: has joined #ruby
[11:14:25] bruno-: has joined #ruby
[11:15:26] krz: has joined #ruby
[11:16:01] User458764: has joined #ruby
[11:16:02] tkuchiki: has joined #ruby
[11:25:51] freerobby: has joined #ruby
[11:28:05] hotpancakes: has joined #ruby
[11:29:00] shevy: japanese devs discussing in english!!!
[11:29:17] tkuchiki: has joined #ruby
[11:31:57] krz: has joined #ruby
[11:33:03] ndrei: has joined #ruby
[11:33:51] eGGsha: has joined #ruby
[11:33:58] choke: has joined #ruby
[11:37:34] alphaatom: has joined #ruby
[11:40:10] casadei_: has joined #ruby
[11:43:13] sdothum: has joined #ruby
[11:47:45] omegamike: has joined #ruby
[11:49:39] freerobby: has joined #ruby
[11:51:32] phutchins: has joined #ruby
[11:52:02] mistermocha: has joined #ruby
[11:52:54] tkuchiki: has joined #ruby
[11:55:38] spacemud: has joined #ruby
[11:55:42] mistermocha: has joined #ruby
[11:59:00] choke: has joined #ruby
[12:01:39] jenrzzz: has joined #ruby
[12:04:21] tkuchiki: has joined #ruby
[12:06:05] j4cknewt: has joined #ruby
[12:06:16] pafin: has joined #ruby
[12:08:05] ishahnaz: has joined #ruby
[12:08:28] tomphp_: has joined #ruby
[12:09:50] unsymbol: has joined #ruby
[12:10:28] mhib: has joined #ruby
[12:11:35] Trynemjoel: has joined #ruby
[12:14:12] gard: has joined #ruby
[12:16:59] jonee: has joined #ruby
[12:16:59] DoubleMalt: has joined #ruby
[12:17:32] alphaatom: has joined #ruby
[12:18:33] Synthead: has joined #ruby
[12:19:18] devoldmx: has joined #ruby
[12:21:42] oliver__: has joined #ruby
[12:21:54] lannonbr: has joined #ruby
[12:24:10] tkuchiki: has joined #ruby
[12:27:12] hotpancakes: has joined #ruby
[12:29:05] dtcristo: has joined #ruby
[12:32:10] pawnbox: has joined #ruby
[12:33:07] Antoine59: has joined #ruby
[12:33:45] einarj: has joined #ruby
[12:34:29] lxsameer: has joined #ruby
[12:37:01] krz: has joined #ruby
[12:38:54] _blizzy_: has joined #ruby
[12:41:28] jonee: has joined #ruby
[12:43:06] workmad3: has joined #ruby
[12:45:55] Shoutsid: has joined #ruby
[12:47:16] _blizzy_: has joined #ruby
[12:48:05] Chau: has joined #ruby
[12:48:33] dgutierrez1287: has joined #ruby
[12:49:11] alphaatom: has joined #ruby
[12:51:00] doosy: has joined #ruby
[12:51:25] ndrei: has joined #ruby
[12:59:12] mistermocha: has joined #ruby
[13:01:07] fluffykat: has joined #ruby
[13:02:25] fluffykat: hello - I am hoping someone can help. I can't get my basic if statement to work.
[13:02:35] fluffykat: I'll paste code to gist
[13:04:22] fluffykat: http://pastebin.com/Wnk1HwyD
[13:04:23] ruboto: fluffykat, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/1166108d422f5138e03b
[13:04:23] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[13:05:17] [k-: what is wrong?
[13:05:18] greenarrow: fluffykat, whats the error
[13:05:56] fluffykat: basically it's always returning type_a.name as the winner.....
[13:06:13] greenarrow: if statement is fine something wrong with your logic
[13:07:02] greenarrow: you dont the the wrapping brackets on this fyi if (self.type_a.pick('5'))
[13:07:05] [k-: yup, if you dont run into an error, it's not the code, it's the logic
[13:07:57] fluffykat: yeah, i'll take out those brackets and see if it makes a difference
[13:08:23] [k-: it wont make a difference
[13:09:09] [k-: what does `self.type_a.pick('5')` return?
[13:09:19] fluffykat: hmm...im checking in irb
[13:09:33] fluffykat: it return '5'
[13:09:44] [k-: 5 is a truthy valie
[13:09:55] [k-: it will always be treated as true
[13:10:16] fluffykat: `self.type_a.pick('2')` returns '2'
[13:10:29] [k-: what do you expect pick to return?
[13:10:33] [k-: is it your code?
[13:10:42] [k-: do you know ruby?
[13:11:16] fluffykat: just learning
[13:11:23] casadei_: has joined #ruby
[13:11:37] [k-: what should pick return?
[13:12:41] dseitz: has joined #ruby
[13:13:03] fluffykat: basically if i enter test.type_a.pick('5') it returns '5', which is correct
[13:13:27] [k-: and what should the if statement do?
[13:13:41] lannonbr: I think [k- is asking what is the purpose of the function pick
[13:13:50] [k-: lannonbr, no
[13:14:05] [k-: im asking if he actually expected a boolean
[13:14:16] [k-: anyways
[13:14:34] [k-: fluffykat, how is the if statement supposed to work?
[13:14:51] [k-: if it is 5? if it is 2? if it is not 5? etc etc
[13:15:09] Trynemjoel: has joined #ruby
[13:15:21] alphaatom: has joined #ruby
[13:15:36] fluffykat: i'm checking if type_a has picked 5 and type_b has picked 2 in the first test and if so then type_a wins. the method .pick returns the string '5' or '2'
[13:16:00] fluffykat: sorry the method pick returns the argument value passed into it
[13:16:31] [k-: so you want to see if 5 is more than 2?
[13:17:09] [k-: that seems to be what you want to do
[13:17:38] [k-: so you want to check if a is 5 and b is 2, right?
[13:17:51] fluffykat: is this the correct expression? - if ((self.type_a.pick('5')) == '5') && (self.type_b.pick('2') == '2')
[13:18:17] lannonbr: It may be, but it doesn't seem what you really want to do
[13:18:27] lannonbr: It is valid
[13:18:36] fluffykat: let me check
[13:18:57] 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:22:33] charliesome: has joined #ruby
[13:22:43] edwinvdgraaf: has joined #ruby
[13:26:32] edwinvdg_: has joined #ruby
[13:28:04] hotpancakes: has joined #ruby
[13:29:57] Tamae: has joined #ruby
[13:31:00] thiagovsk: has joined #ruby
[13:31:49] ruurd: has joined #ruby
[13:34:17] basmoura: has joined #ruby
[13:35:09] alphaatom: has joined #ruby
[13:35:54] einarj: has joined #ruby
[13:36:07] Kallis: has joined #ruby
[13:37:40] dling`: has joined #ruby
[13:37:44] banister: has joined #ruby
[13:38:12] fluffykat: hmm, the code is still not working
[13:38:31] gunslinger: has joined #ruby
[13:38:48] gunslinger: Is it possible to find the object causing an exception in ruby?
[13:39:32] gunslinger: I get an "Undefined method [] for Nil::Nilclass" error,
[13:39:36] shazaum_: has joined #ruby
[13:39:43] gunslinger: but IDK which object is causing it
[13:39:54] sevenseacat: the one you're calling [] on, in the line raising the error
[13:40:32] gunslinger: sevenseacat: I'm not currently sure which line gets the Error, my exception
[13:40:39] gunslinger: loop just prints the message
[13:40:47] sevenseacat: gist the code and error?
[13:41:21] sargas: has joined #ruby
[13:41:24] fluffykat: I've tested it in irb and what is happening is this: when i define type_a.pick = '5' and type_b.pick = '2' then Irb works fine when I check what value type_a is and value type_b is. As soon as I run the program, the type_b changes its value?? bizarre
[13:42:24] [k-: post what you typed into irb
[13:42:25] fluffykat: as soon as i run test.play i meant to say*
[13:42:40] ruboto: We can't help you without your code, please post it to https://gist.github.com
[13:42:41] gunslinger: sevenseacat: This is the code : https://gist.github.com/anonymous/470c6a506c83b715a7ca
[13:42:53] gunslinger: sevenseacat: The error: https://gist.github.com/anonymous/c27d7e093c40c9b51357
[13:43:08] jhass: gunslinger: gist supports syntax highlighting and multiple files
[13:43:23] gunslinger: jhass: TIL, I'll keep that in mind
[13:43:28] jonee: has joined #ruby
[13:43:54] jhass: gunslinger: fix whatever shit is catching the error to print the backtrace
[13:44:11] sevenseacat: that would be a good first step
[13:45:02] gorgoroth: has joined #ruby
[13:45:37] gorgoroth: when trying to compile json I get this: "/usr/bin/ruby19: Permission denied -- /usr/local/bin/rake (LoadError)"
[13:45:44] gorgoroth: anyone knows what is the problem?
[13:45:56] sevenseacat: gorgoroth: permission denied is the problem.
[13:46:25] gorgoroth: sevenseacat: yes, dmesg shows nothing
[13:46:36] gorgoroth: the binary is with executable bit
[13:46:48] sevenseacat: doesnt mean you have permission to execute it
[13:47:12] gorgoroth: sevenseacat: I have, I'm root, but wait
[13:47:15] [k-: fluffykat: ignoring us will not help us help you
[13:47:40] gunslinger: jhass: On it
[13:48:48] fantazo: has joined #ruby
[13:50:22] gunslinger: jhass: This is the line, https://gist.github.com/anonymous/1c21cdbf127e9017f916
[13:50:40] jhass: !fact mk styleguides here are three popular styleguides, you should read and follow at least one: https://github.com/styleguide/ruby https://github.com/bbatsov/ruby-style-guide https://github.com/thoughtbot/guides/tree/master/style/ruby
[13:50:41] ruboto: jhass, I will remember that styleguides is here are three popular styleguides, you should read and follow at least one: https://github.com/styleguide/ruby https://github.com/bbatsov/ruby-style-guide https://github.com/thoughtbot/guides/tree/master/style/ruby
[13:51:05] jhass: gunslinger: so there are three calls to [] on it
[13:51:31] jhass: check which is nil, posts, posts[index] or posts[index]["shares"]
[13:51:46] gunslinger: jhass: thanks, I'm looking into that now
[13:53:20] oliver__: has joined #ruby
[13:55:16] gunslinger: jhass: It was shares, thanks!
[13:55:41] jhass: ?styleguides gunslinger
[13:55:41] ruboto: gunslinger, here are three popular styleguides, you should read and follow at least one: https://github.com/styleguide/ruby https://github.com/bbatsov/ruby-style-guide https://github.com/thoughtbot/guides/tree/master/style/ruby
[13:56:48] sylvain31: has joined #ruby
[13:57:35] jhass: gunslinger: also you should do posts.first(10).each do |post| instead of your while construct. Or posts.reverse.first(10) if you really care about iterating in reverse
[13:58:19] fluffykat: [k-: apologises - I was distracted from the screen. I think I understand what explain the error. Let me paste the irb as requested...give me a moment please.
[13:59:14] j3r0: has joined #ruby
[13:59:15] jhass: gunslinger: and actually it's a .map not an .each
[13:59:42] gorgoroth: has joined #ruby
[14:01:03] gunslinger: jhass: Is there a significant advantage to using map instead?
[14:01:16] jhass: it's a lot prettier?
[14:01:26] gunslinger: Utility-wise?
[14:02:20] gunslinger: How'd you get the idea I wanted to iterate in reverse (& this is why I hate correcting code that isn't my own :/)
[14:02:21] doosy: has joined #ruby
[14:02:49] sylvain31: hi, when I define a top level function, how do I test that the method name exist in the current context, normally the scope is global and I should be able to call it from everywhere.
[14:02:50] jhass: the while condition got me all dizzy ;)
[14:02:59] tmtwd: has joined #ruby
[14:03:41] jhass: post_results = posts.first(10).map {|post| {shares: post["shares"]["count"], likes: post["likes"], message: post["message"], comments: top_ten_comments_from(post) } end
[14:04:08] gorgoroth: I have no idea
[14:04:10] jhass: something into that direction, should be about a third of the lines of code -> a lot easier to understand
[14:04:14] gorgoroth: anyone knows what this might be?
[14:04:50] jhass: gorgoroth: I suspect you messed up your system by mindlessly using root because something "didn't work"
[14:04:59] [k-: gorgoroth: at least provide us with more info
[14:05:18] gorgoroth: ok, I'll try
[14:06:28] dorei: has joined #ruby
[14:06:44] fluffykat: [k-: I've fixed my problem. I couldn't resist making the change in the code and seeing if it worked in IRB. Basically the error is in this line " if (self.type_a.pick('5')) && self.type_b.pick('2')" . When it reaches this line it changes type_b to the value 2 even if I had previously assigned the value '5' to it. I had to instead save the value in a method that doesn't ask for any arguments. the code now works
[14:06:57] conor_: has joined #ruby
[14:07:37] [k-: congrats
[14:09:39] shevy: what a nick
[14:09:51] shevy: sevenseacat may get jealous to see a fluffykat
[14:10:08] [k-: this feels dej?? vu
[14:12:33] jackjackdripper: has joined #ruby
[14:13:41] phutchins: has joined #ruby
[14:13:52] shevy: says the [k-cat
[14:14:23] gunslinger: jhass: That looks really nice, I'm still a pythonic coder so I tend to type that way but ty
[14:15:15] pafin: has joined #ruby
[14:15:27] [k-: do you want to ruby or python
[14:16:00] shevy: how about rython
[14:16:28] gunslinger: [k-: I like ruby, but I'm used to doing python. but you learn what you need to to get a job
[14:17:24] [k-: dont use python as an excuse
[14:17:31] [k-: GET ON THE RUBY BOAT!
[14:17:32] jhass: gunslinger: that looks more like java or C than python to me...
[14:18:13] jhass: in python it would be something like results = [{...} for post in posts[10:]] or idk
[14:18:14] gunslinger: It's not mine :) but mine would sorta look less rubyish TBH
[14:18:30] cashnguns: has joined #ruby
[14:18:40] gunslinger: I believe the guy who wrote it was all about that Java
[14:19:34] gunslinger: IDK why he keeps using ; at the end lol
[14:20:13] devoldmx: has joined #ruby
[14:20:44] [k-: ugh java
[14:20:58] [k-: shevy's favorite
[14:21:21] chouhoulis: has joined #ruby
[14:21:42] ruurd: has joined #ruby
[14:21:57] mhib: has joined #ruby
[14:22:52] shevy: too verbose
[14:23:11] [k-: im sure you love it!
[14:23:24] shevy: I never liked verbosity, I use e rather than puts for instance!
[14:24:48] shevy: I think it evolved historically but I no longer have the intermediary code :/
[14:24:55] gunslinger: I mean, how do you use it?
[14:24:55] [k-: puts is verbose?
[14:24:58] shevy: it had something to do with colourization
[14:25:04] shevy: yeah [k- 4 chars, inacceptable
[14:25:15] shevy: gunslinger well e 'Hello world!'
[14:25:35] [k-: shevy APL is perfect for you!
[14:25:43] shevy: I was using term-ansicolor back then
[14:26:01] shevy: e 'red'.red
[14:26:04] [k-: look, it evens take advantage of Unicode
[14:26:11] shevy: why would I need unicode
[14:26:26] jhass: I guess we should be glad that shevy only brags but never actually shares any of his code
[14:26:30] shevy: [k- I don't remember... e for echo would make sense, but I think there was some intermediary step
[14:26:59] [k-: i think o would be good for you shevy
[14:27:05] shevy: I think I may have some old backup from where I could find out
[14:27:12] [k-: o means output
[14:27:17] [k-: and it prints!
[14:27:31] chabil: has joined #ruby
[14:27:32] [k-: the o language i mean
[14:27:44] chouhoulis: has joined #ruby
[14:28:09] shevy: but e is on the left half of the keyboard
[14:28:32] gorgoroth: read(8, "/usr/bin/ruby19: Permission deni"..., 4096) = 70
[14:28:33] gorgoroth: write(9, "/usr/bin/ruby19: Permission deni"..., 70) = 70
[14:28:33] gorgoroth: write(10, "/usr/bin/ruby19: Permission deni"..., 70) = 70
[14:28:47] shevy: ack, debian
[14:29:22] jhass: gorgoroth: ls -lh /usr/bin/ruby19 /usr/local/bin/rake; whoami; or whatever the path was
[14:29:30] [k-: shevy uses puppylinux
[14:29:47] gorgoroth: -rwx------ 1 root root 5.9K Aug 9 11:29 /usr/bin/ruby19
[14:29:48] gorgoroth: -rwx------ 1 root root 452 Nov 20 2014 /usr/local/bin/rake
[14:30:03] gorgoroth: that explains a lot
[14:30:04] shevy: if anything then gobolinux but sadly it died years ago :(
[14:31:10] mago0: has joined #ruby
[14:31:16] gorgoroth: strange, I've checked that before, it seemed normal
[14:31:24] conor_: has joined #ruby
[14:31:41] gorgoroth: it worked out, thanks jhass and everyone
[14:31:48] workmad3: has joined #ruby
[14:31:49] [k-: shevy: Happy National Day Singapore!
[14:33:23] [k-: huat ah!
[14:33:53] [k-: gobolinux's latest news is 2015-02?
[14:35:32] Fluent: has joined #ruby
[14:35:59] shevy: well it's like with _why
[14:36:10] shevy: different maintainers change the identity of a project :(
[14:36:17] halcyone3: has joined #ruby
[14:36:37] shevy: I haven't tried out the non-java shoes yet though
[14:36:47] einarj: has joined #ruby
[14:37:37] shevy: https://github.com/shoes/shoes4 - wasn't there another one as well?
[14:37:49] michael_mbp: has joined #ruby
[14:38:13] gunslinger: has left #ruby: ()
[14:39:03] [k-: remove the 4?
[14:39:35] shevy: no I think this was the group that moved to shoes4 anyway
[14:39:51] einarj: has joined #ruby
[14:39:55] [k-: > jruby
[14:40:11] [k-: might as well use awt or swing
[14:40:33] shevy: I find this very confusing
[14:40:37] shevy: this blog is active too http://walkabout.mvmanila.com/
[14:40:44] shevy: "This entry was posted in Linux, OSX, Raspberry, Ruby, Shoes, Windows on August 9, 2015."
[14:40:54] DoubleMalt: has joined #ruby
[14:40:57] shevy: but I also don't think that was the other shoes I remember :\
[14:41:03] havenwood: shevy: green shoes
[14:44:37] [k-: im sure havenwood has a special place reserved in his memory for shoes :3
[14:47:17] rikkipitt: has joined #ruby
[14:48:31] [k-: k does not k
[14:48:33] sylvain31: has left #ruby: ("Leaving")
[14:48:43] sylvain31: has joined #ruby
[14:49:26] sylvain31: do you know why delegateClass is masking global scope function? example in: https://gist.github.com/Sylvain303/55c330ac6bf113711286
[14:50:03] dionysus69: has joined #ruby
[14:51:10] alphaatom: has joined #ruby
[14:54:35] [k-: test_that? isnt in the scope of the class?
[14:54:46] relix: has joined #ruby
[14:55:27] sylvain31: if the class is not a DelagateClass it is???
[14:55:54] [k-: sorry derped
[14:56:18] sylvain31: what "derped" means?
[14:56:26] [k-: it raises NoMethodError?
[14:56:55] sylvain31: delegate_class.rb:9:in `initialize': undefined method `test_that?' for module `Kernel' (NameError)
[14:56:58] Papierkorb: has joined #ruby
[14:57:45] Mon_Ouie: sylvain31: Because of the way Delegate is written, it doesn't let you call private methods unless those are defined on Kernel
[14:57:57] Mon_Ouie: Defining a top-level method is the same as defining a private instance method on the Object class
[14:58:04] Papierkorb: "a".gsub /(.)/, '\\\1' # Results in \1, but I expected \a - Is this a ruby parser bug in #gsub?
[14:58:29] Papierkorb: funny thing is, that writing '\\' '\1' yields the same result
[14:58:36] Mon_Ouie: >> "a".gsub /(.)/, '\1'
[14:58:37] ruboto: Mon_Ouie # => "a" (https://eval.in/414205)
[14:58:47] Papierkorb: >> "a".gsub /(.)/, '\\\1'
[14:58:48] ruboto: Papierkorb # => "\\1" (https://eval.in/414206)
[14:58:56] Mon_Ouie: You just quoted one too many times
[14:59:11] Papierkorb: No I didn't. I want it to return a backslash, and then the captured char
[14:59:21] Papierkorb: >> "a".gsub /(.)/, '\\1'
[14:59:22] ruboto: Papierkorb # => "a" (https://eval.in/414207)
[14:59:28] AlexRussia: has joined #ruby
[14:59:42] Mon_Ouie: Ah, then you need to escape once more :p
[14:59:59] Mon_Ouie: How would you ask gsub to literally insert a backslash followed by the character one otherwise?
[15:00:07] Papierkorb: Mon_Ouie: already tried to add a bunch of more backslashes, same result
[15:00:12] deepu: has joined #ruby
[15:00:22] casadei_: has joined #ruby
[15:00:42] Mon_Ouie: >> "a".gsub /(.)/, '\\\\\1'
[15:00:43] ruboto: Mon_Ouie # => "\\a" (https://eval.in/414211)
[15:01:16] Mon_Ouie: (You need one more backslash in the string as seen by gsub, so you need two more backslashes in your string literal)
[15:01:25] sylvain31: Mon_Ouie, ??? I see. test_that? doesn't look like a private method to me??? But I can handle that.
[15:01:31] Papierkorb: Mon_Ouie: oh well. thanks
[15:02:03] k1v4n: has joined #ruby
[15:02:15] Mon_Ouie: sylvain31: "private methods" in Ruby means you can't call them with an explicit receiver, i.e. you can't do 3.test_that? --- but you can still do test_that? when self is 3
[15:02:23] conor_: has joined #ruby
[15:04:16] sylvain31: Mon_Ouie, I would like to share the top-level method with other code too
[15:05:23] mistermocha: has joined #ruby
[15:05:36] Mon_Ouie: module Kernel; module_function; def test_that?(num); ???; end; end <- this is how most methods in Kernel are defined
[15:08:11] sylvain31: Mon_Ouie, I don't want to put it at Kernel level, I just want to be able to call it inside the DelegateClass. I found: if Object.send(:test_that?, num); ??? ; end; is working???
[15:08:18] j4cknewt: has joined #ruby
[15:08:22] workmad3: has joined #ruby
[15:08:31] Mon_Ouie: What do you mean "not put it at Kernel level"?
[15:09:09] Mon_Ouie: If you just want it inside your delegator that's where you can define it
[15:09:37] sylvain31: Mon_Ouie, I don't want to change the way the top-level method is defined, only the way to reach it inside the DelegateClass subclass with its restriction
[15:10:30] Mon_Ouie: Why is the way that the method is defined a constraint? A module function on Kernel is a valid way to define a 'global function'-like method
[15:10:51] mcgain: has joined #ruby
[15:11:11] Mon_Ouie: But yes, you can just do send(:test_that?, num) on any object if you really don't want to touch the method definition
[15:13:12] sylvain31: I can do both. But I only have one DelegateClass, the constraint is here, I will fix it here, Thank I will read the doc about "module function on Kernel", thanks
[15:13:14] ivanskie: has joined #ruby
[15:13:49] bronson: has joined #ruby
[15:16:35] calleerlandsson: has joined #ruby
[15:17:45] dardo82: has joined #ruby
[15:19:15] sylvain31: Mon_Ouie, do you know where I can find the restrictions on DelegateClass?
[15:20:03] dardo82: i have some problems with homebrew on a mac
[15:20:16] Mon_Ouie: I looked at their implementation of method_missing to understand this, I don't know if it's mentioned in the documentation
[15:20:30] dardo82: "brew tests" fails saying something about ruby
[15:21:00] dardo82: "Could not find 'bundler' (>= 0) among 29 total gem(s) (Gem::LoadError)"
[15:21:33] sylvain31: Mon_Ouie, OK thanks.
[15:21:35] dardo82: i should ask about it here or on the machomebrew channel?
[15:22:08] Mon_Ouie: dardo82: It looks like you need to 'gem install bundler'. They probably know more about the specific dependencies of homebrew though.
[15:22:09] blue_deref: has joined #ruby
[15:22:19] zarubin_: has joined #ruby
[15:23:15] jamesaxl: has joined #ruby
[15:24:18] j416_: has joined #ruby
[15:24:21] dardo82: Mon_Ouie: when i try it i get the error "Symbol not found: _SSLv2_client_method"
[15:25:22] dopie: has joined #ruby
[15:26:33] hotpancakes: has joined #ruby
[15:26:34] Mon_Ouie: Could it be that your Ruby's OpenSSL extension was linked against a incompatible version of OpenSSL?
[15:26:36] omegamike: has joined #ruby
[15:30:25] dardo82: Mon_Ouie: maybe, how i can check that?
[15:31:10] Mon_Ouie: I don't know, not very familiar with how dynamic libraries work on Mac OS X
[15:31:26] dardo82: on Google i found this, if it can be of any help: http://stackoverflow.com/questions/25492787/ruby-bundle-symbol-not-found-sslv2-client-method-loaderror
[15:31:45] Mon_Ouie: But you could try and rebuild Ruby to make sure though
[15:31:49] havenwood: dardo82: ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION'
[15:32:00] Mon_Ouie: I guess that's what they're suggesting too
[15:32:11] havenwood: aye, rebuild!
[15:32:33] havenwood: i hate that ruby-build ships its own openssl
[15:32:45] dardo82: havenwood: that command gives the same error
[15:32:53] havenwood: dardo82: ah, right
[15:33:28] havenwood: dardo82: How'd you install Ruby?
[15:34:49] michael_mbp: has joined #ruby
[15:35:53] yeticry: has joined #ruby
[15:39:03] workmad3: has joined #ruby
[15:40:23] triangles: has joined #ruby
[15:40:32] bmurt: has joined #ruby
[15:40:40] einarj: has joined #ruby
[15:41:14] dopie: has joined #ruby
[15:42:49] chinmay_dd: has joined #ruby
[15:43:53] deepu: has joined #ruby
[15:48:09] ruurd: has joined #ruby
[15:48:51] brain_shim: has joined #ruby
[15:48:54] saddad: has joined #ruby
[15:49:15] DLSteve: has joined #ruby
[15:50:59] dimasg: has joined #ruby
[15:51:01] rmoriz: has joined #ruby
[15:53:22] NeverDie: has joined #ruby
[15:53:41] TomyLobo: i want to make a hash of hashes. is there any way i can do that without having to manually initialize the first level?
[15:54:12] TomyLobo: doesnt have to be an actual hash of hashes, it can also be hash with a 2-part key
[15:54:12] wprice: has joined #ruby
[15:54:42] shevy: you could set a .default value for your hash
[15:54:59] shevy: http://ruby-doc.org/core-2.2.2/Hash.html#method-i-default
[15:55:21] shevy: hash = { "a" => 100, "b" => 200 }; hash.default = Hash.new
[15:55:50] shevy: or perhaps not :\
[15:56:10] fedexo: has joined #ruby
[15:56:31] [k-: Hash.new({})?
[15:56:58] zanloy: >> h = Hash.new({a: 1, b: 2}); puts h[:key]
[15:56:59] ruboto: zanloy # => {:a=>1, :b=>2} ...check link for more (https://eval.in/414215)
[15:57:50] [k-: it would be the same object tho
[15:59:17] zanloy: >> obj = {a: 1, b: 2}; h = Hash.new(obj); puts h[:key]; obj[:b] = 3; puts h[:key2]
[15:59:18] ruboto: zanloy # => {:a=>1, :b=>2} ...check link for more (https://eval.in/414217)
[15:59:39] zanloy: >> obj = {a: 1, b: 2}; h = Hash.new(obj); obj[:b] = 3; puts h[:key]
[15:59:40] ruboto: zanloy # => {:a=>1, :b=>3} ...check link for more (https://eval.in/414218)
[15:59:57] [k-: as i said...
[16:00:13] [k-: you need to use a proc to create the object
[16:00:23] gattuso: has left #ruby: ()
[16:00:26] jamesaxl|2: has joined #ruby
[16:02:14] havenwood: TomyLobo: The idiom is: Hash.new { |h, k| h[k] = {} }
[16:04:31] sarkyniin: has joined #ruby
[16:06:45] yxhuvud: as long as only one extra level is needed.
[16:06:50] ruurd: has joined #ruby
[16:07:00] dardo82: Mon_Ouie, havenwood: thanks ,i think i fixed it, at least regarding homebrew...
[16:08:38] freerobby: has joined #ruby
[16:09:13] [k-: Hash.new { |h, k| h[k] = h }
[16:10:07] Vile`: has joined #ruby
[16:10:15] krz: has joined #ruby
[16:10:36] sepp2k: has joined #ruby
[16:10:37] yxhuvud: [k: so regardless of how deep you go, you still end up with the same hash..
[16:11:09] Muhannad: has joined #ruby
[16:12:20] mistermocha: has joined #ruby
[16:12:25] conor_: has joined #ruby
[16:12:41] Inside: has joined #ruby
[16:12:41] Inside: has joined #ruby
[16:13:01] Muhannad: has joined #ruby
[16:13:05] [k-: its a merge thing
[16:15:22] Shoutsid: has joined #ruby
[16:18:00] JusticeFries: has left #ruby: ()
[16:18:32] djbkd: has joined #ruby
[16:20:14] conor_: has joined #ruby
[16:20:51] devoldmx: has joined #ruby
[16:21:47] Azure: has joined #ruby
[16:22:16] k1v4n_: has joined #ruby
[16:23:09] tkuchiki: has joined #ruby
[16:24:10] niemcu: has joined #ruby
[16:25:04] Respek: has joined #ruby
[16:26:02] Hanmac: has joined #ruby
[16:26:52] Zackio: has joined #ruby
[16:27:10] hotpancakes: has joined #ruby
[16:27:22] TomyLobo: yxhuvud, well if i need more than one level, you can always apply the solution recursively :)
[16:27:32] TomyLobo: infinite levels would be trickier
[16:27:35] k1v4n: has joined #ruby
[16:29:22] conor_: has joined #ruby
[16:31:21] apofis: has joined #ruby
[16:31:24] atomi: has left #ruby: ()
[16:33:47] [k-: >> lambda=->h{lambda[h[:a].merge!(h)]}[{:b => ?c}]
[16:33:48] ruboto: [k- # => undefined method `merge!' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/414223)
[16:34:07] [k-: >> lambda=->h{lambda[h[:a].merge!(h)]}[{:a => ?c}]
[16:34:08] ruboto: [k- # => undefined method `merge!' for "c":String (NoMethodError) ...check link for more (https://eval.in/414224)
[16:34:15] [k-: well whatever
[16:35:58] mago0: has joined #ruby
[16:37:13] k1v4n: has joined #ruby
[16:39:44] pawnbox: has joined #ruby
[16:41:17] [k-: https://eval.in/414236
[16:43:03] Muhannad: has joined #ruby
[16:43:44] dymk: has left #ruby: ("Leaving")
[16:43:56] lannonbr: has joined #ruby
[16:44:16] fullofcaffeine: has joined #ruby
[16:45:21] pawnbox: has joined #ruby
[16:46:30] sdwrage: has joined #ruby
[16:47:57] hotpancakes: has joined #ruby
[16:48:23] pawnbox: has joined #ruby
[16:49:05] casadei_: has joined #ruby
[16:51:28] sarkyniin: has joined #ruby
[16:51:40] leafybasil: has joined #ruby
[16:56:05] j3r0: has joined #ruby
[16:56:36] Darkwater: I'm writing an irc client, how should I handle incoming commands? a case/when block or call methods on self like on_ping, on_privmsg etc?
[16:56:40] Darkwater: what would be the msot ruby way
[16:58:08] rbennacer: has joined #ruby
[16:58:09] spacemud: has joined #ruby
[16:58:33] rehat: has joined #ruby
[16:58:42] hotpancakes: has joined #ruby
[16:58:46] jhass: just use cinch?
[16:58:56] hotpancakes: has joined #ruby
[17:01:38] Darkwater: jhass: it's not just an irc bot, it's an entire client
[17:01:45] Darkwater: so I'd like full control over everything
[17:01:51] unsymbol: has joined #ruby
[17:01:58] Darkwater: but I'll take a look at how cinch does things
[17:05:18] roolo: has joined #ruby
[17:07:01] yb_drowe: has joined #ruby
[17:07:36] sarkyniin: has joined #ruby
[17:08:06] gard: has joined #ruby
[17:08:51] conor_: has joined #ruby
[17:09:08] apt-get_: has joined #ruby
[17:09:47] [k-: i bet it would be slow!
[17:09:54] [k-: with guis and everything
[17:09:58] t_mmyv: has joined #ruby
[17:10:08] [k-: are you sure you want to do this?
[17:10:17] Darkwater: been wanting this for a while now
[17:10:22] Trynemjoel: has joined #ruby
[17:10:26] [k-: why not just a bot
[17:10:43] Darkwater: I want things
[17:10:55] [k-: a bot is a thing
[17:10:55] Darkwater: want to make yet another multichat client
[17:11:03] Darkwater: irc, telegram, steam, idk what else
[17:11:21] [k-: another protocol?
[17:11:35] Darkwater: a client that supports multiple protocols
[17:11:48] [k-: well, there are lots of things involved in making a client
[17:12:04] Darkwater: already having difficulty in deciding how to make the desktop client
[17:12:29] Darkwater: well I want the chat client to be like a daemon
[17:12:34] Darkwater: and have clients connect to that
[17:12:40] Darkwater: so it'd be like running irssi in a remote screen
[17:12:58] Darkwater: or more like that one irc client I forgot the name of
[17:13:02] [k-: i kind of think doing this in ruby is crazy
[17:13:05] [k-: oh well
[17:13:08] Darkwater: quassel does it I think
[17:13:09] omegamike: has joined #ruby
[17:13:14] Darkwater: server should be fine in ruby
[17:13:25] Darkwater: terminator is written in python and it'
[17:13:29] Darkwater: s popular (though slow)
[17:13:49] Darkwater: but hey, performance isn't a big issue for a chat client
[17:13:51] [k-: crystal? elixir?
[17:14:30] Voxxit: has joined #ruby
[17:14:38] Darkwater: "ruby-inspired syntax"
[17:14:43] Darkwater: >example is pure valid ruby
[17:14:54] yxhuvud: depends on how many users you have.
[17:15:12] Darkwater: yxhuvud: what do you mean?
[17:15:18] [k-: i think the type errors in Ruby will drive you crazy
[17:15:20] yxhuvud: server performance.
[17:15:26] k1v4n: has joined #ruby
[17:15:30] [k-: and the unit tests
[17:15:31] Darkwater: there's one user per server
[17:15:32] Darkwater: read closer
[17:16:11] [k-: type safety should be embraced
[17:16:32] [k-: it is how java is still used for enterprise today
[17:16:55] Darkwater: yeah I consider that a disadvantage of ruby
[17:17:00] dopamean_: has joined #ruby
[17:17:08] Darkwater: but I still like the language
[17:17:22] Darkwater: and I probably wouldn't complete the project if I'd write it in C++
[17:17:33] [k-: it *isnt* a disadvantage
[17:17:43] Darkwater: maybe I'll make a C++ server later
[17:18:07] [k-: go functional!
[17:18:31] [k-: a fool.
[17:18:32] Darkwater: I have little to no experience with functional programming
[17:18:50] Darkwater: and I'm not going to use this project to learn it, nor wait with this project until I've learnt it
[17:19:28] mistermocha: has joined #ruby
[17:21:34] devoldmx: has joined #ruby
[17:21:51] bnagy: p sure ruby is fast enough for the BLISTERING demands of IRC
[17:21:52] [k-: functional
[17:22:41] [k-: hop on sevenseacat express!
[17:23:46] shevy: don't follow wrong paths
[17:23:55] chinmay_dd: has joined #ruby
[17:24:10] shinnya: has joined #ruby
[17:24:55] freerobby: has joined #ruby
[17:25:03] [k-: you dont know what is better!
[17:25:23] Trynemjoel: has joined #ruby
[17:25:36] [k-: a language is neveeeer enough
[17:25:53] [k-: if i never got off javs
[17:26:02] [k-: *shudder*
[17:27:50] workmad3: has joined #ruby
[17:28:02] hotpancakes: has joined #ruby
[17:28:20] yardenbar: has joined #ruby
[17:28:29] bnagy: ruby has more or less no usable gui libs, it is crazy slow, the syntax is, tbf, awful, the testing frameworks are hipster and ridiculous
[17:28:47] bnagy: and yet, still a better language to actually write software than haskell
[17:29:48] [k-: there is unsafePerformIO for all your needs
[17:30:09] howdoicomputer: has joined #ruby
[17:30:18] [k-: as i said, elixir is also a candidate
[17:30:23] yb_drowe: has joined #ruby
[17:32:01] TomyLobo: what's a good rest client?
[17:32:06] TomyLobo: https://github.com/rest-client/rest-client this? :)
[17:32:25] iooner: has joined #ruby
[17:34:34] khebbie: has joined #ruby
[17:35:06] [k-: there is no such thing as good or bad
[17:35:23] [k-: only something that does the job sastisfactory or unsatisfactory
[17:35:59] cscheib: [k-: well, let's be truthful... there is certainly bad
[17:36:11] Vile`: has joined #ruby
[17:36:58] ght: Question: Is there any way to quickly determine if a begin...while loop is in its first iteration without having to use supplemental "is_first_loop" boolean variable or counter variable?
[17:37:42] ght: TomyLobo: We've used rest-client for years, all successfully, so yes, rest-client works perfectly fine.
[17:37:58] ght: The syntax can take some getting used to, but once you do it has worked every time so far.
[17:38:06] TomyLobo: looks fine to me
[17:38:32] [k-: ght finite (countable) loop?
[17:38:41] ght: Yeah, I've never encountered a situation where rest-client hasn't done everything we needed to do, with the exception of XMLRPC-based API endpoints.
[17:38:51] ght: [k-: No, it's not finite.
[17:38:58] TomyLobo: nah i just need json
[17:39:25] [k-: ght i dont think theres any other way then
[17:39:31] ght: [k-: Thank you.
[17:40:38] chipotles: has joined #ruby
[17:40:51] youch: has joined #ruby
[17:41:03] sdwrage: has joined #ruby
[17:41:53] ndrei: has joined #ruby
[17:42:40] Guest84: has joined #ruby
[17:44:34] TomyLobo: should i use "do |foo| end" or "{ |foo| }"?
[17:44:39] workmad3: has joined #ruby
[17:44:44] narak: has joined #ruby
[17:44:54] [k-: depends
[17:45:01] TomyLobo: are they not equivalent?
[17:45:11] Mon_Ouie: They have different precedence
[17:45:24] TomyLobo: well, for a single argument
[17:45:28] Mon_Ouie: `foo bar do |foo| end' is not the same as foo bar { |foo| }
[17:45:50] ohaibbq: has joined #ruby
[17:46:19] Mon_Ouie: Other than that, they are functionally equivalent, but people prefer one over the other in different circumnstances
[17:46:40] TomyLobo: i'd actually like it to behave more like a function argument than that special snowflake syntax with the braces :)
[17:46:49] ctalr: has joined #ruby
[17:47:02] mikecmpbll: has joined #ruby
[17:47:21] marr: has joined #ruby
[17:47:22] TomyLobo: hnnng, you're right... do..end looks kinda bad with gsub
[17:47:46] Mon_Ouie: One convention is to use do ??? end for multiple lines and { ??? } for single line. Another one is do ??? end for blocks that have side-effects (and "do" things), and { ??? } for blocks that just calculate some value. Also people tend to prefer { ??? } when chaining.
[17:48:24] basmoura_: has joined #ruby
[17:48:26] chinmay_dd: has joined #ruby
[17:48:51] TomyLobo: hmm i thought i know what you meant when you said "`foo bar do |foo| end' is not the same as foo bar { |foo| }", but i don't
[17:48:56] TomyLobo: can you elaborate?
[17:49:12] Mon_Ouie: foo bar do |foo| end is parsed as foo(bar) do |foo| ??? end
[17:49:26] Mon_Ouie: foo bar { |foo| } is parsed as foo(bar { |foo| })
[17:50:34] [k-: another convention is do..end for multiline blocks and {...} for one line (chaining)
[17:51:53] jud: has joined #ruby
[17:52:05] TomyLobo: i'll just use do..end until it fails, since that is more consistent with the other block syntaxes
[17:52:18] Inside: has joined #ruby
[17:52:18] Inside: has joined #ruby
[17:52:55] TomyLobo: but "FuseFS.main() { |options| HelloDir.new }" does look nice
[17:53:20] TomyLobo: the one line/multiple lines rule seems the most sensible
[17:53:56] Mon_Ouie: It used to be the most common one. Now I feel like the second one is somewhat more popular.
[17:54:47] [k-: ohh you mentioned it
[17:54:55] [k-: i somehow missed it
[17:55:09] Muhannad: has joined #ruby
[17:57:27] Muhannad: has joined #ruby
[17:57:31] bigbadwolf: has joined #ruby
[17:57:55] fullofcaffeine: has joined #ruby
[17:58:51] k1v4n: has joined #ruby
[17:59:03] big|bad|wolf: has joined #ruby
[17:59:22] chabil: has joined #ruby
[18:00:45] tectonic: has joined #ruby
[18:00:52] h4ckurate: has joined #ruby
[18:01:04] mclee: has joined #ruby
[18:01:37] djbkd: has joined #ruby
[18:02:18] samu: has joined #ruby
[18:02:53] samu: I have a customer running ruby-1.8.7-p374 on FreeBSD 10.2-RC3 via rvm (which should not be the case here)
[18:03:13] samu: I'm trying to install mysql2 gem for him, but the gem utility keeps complaining that it can't find the mysql.h header file
[18:03:23] havenwood: samu: Is MySQL installed?
[18:03:37] samu: yes, the devel packages are also installed
[18:03:59] samu: but because it's freebsd, the include and lib files are prefixed under /usr/local, so mysql.h is actually under /usr/local/include/mysql/mysql.h
[18:04:45] samu: now, in the gem output I can see that it tries to use /usr/local/bin/mysql_config, and that script gives the right information, the -I and -L flags point to the right directories: -I/usr/local/include/mysql and -L/usr/local/lib/mysql
[18:05:02] casadei_: has joined #ruby
[18:05:25] samu: I cannot re-create this problem under my account on the same type of server (exact same os/hardware), so I'm blindly asking for help now
[18:06:12] samu: here's the `gem install mysql2` output: https://dpaste.de/ur9g
[18:09:21] cscheib: damn irssi
[18:09:34] khapa_: has joined #ruby
[18:13:04] Musashi007: has joined #ruby
[18:13:12] samu: crap, I have to make this work somehow ;D
[18:13:51] Oka: has joined #ruby
[18:17:10] TomyLobo: () or no ()?
[18:17:17] TomyLobo: around method arguments
[18:18:24] TomyLobo: intuitively (and that intuition is informed by qbasic being the first language i ever learned), i'd say () around methods where you use the return values in some way
[18:18:35] djbkd: has joined #ruby
[18:20:03] Muhannad: has joined #ruby
[18:20:17] jhass: TomyLobo: I tend to leave them off where syntactically and semantically allowed
[18:20:43] jhass: but most keep them for at least method definitions
[18:21:05] TomyLobo: yeah i leave them for method definitions too
[18:21:24] codecop: has joined #ruby
[18:21:27] codecop_: has joined #ruby
[18:21:38] TomyLobo: i think i'll put return everywhere too, except for one-liner blocks
[18:22:02] mistermocha: has joined #ruby
[18:22:16] yh: has joined #ruby
[18:23:14] Mon_Ouie: Are you sure you understand the semantics of the keyword `return' inside blocks?
[18:23:34] Mon_Ouie: def foo; array.each { return x }; end <- this method returns the first element of array
[18:23:48] phutchins: has joined #ruby
[18:23:53] TomyLobo: yeah for all blocks then :)
[18:24:11] TomyLobo: is there any way to explicitly return a value from a block btw?
[18:24:20] Mon_Ouie: (Well if you add the missing |x| anyway)
[18:24:35] h4ckurate: has joined #ruby
[18:24:38] TomyLobo: like in a short-cut if
[18:24:38] Mon_Ouie: Yes, using `next value'
[18:25:21] Mon_Ouie: this looks misleading for blocks that aren't used to iterate over a collection, but what it really does is return to the point where the block was called
[18:26:16] TomyLobo: and especially giving a value to "next"
[18:26:56] TomyLobo: are there module-local variables?
[18:27:17] n008f4g_: has joined #ruby
[18:27:24] hotpancakes: has joined #ruby
[18:27:48] Mon_Ouie: Like @@foo? You can also simply use @foo when self is a Module (those have different semantics, of course)
[18:28:17] TomyLobo: module Routing
[18:28:17] TomyLobo: @routes = Hash.new { |h, k| h[k] = [] }
[18:28:26] havenwood: Any RVM user on OS X want to grab master and try installing Ruby 2.2.2 with the just-uploaded precompiled binary?
[18:28:58] Mon_Ouie: Depends on how you plan to use it, but yes, that could make sense
[18:29:02] havenwood: If you want to test just uninstall 2.2.2 and reinstall after a: rvm get master
[18:29:22] TomyLobo: hmm then something is wrong here...
[18:29:37] havenwood: A sanity check that it works on one other person's machine would be nice. ;)
[18:29:40] yqt: has joined #ruby
[18:29:44] jbw: has joined #ruby
[18:30:29] TomyLobo: Mon_Ouie, i'm using that from a method that is invoked from a place where the module is included
[18:30:39] TomyLobo: puts @routes shows an empty line
[18:31:54] Guest84: has joined #ruby
[18:32:04] Mon_Ouie: Since it is an instance variable, you can only directly access it when self is the Module itself, so one way to use it is to define a reader for convenience's sake and then use Routing.routes
[18:32:42] TomyLobo: but then i'd always have the module's instance, right?
[18:32:46] Mon_Ouie: In your example it seems @@routes = Hash.new { ??? } should work (it does mean that in any class where the module is included, @@routes will refer to the same hash)
[18:32:51] TomyLobo: https://gist.github.com/TomyLobo/4df7653389932341f5d1 here's the code, btw
[18:33:08] h4ckurate: has joined #ruby
[18:34:41] TomyLobo: i do want the routes to be independent when i add routes in multiple objects
[18:35:33] Mon_Ouie: Oh, okay. Do you want them to be different for each class where you include the module, or for each instance of each class?
[18:35:51] TomyLobo: basically a separate initializer for the module would be nice
[18:35:59] whiteline: has joined #ruby
[18:36:20] TomyLobo: would that be self.included?
[18:36:51] TomyLobo: def self.included(base) is what i just found on stackoverflow... but the syntax looks crude
[18:37:10] TomyLobo: base.instance_variable_set :@example_ivar, :foo
[18:37:28] Mon_Ouie: Having mixins that need their own instance variables is not easy to do, and I would generally avoid it. In this example I would just have def routes; @routes ||= Hash.new { ??? }; end and always access the instance variable through that method
[18:38:13] radgeRayden: has joined #ruby
[18:38:26] Mon_Ouie: The argument of Module#included is the class that included module. Do you want one hash per class that includes the module?
[18:38:51] TomyLobo: nope, per instance
[18:39:19] Mon_Ouie: Then the code you found wouldn't work (it sets an instance variable on the class itself)
[18:39:22] TomyLobo: i only have per-instance routes as a workaround anyway
[18:40:00] TomyLobo: i'd rather have things like "route_add :list, '/issues', to: :list_issues" in the class scope instead of the initializer
[18:40:17] TomyLobo: but still reference methods from that class
[18:40:23] Mon_Ouie: Are you aware of Module#extend? That looks like what you'd want
[18:40:36] TomyLobo: nope, lemme google it
[18:41:58] swgillespie: has joined #ruby
[18:42:08] TomyLobo: ah, yeah that sounds like it
[18:42:21] arooni-mobile: has joined #ruby
[18:43:19] arooni-mobile__: has joined #ruby
[18:43:34] TomyLobo: how do i get something into a class-specific variable there?
[18:43:45] fantazo: has joined #ruby
[18:43:53] TomyLobo: specific to the extended class
[18:44:19] conor_: has joined #ruby
[18:44:29] Mon_Ouie: From where? Inside your methods (e.g. route_add), @instance_variables will be specific to the class itself.
[18:44:37] shevy: anyone remembers offhand what ruby installs into bin/ ? I assume: ruby, irb, ri ... did I forget anything?
[18:45:00] Mon_Ouie: Don't we also have rake and gem?
[18:45:03] Kallis: has joined #ruby
[18:45:05] arooni-mobile: has joined #ruby
[18:45:26] miah: erb gem irb rake rdoc ri ruby
[18:46:02] miah: i just did a ls ~/.rubies/ruby-2.2.2/bin
[18:46:43] Mon_Ouie: That's harder to do when using your system's Ruby :p
[18:47:42] miah: who in their right mind would do that? (unless you're running archlinux) ;)
[18:48:24] Mon_Ouie: That's my case, as it happens
[18:49:02] miah: thats the case on every one of my systems apart from my work laptop (which i'm using currently)
[18:49:09] yxhuvud: mon: arch, or in your right mind?
[18:49:30] alphaatom: has joined #ruby
[18:49:46] Mon_Ouie: is that a xor?
[18:50:17] TomyLobo: some systems need ruby for system stuff
[18:50:31] TomyLobo: so you get a system ruby
[18:50:39] miah: maybe opensuse, iirc yast is rewritten in ruby now
[18:51:07] Mon_Ouie: Doesn't Mac OS X come with stuff written in Ruby? I remember it doing so.
[18:51:17] TomyLobo: that would be strange
[18:51:24] shevy: miah yeah that list looks good enough; I am trying to clean up my system so I had leftovers at /usr/bin/, but also in a versioned directory similar to your ~/.rubies (but I had like 30 entries there, from some gems what they install into bin/). Now I cleaned everything up \o/
[18:51:27] havenwood: Mon_Ouie: Aye, it does.
[18:51:27] dgutierrez1287: has joined #ruby
[18:51:29] TomyLobo: it not being a terribly open system and all
[18:53:09] shevy: was yast written in python before?
[18:53:18] shevy: I think the last time I used it was like in 2006 or something like that
[18:54:49] pawnbox: has joined #ruby
[18:55:50] miah: shevy: python iirc
[18:56:21] miah: the redhat installer 'anaconda' was also python too i have no idea if thats the case these days
[18:57:03] mozzarella: I think they moved to python 3
[18:58:22] miah: https://news.opensuse.org/2013/10/10/coming-soon-opensuse-13-1-with-yast-in-ruby/
[19:00:00] TomyLobo: http://www.railstips.org/blog/archives/2009/05/15/include-vs-extend-in-ruby/ does that "common idiom" from this 2009 article still make sense?
[19:00:04] shevy: ok I guess I misremembered... "YaST was developed in YCP ? a custom, simple, inflexible language."
[19:00:06] TomyLobo: (ctrl-f common idiom)
[19:00:15] workmad3: has joined #ruby
[19:00:43] Mon_Ouie: You still see it very often, if you need to provide class and instance methods
[19:00:51] TomyLobo: shevy, yep that sounds exactly like suse :D
[19:01:33] omegamike: has joined #ruby
[19:01:36] pawnbox: has joined #ruby
[19:01:41] shevy: "Why did you pick Ruby?" - [...] "Technically it was on par with other languages we considered (mainly Python and JavaScript/CoffeeScript), so the internal knowledge and standardization was the decisive factor."
[19:01:48] sarkyniin: has joined #ruby
[19:01:51] shevy: ruby won a rare battle! \o/
[19:02:12] aphprentice: has joined #ruby
[19:02:15] TomyLobo: by means of vendor lock-in \o/
[19:02:50] lapide_viridi: has joined #ruby
[19:03:19] fullofcaffeine: has joined #ruby
[19:03:26] shevy: well pick your poison from other distributions - like if you don't want systemd :)
[19:03:36] shevy: I am surprised that they did not pick python though
[19:03:58] TomyLobo: there's no way around systemd if you want a stable distribution anyway
[19:04:06] Respek: has joined #ruby
[19:04:19] TomyLobo: except maybe slackware or something
[19:04:27] atomical: has joined #ruby
[19:05:01] last_staff: has joined #ruby
[19:05:51] miah: or are running kernel 2.0 - 2.4
[19:06:57] wookiehangover: has joined #ruby
[19:08:06] khebbie: has joined #ruby
[19:08:57] Nieralyte: has joined #ruby
[19:09:58] yh: shevy: yeah, python always seems to win over Ruby in these debates
[19:10:09] yh: I simply don't find python as intuitive or its docs as easy to dip in & out of
[19:11:28] yh: It's a shame. It makes me view Ruby as a product with a limited shelf-life that's looming
[19:13:00] Musashi007: has joined #ruby
[19:15:28] rehat: has joined #ruby
[19:17:11] ramfjord: has joined #ruby
[19:18:57] Nieralyte: has joined #ruby
[19:20:20] darix: shevy: i think the factor that suse does many ruby projects wasnt that small either
[19:20:41] sevvie: has joined #ruby
[19:21:16] tomphp_: has joined #ruby
[19:22:24] devoldmx: has joined #ruby
[19:22:39] khebbie: has joined #ruby
[19:22:51] shevy: good! I hope their default ruby works better than the default debian ruby :D
[19:22:58] gsingh93: has joined #ruby
[19:23:39] darix: shevy: sure.
[19:24:04] darix: shevy: we even have a nice way to use additional MRI versions without rvm or so
[19:24:17] gambl0re: what is orm, haml and medis?..
[19:24:29] havenwood: gambl0re: types of sandworms
[19:24:46] shevy: darix how or where do the multiple versions get installed?
[19:24:47] dcope: has joined #ruby
[19:25:24] darix: shevy: https://discourse.nordisch.org/t/ruby-packaging-next/22
[19:25:59] yh: shevy: what's wrong with debian default ruby?
[19:26:07] darix: shevy: just normal paths. the /usr/bin/{ruby,gem} is locked to the default ruby. so you have to use the full paths for the other versions.
[19:26:10] yh: I deploy most apps to Docker so I wouldn't know
[19:26:23] shevy: hmm so you have /usr/bin/ruby2.1 too?
[19:26:31] gsingh93: i'm using rbenv for a project and i set the version to 2.1.6. when i do `bundle install` gems are installed in $GEMDIR/ruby/2.2.0. shouldn't they be installed in $GEMDIR/ruby/2.1.6?
[19:26:48] shevy: yh debian changes some paths and makes some modifications such as removes 'mkmf' by default
[19:27:23] darix: shevy: shevy: https://gist.github.com/darix/d2cae59b8ae7785d6c3d
[19:27:37] darix: shevy: mkmf belongs to the devel package
[19:27:42] darix: if i recall correctly we have that too
[19:27:44] shevy: what a strange name... /usr/bin/ruby.ruby2.2
[19:27:55] darix: oh not anymore
[19:27:58] yh: shevy: removing mkmf? Such obscure madness
[19:28:08] soxet: has joined #ruby
[19:28:15] hotpancakes: has joined #ruby
[19:28:25] darix: shevy: if i ever get it building in a rpm. i also want to have ruby.rbx2.5
[19:28:28] shevy: I guess with a rare name, conflicts would be even rarer if someone would want to use the same location at /usr/bin :)
[19:28:48] shevy: yeah that is very similar to debian
[19:28:49] darix: shevy: just consistent naming
[19:29:23] darix: gsingh93: sounds like you are using the bundle for ruby 2.2 and not 2.1
[19:29:31] darix: shevy: the discourse link explains it
[19:29:33] shevy: darix is "stat /usr/bin/ruby" a symlink?
[19:29:39] darix: shevy: hard link
[19:29:58] darix: we dont want to change the default ruby. especially when things like yast sit on top of it
[19:30:28] mistermocha: has joined #ruby
[19:30:55] gsingh93: darix: i did `rbenv global 2.1.6; gem install bundler`
[19:31:08] gsingh93: shouldn't that give me the 2.1 version?
[19:31:17] myztic: has joined #ruby
[19:31:46] darix: shevy: so i run rails apps on top of 2.2 on a system with 2.1 as default without any problems. (and yes all dependencies packaged ^^)
[19:31:49] shevy: jhass I may have finally found a use case for UTF-8 - animated dancing unicode icons \o/
[19:31:51] havenwood: gambl0re: Asking for real?
[19:32:02] shevy: jhass http://jsfiddle.net/mnpenner/gm86u2jv/3/ the bottom right ones
[19:34:03] nfk: has joined #ruby
[19:34:47] kallisti5: any devs have a chance to review this pull request? https://github.com/ruby/ruby/pull/984
[19:35:23] havenwood: kallisti5: You might also try in #ruby-core though there's not much traffic there.
[19:35:26] robbyoconnor: has joined #ruby
[19:35:35] kallisti5: havenwood: thanks :-)
[19:35:49] kallisti5: ACTION hates to be the squeeky wheel... but it is such a simple patch lol
[19:35:55] Respek: has joined #ruby
[19:36:07] h4ckurate: has joined #ruby
[19:36:19] Respek: has joined #ruby
[19:36:46] havenwood: kallisti5: keep on squeezing! :)
[19:38:37] Musashi007: has joined #ruby
[19:42:45] dimasg: has joined #ruby
[19:42:54] phutchins: has joined #ruby
[19:43:05] dcope: how come gsub(/\w+/i) won't catch strings with spaces?
[19:43:17] brain_shim: has joined #ruby
[19:43:45] dcope: for example, https://repl.it/BAyK the words "lime green" isn't caught.
[19:43:55] MyMind: has joined #ruby
[19:44:31] ascarter: has joined #ruby
[19:44:37] chabil: has joined #ruby
[19:47:09] Musashi007: has joined #ruby
[19:50:05] ndrei: has joined #ruby
[19:52:22] radgeRayden: has joined #ruby
[19:53:29] triangles: dcope: \w only matches on letters, numbers, and _
[19:54:07] triangles: instead of \w, use [\w\s]
[19:54:43] brnpcn: has joined #ruby
[19:55:54] dcope: triangles: that seems to match every single letter
[19:56:08] dcope: gsub(/[\w\s]/i)
[19:56:12] Mendenhall: has joined #ruby
[19:57:01] nymous: has joined #ruby
[19:57:05] bodgix: has joined #ruby
[19:57:09] nymous: hey folks
[19:57:15] nymous: quick question
[19:57:29] nymous: is there a way to write something like this shorter?
[19:57:41] nymous: root.elements['//TEMPLATE/MEMORY'].nil? ? 0 : root.elements['//TEMPLATE/MEMORY'].cdatas[0].value
[19:58:29] apeiros: nymous: on rails/with active support you can use .try
[19:58:42] nymous: i have only plain ruby
[19:58:51] apeiros: without that, all I see is that you could use 2 statements instead of 1:
[19:59:09] wprice: nymous: you could write it laying on your stomach???sorry, bad joke???
[19:59:09] apeiros: memory = root.elements['//TEMPLATE/MEMORY']; memory ? memory.cdatas[0].value : 0
[19:59:16] yfeldblum: has joined #ruby
[19:59:47] nymous: i need to go through several xml entries, so i don't think adding too much variables would improve readability
[19:59:50] tvw: has joined #ruby
[20:01:06] dcope: triangles: ok i found an ugly solution... but it works! :)
[20:01:29] sdwrage: has joined #ruby
[20:01:34] apeiros: nymous: add your own .try then. maybe a specialized variant for your case of "if present, dig deeper, else use default"
[20:02:25] gsingh93: how do i install bundler for ruby 2.1? i'm using rbenv, and i install bundler with `gem install bundler`, but `bundle env` says it's using ruby 2.2
[20:04:02] Trynemjoel: has joined #ruby
[20:05:04] cornerma1: has joined #ruby
[20:06:02] apeiros: nymous: in this case also maybe possible - query cdatas[0] in your xpath. not sure whether that's at all possible, though. my xpath isn't that good :)
[20:09:31] nymous: the problem is i need to query xml for a value, but it might not exist at all
[20:09:48] ndrei: has joined #ruby
[20:10:45] sarmiena_: has joined #ruby
[20:11:24] sarmiena_: i???m experiencing a segfault with a ruby gem (twilio-ruby) when trying to run it in a threaded environment (sidekiq)
[20:11:24] dseitz: has joined #ruby
[20:11:39] skade: has joined #ruby
[20:11:54] sarmiena_: the guys here are saying to put a global mutex lock around twilio, but having a hard time figuring out where to do that
[20:12:32] dimasg: has joined #ruby
[20:12:41] apeiros: nymous: why's that a problem? xpath will return nil in that case
[20:12:55] apeiros: which you can easily map to your default vaue via `xpath || default`
[20:16:23] Nahra: has joined #ruby
[20:16:29] gsingh93: i really need some help here, i've been stuck on this for an hour. bundler keeps installing gems in ruby/2.2.0, i can't figure out why
[20:19:52] h4ckurate: has joined #ruby
[20:20:13] nymous: apeiros: you mean something like memory = root.elements['//TEMPLATE/MEMORY'] || "0"?
[20:21:37] Jarboe: has joined #ruby
[20:22:24] jhass: gsingh93: I believe there's an #rbenv
[20:22:42] jhass: wait, there isn't?
[20:22:47] havenwood: jhass: nope
[20:22:50] jhass: how disappointing
[20:22:58] jhass: I guess nobody actually uses it :P
[20:23:04] havenwood: jhass: #rvm or #chruby but tweet @DHH for rbenv support
[20:23:05] devoldmx: has joined #ruby
[20:23:43] jhass: I mean there could be at least a community supported one
[20:24:29] mary5030: has joined #ruby
[20:25:48] hotpancakes: has joined #ruby
[20:26:52] sdwrage: has joined #ruby
[20:27:02] dseitz: has joined #ruby
[20:27:43] apeiros: nymous: yes, except a) to have the .cadatas[0] part of the xpath and b) your original has 0, not "0" as default
[20:27:44] jhass: gsingh93: you're through the standard troubleshooting? check rbenv is properly loaded, actually thinks the right ruby is selected, 2.1 is the first ruby in your path etc?
[20:28:07] gsingh93: jhass: yea, ruby -v, gem -v, which ruby, and which gem all look right
[20:28:21] gsingh93: point to the rbenv version of ruby, 2.1.6
[20:28:23] havenwood: gsingh93: and rehashed your shims?
[20:28:24] einarj: has joined #ruby
[20:28:33] havenwood: gsingh93: switch to chruby.
[20:28:37] jhass: what about which bundle?
[20:30:13] ndrei: has joined #ruby
[20:30:21] gsingh93: i'm on archlinux, i have ruby-bundler installed which adds /usr/bin/bundle which selects the correct version of bundler from ~/.gems
[20:30:27] gsingh93: and in .gems i only have one version of bundler
[20:30:30] gsingh93: 10.6 i believe
[20:30:57] gsingh93: i'll give chruby a shot
[20:31:23] havenwood: gsingh93: https://gist.github.com/jhass/8839655bb038e829fba1
[20:31:35] bronson: has joined #ruby
[20:31:47] lapide_viridi: has joined #ruby
[20:33:02] mistermocha: has joined #ruby
[20:33:29] shevy: ohhh I just realized
[20:33:32] shevy: gist allows .md files
[20:34:54] TomyLobo: i have this in an extend method body: hash[:to] = self.method(hash[:to])
[20:35:14] TomyLobo: this cant find a method of the extended class
[20:35:25] TomyLobo: not without the "self." either
[20:36:15] jhass: gsingh93: ruby-bundler hardcodes /usr/bin/ruby into the hashbang, but your rbenv should put a different bundle script in front of it into your $PATH
[20:36:26] baweaver: has joined #ruby
[20:37:04] jhass: however if ruby -v is correct you can probably workaround with ruby -S bundle
[20:37:06] willharrison: has joined #ruby
[20:37:30] jhass: ?code TomyLobo
[20:37:30] ruboto: TomyLobo, We can't help you without your code, please post it to https://gist.github.com
[20:38:26] Ox0dea: has joined #ruby
[20:38:41] Ox0dea: TomyLobo: Module#extended takes an argument that you should use.
[20:38:42] gsingh93: i completely forgot about the hashbang
[20:39:03] gsingh93: rbenv doesn't provide a bundler shim
[20:39:20] brain_shim: has joined #ruby
[20:39:42] jhass: it should
[20:39:42] TomyLobo: >> module Foo def foo() self.method(:bar) end class Bar extend Foo def bar end end Bar.new.foo()
[20:39:43] ruboto: TomyLobo # => /tmp/execpad-7debe4650287/source-7debe4650287:2: syntax error, unexpected keyword_class, expecting k ...check link for more (https://eval.in/414371)
[20:39:44] pollyprissypants: has joined #ruby
[20:39:58] TomyLobo: >> module Foo def foo() self.method(:bar) end end class Bar extend Foo def bar end end Bar.new.foo()
[20:39:59] ruboto: TomyLobo # => /tmp/execpad-6b0908a24586/source-6b0908a24586:2: syntax error, unexpected keyword_class, expecting k ...check link for more (https://eval.in/414372)
[20:40:05] gsingh93: jhass: i tried changing the hashbang to /usr/bin/env ruby and it worked
[20:40:07] Ox0dea: ?experiment TomyLobo
[20:40:08] ruboto: TomyLobo, Please use your local irb or pry (see ?pry) to experiment, ruboto's eval functionality is for demonstration purposes only.
[20:40:11] TomyLobo: i give up. i'll try that argument
[20:40:20] gsingh93: although that's not really a proper solution, given that it's a system installed file
[20:40:22] jhass: gsingh93: meh, that'll break with the next bundler update
[20:40:25] gsingh93: but at least i know the problem now
[20:40:45] Ox0dea: TomyLobo: Module#extended and/or #super_method seem to be the methods you're looking for.
[20:40:49] jhass: now you know why nobody uses rbenv :P
[20:41:20] TomyLobo: undefined method `super_method' for HelloDir:Class
[20:41:51] jhass: too old ruby? it's new in 2.2 iirc
[20:42:00] TomyLobo: that might be why :)
[20:42:08] Ox0dea: TomyLobo: https://gist.github.com/0x0dea/19494c27b088c5d54710
[20:42:09] TomyLobo: i dont want to require more than 2.0 anyway
[20:42:37] TomyLobo: Ox0dea, what's p?
[20:42:41] Ox0dea: This guy.
[20:42:45] h4ckurate: has joined #ruby
[20:42:50] jhass: puts obj.inspect; obj
[20:43:06] jhass: that's pretty much the definition of p
[20:43:32] Ox0dea: You're supposed to learn about that method on day one. :/
[20:43:46] TomyLobo: i guess i must have missed it :)
[20:43:46] jhass: yeah, too many people debug with puts instead of p
[20:43:56] shevy: I use double power
[20:44:08] jhass: no, the tutorials don't mention it, the ones I've seen at least
[20:44:16] Ox0dea: That's ridiculous.
[20:44:22] shevy: pp must be superior because it is included by default
[20:44:22] ap4y: has joined #ruby
[20:44:31] DoubleMalt: has joined #ruby
[20:44:32] jhass: most tutorials are fairly ridiculous
[20:44:39] Ox0dea: shevy: Sounds like you want faster horses.
[20:44:44] shevy: I want flying pigs
[20:44:56] jhass: why not spider pigs?
[20:44:59] apeiros: shevy: travel back a couple of hundred years and you'll have them
[20:45:12] shevy: I don't like spiders that much :\
[20:45:15] apeiros: though I think flying cows were more popular. also usually cadavers.
[20:45:53] apeiros: (medieval siege tactics)
[20:45:57] Ox0dea: > With sufficient thrust, pigs fly just fine.
[20:45:59] Ox0dea: https://tools.ietf.org/html/rfc1925
[20:46:28] shevy: don't say you read that ...
[20:46:36] Mon_Ouie: I like pp because any class can change how it is displayed simply by redefining #pretty_inspect and some libraries do so for their own classes. Last time I used ap you couldn't easily change how it handled custom classes and it didn't fall back on pp's behavior for objects it didn't know how to print.
[20:46:52] shevy: you have way too much time available Ox0dea!
[20:47:17] Ox0dea: You seem to have concluded that I've read all the RFCs.
[20:47:28] shevy: you read a pig rfc!
[20:47:53] Mon_Ouie: Just read all the April's Fools RFCs
[20:48:05] shevy: I missed the date :(
[20:48:22] Mon_Ouie: I AM A TEAPOT
[20:48:28] Ox0dea: IPoAC is best 4/1 RFC.
[20:48:57] workmad3: has joined #ruby
[20:49:35] apeiros: IPoAC can actually reach quite high bandwidths. but latency sucks.
[20:49:43] omegamike: has joined #ruby
[20:49:55] saddad: has joined #ruby
[20:50:11] yardenbar: has joined #ruby
[20:51:43] einarj: has joined #ruby
[20:52:37] TomyLobo: it's the modem of animal-borne communication protocols
[20:52:57] TomyLobo: dialup modem*
[20:53:10] Zggb: has joined #ruby
[20:54:16] mcgain_: has joined #ruby
[20:55:02] mcgain_: has joined #ruby
[20:55:25] ellisTAA: has joined #ruby
[20:55:28] pollyprissypants: has left #ruby: ("Leaving")
[20:55:38] TomyLobo: Ox0dea, so what do i do with the reference to the method? i cant store it with the class because i cant get a reference to that class later on (which is kind of the initial problem)
[20:55:39] Mon_Ouie: I think that, to achieve high bandwidths, you have to violate the Frame Format suggested by the RFC, which means your implementation is not compatible with compliant avian carrier receptors.
[20:56:05] TomyLobo: and i cant store it with the module, since i dont get a separate instance per class (or do i?)
[20:59:48] brnpcn: has joined #ruby
[20:59:55] fullofcaffeine: has joined #ruby
[21:03:10] Ox0dea: TomyLobo: You can always get a reference to any class.
[21:03:15] arup_r: has joined #ruby
[21:03:19] Ox0dea: Could you perhaps clarify what exactly you're trying to do?
[21:03:30] mary5030: has joined #ruby
[21:04:26] fullofca_: has joined #ruby
[21:04:27] lannonbr: has joined #ruby
[21:06:02] Yzguy: has joined #ruby
[21:06:24] Ox0dea: TomyLobo: Also, nobody seems to have shown you autovivifying Hashes:
[21:06:26] Ox0dea: >> auto = Hash.new { |h, k| h[k] = Hash.new &h.default_proc }; auto[1][2][3] = 4; auto
[21:06:27] ruboto: Ox0dea # => {1=>{2=>{3=>4}}} (https://eval.in/414374)
[21:06:51] twistedpixels: has joined #ruby
[21:07:28] doosy: has joined #ruby
[21:07:34] twistedpixels: has joined #ruby
[21:07:45] TomyLobo: that's what i meant with "a little more complicated" :)
[21:07:53] northfurr: has joined #ruby
[21:09:37] Ox0dea: Only just.
[21:10:16] MatthewsFace: has joined #ruby
[21:11:22] TomyLobo: >> module M; def mm(); puts method(:cm); end; end; class C; C.extend M; def cm(); puts 'cm'; end; mm; end
[21:11:24] ruboto: TomyLobo # => undefined method `cm' for class `Class' (NameError) ...check link for more (https://eval.in/414375)
[21:11:39] TomyLobo: i want to get cm by name, from mm
[21:11:47] apeiros: TomyLobo: extend adds class methods
[21:11:51] apeiros: not instance methods
[21:12:15] j4cknewt: has joined #ruby
[21:12:18] TomyLobo: so i cant even get an unbound method?
[21:12:24] apeiros: ah, i see, you are using it as a class method, but you query for a class method
[21:12:33] Ox0dea: TomyLobo: I showed you how to do so?
[21:12:53] apeiros: A.method(:foo) gives you the method you'd call as A.foo
[21:13:07] TomyLobo: i dont have A
[21:13:22] TomyLobo: i'm in a module's method
[21:13:26] apeiros: C.method(:cm) gives you the method you'd call as C.cm
[21:13:39] apeiros: you don't define a method C.cm. You define a method C.new.cm. an instance method.
[21:13:49] TomyLobo: yeah i dont have C either, unless i get that as "self"... let me check
[21:13:51] apeiros: yes, you're in a module's method which you added as a class method.
[21:14:03] apeiros: right. there. in. your. own. friggin. example.
[21:14:54] TomyLobo: in that example i threw stuff together the way i thought it could work and got an error telling me it doesn't
[21:15:15] tomphp_: has joined #ruby
[21:15:22] apeiros: and I told you why. but you don't seem to be interested in the reasons.
[21:15:28] apeiros: ACTION off, better stuff to do.
[21:15:36] mago0: has joined #ruby
[21:16:04] TomyLobo: oh, now i get what you're saying
[21:16:39] TomyLobo: sorry, was a bit thick there
[21:17:19] f4cl3y__: has joined #ruby
[21:18:02] TomyLobo: >> module M; def mm(); puts instance_method(:cm); end; end; class C; C.extend M; def cm(); puts 'cm'; end; mm; end
[21:18:03] ruboto: TomyLobo # => #<UnboundMethod: C#cm> ...check link for more (https://eval.in/414376)
[21:18:19] blue_deref: has joined #ruby
[21:19:04] shellie_: has joined #ruby
[21:19:58] nofxx: has joined #ruby
[21:20:01] sdwrage: has joined #ruby
[21:22:35] vdamewood: has joined #ruby
[21:22:51] skade: has joined #ruby
[21:29:02] dimasg: has joined #ruby
[21:31:45] TomyLobo: >> module M; def mm(); @mv = 'mvvalue'; end; end; class C; extend M; def cm(); puts @@mv; end; mm; end; C.new.cm
[21:31:47] ruboto: TomyLobo # => uninitialized class variable @@mv in C (NameError) ...check link for more (https://eval.in/414377)
[21:32:57] TomyLobo: does this mean an instance variable of the class isnt the same as a class variable or am i doing something wrong?
[21:32:58] hotpancakes: has joined #ruby
[21:32:59] elton: has joined #ruby
[21:34:05] Ox0dea: TomyLobo: Instance variables are for instances.
[21:34:33] TomyLobo: Ox0dea, but classes are first-class object, right?
[21:35:33] Ox0dea: Methods can accept and return classes, sure, but I fail to see the relevance in this case.
[21:36:21] dented42: has joined #ruby
[21:36:34] Ox0dea: Instance variables are never "shared"; that would sort of defeat the purpose.
[21:36:39] TomyLobo: well within that invocation of "mm", self is C. i checked. so i should be able to set C's instance variables with @name=value
[21:36:56] Ox0dea: Literal instance variables go on self.
[21:37:17] TomyLobo: i meant C's, not C.new's
[21:38:05] TomyLobo: and as i said, self is C
[21:38:16] sargas: has joined #ruby
[21:38:25] TomyLobo: >> module M; def mm(); puts self == C; @mv = 'mvvalue'; end; end; class C; extend M; def cm(); puts @@mv; end; mm; end; C.new.cm
[21:38:26] ruboto: TomyLobo # => true ...check link for more (https://eval.in/414378)
[21:38:50] devoldmx: has joined #ruby
[21:40:42] Ox0dea: TomyLobo: You're putting the instance variable on C, not instances of C.
[21:41:58] Motoservo: has joined #ruby
[21:44:26] rehat_: has joined #ruby
[21:46:11] yardenbar: has joined #ruby
[21:48:40] h4ckurate: has joined #ruby
[21:49:36] BTRE: has joined #ruby
[21:52:32] tkuchiki: has joined #ruby
[21:52:39] exadeci: has joined #ruby
[21:53:15] shevy: he also mixes @mv with @@mv
[21:53:24] Rinzlit1: has joined #ruby
[21:53:42] Ox0dea: Yes, but I think that was intentional, evincing his confusion.
[22:00:00] nahtnam: has joined #ruby
[22:00:18] f4cl3y__: has joined #ruby
[22:04:27] doosy_: has joined #ruby
[22:05:21] Ann: has joined #ruby
[22:06:20] Yzguy: has joined #ruby
[22:06:22] Ann: has joined #ruby
[22:06:22] ellisTAA: has joined #ruby
[22:08:41] Ann: has joined #ruby
[22:09:58] Ann: has joined #ruby
[22:10:55] workmad3: has joined #ruby
[22:11:22] mcgain: has joined #ruby
[22:11:23] Ann: has joined #ruby
[22:12:07] tkuchiki: has joined #ruby
[22:12:47] Ann: has joined #ruby
[22:14:30] Ann: has joined #ruby
[22:15:07] Ann: has joined #ruby
[22:15:55] Ann: has joined #ruby
[22:16:47] Ann: has joined #ruby
[22:17:28] Ann: has joined #ruby
[22:17:53] Ann: has joined #ruby
[22:18:27] Ann: has joined #ruby
[22:19:12] Trynemjoel: has joined #ruby
[22:21:04] ohaibbq: has joined #ruby
[22:21:20] ahuman: has joined #ruby
[22:22:21] Inside: Hey guys ~ web server question here.
[22:23:12] Inside: Um.... I... am not understanding what roles rack/nginx/rails/etc serve; ie: how the whole stack works together
[22:23:42] Inside: Anyone have a link to an article bookmarked that explains it all in general terms since I can't seem to find anything that explains it
[22:24:12] apeiros: Inside: one example - browser sends request to server, server is nginx. nginx figures the request is handled by rack, dispatches request to rack. rack dispatches to rails.
[22:24:50] apeiros: and rack is the layer between webserver and framework. like a database independence layer for databases.
[22:25:22] Inside: okay so something like WEbrick serves as both nginx/rack?
[22:25:33] apeiros: webrick serves as nginx
[22:25:39] apeiros: rack is still in there
[22:25:46] Inside: ACTION scratches his head.
[22:25:46] apeiros: just that there you could have ruby without rack in between
[22:26:07] apeiros: rack still serves the same purpose - it makes all webservers look the same to the webframework.
[22:26:24] havenwood: Inside: Optional Reverse Proxy (Nginx, Apache, etc.) -> Rack webserver (WEBrick default or Thin, Puma, Unicorn, Rainbows!, Passenger or Reel-Rack) -> Rack and optional Rack Middleware -> optional Rack adapter (Rails, Sinatra, Roda, Cuba, Lotus, Padrino, NYNY, Hobbit, Ramaze, Camping, Scorched, etc.)
[22:26:54] lordkryss: has joined #ruby
[22:27:04] ahuman: has joined #ruby
[22:27:04] allcentury: has joined #ruby
[22:27:30] devbug: has joined #ruby
[22:27:49] havenwood: Inside: Maybe try making a plain vanilla Rack app.
[22:28:32] Inside: Yeah, I'm trying to create a super simple website and while I have experience with rails (it seems to "just work" for me), I want to figure out how all this works.
[22:28:46] j4cknewt: has joined #ruby
[22:28:55] Inside: I think I even spoke to you a couple of days ago :P
[22:29:01] apeiros: Inside: or from the other side: rack makes all webframeworks look the same to the webserver
[22:29:13] apeiros: as said, it works similar to how a DBI works for databases.
[22:29:16] havenwood: Inside: Rails is one of many optional Rack adapters.
[22:29:22] Inside: well, I get that
[22:29:27] havenwood: Inside: You can not use a Rack adapter at all and make a pure Rack app.
[22:29:28] Inside: from your example :D
[22:30:06] apeiros: and middleware fits into that picture as stuff the request goes through before or after reaching the webframework
[22:31:39] Inside: and why do we want middleware?
[22:32:03] apeiros: because you don't want to code against each webframework but still have shared interests
[22:32:31] apeiros: take a look at some existing middleware. many things are not framework specific.
[22:32:47] shazaum_: has joined #ruby
[22:37:16] mistermocha: has joined #ruby
[22:37:38] shellie_: has left #ruby: ()
[22:39:35] devoldmx: has joined #ruby
[22:40:50] mistermo_: has joined #ruby
[22:40:59] Pisuke: has joined #ruby
[22:41:01] workmad3: has joined #ruby
[22:43:13] Yzguy: anyone got a moment to look at my code for a sec, can't figure out why it won't print
[22:43:17] Yzguy: value from optprase
[22:43:21] Inside: So... looks like it's up to the webserver to take in data over the socket and then turn it into a rack environment hash
[22:43:22] Inside: interesting
[22:43:42] Radar: Yzguy: !gist
[22:43:42] helpa: Yzguy: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:43:44] Radar: Yzguy: ?gist
[22:43:47] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[22:44:03] Inside: but then the question is - if the popular webservers already smoosh everything into a rack environment info hash, why not just push that to the application? :P
[22:44:05] Yzguy: https://gist.github.com/yzguy/a8300524def339a13241
[22:44:19] Yzguy: it only outputs " , "
[22:46:04] dtcristo: has joined #ruby
[22:46:30] Inside: that's weird
[22:47:24] Yzguy: I'm probably missing something basic, but just trying to dabble with ruby
[22:47:27] Mendenhall: has joined #ruby
[22:47:32] Yzguy: and can't seem to figure it out
[22:47:51] Symbiosisz: has joined #ruby
[22:48:27] perturbation: has joined #ruby
[22:48:49] ruby-lang853: has joined #ruby
[22:49:02] arooni-mobile: has joined #ruby
[22:49:45] Inside: has something to do with how you're specifying the options to .on()
[22:50:31] arooni-mobile__: has joined #ruby
[22:51:51] ruby-lang853: hey @rob_ can u pm me please.
[22:52:10] arooni-mobile: has joined #ruby
[22:52:18] Inside: actually I have no idea
[22:52:20] Inside: this baffles me.
[22:52:49] Yzguy: needs to be like
[22:52:53] Yzguy: --first FIRST
[22:52:55] Yzguy: or it won't work
[22:53:09] Inside: cause --first means no argument
[22:53:13] Inside: > http://docs.ruby-lang.org/en/2.1.0/OptionParser.html#method-i-make_switch
[22:53:35] Yzguy: :P well guess we both learned something
[22:53:41] Inside: "Long style switch:" specifies a long style switch which takes a mandatory, optional, or no argument.
[22:53:49] Inside: wump wump
[22:55:03] sdwrage: has joined #ruby
[22:56:05] Yzguy: boom, tis working :D
[22:58:12] Inside: come baaack
[22:58:47] dgutierrez1287: has joined #ruby
[22:59:09] brnpcn: has joined #ruby
[22:59:14] CanTonic: has joined #ruby
[23:00:42] Ox0dea: Well, that wasn't very wise.
[23:03:26] iamninja: has joined #ruby
[23:06:33] dgutierrez1287: has joined #ruby
[23:06:36] mikefulcher: has joined #ruby
[23:07:06] Inside: hmmm.. after reading up on how thin runs, a bit more of rail starts to sorta almost make sense
[23:07:28] DanielI: has joined #ruby
[23:09:02] DanielI: has joined #ruby
[23:09:12] sarkyniin: has joined #ruby
[23:09:37] mrf: has joined #ruby
[23:10:40] j4cknewt: has joined #ruby
[23:10:41] allcentury: has joined #ruby
[23:12:14] basmoura: has joined #ruby
[23:12:25] shevy: Ox0dea why does this not work at parse time :( http://pastie.org/10340551
[23:12:54] whiteline: has joined #ruby
[23:14:01] Ox0dea: Inside: I was punning on Yzguy's nick.
[23:14:10] Inside: ACTION pokerface.
[23:15:37] Ox0dea: shevy: Foo[:one] isn't a method...
[23:15:42] Axy: has joined #ruby
[23:15:42] Axy: has joined #ruby
[23:15:46] Yzguy: has joined #ruby
[23:15:53] Ox0dea: Blocks can only be attached to method calls.
[23:16:06] shevy: but but but ... [] !
[23:16:20] Ox0dea: Yeah, I see what you mean now.
[23:16:37] Ox0dea: Foo.[](i) { :two } works, so I guess your example should too.
[23:16:46] shevy: ah you mean with the .
[23:16:46] GeissT: has joined #ruby
[23:17:10] shevy: sneaky method calls that hide the .
[23:17:18] baroquebobcat: has joined #ruby
[23:17:25] Ox0dea: Very sneaky. Sexy syntax uber alles, though.
[23:17:39] simoz1111117: has joined #ruby
[23:17:53] shevy: how many method invocations can avoid the . by default? [] ? would -> also count to that? anything else?
[23:19:03] Ox0dea: >> 1.+(2) # shevy
[23:19:04] ruboto: Ox0dea # => 3 (https://eval.in/414414)
[23:19:11] Ox0dea: There are so many implicit method calls.
[23:19:34] Rinzlit: Does ruboto remember strings?
[23:19:36] rasengan: has joined #ruby
[23:19:39] Ox0dea: Of course not.
[23:19:44] shevy: so ... [] -> + - / * ^ ...
[23:20:21] Rinzlit: Oh, and I found out metasploit was made with ruby
[23:20:37] Rinzlit: I must try harder to learn ruby! :D
[23:20:46] Ox0dea: >> Fixnum.instance_methods.select { |m| m[/^\W+$/] } # shevy
[23:20:47] ruboto: Ox0dea # => [:-@, :+, :-, :*, :/, :%, :**, :==, :===, :<=>, :>, :>=, :<, :<=, :~, :&, :|, :^, :[], :<<, :>>, :+@ ...check link for more (https://eval.in/414415)
[23:20:49] shevy: what a strange way to get to fame
[23:20:55] shevy: metasploit
[23:21:03] Ox0dea: Why strange?
[23:21:06] shevy: why not code for love and peace instead
[23:21:15] Ox0dea: Whitehats use msf.
[23:21:22] Rinzlit: shevy that sounds wonderful but I doubt that makes as much money
[23:21:24] shevy: what is -@ ?
[23:21:28] Ox0dea: Unary minus.
[23:21:37] shevy: half of those things look like smileys
[23:21:41] Ox0dea: >> class Foo; def -@; :foo end end; -Foo.new
[23:21:42] ruboto: Ox0dea # => :foo (https://eval.in/414416)
[23:21:48] brnpcn: has joined #ruby
[23:23:47] Rinzlit: Ox0dea, what is msf? I couldn't find it from duckduckgo
[23:23:56] Ox0dea: This guy.
[23:23:59] dgutierrez1287: has joined #ruby
[23:24:09] Ropeney: has joined #ruby
[23:24:21] michael_mbp: has joined #ruby
[23:24:24] Ox0dea: It's what people who actually use Metasploit call Metasploit.
[23:24:56] Rinzlit: Ox0dea, I just wanna learn to be a badass script kiddie D:
[23:25:04] Ox0dea: How tragic.
[23:25:23] Rinzlit: shevy php is harder and doesn't get paid as much .-.
[23:25:23] Inside: Ox0dea: so if my app has two seperate functions (web server request->attached printer prints something and on database update->automatically print something) which don't really talk to each other than to start up/shutdown together, should I just like run thin in one thread and then run the automatic printer in another?
[23:25:58] Ox0dea: Inside: If you're really sure they don't need to coordinate, that should do.
[23:26:10] Inside: I don't get why it took me that long to come to that conclusion, haha.
[23:31:38] mago0: has joined #ruby
[23:32:29] whiteline: has joined #ruby
[23:32:47] lannonbr: has joined #ruby
[23:34:31] rehat: has joined #ruby
[23:36:40] ecksit: has joined #ruby
[23:37:07] _blizzy_: has joined #ruby
[23:37:11] ecksit: heya, where is the documentation on what `%()` is? i found some docs on `%q()` but nothing on it
[23:38:00] Mon_Ouie: %(???) is like %Q(???)
[23:40:50] ecksit: is it an alias? or "like"
[23:41:38] shevy: >> %( abc )
[23:41:39] ruboto: shevy # => " abc " (https://eval.in/414419)
[23:41:41] shevy: >> %Q( abc )
[23:41:42] ruboto: shevy # => " abc " (https://eval.in/414420)
[23:41:51] shevy: looks to be identical so I would assume it is an alias
[23:42:26] Mon_Ouie: They behave in exactly the same way in all regards (escaping, string interpolation, which characters you can use to delimit the strings, ???)
[23:44:28] mistermocha: has joined #ruby
[23:44:46] _blizzy_: has joined #ruby
[23:45:18] Maletor: has joined #ruby
[23:46:35] Vile`: has joined #ruby
[23:47:47] baroquebobcat: has joined #ruby
[23:48:23] dgutierrez1287: has joined #ruby
[23:48:53] Channel6: has joined #ruby
[23:50:40] mistermocha: has joined #ruby
[23:52:50] Ox0dea: >> %{this is } + %}insane}
[23:52:51] ruboto: Ox0dea # => "this is insane" (https://eval.in/414421)
[23:53:40] Mon_Ouie: I also like that you can still use '{' and '}' inside those strings, as long as they are paired up correctly
[23:53:56] charliesome: has joined #ruby
[23:54:38] workmad3: has joined #ruby
[23:54:40] duoi: has joined #ruby
[23:54:50] yh: has joined #ruby
[23:55:36] Ox0dea: >> %'a''b' # sneaky
[23:55:37] ruboto: Ox0dea # => "ab" (https://eval.in/414422)
[23:56:04] Klumben: has joined #ruby
[23:58:09] eam: Ox0dea: now that's interesting, string literals only statically concat when the second one is "" or ''? But not %{} ?
[23:58:17] eam: (but the first can be?)
[23:58:23] eam: seems like a bug
[23:58:26] rbennacer: has joined #ruby
[23:58:27] Ox0dea: Could well be.
[23:59:06] shevy: two detective cats investigate on the scene
[23:59:09] Mon_Ouie: The problem with %{} as the second one is it's going to be parsed as a call to the '%' method followed by what could be a hash
[23:59:55] Mon_Ouie: As it happens String#% followed by a hash even makes sense
[23:59:56] Ox0dea: Aye, that String#% is a thing means 'a'%'b' really shouldn't do concatenation.
[23:59:59] eam: Mon_Ouie: %{} is string literal in the parser, yeah?