apeiros_ has quit [Remote host closed the connection]
slyphon has quit [Quit: WeeChat 0.3.6]
cantonic_ has joined #ruby-lang
postmodern has joined #ruby-lang
mistym has quit [Remote host closed the connection]
cantonic_ has quit [Ping timeout: 265 seconds]
fukushim_ has joined #ruby-lang
fukushima has quit [Ping timeout: 252 seconds]
ConstantineXVI has quit [Remote host closed the connection]
rushed has joined #ruby-lang
<postmodern>
when was respond_to_missing? introduced?
<postmodern>
hmm looks like 1.9
QaDeS has quit [Quit: Ex-Chat]
Radium_ has quit [Ping timeout: 245 seconds]
dankest has quit [Quit: Leaving...]
slyphon has joined #ruby-lang
VegetableSpoon has quit [Quit: Leaving]
DEac- has quit [Quit: leaving]
mistym has joined #ruby-lang
jperry2 has joined #ruby-lang
jperry2 has quit [Client Quit]
DEac- has joined #ruby-lang
srbartlett has joined #ruby-lang
ryanf has quit [Quit: broken pipes |||]
pygmael has quit [Read error: Connection reset by peer]
bglusman has joined #ruby-lang
DEac- has quit [Ping timeout: 248 seconds]
pygmael has joined #ruby-lang
DEac- has joined #ruby-lang
chriskk has quit [Quit: chriskk]
brianpWins has joined #ruby-lang
diegoviola has joined #ruby-lang
srbartle_ has joined #ruby-lang
ConstantineXVI has joined #ruby-lang
srbartlett has quit [Ping timeout: 245 seconds]
DRCALKIN has joined #ruby-lang
renato has joined #ruby-lang
dankest has joined #ruby-lang
hexreel has joined #ruby-lang
srbartle_ has quit [Remote host closed the connection]
srbartlett has joined #ruby-lang
ConstantineXVI has quit [Ping timeout: 256 seconds]
srbartlett has quit [Ping timeout: 260 seconds]
mistym has quit [Remote host closed the connection]
pygmael has quit [Read error: Connection reset by peer]
pygmael has joined #ruby-lang
dankest has quit [Read error: Connection reset by peer]
x0F_ has joined #ruby-lang
x0F_ has quit [Changing host]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
scott1 has left #ruby-lang [#ruby-lang]
gsav has joined #ruby-lang
tomb_ has joined #ruby-lang
bglusman has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
S2kx has joined #ruby-lang
savage- has joined #ruby-lang
S1kx has quit [Ping timeout: 252 seconds]
dcorbin has quit [Quit: This computer has gone to sleep]
mistym has joined #ruby-lang
tomb_ has quit [Quit: Computer has gone to sleep.]
dreieins has quit [Ping timeout: 272 seconds]
rjgoldsborough has joined #ruby-lang
spowers has joined #ruby-lang
dreieins has joined #ruby-lang
DRCALKIN has quit [Quit: Leaving]
dr0id has joined #ruby-lang
DRCALKIN has joined #ruby-lang
voidx has joined #ruby-lang
Hakon|mbp has quit [Quit: Leaving...]
Banistergalaxy has joined #ruby-lang
Hunter_WTP has quit [Quit: Hunter_WTP]
Boohbah has quit [Ping timeout: 276 seconds]
sora_h is now known as s0ra_h
s0ra_h is now known as sora_h
DRCALKIN has quit [Quit: Leaving]
slyphon is now known as slyphon_away
behr has joined #ruby-lang
slyphon_away has quit [Ping timeout: 245 seconds]
linuxpaulo has joined #ruby-lang
linuxpaulo has left #ruby-lang [#ruby-lang]
tRAS has joined #ruby-lang
behr has quit [Remote host closed the connection]
c64paulo has joined #ruby-lang
renato has quit [Quit: leaving]
brianpWins has joined #ruby-lang
petercooper has quit [Remote host closed the connection]
gregf has quit [Quit: WeeChat 0.3.7]
bryancp has joined #ruby-lang
bryancp has quit [Remote host closed the connection]
tRAS has quit [Quit: Mother, did it need to be so high?]
c64paulo has quit [Quit: c64paulo]
pygmael has quit [Read error: Connection reset by peer]
pygmael has joined #ruby-lang
rippa has joined #ruby-lang
savage- has quit [Remote host closed the connection]
pygmael has quit [Read error: Connection reset by peer]
pygmael has joined #ruby-lang
tRAS has joined #ruby-lang
srbartlett has joined #ruby-lang
cantonic has joined #ruby-lang
crackity_jones has joined #ruby-lang
postmodern has quit [Quit: Leaving]
savage- has joined #ruby-lang
yxhuvud has joined #ruby-lang
Gaivs has quit [Ping timeout: 250 seconds]
joast has joined #ruby-lang
pygmael has quit [Read error: Connection reset by peer]
tomzx has quit [Ping timeout: 245 seconds]
pygmael has joined #ruby-lang
<erikh>
aherp
<matled>
.
mistym has quit [Remote host closed the connection]
Veejay has left #ruby-lang ["WeeChat 0.3.0"]
cantonic has quit [Ping timeout: 244 seconds]
<dr0id>
..
tla has joined #ruby-lang
cantonic has joined #ruby-lang
bassplayerdoug has joined #ruby-lang
savage- has quit [*.net *.split]
igotnolegs has quit [*.net *.split]
thone has quit [*.net *.split]
alindeman has quit [*.net *.split]
Skif has quit [*.net *.split]
Mchl has quit [*.net *.split]
CodeBlock has quit [*.net *.split]
nick_h_ has quit [*.net *.split]
shaman42 has quit [*.net *.split]
alexkane has quit [*.net *.split]
thorncp has quit [*.net *.split]
ltd- has quit [*.net *.split]
akahn has quit [*.net *.split]
mahlon has quit [*.net *.split]
CodeBlock has joined #ruby-lang
<bassplayerdoug>
I am having some problems with a basic padrino command. Could someone take a look? http://pastebin.com/w5qqu9pi
rippa has quit [Ping timeout: 260 seconds]
Indian has quit [Quit: Indian]
pygmael has quit [Read error: Connection reset by peer]
tRAS has quit [Quit: Mother, did it need to be so high?]
rohit has joined #ruby-lang
apeiros_ has joined #ruby-lang
pygmael has joined #ruby-lang
qawsedrf has joined #ruby-lang
pygmael has quit [Read error: Connection reset by peer]
pygmael has joined #ruby-lang
yannis has joined #ruby-lang
olesu has joined #ruby-lang
tRAS has joined #ruby-lang
pygmael has quit [Read error: Connection reset by peer]
pygmael has joined #ruby-lang
olesu has quit [Remote host closed the connection]
gsav has quit [Read error: Connection reset by peer]
voidx has quit [Ping timeout: 252 seconds]
Banistergalaxy has quit [Ping timeout: 248 seconds]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
GSHN has joined #ruby-lang
Watcher7 has quit [Remote host closed the connection]
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
znake has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
qawsedrf has quit [Quit: Lost terminal]
gasbakid__ has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
srbaker has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
gasbakid has quit [Ping timeout: 260 seconds]
rohit has quit [Quit: Leaving]
alindeman has joined #ruby-lang
thone has joined #ruby-lang
Skif has joined #ruby-lang
shaman42 has joined #ruby-lang
nick_h_ has joined #ruby-lang
Mchl has joined #ruby-lang
thorncp has joined #ruby-lang
ltd- has joined #ruby-lang
mahlon has joined #ruby-lang
akahn has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
alindeman is now known as Guest47148
behr has joined #ruby-lang
S2kx has left #ruby-lang [#ruby-lang]
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
roha has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
gasbakid__ has quit [Quit: Quitte]
GSHN has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
behr_ has joined #ruby-lang
behr has quit [Ping timeout: 252 seconds]
Jc_ has joined #ruby-lang
tRAS has quit [Ping timeout: 244 seconds]
tRAS has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
dalekurt has quit [Quit: Zzz...]
<Jc_>
I have an external gem return me Objects of a class X. For ease of use, I would like to create an Xextended class (that does not contain extra variables/data, just methods). How to I "cast" Objects from the X to the Xextended class ?
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
ioanpaulpirau has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
<burgestrand>
You don’t cast in ruby, you explicitly convert (either by X supporting the conversion, like 5.to_s that converts 5 to a string, or by Xextended support wrapping X, like Xextended.new(X))
<burgestrand>
Jc_: but if it’s just methods you want, you could either reopen the class X and just add them (monkeypatching), or extend the X-object you get back with a module (same thing, but you only monkeypatch the one object you get back, all other objects of class X remain the same)
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
<Jc_>
Maybe the later is more suitable for my need. I'll investigate monkeypatching. Thank you :)
<yxhuvud>
another option is to use coercion, with to_str/to_proc and the like. however, that is probably not the way to do it in your case.
<yxhuvud>
You can also create a proxy object instead of subclassing.
<burgestrand>
Jc_: ^
<Jc_>
yxhuvud: well, to make it clear : the Object I use are return by WIN32OLE calls, and my purpose is just to extend them for basic purposes (like adding a "archive()" method to a Mail object)
<Jc_>
I'm new to Ruby, but monkeypatching seems dangerous, fun, and easy : just [re]defining the class and adding my methods, or am I wrong ?
<burgestrand>
Jc_: sounds about right
<Jc_>
Cool, let's have som fun with it then :)
<burgestrand>
Jc_: it becomes really weird if you define true to equal false and all that stuff… and kinda fun if you add a call to rand() to it.
<Jc_>
Yup, I just read a few posts about overwriting Class.inherited() and break all inheritable attributes ^^
srbartle_ has joined #ruby-lang
srbartlett has quit [Ping timeout: 255 seconds]
olesu has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
roha has quit [Ping timeout: 244 seconds]
<countdigi>
just curious - in this gist the foo definition returns the array bar but the method above doesn't return the array of objects unless I explicitly stage vgs on line 6: https://gist.github.com/2687136
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
<countdigi>
ruby 1.9.2
znake has quit [Quit: znake]
voker57 has quit [Read error: Connection reset by peer]
macmartine has quit [Ping timeout: 265 seconds]
<burgestrand>
countdigi: foo actually just returns %w[ a b c d ]
GSHN has quit [Read error: Connection reset by peer]
<burgestrand>
countdigi: "bar" in foo is lost
GSHN has joined #ruby-lang
<Mon_Ouie>
You should use #map anyway
vesan__ has quit [Ping timeout: 248 seconds]
diegoviola has quit [Quit: leaving]
Z33K|Lux has quit []
vesan has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
roha has joined #ruby-lang
<countdigi>
ah gotcha tx
lolmaus has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
jxie has quit [Quit: leaving]
vesan has quit [Read error: Connection reset by peer]
olesu has quit [Remote host closed the connection]
sandbags has quit [Ping timeout: 252 seconds]
vesan has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
sandbags has joined #ruby-lang
pygmael has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
pygmael has joined #ruby-lang
<rue>
burgestrand: Foo was lost in the bar
olesu has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
sepp2k has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
Boohbah has joined #ruby-lang
heftig has quit [Ping timeout: 245 seconds]
yannis has quit [Quit: yannis]
<countdigi>
i see how to do it w/ map .. lot cleaner and no tmp var needed - tx
<apeiros_>
youngin: write a country class, read one list and create the country instances, use a hash to store them, read the other list and amend the country instances
benanne has joined #ruby-lang
<youngin>
cool
<youngin>
thanks man
<apeiros_>
and then use sort_by
<rue>
There should be a #splort_by
<apeiros_>
those two list don't seem to contain the same countries, though?
<youngin>
no, the gdp_ppp contain a bunch of others as well (they are irrelevant though)
<apeiros_>
ah, so oic contains a subset of the countries of gdp_ppp
<youngin>
yeah thats right
roha has quit [Ping timeout: 252 seconds]
roha has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
yannis has joined #ruby-lang
crekev has joined #ruby-lang
adambeynon has joined #ruby-lang
<crekev>
Hi, how can I trigger `bundle install` from within a ruby script? I want to require extra gem groups in some modules, but only if necessary. It must be something with Bunder.???? … Bundler.settings.without works fine, but just `bundle install` doesn't do the job.
<rue>
Is your CWD correct?
adambeynon has quit [Client Quit]
<rue>
Also, I’m sure there’s a programmatic way
<crekev>
I think so. Bundler.settings.inspect looks fine
tRAS has quit [Quit: Mother, did it need to be so high?]
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
dcorbin has joined #ruby-lang
adambeynon has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
rolfb has joined #ruby-lang
zmack has joined #ruby-lang
adambeynon has quit [Quit: adambeynon]
TheHunter_1039 has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
behr_ has quit [Remote host closed the connection]
lupine_85 has quit [Changing host]
lupine_85 has joined #ruby-lang
toretore has joined #ruby-lang
QaDeS has joined #ruby-lang
cschneid_ has quit [Remote host closed the connection]
Codif has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
Indian has joined #ruby-lang
cschneid has joined #ruby-lang
Gaivs has joined #ruby-lang
cschneid has quit [Excess Flood]
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
cschneid has joined #ruby-lang
<crekev>
maybe I just ask again … anybody knows how can I trigger `bundle install` from within a script? I want to require extra gem groups in some modules, but only if necessary. It must be something with Bunder.???? … Bundler.settings.without and Bundler.settings.inspect work fine, but how to trigger `bundle install` programmatically?
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
benanne has quit [Quit: kbai]
Codif has quit [Remote host closed the connection]
Gaivs has quit [Ping timeout: 260 seconds]
Gaivs has joined #ruby-lang
vesan has quit [Ping timeout: 248 seconds]
vesan__ has joined #ruby-lang
RegEchse has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
Indian has quit [Quit: Indian]
jxie has quit [Ping timeout: 245 seconds]
srbartle_ has quit [Remote host closed the connection]
srbartlett has joined #ruby-lang
srbartlett has quit [Ping timeout: 252 seconds]
pygmael has quit [Read error: Connection reset by peer]
mssola has joined #ruby-lang
pygmael has joined #ruby-lang
Radium_ has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
francisfish has joined #ruby-lang
GSHN has joined #ruby-lang
ConstantineXVI has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
krohrbaugh has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
robbyoconnor has joined #ruby-lang
robbyoconnor has quit [Changing host]
robbyoconnor has joined #ruby-lang
nahhh has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
QaDeS has quit [Ping timeout: 245 seconds]
Radium_ has quit [Ping timeout: 272 seconds]
QaDeS_ has joined #ruby-lang
heftig has joined #ruby-lang
jaisoares has joined #ruby-lang
nofxx has quit [Ping timeout: 252 seconds]
Gaivs has quit []
jarib has quit [Excess Flood]
Radium has joined #ruby-lang
Gaivs has joined #ruby-lang
GSHN has joined #ruby-lang
jarib has joined #ruby-lang
jaisoares has left #ruby-lang [#ruby-lang]
francisfish has quit [Remote host closed the connection]
jaisoares has joined #ruby-lang
jaisoares has quit [Quit: jaisoares]
jaisoares has joined #ruby-lang
nofxx has joined #ruby-lang
kiddorails has joined #ruby-lang
jperry2 has joined #ruby-lang
jwbuurlage has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
QaDeS_ has quit [Ping timeout: 245 seconds]
GSHN has joined #ruby-lang
<Gaivs>
guys, I having difficulties to access a variable defined inside a anonymous module
<apeiros_>
note that this will read the image completely into ram before saving it to disk. if you want to use smaller buffers, read & write chunks instead of just &:read
<kiddorails>
apeiros_: Thanks!
<kiddorails>
read and write chunks? You mean, to divide the files in fragment and sequentially do it?
<Gaivs>
hey guys! once I defined a anoymous Module, I need to 'include' it in order to get the functions I've declared on it?
GSHN has quit [Read error: Connection reset by peer]
<Gaivs>
cause I can't do it in another way
<Gaivs>
in ruby 1.9
<kiddorails>
Gaivs: yes, upon defining the module.
<kiddorails>
you include it in the class where you want it's instance to get accessed.
GSHN has joined #ruby-lang
<Gaivs>
yes, but I using this anonymous module to make temporary changes on my global namespace
GSHN has quit [Read error: Connection reset by peer]
<Gaivs>
if I need to do an include I'm change the commom global scope
<Gaivs>
not accomplishing what I want :)
GSHN has joined #ruby-lang
roha has quit [Ping timeout: 245 seconds]
<Gaivs>
Explaining: I'm tryng do do a 'temporary require', i.e. making a require, using what I want and then remove the classes included. Do you can help he?
<Gaivs>
and sorry the bad english =/
<Gaivs>
my intent is to do like the load(filename, wrap=True), but I want to have the anonymous module ruby creates in loading...
<Gaivs>
is there a way to arbitrarily remove a name from my global binding?
ankurgel_ has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
kiddorails has quit [Ping timeout: 255 seconds]
ankurgel_ has quit [Client Quit]
GSHN has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
kiddorails has joined #ruby-lang
tomb_ has joined #ruby-lang
<Gaivs>
someone knows a way to remove a name from my global binding? specifically, names required from other modules
jxie has joined #ruby-lang
frem has quit [Ping timeout: 265 seconds]
roha has joined #ruby-lang
jaisoares has quit [Ping timeout: 272 seconds]
lolmaus has quit []
thone has quit [Ping timeout: 240 seconds]
thone has joined #ruby-lang
ioanpaulpirau has quit [Ping timeout: 244 seconds]
francisfish has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
fayimora has quit [Quit: Busy…..zzzzz]
GSHN has joined #ruby-lang
jperry2 has quit [Quit: Leaving.]
jperry2 has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
jperry2 has quit [Client Quit]
GSHN has joined #ruby-lang
VegetableSpoon has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
<rue>
Constants?
<rue>
You can remove constants, but you can’t for example uninclude a module
<Gaivs>
rue: but I can make the names I included not accessible anymore?
<rue>
Don’t say “name”, there’s no such thing
<Gaivs>
rue: I mean a binding, an association between a name and a memory space in the global environment
<Gaivs>
right?
fayimora has joined #ruby-lang
<Gaivs>
what the conventioned name for this in ruby?
ssand has joined #ruby-lang
fayimora has quit [Read error: Connection reset by peer]
macmartine has joined #ruby-lang
<rue>
Classes and modules are usually referred to by a constant. Other objects are usually referred to by a variable (local, global, instance, class)
francisfish has joined #ruby-lang
fayimora has joined #ruby-lang
TDJACR has quit [Read error: Operation timed out]
<Gaivs>
right. But, given a constant referring to a class that I included once, e.g. "ActiveRecord", I would like to remove this, in a way that if try to access then, it will no more be accessible
<Gaivs>
Do I am being clean, rue? I feel I not expressing me correctly
francisfish has quit [Remote host closed the connection]
GSHN has quit [Read error: Connection reset by peer]
<rue>
Gaivs: ActiveRecord is a constant, so you can just reassign it. ActiveRecord = nil
GSHN has joined #ruby-lang
<rue>
Essentially, creating a class/module is like ModuleName = Module.new { stuff goes here }
<rue>
But, as I said, you won’t undo the *effects* of having added the class/module. If, for example, it adds a global variable, or is secretly included into other classes, all that will stay. You’re just undefining the constant
<Gaivs>
rue: I got...
<erikh>
deherpinstan
cdt has quit [Quit: Ex-Chat]
<Gaivs>
rue: do you know how works the 'load(filename, wrap=true)'
jwbuurlage has quit [Quit: jwbuurlage]
<Gaivs>
it seems it makes how I need, but this seems to be a internal of ruby...
jwbuurlage has joined #ruby-lang
francisfish has joined #ruby-lang
cdt has joined #ruby-lang
TDJACR has joined #ruby-lang
fjfish has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
francisfish has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
kiddorails has quit [Ping timeout: 244 seconds]
fayimora has quit [Quit: Busy…..zzzzz]
GSHN has quit [Read error: Connection reset by peer]
slyphon_away has joined #ruby-lang
ssandEFG has joined #ruby-lang
GSHN has joined #ruby-lang
Indian has joined #ruby-lang
ssand has quit [Ping timeout: 245 seconds]
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
nofxx has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
olesu has quit [Remote host closed the connection]
olesu has joined #ruby-lang
sora_h is now known as s0ra_h
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
<Jc_>
One of my method is receiving a code block for doing "something" on some files. Works ok. Now I want my method to call itself recursively to handle subdirs. Is there a way to provide the "code block" to the recursive calls ?
* Jc_
is wondering why code blocks are not handled like usual args...
<Defusal_>
Jc_, they are
<Mon_Ouie>
some_method(&block)
<Defusal_>
^
<Mon_Ouie>
But they're not, they don't count as normal argument
<Defusal_>
they are a special arg
<Jc_>
Mmm, can I pass it to another method ?
<Defusal_>
does anyone know why data = data.encode('UTF-8', :invalid => :replace, :replace => '').encode('UTF-8'); data.split(delimiter); => invalid byte sequence in UTF-8
<Defusal_>
Jc_, exactly like that
<Jc_>
Just tried : works perfectly. I love this language...
behr has joined #ruby-lang
<Defusal_>
:)
olesu has quit [Remote host closed the connection]
<Jc_>
Seriously, I started ruby less than two weeks ago, and, coming from Perl, it's really nice.
<Jc_>
<flame>Except those "end" keywords, of course :p</flame>
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
jwbuurlage has quit [Quit: jwbuurlage]
<Defusal_>
hehe, you learn to like end
<countdigi>
Jc_: felt similar about the end but now i must say i prefer it
<Jc_>
Sure, I am just used to {} blocks [Perl, C, Java], but I guess 'end' is as good/bad as them
GSHN has quit [Read error: Connection reset by peer]
<Defusal_>
at the very least, it's more human
<countdigi>
the idiom still has {} for blocks
<Defusal_>
yup
<Defusal_>
but not for all constructs CodeBlock
<Defusal_>
countdigi *
<Defusal_>
but you can use methods and blocks for almost everything anyway
<countdigi>
yeah how would u say that? closures can have {} but not type defs?
GSHN has joined #ruby-lang
<Defusal_>
yea
<Defusal_>
if anyone knows how i can remove all invalid utf-8 encoded chars from a string, please let me know
gasbakid has quit [Read error: Connection reset by peer]
<Gaivs>
well, I learned to live well with delimiting blocks with indentation of python. All approaches have pros and cons, but I prefer the python way
<Gaivs>
indeed, the end is better than {} as blocks
<Gaivs>
the 'end' keyword*
<countdigi>
Jc_: whats the input from ur perl friends on ruby as an alt?
bryancp has joined #ruby-lang
<Jc_>
Feedback about Perl users is rather positive. Ruby code is easier to read, object management is way above Perl's. Exception handling is also great.
<Jc_>
s/about/among/
kyrylo has quit [Quit: WeeChat 0.3.7]
kyrylo has joined #ruby-lang
kyrylo has quit [Changing host]
kyrylo has joined #ruby-lang
<Jc_>
Performance could be an argument, but we did not met any situation where it was significant, to be honest
TheHunter_1039 has quit [Quit: TheHunter_1039]
<Jc_>
So, except the "end" keyword that seem to come from VB ;-) We like Ruby
GSHN has quit [Read error: Connection reset by peer]
<andrewvos>
HEY HEY HEY !
<countdigi>
cool to hear
GSHN has joined #ruby-lang
<Jc_>
My only surprise came from some argument number changed between 1.8 and 1.9 (in the rand() method)
lsegal has joined #ruby-lang
<Jc_>
We aere also wondering if we should use Python or Ruby. But I gues I'm not in the good place to ask ;)
dr0id has quit [Quit: Leaving.]
<Jc_>
Time to drink a glass of milk in the sun...
Jc_ is now known as Jc_Away
roha has quit [Ping timeout: 245 seconds]
<countdigi>
i like the new way of writing hashes in 1.9
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
<andrewvos>
Obligatory Anchorman quote.
latsarazzi is now known as kish
cantonic has joined #ruby-lang
grin has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
Sheperson has joined #ruby-lang
GSHN has joined #ruby-lang
<Sheperson>
I am looking for a good and short beginner's book on Ruby, can you suggest anything?
<Sheperson>
I have experience in Java, C, Python and PHP!
<deryl>
Programming Ruby 1.9 or The Well Grounded Rubyist
benanne has joined #ruby-lang
<deryl>
or _why's Poignant Guide To Ruby
<countdigi>
ya know whats good to go through is the ruby koans
<countdigi>
when i run it rspec -rd i only see the last of the keys as an example pass
cdt has quit [Ping timeout: 272 seconds]
<countdigi>
and a loop round it { test key } doesn't seem to work - looking for someway of automating at runtime creating a whole bunch of it { test } statements
<countdigi>
sorry thats rspec -fd
fjfish has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 250 seconds]
rippa has joined #ruby-lang
francisfish has joined #ruby-lang
samuelkadolph_ has joined #ruby-lang
GSHN has quit [Read error: Connection reset by peer]
samuelkadolph has quit [Ping timeout: 248 seconds]
samuelkadolph_ is now known as samuelkadolph
savage- has joined #ruby-lang
olesu has quit [Remote host closed the connection]
GSHN has joined #ruby-lang
olesu has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
gsav has joined #ruby-lang
sonja has joined #ruby-lang
<sonja>
what's the name for a person who uses PHP?
imperator has joined #ruby-lang
<sonja>
Rubyist, Pythonista, PHPist?
* countdigi
smells a setup ;-)
<sonja>
no it's a sincere question
<sonja>
:)
<countdigi>
i would guess php-er
* yxhuvud
'd vote for 'misguided'
morozovm has joined #ruby-lang
wvdschel has joined #ruby-lang
wvdschel has joined #ruby-lang
<wvdschel>
I want to embed a caching mechanism into multiple classes. I'm thinking of adding a static method (or whatever is the opposite of instance methods is) called get to all these classes. is this possible with a mixin module? or how would you go about this?
<canton7>
class methods, and yeah, you can use extend to add class methods
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
<yxhuvud>
wvdschel: rails or not rails?
<wvdschel>
not rails
grin has quit [Quit: Leaving.]
benanne has quit [Quit: kbai]
JohnBat26 has joined #ruby-lang
<yxhuvud>
I'll probably not be able to help then.
<wvdschel>
yxhuvud: thanks anyway :)
<wvdschel>
canton7: so how do I define the class method in a module and use it for the extending classes?
<wvdschel>
I have a module M and class C extending M
<canton7>
yeah. module MyCachingClass; methods definitions... end. class MyClassWhichNeedsCachine; extend MyCachingClass; blah blah end
<wvdschel>
yeah, but def self.get ... end in MyCachingClass doesnt allow me to do MyClassWhichNeedsCaching.get :(
<drbrain>
khaase: I don't think they're using the latest, though :/
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
<wvdschel>
canton7: aha, cool!
<wvdschel>
thanks a lot!
<khaase>
drbrain: yeah, I'm not super happy with that, as the readme is used in many places. i.e. will it work with rubydoc.info (which we use for docs atm) and I'll probably also have to dive into the website generation
<canton7>
:)
<drbrain>
khaase: I've been meaning to file a bug with github about their use of a non-latest version of the rdoc parser
<khaase>
:D
jstarcher has joined #ruby-lang
tomb_ has joined #ruby-lang
TDJACR has left #ruby-lang [#ruby-lang]
tRAS has quit [Quit: Mother, did it need to be so high?]
sonja has quit [Remote host closed the connection]
GSHN has quit [Read error: Connection reset by peer]
GSHN has joined #ruby-lang
behr has joined #ruby-lang
indeterminate has joined #ruby-lang
igotnolegs has joined #ruby-lang
Veejay has joined #ruby-lang
olesu has quit [Remote host closed the connection]
<whitequark>
->(x) { } is equivalent to lambda { |x| }
cads has joined #ruby-lang
<freedrull>
whitequark: oh cool
<freedrull>
should have guessed, that method is named 'to_proc' ha
<cads>
hey all, I have written the following ruby file, and I'd like to load it into IRB to play with the variable I've defined: https://gist.github.com/2690764
<cads>
I've very rusty with ruby, so I've forgotten how do to this
<whitequark>
make it a global ($greek)
<whitequark>
then irb> load "file.rb"
Asher has joined #ruby-lang
<cads>
awesome, thanks
<cads>
so load will run a ruby file, and add classes, modules, and global variables into the current IRB context?
s0ra_h is now known as sora_h
Asher has quit [Client Quit]
jstarcher has quit [Remote host closed the connection]
Defusal_ has quit [Ping timeout: 265 seconds]
<whitequark>
yeah, kind of
<whitequark>
it will just execute all the code in that file, and the file can do whatever it can with the global ruby context
<whitequark>
which is also the irb context in this case
<whitequark>
note that local variables are not promoted to irb context
<cads>
yes, I see now that was the exact issue I was having
slyphon_away is now known as slyphon
benanne has quit [Quit: kbai]
Natch| has quit [Read error: Connection reset by peer]
Natch| has joined #ruby-lang
Defusal has joined #ruby-lang
publicvoid__ has joined #ruby-lang
dejongge has quit [Ping timeout: 245 seconds]
tr-808 has quit [Ping timeout: 260 seconds]
publicvoid_ has quit [Ping timeout: 244 seconds]
tenderlove has quit [Remote host closed the connection]