apeiros changed the topic of #ruby to: Rules & more: http://ruby-community.com || Ruby 2.2.2; 2.1.6; 2.0.0-p645: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
lwu has quit [Ping timeout: 246 seconds]
Kallis has joined #ruby
Kallis has quit [Max SendQ exceeded]
decoponio has joined #ruby
sdwrage has joined #ruby
pepperbreath1 has quit [Ping timeout: 272 seconds]
lwu has joined #ruby
Silox| has quit [Quit: Connection closed for inactivity]
pepperbreath has joined #ruby
paulcsmith has joined #ruby
millerti has quit [Read error: Connection reset by peer]
choke has joined #ruby
Kallis has joined #ruby
mistermocha has joined #ruby
deject3d has joined #ruby
paulcsmith has quit [Ping timeout: 246 seconds]
choke has quit [Client Quit]
<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'
<nofxx> $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) solves but its ugly change the bin =/
nngrey has joined #ruby
choke has joined #ruby
mistermocha has quit [Ping timeout: 252 seconds]
mary5030 has joined #ruby
arooni-mobile has joined #ruby
choke has quit [Client Quit]
nngrey has quit [Remote host closed the connection]
arooni-mobile__ has joined #ruby
h4ckurate has quit [Quit: h4ckurate]
choke has joined #ruby
<shevy> I usually define the path to the gem-directory
<shevy> PROJECT_BASE_DIRECTORY = RbConfig::CONFIG['sitelibdir']+'/name_of_gem/'
<shevy> there is a similar, slightly different solution
<shevy> I think it was either using __FILE__ ... or Pathname
bronson has joined #ruby
exadeci has quit [Quit: Connection closed for inactivity]
lannonbr has joined #ruby
<nofxx> shevy, where that goes ? PROJECT_BASE_DIRECTORY
<shevy> I put it into the main namespace of the gem
malnek has joined #ruby
<shevy> like if the gem-name is foobar, I usually have: module Foobar; and inside there, that constant
workmad3 has joined #ruby
<shevy> you have an executable?
<nofxx> shevy, yup
<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
<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
<shevy> no idea, I never needed to manipulate load path so far for gems, neither my own or other people's gem
<shevy> and you are right, that long line is very ugly :)
<Ox0dea> nofxx: Are you not using Bundler?
bronson has quit [Ping timeout: 245 seconds]
phutchins has quit [Ping timeout: 260 seconds]
tennis_ has joined #ruby
<nofxx> Ox0dea, I not sure it'll work in this hacked scenario of mine: did a dirty change and just want to test it
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nofxx> It loads the git repo from where you are on terminal, so the scneario is: ~/git/gem/bin/foo . (on another folder)
<Ox0dea> Lovely. :P
sarmiena_ has joined #ruby
harushimo has quit [Quit: Leaving]
<nofxx> hehe =D but I'll spec it to commit , rest sure Ox0dea
<Ox0dea> nofxx: You intend to release this gem that looks for a specific Git repository on the user's system?
workmad3 has quit [Ping timeout: 244 seconds]
<nofxx> Ox0dea, actually it's released. I'm fixing and adding features =D https://github.com/gittalk/git-issues
gamename has quit [Ping timeout: 252 seconds]
mdavid613 has joined #ruby
<sarmiena_> Hi. I’m getting this error when trying to install ruby: $ rvm install --autolibs=openssl 2.2
<sarmiena_> Searching for binary rubies, this might take some time.
<sarmiena_> No binary rubies available for: ubuntu/12.04/i386/ruby-2.2.2.
<sarmiena_> but if i do it without —autolibs it works. what gives?
Overand has quit [Remote host closed the connection]
<havenwood> sarmiena_: There would still be no binary available. Is there some other error?
<nofxx> sarmiena_, use the repo.. bright.. someone will help or google
<nofxx> there's NO need for RVM for developing/using ruby
<nofxx> sarmiena_, plus no compiling, just download from apt and run. The way it should be.
<sarmiena_> nofxx sorry i don’t follow what you’re saying
<havenwood> sarmiena_: Is this for development or production?
<havenwood> sarmiena_: Do you need to be able to switch Rubies?
hotpancakes has quit [Remote host closed the connection]
<sarmiena_> havenwood: yeah i do need to switch rubies
<havenwood> Only MRI?
<havenwood> sarmiena_: Production or development?
<nofxx> sarmiena_, between versions?
<sarmiena_> yeah.
einarj has quit [Remote host closed the connection]
<Ox0dea> ya all dat plz halp
<nofxx> sarmiena_, out of curiosity, why?
<nofxx> really old rails projects? =D
doritostains has joined #ruby
<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?
Liam` has quit [Ping timeout: 244 seconds]
<Ox0dea> sarmiena_: Why RVM?
<havenwood> sarmiena_: The precompiled binaries for 2.2.2 haven't been uploaded yet. They have been for 2.2.1.
<sarmiena_> nofxx: before we upgrade ruby, we like to install version & gemset. allows for easy rollback in event of something we hadn’t considered
<havenwood> sarmiena_: If you want to compile and not use the precompiled binary: --disable-binary
<havenwood> which is what happens anyways
<nofxx> sarmiena_, I'd say use a CI for that.
<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
<nofxx> gitlab-ci* btw
ramfjord has joined #ruby
deject3d has quit [Quit: Computer has gone to sleep.]
devoldmx has joined #ruby
<sarmiena_> i see
deject3d has joined #ruby
<nofxx> sarmiena_, that way neither dev or production needs to worry with rvm
PhantomSpank has quit []
h4ckurate has joined #ruby
Kallis has quit [Read error: Connection reset by peer]
Encapsulation has joined #ruby
chouhoulis has joined #ruby
deject3d has quit [Client Quit]
devoldmx has quit [Ping timeout: 250 seconds]
mdavid613 has quit [Quit: Leaving.]
bruno-_ has quit [Ping timeout: 250 seconds]
Cronon has quit [Read error: Connection reset by peer]
Liam` has joined #ruby
Cronon has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
neurotech has joined #ruby
<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?
zanloy has quit [Ping timeout: 240 seconds]
<wmoxam> neurotech: it's certainly a popular and well supported way to do it
<havenwood> neurotech: chruby is a very nice alternative
hotpancakes has joined #ruby
<neurotech> Ah neat. Thanks
chouhoulis has joined #ruby
mary5030 has quit [Remote host closed the connection]
arooni-mobile has quit [Ping timeout: 246 seconds]
j75 has joined #ruby
mary5030 has joined #ruby
arooni-mobile__ has quit [Ping timeout: 244 seconds]
deject3d has joined #ruby
malnek has quit [Quit: WeeChat 1.1.1]
j3r0 has joined #ruby
djbkd has quit [Quit: Leaving...]
shock_one has joined #ruby
<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
mary5030 has quit [Ping timeout: 244 seconds]
<Ox0dea> But... why?
<j75> just curious how it can be done
<Ox0dea> j75: Do you just not know about Ruby's -e flag?
<j75> yes but and -a
<j75> but i can't seem to get them to pick it up in my .bashrc function
<Ox0dea> I'm afraid I don't follow.
shock_on_ has joined #ruby
basmoura has quit [Remote host closed the connection]
<Ox0dea> j75: <<-'EORUBY' ... EORUBY, if you really must.
shock_on_ has quit [Remote host closed the connection]
<j75> .bashrc allows for functions: f() {echo $1} when you run 'f test' from the terminal it will then just output test.
<j75> how do i get <<- 'EORUBY' ... EORUBY to access arguments like $1
<Ox0dea> j75: ARGV?
<j75> doesn't seem to want to read it
deepu has joined #ruby
shock_one has quit [Ping timeout: 240 seconds]
<j75> it puts a size of 0
<j75> it's not actually getting the arguments
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<j75> I tried /usr/bin/env ruby <<-EORUBYputs ARGV.sizeputs ARGV.classEORUBY}
deepu has quit [Client Quit]
tennis_ has quit []
<shevy> can this work? ARGV is only available within a .rb file isn't it?
saddad has quit [Ping timeout: 246 seconds]
jester13 has joined #ruby
<shevy> could you not invoke a ruby script directly by the way, from bash? and just pass it the arguments?
j3r0 has quit [Ping timeout: 246 seconds]
<Ox0dea> j75: Perhaps you might explain why you think you need to do it this way?
sarkyniin has quit [Ping timeout: 250 seconds]
j3r0 has joined #ruby
<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
<Ox0dea> But... why? :'(
<j75> to easily move .bashrc between setups without having to remember where different files are that's all
<shevy> you made Ox0dea so sad now
Vile` has quit [Ping timeout: 265 seconds]
arooni-mobile__ has joined #ruby
arooni-mobile has joined #ruby
<j75> Ox0dea you are the man thanks! wouldn't not have thought to put $@ after EOR
hyy has joined #ruby
<j75> would not*
<Ox0dea> Happy to help.
<hyy> What's the Ruby equivalent for https://docs.python.org/2/library/socketserver.html
Vile` has joined #ruby
<hyy> bathroom brea
<hyy> break
mistermocha has joined #ruby
omegamike has joined #ruby
saddad has joined #ruby
arooni-mobile has quit [Ping timeout: 244 seconds]
arooni-mobile__ has quit [Ping timeout: 244 seconds]
<Ox0dea> hyy: Still in the bathroom?
<hyy> 0x0dea: I'm back :)
<Ox0dea> >> require 'socket'; ObjectSpace.each_object(Class).select { |c| c.to_s[/Socket$/] }
<ruboto> Ox0dea # => [UNIXSocket, UDPSocket, TCPSocket, IPSocket, Socket, BasicSocket] (https://eval.in/414074)
mistermocha has quit [Ping timeout: 255 seconds]
<Ox0dea> loop { case socket.gets; when foo; end } to turn them into "servers". :P
Synthead has joined #ruby
jasonbeale has quit [Remote host closed the connection]
casadei_ has joined #ruby
<hyy> how do I write a guide for myself to learn Ruby well enough for my router to boot this little program?
<hyy> or receive this file
<shevy> just create a class that does the functionality you require
<hyy> TFTPSender
h4ckurate has quit [Quit: h4ckurate]
dorei has quit []
<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
<shevy> Ox0dea lol I just realized the title you used in the shell script... retarded.sh
omegamike has quit [Ping timeout: 245 seconds]
<Ox0dea> Si vicium in calceus.
<hyy> I'd laugh if you guys pointed me to a learning resource
<hyy> learning the very basics
polyrob- is now known as polyrob
polyrob has quit [Changing host]
polyrob has joined #ruby
pepperbreath has quit [Ping timeout: 250 seconds]
kith_ has joined #ruby
fella7s has joined #ruby
omfgtora_ has joined #ruby
Rinzlit1 has joined #ruby
casadei_ has quit [Ping timeout: 244 seconds]
polyrob has left #ruby ["Leaving"]
tenseiten has joined #ruby
tenseiten has joined #ruby
<hyy> 0x0dea: LOL!
<neurotech> What is the recommended gem for running an HTTP server? I'm looking for the ruby equivalent of hapi or express on node
omfgToRA has quit [Read error: Connection reset by peer]
<Ox0dea> neurotech: Everything uses WEBrick.
<neurotech> Right. Typically on node I would put my app(s) behind an nginx reverse proxy
<hyy> I'm ticked. No book.
<Ox0dea> "Ticked"?
<hyy> ok I'm not angry. But I want that book.
<shevy> hyy https://pine.fm/LearnToProgram/chap_01.html is still ok; for books, try the pickaxe3
<hyy> thank you!
<neurotech> Is WEBrick part of the standard library?
<Ox0dea> Yep.
scorp007 has quit [Ping timeout: 256 seconds]
seitensei has quit [Ping timeout: 256 seconds]
fella6s has quit [Ping timeout: 256 seconds]
kith has quit [Ping timeout: 256 seconds]
<shevy> but it seems as if they stopped to write new books about ruby since then :(
<Ox0dea> Eloquent Ruby > Pickaxe.
j3r0 has quit [Read error: Connection reset by peer]
Rinzlit has quit [Ping timeout: 256 seconds]
<neurotech> What sites/resources does everyone use to stay up to date with what's happening with the language?
<shevy> I look at the changelog :)
<shevy> and ask havenwood
<shevy> those are my two main resources
<Ox0dea> neurotech: The language itself, or library development?
<neurotech> This? https://changelog.com/
<Ox0dea> shevy: There's a typo in [k-'s docfix. :/
<shevy> lol
<shevy> I COULD FIX THAT
<neurotech> Ox0dea: The culture, the community, stuff happening etc
<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
<nofxx> neurotech, you're inside of it
<neurotech> I'm thinking of stuff like http://www.echojs.com/
<shevy> don't think we have that
<shevy> I guess javascript outgrew ruby :(
charliesome has joined #ruby
<shevy> 1163 on #javascript
<shevy> neurotech but really ask havenwood here every once in a while, he has some mystic resources
dimasg has joined #ruby
<nofxx> neurotech, I remember ruby-inside, check it on my mail once in a while
<neurotech> Okay cool. Thanks all
j3r0 has joined #ruby
<nofxx> neurotech, and github.. explore/ruby
ap4y has quit [Remote host closed the connection]
countryHick has joined #ruby
FernandoBasso has quit [Quit: May the force be with you.]
einarj has joined #ruby
lwu has quit [Ping timeout: 252 seconds]
lwu has joined #ruby
<neurotech> nofxx: It looks like there isn't a ruby section on GH explore
<nofxx> neurotech, trending/stars/showcase something like it?
<nofxx> should be a filter somewhere on the sidebar iirc
paulcsmith has joined #ruby
<nofxx> neurotech, trending
poguez_ has quit [Quit: Connection closed for inactivity]
devoldmx has joined #ruby
einarj has quit [Ping timeout: 244 seconds]
arooni-mobile__ has joined #ruby
<neurotech> ah yes. Thanks!
arooni-mobile has joined #ruby
tmtwd has quit [Ping timeout: 265 seconds]
bruno- has joined #ruby
paulcsmith has quit [Ping timeout: 244 seconds]
arooni-mobile__ has quit [Max SendQ exceeded]
devoldmx has quit [Ping timeout: 246 seconds]
arooni-mobile__ has joined #ruby
deject3d has quit [Remote host closed the connection]
mesamoo has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
<Ox0dea> >> !@THEqQUICKbBROWNfFXjJMPSvVLAZYDGgkyz&[%r{\"}mosx,4>6]|?'while(putc 3_0-~$.+=9/2^5;)<18*7and:`#
<ruboto> Ox0dea # => !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~nil (https://eval.in/414077)
<Ox0dea> That program prints and contains each non-control ASCII character exactly once.
pepperbreath has joined #ruby
sarmiena_ has quit [Quit: sarmiena_]
Musashi007 has quit [Quit: Musashi007]
djbkd has joined #ruby
Vile` has quit [Ping timeout: 265 seconds]
hahuang65 has quit [Quit: Connection closed for inactivity]
Musashi007 has joined #ruby
dtcristo has joined #ruby
Oka has quit [Quit: さようなら]
Vile` has joined #ruby
myztic has quit [Ping timeout: 240 seconds]
[k- has joined #ruby
Vile` has quit [Ping timeout: 240 seconds]
dented42 has joined #ruby
chipotle has joined #ruby
GarethAdams has quit [Ping timeout: 256 seconds]
Caius has quit [Ping timeout: 256 seconds]
iamninja has quit [Ping timeout: 260 seconds]
tmtwd has joined #ruby
j4cknewt has joined #ruby
GarethAdams has joined #ruby
Caius has joined #ruby
workmad3 has joined #ruby
noethics has quit [Quit: Leaving]
myztic has joined #ruby
Synthead has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 244 seconds]
r0bby_ is now known as robbyoconnor
mistermocha has quit [Ping timeout: 256 seconds]
sarmiena_ has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
sarmiena_ has quit [Client Quit]
havenwood has quit [Ping timeout: 264 seconds]
lwu has quit [Quit: This computer has gone to sleep]
arooni-mobile__ has quit [Ping timeout: 244 seconds]
arooni-mobile has quit [Ping timeout: 244 seconds]
dopie has joined #ruby
LiquidInsect has joined #ruby
casadei_ has joined #ruby
mago0 has quit [Ping timeout: 264 seconds]
choke has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
casadei_ has quit [Ping timeout: 260 seconds]
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
_blizzy_ has quit [Ping timeout: 246 seconds]
dgutierrez1287 has quit [Remote host closed the connection]
jonee has joined #ruby
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Synthead has joined #ruby
serivich has joined #ruby
fullofcaffeine has joined #ruby
<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.
dinasor is now known as pyon
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
<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
The_Phoenix has joined #ruby
serivich has quit [Client Quit]
The_Phoenix has quit [Read error: Connection reset by peer]
<Antiarc> fatal error: 'ruby/config.h' file not found <-- you need ruby-devel or equivalent development headers installed on your system
<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.
<cscheib> lemme fire up xcode to see if there's extra crap I can install.
arooni-mobile has joined #ruby
arooni-mobile__ has joined #ruby
<Antiarc> "To install them, you need to install the Xcode Tools package."
<cscheib> yea, which I've installed
spacemud has quit [Ping timeout: 272 seconds]
<Antiarc> (I don't use OS X, I won't be much further help)
pepperbreath has quit [Ping timeout: 255 seconds]
<Antiarc> `xcode-select --install` apparently helps
<cscheib> installing xcode installs the tools (these days)
<cscheib> you can either install just the tools or all of xcode
<cscheib> which xcode-select --install gets you
<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
spacemud has joined #ruby
<cscheib> (of note: this is a system that was on non-beta before, and everything was working fine and dandy)
tkuchiki has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
dtcristo has joined #ruby
h4ckurate has joined #ruby
CatMartyn has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
The_Phoenix has joined #ruby
<cscheib> I'll probably just move back to 10.10 tomorrow
<Ox0dea> Downgrading is for quitters.
saddad has quit [Ping timeout: 260 seconds]
* [k- downgrades [k-
bmurt has joined #ruby
<cscheib> agreed... but, I use boxen to configure my dev environment on my laptop, and I'd rather not manually configure everything.
darkf has joined #ruby
<[k-> ^
gix has quit [Ping timeout: 244 seconds]
<[k-> configuring is for people who like challenges!
stoodfarback has joined #ruby
<[k-> i prefer everything to be done for me
<shevy> [k-
braincrash has quit [Quit: bye bye]
<[k-> PONG: [k-
dseitz has joined #ruby
<shevy> Ox0dea> shevy: There's a typo in [k-'s docfix. :/
<shevy> if I fix your typo then we would be on equal commit-parity
PVico has quit [Quit: Page closed]
<cscheib> [k-: the trolling is unnecessary.
<[k-> that is actually a real fact about me
<[k-> go ahead shevy!
<shevy> I don't know how to do it though
<cscheib> nevermind then. felt like trolling
<[k-> sorry
<[k-> shevy: just fork documenting-ruby
gix has joined #ruby
<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
<cscheib> spent a lot of time working on my boxen/puppet shit, so it wasn't really done for me... but I agree
<[k-> and make changes
<[k-> and pr!
<cscheib> Radar: only things I've really had issues with are the Box drive client and... this
<Radar> cscheib: We spent 4 hours trying to figure out how to install Poltergeist and then found some obscure instructions somewhere that fixed it.
braincrash has joined #ruby
<Radar> I personally like to wait for OS releases like the normal folk
<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)
<cscheib> so I usually run betas, unless there's something critically wrong
cashnguns has quit [Ping timeout: 244 seconds]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<cscheib> the only issue switching is re-generating all of my keys/one-time-passwords
ThaiWood has quit [Quit: leaving]
Synthead has quit [Ping timeout: 244 seconds]
ccbn has joined #ruby
pepperbreath has joined #ruby
iamninja has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
j4cknewt has quit [Remote host closed the connection]
sdothum has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
dopie has quit [Quit: This computer has gone to sleep]
vdamewood has quit [Quit: Life beckons.]
ramfjord has joined #ruby
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jorgevaldez has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
jonee has quit [Ping timeout: 272 seconds]
<jorgevaldez> Hi, is there anyone from Japan here? Please send me a private message
<Ox0dea> Ohaiou gozaimasu!
devoldmx has joined #ruby
<Ox0dea> I can't even into Weeaboo. :/
<[k-> Fauxwapanese!
Synthead has joined #ruby
sphex_ has quit [Ping timeout: 250 seconds]
sphex has joined #ruby
<Ox0dea> jorgevaldez: Watashi no puroguramu wa doko desu ka.
<jorgevaldez> what? english please?
<Ox0dea> This guy.
fedexo has joined #ruby
<Radar> Is that... I am a programmer, what do you do?
* Radar knows no Japanese
<[k-> what if i wanted to do 5 <=> 1 <= 6
<Ox0dea> [k-: Then you can fuck right offf.
<Ox0dea> "off and only off"
<[k-> :>
<Ox0dea> Radar: I said "Where is my program?".
jackjackdripper has joined #ruby
<[k-> i still dont see && at all?
<Radar> Ox0dea: ok, I am terrible at interpreting then :D
<Ox0dea> [k-: ":>" is the syntax for Tab in LOLCODE.
<Ox0dea> [k-: Why do you think an && is necessary?
dopie has joined #ruby
<[k-> self && prev.send (...)?
<[k-> you must make sure both sides are true?
devoldmx has quit [Ping timeout: 244 seconds]
<Ox0dea> [k-: You're misunderstanding the call to `super`, I reckon.
<[k-> much misunderstand
<Mon_Ouie> That's nasty and kind of cool
jorgevaldez has quit []
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<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.
<Ox0dea> [k-: Rinse and repeat.
jorgevaldez has joined #ruby
baweaver has joined #ruby
Synthead has quit [Ping timeout: 244 seconds]
countryHick has quit [Quit: Connection closed for inactivity]
<Ox0dea> But yeah, you didn't misunderstand the `super`, just... all the other madness.
<Mon_Ouie> Of course the problem with floats is that 1e500 <= 1e400
<Ox0dea> Aye, needs more BigDecimal.
<[k-> this is supposed to be false
<[k-> 2 is not between 3 and 4
<[k-> this is what i am sayinf
<Ox0dea> Oh, right.
<[k-> yea!
<Ox0dea> Stick a `return false unless self` in there somewhere.
<[k-> i didnt even need to run it!
<Mon_Ouie> Or just define each operation in FalseClass to return false
ccbn has left #ruby [#ruby]
<[k-> you didnt even test!
<[k-> much dismay
mrod has joined #ruby
pepperbreath has quit [Ping timeout: 256 seconds]
<[k-> i even have to write code to prove my point!
<Ox0dea> > and instance
<Ox0dea> ^.^
<[k-> this is in violation of the [k--[k--[k--Ox0dea agreement
<Ox0dea> In any case, refining Booleans is insane.
<Ox0dea> Probably not as bad as this !== I've added to my local trunk, though.
<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
<Ox0dea> Everything works, but I'm having trouble pinning down the semantics, which I suppose would explain its nonexistence.
<Ox0dea> ?guys jorgevaldez
<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?
<Radar> jorgevaldez: Why do you need someone who speaks both English and Japanese?
<Ox0dea> To translate, obviously.
<Radar> but to translate wht?
<jorgevaldez> ok sorry about the guys thing :)
<[k-> self || send(...)
<Ox0dea> Early exit = high performance.
tkuchiki has quit [Remote host closed the connection]
<[k-> yes, exactly
<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.
saddad has joined #ruby
<Ox0dea> mrod: Use ActionCable!
bmurt has quit []
<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
Aww is now known as NotAww
<mrod> Thanks Ox0dea , I'll check it out
<[k-> this is not related to Ruby
NotAww is now known as Aww
<[k-> you can search somewhere else!
<[k-> off you go!
Aww has left #ruby ["Leaving"]
<Ox0dea> jorgevaldez: Stahp.
<[k-> this is like wayyyy off topic
<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
<[k-> just because Matz is japanese doesnt mean this is related!
<jorgevaldez> yeah i know, lol
<Ox0dea> So lacist.
<Ox0dea> *racist
<[k-> so, english-japanese people elsewhere arent intelligent?
<Ox0dea> Sorry, L and R are right next to each other on my Colemak keyboard.
<jorgevaldez> wtf? that was meant as a compliment for this channel
<[k-> Congrats, Ox0dea, you are an intelligent anglo-japanese!
<Ox0dea> Onoes!
danieli has joined #ruby
<Ox0dea> I didn't make any preparations for having my ass kissed this evening.
<[k-> jorgevaldez: some things *shouldn't* be said
jeadr has joined #ruby
<[k-> watashi [k- desu!
jorgevaldez has left #ruby [#ruby]
<Ox0dea> [k-: I once wrote a function for determining the number of common bits between two integers.
<Ox0dea> In the lambda calculus.
<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
pepperbreath has joined #ruby
<[k-> i have no concept of what bits are, but ok
jonee has joined #ruby
<Ox0dea> [k-: That's so weird, dude.
<[k-> we are young!
<Ox0dea> mrod: Your camera's flash a shit.
<mrod> Ox0dea: What?
<Ox0dea> mrod: What sort of error(s) are you getting?
bmurt has joined #ruby
workmad3 has joined #ruby
<Ox0dea> [k-: Positional number systems should be *really* easy to understand for somebody who already groks the essentials of programming. :/
<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.
<Ox0dea> More guns doesn't make shooting in the dark any more likely to bear fruit.
<Ox0dea> Never mind why we're firing at apple trees.
gix has quit [Ping timeout: 265 seconds]
<[k-> it's not like there is a list of things programmers should know :/
<Ox0dea> Radices are just applied addition, exponentiation, and modular division, doe.
<[k-> do O levels cover that?
bmurt has quit [Ping timeout: 260 seconds]
jester13 has quit [Quit: ChatZilla 0.9.91.1 [Firefox 39.0.3/20150806001005]]
workmad3 has quit [Ping timeout: 264 seconds]
gix has joined #ruby
iamjarvo has joined #ruby
wldcordeiro_ has quit [Remote host closed the connection]
iamjarvo has quit [Client Quit]
tkuchiki has joined #ruby
<[k-> welp, doesnt look like it's in my syllabus
lannonbr has quit [Quit: WeeChat 1.2]
<Ox0dea> [k-: Schoogle admits new students instantaneously and covers the broadest possible range of subjects.
msnyon has quit [Quit: Textual IRC Client: www.textualapp.com]
<Ox0dea> > mfw when of course that's a real thing
<[k-> but i would have to attend TWO! schools
<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.
<Ox0dea> I'd like to generalize it, but storing other's class in $2 (to maintain thread-safety) wouldn't suffice.
<Ox0dea> There's no generalized way to instantiate objects from strings.
<[k-> Thread.current[:things]
* [k- knocks Ox0dea's head
jonee has quit [Ping timeout: 252 seconds]
<Ox0dea> I'm going to use a module variable and you can't stop me.
<[k-> but that isnt safe!
* [k- waits for a "your face" comment
<Ox0dea> Thread#[]= is just another way to spell global variables.
<[k-> but it is thread local
<heftig> fiber local
wldcordeiro_ has joined #ruby
<Ox0dea> But anybody can access it at any time.
<[k-> Thread.current changes for the current thread
<Ox0dea> I'm aware.
<[k-> anyone can access $1 at any time
pepperbreath has quit [Ping timeout: 244 seconds]
<Ox0dea> But that's a scope-local variable.
jackjackdripper has quit [Quit: Leaving.]
<[k-> anyone can access module variables at any time
<Ox0dea> U LIE!
<[k-> ruby is a reflective language!
<Ox0dea> We're not supposed to have to namespace our variables in not-C.
djbkd has quit [Quit: Leaving...]
<heftig> fiber-locals are used for recursion guards, for example
sepp2k has quit [Read error: Connection reset by peer]
iateadonut has joined #ruby
<[k-> what do you mean namespacing variables
j3r0 has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
<Ox0dea> [k-: If I used Thread#[], I'd have to stick some arbitrary prefix on the variable names.
<Ox0dea> Arbitrarity is worst arity.
<[k-> why not (Your Module Name Here)
Ann has joined #ruby
zz_Outlastsheep has joined #ruby
<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. :/
iamninja has quit [Read error: Connection reset by peer]
<Ox0dea> >> Symbol.all_symbols.grep(/core#/).sort.first
<ruboto> Ox0dea # => :"core#define_method" (https://eval.in/414099)
<Ox0dea> It'd be cake if nobu hadn't gimped FrozenCore.
iamninja has joined #ruby
<Ox0dea> NOBU, Y U DO DIS?
chouhoulis has quit [Ping timeout: 246 seconds]
<[k-> Gimped
<[k-> The practice of making software run poorly on a compatitor's hardware.
mistermocha has quit [Ping timeout: 244 seconds]
<[k-> hm
wldcordeiro_ has quit [Ping timeout: 246 seconds]
<[k-> gimped
<[k-> "messed up", "broken",
blue_deref has quit [Quit: bbn]
<Ox0dea> "Made less useful".
tmtwd has quit [Remote host closed the connection]
<[k-> u2cmplx4me
<hyy> ok guys I need a starting resource for ruby, something to get me started
<[k-> this is ridiculously long
<Ox0dea> [k-: I linked to the relevant lines!
krz has joined #ruby
<Ox0dea> You need a GitHub app or some shit.
hyy has quit [Remote host closed the connection]
<[k-> hide the Singleton
<[k-> whatever that means
hyyper has joined #ruby
Peterzky has joined #ruby
<hyyper> my IRC client crashed
hyyper is now known as hyy
<Ox0dea> [k-: It means it's virtually impossible to hook #core#define_method, which is the method that gets called when methods get defined.
<Ox0dea> Still don't really understand why he did it. :'(
michael_mbp has quit [Excess Flood]
<[k-> why dont you just get the owners to do it themselves
<[k-> classes are open anyway
<Ox0dea> [k-: Huh? How do I refine classes I don't know about?
<[k-> get the owner to do it!
<hyy> I need a starting out guide to Ruby for beginner programmers
<Ox0dea> hyy: No, you don't. You need a book.
<Ox0dea> We've discussed this.
<Ox0dea> [k-: Not sexy (read: magical) enough.
<hyy> then crap, which book do I buy? I'm ready to buy anything
Peterzky has quit [Client Quit]
<[k-> Ox0dea: stupid statw
<Ox0dea> hyy: Project Gutenberg is having a sale this weekend.
<[k-> state
<[k-> ?links
<[k-> ?books
<ruboto> I don't know anything about books
<Ox0dea> apeiros: ^
<Radar> hyy: !twgr
<Radar> hyy: The Well Grounded Rubyist is a good starting book.
<Radar> hyy: so is Chris Pine's Learn to Program.
<[k-> i am well grounded arent i? /s
mary5030 has joined #ruby
michael_mbp has joined #ruby
tmtwd has joined #ruby
<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
tmtwd has quit [Client Quit]
<mrod> Looks like a block isn't getting passed through somewhere but I can't tell where.
<[k-> you aren't supplying the right arguments then
<hyy> 0x0dea: which books do they have on sale?
<Radar> hyy: please ignore Ox0dea. They are in a troll-y mood.
<[k-> Ox0dea: your gender seems suspicious to Radar
atomi has quit [Ping timeout: 252 seconds]
jonee has joined #ruby
<hyy> LINUX MUST HAVE COME
<slani> can I get value neseted hash kpi[:average]
<slani> => {"Sun, 09 Aug 2015"=>0.4539780114845019}
<slani> without loop
atomi has joined #ruby
<mrod> I think it's a bug in em-priority-queue
<hyy> Radar, book suggestion please?
<[k-> kpi[:average]["Sun, 09 Aug 2015"]
<Radar> hyy: I suggested two books. Scroll up.
<hyy> k
<[k-> yes?
<slani> [k-: I' don't know a date
<Radar> [k-: drunk?
<[k-> Radar: that's what he wanted!
jackjackdripper has joined #ruby
<[k-> slani: what do you want to achieve
<Radar> slani: input + expected output polease
<Radar> please*
<[k-> your code will be subjected to policing
<[k-> :>
<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.
<Radar> slani: Code or ban
<Radar> oops i mean "or I will be upset" sorry typo
arescorpio has joined #ruby
<hyy> Radar, like this? \Radar
<[k-> &ri Hash#each Hash#values Hash#pop Hash#values_at Hash#[] Hash#fetch Hash#fetch!
* Radar has entered the land of crazy it seems
Respek has joined #ruby
<[k-> there are literally hundreds of ways to get a value
<[k-> please be more specific
* Radar has an idea
* hyy must buy Learn to Program by Chris Pine
Shibo has quit [Read error: Connection reset by peer]
mrod has quit [Quit: Page closed]
<Radar> Stop suggesting answers until you know the question?
jonee has quit [Ping timeout: 250 seconds]
* Radar approves of Radar's idea
<Ox0dea> Simmer down, gals.
<Radar> For it is better to let people think you're a fool than to type into an IRC channel and remove all doubt.
<Ox0dea> "Speak only that you would improve the silence."
pepperbreath has joined #ruby
<[k-> Radar: stop suggestings answers until you know the question!
* [k- nods
<Radar> Who's next?
<Ox0dea> I'll go with him.
<Radar> [k- is clearly off their rocker and is being disruptive.
<Radar> Great. Take it to #ruby-offtopic if you would kindly :)
<Ox0dea> I think you and him just aren't on the same wavelength. :/
omegamike has joined #ruby
jud has quit [Quit: Leaving]
<Ox0dea> Radar: Could you clarify which of [k-'s messages you deemed to be "disruptive"?
* bnagy sigh
<Radar> [14:47:08] <[k->your code will be subjected to policing
<Radar> [14:49:17] <[k->&ri Hash#each Hash#values Hash#pop Hash#values_at Hash#[] Hash#fetch Hash#fetch!
<Radar> etc.
bronson has joined #ruby
<Radar> Those are not useful comments to be making.
ivanskie has joined #ruby
<Radar> 15 minute timeout.
<Radar> slani: Do you have code you can share with us?
dgutierrez1287 has joined #ruby
<slani> Radar: i don't have code
<slani> I just have a hash
<Radar> slani: that's code.
<slani> Radar: :D
<slani> ok
danieli has quit [Quit: *does an epic backflip into nowhere*]
<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?
psy_ has quit [Remote host closed the connection]
amcoder has joined #ruby
<Radar> nofxx: steps to reproduce plz
<nofxx> Radar, well, if you could just install that gem
<Radar> aha
<nofxx> hehe
<Radar> hard for me to reproduce then :)
<nofxx> but boring... =/
<nofxx> but rly, lost 2 hours already... put a binding.pry in every line from that to httparty
<Radar> nofxx: Same versions of httparty on both machines?
danieli has joined #ruby
<nofxx> yes, freshly installed... gonna check again
bronson has quit [Ping timeout: 240 seconds]
omegamike has quit [Ping timeout: 244 seconds]
<slani> Radar: 2.2.2 :060 > k = {:average=>{'Sun, 09 Aug 2015'=>0.4539780114845019}}
dgutierrez1287 has quit [Ping timeout: 252 seconds]
<Radar> slani: And you just want to get the value from there? You don't necessarily care about the date?
<slani> I like to get value 0.45
<slani> Radar: yes
chouhoulis has joined #ruby
<slani> I know avarge key
<Radar> slani: k[:average].values.first
<slani> Radar: thanks
<Radar> np
<Radar> nofxx: I don't know how that could be possible.
h4ckurate has quit [Quit: h4ckurate]
<bnagy> is there an strace analog for ruby? That would be awesome.
<nofxx> Radar, that makes two of us. Just tested again, my machine GET, next to me POST. both linux, same ruby
dopie has quit [Quit: This computer has gone to sleep]
<Radar> nofxx: my initial guess is that something is overriding the post method.
<Radar> nofxx: method(:post).source_location returns the same location on both machines?
deepu has joined #ruby
deepu has quit [Client Quit]
deepu has joined #ruby
tectonic has joined #ruby
hyy has quit [Ping timeout: 246 seconds]
riotjones has joined #ruby
bmurt has joined #ruby
deepu has quit [Client Quit]
halcyone3 has joined #ruby
stoodfarback has quit [Quit: WeeChat 1.2]
bmurt has quit [Client Quit]
riotjones has quit [Ping timeout: 264 seconds]
<slani> what is wrong with this code http://paste.ubuntu.com/12037339/
wldcordeiro_ has joined #ruby
<Radar> slani: Can you write a small program which reproduces the problem?
<Radar> Hard to know without seeing what kpi is
hahuang61 has quit [Quit: WeeChat 1.2]
peteykun has joined #ruby
wldcordeiro_ has quit [Read error: Connection reset by peer]
<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}}
<slani> kpi = {23=>{'Sun, 09 Aug 2015'=>0.7021276595744681}, 1=>{'Sun, 09 Aug 2015'=>1.0}}
dopie has joined #ruby
<Radar> and what is e?
<Radar> Oh
<slani> 2.2.2 :086 > e = Hash.new(0)
devoldmx has joined #ruby
hahuang65 has joined #ruby
swgillespie has joined #ruby
rehat has joined #ruby
<Radar> Silex: You should put a space around the *0.2, so it's * 0.2
<Radar> Otherwise it will interpret it as an argument to .first
<slani> Radar: thanks
<slani> I'm new in Ruby
<Radar> np
swgillespie has quit [Max SendQ exceeded]
<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
swgillespie has joined #ruby
peteykun has quit [Ping timeout: 250 seconds]
devoldmx has quit [Ping timeout: 264 seconds]
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
j4cknewt has joined #ruby
<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 :)
<al2o3-cr> try it out in irb/pry to see why it work :)
<al2o3-cr> *works
<[k-> you do not need to access kpi[user_id]
<[k-> it is provided in date
<al2o3-cr> [k-: good call :)
<Radar> date should then probably be called data instead.
<Ox0dea> I thought that was a style violation.
<Radar> is it?
mary5030 has quit [Remote host closed the connection]
<al2o3-cr> yeah, that would be a better variable name
<Ox0dea> It's all data.
<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
<Radar> Ox0dea: Ok. What's a better name for it than date or data?
<[k-> value
<Radar> It's all values.
<[k-> conventions states { |k,v| ... }
Respek has quit [Quit: gone to sleep. ZZZzzz…]
<Ox0dea> Radar: I believe you were mistaken in suggesting that slani needed to change it from `date`.
dc_ has joined #ruby
<Radar> Ok.
<Ox0dea> I mean, look at his Has.
<Ox0dea> *Hash
h4ckurate has joined #ruby
<Ox0dea> The keys are rather obviously dates.
<Radar> Yes, I can see that now.
<Ox0dea> slani: Pardon the disruption.
psy_ has joined #ruby
blt has joined #ruby
<al2o3-cr> slani: e = kpi.each_with_object(Hash.new(0)) { |(key, value), hsh| hsh[key] += value.values[0] * 0.2 } # updated
<Ox0dea> But he has user IDs and dates!
<Ox0dea> Jesus.
lxsameer has joined #ruby
<[k-> or you can just map and turn it to a hash later
<al2o3-cr> Ox0dea: He can obviously change them (it's an example)
<[k-> or you can update the hash
<Ox0dea> al2o3-cr: Are you not morally obligated to attempt to lessen the confusion of newcomers?
<al2o3-cr> Ox0dea: I'm pretty sure from the code he gave, he knows what key/values are
<Radar> Well this seems like a fun discussion to be nope'ing out of. Bye.
<[k-> https://d262ilb51hltx0.cloudfront.net/max/800/1*mIrYVuSZtaYe3WJkRwUqwQ.jpeg
<[k-> this actually shows that we can have * in names as well
dc_ has quit []
AlexRussia has joined #ruby
<Ox0dea> [k-: Mayhap the Common Lispers are making that trek, but Clojurians in general seem quite happy with theirs.
einarj has joined #ruby
<Ox0dea> Haskell sure is on folks' tongues, though: http://git.io/v3T4R
dimasg has quit [Ping timeout: 272 seconds]
sdwrage has joined #ruby
<slani> al2o3-cr: is there any performance improvemnt
<[k-> all this shows is that everyone wants to move away from java
<[k-> and lua people are quiet
shoutsid has quit [Remote host closed the connection]
<al2o3-cr> slani: idk have not benchmarked it
einarj has quit [Ping timeout: 244 seconds]
<al2o3-cr> [k-: /j #lua they're nutters :)
bruno- has joined #ruby
djbkd has joined #ruby
<slani> hash.delete(key)
<slani> hash.delete(key1)
<slani> can I do this in one lien
<slani> line*
mary5030 has joined #ruby
<[k-> hash.delete(key1) && hash.delete(key2)
<[k-> do you need to preserve kpi?
<slani> yes
<slani> only delete two kesy
<[k-> also note that the above code does not work all the time
<Ox0dea> slani: Do you know what [k- meant by "preserve kpi"?
workmad3 has joined #ruby
<pontiki> i don't know what that means
<pontiki> "Key Performance Indicator" ?
<Ox0dea> Could well be.
bruno- has quit [Ping timeout: 255 seconds]
fedexo has quit [Ping timeout: 246 seconds]
<bnagy> slani: [k1,k2].each {|k| hsh.delete k }, but for two why bother
<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
<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
<slani> Ox0dea: I hope so
<Ox0dea> slani: Hash#delete does not preserve the receiver.
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea> >> foo = {a: 1, b: 2, c: 3}; foo.delete_if { |key| %i[a c].include? key }; foo
<ruboto> Ox0dea # => {:b=>2} (https://eval.in/414103)
<[k-> yeah, that is only 1 loop
<slani> I will still have other keys and vale in kpi
<Ox0dea> slani: Yes, but kpi will be mutated.
<[k-> Ox0dea but in the case of a hash, wouldn't a loop be slower
dopamean_ has quit [Quit: leaving]
<Ox0dea> [k-: I was only demonstrating #delete{,_if}'s mutative natures.
workmad3 has quit [Ping timeout: 264 seconds]
<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'
<nofxx> hate computers, going to the hills live on subsistance agriculture
tkuchiki has quit [Remote host closed the connection]
<al2o3-cr> better to use reject then?
CatMartyn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<slani> Ox0dea: what shoul I use then
<Ox0dea> slani: Do or do you not wish to leave kpi in its previous state?
<Ox0dea> Is it okay if the entries you #delete disappear forever?
<slani> yes it is ok for me
<slani> to disappear
<Ox0dea> How many entries do you need to remove? Just the two?
<slani> just two
devbug has quit [Read error: Connection reset by peer]
<Ox0dea> Then just use two #deletes on two lines, man.
<[k-> ^
devbug has joined #ruby
<slani> Ok
<slani> thanks
<Ox0dea> slani: I see where you were coming from, but optimizing for code height is pretty much never a good idea.
<[k-> not what rubocop thinks
<[k-> curse rubocop!
<slani> Ox0dea: :d
ndrei has joined #ruby
<slani> kpi
sargas has joined #ruby
yardenbar has joined #ruby
mary5030 has quit [Remote host closed the connection]
chipotle has quit [Quit: cheerio]
hotpancakes has quit [Remote host closed the connection]
yardenbar has quit [Remote host closed the connection]
yardenbar has joined #ruby
arooni-mobile has quit [Ping timeout: 246 seconds]
halcyone3 has quit [Ping timeout: 260 seconds]
arooni-mobile__ has quit [Ping timeout: 244 seconds]
hyy has joined #ruby
null_ref_ has joined #ruby
shinnya has quit [Ping timeout: 250 seconds]
Mendenhall has quit [Ping timeout: 265 seconds]
chouhoulis has quit [Remote host closed the connection]
kies has quit [Ping timeout: 272 seconds]
saddad has quit [Ping timeout: 260 seconds]
bustrarm has joined #ruby
banister has joined #ruby
chris2 has quit [Ping timeout: 240 seconds]
busterarm has quit [Ping timeout: 240 seconds]
hotpancakes has joined #ruby
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
arescorpio has quit [Quit: Leaving.]
sargas has quit [Quit: This computer has gone to sleep]
AlexRussia has quit [Ping timeout: 256 seconds]
mistermocha has joined #ruby
kies has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
mistermocha has quit [Read error: Connection reset by peer]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mistermocha has joined #ruby
fullofcaffeine has joined #ruby
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd has quit [Quit: Leaving...]
shoutsid has joined #ruby
hyy has quit [Ping timeout: 244 seconds]
jackjackdripper has quit [Quit: Leaving.]
mistermocha has quit [Ping timeout: 250 seconds]
User458764 has quit [Read error: Connection reset by peer]
<slani> how can I round float on 2 decimals
<slani> 0.45
lxsameer has quit [Remote host closed the connection]
<slani> I got it
lxsameer has joined #ruby
lxsameer has joined #ruby
dimasg has joined #ruby
hyy has joined #ruby
chris2 has joined #ruby
tkuchiki has joined #ruby
Cust0sLim3n has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 240 seconds]
dimasg has quit [Ping timeout: 265 seconds]
Cust0sLim3n has joined #ruby
charliesome has quit [Quit: zzz]
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
tkuchiki has quit [Ping timeout: 260 seconds]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
baroquebobcat has joined #ruby
bnizzle has joined #ruby
hyy has quit [Ping timeout: 272 seconds]
fullofcaffeine has quit [Remote host closed the connection]
dcarmich has joined #ruby
hyy has joined #ruby
lxsameer has joined #ruby
hotpancakes has quit [Remote host closed the connection]
krz has quit [Quit: WeeChat 1.2]
mary5030 has joined #ruby
lxsameer has quit [Ping timeout: 245 seconds]
iateadonut has quit [Quit: Leaving.]
mary5030 has quit [Ping timeout: 244 seconds]
devoldmx has joined #ruby
charliesome has joined #ruby
yfeldblum has joined #ruby
tubulife- has joined #ruby
khebbie has joined #ruby
devoldmx has quit [Ping timeout: 246 seconds]
dimasg has joined #ruby
tubuliferous_ has quit [Ping timeout: 260 seconds]
fullofcaffeine has joined #ruby
khebbie has quit [Remote host closed the connection]
dimasg has quit [Ping timeout: 265 seconds]
lxsameer has joined #ruby
krz has joined #ruby
hotpancakes has joined #ruby
sevenseacat has joined #ruby
dcarmich has quit [Quit: Textual IRC Client: www.textualapp.com]
krz has quit [Read error: Connection reset by peer]
iateadonut has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
iateadonut has quit [Client Quit]
choke has joined #ruby
mistermocha has joined #ruby
workmad3 has joined #ruby
jonee has joined #ruby
einarj has joined #ruby
baweaver has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 250 seconds]
shock_one has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
lxsameer has quit [Ping timeout: 250 seconds]
einarj has quit [Ping timeout: 244 seconds]
hotpancakes has joined #ruby
shock_one has quit [Remote host closed the connection]
krz has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
Jackneill has joined #ruby
tkuchiki has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
yfeldblum has quit [Read error: Connection reset by peer]
roolo has joined #ruby
yfeldblum has joined #ruby
jonee has quit [Ping timeout: 246 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
hotpancakes has quit [Ping timeout: 250 seconds]
dgutierrez1287 has joined #ruby
niemcu has joined #ruby
postmodern has quit [Quit: Leaving]
yfeldblu_ has joined #ruby
User458764 has joined #ruby
dgutierrez1287 has quit [Ping timeout: 260 seconds]
dopie has quit [Quit: This computer has gone to sleep]
halcyone3 has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
cornerma1 has joined #ruby
krz has quit [Ping timeout: 260 seconds]
cornerman has quit [Ping timeout: 265 seconds]
cornerma1 is now known as cornerman
jonee has joined #ruby
sdwrage has joined #ruby
tkuchiki has quit [Remote host closed the connection]
krz has joined #ruby
yfeldblu_ has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 256 seconds]
yfeldblum has joined #ruby
rehat has quit [Ping timeout: 244 seconds]
symm- has quit [Ping timeout: 252 seconds]
ctalr has quit [Ping timeout: 244 seconds]
TomyLobo has joined #ruby
stoodfarback has joined #ruby
krz has quit [Read error: Connection reset by peer]
gard has joined #ruby
yfeldblu_ has joined #ruby
krz has joined #ruby
jonee has quit [Ping timeout: 246 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
bricker has quit [Quit: leaving]
oliver__ has joined #ruby
dtcristo has joined #ruby
null_ref_ has quit [Quit: leaving]
devbug has quit [Read error: Connection reset by peer]
Mendenhall has joined #ruby
khebbie has joined #ruby
hotpancakes has joined #ruby
banister has joined #ruby
symm- has joined #ruby
khebbie has quit [Ping timeout: 260 seconds]
Feyn has joined #ruby
radgeRayden has quit [Ping timeout: 265 seconds]
jonee has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
Violentr has joined #ruby
<nofxx> Is there some way to make the .git ext optional, that wont change the <repo> match? /^(ssh:\/\/)?git@github.com:(?<user>[^\/]+)\/(?<repo>.+)\.git$/
lxsameer has joined #ruby
<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
choke has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
Sembei has joined #ruby
mistermocha has joined #ruby
Pisuke has quit [Ping timeout: 252 seconds]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
glenn_ has joined #ruby
haroldwu has quit [Ping timeout: 244 seconds]
<Ox0dea> nofxx: %r'^(ssh://)?git@github.com:(?<user>[^/]+)/(?<repo>.+?)(\.git)?$'
<Ox0dea> It suffices to make the repo match non-greedy.
haroldwu has joined #ruby
rikkipitt has joined #ruby
<nofxx> Ox0dea, works like a charm, ty!
dented42 has joined #ruby
<Ox0dea> Happy to help.
glenn_ has quit [Read error: Connection reset by peer]
mistermocha has quit [Ping timeout: 260 seconds]
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
khapa has joined #ruby
Trynemjoel has quit [Ping timeout: 250 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
baroquebobcat has quit [Quit: baroquebobcat]
Trynemjoel has joined #ruby
apfeluser has joined #ruby
tkuchiki has joined #ruby
baroquebobcat has joined #ruby
riotjones has joined #ruby
baroquebobcat has quit [Client Quit]
h4ckurate has quit [Quit: h4ckurate]
yeticry_ has quit [Ping timeout: 244 seconds]
_ht has joined #ruby
riotjones has quit [Ping timeout: 256 seconds]
jonee has quit [Ping timeout: 250 seconds]
yeticry has joined #ruby
halcyone3 has quit [Ping timeout: 272 seconds]
charliesome has quit [Quit: zzz]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yeticry has quit [Ping timeout: 244 seconds]
yeticry has joined #ruby
Iskarlar has joined #ruby
tectonic has quit []
workmad3 has joined #ruby
Violentr has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
h4ckurate has joined #ruby
DoubleMalt has joined #ruby
einarj has joined #ruby
bweston92 has joined #ruby
niemcu has quit [Ping timeout: 240 seconds]
devoldmx has joined #ruby
einarj has quit [Ping timeout: 256 seconds]
devoldmx has quit [Ping timeout: 244 seconds]
krz has quit [Read error: Connection reset by peer]
tectonic has joined #ruby
tkuchiki has quit [Remote host closed the connection]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_blizzy_ has joined #ruby
gard has quit [Ping timeout: 260 seconds]
tkuchiki has joined #ruby
lapide_viridi has joined #ruby
hotpancakes has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
oliver__ has quit [Remote host closed the connection]
rikkipitt has quit [Remote host closed the connection]
iamninja has joined #ruby
doosy has joined #ruby
hotpancakes has quit [Ping timeout: 250 seconds]
krz has joined #ruby
tectonic has quit []
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
decoponio has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
Musashi007 has quit [Quit: Musashi007]
lapide_viridi has quit [Quit: Leaving]
mistermocha has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
jenrzzz has joined #ruby
bruno- has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
greenarrow has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
bruno- has quit [Ping timeout: 265 seconds]
<shevy> wow
<shevy> ncurses 6.0 is out, now we will be able to write kick-ass apps in ruby
blt has left #ruby ["WeeChat 1.2"]
dtcristo has joined #ruby
kraljev11 has joined #ruby
rikkipitt has joined #ruby
jonee has joined #ruby
halcyone3 has joined #ruby
<krz> is it possible to use do something like try against a hash? i.e. {a:'a'}.try(:a)
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
araujo has quit [Ping timeout: 255 seconds]
bweston92 has quit [Quit: Leaving]
bweston92 has joined #ruby
marr has joined #ruby
<adaedra> krz: what would it do?
sarkyniin has joined #ruby
bweston92 has quit [Client Quit]
bweston92 has joined #ruby
dcarmich has joined #ruby
araujo has joined #ruby
devoldmx has joined #ruby
jonee has quit [Ping timeout: 272 seconds]
dgutierrez1287 has joined #ruby
tkuchiki has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 272 seconds]
Mendenhall has quit [Ping timeout: 255 seconds]
araujo has quit [Ping timeout: 255 seconds]
dgutierrez1287 has quit [Ping timeout: 260 seconds]
DexterLB has quit [Ping timeout: 260 seconds]
h4ckurate has quit [Quit: h4ckurate]
DexterLB has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
araujo has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
davedev24 has quit [Remote host closed the connection]
jonee has joined #ruby
<[k-> >> {a: 'a'}.key?(:a)
<ruboto> [k- # => true (https://eval.in/414170)
einarj has joined #ruby
niemcu has joined #ruby
krz has quit [Quit: WeeChat 1.2]
davedev24 has joined #ruby
krz has joined #ruby
ndrei has joined #ruby
Gadgetoid has quit [Read error: Connection reset by peer]
jonee has quit [Ping timeout: 246 seconds]
pgatt has joined #ruby
pyon has quit [Quit: Can't you stop what's happening?]
SCHAAP137 has joined #ruby
eGGsha has joined #ruby
doosy has quit [Remote host closed the connection]
jenrzzz has joined #ruby
shock_one has joined #ruby
swgillespie has joined #ruby
Gadgetoid has joined #ruby
havenwood has joined #ruby
doosy has joined #ruby
mcgain has joined #ruby
mcgain has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
zanloy has joined #ruby
mcgain has left #ruby [#ruby]
mcgain has joined #ruby
kirun has joined #ruby
DoubleMalt has quit [Ping timeout: 255 seconds]
pyon_ has joined #ruby
workmad3 has joined #ruby
pyon_ is now known as pyon
DoubleMalt has joined #ruby
ndrei has quit [Ping timeout: 265 seconds]
<krz> [k-: sorry was dc'd. im trying to return the value or nil. depending if key is present
<krz> similar to what .try does
<Mon_Ouie> That's already what Hash#[] does
DoubleMalt has quit [Remote host closed the connection]
shoutsid has quit [Remote host closed the connection]
DoubleMalt has joined #ruby
<krz> hmmm good point
<[k-> Hash#fetch(key, default_value)
workmad3 has quit [Ping timeout: 255 seconds]
FernandoBasso has joined #ruby
krz has quit [Read error: Connection reset by peer]
nofxx has quit [Ping timeout: 250 seconds]
j4cknewt has quit [Remote host closed the connection]
roolo has quit [Remote host closed the connection]
lxsameer has joined #ruby
shock_one has quit []
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Trynemjoel has quit [Ping timeout: 245 seconds]
Trynemjoel has joined #ruby
oleksandriuzikov has joined #ruby
bruno- has joined #ruby
<pontiki> is i?
<pontiki> is it?
krz has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
User458764 has quit [Ping timeout: 272 seconds]
User458764 has joined #ruby
tkuchiki has joined #ruby
einarj has quit [Remote host closed the connection]
sarkyniin has quit [Remote host closed the connection]
DoubleMalt has quit [Ping timeout: 255 seconds]
tkuchiki has quit [Ping timeout: 246 seconds]
krz has quit [Read error: Connection reset by peer]
kraljev11 has quit [Ping timeout: 255 seconds]
freerobby has joined #ruby
hotpancakes has joined #ruby
<shevy> yes!
<shevy> japanese devs discussing in english!!!
tkuchiki has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rikkipitt has quit [Remote host closed the connection]
krz has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
ndrei has joined #ruby
eGGsha has joined #ruby
choke has joined #ruby
AlphaAtom has joined #ruby
casadei_ has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has joined #ruby
freerobby has quit [Quit: Leaving.]
casadei_ has quit [Ping timeout: 260 seconds]
doosy has quit [Remote host closed the connection]
_blizzy_ has quit [Ping timeout: 246 seconds]
omegamike has joined #ruby
tkuchiki has quit [Remote host closed the connection]
freerobby has joined #ruby
freerobby has quit [Client Quit]
phutchins has joined #ruby
mistermocha has joined #ruby
tkuchiki has joined #ruby
spacemud has quit [Ping timeout: 244 seconds]
omegamike has quit [Ping timeout: 256 seconds]
mistermocha has quit [Read error: Connection reset by peer]
flegercovateam has quit [Quit: Bye Bye]
spacemud has joined #ruby
mistermocha has joined #ruby
choke has joined #ruby
tkuchiki has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
doritostains has quit [Quit: WeeChat 1.0.1]
tkuchiki has joined #ruby
yfeldblu_ has quit [Ping timeout: 244 seconds]
j4cknewt has joined #ruby
pico-pete has quit []
pafin has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
unsymbol has quit [Ping timeout: 252 seconds]
ishahnaz has joined #ruby
tomphp_ has joined #ruby
unsymbol has joined #ruby
Trynemjoel has quit [Ping timeout: 250 seconds]
mhib has joined #ruby
j4cknewt has quit [Ping timeout: 244 seconds]
Trynemjoel has joined #ruby
niemcu has quit [Ping timeout: 264 seconds]
gard has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tkuchiki has quit [Remote host closed the connection]
jonee has joined #ruby
DoubleMalt has joined #ruby
AlphaAtom has joined #ruby
Synthead has joined #ruby
devoldmx has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
jonee has quit [Ping timeout: 260 seconds]
oliver__ has joined #ruby
lannonbr has joined #ruby
Synthead has quit [Ping timeout: 244 seconds]
devoldmx has quit [Ping timeout: 250 seconds]
tkuchiki has joined #ruby
krz has quit [Quit: WeeChat 1.2]
phutchins has quit [Ping timeout: 240 seconds]
hotpancakes has joined #ruby
dtcristo has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
pawnbox has joined #ruby
Antoine59 has joined #ruby
einarj has joined #ruby
lxsameer has joined #ruby
jeadr has quit [Remote host closed the connection]
krz has joined #ruby
Antoine59 has quit [Client Quit]
einarj has quit [Ping timeout: 252 seconds]
_blizzy_ has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jonee has joined #ruby
workmad3 has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
fantazo has quit [Ping timeout: 246 seconds]
shoutsid has joined #ruby
_blizzy_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
Chau has joined #ruby
dgutierrez1287 has joined #ruby
AlphaAtom has joined #ruby
ishahnaz has quit []
ndrei has quit [Ping timeout: 240 seconds]
shoutsid has quit [Ping timeout: 250 seconds]
doosy has joined #ruby
ndrei has joined #ruby
dgutierrez1287 has quit [Ping timeout: 255 seconds]
mistermocha has joined #ruby
eGGsha has quit [Quit: Textual IRC Client: www.textualapp.com]
fluffykat has joined #ruby
<fluffykat> hello - I am hoping someone can help. I can't get my basic if statement to work.
<fluffykat> I'll paste code to gist
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruboto> fluffykat, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/1166108d422f5138e03b
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<[k-> what is wrong?
<greenarrow> fluffykat, whats the error
<fluffykat> basically it's always returning type_a.name as the winner.....
<greenarrow> if statement is fine something wrong with your logic
mistermocha has quit [Ping timeout: 246 seconds]
<greenarrow> you dont the the wrapping brackets on this fyi if (self.type_a.pick('5'))
<[k-> yup, if you dont run into an error, it's not the code, it's the logic
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<fluffykat> yeah, i'll take out those brackets and see if it makes a difference
<[k-> it wont make a difference
<[k-> what does `self.type_a.pick('5')` return?
<fluffykat> hmm...im checking in irb
<fluffykat> it return '5'
<[k-> 5 is a truthy valie
<[k-> value
<[k-> it will always be treated as true
<fluffykat> `self.type_a.pick('2')` returns '2'
<[k-> what do you expect pick to return?
<[k-> is it your code?
<fluffykat> yes
<[k-> do you know ruby?
<fluffykat> just learning
casadei_ has joined #ruby
<[k-> what should pick return?
dseitz has joined #ruby
<fluffykat> basically if i enter test.type_a.pick('5') it returns '5', which is correct
<fluffykat> in irb
<[k-> and what should the if statement do?
<lannonbr> I think [k- is asking what is the purpose of the function pick
<[k-> lannonbr, no
<[k-> im asking if he actually expected a boolean
Trynemjoel has quit [Ping timeout: 245 seconds]
<[k-> anyways
<[k-> fluffykat, how is the if statement supposed to work?
<[k-> if it is 5? if it is 2? if it is not 5? etc etc
Trynemjoel has joined #ruby
AlphaAtom has joined #ruby
<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'
<fluffykat> sorry the method pick returns the argument value passed into it
casadei_ has quit [Ping timeout: 246 seconds]
<[k-> so you want to see if 5 is more than 2?
<fluffykat> no
<[k-> that seems to be what you want to do
<[k-> so you want to check if a is 5 and b is 2, right?
<fluffykat> is this the correct expression? - if ((self.type_a.pick('5')) == '5') && (self.type_b.pick('2') == '2')
<[k-> yes
<lannonbr> It may be, but it doesn't seem what you really want to do
<lannonbr> It is valid
<fluffykat> let me check
<[k-> ?fake
<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.
edwinvdgraaf has quit [Remote host closed the connection]
charliesome has joined #ruby
edwinvdgraaf has joined #ruby
doosy has quit [Remote host closed the connection]
edwinvdg_ has joined #ruby
hotpancakes has joined #ruby
jonee has quit [Ping timeout: 246 seconds]
Tamae has joined #ruby
edwinvdgraaf has quit [Ping timeout: 252 seconds]
thiagovsk has joined #ruby
ruurd has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hotpancakes has quit [Ping timeout: 246 seconds]
basmoura has joined #ruby
oliver__ has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
einarj has joined #ruby
Kallis has joined #ruby
halcyone3 has quit [Ping timeout: 272 seconds]
dling` has joined #ruby
banister has joined #ruby
brain_shim has quit [Ping timeout: 265 seconds]
dling has quit [Ping timeout: 260 seconds]
<fluffykat> hmm, the code is still not working
gunslinger has joined #ruby
<gunslinger> Is it possible to find the object causing an exception in ruby?
<gunslinger> I get an "Undefined method [] for Nil::Nilclass" error,
shazaum_ has joined #ruby
<gunslinger> but IDK which object is causing it
<sevenseacat> the one you're calling [] on, in the line raising the error
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gunslinger> sevenseacat: I'm not currently sure which line gets the Error, my exception
<gunslinger> loop just prints the message
einarj has quit [Ping timeout: 246 seconds]
<sevenseacat> gist the code and error?
sargas has joined #ruby
<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
sargas has quit [Client Quit]
<[k-> post what you typed into irb
<fluffykat> as soon as i run test.play i meant to say*
<jhass> ?code
<ruboto> We can't help you without your code, please post it to https://gist.github.com
<gunslinger> sevenseacat: This is the code : https://gist.github.com/anonymous/470c6a506c83b715a7ca
<gunslinger> sevenseacat: The error: https://gist.github.com/anonymous/c27d7e093c40c9b51357
<jhass> gunslinger: gist supports syntax highlighting and multiple files
<gunslinger> jhass: TIL, I'll keep that in mind
jonee has joined #ruby
<jhass> gunslinger: fix whatever shit is catching the error to print the backtrace
<sevenseacat> that would be a good first step
gorgoroth has joined #ruby
<gorgoroth> when trying to compile json I get this: "/usr/bin/ruby19: Permission denied -- /usr/local/bin/rake (LoadError)"
ruurd has quit [Quit: ZZZzzz…]
<gorgoroth> anyone knows what is the problem?
<sevenseacat> gorgoroth: permission denied is the problem.
<gorgoroth> sevenseacat: yes, dmesg shows nothing
<gorgoroth> the binary is with executable bit
<sevenseacat> doesnt mean you have permission to execute it
<gorgoroth> sevenseacat: I have, I'm root, but wait
<[k-> fluffykat: ignoring us will not help us help you
<gunslinger> jhass: On it
fantazo has joined #ruby
<gunslinger> jhass: This is the line, https://gist.github.com/anonymous/1c21cdbf127e9017f916
<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
<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
<jhass> gunslinger: so there are three calls to [] on it
<jhass> check which is nil, posts, posts[index] or posts[index]["shares"]
<gunslinger> jhass: thanks, I'm looking into that now
gorgoroth has quit [Ping timeout: 260 seconds]
oliver__ has joined #ruby
<gunslinger> jhass: It was shares, thanks!
<jhass> ?styleguides gunslinger
<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
sylvain31 has joined #ruby
<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
<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.
j3r0 has joined #ruby
<jhass> gunslinger: and actually it's a .map not an .each
gorgoroth has joined #ruby
<gunslinger> jhass: Is there a significant advantage to using map instead?
<jhass> it's a lot prettier?
<gunslinger> Utility-wise?
Coldblackice has quit [Ping timeout: 244 seconds]
<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 :/)
doosy has joined #ruby
<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.
<jhass> the while condition got me all dizzy ;)
tmtwd has joined #ruby
ponga has quit [Quit: Connection closed for inactivity]
<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
<gorgoroth> yeh
<gorgoroth> I have no idea
<jhass> something into that direction, should be about a third of the lines of code -> a lot easier to understand
<gorgoroth> anyone knows what this might be?
<jhass> gorgoroth: I suspect you messed up your system by mindlessly using root because something "didn't work"
<[k-> gorgoroth: at least provide us with more info
<gorgoroth> ok, I'll try
Feyn has quit [Quit: Leaving]
dorei has joined #ruby
<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
conor_ has joined #ruby
<[k-> ok
<[k-> congrats
mhib has quit [Ping timeout: 250 seconds]
<shevy> what a nick
<shevy> sevenseacat may get jealous to see a fluffykat
<[k-> this feels dejá vu
jackjackdripper has joined #ruby
phutchins has joined #ruby
<shevy> says the [k-cat
pgatt has quit [Quit: Connection closed for inactivity]
jackjackdripper has quit [Client Quit]
<gunslinger> jhass: That looks really nice, I'm still a pythonic coder so I tend to type that way but ty
pafin has quit [Read error: Connection reset by peer]
pafin has joined #ruby
<[k-> do you want to ruby or python
<shevy> how about rython
<gunslinger> [k-: I like ruby, but I'm used to doing python. but you learn what you need to to get a job
<[k-> dont use python as an excuse
<[k-> GET ON THE RUBY BOAT!
<jhass> gunslinger: that looks more like java or C than python to me...
<jhass> in python it would be something like results = [{...} for post in posts[10:]] or idk
<gunslinger> It's not mine :) but mine would sorta look less rubyish TBH
cashnguns has joined #ruby
marr has quit [Ping timeout: 250 seconds]
<gunslinger> I believe the guy who wrote it was all about that Java
<gunslinger> IDK why he keeps using ; at the end lol
devoldmx has joined #ruby
<[k-> ugh java
jonee has quit [Ping timeout: 255 seconds]
<[k-> shevy's favorite
chouhoulis has joined #ruby
ruurd has joined #ruby
mhib has joined #ruby
<shevy> too verbose
<[k-> im sure you love it!
<shevy> I never liked verbosity, I use e rather than puts for instance!
<[k-> e?
<shevy> yeah
<gunslinger> what's e?
devoldmx has quit [Ping timeout: 246 seconds]
qiukun has quit [Ping timeout: 244 seconds]
<shevy> I dunno
<shevy> I think it evolved historically but I no longer have the intermediary code :/
<gunslinger> I mean, how do you use it?
<[k-> puts is verbose?
<shevy> it had something to do with colourization
<shevy> yeah [k- 4 chars, inacceptable
<shevy> gunslinger well e 'Hello world!'
gard has quit [Ping timeout: 244 seconds]
<[k-> shevy APL is perfect for you!
oliver__ has quit []
<shevy> I was using term-ansicolor back then
<shevy> e 'red'.red
<[k-> look, it evens take advantage of Unicode
<[k-> echo?
<shevy> why would I need unicode
chouhoulis has quit [Ping timeout: 264 seconds]
<jhass> I guess we should be glad that shevy only brags but never actually shares any of his code
<shevy> [k- I don't remember... e for echo would make sense, but I think there was some intermediary step
j3r0 has quit [Ping timeout: 255 seconds]
<[k-> i think o would be good for you shevy
<shevy> I think I may have some old backup from where I could find out
<[k-> o means output
<[k-> and it prints!
chabil has joined #ruby
<[k-> the o language i mean
chouhoulis has joined #ruby
<shevy> hmm
<shevy> but e is on the left half of the keyboard
<gorgoroth> read(8, "/usr/bin/ruby19: Permission deni"..., 4096) = 70
<gorgoroth> write(9, "/usr/bin/ruby19: Permission deni"..., 70) = 70
<gorgoroth> write(10, "/usr/bin/ruby19: Permission deni"..., 70) = 70
<shevy> ack, debian
<jhass> gorgoroth: ls -lh /usr/bin/ruby19 /usr/local/bin/rake; whoami; or whatever the path was
<[k-> shevy uses puppylinux
<shevy> nah
<gorgoroth> -rwx------ 1 root root 5.9K Aug 9 11:29 /usr/bin/ruby19
<gorgoroth> -rwx------ 1 root root 452 Nov 20 2014 /usr/local/bin/rake
<gorgoroth> yeah
<gorgoroth> that explains a lot
<shevy> if anything then gobolinux but sadly it died years ago :(
conor_ has quit [Remote host closed the connection]
sevenseacat has quit [Quit: .]
mago0 has joined #ruby
<gorgoroth> strange, I've checked that before, it seemed normal
conor_ has joined #ruby
<gorgoroth> it worked out, thanks jhass and everyone
workmad3 has joined #ruby
<[k-> shevy: Happy National Day Singapore!
<shevy> wa liao!
<[k-> huat ah!
araujo has quit [Quit: Leaving]
asaaki has quit [Ping timeout: 244 seconds]
<[k-> gobolinux's latest news is 2015-02?
DoubleMalt has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
Fluent has quit [Changing host]
Fluent has joined #ruby
<shevy> well it's like with _why
<shevy> different maintainers change the identity of a project :(
halcyone3 has joined #ruby
<shevy> I haven't tried out the non-java shoes yet though
workmad3 has quit [Ping timeout: 250 seconds]
einarj has joined #ruby
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy> https://github.com/shoes/shoes4 - wasn't there another one as well?
michael_mbp has joined #ruby
Kallis has quit [Read error: Connection reset by peer]
gunslinger has left #ruby [#ruby]
<[k-> remove the 4?
Chau has quit [Quit: Leaving]
<shevy> no I think this was the group that moved to shoes4 anyway
einarj has quit [Remote host closed the connection]
einarj has joined #ruby
einarj has quit [Remote host closed the connection]
<[k-> > jruby
<[k-> might as well use awt or swing
<shevy> I find this very confusing
<shevy> this blog is active too http://walkabout.mvmanila.com/
<shevy> "This entry was posted in Linux, OSX, Raspberry, Ruby, Shoes, Windows on August 9, 2015."
DoubleMalt has joined #ruby
<shevy> but I also don't think that was the other shoes I remember :\
<havenwood> shevy: green shoes
<[k-> im sure havenwood has a special place reserved in his memory for shoes :3
rikkipitt has joined #ruby
<sylvain31> Do you k
<[k-> k does not k
sylvain31 has left #ruby ["Leaving"]
sylvain31 has joined #ruby
<sylvain31> do you know why delegateClass is masking global scope function? example in: https://gist.github.com/Sylvain303/55c330ac6bf113711286
dionysus69 has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlphaAtom has joined #ruby
fluffykat has quit [Quit: Leaving]
conor_ has quit [Remote host closed the connection]
<[k-> test_that? isnt in the scope of the class?
relix has joined #ruby
<sylvain31> if the class is not a DelagateClass it is…
<[k-> sorry derped
<sylvain31> what "derped" means?
<[k-> it raises NoMethodError?
<sylvain31> delegate_class.rb:9:in `initialize': undefined method `test_that?' for module `Kernel' (NameError)
Papierkorb has joined #ruby
<Mon_Ouie> sylvain31: Because of the way Delegate is written, it doesn't let you call private methods unless those are defined on Kernel
<Mon_Ouie> Defining a top-level method is the same as defining a private instance method on the Object class
<Papierkorb> "a".gsub /(.)/, '\\\1' # Results in \1, but I expected \a - Is this a ruby parser bug in #gsub?
<Papierkorb> funny thing is, that writing '\\' '\1' yields the same result
<Mon_Ouie> >> "a".gsub /(.)/, '\1'
<ruboto> Mon_Ouie # => "a" (https://eval.in/414205)
<Papierkorb> >> "a".gsub /(.)/, '\\\1'
<ruboto> Papierkorb # => "\\1" (https://eval.in/414206)
<Papierkorb> Mon_Ouie: ^
<Mon_Ouie> You just quoted one too many times
<Papierkorb> No I didn't. I want it to return a backslash, and then the captured char
<Papierkorb> >> "a".gsub /(.)/, '\\1'
<ruboto> Papierkorb # => "a" (https://eval.in/414207)
AlexRussia has joined #ruby
<Mon_Ouie> Ah, then you need to escape once more :p
<Mon_Ouie> How would you ask gsub to literally insert a backslash followed by the character one otherwise?
<Papierkorb> Mon_Ouie: already tried to add a bunch of more backslashes, same result
deepu has joined #ruby
casadei_ has joined #ruby
<Mon_Ouie> >> "a".gsub /(.)/, '\\\\\1'
<ruboto> Mon_Ouie # => "\\a" (https://eval.in/414211)
lxsameer has quit [Quit: Leaving]
<Mon_Ouie> (You need one more backslash in the string as seen by gsub, so you need two more backslashes in your string literal)
<sylvain31> Mon_Ouie, … I see. test_that? doesn't look like a private method to me… But I can handle that.
<Papierkorb> Mon_Ouie: oh well. thanks
k1v4n has joined #ruby
<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
conor_ has joined #ruby
<sylvain31> Mon_Ouie, I would like to share the top-level method with other code too
casadei_ has quit [Ping timeout: 255 seconds]
mistermocha has joined #ruby
Aridere has quit [Ping timeout: 255 seconds]
<Mon_Ouie> module Kernel; module_function; def test_that?(num); …; end; end <- this is how most methods in Kernel are defined
deepu has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<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…
j4cknewt has joined #ruby
workmad3 has joined #ruby
<Mon_Ouie> What do you mean "not put it at Kernel level"?
<Mon_Ouie> If you just want it inside your delegator that's where you can define it
<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
mcgain has quit [Quit: Textual IRC Client: www.textualapp.com]
<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
mcgain has joined #ruby
<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
The_Phoenix has quit [Quit: Leaving.]
j4cknewt has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 244 seconds]
<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
ivanskie has joined #ruby
bronson has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
Axy is now known as Mia
calleerlandsson has joined #ruby
dardo82 has joined #ruby
lannonbr has quit [Quit: WeeChat 1.2]
bronson has quit [Ping timeout: 244 seconds]
<dardo82> hello
<sylvain31> Mon_Ouie, do you know where I can find the restrictions on DelegateClass?
<dardo82> i have some problems with homebrew on a mac
<Mon_Ouie> I looked at their implementation of method_missing to understand this, I don't know if it's mentioned in the documentation
<dardo82> "brew tests" fails saying something about ruby
<dardo82> "Could not find 'bundler' (>= 0) among 29 total gem(s) (Gem::LoadError)"
<sylvain31> Mon_Ouie, OK thanks.
<dardo82> i should ask about it here or on the machomebrew channel?
<Mon_Ouie> dardo82: It looks like you need to 'gem install bundler'. They probably know more about the specific dependencies of homebrew though.
blue_deref has joined #ruby
zarubin_ has joined #ruby
zarubin_ has quit [Client Quit]
jamesaxl has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
j416 has quit [Read error: Connection reset by peer]
j416_ has joined #ruby
<dardo82> Mon_Ouie: when i try it i get the error "Symbol not found: _SSLv2_client_method"
j416_ is now known as j416
dopie has joined #ruby
hotpancakes has joined #ruby
<Mon_Ouie> Could it be that your Ruby's OpenSSL extension was linked against a incompatible version of OpenSSL?
omegamike has joined #ruby
gorgoroth has quit [Quit: gorgoroth]
<dardo82> Mon_Ouie: maybe, how i can check that?
<Mon_Ouie> I don't know, not very familiar with how dynamic libraries work on Mac OS X
hotpancakes has quit [Ping timeout: 245 seconds]
<Mon_Ouie> But you could try and rebuild Ruby to make sure though
<havenwood> dardo82: ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION'
omegamike has quit [Ping timeout: 260 seconds]
<Mon_Ouie> I guess that's what they're suggesting too
<havenwood> aye, rebuild!
<havenwood> i hate that ruby-build ships its own openssl
michael_mbp has quit [Excess Flood]
<dardo82> havenwood: that command gives the same error
<havenwood> dardo82: ah, right
<havenwood> dardo82: How'd you install Ruby?
yeticry has quit [Ping timeout: 256 seconds]
michael_mbp has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
yeticry has joined #ruby
workmad3 has joined #ruby
yardenbar has quit [Quit: Leaving]
triangles has joined #ruby
bmurt has joined #ruby
einarj has joined #ruby
dopie has joined #ruby
chinmay_dd has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
deepu has joined #ruby
einarj has quit [Ping timeout: 244 seconds]
ruurd has joined #ruby
brain_shim has joined #ruby
saddad has joined #ruby
deepu has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
DLSteve has joined #ruby
dimasg has joined #ruby
rmoriz has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
bmurt has quit []
matugm has quit [Quit: Leaving]
NeverDie has joined #ruby
<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?
<TomyLobo> doesnt have to be an actual hash of hashes, it can also be hash with a 2-part key
wprice has joined #ruby
<shevy> you could set a .default value for your hash
<shevy> hash = { "a" => 100, "b" => 200 }; hash.default = Hash.new
<shevy> hmm
<shevy> or perhaps not :\
ruurd has quit [Quit: ZZZzzz…]
fedexo has joined #ruby
<[k-> Hash.new({})?
<zanloy> >> h = Hash.new({a: 1, b: 2}); puts h[:key]
<ruboto> zanloy # => {:a=>1, :b=>2} ...check link for more (https://eval.in/414215)
lele|w has quit [Ping timeout: 240 seconds]
<[k-> it would be the same object tho
chinmay_dd has quit [Quit: Leaving]
<zanloy> >> obj = {a: 1, b: 2}; h = Hash.new(obj); puts h[:key]; obj[:b] = 3; puts h[:key2]
<ruboto> zanloy # => {:a=>1, :b=>2} ...check link for more (https://eval.in/414217)
<zanloy> >> obj = {a: 1, b: 2}; h = Hash.new(obj); obj[:b] = 3; puts h[:key]
<ruboto> zanloy # => {:a=>1, :b=>3} ...check link for more (https://eval.in/414218)
<[k-> as i said...
<[k-> you need to use a proc to create the object
gattuso has left #ruby [#ruby]
jamesaxl|2 has joined #ruby
jamesaxl has quit [Ping timeout: 246 seconds]
<havenwood> TomyLobo: The idiom is: Hash.new { |h, k| h[k] = {} }
krz has quit [Ping timeout: 246 seconds]
<TomyLobo> ah, thanks
<havenwood> no prob
charliesome has quit [Quit: zzz]
sarkyniin has joined #ruby
<yxhuvud> as long as only one extra level is needed.
pafin has quit [Ping timeout: 244 seconds]
ruurd has joined #ruby
ruurd has quit [Client Quit]
<dardo82> Mon_Ouie, havenwood: thanks ,i think i fixed it, at least regarding homebrew...
k1v4n has quit [Quit: Leaving]
freerobby has joined #ruby
<[k-> Hash.new { |h, k| h[k] = h }
dardo82 has quit [Quit: Page closed]
rikkipitt has quit [Quit: Leaving...]
Vile` has joined #ruby
krz has joined #ruby
sepp2k has joined #ruby
<yxhuvud> [k: so regardless of how deep you go, you still end up with the same hash..
hanmac has quit [Ping timeout: 244 seconds]
Muhannad has joined #ruby
conor_ has quit [Remote host closed the connection]
mistermocha has joined #ruby
conor_ has joined #ruby
Muhannad has quit [Max SendQ exceeded]
Inside has joined #ruby
Inside has joined #ruby
conor_ has quit [Remote host closed the connection]
Muhannad has joined #ruby
<[k-> its a merge thing
shoutsid has joined #ruby
jordanm has quit [Quit: Konversation terminated!]
DoubleMalt has quit [Remote host closed the connection]
justicefries has left #ruby [#ruby]
Azure has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd has joined #ruby
conor_ has joined #ruby
devoldmx has joined #ruby
mistermocha has quit [Ping timeout: 272 seconds]
conor_ has quit [Remote host closed the connection]
Azure has joined #ruby
tkuchiki has quit [Remote host closed the connection]
k1v4n_ has joined #ruby
tkuchiki has joined #ruby
freerobby has quit [Quit: Leaving.]
niemcu has joined #ruby
Respek has joined #ruby
devoldmx has quit [Ping timeout: 246 seconds]
Zackio has quit [Quit: C-x C-c]
hanmac has joined #ruby
k1v4n_ has quit [Client Quit]
Zackio has joined #ruby
hotpancakes has joined #ruby
<TomyLobo> yxhuvud, well if i need more than one level, you can always apply the solution recursively :)
Muhannad has quit [Ping timeout: 260 seconds]
<TomyLobo> infinite levels would be trickier
k1v4n has joined #ruby
conor_ has joined #ruby
apofis has joined #ruby
atomi has left #ruby [#ruby]
hotpancakes has quit [Ping timeout: 255 seconds]
mago0 has quit [Ping timeout: 246 seconds]
_blizzy_ has quit [Ping timeout: 246 seconds]
<[k-> >> lambda=->h{lambda[h[:a].merge!(h)]}[{:b => ?c}]
<ruboto> [k- # => undefined method `merge!' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/414223)
<[k-> >> lambda=->h{lambda[h[:a].merge!(h)]}[{:a => ?c}]
<ruboto> [k- # => undefined method `merge!' for "c":String (NoMethodError) ...check link for more (https://eval.in/414224)
<[k-> :/
<[k-> well whatever
k1v4n has quit [Quit: WeeChat 1.2]
mago0 has joined #ruby
k1v4n has joined #ruby
pawnbox has joined #ruby
k1v4n has quit [Quit: WeeChat 1.2]
pawnbox has quit [Remote host closed the connection]
Muhannad has joined #ruby
dymk has left #ruby ["Leaving"]
lannonbr has joined #ruby
fullofcaffeine has joined #ruby
pawnbox has joined #ruby
sdwrage has joined #ruby
hotpancakes has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
hotpancakes has quit [Remote host closed the connection]
shazaum_ has quit [Quit: This computer has gone to sleep]
casadei_ has joined #ruby
sarkyniin has quit [Ping timeout: 245 seconds]
sarkyniin has joined #ruby
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #ruby
casadei_ has quit [Ping timeout: 260 seconds]
unsymbol has quit [Ping timeout: 260 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spacemud has quit [Ping timeout: 250 seconds]
j3r0 has joined #ruby
<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?
<Darkwater> what would be the msot ruby way
yh has quit [Ping timeout: 246 seconds]
j3r0 has quit [Client Quit]
rbennacer has joined #ruby
spacemud has joined #ruby
rehat has joined #ruby
hotpancakes has joined #ruby
hotpancakes has quit [Remote host closed the connection]
<jhass> just use cinch?
hotpancakes has joined #ruby
sarkyniin has quit [Ping timeout: 244 seconds]
sylvain31 has quit [Remote host closed the connection]
AlexRussia has quit [Read error: Connection reset by peer]
<Darkwater> jhass: it's not just an irc bot, it's an entire client
<Darkwater> so I'd like full control over everything
unsymbol has joined #ruby
<Darkwater> but I'll take a look at how cinch does things
roolo has joined #ruby
kies has quit [Ping timeout: 244 seconds]
yb_drowe has joined #ruby
conor_ has quit [Remote host closed the connection]
sarkyniin has joined #ruby
gard has joined #ruby
brain_shim has quit [Ping timeout: 255 seconds]
conor_ has joined #ruby
apt-get_ has joined #ruby
Trynemjoel has quit [Ping timeout: 250 seconds]
<[k-> i bet it would be slow!
<[k-> with guis and everything
t_mmyv has joined #ruby
<[k-> are you sure you want to do this?
<Darkwater> yes
<Darkwater> been wanting this for a while now
Trynemjoel has joined #ruby
<[k-> why not just a bot
tkuchiki has quit [Remote host closed the connection]
<Darkwater> I want things
<Darkwater> want to make yet another multichat client
<[k-> a bot is a thing
<Darkwater> irc, telegram, steam, idk what else
<[k-> another protocol?
<Darkwater> no
<Darkwater> a client that supports multiple protocols
<[k-> well, there are lots of things involved in making a client
<Darkwater> I know
<Darkwater> already having difficulty in deciding how to make the desktop client
sarkyniin has quit [Ping timeout: 250 seconds]
<Darkwater> well I want the chat client to be like a daemon
<Darkwater> and have clients connect to that
<Darkwater> so it'd be like running irssi in a remote screen
<Darkwater> or more like that one irc client I forgot the name of
<[k-> i kind of think doing this in ruby is crazy
<[k-> oh well
<Darkwater> quassel does it I think
omegamike has joined #ruby
<Darkwater> server should be fine in ruby
<Darkwater> client idk
<Darkwater> terminator is written in python and it'
<Darkwater> s popular (though slow)
<Darkwater> but hey, performance isn't a big issue for a chat client
<[k-> crystal? elixir?
voxxit has joined #ruby
<Darkwater> "ruby-inspired syntax"
<Darkwater> >example is pure valid ruby
<yxhuvud> depends on how many users you have.
<Darkwater> yxhuvud: what do you mean?
<[k-> i think the type errors in Ruby will drive you crazy
<yxhuvud> server performance.
k1v4n has joined #ruby
<Darkwater> there's one user per server
<[k-> and the unit tests
<Darkwater> read closer
<[k-> type safety should be embraced
<[k-> it is how java is still used for enterprise today
<Darkwater> yeah I consider that a disadvantage of ruby
dopamean_ has joined #ruby
<Darkwater> but I still like the language
<Darkwater> and I probably wouldn't complete the project if I'd write it in C++
<[k-> it *isnt* a disadvantage
<Darkwater> maybe I'll make a C++ server later
<[k-> go functional!
<Darkwater> yeah nty
<[k-> a fool.
<Darkwater> I have little to no experience with functional programming
<[k-> so?
<Darkwater> and I'm not going to use this project to learn it, nor wait with this project until I've learnt it
<[k-> k
mistermocha has joined #ruby
omegamike has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Remote host closed the connection]
<shevy> dumdedum
devoldmx has joined #ruby
rbennacer has quit [Remote host closed the connection]
<[k-> shevy
<bnagy> p sure ruby is fast enough for the BLISTERING demands of IRC
<[k-> functional
<[k-> now
<[k-> hop on sevenseacat express!
Trynemjoel has quit [Ping timeout: 245 seconds]
<shevy> don't follow wrong paths
chinmay_dd has joined #ruby
Inside has quit [Ping timeout: 252 seconds]
shinnya has joined #ruby
mistermocha has quit [Ping timeout: 246 seconds]
freerobby has joined #ruby
<[k-> you dont know what is better!
Trynemjoel has joined #ruby
<[k-> a language is neveeeer enough
devoldmx has quit [Ping timeout: 240 seconds]
<[k-> if i never got off javs
<[k-> java*
<[k-> *shudder*
freerobby has quit [Client Quit]
yb_drowe has quit [Quit: Zzzzzzz....]
doosy has quit [Remote host closed the connection]
phutchins has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
hotpancakes has joined #ruby
yardenbar has joined #ruby
<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
<bnagy> and yet, still a better language to actually write software than haskell
<[k-> there is unsafePerformIO for all your needs
howdoicomputer has joined #ruby
<[k-> as i said, elixir is also a candidate
yb_drowe has joined #ruby
iooner has quit [Quit: http://www.iooner.me]
<bnagy> yawn
<TomyLobo> what's a good rest client?
iooner has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
yb_drowe has quit [Client Quit]
Vile` has quit [Ping timeout: 246 seconds]
khebbie has joined #ruby
<[k-> there is no such thing as good or bad
oleksandriuzikov has quit [Quit: Leaving.]
<[k-> only something that does the job sastisfactory or unsatisfactory
fullofcaffeine has quit [Remote host closed the connection]
<cscheib> [k-: well, let's be truthful... there is certainly bad
Vile` has joined #ruby
<[k-> :3
<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?
<ght> TomyLobo: We've used rest-client for years, all successfully, so yes, rest-client works perfectly fine.
<ght> The syntax can take some getting used to, but once you do it has worked every time so far.
<TomyLobo> thanks :)
<TomyLobo> looks fine to me
<[k-> ght finite (countable) loop?
<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.
<ght> [k-: No, it's not finite.
<TomyLobo> nah i just need json
ndrei has quit [Ping timeout: 240 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
khebbie has quit [Remote host closed the connection]
<[k-> ght i dont think theres any other way then
<ght> [k-: Thank you.
chipotles has joined #ruby
youch has joined #ruby
sdwrage has joined #ruby
k1v4n has quit [Quit: WeeChat 1.2]
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
chipotles has quit [Client Quit]
ndrei has joined #ruby
Muhannad has quit [Ping timeout: 260 seconds]
Guest84 has joined #ruby
<TomyLobo> should i use "do |foo| end" or "{ |foo| }"?
workmad3 has joined #ruby
narak has joined #ruby
<[k-> depends
<TomyLobo> are they not equivalent?
<Mon_Ouie> They have different precedence
<TomyLobo> well, for a single argument
<Mon_Ouie> `foo bar do |foo| end' is not the same as foo bar { |foo| }
ohaibbq has joined #ruby
<TomyLobo> well yeah
<Mon_Ouie> Other than that, they are functionally equivalent, but people prefer one over the other in different circumnstances
<TomyLobo> i'd actually like it to behave more like a function argument than that special snowflake syntax with the braces :)
ctalr has joined #ruby
mikecmpbll has joined #ruby
marr has joined #ruby
<TomyLobo> hnnng, you're right... do..end looks kinda bad with gsub
Respek has quit [Quit: gone to sleep. ZZZzzz…]
<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.
chinmay_dd has quit [Read error: Connection reset by peer]
basmoura_ has joined #ruby
chinmay_dd has joined #ruby
<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
<TomyLobo> can you elaborate?
<Mon_Ouie> foo bar do |foo| end is parsed as foo(bar) do |foo| … end
<Mon_Ouie> foo bar { |foo| } is parsed as foo(bar { |foo| })
<TomyLobo> oh
<TomyLobo> eww
workmad3 has quit [Ping timeout: 245 seconds]
<[k-> another convention is do..end for multiline blocks and {...} for one line (chaining)
jud has joined #ruby
basmoura has quit [Ping timeout: 256 seconds]
<TomyLobo> i'll just use do..end until it fails, since that is more consistent with the other block syntaxes
Inside has joined #ruby
Inside has joined #ruby
<TomyLobo> but "FuseFS.main() { |options| HelloDir.new }" does look nice
<TomyLobo> the one line/multiple lines rule seems the most sensible
<Mon_Ouie> It used to be the most common one. Now I feel like the second one is somewhat more popular.
chabil has quit [Ping timeout: 255 seconds]
<[k-> ohh you mentioned it
<[k-> i somehow missed it
Muhannad has joined #ruby
narak has quit []
Muhannad has quit [Max SendQ exceeded]
relix has quit [Quit: Textual IRC Client: www.textualapp.com]
Muhannad has joined #ruby
bigbadwolf has joined #ruby
fullofcaffeine has joined #ruby
bigbadwolf has quit [Client Quit]
fantazo has quit [Quit: Verlassend]
k1v4n has joined #ruby
big|bad|wolf has joined #ruby
chabil has joined #ruby
mago0 has quit [Ping timeout: 240 seconds]
Muhannad has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
mclee has quit [Ping timeout: 264 seconds]
apofis has quit [Ping timeout: 240 seconds]
tectonic has joined #ruby
h4ckurate has joined #ruby
mclee has joined #ruby
djbkd has joined #ruby
darkf has quit [Quit: Leaving]
samu has joined #ruby
<samu> Hi!
<[k-> Hi
<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)
hyy has quit [Remote host closed the connection]
<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
halcyone3 has quit [Ping timeout: 245 seconds]
<havenwood> samu: Is MySQL installed?
<samu> yes, the devel packages are also installed
<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
Guest84 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<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
casadei_ has joined #ruby
<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
djbkd has quit [Ping timeout: 244 seconds]
<samu> here's the `gem install mysql2` output: https://dpaste.de/ur9g
k1v4n has quit [Quit: WeeChat 1.2]
fedexo has quit [Ping timeout: 246 seconds]
fullofcaffeine has quit [Remote host closed the connection]
<cscheib> win 3
<cscheib> damn irssi
casadei_ has quit [Ping timeout: 260 seconds]
khapa_ has joined #ruby
khapa has quit [Ping timeout: 244 seconds]
Musashi007 has joined #ruby
<samu> crap, I have to make this work somehow ;D
Oka has joined #ruby
hotpancakes has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
howdoicomputer has quit [Ping timeout: 250 seconds]
<TomyLobo> () or no ()?
<TomyLobo> around method arguments
<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
djbkd has joined #ruby
conor_ has quit [Remote host closed the connection]
Muhannad has joined #ruby
<jhass> TomyLobo: I tend to leave them off where syntactically and semantically allowed
<jhass> but most keep them for at least method definitions
<TomyLobo> yeah i leave them for method definitions too
codecop has joined #ruby
codecop_ has joined #ruby
rehat has quit [Remote host closed the connection]
codecop_ has quit [Client Quit]
<TomyLobo> i think i'll put return everywhere too, except for one-liner blocks
h4ckurate has quit [Quit: h4ckurate]
mistermocha has joined #ruby
saddad has quit [Ping timeout: 245 seconds]
yh has joined #ruby
<Mon_Ouie> Are you sure you understand the semantics of the keyword `return' inside blocks?
<TomyLobo> oh right
<Mon_Ouie> def foo; array.each { return x }; end <- this method returns the first element of array
phutchins has joined #ruby
<TomyLobo> yeah for all blocks then :)
thiagovsk has quit [Quit: Connection closed for inactivity]
<TomyLobo> is there any way to explicitly return a value from a block btw?
<Mon_Ouie> (Well if you add the missing |x| anyway)
h4ckurate has joined #ruby
<TomyLobo> like in a short-cut if
<Mon_Ouie> Yes, using `next value'
sdwrage has quit [Quit: This computer has gone to sleep]
<TomyLobo> ah
<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
<TomyLobo> yep
<TomyLobo> and especially giving a value to "next"
<TomyLobo> are there module-local variables?
n008f4g_ has joined #ruby
hotpancakes has joined #ruby
roolo has quit [Remote host closed the connection]
<Mon_Ouie> Like @@foo? You can also simply use @foo when self is a Module (those have different semantics, of course)
<TomyLobo> module Routing
<TomyLobo> @routes = Hash.new { |h, k| h[k] = [] }
khapa_ has quit [Quit: Leaving]
<TomyLobo> like so?
<havenwood> Any RVM user on OS X want to grab master and try installing Ruby 2.2.2 with the just-uploaded precompiled binary?
phutchins has quit [Ping timeout: 256 seconds]
<Mon_Ouie> Depends on how you plan to use it, but yes, that could make sense
<havenwood> If you want to test just uninstall 2.2.2 and reinstall after a: rvm get master
jbw has quit [Ping timeout: 260 seconds]
<TomyLobo> hmm then something is wrong here...
<havenwood> A sanity check that it works on one other person's machine would be nice. ;)
yqt has joined #ruby
jbw has joined #ruby
<TomyLobo> Mon_Ouie, i'm using that from a method that is invoked from a place where the module is included
<TomyLobo> puts @routes shows an empty line
mistermocha has quit [Ping timeout: 264 seconds]
Guest84 has joined #ruby
<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
h4ckurate has quit [Quit: h4ckurate]
<TomyLobo> but then i'd always have the module's instance, right?
whiteline has quit [Remote host closed the connection]
<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)
h4ckurate has joined #ruby
<TomyLobo> i do want the routes to be independent when i add routes in multiple objects
<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?
<TomyLobo> basically a separate initializer for the module would be nice
whiteline has joined #ruby
<TomyLobo> would that be self.included?
chouhoulis has quit [Remote host closed the connection]
<TomyLobo> def self.included(base) is what i just found on stackoverflow... but the syntax looks crude
<TomyLobo> base.instance_variable_set :@example_ivar, :foo
<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
radgeRayden has joined #ruby
<Mon_Ouie> The argument of Module#included is the class that included module. Do you want one hash per class that includes the module?
<TomyLobo> nope, per instance
<TomyLobo> actually
<Mon_Ouie> Then the code you found wouldn't work (it sets an instance variable on the class itself)
<TomyLobo> i only have per-instance routes as a workaround anyway
<TomyLobo> i'd rather have things like "route_add :list, '/issues', to: :list_issues" in the class scope instead of the initializer
<TomyLobo> but still reference methods from that class
<Mon_Ouie> Are you aware of Module#extend? That looks like what you'd want
<TomyLobo> nope, lemme google it
swgillespie has joined #ruby
<TomyLobo> ah, yeah that sounds like it
arooni-mobile has joined #ruby
arooni-mobile__ has joined #ruby
<TomyLobo> how do i get something into a class-specific variable there?
fantazo has joined #ruby
<TomyLobo> specific to the extended class
conor_ has joined #ruby
<Mon_Ouie> From where? Inside your methods (e.g. route_add), @instance_variables will be specific to the class itself.
<shevy> anyone remembers offhand what ruby installs into bin/ ? I assume: ruby, irb, ri ... did I forget anything?
arooni-mobile has quit [Max SendQ exceeded]
<Mon_Ouie> Don't we also have rake and gem?
Kallis has joined #ruby
arooni-mobile has joined #ruby
<miah> erb gem irb rake rdoc ri ruby
dimasg has quit [Ping timeout: 260 seconds]
<shevy> thanks
<miah> i just did a ls ~/.rubies/ruby-2.2.2/bin
<miah> fwiw
<Mon_Ouie> That's harder to do when using your system's Ruby :p
conor_ has quit [Remote host closed the connection]
<miah> who in their right mind would do that? (unless you're running archlinux) ;)
<Mon_Ouie> That's my case, as it happens
<miah> thats the case on every one of my systems apart from my work laptop (which i'm using currently)
<yxhuvud> mon: arch, or in your right mind?
<miah> haha
AlphaAtom has joined #ruby
<Mon_Ouie> is that a xor?
dcarmich has quit [Quit: Textual IRC Client: www.textualapp.com]
<TomyLobo> some systems need ruby for system stuff
<miah> which?
<TomyLobo> so you get a system ruby
<miah> maybe opensuse, iirc yast is rewritten in ruby now
<Mon_Ouie> Doesn't Mac OS X come with stuff written in Ruby? I remember it doing so.
<TomyLobo> that would be strange
chinmay_dd has quit [Quit: Leaving]
<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/
<havenwood> Mon_Ouie: Aye, it does.
dgutierrez1287 has joined #ruby
<TomyLobo> it not being a terribly open system and all
h4ckurate has quit [Quit: h4ckurate]
<shevy> was yast written in python before?
<shevy> I think the last time I used it was like in 2006 or something like that
pawnbox has joined #ruby
<miah> shevy: python iirc
Ox0dea has quit [Read error: No route to host]
<miah> the redhat installer 'anaconda' was also python too i have no idea if thats the case these days
<mozzarella> I think they moved to python 3
Musashi007 has quit [Quit: Musashi007]
<shevy> cool
<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?
<shevy> ok I guess I misremembered... "YaST was developed in YCP ? a custom, simple, inflexible language."
<TomyLobo> (ctrl-f common idiom)
workmad3 has joined #ruby
j75 has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
<Mon_Ouie> You still see it very often, if you need to provide class and instance methods
wookiehangover has quit [Ping timeout: 246 seconds]
<TomyLobo> shevy, yep that sounds exactly like suse :D
omegamike has joined #ruby
pawnbox has joined #ruby
<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."
sarkyniin has joined #ruby
<shevy> ruby won a rare battle! \o/
aphprentice has joined #ruby
shinnya has quit [Ping timeout: 256 seconds]
<TomyLobo> by means of vendor lock-in \o/
lapide_viridi has joined #ruby
fullofcaffeine has joined #ruby
<shevy> well pick your poison from other distributions - like if you don't want systemd :)
<shevy> I am surprised that they did not pick python though
<TomyLobo> there's no way around systemd if you want a stable distribution anyway
Respek has joined #ruby
<TomyLobo> except maybe slackware or something
atomical has joined #ruby
last_staff has joined #ruby
apt-get_ has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 244 seconds]
<miah> or are running kernel 2.0 - 2.4
jgpawletko has quit [Quit: jgpawletko]
omegamike has quit [Ping timeout: 244 seconds]
wookiehangover has joined #ruby
khebbie has joined #ruby
Nieralyte has joined #ruby
apfeluser has quit [Ping timeout: 246 seconds]
<yh> shevy: yeah, python always seems to win over Ruby in these debates
<yh> I simply don't find python as intuitive or its docs as easy to dip in & out of
<yh> It's a shame. It makes me view Ruby as a product with a limited shelf-life that's looming
youch has quit [Quit: Konversation terminated!]
Musashi007 has joined #ruby
khebbie has quit [Remote host closed the connection]
Respek has quit [Quit: gone to sleep. ZZZzzz…]
sevvie has quit [Ping timeout: 252 seconds]
rehat has joined #ruby
ramfjord has joined #ruby
Nieralyte has quit [Quit: Nieralyte]
Nieralyte has joined #ruby
myztic has quit [Ping timeout: 265 seconds]
<darix> shevy: i think the factor that suse does many ruby projects wasnt that small either
sevvie has joined #ruby
tomphp_ has joined #ruby
hotpancakes has quit [Remote host closed the connection]
fullofcaffeine has quit [Remote host closed the connection]
devoldmx has joined #ruby
khebbie has joined #ruby
<shevy> good! I hope their default ruby works better than the default debian ruby :D
gsingh93 has joined #ruby
<darix> shevy: sure.
<darix> shevy: we even have a nice way to use additional MRI versions without rvm or so
arooni-mobile has quit [Ping timeout: 244 seconds]
<gambl0re> what is orm, haml and medis?..
<havenwood> gambl0re: types of sandworms
arooni-mobile__ has quit [Ping timeout: 244 seconds]
<shevy> darix how or where do the multiple versions get installed?
dcope has joined #ruby
<yh> shevy: what's wrong with debian default ruby?
<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.
yardenbar has quit [Quit: Leaving]
<yh> I deploy most apps to Docker so I wouldn't know
<shevy> hmm so you have /usr/bin/ruby2.1 too?
<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?
<shevy> yh debian changes some paths and makes some modifications such as removes 'mkmf' by default
devoldmx has quit [Ping timeout: 255 seconds]
Musashi007 has quit [Quit: Musashi007]
<darix> shevy: mkmf belongs to the devel package
<darix> if i recall correctly we have that too
<shevy> what a strange name... /usr/bin/ruby.ruby2.2
pawnbox has quit [Remote host closed the connection]
<darix> oh not anymore
<yh> shevy: removing mkmf? Such obscure madness
soxet has joined #ruby
soxet has quit [Client Quit]
hotpancakes has joined #ruby
<darix> shevy: if i ever get it building in a rpm. i also want to have ruby.rbx2.5
<darix> :)
<shevy> I guess with a rare name, conflicts would be even rarer if someone would want to use the same location at /usr/bin :)
<shevy> yeah that is very similar to debian
<darix> shevy: just consistent naming
chabil has quit [Ping timeout: 244 seconds]
<darix> gsingh93: sounds like you are using the bundle for ruby 2.2 and not 2.1
<darix> shevy: the discourse link explains it
<shevy> darix is "stat /usr/bin/ruby" a symlink?
<darix> shevy: hard link
khebbie has quit [Remote host closed the connection]
<darix> we dont want to change the default ruby. especially when things like yast sit on top of it
mistermocha has joined #ruby
<gsingh93> darix: i did `rbenv global 2.1.6; gem install bundler`
<gsingh93> shouldn't that give me the 2.1 version?
myztic has joined #ruby
<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 ^^)
<shevy> jhass I may have finally found a use case for UTF-8 - animated dancing unicode icons \o/
<havenwood> gambl0re: Asking for real?
<shevy> jhass http://jsfiddle.net/mnpenner/gm86u2jv/3/ the bottom right ones
nfk has joined #ruby
radgeRayden has quit [Ping timeout: 265 seconds]
<kallisti5> any devs have a chance to review this pull request? https://github.com/ruby/ruby/pull/984
robbyoconnor has quit [Excess Flood]
<havenwood> kallisti5: You might also try in #ruby-core though there's not much traffic there.
robbyoconnor has joined #ruby
<kallisti5> havenwood: thanks :-)
* kallisti5 hates to be the squeeky wheel... but it is such a simple patch lol
Respek has joined #ruby
Respek has quit [Client Quit]
h4ckurate has joined #ruby
mistermocha has quit [Ping timeout: 256 seconds]
Respek has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood> kallisti5: keep on squeezing! :)
h4ckurate has quit [Quit: h4ckurate]
Musashi007 has joined #ruby
dimasg has joined #ruby
phutchins has joined #ruby
<dcope> how come gsub(/\w+/i) won't catch strings with spaces?
Musashi007 has quit [Ping timeout: 255 seconds]
brain_shim has joined #ruby
<dcope> for example, https://repl.it/BAyK the words "lime green" isn't caught.
MyMind has joined #ruby
ascarter has joined #ruby
chabil has joined #ruby
big|bad|wolf has quit [Ping timeout: 264 seconds]
Sembei has quit [Ping timeout: 255 seconds]
Musashi007 has joined #ruby
dimasg has quit [Ping timeout: 256 seconds]
Musashi007 has quit [Client Quit]
ndrei has quit [Ping timeout: 256 seconds]
ndrei has joined #ruby
banister has quit [Ping timeout: 240 seconds]
radgeRayden has joined #ruby
<triangles> dcope: \w only matches on letters, numbers, and _
fantazo has quit [Quit: Verlassend]
<triangles> instead of \w, use [\w\s]
elton has quit [Read error: Connection reset by peer]
brnpcn has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<dcope> triangles: that seems to match every single letter
<dcope> gsub(/[\w\s]/i)
Mendenhall has joined #ruby
nymous has joined #ruby
bodgix has joined #ruby
<nymous> hey folks
<nymous> quick question
<nymous> is there a way to write something like this shorter?
<nymous> root.elements['//TEMPLATE/MEMORY'].nil? ? 0 : root.elements['//TEMPLATE/MEMORY'].cdatas[0].value
<apeiros> nymous: on rails/with active support you can use .try
<nymous> i have only plain ruby
<apeiros> without that, all I see is that you could use 2 statements instead of 1:
<wprice> nymous: you could write it laying on your stomach…sorry, bad joke…
<apeiros> memory = root.elements['//TEMPLATE/MEMORY']; memory ? memory.cdatas[0].value : 0
yfeldblum has joined #ruby
<nymous> i need to go through several xml entries, so i don't think adding too much variables would improve readability
tvw has joined #ruby
<dcope> triangles: ok i found an ugly solution... but it works! :)
Trynemjoel has quit [Ping timeout: 250 seconds]
sdwrage has joined #ruby
<apeiros> nymous: add your own .try then. maybe a specialized variant for your case of "if present, dig deeper, else use default"
<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
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Trynemjoel has joined #ruby
dionysus69 has quit [Quit: dionysus69]
cornerma1 has joined #ruby
mhib has quit [Remote host closed the connection]
<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 :)
kirun has quit [Quit: Client exiting]
sarkyniin has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 246 seconds]
cornerman has quit [Ping timeout: 244 seconds]
cornerma1 is now known as cornerman
wprice has quit [Quit: wprice]
_ht has quit [Quit: Konversation terminated!]
<nymous> the problem is i need to query xml for a value, but it might not exist at all
ndrei has joined #ruby
lapide_viridi has quit [Quit: Leaving]
sarmiena_ has joined #ruby
<sarmiena_> i’m experiencing a segfault with a ruby gem (twilio-ruby) when trying to run it in a threaded environment (sidekiq)
dseitz has joined #ruby
skade has joined #ruby
<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
dimasg has joined #ruby
<apeiros> nymous: why's that a problem? xpath will return nil in that case
<apeiros> which you can easily map to your default vaue via `xpath || default`
sdwrage has quit [Quit: This computer has gone to sleep]
Nahra has joined #ruby
<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
hotpancakes has quit [Remote host closed the connection]
blue_deref has quit [Quit: bbn]
h4ckurate has joined #ruby
krz has quit [Quit: WeeChat 1.2]
<nymous> apeiros: you mean something like memory = root.elements['//TEMPLATE/MEMORY'] || "0"?
basmoura_ has quit [Remote host closed the connection]
Jarboe has joined #ruby
<jhass> gsingh93: I believe there's an #rbenv
<jhass> wait, there isn't?
<havenwood> jhass: nope
<jhass> how disappointing
<jhass> I guess nobody actually uses it :P
<gsingh93> :(
<havenwood> jhass: #rvm or #chruby but tweet @DHH for rbenv support
devoldmx has joined #ruby
<jhass> I mean there could be at least a community supported one
mary5030 has joined #ruby
hotpancakes has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
sdwrage has joined #ruby
dseitz has joined #ruby
<apeiros> nymous: yes, except a) to have the .cadatas[0] part of the xpath and b) your original has 0, not "0" as default
<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?
devoldmx has quit [Ping timeout: 256 seconds]
Respek has quit [Quit: gone to sleep. ZZZzzz…]
<gsingh93> jhass: yea, ruby -v, gem -v, which ruby, and which gem all look right
ndrei has quit [Ping timeout: 240 seconds]
<gsingh93> point to the rbenv version of ruby, 2.1.6
<havenwood> gsingh93: and rehashed your shims?
einarj has joined #ruby
<gsingh93> yup
<havenwood> gsingh93: switch to chruby.
<jhass> what about which bundle?
h4ckurate has quit [Ping timeout: 255 seconds]
<jhass> :D
mary5030 has quit [Remote host closed the connection]
Jackneill has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
<havenwood> :)
hotpancakes has quit [Ping timeout: 240 seconds]
ndrei has joined #ruby
chabil has quit [Quit: WeeChat 1.2]
<gsingh93> i'm on archlinux, i have ruby-bundler installed which adds /usr/bin/bundle which selects the correct version of bundler from ~/.gems
<gsingh93> and in .gems i only have one version of bundler
<gsingh93> 10.6 i believe
<gsingh93> 1.10.6
<gsingh93> i'll give chruby a shot
<havenwood> jhass: \o/
bronson has joined #ruby
lapide_viridi has joined #ruby
<jhass> :D
dimasg has quit [Ping timeout: 264 seconds]
mistermocha has joined #ruby
einarj has quit [Ping timeout: 265 seconds]
<shevy> ohhh I just realized
<shevy> gist allows .md files
<TomyLobo> i have this in an extend method body: hash[:to] = self.method(hash[:to])
<TomyLobo> this cant find a method of the extended class
<TomyLobo> not without the "self." either
<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
bronson has quit [Ping timeout: 250 seconds]
baweaver has joined #ruby
brain_shim has quit [Ping timeout: 250 seconds]
<jhass> however if ruby -v is correct you can probably workaround with ruby -S bundle
willharrison has joined #ruby
<jhass> ?code TomyLobo
<ruboto> TomyLobo, We can't help you without your code, please post it to https://gist.github.com
mistermocha has quit [Ping timeout: 252 seconds]
Ox0dea has joined #ruby
<gsingh93> jhass: omg
<Ox0dea> TomyLobo: Module#extended takes an argument that you should use.
<gsingh93> i completely forgot about the hashbang
<gsingh93> rbenv doesn't provide a bundler shim
brain_shim has joined #ruby
<jhass> it should
<TomyLobo> >> module Foo def foo() self.method(:bar) end class Bar extend Foo def bar end end Bar.new.foo()
<ruboto> TomyLobo # => /tmp/execpad-7debe4650287/source-7debe4650287:2: syntax error, unexpected keyword_class, expecting k ...check link for more (https://eval.in/414371)
pollyprissypants has joined #ruby
<TomyLobo> oh well
<TomyLobo> >> module Foo def foo() self.method(:bar) end end class Bar extend Foo def bar end end Bar.new.foo()
<ruboto> TomyLobo # => /tmp/execpad-6b0908a24586/source-6b0908a24586:2: syntax error, unexpected keyword_class, expecting k ...check link for more (https://eval.in/414372)
<gsingh93> jhass: i tried changing the hashbang to /usr/bin/env ruby and it worked
<Ox0dea> ?experiment TomyLobo
<ruboto> TomyLobo, Please use your local irb or pry (see ?pry) to experiment, ruboto's eval functionality is for demonstration purposes only.
<TomyLobo> i give up. i'll try that argument
<gsingh93> although that's not really a proper solution, given that it's a system installed file
<jhass> gsingh93: meh, that'll break with the next bundler update
<gsingh93> but at least i know the problem now
<gsingh93> yea
<Ox0dea> TomyLobo: Module#extended and/or #super_method seem to be the methods you're looking for.
<jhass> now you know why nobody uses rbenv :P
<gsingh93> haha
<TomyLobo> undefined method `super_method' for HelloDir:Class
<jhass> too old ruby? it's new in 2.2 iirc
<TomyLobo> that might be why :)
<TomyLobo> i dont want to require more than 2.0 anyway
<TomyLobo> Ox0dea, what's p?
<Ox0dea> This guy.
<shevy> inbuilt
h4ckurate has joined #ruby
<jhass> puts obj.inspect; obj
<jhass> that's pretty much the definition of p
<TomyLobo> ah
<TomyLobo> useful
<Ox0dea> You're supposed to learn about that method on day one. :/
<TomyLobo> i guess i must have missed it :)
<jhass> yeah, too many people debug with puts instead of p
<shevy> I use double power
<shevy> pp!
<Ox0dea> ap > pp
<jhass> no, the tutorials don't mention it, the ones I've seen at least
<Ox0dea> That's ridiculous.
<shevy> pp must be superior because it is included by default
ap4y has joined #ruby
DoubleMalt has joined #ruby
<jhass> most tutorials are fairly ridiculous
<Ox0dea> shevy: Sounds like you want faster horses.
<shevy> I want flying pigs
<jhass> why not spider pigs?
<apeiros> shevy: travel back a couple of hundred years and you'll have them
<shevy> I don't like spiders that much :\
<apeiros> though I think flying cows were more popular. also usually cadavers.
<apeiros> (medieval siege tactics)
<Ox0dea> > With sufficient thrust, pigs fly just fine.
<shevy> don't say you read that ...
<Ox0dea> I did?
<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.
<shevy> you have way too much time available Ox0dea!
phutchins has quit [Read error: Connection reset by peer]
<Ox0dea> You seem to have concluded that I've read all the RFCs.
<shevy> you read a pig rfc!
<Mon_Ouie> Just read all the April's Fools RFCs
<shevy> oh damn
<shevy> I missed the date :(
bweston92 has quit [Ping timeout: 250 seconds]
<Mon_Ouie> I AM A TEAPOT
dgutierrez1287 has quit [Remote host closed the connection]
<Ox0dea> IPoAC is best 4/1 RFC.
workmad3 has joined #ruby
<apeiros> IPoAC can actually reach quite high bandwidths. but latency sucks.
omegamike has joined #ruby
lannonbr has quit [Ping timeout: 250 seconds]
h4ckurate has quit [Ping timeout: 265 seconds]
saddad has joined #ruby
yardenbar has joined #ruby
einarj has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
twistedpixels has quit [Remote host closed the connection]
<TomyLobo> it's the modem of animal-borne communication protocols
<TomyLobo> dialup modem*
Zggb has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
workmad3 has quit [Ping timeout: 246 seconds]
mcgain_ has joined #ruby
t_mmyv has quit [Quit: Textual IRC Client: www.textualapp.com]
mcgain_ has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
EllisTAA has joined #ruby
pollyprissypants has left #ruby ["Leaving"]
<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)
<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.
omegamike has quit [Ping timeout: 272 seconds]
<TomyLobo> and i cant store it with the module, since i dont get a separate instance per class (or do i?)
mcgain has quit [Ping timeout: 255 seconds]
mcgain_ is now known as mcgain
brnpcn has quit []
brnpcn has joined #ruby
fullofcaffeine has joined #ruby
<Ox0dea> TomyLobo: You can always get a reference to any class.
arup_r has joined #ruby
<Ox0dea> Could you perhaps clarify what exactly you're trying to do?
mary5030 has joined #ruby
fullofca_ has joined #ruby
lannonbr has joined #ruby
Mendenhall has quit [Ping timeout: 255 seconds]
Yzguy has joined #ruby
<Ox0dea> TomyLobo: Also, nobody seems to have shown you autovivifying Hashes:
<Ox0dea> >> auto = Hash.new { |h, k| h[k] = Hash.new &h.default_proc }; auto[1][2][3] = 4; auto
<ruboto> Ox0dea # => {1=>{2=>{3=>4}}} (https://eval.in/414374)
twistedpixels has joined #ruby
twistedpixels has quit [Excess Flood]
doosy has joined #ruby
fullofcaffeine has quit [Ping timeout: 260 seconds]
twistedpixels has joined #ruby
<TomyLobo> that's what i meant with "a little more complicated" :)
northfurr has joined #ruby
<Ox0dea> Only just.
MatthewsFace has joined #ruby
Yzguy has quit [Ping timeout: 264 seconds]
<TomyLobo> >> module M; def mm(); puts method(:cm); end; end; class C; C.extend M; def cm(); puts 'cm'; end; mm; end
<ruboto> TomyLobo # => undefined method `cm' for class `Class' (NameError) ...check link for more (https://eval.in/414375)
<TomyLobo> i want to get cm by name, from mm
<apeiros> TomyLobo: extend adds class methods
<apeiros> not instance methods
j4cknewt has joined #ruby
<TomyLobo> so i cant even get an unbound method?
<apeiros> ah, i see, you are using it as a class method, but you query for a class method
<Ox0dea> TomyLobo: I showed you how to do so?
<apeiros> A.method(:foo) gives you the method you'd call as A.foo
<TomyLobo> i dont have A
<apeiros> *sob*
<TomyLobo> i'm in a module's method
<apeiros> C.method(:cm) gives you the method you'd call as C.cm
<apeiros> you don't define a method C.cm. You define a method C.new.cm. an instance method.
<TomyLobo> yeah i dont have C either, unless i get that as "self"... let me check
<apeiros> yes, you're in a module's method which you added as a class method.
<apeiros> right. there. in. your. own. friggin. example.
<TomyLobo> in that example i threw stuff together the way i thought it could work and got an error telling me it doesn't
tomphp_ has joined #ruby
<apeiros> and I told you why. but you don't seem to be interested in the reasons.
* apeiros off, better stuff to do.
mago0 has joined #ruby
<TomyLobo> oh, now i get what you're saying
<TomyLobo> sorry, was a bit thick there
f4cl3y__ has joined #ruby
<TomyLobo> >> module M; def mm(); puts instance_method(:cm); end; end; class C; C.extend M; def cm(); puts 'cm'; end; mm; end
<ruboto> TomyLobo # => #<UnboundMethod: C#cm> ...check link for more (https://eval.in/414376)
blue_deref has joined #ruby
shellie__ has quit [Quit: leaving]
shellie_ has joined #ruby
Guest84 has quit [Quit: Textual IRC Client: www.textualapp.com]
nofxx has joined #ruby
sdwrage has joined #ruby
Rutix has quit []
vdamewood has joined #ruby
skade has joined #ruby
rehat has quit [Read error: Connection reset by peer]
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
brnpcn has quit []
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tectonic has quit []
dimasg has joined #ruby
DoubleMalt has quit [Ping timeout: 240 seconds]
j4cknewt has quit [Remote host closed the connection]
f4cl3y__ has quit [Ping timeout: 246 seconds]
greenarrow has quit [Read error: Connection reset by peer]
<TomyLobo> >> module M; def mm(); @mv = 'mvvalue'; end; end; class C; extend M; def cm(); puts @@mv; end; mm; end; C.new.cm
<ruboto> TomyLobo # => uninitialized class variable @@mv in C (NameError) ...check link for more (https://eval.in/414377)
<TomyLobo> does this mean an instance variable of the class isnt the same as a class variable or am i doing something wrong?
hotpancakes has joined #ruby
elton has joined #ruby
dimasg has quit [Ping timeout: 260 seconds]
<Ox0dea> TomyLobo: Instance variables are for instances.
yardenbar has quit [Ping timeout: 265 seconds]
<TomyLobo> Ox0dea, but classes are first-class object, right?
<TomyLobo> +s
<Ox0dea> Methods can accept and return classes, sure, but I fail to see the relevance in this case.
dented42 has joined #ruby
<Ox0dea> Instance variables are never "shared"; that would sort of defeat the purpose.
<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
<Ox0dea> Nope.
<Ox0dea> Literal instance variables go on self.
<TomyLobo> i meant C's, not C.new's
<TomyLobo> and as i said, self is C
sargas has joined #ruby
sargas has quit [Remote host closed the connection]
<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
<ruboto> TomyLobo # => true ...check link for more (https://eval.in/414378)
devoldmx has joined #ruby
<Ox0dea> TomyLobo: You're putting the instance variable on C, not instances of C.
arup_r has quit [Quit: Leaving]
last_staff has quit [Ping timeout: 255 seconds]
Motoservo has joined #ruby
BTRE has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 252 seconds]
rehat_ has joined #ruby
yardenbar has joined #ruby
h4ckurate has joined #ruby
northfurr has quit [Quit: northfurr]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
BTRE has joined #ruby
aphprentice has quit [Read error: Connection reset by peer]
codecop has quit [Remote host closed the connection]
tkuchiki has joined #ruby
exadeci has joined #ruby
decoponio has quit [Quit: Leaving...]
Rinzlit1 has quit [Read error: Connection reset by peer]
sarmiena_ has quit [Quit: sarmiena_]
h4ckurate has quit [Ping timeout: 265 seconds]
<shevy> he also mixes @mv with @@mv
Rinzlit1 has joined #ruby
<Ox0dea> Yes, but I think that was intentional, evincing his confusion.
jamesaxl|2 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
tkuchiki has quit [Remote host closed the connection]
nahtnam has joined #ruby
Ann has quit [Ping timeout: 246 seconds]
f4cl3y__ has joined #ruby
cashnguns has quit [Ping timeout: 244 seconds]
mcgain has quit [Quit: mcgain]
doosy_ has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Yzguy has joined #ruby
Ann has joined #ruby
EllisTAA has joined #ruby
niemcu has quit [Ping timeout: 240 seconds]
doosy has quit [Ping timeout: 245 seconds]
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
workmad3 has joined #ruby
mcgain has joined #ruby
Ann has joined #ruby
tkuchiki has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
workmad3 has quit [Ping timeout: 250 seconds]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Trynemjoel has quit [Ping timeout: 245 seconds]
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Trynemjoel has joined #ruby
doosy_ has quit []
ohaibbq has quit [Remote host closed the connection]
ohaibbq has joined #ruby
ahuman has joined #ruby
lapide_viridi has quit [Quit: Leaving]
<Inside> Hey guys ~ web server question here.
<Inside> Um.... I... am not understanding what roles rack/nginx/rails/etc serve; ie: how the whole stack works together
<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
<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.
ahuman_ has quit [Ping timeout: 250 seconds]
<apeiros> and rack is the layer between webserver and framework. like a database independence layer for databases.
<Inside> okay so something like WEbrick serves as both nginx/rack?
<apeiros> no
<apeiros> webrick serves as nginx
<apeiros> rack is still in there
* Inside scratches his head.
<apeiros> just that there you could have ruby without rack in between
ahuman has quit [Remote host closed the connection]
<apeiros> rack still serves the same purpose - it makes all webservers look the same to the webframework.
<Inside> ahh
<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.)
lordkryss has joined #ruby
ahuman has joined #ruby
allcentury has joined #ruby
devbug has joined #ruby
<havenwood> Inside: Maybe try making a plain vanilla Rack app.
<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.
j4cknewt has joined #ruby
<Inside> I think I even spoke to you a couple of days ago :P
<apeiros> Inside: or from the other side: rack makes all webframeworks look the same to the webserver
skade has quit [Quit: Computer has gone to sleep.]
<apeiros> as said, it works similar to how a DBI works for databases.
<havenwood> Inside: Rails is one of many optional Rack adapters.
<Inside> well, I get that
<havenwood> Inside: You can not use a Rack adapter at all and make a pure Rack app.
<Inside> from your example :D
<apeiros> and middleware fits into that picture as stuff the request goes through before or after reaching the webframework
<Inside> and why do we want middleware?
<apeiros> because you don't want to code against each webframework but still have shared interests
<apeiros> take a look at some existing middleware. many things are not framework specific.
SCHAAP137 has quit [Remote host closed the connection]
shazaum_ has joined #ruby
mistermocha has joined #ruby
shellie_ has left #ruby [#ruby]
devoldmx has joined #ruby
mistermo_ has joined #ruby
Pisuke has joined #ruby
workmad3 has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
MyMind has quit [Ping timeout: 260 seconds]
<Yzguy> anyone got a moment to look at my code for a sec, can't figure out why it won't print
<Yzguy> value from optprase
<Yzguy> parse
<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
<Inside> interesting
<Radar> Yzguy: !gist
<Radar> Yzguy: ?gist
<Radar> ?gist
<ruboto> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<Radar> Finally.
<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
devoldmx has quit [Ping timeout: 244 seconds]
<Yzguy> it only outputs " , "
yardenbar has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 260 seconds]
dtcristo has joined #ruby
mary5030 has quit [Remote host closed the connection]
mistermo_ has quit [Ping timeout: 265 seconds]
<Inside> that's weird
<Inside> oh wait
<Yzguy> I'm probably missing something basic, but just trying to dabble with ruby
Mendenhall has joined #ruby
<Yzguy> and can't seem to figure it out
Symbiosisz has joined #ruby
perturbation has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
ruby-lang853 has joined #ruby
arooni-mobile has joined #ruby
<Inside> has something to do with how you're specifying the options to .on()
DLSteve has quit [Quit: Leaving]
arooni-mobile__ has joined #ruby
lannonbr has quit [Quit: WeeChat 1.2]
arooni-mobile has quit [Max SendQ exceeded]
<ruby-lang853> hey @rob_ can u pm me please.
arooni-mobile has joined #ruby
<Inside> actually I have no idea
<Inside> this baffles me.
gard has quit [Ping timeout: 246 seconds]
<Yzguy> i got it
<Yzguy> so the
<Yzguy> --first
<Yzguy> needs to be like
<Yzguy> --first FIRST
<Yzguy> or it won't work
<Inside> oh
<Inside> cause --first means no argument
<Inside> ha
<Yzguy> :P well guess we both learned something
<Inside> "Long style switch:" specifies a long style switch which takes a mandatory, optional, or no argument.
<Inside> wump wump
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdwrage has joined #ruby
<Yzguy> boom, tis working :D
Yzguy has quit [Quit: Zzz...]
<Inside> come baaack
dgutierrez1287 has joined #ruby
brnpcn has joined #ruby
CanTonic has joined #ruby
whiteline has quit [Quit: Leaving]
<Ox0dea> Well, that wasn't very wise.
allcentury has quit [Ping timeout: 272 seconds]
yqt has quit [Ping timeout: 240 seconds]
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
<Inside> why not
danieli has quit [Ping timeout: 240 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dgutierrez1287 has joined #ruby
mikefulcher has joined #ruby
GnuYawk has quit [Read error: Connection reset by peer]
perturbation has quit [Quit: Leaving]
<Inside> hmmm.. after reading up on how thin runs, a bit more of rail starts to sorta almost make sense
mikefulcher has quit [Client Quit]
danieli has joined #ruby
danieli has quit [Changing host]
danieli has joined #ruby
sarkyniin has joined #ruby
mrf has joined #ruby
j4cknewt has quit [Read error: Connection reset by peer]
j4cknewt has joined #ruby
allcentury has joined #ruby
Rinzlit1 is now known as Rinzlit
basmoura has joined #ruby
<shevy> Ox0dea why does this not work at parse time :( http://pastie.org/10340551
whiteline has joined #ruby
<Ox0dea> Inside: I was punning on Yzguy's nick.
<Inside> oh
* Inside pokerface.
petersaints has quit [Quit: ZNC - http://znc.in]
<Ox0dea> shevy: Foo[:one] isn't a method...
Axy has joined #ruby
Axy has joined #ruby
Yzguy has joined #ruby
<Ox0dea> Blocks can only be attached to method calls.
<shevy> but but but ... [] !
<Ox0dea> Yeah, I see what you mean now.
dgutierrez1287 has quit [Remote host closed the connection]
<Ox0dea> Foo.[](i) { :two } works, so I guess your example should too.
<shevy> ah you mean with the .
GeissT has joined #ruby
<shevy> sneaky method calls that hide the .
baroquebobcat has joined #ruby
<Ox0dea> Very sneaky. Sexy syntax uber alles, though.
simoz1111117 has joined #ruby
Mia has quit [Ping timeout: 244 seconds]
<shevy> how many method invocations can avoid the . by default? [] ? would -> also count to that? anything else?
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
<Ox0dea> >> 1.+(2) # shevy
<ruboto> Ox0dea # => 3 (https://eval.in/414414)
brnpcn has quit []
<Ox0dea> There are so many implicit method calls.
<shevy> hmm
<Rinzlit> Does ruboto remember strings?
rasengan has joined #ruby
<Ox0dea> Of course not.
<shevy> so ... [] -> + - / * ^ ...
<Rinzlit> Oh, and I found out metasploit was made with ruby
<Rinzlit> I must try harder to learn ruby! :D
<shevy> :\ :/
<Ox0dea> >> Fixnum.instance_methods.select { |m| m[/^\W+$/] } # shevy
<ruboto> Ox0dea # => [:-@, :+, :-, :*, :/, :%, :**, :==, :===, :<=>, :>, :>=, :<, :<=, :~, :&, :|, :^, :[], :<<, :>>, :+@ ...check link for more (https://eval.in/414415)
<shevy> what a strange way to get to fame
<shevy> metasploit
<Ox0dea> Why strange?
<shevy> why not code for love and peace instead
<Ox0dea> Whitehats use msf.
<Rinzlit> shevy that sounds wonderful but I doubt that makes as much money
<shevy> what is -@ ?
michael_mbp has quit [Excess Flood]
<Ox0dea> Unary minus.
<shevy> half of those things look like smileys
<Ox0dea> >> class Foo; def -@; :foo end end; -Foo.new
<ruboto> Ox0dea # => :foo (https://eval.in/414416)
brnpcn has joined #ruby
simoz1111117 has quit [Ping timeout: 252 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Rinzlit> Ox0dea, what is msf? I couldn't find it from duckduckgo
<Ox0dea> This guy.
dgutierrez1287 has joined #ruby
Ropeney has joined #ruby
michael_mbp has joined #ruby
<Ox0dea> It's what people who actually use Metasploit call Metasploit.
arooni-mobile has quit [Ping timeout: 244 seconds]
<Rinzlit> Ox0dea, I just wanna learn to be a badass script kiddie D:
arooni-mobile__ has quit [Ping timeout: 244 seconds]
<shevy> yeah see
<Ox0dea> How tragic.
<shevy> use php
<Rinzlit> shevy php is harder and doesn't get paid as much .-.
<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?
<Ox0dea> Inside: If you're really sure they don't need to coordinate, that should do.
<Inside> huh
<Inside> I don't get why it took me that long to come to that conclusion, haha.
mago0 has quit [Ping timeout: 244 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
rehat_ has quit [Read error: Connection reset by peer]
dgutierrez1287 has quit [Ping timeout: 240 seconds]
whiteline has quit [Quit: Leaving]
mago0 has joined #ruby
whiteline has joined #ruby
lannonbr has joined #ruby
bodgix has quit [Ping timeout: 256 seconds]
tkuchiki has quit [Remote host closed the connection]
rehat has joined #ruby
ecksit has joined #ruby
_blizzy_ has joined #ruby
<ecksit> heya, where is the documentation on what `%()` is? i found some docs on `%q()` but nothing on it
<Mon_Ouie> %(…) is like %Q(…)
fullofca_ has quit [Quit: Leaving...]
<ecksit> is it an alias? or "like"
<shevy> >> %( abc )
<ruboto> shevy # => " abc " (https://eval.in/414419)
<shevy> >> %Q( abc )
<ruboto> shevy # => " abc " (https://eval.in/414420)
<shevy> looks to be identical so I would assume it is an alias
_blizzy_ has quit [Read error: Connection reset by peer]
<Mon_Ouie> They behave in exactly the same way in all regards (escaping, string interpolation, which characters you can use to delimit the strings, …)
iamninja has quit [Ping timeout: 256 seconds]
mistermocha has joined #ruby
Vile` has quit [Ping timeout: 250 seconds]
_blizzy_ has joined #ruby
maletor has joined #ruby
yh has quit [Ping timeout: 240 seconds]
Vile` has joined #ruby
baroquebobcat has joined #ruby
dgutierrez1287 has joined #ruby
Channel6 has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
sdwrage has quit [Quit: This computer has gone to sleep]
mistermocha has joined #ruby
baroquebobcat has quit [Client Quit]
duoi has quit [Max SendQ exceeded]
ruby-lang853 has quit [Ping timeout: 246 seconds]
<Ox0dea> >> %{this is } + %}insane}
<ruboto> Ox0dea # => "this is insane" (https://eval.in/414421)
<shevy> lol
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Mon_Ouie> I also like that you can still use '{' and '}' inside those strings, as long as they are paired up correctly
charliesome has joined #ruby
Klumben has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
duoi has joined #ruby
yh has joined #ruby
<Ox0dea> >> %'a''b' # sneaky
<ruboto> Ox0dea # => "ab" (https://eval.in/414422)
Klumben has joined #ruby
mistermocha has quit [Ping timeout: 252 seconds]
hotpancakes has quit [Remote host closed the connection]
<eam> Ox0dea: now that's interesting, string literals only statically concat when the second one is "" or ''? But not %{} ?
<eam> (but the first can be?)
<eam> seems like a bug
rbennacer has joined #ruby
<Ox0dea> Could well be.
<shevy> two detective cats investigate on the scene
<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
workmad3 has quit [Ping timeout: 246 seconds]
<Mon_Ouie> As it happens String#% followed by a hash even makes sense
<Ox0dea> Aye, that String#% is a thing means 'a'%'b' really shouldn't do concatenation.
<eam> Mon_Ouie: %{} is string literal in the parser, yeah?