Aswebb has quit [Remote host closed the connection]
jonr22 has quit [Ping timeout: 258 seconds]
n3phos has quit [Remote host closed the connection]
luriv_ has quit [Quit: Leaving]
thsig_ has joined #ruby
zorak8 has quit [Ping timeout: 245 seconds]
sailias has joined #ruby
josephndenton has quit [Ping timeout: 264 seconds]
thsig_ has quit [Remote host closed the connection]
jimms has quit [Remote host closed the connection]
thsig_ has joined #ruby
nkumari has joined #ruby
thsig has quit [Ping timeout: 272 seconds]
SHyx0rmZ has joined #ruby
karmatr0n has quit [Remote host closed the connection]
valeriansaliou has quit [Quit: Be back later ...]
thsig_ has quit [Ping timeout: 255 seconds]
timmmaaaayyy has joined #ruby
Joe_knock has left #ruby ["Leaving"]
charlenopires has quit [Ping timeout: 240 seconds]
ghr has joined #ruby
arescorpio has joined #ruby
x1337807x has joined #ruby
hmsimha has joined #ruby
Guest19435 has quit [Quit: Lost terminal]
<timmmaaaayyy>
i'm trying to convert a URL from https://s3.amazonaws.com/bucket/blah/blah.jpg to s3://bucket/blah/blah.jpg. i'm initially retrieve the url from a databse, then covert to string, then use gsub.
<timmmaaaayyy>
i'm doing s3url = image.to_s.gsub("https", "s3").gsub("s3.amazonaws.com", "") -- it puts brackets and quotes aroundt he result. why is this and how do i make it stop?
patteh has quit [Quit: leaving]
patteh has joined #ruby
charlenopires has joined #ruby
Channel6 has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
jnollette has quit [Remote host closed the connection]
ghr has quit [Ping timeout: 255 seconds]
x1337807x has quit [Ping timeout: 240 seconds]
jnollette has joined #ruby
Wapitidou has joined #ruby
<waxjar>
timmmaaaayyy: u = URI.parse(original_url); u.scheme = "s3"
<waxjar>
require "uri" first, tho
sailias has quit [Quit: Leaving.]
<waxjar>
you can do the same for the domain, just set it to ""
<timmmaaaayyy>
ok let me give this a shot
jnollette has quit [Remote host closed the connection]
tus has joined #ruby
tokik has joined #ruby
jnollette has joined #ruby
<timmmaaaayyy>
s3url = URI.parse(image); s3url.scheme = "s3" is just erroring out for me
davasaurous has quit [Remote host closed the connection]
Soda has joined #ruby
crazydiamond has quit [Ping timeout: 265 seconds]
bmichelsen has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
ghr has joined #ruby
davasaurous has joined #ruby
buddy_tucker has joined #ruby
vyorkin has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
danijoo_ has joined #ruby
<obelich>
some one here using angularjs + Rails ?
ghr has quit [Ping timeout: 250 seconds]
<sevenseacat>
both of those topics are pretty off-topic here
<obelich>
sevenseacat: :(
yeticry has quit [Ping timeout: 240 seconds]
<obelich>
sevenseacat: some chanel you recomen to get some people can give some help ?
<sevenseacat>
#rubyonrails or #angularjs? :)
duncannz has quit [Ping timeout: 258 seconds]
yeticry has joined #ruby
<Areessell>
I'm sure google has the answer for any question you have about those since they are both wildly popular frameworks
<sevenseacat>
thats too hard.
<Areessell>
I don't see why alot of people are using Rails for hosting purely front-end style web apps
<Areessell>
They could easily use Jekyll or Middleman
adriancb has quit [Remote host closed the connection]
<sevenseacat>
mmmm not really, if it involves data
jonr22 has joined #ruby
<Areessell>
Oh right.
<Areessell>
All my "front-end" projects held data in the browser so I wasn't thinking about that. Never hooked one up to an actual database.
adriancb has joined #ruby
AlexRussia has quit [Quit: WeeChat 1.1-dev]
<sevenseacat>
yeah for frontend stuff that just involves local storage or whatnot, rails is pointless
uber_hulk has joined #ruby
quazimodo has joined #ruby
<Areessell>
I bit off alot for my current project =S Gotta abstract all my code into separate libraries. Easy to do, it's just such a pain renaming everything, opening every single file to double check everythings working.
saclark has quit [Quit: saclark]
jonr22 has quit [Ping timeout: 258 seconds]
adriancb has quit [Ping timeout: 264 seconds]
Takle has joined #ruby
ChoiKyuSang has quit [Quit: Going offline, see ya! (www.adiirc.com]
arup_r has joined #ruby
bluOxigen has joined #ruby
phutchins has quit [Ping timeout: 240 seconds]
timonv_ has joined #ruby
diegoviola has quit [Remote host closed the connection]
Lewix has joined #ruby
Lewix has joined #ruby
Lewix has quit [Changing host]
valeriansaliou has joined #ruby
Takle has quit [Ping timeout: 258 seconds]
Axy has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
snath has quit [Ping timeout: 245 seconds]
snath has joined #ruby
timonv_ has quit [Ping timeout: 250 seconds]
Scripore has quit [Ping timeout: 244 seconds]
valeriansaliou has quit [Ping timeout: 265 seconds]
<Areessell>
It's similar because it takes a block. `any?` checks if any of the objects in the Enumerable object returns true when the block is run. It uses the `each` method behind the scenes
ARCADIVS has joined #ruby
jottr has joined #ruby
<bigmac>
a quick if expression
<bigmac>
quicker
<Areessell>
It's the same as going through each object with an `each` block, and `break`ing when an if expression returns true.
mbrumbelow has joined #ruby
ChoiKyuSang has joined #ruby
<bigmac>
i see
Avahey has quit [Quit: Connection closed for inactivity]
<Areessell>
You could use regular Ruby to do any of those methods in Enumerable, but it's just easier and usually faster to use them.
<Areessell>
Makes life alot simplier when you work on large scale projects.
doodlehaus has joined #ruby
CrazyM4n has joined #ruby
<CrazyM4n>
Whoever made Cinch for IRC bots was a genius
<CrazyM4n>
I swear
jottr has quit [Ping timeout: 272 seconds]
davasaurous has quit [Ping timeout: 272 seconds]
benzrf is now known as benzrf|offline
<Areessell>
Modularity in action
renderful has joined #ruby
renderful has quit [Read error: Connection reset by peer]
renderful has joined #ruby
<CrazyM4n>
I was under the impression it wasn't working for like 3 hours
<CrazyM4n>
Until I realized that by default commands were prefaced by !
<CrazyM4n>
And it's been so smooth ever since
Joufflu has quit [Ping timeout: 258 seconds]
doodlehaus has quit [Ping timeout: 255 seconds]
Abhijit has joined #ruby
olivier_bK has joined #ruby
psy has quit [Remote host closed the connection]
konsolebox has quit [Remote host closed the connection]
Joufflu has joined #ruby
renderful has quit [Ping timeout: 258 seconds]
valeriansaliou has joined #ruby
rocknrollmarc has joined #ruby
psy has joined #ruby
psy has quit [Max SendQ exceeded]
psy has joined #ruby
mbrumbelow has quit [Quit: mbrumbelow]
kireevco has joined #ruby
valeriansaliou has quit [Client Quit]
mikepack has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
chabier has joined #ruby
Arnie25 has quit [Ping timeout: 256 seconds]
quazimodo has quit [Ping timeout: 255 seconds]
rshetty has quit [Remote host closed the connection]
olivier_bK has quit [Ping timeout: 258 seconds]
mikepack has quit [Ping timeout: 255 seconds]
quazimodo has joined #ruby
rocknrollmarc has quit [Ping timeout: 250 seconds]
ghr has joined #ruby
chabier has quit [Remote host closed the connection]
rshetty has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jonr2219 has quit [Read error: Connection reset by peer]
kamilc__ has joined #ruby
chabier has quit [Remote host closed the connection]
andikr has joined #ruby
Macaveli has quit [Ping timeout: 264 seconds]
ARCADIVS has quit [Quit: ARCADIVS]
valeriansaliou has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
ghr has joined #ruby
jonr2219 has joined #ruby
lkba has quit [Ping timeout: 240 seconds]
jonr22 has quit [Read error: Connection reset by peer]
clauswitt has joined #ruby
lkba has joined #ruby
WormDr1nk has quit [Ping timeout: 255 seconds]
buddy_tucker has quit [Quit: Konversation terminated!]
anaeem1_ has joined #ruby
ghr has quit [Ping timeout: 256 seconds]
jonr22 has joined #ruby
jobewan has quit [Quit: Leaving]
jonr2219 has quit [Read error: Connection reset by peer]
valeriansaliou has quit [Read error: Connection reset by peer]
patrick99e99 has quit [Ping timeout: 245 seconds]
valeriansaliou has joined #ruby
lemur has quit [Remote host closed the connection]
lemur has joined #ruby
Joufflu has quit [Ping timeout: 265 seconds]
stoffus has joined #ruby
jonr22 has quit [Remote host closed the connection]
jonr22 has joined #ruby
Tranquility has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
valeriansaliou has quit [Ping timeout: 272 seconds]
anaeem1_ has joined #ruby
lemur has quit [Ping timeout: 258 seconds]
codecop has joined #ruby
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
josephndenton has quit [Ping timeout: 256 seconds]
yokel has quit [Ping timeout: 240 seconds]
NoNMaDDeN has quit [Ping timeout: 264 seconds]
Macaveli has joined #ruby
jonr2219 has quit [Remote host closed the connection]
NoNMaDDeN has joined #ruby
jonr22 has joined #ruby
fxn has joined #ruby
mloveless has joined #ruby
echooo1 has joined #ruby
kireevco has quit [Read error: Connection reset by peer]
echooo has quit [Ping timeout: 244 seconds]
kireevco has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jonr2219 has joined #ruby
jonr2219 has quit [Remote host closed the connection]
jottr has joined #ruby
jonr22 has joined #ruby
fabrice31 has joined #ruby
kamilc__ has quit [Remote host closed the connection]
CpuID has quit [Ping timeout: 265 seconds]
NoNMaDDeN has quit [Ping timeout: 265 seconds]
jottr has quit [Ping timeout: 240 seconds]
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jaequery has joined #ruby
aganov has joined #ruby
shortCircuit__ has joined #ruby
michael_mbp has quit [Excess Flood]
amystephen has quit [Quit: amystephen]
timonv_ has joined #ruby
yokel has joined #ruby
michael_mbp has joined #ruby
shortCircuit__ is now known as friedAy
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
uber_hulk has joined #ruby
NoNMaDDeN has joined #ruby
jottr has joined #ruby
kuda has joined #ruby
timonv_ has quit [Remote host closed the connection]
Xiti has quit [Quit: Xiti]
Xiti has joined #ruby
x1337807x has joined #ruby
WormDr1nk has joined #ruby
ringarin has joined #ruby
jonr22 has quit [Remote host closed the connection]
ringaring has joined #ruby
jonr22 has joined #ruby
doodlehaus has joined #ruby
kireevco has left #ruby [#ruby]
SOLDIERz_ has joined #ruby
ringarin has quit [Read error: Connection reset by peer]
x1337807x has quit [Ping timeout: 250 seconds]
shredding has joined #ruby
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonr22 has quit [Remote host closed the connection]
jonr22 has joined #ruby
Aswebb has joined #ruby
charliesome has joined #ruby
jonr2219 has joined #ruby
jonr22 has quit [Remote host closed the connection]
doodlehaus has quit [Ping timeout: 244 seconds]
Cache_Money has joined #ruby
mkaesz has joined #ruby
lampd1 has joined #ruby
JCii8_ has quit [Ping timeout: 240 seconds]
Xiti has quit [Quit: Xiti]
bmichelsen has quit [Quit: ZZZzzz…]
Xiti has joined #ruby
<epitron>
bigmac: that can be done simpler than delete_if; try "array1 - array2"
ht__th has joined #ruby
jonr22 has joined #ruby
ohaibbq has quit [Quit: Leaving...]
jonr2219 has quit [Read error: Connection reset by peer]
terlar has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
kuda has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonr2219 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
<epitron>
if you don't care about order or having duplicates, you can convert the arrays to Set objects, and then you can do even more fun stuff, like intersection (&), union (|), exclusive or (^)
jonr22 has quit [Read error: Connection reset by peer]
kuda has joined #ruby
jonr22 has joined #ruby
gaussblurinc1 has joined #ruby
einarj has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Senjai has quit [Ping timeout: 240 seconds]
jonr2219 has joined #ruby
last_staff has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
ghr has joined #ruby
despai has joined #ruby
noop has joined #ruby
kuda has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider_>
you can do all of that with just arrays, not just sets
marr has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
rdark has joined #ruby
Senjai has joined #ruby
ghr has quit [Ping timeout: 265 seconds]
CrazyM4n has quit [Quit: leaving]
tyll_ is now known as tyll
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
rshetty has joined #ruby
Xeago has joined #ruby
kuda has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
bal1 has quit [Ping timeout: 240 seconds]
dalai has joined #ruby
livathinos has joined #ruby
jonr2219 has joined #ruby
jonr22 has quit [Remote host closed the connection]
Xeago_ has joined #ruby
arup_r has quit [Remote host closed the connection]
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
Senjai has quit [Ping timeout: 240 seconds]
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
razieliyo has joined #ruby
razieliyo has quit [Changing host]
razieliyo has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
alex88 has joined #ruby
razieliyo has quit [Remote host closed the connection]
Senjai has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
ht__th has quit [Ping timeout: 256 seconds]
iwishiwerearobot has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
Pupeno has joined #ruby
Takle has joined #ruby
sea_local has quit [Remote host closed the connection]
charliesome has quit [Read error: Connection reset by peer]
<mikecmpbll>
imho it'd be more consistent in behaviour if a = *[1] resulted in a being 1
<apeiros_>
no
<mikecmpbll>
the conditions are the same, same number of variables as array elements.
<mikecmpbll>
so why doens't it behave the same?
<apeiros_>
a,*
<apeiros_>
a,* = …
<mikecmpbll>
this syntax is a new one on me, let me play around.
charliesome has joined #ruby
bigkevmcd has quit [Ping timeout: 255 seconds]
<mikecmpbll>
still don't really see why it's necessary but i'll be placated if it works :p
<apeiros_>
personally, I'd prefer explicit splat/unsplat all the time. but that's not what we have. consistency here is that non-multiple-lhs is auto-unsplat
<apeiros_>
i.e. if you have x = … it's always *x = … if rhs is an array
dumdedum has quit [Quit: foo]
<apeiros_>
oh interesting? splat seems to have changed behavior… used to be to_ary iirc, is to_a now.
ki0 has joined #ruby
dcarmich has joined #ruby
WormDr1nk has joined #ruby
<mikecmpbll>
hmpf. you've certainly got me thinking about how splat works :)
mr_foobar_baz has joined #ruby
<mikecmpbll>
still don't entirely get why my example has that result.
dangerousdave has quit [Ping timeout: 255 seconds]
certaint1 has quit [Quit: Lost terminal]
<mikecmpbll>
ah, nvm i understand more clearly now.
certainty has quit [Quit: Lost terminal]
doodlehaus has joined #ruby
Kricir has joined #ruby
certainty has joined #ruby
VBlizzard has quit [Ping timeout: 240 seconds]
Blizzy has quit [Ping timeout: 240 seconds]
clauswitt has joined #ruby
tokik has quit [Ping timeout: 272 seconds]
arup_r_ has joined #ruby
moritzschaefer has joined #ruby
moritzs has quit [Ping timeout: 272 seconds]
doodlehaus has quit [Ping timeout: 240 seconds]
jottr has quit [Read error: Connection reset by peer]
arup_r has quit [Ping timeout: 255 seconds]
lsc is now known as Schmidt
jottr has joined #ruby
lkba has quit [Ping timeout: 244 seconds]
moritzschaefer has quit [Ping timeout: 250 seconds]
nastri has joined #ruby
JohnBat26 has quit [Ping timeout: 272 seconds]
kl_ has joined #ruby
danijoo_ has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
quimrstorres has joined #ruby
bigkevmcd has joined #ruby
greenbagels_ has quit [Ping timeout: 240 seconds]
moritzschaefer has joined #ruby
AFKGeek has joined #ruby
Timgauthier has joined #ruby
Takle has joined #ruby
mollitz has joined #ruby
Timgauthier is now known as timgauthier_away
fandi has quit [Remote host closed the connection]
timgauthier_away is now known as Timgauthier
<friedAy>
I have to write some code that would not match a string that has atleast one alphabet in it. A regex like /^\d+/ matches the 12a , but I don't want it to match it.. I have /^\d+[^a-z]/ but that isn't working
jimms has joined #ruby
moritzschaefer has quit [Ping timeout: 272 seconds]
Pupeno has quit [Read error: Connection reset by peer]
Pupeno has joined #ruby
samuel02 has joined #ruby
Spami has joined #ruby
<DefV>
friedAy: to do exactly what you want: /^[^a-z]+$/i
<friedAy>
ah
ponga has joined #ruby
AlexRussia has joined #ruby
<gregf_>
or /^\d+$/
<gregf_>
er, well its the same
<DefV>
well, not really
<apeiros_>
DefV, friedAy: remember that ^$ is start/end of *line*. use \A and \z for start/end of *string*.
<friedAy>
ohk
<DefV>
gregf_: because he just said "that would not match a string that has at least one alphabet in it"
<DefV>
gregf_: which means 10-1 is a valid value
<apeiros_>
>> "helloworld\n12" =~ /^\d+
<eval-in__>
apeiros_ => /tmp/execpad-1d563fc9ac7d/source-1d563fc9ac7d:2: unterminated regexp meets end of file ... (https://eval.in/227545)
rocknrollmarc has quit [Ping timeout: 264 seconds]
wpp has joined #ruby
reinaldob has joined #ruby
mkaesz has quit [Remote host closed the connection]
josephndenton has quit [Ping timeout: 264 seconds]
ldnunes has joined #ruby
sinanislekdemir has quit [Remote host closed the connection]
jenrzzz has joined #ruby
mr_foobar_baz has quit [Quit: WeeChat 1.0.1]
ptrrr has joined #ruby
bigkevmcd has quit [Ping timeout: 255 seconds]
mkaesz has joined #ruby
mkaesz has quit [Remote host closed the connection]
mkaesz has joined #ruby
FooMunki has joined #ruby
chabier has joined #ruby
<shevy>
"No matches."
<gregf_>
apeiros_++. never used that \A before. '\b'/'\z' for word boundaries :/
Advocation has quit [Quit: Advocation]
<Timgauthier>
They Call me the Hip-hop-ipotimus
<shevy>
damn canadians
<Timgauthier>
:O!
<shevy>
btw Canadians... it is getting damn cold here lately Timgauthier :(
<Timgauthier>
WHY? CAUSE I RAP ABOUT REALITY LIKE MY GRAM AND ME HAVING SOME TEA?
<shevy>
no - because you have a french accent
<Timgauthier>
THERE AINT NO PARTY LIKE MY GAMS TEA PARTY!
<Timgauthier>
i don't luckily
<shevy>
like Georges St-Pierre
<Timgauthier>
shevy how cold? they got like 1foot of snow last night
ponga has quit [Remote host closed the connection]
<shevy>
hmm lemme see
<Timgauthier>
30.48cm
<shevy>
right now it is 2°C in central vienna; that means border vienna should be -3 compared to that, so -1°C, and that is about the highest temperature for today, it will be awful at night + chilling wind :(
mkaesz has quit [Ping timeout: 256 seconds]
wpp has quit []
Advocation has joined #ruby
<shevy>
cool
<shevy>
we have no snow yet
mr_foobar_baz has joined #ruby
oo__ has joined #ruby
marr has joined #ruby
wpp has joined #ruby
<gaussblurinc1>
hi
<gaussblurinc1>
can I determine both (bang or not) behavior inside one method?
mr_foobar_baz has quit [Client Quit]
<gaussblurinc1>
is there any flag or function that said yes or no if method used with bang or not?
<shevy>
you mean whether the name of a method is "foo!" or "foo" ?
Spami has quit [Quit: This computer has gone to sleep]
<shevy>
not sure if you can access __method__ outside a method though ... hahaha :D
Pupeno has quit [Read error: Connection reset by peer]
ringarin has joined #ruby
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
ayaz has quit [Read error: Connection reset by peer]
xymbol_ has joined #ruby
<gaussblurinc1>
shevy: thanks!
<shevy>
\o/
ajaiswal has quit [Quit: Leaving]
<gaussblurinc1>
shevy: I want to define two methods with one body, because they are mostly the same (only one 'if' is a difference)
uber_hulk has quit [Read error: Connection reset by peer]
<gaussblurinc1>
__method__ =~ '!'
<shevy>
huh
<gaussblurinc1>
or better: __method__ =~ /!$/ (but actually the same)
<shevy>
I failed to parse that
xymbol has quit [Ping timeout: 265 seconds]
<shevy>
two methods with one body? one main method... one alias to it?
<gaussblurinc1>
bang and non-bang behavior
<gaussblurinc1>
only one if is a difference
Advocation has quit [Ping timeout: 255 seconds]
<certainty>
normally you'd build the bang version using the non-bang version (depends on your actual implementation though)
vyorkin has quit [Ping timeout: 264 seconds]
<shevy>
gaussblurinc1 well I would probably use three methods - the method that does your initial action, a second method that invokes that method, and adds that if-check, and a third method that ... uhm... not sure if it is needed
<shevy>
or determine the behaviour of your method absed on some arguments
<hanmac1>
gaussblurinc1: you dont, you define only the non-bang method, and let method missing emulate the bang one ... but if you show us more of your code, then we might able to tell you what you do wrong
workmad3 has joined #ruby
tgandrews has quit [Quit: This computer has gone to sleep]
dts is now known as dts|Zzzz
ptrrr has quit [Quit: ptrrr]
jheg has quit [Ping timeout: 258 seconds]
JCii8_ has joined #ruby
Abhijit has quit [Read error: No route to host]
jheg has joined #ruby
Abhijit has joined #ruby
Mia has joined #ruby
<gaussblurinc1>
hanmac1: only academic knowledge. I like interesting language sentences like this one. In perl you can use dual-var module for determining dual variable behaviour (string and number in one place). also, you can use wantarray() function to determine inside body of function that invocation of this function has array or scalar context.
JohnBat26 has joined #ruby
Senjai has quit [Ping timeout: 255 seconds]
Takle_ has quit []
<shevy>
oh you mentioned perl
<shevy>
that triggered eam from his beauty sleep
lemur has quit [Remote host closed the connection]
rocknrollmarc has joined #ruby
<shevy>
gaussblurinc1 for wantarray(), I assume you could simply check for object.is_a? relationship right?
byteoverfl0w has joined #ruby
lemur has joined #ruby
<shevy>
gaussblurinc1 you could also probably get extra context information from using caller() inside a method
<gaussblurinc1>
shevy: yeah, caller may help. But how you can determine wantarray() in ruby with object.is_a? invocation? wantarray usage: wantarray ? () : '' # in perl () - list, nearly the same as array in ruby, not completely
moritzschaefer has quit [Max SendQ exceeded]
banister has quit [Max SendQ exceeded]
jonr22 has joined #ruby
banister has joined #ruby
doodlehaus has joined #ruby
samuel02 has quit [Remote host closed the connection]
apeiros_ has joined #ruby
Senjai has joined #ruby
nrsk has quit [Ping timeout: 256 seconds]
charliesome has quit [Quit: zzz]
Soda has quit [Ping timeout: 265 seconds]
postmodern has quit [Quit: Leaving]
jonr22 has quit [Ping timeout: 264 seconds]
fabrice31 has quit [Remote host closed the connection]
<arup_r_>
Is there any online Regexp builder site.. Not Rubulat.. It is for testing.. I don't know how to write a bug free Regex.. :-)
<txdv>
all the week i create plans for the weekend
rocknrollmarc has quit [Read error: No route to host]
<txdv>
and then i fail to pursue them
<gaussblurinc1>
canton7: brownie?
<workmad3>
canton7: btw, there are techniques for what arup_r_ wants... but we are talking about him building a neural network, feeding it hundreds or thousands of examples of 'for this input, I want this output' strings to train it and then letting it loose :)
<txdv>
because i wake up on sunday and do nothing
chabier has joined #ruby
<workmad3>
on the whole... probably easier to just learn regexp so you can reason about them :)
<apeiros_>
txdv: take monday off
<canton7>
workmad3, yeah, I accept that you *can* generate code and regex....
<canton7>
gaussblurinc1, brownie!
<txdv>
im already taking like 12 days for december
<arup_r_>
workmad3: Yes.,. you are correct!
<txdv>
and i only have 1 vacation day
<workmad3>
canton7: heh :) note I didn't provide a mechanism for writing regexp... I provided a (more complicated) mechanism to categorise the strings so that he doesn't need a regexp ;)
<txdv>
the boss agreed to give me 3 days of working at home
<arup_r_>
Everytime I started.. I lost my energy within a minute... so I'll try again
<txdv>
still a fucking deficit of 4 months of work
<txdv>
school and university was so much better
<workmad3>
arup_r_: for me, regexp was something I learned by osmosis more than anything tbh... just too much time being unable to avoid them
<arup_r_>
workmad3: Where is your regex.. I can't see it
thsig has quit [Ping timeout: 244 seconds]
<workmad3>
arup_r_: that's because I didn't give you a regexp :P
nrsk has joined #ruby
thsig has joined #ruby
<arup_r_>
Ohh!... I was searching the validity of the line "I provided a (more complicated) mechanism to categorise the strings so that he doesn't need a regexp "
<arup_r_>
txdv: humm
Takle_ has joined #ruby
fabrice31 has joined #ruby
<txdv>
what?
thsig has quit [Remote host closed the connection]
<gaussblurinc1>
arup_r_: oh, which regexp you want?
<workmad3>
arup_r_: that was when I said you could build and train a neural network for the purposes of sorting out your string manipulation :P
<workmad3>
arup_r_: to avoid writing a regexp
thsig has joined #ruby
<workmad3>
arup_r_: basically, I was providing a 'friday answer' - technically correct, but worth about as much as code written on a friday ;)
<gaussblurinc1>
today is black friday, right? discounts on help and regex!
<arup_r_>
workmad3: Insulting.. please shut up your mouth :-) :-)
<workmad3>
arup_r_: no, I refuse!
<txdv>
why neural network?
<txdv>
Just create some AI which works for you
<arup_r_>
gaussblurinc1: I got a working from hanmac1:
tgandrews has joined #ruby
<arup_r_>
workmad3: Carry on!.. hehehehehe
Macaveli has joined #ruby
noop has quit [Ping timeout: 244 seconds]
<workmad3>
txdv: I now see how the robot apocalypse starts... we create bayesian super-intelligent AI agents, and then we insult them by getting them to do menial string manipulation for us
Takle has quit [Ping timeout: 272 seconds]
despai has quit [Quit: This computer has gone to sleep]
fantazo has joined #ruby
<txdv>
by that logic i should have killed my boss already
<workmad3>
txdv: so no wonder they create a secret underground factory, build themselves robot bodies and slaughter us all
<txdv>
Too easy for my taste
<workmad3>
txdv: it's ok, you're human... you don't need to act rationally all the time :P
Advocation has quit [Quit: Advocation]
mkaesz has joined #ruby
<gaussblurinc1>
txdv: is your boss a robot?
<hanmac1>
workmad3: no they are turned mad because they are forced to do Java-programming ;P
<workmad3>
hanmac1: :D
<txdv>
the haskell robots will kill us all
<workmad3>
hanmac1: I'm not sure which I'd prefer at the moment... java coding, or the barrel of URL manipulation I'm staring down in javascript right now...
<hanmac1>
in java you need interfaces for your interfaces and factories that does create your factories ;P#
<txdv>
hanmac1: that is not true, you can do overarchitecting with all languages
mkaesz has quit [Remote host closed the connection]
<hanmac1>
workmad3: currently i do haxe programming that does put out javascript code, that uses Jquery, do to something with a configurator or similar ... last time i wrote a Image slider in haxe
mkaesz has quit [Remote host closed the connection]
<workmad3>
txdv: I don't think hanmac1's claim was that you couldn't do over-architecturing in other languages... I think it was that in Java then you *have* to
<arup_r_>
Opps! Sorry I thought it is my IRB.. :-)
<txdv>
java people get probably paid for factories per hour
<workmad3>
txdv: yeah... their managers read the articles pointing out that kLoC/hour was a useless metric, so they started suffering in performance reviews
lemur has joined #ruby
Hobogrammer has quit [Ping timeout: 265 seconds]
<arup_r_>
hanmac1: Thank you bery much!!
<arup_r_>
very
<canton7>
I think the java-bloat thing is partially langauge, partially cultural. everyone writes bloat, all the libraries you use are bloated, so bloat feels like the natural way
<canton7>
you *can* write non-bloat in java (you have to write boilerplate, but that's different), but that *feels* wrong
arup_r_ has quit [Remote host closed the connection]
shazaum has joined #ruby
mostlybadfly has joined #ruby
charliesome has joined #ruby
moritzs has joined #ruby
fandi has joined #ruby
quimrstorres has quit [Remote host closed the connection]
Takle_ has quit [Read error: Connection reset by peer]
Takle has joined #ruby
<gaussblurinc1>
what is the smallest valid jsonish string for default ruby json parser?
<gaussblurinc1>
empty string not valid
<canton7>
emptyobject or emptyarray
<gaussblurinc1>
:(
jeanlinux has joined #ruby
<apeiros_>
string as root object is not valid json
<apeiros_>
so it's not a "for ruby json parser" thing.
thsig has quit [Read error: Connection reset by peer]
mengu has joined #ruby
SOLDIERz_ has joined #ruby
Morkel has quit [Ping timeout: 258 seconds]
Morkel_ is now known as Morkel
renderful has joined #ruby
Spami has joined #ruby
rodfersou has joined #ruby
renderful has quit [Ping timeout: 244 seconds]
quimrstorres has joined #ruby
sevenseacat has joined #ruby
quimrstorres has quit [Remote host closed the connection]
F__i__L has joined #ruby
Xeago_ has quit [Ping timeout: 264 seconds]
<F__i__L>
hello! is it possible to get a list of instance methods defined in a class without the methods from the modules that are included in that class ?
quimrstorres has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Spami has quit [Quit: This computer has gone to sleep]
<cYris212>
Could somebody pls tell me what "--deployment" in "bundle install --deployment" does?
Snowstormer has joined #ruby
NoNMaDDeN has quit [Remote host closed the connection]
abuzze_ has quit [Ping timeout: 265 seconds]
thsig has joined #ruby
<workmad3>
cYris212: it sets up bundler options that are typically recommended for deployment, such as only installing gems from Gemfile.lock, raising an error if Gemfile and Gemfile.lock are out of sync, installing into a vendored path, etc
<workmad3>
cYris212: there's probably more detail on bundler.io
<F__i__L>
hanmac1 instance_methods(false) wil alsol give me the methods returned in the included modules, right ?
<cYris212>
workmad3: thanks a lot!
<F__i__L>
so I have to substract include_modules(:&instance_methods).flatten
<hanmac1>
F__i__L: hm no instance_methods(false) also removes the one from the included modules
thsig_ has quit [Ping timeout: 240 seconds]
thsig has quit [Remote host closed the connection]
thsig has joined #ruby
spastorino has joined #ruby
mr_foobar_baz has quit [Ping timeout: 250 seconds]
NoNMaDDeN has joined #ruby
michael_mbp has quit [Excess Flood]
thsig_ has joined #ruby
arup_r has joined #ruby
Xeago_ has joined #ruby
michael_mbp has joined #ruby
shredding has quit [Quit: shredding]
lkba has joined #ruby
thsig has quit [Ping timeout: 240 seconds]
fabrice31 has quit [Remote host closed the connection]
Takle has quit [Remote host closed the connection]
Xeago has quit [Ping timeout: 264 seconds]
Prawnzy has joined #ruby
bmichelsen has quit [Quit: ZZZzzz…]
vyorkin has joined #ruby
Wapitidou has joined #ruby
arup_r has quit []
fabrice31 has joined #ruby
stoffus has quit [Ping timeout: 264 seconds]
NoNMaDDeN has quit [Remote host closed the connection]
abuzze has joined #ruby
oo__ has quit [Quit: Leaving...]
xymbol_ has quit [Quit: Be back later ...]
jottr has quit [Ping timeout: 245 seconds]
oo_ has joined #ruby
Spami has joined #ruby
lemur has quit [Remote host closed the connection]
mikestok has joined #ruby
lemur has joined #ruby
atomical has joined #ruby
chabier has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
MrSamuel has quit [Ping timeout: 245 seconds]
mikestok has quit [Client Quit]
sailias has joined #ruby
Spami has quit [Client Quit]
mkaesz has joined #ruby
sailias has quit [Client Quit]
kamilc__ has quit [Quit: Leaving...]
chabier_ has joined #ruby
chabier_ has quit [Remote host closed the connection]
chabier_ has joined #ruby
lemur has quit [Ping timeout: 258 seconds]
chabier_ has quit [Remote host closed the connection]
Takle has quit [Read error: Connection reset by peer]
Takle has joined #ruby
benzrf|offline is now known as benzrf
lkba has joined #ruby
ta has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
Kricir has quit [Remote host closed the connection]
Linuus has joined #ruby
<benzrf>
heuh
tkuchiki has joined #ruby
<benzrf>
gogs looks kinda neat but i wish they hadnt just tried to clone github's UI
<Linuus>
Some ruby libraries, such as Octokit and Twitter define all their stuff in modules and mixes in everything in their Client class. Are there any benefits of doing this over using separate classes and inheritance?
<benzrf>
cause now if i use it i'll just keep expecting it to work like github and getting annoyed at it
AndChat| has quit [Ping timeout: 258 seconds]
<benzrf>
while i might have really liked it if it were its own thing
ta has quit [Remote host closed the connection]
<shevy>
Linuus module mixins are more flexible; you can always mix in something regardless, but with subclassing, you always require one and only one direct parent alone
<workmad3>
Linuus: neither is having everything come in via inheritance though
<shevy>
well Instagram uses like only 1/3 compared to that example of octokit
<workmad3>
Linuus: both lead to bloated classes that are doing too much and difficult to work with and modify
<Linuus>
shevy: That's only because their codebase is smaller. The design is the same.
ltd has quit [Ping timeout: 264 seconds]
ltd has joined #ruby
<Linuus>
workmad3: Sure, shared stuff can be included via mixins. It just seemed weird to include everything in one class :)
mikecmpbll has joined #ruby
<shevy>
the class that handles ALL problems
<shevy>
class Universe
<Linuus>
I usually create a base class and then inherit from that when creating an API wrapper for instance. So I would have done a Base class and then Octokit::Commit < Base and so on...
ta has joined #ruby
<shevy>
yeah that is what people are doing
fandi has quit [Remote host closed the connection]
<shevy>
class MyApp < Sinatra::Base
ta has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
ta has joined #ruby
razieliyo has joined #ruby
<Linuus>
Yep. I just thought maybe there were some upsides to using the other approach that I didn't see.
DaniG2k has joined #ruby
SOLDIERz_ has quit [Quit: Be back later ...]
<Linuus>
It seems to be common among API wrappers for some reason
WormDr1nk has quit [Ping timeout: 244 seconds]
<workmad3>
Linuus: composition is preferable, IMO... for example, last time I wrote an API client, I created a class for the connection that wrapper around Faraday, a class for Authentication that took in the authentication keys and turned them into request headers appropriately, and a class for the actual client that created a connection, created an authentication and exposed methods for making requests that used tho
<workmad3>
se 2 classes
ColloquyUser has joined #ruby
enroxorz has joined #ruby
<enroxorz>
hey guys, is it good practice having an init file require files within a folder? like in python?
<Linuus>
workmad3: Yes that sounds more reasonable.
<shevy>
enroxorz that is a perfectly legit approach
anarang has quit [Quit: Leaving]
<shevy>
I do that for some autogenerated files where I can never be sure which ones will be there and which ones won't before starting
ColloquyUser has quit [Client Quit]
Hightower_ has quit [Quit: Not that there is anything wrong with that]
uber_hulk has joined #ruby
tgandrews has quit [Quit: Leaving]
<enroxorz>
thanks shevy
<shevy>
\o/
apeiros_ has quit [Remote host closed the connection]
<workmad3>
klmlfl: Person doesn't have a method 'age'
<shevy>
you call the method .age
enroxorz is now known as ArchBeOS
<shevy>
but you have not defined it
<shevy>
so how can this work man
<workmad3>
shevy: he said he doesn't understand why it doesn't work :P
<workmad3>
shevy: so he already knows it's broken, but doesn't quite understand why ;)
<shevy>
yeah I am telling him why
<klmlfl>
I feel like it should work because the value of it was passed in to initialize it.
<shevy>
why
<workmad3>
klmlfl: right... but that was stored in an instance variable
AndChat| has joined #ruby
Seich has quit [Ping timeout: 258 seconds]
tylersmith has quit [Ping timeout: 258 seconds]
<workmad3>
klmlfl: instance variables don't automatically become available via methods of the same name
<workmad3>
klmlfl: you need to create the method
<exadeci>
Hello, I got some activerecord problem I receive information about an exercise and I link it to a teacher_exercise but I can't find how to link it to the student id (using the student_login I receive) I tried with an includes but it displays the login :/ https://gist.github.com/exadeci/4629d570df6207131100
<workmad3>
exadeci: #rubyonrails
<klmlfl>
i thought any @variables are accessible
Seich has joined #ruby
<workmad3>
klmlfl: no
<workmad3>
klmlfl: the opposite :P
<klmlfl>
that's the point of putting the @there
<workmad3>
klmlfl: no, the @ makes it an instance variable rather than a local variable
Scripore has joined #ruby
<workmad3>
klmlfl: but all instance variables in ruby are private and only accessible outside the object if you write a method to expose them
<klmlfl>
i see.
<klmlfl>
so if that was just age instead of @age, i would be able to access it?
<workmad3>
klmlfl: no
<workmad3>
klmlfl: because you still wouldn't have a method
<klmlfl>
ok.
doev has joined #ruby
tylersmith has joined #ruby
<klmlfl>
ok, i understand the needing a method part to access it
<workmad3>
klmlfl: at that point, you'd have just created a local variable 'age' in the initialize method and the value would vanish afterwards
<klmlfl>
we're clear on that now
<shevy>
klmlfl it is easier by default to not expose such internal data
lkba has quit [Ping timeout: 258 seconds]
livathinos has joined #ruby
<klmlfl>
k
<shevy>
if you need that, you could use Struct or OpenStruct; there you will automatically have the method available on the data you provided
<shevy>
there... a sword with a length of 120 cm and a weight of 4.5 kg (probably not realistic...)
<workmad3>
shevy: I see no units there :P
amundj has quit [Ping timeout: 258 seconds]
<shevy>
you are excused
<shevy>
you are from the UK
<klmlfl>
what would the point be of using an local variable like age as opposed to @age
oleo__ has joined #ruby
<klmlfl>
in that example
oleo is now known as Guest89591
<klmlfl>
i can't think of one
<shevy>
workmad3 though I guess I should have used meters instead, to stick to the SI system ...
<workmad3>
klmlfl: grab it out the hash and then do some calculations on it before storing the result in an instance variable
<shevy>
but man, inches are so out of the question
<klmlfl>
k
doodlehaus has quit [Remote host closed the connection]
<workmad3>
shevy: I personally read it as 120 rods in length, and 4.5 shevies in weight
<shevy>
klmlfl you could use a local variable too
<shevy>
klmlfl I mean it all depends if you need or want to have data be persistent in your object
Guest89591 has quit [Ping timeout: 244 seconds]
<shevy>
like in the example above, with a sword
<shevy>
every sword should have a length and a weight right?
<klmlfl>
yea
<shevy>
so it would make sense to store these in an @ivar (at least the length I guess... weight can perhaps be calculcated from the length... if you know the material... probably steel or? man I am no expert on swords)
<workmad3>
klmlfl: now imagine if what you had was something like 'sword = Sword.new("120cm", "4.5kg") though
<shevy>
aha
Kricir has joined #ruby
<shevy>
now we are more clear here
<shevy>
we don't have to guess the units!
<klmlfl>
k
<shevy>
workmad3 always improves code he gets a grab onto :)
<workmad3>
klmlfl: then in the initialize method, you could easily want 'def initialize(length_str, weight_str); @length_in_cm = convert_to_cm(length_str); @weight_in_kg = convert_to_kg(weight_str); end'
<klmlfl>
i'm trying to think of A single reason
<klmlfl>
why one wouldn't use an instance variable
<klmlfl>
at all
<klmlfl>
in my code
<workmad3>
klmlfl: because you don't want or need to keep data around
<workmad3>
klmlfl: the other classic example would be needing a password for a particular operation
<klmlfl>
but for a blueprint of the object
<shevy>
klmlfl sometimes you just dump data into a temporary variable
<klmlfl>
why would one a non persistent variable
<workmad3>
klmlfl: you want to limit the amount of time the password exists in memory... storing it in an instance variable means you need to remember to clear the instance variable (or leak data)
<shevy>
my favourite one is _
<shevy>
klmlfl to break up chunks of code, for instance
<klmlfl>
i think you guys have way more experience than me. lol
<shevy>
well you will find situations where you have to use local variables
<workmad3>
klmlfl: or storing the result of a calculation halfway through
<shevy>
of course you can store in a @ivar too
<shevy>
but what is the point if you don't really need it
Vile` has quit [Quit: ...]
<workmad3>
klmlfl: you don't actually care about that result... but you want to split the calculation up into separate, more readable parts
mayday_jay has joined #ruby
<klmlfl>
i guess what im saying is
leizzer has joined #ruby
ringarin has quit [Read error: Connection reset by peer]
<workmad3>
klmlfl: so you store part of the calculation in a local variable, then continue the calculation
<klmlfl>
if i dont save age in an @ivar
<klmlfl>
how can it be used
<klmlfl>
when its instantiated
<shevy>
what is age exactly there
<workmad3>
klmlfl: in your example, you'd want to store the age (or some calculation based off the age) in an ivar, most likely
<shevy>
an @ivar right?
thsig has quit [Remote host closed the connection]
<shevy>
you could also use a CONSTANT :>
<workmad3>
klmlfl: but you started talking about general situations, so we were giving general responses ;)
<klmlfl>
so let's say I instantiated the person, initialized age
<klmlfl>
how can age (not @age) be used now
<shevy>
you mean .age
<klmlfl>
by other methods within the object?
<shevy>
you must define that method!
<klmlfl>
yes shevy
<shevy>
if you do not define the method, of course you can not use it
<shevy>
and you don't have many options to store data
<shevy>
I mean you have @ivars
<shevy>
what else would you need
<workmad3>
klmlfl: btw, when we say 'define the method age', we mean in the simplest term, 'def age; @age; end'
<shevy>
you could use a $var
<klmlfl>
got it
<shevy>
but then why would you want to use a class anyway
<workmad3>
klmlfl: you have a method called 'age' that returns the value of the @ivar @age
<klmlfl>
if i dont save it in an @ivar , just a regular local variable
<shevy>
it won't be persistent if it is local
<klmlfl>
it be accessed by the other methods within the instantiated object, right?
<workmad3>
klmlfl: then you'd lose access to it outside of that local scope
<workmad3>
klmlfl: no
<workmad3>
klmlfl: local variables are scoped to the method they're created in
ringarin has joined #ruby
<workmad3>
klmlfl: @ivars are scoped to the object they're created in
<shevy>
klmlfl it is so local that it is superlocal to the method it was localized
<klmlfl>
oh, right right.
<klmlfl>
i knew that.
<klmlfl>
brain fart
noop has quit [Quit: Leaving]
<workmad3>
klmlfl: heh :)
<shevy>
the name indicates that
chris613 has joined #ruby
<shevy>
l-o-c-a-l variable
Guest56870 has quit [Ping timeout: 258 seconds]
eind has quit [Remote host closed the connection]
<shevy>
unlike a
<shevy>
g-l-o-b-a-l variable
<workmad3>
shevy: hey, it's hard to be a newbie on a friday, give him a break ;)
<shevy>
I am having way too much fun
<chris613>
Is it correct to nest another begin/rescue if my ensure block might also throw exceptions?
lmickh has joined #ruby
<workmad3>
(or not... it's kinda funny seeing you do the text equivalent of speaking slowly :D )
<klmlfl>
thanks shevy, making it a great experience to ask questions on here ;)
<shevy>
well he'll remember it the next time he says "local variable"
<shevy>
l-oooooooo-c-a-l
<shevy>
hmm
<klmlfl>
I understand.
<shevy>
loooooocal :D
<workmad3>
bah, why does generating a 4096 bit diffie-helman parameters file take so bloody long? :(
<klmlfl>
I was thinking of a variable outside of the method.
<shevy>
klmlfl yes! an @ivar!
apoorvparijat has joined #ruby
<klmlfl>
if that variable wasn't an instance variable
<workmad3>
shevy: or a local variable in the class body ;)
<workmad3>
klmlfl: the problem you have then is that 'age' is a local variable there, and 'def' stops you from accessing local variables from outside its scope
<shevy>
there really aren't that many options if you think about it
<klmlfl>
that variable could be accessed by methods within the class
apoorvparijat has quit [Client Quit]
<workmad3>
klmlfl: no it couldn't... see my previous statement ;)
C0deMaver1ck has joined #ruby
<shevy>
klmlfl how?
apoorvparijat has joined #ruby
C0deMaver1ck is now known as Guest15281
<klmlfl>
shevy: i appreciate your help, but a word of advice, teaching isn't a matter of forcing something onto someones brain.
<klmlfl>
because learning is about absorbing at ones own pace ;)
huddy has joined #ruby
<shevy>
ah but your brain still believes that class Foo; bla = 5; end must work
<workmad3>
klmlfl: 'def foobar; <this scope can't access local variables from outside it>; end'
<klmlfl>
I think your brain thinks that's why my brain thinks.
<shevy>
<klmlfl> that variable could be accessed by methods within the class
FooMunki has quit [Quit: FooMunki]
<workmad3>
shevy: before you go completely OTT, remember that there *are* ways you could make that work in ruby ;)
<shevy>
show me!
Seich has quit [Ping timeout: 258 seconds]
<workmad3>
shevy: e.g. 'class Foo; bar = 5; define_method :fizz {bar}; end'
<shevy>
olivier_bK was there a question in your sentence?
<klmlfl>
They should be accessible within the methods, meaning I think magic that happens in a method can alter their values if needed, and at least access them
<shevy>
magic happens :)
<workmad3>
klmlfl: ok, so you think that instance methods of a class have access to the local scope of the class body
mikecmpbll has joined #ruby
<workmad3>
klmlfl: now, write some code that shows that this is the case
<klmlfl>
Yes
<workmad3>
klmlfl: or demonstrates that it isn't
<klmlfl>
ok
<klmlfl>
give me a minute, I'll be right back.
<workmad3>
klmlfl: np ;)
kapil__ has quit [Quit: Connection closed for inactivity]
bestie has joined #ruby
<workmad3>
I need coffee anyway :)
wald0 has joined #ruby
existensil has joined #ruby
doodlehaus has joined #ruby
oleo__ has quit [Quit: Verlassend]
Xeago_ has quit [Ping timeout: 250 seconds]
hexxx has joined #ruby
vyorkin has quit [Ping timeout: 240 seconds]
livathinos has quit [Remote host closed the connection]
drkyro has joined #ruby
hexxx has left #ruby [#ruby]
fabrice31 has quit [Remote host closed the connection]
<workmad3>
klmlfl: right... but does the second one print out 'Hello' or 'nil'?
Axy has joined #ruby
<klmlfl>
nil
<workmad3>
klmlfl: ok... so what can you conclude?
<klmlfl>
i dont know
mikecmpbll has joined #ruby
<workmad3>
klmlfl: well, for starters you can conclude that instance variables aren't local variables, I'd hope ;)
<klmlfl>
i can't get it to print hello at all
<shevy>
olivier_bK you need to show the code that leads to the error you described
<klmlfl>
yes, i got that.
Beoran_ has quit [Ping timeout: 250 seconds]
karmatr0n has quit [Remote host closed the connection]
<klmlfl>
what was strange to me though
Mia has quit [Ping timeout: 255 seconds]
<klmlfl>
on the second example
<workmad3>
klmlfl: secondly, you can conclude that you can't access 'var' from inside the method definition
<klmlfl>
i didnt declare var as an @ivar
<klmlfl>
but in the method i did
<klmlfl>
i did access as it as an @ivar **
<workmad3>
klmlfl: 'def' doesn't give you access to the local scope you write it in
<benzrf>
>mfw methods are not closures
roolo has joined #ruby
<shevy>
yeah workmad3 I was being dumb and forgot .new ... works fine now -> class Foo; bar = 5; define_method(:foo) {bar}; end; Foo.new.foo
oleo has joined #ruby
FooMunki has joined #ruby
<workmad3>
benzrf: I was about to use that as the way to introduce the concept of a closure ;)
<workmad3>
benzrf: but you can do that now :P
<klmlfl>
How can I get it to print Hello
<klmlfl>
..
jonr22 has joined #ruby
mikepack has joined #ruby
<klmlfl>
How can I get a method to access var
<klmlfl>
any way possible
<klmlfl>
?
ponga has joined #ruby
<workmad3>
klmlfl: ok, as benzrf just said, a method defined with 'def' is not what's called a 'closure'
ponga has quit [Changing host]
ponga has joined #ruby
karmatr0_ has joined #ruby
<workmad3>
klmlfl: a 'closure' is a technical way of saying "Has access to its surrounding scope" (in some sense)
Xeago_ has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
sevenseacat has quit [Remote host closed the connection]
alex88 has quit []
<workmad3>
klmlfl: so, if you were paying attention to the back-and-forth between myself and shevy, you may have noticed me point out a way to define a method that *is* a closure
<workmad3>
klmlfl: using 'define_method'
Axy has quit [Ping timeout: 255 seconds]
<klmlfl>
ok
dangerousdave has joined #ruby
<klmlfl>
so is the simple answer that a variable outside of a method can't be accessed?
patrick99e99 has joined #ruby
<klmlfl>
regardless of whether its a @ivar or not
<klmlfl>
because that's what it seems like to me.
agjacome has quit [Quit: leaving]
apope has joined #ruby
ndrei has quit [Ping timeout: 258 seconds]
<klmlfl>
I tried to access var (or @var) within the method definition to puts it
<klmlfl>
but the best i got was nil.
<workmad3>
klmlfl: ok, so the next thing for you to check quickly... what is 'self' both inside and outside the method?
<klmlfl>
k
<workmad3>
klmlfl: first - what's your intuition?
<klmlfl>
hm.
Scripore has quit [Ping timeout: 258 seconds]
mikepack has quit [Ping timeout: 256 seconds]
FooMunki has quit [Quit: FooMunki]
DaniG2k has quit [Ping timeout: 244 seconds]
NoNMaDDeN has quit [Remote host closed the connection]
Xeago has quit [Ping timeout: 272 seconds]
<klmlfl>
I don't know. All I know is I think that's part of the solution because of how you presented it
<klmlfl>
lol
<klmlfl>
self refers to the object
<klmlfl>
so..
atomical has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
konsolebox has joined #ruby
<workmad3>
klmlfl: ok... so what changes with 'self' when you're inside and outside the object?
<klmlfl>
self.var refers to the particular objects variable
<workmad3>
klmlfl: no... 'self.var' calls the method 'var' on 'self'
<klmlfl>
var isn't a method
<workmad3>
s/inside and outside the method'
samuel02 has quit [Remote host closed the connection]
<workmad3>
klmlfl: when you do 'self.var' you're calling a method though ;)
<workmad3>
klmlfl: which should give you a hint why your first attempt with Person.new.age wasn't working ;)
<klmlfl>
what if var is nothing more than "string"
jenrzzz has quit [Ping timeout: 240 seconds]
<klmlfl>
so self.var
<klmlfl>
does that puts it
<klmlfl>
print it
<klmlfl>
or something else it
<workmad3>
klmlfl: no... you can't do 'self.var' unless you've defined a *method* var
<workmad3>
klmlfl: and that's also not actually what I was asking
olivier_bK has quit [Ping timeout: 244 seconds]
<klmlfl>
oh okay
jottr has joined #ruby
<workmad3>
klmlfl: what do you think the value of *self* is when you're inside the method compared to outside the method in your code
shazaum has quit [Quit: Leaving]
<workmad3>
klmlfl: e.g. 'class Person; self <-- what is self here?; def foo; self <-- what is self here?; end; end'
<klmlfl>
oh okay
ikaros has quit [Quit: Ex-Chat]
Guest15281 has quit [Ping timeout: 258 seconds]
<klmlfl>
my intuition: the first self refers to the object
bracky_ has joined #ruby
NoNMaDDeN has joined #ruby
<workmad3>
klmlfl: the 'self' outside the method definition?
FooMunki has joined #ruby
<klmlfl>
yes
<workmad3>
klmlfl: ok... your intuition is leading you astray
<klmlfl>
ok
<workmad3>
klmlfl: 'self' outside the method is the *class*
C0deMaver1ck_ has joined #ruby
<workmad3>
klmlfl: 'self' inside an instance method is the object you called the method on
freerobby has joined #ruby
tvw has joined #ruby
bracky has quit [Ping timeout: 265 seconds]
jottr has quit [Ping timeout: 264 seconds]
karmatr0_ has quit [Remote host closed the connection]
bracky_ has quit [Ping timeout: 240 seconds]
krz has quit [Quit: WeeChat 1.0.1]
mikepack has joined #ruby
shazaum has joined #ruby
chabier has joined #ruby
<workmad3>
klmlfl: i.e. the context of your code changes when you're inside and outside the method definition... outside, the code is running on a class, inside the code is running on an instance... so @ivars, which we already stated are automatically private to an object, can't be accessed directly when they're declared outside method and referenced inside a method
<workmad3>
klmlfl: but you *could* access an ivar that you set in one method and use in another method
eind has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<workmad3>
klmlfl: e.g. you could write an initialze method that sets an ivar, and another method that returns the value of that ivar
<workmad3>
*initialize
mary5030 has joined #ruby
Takle has quit [Read error: Connection reset by peer]
_ixti_ has joined #ruby
<klmlfl>
Ok that makes sense.
Takle has joined #ruby
jbueza has joined #ruby
<workmad3>
klmlfl: now, local variables work slightly differently... they can only be accessed from within the scope they were defined in
<klmlfl>
I dont seem to have a problem understanding local variables - the variables inside of methods)
eind has quit [Remote host closed the connection]
<workmad3>
klmlfl: and you can think of a scope, for now, as the code between 'class ... end', 'module ... end' and 'def ... end' (all of which create new scopes)
<klmlfl>
They are very limited
<workmad3>
klmlfl: so 'class Foobar; var = "hello" <-- that's a local variable; end'
ixti has quit [Ping timeout: 245 seconds]
<workmad3>
klmlfl: so you can only access 'var' from inside the same scope
<klmlfl>
from the class
<klmlfl>
not from an object of the class
<workmad3>
klmlfl: the other important bit about 'def', 'class' and 'module' is that they *remove* your access to the outside local variable scope
chabier has quit [Ping timeout: 272 seconds]
<klmlfl>
right?
<klmlfl>
or from a method within the class
<workmad3>
klmlfl: so when you write 'def', all the code up until its closing 'end' can't access local variables from outside it
<workmad3>
klmlfl: what's important for local variables is scopes, not objects and classes ;)
<workmad3>
klmlfl: hence why I changed the terminology
<klmlfl>
Ok I got it.
doev has quit [Quit: Verlassend]
einarj has quit [Remote host closed the connection]
<workmad3>
klmlfl: it's important, because if you write some code that re-opens a class, e.g. 'class Foo; var = "hello"; end; class Foo; var <-- Local variable doesn't exist here; end'
<workmad3>
klmlfl: so even though when you did 'class Foo' for the second time you were working with the same class, the scope has changed
<klmlfl>
so a variable outside of a method definition cannot access any of the code inside of the method, variables and such.
<workmad3>
klmlfl: correct
mary5030 has quit [Remote host closed the connection]
apope has quit [Quit: apope]
<workmad3>
klmlfl: and code inside a method (written with 'def') also can't access local variables from outside it
<klmlfl>
got it.
mary5030 has joined #ruby
silkfox has quit [Ping timeout: 256 seconds]
Vile` has joined #ruby
<workmad3>
klmlfl: also, when you do 'some_object.something', 'something' there is *always* a method call, never something else (so it's not accessing an instance variable, not accessing a local variable... it's only a method call)
sdwrage has joined #ruby
<workmad3>
klmlfl: so, with all of that information and explanation, do you think you could redo your original non-working code and get it to work? :)
<klmlfl>
see..
<klmlfl>
I thought .something could be a method (whatever is returned from a method) or a variable.
<ericwood>
ivar access like that is just a method call
<klmlfl>
Yea, I could.
<ericwood>
attr_accessor and its ilk are syntactic sugar for getter/setter methods for ivars :D
mary5030_ has joined #ruby
eind has joined #ruby
<workmad3>
ericwood: heh :) I was going to mention attr_accessor and its ilk after he got working code :P
lolmaus has quit [Quit: Konversation terminated!]
apeiros_ has joined #ruby
<ericwood>
oops did I ruin it
<workmad3>
ericwood: not quite yet ;)
atomical has joined #ruby
mary5030 has quit [Ping timeout: 258 seconds]
<ericwood>
make 'em write java so they understand how good they have it with this syntactic sugar :D
silkfox has joined #ruby
<ericwood>
"you tellin me I don't have to write 1000 lines to make that happen?!"
apeiros_ has quit [Read error: Connection reset by peer]
apope has joined #ruby
<workmad3>
ericwood: I'm pretty sure that violates several international human rights treaties...
<workmad3>
ericwood: it may even make you susceptible to charges of war crimes...
apeiros_ has joined #ruby
<ericwood>
I hate java so much, but it did put hair on my chest
<workmad3>
:)
lolmaus has joined #ruby
<workmad3>
ericwood: tbh, I don't mind java itself too much... it's a bit verbose and annoying, but it's not too bad
<workmad3>
ericwood: what I dislike is the J2EE ecosystem and the boilerplate and crap and hoops you have to deal with to get even the simplest crap working there
mayday_jay has quit [Quit: c ya!]
jonr2219 has joined #ruby
<workmad3>
ericwood: oh, and the over-reliance on inheritance in most java architectures and frameworks... lets not forget about that :)
<ericwood>
overall it didn't make me happy so I was like "naaaaaaaaahhhhh"
<ericwood>
and now i write ruby all dayyyyy
<ericwood>
errydayyyy
chabier has joined #ruby
<workmad3>
yeah, it doesn't make me happy if I hear 'you have to write some java'
<ziggles>
Whoops... that was for Ruby 1.9.2... but the same doc page exists for 2.1.5
<ziggles>
thanks a ton
<apeiros_>
ruby version doesn't really matter
<apeiros_>
rubygems is versioned separately
tastycode has quit [Ping timeout: 250 seconds]
<ziggles>
@apeiros_ well it kind of does... If you look @ the source there's a comment saying the dir should be deprecated
<ziggles>
so that's good to know i guess lol
<rpag>
data/<your gem name>/ seems to be the convention there
<apeiros_>
iirc drbrain said the method should be deprecated, not the dir.
<apeiros_>
but the way it's structured is annoying
spacemud has quit [Ping timeout: 250 seconds]
tastycode has joined #ruby
<ziggles>
@apeiros_ ah yeah, that's correct. I misinterpreted the comment
iamjarvo_ has quit [Read error: Connection reset by peer]
iamjarvo_ has joined #ruby
boombadaroomba has quit [Ping timeout: 264 seconds]
spacemud has joined #ruby
<ziggles>
apeiros_ / rpag do you know how i should be calling the data dir from within my gem? Currently i've been getting at my bin files via joining on the root
<ziggles>
something like this: gem_root = Gem::Specification.find_by_name('my_gem')
vyorkin has joined #ruby
iamjarv__ has joined #ruby
ldnunes has quit [Quit: Leaving]
shazaum has quit [Quit: This computer has gone to sleep]
iamjarv__ has quit [Max SendQ exceeded]
<ziggles>
then getting at data or bin i would end up with `.bin = File.join(gem_root, 'bin')`
bogeyd6 has quit [Quit: Leaving]
iamjarv__ has joined #ruby
dangerousdave has joined #ruby
<rpag>
Gem.datadir('mygem') should work, but thats deprecated (apparently?) and couples you to rubygems.
iamjarv__ has quit [Max SendQ exceeded]
iamjarv__ has joined #ruby
apoorvparijat has joined #ruby
iamjarv__ has quit [Max SendQ exceeded]
jaequery has joined #ruby
anaeem1_ has joined #ruby
samuel02 has joined #ruby
<rpag>
if you're at lib/mygem.rb, DATA_DIR = File.join(__dir__, '..', 'data', 'mygem') should also work
ldnunes has joined #ruby
iamjarvo_ has quit [Ping timeout: 244 seconds]
<rpag>
ruby2+ for __dir__
<apeiros_>
rpag: no
<apeiros_>
you can't rely on your gem structure staying together
<apeiros_>
ziggles: use the Gem.datadir, even if it's marked to be deprecated.
<apeiros_>
rpag: because gem makes no guarantee to retain the structure.
<apeiros_>
it could store the lib, bin and datadir in separate places.
<rpag>
does it though, in practice?
<apeiros_>
note: I'm not aware of this happening anywhere. but it's needless coupling anyway.
apoorvparijat has quit [Ping timeout: 240 seconds]
asmodlol has joined #ruby
jimms has joined #ruby
chrishough has joined #ruby
<rpag>
it just assumes __dir__ will be relative to lib/mygem.rb, i haven't seen that not be the case
last_staff has joined #ruby
quimrstorres has quit [Remote host closed the connection]
<apeiros_>
yes. and you don't need to do that. don't use bad design principles if you don't have to.
samuel02 has quit [Ping timeout: 250 seconds]
<apeiros_>
you can go entirely without any assumption. so why would you choose to make one?
nanashiRei has quit [Ping timeout: 264 seconds]
asmodlol has quit [Client Quit]
nastri has quit [Read error: Connection reset by peer]
inkblots_ has quit [Quit: WeeChat 0.4.2]
ruby-issues has joined #ruby
jeanlinux has joined #ruby
<rpag>
i don't think its a bad assumption to make, your coupled to relatively (lib/../data will always be there), or coupled to rubygems + Gem.datadir.
<rpag>
relativity*
ArchBeOS has quit [Quit: Page closed]
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jottr_ has quit [Ping timeout: 255 seconds]
<ruby-issues>
Hi, im having an syntax issue i cant quite figure out. Is anyone able to help? http://paste.ee/p/kSzg1
chabier has joined #ruby
<rpag>
ruby-issues, you're trying to use interpolation on a single quoted string
<apeiros_>
rpag: *an assumption* vs *no assumption*. you already lost.
<apeiros_>
I don't see how we're even debating this.
iamjarvo_ has joined #ruby
wald0 has quit [Quit: Lost terminal]
<apeiros_>
well, actually I'm not anymore. if you want make bad design decisions, go ahead. you've been told.
p8952 has joined #ruby
<ruby-issues>
rpag: i am?
<rpag>
apeiros, *shrug*, totally subjective, i don't see it as a bad design decision
adriancb has joined #ruby
mloveless has quit [Remote host closed the connection]
<apeiros_>
tbh, you've to be quite blind to not see it.
<ruby-issues>
rpag: the only part in single quotes is the require 'open-uri'
Vile` has quit [Ping timeout: 240 seconds]
<rpag>
ruby-issues, sorry, you're not
jbueza has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ruby-issues>
seems im losing the output after the ampersand
<rpag>
oh i see
<rpag>
try line.chomp
<rpag>
its inserting a newline in there
jeanlinux has quit [Ping timeout: 264 seconds]
adriancb has quit [Remote host closed the connection]
<ruby-issues>
im very new, can you give me a little more ?
<rpag>
"line" is something like "CloudServer\n".
moritzs has joined #ruby
ponga has quit [Quit: Leaving...]
Vile` has joined #ruby
tastycode has quit [Ping timeout: 240 seconds]
tastycode_ has joined #ruby
jbueza has joined #ruby
<ruby-issues>
rpag: so like |line\n|
iamjarvo_ has quit [Ping timeout: 264 seconds]
<rpag>
that'd be a syntax error, but if you mean line embeds a newline(\n), then yeah
adriancb has joined #ruby
iamjarvo_ has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
arup_r has quit [Quit: Leaving.]
<rpag>
try 'p line' and you should see the problem
Scripore has quit [Ping timeout: 272 seconds]
rylev has joined #ruby
rylev has quit [Remote host closed the connection]
<ruby-issues>
rpag: ill have to look up what you mean
nanashiRei has joined #ruby
<rpag>
before L6, add 'p line', it will show you the raw string
<ruby-issues>
with single quotes?
<rpag>
on L5, you may as well use #each, since you don't do anything with the return value of .map
<rpag>
without single quotes
ghr has joined #ruby
chabier has quit [Remote host closed the connection]
rodfersou has quit [Remote host closed the connection]
rkalfane has joined #ruby
bayed has quit [Quit: Connection closed for inactivity]
fabrice31 has joined #ruby
bonhoeffer has joined #ruby
ghr has quit [Ping timeout: 258 seconds]
SCHAAP137 has joined #ruby
dcunit3d has quit [Ping timeout: 265 seconds]
<ruby-issues>
the p line didnt show any different output
<bot12>
shevy: eh, the point of all this is that I am using sass and the libsass isn't ready yet (no full map support)
chabier has joined #ruby
<bot12>
and I want to speed up compilation
<shevy>
I wonder if they discount startup time
jonr22 has quit [Remote host closed the connection]
<bot12>
as all rubies should support the features required by sass, I could use another one - in the hope that it is faster then.
kamoh has joined #ruby
kyoshero has quit [Max SendQ exceeded]
<bot12>
or can I tweak mri ruby somehow?
<shevy>
oh jump down to "Recent benchmarks put JRuby in the lead, followed by MagLev, Rubinius, then MRI." on the stackoverflow page
<bot12>
oh
<bot12>
hehe, let's jump the bandwagon
<headius>
jruby should be faster than the other impls on just about everything, but it takes a bit of warmup to get there
mkaesz has quit [Remote host closed the connection]
kyoshero has joined #ruby
<bot12>
and what is the difference between jruby-1.7. and jruby-9000 ?
<bot12>
I mean 9000 is quite a version hop, isn't it?
despai has quit [Quit: This computer has gone to sleep]
mkaesz has joined #ruby
<headius>
9000 introduces a new execution runtime, new encoding and IO subsystem, and jumps to 2.2 compatibility
whoisjake has joined #ruby
<bot12>
so 9000 is newer and faster
<bot12>
, right?
jonr22 has joined #ruby
<shevy>
and free cookies
zybi1 has quit [Remote host closed the connection]
<headius>
right now we're finishing up compatibility and stability, but yes, it should get much faster than earlier versions over the next several months
<bot12>
cool
ziggles has quit []
<bot12>
it also got some nooooode fanciness? I mean callback hell and all those goodies?
* bot12
wants to be faaaaaaancy
<bot12>
headius: is +graal the bleeding edge/nightly thing?
<bot12>
I mean, both are dev though
whoisjake has quit [Client Quit]
elegant has left #ruby [#ruby]
<headius>
truffle/graal is experimental/research work so don't look for that soon...they're focusing exclusively on how fast they can make things in the ideal case
<headius>
while still supporting all Ruby features
<apeiros>
and how fast can they make it in the ideal case? :)
<bot12>
headius: but if it runs and sass compiles everything with that graal thing I could use that safely?
<bot12>
apeiros: ruby mascot will come out of your box and abuse you
<apeiros>
bot12: not a funny joke. please refrain.
<bot12>
:)
<bot12>
what mascot got ruby btw
mkaesz has quit [Ping timeout: 240 seconds]
<shevy>
a ruby
<apeiros>
there's that girl
<zacts>
bot12: um a ruby ;-P
<shevy>
bot12 don't let apeiros distract you with promises of pretty girls - it's just a ruby :(
<shevy>
but it is shiny
<zacts>
shevy: lol
<headius>
bot12: perhaps...it runs a fair amount. You should talk to chrisseaton in #jruby about it, he's leading that side of things
<apeiros>
ruby-chan, right
<zacts>
ruby my dear
Takle has quit [Remote host closed the connection]
<shevy>
we should push for a fitting mascot for ruby :\
<bot12>
headius: I will try that now!
<rpag>
i know, japan invented anime, you would think we'd have something awesome
<shevy>
yeah
<shevy>
but pls no sailor moon identity
<shevy>
or those dragonball maniacs
<zacts>
shevy: I like cowboy bebop
<shevy>
I don't even know what that is sorry :D
<wasamasa>
you guys
<bot12>
apeiros: I refrain. What refrain should I sing now? :D
<shevy>
but isn't that a song from the hansens?
<wasamasa>
please don't turn wapanese
<wasamasa>
kthx
<zacts>
shevy: let me find a link. It was a series on cartoon network's adult swim
<apeiros>
bot12: dude, you're on thin ice. stop it.
<zacts>
well you can google it if you want
Photism has joined #ruby
<zacts>
it's like an urban gangster space city bebop jazz kind of setting
giuseppesolinas has joined #ruby
<bot12>
ohh :(
bot12 has left #ruby [#ruby]
silkfox has quit [Ping timeout: 255 seconds]
kamoh has quit [Remote host closed the connection]
<zacts>
there are a few episodes for free on cartoon network's homepage
user_02 has joined #ruby
charliesome has joined #ruby
<user_02>
hey. i am trying to activate budget plugin (https://github.com/edavis10/redmine-budget-plugin) which also requires rate plugin (https://github.com/edavis10/redmine_rate). I place the folders on /plugins but when i restart redmine i get “ERROR: The Rate plugin is not installed. Please install the Rate plugin from …”. Has anyone tried this? Any other budgeting plugins you recommend?
<zenspider_>
user_02: this _really_ isn't a ruby question. We'd be happy to help you out with a ruby specific issue, but this ain't the right place for this question
freerobby has joined #ruby
stormbytes has left #ruby [#ruby]
<shevy>
jhass now you made me curious what ##c will say about apache
leizzer has quit [Ping timeout: 240 seconds]
<rpag>
they would say, go to #apache
<jhass>
shevy: shall we find out? you have to ask the question though
<zenspider_>
user_02: the problem you have is here: /usr/share/redmine/plugins/redmine_rate/init.rb:4 -- you'll have to debug it on your own or get help from #redmine
<shevy>
jhass they have a defence wall - I got redirected to ##c-unregistered :(
jottr_ has joined #ruby
<jhass>
oO you're not registered?
iamjarvo_ has quit [Ping timeout: 250 seconds]
<zenspider_>
one of us
iamjarvo_ has joined #ruby
jerius has joined #ruby
iamjarvo_ has quit [Max SendQ exceeded]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
iamjarvo_ has joined #ruby
<shevy>
long live the underground!
<zenspider_>
hah
zenspider_ is now known as zenspider
despai has quit [Quit: This computer has gone to sleep]
kiyote23_ has quit [Remote host closed the connection]
centrx has joined #ruby
blackmesa has joined #ruby
Xeago_ has joined #ruby
dts is now known as Sargon_
Sargon_ is now known as dts
davedev24_ has quit [Ping timeout: 264 seconds]
leizzer has quit [Client Quit]
thsig has joined #ruby
davedev24_ has joined #ruby
Xeago has quit [Ping timeout: 264 seconds]
ghr has joined #ruby
benzrf is now known as benzrf|offline
MattB2_ has joined #ruby
agrinb has joined #ruby
thsig has quit [Ping timeout: 258 seconds]
kiyote23 has joined #ruby
nkumari has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
claw has joined #ruby
ghr has quit [Ping timeout: 265 seconds]
<shevy>
if I have a file like foo.rb and just one def there: def foo; puts 'hi from foo'; end ... no namespaces. Is there a simple way to load and attach this into a module?
MattB2 has quit [Ping timeout: 264 seconds]
<rpag>
module Foo; binding.eval File.read('foo.rb'); end
<claw>
https://eval.in/228075 Shouldn't line 4 (Conditional Assignment) only apply if options[:something].nil? ?
<claw>
im confused
<shevy>
rpag aha interesting, let me think
<claw>
oh i guess its nil or false for conditional assingment
<zenspider>
hrm... it's kinda sad that Kernel.load has the wrap param but still returns true and not the anonymous module it creates
dcunit3d has quit [Ping timeout: 240 seconds]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
banister has joined #ruby
gtrak has quit [Read error: Connection reset by peer]
claymore has quit [Quit: Leaving]
codecop has quit [Remote host closed the connection]
m8 has quit [Quit: Sto andando via]
lemur has joined #ruby
<centrx>
claw, nil and false are both "falsey"
bonhoeffer has joined #ruby
adriancb has joined #ruby
<shevy>
rpag that is a neat trick
ItSANgo has quit [Quit: Leaving...]
<claw>
okay that bad for what im trying the archive with boolean options here. ill use options[:something] = true if options[:something].nil?
Guest1882 has joined #ruby
<centrx>
claw, yes, or options.has_key?(:something)
beilabs___ has joined #ruby
jaequery has joined #ruby
despai has joined #ruby
beilabs__ has quit [Ping timeout: 255 seconds]
samuel02 has joined #ruby
silkfox has joined #ruby
reinaldob has quit [Remote host closed the connection]
agrinb has quit [Remote host closed the connection]
<banister>
rpag what was your trick
<banister>
that shevy is talking about
agrinb has joined #ruby
josephndenton has joined #ruby
Pumukel has quit [Quit: ChatZilla 0.9.91 [Firefox 33.1/20141106120505]]
iamjarvo_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pietr0 has joined #ruby
kiyote23 has quit [Remote host closed the connection]
nkumari has joined #ruby
spastorino has quit [Quit: Connection closed for inactivity]
<rpag>
module Foo; binding.eval File.read('foo.rb'); end
kiyote23 has joined #ruby
josephndenton has quit [Ping timeout: 264 seconds]
pietr0 has quit [Client Quit]
claptor has joined #ruby
Lingo_ has quit [Quit: (null)]
kirun has quit [Quit: Client exiting]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
acmehandle has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
klmlfl has quit [Remote host closed the connection]
boombadaroomba has joined #ruby
kiyote23 has quit [Remote host closed the connection]
Wapitidou has quit [Quit: WeeChat 1.0]
sptx00 has joined #ruby
<jidar>
is there some way to inspect variables in irb?
<jidar>
or perhaps something a little more similar to how you can tab complete methods/properties
<jhass>
jidar: just type its name and press enter
kiyote23 has joined #ruby
<jhass>
also have a look at pry for a more powerful repl
startupality has quit [Quit: startupality]
<jidar>
there we go
<jidar>
pry is totally what I was looking for, thanks.
boombadaroomba has quit [Ping timeout: 258 seconds]
Scripore has joined #ruby
fabrice31 has joined #ruby
agrinb has quit [Remote host closed the connection]
samuel02 has quit [Remote host closed the connection]
kireevco has joined #ruby
cleopatra has joined #ruby
davedev24_ has quit [Ping timeout: 265 seconds]
apoorvparijat has joined #ruby
benzrf|offline is now known as benzrf
kiyote23 has quit [Remote host closed the connection]
davedev24_ has joined #ruby
<shevy>
rpag I guess if I use @instance variables, they won't work when included into a class?
<shevy>
oh nevermind
<rpag>
shevy, as long as they're defined in instance methods they will
fabrice31 has quit [Ping timeout: 256 seconds]
ht__th has quit [Read error: Connection reset by peer]
<shevy>
it works, I was just calling the wrong method
<shevy>
foo = Foo.new; foo.foo can become confusing if you want to call foo.bar
dangerousdave has joined #ruby
dangerousdave has quit [Client Quit]
kiyote23 has joined #ruby
nkumari has quit [Remote host closed the connection]
mloveless has quit [Ping timeout: 240 seconds]
siwica1 has joined #ruby
mkaesz has joined #ruby
apoorvparijat has quit [Ping timeout: 250 seconds]
siwica has quit [Ping timeout: 258 seconds]
jbueza has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
r0bby_ has joined #ruby
mloveless has joined #ruby
Soda has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 256 seconds]
cleopatra has quit [Remote host closed the connection]
hydrozen has joined #ruby
nkumari has joined #ruby
davedev24_ has quit [Read error: Connection reset by peer]
Narzew has quit [Quit: Wychodzi]
davedev24_ has joined #ruby
mkaesz has quit [Ping timeout: 258 seconds]
user_02 has quit [Quit: user_02]
<hydrozen>
Hey, is there a way to configure rubygems to not download release candidates / betas when doing `gem update`?
chrishough has joined #ruby
davedev24_ has quit [Read error: Connection reset by peer]
banister has joined #ruby
davedev24_ has joined #ruby
chrishough has quit [Remote host closed the connection]
chrishough has joined #ruby
tgandrews has quit [Quit: This computer has gone to sleep]