<havenwood>
"We recommend that you start planning to upgrade to Ruby 2.3 or 2.2."
<Noxilex>
Why did you choose to learn ruby ?
mattwildig has quit [Ping timeout: 240 seconds]
brijesh has joined #ruby
<havenwood>
Noxilex: I started liking it and kept liking it.
gigetoo has quit [Ping timeout: 252 seconds]
<Noxilex>
^^ Same
<Noxilex>
Also beginners tutorial are really great in this language
graydot has quit [Quit: graydot]
devbug has joined #ruby
devbug_ has joined #ruby
<Noxilex>
Do you know about codingame ?
devbug_ has quit [Read error: Connection reset by peer]
<havenwood>
Noxilex: nope
<Noxilex>
How do you speak to me that way ?
<Noxilex>
It is a /msg ?
DmitryBochkarev has joined #ruby
Guest34101 has joined #ruby
mattwildig has joined #ruby
<havenwood>
Noxilex: Nope, I type "Nox" then hit <tab>
ensyde_ has quit [Quit: Leaving]
sondr3 has joined #ruby
<Noxilex>
I've started ruby on codingame, it's a website where you can improve your skills in any language by solving puzzle or playing at clash of code: a gamemode where you have limited time to solve a problem before other participants
<Noxilex>
havenwood: Oh ok
<Noxilex>
good to know
Mr0rris0 has quit [Read error: Connection reset by peer]
<havenwood>
Noxilex: Enjoying it so far?
cyclonis has quit [Read error: Connection reset by peer]
Mr0riss0 has joined #ruby
<Noxilex>
IRC ?
cyclonis has joined #ruby
phatso727 has quit [Ping timeout: 250 seconds]
<havenwood>
Noxilex: codinggame.com
<Noxilex>
havenwood: Anybody can see when we talk like that right ?
soLucien has quit [Read error: Connection reset by peer]
johnny56 has quit [Ping timeout: 264 seconds]
skade has joined #ruby
despai has joined #ruby
konsolebox has joined #ruby
johnny56 has joined #ruby
skade has quit [Client Quit]
KensoDev has joined #ruby
despai has quit [Client Quit]
blackmes1 has joined #ruby
vdamewood has joined #ruby
toretore has joined #ruby
devbug has quit [Read error: Connection reset by peer]
ferr has joined #ruby
baweaver has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
petrichorx has quit [Quit: Connection closed for inactivity]
rdark has joined #ruby
blackmes1 has quit [Ping timeout: 244 seconds]
mondok has joined #ruby
devbug has joined #ruby
SCHAAP137 has joined #ruby
william3 has quit [Remote host closed the connection]
jas02 has joined #ruby
PlasmaStar has quit [Ping timeout: 240 seconds]
thevaliantx has joined #ruby
smolny has joined #ruby
rohit_ has joined #ruby
duncannz has quit [Remote host closed the connection]
gregf has quit [Ping timeout: 244 seconds]
ta__ has quit [Remote host closed the connection]
<flughafen>
can i print the current node htmlin capybara? i want to just print out what it sees's the within("#foo")
sandstrom has joined #ruby
aufi has joined #ruby
TDJACR has quit [Ping timeout: 250 seconds]
charliesome has quit [Ping timeout: 240 seconds]
trosborn has quit [Quit: trosborn]
verde has joined #ruby
Guest34101 has joined #ruby
pawnbox has quit [Remote host closed the connection]
charlemagne has joined #ruby
pawnbox has joined #ruby
quazimodo has quit [Ping timeout: 276 seconds]
blackms has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
vigilate has quit [Ping timeout: 240 seconds]
TDJACR has joined #ruby
ropeney has joined #ruby
pawnbox has joined #ruby
TomyWork has joined #ruby
Anderson69s has joined #ruby
rohit_ has quit [Quit: Leaving]
rohit_ has joined #ruby
Xeago has joined #ruby
PlasmaStar has joined #ruby
Guest34101 has quit [Ping timeout: 255 seconds]
eregi has joined #ruby
vigilate has joined #ruby
pawnbox has quit [Remote host closed the connection]
krzkrzkrz has quit [Ping timeout: 250 seconds]
tulak has joined #ruby
pawnbox has joined #ruby
charliesome has joined #ruby
Pumukel has joined #ruby
steffkes has joined #ruby
steffkes has joined #ruby
eregi has quit [Ping timeout: 248 seconds]
tulak has quit [Ping timeout: 276 seconds]
rohit_ has quit [Quit: Leaving]
skade has joined #ruby
rohit_ has joined #ruby
anisha has joined #ruby
elaptics is now known as elaptics`away
sepp2k has joined #ruby
ur5us has quit [Remote host closed the connection]
firstdayonthejob has quit [Ping timeout: 244 seconds]
krzkrzkrz has joined #ruby
verde has quit [Remote host closed the connection]
rbennacer has joined #ruby
charlemagne has quit [Remote host closed the connection]
stannard has joined #ruby
lubekpl has joined #ruby
charlemagne has joined #ruby
mattwildig has joined #ruby
mikecmpbll has joined #ruby
jenrzzz has joined #ruby
mikecmpbll has quit [Client Quit]
rbennacer has quit [Ping timeout: 240 seconds]
Hounddog has joined #ruby
uglybandersnatch has joined #ruby
charlemagne has quit [Ping timeout: 252 seconds]
stannard has quit [Ping timeout: 252 seconds]
thevaliantx has quit [Quit: Leaving]
mattwildig has quit [Ping timeout: 240 seconds]
bweston92 has joined #ruby
jimcroft has joined #ruby
xfbs has joined #ruby
xfbs has quit [Client Quit]
vigilate has quit [Ping timeout: 276 seconds]
TDJACR has quit [Ping timeout: 250 seconds]
elaptics`away is now known as elaptics
blackmes1 has joined #ruby
TDJACR has joined #ruby
djbkd has quit [Quit: My people need me...]
baweaver has joined #ruby
uglybandersnatch has quit [Ping timeout: 244 seconds]
contrastingly has joined #ruby
mikecmpbll has joined #ruby
Anderson69s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 244 seconds]
UtkarshRay has quit [Ping timeout: 240 seconds]
blackmes1 has quit [Ping timeout: 250 seconds]
amincd has quit [Quit: Page closed]
baweaver has quit [Ping timeout: 250 seconds]
Xeago has quit [Read error: Connection reset by peer]
steffkes has quit [Ping timeout: 276 seconds]
rohit_ has quit [Ping timeout: 244 seconds]
ta_ has joined #ruby
Kang0 has joined #ruby
Jex has joined #ruby
Jex is now known as Guest16913
xfbs has joined #ruby
blackmes1 has joined #ruby
Xeago has joined #ruby
shredding has joined #ruby
Kang0 has quit [Client Quit]
blackgoat has joined #ruby
laith has joined #ruby
tmsbrg has joined #ruby
<tmsbrg>
where is gem's log file?
Guest16913 has quit [Ping timeout: 240 seconds]
william3 has joined #ruby
<tmsbrg>
gem tells me "Check the mkmf.log file for more details."
<tmsbrg>
and doesn't tell me where it is...
<adaedra>
Gist the entire output.
<tmsbrg>
wait, I found it
ben_ has joined #ruby
lipoqil has joined #ruby
<tmsbrg>
that was stupid, it failed to build native extensions because I have clang instead of GCC, and apparently libffi is hard-programmed to use GCC
william3 has quit [Remote host closed the connection]
Macaveli has joined #ruby
last_staff has joined #ruby
william3 has joined #ruby
<apeiros>
sombody got general experiences to share with regards to ruby + mssql? (asking over in #rubyonrails too)
noodle has quit [Ping timeout: 240 seconds]
<adaedra>
?somebody
<ruby[bot]>
adaedra: I don't know anything about somebody
<adaedra>
damn.
<adaedra>
:p
eregi has joined #ruby
<apeiros>
context: there's a push from our parent company to move to mssql and we're trying to come up with pros&contras
f4cl3y has joined #ruby
charlemagne has joined #ruby
djellemah_ has joined #ruby
mlehrer has joined #ruby
william3_ has joined #ruby
eregi has quit [Ping timeout: 240 seconds]
william3 has quit [Read error: Connection reset by peer]
aupadhye has quit [Quit: Leaving]
anisha_ has joined #ruby
charlemagne has quit [Remote host closed the connection]
charlemagne has joined #ruby
pietr0 has quit [Ping timeout: 240 seconds]
william3_ has quit [Remote host closed the connection]
p1k_ has quit [Ping timeout: 244 seconds]
anisha has quit [Ping timeout: 252 seconds]
william3 has joined #ruby
FooMunki has joined #ruby
bruce_lee has quit [Remote host closed the connection]
charlemagne has quit [Ping timeout: 255 seconds]
Mon_Ouie has quit [Ping timeout: 250 seconds]
dlitvak has joined #ruby
FooMunki has quit [Quit: FooMunki]
FooMunki has joined #ruby
pawnbox has quit [Remote host closed the connection]
gregf has joined #ruby
pawnbox has joined #ruby
steffkes has joined #ruby
steffkes has joined #ruby
contrastingly has quit [Ping timeout: 276 seconds]
bruce_lee has joined #ruby
moeabdol2 has quit [Quit: WeeChat 1.4]
Gnut has quit [Ping timeout: 276 seconds]
skade has quit [Quit: Computer has gone to sleep.]
araujo has joined #ruby
araujo has joined #ruby
steffkes has quit [Ping timeout: 244 seconds]
skade has joined #ruby
moeabdol has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
bruce_lee has quit [Ping timeout: 248 seconds]
bruce_lee has joined #ruby
ropeney has quit [Quit: Leaving]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kp666 has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
<nerium>
How do I create a hash from the Hash class (without using the {}-syntax) ? I’ve tried using Hash.new { a: 2 }, but that only returns an empty hash.
<chridal>
I need a really high speed async worker queue. Have an API written in Rails, and we're spinning of a worker to hit Pusher (an external API that broadcasts our chat messages over TCP sockets to the clients). The thing is though that the jobs seem to not only take a time to finish, but also to just be taken off the queue
<adaedra>
nerium: why?
<nerium>
adaedra: Inheritence
<chridal>
And also; what could be a good way of benchmarking this?
<adaedra>
nerium: why are you inheriting from Hash?
<nerium>
adaedra: b/c I need to add some custom methods to it
<adaedra>
You should wrap it rather than inherit from it
<nerium>
Wrap?
<nerium>
Care to elaborate?
<adaedra>
Have a custom class which has the hash as instance variable
<nerium>
Why would I do that?
william3 has quit [Ping timeout: 255 seconds]
xfbs has joined #ruby
<nerium>
That sounds like a bad implementation as I would have to deligate every method from my custom class to the hash
BrunoSaboia has joined #ruby
<nerium>
Which would yeild the exact same impl. as just using inheritance, except for all the code
william3 has joined #ruby
<ddv>
nerium: Use inheritance only when there are clearly related reusable pieces of code that fit under a single common concept or if you have to because of something you're using.
<nerium>
ddv: Its the exact same instance of Hash, just with a cuple of custom methods. That’s all. It’s should still act as a hash
BSaboia has quit [Ping timeout: 240 seconds]
<nerium>
Anyhow, how do I create a hash from scratch with init data, like I would expect .new(..) would do
<ddv>
nerium: first explain why you even want to do this
arian0n has joined #ruby
<nerium>
ddv: That’s a bit out of the scope for this question. Just imagen that I’ve to add a method to an arbirtary class. (I’ve already solved the original problem, so I’m just curoius on how you would solve it)
<nerium>
adaedra: That’s way to overkill
<adaedra>
?xy
<ruby[bot]>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
platzhirsch has left #ruby [#ruby]
pietr0 has joined #ruby
<nerium>
yeah, I know about xy, I’ve been in this comunity for over 10 years
<norc>
Refine, inherit or use Delegate.
<norc>
Those are your basic three options to do what you want.
<norc>
Each with its own up and downsides.
<apeiros>
inherit: only from classes you own.
<apeiros>
simple rule :)
<nerium>
apeiros: Okay, that’s an interesting argument
<chridal>
Currently having this issue: on a Rails API but we're hitting external APIs, and it needs to happen really fast. Currently using Resque-workers but it's slow. How to benchmark this? Also do I look at solving this with EventMachine, or even Node?
<nerium>
apeiros: or view
<apeiros>
was just gonna say that I didn't yet make an argument for that view ;-D
<nerium>
apeiros: So what would you do if you needed to add a custom method to say the String class?
<apeiros>
nerium: with ruby? I'm experimenting with refinements atm
<ddv>
chridal: #rubyonrails, also you asked the same question earlier this week right?
<apeiros>
nerium: though one question before that would be whether String is actually the right place and why
<chridal>
ddv: No. I was talking about it in #RubyOnRails indeed. Started on a rewrite in Node
<chridal>
But the thing is that there is nothing like Rails in Node, and the code becomes messy nearly right away
<ddv>
chridal: 'really fast' is kind of subjective
<chridal>
So I am trying to look at it again
<ddv>
chridal: come up with a baseline first
<chridal>
ddv: How about this; spending 50-150 ms to take the worker off the queue is totally unacceptable
BtcBen has quit [Ping timeout: 244 seconds]
<chridal>
ddv: I need messages that come into the API to have hit the external Pusher nearly instantly
<chridal>
Talking less than 10 ms here preferably
<ddv>
chridal: why are you backgrounding this?
<nerium>
apeiros: That’s sound scarry for someone getting passed the object. Say you add a method to String, make the object public. I twould look really strange if it suddendlty contained a custom method even tho it’s still a string.
<chridal>
ddv: Because we need to hit an external API, and I don't want to block the entire API while we do so.
<nerium>
Inheritence seams like a much better fit
workmad3 has joined #ruby
<apeiros>
nerium: talking about refinements?
<nerium>
apeiros: Yes
<apeiros>
nerium: that's not how they work
<apeiros>
refinements are lexically scoped
<apeiros>
i.e. the method exists at the place where you say you need it
<apeiros>
so nothing scary about it. you know you're adding the methods for that piece of code only.
<nerium>
apeiros: But if you create an object inside your ”space”, and make this object public, wont it still contain your method?
<apeiros>
no
<apeiros>
that's the point
<nerium>
I trought this only applied to the class
<apeiros>
extend would do that. refining doesn't
<nerium>
not the instances of the object
<apeiros>
it applies to everything you refine.
<nerium>
In this case I’m making the object public
<apeiros>
yes. and the method will only be available to code within the block where you have `using MyStringRefinement`
<apeiros>
nowhere else
Guest34101 has joined #ruby
<chridal>
ddv: The use case is this: We have iOS clients that are connected via a websocket to Pusher (a SaaS). We hit their REST API and it then gets broadcasted to all the listening devices. The user calls POST /message from the client, we spawn a worker which then hits their REST API. We can't block on the main thread, so we need to do it in a worker.
tvw has joined #ruby
<ddv>
chridal: why not writing directly to redis?
<chridal>
We also need for this to be nearly instant on the Rails side, because we might also have 50-200 ms on reaching Pusher and the messages actually being propagated to the listeners.
<chridal>
ddv: Instead of spawning the worker ddv?
<ddv>
yes
<nerium>
apeiros: Okay
<nerium>
Thanks for the clearification
<chridal>
ddv: Hm. That's an idea. How much time do you think we can save? Is there a big overhead with .perform_later?
<chridal>
Which also brings me to the next part; I need some good way of benchmarking this
<chridal>
So that I can make an informed decision on what we can save on moving to something like Node.
<chridal>
Sidekiq says on their GH that someone achieved 50,000 workers per second with that lib
<ddv>
chridal: well are you using the paid version?
f4cl3y has quit [Remote host closed the connection]
<chridal>
ddv: We could be, if it would save us that time.
<chridal>
Rewriting in Node is really a last last last option
<apeiros>
chridal: 50kw/s might not be relevant to you though, since your problem seems to be the latency
<ddv>
anyways this is way offtopic in here
<apeiros>
at least from the quick glance through your convo
jurisdiction has quit [Ping timeout: 250 seconds]
<chridal>
ddv: why is it off-topic though? it's not about Rails
<chridal>
It's about a Ruby gem.
<ddv>
nope
dlitvak has quit [Ping timeout: 244 seconds]
<ddv>
chridal: You are using this with Rails
Guest34101 has quit [Ping timeout: 252 seconds]
<chridal>
It's sort of in the gray zone.
<chridal>
But alright.
<chridal>
apeiros: Any thoughts about how I should be looking at this to achieve the needed performance gain though?
tulak has joined #ruby
dlitvak has joined #ruby
<chridal>
Just really struggling to get a conversation about it going in Rails.
<apeiros>
ddv: IMO it's fine. but it's borderline.
<apeiros>
chridal: don't use workers, use threads?
eregi has joined #ruby
<ddv>
he asked the same questions in #rubyonrails and because he couldn't get satisyfing answers there and answers that align with his opinions he asks them here
<chridal>
apeiros: So run it on the JVM?
<chridal>
ddv: It's more like the people in Rails don't think it's enough about Rail
<chridal>
s
<chridal>
since it's really not about Rails
<chridal>
It's about an async worker queue.
<apeiros>
not necessary. IO based threading is fine in ruby. unless there's lots of CPU involved in getting the data to Pusher
<chridal>
apeiros: So the GIL won't interfere with this?
<apeiros>
but yes, jruby will help with threading and will quite likely get more performance
<apeiros>
chridal: GIL will interfere, but I'd assume not as much, since your problem is probably mostly IO related
ropeney has joined #ruby
<chridal>
apeiros: It is indeed an IO problem, because I won't do "any processing at all" before shipping it off.
<apeiros>
but unless you have something which stops you from using jruby, I'd try with that. as it can parallelize more than just IO
<chridal>
I just need to hit that API async
<chridal>
apeiros: well, I really don't want to get into deploying the JVM if I can avoid it.
<apeiros>
yeah, then spin off a thread, hit the API and let the thread die. threads in ruby are not that expensive.
<apeiros>
just make sure you box them proberly with regards to exceptions (by default, threads die silently)
blaxter has joined #ruby
terlar has joined #ruby
<chridal>
Very interesting. Any litterature I should dive into before going down this route?
tulak has quit [Ping timeout: 240 seconds]
Axy has joined #ruby
Axy has joined #ruby
romancpodolski has joined #ruby
<romancpodolski>
Hey folks, anyone using ruby for machinelearing?
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
eregi has quit [Ping timeout: 276 seconds]
<apeiros>
chridal: not aware of any. it'll be mostly the code you already have in your worker, but called within a new thread.
<chridal>
Yea, just thinking about stuff to be weary about now that I'm doing this in a threaded manner.
Mia has quit [Ping timeout: 244 seconds]
<apeiros>
Thread.new begin; existing_call; rescue => e; handle_exception(e); end # that's the basic setup
p1k_ has joined #ruby
<chridal>
Alright. I'll do some benchmarking and see what kinds of speed improvements we get with this setup.
<chridal>
Thanks a lot.
<apeiros>
yw
<apeiros>
lets hope it's useful ;-)
<chridal>
Indeed. After spending the last 4 days in Node I was really grateful when I returned to Ruby + Rails.
<chridal>
:-D
<apeiros>
chridal: overhead to spawn a thread seems to be around 0.05ms in ruby 2.3 on my machine (2.3GHz i7 on OSX 10.11)
<apeiros>
the rest is a question of whether those threads will slow your app down too much or not
charliesome has joined #ruby
<chridal>
apeiros: Indeed. Which is the scary question because it'll be hard to measure.
uglybandersnatch has quit [Ping timeout: 244 seconds]
<apeiros>
shouldn't be too difficult
<chridal>
I also thought about writing a microservice with EventMachine and then hit the Rails API for persistence and just hit Pusher from there
<apeiros>
that'd be an option, yes
<apeiros>
that'd remove the latency
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<chridal>
and it'd decouple it entirely from the app server
<chridal>
or not entirely obviously
<chridal>
because of the persistence
<chridal>
but the spawning of threads etc.
<apeiros>
spawning of threads has the advantage of being rather simple to implement
steffkes has joined #ruby
<apeiros>
the one thing with regards to rails you have to be aware is connection pooling if you do any db work in the new thread
<chridal>
Yea. If we go for the microservice that means another load balancer and servers behind there which need to support continuous deployment and their own staging area which means at least 3 servers + load balancer
mattwildig has joined #ruby
<apeiros>
you have to check out a new connection and check it in again at the end (best in the ensure of your exception boxing of the thread)
<apeiros>
I can gist you the code of our Thread.with_connection if you wish. it handles both boxing and checking out/in a connection. would have to do after lunch, though :)
djellemah_ has quit [Ping timeout: 250 seconds]
blaxter has quit [Ping timeout: 276 seconds]
kirillzh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<chridal>
apeiros: That would be really awesome!
<apeiros>
ah, the other thing you have to be aware: if any of those threads is running while you kill the server, the "job" is lost unless you manually build countermeasures. but that might be arbitrarily complex no matter which solution you choose.
quazimodo has joined #ruby
<apeiros>
chridal: ok. bing me in ~1h if I haven't gisted until then. laters! :)
<chridal>
apeiros: Cheers! Later :-)
p1k_ has quit [Ping timeout: 240 seconds]
rbennacer has joined #ruby
mattwildig has quit [Ping timeout: 240 seconds]
ziyadb has joined #ruby
romancpodolski has quit [Quit: leaving]
sandstrom has quit [Quit: My computer has gone to sleep.]
dlitvak_ has joined #ruby
Timberwo|f has quit [Ping timeout: 250 seconds]
davidsong has joined #ruby
dlitvak has quit [Ping timeout: 252 seconds]
<davidsong>
hello ruby. I have a newb question. I have an array of arrays, [[1,2,3], [3,4,5]] and want to replace all the 3s with zeros
<davidsong>
is there a "nice" way to do this? rather than in the bloated style of other languges where you explicitly iterate over creating a new list of lists
tmsbrg has quit [Remote host closed the connection]
<manveru>
desc isn't defined, so you can call [0] on it
mondok has quit [Quit: Leaving]
<manveru>
*can't
steffkes has quit [Ping timeout: 276 seconds]
<_mak>
hmm
<manveru>
if you want to make it really short, you could do: `(desc = t.tds(:id => 'descr')).exist? ? desc[0].text : "doesn't exist"`
<manveru>
but then apeiros will have to kill a kitten
<_mak>
haha
<adaedra>
?cat
<ruby[bot]>
adaedra: I don't know anything about cat
<_mak>
I won't then
<adaedra>
?cats
<apeiros>
whaaaat?!?
<ruby[bot]>
Cats!
<_mak>
ok, I'll use the long way
<_mak>
thanks guys
<adaedra>
you're slow, ruby[bot]
mhoungbo has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby
<chridal>
apeiros: Thanks! Will have a look.
<manveru>
/rename ruby[bot] roboto
blackmes1 has quit [Ping timeout: 244 seconds]
<chridal>
Out of curiousity: what are you using threads for in your application?
<apeiros>
roboto? yet another nick?
platzhirsch has joined #ruby
<manveru>
ruboto exists already, no?
<apeiros>
ruboto is owned by me
<apeiros>
the name
<apeiros>
or the nick
<apeiros>
chridal: exchange webservice (ews)
terlar has quit [Ping timeout: 252 seconds]
<manveru>
so i suggest roboto :)
<chridal>
apeiros: But what does the code in the thread do?
<apeiros>
add calendar entries f.ex.
<apeiros>
ews is sometimes horribly slow for us (~2s for a response)
steffkes has joined #ruby
steffkes has quit [Changing host]
steffkes has joined #ruby
<apeiros>
i.e. we add the entry to our db, spin up a thread to push it over to exchange/outlook and then update the db entry with the exchange id for synchronization
<apeiros>
rails can return & render without having to wait for snaily exchange
krzkrzkrz has joined #ruby
ElFerna has joined #ruby
psyq is now known as psyq_work
steffkes has quit [Ping timeout: 248 seconds]
DaniG2k has quit [Quit: leaving]
JohnBat26 has joined #ruby
millerti has joined #ruby
Xeago has joined #ruby
Xeago has quit [Remote host closed the connection]
<chridal>
Aha! Sounds much like our use case
<chridal>
What kind of penalty are you taking for spinning up that thread?
<chridal>
Is this an often performed action?
resin has quit [Quit: leaving]
xfbs has joined #ruby
dlitvak has quit [Remote host closed the connection]
jeanlinux has joined #ruby
dlitvak has joined #ruby
UtkarshRay has joined #ruby
DaniG2k has joined #ruby
<apeiros>
chridal: as per my measurement above - it's about 0.05ms on my machine. don't know how long the connection clearing takes.
mhoungbo has joined #ruby
p1k_ has joined #ruby
kobain has joined #ruby
platzhirsch has quit [Quit: Leaving.]
Xeago has joined #ruby
sluukkonen has joined #ruby
xfbs has quit []
platzhirsch has joined #ruby
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 250 seconds]
stevemackinnon has quit [Remote host closed the connection]
Xeago has joined #ruby
dlitvak has quit [Ping timeout: 252 seconds]
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has joined #ruby
Guest34101 has quit [Read error: Connection reset by peer]
skade has joined #ruby
johnmilton has joined #ruby
duckpuppy has joined #ruby
eregi has joined #ruby
kp666 has joined #ruby
kp666 has quit [Max SendQ exceeded]
sgambino has joined #ruby
xfbs has joined #ruby
kp666 has joined #ruby
kp666 has quit [Remote host closed the connection]
openstruct has joined #ruby
Xeago has quit [Remote host closed the connection]
dlitvak_ has joined #ruby
askhat has joined #ruby
askhat has left #ruby [#ruby]
dlitvak has quit [Ping timeout: 276 seconds]
eregi has quit [Ping timeout: 240 seconds]
_mak has left #ruby [".."]
nolsen has quit [Excess Flood]
bahar has quit [Changing host]
bahar has joined #ruby
joonty has quit [Ping timeout: 240 seconds]
sandstrom has joined #ruby
Xeago has joined #ruby
lessless has joined #ruby
armyriad has quit [Ping timeout: 255 seconds]
<lessless>
guys, do you know any better way to copy a part of the hash than @params.select { |k| %w(a b c d e f g h j k l m n o).include?(k) }
<shevy>
he used guys!!!
armyriad has joined #ruby
<apeiros>
lessless: check the code of activesupport's Hash#slice
<lessless>
apeiros, thank you!
mattwildig has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<silverdust>
How may I check if a method exists in a struct?
OSIRIS_ has joined #ruby
<havenwood>
silverdust: members.include? :meth
<silverdust>
I have [['id',5],['name','Joe']].to_h.to_struct for example which gives #<struct id=5, name="Joe"> . Can I do the_struct.include? :name
<silverdust>
okay
mattwildig has quit [Ping timeout: 252 seconds]
bronson_ has joined #ruby
<silverdust>
havenwood: I get false when I check for name and name exists in it
dlitvak_ has quit [Remote host closed the connection]
sgambino has joined #ruby
sdothum has joined #ruby
<silverdust>
i = [['id',5],['name','Joe']].to_h.to_struct; i.include? :name #=> false
dlitvak has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
<ljarvis>
silverdust: where does to_struct come from?
<ljarvis>
also, as havenwood mentioned, it's .members.include?
<silverdust>
I use hashtostruct gem
<ljarvis>
heh ok
<silverdust>
It works with .members.include? I didn't know he meant members as a method of my struct
william3 has quit [Remote host closed the connection]
<apeiros>
ljarvis: WHY DO YOU DO THIS TO ME?!?
<ljarvis>
i had to go through it :(
<apeiros>
I'm with data on this one - how the F is shared suffering half the suffering?!? it's double the suffering!
<ljarvis>
:D
<ljarvis>
silverdust: please dont use that gem
<ljarvis>
I mean, unless you *really* know you need it
* ljarvis
stares at to_obj
<apeiros>
wrong anchors for a start
<ljarvis>
also, lul at inject instead of map
<apeiros>
(tru|fals)e # optimize!
<apeiros>
old me would probably have committed the same crime.
<ljarvis>
[+-]?\d+ :|
<silverdust>
ljarvis: I wouldn't if I knew a better way to convert my hash to struct
atmosx has joined #ruby
charlemagne has joined #ruby
UtkarshRay has quit [Remote host closed the connection]
mxn has joined #ruby
<silverdust>
I have very little expertise and it was my first solution to what I wanted
<ljarvis>
silverdust: like this: Struct.new(*hash.keys.map(&:to_sym)).new(hash.values) -- now you can customise it to how you really want
johnnyt has quit [Ping timeout: 240 seconds]
<ljarvis>
*hash.values *
<ljarvis>
****
<ljarvis>
then add some error checking so it doesn't blow up
<mxn>
hi! i'm trying to install the librarian-puppet gem on a debian stable system, which fails cause the ruby version is too old for one of the dependencies. i'd like to figure out where exactly the issue is, so i would love to print a gem dependency tree
unl0ckd has quit [Ping timeout: 240 seconds]
<mxn>
'gem dependency librarian-puppet' gives me something useful, but if i attempt the same for each of the dependencies, it fails for some, e.g. rspec
<mxn>
oh, 'of an installed gem', got it. so, how do i do this for non-installed gems?
joonty has joined #ruby
fourq is now known as fourq|away
fourq|away is now known as fourq
<apeiros>
ljarvis: you can drop the to_sym if you add a nil as first arg
<ljarvis>
ah yeah i guess it expects a symbol for the constant?
<mxn>
or in other ways: is there many a way i can make gem install an older version of a dependency (which still is new enough to fit the dependency), which will not require a ruby that's not available for debian stable?
<apeiros>
ljarvis: na, if the first value is a string, it'll use that as a constant. with a symbol it won't use it for the constant. sad case of argument overloading
<apeiros>
or whatever the proper term is
<ljarvis>
derp
sandstrom has quit [Quit: My computer has gone to sleep.]
<flughafen>
hurr durr
<silverdust>
ljarvis: can you please help me understand what the role of * there is. I tried omitting it and name was nil, id had both values in it as an array
bronson_ has quit [Remote host closed the connection]
<havenwood>
>> h = {aim: true}; Struct.new('StructStructStruct', *h.keys).new(*h.values)
<zotherstupidguy>
running a rake test, will load and use bundle Gemfile?
DaniG2k has joined #ruby
davidsong has quit [Quit: Page closed]
konsolebox has quit [Quit: Leaving]
ben_ has joined #ruby
<havenwood>
zotherstupidguy: bundle exec rake
quaristice has quit [Read error: Connection reset by peer]
anisha_ has quit [Quit: Leaving]
jgpawletko has joined #ruby
xfbs has quit []
mattwildig has joined #ruby
bronson has joined #ruby
godzillaenlacasa has joined #ruby
dlitvak_ has joined #ruby
stannard has joined #ruby
Sminthurus has joined #ruby
charlemagne has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 255 seconds]
bronson has quit [Ping timeout: 240 seconds]
sgambino has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
stevemackinnon has joined #ruby
xapak has joined #ruby
stevemackinnon has quit [Read error: Connection reset by peer]
AlexRussia has joined #ruby
goodcodeguy has joined #ruby
stevemackinnon has joined #ruby
stevemac_ has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nogic has joined #ruby
segy has joined #ruby
ElFerna has quit [Ping timeout: 240 seconds]
DaniG2k_ has joined #ruby
DaniG2k_ has quit [Client Quit]
stevemackinnon has quit [Ping timeout: 240 seconds]
MrDoctor has joined #ruby
<MrDoctor>
Hi guys, I am in fedora 23 and trying to set up postgresql for a rails application. I can connect to my created database using psql fine, but I am encountering problems from both my rails application and from pgadminIII. It's gives me an ident authentication failed arror.
Timberwo|f has joined #ruby
stevemac_ has quit [Ping timeout: 250 seconds]
DaniG2k has quit [Ping timeout: 252 seconds]
hxegon has joined #ruby
dlitvak has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
Kang0 has quit [Remote host closed the connection]
dlitvak_ has quit [Ping timeout: 244 seconds]
andikr has quit [Remote host closed the connection]
Kang0 has joined #ruby
mattwashere has joined #ruby
xfbs has joined #ruby
aegis3121 has joined #ruby
mxn has left #ruby [#ruby]
andyrs has joined #ruby
andyrs has quit [Remote host closed the connection]
sankaber has joined #ruby
Guest85 has joined #ruby
kies^ has quit [Ping timeout: 248 seconds]
Kensei has quit [Ping timeout: 255 seconds]
timwis has joined #ruby
<MrDoctor>
It did the trick ghr, thanks a lot.
jeanlinu_ has joined #ruby
<ghr>
great :)
eregi has joined #ruby
aryaching has quit [Read error: No route to host]
dopamean_ has quit [Ping timeout: 276 seconds]
Ishido has joined #ruby
kerunaru has joined #ruby
ElFerna has joined #ruby
Kang0 has quit [Remote host closed the connection]
Kang0 has joined #ruby
dlitvak_ has joined #ruby
jeanlinux has quit [Ping timeout: 276 seconds]
aryaching has joined #ruby
eregi has quit [Ping timeout: 240 seconds]
dlitvak has quit [Ping timeout: 250 seconds]
djellemah_ is now known as djellemah
AlexRussia has quit [Quit: WeeChat 1.4-dev]
uglybandersnatch has joined #ruby
rbennacer has quit [Remote host closed the connection]
jeanlinux has joined #ruby
jimcroft has quit []
jimcroft has joined #ruby
jimcroft_ has joined #ruby
uglybandersnatch has quit [Ping timeout: 276 seconds]
jeanlinu_ has quit [Ping timeout: 240 seconds]
A124 has quit [Ping timeout: 250 seconds]
Xeago has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
rahulprabhakar has joined #ruby
binaryplease has quit [Quit: WeeChat 1.4]
platzhirsch has joined #ruby
binaryplease has joined #ruby
steffes has quit [Remote host closed the connection]
terlar has quit [Ping timeout: 248 seconds]
<timwis>
Hey guys, I've submitted a simple pull request to Jekyll but I'm a JS dev so I'm not as familiar with ruby best practices. What's the best way to write "select where there's a string match or, if it's an array, where the array contains the string" (at the moment tests are failing because `.include?` throws an error against a boolean value) https://github.com/jekyll/jekyll/pull/4555/files
<timwis>
adaedra, a few things that are rather elementary, i'm afraid. if it were a language with which i'm comfortable, I'd do a few things: create a variable for the item_property(object, property) bit so as not to execute that function twice (and increase readability), and I'd wrap the second conditional in some kind of test that prevents it throwing an error if it's not being done on an array
<timwis>
adaedra: yeah, i was reviewing github's ruby style guide and noticed they recommend ||
MrDoctor has joined #ruby
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
or/and have different precedence than ||/&& and it is a bit confusing. You usually want ||/&&
binaryplease1 has joined #ruby
<timwis>
The reason I thought to ask in here is because a few lines up they do that "input - input.values if input.is_a?(Hash)" stuff, and the "if xxx" suffix is something I've only seen in ruby (and I think python), so I wasn't sure if there were a clever or "more best practice" way to do the test i mentioned above
platzhirsch has left #ruby [#ruby]
mor789 has joined #ruby
platzhirsch has joined #ruby
<shevy>
timwis .respond_to? is also a possibility
<adaedra>
Don't be afraid to spread it on multiple lines if you need to, shorter is not always better, timwis
<mor789>
How does the method_missing method gets a method name as an argument after overriding it?
<ljarvis>
timwis: why not just have item_property return an array and remove the first condition?
rbennacer has quit [Ping timeout: 240 seconds]
<timwis>
adaedra, and from what I've gathered, I remove the brackets and use "do" and "end" to do that, right? (forgive the elementary question)
nando293921 has joined #ruby
tulak has quit [Read error: Connection reset by peer]
<adaedra>
not compulsory, but yeah, I think community guidelines do that
<timwis>
ljarvis: I *assume* that item_property is a utility used throughout the codebase, and doing that would be a more significant pull request than they probably want on a project this big
<timwis>
but worth verifying
tulak has joined #ruby
<ljarvis>
timwis: yep fair enough, otherwise you could just do: Array(item_property(object, property).to_s).include?(value.to_s)
thevaliantx has joined #ruby
<timwis>
okay i'll find out what respond_to? does shevy thanks for the tip
binaryplease1 has quit [Client Quit]
binaryplease has quit [Ping timeout: 240 seconds]
mattwashere has quit []
<ljarvis>
you really don't need type checks here fwiw
TomPeed has joined #ruby
binaryplease has joined #ruby
<timwis>
ljarvis, but .to_s ... wouldn't that be converting it to a string?
<ljarvis>
imo: Array(foo).include?(bar) reads better than foo == bar || (foo.is_a?(Array) && foo.include?(bar))
<ljarvis>
timwis: yes, before you create the array
Jeremy1023 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
konsolebox has joined #ruby
<ljarvis>
but anyway, I'm confused. You don't control item_property() but your code assumes it *might* be an array, why is that?
<mor789>
How does the method_missing method gets a method name as an argument after overriding it?
<timwis>
i agree about readability, but ... well i suppose if I leave off .to_s, I could do what you've suggested. Wrapping it in Array() will still work if it's already an array?
<timwis>
ljarvis, the pull request is enhancing the "where" liquid filter. currently it only works on string comparisons (where: foo, "bar") when foo is a string. the pull request enables it to work when foo is an array, to test if it contains the string "bar"
jimcroft_ has quit []
jimcroft_ has joined #ruby
Damien___ has joined #ruby
<ljarvis>
timwis: I don't think that's right. Your code assumes item_property() could return an array, not that value is an array
<ljarvis>
so maybe it's backwards?
<ljarvis>
in which case, Array(value).include?(item_property...) would definitely be the best way to write it
nando293921 has quit [Ping timeout: 240 seconds]
<timwis>
Your logic confused me a bit just now, but your conclusion I agree with
<ljarvis>
mor789: yes, that's some code. Do you have a question about it?
william3 has quit [Remote host closed the connection]
<silverdust>
what's the name given to things like this exists?
<mor789>
How does the method take the method name "some_method" as an argument when its overrided
whippythellama has joined #ruby
<ljarvis>
mor789: by design, if a method does not exist when being called, it calls method_missing (which, by default, just raises an exception)
<silverdust>
I mean with the question mark at the end
<ljarvis>
silverdust: huh?
rahulprabhakar has joined #ruby
<silverdust>
methods like that
Flakes has quit [Ping timeout: 244 seconds]
<ljarvis>
silverdust: oh.. you can just assume that they're used to check the truthyness of something
<silverdust>
methods that always return a boolean value
<ljarvis>
no
<ljarvis>
that's not quite right
idefine has joined #ruby
<ljarvis>
the idea is that you shouldn't care about the return value, except in a condition. Because it should return truthy or falsy (that is, nil/false for falsy, and anything else for truthy)
<silverdust>
I've heard someone call them by a name before but I can't remember what that is
<workmad3>
silverdust: predicate methods
jeanlinux has quit [Remote host closed the connection]
<mor789>
ljarvis: but the method was override
<ljarvis>
wat
rahulprabhakar has left #ruby [#ruby]
aegis3121 has quit [Ping timeout: 248 seconds]
<ljarvis>
I've never heard of it called a predicate method but yeah
<silverdust>
okay so can I store a value directly in a something like a preidcate method? i.e exists? = true just to mock data
bronson has joined #ruby
jeanlinux has joined #ruby
<ljarvis>
silverdust: methods dont store things, they do stuff and return values
<silverdust>
*predicate method
nofacade has joined #ruby
<ljarvis>
silverdust: so yes, you can write a method which just returns true
<ljarvis>
def exists?() true end
<timwis>
ljarvis: here's what I ended up with FYI, and tests are passing. https://gist.github.com/timwis/8d2078c62cd3a0b0d8ed Thanks again. I can't really tell if there's anything "non-rubyist" in there but hopefully it's simple enough that I've avoided any of those mistakes
rbennacer has joined #ruby
konsolebox has quit [Quit: Leaving]
<mor789>
ljarvis: if you override the method_missing method how does it refers to its origin method?
quakephil has quit [Ping timeout: 252 seconds]
<silverdust>
okay thanks
<ljarvis>
timwis: your first expression is already covered by the second expression.
william3 has joined #ruby
aegis3121 has joined #ruby
<timwis>
:O no way
<ljarvis>
mor789: by calling super
<timwis>
I think I can see what you mean
<ljarvis>
timwis: well, not *exactly* but you should consense it imo
<timwis>
but Array(input_property) doesn't cast input_property to a string
<ljarvis>
but again, I'm confused. you mentioned that you don't control what item_property returns, but your code assumes it could return either an array or a string
<ljarvis>
did it always return maybe an array?
<mor789>
ljarvis: I didn't call super in my method, so how does it take a method name as an argument?
jottr has quit [Ping timeout: 248 seconds]
<ljarvis>
mor789: because that's how method_missing works, when it's called, it sends the method name as the first argument
<ljarvis>
I don't know what you want from me :(
ljames has quit [Ping timeout: 260 seconds]
<timwis>
ljarvis: It could return a boolean or number as well (some of the tests use booleans)
<timwis>
I think item_property is just getting a property from a hash
<ljarvis>
timwis: right, so previously it just called .to_s on *everything*?
<timwis>
yes
Xeago has joined #ruby
dhollinger has joined #ruby
<ljarvis>
right ok thanks, then I would: Array(input_property).map(&:to_s).include?(value.to_s)
Deck` has joined #ruby
<ljarvis>
but what you have is fine really
bronson has quit [Ping timeout: 276 seconds]
jottr has joined #ruby
x77686d has joined #ruby
quakephil has joined #ruby
<mor789>
ljarvis: when you override the method_missing method you change its content and put your's
twintail has quit [Remote host closed the connection]
<ljarvis>
mor789: correct.
<timwis>
ah, clever ljarvis. since it was already casting everything to a string, this is no worse
krobzaur_ has joined #ruby
decoponio has joined #ruby
<timwis>
and i can keep it a slim one-liner (which I know is not always the best)
<timwis>
(but simpler for a pull request)
zast has joined #ruby
jeanlinu_ has joined #ruby
krobzaur has joined #ruby
saneax is now known as saneax_AFK
<Deck`>
is there more elegant way to write this https://dpaste.de/EjPu ? it's about creating hash with optional params
<mor789>
ljarvis: so how does it take a method name as an argument after rewriting the method?
idefine has quit [Remote host closed the connection]
<ljarvis>
Deck`: I wouldn't use tap myself, but I think it's fine
Damien___ has quit [Ping timeout: 240 seconds]
<ljarvis>
mor789: because when method_missing is trigged, it *always* sends the method name as an argument
bricker has quit [Ping timeout: 252 seconds]
<Deck`>
ljarvis: so you would add new variable inside map and then set optional arguments?
<ljarvis>
Deck`: I would yeah
thevaliantx has quit [Quit: Leaving]
<Deck`>
thanks
rippa has joined #ruby
steffkes has quit [Ping timeout: 240 seconds]
jeanlinux has quit [Ping timeout: 250 seconds]
failshell has joined #ruby
<mor789>
ljarvis: Thank you! is it unique feature to the "method_missing" method or all the methods act like this?
fostertheweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Deck`>
ljarvis: I disliked this approach as I should explicitly say 'entity' in the end to return
steffes has quit [Remote host closed the connection]
dopamean_ has joined #ruby
<ljarvis>
mor789: it's very much unique, method_missing is used in core Ruby C code. There are other types of unique methods similar to this
rbennacer has quit [Remote host closed the connection]
<ljarvis>
Deck`: yep, I prefer that. It's down to taste, go with tap if you prefer it
Helheim has quit [Ping timeout: 250 seconds]
dopamean1 has joined #ruby
floatingpoint has joined #ruby
swills has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ljarvis>
I only use tap when creating a new block helps code readability or maintenance in some way
sgambino has joined #ruby
<mor789>
ljarvis: thanks a lot! :)
fostertheweb has joined #ruby
rodfersou is now known as rodfersou|lunch
steffkes has joined #ruby
griffindy has quit [Read error: Connection reset by peer]
htmldrum has joined #ruby
Helheim has joined #ruby
diegoviola has joined #ruby
fostertheweb has quit [Client Quit]
x77686d has quit [Remote host closed the connection]
dopamean_ has quit [Ping timeout: 240 seconds]
Hammy_Work has joined #ruby
sankaber has quit [Remote host closed the connection]
matled- has joined #ruby
justbleed has joined #ruby
x77686d has joined #ruby
sankaber has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
Kensei has quit [Ping timeout: 252 seconds]
fostertheweb has joined #ruby
Helheim has quit [Max SendQ exceeded]
minimalism has quit [Ping timeout: 276 seconds]
Mojo_Nixon has joined #ruby
pawnbox_ has joined #ruby
Helheim has joined #ruby
aufi has quit [Remote host closed the connection]
rbennacer has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
symm- has joined #ruby
ljames has joined #ruby
ElFerna_ has joined #ruby
babblebre has joined #ruby
PsionTheory has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
Helheim has quit [Max SendQ exceeded]
aufi has joined #ruby
ElFerna has quit [Ping timeout: 240 seconds]
TomPeed has quit [Read error: Connection reset by peer]
\13k has joined #ruby
\13k has joined #ruby
\13k has quit [Ping timeout: 240 seconds]
ruurd has quit [Excess Flood]
matled has quit [Ping timeout: 240 seconds]
lianj has quit [Ping timeout: 240 seconds]
funnel has quit [Ping timeout: 240 seconds]
Platini has quit [Ping timeout: 240 seconds]
\13k has quit [Changing host]
pawnbox has quit [Ping timeout: 240 seconds]
infernix has quit [Ping timeout: 240 seconds]
matled- is now known as matled
justbleed is now known as tommy_p
lianj has joined #ruby
lianj has joined #ruby
lianj has quit [Changing host]
funnel has joined #ruby
FIGO_ has joined #ruby
Helheim_ has joined #ruby
ruurd has joined #ruby
anagha_ has joined #ruby
p1k_ has quit [Read error: Connection reset by peer]
Helheim_ has quit [Max SendQ exceeded]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tulak has quit [Remote host closed the connection]
goodcodeguy has joined #ruby
tulak has joined #ruby
<anagha_>
gtgt
dlitvak has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<anagha_>
hello
FIGO_ is now known as Platini
<anagha_>
is #RubyonRails the irc channel for rails?
<ljarvis>
yes
<apeiros>
yes
<apeiros>
anagha_: why do you ask?
<anagha_>
But I am not able to ping on the channel
<apeiros>
you need to be registered
<ljarvis>
you need to register your nick
Helheim has joined #ruby
cdg has joined #ruby
<apeiros>
?register
<ruby[bot]>
you need to be identified with NickServ, see /msg NickServ HELP
<ddv>
anyone know why this matches? '2016-02-25T15:20:12.0_' =~ /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{1,3}/
<apeiros>
that's what it matches. the why is IMO obvious, if not, please specify what part you have trouble with.
dlitvak_ has quit [Ping timeout: 252 seconds]
<ddv>
apeiros: well becaus of the underscore, I thought I specified \d{1,3} at the end
cabargas has joined #ruby
<apeiros>
ddv: you have no anchors
jottr has quit [Ping timeout: 244 seconds]
goodcodeguy has quit [Client Quit]
<ljarvis>
there is no endzz
<ddv>
aaah
themsay has joined #ruby
<ddv>
thanks :)
<apeiros>
the \.\d{1,3} happily matches the ".0"
goodcodeguy has joined #ruby
<apeiros>
common regex mistake no. 2
<ddv>
probably
<ljarvis>
apeiros: what's 1? using regex in the first place? :)
lessless has quit [Ping timeout: 255 seconds]
<apeiros>
yupp
Helheim has quit [Max SendQ exceeded]
eregi has joined #ruby
<ljarvis>
aye
<ljarvis>
which reminds me
blandflakes has joined #ruby
<ljarvis>
ddv: Time.parse
* apeiros
smacks ljarvis with a large clock
<apeiros>
Time.strptime
<ljarvis>
a.. clock
<ljarvis>
right right strptime
<ddv>
I tried using Time.iso8601
<apeiros>
or in this case, probably Time…
<apeiros>
right. that's what I wanted to say :)
<ddv>
but I don't want to use time zone designations
Helheim has joined #ruby
<ljarvis>
ddv: always use strpftime, since you seem to know the format
<ddv>
yeah seems way better
<apeiros>
ddv: they're not required by iso8601
<ljarvis>
time zones
<ljarvis>
not even once
<ddv>
apeiros: I know
<apeiros>
no time zone == local time zone
rbennacer has quit [Remote host closed the connection]
<apeiros>
ddv: then I don't understand your problem with iso8601
<apeiros>
ljarvis: lucky guy if you so far managed to not having to deal with timezones
goodcodeguy has quit [Client Quit]
kies^ has joined #ruby
htmldrum has quit [Ping timeout: 252 seconds]
<apeiros>
though, timezones are easy. dst and leapseconds are hard.
<ljarvis>
apeiros: ... I work on chronic
Helheim has quit [Max SendQ exceeded]
<apeiros>
ljarvis: hah!
<apeiros>
ljarvis: I work on chronos.js again
<ljarvis>
:)
<apeiros>
almost completed. but parser still missing - in case you're interested :D
<ljarvis>
I am not, thank you ;)
<apeiros>
too sad. interested in sharing your experience, though?
<apeiros>
in order for me to avoid the pitfalls you already identified…
<ddv>
apeiros: I was using Time.iso8601 to check if a string conforms to iso8601
idefine has joined #ruby
<yorickpeterse>
apeiros: 1) don't write a natural time parser
<yorickpeterse>
ᕕ(ᐛ)ᕗ
Helheim has joined #ruby
<ljarvis>
I could be, I've actually been working on a chronic replacement for.. 2/3 years now. I have a different branch with 3 different parsing methods, none of which I'm completely sold on
eregi has quit [Ping timeout: 240 seconds]
<apeiros>
yorickpeterse: I want to go even further than that actually. I want to implement "data detectors"
<ljarvis>
so yeah, yorickpeterse pretty much nails it
<apeiros>
(find dates, locations, names in plain text)
mary5030 has joined #ruby
goodcodeguy has joined #ruby
Snowy is now known as EGGS_
mary5030 has quit [Remote host closed the connection]
terlar has joined #ruby
<apeiros>
ljarvis: ok. well. I guess whenever I get to writing a natural language parser, I'll have a talk with you after having come up with something myself.
mary5030 has joined #ruby
htmldrum has joined #ruby
Helheim has quit [Max SendQ exceeded]
eregi has joined #ruby
<apeiros>
though I'm a bit startled by the idea of doing this in js with its piss poor text manipulation support.
<apeiros>
s/startled/scared/
<timwis>
apeiros what do you mean by text manipulation support?
<timwis>
have you tried template strings?
konsolebox has joined #ruby
<apeiros>
timwis: I'd love to have an equivalent of StringScanner f.ex.
<apeiros>
also js' regexen are a sad sad joke
<ljarvis>
a custom lexer is probably just the thing you need anyway
Helheim has joined #ruby
codecop has joined #ruby
<yorickpeterse>
apeiros: finding locations/names is super complex
<yorickpeterse>
really the only way you can do that is using either dictionaries (good luck with their sizes) or NLP (good luck producing good models)
<yorickpeterse>
It's right up there with detecting address formats
Helheim has quit [Max SendQ exceeded]
<apeiros>
timwis: I somewhat doubt that that can be even remotely efficient
dubek has quit [Ping timeout: 244 seconds]
<timwis>
apeiros: forgive me, but I missed the beginning of the conversation where you said what you were trying to do, and couldn't establish it well enough by scrolling up
Helheim has joined #ruby
<apeiros>
I have a vague idea how I'd port it (since I pondered), and I didn't because I doubted the possibility of doing it with sane efficiency. I never actually did the necessary checks, though.
<apeiros>
timwis: no worries
eregi has quit [Ping timeout: 248 seconds]
ElFerna_ has quit [Ping timeout: 244 seconds]
chouhoulis has quit [Remote host closed the connection]
infernix has joined #ruby
MrDoctor has quit [Quit: Konversation terminated!]
chouhoulis has joined #ruby
<apeiros>
yeah, as expected, StringScanner#scan in the js impl: `regexp.exec(this.getRemainder())) && matches.index === 0`
<apeiros>
so the regex is ran against the full remainder, i.e. no chance of short-circuit when it doesn't match at start.
Helheim has quit [Max SendQ exceeded]
zotherstupidguy has quit [Quit: WeeChat 1.3]
jokester has quit [Quit: WeeChat 1.4]
<ljarvis>
that across the entire source?
<ljarvis>
lul
<apeiros>
plus it needs to create the substring to get the remainder in the first place (this can be done reasonably efficient, though)
aufi has quit [Ping timeout: 240 seconds]
Helheim has joined #ruby
<apeiros>
yeah. fine for short pieces of text. but if you want to run it against, say, a multi-page document? good luck not having an exploding running time.
adgtl has joined #ruby
<yorickpeterse>
apeiros: Ragel 7 has a JS backend, you might want to just use that
rodolfowtf has joined #ruby
<apeiros>
yorickpeterse: that is interesting. though ragel probably means I'd have to compile it for every language.
tjohnson has joined #ruby
<yorickpeterse>
eh?
ben___ has joined #ruby
<apeiros>
human language
<apeiros>
like, one state machine for english, one for german etc.
<yorickpeterse>
oh right
Kensei has joined #ruby
Kensei has joined #ruby
<yorickpeterse>
Hm, probably
ben_ has quit [Ping timeout: 248 seconds]
<ljarvis>
I hacked around with a funny (ridiculous) implementation for parsing date/times which basically normalised the string in some way, then matched the return value from a set and returned the method to parse. Now all I have to do is crowdsource formats
<apeiros>
ah, right, language detection would also be part of the data detectors :) shouldn't be too hard with sampling of a short piece of the text and a bloom filter.
cjbottaro has joined #ruby
hayden_ has joined #ruby
<yorickpeterse>
haha no
<yorickpeterse>
it's not that easy
timwis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
we shall see! :D
<yorickpeterse>
hi I worked on this stuff for about 3 years
<yorickpeterse>
bloom filters are about as accurate as having a 4 year old do it
andikr has joined #ruby
johnny56_ has joined #ruby
idefine has quit [Remote host closed the connection]
<apeiros>
yorickpeterse: did you opensource your solution?
Helheim has quit [Max SendQ exceeded]
dlitvak has quit [Remote host closed the connection]
<yorickpeterse>
"chicken butts" gets detected as English correctly
Helheim has joined #ruby
BSaboia has quit [Ping timeout: 252 seconds]
htmldrum has quit [Ping timeout: 244 seconds]
<silverdust>
shouldn't rbenv global x just switch to that version as far as I have it installed. I have 2.2.3 and trying to test 2.0.0-dev but it wouldn't leave 2.2.3
<silverdust>
I never had to switch on rbenv until now
htmldrum has joined #ruby
aryaching has quit [Ping timeout: 244 seconds]
ropeney has quit [Quit: Leaving]
eregi has joined #ruby
Helheim has quit [Max SendQ exceeded]
<silverdust>
oh I get it. I was in project that had it as its local had to run rbenv local
moos3 has quit [Ping timeout: 252 seconds]
<yorickpeterse>
also while we're at it, there's so much BS in the NLP industry
Helheim has joined #ruby
<yorickpeterse>
OMGMMGMG THIS LIBRARY HAS 99,9% ACCURACY....on the 5 sentences we tested it
jottr has joined #ruby
<apeiros>
heh
<yorickpeterse>
oh and it's not actually suitable for production usage because lol lets load 10GB of models into memory
<apeiros>
that's actually one thing which I dislike - getting a reasonable body of text for test-cases.
rbennacer has quit [Ping timeout: 252 seconds]
<yorickpeterse>
Oh you want to do constituent parsing in Dutch? Enjoy installing some random thing written in Prolog that uses an ancient version of TCL/TK
dlitvak has joined #ruby
<yorickpeterse>
I can go on for a while :P
moos3 has joined #ruby
<yorickpeterse>
Thankfully I don't have to deal with that any more
<yorickpeterse>
now I just deal with caching issues
<apeiros>
that's quite a new aspect of you yorickpeterse, never noticed before ;-p
yardenbar has quit [Ping timeout: 250 seconds]
<yorickpeterse>
shush
terminalrecluse has joined #ruby
stevemackinnon has joined #ruby
rbennacer has joined #ruby
devbug has joined #ruby
konsolebox has quit [Quit: Leaving]
jeanlinu_ has quit [Remote host closed the connection]
bronson has joined #ruby
mor789 has quit [Ping timeout: 252 seconds]
stevemackinnon has quit [Read error: Connection reset by peer]
Helheim has quit [Max SendQ exceeded]
stevemackinnon has joined #ruby
idefine has quit [Remote host closed the connection]
slawrence00 has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
mark1 has quit [Remote host closed the connection]
Helheim has joined #ruby
stevemackinnon has quit [Read error: Connection reset by peer]
Gnut has joined #ruby
stevemackinnon has joined #ruby
Renich has joined #ruby
Helheim has quit [Max SendQ exceeded]
stevemackinnon has quit [Read error: Connection reset by peer]
stevemac_ has joined #ruby
dlitvak has quit [Ping timeout: 276 seconds]
polishdub has joined #ruby
rakm has joined #ruby
devbug has quit [Ping timeout: 250 seconds]
stevemac_ has quit [Read error: Connection reset by peer]
bricker has joined #ruby
<openstruct>
I came across a coding challenge to update a value in a nested hash base on a bath. E.g. hash = { name: 'bob', hobbies : { baseball: {type: :activity}}} and path = 'hobbies.baseball.type'. The task was to update type to :sport.
bronson has quit [Ping timeout: 240 seconds]
idefine has joined #ruby
Helheim has joined #ruby
stevemackinnon has joined #ruby
<openstruct>
I did it by splitting the path into an array of symbols and iterating over it.
blaxter has joined #ruby
<openstruct>
Apparently it can be done in one line (albeit slower) but I can't seem how figure out the one liner way.
stevemackinnon has quit [Read error: Connection reset by peer]
stevemackinnon has joined #ruby
aegis3121 has quit [Ping timeout: 244 seconds]
<apeiros>
openstruct: please gist your solution (just to show that you did solve it yourself)
<openstruct>
Solution is a bit messy but it was my first stab at it on the fly.
<openstruct>
I considered recursion but meh.
<apeiros>
path.split(".")[0..-2].inject(hash) { |scope, key| scope[key.to_sym] }[path[/[^.]*\z/].to_sym] = :sport # untested, extracting the values twice is ugly but gives you a single line of code
<openstruct>
Ah, yeah, I was thinking that inject would be the best route.
<apeiros>
if two lines are allowed, I'd do: *base,last = path.split("."); base.inject …
<apeiros>
additional note: this code fails horribly if the path doesn't actually exist :)
<apeiros>
(which is why I wouldn't write code like that in anything production)
stevemackinnon has quit [Ping timeout: 252 seconds]
Helheim has quit [Max SendQ exceeded]
Guest34101 has quit [Ping timeout: 248 seconds]
<apeiros>
works for your example code.
Helheim has joined #ruby
kobain has quit [Ping timeout: 260 seconds]
aegis3121 has joined #ruby
haylon has joined #ruby
<openstruct>
apeiros: Cool - thanks for showing that!
<apeiros>
yw
aegis3121 has quit [Client Quit]
melter has joined #ruby
treehug88 has joined #ruby
aegis3121 has joined #ruby
Helheim has quit [Max SendQ exceeded]
aganov has quit [Remote host closed the connection]
pandaant has quit [Remote host closed the connection]
Helheim has joined #ruby
marr has quit [Ping timeout: 248 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
ElFerna_ has joined #ruby
synthroid has quit [Remote host closed the connection]
idefine has quit [Remote host closed the connection]
Helheim has quit [Max SendQ exceeded]
ljames has quit [Ping timeout: 260 seconds]
dlitvak has joined #ruby
voxxit has quit [Ping timeout: 240 seconds]
Helheim has joined #ruby
idefine has joined #ruby
Xeago has quit [Ping timeout: 244 seconds]
sneakerhax has quit [Quit: back later]
Helheim has quit [Max SendQ exceeded]
Xeago has joined #ruby
voxxit has joined #ruby
tristanp_ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
Helheim has joined #ruby
Helheim has quit [Max SendQ exceeded]
johnnyt has quit [Ping timeout: 240 seconds]
fostertheweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Helheim has joined #ruby
B1n4r10 has quit [Ping timeout: 244 seconds]
johnnyt has joined #ruby
jas02 has quit [Quit: jas02]
mlehrer has quit [Remote host closed the connection]
MrDoctor has joined #ruby
llua has quit [Changing host]
llua has joined #ruby
Helheim has quit [Max SendQ exceeded]
hanmac has joined #ruby
failshell has quit []
idefine has quit [Remote host closed the connection]
rkazak has quit [Ping timeout: 248 seconds]
Helheim has joined #ruby
tulak has quit [Remote host closed the connection]
idefine has joined #ruby
Guest85 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Phoenix has joined #ruby
tulak has joined #ruby
adam_ is now known as adam12
idefine has quit [Remote host closed the connection]
htmldrum has quit [Ping timeout: 240 seconds]
htmldrum has joined #ruby
idefine has joined #ruby
ElFerna_ has quit [Ping timeout: 244 seconds]
idefine has quit [Remote host closed the connection]
tulak has quit [Ping timeout: 255 seconds]
ljames has joined #ruby
Don_John has joined #ruby
htmldrum has quit [Ping timeout: 240 seconds]
Guest85 has joined #ruby
htmldrum has joined #ruby
Sembei has joined #ruby
idefine has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
mattwild_ has joined #ruby
rattatmatt has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mattwildig has quit [Ping timeout: 248 seconds]
baweaver has joined #ruby
kobain has joined #ruby
kobain has quit [Max SendQ exceeded]
TomyWork has quit [Ping timeout: 244 seconds]
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kobain has joined #ruby
terlar has quit [Ping timeout: 255 seconds]
rbennacer has quit [Remote host closed the connection]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<n1colas>
o/
kobain has quit [Max SendQ exceeded]
unsymbol_ has quit [Quit: cheerio]
krobzaur_ has quit [Quit: WeeChat 1.2]
kobain has joined #ruby
unsymbol has joined #ruby
blackmes1 has quit [Ping timeout: 244 seconds]
sandstrom has joined #ruby
chouhoulis has quit [Remote host closed the connection]
laith has quit [Ping timeout: 250 seconds]
Guest85 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dgncn has joined #ruby
htmldrum has quit [Ping timeout: 248 seconds]
dlitvak has quit [Remote host closed the connection]
flughafen_ has joined #ruby
aegis3121 has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
idefine has quit [Remote host closed the connection]
Rickmasta has joined #ruby
chipotle has joined #ruby
goodcodeguy has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
idefine has joined #ruby
quakephil has quit [Ping timeout: 244 seconds]
Rickmasta has quit [Max SendQ exceeded]
htmldrum has joined #ruby
Rickmasta has joined #ruby
Rickmasta has quit [Max SendQ exceeded]
mattwild_ has quit [Ping timeout: 255 seconds]
Rickmasta has joined #ruby
mattwildig has joined #ruby
Rickmasta has quit [Max SendQ exceeded]
idefine has quit [Remote host closed the connection]
Kensei has quit [Ping timeout: 252 seconds]
Rickmasta has joined #ruby
blackmes1 has joined #ruby
Rickmasta has quit [Max SendQ exceeded]
Rickmasta has joined #ruby
Rickmasta has quit [Client Quit]
<manveru>
(*h, t = path.split('.'); h).reduce(hash){|s,v| s[v.to_sym] }[t] = 'stuff'
psyq_work is now known as psyq
joonty has quit [Ping timeout: 276 seconds]
uri_ has joined #ruby
eregi has quit [Ping timeout: 248 seconds]
htmldrum has quit [Ping timeout: 276 seconds]
mfb2 has joined #ruby
baweaver has quit [Remote host closed the connection]
speakingcode has quit [Quit: leaving]
dubek has joined #ruby
synthroid has joined #ruby
synthroid has quit [Remote host closed the connection]
synthroid has joined #ruby
<manveru>
now... one line is a bit harder
rbennacer has joined #ruby
eregi has joined #ruby
x77686d has quit [Quit: x77686d]
Guest85 has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sanguisdex>
ljarvis: reading and comprehending thanks
iooner has quit [Ping timeout: 240 seconds]
<sanguisdex>
or at least trying
<Authenticator>
What's a good single-file-executable Ruby packager for Linux? Currently I'm fetching Ruby 2.2+, building an RPM, including my gem, and RPMing that. It takes admin privs to install, and isn't very tidy once installed.
<havenwood>
Authenticator: You can add an `-- --enable-shared` flag if you want to have the Ruby be movable.
adgtl has quit []
iooner has joined #ruby
<havenwood>
Authenticator: You can install to `/usr/local` with the `--system` flag or put it wherever you like. A popular tool that will detect the default install locations and let you easily switch between Rubies is chruby: https://github.com/postmodern/chruby#auto-switching
<havenwood>
(Didn't mean to link to #auto-switching.)
Xeago has quit [Remote host closed the connection]
binaryplease has quit [Ping timeout: 255 seconds]
dlitvak has joined #ruby
<havenwood>
Authenticator: Or say more what you mean by "single-file-executable Ruby package"? Now that I'm rereading your question I think I misread.
Couch has quit [Ping timeout: 244 seconds]
funnel has quit [Quit: leaving]
nofacade has quit [Ping timeout: 244 seconds]
<havenwood>
Authenticator: I have to relocate but my second stab at trying to answer is to take a look at Traveling Ruby: http://phusion.github.io/traveling-ruby/
f4cl3y has quit [Ping timeout: 240 seconds]
funnel has joined #ruby
rbennacer has joined #ruby
borodin has joined #ruby
LoneHerm_ has joined #ruby
rbennace_ has quit [Ping timeout: 240 seconds]
mor789 has joined #ruby
<mor789>
I have an error: "test.rb:17:in `has_friend': undefined method `<<' for nil:NilClass (NoMethodError)"
nickjj has quit [Read error: Connection reset by peer]
<Zarthus>
mor789: :(
rattatmatt has quit [Remote host closed the connection]
sepp2k has quit [Read error: Connection reset by peer]
<mor789>
Zarthus: I want it to be an empty array
dlitvak_ has quit [Remote host closed the connection]
<Zarthus>
mor789: I'm afraid i'm not going to spell it out for you.
<Zarthus>
I've given you enough hints, take a look. What could be going wrong here?
stevemackinnon has joined #ruby
dlitvak has joined #ruby
dopamean1 has quit [Ping timeout: 244 seconds]
The_Phoenix has quit [Quit: Leaving.]
stevemackinnon has quit [Read error: Connection reset by peer]
Kensei has joined #ruby
Kensei has joined #ruby
stevemackinnon has joined #ruby
firstdayonthejob has joined #ruby
Xeago has joined #ruby
<ben___>
Is there a way to achieve a similar behaviour to if/else in ERB, but with a custom function accepting a block? I want to be able to write <%= f(x) do %> blah html <% end %> and either produce the return value of f(x) or "blah html" if f(x) == nil.
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
adgtl has quit [Read error: No route to host]
sgambino has joined #ruby
blaxter has quit [Quit: foo]
HiddenSnake has joined #ruby
nisstyre_ has joined #ruby
stevemackinnon has quit [Ping timeout: 240 seconds]
adgtl has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skade has joined #ruby
adgtl has quit [Client Quit]
mikecmpbll has joined #ruby
elifoster has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
lsmola has quit [Ping timeout: 255 seconds]
lubekpl has joined #ruby
Gnut has quit [Ping timeout: 276 seconds]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
<mor789>
Zarthus: im so funny...spelling error, thank you:)
chouhoulis has joined #ruby
maletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kerunaru has joined #ruby
william3 has quit [Remote host closed the connection]
_djbkd has joined #ruby
Gnut has joined #ruby
goodcodeguy has joined #ruby
yfeldblum has quit [Ping timeout: 276 seconds]
william3 has joined #ruby
bronson has quit [Ping timeout: 244 seconds]
ben___ has quit [Quit: Lost terminal]
adgtl has joined #ruby
adgtl has quit [Changing host]
adgtl has joined #ruby
graydot has joined #ruby
armyriad has quit [Ping timeout: 244 seconds]
dubek has quit [Ping timeout: 240 seconds]
armyriad has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
Guest85 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
william3 has quit [Ping timeout: 240 seconds]
chipotle has quit [Quit: cheerio]
ramfjord has joined #ruby
mondok has joined #ruby
<sanguisdex>
I have to say 10 lines feels like a really tight squeeze for a method line limit
intrigueD has joined #ruby
* sanguisdex
is used to the php freedom of vomiting up lines and lines of dirty code
Guest85 has joined #ruby
trosborn has joined #ruby
<ramfjord>
What do you guys think is the cleanest way to transform a set of hash keys using another hash as the mapping?
rbennacer has quit [Remote host closed the connection]
jenrzzz has joined #ruby
spk has quit [Client Quit]
mattwildig has joined #ruby
ss_much has quit [Quit: Connection closed for inactivity]
HiddenSnake has joined #ruby
tomchapin has joined #ruby
GenghisKen has quit [Ping timeout: 244 seconds]
tomchapin has quit [Client Quit]
spk has joined #ruby
Hounddog has quit [Ping timeout: 250 seconds]
mhoungbo has quit [Ping timeout: 255 seconds]
shadoi has joined #ruby
akem has joined #ruby
sneakerhax has joined #ruby
ljames has quit [Ping timeout: 276 seconds]
uglybandersnatch has joined #ruby
sandstrom has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
<sanguisdex>
is there any way to re-factor this to make it better fit into rubocops 10 line method limit other then making what would seem to be more smaller methods that will only be used for the purpose of making things smaller. https://gist.github.com/sanguis/8fea8779e61721baeb47
Asher has joined #ruby
* adaedra
don't care about these kind of rubocop offenses
psyq_away is now known as psyq
cajone has joined #ruby
<mor789>
`method_missing': undefined method `public_method_defined' for Person:Class
uglybandersnatch has quit [Ping timeout: 240 seconds]
<Zarthus>
mor789: you need to start asking questions, not pasting your error.
joonty has quit [Ping timeout: 276 seconds]
<Zarthus>
mor789: What is going wrong, what are you expecting, why do you think it is going wrong, and where is the gist of your code?
<hanmac>
adaedra: thumbs up from me! ;P
<workmad3>
sanguisdex: not particularly... I'd probably ignore the offence in `get_files` as that's pretty clear IMO... I'd probably look to extract the `extract = ...` bit out into a separate method in `unpack_archive` because that feels lower-level than the other 2 parts of that method :)
<workmad3>
sanguisdex: you're likely to run into that rubocop offence a lot if you run it over chef resources, btw... the way chef resources are declared tends towards a lot of lines, but conceptually the resource and the block is '1 thing'... but rubocop doesn't understand that sort of concept-level thing, so just criticises the long list of simple resource attribute declarations :)
ta_ has joined #ruby
dlitvak_ has quit [Remote host closed the connection]
jenrzzz has joined #ruby
colegatron has joined #ruby
MatthewsFace has joined #ruby
<Authenticator>
havenwood: Sorry I had to go AFK. I'm looking at your two links, thanks. (My question was vague, yes. Easy to the users is more the goal than specifically single-file.)
<hanmac>
mor789: "Module#public_method_defined?" is the only one ... so i think you miss the "?"
Asher has joined #ruby
trosborn has quit [Quit: trosborn]
baweaver has joined #ruby
nettoweb has joined #ruby
kobain has quit [Ping timeout: 260 seconds]
<mor789>
hanmac: thank you
kirillzh has joined #ruby
<sanguisdex>
workmad3: thanks, I had looked at the archive cookbook but it seemed a lot of cruft to just unzip a file, because it does not handle a tar.
dlitvak has joined #ruby
<workmad3>
sanguisdex: the other option would be to wrap that up into your own resource
<workmad3>
resources are pretty easy to write in chef
<workmad3>
sanguisdex: heh :) to me, you're stringing together a bunch of other resources... that always felt more appropriate as a new resource when I was using chef
Deck` has quit [Ping timeout: 250 seconds]
<workmad3>
sanguisdex: I rarely felt simple helper methods were much use in chef after a while using it
<workmad3>
they tend to look odd and out of place when writing a recipe, while a custom resource fits into the rest of the recipe well :)
kirillzh has quit [Ping timeout: 250 seconds]
<sanguisdex>
fair enough
<alexishuard>
Yeah I'd go for custom_ressource over helper method any day with Chef
baweaver has quit [Remote host closed the connection]
<alexishuard>
I've just wrote an entire one to include Vault Secret Management in production via Chef
<alexishuard>
Feels good to spread those ressource in all my recipes.
<mad_hatter>
hey guys...new to ruby looking for some documentation on how to get started with the language. I have experience with other languages (Perl & Java) so something that kinda skips the basics of computer programming and jubs into the nuts and bolts of Ruby specifically
cjbottaro has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mad_hatter>
Is there a ruby equivalent of perlbrew? something that will allow me to run multiple versions of ruby from my homedir? or am i stuck with system ruby?
<adaedra>
chruby, rbenv, rvm
<adaedra>
I would recommend chruby + ruby-install
nisstyre_ has quit [Ping timeout: 276 seconds]
<eam>
mad_hatter: you might find http://rubykoans.com/ useful, set of tasks you can breeze through to pick up syntax and idioms
sauvin has quit [Remote host closed the connection]
xapak has quit []
blackmesa has quit [Ping timeout: 244 seconds]
<mad_hatter>
thanks :)
joonty has quit [Ping timeout: 255 seconds]
dlitvak has quit [Ping timeout: 244 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
skade has quit [Quit: Computer has gone to sleep.]
Guest85 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
adgtl has quit [Read error: No route to host]
rodfersou|coffee is now known as rodfersou
Asher has joined #ruby
idefine has joined #ruby
elaptics is now known as elaptics`away
Snowy has joined #ruby
shellie__ has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
Renich has joined #ruby
Guest85 has joined #ruby
Guest85 has quit [Client Quit]
Scriptonaut has left #ruby [#ruby]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
segmond has quit [Ping timeout: 244 seconds]
HiddenSnake has quit [Quit: HiddenSnake]
skade has joined #ruby
skade has quit [Client Quit]
workmad3 has quit [Read error: Connection reset by peer]
krobzaur has quit [Ping timeout: 252 seconds]
mor789 has quit [Ping timeout: 252 seconds]
BtcBen has joined #ruby
sgambino has joined #ruby
hxegon is now known as hxegon_AFK
sanguisdex has quit [Ping timeout: 240 seconds]
mhoungbo has joined #ruby
uglybandersnatch has quit [Ping timeout: 250 seconds]
code_ has quit [Quit: BNC - Hosted by EpicKitty]
krobzaur has joined #ruby
despai has joined #ruby
code_ has joined #ruby
LoneHerm_ has joined #ruby
kies^ has quit [Ping timeout: 244 seconds]
intrigueD has quit [Remote host closed the connection]
dgncn has quit [Quit: Leaving]
dgncn has joined #ruby
rattatmatt has joined #ruby
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
failshell has quit [Read error: Connection reset by peer]
failshell has joined #ruby
code_ has quit [Client Quit]
kirun has joined #ruby
LoneHerm_ has quit [Ping timeout: 244 seconds]
mattwildig has joined #ruby
segmond has joined #ruby
blackmesa has joined #ruby
lubekpl has joined #ruby
godzillaenlacasa has quit [Quit: ZZZZZ....]
stevemackinnon has joined #ruby
dubek has joined #ruby
Azulinho has joined #ruby
nisstyre_ has joined #ruby
chipotle has joined #ruby
symm- has joined #ruby
mfb2 has quit [Remote host closed the connection]
LoneHermit has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
Deck` has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
n1colas has quit [Quit: WeeChat 1.4]
stevemackinnon has quit [Ping timeout: 252 seconds]
godzillaenlacasa has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
kies^ has joined #ruby
n00bdev has quit []
jgpawletko has joined #ruby
hxegon_AFK is now known as hxegon
JJM has joined #ruby
Jammy_Work has joined #ruby
failshell has quit []
lipoqil has quit [Quit: Connection closed for inactivity]
ht_ has joined #ruby
GenghisKen has joined #ruby
_ht has quit [Ping timeout: 240 seconds]
Hammy_Work has quit [Ping timeout: 244 seconds]
lapide_viridi has joined #ruby
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
LoneHermit has quit [Remote host closed the connection]
flughafen_ has quit [Ping timeout: 250 seconds]
dling has quit []
trosborn has joined #ruby
platzhirsch has left #ruby [#ruby]
Guest85_ has joined #ruby
dgncn has quit [Quit: Leaving]
ta_ has joined #ruby
dgncn has joined #ruby
terminalrecluse has quit [Read error: Connection reset by peer]
dlitvak has joined #ruby
terminalrecluse has joined #ruby
St1gma has joined #ruby
gizmore has joined #ruby
LoneHerm_ has joined #ruby
baweaver has joined #ruby
code_ has joined #ruby
mfb2 has joined #ruby
Xeago has joined #ruby
william3 has joined #ruby
idefine has quit [Remote host closed the connection]
fostertheweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sandstrom has joined #ruby
InternetFriend has joined #ruby
rattatmatt has quit [Remote host closed the connection]
wilbert has joined #ruby
Xeago has quit [Remote host closed the connection]
lapide_viridi has quit [Quit: Leaving]
cpup has joined #ruby
azure32 has quit [Ping timeout: 244 seconds]
quazimodo has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
baweaver has quit [Ping timeout: 276 seconds]
william3 has quit [Ping timeout: 244 seconds]
yqt has joined #ruby
Asher has quit [Quit: Leaving.]
Xeago has joined #ruby
treehug88 has quit [Ping timeout: 244 seconds]
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
rattatmatt has joined #ruby
Xeago has quit [Remote host closed the connection]
Asher has joined #ruby
DoubleMalt has joined #ruby
<InternetFriend>
exit
fostertheweb has joined #ruby
InternetFriend has quit [Quit: leaving]
Asher has quit [Remote host closed the connection]
ta_ has quit [Remote host closed the connection]
Snowy has quit [Remote host closed the connection]
aegis3121 has joined #ruby
[Butch] has quit [Read error: Connection reset by peer]
Asher has joined #ruby
robbyoconnor has quit [Ping timeout: 276 seconds]
jimcroft has joined #ruby
mdw has joined #ruby
blackmesa has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
poguez_ has joined #ruby
william3 has joined #ruby
baweaver has joined #ruby
fostertheweb has quit [Client Quit]
dlitvak has quit [Ping timeout: 240 seconds]
FernandoBasso has joined #ruby
skade has joined #ruby
Deck` has quit [Ping timeout: 244 seconds]
fostertheweb has joined #ruby
Snowy has joined #ruby
idefine has joined #ruby
x77686d has quit [Quit: x77686d]
codecop has quit [Remote host closed the connection]
replay has quit [Ping timeout: 250 seconds]
dlitvak has joined #ruby
openstruct has quit []
aswen has joined #ruby
idefine has quit [Remote host closed the connection]
Asher has quit [Quit: Leaving.]
synthroid has quit [Remote host closed the connection]
idefine has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
pwnd_nsfw` has joined #ruby
dgncn has quit [Quit: Leaving]
nachoman has quit []
dgncn has joined #ruby
synthroid has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
pwnd_nsfw has quit [Ping timeout: 268 seconds]
Affix has quit [Ping timeout: 255 seconds]
rattatmatt has quit [Remote host closed the connection]
kobain has joined #ruby
DefV has quit [Ping timeout: 255 seconds]
DefV has joined #ruby
kirillzh has quit [Remote host closed the connection]
fostertheweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
rescue
moeabdol1 has joined #ruby
wilbert_ has joined #ruby
spuk has joined #ruby
Affix has joined #ruby
<pipework>
ensure
Affix is now known as Guest46298
dlitvak_ has joined #ruby
<ljarvis>
exit!
idefine has quit [Remote host closed the connection]
<baweaver>
rescue
davedev24 has joined #ruby
wilbert has quit [Ping timeout: 240 seconds]
moeabdol has quit [Ping timeout: 244 seconds]
<ljarvis>
too late we exited sorrynotsorry
MrDoctor has quit [Ping timeout: 250 seconds]
dlitvak has quit [Ping timeout: 244 seconds]
Hammy_Work has joined #ruby
idefine has joined #ruby
<xpt>
we are back in shell?
MrDoctor has joined #ruby
<shevy>
yeah xpt, we can not rescue the exit! :(
<xpt>
while /bin/true; do irb ; done
x77686d has joined #ruby
Mon_Ouie has quit [Ping timeout: 252 seconds]
<xpt>
now you need to sigkill parent process to quit!
<eam>
Process.kill :STOP, $$
<eam>
there, now your outer loop is bunk too
<ljarvis>
rekt
ta_ has joined #ruby
Jammy_Work has quit [Ping timeout: 252 seconds]
<xpt>
eam: :'(
<shevy>
perl code!
Deck` has joined #ruby
<adaedra>
%x(kill -9 -1)
[Butch] has joined #ruby
<ljarvis>
shutdown -t now
<pipework>
Signal.trap("EXIT") { puts :nope }
<ruurd>
shevy are you sure it's not uuencoded /dev/urandom
sandstrom has joined #ruby
dgncn has quit [Quit: Leaving]
<pipework>
ruurd: Most of what shevy says is uuencoded /dev/urandom.
<adaedra>
:D
quakephil has joined #ruby
<ruurd>
so why then is it shevy not named whitenoise
<adaedra>
Given infinite numbers of threads reading /dev/urandom and infinite time, a computer can rewrite 1984.
<ljarvis>
because that's discrimination
dlitvak_ has quit [Remote host closed the connection]
<ruurd>
because
<adaedra>
nativeeuropeannoise
<eam>
the prng backing /dev/urandom is single-threaded, isn't it?
pawnbox has quit [Remote host closed the connection]
<ruurd>
don't know. use the source luke
<adaedra>
Implementation-dependent.
<adaedra>
dependant?
<eam>
gonna hit some scaling issues
<eam>
just use RDRAND
<adaedra>
Doesn't matter, had entropy.
<pipework>
eam: non-blocking, so who cares?
<ljarvis>
rewrite it in node
perfectritone has joined #ruby
<eam>
pipework: well you'll just get empty reads
<pipework>
Get it real close to the metal that way.
<pipework>
eam: No, you'll just not bother until you get more.
<ljarvis>
so close it becomes the metal
<pipework>
Exactly how shevy works now.
<pipework>
As intended.
workmad3 has joined #ruby
Canar has quit [Ping timeout: 248 seconds]
fostertheweb has joined #ruby
idefine has quit [Remote host closed the connection]
rodfersou has quit [Quit: leaving]
<perfectritone>
I'm trying to run a method on an instance defined in an included Module. It's second in line in inheritence, so super isn't cutting it. Any ideas/.
<apeiros>
what's "an instance defined in an included Module"?
idefine has joined #ruby
<shevy>
pipework lol
<perfectritone>
An instance of a Class. The Module is included in the Class
<perfectritone>
and the method I want to get to (which is superseded already) is defined in the Module that has been included
<shevy>
perfectritone and do you happen to have code for that problem description?
<apeiros>
I think you should make an example
<apeiros>
because super should work for that
<ljarvis>
I think you should make a cake
<ljarvis>
?cake
<ruby[bot]>
here's your cake:
blackmesa has quit [Ping timeout: 240 seconds]
<ljarvis>
ok back to work
<adaedra>
ljarvis: tis a lie.
<apeiros>
>> module Fuu; def x; "Fuu#x"; end; end; class Foo; include Fuu; def x; super; end; end; Foo.new.x
<eam>
Ox0dea: I mean, Class would still be nil. I'm guessing eval.in doesn't do enough after to provoke a failure
dubek has quit [Ping timeout: 240 seconds]
statelesscode has quit [Quit: statelesscode]
sp4rrow has joined #ruby
<Ox0dea>
>> $VERBOSE = Class = nil; String.class # eam
<ruby[bot]>
Ox0dea: # => /tmp/execpad-cd9608389305/source-cd9608389305:2: warning: already initialized constant Class ...check link for more (https://eval.in/525699)
johnmilton has quit [Remote host closed the connection]
ht_ has quit [Read error: Connection reset by peer]
<havenwood>
eam: ah, nice
hahuang65 has joined #ruby
ht_ has joined #ruby
nolsen has joined #ruby
<apeiros>
"MacOS/X no" :<
idefine has joined #ruby
twitch_ has joined #ruby
Guest85_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has quit [Remote host closed the connection]
idefine has joined #ruby
<arthurl>
hi guys- i have two different web servers, one apache/passenger/rails which is connected to database on local network and one nginx/passenger/rails which is connected to the same database but over a vpn with ~40ms latency- however i am seeing much slower app performance on the nginx box- taking a look at our apps production.log I'm seeing ActiveRecord: load time is much great on the nginx box- does this simply mean rails is taking longer to talk to the
<arthurl>
database?
LoneHermit has quit [Remote host closed the connection]
<eam>
apeiros: osx is missing a lot of super basic stuff, like gettimeofday()
jenrzzz has joined #ruby
<havenwood>
require 'shell'; Shell.cd('..').pwd
<eam>
sorry I mean clock_gettime() -- for ns
sanguisdex has joined #ruby
weemsledeux has quit [Max SendQ exceeded]
twitch_ has quit [Client Quit]
perfectritone has quit [Ping timeout: 252 seconds]
<apeiros>
eam: yeah, I've noticed over the last couple of years :-S
jimcroft has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<eam>
at least it's x86 now so I can run a fast linux vm on it
baweaver has quit [Remote host closed the connection]
centrx has joined #ruby
jimcroft has joined #ruby
afaris has joined #ruby
ht_ has quit [Ping timeout: 240 seconds]
Matthews_ has quit [Remote host closed the connection]
ht_ has joined #ruby
maletor_ has joined #ruby
Cohedrin has joined #ruby
pawnbox has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Snowy has quit [Read error: Connection reset by peer]
n1colas has joined #ruby
malnek has joined #ruby
Snowy has joined #ruby
<afaris>
Is it possible to lock a rvm gemset and prevent any additions? I can't seem to break the habit of running 'gem install' while using the global gemset.
idefine has quit [Remote host closed the connection]
idefine has joined #ruby
stevemackinnon has joined #ruby
<havenwood>
afaris: I suppose you could change the permissions of your global gemset dir. :O
<havenwood>
afaris: To remove writing.
maletor has quit [Ping timeout: 252 seconds]
<afaris>
heh, i hadn't thought of that
spintronic has quit [Read error: Connection reset by peer]
goodcodeguy has joined #ruby
spintronic has joined #ruby
chipotle has quit [Quit: cheerio]
rodolfowtf has quit [Read error: Connection reset by peer]
<kirillzh>
havenwood I mean, I have hash let's say with keys "a", "b" and "c" (I know these keys), values of these keys are Sets. I want to convert these specific to arrays. So I was wondering if there is "better" way to do that: https://gist.github.com/anonymous/3071d6c6f3bfeab7ae9d
spintronic has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 240 seconds]
Gnut has joined #ruby
graydot has joined #ruby
WizJin has quit [Excess Flood]
spintronic has joined #ruby
recycle has quit [Ping timeout: 240 seconds]
vdamewood has joined #ruby
Dimik has joined #ruby
rahult is now known as rahult_
rahult_ is now known as rahult
ElFerna_ has joined #ruby
rahult is now known as rahult_
rahult_ is now known as rahult
<shevy>
long live ruby!
graydot has quit [Quit: graydot]
InternetFriend has joined #ruby
<kaleido>
shevy: you know you prefer perl and php
htmldrum has joined #ruby
platzhirsch has quit [Ping timeout: 244 seconds]
Dimik has quit [Ping timeout: 276 seconds]
Xeago has quit [Remote host closed the connection]
mattwildig has quit [Remote host closed the connection]
mdw has quit [Quit: Sleeping Zzzzz]
spintronic has quit [Ping timeout: 244 seconds]
phatso727 has joined #ruby
maletor_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
maletor has joined #ruby
GenghisKen has quit [Ping timeout: 244 seconds]
fostertheweb has joined #ruby
x77686d has quit [Quit: x77686d]
[BNC]WizJin has joined #ruby
LoneHerm_ has joined #ruby
theunraveler has joined #ruby
nachoman has joined #ruby
aibot has quit [Ping timeout: 276 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramortegui has quit [Quit: Ex-Chat]
shiver has quit [Ping timeout: 252 seconds]
quazimodo has quit [Read error: No route to host]
Dimik has joined #ruby
sgambino has joined #ruby
alexishuard has joined #ruby
safe has joined #ruby
diego2 has joined #ruby
alexishuard has quit [Client Quit]
<VeryBewitching>
kaleido: If Perl were declared the last language to exist and to be used, I would find a way to accept it. If PHP were delcared to be the same, I would take up carpentry full time.
<[BNC]WizJin>
hmm
[BNC]WizJin has left #ruby ["Leaving"]
malcolmva has quit [Ping timeout: 276 seconds]
hahuang65 has quit [Ping timeout: 276 seconds]
diego2 has quit [Changing host]
diego2 has joined #ruby
ElFerna_ has quit [Ping timeout: 250 seconds]
malnek has quit [Quit: Lost terminal]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diegoviola has quit [Ping timeout: 255 seconds]
nickjj has quit [Read error: Connection reset by peer]
ESpiney has quit [Read error: Connection reset by peer]
nickjj has joined #ruby
Dreamer3_ has joined #ruby
jgpawletko has quit [Quit: jgpawletko]
sp4rrow has joined #ruby
uglybandersnatc- has quit [Ping timeout: 252 seconds]
mad_hatter has quit [Ping timeout: 244 seconds]
mary5030 has quit [Remote host closed the connection]
godzillaenlacasa has quit [Quit: ZZZZZ....]
moeabdol2 has quit [Ping timeout: 240 seconds]
fostertheweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
polishdub has quit [Quit: Leaving]
x77686d has joined #ruby
diego2 is now known as diegoviola
kobain has quit [Ping timeout: 260 seconds]
ElFerna_ has joined #ruby
<Radar>
VeryBewitching: rofl
graydot has joined #ruby
tommy_p has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
malcolmva has joined #ruby
fostertheweb has joined #ruby
chipotle has quit [Quit: cheerio]
al2o3-cr has quit [Ping timeout: 244 seconds]
zenlot has quit [Ping timeout: 252 seconds]
chipotle has joined #ruby
Matthews_ has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wastrel has joined #ruby
zenlot has joined #ruby
Guest77500 is now known as montyboy
Deck` has quit [Ping timeout: 250 seconds]
dome22xl has joined #ruby
rakm has joined #ruby
al2o3-cr has joined #ruby
Matthews_ has quit [Remote host closed the connection]
jhn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MatthewsFace has quit [Ping timeout: 240 seconds]
mdw has joined #ruby
MatthewsFace has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
<shevy>
kaleido dunno, I had a nice perl book which was good, had a great part about regexes. perl was somewhat awkward, I actually was more productive in php strangely enough :\ ruby was best though, the other two are not in the same league
postmodern has joined #ruby
<bronson>
both are really screwed up when it comes to objects and references... could be just personal taste which one appeals more.
Dusk_ has quit [Quit: Page closed]
<bronson>
I've programmed enough perl to appreciate its internal consistency. but it's a pretty heavy mental burden until you have earned enough scars.
wastrel has left #ruby ["nvm"]
Snowy has quit [Quit: ragequit]
<eam>
I thought perl was super straightforward
jenrzzz_ has joined #ruby
BTRE has quit [Ping timeout: 240 seconds]
ledestin has joined #ruby
kobain has joined #ruby
brijesh has joined #ruby
kobain has quit [Max SendQ exceeded]
kobain has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
<VeryBewitching>
Going from programming Ruby to PHP in the last month or so, my hands hurt more. It's normal that they hurt for my medical situation, but I feel caged by syntactical nonsense throughout most of my work day.
solocshaw has joined #ruby
<VeryBewitching>
Perl would be roughly the same effect I think.
skade has quit [Quit: Computer has gone to sleep.]
edwinvdgraaf has quit [Remote host closed the connection]
<shevy>
bronson problem is that I can not answer it because I don't like class variables
<bronson>
I suspect it could be just aesthetics because it works OK either way.
brijesh has quit [Ping timeout: 244 seconds]
mostlybadfly has joined #ruby
<bronson>
shevy: me neither.
<bronson>
especially when ActiveSupport::Concerning.
<bronson>
unfortunately I inherited this one.
<shevy>
however had, if it would be a @foo variable, on the toplevel instance, like a class level instance variable, then always initialize it near the top somewhere
shiver_ has joined #ruby
<eam>
one thing perl does that I wish ruby would do is merge def and proc/lambda
quazimodo has joined #ruby
<eam>
why can't def with no name return a lambda?
uglybandersnatch has quit [Ping timeout: 250 seconds]
phatso727 has quit [Ping timeout: 250 seconds]
<shevy>
it could return a proc!
<bronson>
agree 100%. stabby procs are neat but just paper over the oddity.
<shevy>
are defs without names possible?
<eam>
no
aibot has joined #ruby
<eam>
the syntax is ambiguous, I think
<eam>
(or, would be)
<VeryBewitching>
Can you declare a null symbol?
<VeryBewitching>
:
nando293921 has quit [Ping timeout: 248 seconds]
dome22xl has quit [Ping timeout: 248 seconds]
<eam>
>> define_method "", ->{"yes"}; send "" # if you mean empty string
<eam>
and in fact, null pointers aren't always zero
<VeryBewitching>
So... the reason why I casually mentioned null (and it turned into a bit of a chat) is that you shouldn't define a method in the same way you define code to be executed within a very specific scope.
<apeiros>
though, "null character" is listed under "description" - does that count as "name"?
theunraveler has quit []
<Ox0dea>
UnicodeData.txt calls it NULL, so I guess NUL is an abbreviation.
<VeryBewitching>
apeiros: A description is subjective, a name is unique.
justinweiss has quit [Quit: Connection closed for inactivity]
blackgoat has joined #ruby
<shevy>
unique names hmm :)
<eam>
VeryBewitching: you'll love php's create_function() then
<Ox0dea>
Internally, MRI does have Qundef for representing "nonexistence", but it's not directly exposed.