charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruby-lang180 has joined #ruby
KnownSyntax has joined #ruby
shinnya has quit [Ping timeout: 246 seconds]
dr3w has quit [Ping timeout: 260 seconds]
RobertBirnie has quit [Ping timeout: 252 seconds]
KnownSyntax has quit [Changing host]
KnownSyntax has joined #ruby
bruno- has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
KnownSyntax has quit [Quit: Leaving]
<ruby-lang180>
Pushing an element to an array using `<<` or `Array#push` returns the array itself. How can I add a new element to an array have it return just the newly-added element?
KnownSyntax has joined #ruby
Encapsulation has quit [Read error: Connection reset by peer]
lucyinthesky has joined #ruby
robh71 has joined #ruby
Encapsulation has joined #ruby
bruno- has quit [Ping timeout: 272 seconds]
<Ropeney>
ruby-lang180: Quick hackish would be array.push(1).last ?
nofxx has joined #ruby
nofxx has joined #ruby
crack_user has joined #ruby
allcentu1 has joined #ruby
christiandsg has joined #ruby
lucyinthesky has left #ruby ["Leaving"]
marius has joined #ruby
dopamean_ has joined #ruby
marius has quit [Client Quit]
<shevy>
yeah well
<shevy>
if you already add the element to your array
<shevy>
you already have that element :)
christiandsg has quit [Ping timeout: 265 seconds]
<pipework>
ruby-lang180: You have the ability to get a reference already by pushing it on the array.
axsuul has quit [Read error: Connection reset by peer]
<KensoDev>
ruby-lang180: why not just arr.push(element);element
<KensoDev>
If you already have the element you are passing in, you can just return it from your method.
<KensoDev>
am I misunderstanding what you want to accomplish?
<pipework>
Or if you want to be funny, element.tap {|el| arr << el }
oleksandriuzikov has quit [Quit: Leaving.]
<ruby-lang180>
I was just wondering if there was a simpler way to do it than push(foo).last
jgt1 has quit [Ping timeout: 250 seconds]
ishahnaz has quit []
<pipework>
ruby-lang180: Sure.
troulouliou_div2 has quit [Quit: Leaving]
<pipework>
foo.tap {|el| arr << el } would definitely always return foo
<havenwood>
ruby-lang180: array << item; item
<EllisTAA_>
Can someone clarify something for me. is parallelism when you use two processors, and concurrency when you use one?
<pipework>
though it might no longer be the last item in the array.
vF3hNGxc47h8 has joined #ruby
techsethi has joined #ruby
RegulationD has joined #ruby
pen-soldier has quit [Quit: Leaving]
<toretore>
EllisTAA_: yes, mostly
bruno- has joined #ruby
vF3hNGxc47h8 has quit [Ping timeout: 246 seconds]
<havenwood>
EllisTAA_: Imagine there's a Global VM Lock and two cores alternate which has the lock. Is that concurrent? Is that parallel?
<EllisTAA_>
i dont’ know what a lock is
<EllisTAA_>
:P
<havenwood>
EllisTAA_: Aha! No prob.
<havenwood>
EllisTAA_: Are you familiar with Ruby's Mutex?
<EllisTAA_>
nope, should i look it up
binaryplease1 has quit [Ping timeout: 250 seconds]
<toretore>
EllisTAA_: concurrency is boiling rice and pasta at the "same time" by using one heating element and switching between the two; parallelism is boiling rice and pasta at the same time by using two heating elements
keen______ has joined #ruby
<havenwood>
EllisTAA_: But you can run code concurrently on one or more cores, but they may or may not be running in parallel.
<toretore>
s/element/cpu/; s/rice|pasta/program/
tmtwd has quit [Quit: Leaving]
<EllisTAA_>
toretore: nice!
keen_____ has quit [Ping timeout: 265 seconds]
jackjackdripper has quit [Quit: Leaving.]
michaeldeol has joined #ruby
dr3w has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
robh71 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
frem has quit [Quit: Connection closed for inactivity]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
eminencehc has quit [Remote host closed the connection]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chuy has joined #ruby
sevenseacat has joined #ruby
oo_ has joined #ruby
pengin has quit [Remote host closed the connection]
<ght>
You know, it's funny, when we set out on the app building wing of our company, we were choosing between base languages: Phython, PHP, and Ruby
nettoweb has joined #ruby
<ght>
and it never ceases to amaze me how the Python guys try to act elitist, despite it being, from all accounts, more simplistic than Ruby.
nisstyre has quit [Remote host closed the connection]
rahult is now known as rahult_
cajone has joined #ruby
<diegoaguilar>
yeah I somehow think that Go will be a dominant language soon
<Nilium>
It more or less already is.
mgorbach has joined #ruby
<diegoaguilar>
I dont know why or how it got more and more popular
<diegoaguilar>
python, nodejs and node
<diegoaguilar>
alongside Assembly, C/C++ :P
<Nilium>
Probably whiplash from node.js and Python and co.
Mojo_Nixon has joined #ruby
rahult_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
devoldmx has joined #ruby
<Nilium>
i.e., everything got so collectively stupid and hard to maintain that Go ended up being the "ok, we need to be able to read this a month later" option
ruby-lang180 has quit [Ping timeout: 246 seconds]
gilest has quit [Quit: Leaving...]
umgrosscol has joined #ruby
andywojo has joined #ruby
icarus has quit [Ping timeout: 250 seconds]
jeadr has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 250 seconds]
pragmatism has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
andywojo has quit [Client Quit]
jtdoncas has joined #ruby
jeadr has joined #ruby
oo_ has quit [Remote host closed the connection]
Vile` has quit [Remote host closed the connection]
veduardo has quit [Ping timeout: 272 seconds]
renderful has joined #ruby
rubie has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 244 seconds]
phutchins1 has quit [Ping timeout: 252 seconds]
Vile` has joined #ruby
TheNet has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 245 seconds]
da3mian has quit [Remote host closed the connection]
renderful has quit [Ping timeout: 265 seconds]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
eminencehc has joined #ruby
Guest91143 has joined #ruby
oo_ has joined #ruby
uptownhr has joined #ruby
speaking1ode has quit [Ping timeout: 255 seconds]
axsuul has joined #ruby
_blizzy_ has quit [Ping timeout: 260 seconds]
maletor has quit []
veduardo has joined #ruby
rubie has joined #ruby
howdoico1 has joined #ruby
casadei_ has joined #ruby
Guest91143 has quit [Quit: leaving]
sdfgsdfg has joined #ruby
radgeRayden has joined #ruby
choppington has quit [Ping timeout: 244 seconds]
Vile` has quit [Remote host closed the connection]
dr3w has quit [Ping timeout: 255 seconds]
Vile` has joined #ruby
howdoico1 has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
attamusc has quit [Quit: Connection closed for inactivity]
eminencehc has quit [Remote host closed the connection]
tkuchiki has joined #ruby
guih has joined #ruby
iwaffles has quit [Quit: iwaffles]
Vile` has quit [Remote host closed the connection]
tmtwd has quit [Remote host closed the connection]
<mwlang>
nofxx: better to do that sort of thing client side —hard to know how big the text’s rendering on user’s device and margins and all that which comes after the browser calculates the layout and flow.
<Radar>
Ox0dea: that feature baweaver was talking about yesterday for bad name detection is now in helpa. It'll message the ops channel if it detects one. Your !ops calls are still welcome :)
<nofxx>
mwlang, no, that one isn't text 'fitting' is acronym/abbr smallcaps, literal quotes
dopie has joined #ruby
<nofxx>
those kinds of fanciness
TheNet has joined #ruby
<nofxx>
hence compiling at write time isn't such bad idea
<Aeyrix>
You realise you can do that client-side, right?
<Aeyrix>
With this new-ish thing called cascading stylesheets.
<Ox0dea>
Those are still in beta, no?
<Aeyrix>
v3 beta, yeah.
JoshGlzBrk has joined #ruby
<mwlang>
Ah — I saw the “soft hyphen insertion, optical margin outdents” part, which is sensitive to where the words fall on the page.
<mwlang>
I guess I read too much into it.
<nofxx>
Aeyrix, not all of that... but eitherway, know any lib?
<Ox0dea>
Radar: Does it watch /nick?
jpfuentes2 has joined #ruby
<Aeyrix>
Why are you using a library for something like that
<Aeyrix>
why not just do it like a normal human being
<Radar>
Ox0dea: it watches join events
<shevy>
lol
veduardo has quit [Ping timeout: 245 seconds]
<shevy>
a normal human being :)
<Ox0dea>
Radar: In that case, I apologize for airing the idea.
<nofxx>
Aeyrix, and reinvent the wheel? not following. What's the magical line?
<Radar>
Ox0dea: :P
helpa has quit [Remote host closed the connection]
<Aeyrix>
nofxx: lol
<Ox0dea>
mwlang: Something about that message borked WeeChat.
helpa has joined #ruby
<Ox0dea>
Your message spilled over into the nicklist.
<mwlang>
nofxx: no, I try to avoid going to fanciful places like that.
yashinbasement has quit [Read error: Connection reset by peer]
<mwlang>
Ox0dea: man…I copied and pasted from that typeset page…another good reason not to use it. :-D
christiandsg has quit [Ping timeout: 265 seconds]
<baweaver>
just happened to have a spare 30 minutes, so I made a quick addition for it.
paulcsmith has joined #ruby
sdwrage has joined #ruby
<mwlang>
sometimes I think improvements 30 minutes or an hour at a time are the best ones.
<mwlang>
they add up after a while.
<nofxx>
mwlang, typography isn't all that superfluous. Gave Jobs at least a helluv speech.
<mwlang>
nofxx: not saying typography itself is a bad thing. I pay a lot of attention to it…but I don’t get into the kinds of details that library does.
reset has joined #ruby
umgrosscol has quit [Quit: Quit]
<mwlang>
I am more like Pixar with their details…If you watch closely, they do super hi-res rendering only 10% of the time and usually only the most memorable frames…but the overall product still shines and looks finished/polished.
<shevy>
yeah lot of polishing
<mwlang>
that’s what I do in typography and web design overall as well. Put the extra details in where it matters most and has high impact. Everything else done quickly and effciently.
<shevy>
more animated gifs!
<nofxx>
hm, not so sure with that analogy. A frame goes by , a screen the user can lean the head forwards and backwards at will
<nofxx>
but anyway, that wasn't meant for paragraphs of an app, but a wiki
framling has quit [Remote host closed the connection]
<mwlang>
nofxx: for example…if I’m going to put a big bold statement on a page that’s meant to gawk at, then I’ll do the whole curly quotes left and right hanging and fancy font and great gradient background and whatnot there.
<sevenseacat>
Aeyrix: lol
<mwlang>
but anywhere else, I just use straight up double quotes, etc.
<Aeyrix>
Pull requests welcome.
chipotle has quit [Quit: cheerio]
yashinbasement has joined #ruby
<nofxx>
Aeyrix, asks how to use RVM
<Aeyrix>
>someone links Radar's chruby guides
<nofxx>
mwlang, yup... but in my case is user edited text
<sevenseacat>
I get pinged every time someone mentions R4IA
<Aeyrix>
heh
<Radar>
Aeyrix: Only 9 entries?
<Aeyrix>
Radar: Pull requests welcome. ;)
<Aeyrix>
Making a repo for it now on memeci.de
ponga has joined #ruby
howdoico1 has joined #ruby
<shevy>
Aeyrix you could extend that chart to make a game - the labyrinth of death. find the right questions, for the proper answers to lead you out of the deadly maze!
<Ox0dea>
"Memeci" looks like an Italian name.
shoutsid has quit [Remote host closed the connection]
<mwlang>
sevenseacat: even in gists?
devoldmx has joined #ruby
lannonbr has quit [Quit: WeeChat 1.2]
jeadr has quit [Remote host closed the connection]
choke has joined #ruby
<baweaver>
R4IA?
<Aeyrix>
Okay I need four more.
<Aeyrix>
All current requests are in.
<nofxx>
Aeyrix, user is looking for a way to write JS with ruby
<Aeyrix>
Ox0dea: meme-cide
<Aeyrix>
:^)
jeadr has joined #ruby
<Radar>
baweaver: Rails 4 in Action aka the best book written about Rails.
<baweaver>
Oh I know
<mwlang>
Aeyrix: “mwlang asks a question that goes unanswered while everybody engages the rude clueless newbie”
<mwlang>
:-)
<sevenseacat>
until I write another one.
<Aeyrix>
mwlang: lmao
<baweaver>
just tagging with R4IA because R$IA
<Aeyrix>
mwlang: I'll file that under "someone is angry that their question goes unanswered" ;)
<baweaver>
dangit, botched that last R4IA
fedexo has joined #ruby
<mwlang>
c/angry/miffed
<mwlang>
:-)
<Radar>
Who's question are we talking about?
* Radar
has the attention span of an oh nevermind
<Aeyrix>
ONE MORE
* baweaver
scrolls up in an obliged sense of slight guilt
<sevenseacat>
mwlang: yeah I get that sometimes, the question-being-ignored part. kinda frustrates me, but eh.
devoldmx has quit [Ping timeout: 255 seconds]
<Aeyrix>
last call for alcohol
<mwlang>
baweaver: no unanswered questions by me tonight. :-p
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
yfeldblum has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
yfeldblum has quit [Remote host closed the connection]
<mwlang>
Aeyrix: Radar busts github and can’t get work done.
<Radar>
mwlang: that happened once!
<Aeyrix>
loooool
<baweaver>
You mean other people don't crash their corporate githubs to get out of work?
<baweaver>
er...
yfeldblum has joined #ruby
<baweaver>
not that I've done that before
<mwlang>
I think I’ve crashed github once…many years ago.
<baweaver>
It's not hard is the bad part
<baweaver>
just saturate it with REST requests
<mwlang>
early unicorn days.
cibs_ is now known as cibs
<mwlang>
heh…was attempting to automate repo setup and was running (gasp) automated tests and accidentally put one of the specs into infinite loops. github was down for a couple hours after that.
<baweaver>
Someone said their remote execution for orchestration was safe once at another job
<baweaver>
so I put a fork bomb in the text field and asked them if they were feeling lucky
<Psi-Jack>
Trying to find a similar queuing method as EM::Connection to handle stuffing new objects into a queue to be handled by EventMachine. Anyone have any thoughts? Something like the Endpoints + RelayConnectionHandler as per https://gist.github.com/erenfro/177045fef620e2aaac6f
<mwlang>
used it on a goliath project a few years back…no idea if it’s similar queuing method
<Psi-Jack>
Hmmm, RabbitMQ might be interesting. Sensu already uses RabbitMQ as-is.
baroquebobcat has quit [Quit: baroquebobcat]
astrobun_ has joined #ruby
Asher has quit [Quit: Leaving.]
Mia has quit [Read error: Connection reset by peer]
<mwlang>
alright, gots some good music on and grooving again…the blues have subsided and I’m ready to tackle this obnoxious code.
Mia has joined #ruby
Asher has joined #ruby
techsethi has joined #ruby
yashinbasement has quit [Quit: Leaving]
towski_ has quit [Remote host closed the connection]
arooni-mobile has joined #ruby
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mistermocha has joined #ruby
n_blownapart has joined #ruby
finisherr has quit [Quit: finisherr]
finisherr has joined #ruby
metamp has quit [Ping timeout: 250 seconds]
<Psi-Jack>
mwlang: Hmmm... Definitely considering this idea. Could tie it right in with the rest of things. Just wonder how I could make a sensu extension to initialize the worker as a threaded process or so, initially, and the event handler simply just push things to queue while the thread watches said queue.
mistermocha has quit [Ping timeout: 244 seconds]
rubie has joined #ruby
RegulationD has joined #ruby
RickHull has joined #ruby
<mwlang>
Psi-Jack: not sure…I haven’t used EM in a while.
chouhoulis has quit [Read error: Connection reset by peer]
dimasg has joined #ruby
chouhoulis has joined #ruby
<mwlang>
I just happened to remember RabbitMQ from that one project and it seemed to work well.
<Psi-Jack>
Hehe. Well, it gives me ideas at the least. ;)
<Psi-Jack>
Why make a queue, when one already exists? ;)
<mwlang>
just fill ‘er up!
techsethi has quit [Quit: techsethi]
RegulationD has quit [Ping timeout: 240 seconds]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Swappticon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Aeyrix>
like actual JS
<Aeyrix>
no jQuery
<Aeyrix>
give me an award please
radgeRayden_ has quit [Ping timeout: 265 seconds]
reset has quit [Quit: Leaving...]
kp666 has joined #ruby
* mwlang
faxes Aeyrix a pizza
<Aeyrix>
wew tbh
<Aeyrix>
also
<Aeyrix>
bingo written
<mwlang>
Aeyrix: did you test it on IE6? :-)
<Aeyrix>
I automatically redirect anyone using any version of IE to getfirefox.com
<Aeyrix>
I literally don't even care.
howdoico1 has joined #ruby
Yzguy has quit [Quit: Zzz...]
<mwlang>
man, that automatically kills more than half the bot crawlers hitting your site. how cruel!
ramfjord has joined #ruby
<mwlang>
why any kiddie scripts choose to impersonate IE instead of FF or Chrome is beyond me.
rahult is now known as rahult_
rahult_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
baroquebobcat_ has joined #ruby
arescorpio has quit [Quit: Leaving.]
baroquebobcat_ has quit [Ping timeout: 245 seconds]
<Aeyrix>
mwlang: I hide it behind CloudFlare anyway.
<Aeyrix>
*shrugs*
<mwlang>
good place to hide.
<Aeyrix>
Why the hell is this taking "a few hours"
<Aeyrix>
;_;
<Aeyrix>
mwlang: I love Cloudflare tbh
<Aeyrix>
they've tanked some fierce DDoS
<Aeyrix>
for free™
<mwlang>
Aeyrix: same here. I have all my own stuff behind them, but can’t seem to convince a single customer to use ‘em too. They’re suspicious of “free security”
<Aeyrix>
Heh.
opensource_ninja has quit [Remote host closed the connection]
webopsx has joined #ruby
<Aeyrix>
They more than make a profit with their business / enterprise plans.
<Aeyrix>
It's basically like insurance.
<Ox0dea>
Aeyrix: ELI5 why tanking is still the best (only?) way to handle DDsoS.
webopsx has quit [Client Quit]
<mwlang>
yeah. network ops who are too close to their own servers. :-p
<Aeyrix>
oh boy
<Aeyrix>
Ox0dea: Basically the way the Internet is built, there isn't much of another way.
<Ox0dea>
ELI5 why that is so?
<Aeyrix>
Because there's no way to stop people sending unwarranted letters to your postbox *until* it gets to your postbox.
gilest has left #ruby ["Leaving..."]
<Aeyrix>
So your only option is security at the postbox.
<Aeyrix>
You can't relay that decision across the globe's post services.
<Ox0dea>
Because why?
mikecmpbll has quit [Quit: ciao.]
<Aeyrix>
In reality: *shrugs*
<ZeeNoodleyGamer>
because it just doesn't work that way, end of story
<ZeeNoodleyGamer>
lol
<Aeyrix>
My theory: Far too difficult to maintain a list of that sort.
<Ox0dea>
ZeeNoodleyGamer: Get your fat-ass nick outta here.
<Aeyrix>
You have to have a massive exemptions list.
<Aeyrix>
"this IP cannot contact this IP"
<sevenseacat>
thats a lot of extra burden to place on *every post service*
<Aeyrix>
at every hop
<Aeyrix>
at every router
<Aeyrix>
for *every* IP
<ZeeNoodleyGamer>
Ox0dea: what do you have against big nicks :(
<ZeeNoodleyGamer>
also fine lets see
<Ox0dea>
ZeeNoodleyGamer: They're jarring.
<Aeyrix>
^
<Aeyrix>
tbh
opensource_ninja has joined #ruby
<Aeyrix>
Ox0dea: I've written some theoretical papers on DDoS mitigation.
<ZeeNoodleyGamer>
yeah well I don't own ZNG, otherwise I'd take it
<Aeyrix>
But I'm no longer going for Ph.D. candidacy, so I discarded them.
<Ox0dea>
Aeyrix: Could it not have been set up to require at most one additional hop to some sort of whitelisting server?
<Aeyrix>
Sure, you can do that already.
mwlang has quit [Quit: mwlang]
<Aeyrix>
DDoS mitigation systems outside (or on) your perimeter.
howdoico1 has quit [Ping timeout: 250 seconds]
<Aeyrix>
Only problem is CPU processing power, and uplink size.
<Aeyrix>
If you have 100Gbit of traffic hitting you, your 10Gbit pipe is going to be immediately saturated and it backs up the upstream.
<Aeyrix>
(seriously)
<Aeyrix>
If you hit Australia with around 400Gbit of traffic, you will gridlock the entire country.
<bnagy>
you could do something at an AS level, but there's no real way to propagate that blocking info that wouldn't be thorny
<Aeyrix>
Actually, it's less. It's about 100Gbit of strategic attacks.
<sevenseacat>
fuck yeah australia.
<Aeyrix>
You could gridlock Australia.
<bnagy>
plus bgp updates are already kinda slow
<Aeyrix>
And, by extension, really fuck up Singapore, Papua New Guinea, and parts of Texas.
ZeeNoodleyGamer is now known as ZNG
Gmi has quit [Quit: Leaving...]
<ZNG>
there Ox0dea happy?
<Aeyrix>
I've done a lot of research into mitigations and methods and stuff, I talk about it a lot.
<Aeyrix>
I considered presenting at a security conference but imposter syndrome. :^)
casadei_ has quit [Remote host closed the connection]
<bnagy>
if you're into it try one of the bsides or a single-track that's near you
<bnagy>
tons of smaller cons now
<bnagy>
arguably too many :/
jeadr has quit [Remote host closed the connection]
<Aeyrix>
RuxMon is near me.
<Aeyrix>
So's RuxCon, as I'm in Melbourne.
<bnagy>
nice :) I <3 rux
<Aeyrix>
The last one I went to had some demonstrable flaws in some of the talsk.
<Aeyrix>
talks, as well.
<BraddPitt>
is there a website that lists all upcoming ruby confs?
<bnagy>
all talks have flaws.
jeadr has joined #ruby
towski_ has joined #ruby
<bnagy>
imho the trick is to remember that it's very likely that there's >1 person in the room that knows more about the topic than the speaker
cornerma1 has joined #ruby
<bnagy>
and also the speaker is often not dropping their very best stuff :P
<Aeyrix>
That's why I refuse to talk about DDoS stuff. :^)
skydiver has quit [Ping timeout: 250 seconds]
devoldmx has joined #ruby
christiandsg has joined #ruby
skydiver has joined #ruby
araujo has quit [Quit: Leaving]
np0 has quit [Quit: leaving]
cornerman has quit [Ping timeout: 264 seconds]
cornerma1 is now known as cornerman
rahult has joined #ruby
arooni-mobile has quit [Ping timeout: 246 seconds]
Torrieri has quit [Ping timeout: 240 seconds]
Torrieri has joined #ruby
towski_ has quit [Remote host closed the connection]
pawnbox has joined #ruby
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
klaas_ is now known as klaas
dseitz has joined #ruby
KensoDev has joined #ruby
pawnbox has quit [Remote host closed the connection]
arooni-mobile has joined #ruby
bronson has joined #ruby
pawnbox has joined #ruby
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rubie has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 252 seconds]
chrissonar has joined #ruby
riotjones has joined #ruby
astrobun_ has quit [Remote host closed the connection]
KensoDev has quit []
pawnbox has quit [Remote host closed the connection]
diegoviola has quit [Quit: WeeChat 1.2]
riotjones has quit [Ping timeout: 246 seconds]
mistermocha has joined #ruby
bronson has joined #ruby
pawnbox has joined #ruby
j4cknewt has quit [Remote host closed the connection]
Torrieri has quit [Quit: Be back later ...]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tubbo>
learn javascript because all these other langs are going to shit anyway and JS is still gonna be around :)
<dupek>
but I hate javascript
<Ox0dea>
^
<Ox0dea>
Too bad.
<tubbo>
Ox0dea: "Buy now for only $99" eff that ;)
<tubbo>
dupek: why do you hate javascript?
<Ox0dea>
Because somebody told him he should.
TomyLobo has joined #ruby
<dopie>
tubbo, JS is a bit confusing to me at times but getting used to it with using it and rails
howdoico1 has joined #ruby
<nscheurich>
I've had some good times with Impact. +1
<dupek>
javascript is strange
<Ox0dea>
nscheurich: How about Haxe?
<tubbo>
dupek: so is Go. totally different paradigm from what you're used to.
<nscheurich>
Ox0dea: Never tried it.
<dupek>
go is strange too
<Ox0dea>
tubbo: Could you clarify that? Go is intentionally "boring".
<dupek>
personally I like C
<dupek>
and C++
<tubbo>
Ox0dea: that's the point, if you're used to higher-level languages you have to think about things a little differently when working with Go
manila90 has joined #ruby
Motoservo has quit [Quit: Over & out.]
<tubbo>
dupek: now you're talking performance.
<Ox0dea>
I think he's just mentioning the names of languages.
<tubbo>
and if you want to write games? C/C++/C# is your friend
dhjondoh has quit [Quit: dhjondoh]
dhjondoh has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<tubbo>
Ox0dea: fwiw i think Go is basically "a better C", it's the "C" for the distributed future
<ytti>
i disagree
<ytti>
rust is the new c and thew new c++
<tubbo>
but i still find myself thinking "hmm...how the hell am i gonna model this"
pawnbox has quit [Ping timeout: 250 seconds]
<ytti>
go has overhead
<ytti>
it's too high level to replace c
<ytti>
it has stop-the-world GC
<nscheurich>
If you're looking at games, I'd highly recommend downloading Unity and having a go. Once you've gotten your head around some of the game design patterns you shouldn't have much trouble implementing them in any language.
<ytti>
it has runtime
<tubbo>
ytti: that's probably true, i'm talking more about the language syntax and not the semantics of how it's being run
<RickHull>
any network server that you might be tempted to write in C, should probably be written in go
<dupek>
Unity isn't Linux friendly
<ytti>
one of my older friends is one of the orignal unity developers, recently moved to san fran from helsinki
<tubbo>
ytti: tbh i haven't had a chance to look at rust much. do you like using it?
<nscheurich>
Ah, yeah, this is true.
<RickHull>
any system software that you might be tempted to write in C/C++ should probably be written in Rust
<tubbo>
dupek: neither is game development.
<tubbo>
dupek: have fun with visual studio ;)
riotjones has joined #ruby
<nscheurich>
It does okay with Wine, but I wouldn't recommend it for serious work.
<Aeyrix>
tubbo: Unreal fully supports Linux
<ytti>
tubbo, i've not done much with it, it's much more complex than go, but not insanely like c++
<tubbo>
RickHull: i'm just gonna write my own language that writes all these programs for me
<tubbo>
all i have to do is get one of them fancy new intel rodent chips
<ytti>
tubbo, essentially it's safe c++, which tries to move responsibilities to the compiler from the programmer
<tubbo>
enough rats will create a better system than what we have now
<RickHull>
languages can't write programs or melt steel beams
<ytti>
tubbo, and deliver as much compile time safety guarantees at possible
<ytti>
tubbo, without any runtime or GC
<Ox0dea>
RickHull: See Lisp.
<ytti>
i'm amazed C is still alive
<Ox0dea>
Then you've not got your thinking cap on.
<tubbo>
RickHull: the future is a language for design, a language that you give to AIs that write the programs for you
<Ox0dea>
C is immortal, well and truly.
<ytti>
it's just too demanding langauge to produce working code in
<RickHull>
i agree that programs can write programs
<RickHull>
languages not so much
choke has joined #ruby
<tubbo>
ytti: it's still the thing everything is eventually built on
howdoico1 has quit [Ping timeout: 260 seconds]
<ytti>
i see horrible bugs every day in junos, ios and ios-xr
aganov has joined #ruby
<ytti>
which i feel can completely be blamed on C
<tubbo>
i mean, C started out basically as a "DSL" for ASM
<miah>
the json objects themselves are similar to hashes which do have keys
dimasg has quit [Ping timeout: 255 seconds]
TheNet has quit [Remote host closed the connection]
ohaibbq has joined #ruby
hmsimha_ has joined #ruby
opensource_ninja has quit [Quit: opensource_ninja]
stan has joined #ruby
<ICantCook>
miah: Ah, so if I don't have json objects in list.json, I'll get that error?
<Ox0dea>
?jsonobject
<ruboto>
there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
saddad has quit [Ping timeout: 240 seconds]
hs366 has quit [Quit: Leaving]
<ICantCook>
lol conflicting information
<miah>
well
<miah>
kinda
BloodyHistory has joined #ruby
<miah>
Ox0dea is right
shoutsid has quit [Remote host closed the connection]
hs366 has joined #ruby
arooni-mobile has quit [Ping timeout: 244 seconds]
shoutsid has joined #ruby
tkuchiki has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
manila90 has quit [Ping timeout: 250 seconds]
manila90 has joined #ruby
<miah>
when you parse existing json files using 'JSON.parse' they are represented by hashes
<Ox0dea>
No, that's not quite true.
Ropeney has joined #ruby
<Ox0dea>
ICantCook's issue is that he has an Array of Hashes.
RobertBirnie has joined #ruby
<miah>
no?
yardenbar has joined #ruby
dhjondoh has joined #ruby
oo_ has quit [Quit: Leaving...]
RegulationD has joined #ruby
<ElSif>
what do you mean `are represented as hashes`? the outer JSON object is turned into a ruby Hash but any internal data structures pointed to by keys should be preserved, or am i misunderstanding?
<miah>
ElSif: you're right, i didnt say anything about internal structure
<ElSif>
i just got here, ignore me >.>
TheNet has joined #ruby
ruby-lang375 has quit [Client Quit]
<miah>
its fine, im allowed to be wrong
<miah>
=)
<Ox0dea>
:+1: for humility.
TvL2386 has joined #ruby
shoutsid has quit [Ping timeout: 244 seconds]
tkuchiki has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
<ElSif>
>> require 'json'; JSON.parse("''")
<ruboto>
ElSif # => 757: unexpected token at '''' (JSON::ParserError) ...check link for more (https://eval.in/417984)
<ElSif>
aww :(
RegulationD has quit [Ping timeout: 264 seconds]
<ICantCook>
Okay. So far I've learned: 1) You're allowed to 'lol' in here, unlike #python. 2) There's no such thing as json object. 3) Arrays have no 'keys' method, so that stackoverflow post is incorrect.
<Ox0dea>
ElSif: JSON strings must be double-quoted.
ruurd has joined #ruby
<ElSif>
ah
<ElSif>
>> require 'json'; JSON.parse("\"\"")
<ruboto>
ElSif # => 757: unexpected token at '""' (JSON::ParserError) ...check link for more (https://eval.in/417985)
<ElSif>
aww
<ElSif>
>> require 'json'; JSON.parse('""')
<ruboto>
ElSif # => 757: unexpected token at '""' (JSON::ParserError) ...check link for more (https://eval.in/417986)
<ElSif>
lol ok
<ElSif>
blanks string no worky?
<Ox0dea>
ElSif: The outermost object must be a collection, it seems.
<ElSif>
interesting
manila90 has quit [Ping timeout: 250 seconds]
mistermocha has quit [Ping timeout: 260 seconds]
Kallis has quit [Read error: Connection reset by peer]
ofdtrinity has quit [Quit: Leaving]
oo_ has quit [Ping timeout: 246 seconds]
dhjondoh has quit [Quit: dhjondoh]
dhjondoh has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has joined #ruby
Encapsulation has quit [Ping timeout: 245 seconds]
<Ox0dea>
ICantCook: That SO post is not incorrect. The poster's JSON gets parsed to a Hash, whereas yours is being parsed into an Array.
r0x0rZ has joined #ruby
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruurd has joined #ruby
JoshGlzBrk has joined #ruby
<ekleog>
Hi there! I seem to remember having seen some weird hack so that var_name = SomeClass.new; var_name.varname returns "var_name" in ruby. Have I dreamt?
charliesome has joined #ruby
TheNet has quit [Remote host closed the connection]
Ox0dea has quit [Read error: Connection reset by peer]
<ekleog>
Hoped for a second I could use that to return classes instead of variables and use that
ruurd has quit [Max SendQ exceeded]
_blizzy_ has joined #ruby
pawnbox has quit [Ping timeout: 272 seconds]
* ekleog
back in a second, looking at how Class does it...
<Ox0dea>
You're definitely not doing $thing the right way.
howdoi has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
<Ox0dea>
If you need a dynamic mapping from names to values, you should be using a Hash.
ruurd has joined #ruby
christiandsg has quit [Ping timeout: 265 seconds]
pawnbox has joined #ruby
devoldmx has quit [Ping timeout: 244 seconds]
solars has joined #ruby
<ekleog>
Basically I'm writing a DSL, and ideally var = some_function "args" would add "var": some_other_function "args" in some Hash -- cleaner than var, stuff["var"] = some_function "args" for the end user
Pupp3tm4st3r has joined #ruby
ruurd has quit [Max SendQ exceeded]
<ekleog>
Ugh, Class is a builtin :(
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Aeyrix>
The fact you expected anything else bewilders me.
_blizzy_ has quit [Read error: Connection reset by peer]
ruby-lang759 has left #ruby [#ruby]
icarus has joined #ruby
arup_r has quit []
arup_r has joined #ruby
<rehat>
anyone bored and want to look over my code that I translated from python to ruby? I'm practicing ruby by converting snippets in this book Collective Intelligence and my code seems harder to read than the python snippets lol :(
<ekleog>
The ruby source code search gave nothing, it looks like it's hacked right into the C code
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
<Ox0dea>
What're you on about?
oo_ has quit [Remote host closed the connection]
<Ox0dea>
You've been advised of your options.
<ekleog>
I think I'm going to use eam's Binding-based solution: it is (presumably?) more portable; and I can have the end user call a function at the end of the file sending "binding" so I could backtrack it :)
<Ox0dea>
That's not very friendly.
<ekleog>
(or the last one if I understand anything in it)
<eam>
my solution is ridiculous and expensive; I don't recommend it
rahult has joined #ruby
<Ox0dea>
My solution breaks if the user doesn't call the method on the same line as the assignment.
dionysus69 has joined #ruby
<Ox0dea>
(I don't recommend it.)
<eam>
File.open $0, ...
krz has joined #ruby
cfloare has joined #ruby
<eam>
I found a perl script once that parsed itself. I think the author was attempting reflection
* ekleog
bangs head onto wall, realizing once again ruby is interpreted
leat has quit [Remote host closed the connection]
leat has joined #ruby
<ekleog>
Ox0dea: Going to have a look at your solution, and hope you don't go to hell for this :)
<eam>
it opened $0 and looked for a line defining a variable, then grabbed the value ala /foo = (.*)/
TvL2386 has quit [Ping timeout: 252 seconds]
renderful has quit [Ping timeout: 245 seconds]
manila90 has quit [Ping timeout: 264 seconds]
avelldiroll has quit [Quit: WeeChat 0.3.8]
<ekleog>
Oh, just thought the variable assignments could be scattered among several files... Well, guess I'll just require an explicit name to be given in each function call, and come back later to this issue -- but after some thought variable name may not be unique, when variables are defined inside functions...
jgt1 has joined #ruby
astrobun_ has quit [Remote host closed the connection]
* ekleog
probably just tried to do something impossible
<ekleog>
(and no, I'm not only looking for unique names, but for human-"guessable" unique names)
<Ox0dea>
"Impossible" is surely too strong, but you're definitely being a little crazy.
iliketur_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
Also, no such thing as functions in Ruby. :P
<Ox0dea>
Aeyrix: ^ Bingo-worthy?
techsethi has quit [Quit: techsethi]
pawnbox has quit [Ping timeout: 272 seconds]
<Aeyrix>
Which bit?
<Ox0dea>
"No functions."
<Aeyrix>
Does that come up often?
<Aeyrix>
functions vs methods
<Ox0dea>
Reasonably?
<Ox0dea>
Not often enough, I suppose.
<Aeyrix>
It's more common than the video games one
<Aeyrix>
i'll swap 'em out
<Aeyrix>
heading out from work in a sec
<Ox0dea>
Mind the dropbears.
<Aeyrix>
cheers fam
ruurd has quit [Quit: ZZZzzz…]
yfeldblum has quit [Ping timeout: 244 seconds]
<Ox0dea>
ekleog: The "solution" I proposed would work across files.
<Ox0dea>
__FILE__ != $0
<ekleog>
But would require the top part to be present at the top of each file, isn't it? If so I'd rather impose a call to a method sending binding at the end of each file / function :)
Meow-J has quit [Quit: Connection closed for inactivity]
fedexo has joined #ruby
pawnbox has joined #ruby
[k- has joined #ruby
<Ox0dea>
ekleog: Do you not intend for users to `require` your thing?
roolo has quit [Remote host closed the connection]
Guest64059 has quit [Quit: leaving]
<[k->
Ox0dea!
TvL2386 has joined #ruby
<Ox0dea>
[k--k]!
_blizzy_ has quit [Ping timeout: 240 seconds]
<[k->
o_O
dionysus69 has quit [Quit: dionysus69]
astrobun_ has joined #ruby
<Ox0dea>
Palindromes happen.
blackmesa has joined #ruby
<ekleog>
Well, I think I don't understand how '__FILE__' works: if in main.rb I require my_file.rb and in both main.rb and my_file.rb I include my_gem (containing __FILE__), in main.rb calling a function from my_gem using __FILE__ will let it equal to main.rb, and in my_file.rb to my_file.rb? How would it do that?
dionysus69 has joined #ruby
<[k->
Ox0deaaed0xO
<[k->
oh well, doesnt look as nice
<Ox0dea>
Not in the least.
ohaibbq has quit [Quit: Leaving...]
<[k->
reversing words is an expensive operation
<[k->
O(n)!
<Ox0dea>
ekleog: __FILE__ will be whichever file is "active" when the block passed to Foo is used in the call to #instance_eval.
<apeiros>
[k-: better O(n)! than O(n!) !
<[k->
true, that would be horrible
<Ox0dea>
[k-: We've been here. Isn't it O(~0.5n)?
Musashi007 has quit [Quit: Musashi007]
<[k->
why would it be 0.5
<apeiros>
O(0.5n) is still O(n)
<Ox0dea>
Because you need only perform at most 0.5n swaps?
<Ox0dea>
Not where we're going!
<apeiros>
you're leaving reality? :)
<[k->
I meant for my brain, because i do O(n)
<Ox0dea>
apeiros: Pedantically speaking, the coefficient musn't *necessarily* be discarded.
<ekleog>
How do you count operations? Is a swap a "unitary" operation?
<apeiros>
Ox0dea: um, yes, it is discarded. it's not O() otherwise.
<[k->
you swap the first and the last element
<[k->
and then the second and second last
techsethi has joined #ruby
<apeiros>
you can give a precise formula, sure.
DLSteve has joined #ruby
<[k->
and so on, so you do only half the iteration
<ekleog>
Swap is usually implemented in 3 operations, so...
<Ox0dea>
apeiros: And which Greek letter do we use for that representation?
<ekleog>
:p
<apeiros>
Ox0dea: iirc none
<apeiros>
the greek letters are for the limits
terlar has joined #ruby
ICantCook has quit [Quit: Leaving]
<apeiros>
and/or approximations
<[k->
;ςερτυθιοπασδφγηξκλζχψωβνμ!
avelldiroll has joined #ruby
<ekleog>
Ox0dea: In France it would be T_n ~ coeff * n ; where T_n would be defined as the time necessary for the function to complete ; don't know whether it's international though
<[k->
time is small t!
<[k->
how dare you not obey convention!
<ekleog>
Not in the french computer courses I had unfortunately ^^'
<apeiros>
oh, s/approximation/asymptote/
Encapsulation has joined #ruby
* [k-
starts listing all the greek letters he knows
<[k->
π = pi
<[k->
yay!
joel2 has joined #ruby
choke has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
ruurd has joined #ruby
<[k->
α,β = root θ = temperature σ = stress τ = strain η = refractive index λ = wave length ε = set(?)
rubie has quit [Remote host closed the connection]
<Rico>
Ox0dea: -rv returns me "ERROR: Unknown gem 'rails'"
araujo has joined #ruby
<Ox0dea>
Yeah, there's no such gem by that name.
joonty has joined #ruby
Cust0sLim3n has quit [Ping timeout: 240 seconds]
<zenspider>
You can specify a field straight up
<zenspider>
gem spec rails required_ruby_version
<zenspider>
you guys should try looking at the --help output
nifoc has quit [Ping timeout: 264 seconds]
<Ox0dea>
Derp.
<adaedra>
you mean READING DOCUMENTATION?
<adaedra>
Who does that?
krz has joined #ruby
nifoc has joined #ruby
<zenspider>
old guys like me, I guess
ishahnaz has joined #ruby
linuxboytoo has quit [Remote host closed the connection]
bumbar_ has joined #ruby
bumbar_ has quit [Changing host]
bumbar_ has joined #ruby
linuxboytoo has joined #ruby
pawnbox has joined #ruby
jeadr has quit [Remote host closed the connection]
Iskarlar has joined #ruby
<ekleog>
Hmmm... Is there a way to convert a code block to a lambda? Stupid example, but let's say I'd like to make a my_lambda function that takes a code block and returns the same "function" as a lambda...?
rahult has quit [Quit: Back to the world of zombies]
<apeiros>
or if you actually want a lambda, Kernel#lambda
Cust0sLim3n has joined #ruby
joshmyers has joined #ruby
thermatix has joined #ruby
<apeiros>
and you can convert the block argument passed to a method to a lambda using &
<apeiros>
def foo(&block); p block.class; end
eGGsha has joined #ruby
pawnbox has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
radgeRayden_ has joined #ruby
<ekleog>
Oh, just forgot to mention the block should be optional :/ (so AFAICT I have no item to call to_proc on?)
nuttermb has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
djbkd has quit [Remote host closed the connection]
<ekleog>
apeiros: I get a warning when doing def foo; lambda.call; end; foo{"bar"} ... ? ("tried to create a Proc object without a block")
chthon has joined #ruby
michael_mbp has joined #ruby
<apeiros>
ekleog: yeah, that's not what I said
<apeiros>
10:11 apeiros: def foo(&block); p block.class; end
thermatix has quit [Ping timeout: 244 seconds]
<apeiros>
and if you call lambda, you have to actually pass it a block. and that makes no sense if you already "captured the block in a variable" (read: if you *already have* a lambda)
<ekleog>
Oh, with s/lambda/proc/ it does appear to work, looks good :)
[k- has quit [Ping timeout: 272 seconds]
baweaver has joined #ruby
Guest32 has joined #ruby
jeadr has quit [Remote host closed the connection]
<yorickpeterse>
morning
<ekleog>
apeiros: It looks like I cannot define a default value for &block using this syntax ("syntax error, unexpected '=', expecting ')'")
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ekleog>
morning :)
joshmyers has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
jeadr has joined #ruby
mutuma has joined #ruby
shoutsid has quit []
mutuma is now known as Pathfinder
krz has quit [Read error: Connection reset by peer]
<ekleog>
I'm not dreaming, this works? (I don't understand why, though...)
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
joshmyers has joined #ruby
maasha has joined #ruby
<adaedra>
Never
<maasha>
I have a method: def size; @node_id; end that rubocop doesn't like -> trivial accessor warning - should be resolved with attr_reader. Now what is the best way to do that?
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BrazenBraden has joined #ruby
jgt1 has quit [Ping timeout: 246 seconds]
Pupp3tm4st3r has quit [Remote host closed the connection]
mutuma has joined #ruby
<Ox0dea>
Gross, though.
Pathfinder has quit [Ping timeout: 240 seconds]
Pupp3tm4st3r has joined #ruby
tomaz_b has joined #ruby
joshmyers has quit [Ping timeout: 244 seconds]
<apeiros>
ekleog: correct. you can't define a default value for &block args. you have to test against nil.
mutuma is now known as Pathfinder
Iskarlar has joined #ruby
axsuul has quit [Read error: Connection reset by peer]
chthon has quit [Quit: Ex-Chat]
hs366 has quit [Read error: Connection reset by peer]
<ekleog>
apeiros: Thanks :)
rbowlby has quit [Ping timeout: 240 seconds]
c0m0 has joined #ruby
krz has joined #ruby
ndrei has joined #ruby
<apeiros>
adaedra, ekleog: `def foo(&a); a; end` makes zero sense. that's what Kernel#proc and #lambda do already.
jeadr has quit [Remote host closed the connection]
howdoico1 has joined #ruby
pengin has joined #ruby
jeadr has joined #ruby
blackmesa has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea>
apeiros: It allows for the block to be optional.
<adaedra>
In that case, &x has no purpose at all?
roolo has joined #ruby
<apeiros>
Ox0dea: that makes even less sense.
jenrzzz has quit [Ping timeout: 244 seconds]
<apeiros>
Ox0dea: if you use lambda/proc, you have a *literal* block
<apeiros>
if you *don't* have a literal block, you *already have* a Proc instance.
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ekleog>
>> test = ->() { test }; [test, test.call] # Discovering ruby's fun facts
<ruboto>
ekleog # => [#<Proc:0x41a3d374@/tmp/execpad-6bf78b5cf90e/source-6bf78b5cf90e:2 (lambda)>, #<Proc:0x41a3d374@/tmp ...check link for more (https://eval.in/418067)
<Ox0dea>
Yay, assignment?
<Ox0dea>
>> (a = []) << a # This is slightly more interesting.
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
chipotle has quit [Quit: cheerio]
mistermocha has quit [Ping timeout: 255 seconds]
manila90 has joined #ruby
maasha has quit [Quit: Page closed]
Pathfinder has quit [Remote host closed the connection]
binaryplease1 has joined #ruby
pawnbox has joined #ruby
nofxx has quit [Ping timeout: 256 seconds]
devbug has joined #ruby
devbug_ has quit [Ping timeout: 252 seconds]
sheldonh has joined #ruby
ruurd has joined #ruby
<sheldonh>
where in the ruby source are keyword arguments implemented? i'm trying to find out how ruby uses a hash as keyword arguments, so i can make my specialized dictionary play nice
<apeiros>
sheldonh: foo(**args) calls to_hash on args
ruurd has quit [Client Quit]
<livcd>
is there a reference somewhere for all these specific things like splat,double splat, hash: value,<=> etc ?
sevenseacat has quit [Quit: .]
christiandsg has joined #ruby
Semtex-H has quit [Ping timeout: 260 seconds]
arup_r has quit [Remote host closed the connection]
<sheldonh>
apeiros: ah. and to_hash goes behind my default_proc's back. thanks
jeadr has quit [Remote host closed the connection]
<ekleog>
Yet another question: I just found Hash.new{|h, k| h[k] = "..."} ; but now I wonder: is there a way to have a similar behavior with an OpenStruct? I can't find anything like this, and passing a well-prepared Hash to OpenStruct.new seems not to work :/
TheHodge has joined #ruby
_blizzy_ has quit [Ping timeout: 240 seconds]
<apeiros>
ekleog: inherit from OpenStruct and add the functionality.
<ccooke>
ekleog: you can pass a pre-prepared hash to OpenStruct with **
<ccooke>
>> require 'ostruct'; OpenStruct.new(**{ foo: 1, bar: 2})
<ljarvis>
bweston92: that's because of the local variable
<ljarvis>
bweston92: so either rename your first repository, or use self.repository for the second one
<bweston92>
aha what an idiot ¬¬ , sorry
<ljarvis>
or, use Git.close(repository, deploy_path).checkout(sha) and do away with the lvar
<ljarvis>
it's an easy mistake
<ekleog>
'night folks :)
pawnbox has quit [Ping timeout: 265 seconds]
manila90 has quit [Ping timeout: 240 seconds]
TvL2386 has joined #ruby
<ght>
Question: MySQL saves these boolean values as 1 if true and 0 if false, yet when I load them, == true or == false fails
<ght>
but == 1 or == 0 works, of course.
<ght>
Is there some other method I should be using for boolean values with the Mysql2 gem to confirm true or false?
<ght>
besides == 1 or == 0 ?
sameerynho has joined #ruby
pawnbox has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
ujjain has joined #ruby
<ljarvis>
ght: probably not, that isn't really the job on the mysql gem (I'd say), it's often solved at a higher level (i.e an orm)
<ljarvis>
since the mysql gem doesn't care about reverse type casting
<ljarvis>
I think, anyway; I don't use mysql nor the gem
<ght>
Looks like you use this: :cast_booleans => true
<ght>
When executing the query.
RegulationD has joined #ruby
<ljarvis>
:)
kidoz has quit [Quit: Ухожу я от вас]
thiagovsk has joined #ruby
nofxx has quit [Ping timeout: 244 seconds]
nofxx has joined #ruby
nofxx has joined #ruby
nofxx has quit [Changing host]
pawnbox has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 244 seconds]
stnly has quit [Remote host closed the connection]
noway_ has joined #ruby
noway_ has quit [Client Quit]
terlar has quit [Ping timeout: 245 seconds]
noway_ has joined #ruby
Spami has joined #ruby
ruurd has joined #ruby
Spami has quit [Client Quit]
noway_ has quit [Client Quit]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
noway_ has joined #ruby
skydiver has quit [Ping timeout: 250 seconds]
AlexAltea has joined #ruby
mistermocha has joined #ruby
roolo has joined #ruby
pawnbox has joined #ruby
mutuma has joined #ruby
charliesome has joined #ruby
<ght>
Question: I have an array that looks like this: [{"id" => 1, "cl_id" => 15}, {"id" => 2, "cl_id" => 22}, {"id" => 3, "cl_id" => 82}]
skade has quit [Quit: Computer has gone to sleep.]
<ght>
I was wondering, without having to loop through the array until you hit a match, is there a Ruby command to simply look for the array element with the "cl_id" value 82?
roolo has quit [Ping timeout: 246 seconds]
pawnbox has quit [Ping timeout: 246 seconds]
ruurd has quit [Quit: ZZZzzz…]
mistermocha has quit [Ping timeout: 246 seconds]
ruurd has joined #ruby
mathie has quit [Quit: Quitting...]
mathie has joined #ruby
suchness has joined #ruby
joonty has quit [Quit: joonty]
dtraveler has joined #ruby
oo_ has quit [Remote host closed the connection]
pandaant has joined #ruby
joonty has joined #ruby
manila90 has joined #ruby
techsethi has joined #ruby
<dtraveler>
I am trying to upload some files to a REST api using rest_client and it is giving this error: /var/lib/gems/1.9.1/gems/rest_client-1.8.2/lib/restclient/payload.rb:212:in `close': closed stream (IOError)
oo_ has joined #ruby
<dtraveler>
can someone help? Thanks in advance
<apeiros>
dtraveler: not with the given information. all I can say is that it seems like you're closing an already closed IO again.
TomyWork has joined #ruby
<TomyWork>
arr[0].zip(arr[1..-1]) seems clumsy. is there a better way?
pawnbox has joined #ruby
conor_ has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ruurd has quit [Ping timeout: 244 seconds]
<bweston92>
`bundler exec main.rb` doesn't work, any ideas? the docs aren't too good.
<dtraveler>
apeiros: it is failing at line 32(in gist)
<apeiros>
bweston92: "doesn't work" isn't any good problem description
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
IceyEC has joined #ruby
charliesome has joined #ruby
<bweston92>
apeiros: "bundler: command not found: main.rb
<bweston92>
"
<gregf_>
TomyWork: arr = [0,1,2,3]; p arr[1..-1].map{|v| [arr[0],v] } *runs*
<apeiros>
dtraveler: if you use .rb as gist filename, it'll have syntax highlighting, making it easier for the people who help
blue_deref has quit [Client Quit]
<apeiros>
bweston92: well, then main.rb is either not executable, or not in your PATH
BloodyHistory has quit [Client Quit]
__BloodyHistory_ has quit [Client Quit]
sdothum has joined #ruby
<dtraveler>
apeiros: changed.
<apeiros>
dtraveler: thanks
IceyEC has quit [Client Quit]
charliesome has quit [Client Quit]
tesuji has joined #ruby
<bweston92>
apeiros is certainly is executable and is in the same directory I'm called bundler from
stamina has joined #ruby
<dtraveler>
apeiros: and on upload_file method, it is failing on line 6
<apeiros>
bweston92: ./t.rb
<apeiros>
bweston92: means . is not in your PATH, so main.rb isn't in your PATH as I said.
<bweston92>
apeiros: Ok, thanks would of thought it would check working dir but hey ho
<apeiros>
bweston92: it doesn't behave differently than your shell in that regard.
charliesome has joined #ruby
<dtraveler>
apeiros: any help? why it is failing on e2 and not on e1?
IceyEC has joined #ruby
<apeiros>
dtraveler: 2 problems with your gist: it's (at least partially) fake code, and I'm missing a full backtrace
<dtraveler>
yes. it is partial code.
chthon has joined #ruby
godapol has joined #ruby
kp666 has quit [Ping timeout: 272 seconds]
rodfersou has joined #ruby
<apeiros>
dtraveler: you know, you leave out about *all* relevant parts in that gist. we don't know what @rsrc[@file_rsrc] is, we don't know what file is, we know only the basics about the exception…
<apeiros>
I'm not quite sure how you imagine helping works based off of those infos
<dtraveler>
apeiros: sorry. I am sending whole code.
<apeiros>
dtraveler: I'm afk now, but please do. anybody else trying to help would have the same problem anyway.
<apeiros>
dtraveler: I suspect the exception happens with an origin in line 140?
<dtraveler>
apeiros: it is happening at line 148
<apeiros>
that'd probably be because you pass twice the same File instance, and the first time you call .upload_file with it, that file instance gets closed
<dtraveler>
e1.upload_file is working
<dtraveler>
Oh. Yes! I passing the same file..
<apeiros>
err, right. 148 is the second time you call it with the same instance.
Pupp3tm4st3r has joined #ruby
<apeiros>
anyway, first call -> file instance is closed. second call -> already closed file instance is closed again
<apeiros>
just a guess, though. good luck hunting.
User458764 has joined #ruby
<dtraveler>
apeiros: Thanks for the replies.. I think, I got it now
skydiver has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
[k- has joined #ruby
Pupp3tm4_ has joined #ruby
iamninja has joined #ruby
_blizzy_ has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
bruno- has joined #ruby
jbw has quit [Ping timeout: 245 seconds]
skade has joined #ruby
skydiver has quit [Ping timeout: 250 seconds]
Pupp3tm4st3r has quit [Ping timeout: 244 seconds]
sheldonh has quit [Quit: Leaving]
user1138 has joined #ruby
da3mian has joined #ruby
jbw has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
IceyEC has quit [Quit: iceyec]
_blizzy_ has quit [Read error: Connection reset by peer]
tmtwd has joined #ruby
_blizzy_ has joined #ruby
christiandsg has joined #ruby
radgeRayden_ has quit [Ping timeout: 265 seconds]
mistermocha has joined #ruby
ldnunes has joined #ruby
but3k4 has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
christiandsg has quit [Ping timeout: 265 seconds]
jxf has quit [Ping timeout: 252 seconds]
bttf has quit [Ping timeout: 256 seconds]
danzilio has quit [Ping timeout: 246 seconds]
HashNuke has quit [Ping timeout: 246 seconds]
alekst_ has quit [Ping timeout: 244 seconds]
cbetta has quit [Ping timeout: 244 seconds]
jpinnix______ has quit [Ping timeout: 252 seconds]
mjc_ has quit [Ping timeout: 256 seconds]
bestie has quit [Ping timeout: 256 seconds]
frode15243 has quit [Ping timeout: 256 seconds]
daxroc has quit [Ping timeout: 245 seconds]
zipkid has quit [Ping timeout: 252 seconds]
thesheff17 has quit [Ping timeout: 246 seconds]
fgo has joined #ruby
Kharma has quit [Ping timeout: 265 seconds]
dmoe has quit [Ping timeout: 256 seconds]
jlyndon has quit [Ping timeout: 256 seconds]
autrilla has quit [Ping timeout: 245 seconds]
frankS2 has quit [Ping timeout: 246 seconds]
sylvain31 has joined #ruby
yashinbasement has joined #ruby
jevs has quit [Ping timeout: 256 seconds]
ggherdov has quit [Ping timeout: 256 seconds]
dgutierrez1287 has joined #ruby
cbednarski has quit [Ping timeout: 246 seconds]
oo_ has quit [Remote host closed the connection]
holsee_ has quit [Ping timeout: 252 seconds]
bruno- has quit [Read error: Connection reset by peer]
knowtheory has quit [Ping timeout: 246 seconds]
oo_ has joined #ruby
terlar has joined #ruby
oo_ has quit [Remote host closed the connection]
jmcc has quit [Ping timeout: 252 seconds]
glowcoil has quit [Ping timeout: 252 seconds]
oo_ has joined #ruby
roughz1 has joined #ruby
ruurd has joined #ruby
UtkarshRay has quit [Remote host closed the connection]
f0ster has quit [Ping timeout: 244 seconds]
Iskarlar has joined #ruby
<roughz1>
hey.... I think I messed up some gem installation? the beef browser exploitation framework requires sqlire3 with native extensions. However I did run "bundle install" before I added the sqlire3 precomplied binary (I'm on windows here) to the ruby bin directory. bundle install now always fails with not being able to install sqlite3 ..... is there a reverse command for "bundle install"? I'm nowhere fluent with ruby :(
mistermocha has quit [Ping timeout: 265 seconds]
spacemud has quit [Ping timeout: 250 seconds]
astrobun_ has joined #ruby
<apeiros>
roughz1: `bundle -h`
devyn_ has quit [Ping timeout: 250 seconds]
devyn has joined #ruby
spacemud has joined #ruby
Iskarlar has quit [Client Quit]
j4cknewt has quit [Remote host closed the connection]
shadeslayer_ is now known as shadeslayer
B5X has joined #ruby
<yashinbasement>
has guys I am a startup web developer, I am interested in doing rails/ruby, but when I try to find entry level jobs, could not find things
<yashinbasement>
while Django and php has many jobs comapte to ruby on rails
Iskarlar has joined #ruby
B5X has quit [Client Quit]
<yashinbasement>
so should I start learning them or should I keep with ruby on rails
IceyEC has joined #ruby
<yashinbasement>
any suggestions if any one that experience
UtkarshRay has joined #ruby
hs366 has joined #ruby
B5X has joined #ruby
TvL2386 has quit [Quit: Ex-Chat]
<suchness>
Am I crazy or is the object.open method documented nowhere in the ruby docs? http://pastie.org/10359021
<suchness>
I can't seem to find it in any version, and I have tested in 1.8 1.9.3 2.0 and 2.2
devoldmx has joined #ruby
<suchness>
It exists in all those places in the actual code, but not the docs.
<suchness>
*actual language
dimasg has joined #ruby
cynosures has joined #ruby
r0x0rZ has quit []
<gregf_>
oh well... we've finally managed to get 'web startup developers'... :)
<suchness>
yashinbasement: How are you not finding any ruby jobs? They are everywhere.
<[k->
as ruby said, it is a private method
<suchness>
yashinbasement: Maybe just not near you?
manila90 has quit [Ping timeout: 265 seconds]
<suchness>
[k-: Still should have some documentation to it, don't you think?
<[k->
you arent supposed to know about it
<yashinbasement>
well I am in Melbourne Australia, which is good IT market
<jhass>
suchness: fyi they crossposted to #RubyOnRails
<roughz1>
apeiros: I was expecting "bundle clean" to help. I have trouble figuring out where's the issue and whether ruby even knows about the precompiles sqlite library in /bin. Could you throw me a bone what to look for? i.e. I'd expect ruby to find the sqlite3 headers within the precompiled gem, right? https://paste.ee/p/RKdid
hs366 has quit [Client Quit]
rideh has joined #ruby
<suchness>
jhass: Point taken haha.
tmtwd has quit [Remote host closed the connection]
<jhass>
just so can reevaluating spending your time, since they don't seem to care much about transporting any info
leafybasil has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 244 seconds]
andywojo has quit [Quit: leaving]
andywojo has joined #ruby
hs366 has joined #ruby
ndrei has joined #ruby
techsethi has quit [Quit: techsethi]
Guest67238 has quit [Quit: WeeChat 1.2]
yashinbasement has quit [Quit: Leaving]
blackmesa has joined #ruby
abdoudjanifresh has quit [Ping timeout: 265 seconds]
[k-_ has joined #ruby
abdoudjanifresh has joined #ruby
blackmesa has quit [Client Quit]
dtraveler has left #ruby [#ruby]
iloverubynoob has joined #ruby
bhorn1|away is now known as bhorn1
leafybasil has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
kitfox has quit []
andywojo has quit [Ping timeout: 252 seconds]
allcentu1 has joined #ruby
sdwrage has joined #ruby
thiagovsk has quit [Ping timeout: 245 seconds]
ss_much has quit [Ping timeout: 245 seconds]
Aeyrix has quit [Ping timeout: 245 seconds]
jimbeaudoin has quit [Ping timeout: 245 seconds]
jgt1 has quit [Ping timeout: 252 seconds]
dimasg has quit [Ping timeout: 264 seconds]
ruurd has quit [Quit: ZZZzzz…]
leafybasil has quit [Ping timeout: 240 seconds]
kapowaz has quit [Ping timeout: 245 seconds]
jimbeaudoin has joined #ruby
ss_much has joined #ruby
Aeyrix has joined #ruby
hinbody has joined #ruby
joonty has joined #ruby
thiagovsk has joined #ruby
rbennacer has joined #ruby
kapowaz has joined #ruby
jeadr has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
RegulationD has joined #ruby
roolo has joined #ruby
joonty has quit [Client Quit]
blue_deref has joined #ruby
jeadr has joined #ruby
tvw has quit []
tvw has joined #ruby
skydiver has joined #ruby
jgt1 has joined #ruby
XoRoN has joined #ruby
<flughafen>
sup shevy , no flughafen jokes today?
RegulationD has quit [Ping timeout: 244 seconds]
s00pcan has quit [Ping timeout: 246 seconds]
roolo has quit [Ping timeout: 256 seconds]
da3mian has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_enrique has joined #ruby
<[k-_>
flughafen!
<flughafen>
sup [k-_ !
skydiver has quit [Ping timeout: 250 seconds]
s00pcan has joined #ruby
<_enrique>
I installed bundler using gem bundler install
tvw has quit [Ping timeout: 256 seconds]
conor_ has quit [Remote host closed the connection]
linuxboytoo has joined #ruby
<[k-_>
im slowly trying to get myself to do what i need to do
Kero has quit [Ping timeout: 244 seconds]
<_enrique>
and when I type in bundle it gives me an error -bash: -bash:: command not found
jpinnix______ has joined #ruby
Kero has joined #ruby
glowcoil has joined #ruby
knowtheory has joined #ruby
brunoro has joined #ruby
cbetta has joined #ruby
brunoro has left #ruby [#ruby]
noway_ has quit [Remote host closed the connection]
ruurd has joined #ruby
conor_ has joined #ruby
<[k-_>
"intalled" and "trying to install" is different
Alina-malina has quit [Quit: Leaving]
jlyndon has joined #ruby
linuxboytoo has quit [Remote host closed the connection]
linuxboytoo has joined #ruby
HashNuke has joined #ruby
sdothum has quit [Ping timeout: 264 seconds]
chandu has joined #ruby
chandu has quit [Quit: Leaving]
but3k4 has quit [Read error: Connection reset by peer]
but3k4 has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jeremy04_ has quit [Remote host closed the connection]
roughz1 has quit [Quit: Page closed]
dmoe has joined #ruby
jeremy04 has joined #ruby
linuxboytoo has quit [Ping timeout: 250 seconds]
da3mian has joined #ruby
<_enrique>
ok so what do you suggest
<_enrique>
I see the bunde and bundler files in ~/rub/gems/bin directory
<_enrique>
but I can't runthem
jevs has joined #ruby
arta82 has quit [Ping timeout: 264 seconds]
<[k-_>
"intalled" and "trying to install" is different
mjc_ has joined #ruby
<_enrique>
I see
ggherdov has joined #ruby
holsee_ has joined #ruby
<[k-_>
you must clarify for us to help you
thesheff17 has joined #ruby
frankS2 has joined #ruby
<_enrique>
when I think I installed it it gave me "Successfully installed bundler-1.10.6"
<_enrique>
when I do ./bundle it outputs /usr/local/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0)
bruno- has joined #ruby
Iskarlar has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
dstarh has joined #ruby
Kharma has joined #ruby
Illusioneer1 has joined #ruby
joonty has joined #ruby
Ropeney has joined #ruby
DroidBurgundy has joined #ruby
astrobun_ has quit [Remote host closed the connection]
mjc_ has quit [Ping timeout: 245 seconds]
dmoe has quit [Ping timeout: 245 seconds]
mistermocha has quit [Ping timeout: 265 seconds]
jlyndon has quit [Ping timeout: 240 seconds]
bruno- has quit [Ping timeout: 264 seconds]
<[k-_>
are you installing as root?
jpinnix______ has quit [Ping timeout: 246 seconds]
<jhass>
_enrique: how did you install Ruby? Did you install more than one version?
momomomomo has joined #ruby
<Illusioneer1>
So I am looking for the right gem for some basic command execution. Say if I want to launch a script that would require nohup, is this something in the basic ruby library or do I need something in the gem repository?
daxroc has quit [Ping timeout: 246 seconds]
<_enrique>
no
cbetta has quit [Ping timeout: 256 seconds]
<_enrique>
installing as user'
thesheff17 has quit [Ping timeout: 244 seconds]
frankS2 has quit [Ping timeout: 246 seconds]
glowcoil has quit [Ping timeout: 246 seconds]
momomomomo has quit [Client Quit]
<_enrique>
when I installed as root it worked
<jhass>
Illusioneer1: depending on your need use Kernel#system, Kernel#`, Kernel#spawn, IO::popen, or the open3 stdlib
jevs has quit [Ping timeout: 245 seconds]
christiandsg has joined #ruby
nettoweb has joined #ruby
tkuchiki has joined #ruby
ggherdov has quit [Ping timeout: 250 seconds]
<jhass>
_enrique: you're not really answering the question
frode15243 has quit [Ping timeout: 246 seconds]
knowtheory has quit [Ping timeout: 250 seconds]
Kharma has quit [Ping timeout: 265 seconds]
HashNuke has quit [Ping timeout: 246 seconds]
holsee_ has quit [Ping timeout: 240 seconds]
<[k-_>
im no good for things not related to scripting @.@
r0x0rZ has quit [Remote host closed the connection]
devoldmx has joined #ruby
<Psi-Jack>
Heh. I'm running through this codecademy for ruby, so far, borrring since I know a lot of the core basics already simply because I've already done a little ruby. But, pretty cool site non-the-less.
<gregf_>
_enrique: its surely got to be related to conflicting ruby versions i'm afraid :/
<[k-_>
nonetheless*
ahmetkapikiran has joined #ruby
<Psi-Jack>
Is this ##english?
<[k-_>
promoting good english use helps ruby programmers communicate efficiently!
<gregf_>
Psi-Jack: so, whats your question? ;)
<[k-_>
there is also nevertheless
binaryplease1 has joined #ruby
<[k-_>
anyway, isnt it taxing to type so many extra characters, especially -
Semtex-H has joined #ruby
<shevy>
go and write more scripts [k-
malconis has joined #ruby
<[k-_>
dont have time for that
<shevy>
go and study for university then and become a millionaire
conor_ has quit [Remote host closed the connection]
<Psi-Jack>
Hmmm.. gregf_ none yet. I'm just expanding my knowledge of ruby so I can be able to finish this sensu extension, and more. ;)
bmurt has joined #ruby
devoldmx has quit [Ping timeout: 264 seconds]
conor_ has joined #ruby
pandaant has quit [Remote host closed the connection]
aredridel has quit [Remote host closed the connection]
aredridel has joined #ruby
Pupp3tm4_ has quit [Remote host closed the connection]
casadei_ has joined #ruby
Pupp3tm4st3r has joined #ruby
amystephen has joined #ruby
elepedus has joined #ruby
<shevy>
if you know the basics, write advanced scripts
<shevy>
Anything with Thread.new {} really.
<[k-_>
oh god, that is horrible
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
r0x0rZ has joined #ruby
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Psi-Jack>
shevy: Heh, that's kinda where I'm heading, cause my extension's going to load up its own thread during run-time to consume a rabbitmq queue, while the run(event) itself of the extension module will inject queue items and mutate them into what they need to be.
<Psi-Jack>
And will need to be able to stop... When told to stop. :)
BLuEGoD has joined #ruby
victortyau has joined #ruby
<[k-_>
mutating and threads @.@
<[k-_>
make sure you into thread safety!
<shevy>
Yeah there are steps of difficulty
<shevy>
once you use Thread.new, the next thing to do is to share data between the threads
<shevy>
I still haven't started to use fiber and mutex myself :(
<Psi-Jack>
shevy: Heh, my extension mostly just deals with string, Hash, and json manipulation, and speaking tcp and http to relay inbound information to external servers, such as ElasticSearch, InfluxDB, Graphite, OpenTSDB, and KairosDB.
<Psi-Jack>
InfluxDB has a graphite input format, but it's horrible, and would be much better done using the http-style line input method.
<shevy>
[k-_ yeah I need a use case myself. I started to use Thread.new only because the pickaxe mentioned parallel downloads, and they did this via Thread.new
allcentu1 has quit [Ping timeout: 255 seconds]
kedare has joined #ruby
leafybasil has joined #ruby
<[k-_>
shevy: you obviously didnt make many useful things then!
mutuma has quit [Quit: mutuma]
imperator has joined #ruby
<imperator>
good morning
AccordLTN has joined #ruby
<imperator>
just looking at method caching solutions in ruby - anyone got a favorite lib?
OrbitalKitten has joined #ruby
sevenseacat has joined #ruby
crdpink has quit [Excess Flood]
AlexAltea has quit [Ping timeout: 250 seconds]
AccordsLTN has quit [Ping timeout: 246 seconds]
crdpink has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
<shevy>
[k-_ well semi-useful, I wrote a lot of smaller things that automatize stuff
Cust0sLim3n has quit [Ping timeout: 244 seconds]
<[k-_>
automate*
<shevy>
:)
<[k-_>
wait, what? method caching?
<imperator>
yes, method caching
sgambino has quit [Ping timeout: 272 seconds]
Ropeney has joined #ruby
jiada has joined #ruby
Pupp3tm4st3r has joined #ruby
<[k-_>
you mean caching the result of a method?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruby-lang841 has joined #ruby
krz has quit [Ping timeout: 246 seconds]
tmtwd has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruurd has quit [Quit: ZZZzzz…]
allcentu1 has joined #ruby
pawnbox has quit [Remote host closed the connection]
dimasg has quit [Ping timeout: 264 seconds]
<shevy>
perhaps memoization
<imperator>
yes
pawnbox has joined #ruby
devdazed has joined #ruby
<imperator>
right now i'm looking at cache_method, just wondered if you had any thoughts
Miphix has joined #ruby
Miphix has quit [Read error: Connection reset by peer]
Guest32 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanpaucar has joined #ruby
rodfersou has quit [Quit: Lost terminal]
rodfersou has joined #ruby
sgambino has joined #ruby
<[k-_>
i think caching should be done by optting in
<[k-_>
not by opting out
<[k-_>
but, well, it makes methods pure!
<imperator>
well, i'd need something that works at the instance level then
<[k-_>
the library is fine though
dopie has quit [Ping timeout: 250 seconds]
dhjondoh has quit [Quit: dhjondoh]
<jiada>
I am working on DFS graph algrithom.Does anybody would like to help me a little bit?(If yes,I can show you guys my ugly code)
<[k-_>
oh, it seems like you opt in to caching
allcentu1 has quit [Ping timeout: 265 seconds]
<[k-_>
i missed the cache_method :entries there
efox has joined #ruby
kies has quit [Ping timeout: 255 seconds]
<efox>
How long should I expect 'gem install mysql2' to take?
<jhass>
?anyone jiada
<ruboto>
jiada, Just ask your question, if anyone has or can, they will respond.
<jhass>
efox: well that certainly sounds like it hung up
<[k-_>
oh gosh the code looks horride
<[k-_>
horrid*
<shevy>
efox that sometimes happens to me with gem install rails, I usually interrupt it and do it again, and then it installs fine
<jhass>
*horrible
<efox>
well it does say 'Building native extensions. This could take a while...'
charliesome has joined #ruby
darkf has quit [Quit: Leaving]
<jhass>
efox: yeah, but unless you're on a Z80 it shouldn't take an hour
<apeiros>
jhass: probably need to pm that it was a kick, not a ban
dimasg has joined #ruby
<jhass>
apeiros: was about to
dionysus69 has quit [Ping timeout: 265 seconds]
darkf has joined #ruby
<apeiros>
kk
* apeiros
prematurely overlording
jpinnix______ has joined #ruby
<efox>
so i can just ctrl-c and start over? no ill effects?
d10n-work has joined #ruby
<imperator>
[k-_, is it? didn't look at it
<jhass>
derp, they quit
<imperator>
well, uh, any other suggestions?
<jhass>
efox: most likely, yeah
<[k-_>
it looks like the only library that is available @.@
jhack has joined #ruby
Cust0sLim3n has joined #ruby
glowcoil has joined #ruby
knowtheory has joined #ruby
<efox>
jhass, thanks I'll give it a nudge and retry.
<[k-_>
the documentation is quite comprehensive
jiada has joined #ruby
<jhass>
?gist jiada
<ruboto>
jiada, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
cbetta has joined #ruby
<jiada>
wait
<jhass>
had to kick you to stop the flooding ;)
krz has joined #ruby
binaryplease1 has quit [Remote host closed the connection]
<jiada>
In China,sometimes,It's very slow to connect to github.
Mojo_Nixon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
whippythellama has joined #ruby
<imperator>
welp, we have to use the libraries we have, not the libraries we wish we had ;)
<jhass>
well, as long as you don't use pastebin.com ... ;)
Pupeno has joined #ruby
Pupeno has joined #ruby
<imperator>
i've seen the terminal appear to hang, but it's actually working
ldnunes has quit [Ping timeout: 246 seconds]
<imperator>
like, i hit enter and suddenly it continues
<jhass>
imperator: searched under memoization? I think method caching is more often used in the compiler/interpreter building as term for caching method lookups
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aganov has quit [Remote host closed the connection]
tkuchiki_ has quit [Remote host closed the connection]
dmolina has quit [Quit: Leaving.]
momomomomo has quit [Ping timeout: 252 seconds]
Pupp3tm4st3r has quit [Remote host closed the connection]
rdark has joined #ruby
roolo has quit [Ping timeout: 240 seconds]
skydiver has quit [Ping timeout: 250 seconds]
jerius has quit [Quit: /quit]
Chau has joined #ruby
imperator has left #ruby ["Leaving"]
Chau has quit [Max SendQ exceeded]
saddad has joined #ruby
Pupp3tm4st3r has joined #ruby
Chau has joined #ruby
momomomomo has joined #ruby
j_mcnally has joined #ruby
JoshL has quit [Read error: No route to host]
jerius has joined #ruby
<shevy>
let's dance! \o~ ~o/
JoshL has joined #ruby
DaniG2k has joined #ruby
<[k-_>
┌(・。・)┘ ♪ └(・。・)┐ ♪ ┌(・。・)┘
DaniG2k has left #ruby [#ruby]
bttf has joined #ruby
<[k-_>
im having a headache :(
dopie has joined #ruby
christiandsg has joined #ruby
<livcd>
[k-_: caffeine helps
christiandsg has quit [Remote host closed the connection]
ItSANgo has quit [Ping timeout: 256 seconds]
<Kalov>
sleeping helps
dopamean_ has joined #ruby
kalz has joined #ruby
autrilla has joined #ruby
<shevy>
eating melons helps
Marsupermammal has joined #ruby
robh71 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cbednarski has joined #ruby
livathinos has quit []
rfmind has quit [Quit: WeeChat 1.2]
riotjones has quit [Remote host closed the connection]
rfmind has joined #ruby
hs366 has quit [Read error: Connection reset by peer]
chrissonar has quit [Remote host closed the connection]
<[k-_>
caffeine is awful!
RegulationD has joined #ruby
<[k-_>
withdrawal symptoms are awful!
govg has quit [Quit: leaving]
joelataylor has joined #ruby
* havenwood
slinks away in search of coffee
centrx has joined #ruby
kies has joined #ruby
Kallis has joined #ruby
Kallis has quit [Max SendQ exceeded]
conor_ has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
jeadr has quit [Remote host closed the connection]
sepp2k has joined #ruby
freerobby has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JakFrist has joined #ruby
<[k-_>
the last time i drank a cup of coffee, it didnt work
ItSANgo__ has joined #ruby
<[k-_>
well, it tasted a bit bland, because i over diluted it
Timba-as has joined #ruby
jeadr has joined #ruby
<[k-_>
but that was only *a bit*
millerti has joined #ruby
aceRacer has joined #ruby
<aceRacer>
hi
robh71 has joined #ruby
<livcd>
[k-_: coffee pills
<[k-_>
eww no
danzilio has joined #ruby
diegoaguilar has joined #ruby
jeanlinux has joined #ruby
<aceRacer>
http://stackoverflow.com/a/7988465 how does this work. I mean calling a class methods outside any method. normally in programming like in java I have seen that if I need to call a method I need to do that in another method, which is not the case with typesafe_accessor ? how does this work in ruby?
* [k-_
leads a caffeine free lifestyle (we'll see what happens when i start working)
aibo has joined #ruby
<jeanlinux>
guys, good afternoon
<jeanlinux>
i like a little help on finding the average time of an array of time object
stef204 has joined #ruby
stef204 has quit [Changing host]
stef204 has joined #ruby
<[k-_>
aceRacer: Foo is actually an instance of Class
<jeanlinux>
or maybe a time string.. like say array = ["9:30", "8:21", "7:43", "9:12","13:53"]
<jeanlinux>
how do i get the average time from the array
rfmind has quit [Quit: WeeChat 1.2]
rfmind has joined #ruby
<aceRacer>
yeah I understand that. but if it were written inside another class Method then it would be easier to understand. is it not like calling the class method typesafe_accessor inside the class ?
mjburgess has joined #ruby
<oddmunds>
aceRacer: what were you linking to exactly? your question doesn't seem to have anything to do with the question you linked to. :/
<aceRacer>
I mean its not something like def self.init_typeself(option); typesafe_accessor(option, Integer); end
<[k->
wait, i think im confused a little. So, actually, everything in the class body is actually evaulated as an instancr of class
UtkarshRay has quit [Ping timeout: 246 seconds]
<aceRacer>
oddmunds: I am showing the example. I want to understand how the methods like attr_accessor works? I have never seen a method call outside of a method
rbennacer has joined #ruby
tkuchiki has joined #ruby
<oddmunds>
oh, yeah, that stuff is just called when the class is read
<workmad3>
or, more accurately, the class body is just code that gets run
<[k->
aceRacer, when you call puts, its not in a method, isnt it?
Marsupermammal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pisuke has joined #ruby
conor_ has joined #ruby
jiada has quit [Remote host closed the connection]
<[k->
i mean, you dont have to call it in a method
Marsupermammal has joined #ruby
<[k->
you dont have to define a main method in ruby
<[k->
unlike in java and the like
<[k->
code just gets ran
Trieste has quit [Ping timeout: 245 seconds]
Guest14911 has quit [Ping timeout: 245 seconds]
Marsupermammal has quit [Max SendQ exceeded]
sevenseacat has quit [Quit: .]
chipotle has joined #ruby
Trieste has joined #ruby
platzhirsch has quit [Ping timeout: 265 seconds]
<saddad>
yes
<[k->
method calls can exist outside a method because Ruby treats those as "main methods", Ruby runs them in sequence that it sees them
tmtwd has quit [Ping timeout: 246 seconds]
lwu has quit [Ping timeout: 245 seconds]
<jeanlinux>
can anyone help or suggest a solution pls?
dbugger has joined #ruby
<dbugger>
Hey guys. I have a question. Why this mess with "rvm" and "rbenv" and so on? Arent Ruby versions back comaptible?
MyMind has quit [Ping timeout: 260 seconds]
lwu has joined #ruby
<twohlix>
dbugger: not all no
nerio has joined #ruby
bmurt has quit [Ping timeout: 245 seconds]
<aceRacer>
ok. i see
<dbugger>
twohlix, it is kinda messy, isnt it?
<twohlix>
dbugger: it also lets you dev for the ruby version you plan on deploying to
siempref_ has joined #ruby
<saddad>
[k- the scope that your program starts in can be thought of as 'main'
<twohlix>
dbugger: while they are probably backwards compatible, you can't use syntax like symbol: value in 1.8
<havenwood>
Yeah, that's how I think too but the gibberish symbols can be distracting.
<dbugger>
havenwood, Does that mean that we might see soon disappear things like RVM and RBENV?
n_blowna_ has joined #ruby
jeadr has quit [Remote host closed the connection]
robh71 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #ruby
bstrarm has joined #ruby
decoponio has joined #ruby
<[k-_>
rbenv is spelt with lowercase, like xkcd, just sayin'
uxp has joined #ruby
<[k-_>
does anyone have a relevant xkcd?
elton_ has joined #ruby
<havenwood>
dbugger: In production you typically don't need more than one Ruby. If you're working on more than one Ruby app they may be written for different Rubies. Maybe not even the same implementation of Ruby.
<havenwood>
dbugger: So you may want to switch Rubies between apps, hence the Ruby version switchers like chruby, RVM and rbenv.
jeadr has joined #ruby
DroidBurgundy has quit []
axl__ has joined #ruby
<twohlix>
dbugger: semantic versioning doesnt make rbenv + rvm useless. It just is easier to tell that 3.0.0 could be hugely different than 2.0.0 or 2.9.9 even and probably not compatible
conor__ has joined #ruby
`scootaloo has joined #ruby
tmtwd has joined #ruby
AccordsLTN has joined #ruby
adaedra has quit [Disconnected by services]
fgo has quit [Ping timeout: 246 seconds]
`scootaloo is now known as adaedra
Hounddog_ has joined #ruby
Swappticon has joined #ruby
<daxroc>
Does ruby have a default path that it looks for SSL certificates in ?
<tubbo>
the only way we'll see ruby switchers change is if everyone agrees to use the same implementation
mistermocha has quit [Ping timeout: 244 seconds]
<adaedra>
it uses openssl's one iirc daxroc
mhib has joined #ruby
<havenwood>
tubbo: So which shall we use? :P
jeremy04_ has joined #ruby
<tubbo>
havenwood: lol exactly
<tubbo>
i really liked the rubinius thing when it was first announced
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
martinbjeldbak has joined #ruby
nwhirschfeld_ has joined #ruby
<tubbo>
but unfortunately it's hard to work with since like no one uses it :( everyone's all about the MRI or JRuby
_main_ has joined #ruby
<tubbo>
(i know people use it just not around where i am)
<tubbo>
rubymotion will always be a layer above what apple provides. it makes more sense to bet on swift for long-term stability, because it's in apple's best interest to make it a better and more stable language.
<tubbo>
that said, most apps rewrite themselves a bunch of times over so maybe not :)
rubie has quit [Remote host closed the connection]
<livcd>
tubbo: on the other hand rubymotion has been started by ex-apple employee and it is their core business
bronson has joined #ruby
JakFrist has joined #ruby
tmtwd has joined #ruby
<tubbo>
i wish i could like try it for free somehow
<tubbo>
just to see how it works
<tubbo>
i don't want to pay all that and then find out i don't like it
<havenwood>
tubbo: yup
JakFrist has quit [Client Quit]
Mojo_Nixon has joined #ruby
<livcd>
tubbo: they said they had no way to prevent users from publishing apps to app store when the rbmotion thing was "free"
northfurr has quit [Quit: northfurr]
<tubbo>
yeah
BrazenBraden has quit [Read error: Connection reset by peer]
knowtheory has quit [Remote host closed the connection]
alekst_ has quit [Remote host closed the connection]
cbetta has quit [Remote host closed the connection]
dmoe has quit [Remote host closed the connection]
HashNuke has quit [Remote host closed the connection]
jxf has quit [Remote host closed the connection]
danzilio has quit [Remote host closed the connection]
Kharma has quit [Remote host closed the connection]
autrilla has quit [Remote host closed the connection]
glowcoil has quit [Remote host closed the connection]
daxroc has quit [Remote host closed the connection]
holsee_ has quit [Remote host closed the connection]
mjc_ has quit [Remote host closed the connection]
cbednarski has quit [Remote host closed the connection]
jevs has quit [Remote host closed the connection]
ggherdov has quit [Remote host closed the connection]
jpinnix______ has quit [Remote host closed the connection]
zipkid has quit [Remote host closed the connection]
bttf has quit [Remote host closed the connection]
frode15243 has quit [Remote host closed the connection]
frankS2 has quit [Remote host closed the connection]
jlyndon has quit [Remote host closed the connection]
jmcc has quit [Remote host closed the connection]
bestie has quit [Remote host closed the connection]
thesheff17 has quit [Remote host closed the connection]
maletor has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
eminencehc has joined #ruby
JakFrist has joined #ruby
mary5030_ has joined #ruby
crazydiamond has quit [Remote host closed the connection]
<michael_mbp>
gives me an instance of Gem::Dependency
bronson has quit [Remote host closed the connection]
j4cknewt has quit [Ping timeout: 240 seconds]
RobertBirnie has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
rbowlby has joined #ruby
rbowlby has quit [Remote host closed the connection]
pragmatism has joined #ruby
dseitz has quit [Ping timeout: 265 seconds]
ckinniburgh has joined #ruby
RobertBirnie has joined #ruby
Papierkorb has joined #ruby
j4cknewt has joined #ruby
fantazo has joined #ruby
radgeRayden__ has joined #ruby
rbennacer has quit [Remote host closed the connection]
j4cknewt_ has quit [Ping timeout: 252 seconds]
bruno- has quit [Ping timeout: 245 seconds]
<Papierkorb>
Hi. I have some code with quite some where I put a string into a case statement, the when statements use regex's to match and the when bodies evaluate to something using $1, $2, .. - Now, rubocop is complaining about those perl style backrefs. What's the "proper" way to do that?
northfurr has quit [Quit: northfurr]
face has joined #ruby
robh71 has joined #ruby
<Papierkorb>
having a gazillion elsif's instead to use string#match would be much less readable
<jhass>
according to rubocop, Regexp.last_match
faces has quit [Ping timeout: 246 seconds]
platzhirsch has joined #ruby
solars has joined #ruby
<michael_mbp>
ha got it.
<Papierkorb>
jhass: thanks. What do you think though? Is #{$1} more harmful than the much longer #{Regexp.last_match 1} ?
<jhass>
haven't made my mind up yet
RegulationD has quit [Remote host closed the connection]
<jhass>
third variant would be $~[1]
chinmay_dd has joined #ruby
<adaedra>
I usually do match = $~ just after myself and use my variable
<Papierkorb>
well i won't replace a global for another one heh ..
Musashi007 has quit [Quit: Musashi007]
icarus has quit [Ping timeout: 246 seconds]
radgeRayden_ has quit [Ping timeout: 255 seconds]
fgo has joined #ruby
j4cknewt has quit [Ping timeout: 265 seconds]
dr3w has quit [Quit: WeeChat 1.2]
bb010g has quit [Quit: Connection closed for inactivity]
cornerma1 has joined #ruby
lannonbr has quit [Quit: WeeChat 1.2]
<Papierkorb>
Also, a related question, those functions are quite long (text processing/conversion ..), and thus rubocop complains about almost every complexity issue it has linters for. But how should you, if at all, split them up in a sensible fashion? Especially when it comes to parsers where you have a small stack ("stack = [ ]"), passing that around is really tedious, and using instance variables for that looks like a hack too
<shevy>
I could swear that something has changed in regards to warnings... I seem to get new ones now
<ryanprior>
jhass: yeah that's what I'm reading
crayfishx has quit [Ping timeout: 252 seconds]
casadei_ has quit []
sylvain31 has joined #ruby
<ryanprior>
jhass: problem is, I want to pass something different to new for every test
RegulationD has joined #ruby
<jhass>
I wonder if something like describe Foo do; let(:args) { default }; subject { described_class.new(args) }; context "bar"; let(:args) { bar }; ... works
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stamina has quit [Ping timeout: 256 seconds]
car has quit [Client Quit]
baroquebobcat has joined #ruby
ndrei has quit [Ping timeout: 255 seconds]
bronson has quit [Remote host closed the connection]
spider-mario has joined #ruby
benlieb has quit [Quit: benlieb]
Cust0sLim3n has joined #ruby
AlexRussia_ has quit [Ping timeout: 244 seconds]
ndrei has joined #ruby
suchness has quit [Remote host closed the connection]
jeadr has quit [Remote host closed the connection]
pengin has joined #ruby
chichou has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
decoponio has joined #ruby
jeadr has joined #ruby
hotpancakes has quit [Remote host closed the connection]
yfeldblum has joined #ruby
Voker57 has quit [Ping timeout: 264 seconds]
tmtwd has joined #ruby
hinbody_ has joined #ruby
fantazo has quit [Ping timeout: 265 seconds]
Illusioneer has joined #ruby
rubie has quit [Remote host closed the connection]
mozzarella has quit [Quit: WeeChat 1.2]
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
momomomomo_ has quit [Quit: momomomomo_]
rubie has joined #ruby
hinbody has quit [Ping timeout: 252 seconds]
choke has joined #ruby
chicken_wangs has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
nscheurich has joined #ruby
Blue_Ice_ is now known as Blue_Ice
lwu has quit [Ping timeout: 246 seconds]
jeanlinux has quit [Remote host closed the connection]
hotpancakes has joined #ruby
tmtwd has quit [Ping timeout: 245 seconds]
yfeldblum has quit [Ping timeout: 255 seconds]
thermatix has joined #ruby
rubie has quit [Remote host closed the connection]
skydiver has joined #ruby
tkuchiki has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
crayfishx has quit [Ping timeout: 256 seconds]
fantazo has joined #ruby
SolarSailor has joined #ruby
renderful has quit [Ping timeout: 264 seconds]
renderfu_ has joined #ruby
skydiver has quit [Ping timeout: 250 seconds]
rubie has joined #ruby
howdoico1 has quit [Ping timeout: 250 seconds]
hinbody has joined #ruby
rideh^ has joined #ruby
hydrozen has joined #ruby
nanoz has quit [Ping timeout: 272 seconds]
northfurr has quit [Ping timeout: 240 seconds]
hobodave has joined #ruby
jtdoncas has quit [Ping timeout: 245 seconds]
hinbody_ has quit [Ping timeout: 246 seconds]
tmtwd has joined #ruby
rideh has quit [Ping timeout: 265 seconds]
<Darkwater>
using the built-in json module, how can I make to_json use to_h if an object doesn't have to_json?
zendrix has joined #ruby
<Darkwater>
I could def to_json; to_h.to_json; end on relevant objects but I really don't want to do that on everything
einarj has quit [Read error: Connection reset by peer]
Violentr has quit [Ping timeout: 244 seconds]
einarj_ has joined #ruby
<Darkwater>
in the end I want to convert a hash to json, but some elements deep in that hash are custom classes that should only have to_h and not to_json
dseitz has joined #ruby
fgo has joined #ruby
crayfishx has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chichou has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 245 seconds]
chichou has joined #ruby
mhib has quit [Remote host closed the connection]
shmilan has joined #ruby
juanpaucar has quit [Remote host closed the connection]
sshuff|gone is now known as sshuff
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
eminencehc has quit [Remote host closed the connection]
hinbody has quit [Ping timeout: 265 seconds]
dumdedum has quit [Quit: foo]
<centrx>
Darkwater, Make a module and include it in any classes you want to have that functionality?
bweston has joined #ruby
hinbody has joined #ruby
<Darkwater>
might as well put def to_json; to_h.to_json; end then
decaff has joined #ruby
bhorn1 is now known as bhorn1|away
<Darkwater>
was thinking of doing some trickery to call that on objects that don't have to_json
mistermocha has joined #ruby
fgo has quit [Ping timeout: 260 seconds]
SuMo_D has quit [Quit: Off into this... Real world place...]
jtdoncas has joined #ruby
Torrieri has joined #ruby
Torrieri has joined #ruby
Violentr has joined #ruby
tmtwd has quit [Ping timeout: 246 seconds]
northfurr has joined #ruby
<jhass>
Darkwater: define def as_json
Kallis has joined #ruby
<jhass>
and you really should do that for everything (prolly in some baseclass / common module)
hinbody has quit [Ping timeout: 252 seconds]
hinbody has joined #ruby
centrx has quit [Quit: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong."]
<Darkwater>
jhass: think I'm just going to reopen Object for this
<Darkwater>
I'd expect this to be default behaviour
<jhass>
>> Object.new.to_h
<ruboto>
jhass # => undefined method `to_h' for #<Object:0x41b1c3bc> (NoMethodError) ...check link for more (https://eval.in/418419)
foureight84____ has quit [Remote host closed the connection]
northfurr has joined #ruby
jerius has quit [Quit: /quit]
<acovrig>
I’m using active_record in ruby, which is better/more efficient: `Event.create(colum stuffs here) if not Event.find_by(unique column)` or `begin Event.create(column stuffs here) rescue <unique contrstraint thing here> end`?
yqt has joined #ruby
crazydiamond has joined #ruby
zendrix has quit [Remote host closed the connection]
einarj has quit [Ping timeout: 255 seconds]
lkba has joined #ruby
hahuang65 has joined #ruby
foureight84_____ has quit [Ping timeout: 256 seconds]
drbrain has quit [Remote host closed the connection]
foureight84_____ has joined #ruby
klingeldraht has quit [Ping timeout: 250 seconds]
<[spoiler]>
?rails acovrig
<ruboto>
acovrig, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<bricker>
acovrig: You can use Event.exists?() which will perform an efficient COUNT query
einarj has joined #ruby
<jhass>
acovrig: find_or_create_by,
northfurr has quit [Quit: northfurr]
fantazo has quit [Ping timeout: 256 seconds]
n_blowna_ has quit [Remote host closed the connection]
chichou has quit [Ping timeout: 260 seconds]
n_blownapart has joined #ruby
iloverubynoob has joined #ruby
j4cknewt has quit [Remote host closed the connection]
northfurr has joined #ruby
jerius has joined #ruby
stevednd has joined #ruby
xet7 has joined #ruby
Rutix has joined #ruby
Rutix has joined #ruby
klingeldraht has joined #ruby
troyready has quit [Remote host closed the connection]
momomomomo has joined #ruby
chichou has joined #ruby
andywojo has quit [Ping timeout: 272 seconds]
howdoico1 has joined #ruby
roolo has joined #ruby
casadei has quit [Remote host closed the connection]
ivanskie has joined #ruby
tmtwd has quit [Ping timeout: 245 seconds]
baweaver has quit [Remote host closed the connection]
puppeh_ has quit [Remote host closed the connection]
whiteline has quit [Remote host closed the connection]
<XF>
pipework i should pastebin?
shmilan has quit [Ping timeout: 255 seconds]
banister has quit [Read error: Connection reset by peer]
<XF>
pipework can you help? :)
roolo has quit [Ping timeout: 240 seconds]
einarj has joined #ruby
<pipework>
XF: See /topic for the pasting service to use. I'll take a look after you're done with that, but if I can't help, be patient and wait a while before repeating your request for help. :)
yeticry has joined #ruby
<Darkwater>
?gist
<ruboto>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<XF>
ok
Musashi007 has quit [Quit: Musashi007]
<Darkwater>
XF: did you install domainatrix?
kadoppe has quit [Ping timeout: 240 seconds]
lkba has quit [Read error: Connection reset by peer]
<pipework>
It appears not to be in your current load path, so if it's a gem, you may need to install it, or if it is installed perhaps you might need to locate it on disk and make sure that path is in $LOAD_PATH
yfeldblum has quit [Quit: Leaving...]
kadoppe has joined #ruby
DLSteve has joined #ruby
shadoi has joined #ruby
<XF>
ah i forgot to install gem
<XF>
.gem
<XF>
done gem
<XF>
what next?
<XF>
darkwater it says no package domainatrix
hinbody has quit [Quit: leaving]
<XF>
pipework there?
<Darkwater>
XF: if you can't install it using gem you should find another way of installing it
djbkd has quit [Remote host closed the connection]
<pipework>
XF: I'm not sure what you're saying you did.
<Darkwater>
maybe fetch it from github or wherever
<pipework>
You'll want to edit your gist and add new data.
<XF>
i did apt-get install gem
juanpaucar has joined #ruby
luksaur has joined #ruby
<XF>
when i do apt-get install domainatrix it says no package
<chichou>
it's on rubygems though
troyready has joined #ruby
<chichou>
gem install gemname
iloverubynoob has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<XF>
chichou i did gem install domainatrix
<XF>
but still same error
<Coraline>
No apt-get
<XF>
i did no apt-get now
<Coraline>
There's no way that you got the same error then.
joneshf-laptop has quit [Ping timeout: 250 seconds]
<chichou>
sorry, but what is that partial backtrace?
mistermocha has joined #ruby
Konstruktionist has joined #ruby
nux443 has joined #ruby
<XF>
what?
blackmesa has quit [Ping timeout: 260 seconds]
<pipework>
XF: I'm not sure why you're only giving us a tiny bit of the text.
<pipework>
.Trust me, nothing you're doing is remotely interesting enough for us to steal, so just mask or change passphrases and other credentials, but leave the rest alone.
nerio has quit [Ping timeout: 272 seconds]
skade has quit [Quit: Computer has gone to sleep.]
diegoviola has quit [Quit: WeeChat 1.2]
renderful has joined #ruby
joneshf-laptop has joined #ruby
codecop has joined #ruby
drbrain has joined #ruby
bronson has quit [Remote host closed the connection]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
radgeRayden has joined #ruby
christiandsg has quit [Ping timeout: 265 seconds]
nikolakn has quit [Quit: Leaving]
codecop has quit [Remote host closed the connection]
renderfu_ has quit [Ping timeout: 252 seconds]
Kallis has quit [Read error: Connection reset by peer]
mistermocha has quit [Ping timeout: 265 seconds]
Cust0sLim3n has joined #ruby
hotpancakes has joined #ruby
matp has quit [Remote host closed the connection]
sdwrage has joined #ruby
matp_ has joined #ruby
pengin has quit []
chipotle has joined #ruby
deol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<chipotle>
anyone here use OS X primarily? i want to try out dev environments to learn ruby and various stacks; is the best way to use vagrants or should i deploy a VM of debian or whatever?
michaeldeol has joined #ruby
PaulCape_ has joined #ruby
michaeldeol has quit [Remote host closed the connection]
axsuul has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
<pipework>
chipotle: I've take both approaches and they have their benefits. If your application can work equally whale on OSX only, then why not?
PaulCapestany has quit [Ping timeout: 252 seconds]
Violentr has quit [Ping timeout: 272 seconds]
<chipotle>
i'm afraid to screw something up
<chipotle>
so i ratehr have a sandbox
<pipework>
chipotle: Never be afraid.
nettoweb has quit [Max SendQ exceeded]
<pipework>
It's just a computer.
<pipework>
You'll learn a lot more by breaking shit than you will by never screwing up.
nettoweb has joined #ruby
<chipotle>
i can't afford for my main system to brick
<chipotle>
it's nice to build in sandboxes
<chipotle>
like when i build a drupal app, i used to build it inside a ubuntu vm
<chipotle>
but it was slow
eminencehc has joined #ruby
<pipework>
You won't "brick" anything
<chipotle>
now that i'm learning ruby, i am afraid that a vm will slwo me down
<al2o3-cr>
chipotle: then don't use vm
djbkd has joined #ruby
hotpancakes has joined #ruby
<pipework>
Don't let the unknown unknowns give you paralysis. Be brave, be okay with breaking things, and know that unless you fuck up the hardware, you're probably going to fine.
rideh has quit [Read error: Connection reset by peer]
einarj has quit [Ping timeout: 250 seconds]
<al2o3-cr>
chipotle: get a Pi(e)
jerius has joined #ruby
nscheurich1 has joined #ruby
rideh has joined #ruby
umgrosscol has quit [Remote host closed the connection]
crdpink has quit [Ping timeout: 244 seconds]
dfockler has quit [Remote host closed the connection]
crdpink2 has joined #ruby
failshell has quit []
frem has joined #ruby
juanpaucar has quit [Remote host closed the connection]
northfurr has quit [Quit: northfurr]
Violentr has joined #ruby
<al2o3-cr>
chipotle: then the only thing yo can screw up is the crust :p
<ght>
Question: I have an array that looks like this: myArr = [ {"id" => 1, "cl_id" => 12}, {"id" => 2, "cl_id" => 28}, {"id" => 3, "cl_id" => 93}]
nscheurich has quit [Ping timeout: 260 seconds]
benlieb has joined #ruby
<ght>
Is there a technique for pulling the array element that contains "cl_id" => 93 without having to iterate through the array itself?
<ght>
Or the array index, rather.
<jhass>
.find
juanpaucar has joined #ruby
<ght>
Ok, I'll read up on that, thank you.
<al2o3-cr>
.detect
<jhass>
that's an alias for .find
<al2o3-cr>
ok
<al2o3-cr>
sorry jhass
jamesaxl has joined #ruby
northfurr has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
jcdesimp has quit [Remote host closed the connection]
skade has joined #ruby
demonlove has quit [Remote host closed the connection]
einarj has joined #ruby
<al2o3-cr>
why so many aliases?
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bweston has quit [Ping timeout: 256 seconds]
jcdesimp has joined #ruby
rehat has joined #ruby
kr3ssh has joined #ruby
<pipework>
al2o3-cr: because convenience
andywojo has joined #ruby
<pipework>
I prefer the rhyming select, detect, reject, etc.
<al2o3-cr>
convenience stores a costly though, no?
tommek has quit [Ping timeout: 264 seconds]
jeadr has quit [Remote host closed the connection]
<pipework>
al2o3-cr: If that's your argument, ruby is not the language for you.
scottschecter has quit [Ping timeout: 240 seconds]
tommek has joined #ruby
<al2o3-cr>
that's not an argument the sarcasm
<jhass>
I do prefer select and reject too, but I find detect odd, it feels sort of like a predicate to me, the block form of include? basically
<al2o3-cr>
detect/find same difference really
nscheurich has joined #ruby
jeadr has joined #ruby
hotpancakes has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
jerius_ has joined #ruby
skydiver has joined #ruby
<al2o3-cr>
reduce/inject hmm, not to sure
jcdesimp has quit [Ping timeout: 250 seconds]
<jhass>
I can visualize the operation better with inject, but that's probably it clicked for me while using inject
<pipework>
al2o3-cr: You might avail yourself of the intent of the language designer. :)
<jhass>
*because it
<dopie>
anyone here ever work with the authorize.net api?
<jhass>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
choke has joined #ruby
jerius has quit [Ping timeout: 240 seconds]
<dopie>
?everyone
<ruboto>
I don't know anything about everyone
<dopie>
haha
woobywoob has joined #ruby
<woobywoob>
hello
<al2o3-cr>
dopie: to re-iterate, just ask your Q
<woobywoob>
anyone know how to group things by date in an index?
<jhass>
well while we're listing we should also mention slice_before and slice_after I guess
JoshL has quit [Read error: Connection reset by peer]
JoshL has joined #ruby
Coldblackice has joined #ruby
<jhass>
which can provide cleaner implementations of some usecases of chunk
<drbrain>
I think I've used chunk once
<chipotle>
pipework: but isn't it hard to say run both a LEMP stack and a ruby stack at the same time? or like say you need two versions of ruby or two versions of php running?
<drbrain>
but wow did I need exactly that
<jhass>
I think I used all threes only in code challenges yet
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
chipotle: we got chruby/rvm/rbenv for running multiple Ruby versions, I can imagine the PHP community has something similar by now
<al2o3-cr>
rvm my choice of choices
<Radar>
what even is a lemp stack
<Radar>
death to RVM.
mwlang has joined #ruby
<Radar>
long live chruby+ruby-install
<al2o3-cr>
noooooo
<al2o3-cr>
:P
pdoherty has quit [Ping timeout: 265 seconds]
<al2o3-cr>
each to their own I would guess
<al2o3-cr>
whatever works for you
<jhass>
yeah, nobody else does chruby+pacman :P
einarj has quit [Ping timeout: 244 seconds]
<al2o3-cr>
:)
<al2o3-cr>
maybe their not running arch
jeremy04_ has joined #ruby
casadei has joined #ruby
<al2o3-cr>
Arch (for the elite) :p
<al2o3-cr>
why you ask?
<jhass>
they're afraid of exploring and breaking stuff (= will have a hard time at being a developer)
<Radar>
rvm is a bloated piece of crap that will stab you in your back the moment you show it
<al2o3-cr>
Radar: does it work though?
Rickmasta has quit [Ping timeout: 246 seconds]
<al2o3-cr>
bad code is good code in someones eyes
centrx has joined #ruby
Rickmasta has joined #ruby
nux443 has quit [Ping timeout: 240 seconds]
jeremy04 has quit [Ping timeout: 256 seconds]
<al2o3-cr>
linux basics and all that :P
dfockler has joined #ruby
nux443 has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<baweaver>
Servers tend to be OpenBSD, desktops FreeBSD variants.
roolo has joined #ruby
<al2o3-cr>
Ox0dea: seriously what?
<baweaver>
Mostly because I'm going through the kernel piece by piece at the moment.
<Ox0dea>
I was asking baweaver if he uses FreeBSD as his daily driver.
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver>
OSX
<baweaver>
Same difference
<al2o3-cr>
not a chance
<al2o3-cr>
osx is heavily modified
<baweaver>
I was being facetious.
<al2o3-cr>
i know :P
jackjackdripper has joined #ruby
krz has quit [Quit: WeeChat 1.2]
<baweaver>
Darwin is a derivative of FreeBSD, that was the joke of it.
sshuff is now known as sshuff|gone
<Radar>
glhf everyone. I'm going to use my time more productively.
<al2o3-cr>
openbsd
<chipotle>
other than the well grounded rubyist, are there some other books you can recommend to a beginner? i've used drupal for years but i want to build cool stuff and move to san francisco (i'm in nyc now), so i am trying to learn ruby, js, etc....
atomical_ has joined #ruby
<baweaver>
Of course Windows is a derivative of Unix too
<apeiros>
Ox0dea: maybe the code which handles constant assignment.
<jhass>
heh, parse.y is the standard answer to "where does weird thing X happen" :P
<chipotle>
atmosx: you don't recommend the well grounded rubyist?
<Norrin>
any of you guys ever consider contributing to Diaspora?
rbennacer has quit [Remote host closed the connection]
Illusioneer has quit [Quit: Leaving.]
jerius_ has quit [Quit: /quit]
bronson has quit [Ping timeout: 255 seconds]
Wolland has quit [Remote host closed the connection]
<jhass>
no, never
rodferso1 has quit [Quit: leaving]
<jhass>
?guys Norrin
<ruboto>
Norrin, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
mistermocha has quit [Read error: Connection reset by peer]
hydrozen has joined #ruby
That1Guy has quit [Client Quit]
<Norrin>
:-/
polly_wog has quit [Remote host closed the connection]
<Norrin>
really?
devoldmx has joined #ruby
jerius has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Norrin>
i actually wondered if i recognized your nick
solars has joined #ruby
<Norrin>
raven24 i remember
mistermocha has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blueOxigen has quit [Ping timeout: 252 seconds]
skade has quit [Ping timeout: 244 seconds]
<Ox0dea>
Raven24 appears to be a Polish funeral parlor.
benlieb has joined #ruby
shmilan has joined #ruby
ldnunes has quit [Quit: Leaving]
<Norrin>
besides diaspora i don't know of any active ruby OSS projects that would be a good learning ground
jpfuentes2 has joined #ruby
<Norrin>
back when i did diaspora even it was over my head. rails was really hard for me to grep circa rails 2/3
devoldmx has quit [Ping timeout: 255 seconds]
uri_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Norrin>
when I tried* disaspora. not that i was ever capable of making a commit
<jhass>
discourse I guess
<mwlang>
so I’m going to implement a simple “man in the middle” app. That basically takes bi-directional input over http or https and writes the request/response pairs to log files. The intent is not malicious. ;-) The intent is to capture real traffic happening in a production environment in order to build a mock test environment for exchanges happening between a current Rails server (with no test specs) and an COTS SOAP server not under our
<mwlang>
control.
<miah>
chef, puppet, sensu, all big ops tools written in ruby with big oss communities
<Ox0dea>
Norrin: Rails is no harder to grep than any other collection of files.
hahuang65 has quit [Ping timeout: 256 seconds]
<mwlang>
The question is: what should that MTM server be? My thought is Sinatra.
<BraddPitt>
is there any way to mixin a module so that I can simply call foo() from within the including class? In other words, so I don't have to write Class.foo()
<pipework>
mwlang: Why not just use existing software?
<Norrin>
Ox0dea, opinion... looking at the docs recently... the api has gotten far better than it was
<mwlang>
pipework: such as….
<Norrin>
the docs included
mistermo_ has joined #ruby
<Norrin>
but i was new to ruby also. still now it's hard for me to read
<pipework>
mwlang: Whale, you're looking to implement a proxy, and one that terminates TLS. So I'd immediately think haproxy.
<Ox0dea>
mwlang: Why not Charles?
baweaver has joined #ruby
jhooker has quit [Quit: Leaving]
mistermocha has quit [Read error: Connection reset by peer]
<Ox0dea>
mitmproxy is Python, which is ?ot.
<al2o3-cr>
BraddPitt: module_function or i missing the point
<Norrin>
miah, i guess i'd have to find motivation in the project also. not being a web guy, i dont use those
<mwlang>
pipework: one reasoning I have in mind is that this MTM server will have a dual role…as we start reimplementing the services provided by the old Rails app, we can bring the new portions up and go live and start retiring the old app route by route.
<bougyman>
agreed, us a real proxy to proxy the requests to your app, and have your app forward the requests to the remote SOAP thingy.
<bougyman>
*use
<miah>
you're not a web person? neither are those projects.
skade has joined #ruby
<bougyman>
what you use for your app could be whatever you feel comfy with.
nettoweb has quit [Read error: No route to host]
<mwlang>
Ox0dea: Charles doesn’t have blue eyes, so he wouldn’t work as well as Sinatra.
<bougyman>
sinatra, roda, plain rack, whatever.
gard has quit [Ping timeout: 260 seconds]
<BraddPitt>
googling now al2o3-cr, thanks
ckinniburgh has quit [Quit: Leaving]
millerti has quit [Read error: Connection reset by peer]
<Norrin>
miah, chef, puppet, aren't those server deployment tools?
<bougyman>
they're IaaS frameworks.
<BraddPitt>
al2o3-cr module_function or self.extend?
<bougyman>
sensu is a monitoring suite.
<mwlang>
and another extension on this MTM app is to forward incoming SOAP requests in parallel to both Rails apps for a short time and compare responses from both to ensure they’re responding identically.
jeadr has quit [Remote host closed the connection]
<bougyman>
mwlang: again you'd do that with the real proxy (reverse proxy) on the inbound soap requests.
<Norrin>
bougyman, sounds like web services
<bougyman>
Norrin: infrastructure as a service is not 'web services'
reset has joined #ruby
<mwlang>
bougyman: cool. I’ll go read up on haproxy then. If I can put it to use, then I’d definitely prefer not to write my own piece.
mistermo_ has quit [Ping timeout: 246 seconds]
<Norrin>
it's useful to web people
<Norrin>
the web devs i know use those tools
<bougyman>
software as infrastructure is what chef, puppet, ansible, others are made for, which is used by IaaS (think AWS, Hadoop, Github) companies for continuous delivery.
jeadr has joined #ruby
<al2o3-cr>
BraddPitt: module_function if I interpreting you right
<pipework>
mwlang: Please avail yourself of the existing proxy servers that don't suck and won't be ungodly slow.
<bougyman>
capacity management, monitoring, scaling on demand, all coordinated through the software (chef or puppet or salt or ansible or ______)
tmtwd has quit [Ping timeout: 245 seconds]
<BraddPitt>
al2o3-cr don't they do the same thing? I'm just asking which is more Ruby-like
<bougyman>
it's how wikimedia can run one of the busiest sites on the planet with a dozen people.
<Norrin>
exactly. deploying and managing web servers
<Norrin>
for example
<bougyman>
not just web, but sure it can do web.
<Norrin>
and often done
<mwlang>
pipework: would be happy to! I didn’t realize they could proxy incoming requests to two targets yet return a selected target’s response back while logging both target’s responses in conjunction with the original incoming request.
<bougyman>
behind that web is a ton of supporting services, in any case.
<ruboto>
al2o3-cr # => undefined method `boo' for Foo:Module (NoMethodError) ...check link for more (https://eval.in/418465)
opensource_ninja has joined #ruby
<ght>
Question: I have an array formatted as myarr = [{"GroupName"=>"MyFirstGroup", "Id"=>114}, {"GroupName"=>"Interest - Email", "Id"=>101}, {"GroupName"=>"New Customer", "Id"=>102}, {"GroupName"=>"New Lead", "Id"=>135}]
<al2o3-cr>
BraddPitt: extend puts the methods in a singleton class
<BraddPitt>
I thought extend just makes them instance methods
<BraddPitt>
for the requiring class
<ght>
and I have another object with a string, mystring["notes"] = "Here are a bunch of notes. That includes Interest - Email."
<al2o3-cr>
BraddPitt: the code example show not
<ght>
What is the best way to see if any of the "GroupName" fields match a string within mystring["notes"]?
<BraddPitt>
er did I get it backwards
shmilan has quit [Ping timeout: 246 seconds]
<jhass>
ght: .any?
<ght>
Normally, I would .each through myarr and see if mystring["notes"].include? the object in that iteration of the each loop.
<ght>
Hmm, .any? I'll look that up.
<mwlang>
pipework: what’s a direct link to the nginx + lua built-in? I’m finding lots of hits on Google, but not sure which specifically you’re thinking of.
platzhirsch has joined #ruby
platzhirsch has left #ruby [#ruby]
nfk has joined #ruby
Axy has joined #ruby
<al2o3-cr>
>> module Foo; end; class A; end; class B; end; [A.ancestors, B.ancestors] # BraddPitt
<shevy>
well lua has one huge thing going and this is that it is fast
kies has quit [Ping timeout: 246 seconds]
<pipework>
jhass: Isn't that what he said about the languages he used when designing ruby int he first place?
chihhsin has quit [Ping timeout: 265 seconds]
<pipework>
shevy: Hopefully lua-jit gets a great maintainer.
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mwlang>
pipework: I started getting my feet wet with Lua while running ntopng
zendrix has joined #ruby
<shevy>
who wants to embed ruby for a game
<jhass>
I guess, why not repeat a success story?
<dfockler>
I wish I could use ruby with Love2D
<pipework>
jhass: I'd welcome a better lua, but I doubt entirely that a class-based language would be it.
<dfockler>
but lua is ok
_ht has quit [Quit: Konversation terminated!]
<shevy>
pipework the funny thing is that the one who started gobolinux is a maintainer for luarocks
<ght>
jhass: I've been researching .any? and testing it in irb, and I'm so far unable to utilize it in the manner needed.
<pipework>
shevy: Is that funny? I'm not sure.
<mwlang>
shevy: not just crazy fast, but small on resources — so it ran really well even on a Raspberry Pi running a full-fledged firewall setup for me.
<mwlang>
shevy it’s the adjective not the noun since you usually include it to describe (extend) your own things to make them, well, Enumerable.
kr3ssh has quit [Ping timeout: 245 seconds]
jaycee has quit [Read error: Connection reset by peer]
<mwlang>
at least that’s how I remember it.
<shevy>
hmm wait
<shevy>
I think I meant Enumerable now
<ght>
Heavens, what the crap is the syntax in this situation.
<shevy>
the bigger of the two, whatever that is
<shevy>
oh yeah... #collect_concat
<Ox0dea>
Ha.
<Ox0dea>
I've actually seen it in wild code.
foureight84_____ has quit [Quit: Be back later ...]
<ght>
Got it
<ght>
Awesome, thanks jhass.
<shevy>
well it confuses me already because I am using .map ...
rgb-one has joined #ruby
<rgb-one>
Hello, is there any way to automatically generate ids for headers with haml?
<Ox0dea>
Sure, but sometimes #flat_map is just the thing.
michaeldeol has joined #ruby
duoi has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 246 seconds]
<Ox0dea>
#collect_concat takes the aliasing a little too far, I think.
decoponio has quit [Ping timeout: 265 seconds]
<shevy>
hehe
hobodave has quit [Quit: Computer has gone to sleep.]
<baweaver>
there are times I want to do a compact_map
mary5030_ has quit [Ping timeout: 244 seconds]
<shevy>
.map_the_dam!
<baweaver>
of which I tend to implement with reduce so it's a single loop
eGGsha has joined #ruby
That1Guy has joined #ruby
That1Guy has quit [Client Quit]
sepp2k has quit [Quit: Leaving.]
kb3ien has joined #ruby
icharlie has quit [Remote host closed the connection]
bap1313 has joined #ruby
<kb3ien>
How does one get kaminari to produce links to /path? rather than /?
<jhass>
kb3ien: I expect more kaminari experience over at #RubyOnRails
<ght>
jhass: My last question on the matter, is, I need to be able to perform operations on the individual matches from the .any? call. Is that possible?
<ght>
For example, if two "GroupName" entries match, for each one I want to perform operations.
<jhass>
ght: any? stops on the first match, perhaps you want .select
kb3ien has left #ruby [#ruby]
<ght>
Ok.
<baweaver>
>> module Enumerable; def compact_map() reduce([]) { |a,i| v = yield(i); a << v if v; a } end end; (1..10).compact_map { |v| v.even? ? v * 2 : nil } #shevy
<Ox0dea>
It should be called #map_compact in that case, no?
<baweaver>
compact_map, select_map, could go by who knows how many names
* baweaver
shrugs
<baweaver>
I just tend to do something similar a lot.
<baweaver>
flat_map though
nettoweb has joined #ruby
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver>
map(&block).flatten
thermatix has joined #ruby
duoi has joined #ruby
<shevy>
hmm
<shevy>
map_flatten :D
skade has quit [Ping timeout: 250 seconds]
<Ox0dea>
baweaver: MRI does the "reduce and ignore" thing.
<al2o3-cr>
map_squash :)
[k- has joined #ruby
<ght>
jhass: .select worked perfectly, thank you
choke has joined #ruby
skade has joined #ruby
<ght>
Question: If you write logger.debug() statements throguhout your code, then later set your LOG_LEVEL to Info so these debug messages are not output, do those logger.debug statements simply being present in the code slow down execution in any way?
<Ox0dea>
Negligibly.
rgb-one has left #ruby [#ruby]
<al2o3-cr>
ght: not that any human would ever notice :P
thermatix has quit [Ping timeout: 255 seconds]
<RickHull>
how can I say in a regex, capture this group, and it's either followed by \z or 5 known chars and then some junk? starting with: /\A.+ - (\{.+\})\z/
<RickHull>
this matches only when followed by \z (end of string)
<jhass>
(?:\z|five.+) should work
<ght>
Got it, thank you.
iamninja has quit [Read error: Connection reset by peer]
<RickHull>
jhass: ah thx
mwlang has quit [Quit: mwlang]
nettoweb has quit [Read error: Connection reset by peer]
<jhass>
RickHull: prolly meant to [^}]+ instead of .+
iamninja has joined #ruby
<RickHull>
it's capturing json, heh
<jhass>
oO
<jhass>
okay the nvm I guess
<RickHull>
so i'm not matching braces or anything
<jhass>
*then
<RickHull>
just looking for the known end-of-json
zeroDivisible has joined #ruby
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
linduxed has quit [Ping timeout: 246 seconds]
<Ox0dea>
RickHull: "the"?
<al2o3-cr>
yeah the f
jayne_ is now known as jayne
<baweaver>
regex is not a good idea for html or json or yaml or any other sane data format that already has a parser
skydiver has joined #ruby
<RickHull>
baweaver: how about extracting json from a wildly-formatted text log?
<baweaver>
sed
<baweaver>
pipe them to sane formats using unix tools, then worry about it.
<RickHull>
are you going to concretely recognize the json, or recognize what tends to precede and follow it?
<baweaver>
well, more of an awk thing at that point
<jhass>
why sed or awk if Ruby has perfectly fine tools for it
<baweaver>
If you can't tell, you have a bigger problem than esoterically musing on regexing json.
einarj has quit [Ping timeout: 240 seconds]
<RickHull>
baweaver: thanks for the advice bud (whoosh)
<baweaver>
Not all servers generating logs have it
<Ox0dea>
Something to bear in mind, as you indicated it to be your belief that all serialized JSON ends with a closing brace.
<baweaver>
sed/awk are for doing things on server before ruby touches them, though preferably you make the app give back sane logs.
einarj has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skydiver has quit [Ping timeout: 250 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
doublemalt_ has joined #ruby
<shevy>
jhass yes my brother! The RubyOS! \o/
AlxAltea has quit [Ping timeout: 250 seconds]
<hfp>
I feel a bit dumb asking but I have always been struggling with mocking, stubbing and testing. And it's biting me now. So I am using this framework that is not very popular and I need to run tests to make sure my controller does what it's supposed to. But to execute the controller's code properly, I have to mock a certain number of dependent objects. There is very little documentation available so I only have th
<hfp>
e framework's code, its tests ...
<hfp>
... and my eyes. How should I approach the test to find out which objects should I mock, which methods should I mock and how to inject mocked objects into the framework's code when running my test?
nettoweb has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ilyes512 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jeadr has quit [Remote host closed the connection]
nettoweb has joined #ruby
<workmad3>
hfp: first, establish if you actually need to mock things... next, remember the cardinal rule of mocking - only mock the types (things) you own, and only mock collaborators
<hfp>
al2o3-cr: I asked there 2 days ago. There is nothing but echo in this chan :D
nettoweb has quit [Client Quit]
[k-_ has joined #ruby
<al2o3-cr>
hfp: fair dos
<workmad3>
hfp: and if you're having trouble mocking just types you own, it sounds like you need to introduce anti-corruption/wrapper layers to isolate your code from the framework so you can test your code in isolation from the framework
ishahnaz has quit [Ping timeout: 264 seconds]
solars has quit [Ping timeout: 240 seconds]
jeadr has joined #ruby
polly_wog has joined #ruby
<hfp>
workmad3: Well, I do need to mock objects I don't own (i.e. the framework's objects). Because the code results in actual phone calls, there is no live call made in the test. So the methods that output audio need to be mocked so the test doesn't crash. I know that much. But I don't know how to tell for sure which objects I need to mock exactly, nor which methods. And when I do find out, I dont know what these met
<workmad3>
hfp: you have a layer between your business logic code and the framework that basically translates from the frameworks domain into your own domain
<workmad3>
hfp: and then you mock that wrapper
<baweaver>
Look into VCR to get real requests to replay
<workmad3>
hfp: you then also write integration tests on your wrapper to make sure it's working correctly against actual framework code
jgt1 has joined #ruby
<workmad3>
(or, if that's not possible because your framework lacks a test mode to turn off stuff that crashes, you get ultra-paranoid about all changes to the wrappers and ensure any change to them undergoes a full, manual QA cycle)
hydrozen has joined #ruby
<hfp>
workmad3: This framework doesn't have a test mode so it looks like I need a wrapper... For example, my controller answers the call and says a sentence. But he test crashes because there is no audio channel to actually write the audio to. So I mocked this particular object and its method. Then it crashes again with another method, so I stubbed this method and return true. And then it crashes again but with a thir
<hfp>
d method. It seems like the more I mock, the more I need to mock.
yqt has quit [Ping timeout: 245 seconds]
<hfp>
How would I do this with the wrapper method you suggested?
tisp has joined #ruby
whippythellama has quit [Quit: WeeChat 1.3]
<workmad3>
hfp: not sure, it depends a lot on the framework... I'd probably need to actually play around with it
TomyWork has quit [Ping timeout: 264 seconds]
jatb has quit [Remote host closed the connection]
<workmad3>
hfp: but the general principle is that anything that touches the framework needs to go through your wrapper rather than touching it directly
ledestin has joined #ruby
einarj has quit [Ping timeout: 250 seconds]
rakm has joined #ruby
einarj has joined #ruby
rubie has quit [Remote host closed the connection]
elton has quit [Quit: elton]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
polpak has quit [Quit: leaving]
roolo has joined #ruby
blackmes1 has joined #ruby
<hfp>
what does the wrapper do? do you have an example?
darwingr has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
pragmatism has quit [Read error: Connection reset by peer]
<fschuindt>
Guys, how can I verify the percentage of a value occurence in a given array? like w%(5 2 9 4 2 2 1) how many % the element 2 appears? is there an easy way?
<pipework>
zenspider: I mean, I could write one, that's not the issue. It's just that I don't want to bother every single damn time to convince people that it's worthwhite.
finisherr has joined #ruby
einarj has joined #ruby
<pipework>
WTB ruby-core implemention
<zenspider>
baweaver: pipe ... yeah. I'd just be a bit worried it'd be confused with the IO pipe
<baweaver>
There was a bit earlier about making itself take a block.
<baweaver>
fair.
<zenspider>
pipework: that's because it isn't worthwhile
zendrix has quit []
<pipework>
zenspider: I'm not sure I agree.
* baweaver
grabs popcorn
<pipework>
Tap isn't worthwhile to me, imo, but it's fun to use if you don't take yourself seriously.
<shevy>
beaver time again!
<baweaver>
1.tap(&Kernel.method(:puts))
<baweaver>
though I tend to make an addition to Rails logger
<shevy>
what is this
<shevy>
is this puts 1
<Ox0dea>
Ja.
<pipework>
shevy: lulz for people who don't want to change their LOC metric. :p
<shevy>
oh my god
<shevy>
and this is what pipework is cheering for :(
<baweaver>
that returns procs so I can: Some.long.chain.tap(&Rails.logger.info_proc).do_other_stuffs
<havenwood>
Any RVM user on OS X want to test precompiled binaries for 2.2.3 or any of the other new ones? Try a (re)install after: rvm get master
bmurt has joined #ruby
spider-mario has quit [Remote host closed the connection]