monkegjinni has quit [Remote host closed the connection]
<bnagy>
i0n: what Gurpartap said is kind of 180 degrees from correct
* Gurpartap
realized XD
<bnagy>
try a=[1,2,3];b=a;a << 4; p b
<bnagy>
i0n: which is why you want to dup or clone
<bnagy>
although sometimes even that's not enough to protect the original
pskosinski has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
blazes816 has joined #ruby
bglusman_ has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
<bnagy>
a=["I'M"];b=a.clone;b.map {|s| s << ' IN UR STRINGZ!'};p a
<bnagy>
eg
bglusman has quit [Read error: Connection reset by peer]
akem has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
undersc0re has quit [Read error: Connection reset by peer]
undersc0re has joined #ruby
akem has joined #ruby
jarred_ has joined #ruby
<Gurpartap>
bnagy: oh oh. i shouldn't have assumed what clone meant :/
<Gurpartap>
i0n: bnagy is probably right
jarred has quit [Ping timeout: 250 seconds]
jarred_ is now known as jarred
Apple has joined #ruby
Apple is now known as Guest19109
mahmoudi_ has joined #ruby
denis has joined #ruby
mahmoudimus has quit [Read error: Connection reset by peer]
ghjk has quit [Ping timeout: 272 seconds]
cableray has quit [Quit: cableray]
akem has quit [Ping timeout: 252 seconds]
ZachBeta has quit [Quit: Computer has gone to sleep.]
Guest19109 has quit [Read error: Connection reset by peer]
n8ji has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
strife25 has quit [Quit: Computer has gone to sleep.]
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
jimeh has joined #ruby
fayimora has joined #ruby
raul782 has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
raul782 has quit [Remote host closed the connection]
ProT-0-TypE has joined #ruby
ProT-0-TypE has quit [Client Quit]
gmci has joined #ruby
vitorpacheco has joined #ruby
vitor-br has quit [Ping timeout: 272 seconds]
mockra has quit [Remote host closed the connection]
mahmoudi_ has quit [Ping timeout: 244 seconds]
cirwim has joined #ruby
cirwim has left #ruby [#ruby]
brianpWins has quit [Quit: brianpWins]
savage- has joined #ruby
kah_ has quit [Ping timeout: 264 seconds]
gtuckerkellogg has joined #ruby
beakerma_ has joined #ruby
raul782 has joined #ruby
hunglin has joined #ruby
beakerman has quit [Ping timeout: 272 seconds]
mockra has joined #ruby
mxweas has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
<i0n>
hmm okay so now i have a weird problem.. array1 = method () { |f| ... } which shows correctly in irb
kah_ has joined #ruby
<i0n>
oh hangon
Hanmac has quit [Ping timeout: 240 seconds]
<i0n>
ok it shows correctly in irb, but when i try to pass it into my method as a argument the error/debug message shows like its not performing any stuff I ran on the block?
odigity has joined #ruby
mockra has quit [Remote host closed the connection]
Transformer has joined #ruby
Transformer has quit [Excess Flood]
manizzle has quit [Remote host closed the connection]
manizzle has joined #ruby
mengu_ has quit [Remote host closed the connection]
Z_Mass has quit [Quit: Leaving]
sailias has joined #ruby
<chessguy>
i0n: that doesn't even parse for me in 1.9.3
<i0n>
i had to do it inline with things like collect!
{aaron} has quit [Quit: Leaving]
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
chimkan_ has joined #ruby
jarred has quit [Ping timeout: 240 seconds]
Speed has quit [Remote host closed the connection]
akem has quit [Read error: Connection reset by peer]
radic_ has joined #ruby
radic_ is now known as radic
akem has joined #ruby
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
<blazes816>
wtf, idk what i was saying with the method thing
<otters>
class A; class << self; @var = "foo"; end; end
<davidokner>
I have not seen code like that yet.
<jumpingcloud>
davidokner: thanks! this is new to me!
* jumpingcloud
ragequits! ;) j/k
n8ji has joined #ruby
n8ji has quit [Remote host closed the connection]
jumpingcloud has quit [Ping timeout: 272 seconds]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<davidokner>
But, I don't understand any of the explinations of the syntax for this type of variable.
Guest___ has joined #ruby
shadoi has joined #ruby
dagnachewa has joined #ruby
mpereira has quit [Ping timeout: 246 seconds]
nedbat has quit [Ping timeout: 244 seconds]
noganex has quit [Read error: Operation timed out]
noganex has joined #ruby
Araxia has joined #ruby
nedbat has joined #ruby
gtuckerkellogg has joined #ruby
<davidokner>
I'm reading that article. I didn't find that one before.
shadoi has quit [Quit: Leaving.]
tommyvyo has joined #ruby
reuf has quit [Quit: Leaving]
stefanp_ has joined #ruby
gtuckerkellogg has quit [Client Quit]
gmci has quit [Quit: Computer has gone to sleep.]
stefanp has quit [Ping timeout: 265 seconds]
Guest___ has quit [Ping timeout: 255 seconds]
jarred_ has joined #ruby
greasegum has quit [Quit: Leaving]
shadoi has joined #ruby
jarred has quit [Ping timeout: 272 seconds]
jarred_ is now known as jarred
nedbat has quit [Ping timeout: 276 seconds]
soooga has joined #ruby
hadees has quit [Quit: hadees]
soooga has quit [Max SendQ exceeded]
soooga has joined #ruby
hadees has joined #ruby
chimkan_ has quit [Remote host closed the connection]
<davidokner>
Is there such thing as a class method?
chimkan_ has joined #ruby
<davidokner>
instead of an instance method? One I just call on the class, without using an instance?
kvirani has joined #ruby
grantbdev has quit [Quit: Leaving]
<davidokner>
I could use that class method to return a class variable.
<fowl>
no
<fowl>
class variables are gay
<fowl>
davidokner: what's the difference in Foo.new.doo and Foo.doo ?
<davidokner>
I am not using inheritance, so I don't need class instance variables yet.
manizzle has quit [Read error: No route to host]
<fowl>
davidokner: class variables are still pretty gay
<davidokner>
Because my variable isn't specific to any instance, so it looks confusing to type an instance just to display a class variable that is not specific to that arbitrary instance.
<fowl>
davidokner: by using class variables you are saying "Hey word, dont bother trying to subclass or extend this in any way, because it's gay!"
<fowl>
hey world*
<davidokner>
Oh, Ok.
<davidokner>
So it might get extended.
<davidokner>
And you don't want to prevent that
<fowl>
i dont understand your aversion to class instance vars
shadoi has quit [Quit: Leaving.]
<davidokner>
Well I have to finish reading the article on it
<davidokner>
And it got me thinking
<davidokner>
I just wanted to try something right now
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
dpk_ has joined #ruby
nyuszika7h has joined #ruby
dpk_ has quit [Client Quit]
julio has joined #ruby
julio has quit [Ping timeout: 246 seconds]
heftig has quit [Ping timeout: 250 seconds]
tatsuya has quit [Remote host closed the connection]
whitedawg has quit [Read error: Connection reset by peer]
<shevy>
I always end up using a big case / when menu to check against user input
stoffus has left #ruby [#ruby]
MornStar| has joined #ruby
<chessguy>
shevy, well sure. i'm just looking for an object-oriented way to have a class per possible input-handler
r0bby has joined #ruby
nari has joined #ruby
stoffus has joined #ruby
fantazo has quit [Remote host closed the connection]
Spooner has quit [Ping timeout: 252 seconds]
robbyoconnor has quit [Ping timeout: 272 seconds]
ZachBeta has quit [Quit: Computer has gone to sleep.]
<fraser>
Couldn't you define a module that handles input and just include it in any object that'll need the input
<fraser>
The equivalent of a java ActionListener basically
<chessguy>
fraser: there are lots of possibilities for how to do it. i'm just wondering if someone has built something re-usable for something like this
gtuckerkellogg has joined #ruby
<fraser>
chessguy: I'm probably the person least likely to know, but it's always fun to try to figure out a solution rather than download a library.
mucker has joined #ruby
<chessguy>
it's also fun seeing what someone else has written
techsurvivor has quit [Ping timeout: 240 seconds]
krusty_ar has joined #ruby
dhruvasagar has joined #ruby
geekyogi has quit [Quit: Leaving.]
qwerxy has joined #ruby
kidoz has joined #ruby
geekyogi has joined #ruby
emmanuelux has quit [Ping timeout: 264 seconds]
ZachBeta has joined #ruby
nicoulaj has joined #ruby
chessguy has quit [Read error: Connection reset by peer]
jonathanwallace has quit [Read error: Connection reset by peer]
chessguy has joined #ruby
jonathanwallace has joined #ruby
Doc_X has quit [Read error: Connection reset by peer]
Doc_X has joined #ruby
MornStar| has quit [Quit: ircN 8.00 for mIRC (20100904) - www.ircN.org]
jimmy1980 has quit [Ping timeout: 250 seconds]
jimmy1980 has joined #ruby
Spooner has joined #ruby
yugui is now known as yugui_zzz
wvms has quit [Read error: Connection reset by peer]
wvms has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
Eldariof-ru has joined #ruby
<fraser>
leave
fraser has quit [Quit: Lost terminal]
krusty_ar has quit [Read error: Connection reset by peer]
timonv has quit [Remote host closed the connection]
<shevy>
data["server_time"]["BookData"]["Title"]
<shevy>
this is a fucked up data structure btw
<shevy>
you even have an array there
<shevy>
so the above wouldn't work
maxmmurphy has joined #ruby
<Mon_Ouie>
More than one
<shevy>
yeah
<shevy>
data["server_time"]["BookData"] will yield the array
<shevy>
then you have to find the proper element that holds the BookData key
havenn has joined #ruby
kah_ has joined #ruby
strife25 has joined #ruby
digitalcakestudi has joined #ruby
strife25 has quit [Client Quit]
tatsuya has joined #ruby
<shevy>
let's spread wisdom
<shevy>
"The to_s method, for obtaining a String representation of an object, is probably the most commonly implemented and best known of these methods."
<shevy>
"inspect, on the other hand, is intended for debugging use, and should return a representation that is helpful to Ruby developers."
akem has quit [Ping timeout: 240 seconds]
linoj has joined #ruby
<abdulkarim>
shevy: data["server_time"]["BookData"]["Title"] this doesn't work
<Hanmac>
like "<helpfull>" :P
<shevy>
abdulkarim yes because you have an array
<abdulkarim>
I got this dom from isbndb.com. Basically i'm writing a script that will fetch the title for a given ISBN
<shevy>
abdulkarim in the array you must find the proper hash entry
<shevy>
check via require 'pp'; pp data["server_time"]["BookData"] first
jameshyde has joined #ruby
<abdulkarim>
shevy: nil
SCommette has joined #ruby
<Hanmac>
its this: data["BookData"][0]["Title"]
foEs has quit [Ping timeout: 272 seconds]
<abdulkarim>
Hanmac: nopes, already tried that
<abdulkarim>
NoMethodError: undefined method `[]' for nil:NilClass
<weeb1e_>
I don't have the slightest clue what is going on
<weeb1e_>
I have a Thin::Server, it maps '/' to Router.new
<weeb1e_>
class Router; def call(env); pp env end end
<weeb1e_>
At that point, all paths in env are already incorrect. They are prepended with another applications root path, which every one of my browsers cannot be doing randomly. So this make no sense at all
<ThePicard>
Mon_Ouie: ah, I did not think to try that
Hien has quit [Ping timeout: 272 seconds]
jameshyde has quit [Ping timeout: 264 seconds]
Guest76126 has joined #ruby
jameshyde has joined #ruby
rushed has joined #ruby
rushed has quit [Quit: rushed]
linoj has joined #ruby
julio has quit [Ping timeout: 244 seconds]
bradhe has quit [Remote host closed the connection]
wargasm has quit [Read error: Connection reset by peer]
wargasm has joined #ruby
mars__ has joined #ruby
linoj has quit [Quit: linoj]
mahmoudimus has joined #ruby
mockra has joined #ruby
conor_ireland has quit [Quit: conor_ireland]
EMarklar has joined #ruby
conor_ireland has joined #ruby
havenn has quit [Remote host closed the connection]
davidpk has quit [Quit: Computer has gone to sleep.]
zaidka has joined #ruby
chimkan has joined #ruby
leoncamel has quit [Ping timeout: 244 seconds]
<zaidka>
hello. if i build a c extension to ruby, is there any overhead in calling c functions?
<Mon_Ouie>
About the same overhead as for regular method calls
havenn has joined #ruby
mneorr has joined #ruby
Morkel has joined #ruby
timonv has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
Gab0 has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
<yxhuvud>
Mon_Ouie: how about if using FFI to call it?
chimkan has quit [Client Quit]
mockra has quit [Remote host closed the connection]
cj3kim has quit [Client Quit]
<Mon_Ouie>
yxhuvud: I'm not sure about how it is implemented, the part where Ruby arguments are converted into structures C can understand has more overhead I think
<Mon_Ouie>
Compared to the C API where ruby just passes you a bunch of pointers you can do whatever you want with directly in C
<zaidka>
Mon_Ouie, i have a small function that i want to impelment in c. it'll be called maybe a thousand times per second. should i not worry about unexpected surprises when it comes to calling overhead?
<Mon_Ouie>
1000 times per seconds doesn't sound like much to me
<zaidka>
im not talking web. just a regular script run by one user
<Mon_Ouie>
(By that I mean, not enough for the calling overhead to be so important — the actual implementation may need to be fast)
<Mon_Ouie>
I'm not talking web either
<shevy>
zaidka if C is not fast enough for you, what else do you wanna use... assembler? ;-)
<matti>
Machine code.
zaidka has quit [Read error: Connection reset by peer]
abstrusenick has quit [Quit: abstrusenick]
<matti>
:)
krusty_ar has quit [Quit: No Ping reply in 180 seconds.]
banghouse has joined #ruby
<shevy>
PERL!!!
Guest76126 has quit [Ping timeout: 272 seconds]
<shevy>
I want to go back to punchard interfaces
<shevy>
ahm
<shevy>
punchcard
<matti>
That's not efficient.
ZachBeta has joined #ruby
tatsuya has joined #ruby
krusty_ar has joined #ruby
Layke has joined #ruby
<Layke>
What would you recommend as a getting started?
<k_89>
for ruby?
<Layke>
Yeah sorry. (Have 10+ years experience of programming)
<k_89>
i guess then writing basic ruby would be piece of cake for you ..
<matti>
With that amount of years, asking that sort of question should left you covered in shame :)
<k_89>
just read on its metaprogramming features
<Layke>
Haha. I've gone through the docs already. Just wondering if there is a "goto" book that most people refer to.
<matti>
Layke: :)
<matti>
Layke: Look at Eloquent Ruby book.
<k_89>
Layke, there's a book .. metaprogramming ruby
<matti>
Layke: It only touches on Ruby-specific things.
wallerdev has joined #ruby
<Layke>
Cheers. Yeah that's the kind of thing I'm looking for.
<k_89>
i found meta ruby more helpful
bradhe has joined #ruby
<k_89>
it deals with all the magic in ruby
<matti>
k_89: Both are good.
<k_89>
making dsl's and stuff
duply has quit [Read error: Connection reset by peer]
<matti>
k_89: Meta programming is a funny thing.
<shevy>
Layke best way is to start writing ruby code as soon as possible
<k_89>
yeah it is
havenn has quit [Remote host closed the connection]
exchgr has quit [Quit: exchgr]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<Layke>
shevy, Yeah, I agree. I've already been working through simple "assignment" examples and project euler questions etc.
<matti>
k_89: There is this learning curve: First you discover meta-programming, Second you want to make everything into a DSL, Third you discover a real-life project (probably at work) which abuses MP and then you learn to avoid it (troubleshooting can be a bitch).
krusty_ar has quit [Quit: No Ping reply in 180 seconds.]
Hien_ has joined #ruby
<shevy>
then your next task shall be - understand and explain what is an @instance variable, when you use __DATA__ __END__ ARGV and ARGF
ZachBeta has quit [Quit: Computer has gone to sleep.]
Jackneill has joined #ruby
quest88 has joined #ruby
berserkr has joined #ruby
<shevy>
yeah
<matti>
shevy: ARGF is a child of Matz and the Devil himself.
<shevy>
what matti wrote ^^^
Jackneill is now known as Guest91275
<shevy>
though I stay away from meta magic
<matti>
Hehe
krusty_ar has joined #ruby
<shevy>
BUT I WILL LEARN RAILS ONE DAY
<matti>
NOESS
<matti>
;d
<k_89>
but you gotta learn all the ruby's meta magic to understand rails, sinatra etc
<matti>
Yeah.
<k_89>
i understand sinatra to a fair level now
<Layke>
On that topic k_89, is rails the de facto goto framework?
Nisstyre has joined #ruby
<matti>
k_89: I like to use Spider-Man quote here: "With great power comes great responsobility"
<k_89>
i hate rails
<Layke>
ie, *everyone* knows rails?
<k_89>
:P
<shevy>
k_89 how do they make the:
<matti>
Layke: No, I don't know / like it.
<shevy>
map /
<shevy>
part?
<k_89>
but then i am mainly a php guy
<shevy>
oh dear
<matti>
PHP?
<matti>
Quick.
<k_89>
hehe
<matti>
Exorcism
<matti>
Infidel.
<shevy>
let's burn him
<matti>
;d
<k_89>
nvm
<matti>
Hehe
<shevy>
or we put him with matti into a room
JeanMertz has quit [Quit: JeanMertz]
<matti>
shevy: Better to burn him ;p
<shevy>
he can choose
<Layke>
Do you use any PHP framework k_89 ? Just curious. :)
<shevy>
matti, yeah, easier and faster
<shevy>
:P
<k_89>
shevy, at the end of sinatra's included files, they just do an include to include all of sinatras methods into current context
<shevy>
hmm
<k_89>
Layke, i switch every 4-5 months :P
dhruvasagar has quit [Ping timeout: 252 seconds]
<k_89>
currently i'm using laravel
<k_89>
its a beauty
<k_89>
but getting bored of it too
conor_ireland has quit [Quit: conor_ireland]
<Layke>
I always just stick with Zend Framework for anything I use when working on PHP based projects.
<matti>
shevy: Putting me into a room with PHP developers is forbidden by Geneva Conventions.
<k_89>
Layke, you checked out composer??
<matti>
;]
<Layke>
No I haven't
<shevy>
zend zend zend
<k_89>
laravel and fuelphp frameworks are coming out as composer packages
<matti>
shevy: LOL ;s
<k_89>
those + silex are gonna be my goto php dev tools in near future
<matti>
k_89: +1
<k_89>
Layke, do have a look getcomposer.org
<k_89>
matti, +1 for what ??
mneorr has quit [Quit: Leaving.]
Ionic` has joined #ruby
<matti>
k_89: Being open minded :)
<Kwpolska>
How do I remove the first 18 lines from a string in ruby?
<k_89>
:)
mneorr has joined #ruby
<shevy>
Kwpolska what do you mean with lines from a string
zaidka has joined #ruby
<shevy>
if you mean separated by newline \n
<shevy>
then you could convert it to array, then fetch only lines 19 up to last
<shevy>
string.split("\n")[19..-1]
gmci has quit [Quit: Computer has gone to sleep.]
<shevy>
or 18, no idea. try it.
<shevy>
string = string.split("\n")[18..-1]
<td123>
str.lines.slice(18..-1).unlines
<matti>
unlines?
<td123>
nvm lol
Morkel has quit [Quit: Morkel]
<td123>
I'm thinking about a diff language
<matti>
:D
<td123>
haskell has unlines and lines
gmci has joined #ruby
<Kwpolska>
okay, shevy’s solution worked, thanks.
<matti>
Kwpolska: There is a problem with it.
<matti>
Kwpolska: If number of "\n" is substantial.
havenn has joined #ruby
<Kwpolska>
matti: and I do not know what 'substantial' means here.
ethan2 is now known as Ethan
maxmmurphy has joined #ruby
<Hanmac>
yxhuvud there is something FFI cant do
<matti>
Kwpolska: If you have large file read into a string, then spliting it to remove first 18 lines might cost memory. But, whatever works I fine I guess and less fiddly :)
Keva161 has joined #ruby
<Kwpolska>
it is quite large, but I don’t care.
<matti>
Ah, OK.
<matti>
:)
jbw has quit [Ping timeout: 272 seconds]
<shevy>
haskell has unlines?
<shevy>
well, if it is an alias to split("\n") perhaps it wouldn't be so bad
<shevy>
or rather
<shevy>
join("\n")
<hoelzro>
unlines = join "\n"
<hoelzro>
lines = split "\n"
<hoelzro>
iirc
gmci has quit [Quit: Computer has gone to sleep.]
mobilegamelabs has quit [Quit: Angry Polygon (iPhone/Android/Mac) - http://www.MGGGGG.com/ap #ratingexchange]
<hoelzro>
it's not that bad once you get used to it
mneorr has joined #ruby
drago757 has joined #ruby
jbw has joined #ruby
mockra has quit [Ping timeout: 250 seconds]
<Paradox>
C is the only functional/proceedural language i know
<Paradox>
and i have no intention of learning any others
<k_89>
javascript??
zaidka has quit [Ping timeout: 272 seconds]
kirun has joined #ruby
help2man is now known as shopt
Xethron has quit [Changing host]
Xethron has joined #ruby
Ethan has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
<jrajav>
Paradox: You don't really know what a functional language is, do you?
savage- has joined #ruby
liluo has quit [Remote host closed the connection]
<Mon_Ouie>
procedural or imperative is almost the opposite of functional programming
<jrajav>
^
<jrajav>
Ruby is a lot more of a functional language than C is
EMarklar has quit [Quit: This computer has gone to sleep]
nateberkopec has quit [Quit: Leaving...]
cantonic has quit [Quit: cantonic]
jarred has joined #ruby
wvms has joined #ruby
stefanp_ has quit [Ping timeout: 265 seconds]
SCommette has quit [Quit: SCommette]
savage- has quit [Remote host closed the connection]
cantonic has joined #ruby
SCommette has joined #ruby
tonni has joined #ruby
<Kwpolska>
I need to do some magic with .po files. I want to copy over the msgid to the msgstr. Is there any easy way to do that or should I incorporate space magic?
livencode has joined #ruby
chimkan has quit [Quit: chimkan]
dross_ is now known as dross
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
k_89 has quit [Quit: Leaving]
davidcelis has quit [Quit: K-Lined.]
drago757 has quit [Quit: drago757]
<Kwpolska>
oh wait, space magic is easier than ruby in this case. (and by 'space magic' I mean msgmerge)
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
hoelzro is now known as hoelzro|away
cantonic has quit [Quit: cantonic]
chimkan has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
atmosx has joined #ruby
levieraf has joined #ruby
seanstickle has quit [Quit: seanstickle]
havenn has quit [Remote host closed the connection]
Markvilla has joined #ruby
havenn has joined #ruby
alindeman has quit [Quit: /quit]
greasegum has joined #ruby
tompsony has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
tvw has joined #ruby
shadoi has joined #ruby
<tompsony>
otters
<tompsony>
you are there man
mrwalker has joined #ruby
mxweas has joined #ruby
drago757 has joined #ruby
levieraf has quit [Ping timeout: 272 seconds]
Araxia has joined #ruby
havenn has quit [Remote host closed the connection]
tonni has quit [Remote host closed the connection]
havenn has joined #ruby
mahmoudimus has joined #ruby
<Kwpolska>
I have those files: /locale/en/something.po and /locale/pl/something.po, and the ruby script is /getnames.rb. How can I get the 'en' and 'pl' parts to an array? (I know about glob, but won’t it return locale/en or stuff like that? I am a noob when it comes to ruby, actually.)
livencode has left #ruby ["Leaving"]
mrwalker has quit [Remote host closed the connection]
BrokenCog has quit [Quit: leaving]
twinturbo has quit [Quit: twinturbo]
drago757 has quit [Quit: drago757]
havenn has quit [Ping timeout: 245 seconds]
<tompsony>
otters pls man
<tompsony>
talk to me
<Kwpolska>
what?
<tompsony>
o.o
<tompsony>
you is otters
<tompsony>
?
<tompsony>
you are*
CaptainJet has joined #ruby
shadoi has quit [Quit: Leaving.]
<tompsony>
you are a programmer?
<tompsony>
Kwpolska
<Ionic`>
holy shit, you're annoying
cj3kim has quit [Quit: This computer has gone to sleep]
<Kwpolska>
anyone who can kick this sir around?
<tompsony>
;/
<Kwpolska>
idiot*
<tompsony>
why
<tompsony>
I need to talk to the otter
<tompsony>
only
shashin has joined #ruby
<Mon_Ouie>
Kwpolska: That's still no reason to call someone else an idiot.
<Mon_Ouie>
tompsony: Use private messages in that case (/msg otters …)
beakerma_ has joined #ruby
<tompsony>
[Mon_Ouie]: ok thank you!
<Mon_Ouie>
Kwpolska: Regarding your question, you can Dir.glob and map to the basename
<tompsony>
but the fact that I have a job and a budget of $ 200
<tompsony>
need someone with skills
<Kwpolska>
I just did that by myself. thanks anyways.
shashin has quit [Client Quit]
<tompsony>
;/
<shevy>
lol
<Kwpolska>
tompsony: add one zero to the budget if you want someone with skills.
<shevy>
otter is cuddly
<Kwpolska>
at least one.
<tompsony>
lol
jimeh2 has quit [Ping timeout: 252 seconds]
<tompsony>
2000 o.o very hard
Bosma has joined #ruby
<shevy>
no
<shevy>
he said to add one zero
<shevy>
0200
<Kwpolska>
at the end
<shevy>
pfffft a bit later for that now... :P
<shevy>
btw Kwpolska how did you solve the /locale/pl/something.po thing?
<Mon_Ouie>
He's not looking for that, he's looking for "pl"
<shevy>
oh
koshii has joined #ruby
<JeanMertz>
Is there any reason why I can't poll my own server using Net::HTTP and Thin? It always returns a response timeout, even when starting thin locally
<JeanMertz>
(so I poll the same server from where the poll originates, only a different end-point)
<JeanMertz>
Ah hang on, probably a thread issue
robozahn has quit [Ping timeout: 265 seconds]
<tompsony>
I just need someone with skills that can create the script in one hour.
<tompsony>
Paid $ 200
kvirani has quit [Remote host closed the connection]
Ethan has quit [Quit: *poof*]
shadoi1 has joined #ruby
koshii has quit [Ping timeout: 252 seconds]
beakerman has joined #ruby
beakerma_ has quit [Read error: Connection reset by peer]
tonni has joined #ruby
justinseiter has quit [Quit: Leaving]
<goganchic>
topsony, $200 per hour? =)
<shevy>
tompsony, u must learn ruby
tommyvyo has joined #ruby
<tompsony>
yes
<tompsony>
not now
<Ionic`>
there are freelancer channels on freenode
<Ionic`>
better ask there
Ste11a has quit [Ping timeout: 244 seconds]
macmartine has joined #ruby
theRoUS has joined #ruby
nateberkopec has joined #ruby
ph^ has joined #ruby
baroquebobcat has joined #ruby
reuf has joined #ruby
joesavage has joined #ruby
atmosx has quit [Ping timeout: 244 seconds]
EMarklar has joined #ruby
<joesavage>
Anyone here available for freelancing a small Ruby Jekyll static site generation project for me?
reuf has quit [Max SendQ exceeded]
beakerma_ has joined #ruby
twinturbo has joined #ruby
reuf has joined #ruby
twinturbo has quit [Client Quit]
reuf has quit [Max SendQ exceeded]
EMarklar has quit [Client Quit]
reuf has joined #ruby
nazty has joined #ruby
nazty has quit [Read error: Connection reset by peer]
naz has quit [Quit: Leaving]
beakerman has quit [Ping timeout: 250 seconds]
levieraf has joined #ruby
EMarklar has joined #ruby
CaptainJet has quit [Ping timeout: 244 seconds]
beakerman has joined #ruby
atmosx has joined #ruby
<shevy>
:(
<shevy>
noone wants to learn ruby anymore
<shevy>
except for Layke... the last guy to want to learn ruby here lately
iamjarvo has quit [Quit: Leaving...]
CaptainJet has joined #ruby
beakerma_ has quit [Ping timeout: 272 seconds]
goganchic has quit [Quit: leaving]
tonni has quit [Remote host closed the connection]
mpereira has quit [Ping timeout: 272 seconds]
chimkan has quit [Quit: chimkan]
iamjarvo has joined #ruby
beakerma_ has joined #ruby
azm has quit [Ping timeout: 246 seconds]
<iamjarvo>
i have this .ru file and there is a require in it. it seems that the require has to be like this require './lib/process/processor' require_realtive blows up
Ste11a has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
blacktulip has joined #ruby
beakerman has quit [Ping timeout: 272 seconds]
<iamjarvo>
i think this is a good thread concerning my problem
banisterfiend has quit [Ping timeout: 240 seconds]
<atmosx>
shevy: I want to learn,I don't know nothing about ruby
<atmosx>
shevy: I'm publishing my latest script in a couple of minutes on github any comments would be more than welcomed (on how to optimize the code, better approach, improvements, etc.)
<Spaceghostc2c>
shevy: Didn't you hear? Ruby is oldnews. The new shit is clojure. :(
<iamjarvo>
can someone explain why when i require a file in irb in a directory im in i have to do require './file' i rembere i read it somewhere about the loadpaths and what haooens when you are in a directory. but i cant remember where
<shevy>
dont know clojure
drago757_ has joined #ruby
<shevy>
iamjarvo, core team hates ./ these days in plain require
nilg has joined #ruby
<Layke>
How do you mean shevy ?
<iamjarvo>
ahh interesting. whats the alternate?
wvms has quit [Quit: wvms]
<shevy>
iamjarvo require_relative() or modifying $LOAD_PATH or simply using a ./ in require or install the project into your ruby installation SITE DIR
<shevy>
Layke, nah, there were two guys here who wanted someone else to write scripts for them
<shevy>
rather than learn ruby on their own
<shevy>
:(
drago757 has quit [Ping timeout: 264 seconds]
drago757_ is now known as drago757
<Layke>
Ah :)
<iamjarvo>
shevy you mentoned using ./ but didnt you say core team hates it
<shevy>
iamjarvo, if you use ruby 1.9.x then you could use require_relative
<shevy>
iamjarvo, yeah. it worked in 1.8.x
<iamjarvo>
shevy require_relative and rackup files dont like each other
<iamjarvo>
thats what im having probs wiht
<iamjarvo>
with
<shevy>
aha
<shevy>
rackup is not valid ruby?
<iamjarvo>
if i do require ./filename in the config.ru it works but require_relative or require doesnt work
<shevy>
but you use ruby 1.9.x ?
levieraf has quit [Ping timeout: 240 seconds]
<iamjarvo>
1.9.3
darren has quit [Remote host closed the connection]
Guest97636 has joined #ruby
linoj has joined #ruby
br4ndon has joined #ruby
drago757 has quit [Quit: drago757]
macer1 has joined #ruby
atmosx has quit [Read error: Operation timed out]
<shevy>
odd
<shevy>
in normal .rb files, require_relative works?
yakko has quit [Ping timeout: 272 seconds]
Ethan has quit [Ping timeout: 272 seconds]
shashin has joined #ruby
yakko has joined #ruby
<shevy>
hmmm
<shevy>
why is nil.to_s == ''
tonni has joined #ruby
<Spooner>
Because nil.to_s is not a printed string (for better or worse). nil.inspect is "nil" though.
fantazo has joined #ruby
tommyvyo has joined #ruby
mockra has joined #ruby
<shevy>
hmm
Berglund has joined #ruby
<Mon_Ouie>
That's probably because the rackup file isn't run normally (that is, not using load or require)
<Mon_Ouie>
Also require ./file doesn't work: just getting in another directory breaks that
joesavage has left #ruby [#ruby]
<Mon_Ouie>
Assuming __FILE__ is set correctly, you can $LOAD_PATH.unshift File.dirname(__FILE__) and require as you need
nilg` has joined #ruby
levieraf has joined #ruby
<iamjarvo>
i just ended up using this require File.expand_path(File.dirname(__FILE__) + "/lib/order_processor/processor")
tatsuya has quit [Remote host closed the connection]
quest88 has quit [Quit: quest88]
jarred has quit [Ping timeout: 264 seconds]
quest88 has joined #ruby
tatsuya has joined #ruby
<iamjarvo>
Mon_Ouie: ^
mockra has quit [Remote host closed the connection]
beakerma_ has quit [Ping timeout: 272 seconds]
baphled has joined #ruby
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
Guest91275 has quit [Quit: Guest91275]
nyuszika7h has joined #ruby
<Mon_Ouie>
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) would be better, as it would allow to require files from there without doing anything weird
SegFaultAX has quit [Ping timeout: 246 seconds]
Ethan has joined #ruby
tatsuya has quit [Ping timeout: 272 seconds]
SegFaultAX has joined #ruby
jarred has joined #ruby
<iamjarvo>
Mon_Ouie describe anything weird
tonni has quit [Remote host closed the connection]
tatsuya has joined #ruby
beakerman has joined #ruby
tonni has joined #ruby
xorgnak has quit [Ping timeout: 272 seconds]
Berglund has quit [Quit: Computer died.]
GlenK has joined #ruby
Gab0 has quit [Remote host closed the connection]
<Mon_Ouie>
Doing requires like what you did above everywhere instead of using the more conventional require 'order_processor/foo'
rippa has quit [Ping timeout: 255 seconds]
mengu has quit [Remote host closed the connection]
around has joined #ruby
nyuszika7h is now known as Guest35929
around is now known as nyuszika7h
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
azm has quit [Read error: Connection reset by peer]
<iamjarvo>
ok
<iamjarvo>
thanks
macer1 has quit [Ping timeout: 272 seconds]
Guest35929 has quit [Ping timeout: 264 seconds]
shadoi1 has quit [Quit: Leaving.]
Gab0 has joined #ruby
aruntomar has joined #ruby
timonv has quit [Remote host closed the connection]
banisterfiend has quit [Ping timeout: 252 seconds]
cantonic has quit [Quit: cantonic]
<otters>
christ I wish people would stop PMing me
Goles has quit [Quit: Computer has gone to sleep.]
dawtcummz is now known as dawtcawm
linoj has quit [Quit: linoj]
dawtcawm is now known as Guest18269
gmci has joined #ruby
<shevy>
otters heheeh
<shevy>
everyone wants to flirt with an otter
<otters>
I shouldn't have picked this attention-grabbing username
jameshyde has quit [Remote host closed the connection]
tomeo has joined #ruby
* shevy
cuddles the otter!!!
bluenemo has quit [Remote host closed the connection]
atmosx has joined #ruby
Keva161 has quit [Remote host closed the connection]
<otters>
we don't happen to have a ruby bot in here do we?
SegFaultAX has quit [Read error: Operation timed out]
chimkan has joined #ruby
banisterfiend has joined #ruby
SegFaultAX has joined #ruby
_axx has quit [Ping timeout: 240 seconds]
aruntomar has quit [Quit: Leaving]
<shevy>
dont think so
<shevy>
save for Hanmac
<otters>
nuts
<otters>
well, irb works just as well
<otters>
class A; class << self; attr_accessor :foo; @foo = 1; end; end; A.foo #=> nil
<otters>
why is this
yxhuvud has quit [Ping timeout: 250 seconds]
<Mon_Ouie>
You set @foo on the class's singleton class, not on the class itself
wvms has joined #ruby
<otters>
Oh, wait, I understand
<Mon_Ouie>
Similarly when you do class Foo; attr_accessor :bar; @bar = 1; end, Foo.new.bar is nil
<otters>
attr_accessor is a class method
<otters>
but instance variables...okay
<otters>
Got it
<Hanmac>
the funniest think is that singleton classes can have singleton classes too :P
<otters>
so I should put the ivar declaration outside the singleton class block
<shevy>
boggles the mind
<shevy>
the ruby inside the ruby inside the ruby
<shevy>
inside the ruby
<otters>
this is the only part of ruby that is really confusing
<shevy>
ruby the inside
<otters>
besides continuations
<shevy>
inside the ruby the ruby inside
<shevy>
otters, I find too many things in ruby confusing :(
<shevy>
the principle of least matz surprise sometimes reminds me of someone being on a LSD rush
_axx has joined #ruby
<shevy>
all the different ways to *eval* make me really violent
<otters>
yeah, eval
<otters>
I'll tell you, I love ruby right now though
<banisterfiend>
shevy: you've never tried LSD, in fact i doubt you've tried many drugs at all. You're actually a very innocent and sheltered boy ;)
<otters>
I had to alter this FTPD to support SSL
<otters>
now in any other language, I would have to check it out from github, modify the source
<otters>
and then use that
<otters>
ruby? re-open the class, monkey patch SSL support in
<shevy>
banisterfiend true
<atmosx>
I agree on the LSD part, I have no opinion on the rest you people are talking a strange language
* atmosx
eats chocolate
15SACFCYB has joined #ruby
mneorr has left #ruby [#ruby]
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
<atmosx>
you don't know how it's likeeee to love somebodyyy
<shevy>
otters, the really sad thing is that other languages are much worse than ruby
<shevy>
like PHP
* atmosx
is listening to Nina Simone - To Love Somebody, from the album Best Of Nina Simone Vol 2 [2:40 mins] [128 kbps MPEG audio file] [2.67 MB] [played missing value times]
<otters>
well, I'm not saying anything is wrong with Ruby
<otters>
it's a very well designed language
<shevy>
come on cuddly otter!
<shevy>
<otters> this is the only part of ruby that is really confusing
<shevy>
^^^ the first level of hate
<shevy>
:)
<otters>
well it could be very well designed for all I know
Xethron has quit [Ping timeout: 244 seconds]
<otters>
son of a gun! module_eval too??
<otters>
where's singleton_eval
Xethron_ has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
exchgr has quit [Quit: exchgr]
strife25 has quit [Quit: Computer has gone to sleep.]