<joesavage>
egon1: Using "eval" is never great practice either, so I'm guessing that's contributing to the massive annoyance of this problem, but I can't think of any other way to do this..
jimg has joined #ruby
jdunck has quit [Quit: Computer has gone to sleep.]
circ-user-IN26m has joined #ruby
louism2_ has left #ruby ["Leaving"]
anderson has quit [Ping timeout: 245 seconds]
F1skr has quit [Quit: WeeChat 0.4.1]
<circ-user-IN26m>
Hey all. I'm trying to setup logging for when a method is entered and then when it is exited. Is that possible?
<sn0wb1rdz>
Yeah. the hex number in the inspect seems to be the memory offset.
<Spooner>
At least in CRuby, it seems, __id__ is half the memory address for proper objects.
<Xeago>
I think that is the way ruby has objects
wmoxam has joined #ruby
Mattix has quit [Ping timeout: 240 seconds]
<Xeago>
the first bit is for value/reference stuff iirc
<Xeago>
so it <<1 all values otherwise displayed
<Xeago>
hence the times 2
<Spooner>
Makes sense.
<Xeago>
or soemthing along those lines
Michael has joined #ruby
<Xeago>
or division by 2, depending on how you look at it
brotatos has joined #ruby
<sn0wb1rdz>
eval-in_ that works
bean__ has joined #ruby
<Spooner>
But really, they are both only guaranteed to be unique identifiers. Implementation dependent what they actually will be.
Michael is now known as Guest12067
banjara has quit [Quit: Leaving.]
devoldmx3 has joined #ruby
JStoker has joined #ruby
devoldmx has quit [Ping timeout: 245 seconds]
Andreo__ has quit [Read error: Connection reset by peer]
Inoperable has quit [Quit: Coyote finally caught me]
aces1up has joined #ruby
nowthatsamatt has joined #ruby
slainer68 has quit [Remote host closed the connection]
tomzx_mac_ has joined #ruby
tomzx_mac has quit [Ping timeout: 245 seconds]
pipework has quit [Remote host closed the connection]
aces1up23 has quit [Ping timeout: 260 seconds]
freerobby has joined #ruby
reset has quit [Ping timeout: 252 seconds]
Mattix has joined #ruby
asdfqwer has quit []
slash_nick has joined #ruby
Vert has joined #ruby
johnnyfuchs has quit [Remote host closed the connection]
freeayu has joined #ruby
tjbiddle has quit [Ping timeout: 252 seconds]
adkron_ has joined #ruby
ablemike has quit [Remote host closed the connection]
adkron has quit [Ping timeout: 256 seconds]
mikepack has quit [Remote host closed the connection]
pr0ton has joined #ruby
mattbl has joined #ruby
AlSquire has quit [Quit: This computer has gone to sleep]
wsterling has joined #ruby
rickruby has joined #ruby
wsterling has quit [Ping timeout: 252 seconds]
jeebster has quit [Read error: Connection reset by peer]
jeebster has joined #ruby
harrymoreno_ has joined #ruby
harrymoreno has quit [Ping timeout: 248 seconds]
harrymoreno_ is now known as harrymoreno
<aces1up>
anyone know if i can do a ruby hash.merge! without overwriting duplicate keys?
<r0bglees0n>
lol
bricker is now known as bricker`away
jeebster1 has joined #ruby
jeebster has quit [Read error: Connection reset by peer]
<r0bglees0n>
aces1up: keys in a hash are unique, how else should lookup happen? I guess the keys could stack values in arrays, but that's not how it works in ruby. keys are unique. you can't have duplicates.
<r0bglees0n>
aces1up: you might be able to reverse the order merge!(…) is called to get the desired results.
adkron_ has quit [Ping timeout: 240 seconds]
<r0bglees0n>
aces1up: so if you have a hash in 'foo', and 'bar', but want to keep the duplicate key in bar, you'd say foo.merge!(bar)
Xeago has quit [Remote host closed the connection]
harrymoreno has quit [Ping timeout: 256 seconds]
bean__ has quit [Quit: Computer has gone to sleep.]
<bitcycle>
Ok. I'm super confused about this. All I want to do is define a single method that wraps every other method printing "enter" on entry and printing "exit" on exit. The methods that're being wrapped are just normal functions inside a ruby file, without a Module or Class or Class Instance designation. Is _that_ possible?
igaiga has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
cj3kim has joined #ruby
havenwood has quit [Remote host closed the connection]
igaiga has joined #ruby
havenwood has joined #ruby
krombr has quit [Remote host closed the connection]
jasonkuhrt has joined #ruby
dhruvasagar has joined #ruby
io_syl has joined #ruby
timkohrumel has joined #ruby
druonysus has quit [Ping timeout: 256 seconds]
timkohrumel has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 245 seconds]
chrisseaton has joined #ruby
paissad_ has joined #ruby
<chrisseaton>
Hi - relative Ruby newbie here - can anyone explain this functionality to me? http://pastebin.com/8N8DwrkQ. I don't get what the rule is to decide when the block de-splats and when it doesn't.
igaiga has quit [Remote host closed the connection]
LennyLinux has quit [Remote host closed the connection]
InFlames has quit [Ping timeout: 256 seconds]
hogeo has joined #ruby
mattbl has joined #ruby
voidpirate has joined #ruby
<jkline>
chrisseaton: puts will echo a new line for every comma, are you accounting for that?
<r0bglees0n>
chrisseaton: you're just confused.
<jkline>
try puts "x is #{x} and y is #{y}"
<r0bglees0n>
puts outputs each element in the array
<r0bglees0n>
so, first one is puts [1,2]
<r0bglees0n>
second is puts [1] puts [2]
Davey has joined #ruby
kenneth has joined #ruby
<r0bglees0n>
but ruby iterates each element and prints it
<r0bglees0n>
so thats why it appears odd
InFlames has joined #ruby
paissad has quit [Ping timeout: 252 seconds]
<chrisseaton>
No, I mean a block with two parameters, when passed an array, will destructure it. Even though there's no * operator in the argument list. Methods don't do that, do they?
Davey has quit [Max SendQ exceeded]
krombr has joined #ruby
<r0bglees0n>
it doesn't destructure it
<r0bglees0n>
do you mean for the second example?
luckyruby has quit [Remote host closed the connection]
<chrisseaton>
Yeah - the first and last make sense to me. I don't get why the second appears to destructure without any * annotation.
Davey has joined #ruby
Davey has quit [Max SendQ exceeded]
<r0bglees0n>
yeah, ruby is intelligent depending on the arity
<r0bglees0n>
it tries to do the best thing
<r0bglees0n>
it can get more complex than that
<r0bglees0n>
you could say |(a,b),c|
Davey has joined #ruby
sayan has quit [Read error: Connection reset by peer]
<chrisseaton>
This is different to methods though isn't it? Methods don't destructure without any annotation.
<r0bglees0n>
well, you can check the arity of a method and decide what parameters to send depending on what it is
<chrisseaton>
So do you think I'm right if I say that the semantics are: if I expect multiple parameters, and I get just one, and it's an array, destructure it
<heftig>
chrisseaton: the automatic destructuring only happens for procs, when the arity is != 1 and a single array is passed as parameter
rickruby has quit [Remote host closed the connection]
<heftig>
chrisseaton: yes.
<chrisseaton>
heftig: ok, i can understand that - although this isn't a proc - it's a block - procs aren't blocks unless you reify them are they?
<heftig>
blocks have proc semantics
<chrisseaton>
heftig: and when you say proc, you mean as opposed to lambda or methods?
<heftig>
yes
<r0bglees0n>
you might be thinking of lambdas
<chrisseaton>
I wish that ISO spec - there's really no formal documentation of all this stuff is there? It's all just ad hoc, try it and see, or try to work it out from the narrative of a book.
<heftig>
chrisseaton: sadly, no. i guess rubyspec is the closest thing we have to any spec
radic__ has joined #ruby
<heftig>
and even it tries just to document what MRI does
<chrisseaton>
ok, thanks everyone
<r0bglees0n>
yeah rubyspec is a good place to learn
<r0bglees0n>
rubinius itself is also great if you want to learn more about ruby in ruby
matematikaadit has joined #ruby
<heftig>
though i don't like how the amount of primitives grows
<r0bglees0n>
yeah.. that's when you hit a brick wall as far as reading ruby goes.
chxane has joined #ruby
igherest has joined #ruby
<chrisseaton>
Semantics is always tricky. You know when they designed Haskell they planned to write a formal operational semantics for all of the language, and never got around to it, so even the most static languages still struggle to define it formally.
<jkline>
I'm building my own gems, and then installing them. They include an executable script. Ruby gems generates a wrapper with #!/usr/bin/env ruby . The problem is that the ruby binary is called ruby1.9 on my system. How can I tell gem to change the name of the binary?
<jkline>
I'm not entirely sure if this is a build-time, or install-time problem.
iamjarvo has joined #ruby
radic_ has quit [Ping timeout: 260 seconds]
nfk has quit [Quit: yawn]
<r0bglees0n>
install-time.
<r0bglees0n>
gem1.9 install yourgem should fix it.
<r0bglees0n>
chrisseaton: yeah its interesting, did you read the draft spec that had been written?
igherest has left #ruby [#ruby]
<jkline>
but why not gem1.9 build r0bglees0n ?
adkron_ has joined #ruby
<r0bglees0n>
because the wrapper is installed at install time, and it wouldn't make sense for the build machine to hardcode the path when the code is destined for another machine (possibly, rubygems)
<chrisseaton>
r0bglees0n: no - I didn't know they got that far. I know there's some joke about asking what the range of functions is - and I think they now regret all the partial functions in the prelude.
sqa_bm has quit [Remote host closed the connection]
<jkline>
Ok, that makes sense mostly. What do you mean by the parenthetical remark "possibly, rubygems" ?
wsterling has joined #ruby
<r0bglees0n>
there was a draft floating around, based on 1.8.7 i think.
<chrisseaton>
r0bglees0n: oh I thought you meant haskell. There's the ISO spec but it's behind a (big) paywall.
<r0bglees0n>
jkline: a rubygem might be built on your machine, pushed to rubygems.org, and installed on multiple other machines.
jurbat has joined #ruby
<r0bglees0n>
chrisseaton: what's the paywall?
<jkline>
r0bglees0n: right, of course. So the ruby binary on each of those machines has a, potentially different, name. Therefore the installer makes a wrapper.
<r0bglees0n>
yeah
<r0bglees0n>
it pulls that from RbConfig probably
adkron has quit [Ping timeout: 264 seconds]
<jkline>
where/what is RbConfig?
brotatos has quit [Quit: WeeChat 0.4.1]
igaiga has joined #ruby
<r0bglees0n>
it's an object that knows all about your ruby build
<r0bglees0n>
require 'rbconfig'
<jkline>
false
<r0bglees0n>
ok, so thats fine, its already loaded
lewix has quit [Remote host closed the connection]
sayan has joined #ruby
<jkline>
"/usr/bin/ruby1.9" (because ~/bin/ruby is a symlink to /usr/bin/ruby1.9, which might be a bad idea)
Guedes has quit [Ping timeout: 246 seconds]
<r0bglees0n>
so your wrapper should point there
<r0bglees0n>
the shebang line will point at whatever env points to
mattbl has quit [Read error: Connection reset by peer]
keanehsiao has joined #ruby
mattbl has joined #ruby
<jkline>
so the problem is the gem is installed as root, and root thinks that ruby means "/usr/bin/ruby" ?
matematikaadit has quit [Quit: used jmIrc]
infecto has joined #ruby
<jkline>
ok, so my colleague is online again. He says that he first made an rpm of the gem using fpm. The problem #! line comes from fpm. If we install the gem using /usr/bin/gem1.9 the #! line is /usr/bin/ruby1.9
adkron_ has quit [Ping timeout: 245 seconds]
ebobby has quit [Quit: Lost terminal]
robert_ has joined #ruby
robert_ has quit [Changing host]
robert_ has joined #ruby
hogeo has quit [Remote host closed the connection]
<jkline>
thanks r0bglees0n . Perhaps Monday we'll hae this discussion again in #fpm :)
hogeo has joined #ruby
danslo has joined #ruby
wting_ is now known as wting
<r0bglees0n>
jkline: sure, no
<r0bglees0n>
np*
bricker`LA has joined #ruby
banghouse has quit [Remote host closed the connection]
viszu has quit [Quit: Leaving.]
hogeo has quit [Ping timeout: 245 seconds]
igaiga has quit [Remote host closed the connection]
sayan has quit [Read error: Connection reset by peer]
infecto has quit [Quit: Leaving.]
freerobby1 has joined #ruby
mattbl has quit [Ping timeout: 240 seconds]
cj3kim has quit [Remote host closed the connection]
freerobby has quit [Ping timeout: 256 seconds]
decoponio has joined #ruby
jasonkuhrt has quit [Quit: Leaving...]
jkline has quit [Quit: jkline]
chrisseaton has quit [Quit: Page closed]
cj3kim has joined #ruby
cj3kim has quit [Remote host closed the connection]
`p has quit [Ping timeout: 256 seconds]
pkrnj has quit [Ping timeout: 276 seconds]
Vivekananda has joined #ruby
pkrnj has joined #ruby
pkrnj has quit [Remote host closed the connection]
wmoxam has quit [Ping timeout: 264 seconds]
stkowski has quit [Quit: stkowski]
Cultofme_ has quit [Read error: Connection reset by peer]
Cultofmetatron has joined #ruby
wsterling has joined #ruby
jacktrick has quit [Quit: Leaving]
jbueza has joined #ruby
Nisstyre-laptop has joined #ruby
ninegrid_ is now known as ninegrid
cj3kim has joined #ruby
v0n has joined #ruby
infecto has joined #ruby
wmoxam has joined #ruby
thomaslee has joined #ruby
rickruby has joined #ruby
ElderFain has joined #ruby
jamesfung14 has quit [Quit: Leaving]
rezzack has quit [Quit: Leaving.]
goodman1 has joined #ruby
goodman1 has quit [Client Quit]
goodman1 has joined #ruby
infecto has quit [Ping timeout: 246 seconds]
csaunders has joined #ruby
threesome has quit [Ping timeout: 245 seconds]
voidpirate has quit [Remote host closed the connection]
icole has quit [Remote host closed the connection]
iamjarvo has quit [Quit: Leaving.]
n_blownapart has joined #ruby
n_blownapart has quit [Remote host closed the connection]
juarlex has joined #ruby
voidpirate has joined #ruby
yacks has joined #ruby
harrymoreno_ has joined #ruby
igaiga has joined #ruby
brunoro has quit [Ping timeout: 252 seconds]
tomzx_mac has quit [Quit: return 0;]
tomzx_mac has joined #ruby
harrymoreno has quit [Ping timeout: 264 seconds]
harrymoreno_ is now known as harrymoreno
Eaven has joined #ruby
igaiga has quit [Remote host closed the connection]
infecto has joined #ruby
brunoro has joined #ruby
baroquebobcat has joined #ruby
hogeo has joined #ruby
wmoxam has quit [Ping timeout: 248 seconds]
faulkner has quit [Quit: boo.]
diadara has joined #ruby
arya has quit [Ping timeout: 256 seconds]
DomKM has joined #ruby
goodman1 has quit []
wu_lmao has quit [Quit: wu_lmao]
krombr has quit [Remote host closed the connection]
ntus1017 has quit [Remote host closed the connection]
jasonkuhrt has quit [Ping timeout: 245 seconds]
arya has joined #ruby
adkron has joined #ruby
Zespre_ has quit [Ping timeout: 240 seconds]
icole_ has quit [Remote host closed the connection]
jimg has joined #ruby
Zespre has joined #ruby
arya_ has joined #ruby
adkron_ has quit [Ping timeout: 276 seconds]
vlad_starkov has quit [Ping timeout: 245 seconds]
arya has quit [Ping timeout: 256 seconds]
Iszak_ has joined #ruby
cj3kim has quit [Remote host closed the connection]
<lessless>
Guys, as I can't find answer @ #RoR, I'll ask it here: Is it possible to start thread in observer and kill it in the model instance method?
AndChat| has quit [Ping timeout: 260 seconds]
arya_ has quit [Ping timeout: 248 seconds]
ananthakumaran has quit [Ping timeout: 260 seconds]
adkron has quit [Ping timeout: 245 seconds]
io_syl has quit [Quit: Computer has gone to sleep.]
Banistergalaxy has joined #ruby
infecto has quit [Quit: Leaving.]
AlbireoX has quit [Remote host closed the connection]
m8 has joined #ruby
sr78ger has joined #ruby
lkba has quit [Ping timeout: 241 seconds]
adkron has joined #ruby
arya has joined #ruby
lkba has joined #ruby
hamed_r has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
arya_ has joined #ruby
Heero has quit [Ping timeout: 256 seconds]
arya has quit [Ping timeout: 248 seconds]
Heero has joined #ruby
Heero has quit [Changing host]
Heero has joined #ruby
adkron_ has joined #ruby
Banistergalaxy has quit [Ping timeout: 260 seconds]
dr0p has joined #ruby
Banistergalaxy has joined #ruby
adkron has quit [Ping timeout: 276 seconds]
Godd2 has joined #ruby
Hanmac has joined #ruby
<Godd2>
I was reading "Programming Ruby" available on ruby-doc and I was a bit confused when he was talking about creating your own ranges
sr78ger has quit [Quit: Qui]
<Godd2>
he said you have to define a succ method and a <=> method first
adkron has joined #ruby
<Godd2>
but when you make a class, doesn't it automatically have <=> available to it from the Object class?
kobain has quit [Quit: l'unica verità.. è la morte stessa!]
<Godd2>
In his example he goes on to define the <=> method for the class in his example, but isn't it already defined?
workmad3 has joined #ruby
adkron_ has quit [Ping timeout: 260 seconds]
<Godd2>
My only explanation was that he was just showing it as a trivial example, and that you don't "have" to define it, but I wasn't sure if that was true or not.
lkba has quit [Ping timeout: 260 seconds]
dallasm has joined #ruby
Zolo has quit [Remote host closed the connection]
dallasm has quit [Client Quit]
ntus1017 has joined #ruby
adkron_ has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
<brendal>
Godd2: that depends on what class it is
choobie has quit [Ping timeout: 248 seconds]
lyanchih has quit [Quit: lyanchih]
<brendal>
Godd2: link?
Kar- has joined #ruby
adkron has quit [Ping timeout: 245 seconds]
adkron has joined #ruby
Chepra has joined #ruby
<Chepra>
Hey
adkron_ has quit [Ping timeout: 260 seconds]
<Chepra>
Can I run a piece of code on a mini::test after something failed?
johnkary has quit [Quit: @johnkary]
<Chepra>
I am using selenium and want to take a screenshot when an error happens
<Godd2>
If you ctrl+F "class VU" its in that example
araujo has joined #ruby
araujo has joined #ruby
harrymoreno_ has joined #ruby
harrymoreno has quit [Ping timeout: 245 seconds]
harrymoreno_ is now known as harrymoreno
m8 has quit [Quit: Sto andando via]
adkron_ has joined #ruby
Vadelius has joined #ruby
adkron has quit [Ping timeout: 264 seconds]
dfdf is now known as bugg
choobie has joined #ruby
vlad_starkov has joined #ruby
arya has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
spider-mario has joined #ruby
freerobby has joined #ruby
Eaven has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
freerobby has quit [Ping timeout: 248 seconds]
keppy has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
arya_ has joined #ruby
osvico has quit [Ping timeout: 264 seconds]
osvico has joined #ruby
timkohrumel has joined #ruby
jasonkuhrt has joined #ruby
arya has quit [Ping timeout: 248 seconds]
jimg has quit [Remote host closed the connection]
bradhe has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
eldariof has quit [Ping timeout: 245 seconds]
jasonkuhrt has quit [Ping timeout: 245 seconds]
takeru has joined #ruby
marr has quit [Ping timeout: 252 seconds]
bradhe has quit [Ping timeout: 245 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
gasbakid has joined #ruby
phipes has quit [Quit: phipes]
beiter has joined #ruby
stonevil has joined #ruby
takezawa has quit [Remote host closed the connection]
Spami has joined #ruby
Spami has joined #ruby
adkron has joined #ruby
harrymoreno has quit [Quit: harrymoreno]
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
Spami has quit [Client Quit]
adkron_ has quit [Ping timeout: 276 seconds]
AgentWillyWonka has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
dr0p has quit [Ping timeout: 252 seconds]
arya has joined #ruby
osvico has quit [Ping timeout: 240 seconds]
wereHamster has quit [Changing host]
wereHamster has joined #ruby
adkron_ has joined #ruby
razi has joined #ruby
joesavage has joined #ruby
freerobby has joined #ruby
Neomex has quit [Quit: Neomex]
cj3kim has joined #ruby
Neomex has joined #ruby
takeru has quit [Remote host closed the connection]
workmad3 has joined #ruby
keppy has quit [Ping timeout: 245 seconds]
<lewix>
Chepra: do you have a mac?
<Chepra>
yes
<lewix>
crt shift 4
<lewix>
cmd shift 4
<Chepra>
haha! :D
<joesavage>
How can I get "defined?" to check an "eval" call properly to see if an eval'd variable exists without just returning "method"? For example: http://pastebin.com/YjVDiihu
adkron has quit [Ping timeout: 276 seconds]
<lewix>
ok im heading to bed
<lewix>
it 2:30
freeayu has joined #ruby
freerobby has quit [Ping timeout: 256 seconds]
cj3kim has quit [Ping timeout: 245 seconds]
<Hanmac>
joesavage: no you cant and you try to avoid eval as far as you can
<joesavage>
Hanmac: Is there really no way to at least do something similar? And I know 'eval' is very bad practice, but for this very specific situation it's actually saving a whole lot of work.
<joesavage>
Hanmac: Using a hash in this situation would create so much more work than it solves
mikewintermute has quit [Client Quit]
agjacome has joined #ruby
<Hanmac>
joesavage: if you wanted to use eval for this than ruby is not your language for that
[rust] has joined #ruby
<joesavage>
Hanmac: I know that using a hash is about a billion times better in terms of code, it's just that this specific situation as part of a bigger partially pre-created system wouldn't really fit with it
<Vadelius>
out of cuiriosity, most people use rubymine, or?
<Hanmac>
Vadelius: the bugtracker or the ide ?
<Vadelius>
ide sorry
<Godd2>
rubymine, vim, textmate I think are the most used ones.
<Hanmac>
joesavage: you need to understand that defined? does not work that way as you think
<Hanmac>
Godd2: i use gedit and eclipse
<joesavage>
Hanmac: Out of interest, why doesn't it work as I'm expecting it to? Is it just not possible to accomplish what I'm trying via 'eval'?
<Vadelius>
Ok was just curious, i prev, used eclipse (java) and rubymine is looking pretty nifty
<Godd2>
joesavage: think about what eval returns
kidoz has quit [Quit: Ухожу я от вас]
Xeago has joined #ruby
arietis has joined #ruby
bjeanes has quit [Ping timeout: 276 seconds]
<Hanmac>
joesavage: because defined? works on parser level not on code one
Vadelius has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
ToApolytoXaos has joined #ruby
bjeanes has joined #ruby
<Godd2>
that conditional will always run, if I'm not mistaken
dhruvasagar has quit [Ping timeout: 240 seconds]
obs has joined #ruby
<Godd2>
your eval will return "method" even if grandmaster_ability isn't set
<Hanmac>
joesavage: because the part in defined?(...) is never executed
<Hanmac>
joesavage: use: local_variables.any? {|s| s.to_s == ability + "_ability" } # but imo you cant trust this, thats why you shoud use array or hash when you have multible similar variables
<Godd2>
joesavage: there are ways to see if a variable exists. Or rather, what is it you're trying to do?
<joesavage>
Godd2: Checking if a variable exists is exactly what I'm trying to exist
mityaz has joined #ruby
arya has quit [Ping timeout: 248 seconds]
<joesavage>
Hanmac: Huh, that's interesting. Maybe I can use that to load local variables into a hash or something?
<joesavage>
Godd2: trying to do*
<Godd2>
I knew what you meant ;)
<Hanmac>
just throw your idea away and rethink about why you need this tons of local variables
yshh has joined #ruby
ananthakumaran has quit [Ping timeout: 245 seconds]
lkba has joined #ruby
<joesavage>
Hanmac: Pretty much it's the way this static site generation system is set up
<Hanmac>
thats smells like that you use rails but does not know ruby enough to use it correct ...
toekutr has quit [Remote host closed the connection]
<joesavage>
Hanmac: I'm using Frank: https://github.com/blahed/frank/ -- Pretty much the variables in the model files go straight to local variables usable in the views
UnnamedUser has joined #ruby
<Godd2>
Im curious as to why you can't just create an enum and iterate over the possible variable names...? Or do you not know what the names are ahead of time?
obs has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
<joesavage>
Godd2: I probably could, but I have this nice little concise piece of code to repeat a certain HTML snippet in the view for a number of variation off a base variable name -- for example one_ability, one_cooldown, one_range, two_ability, two_cooldown, etc.
<joesavage>
However some of those things -- for example one_cooldown -- may not exist
<UnnamedUser>
hi im new to rails and i get problem every step during installation but the most unreasonable one is that http://sdrv.ms/12VD1Wu
<joesavage>
Hanmac: In an ideal world I'd re-write Frank just a little to store all model variables in a hash, but that seems very scary to a Ruby beginner like me right now. Not to mention it'd probably break things.
<Godd2>
you need to get the linguistics gem, but that bit of code will cycle through one_ability, one_cooldown, one_range, two_ability, two_cooldown, two_range, three_ability, ...
yshh has quit [Remote host closed the connection]
ferdev has quit [Quit: ferdev]
<joesavage>
Godd2: But then what if "one_cooldown" doesn't exist? This is the heart of my issue, not all abilities have a cooldown
adkron has quit [Ping timeout: 245 seconds]
<Godd2>
that's when you can use the defined? method
<Godd2>
it will return nil if the variable you're asking about hasn't been defined
<Godd2>
Ill modify my code so you can see
<joesavage>
Godd2: I may be incorrect as a beginner reading your code, but it seems like your code would just output "one_ability" rather than the contents of the variable "one_ability"
[rust] has quit [Quit: Leaving]
UnnamedUser has quit [Ping timeout: 256 seconds]
arya has joined #ruby
<Godd2>
are these local variables or instance variables?
<joesavage>
Local
<Godd2>
and you would be correct that my code simply spits out the strings
darkapex has quit [Ping timeout: 240 seconds]
<joesavage>
I already have a loop similar to yours, however instead I simply "eval" the string you're creating and then try and see if it exists with "defined?", which is the problem I'm having
Senjai has quit [Quit: "BYE"]
daniel_- has quit [Read error: Operation timed out]
obs has joined #ruby
darkapex has joined #ruby
takezawa has joined #ruby
monkegjinni has joined #ruby
arya has quit [Ping timeout: 260 seconds]
UnnamedUser has joined #ruby
<UnnamedUser>
hi
<UnnamedUser>
im newbi ruby on rails
<joesavage>
Godd2: So I think my original problem still applies to your snippet, as using "defined?" upon eval'ing the string wouldn't work
<UnnamedUser>
i started learning couple of days ago
<UnnamedUser>
i stated to hate it
<UnnamedUser>
im facing problems every step
<Godd2>
joesavage: thats correct. Im furiously googling to see other options though
darkapex has quit [Ping timeout: 252 seconds]
nfk has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
<joesavage>
Godd2: Hah, ok, thanks for all the help so far - hopefully we can come up with something that works
<UnnamedUser>
when i came to rails generate controller home index i got this error
<UnnamedUser>
can anybody tell me whats this error ?
<Hanmac>
UnnamedUser: #rubyonrails
Michael is now known as Guest25694
machuga|away has quit [Excess Flood]
machuga has joined #ruby
<Godd2>
joesavage: Do you know how ||= works?
<joesavage>
Godd2: I do not -- In my searches for solutions I ran across it, but discarded it after it wasn't working as I expected
ntus1017 has quit [Remote host closed the connection]
UnnamedUser has left #ruby [#ruby]
machuga has quit [Excess Flood]
machuga has joined #ruby
ananthakumaran has quit [Ping timeout: 264 seconds]
<Godd2>
joesavage: I think you should write a quick class
<Godd2>
that way you can use instance_variable_set and instance_variable_get with strings as arguments to check definedness
viszu has joined #ruby
justsee has quit [Ping timeout: 256 seconds]
<joesavage>
Godd2: Hmm, that sounds interesting however I'm not quite sure how I'd put the local variables into this -- would you be able to write up a quick example for me?
<Godd2>
can you pm me? I have a few questions and I dont want to congest the room
<Godd2>
I don't know how to pm people in this webchat client
kiri has quit [Ping timeout: 260 seconds]
<joesavage>
:D Ok
freerobby has joined #ruby
kiri has joined #ruby
Neomex has quit [Quit: Neomex]
beiter has quit [Ping timeout: 246 seconds]
arya_ has joined #ruby
ericmathison has joined #ruby
yshh has quit [Remote host closed the connection]
kofno has joined #ruby
gstudent2 is now known as germanstudent
darkapex has quit [Ping timeout: 260 seconds]
Guest25694 has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 264 seconds]
freerobby has quit [Ping timeout: 256 seconds]
arya has joined #ruby
vlad_starkov has joined #ruby
end_guy has quit [Ping timeout: 240 seconds]
Sirupsen has quit [Quit: Connection closed for inactivity]
kofno has quit [Remote host closed the connection]
adambeynon has quit [Max SendQ exceeded]
freerobby has joined #ruby
takeru has joined #ruby
Neomex has joined #ruby
kevinykchan has joined #ruby
ffio has joined #ruby
adambeynon has joined #ruby
ferdev has quit [Quit: ferdev]
_ffio_ has quit [Ping timeout: 245 seconds]
neku has joined #ruby
boxmein has joined #ruby
boxmein has quit [Max SendQ exceeded]
iamjarvo has quit [Quit: Leaving.]
ferdev has joined #ruby
yacks has joined #ruby
freerobby has quit [Ping timeout: 246 seconds]
<lessless>
If my program will process multiple requests than I also need to manage a relations between request and thread myself, right?
cortes has joined #ruby
elliptical has joined #ruby
ellipse has quit [Ping timeout: 256 seconds]
sambao21 has joined #ruby
iamjarvo has joined #ruby
mklappstuhl has joined #ruby
ellipse has joined #ruby
elliptical has quit [Read error: Connection reset by peer]
monkegji_ has quit [Ping timeout: 246 seconds]
<lessless>
apeiros_, can I pass Queue between observer and model in rails ?
Neomex has quit [Quit: Neomex]
neku has quit [Quit: Leaving...]
gasbakid_ has joined #ruby
Gues_____ has joined #ruby
Gues_____ has quit [Client Quit]
freerobby has joined #ruby
Z_Mass has joined #ruby
Gues_____ has joined #ruby
Gues_____ has quit [Max SendQ exceeded]
darthdeus has joined #ruby
Gues_____ has joined #ruby
Gues_____ has quit [Max SendQ exceeded]
takeru has quit [Remote host closed the connection]
gasbakid has quit [Ping timeout: 252 seconds]
arya has joined #ruby
braoru has quit [Ping timeout: 248 seconds]
<Hanmac>
lessless: why not asking at #rubyonrails ?
<apeiros_>
lessless: whether you can pass something is only a question of whether you can call a method
<apeiros_>
if you can call a method, you can pass something
monkegjinni has joined #ruby
<Xeago>
seeing his earlier logic, he could just add an ivar with the queue :3
hamed_r has quit [Quit: Leaving]
coderhut has quit [Quit: Page closed]
lyanchih has quit [Quit: lyanchih]
eploko has quit [Ping timeout: 245 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
jonathanwallace has joined #ruby
arya_ has joined #ruby
arya_ has quit [Client Quit]
interactionjaxsn has joined #ruby
razi has quit [Quit: Leaving.]
arya has quit [Ping timeout: 256 seconds]
AgentWillyWonka has quit [Quit: Leaving...]
<aedornm>
I need to automate VirtualBox .. not like Vagrant, more like interaction. Manually building an ISO, booting off it, installing (or trying to install) is taking far too long.
<aedornm>
hmmm.. not sure how I would do that, but I do have an idea on how to automate making breakfast. I should do that instead.
kirun has joined #ruby
Z_Mass has quit [Ping timeout: 264 seconds]
mklappstuhl has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
ia___ has joined #ruby
jmeeuwen has quit [Ping timeout: 264 seconds]
ellipse has quit [Ping timeout: 256 seconds]
Iszak_ has quit [Read error: Connection reset by peer]
Spooner has quit [Remote host closed the connection]
sqa_bm has quit [Remote host closed the connection]
sqa_bm has joined #ruby
Spooner has joined #ruby
generalissimo has joined #ruby
jmeeuwen has joined #ruby
monkegjinni has quit [Ping timeout: 240 seconds]
forced_request has joined #ruby
eldariof has joined #ruby
lyanchih has joined #ruby
Iszak_ has joined #ruby
vlad_starkov has quit [Ping timeout: 260 seconds]
BSaboia has joined #ruby
stonevil has quit [Remote host closed the connection]
sqa_bm has quit [Ping timeout: 245 seconds]
iamjarvo has quit [Quit: Leaving.]
atno has quit [Remote host closed the connection]
atno has joined #ruby
verto has joined #ruby
spider-mario has quit [Ping timeout: 256 seconds]
atno has quit [Remote host closed the connection]
atno has joined #ruby
jimg has joined #ruby
vlad_starkov has joined #ruby
ybart has quit [Quit: ybart]
iamjarvo has joined #ruby
jmeeuwen has quit [Ping timeout: 248 seconds]
ravster has joined #ruby
Zeeraw has quit [Quit: Computer has gone to sleep.]
jimg has quit [Ping timeout: 256 seconds]
jonathanwallace has quit [Quit: WeeChat 0.4.0]
TheDick_ has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
jmeeuwen has joined #ruby
Zeeraw has joined #ruby
monkegjinni has joined #ruby
TheDick has quit [Ping timeout: 252 seconds]
TheDick_ is now known as TheDick
viszu has quit [Quit: Leaving.]
sqa_bm has joined #ruby
diadara_ has quit [Ping timeout: 246 seconds]
monkegjinni has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
manu has joined #ruby
manu is now known as Guest30312
rickruby has joined #ruby
echevemaster has quit [Quit: Leaving]
stonevil has joined #ruby
monkegji_ has joined #ruby
monkegjinni has quit [Ping timeout: 256 seconds]
banghouse has joined #ruby
sqa_bm has quit [Remote host closed the connection]
banghouse is now known as Guest98885
rickruby has quit [Ping timeout: 248 seconds]
iamjarvo has quit [Quit: Leaving.]
Guest98885 is now known as banghouse
replay has quit [Ping timeout: 264 seconds]
Godd2 has quit [Quit: Page closed]
Guest30312 has quit [Ping timeout: 245 seconds]
Z_Mass has joined #ruby
Proshot has quit [Quit: Leaving]
arya has joined #ruby
monkegji_ has quit [Ping timeout: 256 seconds]
mixel has quit [Quit: mixel]
nightfly has quit [Ping timeout: 256 seconds]
r0bglees0n has quit [Ping timeout: 252 seconds]
freerobby has quit [Quit: Leaving.]
jasonkuhrt has joined #ruby
freerobby has joined #ruby
arya has quit [Ping timeout: 256 seconds]
postmodern has quit [Quit: Leaving]
Michael__ has joined #ruby
eploko_ has joined #ruby
arya has joined #ruby
ivanoats has joined #ruby
jasonkuhrt has quit [Ping timeout: 260 seconds]
senayar has quit [Read error: Operation timed out]
vlad_starkov has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<multi_io>
I'm looking for a simple 2D pixel drawing library, i.e. something that allows you to create a simple 2d drawing area of specific dimensions, then set pixels, draw lines, ellipses etc. Ideally there sould be multiple backends, e.g. x11, png etc. I don't need user interactions. What would you recommend?
lathiat has quit [Ping timeout: 256 seconds]
jokke has quit [Ping timeout: 245 seconds]
arya has quit [Ping timeout: 260 seconds]
spider-mario has quit [Remote host closed the connection]
apeiros_ has quit [Ping timeout: 245 seconds]
ybart has joined #ruby
northelks__ has joined #ruby
cj3kim has joined #ruby
northelks__ has left #ruby [#ruby]
northelks__ has joined #ruby
<Spooner>
multi_io, RMagick is popular, but a pain to install for some people (since it has external dependencies).
northelks__ has left #ruby [#ruby]
<Spooner>
Or cairo with rcairo.
closer009 has joined #ruby
vlad_sta_ has quit [Ping timeout: 245 seconds]
arya has joined #ruby
closer has quit [*.net *.split]
ybart has quit [Client Quit]
danslo has joined #ruby
<multi_io>
Spooner: thanks
danslo has quit [Client Quit]
lathiat has joined #ruby
snearch has joined #ruby
<paszo2008>
hi i have problems running the rails server how to check if i have everything ok?
iamjarvo has joined #ruby
AgentWillyWonka has joined #ruby
<paszo2008>
i try to run webrick using rails server
thesheff17 has quit [Disconnected by services]
<Spooner>
paszo2008, #rubyonrails channel might be better for you
danslo has joined #ruby
thesheff17 has joined #ruby
Proshot has joined #ruby
northelks_ has joined #ruby
shammancer has joined #ruby
takeru has joined #ruby
infecto has joined #ruby
kjellski_ has joined #ruby
machuga|away is now known as machuga
northelks_ has quit [Quit: Leaving]
northelks_ has joined #ruby
atno has quit [Quit: Leaving]
northelks_ has quit [Client Quit]
yshh has quit [Remote host closed the connection]
northelks_ has joined #ruby
Cultofmetatron has joined #ruby
osvico has joined #ruby
takeru has quit [Ping timeout: 276 seconds]
kjellski has quit [Ping timeout: 245 seconds]
workmad3 has joined #ruby
razi has joined #ruby
Eaven has joined #ruby
<joshu>
hi guys
Cultofmetatron has quit [Remote host closed the connection]
ariedler has quit [Remote host closed the connection]
<joshu>
I have an ubuntu server vanilla at the moment which will host my ruby script. Just wondering about the details of installing ruby in production. Do I follow the same type of procedure as I do on my local dev machine, e.g. install rbenv, bundler etc?
<joshu>
Or should ruby be installed differently in production?
pagios_ has joined #ruby
pskosinski has joined #ruby
<pagios_>
what is the easiest way to extract filename from "filename.extension" where filename is a dynamic text
<davidcelis>
wouldn't that return an empty string if you pass in a dotfile
<Spooner>
Yeah, better to use File.extname since it knows about dotfiles.
spider-mario has joined #ruby
<Spooner>
File.extname ".gitignore"=> ""
Eaven has quit [Ping timeout: 276 seconds]
dhruvasagar has quit [Ping timeout: 240 seconds]
<joshu>
cool saved for future use
<joshu>
so you have any thoughts on ruby production install?
brianherman has joined #ruby
Cultofmetatron has joined #ruby
<davidcelis>
what about it
<Spooner>
Can't see a reason for production to be different. However, you don't strictly need to use rbenv, because unlike a development machine, you usually don't use multiple versions of ruby at once.
slash_nick is now known as slash-nick
Cultofmetatron has quit [Remote host closed the connection]
<Spooner>
But for consistency, it is probably easier to set it up in the same way.
<joshu>
davidcelis just asking for advice as I need to setup a new ubuntu server to run a ruby script
<Spooner>
That suggestion seems reasonably. At least it is avoiding using system ruby (which is a nightmare ;D).
Yulli has left #ruby ["Leaving..."]
<joshu>
hmm ok might just use that script then
<davidcelis>
joshu: that script seems fine; it's just using ruby-build
monkegji_ has joined #ruby
incorvia has quit [Remote host closed the connection]
lkba has joined #ruby
<joshu>
davidcelis yeah I was reading this now https://github.com/sstephenson/rbenv/wiki/Deploying-with-rbenv but although I have rbenv, bundler on my mac for dev. I'm just confused by binstubs and all that, so I don't know. Honestly, for someone like me who's relatively new to ruby and web dev googling results in so many different views and opinions on how to do standard things such as deployment that a newcomer gets totality confused
monkegjinni has quit [Ping timeout: 246 seconds]
aalmenar has joined #ruby
<joshu>
there doesn't seem to be an accepted "standard", "boilerplate" for essential things
<joshu>
or maybe I'm missing something
infecto has quit [Quit: Leaving.]
ereslibre has joined #ruby
danslo has quit [Ping timeout: 260 seconds]
Z_Mass has quit [Quit: Leaving]
danslo has joined #ruby
<davidcelis>
there is no accepted standard
<davidcelis>
you must make a choice
ybart has joined #ruby
lucaaa has joined #ruby
rickruby has joined #ruby
kindjal has joined #ruby
rickruby has quit [Remote host closed the connection]
stonevil has quit [Remote host closed the connection]
yshh has joined #ruby
agjacome has quit [Quit: leaving]
jasonkuhrt has joined #ruby
ivanoats has quit [Remote host closed the connection]
|RicharD| has joined #ruby
<|RicharD|>
hi to all
<|RicharD|>
anyone know a good gem for mysql sanitize etc… ?
Guest30312 has joined #ruby
<|RicharD|>
now i'm using db.query(...)
slash-nick has quit [Ping timeout: 256 seconds]
<nightfly>
Find a library the doesn't treat queries as just strings.
tonini has joined #ruby
<kindjal>
anyone know what sets GEM PATH to /usr/lib or /var/lib or whatever? I have the same ruby1.8 and same rubygems1.8 on Ubuntu Lucid servers, but some have GEM PATH of /var/lib and others /usr/lib. Can't figure out why they're different.
<|RicharD|>
any suggest ? some good name ?
<davidcelis>
|RicharD|: check out sequel
<|RicharD|>
seems good
areil has quit [Remote host closed the connection]
incorvia has quit [Read error: Connection reset by peer]
Dummies_freelanc has quit [Read error: Connection reset by peer]
incorvia has joined #ruby
jimg has joined #ruby
jasonkuhrt has quit [Ping timeout: 245 seconds]
JZTech101 has joined #ruby
JZTech101 has quit [Max SendQ exceeded]
JZTech101 has joined #ruby
Michael__ has quit [Remote host closed the connection]
jimg has quit [Ping timeout: 260 seconds]
sqa_bm has joined #ruby
razi has quit [Quit: Leaving.]
interactionjaxsn has quit [Remote host closed the connection]
Cultofmetatron has joined #ruby
interactionjaxsn has joined #ruby
sqa_bm has quit [Ping timeout: 252 seconds]
blaxter has joined #ruby
<joshu>
is it customary to add "#!/usr/bin/env rake" to Rakefiles as it is to ruby script files "#!/usr/bin/env ruby" ?
phipes has joined #ruby
interactionjaxsn has quit [Ping timeout: 245 seconds]
arya has quit [Ping timeout: 264 seconds]
tonini has quit [Ping timeout: 248 seconds]
icole has joined #ruby
arya has joined #ruby
<aedornm>
joshu: no. Rake generally acts as a standalone executable that just reads in the rake file and adds tasks to itself. So you don't run the rakefile, just run rake
yshh has quit [Remote host closed the connection]
<joshu>
aedornm ok thanks
diadara_ has joined #ruby
diadara has quit [Read error: Connection reset by peer]
ferdev has quit [Quit: ferdev]
huoxito has joined #ruby
alem0lars has quit [Quit: Leaving]
Liothen has quit [Read error: Connection reset by peer]
Michael__ has joined #ruby
saarinen has joined #ruby
Liothen has joined #ruby
Liothen has joined #ruby
Liothen has quit [Changing host]
wallerdev has quit [Quit: wallerdev]
cj3kim has quit [Remote host closed the connection]
AgentWillyWonka has quit [Ping timeout: 246 seconds]
razi has joined #ruby
Cultofme_ has joined #ruby
Cultofmetatron has quit [Read error: Connection reset by peer]
sqa_bm has joined #ruby
monkegji_ has quit [Remote host closed the connection]
diadara_ has quit [Ping timeout: 260 seconds]
yacks has quit [Remote host closed the connection]
DomKM has joined #ruby
freeayu has quit [Remote host closed the connection]
rickruby has joined #ruby
phipes has quit [Quit: phipes]
<joshu>
I have a gem in my GemFile development group called letter_opener. I only use this when testing my script manually. How do I "disable" "unrequire" that gem when I run minitest and later when I put it into production? I can comment that line of code, but there must be a better way of doing it. Is it done in the Gemfile or in my code?
teclator has quit [Ping timeout: 276 seconds]
jarjar_prime has joined #ruby
b0oh has joined #ruby
baroquebobcat has joined #ruby
arya has quit [Ping timeout: 256 seconds]
monkegjinni has joined #ruby
<fryguy>
joshu: add it to the development group
cj3kim has joined #ruby
LennyLinux has quit [Remote host closed the connection]
<joshu>
so fryguy I have it in the dev group. But when I execute the script like this ruby myscript.rb then there's no concept of dev or production, right?
<fryguy>
there's also no concept of bundler unless you are adding it
<fryguy>
in which case you can specify it
banister_ has joined #ruby
slyv has joined #ruby
slyv has quit [Max SendQ exceeded]
incorvia has quit [Remote host closed the connection]
voidpirate has joined #ruby
<|RicharD|>
sequel rocks!
jurbat has quit [Quit: Computer has gone to sleep.]
LennyLinux has joined #ruby
arya has joined #ruby
freakazoid0223 has joined #ruby
neku has quit [Quit: Leaving...]
graydot has quit [Ping timeout: 252 seconds]
bricker`LA has quit [Ping timeout: 264 seconds]
kjellski has quit [Quit: Leaving]
banister_ has quit [Ping timeout: 256 seconds]
arya has quit [Ping timeout: 246 seconds]
banisterfiend has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
jamesfung14 has quit [Ping timeout: 245 seconds]
fridim_ has quit [Ping timeout: 276 seconds]
wallerdev has joined #ruby
arya has joined #ruby
osvico has quit []
saarinen has quit [Quit: saarinen]
jokke has joined #ruby
phipes has joined #ruby
razi has quit [Quit: Leaving.]
verto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
verto has joined #ruby
mguy has joined #ruby
osvico has joined #ruby
daniel_- has joined #ruby
Guest30312 has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
moos3 has quit [Quit: Computer has gone to sleep.]
wu_lmao has quit [Quit: wu_lmao]
jarjar_prime has quit [Quit: Sleep time.]
iamjarvo has quit [Quit: Leaving.]
leonidlm has quit [Ping timeout: 252 seconds]
splittingred has quit [Quit: splittingred]
kindjal has quit [Ping timeout: 264 seconds]
AgentWillyWonka has joined #ruby
tomzx_mac has joined #ruby
monkegjinni has quit [Remote host closed the connection]
jimg has joined #ruby
machuga is now known as machuga|away
bean__ has joined #ruby
kindjal has joined #ruby
<joshu>
fryguy so what I should be doing is executing my script like this bundle exec ruby myscript.rb?
monkegjinni has joined #ruby
JoeTheGuest has quit [Quit: Connection closed for inactivity]
shevy has quit [Ping timeout: 256 seconds]
shevy has joined #ruby
takezawa has joined #ruby
incorvia has joined #ruby
workmad3 has joined #ruby
b0oh has quit [Quit: Leaving.]
bricker`LA has joined #ruby
osvico has quit []
apeiros_ has joined #ruby
jimg has quit [Ping timeout: 260 seconds]
apeiros has quit [Read error: Operation timed out]
<butblack>
from what i understand, it says the the Person class inherits the attributes name age rows
<Spooner>
What isn't clear, butblack
HektoR has quit [Remote host closed the connection]
haxrbyte has quit [Remote host closed the connection]
<Spooner>
It inherits from a newly created Struct class, which has those attributes.
interactionjaxsn has quit [Remote host closed the connection]
neku has quit [Quit: Leaving...]
<butblack>
ok, and why wouldn't the class just have those attributes in an initialize method?
<butblack>
why would you do that?
Shirakawasuna has joined #ruby
harrymoreno has joined #ruby
danslo has joined #ruby
interactionjaxsn has joined #ruby
<Spooner>
Because it is marginally quicker to use Struct as a base, rather than explicitly have attr_accessors and a defined #initialize.
jztech101_ has quit [Remote host closed the connection]
<Spooner>
There isn't really much to gain from that idiom, unless Person is pretty trivial.
<butblack>
Spooner: ok thanks
jbueza has quit [Quit: Leaving.]
brian_000_ has joined #ruby
JZTech101 has joined #ruby
JZTech101 has quit [Max SendQ exceeded]
Squarepy has quit [Ping timeout: 245 seconds]
<Spooner>
Better than that idiom, however, is: Person = Struct.new(:name, :age, :race) do; def hello; puts "Hello"; end; end
<Spooner>
butblack, Since then you aren't creating a class just to be inherited from, but rather add other methods to a Struct.
Spooner has quit [Remote host closed the connection]
brian_000_ has quit [Client Quit]
interactionjaxsn has quit [Ping timeout: 256 seconds]
<joshu>
another question about moving to production. I have dotenv and a .env file on my dev machine. When I move my finished script as a gem on the production server (ubuntu) should I drop the .env file and provide the env vars in the user shell profile?
LanaDelRey has joined #ruby
Squarepy has joined #ruby
brianherman has quit [Ping timeout: 245 seconds]
Spooner has joined #ruby
Inside_ has quit [Ping timeout: 264 seconds]
<jacktrick>
I don't know what's best practice but I'd set them in my $HOME/.bash_profile
<jacktrick>
I imagine it would be slightly more secure
Davey has joined #ruby
kindjal has joined #ruby
<jacktrick>
can't accidentally add it to vcs and push it to github that way
dmiller has quit [Remote host closed the connection]
<joshu>
jacktrick yeah I'm googling the subject now and getting different suggestions
<joshu>
some suggest loading a yaml config file
mikewintermute has joined #ruby
LanaDelRey has quit [Ping timeout: 245 seconds]
lewis has joined #ruby
<jacktrick>
I'd imagine it's mostly up to personal preference
marr has joined #ruby
<jacktrick>
if you're packaging whatever you're doing as a gem it'd probably be more convenient to keep everything together, actually. Like if you change host, you can't just forget to add that stuff into your profile again. x:
<jacktrick>
Follow your heart~ :D
sambao21 has joined #ruby
love_color_text has joined #ruby
<joshu>
jacktrick hehe you know it's a constant battle between heart and mind ;)
monkegjinni has quit [Remote host closed the connection]
teddyp1cker has joined #ruby
LanaDelRey has joined #ruby
braoru has quit [Ping timeout: 260 seconds]
devoldmx3 has joined #ruby
infecto has joined #ruby
devoldmx has quit [Ping timeout: 248 seconds]
<joshu>
when you move the contents of Gemfile to gemspecs what happens with groups? does gemspecs have this concept as well?
sambao21 has quit [Quit: Computer has gone to sleep.]
Michael__ has quit [Remote host closed the connection]
Michael__ has joined #ruby
shadewind has joined #ruby
egon1 has quit [Remote host closed the connection]
jasonkuhrt has quit [Ping timeout: 240 seconds]
<shadewind>
is it possible to call the superclass implementation of a method other than the current one?
BadDesign has joined #ruby
sambao21 has joined #ruby
<shadewind>
I assume it's possible using reflection but I'm thinking if it's possible using some more conventional method
dmiller has joined #ruby
Michael__ has quit [Ping timeout: 256 seconds]
love_color_text has quit [Remote host closed the connection]
sventon has quit [Remote host closed the connection]
xerxas has quit [Quit: Connection closed for inactivity]
bradhe has joined #ruby
wu_lmao has quit [Ping timeout: 256 seconds]
Guga_ has quit [Quit: ~]
skattyadz has quit [Quit: skattyadz]
Kar- has quit [Remote host closed the connection]
danslo has quit [Quit: danslo]
jamesfung14 has quit [Ping timeout: 256 seconds]
bradhe has quit [Ping timeout: 246 seconds]
ArchBeOS has joined #ruby
ArchBeOS has quit [Changing host]
ArchBeOS has joined #ruby
s0ber_ has joined #ruby
leonidlm has joined #ruby
<joshu>
when you write tests using minitest against a ruby script which has a lib/myscript.rb and bin/myscript. You are testing against the library and the binary is not involved in testing correct?
s0ber has quit [Ping timeout: 246 seconds]
s0ber_ is now known as s0ber
Astralum has quit [Read error: Connection reset by peer]
Astralum has joined #ruby
aedornm has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
pcarrier_ has quit [Quit: Computer has gone to sleep.]
jbpros has quit [Quit: jbpros]
bionhart has quit [Remote host closed the connection]
echevemaster has joined #ruby
jztech101_ has joined #ruby
b0oh has joined #ruby
TheFuzzball has quit [Read error: Operation timed out]
sambao21 has joined #ruby
Guga_ has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
<Spooner>
joshu, bundler-parsed gemspecs only use :default and :development bundler groups
jonathanwallace has quit [Ping timeout: 264 seconds]
<joshu>
Spooner so if I have a testing group what happens?
danslo has joined #ruby
<Spooner>
No way to set a testing group via a gemspec, as far as I know.
ffio has quit [Quit: WeeChat 0.4.0]
emmanuelux has joined #ruby
eldariof has quit [Ping timeout: 246 seconds]
<Spooner>
Just add testing stuff as a development dependency in the gemspec.
<Spooner>
Since it isn't _required_ to run the gem normally.
Evixion` has joined #ruby
<Spooner>
(gemspec just has #add_development_dependency and #add_dependency)
Evixion has quit [Ping timeout: 260 seconds]
eploko has quit [Ping timeout: 264 seconds]
eploko has joined #ruby
ArchBeOS has left #ruby ["Leaving"]
<joshu>
Spooner so when you develop a gem the Gemfile just has require 'gem specs' and if you use say minitest which would be in the gem file's testing group, you would put at as a development dependency in the gemspec file?
jztech101_ has quit [Remote host closed the connection]
Guga_ has quit [Quit: ~]
sambao21 has quit [Quit: Computer has gone to sleep.]
<Spooner>
No, the Gemfile just has "source 'https://rubygems.org'\ngemspec\n" (forgot a quote and I can't assume people can think while copyingpasting)
jonathanwallace has joined #ruby
<Spooner>
But really, this is all pretty well documented and there are 100s of gems set up this way for you to look at.
danneu has joined #ruby
danneu has quit [Client Quit]
ephemerian has joined #ruby
eploko has quit [Ping timeout: 252 seconds]
<joshu>
Spooner ok I've seen different variations thus my question
<Spooner>
Well, lines 1-4 are all you actually need. You don't need the other stuff in groups really.
<joshu>
maybe this is just a "bad" example
<Spooner>
Yeah, I don't think that is a good example really.
eploko has joined #ruby
jimg has joined #ruby
takeru has joined #ruby
<joshu>
Spooner ok what you would have done is put the test and dev group gems as dev dependencies in the gem specs file and that would be a "good example"
jimg has quit [Ping timeout: 245 seconds]
cofin has quit [Quit: cofin]
rippa has quit [Ping timeout: 240 seconds]
takeru has quit [Ping timeout: 260 seconds]
<shadewind>
is there a way to load YAML safely in Ruby?
freerobby has quit [Quit: Leaving.]
arya has quit [Ping timeout: 252 seconds]
LyonJT has joined #ruby
LyonJT has quit [Client Quit]
jacobbednarz has quit [Read error: Connection reset by peer]
JZTech101 has joined #ruby
arya has joined #ruby
Michael__ has quit [Remote host closed the connection]
vlad_sta_ has quit [Remote host closed the connection]
keppy has quit [Read error: Operation timed out]
arya has joined #ruby
cj3kim has quit [Ping timeout: 241 seconds]
banister`shop has joined #ruby
pcarrier_ has joined #ruby
b0oh has quit [Quit: Leaving.]
freerobby has joined #ruby
momomomomo has joined #ruby
arya has quit [Client Quit]
<shadewind>
havenwood: however, I do have a case where I actually want to allow ruby objects but I'm trying to find out how this conversion is being done
<shadewind>
havenwood: any pointers?
<banister`shop>
can someone here help me with a basic css question?
<banister`shop>
not the right channel, i know, but the relevant channels appear dead
cofin has joined #ruby
b0oh has joined #ruby
<workmad3>
banister`shop: I might be able to
<banister`shop>
ok cool
<banister`shop>
i have two questions about this jsfiddle: 1. why can't i specify .b as 30% (if i do, it appears on the next line) 2. why is there a gap between the red and blue divs? http://jsfiddle.net/dYXZb/6/
b0oh has quit [Client Quit]
<banister`shop>
workmad3: :)
<joshu>
workmad3 hey
TheFuzzball has joined #ruby
<joshu>
workmad3 remember the other day you suggested I convert the pdf to an image and try that in word
jacktrick has quit [Quit: Leaving]
<workmad3>
banister`shop: ah, it'll be because of the nature of inline-block
<joshu>
workmad3 well it took me an hour of trial and error and to my surprise I was able to add this annoying fields on top of the image in word and it was accepted by the fax provider service
<joshu>
workmad3 so just wanted to say thanks ;)
<workmad3>
banister`shop: and the fact the two divs have whitespace between them
<banister`shop>
workmad3: ah ok...waht's the best way to have the two divs sitting snuggly side by side then, and being able to specify 70% for one and 30% for the other?
<workmad3>
joshu: cool :)
<workmad3>
banister`shop: you could float them
<workmad3>
banister`shop: you could have them as table cells
Nisstyre-laptop has quit [Ping timeout: 245 seconds]
<brendal>
banister`shop, to get rid of the mag set and and b float: left
<workmad3>
banister`shop: or you could remove the whitespace separation between the elements in the source
<Spooner>
Or give .b margin-left: -2%; width: 30%
kindjal has quit [Ping timeout: 246 seconds]
<Spooner>
(though that is crazy)
<brendal>
banister`shop, ignore that just set a and b to float: left
<Spooner>
Unless you try on another browser (or browser version), in which case anything could happen. Gods, I hate web design :D
bionhart has joined #ruby
<banister`shop>
i'm trying to understand how this works --- click 'about' and it slides out a div from the right, if you look at the html you can see the div on the left (#editors) gets set to 70% after 'about' is clicked, but it's 100% before: http://www.json-generator.com/
dash_ has quit [Quit: Time to beer :)]
pcarrier_ has quit [Ping timeout: 264 seconds]
<banister`shop>
err the this* refers to the link at the end of that text
<banister`shop>
but there's no float: left for those ivs
<workmad3>
banister`shop: the editors is absolutely positioned to left:0; top:0
<workmad3>
banister`shop: and the container with the about in gets positioned absolutely to right:0; top:0
<workmad3>
banister`shop: and then js sets the widths
arquebus has joined #ruby
Hanmac1 has joined #ruby
<workmad3>
banister`shop: incidentally, the most cross-browser compatible (if you need to target back to IE6 sort of levels) would be either the absolute positioning in that json-generator link, or using floats
<banister`shop>
workmad3: the widths just seem to be set at 70% for the #editors and 30% for teh about div though
<workmad3>
banister`shop: yes
eploko has quit [Ping timeout: 256 seconds]
<banister`shop>
so it does/doesn't need js to set the widths?
<workmad3>
banister`shop: when you click the button, 'width:70%' is added to the editors div
<banister`shop>
ah
<workmad3>
banister`shop: and 'width:30%' is added to the about div
<workmad3>
banister`shop: that bit is done with JS ;)
<banister`shop>
workmad3: cool, so..if i set up the divs in my example to use absolute positioning instead and set the widths to 70% and 30% respectively it should work?
<banister`shop>
let me try
bamdad has joined #ruby
<workmad3>
banister`shop: in your example you'd need to set your container to have position:relative first
<butblack>
so it seems like it does refer to the instance method person
<butblack>
* the instance of the class
<apeiros_>
pong?
moos3 has joined #ruby
<Xeago>
aid butblack in my lack of knowledge
<apeiros_>
oh
<apeiros_>
what's unclear? yes, self references to the object in which's scope you are currently
<apeiros_>
within class/module bodies, that's the class/module
<apeiros_>
within methods, it's the object on which the method is called
<apeiros_>
(aka receiver)
devoldmx3 has quit [Ping timeout: 256 seconds]
colonolGron has joined #ruby
leonidlm has quit [Read error: Operation timed out]
ia___ has quit [Quit: ia___]
dambler has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<apeiros_>
butblack: does that answer your question?
freerobby has quit [Quit: Leaving.]
JumpMast3r has joined #ruby
colonolG1on has quit [Ping timeout: 256 seconds]
kirun has quit [Quit: Client exiting]
echevemaster has quit [Ping timeout: 240 seconds]
dmiller has quit [Remote host closed the connection]
bsaboia_ has joined #ruby
moos3 has quit [Quit: Computer has gone to sleep.]
bigmac has joined #ruby
<joshu>
so apeiros_ whatever I have in my dev group I should define as a dev dependency in the gem spec file?
keppy has joined #ruby
dmiller has joined #ruby
<apeiros_>
yupp
<joshu>
ok
<apeiros_>
things you don't need to run your gem are development dependencies
<apeiros_>
i.e., things you only need when you work *on* the gem, as opposed to work *with* the gem
<joshu>
ok
foxiness has quit [Read error: No route to host]
eploko has quit [Quit: Z-z-zzz...]
<joshu>
when running tests with minitest. you test against your library in my case lib/ffm.rb and not bin/ffm?
<apeiros_>
yes
<apeiros_>
the binary in the ideal case is just: MyThingy::CLI.run(ARGV)
<apeiros_>
i.e., you can turn the executable part into a library too
<apeiros_>
and that you can unit test
<joshu>
ok in my case should I leave it as a binary?
danslo has quit [Quit: danslo]
danslo has joined #ruby
senayar has joined #ruby
ivanoats has joined #ruby
mikepack has quit [Remote host closed the connection]
Spooner has quit [Remote host closed the connection]
alexmreis has quit [Quit: Leaving.]
obs has quit [Quit: Saliendo]
RajPi has joined #ruby
forced_request has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby
keppy has quit [Ping timeout: 248 seconds]
RajPi has quit [Remote host closed the connection]
razi has joined #ruby
havenwood has quit [Remote host closed the connection]
Evixion has joined #ruby
shadewind has quit [Quit: Lost terminal]
brendal has quit [Quit: Leaving]
Evixion` has quit [Ping timeout: 240 seconds]
Retistic has quit [Quit: Retistic]
emmanuelux has joined #ruby
verto has joined #ruby
colonolGron has quit [Ping timeout: 246 seconds]
spider-mario has quit [Read error: Connection reset by peer]
RagingDave has quit [Quit: Ex-Chat]
bigmac has quit [Remote host closed the connection]
jjbohn has joined #ruby
monkegjinni has quit [Remote host closed the connection]
justsee has joined #ruby
krombr has joined #ruby
viszu has quit [Quit: Leaving.]
brianherman has joined #ruby
arubin has joined #ruby
kil0byte has quit [Ping timeout: 276 seconds]
yacks has joined #ruby
Dummies_freelanc has joined #ruby
<butblack>
apeiros_: I understand the scope portion, you said "[self] within methods, [references] the object on which the method is called" so in my case it would be the new Person? https://gist.github.com/ebbflowgo/5691941
slash_nick has joined #ruby
slash_nick has joined #ruby
<apeiros_>
butblack: you mean line 4?
<butblack>
apeiros_: precisely
<apeiros_>
on what object do you call the method `person`
<butblack>
it's in rails, I use it in a view
<apeiros_>
(remember that `foo(a,b,c)` is implicitly `self.foo(a,b,c)`)
Michae___ has quit [Remote host closed the connection]
johnkary has quit [Quit: @johnkary]
Michael has joined #ruby
<apeiros_>
well, then `self` would be whatever is the self of/within that view in toplevel code
Michael is now known as Guest77954
<butblack>
yeah.. I guess my real misunderstanding derives from the fact that I don't know what self in the view is
Xeago has quit [Remote host closed the connection]
<joshu>
apeiros_ I have this in my binary lib_dir = File.expand_path('../../lib', __FILE__)
<joshu>
$LOAD_PATH.unshift lib_dir if File.directory?(lib_dir) as you suggested. This enables my binary to load my library. Why is it that my test_helper.rb can load my library WITHOUT that load path defined?
kil0byte has joined #ruby
dmiller has quit [Remote host closed the connection]
<apeiros_>
because you add the lib dir to it somewhere else
<apeiros_>
iirc you had it in your Rakefile
<apeiros_>
also note that the line is only needed when them gem is used without installing it (when it is installed, rubygems adds the lib dir)
<apeiros_>
and even there you can avoid it by using `ruby -Ilib`
malcolmva has quit [Read error: Connection reset by peer]
malcolmva has joined #ruby
akells` has joined #ruby
Shirakawasuna has quit [Quit: Leaving]
<joshu>
apeiros_ this is what I have in my rake file task, task.libs << 'test'
<joshu>
task.pattern = "test/**/*_test.rb"
malcolmva has quit [Read error: Connection reset by peer]
malcolmva has joined #ruby
<joshu>
aren't these two lines only concerned with the "test" folder?
<apeiros_>
hm, right
<apeiros_>
would have to take a look at the code then. but it's still "you somewhere add it"
jjbohn has quit [Quit: Leaving...]
Targen has joined #ruby
timmow has joined #ruby
<joshu>
apeiros_ ok i've been searching to try and figure out why it was working but I can't find where I would be adding it
<joshu>
is there a way when i run the rake test task to see how it is "finding" ffm.rb
Davey has quit [Quit: Computer has gone to sleep.]
bionhart has quit [Remote host closed the connection]
jjbohn has quit [Quit: Leaving...]
predator217 has quit [Ping timeout: 256 seconds]
<apeiros_>
it doesn't happen there
<apeiros_>
you run your tests via `rake test`, right?
<joshu>
yeah
<apeiros_>
you can put `p *$LOAD_PATH` as the first line in your Rakefile
<apeiros_>
do you use rvm?
<joshu>
rbenv
grnman has joined #ruby
timmow has quit [Remote host closed the connection]
<apeiros_>
ok, don't know about rbenv
<apeiros_>
anyway, with that piece of code, you can run `rake -T` and see whether the lib-dir is already loaded at the very start. if not, you can move it around and see, when it starts to appear.
<apeiros_>
(for moving it around, I'd reduce it to only output true/false whether the dir is in, though)