vyorkin has quit [Remote host closed the connection]
jaequery has joined #ruby
lmickh has quit [Remote host closed the connection]
tylersmith has quit [Remote host closed the connection]
agjacome has quit [Quit: Lost terminal]
Nilium has quit [Ping timeout: 246 seconds]
cndiv has quit [Ping timeout: 260 seconds]
agjacome has joined #ruby
benzrf|offline is now known as benzrf
<waxjar>
Fire-Dragon-DoL: you could make a class SuperArray that inherits from Array and redefines the methods that add something to it
_2easy has quit [Ping timeout: 255 seconds]
<waxjar>
there's one huge disadvantage though (that also goes for delegating), namely that the methods that return an Array still return a regular Array
harq has quit [Quit: Be back later ...]
<zenspider>
Fire-Dragon-DoL: if you want to delegate everything but some set of things, you should be defining those things. (same with subclassing)
<zenspider>
there's no good shortcut here. If you need to lock up 10 methods, you need to lock up 10 methods
<zenspider>
waxjar: you can wrap those with a conversion
<Fire-Dragon-DoL>
zenspider , waxjar thanks both, seems resonable, was just asking is someone faced same thing
Dude007__ has quit [Remote host closed the connection]
<Fire-Dragon-DoL>
I think I'll do the opposite, delegate only the methods I'm using, I can always delegate another one when I start using it
<waxjar>
zenspider: is that supported by delegator? or do you mean write your own proxy class?
<waxjar>
that seems most reasonable Fire-Dragon-DoL
Dude007 has joined #ruby
<zenspider>
waxjar: I was assuming the subclass case and just doing def x; convert super; end
Dude007 has quit [Remote host closed the connection]
<Fire-Dragon-DoL>
waxjar: going to use active_support delegate method
Dude007 has joined #ruby
<zenspider>
Fire-Dragon-DoL: then you have two problems
<zenspider>
use stdlib delegate, list the methods you want to delegate
<waxjar>
zenspider: i meant stuff like #map and all, you'd have to redefine *all* of them
<Fire-Dragon-DoL>
zenspider: that's my problem unfortunately
<zenspider>
what is?
<zenspider>
adding active_support to the mix is MORE than your current problem
Nilium has joined #ruby
<zenspider>
waxjar: thems the breaks
j_mcnally has joined #ruby
<zenspider>
tho you could write a simple enough proxy method to do the conversion automatically if you got a plain array back.
<zenspider>
err.. delegate
Channel6 has quit [Quit: Leaving]
<waxjar>
yeah. I thought you meant delegator supported that. I was impressed :P
jottr_ has quit [Ping timeout: 260 seconds]
<Fire-Dragon-DoL>
ok well I'll stick with damn delegate every method I use
<Fire-Dragon-DoL>
currently is faster because I use only #each #size #inject
<Fire-Dragon-DoL>
eventually I'll delegate other methods
<Fire-Dragon-DoL>
too long to reimplement the others
Atttwww has joined #ruby
fourmyle has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thagomizer has quit [Quit: Leaving.]
i_s has quit [Remote host closed the connection]
robustus has quit [Ping timeout: 250 seconds]
zerick has quit [Ping timeout: 240 seconds]
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robustus|Off has joined #ruby
robustus|Off is now known as robustus
<zenspider>
too long?
<zenspider>
Array isn't that big / complex. really.
boddah has quit [Quit: Leaving]
nonks has quit [Ping timeout: 244 seconds]
mary5030 has quit [Remote host closed the connection]
freerobby has joined #ruby
<Fire-Dragon-DoL>
it has a lot of methods
thingstuff has joined #ruby
thisguy123 has quit [Ping timeout: 245 seconds]
fabrice31 has joined #ruby
Takle has joined #ruby
MatthewsFace has quit [Quit: Leaving]
<thingstuff>
hi.I'm a beginner learning ruby and just came across something I don't quite understand and would like to read more about, however I don't know how to search for it. It's the fact that methods that return an instance variable seem to pass a reference when I expect it to only return a value.
<jhass>
thingstuff: ruby is entirely pass by reference
marr has quit []
<thingstuff>
I'm not sure if it's different but I'm talking about what methods return
fuhgeddaboudit has joined #ruby
<jhass>
it's not different
<jhass>
they receive references, they return references
<benzrf>
thingstuff: i assume u know c?
<thingstuff>
not really, I'm a beginner in general
<benzrf>
thingstuff: well, in ruby, all variables are pointers
<benzrf>
period
<benzrf>
thingstuff: ok, well
<zenspider>
thingstuff: everything in ruby is a reference with minor (implementation specific) exceptions
manzo has quit [Ping timeout: 245 seconds]
<benzrf>
when you pass or assign a value
<benzrf>
you pass a pointer to that object
<benzrf>
not a cop
fabrice31 has quit [Ping timeout: 250 seconds]
<benzrf>
*copy
<zenspider>
benzrf: not really true. The "period" is wrong
<benzrf>
there is no such thing as a "value" in ruby, just objects
<benzrf>
zenspider: oh pooh
lolmaus has quit [Ping timeout: 240 seconds]
<zenspider>
but, as I said, they're implementation specific exceptions
<thingstuff>
in that case, though, I'm still a little confused because if it's really a reference, it should be the same class of object, but I'm finding that I can do certain methods but not others
<zenspider>
fixnums for example are encoded in the value pointer directly
SilkFox has joined #ruby
<zenspider>
thingstuff: explain that last part?
<zenspider>
it most def is a reference. It most def is the same class of object.
<thingstuff>
I can do << on arrays and strings, and sort! on arrays, but not +=
<thingstuff>
I'll do a pastebin
charliesome has quit [Quit: zzz]
<jhass>
thingstuff: a += b is a syntax rewrite to a = a+b
gattuso has joined #ruby
<jhass>
it doesn't change the object, it assigns a new object to the variable
<jhass>
okay, we need to differentiate two cases here
<jhass>
a = b and a.b = c
<ziggles>
hey guys... i'm working on building a ruby gem that wraps an API with multiple versions. I was wondering if the common convention is to have the gem support only the most recent gem?
<ziggles>
(the author has locked users to version 0 of the api)
nirvdrum has joined #ruby
<jhass>
thingstuff: the former is syntax, it's not a method call, the later however is a method call, it's syntax sugar for calling a.b=(c), the = is part of the method name
brendenb has quit [Max SendQ exceeded]
brendenb has joined #ruby
<thingstuff>
yes, I understand that. But just as I didn't define a blah<< method I didn't define a blah= method
kaspergrubbe has quit [Remote host closed the connection]
<thingstuff>
that's the part that's confusing me
<jhass>
a.b << c is a.b.<<(c)
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
it's calling #<< on the return value
<jhass>
where as a.b = c is a.b=(c)
luckyruby has joined #ruby
<jhass>
it's called on a
<jhass>
and #b= not #=
zaid_h has quit [Quit: ZZZzzz…]
<benzrf>
am i a hashtag
valeriansaliou has quit [Ping timeout: 255 seconds]
<jhass>
would you like to be one?
<thingstuff>
I think I understand
<thingstuff>
if I have a string s and do s = "asdf", what's the "other" notation for that? it's not s.=("asdf") clearly
<jhass>
thingstuff: these are mostly things you need to memorize for now, it'll feel natural after a while and starts to make sense
nirvdrum has quit [Ping timeout: 255 seconds]
<jhass>
there's no other notation
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bricker`work has quit [Ping timeout: 272 seconds]
<thingstuff>
which is where I guess I was confused and thought of = and << in the same way
<jhass>
in a = b there's no method call, it's handled directly by the interpreter
fuhgeddaboudit has quit [Ping timeout: 260 seconds]
<Fire-Dragon-DoL>
ziggles: I think it's your choice. Either support new api versions with new gem versions (dropping old api versions), ensure you change major version number if that's the case, otherwise support multiple versions by doing something like module Yougem module V1 for example, however consider that this may become a burden
skolman_ has quit [Remote host closed the connection]
davasaurous has quit [Remote host closed the connection]
nichtdiebohne has quit [Ping timeout: 245 seconds]
<ziggles>
Fire-Dragon-DoL: thanks you for responding
<ziggles>
*thank you
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jimbach has quit [Ping timeout: 244 seconds]
skolman has quit [Ping timeout: 255 seconds]
emmesswhy has quit [Quit: This computer has gone to sleep]
<ziggles>
Fire-Dragon-DoL: yeah... seeing a lot of the bigger gems i know about (twitter gem for example) all just hard coding an api version. i think i will take that route
<ziggles>
thanks again
nonks has quit [Ping timeout: 265 seconds]
<Fire-Dragon-DoL>
ziggles: I had another idea right now, you can have in the gem module V1, module V2 and then the constant VCurrent = V2 (for example), in this way you can keep the older versions eventually
thisguy123 has joined #ruby
<Fire-Dragon-DoL>
so people can use VCurrent.something, still I definitely think you should have just latest version
rshetty has quit [Remote host closed the connection]
<Fire-Dragon-DoL>
people can always installl previous gem version, or even fork if they really need two api versions living at same time
<ziggles>
Fire-Dragon-DoL: That is a good idea but i definitely don't like the idea of having to support older and older code in the future, you know?
<ziggles>
yeah good point! just use the older gem
<thingstuff>
jhass you're right about the memorizing part. I just thought about the same thing from the passing arguments perspective, and had to wrap my mind around how "def a(b); b = "ref"; end" would've made me thing ruby is pass by value and "def a(b); b << "ref"; end" would've made me think ruby was pass by reference
baordog has joined #ruby
<thingstuff>
but I believe I get it now
<thingstuff>
= doesn't change the object, it points the variable to a different object
<jhass>
exactly
<thingstuff>
all of this was just very counterintuitive to how I previously thought about things but I learned quite a lot.
robbyoconnor has joined #ruby
Mattias has joined #ruby
moted has quit [Ping timeout: 272 seconds]
Avahey has joined #ruby
lolmaus has joined #ruby
Hobogrammer has joined #ruby
axl_ has joined #ruby
nonks has joined #ruby
narph has quit [Quit: Connection closed for inactivity]
it0a has joined #ruby
Kricir has quit [Remote host closed the connection]
<benzrf>
thingstuff: none of this is a relevant distinction when you use HASKELL!!
rkalfane has joined #ruby
Kricir has joined #ruby
<thingstuff>
I'll keep that in mind
Channel6 has joined #ruby
sevenseacat has joined #ruby
ioc has quit [Quit: leaving]
<thingstuff>
human interest question since it's not too busy here: does anyone here work with ruby for a living for non-rails related things? If so I'd be curious to know what
davasaurous has joined #ruby
luckyruby has quit [Remote host closed the connection]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
emmesswhy has joined #ruby
Kricir has quit [Ping timeout: 245 seconds]
luckyruby has joined #ruby
siwica has quit [Ping timeout: 245 seconds]
axl_ has quit [Quit: axl_]
tkuchiki has joined #ruby
rpag has joined #ruby
rshetty has joined #ruby
luckyruby has quit [Ping timeout: 255 seconds]
jfran has quit [Quit: Going offline, see ya! (www.adiirc.com)]
rshetty has quit [Remote host closed the connection]
jtdowney has joined #ruby
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
echooo has joined #ruby
jtdowney has quit [Client Quit]
jnollett_ has quit [Quit: Leaving...]
bklane has quit [Remote host closed the connection]
melik has quit [Quit: (null)]
nirvdrum has joined #ruby
aspires has quit []
momomomomo has quit [Quit: momomomomo]
mahyuddin has left #ruby [#ruby]
cndiv has joined #ruby
cndiv has quit [Client Quit]
yaymukund has quit [Ping timeout: 272 seconds]
tylersmith has joined #ruby
echooo has quit [Quit: echooo]
fuhgeddaboudit has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<ramfjord>
thingstuff: I use a lot of ruby and very little rails
drkyro has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<ramfjord>
mostly scripts to pass things around in the backend in a service oriented architecture
andrewhampton has joined #ruby
chipotle has joined #ruby
msmith_ has joined #ruby
<ramfjord>
I would probably never decide to use rails on my own
<thingstuff>
ramfjord cool
<thingstuff>
why's that
shock_one has joined #ruby
havenwood has quit [Remote host closed the connection]
nirvdrum has quit [Ping timeout: 258 seconds]
<ramfjord>
thingstuff: the only thing I really like about it is activesupport, and I can include that where I need it
<ramfjord>
sinatra is very simple and light weight
<sevenseacat>
rails rails rails
<ramfjord>
ActiveRecord always seemed like a heavy handed ORM, and it's hard to do complex queries without using SQL anyway
<ramfjord>
I think a lot of people misuse restful routes for non-restful architectures because rails makes it so easy to define a lot of them with resource: blah
<ramfjord>
then they only actually define the index route
<ramfjord>
in my experience at least
Xiti has joined #ruby
<sevenseacat>
dont blame rails for developers who use it poorly
Xiti has quit [Read error: Connection reset by peer]
<ramfjord>
yeah, you could do that with anything
davasaurous has quit [Remote host closed the connection]
shock_one has quit [Ping timeout: 260 seconds]
jnollette has joined #ruby
fuhgeddaboudit has quit [Ping timeout: 272 seconds]
ziggles has quit []
Atttwww has quit [Ping timeout: 258 seconds]
pandaant has quit [Remote host closed the connection]
emmesswhy has quit [Quit: This computer has gone to sleep]
diegoviola has joined #ruby
Takle has quit [Ping timeout: 250 seconds]
Xiti has joined #ruby
phutchins has joined #ruby
j_mcnally has quit [Ping timeout: 240 seconds]
tylersmith has quit [Read error: Connection reset by peer]
skolman has joined #ruby
mercwithamouth has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
yaymukund has joined #ruby
jnollette has quit [Quit: Leaving...]
skolman has quit [Remote host closed the connection]
tokik has joined #ruby
fourmyle has joined #ruby
fourmyle has quit [Max SendQ exceeded]
skolman has joined #ruby
mary5030 has joined #ruby
msmith_ has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 245 seconds]
agent_white has quit [Read error: Connection reset by peer]
agent_white has joined #ruby
tokik has quit [Read error: Connection reset by peer]
sjohnsen has joined #ruby
msmith has quit [Ping timeout: 258 seconds]
shock_one has quit [Ping timeout: 272 seconds]
kinda has joined #ruby
gr33n7007h has quit [Quit: Leaving]
ylluminarious has quit [Quit: Leaving...]
valeriansaliou has quit [Quit: Bye.]
valeriansaliou has joined #ruby
klaut has joined #ruby
valeriansaliou has quit [Client Quit]
valeriansaliou has joined #ruby
tokik has joined #ruby
Pixi_ has joined #ruby
benzrf is now known as benzrf|offline
Pixi_ has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
thisguy123 has joined #ruby
anonymous9381856 has joined #ruby
anonymous9381856 is now known as verkalets
<verkalets>
Hey guys
verkalets has left #ruby [#ruby]
Xiti` has quit [Ping timeout: 258 seconds]
Spami has quit [Quit: Leaving]
verkalets has joined #ruby
NoNMaDDeN has joined #ruby
verkalets has left #ruby [#ruby]
verkalets has joined #ruby
<verkalets>
Lagging
carraroj has joined #ruby
<verkalets>
Mf
freerobby has quit [Quit: Leaving.]
thisguy123 has quit [Ping timeout: 240 seconds]
sinkensabe has joined #ruby
verkalets has left #ruby [#ruby]
thisguy123 has joined #ruby
Spami has joined #ruby
rippa has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
bal has joined #ruby
shock_one has joined #ruby
ylluminarious has joined #ruby
charliesome has quit [Quit: zzz]
nirvdrum has joined #ruby
rippa has quit [Read error: Connection reset by peer]
rippa has joined #ruby
kinda has quit [Quit: Leaving]
ylluminarious has quit [Quit: Leaving...]
nirvdrum has quit [Ping timeout: 246 seconds]
charliesome has joined #ruby
Macaveli has joined #ruby
ht__th has joined #ruby
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
Xeago has joined #ruby
johnhamelink has quit [Ping timeout: 272 seconds]
terrellt has quit [Ping timeout: 272 seconds]
terrellt has joined #ruby
yfeldblum has quit [Ping timeout: 265 seconds]
thisguy123 has quit [Ping timeout: 255 seconds]
timonv_ has joined #ruby
johnhamelink has joined #ruby
apeiros has quit [Ping timeout: 260 seconds]
mkaesz has joined #ruby
mistermocha has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
bMalum has joined #ruby
shock_one has quit [Quit: Be back later ...]
end_guy has quit [Ping timeout: 264 seconds]
i_s has joined #ruby
abuzze has joined #ruby
it0a has quit [Quit: WeeChat 1.0.1]
drakhu has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
sigurding has quit [Quit: sigurding]
sigurding has joined #ruby
mistermocha has quit [Ping timeout: 272 seconds]
agent_white has joined #ruby
bulters has joined #ruby
noop has joined #ruby
i_s has quit [Remote host closed the connection]
fabrice31 has joined #ruby
aganov has joined #ruby
andikr has joined #ruby
shock_one has joined #ruby
HelperW has joined #ruby
SilkFox has joined #ruby
skarn has quit [Ping timeout: 272 seconds]
Hien has joined #ruby
valeriansaliou has quit [Quit: Be back later ...]
tris has quit [Ping timeout: 272 seconds]
starkhalo has quit [Ping timeout: 250 seconds]
tris has joined #ruby
az7ar_away is now known as az7ar
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
az7ar is now known as az7ar_away
skarn has joined #ruby
SilkFox has quit [Ping timeout: 240 seconds]
end_guy has joined #ruby
rbrs has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
charliesome has quit [Quit: zzz]
Beoran has quit [Read error: Connection reset by peer]
acl_ has quit [Quit: ChatZilla 0.9.91-rdmsoft [XULRunner 32.0.3/20140923175406]]
charliesome has joined #ruby
charliesome has quit [Client Quit]
sigurding has quit [Quit: sigurding]
charliesome has joined #ruby
mengu has joined #ruby
charliesome has quit [Client Quit]
dumdedum_ has joined #ruby
wpp has joined #ruby
lkba has joined #ruby
lolmaus has joined #ruby
apeiros has joined #ruby
Xeago has quit [Remote host closed the connection]
Juanchito has joined #ruby
sigurding has joined #ruby
hanmac1 has joined #ruby
<hanmac1>
hmmm my whole testcase idea is breaking because i cant test nicely what happen if my app is not inited yet ... i thought it might be working with test-unit but it seems that it doesnt
valeriansaliou has joined #ruby
ta has quit [Remote host closed the connection]
nonks has joined #ruby
alex88 has joined #ruby
sk87 has joined #ruby
valeriansaliou has quit [Ping timeout: 245 seconds]
monsieurp has joined #ruby
monsieurp has joined #ruby
Photism has quit [Quit: Leaving]
xymbol has joined #ruby
nonks has quit [Ping timeout: 255 seconds]
govg has quit [Ping timeout: 245 seconds]
IceDragon has quit [Quit: Space~~~]
ta has joined #ruby
bulters has quit [Ping timeout: 255 seconds]
muzik has quit [Quit: Leaving]
xymbol has quit [Quit: Be back later ...]
goshdarnyou has quit [Quit: Connection closed for inactivity]
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby
skolman__ has quit [Remote host closed the connection]
gauke has joined #ruby
skolman_ has joined #ruby
dangerousdave has joined #ruby
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
weemsledeux has joined #ruby
renderful has joined #ruby
Dude007 has quit [Remote host closed the connection]
cajone has quit [Remote host closed the connection]
skolman_ has quit [Ping timeout: 272 seconds]
msmith has joined #ruby
bauruine_ has quit [Ping timeout: 265 seconds]
eikood has joined #ruby
relix has joined #ruby
poulet_a has joined #ruby
bulters has joined #ruby
renderful has quit [Ping timeout: 272 seconds]
eikood_ has joined #ruby
SilkFox has joined #ruby
eikood has quit [Client Quit]
FooMunki has joined #ruby
eikood_ has quit [Client Quit]
patric100e99 has joined #ruby
msmith has quit [Ping timeout: 245 seconds]
<shevy>
test test test
eikood has joined #ruby
otakbeku has joined #ruby
ta has quit [Remote host closed the connection]
eikood_ has joined #ruby
SilkFox has quit [Ping timeout: 245 seconds]
ramfjord has quit [Ping timeout: 272 seconds]
coderhs has quit [Ping timeout: 240 seconds]
<alex88>
pass pass pass
<sevenseacat>
...............F
<shevy>
what is that stray F
<agent_white>
My new feature spec d:
<agent_white>
D: *
<shevy>
hmm
<shevy>
do we have a test library that uses smileys to indicate failure or success?
patric100e99 has quit [Ping timeout: 260 seconds]
vinleod has joined #ruby
rbrs has quit [Ping timeout: 250 seconds]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<agent_white>
My terminal changes color based on the return value of the last command :D
eikood_ has quit [Client Quit]
eikood has quit [Quit: Leaving]
eikood has joined #ruby
nfk has joined #ruby
chthon has joined #ruby
ta has joined #ruby
matchaw has joined #ruby
jds has joined #ruby
<pontiki>
you can write your own formatter
grzywacz has joined #ruby
olivier_bK has joined #ruby
mikecmpbll has joined #ruby
<hanmac1>
shevy: passed test:
blueOxigen has joined #ruby
nonks has joined #ruby
<apeiros>
hanmac1: hm, would actually be fun to replace . for passed with
bluOxigen has quit [Ping timeout: 272 seconds]
<hanmac1>
hm ok yeah
ndrei has quit [Ping timeout: 240 seconds]
<hanmac1>
but i find that "fear"face for asserts funny ;P
Joufflu has quit [Quit: Leaving]
marr has joined #ruby
<pontiki>
i think i missed something in that
bluOxigen has joined #ruby
jheg has joined #ruby
<shevy>
with every bullet so far!
blueOxigen has quit [Ping timeout: 240 seconds]
Akagi201 has joined #ruby
msmith has joined #ruby
<pontiki>
ah yes, mosh eats some characters :(
rbrs has joined #ruby
<shevy>
mosh the cat?
ta has quit [Ping timeout: 258 seconds]
<agent_white>
I'm imagining a giant monster eating some heroes.
<pontiki>
mosh the mobile shell
hackeron has quit [Ping timeout: 260 seconds]
hackeron has joined #ruby
akostrikov has joined #ruby
ephemerian has joined #ruby
bMalum has quit [Ping timeout: 260 seconds]
roolo has joined #ruby
Morkel has quit [Ping timeout: 240 seconds]
<shevy>
agent_white I bet you watched too many monty python movies
<agent_white>
shevy: Just cartoons :D
<agent_white>
Adventure Time is too awesome not to watch.
_JamieD_ has quit [Ping timeout: 260 seconds]
sigurding has quit [Ping timeout: 245 seconds]
msmith has quit [Ping timeout: 265 seconds]
ta has joined #ruby
alex88 has quit [Quit: Leaving...]
qba73 has joined #ruby
ndrei has joined #ruby
kaspergrubbe has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
mityaz has quit [Read error: Connection reset by peer]
kaspergrubbe has joined #ruby
mwlang has quit [Read error: Connection reset by peer]
mityaz has joined #ruby
yfeldblum has joined #ruby
<shevy>
omg
<hanmac1>
agent_white: Mathemathical! ;P
<shevy>
don't let hanmac1 find out
<shevy>
TOO LATE :(
<hanmac1>
to late ,P
<agent_white>
hanmac1: RHOMBUS!!!
yfeldblum has quit [Remote host closed the connection]
<agent_white>
Hahaha. I have Finn and Jake tatooed on my leg.
<agent_white>
tatt**
yfeldblum has joined #ruby
Takle has joined #ruby
<hanmac1>
i really need to watch the latest episodes but i didnt had much time for that ...
<agent_white>
I live in the country, so I can't get them :(
<agent_white>
Last one I LOVED was Blade of Grass. Probably my favorite ending to an episode so far.
<agent_white>
"YOU ARE CURSED FOREVER!!MUAHAHA" -- "Oh. OK. Whatevs."
<shevy>
this seems like a problem - ARGV is an array
boombadaroomba has quit [Ping timeout: 240 seconds]
AFKGeek has joined #ruby
_JamieD_ has joined #ruby
_JamieD_ has quit [Client Quit]
<jhass>
hanmac1: sup?
aspiers has quit [Ping timeout: 260 seconds]
FooMunki has quit [Ping timeout: 260 seconds]
<hanmac1>
jhass: didnt you last say that its bad that i want to test in the specs what does happen if the app is not init-ed ?
blueOxigen has joined #ruby
<hanmac1>
i tested rspec and test-unit again ... seems to be i cant let them run in separate child processes ...
rostam has quit [Read error: Connection reset by peer]
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hanmac1>
means i throw the "pre"App testing away and only test what should work when the app is started
tobiasvl has quit [Ping timeout: 260 seconds]
<jhass>
:)
Juzzika has joined #ruby
bluOxigen has quit [Ping timeout: 240 seconds]
<jhass>
I just think what you were testing there was an implementation detail, nothing you would care about staying that way
rostam has joined #ruby
lsmola has quit [Ping timeout: 272 seconds]
<jhass>
from an interface perspective
rdark has joined #ruby
<hanmac1>
yeah ... i planned that week only to add specs/testcases and samples, not new code until weekend
shortCircuit__ has joined #ruby
tvw has joined #ruby
rossgeesman has joined #ruby
elaptics`away is now known as elaptics
einarj has joined #ruby
LoBoGoL has quit [Ping timeout: 272 seconds]
WormDrink has joined #ruby
shock_one has quit [Quit: Be back later ...]
narcan has joined #ruby
joonty has joined #ruby
sheldonh has joined #ruby
charliesome has quit [Quit: zzz]
<sheldonh>
why does Resolv::DNS#getresources(name, Resolv::DNS::Resource::IN::ANY) return an empty list, when Resolv::DNS#getresources(name, Resolv::DNS::Resource::IN::SRV) returns a list of size > 0 for that name?
bluOxigen has joined #ruby
ta has joined #ruby
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Atttwww has quit [Ping timeout: 245 seconds]
Scotteh_ has quit [Read error: Connection reset by peer]
blueOxigen has quit [Ping timeout: 245 seconds]
otakbeku has quit [Ping timeout: 245 seconds]
ta has quit [Client Quit]
charliesome has joined #ruby
lsmola has joined #ruby
ta has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
Takle has quit [Remote host closed the connection]
SilkFox has joined #ruby
ndrei has quit [Quit: Lost terminal]
LoBoGoL has joined #ruby
Takle has joined #ruby
rossgeesman has quit [Ping timeout: 245 seconds]
gauke_ has joined #ruby
akostrikov has quit [Remote host closed the connection]
<sheldonh>
jhass: "redis-1" (which the configured resolvers know about, and offer SRV records for
<jhass>
so nothing we can locally reproduce
<jhass>
it works as expected for the first domain with a SRV record that came to my mind
<sheldonh>
jhass: no. i've hunted for public SRV records to test with, but despaired
<jhass>
xmpp ;)
<jhass>
_xmpp-client._tcp.
<jhass>
should yield plenty of examples
<sheldonh>
cool, i'll try with _xmpp-server._tcp.google.com...
<sheldonh>
jhass: same problem with name = "_xmpp-server._tcp.google.com." ... Resolv::DNS::Resource::IN::SRV gives an array with size > 0, while Resolv::DNS::Resource::IN::ANY gives an empty array
<jhass>
and dig _xmpp-server._tcp.google.com ANY returns all records?
<jhass>
because that one works too as expected here
<sheldonh>
aha! it's interaction with my dns servers, then. thanks for the debugging help :)
<olivier_bK>
how to check with Mechanize when the login is ok ?
<jhass>
you're welcome
kyb3r_ has joined #ruby
ki0 has joined #ruby
<jhass>
olivier_bK: depends on the site I guess, one could try to find a specific element on the result page or look at the redirect I guess
wpp has quit [Quit: ZZZzzz…]
chipotle has quit [Ping timeout: 272 seconds]
sevenseacat has quit [Remote host closed the connection]
coderhs has joined #ruby
<sheldonh>
jhass: found this in the comments of the dns server (skydns): // fuck ANY queries
<jhass>
\o/
<jhass>
more <3 for unbound & powerdns :P
<sheldonh>
jhass: regrettably, those don't really play in the same space as skydns :)
<jhass>
mmh, sounds a bit like reinventing mdns/zeroconf?
lsmola has quit [Ping timeout: 260 seconds]
Timgauthier has joined #ruby
eikood has quit [Remote host closed the connection]
Spami has joined #ruby
Spami has quit [Client Quit]
papal has quit [Remote host closed the connection]
akostrikov has joined #ruby
akostrikov has quit [Remote host closed the connection]
<sheldonh>
jhass: well i'd say dns-sd was reinventing zeroconf ;)
Spami has joined #ruby
<sheldonh>
jhass: skydns (and consul and others) aren't primarily focused on automatic discovery. primarily, what they focus on making easier is automatic registration
<sheldonh>
jhass: i'm using it in a docker cluster, where new containers are automatically registered into DNS. but having seen this, i'm going to switch back to consul
timonv_ has quit [Remote host closed the connection]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Timgauthier has joined #ruby
timonv_ has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
mistermocha has joined #ruby
yokel has quit [Ping timeout: 265 seconds]
kwd has left #ruby [#ruby]
jack_rabbit has quit [Ping timeout: 265 seconds]
workmad3 has quit [Quit: Lost terminal]
yokel has joined #ruby
mkaesz has quit [Ping timeout: 265 seconds]
mistermocha has quit [Ping timeout: 265 seconds]
wpp has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
Takle has quit [Remote host closed the connection]
DLSteve has joined #ruby
Timgauthier is now known as timgauthier_away
Takle has joined #ruby
gaganjyot has joined #ruby
wpp has quit [Read error: Connection reset by peer]
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ndrei has joined #ruby
ylluminarious has joined #ruby
ndrei has quit [Client Quit]
ndrei has joined #ruby
ndrei has quit [Client Quit]
roolo has quit [Remote host closed the connection]
ndrei has joined #ruby
roolo has joined #ruby
<shevy>
agent_white I hate that
<shevy>
I usually think "man, does this code suck"
<shevy>
it got better once I enforced a stricter structure
<agent_white>
Hahah. I don't know any better for now, so I think I'll have some laughs later on
drawingthesun has joined #ruby
<shevy>
simple things like - if I have a larger project, then I will also have a file stored there version/version.rb just to put the version number inside
drawingthesun has quit [Read error: Connection reset by peer]
<shevy>
before that, I usually just directly put the version in the .gemspec file alone and that was it
User458764 has joined #ruby
ldnunes has joined #ruby
ylluminarious has quit [Ping timeout: 244 seconds]
<agent_white>
Damn.
<agent_white>
Luckily I have no projects close to needing release numbers :D
matcouto has joined #ruby
roolo has quit [Ping timeout: 240 seconds]
<shevy>
I do that only for larger projects
<shevy>
I found it much easier to release in small steps
<shevy>
like - add one feature, push up
mxrguspxrt has joined #ruby
drawingthesun has joined #ruby
cmxu has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zaid_h has joined #ruby
tokik has quit [Ping timeout: 272 seconds]
Akagi201 has quit []
hackeron has quit [Ping timeout: 246 seconds]
bulters has quit [Quit: leaving]
hackeron has joined #ruby
william3 has joined #ruby
tkuchiki has joined #ruby
tkuchiki_ has quit [Read error: Connection reset by peer]
Squarepy has quit [Quit: Leaving]
postmodern has quit [Quit: Leaving]
Spami has quit [Quit: This computer has gone to sleep]
nor has joined #ruby
nor is now known as moOoo
SilkFox has joined #ruby
I_Eat_Humans has left #ruby [#ruby]
<moOoo>
hi
mkaesz has joined #ruby
<agent_white>
herro
<moOoo>
allot of ruby programmers here :D
<moOoo>
daym
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
<moOoo>
awesome
SilkFox has quit [Ping timeout: 255 seconds]
DouweM has quit [Read error: Connection reset by peer]
jottr_ has joined #ruby
niklasb has joined #ruby
tkuchiki has quit [Ping timeout: 255 seconds]
xymbol has joined #ruby
nonks has quit [Ping timeout: 246 seconds]
NoNMaDDeN has quit [Remote host closed the connection]
a_ has quit [Ping timeout: 255 seconds]
reinaldob has joined #ruby
oo_ has quit [Remote host closed the connection]
carraroj has quit [Quit: Konversation terminated!]
aspiers has joined #ruby
phutchins has joined #ruby
Macaveli has joined #ruby
Guest97120 has joined #ruby
a_ has joined #ruby
yeticry has quit [Ping timeout: 265 seconds]
Macaveli has quit [Remote host closed the connection]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Macaveli has joined #ruby
relix has joined #ruby
yeticry has joined #ruby
Takle has quit [Remote host closed the connection]
lxsameer has joined #ruby
carraroj has joined #ruby
end_guy has quit [Remote host closed the connection]
Akagi201 has joined #ruby
end_guy has joined #ruby
spastorino has joined #ruby
mxrguspxrt has quit [Remote host closed the connection]
decoponio has joined #ruby
St_Marx has quit [Ping timeout: 264 seconds]
Takle has joined #ruby
mxrguspxrt has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
F__i__L has joined #ruby
timonv_ has quit [Remote host closed the connection]
zaid_h has quit [Quit: ZZZzzz…]
Takle has quit [Ping timeout: 260 seconds]
autonomousdev has joined #ruby
<shevy>
moOoo hey
<shevy>
some of them are perl hackers
<shevy>
like eam
william3 has quit [Remote host closed the connection]
NoNMaDDeN has joined #ruby
roolo has joined #ruby
pandaant has joined #ruby
<shevy>
moOoo are you writing ruby code?
St_Marx has joined #ruby
shazaum has joined #ruby
nonks has joined #ruby
davidhq has joined #ruby
dblessing has joined #ruby
timonv_ has joined #ruby
carraroj has quit [Ping timeout: 244 seconds]
St_Marx has quit [*.net *.split]
end_guy has quit [*.net *.split]
atmosx has quit [*.net *.split]
DrCode has quit [*.net *.split]
<sheldonh>
anyone know of something like dns-clb-go for ruby (client-side load balancer for dns-based service discovery)? https://github.com/benschw/dns-clb-go
Deejay_ has joined #ruby
davidhq has quit [*.net *.split]
a_ has quit [*.net *.split]
kaspergrubbe has quit [*.net *.split]
WormDrink has quit [*.net *.split]
kantakt has quit [*.net *.split]
malcolmva has quit [*.net *.split]
nuck has quit [*.net *.split]
parus has quit [*.net *.split]
Hightower_ has quit [*.net *.split]
timmow has quit [*.net *.split]
kiki_lamb has quit [*.net *.split]
vieq has quit [*.net *.split]
Radar has quit [*.net *.split]
Brando753 has quit [*.net *.split]
Bish_ has quit [*.net *.split]
Kabaka has quit [*.net *.split]
vlad_starkov has quit [*.net *.split]
QKO has quit [*.net *.split]
Guest53847 has quit [*.net *.split]
QKO has joined #ruby
parus has joined #ruby
Radar has joined #ruby
a_ has joined #ruby
kantakt has joined #ruby
malcolmva has joined #ruby
WormDrink has joined #ruby
kaspergrubbe has joined #ruby
davidhq has joined #ruby
vlad_starkov has joined #ruby
timmow has joined #ruby
vieq has joined #ruby
nuck has joined #ruby
Radar is now known as Guest57742
RealMarc has joined #ruby
tadayoshi has joined #ruby
Hightower_ has joined #ruby
mengu has quit [Remote host closed the connection]
Bish has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kabaka has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
bogeyd6 has quit [Read error: Connection reset by peer]
nonks has quit [Ping timeout: 255 seconds]
mengu has joined #ruby
rbrs has quit [Remote host closed the connection]
Brando753 has joined #ruby
doev has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
kiki_lamb has joined #ruby
rossgeesman has joined #ruby
mxrguspxrt has quit [Remote host closed the connection]
Deejay_ has quit [Quit: Computer has gone to sleep.]
DouweM has joined #ruby
Timgauthier has joined #ruby
Takle has joined #ruby
mxrguspxrt has joined #ruby
gccostabr has left #ruby ["See you later!"]
Deejay_ has joined #ruby
User458764 has quit [Ping timeout: 250 seconds]
rossgeesman has quit [Ping timeout: 245 seconds]
shock_one has joined #ruby
User458764 has joined #ruby
shredding has quit [Quit: shredding]
patrick99e99 has joined #ruby
SilkFox has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
catphish has joined #ruby
xiq has quit [Ping timeout: 255 seconds]
<catphish>
are there any alternatives to rack for http server API?
chthon has quit [Quit: Ex-Chat]
noop has quit [Ping timeout: 240 seconds]
patrick99e99 has quit [Ping timeout: 245 seconds]
yalue has joined #ruby
SilkFox has quit [Ping timeout: 260 seconds]
<catphish>
i need an API where i can stream data to the client during a request
<sheldonh>
catphish: rack supports that
tokik has joined #ruby
<sheldonh>
catphish: that's why the body is an enumerable, not a string
<sheldonh>
catphish: rach calls each on it
<catphish>
sheldonh: no, i need to do it during the request, not after its complete
<sheldonh>
catphish: so provide a body whose #each returns available bytes. what's the problem?
<catphish>
i don't understand
max96at|off is now known as max96at
<catphish>
the problem is that rack won't start to stream anything until the app has returned an array to it
AlSquirrel has joined #ruby
<sheldonh>
catphish: yes
sk87 has joined #ruby
<sheldonh>
catphish: so return [200, {...}, MyAwesomeStreamer.new]
iamjarvo has joined #ruby
<sheldonh>
catphish: and implement MyAwesomeStreamer#each to return some data
Guest48968 has joined #ruby
<catphish>
the only workaround i've found for this is to create a fiber during the request, then call the fiber from a streamer class, but that seems to create all kinds of nasty race conditions in some web servers
<catphish>
sheldonh: as i said, i need to stream data while the request is running, not after completion
<catphish>
sheldonh: specifically my problem is an HTTP proxy
<catphish>
i need to stream the output of net/http to rack
<sheldonh>
catphish: "the request is running" until each stops giving rack data
<catphish>
jhass: i meant to tag you, it's an http proxy, net/http -> rack
AlSquire has quit [Ping timeout: 244 seconds]
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
<sheldonh>
catphish: if you want a pretty DSL that helps you get past not being able to imagine a request in progress after you return the response array, see https://github.com/intridea/rack-stream
<catphish>
sheldonh: my problem is actually partially related to net/http, it can't stream output outside of the method that opened the connection
<catphish>
if so, you shouldnt have too much trouble :)
<sheldonh>
catphish: you're wrong about rack. i'm not saying you have to use rack, but it doesn't help people understand what you want by telling them it can't do what it can
<bluvaw>
not really, i don't know OOP
<lolmaus>
Is it possible to store a method in a variable and then call it? Like in JS. I don't want to change it's context, just to make it shorter to type.
<jhass>
lolmaus: not for that purpose and it's not a good approach anyway, it'll make your code harder to understand
yfeldblum has joined #ruby
<catphish>
sheldonh: ok then, lets assume you're right, please explain to me how i can provide a response code and headers to rack, then stream data within the same code block
<jhass>
lolmaus: if that's your own class you can provide aliases with alias_method though
<catphish>
sheldonh: i'm glad you understand what i'm doing :)
NoNMaDDeN has quit [Remote host closed the connection]
<catphish>
sheldonh: the problem is being able to call read_body outside of a net:http.start block
mbwe has quit [Quit: WeeChat 0.4.2]
<catphish>
ie in the streamer instance
eikood has quit [Client Quit]
callumacrae has quit [Ping timeout: 255 seconds]
umdstu has joined #ruby
eikood has joined #ruby
end_guy has joined #ruby
<sheldonh>
catphish: ah. you can't pass response out
<bluvaw>
''.methods.length prints out "162"
<catphish>
actually iirc think it needs to be in a net::http.request{} block
<bluvaw>
why
manzo has joined #ruby
<tobiasvl>
bluvaw: to continue on what catphish said, '3' + '3' is syntactic sugar for '3'.+('3')
<catphish>
sheldonh: correct, you can not
<catphish>
sheldonh: one could probably just use a different http library, but i couldnt find one that did the necessary :(
<umdstu>
i have an openstruct object with two fields, `fields` and `categories`. `categories` accesses fine, but if I try to access `fields` it says its nil. If I inspect the object, all data is present. what's goin on here? Only seems to happen for some records
<shock_one>
umdstu: check if the 'fields' method isnt' redefined. What's the output of 'show-method obj.fieds' inpry?
<shock_one>
*in pry?
Deejay_ has quit [Quit: Computer has gone to sleep.]
<jhass>
bluvaw: .methods returns an array of symbols that correspond to names of methods defined on the object you call methods on. The size of that array is 162, which means there are 162 methods available to call on a string
mxrguspxrt has quit [Remote host closed the connection]
<jhass>
bluvaw: make sure to use eval-in (>>) only for demo purposes, you should get a local ruby install for experiments ;)
<bluvaw>
okay
<bluvaw>
i have ruby
NoNMaDDeN has joined #ruby
<jhass>
okay, then just type irb to get a read eval print loop
jottr_ has quit [Ping timeout: 255 seconds]
tadayoshi has quit [Read error: Connection reset by peer]
<bluvaw>
im using irb rn
<bluvaw>
just wanted to show you how it outputs 162 or a number around there
tadayoshi has joined #ruby
<jhass>
yes, that's totally expected
<umdstu>
shock_one: I just realized its a class derived from 'RecursiveOpenStruct', not 'OpenStruct'. not sure how that changes anything yet
_5kg has quit [Ping timeout: 258 seconds]
unclouded has quit [Ping timeout: 245 seconds]
<jhass>
you can also write that code as: methods_on_string = ''.methods; number_of_methods = methods_on_string.length; does that make more sense to you?
<sheldonh>
catphish: i see your problem: ERROR NoMethodError: undefined method `read_body' for #<Net::HTTP www.google.com:443 open=false> :(
chipotle has joined #ruby
aclearman037 has joined #ruby
Aaaal has joined #ruby
<bluvaw>
jhass: yes
<bluvaw>
but how can a string have methods
<shevy>
bluvaw you query an Array for its amount of elements, hence why you receive 162
<sheldonh>
catphish: i agree with you. you need a better http client or you need an http server library that supports the response writer model
<shevy>
bluvaw you don't get a String, you "turned" it into an Array
<bluvaw>
oh
mengu has quit [Remote host closed the connection]
nonks has joined #ruby
rkalfane has joined #ruby
xymbol has quit [Quit: Be back later ...]
<tobiasvl>
bluvaw: and a string can have methods in ruby, because strings are objects
<apeiros>
also numbers, true, false, nil
<jhass>
bluvaw: in fact everything is an object in ruby and thus has methods
<apeiros>
all objects in ruby @ bluvaw
atmosx has joined #ruby
<sheldonh>
catphish: you might still look at the rack-stream example i sent you, though. it basically implements the on-finish hack described in Rack::Response
<apeiros>
true is a boolean, but booleans are objects in ruby
<catphish>
sheldonh: i'll look at the rack-stream thing
* shevy
feeds apeiros a horse
<bluvaw>
k
unclouded has joined #ruby
<apeiros>
(also ruby does not have an actual Boolean class)
_5kg has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
<sheldonh>
it has both! :)
<catphish>
shevy: oh, rack-stream seems to use EM, i really didnt understand the implications if that with various web servers
<tobiasvl>
bluvaw: the thing to understand is that, unlike in many other object oriented languaes, even literals and "primitive types" are objects in ruby
mengu has quit [Remote host closed the connection]
<catphish>
sorry, sheldonh
<tobiasvl>
bluvaw: even classes are objects…
shock_one has quit [Remote host closed the connection]
<agent_white>
Hm. Is there a way to check what methods are added between a class and instantiating it? ie -- `Array.methods.count <=> Array.new.methods.count`
shock_one has joined #ruby
<agent_white>
I want to see what all methods were added on by ".new"
<agent_white>
tobiasvl: That gives me the count, but not the actual methods added.
<tobiasvl>
agent_white: remove .count then
<tobiasvl>
Array.new.methods - Array.methods
<bluvaw>
is gets.chomp good for input
<apeiros>
agent_white: that question doesn't make sense
<jhass>
agent_white: you might be interested in Array.instance_methods(false)
<apeiros>
agent_white: instances of a class do not *add* methods over the class
<apeiros>
the two object types are entirely different
<tobiasvl>
bluvaw: yes sure
autonomousdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sheldonh>
catphish: you don't have to use rack-stream; it just nicely demonstrates the use Rack::Response finish to have write calls that are synchronous with the rack response (unbuffered)
<apeiros>
i.e., it makes as much sense as asking "how many methods does String add over Integer" (instances of two unrelated classes)
nonks has quit [Ping timeout: 272 seconds]
<agent_white>
tobiasvl: Oh wow. For some reason earlier I thought my list was off!
<agent_white>
apeiros: Hm
<catphish>
sheldonh: i see, i'll look into that i guess
<sheldonh>
catphish: in the end, it all comes down to an empty body [200, {...}, []] with a magic finish
<agent_white>
apeiros: Even when they are empty? Like Array.methods and Array.new.methods ?
<apeiros>
agent_white: "even when the string is empty and the number is zero?"
<catphish>
sheldonh: can the finish replace the code and headers?
<catphish>
sheldonh: doesn't that leave me with exactly the same problem then?
rippa has joined #ruby
<sheldonh>
catphish: it's all a bit gross, imo. better to find a better client or server. you came in looking for a better server, but it seems to me that the thing that's revolting here is net/http :)
<apeiros>
agent_white: ^ the class "Array" and an instance of Array are instances of two entirely different and unrelated classes.
autonomousdev has joined #ruby
<apeiros>
there's no inheritance chain connecting them
<apeiros>
(or anything remotely similar)
<catphish>
sheldonh: you're absolutely right, if i could find an http library that runs in a simple consecutive way, this would be easy!
narph has quit [Quit: Connection closed for inactivity]
<sheldonh>
catphish: ruby people go crazy about blocks :)
<catphish>
ie: http = HTTP.new; http.request(request); x = http.get_status; y = http.get_headers; z=http.read_body; http.close
<agent_white>
apeiros: huh... so the only common methods they would share would be from Object?
<catphish>
sheldonh: i know, i actually very un-ruby for a ruby developer :(
<catphish>
people complain that my code is procedural
rkalfane has joined #ruby
<bluvaw>
does "1 == 1" return 1?
<jhass>
agent_white: since that's their common base class, yes
<sheldonh>
catphish: blocks are wonderful, blocks are awesome, blocks should never be the only interface :)
<apeiros>
agent_white: from their common ancestry. correct. (Object, Kernel, whatever stuff you mixed into Object)
<catphish>
bluvaw: probably true
mxrguspxrt has joined #ruby
Aaaal has quit [Quit: Aaaal]
<agent_white>
Hm.
pu22l3r has quit [Remote host closed the connection]
<catphish>
sheldonh: i agree :)
benzrf|offline is now known as benzrf
<hanmac1>
bluvaw: nope its true
<catphish>
blocks are pretty, but not always useful :)
<agent_white>
Yeah I was just thinking about it, and was curious how much 'additional stuff' I got by instantiating a class.
<bluvaw>
oh
<apeiros>
catphish: lies!
pu22l3r has joined #ruby
<catphish>
apeiros: lol
workmad3 has joined #ruby
<apeiros>
agent_white: yeah, and that line of thought means you have a misunderstanding of how a class and its instances relate to each other
<agent_white>
apeiros: Indeed. I mean, I just imagined that it would add getter/setters and stuff.
ylluminarious has joined #ruby
<agent_white>
Not like... 80 methods.
<shevy>
it's a war object, ready to enter battle!
<tobiasvl>
bluvaw: since you mentioned that you came from C: in ruby we have the boolean values "true" and "false", not 1 and 0. in addition, everything in ruby evaluates to true (it has "truthyness") except false and nil.
<agent_white>
Where do they come from?
<shevy>
the ruby mother
<catphish>
sheldonh: how do i pass a block to finish?
<agent_white>
apeiros: I guess I don't understand, when I create an object from a class, where those additional methods pop up from.
<apeiros>
agent_white: the point is, they are not *additional* methods
<sheldonh>
catphish: (see "How to use" option 2)
<jhass>
agent_white: Array is a Class is a Module. A module provides a container for instance methods (what you define with def foo). See Module#instance_methods
<apeiros>
agent_white: instance of class array does NOT mean "class array + things"
<catphish>
sheldonh: that's quite sexy, thanks
humd1ng3r has quit [Remote host closed the connection]
<olivier_bK>
i find the solution lol
<apeiros>
agent_white: and the methods always come from the defined instance methods of all classes in the ancestry
<bluvaw>
why is sock_raw powerful
<sheldonh>
catphish: oh dear, wait. i'm not seeing how to stream in the body
siwica has joined #ruby
<catphish>
sheldonh: it says it gives you an IO
<apeiros>
i.e. obj.class.instance_methods + obj.class.superclass.instance_methods + … (though, .superclass does not list included modules, .ancestors does)
pu22l3r has quit [Ping timeout: 260 seconds]
jottr_ has joined #ruby
<sheldonh>
catphish: yeah, that's what got me excited. but #pop is defined as returning the body :(
<jhass>
agent_white: simplifying a bit, method lookup works by traversing the modules in .ancestors, looking at their .instance_methods if the method exists
jimbach has joined #ruby
<catphish>
sheldonh: oh i see :(
Timgauthier is now known as timgauthier_away
<apeiros>
so a bit closer: obj.class.ancestors.inject(obj.singleton_class.instance_methods) { |a,c| a | c.instance_methods }
relix has joined #ruby
<catphish>
wonder if net/http can simply be hacked to behave sanely
eikood has quit [Quit: Leaving]
<agent_white>
Ohhh huh
<jhass>
bluvaw: what's sock_raw ?
<umdstu>
I have an error on a line that has `if fields`, followed by a line that has `fields.each`. The error is i NoMethodError on fields.each, but points to the line of the if statement. what would that mean?
<bluvaw>
jhass raw socket
eikood has joined #ruby
<agent_white>
Yeah I was literally just doing "Array.methods - Object.methods" then "Array.new.methods - Object.new.methods" to see what changed.
<agent_white>
Never thought about ancestors.
<apeiros>
Array.methods gives you the *class* methods of Array
<jhass>
bluvaw: but where did you get it from? and what states it's powerful?
<sheldonh>
catphish: it might be worth trying httpclient anyway. there's HttpClient::SocketWrap#readpartial, which looks promising. i just don't have time to trace whether that's exposed higher up
<apeiros>
those are not the methods which instances of Array have
* lupine
is sad that include MyModule, args_to_included_here doesn't work
shock_one has quit [Remote host closed the connection]
<catphish>
sheldonh: this is an ongoing issue that's been bugging me for a while, i'm still somewhat of the opinion that the rack API is less than ideal for many streaming use cases
mxrguspxrt has quit [Remote host closed the connection]
a_ has quit [Ping timeout: 272 seconds]
<catphish>
i often look for a better http client too, but never found a nice simple one
mxrguspxrt has joined #ruby
tadayoshi has quit []
<sheldonh>
catphish: i guess. you can see rack anticipated streaming by taking a thing that yields #each, but... it still has to take a thing :)
siwica has quit [Remote host closed the connection]
<catphish>
sheldonh: cool
<bluvaw>
jhass: it is
<bluvaw>
well, the code in beej's guide isn't
<bluvaw>
but ruby allows you to specify socket type
eikood has quit [Quit: Leaving]
<sheldonh>
catphish: just take that with a pinch of salt, because it says the same of net/http ;)
<catphish>
rack would be perfect if the first 2 things yielded were the response code and the headers
<catphish>
sheldonh: lol
eikood has joined #ruby
<catphish>
sheldonh: shame i can't simply write a finish block that replaces @response_code
<jhass>
bluvaw: well I guess it's powerful because it gives you IP packets directly, allowing to bypass potential limitations in UDP or TCP for your application
xymbol has quit [Ping timeout: 240 seconds]
<bluvaw>
cool
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
not that it's necessarily wise or easy to do so
mercwithamouth has quit [Ping timeout: 245 seconds]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
anaeem1 has joined #ruby
<jhass>
you should be knowing what you're doing with that option
<bluvaw>
does ruby have +=
<jhass>
yes
dangerousdave has joined #ruby
<bluvaw>
cool
<jhass>
a += b is a shortcut for writing a = a+b
<shevy>
\o/
timgauthier_away is now known as Timgauthier
<tobiasvl>
but not ++
<bluvaw>
and does ruby have bitwise operations
<sheldonh>
catphish: kinda makes sense, though. by the time you error out streaming content, you've long-since provided the client with the status code :(
<sheldonh>
that's a very interesting decision, using floats for calculating exponents
Takle has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
<apeiros>
yeah, as I said, it's unexpected. it might be only for calculating the resulting size or something.
shredding_ has joined #ruby
akitada___ has quit []
<apeiros>
at least, I don't think the actual exponentiation happens as floats.
akitada has joined #ruby
klmlfl has quit [Remote host closed the connection]
otakbeku has joined #ruby
<sheldonh>
catphish: if you find wonderful secret sauce out there, i'd love to hear about it at <sheldonh@starjuice.net>... i have a feeling this will become material to me before the year is out
<workmad3>
bluvaw: typically, you'd get Infinity if you did something like 1.fdiv(0)
<ryao>
I know Java defined it to be the sensible way, but C did not.
<apeiros>
moOoo: eval-in__ is not here for your personal experiments. please stop that.
hanmac1 has quit [Read error: Connection reset by peer]
<bluvaw>
is it possible to load things from a file and put it into a hash?
roolo has joined #ruby
<jhass>
bluvaw: yes
<ryao>
No one really uses post increment in tyat way in production code though. It makes things less readable.
<bluvaw>
is it good?
<ryao>
s/tyat/that/
<jhass>
bluvaw: too general to say yes or no, but probably
<apeiros>
ryao: all bad things are used in production eventually. universal truth :-|
<ryao>
apeiros: Windows. :P
unshadow has joined #ruby
<apeiros>
ryao: see, point proven :-p
<bluvaw>
basically, what I want to do is: servers = Hash.new servers { server1 => "127.0.0.1" }
<moOoo>
apeiros: thanks for telling me
<bluvaw>
this is psuedo code
Takle has joined #ruby
cmxu has joined #ruby
<moOoo>
apeiros: i was not sure of this
<bluvaw>
s/psuedo/pseudo
<jhass>
bluvaw: sounds sane
cmxu has quit [Max SendQ exceeded]
zaid_h has joined #ruby
<bluvaw>
why op
rossgeesman has joined #ruby
obscured has joined #ruby
<apeiros>
bluvaw: not because of you
kaspergrubbe_ has joined #ruby
kaspergrubbe has quit [Read error: No route to host]
hanmac1 has joined #ruby
<unshadow>
So, I get a multi-threaded programs that writes to a local mysql DB, I get allot of: "This connection is in use by: #<Thread:0x00000000fb3b28 sleep>" what is the best approche to this problem ?
umdstu has quit [Ping timeout: 246 seconds]
<moOoo>
join the thread?
<moOoo>
dafuq man
<jhass>
unshadow: use the connection_pool gem
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has joined #ruby
n1x has joined #ruby
<catphish>
unshadow: use a thread pool
<catphish>
*connection pool
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Channel6 has joined #ruby
<bluvaw>
does the eval bot have an english parser
charliesome has joined #ruby
oleo has joined #ruby
twohlix has joined #ruby
<catphish>
english? i dont think such a parser exists :)
<bluvaw>
xD
joonty has quit [Quit: Leaving]
shazaum has quit [Ping timeout: 255 seconds]
shazaum has joined #ruby
phantummm has joined #ruby
anaeem1 has joined #ruby
<jhass>
I wonder what it would output anyway
jrhorn425 is now known as jrhorn424
xymbol has joined #ruby
shazaum has joined #ruby
shazaum has quit [Changing host]
qmfnp has joined #ruby
jerius has joined #ruby
<bluvaw>
why do some tutorials declare $ before variables in ruby
<eval-in__>
multi_io => /tmp/execpad-088c53ffb595/source-088c53ffb595:2: invalid pattern in look-behind: /(?<=^foo.*?)bar(?=baz)/ (https://eval.in/208346)
<jhass>
yep
<multi_io>
ok
terlar has quit [Ping timeout: 258 seconds]
axl_ has quit [Quit: axl_]
nonks has joined #ruby
<apeiros>
you can cheat to an extent, e.g. (?<=.{2,3}) can be rewritten as (?<=..|...)
mistermocha has joined #ruby
patrick99e99 has joined #ruby
anaeem1 has joined #ruby
<sheldonh>
jhass: oh? i can stop bothering with "require 'rubygems'"? that. is. awesome
<jhass>
yes, isn't it
SilkFox has joined #ruby
az7ar_away is now known as az7ar
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<apeiros>
sheldonh: if you use 2.0+, you can even stop bothering with `#encoding: utf-8`
terlar has joined #ruby
zaid_h has quit [Quit: ZZZzzz…]
Ankhers has joined #ruby
paulfm has quit []
charliesome has joined #ruby
aspiringflaneur has quit [Quit: If, after I depart this vale, you ever remember me and have thought to please my ghost, forgive some sinner and wink your eye at some homely girl.]
mistermocha has quit [Ping timeout: 260 seconds]
luriv has joined #ruby
<sheldonh>
sounds like i should read some release notes :)
patrick99e99 has quit [Ping timeout: 272 seconds]
SilkFox has quit [Ping timeout: 260 seconds]
nonks has quit [Ping timeout: 272 seconds]
sk87 has joined #ruby
govg has joined #ruby
mxrguspxrt has quit []
jrhorn424 is now known as zz_jrhorn424
rossgeesman has quit [Remote host closed the connection]
zz_jrhorn424 is now known as jrhorn424
ikaros has joined #ruby
St_Marx has quit [Ping timeout: 246 seconds]
Spami has joined #ruby
<workmad3>
sheldonh: leave it in if you're testing on 1.9 and 2.0 though ;)
abuzze has quit [Remote host closed the connection]
<workmad3>
sheldonh: 1.9 defaults encoding to ascii, 2.0 defaults encoding to utf8
<sheldonh>
workmad3: wow, ltns. hi, and thanks :)
mengu__ has joined #ruby
abuzze has joined #ruby
jimbach has quit [Remote host closed the connection]
joast has joined #ruby
paulfm has joined #ruby
mengu has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: zzz]
<workmad3>
sheldonh: heh :)
<Guest63337>
2
<workmad3>
sheldonh: I guess you've just missed me... I'm here most days :P
<ddv>
jep workmad
az7ar is now known as az7ar_away
Aaaal has joined #ruby
lw has joined #ruby
klmlfl has joined #ruby
tvw has quit [Ping timeout: 272 seconds]
Takle has quit [Remote host closed the connection]
reinaldob has quit [Remote host closed the connection]
Ankhers has quit [Remote host closed the connection]
jimbach has joined #ruby
Ankhers has joined #ruby
<sheldonh>
workmad3: i've been away a while ;)
krz has joined #ruby
abuzze has quit [Remote host closed the connection]
lw has quit [Client Quit]
abuzze has joined #ruby
rossgeesman has joined #ruby
freerobby has joined #ruby
g0bl1n has joined #ruby
jrhorn424 is now known as zz_jrhorn424
shortCircuit__ has quit [Remote host closed the connection]
St_Marx has joined #ruby
xymbol has quit [Quit: Be back later ...]
yfeldblum has joined #ruby
abuzze has quit [Ping timeout: 258 seconds]
beef-wellington has joined #ruby
devdazed has quit [Ping timeout: 255 seconds]
cmoneylulz has joined #ruby
rossgeesman has quit [Ping timeout: 240 seconds]
g0bl1n has quit [Client Quit]
cmoneylulz has quit [Client Quit]
Takle has joined #ruby
julieeharshaw has quit [Remote host closed the connection]
jacobat has joined #ruby
govg has quit [Ping timeout: 272 seconds]
Morkel has joined #ruby
tagrudev has quit [Read error: Connection reset by peer]
mengu__ has quit [Remote host closed the connection]
julieeharshaw has joined #ruby
devdazed has joined #ruby
abuzze has joined #ruby
yfeldblum has quit [Ping timeout: 255 seconds]
AlSquirrel has quit [Quit: Quitte]
<karunamon>
why do so many older Ruby programs (1.8ish) do a "require rubygems' as the first thing?
ad_boot has joined #ruby
anaeem1 has quit [Quit: Leaving...]
<jhass>
karunamon because it wasn't implicitly done back hten
<karunamon>
gems just weren't in the load path?
<jhass>
there's still a require "rubygems", it's just already done for you
ad_boot has left #ruby [#ruby]
ta has quit [Ping timeout: 265 seconds]
Macaveli has quit [Ping timeout: 246 seconds]
<shevy>
karunamon gems were an afterthought
<jhass>
it loads the rubygems library, which among other things makes sure installed gems can be loaded
<shevy>
karunamon in the 1.8 era it was still separate, since 1.9.x it is included
<Jon30>
is there anyway to force round to a certain amount of digits? for example.. 4.12.round(4) will return 4.12, is there a way to force it to 4 decimals, so it's 4.1200?
snath has quit [Ping timeout: 260 seconds]
jacobat has joined #ruby
<Liendre>
hi
zz_jrhorn424 is now known as jrhorn424
<jhass>
Jon30: you're confusing the value with its representation
sheldonh has quit [Quit: being a single parent sucks]
failshell has joined #ruby
<jhass>
Jon30: a float has an infinite number of training 0
<jhass>
Jon30: the question is how many you print out
jobewan has quit [Ping timeout: 255 seconds]
<jhass>
*trailing
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<Liendre>
anybody knows how can I define a new instance method on the Array class called second, which returns the second item in an array (similar to the way .first and .last work in Ruby).?
<apeiros>
jordila: then you have a rubygems installed along with your ruby, as it's a part of it
<jordila>
:-/
beef-wellington has quit [Ping timeout: 240 seconds]
<workmad3>
jordila: that command is rvm specific and is for using different versions of rubygems (similar to how rvm lets you switch different versions of ruby)
<Liendre>
please dont laugh at me, i have been on this only a few weeks
<jhass>
no worries
yfeldblum has quit [Remote host closed the connection]
<jhass>
so, do you know what an instance is?
Gunni has joined #ruby
ki0 has quit [Remote host closed the connection]
<shevy>
tzero I think historically #ruby was registered first but the one who did so went missing in action or something. as others did not get ops, but wanted to control a channel still, they created #ruby-lang - at least that is my interpretation
nonks has quit [Ping timeout: 256 seconds]
bricker`work has joined #ruby
yfeldblum has joined #ruby
<tzero>
that's a trend with gems too, I've found :(
<jhass>
Liendre: no is a valid answer ;)
<Liendre>
I think I do
<Liendre>
a litle bit
<jhass>
Okay, how you make a new instance of Ball
russt has quit [Client Quit]
gaboesquivel has joined #ruby
havenwood has quit [Remote host closed the connection]
niklasb has joined #ruby
russt has joined #ruby
<Liendre>
Ball.new
<Liendre>
?
<jhass>
exactly
<Liendre>
yay
<jhass>
now what that assignment wants is to pass a parameter on that call
<jhass>
Ball.new('super')
<Liendre>
yes
havenwood has joined #ruby
<jhass>
do you know which method we need to define to receive this parameter?
<Liendre>
super when something is written as argument
<Liendre>
mmmh
ndrei has quit [Ping timeout: 258 seconds]
niklasb has quit [Client Quit]
noop has quit [Ping timeout: 265 seconds]
linojon has quit [Quit: linojon]
shazaum has quit [Quit: Leaving]
charliesome has joined #ruby
<Liendre>
I am not sure.. I am confused
treehug8_ has joined #ruby
ki0 has joined #ruby
cndiv has quit [Ping timeout: 260 seconds]
<jhass>
it's initialize. new creates a new instance and then calls initialize on it, passing on all parameters
danijoo has quit [Read error: Connection reset by peer]
<jhass>
so def initialize(ball_type)
<Liendre>
aaahaaa
linojon has joined #ruby
<Liendre>
that initialize thing has been a mistery for me for a long time
danijoo has joined #ruby
<Liendre>
always there
<Liendre>
okok
Dude007 has quit [Remote host closed the connection]
<jhass>
the general OOP terminology for it is constructor
<jhass>
so if you read that, same thing
Fohlen has joined #ruby
<Liendre>
ok wait
niklasb has joined #ruby
bricker`work has quit [Read error: Connection reset by peer]
bricker`work has joined #ruby
<Liendre>
(I really need to read that book of Sandi Metz, but I dont have the level yet I think)
Gunni has quit [Ping timeout: 265 seconds]
gaboesquivel has quit [Ping timeout: 260 seconds]
<Fohlen>
anyone here can explain me the general approach of compiling a ruby project? I am trying to compile https://github.com/rauhryan/huboard and I got gem and rake installed, but I simply don't get the grasp how it's supposed to be working
treehug88 has quit [Ping timeout: 260 seconds]
xymbol has joined #ruby
<jhass>
Fohlen: ruby is an interpreted language, you simply run it
<jhass>
ruby foo.rb
nobitanobi has joined #ruby
niklasb_ has joined #ruby
<Fohlen>
okay. What's the rake and gemfiles about than? How do I use them?
treehug8_ has quit [Client Quit]
boombadaroomba has quit [Remote host closed the connection]
<jhass>
rake are for general tasks, those can build things or just run something
<jhass>
the project you linked is sinatra application
<jhass>
you should start by installing its dependencies
<jhass>
make sure you have bundler installed: gem install bundler
<jhass>
then run bundle install
<jhass>
this will among other things install foreman
<max96at>
(build usually as in css and javascript from less/sass/stylus or coffeescript) gemfiles are about dependency management
<Fohlen>
okay, sweet thanks
<jhass>
the project ships a Procfile which gives an indication on how to run it
<jhass>
it's worth looking into wikis on Github if you can't find any docs
jrhorn424 is now known as zz_jrhorn424
<jhass>
Liendre: if ball_type = nil this condition will always be false
jdj_dk has quit [Ping timeout: 255 seconds]
cajone has left #ruby [#ruby]
<jhass>
you assign nil to the variable, the result of an assignment is the right hand side of the assignment, in this case nil. nil in if statements is considered false, we call it falsey
Tricon has joined #ruby
FooMunki has joined #ruby
JBreit has left #ruby ["Leaving"]
momomomomo_ has joined #ruby
<Liendre>
ouff wait ... I need to read your things like 30 times
momomomomo has quit [Ping timeout: 244 seconds]
momomomomo_ is now known as momomomomo
<jhass>
no worries, I'm aware they have a certain density ;)
TPBallbag has joined #ruby
<shevy>
it's because of his short nick
<shevy>
j-h-a-s-s
<shevy>
see? that is much better... it has proper spacing
<jhass>
s-h-e-v-y
<shevy>
Liendre ok but at least you understand how to use nil right?
<godd2>
watch out, or you might lost molecular cohesion
<shevy>
and the difference between = and ==
GPH|work has quit [Read error: Connection reset by peer]
<shevy>
which can be a hard-to-spot error for new folks
<shevy>
my favourite one is this: class Foo; def intialize
emmesswhy has joined #ruby
yfeldblum has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
nettoweb_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zz_jrhorn424 is now known as jrhorn424
<Liendre>
yes shevy , I think so. yes yes classic error = and == thabks
robbyoconnor has quit [Client Quit]
DrCode has joined #ruby
<shevy>
\o/
<jhass>
Liendre: so, it's time to explain default arguments? ;)
beef-wellington has quit [Ping timeout: 265 seconds]
<Liendre>
errr yes
ndrei has joined #ruby
<Liendre>
:o
<jhass>
okay, so currently ball_type is required
<Liendre>
yes
<jhass>
you have to pass it, you can't invoke it without that argument
<jhass>
we don't want that
<jhass>
instead we want it to be 'regular' if we don't pass it
TPBallbag has quit [Ping timeout: 256 seconds]
<Liendre>
"regular" id it is empty
<Liendre>
if*
Xeago_ has joined #ruby
aclearman037 has quit [Ping timeout: 256 seconds]
<jhass>
we can tell ruby this by pretending to assign the value right inside the def: def initialize(ball_type="regular")
spyderman4g63 has quit [Read error: Connection reset by peer]
<Liendre>
oooooooooohhhhhhhhhhhh
<jhass>
let's try out with a simple method that just returns the argument:
<jhass>
first invocation: no argument passed, the default kicks in, second invocation: we pass the argument and override the default
agjacome has joined #ruby
m_3_ has quit [Quit: leaving]
aspires has joined #ruby
m_3 has joined #ruby
elaptics is now known as elaptics`away
niklasb_ is now known as niklasb
aclearman037 has joined #ruby
Xeago has quit [Ping timeout: 244 seconds]
GPH|work has joined #ruby
GPH|work has quit [Remote host closed the connection]
rodfersou has quit [Quit: leaving]
gregf has quit [Quit: WeeChat 1.0.1]
tadayoshi has joined #ruby
<Liendre>
I am googling this :/ arg:=foo
<shevy>
Liendre in other words: if you use the = there, you assign a default argument for a method, if you omit arguments when you invoke it. def foo(i = 'Hello world!'); puts i
<shevy>
no no no
<shevy>
you must train your eyes
<shevy>
<jhass> >> def foo(arg=:foo)
<shevy>
<Liendre> I am googling this :/ arg:=foo
<Liendre>
okoko wait
<shevy>
spot the difference Liendre
<Liendre>
sorry
<Liendre>
I mean
<shevy>
that is the same as you did with the = vs ==
<shevy>
in ruby you need sharp eyes
<Liendre>
=:*
<shevy>
ohh a smiley
<shevy>
=:>
skolman has joined #ruby
beef-wellington has joined #ruby
<Liendre>
nono
<jhass>
Liendre: :fooo is just a symbol, if you don't know them yet don't worry, pretend I had written "foo"
<shevy>
hahaha
<Liendre>
aaahh
<Liendre>
ok
<Liendre>
code slang
<shevy>
a smiley can be valid in ruby Liendre, yeah ^^^ if it is a symbol
atmosx has quit [Remote host closed the connection]
jdj_dk has joined #ruby
atmosx has joined #ruby
eikood has joined #ruby
Deejay_ has quit [Quit: Computer has gone to sleep.]
ndrei has quit [Ping timeout: 245 seconds]
<Liendre>
like this?
<jhass>
yes
<Liendre>
cool
<Liendre>
but now what?
<jhass>
now there's only one piece left
<Liendre>
:O
<jhass>
we need a method that returns which type our ball has
djbkd has quit [Remote host closed the connection]
eikood has quit [Client Quit]
<Liendre>
another method
<Liendre>
ok
eikood has joined #ruby
<momomomomo>
are you doing their homework?
<Liendre>
the method has to be called ball_type
<jhass>
if you look at the example usage, which name should that method have?
<jhass>
right
<momomomomo>
I can’t tell who’s doing who’s homework
<Liendre>
cooool
Xeago_ has quit [Remote host closed the connection]
<jhass>
momomomomo: yes I'm spoonfeeding currently, but as slow as possible ;)
SCHAAP137 has joined #ruby
ht__th has quit [Ping timeout: 250 seconds]
<jhass>
I think it's a kata or something
<Liendre>
yes it is
<jhass>
1kyu or so
<Liendre>
a kata
<Liendre>
8 kyu
<jhass>
er, right, the low one
<momomomomo>
Liendre: You realize that not working through the katas makes them meaningless
x1337807x has joined #ruby
BadQuanta has joined #ruby
<momomomomo>
they’re literally just exercises for you to learn how to google
<momomomomo>
and read and understand documentation
IceDragon has quit [Ping timeout: 272 seconds]
<momomomomo>
sidestepping that defeats the purpose
<Liendre>
yes momomomomo , i know thatm I am doing lots of them, but I have spent a lot of time in this one and I dont know where to look more resources online
<momomomomo>
fair enough
<jhass>
mmh, not all of the higher ones have a premade solution
<Liendre>
anyway chatting with helpful people like here is making me learn a lot. Much more than just on my own.
ta has quit [Read error: Connection reset by peer]
ldnunes has quit [Quit: Leaving]
<jhass>
I wouldn't spoonfeed you here if I had the impression you're not learning anything in the process ;)
Jet4Fire has joined #ruby
ta has joined #ruby
<jhass>
Liendre: okay, so we need to look at variable types again
<Liendre>
yes
Takle has quit [Remote host closed the connection]
<jhass>
ball_type is called a local variable, it is available in the current method only
momomomomo has quit [Quit: momomomomo]
<Liendre>
yes it is
<jhass>
if the method ends, the local variable ceases to exist
<Liendre>
yes yes
<jhass>
@ball_type is called an instance variable
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<Liendre>
aha
<jhass>
it lives inside an instance
<Liendre>
ok
maestrojed has joined #ruby
<jhass>
which makes it available to all methods of that instance
<Liendre>
oh wait
IceDragon has joined #ruby
ht__th has joined #ruby
jrhorn424 is now known as zz_jrhorn424
chipotle has quit [Quit: cya]
lw has joined #ruby
max96at is now known as max96at|off
end_guy_ has joined #ruby
kaspertidemann has quit []
tercenya has joined #ruby
<Liendre>
I am googling instance in ruby to be sure
<jhass>
another term is object
<jhass>
they essentially mean the same thing
<csmrfx>
well, instance implies there is class
<Liendre>
ok now is clear
<jhass>
csmrfx: yeah, I don't think we should go into that detail yet ;)
<csmrfx>
(or a prototype, in some languages)
<Liendre>
all good
zz_jrhorn424 is now known as jrhorn424
<jhass>
Liendre: updated the gist?
Takle has joined #ruby
<Liendre>
eeh
jrhorn424 is now known as zz_jrhorn424
end_guy has quit [Ping timeout: 246 seconds]
<Liendre>
now?
<jhass>
yes
<Liendre>
:|
<Liendre>
:o
<jhass>
so your current gist should pass the tests
<Liendre>
omg
<jhass>
but we can do a bit better
zhigang1992 has joined #ruby
_2easy has joined #ruby
_2easy has joined #ruby
<jhass>
your ball type is a very common method
timonv_ has joined #ruby
<jhass>
we call it an attribute
<Liendre>
ABSOLUTELY
last_staff has quit [Quit: gots to runz]
<Liendre>
pro
yfeldblum has joined #ruby
<jhass>
it makes an instance variable available to the outside world
<jhass>
so since they are so common
<jhass>
ruby provides a shortcut to define them
twohlix has quit [Quit: justQU.IT]
<jhass>
so you can replace the entire def with: attr_reader :ball_type
<jhass>
which will define a method that looks just like the one you written
<Liendre>
ooooohh that one
<jhass>
but is only one line of code
<Liendre>
attr_reader
<Liendre>
another old unknown
doodlehaus has joined #ruby
tonybird has quit [Ping timeout: 272 seconds]
djbkd has joined #ruby
<Liendre>
but attr_reader is for create a variable or to make an existing one available on the outside?
reinaldob has quit [Remote host closed the connection]
blah is now known as nobody18188181
emmesswhy has quit [Client Quit]
ki0 has quit [Remote host closed the connection]
<shock_one>
benzrf, I have a serious question. Why in your opinion Haskell isn't popular. I think you'll agree that it's beautiful, and has many interesting and powerful concepts.
naw_ has joined #ruby
ta_ has joined #ruby
chrishough has joined #ruby
ta has quit [Read error: Connection reset by peer]
DrShoggoth has joined #ruby
jerius has quit []
tadayoshi has quit []
bricker`work has joined #ruby
paulfm has quit []
<benzrf>
shock_one: couple of reasons
<benzrf>
shock_one: one is that relatively few people know it
<wasamasa>
shock_one: what if I told you the majority of people actually using a language doesn't care about its beauty
<shock_one>
csmrfx, could you elaborate? Does it mean that since it's less similar to the C family it requires more time to learn, or that imperative languages suit better to solve real world problems?
<wasamasa>
shock_one: this argument can be applied to lots of other "How dare they not use the bestest <insert tool> like I do???" questions
<wasamasa>
shock_one: even to printouts using comic sans
naw__ has joined #ruby
jdj_dk has joined #ruby
zaid_h has joined #ruby
skolman has quit [Remote host closed the connection]
emmesswhy has joined #ruby
skolman has joined #ruby
<shock_one>
wasamasa, sure, but having a beautiful and a less beautiful language with all the other variables equal, it would be not wise to choose the latter, don't you agree? Therefore, it must me something else.
<csmrfx>
shock_one: simply means that you need to well acquinted with secrets of computer science
mengu has quit [Remote host closed the connection]
<wasamasa>
shock_one: I rather agree with results, not questionable reasoning
<csmrfx>
or, at least the haskell paradigm
<wasamasa>
shock_one: and based on those I'm very sure it's a massive phenomenon
<roger_rabbit>
b. bu. but... but it's so FUNCTIONAL!!!
<csmrfx>
as opposed to starting with bunch of statements or expressions and no real structure and still having a "program"
<eam>
beauty is subjective, and often at odds with pragmatic concerns such as efficiency, simplicity, compatibility and familiarity.
<wasamasa>
^
<wasamasa>
"I mostly don't care how popular Lisp is. I am not using Lisp in order to score better in a popularity contest. I am using Lisp because it is the best programming language I know for the kind of programs I write."
tkuchiki has joined #ruby
SilkFox has quit [Ping timeout: 260 seconds]
naw_ has quit [Ping timeout: 265 seconds]
treehug88 has joined #ruby
olivier_bK has joined #ruby
<siwica>
I am trying to run an external program "foo" from ruby. After executing foo it expects user input in STDIN and returns output in STDOUT. However, I can't manage to achieve this from ruby. These are my attempts so far:
<eam>
siwica: does cs2cs expect stdin to be closed before it writes to stdout?
<eam>
is this on linux?
<shock_one>
wasamasa, I'm also developing a rails application at work, bro. And we have hundreds of tests that would be unnecessary in a statically typed language.
<eam>
it's a great way to figure out where deadlocks like this are occuring
<wasamasa>
wait, did I just got called "bro" by someone on #ruby dreaming of haskell?
<eam>
why is the word "bro" so offensive to some
<siwica>
eam: it only says the following in the man page: "If no files are specified, the input is assumed to be from stdin. For input data the two data values must be in the first two white space separated fields and when both input and output are ASCII all trailing portions of the input line are appended to the output line."
<wasamasa>
eam: the combination is offensive
starkhalo has joined #ruby
codecop_ has quit [Remote host closed the connection]
<siwica>
eam: no, what is that?
<eam>
siwica: is this a fairly simple program? like, can you reduce the problem to just the single popen routine or close to it?
<eam>
strace is a debugging tool that lets you see the syscalls your process is making
spyderman4g63 has quit [Ping timeout: 260 seconds]
<siwica>
Probably I simple question: When making a call to an external program with Open3.popen3('foo') { |stdin, stdout, stderr, wait_thr| stdin.write 'sample input'; a = stdout.read }. How do I get access to the variable "a" outside the block?
jdj_dk has joined #ruby
doodlehaus has quit [Remote host closed the connection]
skolman has joined #ruby
<shevy>
siwica no
allcentury has quit [Ping timeout: 260 seconds]
<shevy>
if you wish to store it, initialize it outside like @a
<jokke>
so no one could help me with my parsing problem?
<siwica>
shevy: ok, but that seems a little ugly
<shevy>
siwica well you could try with a perhaps
<shevy>
I mean, you can not store the local variable outside the block - it has its own scope ok?
<siwica>
shevy: yes
<shevy>
unless you initialized it already
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phutchins has quit [Ping timeout: 260 seconds]
<shevy>
the a = stdout.read part should only persist within the context of that block there
<siwica>
but I just need a in a certain method and not in the entire class
<shevy>
well try it without @
<shevy>
btw you can remove @ variables too
CodeBunny has joined #ruby
SilkFox has joined #ruby
<shevy>
remove_instance_variable(:@a)
Fire-Dragon-DoL has quit [Ping timeout: 272 seconds]
<shevy>
but try with a before you use @a
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<CodeBunny>
is anyone here a Rake wizkid
<siwica>
ok, that sounds interesting
<CodeBunny>
I am trying to run rspec and spec in the same rake file... and I fail
sailias has quit [Quit: Leaving.]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
bigkevmcd has quit [Read error: Connection reset by peer]
gaboesquivel has joined #ruby
<shevy>
rake is fail too
<CodeBunny>
Yeh yeh
zzach has quit [Ping timeout: 245 seconds]
SilkFox has quit [Ping timeout: 272 seconds]
starkhalo has quit [Ping timeout: 272 seconds]
<eam>
have you guys heard about this new cool tool called "make", it's like rake except it works everywhere
zzach has joined #ruby
<CodeBunny>
But seriously....
mleone has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
willywos has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mleone has joined #ruby
mleone has quit [Client Quit]
<shevy>
except you must indent with make
msmith has quit [Remote host closed the connection]
<eam>
you say that like ruby isn't super whitespace sensitive either
User458764 has quit [Ping timeout: 246 seconds]
<shevy>
ruby only complains but continues
tkuchiki has quit [Ping timeout: 255 seconds]
AndChat| has joined #ruby
mleone has joined #ruby
jobewan has quit [Quit: Leaving]
mleone has quit [Client Quit]
lkba has quit [Ping timeout: 255 seconds]
mleone has joined #ruby
ramfjord has quit [Ping timeout: 265 seconds]
volty has joined #ruby
freerobby has quit [Quit: Leaving.]
jimbach has quit [Remote host closed the connection]
Tuxero has quit [Quit: Tuxero]
narcan has joined #ruby
<CodeBunny>
Are you kidding. Ruby could care less about witespace.
PeterBoy has quit [Quit: Bye Bye]
qmfnp has joined #ruby
<CodeBunny>
ruby programmers on the other hand will nitpick your indenting for not better reason than to pick on you
geggam has quit [Ping timeout: 244 seconds]
<CodeBunny>
not = no
freerobby has joined #ruby
timonv_ has joined #ruby
<shevy>
well ruby tends to scream at wrongful indents these days if you run it with warning
<shevy>
test.rb:34: warning: mismatched indentations at 'end' with 'def' at 32
jimbach has joined #ruby
<shevy>
and I guess eam referred to some ... parser strangeness...
<shevy>
I think it was ... [!and] or something like that
reinaldob has joined #ruby
<shevy>
nope
<shevy>
that was not it :(
<shevy>
eam help me out
<volty>
irb: "#{x#{i}}"
bricker`work has quit [Ping timeout: 272 seconds]
obs has quit [Quit: Saliendo]
<shevy>
why do you torture ruby so much volty
jcdesimp has quit [Remote host closed the connection]
<omosoj>
i have an idea how i'd build parts of it, but no idea how i'd make the visualization and whole thing
<omosoj>
thanks, Sou|cutter
mary5030 has quit [Remote host closed the connection]
<wasamasa>
omosoj: you have multiple options
<wasamasa>
omosoj: like, printing it out every time/writing to file
<wasamasa>
omosoj: writing a curses application
<Sou|cutter>
omosoj: honestly if you came into an interview and recited an answer it's a lot less interesting than seeing how you work through the problem
<wasamasa>
omosoj: writing something with an ui toolkit
freerobby has quit [Quit: Leaving.]
<wasamasa>
omosoj: writing something with a web ui
<wasamasa>
omosoj: it doesn't really matter which one you go for
mary5030 has joined #ruby
<eam>
wasamasa: no mention of native graphics?
<eam>
today's world is a weird place
<omosoj>
i was able to work through a class for each block that would behave the right way, but ugh would i be expected to build the graphic part?
<wasamasa>
no
<wasamasa>
besides, wiring it up should be the easiest part
<omosoj>
cool
lmickh has quit [Remote host closed the connection]
<omosoj>
eam, native graphics?
lessless has quit [Remote host closed the connection]
<a_>
mferrier: because I am aware of some very smart people who have spent years doing so, and I do not have the time/scope
<volty>
can't think of something more micro than that
<havenwood>
a_: Are you familiar with the Celluloid ecosystem?
<volty>
answer to havenwood
<a_>
havenwood: thank you for not being one of these clowns :) Yes. Unfortunately, DCell isn't ready for use, yet
<havenwood>
a_: true
<shevy>
when I do something like this:
<volty>
if you like to disguise abstract theories and the sex of angles there's #haskell
<shevy>
heredoc_variable = <<-EOF
<shevy>
is it possible to interpolate inside that via #{} ?
<a_>
havenwood: and I know of no other real alternatives. There's so much hype about micro-soa, it's kind of ridiculous Ruby has virtually *nothing* to offer
arpit has quit [Client Quit]
<havenwood>
a_: No DRb love?
<shevy>
micro-soap?
axl__ has joined #ruby
<a_>
havenwood: author of celluloid has none. I'm going to look into it right now - but I bet his word will be on the money
<a_>
havenwood: I haven't really looked into it (am right now) - my only foreknowledge of it is that the celluloid author doesn't regard it as sufficient
axl__ has left #ruby [#ruby]
<volty>
shevy: yes
jxf has quit [Ping timeout: 265 seconds]
<shevy>
hmm
<shevy>
it's so long
<havenwood>
a_: I know there are some DRb users here in the channel. It being in the stdlib is handy. I think DCell is interesting but I agree it's not fully baked.
<shevy>
I guess I'll put it into its own file :P
doodlehaus has quit [Remote host closed the connection]
<a_>
havenwood: I've only seriously started looking at celluloid recently. Was really upset to realise that it wasn't quite ready, seemed perfect.
cat_pants has joined #ruby
mistermocha has joined #ruby
<cat_pants>
Hi folks, what's this operator called? "=>"
<havenwood>
cat_pants: hash rocket
<cat_pants>
Thanks! Also curious about this one as well: "->"
<havenwood>
cat_pants: stabby lambda
nateberkopec has quit [Quit: Leaving...]
<cat_pants>
Thank you :) I'll go read the docs for those
<a_>
havenwood: I'm looking to implement micro-soa for a large & well-known organization/website. It has to be Ruby (otherwise I'd fall back to Scala for Akka). Will be sad to miss the opportunity of going fully micro-soa
<tmoore>
I mean, generally the reason people want to go micro SOA in the first place is because they can't meet their performance needs with a monolithic architecture, right?
emmesswhy has quit [Quit: This computer has gone to sleep]
<a_>
tmoore: more economical/efficient, as you can scale with more granularity
<tmoore>
you're never going to get the most efficiency possible from Ruby
<a_>
tmoore: I'm not looking for performance here, though
<a_>
tmoore: for instance, I'd like to compose a system of very small services. For the sake of that.
_|d0m|_ has quit [Ping timeout: 245 seconds]
<tmoore>
at its simplest, you don't need a special framework... just a REST API
PeterBoy has quit [Quit: Bye Bye]
rockdon_ has joined #ruby
tvw has quit []
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brainspoil has joined #ruby
cndiv has quit [Ping timeout: 272 seconds]
mary5030 has quit [Remote host closed the connection]
<a_>
tmoore: I was thinking about stuff like using queues for asynchrony, but I guess it's not *really* needed
<tmoore>
there are lots of ways to use queues in Ruby