mrsolo has quit [Quit: This computer has gone to sleep]
lyanchih has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
pen has joined #ruby
richardr has joined #ruby
Jetchisel has left #ruby ["Unfortunately time is always against us -- *Morpheus*"]
<richardr>
If I have a class that has global variables defined, and pass it as an object to another class, e.g. Task.new(self), within class how do I access the global vars within the argument passed through?
<richardr>
i.e. config
DonRichie has quit [Ping timeout: 264 seconds]
fgo has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
DonRichie has joined #ruby
kvirani has joined #ruby
starfox21 has quit [Quit: starfox21]
iliketurtles has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
mneorr_ has joined #ruby
Aryasam has joined #ruby
Mars` has joined #ruby
kdaigle has joined #ruby
danman has joined #ruby
danman has quit [Client Quit]
antix_ has quit [Ping timeout: 264 seconds]
v1n has quit [Ping timeout: 256 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
zz_karupanerura is now known as karupa64
karupa64 is now known as karupanerura
simplyaubs has quit [Quit: simplyaubs]
rager is now known as Trufax
mneorr has joined #ruby
mneorr_ has quit [Ping timeout: 252 seconds]
fgo has quit [Ping timeout: 256 seconds]
antix_ has quit [Ping timeout: 240 seconds]
kofno has joined #ruby
verto has quit [Ping timeout: 246 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
pikapp has quit [Quit: leaving]
Guest4307 has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
cooldman224 has joined #ruby
siezer has quit [Ping timeout: 252 seconds]
simplyaubs has joined #ruby
nari has quit [Ping timeout: 264 seconds]
Nogbit has quit [Ping timeout: 260 seconds]
elplatt has quit [Quit: elplatt]
stuartrexking has quit [Quit: Leaving...]
hogeo has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
brennanMKE has joined #ruby
Aryasam_ has joined #ruby
antix_ has quit [Ping timeout: 264 seconds]
emergion has joined #ruby
Aryasam has quit [Read error: Connection reset by peer]
postmodern has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
pen has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 264 seconds]
mneorr has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
ace_striker_ has quit [Ping timeout: 250 seconds]
schaerli has joined #ruby
adeponte has quit [Remote host closed the connection]
Aryasam_ has quit [Ping timeout: 245 seconds]
lewtds has joined #ruby
lewtds has left #ruby [#ruby]
emergion has quit [Quit: Computer has gone to sleep.]
adeponte has joined #ruby
pen has joined #ruby
Aryasam has joined #ruby
antix_ has quit [Ping timeout: 245 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
lukec has quit [Quit: lukec]
antix_ has joined #ruby
Aryasam has quit [Read error: Connection reset by peer]
Aryasam has joined #ruby
brennanMKE has quit [Ping timeout: 252 seconds]
Voodoofish430 has quit [Quit: Leaving.]
schaerli has quit [Ping timeout: 240 seconds]
coderhs has quit [Ping timeout: 246 seconds]
Aryasam has quit [Read error: Connection reset by peer]
Aryasam_ has joined #ruby
kevinykchan has quit [Quit: Computer has gone to sleep.]
Aryasam has quit [Read error: Connection reset by peer]
xcv_ has quit [Remote host closed the connection]
Aryasam has joined #ruby
xcv has joined #ruby
funburn has quit [Quit: funburn]
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
<Zekka>
Let me know if you need further clarification of my problem, although I think the gist I posted (not just code: also a description of the problem) was pretty comprehensive
jhn has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
Guest16316 has quit [Ping timeout: 240 seconds]
Inside has quit [Ping timeout: 240 seconds]
araujo has quit [Quit: Leaving]
<veinofstars>
Zekka: having a look..
xcv has quit [Ping timeout: 245 seconds]
kevinykchan has quit [Quit: Computer has gone to sleep.]
Aryasam has quit [Ping timeout: 260 seconds]
antix_ has joined #ruby
simplyaubs has joined #ruby
<veinofstars>
Zekka: one idea…define your ProblemPartNs as modules, and include them as needed in Problem
<apeiros>
Zekka: it's a bit too abstract for me. but one thing I wondered is how you think in problem parts, as opposed to "a problem", and "solution parts". but maybe that's just naming and not much related to your approach.
headius has joined #ruby
<Zekka>
apeiros - They're closer to solution parts: each solves a small part of the problem
<Zekka>
the problem parts manipulate a specific kind of data that occurs in the problem, and define some operations on it.
<apeiros>
Zekka: I think in "a problem" + "solvers", I'd have the config be part of the problem object
<Zekka>
veinofstars - That sounds reasonable, but I think I actually need the object-style semantics
Inside has joined #ruby
<veinofstars>
why do you think that?
<veinofstars>
you should still be able to access assumed instance variables in the modules
fixl has quit [Remote host closed the connection]
<Zekka>
The problem parts aren't just instantiated one and then used: each stores some data related to the problem and there can be multiple of each
<sweeper>
Zekka: the only good way to share state is by passing messages :3
<apeiros>
you can use extend to have the modules only on single problem instances
<Zekka>
sweeper - I'm afraid that I'm about to learn that lesson, yes.
antix_ has quit [Ping timeout: 240 seconds]
<Zekka>
apeiros - I'm not quite sure I follow. If some details are a little unclear, I can write up another example
tjbiddle has quit [Quit: tjbiddle]
Targen has quit [Read error: Operation timed out]
<Zekka>
(My code is pretty long and not all of it is in one file, so I figure examples might be more useful)
<apeiros>
Zekka: that was related to veinofstars' suggestion
antix_ has joined #ruby
<apeiros>
in ruby, you can do: a = Foo.new; b = Foo.new; a.extend SomeModule; a.method_of_some_module # b does not have method_of_some_module, only a
<Zekka>
That actually looks pretty close to what I'd like.
emergion has quit [Quit: Computer has gone to sleep.]
<Zekka>
Thanks: I'm still not all that comfortable with Ruby's mixin model and I appreciate the guidance.
schaerli has joined #ruby
<veinofstars>
take a chance, try it out :)
<Zekka>
I'd still have to use explicit message-passing rather than scope manipulation, but Sweeper's probably right that it's safer
aspires has quit [Quit: aspires]
<apeiros>
schaerli: up early?
<apeiros>
or home late? :D
digital-ghost has quit [Remote host closed the connection]
agjacome has quit [Quit: leaving]
AlSquire has quit [Quit: This computer has gone to sleep]
raphaelivan has joined #ruby
ewnd9 has joined #ruby
antix_ has quit [Ping timeout: 240 seconds]
SkuliOskarsson has quit [Quit: SkuliOskarsson]
schaerli has quit [Ping timeout: 245 seconds]
<Zekka>
Revised design in progress: the Problem object will tell every ProblemPart (or SolutionPart, I suppose) to extend it, and it will keep track of the shared state
antix_ has joined #ruby
Mars` has quit [Remote host closed the connection]
Mars` has joined #ruby
richardr has quit [Remote host closed the connection]
soheil has joined #ruby
endash has joined #ruby
reset has quit [Ping timeout: 240 seconds]
Mars` has quit [Ping timeout: 264 seconds]
antix_ has quit [Ping timeout: 245 seconds]
kmurph has quit [Quit: kmurph]
DaZ has joined #ruby
pairup has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
petey has quit [Remote host closed the connection]
nfk has quit [Quit: yawn]
petey has joined #ruby
cfi30_ has joined #ruby
soheil has quit [Ping timeout: 252 seconds]
narcan has joined #ruby
cfi30 has quit [Ping timeout: 264 seconds]
petey has quit [Ping timeout: 245 seconds]
senayar has joined #ruby
antix_ has quit [Ping timeout: 256 seconds]
antix_ has joined #ruby
Xeago has joined #ruby
dustyfields has joined #ruby
dbjeepn has joined #ruby
aryaching has joined #ruby
krz has joined #ruby
krz has joined #ruby
krz has quit [Changing host]
i_s has joined #ruby
senayar has quit [Ping timeout: 252 seconds]
jefflyne1 has quit [Ping timeout: 252 seconds]
pairup has quit [Quit: See ya later.]
antix_ has quit [Ping timeout: 245 seconds]
Bosox20051 has joined #ruby
Xeago has quit [Ping timeout: 246 seconds]
antix_ has joined #ruby
dbjeepn has quit [Client Quit]
headius has quit [Quit: headius]
freerobby has joined #ruby
aggregatebot has quit [Remote host closed the connection]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
bline79_ has joined #ruby
xkickflip has quit [Quit: h..hi]
karupanerura is now known as zz_karupanerura
deens has joined #ruby
narcan has joined #ruby
antix_ has quit [Ping timeout: 256 seconds]
antix_ has joined #ruby
kmurph has joined #ruby
elplatt has quit [Quit: elplatt]
luckyruby has quit [Remote host closed the connection]
Hobogrammer has joined #ruby
luckyruby has joined #ruby
elplatt has joined #ruby
coderhs has joined #ruby
Hobogrammer has quit [Read error: Connection reset by peer]
T_T has quit [Remote host closed the connection]
Hobogrammer has joined #ruby
blackratdog has joined #ruby
raphaelivan has quit [Quit: Leaving.]
mayorga has quit [Ping timeout: 256 seconds]
antix_ has quit [Ping timeout: 260 seconds]
jarm has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
airtonix_ is now known as airtonix
zz_karupanerura is now known as karupa64
conner has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
antix_ has quit [Ping timeout: 264 seconds]
karupa64 is now known as zz_karupa64
antix_ has joined #ruby
krz has quit [Quit: krz]
Tearan has joined #ruby
riku- has quit [Ping timeout: 260 seconds]
sleepshuck has quit [Ping timeout: 246 seconds]
kmurph has quit [Quit: kmurph]
riku has joined #ruby
dustyfields has quit [Remote host closed the connection]
riku is now known as Guest95456
Inside has quit [Ping timeout: 260 seconds]
alvaro_o has quit [Quit: Ex-Chat]
antix_ has quit [Ping timeout: 256 seconds]
antix has joined #ruby
antix has joined #ruby
antix has quit [Changing host]
kdaigle has joined #ruby
antix is now known as Guest1150
kvirani has quit [Remote host closed the connection]
kvirani has joined #ruby
zz_tsykoduk is now known as tsykoduk
Deele has quit [Ping timeout: 260 seconds]
aspires has joined #ruby
michael_mbp is now known as zz_michael_mbp
drumsrgr8forn8 has joined #ruby
zz_michael_mbp is now known as michael_mbp
Guest1150 has quit [Ping timeout: 256 seconds]
kvirani has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
danshultz has quit [Remote host closed the connection]
PragCypher has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
decoponio has joined #ruby
deens has quit [Quit: deens]
blackratdog has quit [Quit: This computer has gone to sleep]
antix_ has quit [Ping timeout: 264 seconds]
drumsrgr8forn8 has quit [Quit: Konversation terminated!]
drumsrgr8forn8_ has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
kaspergrubbe has quit [Ping timeout: 245 seconds]
Matix has quit [Quit: Leaving]
zz_karupa64 is now known as karupa64
dbjeepn has joined #ruby
Tearan has quit [Quit: Sleepy Badger....]
antix_ has quit [Ping timeout: 246 seconds]
Mars` has joined #ruby
Cyrus has quit [Quit: Cyrus.close()]
antix_ has joined #ruby
Tearan has joined #ruby
drumsrgr8forn8_ has quit [Ping timeout: 240 seconds]
kdaigle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
headius has joined #ruby
apeiros has quit [Remote host closed the connection]
simplyaubs has quit [Quit: simplyaubs]
apeiros has joined #ruby
dbjeepn has quit [Quit: Leaving...]
<i8igmac>
how would you display a directory list by new'st to oldest? Dir.glob("*")
<i8igmac>
newest
<i8igmac>
newist
<i8igmac>
nooest
antix_ has quit [Ping timeout: 256 seconds]
<i8igmac>
knew'st
<i8igmac>
modification date
simplyaubs has joined #ruby
antix_ has joined #ruby
w3pm has quit [Ping timeout: 246 seconds]
Tearan has quit [Quit: Sleepy Badger....]
mrsolo has quit [Quit: This computer has gone to sleep]
Xeago has joined #ruby
twoism has joined #ruby
twoism has quit [Remote host closed the connection]
Akuma has joined #ruby
twoism has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
antix_ has quit [Ping timeout: 245 seconds]
antix_ has joined #ruby
Xeago has quit [Ping timeout: 246 seconds]
dbjeepn has joined #ruby
antix_ has quit [Ping timeout: 245 seconds]
brennanMKE has quit [Remote host closed the connection]
antix_ has joined #ruby
robbyoconnor has joined #ruby
Guest66192 has joined #ruby
Tearan has joined #ruby
Kabaka has quit [Ping timeout: 240 seconds]
gwb3 has quit [Read error: Connection reset by peer]
elplatt has quit [Remote host closed the connection]
dallasm has quit [Read error: Connection reset by peer]
ged has joined #ruby
dallasm has joined #ruby
kmurph has quit [Quit: kmurph]
aspires has quit [Quit: aspires]
antix_ has quit [Ping timeout: 246 seconds]
antix_ has joined #ruby
bsaboia_ has quit [Remote host closed the connection]
pjackson_desktop has joined #ruby
kevinykchan has joined #ruby
faoiseamh has quit [Ping timeout: 248 seconds]
postmodern has quit [Quit: Leaving]
jiyinyiyong has joined #ruby
Akuma has quit [Ping timeout: 264 seconds]
aspires has joined #ruby
jefflyne1 has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
LLckfan has joined #ruby
<LLckfan>
I have a Gateway laptop and when I opened the lid the power light was on but the laptop was asleep. When I pushed the power it started flashing with the lights for the light bulb and the battery but only when it was plugged in. Is this a sign I need a new tip end for my charger?
Vivekananda has quit [Ping timeout: 252 seconds]
Xeago has joined #ruby
antix_ has quit [Ping timeout: 264 seconds]
<onewheelskyward>
I don't know but for sure you need to update your ruby version.
mercwithamouth has joined #ruby
Akuma has joined #ruby
antix_ has joined #ruby
<xybre>
LLckfan: They still make Gateway laptops?
ehc has quit [Quit: ehc]
pwh has quit []
mansi has quit [Ping timeout: 264 seconds]
Banistergalaxy has quit [Ping timeout: 260 seconds]
Xeago has quit [Ping timeout: 246 seconds]
mansi has joined #ruby
Banistergalaxy has joined #ruby
antix_ has quit [Ping timeout: 260 seconds]
antix_ has joined #ruby
mrsolo has joined #ruby
mrsolo has quit [Remote host closed the connection]
Zerogrifter has quit [Ping timeout: 264 seconds]
osvico has joined #ruby
ehc has joined #ruby
zeropx has quit [Read error: Connection reset by peer]
AntelopeSalad has quit [Read error: Connection reset by peer]
zeropx has joined #ruby
AntelopeSalad has joined #ruby
Targen has joined #ruby
antix_ has quit [Ping timeout: 252 seconds]
antix_ has joined #ruby
SilverKey has quit [Quit: Zzzzzz.]
ace_striker has quit [Ping timeout: 250 seconds]
cfi30_ has quit [Quit: ;]
jarm has quit [Ping timeout: 252 seconds]
antix_ has quit [Ping timeout: 264 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
iliketurtles has joined #ruby
iliketurtles has quit [Client Quit]
joshwines_ has quit [Remote host closed the connection]
joshwines has quit [Remote host closed the connection]
aspires has quit [Quit: aspires]
antix_ has quit [Ping timeout: 241 seconds]
mrsolo has joined #ruby
antix_ has joined #ruby
dhruvasagar has joined #ruby
antix_ has quit [Ping timeout: 240 seconds]
antix has joined #ruby
antix is now known as Guest85369
io_syl has quit []
ehc has quit [Quit: ehc]
LLckfan has quit []
pnbeast has quit [Quit: leaving]
lyanchih has quit [Quit: lyanchih]
aspires has joined #ruby
mansi has quit [Remote host closed the connection]
Guest85369 has quit [Ping timeout: 264 seconds]
mansi has joined #ruby
antix_ has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
soulcake_ has quit [Read error: Connection reset by peer]
soulcake has joined #ruby
freerobby has joined #ruby
conner has quit [Ping timeout: 245 seconds]
angelxmoreno has quit [Remote host closed the connection]
aagdbl has joined #ruby
DonRichie has quit [Ping timeout: 252 seconds]
angelxmoreno has joined #ruby
angelxmoreno has quit [Read error: Connection reset by peer]
DonRichie has joined #ruby
mansi has quit [Ping timeout: 260 seconds]
dik_dak has joined #ruby
<n88>
i'm issuing a request that returns a large xml response... what can i use to better display/visualize the structure of it ?
angelxmoreno has joined #ruby
antix_ has quit [Ping timeout: 245 seconds]
antix_ has joined #ruby
antix_ has joined #ruby
BizarreCake has joined #ruby
conner has joined #ruby
RORgasm_ has joined #ruby
RORgasm has quit [Read error: Connection reset by peer]
hakunin_ has joined #ruby
hakunin has quit [Read error: Connection reset by peer]
Barrin6 has joined #ruby
WillAmes has quit [Ping timeout: 248 seconds]
ChronocityLC has joined #ruby
antix_ has quit [Ping timeout: 245 seconds]
<onewheelskyward>
nokogiri?
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
osvico has quit [Ping timeout: 252 seconds]
iliketurtles has joined #ruby
RangerMauve has joined #ruby
sergicles_ has joined #ruby
veinofstars has quit [Quit: veinofstars]
kilophoton has quit [Ping timeout: 260 seconds]
sergicles has quit [Ping timeout: 256 seconds]
angelxmoreno has quit [Read error: Connection reset by peer]
sergicles_ is now known as sergicles
angelxmoreno has joined #ruby
antix_ has quit [Ping timeout: 260 seconds]
postmodern has joined #ruby
antix_ has joined #ruby
dik_dak has quit [Quit: Leaving]
Xeago has joined #ruby
gja has joined #ruby
coderhs has quit [Ping timeout: 264 seconds]
sergicles_ has joined #ruby
noop has joined #ruby
simplyaubs has quit [Quit: simplyaubs]
sergicles has quit [Ping timeout: 264 seconds]
sergicles_ is now known as sergicles
Xeago has quit [Read error: Operation timed out]
jefflyne1 has quit [Ping timeout: 264 seconds]
antix_ has quit [Ping timeout: 246 seconds]
kmurph has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
helloworld has quit [Ping timeout: 245 seconds]
lyanchih has joined #ruby
Tearan has joined #ruby
tomzx_mac has quit [Read error: Connection reset by peer]
tomzx_mac has joined #ruby
antix_ has quit [Ping timeout: 260 seconds]
antix_ has joined #ruby
aagdbl has quit [Quit: Leaving.]
tvw has joined #ruby
<weeb1e>
xybre: I thought of another AS feature I use :P
RichardBaker has joined #ruby
<weeb1e>
String#starts_with? and String#ends_with? sound a lot better than start_with? and end_with?
Macaveli has quit [Remote host closed the connection]
Xiti` has joined #ruby
<udoprog>
ace_striker: I would guess that the git user (role) is missing in the postgres database
banisterfiend has quit [Quit: Computer has gone to sleep.]
Xiti has quit [Ping timeout: 245 seconds]
aspires has quit [Quit: aspires]
Mars` has quit [Ping timeout: 264 seconds]
antix_ has quit [Ping timeout: 245 seconds]
<ace_striker>
udoprog: thanks for reply..i already did sudo -u git -H bundle install --deployment --without development test mysql aws
amacgregor_ has joined #ruby
antix_ has joined #ruby
<ace_striker>
do i have to do some chown operations.
amacgregor has quit [Ping timeout: 246 seconds]
<udoprog>
ace_striker: don't know, I'm just decoding your error. You should probably get comfortable with connecting to the database directly and checking that everything got migrated the way you expect it to be
<ace_striker>
ok..i will to fight with it .i guess
<ace_striker>
*will have
dzhulk has quit [Quit: Leaving.]
xkickflip has joined #ruby
tonni has quit [Remote host closed the connection]
Xeago has joined #ruby
ecksit has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
<ecksit>
hey, is anyone using thor? i am trying to make a cli app that uses colons to separate commands instead of a space.
antix_ has quit [Ping timeout: 245 seconds]
jefflyne1 has joined #ruby
antix_ has joined #ruby
Vivekananda has quit [Read error: Connection reset by peer]
coderhs has joined #ruby
alexju_ has quit [Remote host closed the connection]
alexju has joined #ruby
Xeago has quit [Ping timeout: 264 seconds]
Hanmac1 has joined #ruby
ecksit has quit [Quit: Computer has gone to sleep.]
tonini_ has quit [Ping timeout: 260 seconds]
antix_ has quit [Ping timeout: 246 seconds]
RangerMauve has left #ruby [#ruby]
echevemaster has quit [Ping timeout: 245 seconds]
antix_ has joined #ruby
schaerli has quit [Remote host closed the connection]
alexju has quit [Ping timeout: 264 seconds]
Hanmac has quit [Ping timeout: 260 seconds]
Mars` has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
Hanmac has joined #ruby
nyuszika7h has left #ruby ["WeeChat 0.4.2-rc2"]
diegoviola has joined #ruby
Hanmac1 has quit [Ping timeout: 245 seconds]
antix_ has quit [Ping timeout: 264 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
echevemaster has joined #ruby
sectionme has joined #ruby
noop has quit [Ping timeout: 240 seconds]
mercwithamouth has quit [Ping timeout: 256 seconds]
nisstyre has joined #ruby
mklappstuhl has joined #ruby
fgo has joined #ruby
Hanmac1 has joined #ruby
fgo has quit [Remote host closed the connection]
fgo has joined #ruby
sectionme has quit [Ping timeout: 246 seconds]
antix_ has quit [Ping timeout: 256 seconds]
antix_ has joined #ruby
Hanmac has quit [Ping timeout: 264 seconds]
Advocation has quit [Quit: Advocation]
Advocation has joined #ruby
cj3kim has joined #ruby
antix_ has quit [Ping timeout: 260 seconds]
deanrock0 has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
seoNinjaWarrior has quit [Read error: Connection reset by peer]
apeiros has quit [Remote host closed the connection]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
apeiros has joined #ruby
<Hanmac>
yeah let us use our ruby-voodoo dolls to torture him for this sentences ;D
kdaigle has joined #ruby
fgo_ has quit [Remote host closed the connection]
<waxjar>
i like that they mentioned dep
<shevy>
never heard of it before
<shevy>
Hanmac, do you use bundler?
ewnd9 has quit [Ping timeout: 240 seconds]
<Hanmac>
not that i know ;P
<shevy>
aside from the ... very opinionated stuff on the blog entry, it has some other things that are new to me. like: "Evan created Puma to meet the need for a fast web server"
freerobby has quit [Ping timeout: 245 seconds]
<waxjar>
dep is really nice and simple
<shevy>
a web server called puma! if that is not built for speed ... :D
* shevy
will work on a web server called snailserve ...
* Hanmac
prefers rake for this stuff
<ker2x_>
can't convert nil into String (TypeError) <- why not ? o_O
banisterfiend has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
<Hanmac>
ker2x_: there is a difference between to_s and to_str
<ker2x_>
so i should use to_str ?
<Hanmac>
hm nope, i mean nil does not have an auto convert to string
antix_ has quit [Ping timeout: 240 seconds]
igas has joined #ruby
antix has joined #ruby
<ker2x_>
what should i do then ? i parse a long json and create a long sql query from it. and some json parameters are optional
<afrodiziak>
can someone explain me a bit how passing by ref/value works in ruby... how can i achieve that the change of a string stays only in a methode when i do splice to delete some chars and when i go out of the function i want from variable that has been given as an argument to stay the same
<waxjar>
also, i think you've got an sql injection vulnerability there
<ker2x_>
good, now i'm back to my original problem : ERROR: invalid input syntax for type timestamp: "1380973465.22" (PG::InvalidDatetimeFormat) :))
<ker2x_>
thank you
<waxjar>
(and obj is probably the least descriptive variable name you can use in Ruby :P)
kdaigle has joined #ruby
mary5030 has joined #ruby
antix_ has quit [Ping timeout: 264 seconds]
<Hanmac>
ker2x_: the bang-methods are useful in conditions, like
<afrodiziak>
right, but i read somewhere that ruby used passing by value
IceyEC has joined #ruby
<afrodiziak>
that means i dont have to copy it
<apeiros>
afrodiziak: on what level?
nari has joined #ruby
<afrodiziak>
it should work like that straight from the box
<apeiros>
in ruby, you pass objects
hackeron has joined #ruby
<apeiros>
there's no such thing as a reference on rubys own level
<afrodiziak>
right, so if i change them inside the function theyy are changed outside always?
<apeiros>
of course
antix_ has joined #ruby
<afrodiziak>
ok, thx
<apeiros>
that's the same in JS too btw., just that JS doesn't have mutable strings. all methods return a copy there.
mary5030 has quit [Remote host closed the connection]
alexju has joined #ruby
ewnd9 has joined #ruby
IceyEC has quit [Client Quit]
duggiefresh has quit [Remote host closed the connection]
<afrodiziak>
is it normal to make copies like that every time?
<afrodiziak>
with ruby
<afrodiziak>
i find it unnantural
<apeiros>
afrodiziak: you cite javascript string manipulation and find it unnatural?
tonini_ has quit [Ping timeout: 240 seconds]
<apeiros>
as I just said: that's *exactly* what you do in JS
<afrodiziak>
no, javascript passing by reference and value as explained in the link i sent above
<apeiros>
what "no"?
kdaigle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<afrodiziak>
if its a string or integer for example in js it will not be changed
<afrodiziak>
if its an object then you work directly with it and it will be changed
<apeiros>
afrodiziak: yes, because *you create copies*
<apeiros>
as I said: every string method in js creates a copy
<afrodiziak>
its called passing by value as far as i know
antix_ has quit [Ping timeout: 264 seconds]
<canton7>
afrodiziak, yes. passing by value = making a copy
<afrodiziak>
ok
<afrodiziak>
we agree on that
tvw has quit []
<apeiros>
that's not what js does
schaerli has quit [Remote host closed the connection]
antix_ has joined #ruby
<apeiros>
try this: function x(obj) { obj.x = 1 }; o = {x: 100}; x(o); o.x
<apeiros>
tell me what x returns
<afrodiziak>
i said about this case "if its an object then you work directly with it and it will be changed"
<apeiros>
JS does *exactly* the same as ruby. it passes objects. if you modify the object, it's reflected everywhere where you access that object.
schaerli has joined #ruby
<apeiros>
afrodiziak: same for string, just that you *CANT CHANGE A STRING*
<apeiros>
argh, how difficult can it be to grasp that.
<apeiros>
with js, you can't do this with strings: x = "foo"; foo(x); x // => "FOO"
<apeiros>
it's not possible. not because of how objects (or primitves) are passed, but because you CANT MUTATE a string.
<afrodiziak>
its not, string are also objects so they are passed as reference in ruby
notjohn has joined #ruby
<apeiros>
walls
<apeiros>
no use talking to them
<apeiros>
afrodiziak: believe whatever the fuck you want to.
* apeiros
off, got better things to do
IceyEC has joined #ruby
<canton7>
this sounds like fun :P what exactly is the confusion, afrodiziak?
<afrodiziak>
canton7 there is none if this is right "string are also objects so they are passed as reference in ruby" ?
<canton7>
strings are passed by reference in both javascript and ruby. it's a subtle point, but everything is passed by reference in ruby, it's just that some things (like numbers) are immutable, so give the appearance of being passed by value
coderhs has joined #ruby
schaerli has quit [Ping timeout: 256 seconds]
<apeiros>
it might even be that a JS runtime choses to pass string primitives by value. but that's an implementation detail and has nothing to do with the exposed behavior.
antix_ has quit [Ping timeout: 264 seconds]
<apeiros>
also it's entirely irrelevant because the representation of strings within JS itself and the language used to implement the interpreter will differ anyway.
banisterfiend has quit [Quit: Computer has gone to sleep.]
antix_ has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
<canton7>
I can't honestly imagine that it does - that's a huge inefficiency
<canton7>
Yeah there are sources out there saying that string are passed by value in JS
<canton7>
sorry, passed by REFERENCE
<canton7>
it's just that they're immutable, so behave like stuff passed by value
<apeiros>
canton7: same here. but as said, it wouldn't even matter if it did.
<afrodiziak>
canton7 sure, thanks
<canton7>
afrodiziak, I think he's wrong. They just appear to be passed by value because of the immutability. As apeiros says, it's an implementation detail
duggiefresh has joined #ruby
kleinerdrache has joined #ruby
chairabanta has joined #ruby
<canton7>
>> def foo(x); x.object_id; end; a = 1; p [a.object_id, foo]
<eval-in>
canton7 => wrong number of arguments (0 for 1) (ArgumentError) ... (https://eval.in/52797)
<canton7>
>> def foo(x); x.object_id; end; a = 1; p [a.object_id, foo(a)]
<apeiros>
(and yes, that's 2 backslashes - don't forget that you look at an inspect)
<Hanmac>
huch?
<apeiros>
Hanmac: \ is escaped in ' too (\ and ' are the only sequences in single quoted strings)
zarubin has joined #ruby
<kleinerdrache>
ok, thanks
fgo has joined #ruby
forced_request has joined #ruby
<kleinerdrache>
can i open a read write process and have pipes somehow?
Guest60823 has quit [Ping timeout: 240 seconds]
guillaum has joined #ruby
osvico has joined #ruby
antix_ has joined #ruby
alexju_ has quit [Remote host closed the connection]
Ahti333 has joined #ruby
Kruppe has quit [Ping timeout: 240 seconds]
Lorn has quit [Ping timeout: 240 seconds]
cha1tanya has joined #ruby
<apeiros>
kleinerdrache: take a look at popen and spawn
alexju has joined #ruby
Ace__ has quit [Ping timeout: 240 seconds]
zeusmns has quit [Ping timeout: 240 seconds]
Ace__ has joined #ruby
chairabanta has quit [Ping timeout: 256 seconds]
Lorn_ has joined #ruby
chairabanta has joined #ruby
Kruppe has joined #ruby
blackmesa has joined #ruby
guillaum has quit [Ping timeout: 252 seconds]
<ker2x_>
woooooooooooooo it works \o/
<ker2x_>
thank you for your help. now i can be in weekend :)
zeusmns has joined #ruby
bline79_ has quit [Read error: Connection reset by peer]
<ker2x_>
my proof of concept is ok. i know a coder that will have some work to do monday :(and it's not me \o/) :)
antix_ has quit [Ping timeout: 252 seconds]
IceyEC has quit [Quit: IceyEC]
fgh2 has joined #ruby
<ker2x_>
see you later. have fun :)
cads has quit [Read error: Operation timed out]
antix_ has joined #ruby
Ziarkaen has joined #ruby
IceyEC has joined #ruby
ker2x_ has quit [Quit: ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]]
IceyEC has quit [Client Quit]
<kleinerdrache>
how can i write a end of string or something, or end of file to an IO.popen instance?
<apeiros>
you close the write end
<apeiros>
close_write, iirc
fgh has quit [Read error: Connection reset by peer]
<kleinerdrache>
apeiros, thats great, thanks
kdaigle has joined #ruby
Aryasam has joined #ruby
banisterfiend has joined #ruby
afrodiziak has quit [Quit: Going offline, see ya! (www.adiirc.com)]
antix_ has quit [Ping timeout: 240 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
fgo has quit [Remote host closed the connection]
Xeago has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
kdaigle has quit [Ping timeout: 245 seconds]
goganchic has quit []
aryaching has joined #ruby
antix_ has quit [Ping timeout: 240 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
Xeago has quit [Ping timeout: 252 seconds]
mklappstuhl has joined #ruby
kdaigle has joined #ruby
apeiros has quit [Remote host closed the connection]
noop has joined #ruby
Aryasam has quit [Quit: Bye]
antix_ has quit [Ping timeout: 264 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
cha1tanya has quit [Ping timeout: 264 seconds]
fgo has joined #ruby
JonTheNiceGuy has joined #ruby
kdaigle has quit [Ping timeout: 252 seconds]
lkba has quit [Ping timeout: 240 seconds]
antix_ has quit [Ping timeout: 246 seconds]
Lewix has joined #ruby
Lewix has quit [Read error: Connection reset by peer]
<JonTheNiceGuy>
Hi, this is a really newbie-ish question, but I'm trying to use a ruby app called showoff (github.com/puppetlabs/showoff - branch "v0.9.2"), and I'm getting what appears to be a stack trace when it's trying to resize an image using imagemagick. I've installed rmagick, both using Gem and, when that didn't work, removed it and tried again using apt-get install gem-plugin-rmagick. The error I'm getting is "NoMethodError - undefined
<JonTheNiceGuy>
method `has_key?' for nil:NilClass:" followed by a stacktrace - happy to provide the full stack trace, or content and images. Alternatively, if there's a "preferred distro" I could be using with something like vagrant, for fixed troubleshooting, that would be good too! I'm using the packaged version of Ruby from Kubuntu 13.04 which is 1.9.3p194 (2012-04-20 revision 35410) on an x64 Linux box
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
DaZ has quit [Read error: Operation timed out]
bean has joined #ruby
antix_ has quit [Ping timeout: 264 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
starfox21_ has joined #ruby
starfox21_ has quit [Client Quit]
freerobby has joined #ruby
starfox21 has quit [Ping timeout: 256 seconds]
niklasb has joined #ruby
DaZ has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
scarolan has joined #ruby
lord1234 has joined #ruby
<lord1234>
is freeze a deprecated method?
dzhulk1 has quit [Quit: Leaving.]
antix_ has quit [Ping timeout: 260 seconds]
scarolan_ has quit [Ping timeout: 256 seconds]
IceyEC has joined #ruby
kdaigle has joined #ruby
antix_ has joined #ruby
<Hanmac>
lord1234: why do you guess that?
lkba has joined #ruby
schaerli has joined #ruby
T_T has joined #ruby
<shevy>
lord1234 dont think it is
<shevy>
I'd wish it were
michael_mbp is now known as zz_michael_mbp
zz_michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby
apeiros has joined #ruby
mansi has joined #ruby
antix_ has quit [Ping timeout: 246 seconds]
bline79_ has joined #ruby
antix_ has joined #ruby
mansi has quit [Remote host closed the connection]
mansi has joined #ruby
gja has joined #ruby
krz has joined #ruby
krz has quit [Changing host]
krz has joined #ruby
sectionme has joined #ruby
kdaigle has quit [Ping timeout: 264 seconds]
alyi has joined #ruby
mansi has quit [Ping timeout: 246 seconds]
bean has quit [Quit: Computer has gone to sleep.]
KobraKao has joined #ruby
antix_ has quit [Ping timeout: 256 seconds]
banisterfiend has quit [Quit: Computer has gone to sleep.]
antix has joined #ruby
antix has joined #ruby
antix has quit [Changing host]
kdaigle has joined #ruby
sectionme has quit [Ping timeout: 256 seconds]
khushildep has joined #ruby
antix is now known as Guest56823
volty has joined #ruby
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
bean has joined #ruby
<volty>
hi, a method that returns all the keywords ?
<shevy>
cc1plus: all warnings being treated as errors
<shevy>
rubinius does not wanna build for me
<shevy>
volty not sure there is one
Tearan has joined #ruby
<volty>
pity
IceyEC has quit [Quit: IceyEC]
Jetchisel has joined #ruby
<apeiros>
volty: there's none. check zenspiders quickref. it afaik lists all.
<shevy>
alias and BEGIN begin break case class def defined? do else elsif
<shevy>
END end ensure false for if in module next nil not or redo
<shevy>
rescue retry return self super then true undef unless until when while yield
<shevy>
hmmmm
<shevy>
I may have forgotten a few...
<shevy>
38 only? hmmm
KobraKao has quit [Quit: Saindo]
Guest92381 has joined #ruby
choobie has quit [Remote host closed the connection]
<volty>
apeiros: i would like to get a list dynamically, i see the list on rdoc, will see zenspider's too, thanks
Guest56823 has quit [Ping timeout: 240 seconds]
<apeiros>
volty: it hasn't changed in the last 10 years afaik
<apeiros>
i.e., little gain from getting it dynamically.
<shevy>
volty idea!
<shevy>
volty file an issue at the bug tracker :)
* apeiros
wonders where getting keywords dynamically is actually a use case
<shevy>
RUBY_CONSTANTS
<shevy>
I am silly
<apeiros>
you mean RUBY_KEYWORDS ?
<shevy>
RUBY_KEYWORDS
<shevy>
yeah
<volty>
apeiros: little but (would be more) elegant, for a syntax highlighter
<shevy>
dunno why I thought about constants suddenly...
wesside has joined #ruby
Xeago has joined #ruby
senayar has joined #ruby
fgo has quit [Remote host closed the connection]
<krz>
im playing around with a personal mini orm for a db solution. when the class is called (ie User) should trigger something like this: $rethinkdb.table(class_name). I can do this with an extend and a module, in some method. however, im trying figure out where to define this functionality. should i be using a class variable?
<volty>
yes ruby keywords, def, begin, end // all that is in
nisstyre has quit [Remote host closed the connection]
<apeiros>
krz: if "class variable" is the answer, then you're asking the wrong question :-p
<apeiros>
krz: class instance variable is usually what people want when they use class variables.
<krz>
apeiros: yeap. the comment on line 21 probably needs working on. so are instance variables fine for this case?
<apeiros>
yes
<krz>
no issues with race conditions?
alekst has joined #ruby
<apeiros>
and that comment there makes no sense whatsoever
<krz>
yea its a new orm
<krz>
orm/odm
<apeiros>
what kind of variable is unrelated to raciness. sharing is what matters.
alekst has quit [Client Quit]
<krz>
if the author is using an instance variable, that also means the class that includes the module SHOULD not be able to define @table again, right? i.e. @table is reserved
tonni has quit [Remote host closed the connection]
<apeiros>
o0
<apeiros>
you can't reserve variable names in ruby
<apeiros>
you have scopes, and some code has a different scope so it won't be able to access it.
<krz>
no your cant. but the consensus is just that. the orm breaks if @table is defined in the class that includes the module
<apeiros>
with instance variable, the scope is not lexical. it depends on the context of `self`. same self -> same ivars.
<apeiros>
so it doesn't matter where your method/code is defined which accesses an ivar. it only depends in what object's context it is evaluated.
<krz>
class includes a module. the module defines an instance variable. the class has access to that instance variable
<apeiros>
no
yxhuvud has joined #ruby
yxhuvud has quit [Client Quit]
<krz>
hmm ill give this a shot
kdaigle has joined #ruby
Xeago_ has joined #ruby
elaptics`away is now known as elaptics
<volty>
it depends on what krz means by 'defines an instance variable' -- it is different from 'creates an instance variable' - that the class can access
Xeago_ has quit [Read error: Operation timed out]
<volty>
but to create an instance variable from a module you have to do it through an instance method (and call it)
yxhuvud2 has joined #ruby
kleinerdrache has quit [Quit: Ex-Chat]
svector has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
yxhuvud2 has quit [Read error: Connection reset by peer]
s0ber has quit [Remote host closed the connection]
jefflyne1 has joined #ruby
s0ber has joined #ruby
yxhuvud has joined #ruby
afrodiziak has joined #ruby
Ox6abe has joined #ruby
SHyx0rmZ has joined #ruby
kreeves has joined #ruby
<shevy>
volty where did you find keywords.rb in the ruby source btw?
tkuchiki has joined #ruby
zweistein has joined #ruby
<volty>
last night (or better: this night :) ) I read a doc that says we should think more about self -- that is the key for understanding how ruby works
<shevy>
ruby is so selfish
<shevy>
damn it... I searched my hdd for a file called keywords.rb and did not find one
<volty>
shevy: i didn't find it, i saw it there, on the rdoc page (corner up left)
<volty>
never mind, i pasted the list and saw that i missed half of the keybords :)
<volty>
s/i missed/i was missing/
<apeiros>
s/keybords/keyboards/i worsprovement!
banisterfiend has joined #ruby
<volty>
:)
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
lol
<shevy>
you use too many keyboards perhaps
<shevy>
or keyboars
* apeiros
can't motivate himself to code :-|
spike|spiegel has quit [Quit: WeeChat 0.4.1]
mklappstuhl has quit [Ping timeout: 241 seconds]
eka has joined #ruby
<volty>
it happens only when I'm thinking about other things, i make no mistakes when I retype something without thinking
JonTheNiceGuy has quit [Quit: No Ping reply in 180 seconds.]
<volty>
apeiros: your neural needs time to re-organize itself
<apeiros>
I remember when I was fresh into ruby (from php, with mysql), had a class with an ivar @myself, and my hands would automatically type it as mysqlf
<volty>
it's normal
mklappstuhl has joined #ruby
<svector>
why should I use the send method when I can directly make the call?
<apeiros>
svector: you shouldn't
<svector>
so there is no advantage at all?
<svector>
I mean difference...
<apeiros>
if you can call it directly, no.
spike|spiegel has joined #ruby
<apeiros>
you use send either because you want to call a private method or because you want to call a method dynamically by name (e.g. have the name in a variable)
<apeiros>
if none of that is the case, it's even a bad idea to use send.
<svector>
aha, so I can call private methods with send ?
<apeiros>
yes
Nss has quit [Ping timeout: 246 seconds]
<svector>
apeiros, thanks
<apeiros>
which is why you should generally use public_send, not send
<apeiros>
(for the dynamically calling methods part)
<svector>
got it. Never saw public_send actually. Will use that if I have to
<apeiros>
it's relatively new (1.9+)
khushildep has quit [Quit: khushildep]
<svector>
oh okay
<apeiros>
and "relative" here means: exists for >5y and only no longer supported rubies don't have it
<apeiros>
so it's perfectly fine to use it
<Xeago>
apeiros: osx mavericks finally has an updated rubies
<apeiros>
I heard so :)
<apeiros>
but doesn't matter to me much since I use rvm anyway
<apeiros>
how're you doing anyway, Xeago? :)
<Xeago>
doing great, except for some conflict with my old gov in holland
<Xeago>
spotify is really cool :)
<apeiros>
nice!
kindjal has quit [Read error: Connection reset by peer]
fgo has joined #ruby
<apeiros>
glad you enjoy your work
<shevy>
Xeago BURN THE GOVERNMENT!!!
<Xeago>
one of the uncertainties they had was my matureness - my first 1on1 with my lead told my they were blown away by the opposite :)
<apeiros>
shevy: that's not environmentally safe
<Xeago>
s/one of the/the main
<apeiros>
Xeago: nice :D
<shevy>
matureness? you mean in terms of programming? or your looks
<apeiros>
maturity
<Xeago>
programming and attitude/behaviour/etc
<lord1234>
does anyone know where I can find the pragmatic samples?
<lord1234>
i figured they'd be online somewhere
<lord1234>
but can't seem to find them anywhere....
<shevy>
lord1234 I think it was a downloadable bundle... hmm
<lord1234>
i found a ruby-code.zip file on the prag website
<lord1234>
but it is not in the same format as the book calls for
maletor has joined #ruby
<Xeago>
haven't written much python
notjohn has quit [Quit: notjohn]
<Xeago>
mostly puppet, and patches to puppet-core
<Xeago>
(which is ruby)
<Xeago>
unfortunately puppet runs only on 1.8.x :\
<shevy>
good old 1.8.x!
catom has joined #ruby
<apeiros>
Xeago: I hear you port it to ruby 2.1? :D
<volty>
good new when you forget old
<Xeago>
apeiros: porting our private patches first, then the public code - yes :)
<Xeago>
and also some other tooling we have around puppet that was in ruby
<volty>
i'm back with a question: semantics of next changed in 1.9 (in each block) ?
HalfMadDad has quit [Ping timeout: 245 seconds]
threesome has quit [Ping timeout: 264 seconds]
AlSquire has joined #ruby
<apeiros>
volty: don't think so
<apeiros>
next returns control to the yielding method (optionally with a value), it basically prematurely returns from the block.
<apeiros>
has been that way in 1.8 too
Xanderby has joined #ruby
<lord1234>
shevy if you can help me find the dl bundle, I'd much appreciate!
zweistein has quit [Remote host closed the connection]
habanany has joined #ruby
fgo has quit [Read error: Connection reset by peer]
<platzhirsch>
apeiros: btw. there was this talk about don't symbolize all your hashes a week ago or so.. turns out I had a symbolize keys options left in my parser for a 3 GB JSON dump, effectively exploding my memory ;)
<lord1234>
sadly no
<lord1234>
doesn't match
<shevy>
what version did you need again?
<lord1234>
all the files are lableed sample* in the book...and in the zip ar exXXXX.rb
<lord1234>
no folder structure
<apeiros>
krz: to set the ivar in the context of root_class. could have used instance_eval for that too.
<lord1234>
thats the URL referenced in the book actually
<lord1234>
which is frustrating
zarul has quit [Quit: Leaving]
<apeiros>
platzhirsch: rename hash-key: delete + store again
<krz>
apeiros: still nothing related to race conditions right? just checking
<krz>
to do*
<krz>
with*
<apeiros>
krz: no. related to scoping of variables.
veinofstars has quit [Quit: veinofstars]
<krz>
got it
<lord1234>
same file
<lord1234>
:(
<apeiros>
krz: really, you have to understand how ivars are evaluated.
Squarepy has joined #ruby
<apeiros>
class_eval changes the context of self to be the receiver of class_eval. hence all ivars referenced in the code are ivars belonging to the receiver.
lkba has quit [Ping timeout: 245 seconds]
|jemc| has joined #ruby
HalfMadDad has joined #ruby
rippa has joined #ruby
tonni has quit [Read error: Connection reset by peer]
<volty>
yap, thx, u r right, it wasn't the 'next' that changed, but forgotten rescue errostr to_s, so caught by another rescue (far away) that broke the each loop
zarul has joined #ruby
afrodiziak has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<volty>
so the implicit conversion of Exceptions to strings must have changed ( I had rescue Exception => err_str , and afterwards passing err_str as string)
<volty>
I didn't have either that, just Exception => err_str, then error_msg(this + ': ' + err_str) --- missing to_s
<apeiros>
you had it
leehambley has quit [Ping timeout: 264 seconds]
<apeiros>
String#+ expects a string or something string-like. and to_str means string-like.
<volty>
ah, ya, i see what you mean, implicit
<Xeago>
isn't to_str implicit
<Xeago>
?
<apeiros>
how do you mean, Xeago?
<Xeago>
doesn't String#+ call .to_str if it's argument isn't a str?
<apeiros>
yes
<volty>
-- > <apeiros> Exception#to_str was removed
<apeiros>
many methods expecting a string do
<apeiros>
even in C
<Xeago>
can't see where that is done tho
<Xeago>
ah it calls StringValue(str2);
pixelshuck is now known as FootballShuck
<apeiros>
yupp. and StringValue() calls to_str
mikepack has quit [Remote host closed the connection]
tonni has joined #ruby
Zai00 has joined #ruby
mikepack has joined #ruby
leehambley has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
kilophoton has joined #ruby
dangerousdave has joined #ruby
gyre007 has joined #ruby
lkba has joined #ruby
Xeago_ has joined #ruby
mikepack has quit [Ping timeout: 264 seconds]
<Xeago>
wonder how that works, StringValue doesn't return anything
<Xeago>
it must change what it val2 points to
<Xeago>
o
<Hanmac>
its witchcraft! ;D
banisterfiend has joined #ruby
gyre007 has quit [Remote host closed the connection]
Xeago_ has quit [Ping timeout: 245 seconds]
taptapdan has joined #ruby
<shevy>
wicked magic
petey has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
KobraKao has joined #ruby
* Morrolan
scratches head
<Morrolan>
First some guy thinks that I represent Rubygems when I poke fun at him, now some other guy highlights me saying "thanks for your donations"
_whitelogger has joined #ruby
SkuliOskarsson has joined #ruby
ElderFain has quit [Quit: I'm Gone]
<volty>
yap
butblack has joined #ruby
shredding has quit [Quit: shredding]
veinofstars has joined #ruby
mlpinit has quit [Ping timeout: 260 seconds]
kdaigle has joined #ruby
<volty>
but i do not use default values since too often i don't know that kind of hash is going to come, so i always use (h[k] ||= def_val), usually with << afterwards
<volty>
s/that/what/
brennanMKE has joined #ruby
Xeago_ has joined #ruby
ukd1 has joined #ruby
freerobby has joined #ruby
coderhs has quit [Ping timeout: 240 seconds]
Xeago_ has quit [Read error: Operation timed out]
<nhmood_>
Oh sorry that was unclear, I didn't mean the default value of a newly created Hash (and its keys)
<nhmood_>
I meant in .fetch(key, [default])
brennanMKE has quit [Ping timeout: 245 seconds]
<nhmood_>
Is there a way to set the [default] in there such that I don't have to explicitly call it every time
<apeiros>
nhmood_: no.
<apeiros>
but you can easily define your own method
lewis_ has joined #ruby
lewis_ is now known as Lewix
Lewix has quit [Changing host]
Lewix has joined #ruby
nomenkun has joined #ruby
<nhmood_>
apeiros : Ok thanks
mercwithamouth has joined #ruby
<volty>
but at that point it's better to initialize with a default value and change, if needed later, the default or default_proc of the hash
shredding has joined #ruby
<volty>
e.c. with a default value or proc
<volty>
s/it's better/ isn't it better/
khushildep has joined #ruby
KobraKao has joined #ruby
<volty>
can't he continue using the default fetch and just change the default value of the hash?
nomenkun has quit [Remote host closed the connection]
carlyle has joined #ruby
cescalante is now known as ce_afk
nomenkun has joined #ruby
predator117 has quit [Ping timeout: 264 seconds]
sayan has joined #ruby
lfox has quit [Quit: ZZZzzz…]
yxhuvud has quit [Remote host closed the connection]
lfox has joined #ruby
yxhuvud has joined #ruby
Mekkis has joined #ruby
nomenkun has quit [Ping timeout: 245 seconds]
jgrevich_ has joined #ruby
xk_id has joined #ruby
brennanMKE has quit [Remote host closed the connection]
thesheff17 has joined #ruby
akemrir has joined #ruby
sayan has quit [Ping timeout: 246 seconds]
rubyracer has joined #ruby
Notte has joined #ruby
petey has quit [Remote host closed the connection]
petey has joined #ruby
pavilionXP has quit [Quit: Forget progress by proxy. Land on your own moon.]
<rubyracer>
I have existing data in a database that I need to use for a rails application. now i added the schema for the tables in the migration files but how to move the data into the new db?
volty has quit [Quit: Konversation terminated!]
DaZ has quit [Read error: Connection reset by peer]
yxhuvud has quit [Quit: Leaving]
<akemrir>
hi, how to break endless loop? break hangs my script
<apeiros>
rubyracer: um, you export the data from the old database and insert it into the new database?
hside has joined #ruby
<apeiros>
akemrir: break is what it'd be.
schaerli has quit [Remote host closed the connection]
<apeiros>
also an infinite loop with a break isn't really an infinite loop :-p
schaerli has joined #ruby
<akemrir>
apeiros: yeah, isn't so infinite
<IceDragon>
akemrir: try using "catch" and "throw"
Mekkis has quit [Ping timeout: 245 seconds]
schaerli has quit [Read error: Connection reset by peer]
<poisonarms>
Don't suppose anyone can give me a quick "explain to me like I'm 5" explanation of symbols? I never really understood what they were for...Every time I see them used though, they always looked like they were used like you would use key values in hashes in other languages. Am I wrong in making that assumption? In Ruby though, aren't they immutable or something once you set them?
akemrir has quit [Quit: WeeChat 0.4.1]
<Tearan>
Yes immutable
<canton7>
>> a = "test"; b = "test"; [a.object_id, b.object_id]
nomenkun has quit [Remote host closed the connection]
<canton7>
so use them where it's important that comparisons are cheap, but don't go and created loads of them, in a loop or some user input or something
nomenkun has joined #ruby
<Hanmac>
canton7: about strings and object_id ... frozen string literals also share the same object id ;P
<canton7>
poisonarms, so if I create the string "test" twice, I get two different objects
nomenkun has quit [Read error: Connection reset by peer]
BSaboia has quit [Ping timeout: 246 seconds]
kalesage has quit [Quit: ThrashIRC v2.9 sic populo comunicated]
<canton7>
Hanmac, ooh cool!
Barrin6 has joined #ruby
nomenkun has joined #ruby
<Hanmac>
canton7: there is the new "str"f syntax for in ruby2.1
dustyfields has quit [Remote host closed the connection]
<poisonarms>
canton7, but :test assigned to multiple variables is always :test?
<canton7>
poisonarms, but if I refer to the symbol :test twice, ruby makes sure that it's always the same object
<canton7>
so `a = :test; b = :test` is the same as `a = :test; b = a`
<poisonarms>
Gotcha.
<poisonarms>
And so, :symbol => 'Some whatever' ?
<canton7>
Hanmac, yeah, people didn't seem too happy with that syntax
conner has quit [Ping timeout: 245 seconds]
<canton7>
poisonarms, and so? you're using a symbol as a key in a hash
<poisonarms>
Okay
<poisonarms>
Gotcha
chairabanta has quit [Quit: Leaving...]
<poisonarms>
That's what I figured was going on.
<canton7>
cool
<Hanmac>
poisonarms: did you have other languages experimence? like C ? ... if yes just thing about symbols as the enum type
<poisonarms>
Yea I have other language experience.
<poisonarms>
symbol just always seemed weird to me.
boxmein_ has joined #ruby
boxmein_ has quit [Max SendQ exceeded]
<canton7>
fun fact: if you've got a website in ruby, which automatically creates symbols from user input, a mailcious user can keep creating symbols until your server runs out of memory
Xeago_ has quit [Ping timeout: 264 seconds]
boxmein_ has joined #ruby
boxmein_ has quit [Max SendQ exceeded]
<Hanmac>
canton7: yeah *point and laugth about rails*
<canton7>
rails does that? ouch
boxmein_ has joined #ruby
nomenkun has quit [Ping timeout: 240 seconds]
akemrir has joined #ruby
<Hanmac>
i did some times ... but mostly the problem is that they pipe user input unchecked into yaml ...
<Hanmac>
Tearan: he means on ruby, like in very other language too, you need to check the user input because it could break your system
<Tearan>
*nods*
<canton7>
Tearan, hmm? since the symbol table can never be cleared out, every symbol ever created lives on in it. so just created a ton of massive symbols, and they all sit around taking up memory
<Tearan>
I'm a qa engineer. I'm interested in HOW it does that
<Tearan>
I tont understand yet
<canton7>
what don't you understand?
<Tearan>
don't, even
akemrir has quit [Client Quit]
michael_mbp is now known as zz_michael_mbp
boxmein has quit [Ping timeout: 264 seconds]
Ox6abe has quit [Remote host closed the connection]
<Tearan>
How you would feed data, and what kind of places would be vulnerable. Just any input field?
<canton7>
if the framework, or part of the website, creates a symbol from some bit of user input
BizarreCake has quit [Ping timeout: 246 seconds]
Ox6abe has joined #ruby
<Tearan>
so for example of you took search parameters and made them into symbols?
<canton7>
sure, or you create a hash of {form field name => value}, and wanted the hash keys to be symbols
<Tearan>
I'm just trying to think of a usecase
<Tearan>
ok, so anyplace you can potentially create an array of stuff
yacks has quit [Quit: Leaving]
Ox6abe has quit [Ping timeout: 253 seconds]
workmad3 has joined #ruby
endash has joined #ruby
mayorga_ has quit [Quit: Leaving]
T_T has joined #ruby
<nhmood>
apeiros : If I want to use that method of having a DefaultOptions hash, where would I define/declare that
<canton7>
or say you have, somewhere, an internal hash of {symbol => string} relationships, where are used to populate a <select> element, with the hash's keys becoming the <option>'s value field. The user submits the form, and you want to use the submitted value of the <select> as a key in the aforementioned hash. So you turn it into a symbol, to index into the hash
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
raphaelivan has quit [Quit: Leaving.]
ewnd9 has quit [Ping timeout: 245 seconds]
<nhmood>
apeiros : The method is a static method inside of Class Foo lets say
freerobby has joined #ruby
<nhmood>
apeiros : Would it be better to declare inside the method itself or inside the Class as a sort of global? (I'm new to Ruby, still learning how these things should be organized)
kmurph has joined #ruby
PragCypher has joined #ruby
petey has joined #ruby
coderhs has quit [Ping timeout: 252 seconds]
gazzik has quit [Read error: Connection reset by peer]
freerobby has quit [Ping timeout: 245 seconds]
threesome has quit [Ping timeout: 245 seconds]
<apeiros>
nhmood: within the class where you want to use it
iliketurtles has quit [Quit: zzzzz…..]
lfox has quit [Quit: ZZZzzz…]
<apeiros>
whether a class- or instance-method uses it doesn't matter. both can see it.
dangerousdave has joined #ruby
yacks has joined #ruby
kmurph has quit [Read error: Connection reset by peer]
<nhmood>
apeiros : Do I need to declare it with $default_options, or would just defining it inside the class (without any prepending symbol (@/$)) be enough?
boboc has joined #ruby
<boboc>
how to check if a string represents a binary number in Ruby?
PragCypher has quit [Remote host closed the connection]
zz_michael_mbp is now known as michael_mbp
deens has quit [Quit: deens]
<canton7>
erm, you mean see if it contains just 0's and 1's?
lfox has joined #ruby
PragCypher has joined #ruby
drumsrgr8forn8_ has quit [Ping timeout: 240 seconds]
tatsuya_o has joined #ruby
deens has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
nfk has quit [Quit: yawn]
michael_mbp is now known as zz_michael_mbp
zmike has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
tatsuya_o has joined #ruby
tjbiddle has joined #ruby
Davey has joined #ruby
arietis has joined #ruby
zmike has quit [Client Quit]
gazzik has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
cih has joined #ruby
KobraKao has joined #ruby
KobraKao has quit [Read error: Connection reset by peer]
<apeiros>
nhmood: just start it with an uppercase letter
<apeiros>
so it is a constant
<apeiros>
boboc: use a regex
scottstamp is now known as zz_scottstamp
<boboc>
apeiros: i did :) /^[01]+$/.match(s)
Evixion has quit [Read error: Connection reset by peer]
<apeiros>
boboc: use \A instead of ^ and \z instead of $
<apeiros>
^$ relates to line, not string
<apeiros>
but other than that - seems fine
T_T has quit [Remote host closed the connection]
Evixion has joined #ruby
T_T has joined #ruby
lord1234 has joined #ruby
<boboc>
apeiros: how can i convert a binary string to a decimal nr? in both cases then only 1010 are used and when 0b1010 is used with 0b prefix?
dangerousdave has quit [Read error: Connection reset by peer]
<apeiros>
boboc: to_i(2)
<apeiros>
or Integer(str,2)
dangerousdave has joined #ruby
<apeiros>
not sure to_i(2) deals with the 0b prefix
jefflyne2 has quit [Ping timeout: 245 seconds]
<apeiros>
seems like it does
<boboc>
thanks
<apeiros>
yw
<boboc>
no, you're right, to_i(2) doesn't work with prefix
<boboc>
but Interger(str,2) works fine
<boboc>
thanks again
T_T has quit [Ping timeout: 246 seconds]
poisonarms has quit [Ping timeout: 245 seconds]
ehaliewicz has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
<popl>
could you paste it to gist or some other pastebin that doesn't require me to use js please?
tomzx_mac has quit [Ping timeout: 246 seconds]
<sarmiena_>
popl: sure sec
<nhmood>
Is it acceptable to have the functionality of a Class run inside the initialize method? Or is it common practice to have initialize setup the parameters then call a .run method
<apeiros>
sarmiena_: because block_given? is from the outer scope
<shevy>
nhmood I usually bundle things into a run method when a class becomes larger
<sarmiena_>
apeiros: but it's still hitting the block_given case.. but it's just returning nil
<apeiros>
sarmiena_: pretty sure it doesn't
<apeiros>
it returns nil because prefix is nil
<sarmiena_>
ahhhhhh smart man
deens has quit [Quit: deens]
<sarmiena_>
apeiros: lemme verify
<apeiros>
Illetye
<sarmiena_>
you are correct!
Alina-malina has quit [Ping timeout: 240 seconds]
<apeiros>
ofcourseiam
<sarmiena_>
:)
<popl>
that's why he's got the hat
<apeiros>
iamwhatiamandthatscorrect!
<nhmood>
shevy : Is there an advantage of separating out the initialization (setting up parameters, error checking input, ect) from the "run" functionality?
<apeiros>
popl: damn man, you just shocked me. I thought I had still my wizard hat on.
<nhmood>
shevy : Or I guess better question is "what is the advantage of..."
<apeiros>
nhmood: it makes your code more glittery and shiny
<popl>
apeiros: I'm a shocking individual.
<nhmood>
shevy : Haha that is a good reason
<shevy>
nhmood I can initialize the object step by step, and once done call #run on it. when I use #run though I also often have a #reset method
<apeiros>
sarmiena_: any reason you use define_method instead of def?
<sarmiena_>
iterating through a list of methods & don't want to define each one
<sarmiena_>
apeiros: ^
schaerli has joined #ruby
forcefsck has quit [Remote host closed the connection]
<shevy>
nhmood for small classes it is not really worth it though
<shevy>
every method adds at least three lines to your file!
Alina-malina has joined #ruby
bsaboia_ has joined #ruby
<popl>
nhmood: another advantage is that it makes your code easier for humans to parse
mac___ has quit [Read error: Connection reset by peer]