<eam>
whitespace is significant if the rule isn't "tokenize on \s+"
chriskk has quit [Quit: chriskk]
<eam>
or even \s*
<Spaceghostc2c>
But, sans the pedantic point, ruby isn't all that particular in leading whitepace.
<Spaceghostc2c>
whitespace, even.
fantazo has joined #ruby
nari has quit [Ping timeout: 245 seconds]
ryanRT has joined #ruby
balki_ is now known as balki
cascalheira has joined #ruby
sailias has joined #ruby
jorge_ has joined #ruby
krzkrzkrz has joined #ruby
cascalheira has quit [Client Quit]
danheberden has quit [Excess Flood]
scootiepuff has quit [Remote host closed the connection]
krz has quit [Ping timeout: 276 seconds]
krzkrzkrz is now known as krz
danheberden has joined #ruby
<Majost>
How do I go about printing the default value for an option used by optparse; I currently have it implemented in this way: http://pastie.org/4408766
<Majost>
I tried both of those methods, and got the same error
blazes816 has quit [Quit: Leaving]
<Majost>
Do I simply need to add at the top something like: lport = 5432
benson has quit [Remote host closed the connection]
jonathanwallace has quit [Remote host closed the connection]
Konboi has joined #ruby
jonathanwallace has joined #ruby
<bricker88>
so… I'm pretty tired so this might sound stupid… I have an array that I want to treat like a hash… arr=["a", "b", "c"]; arr["z"] #=> nil. Is the best way just to convert it to a hash with "true" for all the values or something?
savage- has quit [Remote host closed the connection]
ipoval has joined #ruby
jonathanwallace has quit [Ping timeout: 256 seconds]
<eam>
bricker88: yes, and perhaps use has_key?
linoj has quit [Quit: linoj]
jimeh has joined #ruby
kenichi has quit [Remote host closed the connection]
chrisja has quit [Quit: leaving]
Speed has quit [Remote host closed the connection]
Brutus- has quit [Quit: Sto andando via]
ipoval has quit [Client Quit]
adamkittelson has quit [Remote host closed the connection]
sailias has quit [Ping timeout: 245 seconds]
niklasb has joined #ruby
beakerma_ has quit [Read error: Connection reset by peer]
beakerman has joined #ruby
yoklov has joined #ruby
daniel_hinojosa has quit [Ping timeout: 255 seconds]
moshee has quit [Ping timeout: 252 seconds]
taypen has joined #ruby
orange_ninja has quit []
<rking>
Hi guys. A coworker on OSX used "port install ruby19", but the $PATH ruby is 1.8, where did this MacPorts put things?
<ged>
rking: /opt/local
moshee has joined #ruby
<ged>
rking: So, /opt/local/bin/ruby probably.
brdude has quit [Quit: brdude]
emmanuelux has quit [Ping timeout: 268 seconds]
yoklov has quit [Client Quit]
jorge_ is now known as _jorge
hynkle has quit [Quit: Computer has gone to sleep.]
freeayu has quit [Ping timeout: 245 seconds]
dankest has joined #ruby
freeayu has joined #ruby
hynkle has joined #ruby
Araxia has quit [Read error: No route to host]
w400z has quit [Quit: Computer has gone to sleep.]
<thebodyguard>
foobar is a long or short turn to oblbivion krz
bradhe has quit [Remote host closed the connection]
mascool has quit [Ping timeout: 244 seconds]
td123 has joined #ruby
ringotwo has quit [Remote host closed the connection]
sailias has quit [Ping timeout: 246 seconds]
adeponte has joined #ruby
wargasm has left #ruby [#ruby]
codeFiend has joined #ruby
w400z has joined #ruby
VegetableSpoon has quit [Quit: Leaving]
Araxia has quit [Quit: Araxia]
_jorge has quit [Remote host closed the connection]
voodoofish430 has quit [Quit: Leaving.]
apok_ has joined #ruby
apok_ has quit [Client Quit]
td123 has quit [Ping timeout: 244 seconds]
havenn has joined #ruby
shadoi has quit [Quit: Leaving.]
cczona has joined #ruby
apok has quit [Ping timeout: 240 seconds]
td123 has joined #ruby
Hanmac1 has joined #ruby
sailias has joined #ruby
iori has quit [Remote host closed the connection]
kpshek has joined #ruby
Hanmac has quit [Ping timeout: 245 seconds]
jonathanwallace has joined #ruby
cczona has left #ruby [#ruby]
daniel_hinojosa has quit [Ping timeout: 246 seconds]
xaq has joined #ruby
daniel_hinojosa has joined #ruby
<havenn>
Just released a gem called 'found' based on evanphx's new CoreLocation gem 'lost' and 'geokit'. So if you 'gem install found' you can then type 'found' and it gives you the nearest street address: https://github.com/havenwood/found
<havenn>
There isn't much to 'found', but l
<havenn>
but 'lost' is worth looking at!
axl_ has quit [Quit: axl_]
<fowl>
havenn: your gem knows my location?
ipoval has joined #ruby
michaelmartinez has joined #ruby
<fowl>
whew, it failed to build, im safe (:
bradhe has joined #ruby
<havenn>
fowl: If you are using a Mac, it asks you if it can have location data. =P Yeah, 'lost' has to compile.
mucker has quit [Ping timeout: 252 seconds]
<havenn>
Right now 'found' gives me "Rugged Trail, Topanga Canyon, CA 90290, USA" and 'lost' gives me [34.10416324080013, -118.59267817253203] (call in an airstrike?)
sailias has quit [Ping timeout: 252 seconds]
zeen has joined #ruby
<banisterfiend>
havenn: cool
justsee is now known as justsee|away
adeponte has quit [Remote host closed the connection]
taypen has quit [Ping timeout: 252 seconds]
savage- has joined #ruby
erichmenge has joined #ruby
bothra has quit [Ping timeout: 245 seconds]
mrsolo has quit [Quit: Leaving]
jonathanwallace has quit [Remote host closed the connection]
td123 has quit [Ping timeout: 268 seconds]
jonathanwallace has joined #ruby
<fowl>
d
taypen has joined #ruby
taypen has quit [Changing host]
taypen has joined #ruby
nadirvardar has joined #ruby
aers has quit [Quit: Leaving...]
banisterfiend is now known as kirill
meoblast001 has quit [Quit: Leaving]
jonathanwallace has quit [Ping timeout: 252 seconds]
havenn has quit [Remote host closed the connection]
bricker88 has quit [Quit: Leaving.]
bricker88 has joined #ruby
dankest has joined #ruby
igotnolegs has joined #ruby
ryanf has joined #ruby
sailias has joined #ruby
randomautomator has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
thebodyguard has quit []
lepht has quit [Read error: Operation timed out]
manizzle has quit [Quit: Leaving]
lepht has joined #ruby
yoklov has joined #ruby
manizzle has joined #ruby
<jazzanova>
thanks guys
mmokrysz has joined #ruby
mmokrysz has left #ruby [#ruby]
justsee|away is now known as justsee
kpshek has quit [Ping timeout: 248 seconds]
deryl has joined #ruby
noyb has joined #ruby
daniel_hinojosa has quit [Ping timeout: 265 seconds]
wereHamster has quit [Quit: Lost terminal]
daniel_hinojosa has joined #ruby
syamajala has quit [Remote host closed the connection]
CannedCorn has joined #ruby
<CannedCorn>
how would you go about writing code to remove the method eql? if defined
slux has quit [Ping timeout: 265 seconds]
<CannedCorn>
remove_method(:eql?) if defined(:eql?) doesn't seem to do the trick
slux has joined #ruby
awarner has quit [Remote host closed the connection]
sbbsbb has quit [Read error: Connection reset by peer]
kyktommy has joined #ruby
sbbsbb has joined #ruby
savage- has quit [Remote host closed the connection]
CannedCorn has quit [Client Quit]
iori has joined #ruby
jonathanwallace has joined #ruby
<ryanf>
hmm not sure how to do it dynamically, but you can use "undef eql?"
<ryanf>
if you know the literal name of the method you want to undefine
chimkan has quit [Quit: chimkan]
itnomad has quit [Ping timeout: 246 seconds]
<kirill>
ryanf: what's wrong with remove_method(:eql?) if method_defined?(:eql?
<kirill>
hmm i guess :eql? will always be defined on the superclass
<kirill>
Object
iori has quit [Remote host closed the connection]
havenn has joined #ruby
jonathanwallace has quit [Ping timeout: 248 seconds]
Banistergalaxy has joined #ruby
tobym_ has quit [Remote host closed the connection]
axl_ has joined #ruby
<ryanf>
oh, does remove_method actually exist? I guess I was looking in the wrong place
cj3kim has joined #ruby
defendguin1 has left #ruby [#ruby]
iori has joined #ruby
itnomad has joined #ruby
codeFiend has quit [Ping timeout: 246 seconds]
akem has quit [Read error: Connection timed out]
baroquebobcat has joined #ruby
jazzanova has quit [Quit: Connection reset by pear]
daniel_hinojosa has quit [Ping timeout: 244 seconds]
wereHamster has joined #ruby
akem has joined #ruby
shadoi has joined #ruby
reuf has joined #ruby
michaelmartinez has joined #ruby
michaelmartinez has quit [Client Quit]
dvolker has joined #ruby
michaelmartinez has joined #ruby
reuf has quit [Client Quit]
MetaCosm has joined #ruby
cakehero has quit [Quit: Leaving...]
baroquebobcat has quit [Quit: baroquebobcat]
ringotwo has joined #ruby
sailias has quit [Ping timeout: 245 seconds]
jeff_sebring has joined #ruby
zastern has joined #ruby
itnomad has quit [Ping timeout: 248 seconds]
philips_ has quit [Excess Flood]
Drewch has joined #ruby
cj3kim has left #ruby ["Leaving"]
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
<Drewch>
Sorry for not looking much online first, but since I'm here, what do people consider to be the "Bible" of ruby books
<Drewch>
Not RoR, just a book for someone with many years of programming experience wanting to do ruby, mainly a C background
beakerma_ has joined #ruby
philips_ has joined #ruby
jhunter has quit [Read error: Operation timed out]
<zastern>
Am I right in thinking that this code here ** target = File.open(filename, 'w') ** sets the variable target to represent the file specified in variable "filename" and the "w" option creates that file if it doesn
<zastern>
doesn't already exist*
beakerman has quit [Ping timeout: 245 seconds]
vitor-br has quit [Quit: Saindo]
kpshek has joined #ruby
jeff_sebring has quit [Ping timeout: 246 seconds]
jhunter has joined #ruby
mfcabrera has joined #ruby
iori has quit [Remote host closed the connection]
kpshek has quit [Ping timeout: 244 seconds]
jeff_sebring has joined #ruby
w400z has quit []
sailias has joined #ruby
Goles has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
Goles has quit [Remote host closed the connection]
linoj has joined #ruby
linoj has quit [Client Quit]
e___ has quit []
cloud|droid has joined #ruby
<deryl>
it returns a File object labeled 'target', with the associated File set to 'w'rite mode only. Yes, if the file does not exist it will create it for you.
Goles has joined #ruby
joast has joined #ruby
Abbas| has quit [Ping timeout: 276 seconds]
mockra has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
cj3kim has quit [Quit: Leaving]
jeff_sebring has quit [Quit: Leaving]
<zastern>
deryl, that's helpful, thanks.
<zastern>
I tried to find the answer with ri, but I had trouble.
<zastern>
and the character "w" isn't very googleable
<excelsior>
202 seems to be messed up. Why should to_s be defined in the class Dog7?
mockra has quit [Remote host closed the connection]
slux has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
_jorge has joined #ruby
joast has quit [Ping timeout: 244 seconds]
havenn_ has joined #ruby
brdude has quit [Quit: brdude]
BrianJ has quit [Quit: Computer has gone to sleep.]
burgestrand has joined #ruby
<jmcphers>
zastern: mode strings are from C stdlib call fopen(); "man fopen" for more details
jonathanwallace has quit [Ping timeout: 245 seconds]
w7tree has joined #ruby
pu22l3r_ has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
nobitanobi has joined #ruby
ananthakumaran has joined #ruby
td123 has joined #ruby
<zastern>
jmcphers, I'll do that, thanks
mockra has joined #ruby
<Drewch>
Programming-Ruby-1-9-Pragmatic-Programmers OR Ruby-Programming-Language
<Drewch>
What does the Ruby community consider the better book for being new to ruby be experienced developer
hadees has quit [Quit: hadees]
cloud|droid is now known as cloud|home
Beoran_ has joined #ruby
hadees has joined #ruby
cloud|home is now known as cloud|droid
<burgestrand>
Drewch: I’ve heard good things about both. However, an old version of Programming Ruby is available online for free: http://ruby-doc.org/docs/ProgrammingRuby/
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
<Drewch>
Oh cool, thanks :)
<Drewch>
What about: "The Ruby Way"
Beoran has quit [Ping timeout: 272 seconds]
iamjarvo has quit [Quit: Leaving...]
<burgestrand>
Drewch: heard good things about it too but I haven’t read it. :P
<Drewch>
:)
`brendan has quit [Ping timeout: 244 seconds]
jarred has joined #ruby
<burgestrand>
Drewch: I used to collect useful ruby resources before, here are my notes: http://simp.ly/publish/ymW6Jk — I only ever wrote up books that I heard enough good stuff about to grab my attention, and it hasn’t been updated in almost a year. ^^
apok has quit [Quit: apok]
mtkd_ has quit [Read error: Operation timed out]
bperry has quit [Read error: Operation timed out]
<burgestrand>
Drewch: so the books at the bottom are the ones I’ve heard good things about from various people and in this channel.
bperry has joined #ruby
lae has quit [Read error: Operation timed out]
<Drewch>
sweet just looking, does this link stay up?
bradhe has quit [Ping timeout: 246 seconds]
mtkd has joined #ruby
<burgestrand>
Drewch: I’d assume it stays up as long as I have the account (which I don’t plan to get rid of), but feel free to take copies if you want. The link updates whenever I add new stuff to it :)
<burgestrand>
Or, not the link, but the content.
tiripamwe has quit [Ping timeout: 246 seconds]
<burgestrand>
The content updates. Link stays the same.
lae has joined #ruby
<Drewch>
hehe:)
tiripamwe has joined #ruby
havenn_ has quit [Remote host closed the connection]
<Drewch>
bookmarked :D
<Drewch>
eloquent ruby looks interesint
<Drewch>
have u read that one
erichmenge has quit [Quit: Be back later]
erichmenge has joined #ruby
yasushi has joined #ruby
erichmenge has quit [Client Quit]
excelsior has quit [Ping timeout: 265 seconds]
yxhuvud has joined #ruby
erichmenge has joined #ruby
xaq has quit [Remote host closed the connection]
emsilva has joined #ruby
erichmenge has quit [Client Quit]
krusty_ar has quit [Remote host closed the connection]
tommyvyo has quit [Quit: Computer has gone to sleep.]
<burgestrand>
Drewch: sorry, have to startle off to work :)
<Drewch>
cya, thanks
burgestrand has quit [Quit: Leaving.]
td123 has quit [Ping timeout: 265 seconds]
jonnn has joined #ruby
jonnn has left #ruby [#ruby]
td123 has joined #ruby
jonahR has quit [Quit: jonahR]
havenn has joined #ruby
ananthakumaran1 has joined #ruby
zastern has quit [Remote host closed the connection]
ananthakumaran has quit [Ping timeout: 252 seconds]
kylesnav has joined #ruby
ananthakumaran1 has quit [Client Quit]
ananthakumaran has joined #ruby
<kylesnav>
Hey guys can anyone help me with a quick question about resumes? (in webdev)
tonini has joined #ruby
codeFiend has joined #ruby
td123 has quit [Read error: Operation timed out]
<kirill>
kylesnav: programmers.stackexchange.com is probably best place 4 that kind of Q
td123 has joined #ruby
havenn has quit [Ping timeout: 245 seconds]
nobitanobi has quit [Read error: Connection reset by peer]
<emsilva>
How would I be able to dynamically instantiate a Datamapper Model from a string?
nobitanobi has joined #ruby
ryanf has quit [Ping timeout: 244 seconds]
khakimov has joined #ruby
ringotwo has quit [Remote host closed the connection]
nobitanobi has quit [Remote host closed the connection]
syamajala has joined #ruby
kylesnav has left #ruby [#ruby]
nXqd has joined #ruby
xnm has quit [Ping timeout: 246 seconds]
d3vic3 has quit [Ping timeout: 244 seconds]
chimkan has joined #ruby
SCommette has joined #ruby
d3vic3 has joined #ruby
berserkr has quit [Quit: Leaving.]
butblack_ has joined #ruby
beakerma_ has quit [Read error: Connection reset by peer]
yasushi has quit [Remote host closed the connection]
gmci has quit [Quit: Computer has gone to sleep.]
beakerman has joined #ruby
yasushi has joined #ruby
butblack has quit [Ping timeout: 240 seconds]
butblack_ is now known as butblack
jonathanwallace has joined #ruby
Jackneill has joined #ruby
Jackneill is now known as Guest74974
yasushi has quit [Ping timeout: 240 seconds]
s1n4 has joined #ruby
yxhuvud has quit [Ping timeout: 256 seconds]
Banistergalaxy has quit [Ping timeout: 255 seconds]
jonathanwallace has quit [Ping timeout: 245 seconds]
kyktommy has quit [Quit: kyktommy]
tiripamwe has quit [Ping timeout: 248 seconds]
alvaro_o has quit [Quit: Ex-Chat]
fearoffish has joined #ruby
chimkan has quit [Quit: chimkan]
kyktommy has joined #ruby
jillsmitt_ has joined #ruby
jillsmitt has quit [Ping timeout: 256 seconds]
derrida has quit [Ping timeout: 264 seconds]
aezop has joined #ruby
beneggett has joined #ruby
burgestrand has joined #ruby
robbyoconnor has joined #ruby
derrida has joined #ruby
ryanf has joined #ruby
RichieEvan has quit [Ping timeout: 276 seconds]
ryanf has quit [Client Quit]
iori has joined #ruby
robbyoconnor has quit [Remote host closed the connection]
laen_ has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
qwerxy has joined #ruby
jonathanwallace has joined #ruby
<pavelz>
hi, have been over tutorials, just wonder if you don't specify var in |a| in the enumerable iterators is there a default variable that is current element set to? _ seems to point to original array.
arietis has joined #ruby
<burgestrand>
pavelz: no
thomasfedb has joined #ruby
<burgestrand>
pavelz: and _ points to the result of the last expression in IRB, not in general
<peterhellberg>
pavelz: No, Ruby does not have built in support for Anaphora.
<pavelz>
peterhellberg, burgestrand thanks that clears it up. from perl thinking ruby is perlish thought this sort of be possible. kind of shorthand .each(&:dosomething) but in terms of .reject{ _!= 3}, oh well.
Rochefort has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
td123 has joined #ruby
Clooth has quit [Quit: Bye!]
jonathanwallace has joined #ruby
freeayu__ has joined #ruby
br4ndon has joined #ruby
<hoelzro>
pavelz: Ruby inherits a bunch of special variables from Perl, but $_ is not one of them
freeayu has quit [Ping timeout: 268 seconds]
jonathanwallace has quit [Ping timeout: 265 seconds]
td123 has quit [Ping timeout: 246 seconds]
<Hanmac>
shevy imo with_object has a bit shitty return value :/
<Muz>
Seq? Sounds like a non-standard command line tool.
<Muz>
(Doesn't ship by default on OS X)
<DefV>
jot replaces that on OS X
<dr_bob>
Muz: you can feed in any input, take "ls" if you need
<dr_bob>
The important bit is after the pipe symbol
AxonetBE has joined #ruby
<AxonetBE>
for what stands MRI in ruby 1.9.3 MRI ?
dpk has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
<DefV>
Matz Ruby Interpreter
rakunHo has quit [Remote host closed the connection]
<Muz>
DefV: minor point, but jot is rather different to seq. Most notably by the provided seq command not being simply reproducable by s/seq/jot/
<hoelzro>
that's one thing that frustrates the hell out of me about OS X
<hoelzro>
no seq.
<Muz>
hoelzro: by default.
dhruvasagar has quit [Ping timeout: 240 seconds]
td123 has quit [Ping timeout: 246 seconds]
<vectorshelve>
is there a one line ruby command to open a file and convert the first line to array and get its size? now I do this http://pastie.org/4410964 kind of a loop
<vectorshelve>
dr_bob: why is the command inside quotes ?
<Muz>
He's invoking it from the commandline.
graspee has joined #ruby
<Muz>
If you're doing that, you could do the entire thing with find, head, awk and wc.
<Muz>
And it'd be a damn sight quicker.
<vectorshelve>
Muz: ok...
<dr_bob>
well inside a program: File.open("x.rb", &:gets).split(/\s+/).size
y2k has quit [Ping timeout: 244 seconds]
<vectorshelve>
dr_bob: thanks mate :)
<dr_bob>
YWC
gmci has quit [Quit: Computer has gone to sleep.]
foEs has quit [Remote host closed the connection]
freeayu__ has quit [Ping timeout: 255 seconds]
elhu has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
w0lverine has quit [Ping timeout: 245 seconds]
RegEchse has joined #ruby
Rochefort has quit [Remote host closed the connection]
freeayu has joined #ruby
Rajesh has joined #ruby
Rajesh is now known as Guest19591
Clooth has joined #ruby
heftig has joined #ruby
und3f has quit [Ping timeout: 255 seconds]
w0lverine has joined #ruby
ssspiff has quit [Remote host closed the connection]
rutkla has quit [Ping timeout: 246 seconds]
slux has joined #ruby
mfcabrera has quit [Quit: Leaving]
rutkla has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
y2k has joined #ruby
ly_gs has joined #ruby
dhruvasagar has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
nilg has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
mc0e has joined #ruby
hemanth has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
und3f has joined #ruby
<mc0e>
(asking as a ruby noob) The recommended install process for rvm involves piping curl output straight into bash. That's not going to fly with most environments I work with. Is there a distributions system available that's set up properly with crypto signatures and so forth? Currently looking at debian, and there's no 'rvm' package from their repos. Any other options?
jonathanwallace has joined #ruby
Apocalypse has joined #ruby
<bnagy>
rbenv is much more neckbeard friendly (and just better use of unix imho)
<bnagy>
but it won't verify sigs for you afaik
tomask has joined #ruby
<bnagy>
well, it won't, if anything did it would be ruby-build
<Hanmac>
mc0e newer debian and newer ubuntu has a ruby-rvm package
<bnagy>
or if you just want to use a single ruby you can use apt
jonatha__ has joined #ruby
dhruvasagar has quit [Ping timeout: 255 seconds]
<bnagy>
but I guess you wouldn't have been looking at rvm if that were the case
w0lverine has quit [Quit: w0lverine]
dhruvasagar has joined #ruby
<mc0e>
what's the story on "gem install xyz"? does that system verify the integrity of what's installed?
<bnagy>
not afaik
jonathanwallace has quit [Ping timeout: 252 seconds]
<bnagy>
should verify the source though
<Muz>
I thought gem's verifiability behaviour was laughable at best.
Spooner has joined #ruby
<bnagy>
which is pretty much equivalent
<Muz>
It just downloads a Gzipped container, uncompresses it and shits the various files in the respective paths.
<Muz>
If there's any native extensions, you may get an error when things fail to build.
<bnagy>
like if a gem source wants to serve a bad gem they control whatever sigs
<Muz>
But that's about it.
nari has quit [Ping timeout: 245 seconds]
<mc0e>
it's not the source that needs verification, it's the content
<mc0e>
source is better than nothing though
<bnagy>
well what I'm saying is the source controls whatever you would use to verify the content
<mc0e>
makes me wonder about all the corporate environments using hiera with puppet.
laen_ has quit [Ping timeout: 246 seconds]
<bnagy>
only recent gem / ruby actually even has ssl checking turned on though :(
tomask has quit [Quit: Quit]
cascalheira has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
<Muz>
If you're really neck-beardy, you'd grab the source, and build your own RPMs from it and not allow the installation of arbitrary gems.
lkba has joined #ruby
<mc0e>
OR you just give ashit about security which is not hte same thing
<bnagy>
you can check shas for the source packges - that's more or less what you'd do with rbenv
<bnagy>
minus building rpms because fuck rpm
<mc0e>
but if that's the best option, then you'd think there would be a suitable repo already doing it for major items.
<Muz>
RPMs are the only true Enterprise option.
<Muz>
Anything less is NOT ENTERPRISE ENOUGH.
<bnagy>
I am mentally dubbing over you with the sound of irritated chickens
<Muz>
It's okay, I can feel hair exploding from my face as I typ that.
<mc0e>
you could check SHAs each time on a one off basis. gets tedious though unless you do it once and distribute your own copy of the code, which is basically what the rpm route ammounts to
<mc0e>
or deb or whatever
<bnagy>
well it's only an option for ruby itself, not for gems and stuff
<bnagy>
and you probably don't want to ship your own ruby
Foxandxss has joined #ruby
<bnagy>
if you only want one single system ruby that's integrated with your OS shiz then use your package manager and update-alternatives
<bnagy>
which Hanmac goes on about constantly
<bnagy>
personally I don't really like having a system ruby
laen_ has joined #ruby
<Muz>
Depends what it's for. Dev boxes, I'd agree with you, prod boxes, it makes more sense.
<bnagy>
I just prefer to minimize the chance that ruby will run as root
<Hanmac>
when you only want to support the latest ruby, than a system ruby is not so bad
<mc0e>
yeah, butthen you get systems like puppet, which is my main concern at present
<mc0e>
nice system, but implicitly has root on pretty much the whole of the network
<Muz>
Or if you're an ass-backwards corporate environment and you only want to support whatever version of ruby has been through the RedHat sieves, you can lock your prod boxes down to 1.8.x or jRuby 1.5.6 ARRGH
<bnagy>
I really like the design of ansible
* Muz
sighs about his current workplace.
<bnagy>
despite it being pythony
td123 has quit [Ping timeout: 246 seconds]
<mc0e>
bnagy: you seem to be saying that ruby's not suitable for that sort of use. that would be a shame
dhruvasagar has quit [Ping timeout: 252 seconds]
<bnagy>
depends what 'that sort of use' means
dhruvasagar has joined #ruby
dhaivatpandya has joined #ruby
bier__ has quit [Quit: Ex-Chat]
td123 has joined #ruby
<bnagy>
if your security requirement is low enough for a regular linux to be an option it's probably fine :D
<mc0e>
wtf?
xbob has quit [Quit: Leaving]
<bnagy>
chef and puppet scare me a little, but they also confuse me a lot so it's not really an issue
<mc0e>
that confusion is worth getting over when you've enough systems to need them
<bnagy>
ansible :)
<Muz>
They probably scare you because you don't understand them too.
<peterhellberg>
Muz: That must be awful :( (We still have some machines on REE… so I have some of those pains myself)
<mc0e>
which after the first week or so of learning means anything over 10 or so servers it's probably worth doing
<Muz>
peterhellberg: yeah, you could say it's Hell... berg.
* Muz
gets his coat.
<peterhellberg>
;)
<workmad3>
bnagy: which would you rather have... a fallible human setting up each machine individually, following a printed script that's probably wrong? or a nice automated system that churns through what needs to be done reliably?
<Muz>
workmad3: or a fallible human writing one bad puppet conf and nuking multiple machines in one fell swoop? ;)
<mc0e>
adn fast, and repeatably, and in a documented way
<peterhellberg>
Protip: alias rake_with_verbose_tests="rake TESTOPTS='-v'"
<Muz>
s/conf/manifest/
<workmad3>
Muz: yeah... but at least puppet and chef configs can be set up with automated testing :P
<peterhellberg>
I use it to track down slow running specs quite often
bier has joined #ruby
<bnagy>
workmad3: the second one but done properly
<workmad3>
bnagy: what's 'properly'? :)
<Muz>
workmad3: heh yeah. Just had a flashback to one particularly funny cock-up at my old workplace.
<Muz>
It was hilarious, because it wasn't my fault or problem...
<peterhellberg>
My current client had a "licensing server" (what ever that means) go haywire… and it started uninstalling _everything_ on the laptops of 350 employees.
<peterhellberg>
That was a couple of fun days for the IT-support guys.
td123 has quit [Ping timeout: 245 seconds]
<bnagy>
workmad3: that same guy has cobbler which is a PXE provisioning system, so you can go from bare metal to fully configured
dhruvasagar has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby
<workmad3>
bnagy: I wouldn't say that is 'properly'... it certainly sounds simpler than chef or puppet, and it could easily fit in as a small-medium config management system
<workmad3>
bnagy: however, I'm not fond of systems that try to set themselves up as 'better' based on a straw-man LoC argument...
<bnagy>
I don't care about the LOC I care about the architecture.
<workmad3>
bnagy: and yes, there is a learning curve for chef and puppet... because there's a learning curve for setting up distributed configuration management and the issues involved... a lot of them may not be applicable in a smaller scale system though :)
<bnagy>
anyway it's not my project, amd I'm not selling anything
<bnagy>
but fedora uses it
<workmad3>
yeah... it's just the implication of 'properly' that I was contending :P
jonatha__ has quit [Remote host closed the connection]
<workmad3>
as if there was a single, unambiguous 'proper' way to do this sort of stuff that should always be used...
gmci has joined #ruby
jonathanwallace has joined #ruby
Markvilla has joined #ruby
Markvill_ has joined #ruby
td123 has joined #ruby
<workmad3>
anyway... it's another option in the config management arsenal :)
<workmad3>
and it seems it could be one that fits in with a more modularised, build your own, approach... separate provisioning, convergence and source of truth...
jonathanwallace has quit [Ping timeout: 265 seconds]
butblack has quit [Quit: butblack]
Konboi has quit [Ping timeout: 245 seconds]
<bnagy>
I like things I can understand, and SSH I understand.
vectorshelve has quit [Ping timeout: 245 seconds]
<bnagy>
SSL is a toilet :/
<mc0e>
In most places I've worked I've had to educate fellow sysadmins about ssh. Usually by abusing agent keys they've forwarded.
<mc0e>
it's good if it's used properly
jjang_ has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
Markvill_ is now known as Markvilla
Markvilla1 has joined #ruby
jjang_ has quit [Remote host closed the connection]
<kalleth>
bnagy: nobody understands SSL.
gen0cide_ has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby
jjang has quit [Ping timeout: 244 seconds]
Markvilla1 has quit [Read error: No route to host]
Markvilla1 has joined #ruby
mc0e has left #ruby [#ruby]
jrajav has quit []
macer1 has quit [Ping timeout: 268 seconds]
Markvilla2 has joined #ruby
td123 has quit [Ping timeout: 246 seconds]
Markvilla1 has quit [Read error: No route to host]
<shevy>
hehe
td123 has joined #ruby
Markvilla2 has quit [Read error: Connection reset by peer]
<nonono440>
Basically, that initialize method with make a customer method which returns @customer
dhruvasagar has quit [Ping timeout: 245 seconds]
<nonono440>
The child class should override the method create with instance_eval, but it doesn't seem to be
Markvilla1 has quit [Quit: Leaving.]
chussenot has joined #ruby
dhruvasagar has joined #ruby
<hoelzro>
nonono440: ah, that's why
<hoelzro>
you're adding singleton methods
<hoelzro>
which are always considered before methods from the inheritance chain
und3f has quit [Quit: Leaving.]
<nonono440>
Right, I figured it was something like that.
<nonono440>
Is there an easy fix, or do I need to rethink it?
<hoelzro>
I think you should rethink it
<nonono440>
k
<nonono440>
Thanks a million
<hoelzro>
np
<bnagy>
try a delegate class with openstruct
sspiff has joined #ruby
sspiff has joined #ruby
nonono440 has quit [Quit: irc2go]
kedare has joined #ruby
mmokrysz has joined #ruby
mmokrysz has left #ruby [#ruby]
ThaDick has joined #ruby
slux has quit [Remote host closed the connection]
HRabbit has joined #ruby
`brendan has joined #ruby
krusty_ar has joined #ruby
davidpk has joined #ruby
dpk has quit [Disconnected by services]
davidpk is now known as dpk
Shrink has joined #ruby
kyktommy has joined #ruby
gmci has joined #ruby
nari has joined #ruby
cousine has joined #ruby
bluenemo has quit [Remote host closed the connection]
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
robotmay has quit [Remote host closed the connection]
kyktommy_ has joined #ruby
robotmay has joined #ruby
mengu has quit [Quit: Konversation terminated!]
mengu_ has joined #ruby
bluenemo has joined #ruby
robotmay has quit [Remote host closed the connection]
vectorshelve has joined #ruby
bluenemo has quit [Remote host closed the connection]
kyktommy has quit [Ping timeout: 244 seconds]
iori has quit [Ping timeout: 246 seconds]
cloud|droid has quit [Quit: Leaving]
codeFiend has quit [Read error: Connection reset by peer]
bluenemo has joined #ruby
<vectorshelve>
line 26 I have used methods of same class to inside the same class. is it wrong http://pastie.org/4410964 ?
paval has joined #ruby
<hoelzro>
seems fine to me, other than the fact that you're missing parameters to those method calls
tvw has quit [Ping timeout: 245 seconds]
Divinite has joined #ruby
verto|off is now known as verto
dhruvasagar has quit [Ping timeout: 256 seconds]
<vectorshelve>
hoelzro: yeah sorry I will do that :)
dhruvasagar has joined #ruby
Vert has joined #ruby
<vectorshelve>
hoelzro: self.method should do I guess .. :)
<vectorshelve>
so I wouldnt require an object
candy has joined #ruby
kedare|2 has joined #ruby
candy has left #ruby [#ruby]
<fowl>
vectorshelve: `y_axis = 0, cells = []` will not do what you want it to
yasushi has joined #ruby
kedare has quit [Ping timeout: 245 seconds]
vectorshelve has quit [Ping timeout: 245 seconds]
kedare|2 has quit [Ping timeout: 248 seconds]
niklasb has joined #ruby
niklasb has quit [Client Quit]
frumushica39 has joined #ruby
frumushica39 has left #ruby [#ruby]
br4ndon has quit [Ping timeout: 252 seconds]
vectorshelve has joined #ruby
iori has joined #ruby
br4ndon has joined #ruby
andrewhl has joined #ruby
tiripamwe has quit [Ping timeout: 265 seconds]
Divinite has quit [Remote host closed the connection]
wangr has joined #ruby
pen has joined #ruby
pen has quit [Remote host closed the connection]
pen has joined #ruby
ThaDick has quit [Quit: zzzZZZ ...]
tvw has joined #ruby
asteve has joined #ruby
xiphias has joined #ruby
xiphias has quit [Client Quit]
xiphiasx_ has quit [Quit: leaving]
xiphiasx_ has joined #ruby
vectorshelve has quit [Ping timeout: 245 seconds]
elhu has quit [Quit: Computer has gone to sleep.]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
groupcat is now known as konk
elhu has joined #ruby
Progster has joined #ruby
andrewhl has quit [Ping timeout: 248 seconds]
kirill has quit [Remote host closed the connection]
davidpk has joined #ruby
tommyvyo has joined #ruby
dpk has quit [Disconnected by services]
davidpk is now known as dpk
xiphiasx_ has quit [Client Quit]
Konboi_ has quit [Remote host closed the connection]
xiphiasx_ has joined #ruby
verto is now known as verto|off
verto|off is now known as verto
tobym_ has joined #ruby
paolooo has joined #ruby
tobym_ has quit [Remote host closed the connection]
mxweas has joined #ruby
dhaivatpandya has quit [Quit: dhaivatpandya]
slux has joined #ruby
dhruvasagar has quit [Ping timeout: 245 seconds]
sailias has quit [Quit: Leaving.]
dhruvasagar has joined #ruby
hynkle has joined #ruby
w7tree has quit [Remote host closed the connection]
linoj has joined #ruby
<shevy>
dumdedum
Shrink has quit [Ping timeout: 268 seconds]
carloslopes has joined #ruby
d3vic3 has quit [Quit: leaving]
tiripamwe has joined #ruby
iamjarvo has quit [Quit: Leaving...]
subbyyy has joined #ruby
subbyyy has quit [Max SendQ exceeded]
subbyyy has joined #ruby
bothra has joined #ruby
lynxy has joined #ruby
<dr_bob>
shoobidoo
GoGoGarrett has joined #ruby
d3vic3 has joined #ruby
joshman_ has joined #ruby
arvidkahl has quit [Read error: Connection timed out]
joshman_ has quit [Read error: Connection reset by peer]
joshman_ has joined #ruby
Markvilla has joined #ruby
arvidkahl has joined #ruby
apok has joined #ruby
bglusman has joined #ruby
jammsen has joined #ruby
dekroning has joined #ruby
subbyyy has quit [Quit: Leaving.]
hunglin has joined #ruby
<jammsen>
Hi guys, is there a tool that converts ruby into php? i got a cssmin ruby file that minifies css but i dont understand ruby, its about 30 lines long.
* Muz
coughs.
<dekroning>
is it possible to use the gem cli to install a gem from github url?
dhruvasagar has quit [Ping timeout: 244 seconds]
<hoelzro>
jammsen: is there any particular constructs you don't understand?
sevvie has joined #ruby
<hoelzro>
I'd be happy to help walk you through it
<jammsen>
hoelzro: i think its the constructure, that i dont get
<hoelzro>
a module is kinda like a class, but not really =/
blacktulip has quit [Remote host closed the connection]
<hoelzro>
in this case, it's just a namespace
<jammsen>
52 defines a function, but is it private or static? input is that var where my css code comes?
<Muz>
dekroning: not to my knowledge, but via Bundler, and a valid Gemfile, you can.
<jammsen>
i dont understand line 53
<hoelzro>
jammsen: it's a "static" function
<dekroning>
Muz: ok... actually I don't want to run the bundle command, because my Gemfile requires much more other gem's I don't want to install at this time
<hoelzro>
line 53 just says "if it's a file object, read its contents. otherwise, give me the string form"
tvw has quit [Read error: Connection reset by peer]
blacktulip has joined #ruby
<jammsen>
okay
<jammsen>
but what is css.gsub
<jammsen>
and css.gsub!
<hoelzro>
global substitution
erichmenge has joined #ruby
<jammsen>
what means the ! is it a reversion?
<Muz>
dekroning: that'd also be an option, create a new dir, write your Gemfile there, and do bundle install from there. Assuming you have bundler installing gems into a system-wide place or similar.
<jammsen>
ah i mean negation
<hoelzro>
gsub returns a string with the substitution(s) applied; gsub! means "modify this string in place"
w400z has joined #ruby
jrist-afk is now known as jrist
<jammsen>
is that line for line? or how is it handled?
<hoelzro>
effectively, foo.gsub!(pattern, replacement) is the same as foo = foo.gsub(pattern, replacement)
<hoelzro>
hmm?
* fowl
sees where this line of questioning is going
<jammsen>
hoelzro: what are line 63, 68, 71 and so on these ___SOMETHING___
<jammsen>
constants?
<hoelzro>
they're placeholders
<hoelzro>
it says so in the comments =)
paval has quit [Remote host closed the connection]
Speed has quit [Ping timeout: 252 seconds]
kyktommy_ has quit [Quit: kyktommy_]
cakehero has joined #ruby
enroxorz is now known as not_enroxorz
nari has quit [Ping timeout: 252 seconds]
<jammsen>
for what could these placeholders be used?
s1n4 has joined #ruby
gmci has joined #ruby
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
<fowl>
jammsen: their entire usage is in that file
<hoelzro>
jammsen: it's not Ruby-specific
a_a_g has quit [Quit: Leaving.]
nateberkopec has joined #ruby
<dr_bob>
<hoelzro> effectively, foo.gsub!(pattern, replacement) is the same as foo = foo.gsub(pattern, replacement) : that is not true!
<jammsen>
i will try to convert it, thanks hoelzro and fowl
cantbecool has joined #ruby
yasushi_ has joined #ruby
arvidkahl has quit [Read error: Connection timed out]
u_u has quit [Ping timeout: 276 seconds]
<fowl>
dr_bob: it is, effectively true.
yasushi has quit [Read error: Connection reset by peer]
<dr_bob>
it's more like foo.replace(foo.gsub(pattern, replacement))
<dr_bob>
fowl: you are missing the subtle issue of identity change and side effects because of aliasing
wmoxam_ has joined #ruby
<peterhellberg>
Hmm, I wonder why there isn’t a must_be_true in MiniTest::Expectations…
<hoelzro>
dr_bob: I was just summarizing to help with the understanding =)
<hoelzro>
I know there's a difference
a_a_g has joined #ruby
<peterhellberg>
"must_equal true" is pretty ok I guess
<fowl>
dr_bob: which are effectively the same thing
uris has joined #ruby
<dr_bob>
fowl: identity change can cause side effects by aliasing - it's more like a cause consequence relationship IMO
johnlcox has joined #ruby
arvidkahl has joined #ruby
<dekroning>
Muz: cool thanks
macer1 has quit [Changing host]
macer1 has joined #ruby
uris has quit [Ping timeout: 265 seconds]
lxsameer has joined #ruby
lxsameer has quit [Max SendQ exceeded]
mucker has joined #ruby
lxsameer has joined #ruby
iamjarvo has joined #ruby
dhruvasagar has quit [Ping timeout: 268 seconds]
foolove has joined #ruby
pdtpatrick has joined #ruby
dhruvasagar has joined #ruby
pdtpatrick has quit [Client Quit]
<shevy>
TIME FOR ORGY!!!
u_u has joined #ruby
d3vic3 has quit [Quit: leaving]
uris has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
linoj_ has joined #ruby
yasushi_ has quit [Remote host closed the connection]
peterhellberg has quit [Remote host closed the connection]
yasushi has joined #ruby
asobrasil has joined #ruby
linoj has quit [Ping timeout: 240 seconds]
linoj_ is now known as linoj
mariooo has joined #ruby
vectorshelve has joined #ruby
<vectorshelve>
Hi
<mariooo>
hi there – any slim users around? having trouble figuring out the syntax for compiling/including less in a slim template
havenn has joined #ruby
arvidkahl has quit [Read error: Connection timed out]
awarner has joined #ruby
AxonetBE has quit [Quit: Leaving.]
deryl has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
td123 has joined #ruby
yasushi has quit [Ping timeout: 246 seconds]
<shevy>
vectorshelve more non rails ruby man please
d3vic3 has joined #ruby
<shevy>
no slim users here, people on #ruby are overweight and fat
<vectorshelve>
shevy: please help me with this pure ruby code
<vectorshelve>
please have a look at the updated cide
stopbit has joined #ruby
cmyers has joined #ruby
emmanuelux has joined #ruby
erichmenge has quit [Client Quit]
andrewhl has joined #ruby
<vectorshelve>
shevy: Hanmac hope u guys got the message thanks
<vectorshelve>
my network has some issues.. so
mengu_ has quit [Ping timeout: 244 seconds]
<cmyers>
I'm trying to make a ruby CLI app which works kinda like git (modal, has commands, global options, and command specific options), using optparse. The example/docs don't really cover this. Can anyone point me at a good tutorial or examples of CLIs that use this?
<cmyers>
(or alternative to optparse that is better for this task is welcome too)
kernelPanik has quit [Quit: Leaving]
v0n has quit [Ping timeout: 246 seconds]
zodiak has joined #ruby
Markvilla has joined #ruby
<Muz>
cmyers: got a concrete example of a bit of functionality that you can't get working?
yasushi has joined #ruby
<Muz>
Or are you just generally bemoaning optparse?
<vectorshelve>
Hanmac: oops.. so to increment it each time in the loop ? x_axis++ doesnt work in ruby
arvidkahl has joined #ruby
<workmad3>
cmyers: so you want to do commands like 'git checkout' and 'bundle install'?
grauwoelfchen has joined #ruby
mengu_ has joined #ruby
<mariooo>
vectorshelve: sounds like you're only just learning ruby like myself
<cmyers>
Muz: I am not sure how to best write it to accept `myscript foo --bar a --baz b` and `myscript help foo` and `myscript invalid` prints the help and exits non-zero
<workmad3>
cmyers: I believe Thor is the library that projects like bundler and rails use to do that style of processing
<lectrick>
But hey, you can get and set instance variables on individual fixnums....
vectorshelve has joined #ruby
Markvilla has quit [Ping timeout: 252 seconds]
<lectrick>
But no, you can't .replace one.
w400z has joined #ruby
Abbas5 is now known as Abbas|
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
bbttxu has joined #ruby
yasushi has quit [Read error: Connection reset by peer]
<mariooo>
lectrick: hrm. I get the feeling I still dont have a good grasp of how Fixnum is a class... 1.next blows my mind
<vectorshelve>
Hanmac: shevy workmad3 this network connection sucks.. sorry for not responding it worked thanks.. how can I make this function further simple ? http://pastie.org/4412130
yasushi has joined #ruby
alexwh has quit [Quit: Quitting]
chrisja has joined #ruby
<lectrick>
mariooo: It is pretty cool, actually.
cassianoleal has joined #ruby
alexwh has joined #ruby
<Muz>
mariooo: ah, welcome to Fixnum's immutability due to it being an immediate.
* Muz
digs up his "favourite" explanation of this.
<vectorshelve>
^^^
<cassianoleal>
is there a way to make a class method make use of a subclass constant?
<cassianoleal>
like… I have a base class that has a self.list method
<vectorshelve>
shevy: sorry for the delay shevy :) let me have a look Hanmac thanks :)
kn330 has joined #ruby
<lectrick>
What is the difference between assigning something to @@some_att in an instance method, and assigning something to @some_att in a class method?
<workmad3>
mariooo: that's more of a syntax error :P
<shevy>
hehe
<Hanmac>
shevy you did an error
<vectorshelve>
Hanmac: just to understand what does end.flatten do /
<lectrick>
shevy: Yeah, that makes sense, because you set it at the instance level in the initializer, but you try to access it from the class level in the self.test method, where it's not
<shevy>
Hanmac wat
<Hanmac>
you call instance_variable on 5
<dr_bob>
vectorshelve: there was still an error "cells <<" was too much, now edited
<lectrick>
shevy: I imagine that if you want to set a class instance variable in an initializer, that you have to call out to a self.class.method or something
td123 has quit [Ping timeout: 252 seconds]
cassianoleal has quit [Quit: Leaving.]
<Hanmac>
vectorshelve read the docs
<vectorshelve>
Hanmac: got it.. flattens the resulting array :)
kyktommy_ has quit [Quit: kyktommy_]
<dr_bob>
vectorshelve: fixed
<vectorshelve>
Hanmac: good one.. mate
burgestrand has quit [Quit: Leaving.]
KarlHungus has left #ruby [#ruby]
<vectorshelve>
Hanmac: got it got it.. sometimes I am a lil like a tubelight,, :) takes time to click
alexwh has joined #ruby
daniel_hinojosa has joined #ruby
<shevy>
yeah but
emmanuelux has quit [Ping timeout: 246 seconds]
<shevy>
vectorshelve the more you write, the easier it will be eventually
erichmenge has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
<shevy>
at least many of the simple erorros, like when you first started Cell.new with 3 arguments when it could only accept 2
<hoelzro>
because they're both referring to an instance variable on the class object
<lectrick>
shevy: Because classes are objects and objects can hold instance variables
<lectrick>
shevy: The "def initialize" is an instance method, even if it sort of proxies to the "new" class method (this part I'm still shaky on FYI)
<shevy>
ohhh
<lectrick>
Actually it's the "new" class method that proxies to the "initialize" instance method on the new object, no?
<shevy>
that makes sense
<shevy>
classes are objects
<shevy>
:)
Markvilla has joined #ruby
bbttxu has quit [Quit: bbttxu]
<shevy>
still confuses me a bit though
<hoelzro>
lectrick: new is a method that just allocates, initializes, and returns
<lectrick>
Can you override the "new" class method?
tjbarber has joined #ruby
<hoelzro>
yes.
<otters>
sure
<otters>
just don't
<hoelzro>
=)
<shevy>
otters! cuddly otters!
<otters>
shevy!
<dr_bob>
lectrick: yes, new is invoked, internally you can imagine it invoking allocate and then initialize on the instance returned by allocate
<lectrick>
Do you have to manually call "initialize" on your new instance though? :)
<otters>
shevrolay
<shevy>
I should have picked the nick otters, it's really great
<otters>
lectrick: no, you just use new
<Hanmac>
lectrick you could override the :new method but you shoundnt
<lectrick>
otters: I know you're not supposed to. But Ruby is about trying what you're not supposed to because it probably does work on some level :)
<tjbarber>
Hi all, I have a question: Sometimes gems comes with a small app that is run at the console to create a directory structure that you can work off of. For example, Compass allows you to run a command at the terminal and it makes some directories with basic files that you can then work off of. How is something like this made?
<otters>
oh, wow, it's less low-level than I thought
<Hanmac>
initialize is one of the 13 secret hook methods :P
<otters>
yeah, you can just do h = SomeClass.allocate; h = h.__send__ :initialize, *args, &blk
<workmad3>
otters: doesn't .new just call .allocate and .initialize?
<Muz>
Specifically, note the "bin" folder, and the file in thre. That's the executable that gets copied to somewhere in your $PATH when the gem is installed.
<tjbarber>
Muz, lol! Thanks! =P
<lectrick>
OK don't do this: class Class; def new; puts "HAHA NO NEW FOR YOU"; end; end
w400z has quit [Quit: Computer has gone to sleep.]
<workmad3>
otters: it's a good job that the actual methods aren't localised then :P
<tjbarber>
Ok, good deal. I'll take a look at that.
qwerxy has quit [Quit: offski]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<workmad3>
otters: on top of which, they're all pretty self-explanatory with their names ;)
<lectrick>
Ich sprech Deutsch. Actually, I have a question... since most computer languages are in English, are there syntax translations for other languages, or does everyone just accept that all computer languages are English?
aganov has quit [Quit: aganov]
<lectrick>
Like, there could be a Ruby library that aliases all English-language methods to German language equivalents, no?
<hoelzro>
lectrick: sure, but it could get painful =)
<hoelzro>
and it's not useful
<workmad3>
however, with new being just 'def self.new(*args, &blk); allocate; initialize(*args, &blk) if defined?(initialize); end;' I'd be tempted to declassify initialize away from being a hook method :)
<lectrick>
crap i can't even def a method with an ümlaut in it boooo
<tjbarber>
Muz, ok. What would you recommend to learn more about Gems and specifically how to make them? Sorry for the noob questions.
<hoelzro>
lectrick: you can in Perl =)
<workmad3>
although I guess the others probably also have similar, simple-ruby implementations
<mariooo>
speaking of ümlauts
<mariooo>
I'm getting the following
<workmad3>
lectrick: did you set your source encoding?
<hoelzro>
s/ü/u/g
<mariooo>
invalid byte sequence in US-ASCII -> caused by line.match("✓")
lxsameer has quit [Ping timeout: 246 seconds]
<Hanmac>
lectrick i think thats better ... i have a cousin that uses c macros to use german inside of c ... so you could do: wenn(){ } mache{ }bis()
<lectrick>
workmad3: I was working in IRB. Maybe that's why.
<mariooo>
what to do?
<lectrick>
hoelzro: maybe add a 'u' switch to the end of the regex?
<hoelzro>
mariooo: you probably have to tell the string that it's whatever encoding that it is
<lectrick>
The character encoding of my Terminal.app is UTF8, workmad3
chussenot_ has joined #ruby
<tjbarber>
Ok, thanks a lot Muz. You've been a huge help. I know the basics of the Ruby language but I'm ready to start working on something everyone can use. Thanks. =)
<lectrick>
workmad3: awww man how do I get my IRB to let me type umlauts then? Weird
<hoelzro>
cmyers: 1.9 is supposed to be a lot better about handling Unicode
<workmad3>
lectrick: dunno... it's just always worked for me
mengu_ has quit [Read error: No route to host]
mengu__ has joined #ruby
<lectrick>
fuck i have option key set to meta key in terminal... fail
<Hanmac>
lectrick did you tell irb that you want umlauts?: Encoding.default_internal="UTF-8"
axl__ has joined #ruby
<lectrick>
Hanmac: That's a good tip but I think the real problem is I had "Use option key as meta key" checked
kyktommy has joined #ruby
chussenot has quit [Ping timeout: 246 seconds]
chussenot_ is now known as chussenot
dhruvasagar has quit [Ping timeout: 265 seconds]
v0n has quit [Ping timeout: 246 seconds]
axl_ has quit [Ping timeout: 240 seconds]
axl__ is now known as axl_
lxsameer has joined #ruby
<peterhellberg>
Ruby does indeed support umlauts in method names. You’ll want to add # encoding: utf-8 to the top of you file though.
w400z has joined #ruby
senny has joined #ruby
<lectrick>
good to know.
etisfo has joined #ruby
<dr_bob>
peterhellberg: not everything which can be done, should be done though. :-)
<etisfo>
How can I edit html source of a ruby app?
daniel_hinojosa has quit [Ping timeout: 245 seconds]
Bofu2U has joined #ruby
<Muz>
etisfo: /which/ ruby app?
<peterhellberg>
dr_bob: Very true, but quite handy for us living in countries with umlauts in our alphabet…
<Muz>
Or do you mean a rails app?
lxsameer has quit [Ping timeout: 246 seconds]
<etisfo>
Muz, gitlabhq
<Hanmac>
ß
<Muz>
Ah, a Rails app. Try asking in #rubyonrails as they'll be more useful.
<Muz>
etisfo: ^
<etisfo>
Thanks :)
a_a_g has joined #ruby
velikasha has left #ruby [#ruby]
<dr_bob>
peterhellberg: yes, umlaut country here as well - but I prefer to stick to English terms in source code
<mariooo>
hoelzro: how might one tell ruby what encoding to use...? I've tried setting Encoding.default_external/internal = Encoding::UTF_8 both in my main .rb and environment.rb (though that seems to be a rails thing, and i"m not using rails..)
paradoja has joined #ruby
alexwh has quit [Ping timeout: 252 seconds]
<hoelzro>
mariooo: I think you need to create a special comment for it
<hoelzro>
plus some other things, maybe
kyktommy has quit [Quit: kyktommy]
<hoelzro>
I'm not 100% certain
<Muz>
#encoding: utf-8
<peterhellberg>
dr_bob: Absolutely, but some companies requires the use of other languages than English…
<dr_bob>
really?
<dr_bob>
amazing
<peterhellberg>
dr_bob: Yes
jillsmitt_ is now known as jillsmitt
elhu has quit [Quit: Computer has gone to sleep.]
<hoelzro>
dr_bob: I think the useful aspect about source encoding is string literals
freeayu has quit [Quit: 离开]
lxsameer has joined #ruby
<dr_bob>
right
elhu has joined #ruby
justsee has quit [Quit: Leaving...]
<Hanmac>
i might be an german, but prefer my methods in english
y2k has joined #ruby
gen0cide_ has joined #ruby
elhu has quit [Client Quit]
uxp_ is now known as uxp
<Mon_Ouie>
How does Ruby deal with non-ascii compatible source encoding actually?
td123 has quit [Ping timeout: 252 seconds]
<Mon_Ouie>
I mean, how could it read the encoding magic comment in that case?
<hoelzro>
Mon_Ouie: good question...I'm guessing it tries to guess from the BOM or something
<peterhellberg>
I’m with Hanmac on this one… code written in Swedish would be horrible…
* dr_bob
is with peterhellberg and Hanmac - although a bit more with Hanmac ;-)
a_a_g has quit [Quit: Leaving.]
rutkla has quit [Ping timeout: 246 seconds]
u_u has quit [Ping timeout: 240 seconds]
Markvilla has quit [Read error: No route to host]
<Hanmac>
pererhellberg and the comments are in swedish too? :'P
whitewhine has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
whitewhine has quit [Remote host closed the connection]
Markvilla has joined #ruby
mahmoudimus has joined #ruby
davidcelis has quit [Quit: K-Lined.]
<peterhellberg>
Hanmac: I’ve heard it suggested that all comments should be in the company business language, yes.
nXqd has quit [Ping timeout: 268 seconds]
<peterhellberg>
Btw, trying to write a class name with umlauts will raise SyntaxError: class/module name must be CONSTANT
gen0cide_ has quit [Quit: Computer has gone to sleep.]
ananthakumaran has joined #ruby
<workmad3>
peterhellberg: is that 'business language' as in swedish, english, etc. or 'business language' as in the domain language of the business area?
<workmad3>
peterhellberg: also, I have no problems with a 'class Uümlaut; end;'
<Hanmac>
i was in sweden when i was young ... do you still have the high snow walls or are they gone?
jasmina87SA__ has quit [Quit: Leaving]
<kalleth>
'business language' as in "we will increase your ROI by introducing synergistic management processes and leveraging advanced user-centric approaches to TQM"
<workmad3>
peterhellberg: fair enough :) I can agree with both sides
alexwh has joined #ruby
<dr_bob>
Hanmac: I suspect currently there's not much snow. :-)
* kalleth
places revolver in mouth
ly_gs has quit [Remote host closed the connection]
* kalleth
pulls strigger
baroquebobcat has joined #ruby
<workmad3>
kalleth: don't forget about matrix management!
<dr_bob>
Aaaaah!
v0n has joined #ruby
<kalleth>
too late, i've already committed suicide
a_a_g has joined #ruby
<workmad3>
kalleth: and cross-organisational synergistic matrix managed committees!
<workmad3>
(I'm just making crap up now btw :) )
BrokenCog has joined #ruby
<peterhellberg>
workmad3: But that does _rarely_ work out because most programming languages doesn’t have built in support for expressing everything in other languages than English
pu22l3r has quit [Remote host closed the connection]
brdude has joined #ruby
shevy has quit [Ping timeout: 252 seconds]
SQLStud has joined #ruby
Speed has quit [Ping timeout: 252 seconds]
gmci has joined #ruby
qwerxy has joined #ruby
Abbas5 is now known as Abbas|
cantonic_ has joined #ruby
anoldhacker has joined #ruby
hadees has quit [Quit: hadees]
cantonic has quit [Ping timeout: 246 seconds]
cantonic_ is now known as cantonic
mxweas has quit [Quit: Computer has gone to sleep.]
<anoldhacker>
I'm having trouble with ruby-prof and rails 3.2.1. I see that the latest version of ruby-prof requires a more recent version of rails, but I haven't found a map of which versions of ruby-prof work with which versions of rails. Help?
JustinCampbell has joined #ruby
jgrevich_ has joined #ruby
<Muz>
anoldhacker: #rubyonrails is full of people who'll know more.
<anoldhacker>
k
cgag has joined #ruby
<Muz>
A number of us here are Ruby 'purists' and don't touch Rails. :)
<zii>
That's a bit silly though.
havenn has quit [Remote host closed the connection]
jgrevich has quit [Ping timeout: 246 seconds]
jgrevich_ is now known as jgrevich
Konboi has quit [Remote host closed the connection]
<zii>
The "purists" part.
<cgag>
anyone know how I would go about disabling type tags when using YAML.dump?
<zii>
That's just douchebaggery.
yasushi has joined #ruby
<JustinCampbell>
lol
<Muz>
zii: I used quote marks because it's self recognised douchebaggery.
<zii>
Cool. :]
havenn has joined #ruby
eldariof has quit [Ping timeout: 276 seconds]
<Muz>
Then again, it may just be a case of having had never gotten round to needing to use or look at Rails.
<Muz>
As opposed to active dejection of it.
Abbas| has quit [Ping timeout: 256 seconds]
ipoval has joined #ruby
ipoval has quit [Client Quit]
tiripamwe has quit [Ping timeout: 244 seconds]
shevy has joined #ruby
ipoval has joined #ruby
<cmyers>
if you ask someone how to do something in python, they won't give you a class which is only found in django. I think that's the thing. ruby + rails is almost an entirely separate language from just ruby, and many people never learn how to do things without rails.
<cmyers>
that is why some people look down on it
<Muz>
I wouldn't say I look down it so much as I recognise the distinction between the two.
<Muz>
Writing Ruby can, and often is, a different beast from writing RoR.
<xclite>
Yep. I don't hate rails, I just don't know it
<cmyers>
right - the non-douchy way to say it =)
brdude has quit [Quit: brdude]
hoelzro is now known as hoelzro|away
xorigin has quit [Quit: leaving]
macer1 has quit [Ping timeout: 265 seconds]
benson has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
havenn has quit [Ping timeout: 246 seconds]
Markvilla has joined #ruby
cousine has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
ipoval has quit [Quit: ipoval]
Markvilla has joined #ruby
niklasb has joined #ruby
cassianoleal1 has joined #ruby
cassianoleal has quit [Ping timeout: 252 seconds]
apeiros_ has joined #ruby
<anoldhacker>
What's obnoxious is that some of the majors in Rails don't know & don't care about solving anyone else's problems. So they create "fixes" which don't play well with others in the core of ruby & become the instant majority.
<anoldhacker>
Like Concerns.
<Muz>
It's just a bit too much of an incestuous circlejerk at times.
<Muz>
Now, that was a bit of douchebaggery. ;)
hadees has joined #ruby
apok has quit [Quit: apok]
<shevy>
what is Concerns anoldhacker
<workmad3>
shevy: it's a module that you can include in another module and automagically get the 'inclusion' of a ClassMethods module when you include a module...
rouss has joined #ruby
nari has quit [Ping timeout: 246 seconds]
davidcelis has joined #ruby
<anoldhacker>
Except that if you include a module that isn't a concern, ugly things can start to happen.
grillo has quit [Ping timeout: 245 seconds]
<anoldhacker>
What they were really trying to do was implement multiple inheritance.
<shevy>
wait what
<shevy>
is that like working around subclassing on a class method level?
<anoldhacker>
Which isn't really all that hard to do, just ugly. Except they didn't.
xaq has quit [Read error: Connection reset by peer]
<shevy>
ah yes
<shevy>
multiple inheritance
<shevy>
seems matz needs to address that one day :P
rouss has quit [Client Quit]
liluo has quit [Remote host closed the connection]
savage- has joined #ruby
xaq has joined #ruby
rouss has joined #ruby
Markvilla has quit [Ping timeout: 252 seconds]
workmad3_ has joined #ruby
chussenot has quit [Quit: chussenot]
Markvilla has joined #ruby
grillo has joined #ruby
wallerdev has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
_jorge has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
theRoUS has quit [Remote host closed the connection]
Markvilla has joined #ruby
Abbas5 has joined #ruby
Abbas5 is now known as Abbas-
Abbas- has quit [Changing host]
Abbas- has joined #ruby
Abbas- is now known as Abbas5
carloslopes has joined #ruby
<anoldhacker>
I may actually go ahead & drive my solution out the door shortly. Like I said, it's not really that hard.
pen has quit [Remote host closed the connection]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
maletor has joined #ruby
TPFC-SYSTEM has joined #ruby
kyktommy has joined #ruby
adeponte has joined #ruby
kyktommy_ has joined #ruby
Markvilla has quit [Read error: No route to host]
Wizek_ has joined #ruby
Markvilla has joined #ruby
ipoval has joined #ruby
eos_1249 has joined #ruby
Wizek has quit [Ping timeout: 246 seconds]
eos_1249 has left #ruby [#ruby]
eos_1249 has joined #ruby
kyktommy has quit [Ping timeout: 252 seconds]
r0bby has joined #ruby
br4ndon has quit [Ping timeout: 240 seconds]
Markvilla has quit [Read error: Connection reset by peer]
Abbas5 is now known as Abbas|
Wizek_ has quit [Ping timeout: 246 seconds]
Markvilla has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
jonahR has joined #ruby
Markvilla has joined #ruby
robbyoconnor has quit [Ping timeout: 244 seconds]
havenn has joined #ruby
randomautomator has joined #ruby
Markvilla1 has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
Markvilla1 has quit [Read error: Connection reset by peer]
kyktommy has joined #ruby
bglusman has quit [Remote host closed the connection]
Markvilla has joined #ruby
br4ndon has joined #ruby
ianbrandt has joined #ruby
quest88 has quit [Quit: quest88]
bradhe has joined #ruby
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
kyktommy_ has quit [Ping timeout: 252 seconds]
Markvilla1 has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
Speed has quit [Ping timeout: 252 seconds]
eos_1249 has left #ruby [#ruby]
eos_1249 has joined #ruby
Markvilla has joined #ruby
enroxorz has quit [Quit: Leaving]
w400z has quit [Quit: Computer has gone to sleep.]
<shevy>
hmmm
<shevy>
<b>Foo</b>
havenn has quit [Ping timeout: 246 seconds]
<shevy>
any ideas for a shorter way, in a text paragraph?
rutkla has joined #ruby
anoldhacker has left #ruby ["No matter how dark the night, somehow the Sun rises once again"]
rodasc has joined #ruby
akl has left #ruby [#ruby]
enroxorz has joined #ruby
blazes816 has joined #ruby
yxhvuud has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
Markvilla1 has quit [Ping timeout: 246 seconds]
yasushi has quit [Ping timeout: 244 seconds]
lsone_ has joined #ruby
jgrevich_ has joined #ruby
ianbrandt has quit [*.net *.split]
jgrevich has quit [*.net *.split]
beneggett has quit [*.net *.split]
yxhuvud has quit [*.net *.split]
lsone has quit [*.net *.split]
andrewhl has quit [*.net *.split]
sspiff has quit [*.net *.split]
mfridh has quit [*.net *.split]
mtkd has quit [*.net *.split]
dv_ has quit [*.net *.split]
rakm has quit [*.net *.split]
bigkevmcd has quit [*.net *.split]
g4 has quit [*.net *.split]
r126l has quit [*.net *.split]
eregon_ has quit [*.net *.split]
kalleth has quit [*.net *.split]
Sou|cutter has quit [*.net *.split]
mikalv has quit [*.net *.split]
Kwpolska has quit [*.net *.split]
mksm has quit [*.net *.split]
TheMoonMaster has quit [*.net *.split]
crodas has quit [*.net *.split]
any-key has quit [*.net *.split]
jmcphers has quit [*.net *.split]
Gm4n has quit [*.net *.split]
Cork has quit [*.net *.split]
musl has quit [*.net *.split]
nahhh has quit [*.net *.split]
lsone_ is now known as lsone
deryl has quit [Quit: Back when the move is done and I got internet again]
jgrevich_ is now known as jgrevich
kalleth has joined #ruby
_jorge has quit [Remote host closed the connection]
jmcphers has joined #ruby
eos_1249 has left #ruby [#ruby]
dhruvasagar has joined #ruby
wargasm has joined #ruby
mfridh_ has joined #ruby
ianbrandt has joined #ruby
beneggett has joined #ruby
16WAA1KF9 has joined #ruby
mfridh has joined #ruby
sspiff has joined #ruby
yxhuvud has joined #ruby
mtkd has joined #ruby
andrewhl has joined #ruby
dv_ has joined #ruby
rakm has joined #ruby
bigkevmcd has joined #ruby
r126l has joined #ruby
eregon_ has joined #ruby
g4 has joined #ruby
Sou|cutter has joined #ruby
mikalv has joined #ruby
mksm has joined #ruby
TheMoonMaster has joined #ruby
any-key has joined #ruby
Cork has joined #ruby
Gm4n has joined #ruby
musl has joined #ruby
nahhh has joined #ruby
yxhuvud has quit [Ping timeout: 255 seconds]
Sou|cutter has quit [Ping timeout: 255 seconds]
aezop has quit [Excess Flood]
mfridh has quit [Read error: Operation timed out]
16WAA1KF9 has quit [Read error: Operation timed out]
Sou|cutter has joined #ruby
a_a_g has joined #ruby
Kwpolska has joined #ruby
r126l has quit [Remote host closed the connection]
r126l has joined #ruby
baroquebobcat has quit [Ping timeout: 252 seconds]
cousine has quit [Remote host closed the connection]
Vert has quit [Remote host closed the connection]
aezop has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
paolooo has quit [Ping timeout: 245 seconds]
s1n4 has quit [Quit: peace fuckin out]
lsone has left #ruby [#ruby]
a_a_g1 has joined #ruby
DrShoggoth has joined #ruby
codeFiend has joined #ruby
blast_hardcheese has quit [Excess Flood]
<lurch_>
is there a way to take a hash and turn it into local variables with name = key in hash and value = value in hash? What i'm trying to do is get some parameters into ERB by using the ERB.new(io.read).result(binding) call. The template holds some variable names which i would like to get from the hash
a_a_g has quit [Ping timeout: 252 seconds]
jrajav has joined #ruby
khakimov has joined #ruby
jonahR has quit [Quit: jonahR]
<Spooner>
lurch_ hash.each_pair {|k, v| instance_variable_set :"@#{k}", v } # No idea how that fits into ERB though.
artOfWar has joined #ruby
jonahR has joined #ruby
Speed has quit [Ping timeout: 252 seconds]
mrsolo has joined #ruby
any-key_ has joined #ruby
mikalv_ has joined #ruby
<lurch_>
thanks Spooner, trying now
wargasm1 has joined #ruby
apeschel has joined #ruby
wargasm has quit [*.net *.split]
mfridh_ has quit [*.net *.split]
ianbrandt has quit [*.net *.split]
beneggett has quit [*.net *.split]
andrewhl has quit [*.net *.split]
sspiff has quit [*.net *.split]
mtkd has quit [*.net *.split]
dv_ has quit [*.net *.split]
bigkevmcd has quit [*.net *.split]
rakm has quit [*.net *.split]
g4 has quit [*.net *.split]
eregon_ has quit [*.net *.split]
mikalv has quit [*.net *.split]
mksm has quit [*.net *.split]
TheMoonMaster has quit [*.net *.split]
any-key has quit [*.net *.split]
Gm4n has quit [*.net *.split]
Cork has quit [*.net *.split]
musl has quit [*.net *.split]
nahhh has quit [*.net *.split]
wargasm has joined #ruby
ianbrandt has joined #ruby
mfridh_ has joined #ruby
dv_ has joined #ruby
andrewhl has joined #ruby
rakm has joined #ruby
sspiff has joined #ruby
bigkevmcd has joined #ruby
g4 has joined #ruby
mksm has joined #ruby
TheMoonMaster has joined #ruby
Gm4n has joined #ruby
Cork has joined #ruby
musl has joined #ruby
nahhh has joined #ruby
mfridh has joined #ruby
mfridh_ has quit [Read error: Operation timed out]
katherinem13 has quit [Remote host closed the connection]
beneggett has joined #ruby
a_a_g1 has quit [Ping timeout: 252 seconds]
musl has quit [Max SendQ exceeded]
dv_ has quit [Max SendQ exceeded]
andrewhl has quit [Max SendQ exceeded]
rakm has quit [Max SendQ exceeded]
mtkd_ has joined #ruby
katherinem13 has joined #ruby
eregon has joined #ruby
wargasm has quit [Ping timeout: 255 seconds]
blast_hardcheese has joined #ruby
andrewhl has joined #ruby
shadoi has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
<lurch_>
Spooner: problem is that that adds instance variables (i.e. starting with @), not local ones. The ERB templates are not managed by me and they just expect some variables to be set (without the @). I'm trying to write some generic code that can be used to generate data from those templates. What i have so far is: http://pastebin.com/VVynpsxA
thomas is now known as website
<lurch_>
but that results in: NameError: undefined local variable or method `var_1' for
bier has quit [Ping timeout: 245 seconds]
Eldariof-ru has joined #ruby
<Spooner>
Oh, right, sorry. I use ivars (in nanoc with haml or slim), so I assumed that is what you actually meant.
ephemerian has quit [Quit: Leaving.]
bier has joined #ruby
<Spooner>
@params.merge!({key => value}) is just the same as the clearer @params[key] = value
<Spooner>
Harzilein : That is not an issue, but user error. rb_intern gives you the ID of a string, which will not find a has key hash that is either a String or a Symbol.
<jonahR>
ohh Uitls
<jonahR>
now i see it haha
baroquebobcat has joined #ruby
bricker88 has joined #ruby
bricker88 has quit [Client Quit]
brianpWins has quit [Quit: brianpWins]
pdtpatrick_ has joined #ruby
bricker88 has joined #ruby
stkowski has joined #ruby
adamkittelson has joined #ruby
brdude has joined #ruby
apok_ has joined #ruby
hadees has quit [Ping timeout: 246 seconds]
<Harzilein>
Spooner: the question is if in the meantime the api for rb_hash_aref has changed. because i found this and it actually segfaults: ... oh
bricker881 has joined #ruby
<Harzilein>
just checked on rugged's github, they seem to have fixed it in master
<Spooner>
Harzilein: No, the answers in that are correct in that thread.
pdtpatrick_ has quit [Client Quit]
<Spooner>
The questioner is wrong.
apok has quit [Ping timeout: 246 seconds]
apok_ is now known as apok
<Spooner>
Harzilein : Sorry, I don't understand what there was to fix.
<asteve>
maletor: you're interpreting the actual encoding incorrectly
<asteve>
look at ISO-8859-1
<maletor>
davidcelis: because I am upgrading from 1.8.7?
<davidcelis>
Why not upgrade to 1.9.3? 1.9.2 has problems for Rails apps
kenichi has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
kidoz has joined #ruby
hukl has joined #ruby
erichmenge has quit [Quit: Be back later]
cdepue has joined #ruby
<maletor>
i haven't heard of 1.9.2 having problems for rails apps per se. and the reason is because we are moving from 60,000 LOC. one step at a time makes the most sense, right?
kidoz has quit [Client Quit]
<davidcelis>
1.9.3 was a minor upgrade to 1.9.2
sailias has quit [Quit: Leaving.]
<davidcelis>
But there was a bug with `require` in 1.9.2 that, when requiring lots of files, would cause a lot of slowdown in booting an app
tndrbt has joined #ruby
cakehero has joined #ruby
<davidcelis>
As you can imagine, that causes problems for Rails
<apeiros_>
davidcelis: not a bug
jrajav has quit [Quit: The best darkness is strange and surprising]
<apeiros_>
just inefficient design
<davidcelis>
potato potato
sendoushi has quit [Remote host closed the connection]
<maletor>
do you think 90+ production level gems we use will all support 1.9.3
<maletor>
if they support 1.9.2?
<apeiros_>
in all likeliness
<apeiros_>
it's rather the other way round
<Spooner>
maletor : 1.9.3 is just 1.9.2.1. It is nothing at all like the difference between 1.8.7 and 1.9.2
<apeiros_>
1.9.3 introduced features/changes that haven't been there in 1.9.2
<maletor>
that's great news. so perhaps we will jump straight to 1.9.3.
<apeiros_>
i.e. I'm not aware of a backwards-incompatibility of 1.9.3 with 1.9.2
<maletor>
regardless, i doubt the issue presented disappears with 1.9.3
<apeiros_>
but there are upwards-incompatibilities (forwards?) of 1.9.2 with 1.9.3
<maletor>
i see ISO-8859-1 but not sure how to use that to fix my issue
<jonahR>
asteve: what about this: "<loc>1</loc>".gsub(/<.*?>/, "")
<maletor>
asteve: what does it mean i am interpreting the actual encoding incorrectly
tndrbt has quit [Quit: tndrbt]
tndrbt has joined #ruby
<asteve>
maletor: you're trying to force something into UTF-8 that's not in the current encoding that it's assuming; most likely you're trying to force an ascii-8bit into utf-8; the true encoding for the ascii-8bit is "ISO-8859-1"
<asteve>
jonahR: thanks, I was really looking for something along the lines of "don't do that, that's stupid! instead use nokogiri node.text" :)
<asteve>
which I got
<Majost>
I am trying to ensure specific options are specified, but I am not sure how to change the select to have proper scope
shadoi has joined #ruby
<jonahR>
yeah, np!
r0bby is now known as robbyoconnor
dankest has quit [Quit: Leaving...]
geekbri has quit [Remote host closed the connection]
u_u has quit [Read error: Operation timed out]
<Majost>
I updated the pastie link so the error on it references the correct line number in the pastie itself.
brianpWins has joined #ruby
sevvie has quit [Quit: sevvie]
<maletor>
asteve: so the solution is to do what? grep for non ascii?
website is now known as thomas
<asteve>
maletor: i'm not sure what you're doing; pastebin of the actual code or a description of the process?
Sou|cutter has quit [Changing host]
Sou|cutter has joined #ruby
poga has joined #ruby
erichmenge has joined #ruby
xaq has joined #ruby
JustinCampbell has quit [Remote host closed the connection]
<apeiros_>
maletor: you want to convert text from iso-8859-1 to utf-8?
<maletor>
asteve: what i'm doing is compiling javascript and css through this gem called jammit
vectorshelve has joined #ruby
<maletor>
it uses ruby_racer to do so
<maletor>
well uglifier uses ruby_racer
ly_gs_ has joined #ruby
Abbas5 has joined #ruby
Abbas5 is now known as Abbas-
Abbas- has quit [Changing host]
Abbas- has joined #ruby
Abbas- is now known as Abbas5
<maletor>
@apeiros_: i think so. is there a perl command that can do that for my whole project because the ones i have found online have yet to work.
<asteve>
wat
vipaca has joined #ruby
aetaric has quit [Ping timeout: 260 seconds]
brdude has joined #ruby
ly_gs has quit [Ping timeout: 256 seconds]
<maletor>
uglifer is a javascript compressor. removes comments from js files etc. just so happens to run in ruby and that's where the error is bubbling up in the gist
u_u has joined #ruby
<apeiros_>
maletor: in ruby, that'd be File.read(somedata, encoding: 'iso-8859-1').encode('utf-8')
br4ndon has quit [Ping timeout: 244 seconds]
Kwpolska has quit [Ping timeout: 244 seconds]
<apeiros_>
also note that people often confuse iso-8859-1 with windows-1252 (the latter is a superset of the former)
cbuxton has joined #ruby
TheNumb has quit [Ping timeout: 240 seconds]
sirecote has quit [Ping timeout: 244 seconds]
jbpros has quit [Ping timeout: 248 seconds]
matti has quit [Ping timeout: 240 seconds]
vectorshelve has quit [Ping timeout: 245 seconds]
rutkla has joined #ruby
KindOne has quit [Ping timeout: 245 seconds]
JodaZ_ has joined #ruby
mtfk has quit [Ping timeout: 248 seconds]
preller has quit [Ping timeout: 244 seconds]
mucker_ has joined #ruby
Kwpolska has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
Abbas5 has quit [Ping timeout: 248 seconds]
Jb_ has quit [Ping timeout: 252 seconds]
\n has quit [Ping timeout: 245 seconds]
JodaZ has quit [Ping timeout: 245 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
ly_gs_ has quit [Remote host closed the connection]
mucker has quit [Ping timeout: 256 seconds]
ly_gs has joined #ruby
jbpros has joined #ruby
<maletor>
it doesn't make sense to write that in the gem; it's not the gems fault
nricciar has quit [Ping timeout: 272 seconds]
darkc0met has quit [Ping timeout: 245 seconds]
<maletor>
i probably have to find the iso-8859 withiin my javascripts and remove it.
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
tnk1 has quit [Read error: Connection reset by peer]
vectorshelve was kicked from #ruby by apeiros_ [stop that. seriously.]
vectorshelve has joined #ruby
Azure|dc has joined #ruby
<vectorshelve>
I am sorry apeiros_
nyuszika7h has joined #ruby
<apeiros_>
no you're not. you know it. I know it.
MindBomb has quit [Remote host closed the connection]
<apeiros_>
but you will stop that.
<vectorshelve>
apeiros_: I mean I am sorry for the mistake. I was a lil frustrated since I was not able to sort the code for that query. I am really sorry wont repeat it
<vectorshelve>
could you help me that query.. I am getting confused on working the code out for that scenario. I have pasted wt I have.. it will be very helpful if you could guide me through
<apeiros_>
no, I certainly wouldn't have the patience.
tnk1 has joined #ruby
Azure|dc has quit [Client Quit]
_jorge_ has joined #ruby
atmosx has joined #ruby
<atmosx>
hello
<shevy>
vectorshelve you should do two things - (a) solve the problem with the simplest possible ruby code first, without using any classes at all, then (b) turn it into a class
<vectorshelve>
apeiros_: patience for what ? I would cooperate with u 100%
<atmosx>
any1 alive? I wanna put together an exception handling with 2 rescues… but I'm kinda confused on how to proceed
BrokenCo1 has joined #ruby
<shevy>
as it is right now it's just confused. you need to get clarity in thoughts first vectorshelve
<vectorshelve>
shevy: I understand I have a created a method for this..I have pasted only the code inside the method.
<TorpedoSkyline>
apeiros_, is there a suggested one or is it entirely up to the user?
<apeiros_>
TorpedoSkyline: but yes, JSON, YAML and XML are all often used in ruby.
<TorpedoSkyline>
ok thanks apeiros_
w0lverine has joined #ruby
<Muz>
vectorshelve: we're not here to do your actual work for you. If you don't understand something, show some initiative and try searching about and solving it yourself. You have an internet connection and a web browser.
<Muz>
TorpedoSkyline: it's entire;y up to the user, but some things are better suited to some data formats than others.
* apeiros_
ponders just banning vectorshelve
<vectorshelve>
Muz: I have already pasted the code mate http://pastie.org/4413304 line 42 has my method
<apeiros_>
he's had enough warning already.
sbbsbb has quit [Remote host closed the connection]
<TorpedoSkyline>
ok. I need to read up on these.
jillsmitt has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
<Muz>
vectorshelve: you've failed to quantify what you're trying to do clearly, you're just presenting broken code and expecting it to be fixed, and have been doing so ad nauseum. I haven't the patience to bother helping you. It wouldn't be satisfying as you'd just come crawling back asking more questions having had never learnt.
darren_ has quit [Remote host closed the connection]
jillsmitt has joined #ruby
rakm has joined #ruby
<Hanmac>
vectorshelve: 1) we dont know about the Grid class ... and as far as i can thought it may miss information about the size
<vectorshelve>
Muz: I will explain. In line 42 I print out x and - based on the state of the cells. What I want to do along with it is that while printing, first print out all the cells whose y is 0 and x varies from 0 to limit and then a line break then again print cells from y=1 and x=0 to its limit
<shevy>
vectorshelve wat
virunga_ has joined #ruby
virunga has joined #ruby
virunga__ has joined #ruby
virunga_ has quit [Read error: Connection reset by peer]
<vectorshelve>
Hanmac: http://pastie.org/4413403 here is my grid class its height is the max value of y and breadth is max value of x
<vectorshelve>
shevy: I am looking to display the cells that way in rows and columns based on its x and y values :)
pencilcheck has joined #ruby
pen has quit [Disconnected by services]
<shevy>
see, I still have no real idea what you need, but this sounds as if you either need an Array or a Hash
<shevy>
row______________
<shevy>
column|
pencilcheck is now known as pen
qwerxy has joined #ruby
<shevy>
and this is like an Array of Arrays. Or a Hash
qwerxy has quit [Client Quit]
aeontech has joined #ruby
<Hanmac>
File.foreach(input_pattern).inject(0) {|c, line| c+1} #come on? you use .inject where .size could be better? ... and why not .inject(:+) ?
<shevy>
vectorshelve knows only partial ruby ;)
<shevy>
though I find .inject(0) quite ugly
<vectorshelve>
Hanmac: u r ryt.. I thought I would improve the code once I am able to make it run completely.. looking at one thing at a time.. I hope u got the point where I had my doubt.. I am trying to display first all cells with y value 0 and x from 0 to breadth and then increment y and do the same until y reaches height
ken_barber has quit [Remote host closed the connection]
codeFiend has quit [Ping timeout: 246 seconds]
aeontech is now known as codeFiend
Spooner has quit [Read error: Connection timed out]
elhu has joined #ruby
<vectorshelve>
Hanmac: assuming you could relate to the code better since u had helped me with a method related to this few hours back.. that was excellent snippet of code to replace that lengthy lines of mine :)
<Hanmac>
shevy.inject(1,:*) there is the 1 important
ananthakumaran has quit [Ping timeout: 265 seconds]
kirun has joined #ruby
alexwh has quit [Ping timeout: 252 seconds]
<maletor>
asteve: here it is: Inspied by the Autocomplete plugin by: Jrn Zaefferer
<maletor>
davidcelis:
Coad has joined #ruby
<maletor>
that guys stupid name cost me an hour
<asteve>
wat?
<asteve>
hah
<asteve>
oh, well, good news you found it :)
<maletor>
in vim it shows up as <9a>
<maletor>
no idea wtf that is
<davidcelis>
wut
<shevy>
<9a> ?
<shevy>
why that
<asteve>
look into od
<shevy>
oh
<shevy>
an umlaut?
<emsilva>
Folks, https://gist.github.com/3297534. Can someone help me understand why I'm getting "wrong number of arguments (1 for 0)" from the create statement? The destroy statement works fine.
<maletor>
ya it's am umluat
katherinem13 has quit [Ping timeout: 268 seconds]
<apeschel>
Vim has unicode support
<maletor>
i know it does
<maletor>
but whoever commited it to source control did not put it in as an umlaut
<maletor>
they put it in as <9a>
<Coad>
Vim has life support
<apeschel>
Textmate has life support, vim is fine
<Coad>
wtf
lurch_ has joined #ruby
bricker88 has joined #ruby
<Coad>
Textmate has poop support
<Coad>
and a bad release cycle :P
<theRoUS>
if i have module A that defines a bunch of module_functions, how can i include it in B and have B inherit the module functions?
Criztian has joined #ruby
bluenemo has quit [Quit: Verlassend]
bluenemo_ has joined #ruby
bluenemo_ has joined #ruby
<theRoUS>
module A ; class << self ; def included(klass) ; klass.extend(A) ; end ; end ; end
<theRoUS>
sorry..
bluOxigen has joined #ruby
<theRoUS>
module A ; class << self ; def included(klass) ; klass.extend(A) ; end ; end ; def modfunc4a ; end ; module_function(:modfunc4a) ; end
<theRoUS>
module B ; include A ; end
Rajesh has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
<theRoUS>
B.modfunc4a => NoMethodError: private method `modfunc4a' called for B:Module
<Coad>
klass? Where abouts are you from theRoUS?
katherinem13 has joined #ruby
Rajesh is now known as Guest14438
<theRoUS>
so it's defined, but private
<theRoUS>
Coad: klass is the formal passed to A.included()
Juul has quit [Ping timeout: 272 seconds]
<Axsuul>
How would I make Time.zone thread safe?
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
<theRoUS>
Coad: s/klass/including_class/g if you prefer
<Coad>
European people tend to use the variable name "klass"
<Coad>
XD
<Coad>
So I've noticed.
<Coad>
hahahaha
<bricker88>
*facepalm*
<theRoUS>
Coad: i'm a global citizen :-)
<Axsuul>
Coad: it's not that =p
<Coad>
no?
<shevy>
Coad I hate that name
<shevy>
In german language, "class" is translated into "Klasse". The word "klass" seems incorrect semi-german to me.
thomas is now known as evilthomas
<theRoUS>
regardless, how can i make module A's 'module_function's also module_functions of B ?
mengu has joined #ruby
<shevy>
my favourite variable name is _
<bricker88>
Coad: It's convention to use `klass` when you want to store a class or class name in a variable, since you obviously can't use `class`. It's not a "european" thing.
<kirill>
theRoUS: what is B
<theRoUS>
shevy: phonetic in english, though.
_jorge has quit [Ping timeout: 276 seconds]
<theRoUS>
module A ; class << self ; def included(klass) ; klass.extend(A) ; end ; end ; def modfunc4a ; end ; module_function(:modfunc4a) ; end
<theRoUS>
module B ; include A ; end
<theRoUS>
B.modfunc4a => NoMethodError: private method `modfunc4a' called for B:Module
<theRoUS>
isn't it Klaße in german?
<vectorshelve>
..
<Coad>
bricker88: That is true.
<bricker88>
I know
tommyvyo has joined #ruby
<Coad>
I tend to use cls, or something XD
<kirill>
theRoUS: no, u cant get class methods when you include a module
<theRoUS>
shevy: '_' kinda interferes with gettext though
<Coad>
Favourite programming languages? inb4 rinu
<Coad>
(ruby
<Coad>
**ruby
<Coad>
derp.
<kirill>
Coad: what does "inb4" mean
<Muz>
PHP. End of discussion.
<shevy>
theRoUS I can't allow any library try to hijack my beloved _
<Muz>
kirill: "in before"
alexwh has joined #ruby
_jorge has joined #ruby
<Coad>
inb4 means, I'm going to say it before everyone else does, and stop them from saying it.
<kirill>
Muz: "Favorite programming languages? in before ruby" ???
<kirill>
what does that mean
<kirill>
oh ok
<Coad>
It's used on a lot of forums.
bradhe has quit [Remote host closed the connection]
<kirill>
inb4 is stupid
<Muz>
Yes, yes it is.
<Coad>
Like, if you go on a RoR forum, and ask what everyone's favourite web dev framework is
<Muz>
Much like the flame-baiting question
<Coad>
You'd say
<Coad>
inb4 rails
<Coad>
LOL
<theRoUS>
kirill: h'm. 'module B < A' would do it -- if it worked. which it doesn't.
<Coad>
inb4 is used on 4chan a lot
* theRoUS
wonders where apeiros_ is
<apeiros_>
here, why?
<Coad>
Any functional programmers? LISP, Haskell? Anyone? :P
* theRoUS
bows deeply before the wisdom of apeiros_
<apeiros_>
o0
* Coad
wonders how wise apeiros_ is
<Coad>
Should I trust theRoUS' judgement?
<kirill>
Coad: your chat style sucks
* shevy
wants apeiros_'s chocolate
<apeiros_>
I think… why, thank you theRoUS :)
cakehero has quit [Quit: Computer has gone to sleep.]
bluenemo_ has quit [Read error: Connection reset by peer]
<Coad>
>at work
<Coad>
>bored as hell
<Coad>
>nothing to do
<theRoUS>
apeiros_: you know so many of the more esoteric byways of ruby.. do *you* know of a trick to get module B to inherit module A's module functions?
<apeiros_>
Coad: I'm about 25 litres per cube candela wise
<theRoUS>
kirill: not doubting you, but suspecting there may be a trick
bradhe has joined #ruby
pedrohenrique has joined #ruby
dhruvasagar has quit [Quit: Changing server]
<apeiros_>
cubic?
phinfonet has quit [Ping timeout: 246 seconds]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<vectorshelve>
<Coad>
apeiros_: dude, that's awesome.
_jorge has quit [Remote host closed the connection]
jillsmitt_ has joined #ruby
<kirill>
theRoUS: just read the link
<theRoUS>
kirill: i'm reading it
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
katherinem13 has quit [Ping timeout: 244 seconds]
ly_gs has quit [Remote host closed the connection]
<kirill>
Traditional module inclusion uses the class pointer of the Included Module to point to the original module; include_complete instead uses the class pointer to point to a wrapped version of the singleton class of the module and stores the original module in a hidden __module__ instance variable. This wrapped singleton class is then injected into the ancestor chain of the receiver's singleton class.
<theRoUS>
mmm
naz has joined #ruby
jjbohn|afk is now known as jjbohn
jlogsdon_ has joined #ruby
<Coad>
I just don't see why Modules don't inherit class methods...
burgestrand has quit [Quit: Leaving.]
gmci has joined #ruby
<Coad>
A design choice that never made sense to me :(
bradhe has quit [Read error: Connection reset by peer]
bradhe_ has joined #ruby
<Coad>
Well, at least it's not like the OOP/imperative mix that PHP has.
<Coad>
damn mysqli
ThaDick has quit [Quit: zzzZZZ ...]
_jorge has joined #ruby
jlogsdon has quit [Ping timeout: 252 seconds]
ThaDick has joined #ruby
<Coad>
ThaDick: lol, nice name
bradhe_ has quit [Read error: Connection reset by peer]
katherinem13_ has joined #ruby
kenneth has joined #ruby
bradhe has joined #ruby
<ThaDick>
:P
<theRoUS>
kirill: i'd rather not depend on a gem. it looks like i can *sort* of get what i want thusly:
atmosx has joined #ruby
<Coad>
>download source code
<Coad>
>put in project
<Coad>
>no more gem dependency XD
<theRoUS>
module A ; def a_method ; end ; class << self ; def included(klass) ; klass.module_eval do ; class << klass ; self.extend(A) ; end ; end ; end ; end ; end
himsin has joined #ruby
<kenneth>
hey i have a 4-byte string that i want to convert to a 32-bit int
<theRoUS>
module B ; include A ; end
<kenneth>
not convert, but cast
<kenneth>
i'm confused about how to do that
<theRoUS>
B.a_method => nil
elhu has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
<stephenjudkins>
kenneth: i don't think you understand what the word "cast" means
<kenneth>
stephenjudkins: i know what cast means
<theRoUS>
kenneth: is the string hex digits? decimal numerals?
<Coad>
Errr kenneth, stephenjudkins is right
tommyvyo has joined #ruby
<Synthead>
what's the best way to get user input from a ruby script when ARGV is not [] ?
<kenneth>
theRoUS: the string is just four bytes that make up my 32bit int
<Coad>
theRoUS: I think it's safe to assume decimal values
<atmosx>
is there any obvious reason why this code exists always with the 1st rescue even when it should go w/ the 2nd? https://gist.github.com/3297666
apeschel has quit [Ping timeout: 276 seconds]
<Coad>
String#to_i
<kirill>
theRoUS: haha that doesnt work
<kirill>
theRoUS: you're extending into the SINGLETON CLASS u nut
<shevy>
Synthead what you mean with ARGV not [], it's always an Array or?
<kirill>
theRoUS: so you're creating an instance methods on the singleton class of the singleton class
<stephenjudkins>
kenneth: there is no casting in ruby. it's strongly and dynamically typed, so the two conceivable meanings of "to cast" don't apply
<theRoUS>
kirill: yeah, fugly -- but it works
<vectorshelve>
,,,
<kirill>
theRoUS: didnt work for me
<kenneth>
stephenjudkins: right, which is why i'm asking, how do i do the same thing as a cast
<kirill>
theRoUS: you have to extend into the klass itself, rather than the singleton class, and it'll work
<Coad>
kenneth: It's String#to_i(base = 10)
<stephenjudkins>
kenneth: what byte order?
<Coad>
so just
<shevy>
kenneth, with the various #to_* methods
<Synthead>
shevy: if ARGV is populated (i.e., ./script.rb this that) and I have user_input = gets in my script, , gets will get ARGV[0] instead of stdin
<theRoUS>
shevy, Coad: i think he wants to unpack it
xclite has quit [Read error: Connection reset by peer]
xclite has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
blazes816 has joined #ruby
aezop has joined #ruby
cakehero has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
specialGuest has quit [Remote host closed the connection]
_jorge has quit [Remote host closed the connection]
asteve has joined #ruby
<theRoUS>
kirill: eigenclasses always confuse me. i'll get 'em right one of these days..
<theRoUS>
thanks!
<kirill>
theRoUS: in your code you were working with eigenclasses of eigenclasses :P
<theRoUS>
yah..
Markvilla has joined #ruby
<theRoUS>
'it's eigenclasses all the way down'
_jorge has joined #ruby
chussenot has quit [Quit: chussenot]
<vectorshelve>
any suggestions on how to make this code better -> http://pastie.org/4413412 more shorter
excelsior has quit [Ping timeout: 276 seconds]
dankest has quit [Quit: Leaving...]
mneorr has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
nu7hatch has joined #ruby
allyraza has joined #ruby
atmosx has quit [Ping timeout: 240 seconds]
specialGuest has joined #ruby
<Mon_Ouie>
vectorshelve: I'm curious why this isn't a method on your grid class
chimkan_ has quit [Quit: chimkan_]
nonotza has joined #ruby
havenn has quit [Remote host closed the connection]
<vectorshelve>
Mon_Ouie: I have a Printer class which takes a grid object and prints it :) Can i further make this code simple and better ?
katherinem13 has joined #ruby
<vectorshelve>
carloslopes: dude remember me ? :)
<carloslopes>
vectorshelve: hi man
<Mon_Ouie>
It would still make more sense for the grid object itself to decide *how* it is supposed to be formatted
<Mon_Ouie>
0.upto(grid.height) do |y|
_jorge has quit [Remote host closed the connection]
<vectorshelve>
Mon_Ouie: can u help me with the proper code ? I am not understanding it properly
<Mon_Ouie>
I just suggest to use that ^ instead of your while loop
Eldariof27-ru has joined #ruby
strnx has quit [Ping timeout: 244 seconds]
<vectorshelve>
Mon_Ouie: ok
vlad_starkov has joined #ruby
chriskk has joined #ruby
<allyraza>
vectorshelve: hi may i could help
<Mon_Ouie>
Also, your cells datastructure (which I'm assuming is an array) could perhaps be arranged in a way that you can use random access for the cell at position (x, y) without having to iterate over all of them
Lachryma has quit [Ping timeout: 268 seconds]
yoklov has joined #ruby
yoklov has quit [Remote host closed the connection]
<Mon_Ouie>
Two common ways to do that are 2-dimensional arrays or mapping the cell at (x, y) to index x + y * height
yoklov has joined #ruby
<vectorshelve>
Mon_Ouie: I need to display in x y axis means... firstly display all y=0 cells incrementing x and then increment y and so on
<Mon_Ouie>
Yeah, but every time you want to print a line you're iterating over all the other cells too
<Mon_Ouie>
Is that a game of life implementation?
katherinem13 has quit [Read error: Connection reset by peer]
katherinem13 has joined #ruby
<vectorshelve>
Mon_Ouie: yes.. so what is the alternative ?
<vectorshelve>
Mon_Ouie: sets or hash or something like that ?
<Mon_Ouie>
vectorshelve: I mentioned two alternatives above
Eldariof59-ru has quit [Ping timeout: 265 seconds]
<Mon_Ouie>
And in such a game, I wouldn't even have the cells know about their position in the grid
<vectorshelve>
Mon_Ouie: how would I do the second one.. so that I could retain array implementation
<vectorshelve>
Mon_Ouie: cells need to know... their position is their characteristic.. behavious
<vectorshelve>
behaviour*
CaptainKnots has quit [Quit: bazinga!]
chichou has joined #ruby
akem has quit [Read error: Connection reset by peer]
ly_gs has joined #ruby
internet_user has quit [Remote host closed the connection]
<Mon_Ouie>
I would usually implement cells so that their only attribute is knowing whether they are alive or dead. The Grid object will do the job of finding neighbour cells, etc.
cousine has quit [Remote host closed the connection]
TheShadowFog has quit [Quit: pls respond]
<vectorshelve>
Mon_Ouie: I have the grid object finding the neighbour for cells... ;) but i have cell coordinates as well in cells...
ReachingFarr has joined #ruby
<ReachingFarr>
Is there a callback for when an object is about to be collected by the garbage collector?
_jorge has joined #ruby
<Mon_Ouie>
Then you don't *need* them to know their position — you just need a way of finding a cell at a given (x, y) position
<Mon_Ouie>
Be careful when using it though, if the proc you pass captures a reference to the object you want to define a finalizer for… well, it will only be collected at the end of the program
workmad3 has joined #ruby
Guest14438 has quit [Read error: Connection reset by peer]
<ReachingFarr>
Mon_Ouie: Thanks!
\13k has joined #ruby
<bricker88>
So, how would I stub the undefinedness of a constant? I'd rather not use remove_const because then I have to set it after that spec for the rest of the tests.
flagg0204 has joined #ruby
thecreators has joined #ruby
flagg0204 has quit [Client Quit]
<Mon_Ouie>
(And if it is very important for the finalizer to be called in time, it is a better idea to use an explicit cleaning method, like File does)
<ReachingFarr>
Mon_Ouie: I just need to call an FFI method to free some memory in C. There is also a explicit cleaning method but it isn't always appropriate to use.
<Mon_Ouie>
Yeah, cleaning C resources is a typical use case for define_finalizer ;)
TheShadowFog has joined #ruby
katherinem13 has quit [Ping timeout: 256 seconds]
katherinem13__ is now known as katherinem13
<ReachingFarr>
Mon_Ouie: Is there a way to declare a finalizer for a given class or do I need to add a new finalizer for each object instance in the class initialize method?
_jorge has quit [Remote host closed the connection]
katherinem13 has quit [Client Quit]
katherinem13 has joined #ruby
Stalkr_ has quit [Quit: Leaving...]
<Synthead>
is 1.9pad down?
<Mon_Ouie>
ReachingFarr: latter
<bricker88>
Here's the scenario: If a certain constant isn't defined (using defined?() ), I'm raising a custom error message. I'd like to test this behavior but I am not sure how to stub that the constant is not defined… I'm using a class where the constant is defined
<ReachingFarr>
Mon_Ouie: Thanks.
sevvie has quit [Quit: sevvie]
kenneth has quit [Quit: kenneth]
katherinem13 has quit [Read error: Connection reset by peer]
aezop is now known as aezopbot
aezopbot is now known as aezop
apok_ has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
maxmmurphy has joined #ruby
pen has quit [Remote host closed the connection]
Ethan has quit [Ping timeout: 244 seconds]
Guest74974 has quit [Quit: Guest74974]
burgestrand has joined #ruby
apok has quit [Ping timeout: 248 seconds]
apok_ is now known as apok
cgag has quit [Ping timeout: 276 seconds]
gmci has quit [Quit: Computer has gone to sleep.]
<ged>
bricker88: Under what circumstances might it not be defined?
<Mon_Ouie>
I'd guess it comes from an optional dependency?
<bricker88>
ged: If the developer forgets to define it :)
<ged>
remove_const isn't public, but you can invoke it with #send
tatsuya_o has quit [Remote host closed the connection]
<ged>
Wrap that in a before/after that fetches/restores the constant, and I think that should work.
_jorge has joined #ruby
_jorge has quit [Remote host closed the connection]
Ethan has joined #ruby
_jorge has joined #ruby
kenneth has joined #ruby
ph^ has quit [Remote host closed the connection]
ninegrid has joined #ruby
stephenjudkins has joined #ruby
<bricker88>
ged: Thank you, I mentioned I was trying to avoid that because I didn't want to have to reset it after each spec, but that's what I will probably end up doing anyways
adelcampo has quit [Read error: Connection reset by peer]
adelcampo has joined #ruby
answer_42 has quit [Quit: WeeChat 0.3.8]
brdude has quit [Quit: brdude]
Eldariof27-ru has quit []
yxhvuud has quit [Ping timeout: 246 seconds]
wereHamster has quit [Quit: Lost terminal]
maletor has joined #ruby
nonotza has quit [Quit: nonotza]
iamjarvo has quit [Quit: Leaving...]
benwoody has left #ruby [#ruby]
i0n has joined #ruby
i0n has quit [Changing host]
i0n has joined #ruby
gmci has joined #ruby
s0ber has quit [Read error: Connection reset by peer]
wereHamster has joined #ruby
rcassidy has quit [Quit: leaving]
s0ber has joined #ruby
workmad3 has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
speciaLG_ has joined #ruby
speciaLG_ has quit [Remote host closed the connection]
<bricker88>
Oh, I can stub const_defined?
<jrajav>
Alright
<Mon_Ouie>
But that enforces a way to check for the definition of the constant — if you switch to using the defined? keyword, it won't work anymore
<jrajav>
I am VERY CAUTIOUSLY reintroducing al2o3cr
al2o3cr has joined #ruby
<jrajav>
al2o3cr: Say hello to all the nice kids
<jrajav>
He is completely unsandboxed
jarred has quit [Quit: jarred]
<Mon_Ouie>
>> #{3}
macer1 has quit [Quit: bye]
<jrajav>
Security is, instead, provided by a chroot environment
<bricker88>
Mon_Ouie I switched to using const_defined? in the code and am just stubbing that in the test
<jrajav>
It runs Ruby scripts as an unprivileged user, using 'sudo'
specialGuest has quit [Ping timeout: 246 seconds]
<jrajav>
So, in theory, a Ruby script running arbitrary code from snippets in the channel cannot do anything to break out of the chroot
<jrajav>
In addition, I can set resource limits on the new Ruby processes
mfridh has quit [Changing host]
mfridh has joined #ruby
<jrajav>
Right now, the only restriction is that the process cannot exceed 1 second of cpu time (which I haven't even tested XD)
<jrajav>
>> 1 + 3
<jrajav>
...
adelcampo has quit [Quit: Leaving...]
<jrajav>
>> puts 'Hi'
<al2o3cr>
Hi
<jrajav>
Oh. I forgot.
<jrajav>
He's also slightly dumber
<jrajav>
He will only print out what you actually print out to stdout
<jrajav>
It's literally just piping your snippet into a new Ruby script file and piping back stdout and, if it exists, stderr
<Mon_Ouie>
You should just make it print the result of the expression, it's kind of pointless to enforce using print for everything
apok has quit [Remote host closed the connection]
<jrajav>
How do you suggest doing that?
<jrajav>
Capturing the result of the last expression, I mean
<Mon_Ouie>
puts eval($stdin.read)
apok has joined #ruby
<jrajav>
Uh.
<jrajav>
What?
<jrajav>
Oh! I see.
<jrajav>
Well, right now I'm not using stdin
<jrajav>
I'm writing the script to a file
vlad_starkov has quit [Remote host closed the connection]
<jrajav>
I don't even know how piping works with sudo :S
<Mon_Ouie>
Like with any other command
adac has joined #ruby
manizzle has quit [Ping timeout: 252 seconds]
<jrajav>
Well, I *really* want to leave work right now
<jrajav>
So I'm afraid I'm just going to have to leave it like it is for right now
seoaqua has joined #ruby
<Mon_Ouie>
I think you missed a "to" which made you say the opposite of what you meant :p
manizzle has joined #ruby
apok has quit [Client Quit]
<jrajav>
Hmm. No?
<Mon_Ouie>
Oh, nvm, both could work
<jrajav>
Anyway. You and Hanmac can feel free to try breaking this bot
elhu has quit [Quit: Computer has gone to sleep.]
<jrajav>
Oh, I remember what I wanted to try
<jrajav>
>> while (true)
<al2o3cr>
stderr too long, PMed
ThaDick has quit [Quit: I'm outta here!]
chichou has quit [Remote host closed the connection]
<jrajav>
>> while (true) ;
<al2o3cr>
stderr too long, PMed
<jrajav>
-_-
<Mon_Ouie>
>> loop {}
<Mon_Ouie>
Yours is just invalid Ruby :p
bluenemo has quit [Remote host closed the connection]
<jrajav>
T_T
<Mon_Ouie>
It seems to be stuck though, it doesn't say anything
chichou has joined #ruby
<jrajav>
It's not stuck
<Hanmac>
>> 1 + 2
<jrajav>
The process ended immediately
<jrajav>
Hanmac: Have to p or puts
<jrajav>
I should add a message saying that there was no stdout so people don't get horribly confused
mlee has left #ruby [#ruby]
<jrajav>
Mon_Ouie: So that should loop forever?
<Mon_Ouie>
It doesn't say anything when it times out either?
<Mon_Ouie>
loop {}? Yes
<jrajav>
Apparently not
carloslopes has quit [Quit: Leaving.]
<Mon_Ouie>
Like while true; end
<Mon_Ouie>
>> while true; end
<jrajav>
I was expecting Process.spawn to give some kind of error when rlimit_cpu is reached
<jrajav>
It seems to be killing the process after 1 second, though, which is correct
<jrajav>
I don't even know HOW to detect rlimit error conditions and print out something manually
daniel_hinojosa has joined #ruby
s1n4 has quit [Quit: leaving]
<Hanmac>
Mon_Ouie:
<Hanmac>
>> Process.kill :KILL, Process.ppid
<al2o3cr>
stderr:
<al2o3cr>
r_Hanmac.rb:1:in `kill': Operation not permitted (Errno::EPERM)
<al2o3cr>
from r_Hanmac.rb:1:in `<main>'
moshee has quit [Ping timeout: 276 seconds]
<Hanmac>
:'(
<jrajav>
Yeah, like I said, unprivileged user
moshee has joined #ruby
<Mon_Ouie>
Funny thing that Process.ppid changes every time
<jrajav>
Yep, because I'm starting a new Ruby process for each script
<jrajav>
Just like the last bot
<jrajav>
By the way, the bot isn't in Node.js anymore, it's in Ruby
<jrajav>
Because Node.js's child_process.exec was having weird problems with the chroot
<Mon_Ouie>
jrajav: No, not Process.pid, *Process.ppid* — the parent process
<Hanmac>
Mon_Ouie i think even you cant kill the bot anymore :P
<jrajav>
Mon_Ouie: I guess I don't know how it works; maybe it's actually forking the process?
<jrajav>
BEFORE it execs?
<jrajav>
I'm using popen3
twock_ has quit [Ping timeout: 244 seconds]
<jrajav>
To call sudo -u jrajav ruby *thescript*.rb
<jrajav>
And yes you can write and read from files all you want
mahmoudimus has quit [Ping timeout: 240 seconds]
<jrajav>
Including filling up the filesystem; I haven't set any resource limits aside from rlimit_cpu
<Hanmac>
even /etc/passwd? :P
<jrajav>
If you DO fill up the filesystem, it's irreversible, because then the bot wouldn't be able to write any more scripts
<jrajav>
I would have to go in myself to rm them
<jrajav>
So don't do that :P
<Mon_Ouie>
But that's how I wanted to kill it :(
<jrajav>
Hanmac: Yes, you can read that if you want
<jrajav>
Hanmac: It's owned by root though
<jrajav>
Hanmac: Everything is
<jrajav>
Except the files you create yourself
<jrajav>
And the temporary script files
<Mon_Ouie>
I'd even make it easy to write a glob pattern to remove the files!
<jrajav>
No, wait, those are too
<jrajav>
Mon_Ouie: Not today :P
mahmoudimus has joined #ruby
<jrajav>
Mon_Ouie: If you mess up anything I can still fix it, but remote desktoping back to my work box is so slooooow
<jrajav>
It'd be a pain
<jrajav>
I'd prefer you try to break things not related to filling up the filesystem, before I try to lock that down with resource limits
<Mon_Ouie>
Not just SSH?
<jrajav>
I haven't bothered to set that up on the linux vm yet
<jrajav>
I should
elhu has joined #ruby
<jrajav>
Hanmac: My bad, looks like you can't even read it
<jrajav>
Hanmac: I'll say straight up, you're probably not going to be able to do much with the files that are already there. That's the entire purpose of making literally everything root (including the bot process!) except for the actual scriptlets
workmad3 has quit [Ping timeout: 240 seconds]
<jrajav>
In addition, the chroot has only the libs and binaries necessary to run the bot. No fancy unix trickery
<jrajav>
:P
jgrevich has quit [Ping timeout: 244 seconds]
nyuszika7h is now known as \n
<jrajav>
Actually, there might be a few more libs than necessary, because I was playing around with things
<jrajav>
Why on earth is core_perl in my path >_>
<Hanmac>
>>p File.exist?("/usr/bin/gcc")
<al2o3cr>
false
<Hanmac>
:(
vipaca has quit [Quit: Leaving...]
<jrajav>
Yup :3
<jrajav>
I literally did stuff like 'ldd ruby'
<jrajav>
And copied precisely the files I needed to run the bot
<jrajav>
Which obviously does not include the gcc binary
<jrajav>
Sorry
<Hanmac>
copied? why not linked?
<jrajav>
I unno
<Hanmac>
oh wait, i think linking "may" not possible
<jrajav>
It's a separate partition, but I guess linking would have been fine
araujo has quit [Remote host closed the connection]
akl_ has joined #ruby
* Hanmac
makes an Uncle Sam: i want YOUR bot, for my c compile :D
Araxia has joined #ruby
<jrajav>
Oh! One more thing. This doesn't have any limit on stdout/stderr privmsging (I meant to add that before bringing it up but I forgot), and it's possible it will flood and Freenode will d/c it
<jrajav>
And it's NOT on a forever or anything
<Mon_Ouie>
There are literally only two binaries available
stephenjudkins has quit [Quit: stephenjudkins]
<Mon_Ouie>
(in path, that is)
<jrajav>
sudo and ruby?
<jrajav>
Yup
axl__ has joined #ruby
chimkan has joined #ruby
scriabin has joined #ruby
<blazes816>
Mon_Ouie: oh, that's why they're called binaries, huh? ;)
vectorshelve_ has quit [Ping timeout: 245 seconds]
axl_ has quit [Ping timeout: 256 seconds]
axl__ is now known as axl_
beakerma_ has joined #ruby
<Mon_Ouie>
Oh, took me a while to get it :p
<blazes816>
I like the slow burners
<jrajav>
Haha, I just got it too
Foxhoundz has joined #ruby
w0lverine has quit [Quit: w0lverine]
<Foxhoundz>
Why is it that I run into a SystemStackError exception whenever I call sleep() inside a for loop?
hynkle has quit []
<Foxhoundz>
If I remove the sleep, it works fine
<jrajav>
Okay, well, I'm really going home now. Please keep trying to break it somehow -- focus on breaking out of the chroot
<Foxhoundz>
I don't know what's causing the recursions
w0lverine has joined #ruby
<Foxhoundz>
is it the sleep or the for loop?
<scriabin>
noob problem: I'm using Octopress for blogging - I moved to github pages from my personal vps just for giggles, when I did it, the main page posts stopped showing - it's because of this issue: https://github.com/imathis/octopress/issues/555 They recommend "simply rollback [sass] to 3.1.17". That ain't so eash when you're a noob like me. Any love for a noob?
<jrajav>
I also wouldn't mind if you try resource limit problems NOT related to filling up the filesystem
<jrajav>
If you bring down the bot, oh well. It's down for an hour or two until I get home.
<jrajav>
Bye
jrajav has quit [Quit: The best darkness is strange and surprising]
adac has quit [Ping timeout: 246 seconds]
<blazes816>
scriabin: change your Gemfile to use sass 3.1.17
geekbri has quit [Remote host closed the connection]
chussenot has joined #ruby
beakerman has quit [Ping timeout: 265 seconds]
dereknelson is now known as admrla
cbuxton has quit [Ping timeout: 252 seconds]
admrla is now known as dereknelson
<scriabin>
when I put sass 3.1.17 in my Gemfile and I run bundle install - I see errors like so: https://gist.github.com/3298785
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
_jorge has quit [Remote host closed the connection]
<scriabin>
I can go around and around with that all day
<scriabin>
somehow I think somebody is giggling hysterically when I do that
maletor has quit [Quit: Computer has gone to sleep.]
workmad3 has joined #ruby
paolooo has quit [Quit: Page closed]
iamjarvo has joined #ruby
bothra has quit [Ping timeout: 245 seconds]
nXqd has quit [Ping timeout: 268 seconds]
linoj has quit [Ping timeout: 276 seconds]
<aezop>
today I wrote a simple irc client in ruby
paolooo has joined #ruby
SQLStud has quit [Quit: Leaving]
<aezop>
ruby is p cool
<scriabin>
+1 if you're using that client right now, to talk to us
<aezop>
later tonight though, I will make that happen
pdtpatrick_ has joined #ruby
<davidcelis>
eventmachine?
<aezop>
?
<davidcelis>
guess not
<aezop>
no I'm handling everything directly
paolooo has quit [Client Quit]
cbuxton has joined #ruby
* Hanmac
could write an http server in C ... but he dont want to :P
<Muz>
At least HTTP has a vaguely adherable standard.
cantonic has quit [Quit: cantonic]
<Muz>
IRC... not so much. There's a spec, no one's really followed it to the bone for 20+ years.
conorwade has joined #ruby
<Hanmac>
Muz so you want to write an HTTP server in P(L)AIN C ? :P
<Muz>
Hanmac: No. :p
Ethan has quit [Read error: Connection reset by peer]
<aezop>
irc has a pretty great standard
<aezop>
rfc 1459 and rfc 2812
strnx has joined #ruby
akem has quit [Ping timeout: 265 seconds]
joshman_ has quit [Read error: Operation timed out]
dekroning has quit [Quit: leaving]
elhu has quit [Quit: Computer has gone to sleep.]
<Muz>
aezop: yeah, now, of the major IRCds that are still about, how confident are you that your client will support the same features in the same ways with deterministic consequences? :P
ph^ has joined #ruby
workmad3 has quit [Ping timeout: 265 seconds]
maletor has joined #ruby
<aezop>
the intention is not to be comaptible with every backwater irc standard
<Muz>
There're standards, but they're hardly adhered to beyond the core of basic connectivity and messaging. User modes, channel modes, permissions, features vary wildly from IRCd to IRCd.
wmoxam_ has quit [Ping timeout: 245 seconds]
<aezop>
eventually, I'm going to turn it into a weapon
methodmat312 has joined #ruby
cantonic has joined #ruby
<methodmat312>
hello quick question
<methodmat312>
i want to slice an array from X to the end
<methodmat312>
like a = [1,2,3,4]
<methodmat312>
and i want to slice it, a[2..end]
<methodmat312>
is there a way to do it other than a[2..a.length]
<savage->
methodmat312: a.drop(2)
sailias has quit [Ping timeout: 246 seconds]
<methodmat312>
awesome!
apok has joined #ruby
adac has joined #ruby
<savage->
:-)
bradhe_ has joined #ruby
chichou has quit [Remote host closed the connection]
<allyraza>
methodmat312: a[2..-1]
<Foxhoundz>
allyraza, now answer my question :(
<allyraza>
should do it
<methodmat312>
you guys are awesome!
<allyraza>
foxhoundz: please ask?
bradhe has quit [Read error: Connection reset by peer]
tatsuya_o has joined #ruby
<aezop>
16:01 <Foxhoundz> Why is it that I run into a SystemStackError exception whenever I call sleep() inside a for loop?
<aezop>
he already did
<aezop>
he/she
<Muz>
It.
<allyraza>
i did not see what is the question
<Foxhoundz>
he, and the message stated "stack level was too deep"
jonahR has quit [Quit: jonahR]
<Muz>
Foxhoundz: do you have a test case you can pastebin?
Morkel has quit [Quit: Morkel]
mxweas has joined #ruby
chrisbolton has quit [Quit: chrisbolton]
<Foxhoundz>
I resolved the problem
<Foxhoundz>
it was a stupid error on my part, as always
Goles has quit [Quit: Computer has gone to sleep.]
mengu has quit [Read error: Connection reset by peer]
<scriabin>
when I put sass 3.1.17 in my Gemfile and I run bundle install - I see errors like so: https://gist.github.com/3298785. Can anyone help a bonified noob?
Ethan has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
<Spooner>
scriabin : 'Bundle update' should clear everything. If it doesn't just delete the .lock file and "bundle install" (lazy way to fix it :D).
<scriabin>
Spooner: genius! thanks a lot. Sucks being a noob
<xclite>
scraibin: did the bundle update fix it, or did you have to delete the .lock?
<xclite>
sorry, scriabin
<xclite>
just for my own education
cjk101010 has joined #ruby
TheShadowFog has quit [Quit: pls respond]
<ablew>
hey all, i'm looping through variable names in a method. how can i reference the value of the variable that matches the current value i'm iterating on
kyb3r has joined #ruby
<kirill>
ablew: each_with_index
<xclite>
guess i'll never know how scriabin fixed his/her error =p
<ablew>
kirill: oh, cool but I should have been more specific. The values of the array I'm iterating over are variables names set earlier in the class. Basically I want to loop through all the variable names and return them in this method
<ablew>
it's entirely possible i'm going about this in a goofy way
jrajav has joined #ruby
<xclite>
ablew
<jrajav>
Is it dead yet?
<ablew>
xclite
cantonic has quit [Quit: cantonic]
<jrajav>
>> puts "I'm still alive! :D"
<al2o3cr>
I'm still alive! :D
<davidcelis>
davidcelis
<jrajav>
:D
<xclite>
ablew, is this supposed to be dynamic on the variables in the object, or is there a reason you can't do: return [@metric_type, @window_start @ttl]
Ethan has quit [Ping timeout: 244 seconds]
<jrajav>
Hanmac: Mon_Ouie: Anything to report? Is she shipshape? Or did you guys get bored :P
<ablew>
xclite: i'd like it to be dynamic, but if it's too complicated to do i'll just define each method individually
<jrajav>
This is no longer a pre-parsed Sandbox; just pure, vanilla Ruby, just like Ma used to make
atmosx has joined #ruby
<davidcelis>
>> IO
<jrajav>
>> puts "This; didn't; work; before"
<al2o3cr>
This; didn't; work; before
h8R has joined #ruby
mengu has quit [Remote host closed the connection]
<jrajav>
Also, currently you have to p or puts things manually. It only prints things that actually got printed to stdout
<jrajav>
And it doesn't even tell you if it didn't get anything on stdout :P
<xclite>
ablew, I think I better understand what you're trying to do. However, the attr_accessor already does that for you (defines getters for those)
<jrajav>
Refinements will come in the next few days
<xclite>
ablew, are you trying to perform some other action before returning the value?
<atmosx>
hello fellow rubbyist
<atmosx>
s
<atmosx>
shevy: r u sleeping?
<jrajav>
I'm not a rubbyist :<
<atmosx>
jrajav: no one is perfect
<h8R>
hello. I have very strange problem. $ whoami -> www-data. When I try ruby script.rb from console everything is okay. When I try <?php system('ruby script.rb'); ?> I got this: [ERROR] no such file to load -- typhoeus
<jrajav>
I might be a rubyist :P
<atmosx>
jrajav: hope is the last to die ;-)
<ablew>
xclite: oh snap, you're right. that was the main thing i needed to do, yea
<ablew>
xclite: thanks for your help!
<atmosx>
jrajav: j/k of courseee
<atmosx>
jrajav: you know any perl?
<h8R>
any ideas? pleeease
v0n has quit [Quit: Leaving]
<davidcelis>
>> class NotClass < BasicObject; instance_methods.grep(/^[^_]/).each { |m| undef_method m }; def initialize(object) @object = object end; def method_missing(name, *args, &block) !@object.send(name, *args, &block) end; end
<xclite>
ablew, sure thing. When you do want to play with stuff like seeing what variables an object has, look up reflection :)
<jrajav>
h8R: Sure php has the right working directory?
jaylevitt has quit [Ping timeout: 245 seconds]
<atmosx>
h8R: typhoeus is a ruby gem?
<jrajav>
h8R: Also, #php
<davidcelis>
>> class Object; def not() NotClass.new(self) end; end
<davidcelis>
>> puts nil.not.nil?
<al2o3cr>
stderr:
<al2o3cr>
r_davidcelis.rb:1:in `<main>': undefined method `not' for nil:NilClass (NoMethodError)
<h8R>
jrajav: i think its more ruby problem. working directory is apache's /var/www
<h8R>
atmosx: seems it ruby gem, yep
andrewhl has quit [Remote host closed the connection]
<atmosx>
h8R: and let me guess, what does 'which gem' return? :-)
<davidcelis>
jrajav: Each input still spawns a new process, i see
<h8R>
jrajav: not sure ? how to check?
<jrajav>
davidcelis: Yes.
<h8R>
atmosx: /usr/local/bin/gem
seoaqua has quit [Ping timeout: 272 seconds]
<jrajav>
davidcelis: However if you really want to you can write a new Ruby script yourself with File/IO calls and run that
<atmosx>
h8R: what system is that?
<h8R>
atmosx: debian stable
<davidcelis>
>> puts `ls -a`
<al2o3cr>
stderr:
<al2o3cr>
r_davidcelis.rb:1:in ``': No such file or directory - ls -a (Errno::ENOENT)
<al2o3cr>
from r_davidcelis.rb:1:in `<main>'
<jrajav>
davidcelis: No automatic persistence or gisting yet, I'm afraid
<atmosx>
h8R: nice, I have the feeling that the gem was installed in your $HOME
<atmosx>
h8R: and it's not available system-wide
<jrajav>
davidcelis: The 'ls' binary isn't in the chroot
<davidcelis>
:)
<jrajav>
davidcelis: Nor is any binary except for sudo and ruby
baphled has quit [Ping timeout: 244 seconds]
<davidcelis>
nice
<allyraza>
h8r: did you get it right?
Criztian has quit []
<atmosx>
h8R: become root
<atmosx>
using 'sudo su -'
<atmosx>
and type 'gem list'
<h8R>
atmosx: yep, i think its the same problem. the problem is that by default debian stable comes with ruby 1.8 and I've tried to install 1.9.1 and i've mashup everything :D
<atmosx>
see if you can see it
<h8R>
atmosx: okay
<atmosx>
h8R: okay nice
<atmosx>
uninstall ruby1.8
ablew has left #ruby [#ruby]
MasterIdler_ has joined #ruby
<atmosx>
and install 1.9 manually, worked on Gentoo (which is much more fucked up by default)
Divinite has joined #ruby
MasterIdler_ has quit [Client Quit]
<atmosx>
the state of ruby in linux is just sad..
<atmosx>
in FreeBSD is sad too, but I'm fine with rvm for the time being
<h8R>
blazes816: what you mean? the language sounds better than french and german, 90% of youths speak english.. :) and its very cheap. come over :)
dangerousdave has quit [Quit: Leaving...]
<blazes816>
h8R: I'm sure it sounds fine, but I can barely handle my native English, and enough French to accidentally insult someone
<h8R>
blazes816: if you got money you don't need to speak at all :) 1 vodka, 100ml is 2 euro ;)
jeffnappi has joined #ruby
cue232s has left #ruby [#ruby]
<blazes816>
oh man
Stalkr_ has joined #ruby
<Synthead>
is there a gem or something to write to files that have a format like smb.conf, my.cnf, etc? the [this] (newline, tab) that=setting (newline, tab) those=setting
excelsior has joined #ruby
<blazes816>
i'm moving from kansas to sf on friday, so maybe after I get eased into the world I'll hit up bulgaria
<h8R>
atmosx: i've recompiled it from source and i still get this: [ERROR] cannot load such file -- typhoeus [TIP] Try to run 'gem install typhoeus' or 'gem install --user-install typhoeus'.
<blazes816>
Synthead: that's a pretty simple to format to write. idk if there's a gem but if not you should be able to whip a real simple one up
<atmosx>
h8R: did you install the gem?
<atmosx>
check out that root and user read the same 'gem' location
<h8R>
atmosx: i didn't yet, after the recompile. how should I do it
<Synthead>
blazes816: yeah, it's easy. I ask because I want to slide a setting into one of those options :) didn't want to reinvent the wheel
<atmosx>
h8R: $sudo gem install typhoeus
justsee has joined #ruby
<h8R>
atmosx: i don't use sudo, don't have a password configured. should i try as root ?
<h8R>
atmosx: i've tried as www-data and I got this Permission denied - /root/ruby-1.9.3-p194
<blazes816>
reading about bulgarian law on wikipedia. "soviet legal thinking" scares me a bit
beakerma_ has quit [Remote host closed the connection]
<atmosx>
wait wait
jjbohn has quit [Quit: Leaving...]
<atmosx>
www-data has a shell?
<h8R>
atmosx: i'm doin su www-data
<blazes816>
eh, not as bad as it made me imagine..
Divinite has quit [Ping timeout: 265 seconds]
<atmosx>
blazes816: nah it's fine
<atmosx>
blazes816: where r u from?
beakerma_ has joined #ruby
burgestrand has quit [Quit: Leaving.]
<atmosx>
first make sure the gem is in your system
<atmosx>
install it as root
Foxandxss has joined #ruby
<blazes816>
atmosx: kansas, US
<atmosx>
blazes816: wow that's far and away
<blazes816>
It just made me image gulags
<atmosx>
kansas city, kansas
<blazes816>
Wichita, Kansas
<atmosx>
haha gulags… Czech republic
<atmosx>
Wichita? I'm going to wichitaaaa
<h8R>
blazes816: nah, that was 2 decades ago :)
<blazes816>
it's boring
<h8R>
blazes816: now we got corruption :)
<blazes816>
i'm moving to san francisco friday
dhruvasagar has joined #ruby
<atmosx>
make the sweat drop out of every poreeee and I'm bleeind and I'm bleeding right before the world
<atmosx>
ops /world/lord
<atmosx>
anyway
<blazes816>
h8R: i'm used to that
<atmosx>
blazes816: sounds a lot cooler
<blazes816>
haha
<h8R>
we have a amfetamine smuggler for a prime minister - its fun here - checkout Boiko Borisov @wikileaks
chussenot has quit [Quit: chussenot]
<blazes816>
that very same wichita
dhruvasagar has quit [Client Quit]
<blazes816>
h8R: Our CIA manufactors and distributes Crack
<atmosx>
h8R: they have a president with a nobel prize for 'peace' who has made more than 5 wars in 4 years
dhruvasagar has joined #ruby
<blazes816>
and guns
<blazes816>
hahah, atmosx, that's my favorite!
<h8R>
atmosx: lol :--)
<blazes816>
but at least he killed bin laden!
<atmosx>
did he?
<blazes816>
yeah
DrShoggoth has quit [Quit: Leaving]
<blazes816>
but it was sarcasm, everybody else here danced it the streeets
<shevy>
atmosx almost fell asleep
<atmosx>
shevy: !!!
fastred has quit [Quit: fastred]
<atmosx>
blazes816: heh
<h8R>
doh. ruby is so hard to install :D
<blazes816>
h8R: RVM isn't
<h8R>
atmosx: i got the typhoeus gem as a root
<h8R>
blazes816: i think rvm made that mashup on my system :D
<atmosx>
h8R: now as user can you see it when you type 'gem list'
<h8R>
atmosx: as www-data - > yes, i see it
dhruvasagar has quit [Client Quit]
<atmosx>
out of curiosity
beakerma_ has quit [Ping timeout: 276 seconds]
dhruvasagar has joined #ruby
<atmosx>
can you do a 'finger www-data' ?
<h8R>
but when I fire the php script, I still get: cannot load such file -- typhoeus
<atmosx>
if you have fingerd in your system will work
<h8R>
atmosx: command not found
<h8R>
atmosx: should I install it
<atmosx>
nah
<atmosx>
leave it
<h8R>
okay
<atmosx>
now php can execute ruby
<atmosx>
but still cannot find the gem?
beakerman has joined #ruby
Foxhoundz has joined #ruby
havenn has joined #ruby
<atmosx>
the same script works if you run it as a user?
Divinite has joined #ruby
<h8R>
atmosx: system("ruby -v"); prints ruby 1.9.3p194 (2012-04-20) [x86_64-linux]
theRoUS has quit [Ping timeout: 245 seconds]
fantazo has joined #ruby
Synthead has quit [Remote host closed the connection]
libryder has joined #ruby
<shevy>
h8R I compile ruby from source and it works nicely
<h8R>
shevy: it works when I executy ruby script.rb from shell.. it doesn' when I try <?php system("ruby script.rb"); ?>
<h8R>
execute*
<atmosx>
hmmm
<shevy>
that is trying to use php. is the path to the ruby interpreter fine?
<shevy>
hmm
<shevy>
I dont have php installed anymore, so I cant test :(
Haidar1982 has joined #ruby
Divinite has quit [Client Quit]
<h8R>
shevy: how to check that ?
<Haidar1982>
hi
<libryder>
i'm writing a gem, and in the gem_name.rb i have "require gem_name/precise_round", which contains this https://gist.github.com/68d601ef6713ade373ca — is there a better way to do this? i have a class where i'm using precise_round(x) several times and it works well.
<libryder>
just want to make sure i'm not doing something crazy
<libryder>
the argument for round wasn't added until 1.9 and i need to support 1.8 for now
Haidar1982 has left #ruby [#ruby]
<shevy>
h8R not sure, been a while since I used PHP. in ruby though... you can get the return value
<shevy>
like result = `php foo.php`; require 'pp'; pp result
<shevy>
I am sure php allows something too, so you can see the error
tommyvyo has quit [Quit: Computer has gone to sleep.]
<shevy>
h8R, from within irb or ruby scripts, using system() works fine for me
<h8R>
atmosx: php and ruby? i'm new ruby user, just trying to print the output..
keyvan is now known as Guest
i0n has quit [Ping timeout: 245 seconds]
<h8R>
atmosx: i got to learn how to use ruby and apache
<blazes816>
h8R: ruby isn't like php
hadees has joined #ruby
und3f has quit [Ping timeout: 246 seconds]
<atmosx>
h8R: you really don't need apache with ruby
<blazes816>
you don't use apache (at least in development)
akl_ has quit [Ping timeout: 245 seconds]
<shevy>
h8R, just use a .cgi page
<blazes816>
it's the hardest part of switching from php to ruby
<atmosx>
h8R: nginx + unicorn_rails will be fine, or sinatra for easier things etc.
<shevy>
I use ruby .cgi scripts + apache just fine
<h8R>
atmosx: ruby doesn't need apache o_O :O
<atmosx>
h8R: nah
<atmosx>
nope
<atmosx>
nada
<blazes816>
webrick, unicorn, thin, etc
libryder has left #ruby [#ruby]
<h8R>
o_O i'm going to varnaconf.com saturday
<shevy>
you guys are confusing him with choices
<h8R>
i'll going to love ruby seem like :)
<atmosx>
h8R: ruby has many servers, apache acts as a 'security measure' if you want it.. but as I said there are other more easy-to-configure solutions.
<atmosx>
shevy is probably right so I'm stopping
<blazes816>
oh, what no shevy, he's been stimulated
<atmosx>
h8R: what are you trying to do anyway?
<shevy>
hehe
<h8R>
okay, i'll read more tomorrow
<shevy>
h8R, I switched from php to ruby many years ago
aezop has quit [Remote host closed the connection]
<atmosx>
h8R: r you trying to hack CERN? (again?)
<h8R>
atmosx: i'm trying to run wpscan script, so I can provide easy way to my colleages to check their buggy wordpresses
<havenn>
I'd recommend either unicorn, rainbows!, thin, puma, or passenger behind nginx, apache, or lighttpd
<h8R>
its written on ruby
77CABBRZB has joined #ruby
<atmosx>
h8R: this passenger + nginx is a very popular solution (although I'll use unicorn + nginx)
<h8R>
atmosx: okay, i;'ll check it.. if you have time come saturday to varnaconf.com
<h8R>
i' gotta go now, i'll come over later. thanks a lot for the support
tommyvyo has joined #ruby
<atmosx>
h8R: I'm far and away :-) I wish I could come though
blacktulip has quit [Read error: Connection reset by peer]
<atmosx>
h8R: bb
<h8R>
see ya tommorow i'll owe you a beer
<h8R>
cheers
nari has joined #ruby
tommyvyo has quit [Client Quit]
syamajala has joined #ruby
scriabin has quit [Quit: leaving]
dpk has quit [Quit: Asleep at the keyboard.]
sailias has joined #ruby
h8R has quit [Ping timeout: 245 seconds]
qwerxy has joined #ruby
sailias1 has joined #ruby
77CABBRZB is now known as skilcraft
chussenot has joined #ruby
<twock>
hello, I want to get the width of a string in ruby that uses wide characters
<twock>
just asking for the length is obviously incorrect, so how would this be handled?
wallerdev has quit [Quit: wallerdev]
<apeiros_>
width? as in pixels?
wallerdev has joined #ruby
<apeiros_>
or as in number of characters?
SCommette has quit [Quit: SCommette]
maxmmurphy has quit [Quit: maxmmurphy]
poga has quit [Remote host closed the connection]
zeen has quit [Ping timeout: 246 seconds]
cantonic has joined #ruby
awarner has quit [Remote host closed the connection]
sailias has quit [Ping timeout: 268 seconds]
<twock>
apeiros_: I want the width of the string in a monospaced font
<twock>
I don't know how font-dependent that is, but I basically want wide characters (mainly japanese) to count 2 for the length
<atmosx>
:im off to bed
<atmosx>
cya
<Muz>
A monospaced font would have all the characters display within the same width...
<apeiros_>
twock: that's font-dependent, rendering dependent, font-size dependent and a whole slew of other things
<Muz>
What it seems you're asking is "I want the length of a string, with wide characters counting for 2"
und3f has joined #ruby
<apeiros_>
twock: so ruby can't answer you that question. whatever engine you use to render the text might.
cakehero has quit [Quit: Computer has gone to sleep.]
Progster has joined #ruby
tommyvyo has joined #ruby
<twock>
Yeah, it's just a matter of sprintf counting characters for formatting
<apeiros_>
aha
conorwade has quit [Quit: Computer has gone to sleep.]
ipoval has quit [Quit: ipoval]
<apeiros_>
so your problem is sprintf counting bytes while you need it to count characters? the difference of the .length with once force_encoded to 'binary' should tell you that
<apeiros_>
or maybe I'm misunderstanding the question…
ipoval has joined #ruby
niklasb has quit [Read error: Operation timed out]
kirill has quit [Remote host closed the connection]
emboss has quit [Quit: Ex-Chat]
niklasb has quit [Client Quit]
jeffnappi has quit [Quit: leaving]
jeffnappi has joined #ruby
ipoval has quit [Quit: ipoval]
und3f has quit [Quit: Leaving.]
tewecske has quit [Quit: Leaving.]
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]
iamjarvo has quit [Quit: Leaving...]
w400z has joined #ruby
sailias1 has quit [Ping timeout: 246 seconds]
johnlcox has quit [Ping timeout: 265 seconds]
adac has quit [Quit: Leaving]
adac has joined #ruby
<adac>
agent.page.search("//link[@rel='ITEM']") NOw how can I tell mechanize/ nokogiri that it should search for case insensitve 'ITEM'?
mikepack has quit [Remote host closed the connection]
jeffnappi has quit [Remote host closed the connection]
cdepue has quit [Remote host closed the connection]
pu22l3r_ has joined #ruby
ringotwo has quit [Read error: Connection reset by peer]
pu22l3r has quit [Ping timeout: 240 seconds]
ringotwo has joined #ruby
ramblex has quit [Quit: ramblex]
vitoravelino is now known as vitoravelino`afk
mascool has joined #ruby
w400z has quit [Quit: Computer has gone to sleep.]
uris has quit [Quit: leaving]
nilg has quit [Remote host closed the connection]
nu7hatch has left #ruby [#ruby]
mneorr1 has joined #ruby
ForSpareParts has left #ruby ["Leaving"]
[Neurotic] has joined #ruby
subbyyy has joined #ruby
baroquebobcat has quit [Ping timeout: 268 seconds]
baroquebobcat_ has joined #ruby
headius has joined #ruby
mneorr has quit [Ping timeout: 260 seconds]
ly_gs has quit [Remote host closed the connection]
khakimov has joined #ruby
kylesnav has joined #ruby
kylesnav has left #ruby [#ruby]
headius has quit [Client Quit]
jjang has joined #ruby
jjang has quit [Remote host closed the connection]
headius has joined #ruby
jjang has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
kylesnav has joined #ruby
kylesnav has left #ruby [#ruby]
kirun has quit [Quit: Client exiting]
jlogsdon_ has joined #ruby
adeponte has quit [Remote host closed the connection]