Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
_whitelogger joined #ruby
Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<zaarg>
i have a list and i want to grep it for things that don't contain a. what's the right reg exp? or do i negate the reg exp? or do i list each character individually...
pac1 joined #ruby
xol joined #ruby
Adman65 joined #ruby
RLa left #ruby
dyer joined #ruby
replore_ joined #ruby
dnyy joined #ruby
macabre joined #ruby
tdubellz joined #ruby
wookiehangover joined #ruby
diverdude joined #ruby
RyanV joined #ruby
looopy joined #ruby
radic joined #ruby
Hellojere joined #ruby
xol joined #ruby
j3r0m3 joined #ruby
xpot joined #ruby
bbttxu joined #ruby
Targen joined #ruby
<shevy>
zaarg one thing at a time
<shevy>
you have an Array right?
<shevy>
a common idiom may be to apply .reject on your array
<terraUNDverra>
zaarg: array.select { |v| v !~ /a/ }
tomzx joined #ruby
<terraUNDverra>
shevy: how did u feel about bruno being a homosexual austrian
<iamjarvo>
so say i knew that 1 euro was 1 australian dollar and 2 australian dollars was 1 us dollar what strategy would i do find the value of euros in u.s dollars
<iamjarvo>
disclaimer this is for the puzzlenode, and i do not intend to submit this
<terraUNDverra>
iamjarvo: go back to highschool and learn basic math?
<iamjarvo>
terraUNDverra haha good one. but from a programming perspective
<shevy>
terraUNDverra who the fuck is bruno
<shevy>
iamjarvo math is programming and programming is math
<qiyong>
where is the rails binary installed by gems?
Adman65 joined #ruby
skrewler joined #ruby
xol joined #ruby
looopy joined #ruby
marcuspat joined #ruby
dotnull joined #ruby
namidark joined #ruby
<qiyong>
is there a command by gems that i can list all files from a gem? like dpkg -L
<namidark>
Is there a way I can use HashwithIndifferentAccess in ruby?
dotnull joined #ruby
<terraUNDverra>
qiyong: are you chinese?
<qiyong>
terraUNDverra: offtopic
monkey13 joined #ruby
poseidon_work joined #ruby
<terraUNDverra>
qiyong: it would help me answer your question as the chinese world view is very different to the western one and i'd have to select my words and categories carefully so as to prevent any ambiguity and misunderstandings. I have some experience with the chinese mind as i lived there for a while and i know the difficulties that exist in cross cultural communication
brianherman joined #ruby
<poseidon_work>
anyone know where I can find gems 1.4?
<poseidon_work>
trying to install redmine
brianherman joined #ruby
dotnull joined #ruby
daniel__ joined #ruby
daniel__ joined #ruby
<poseidon_work>
I was able to find 1.8 with ease. though finding 1.4 is a little more difficult
rsampaio joined #ruby
sysuaf joined #ruby
Eaven joined #ruby
roaminghorse joined #ruby
<qiyong>
i get Invalid gemspec in [/var/lib/gems/1.8/specifications/json-1.6.1.gemspec]: invalid date format in specification: "2011-09-18 00:00:00.000000000Z"
<qiyong>
how to repair?
rhinux joined #ruby
<qiyong>
terraUNDverra: i don't think that's a barrier to me
<qiyong>
terraUNDverra: chinese are human too, not animials
dyer joined #ruby
ksinkar joined #ruby
Rango joined #ruby
nanoyak joined #ruby
monkey13 joined #ruby
Bardosity joined #ruby
dbgster joined #ruby
<Bardosity>
Finally got my first Ruby project
<Bardosity>
I might be here a lot in the future :)
<qiyong>
terraUNDverra: plz non of my business, i do not live there and refuse to move there, that evil city.
<qiyong>
terraUNDverra: and they deserve it, i hate them
<qiyong>
period
raz joined #ruby
<raz>
how do i access an instance attribute that has no attr_reader?
<qiyong>
terraUNDverra: plz, there's things much worse than that
<qiyong>
the system got problems, not the people
<qiyong>
and that's why it became a shocking news
<qiyong>
passers-by's have their reason to not help. anyway not their fault.
<qiyong>
if put you in such a system, you may become much worse than them. trust me.
p0y joined #ruby
satyavvd joined #ruby
tomzx joined #ruby
<terraUNDverra>
qiyong: the system you talk about, all it was was ONE case where someone helped an old person and was prosecuted as the person who injured them in teh first place --- but even in that one case, he was eventually acquitted due to public outcry.
<terraUNDverra>
qiyong: so that is not strong enough to explain nobody helping the girl
<terraUNDverra>
qiyong: seems chinese use a lot of excused to explain away their lack of basic morality
<terraUNDverra>
qiyong: no one believed it
looopy joined #ruby
<qiyong>
terraUNDverra: some/many never got acquitted
<qiyong>
terraUNDverra: the law doesn't protect innocent helpers
<qiyong>
terraUNDverra: if law doesn't protect morality, most people would lost their morality
<terraUNDverra>
qiyong: i know some chinese in my country, and they are all very selfish people. Even someone does something for them they do not say thankyou, they only think about themeslves. It is a problem with the people as much as it is the system
<qiyong>
terraUNDverra: i'm glad those wastes dumped to your country.
d3vic3 joined #ruby
<qiyong>
terraUNDverra: the imoralities get the chance to money, then the chance to imigrate. simple
jfredett joined #ruby
<terraUNDverra>
qiyong: ok
<qiyong>
terraUNDverra: in the world, we are the only place where buddism doctrines are well preserved. so there's hope.
<terraUNDverra>
qiyong: buddhism is stronger there than Taoism?
<qiyong>
terraUNDverra: so you know nothing. don't tell me you've been here
<qiyong>
terraUNDverra: i'd say probably 50% chinese are evil. 40% are doing wrongs without awarness.
<qiyong>
still 10% pure poeple left
<terraUNDverra>
qiyong: there is a quote "you wont like what comes after america", and i think it is right if china comes after america
<qiyong>
terraUNDverra: what that mean?
<terraUNDverra>
qiyong: if china replaces america as the primary world superpower, it will not be a good thing
<qiyong>
terraUNDverra: by the way, next time you met a selfish chinese in you country, pass my words: i, one chinese from north-east china despite you. you lose face. away from china.
<terraUNDverra>
qiyong: i love u
<terraUNDverra>
qiyong: are you from szechuan
<qiyong>
no
<qiyong>
szechuan is the south-west
<terraUNDverra>
qiyong: oh ok, i have met nice people there anyway
* araujo
has been in China ... and loves it there
<qiyong>
szechuan people are genarally good
<araujo>
_all_ people were so nice with me
<terraUNDverra>
qiyong: szechuan women have spicy personalities
* araujo
wants to visit again
<qiyong>
terraUNDverra: different from the rest parts
<terraUNDverra>
araujo: it's creepy to talk about yourself in the 3rd person like that
* araujo
has no idea what terraUNDverra is talking about :)
<araujo>
qiyong, I only visited the south , ... nice people, delicious sweet food, ..... I have heard north is more awesome :)
<qiyong>
araujo: south a bit wet
zenergi joined #ruby
<araujo>
qiyong, was extremely hot/humid in summer ....
<qiyong>
araujo: china is like things in europe
<qiyong>
north and south people speak differently, look differently
<araujo>
qiyong, I was told that
<araujo>
different kind of food, customs, ..... and so on
<qiyong>
derived from different races
<qiyong>
silightly
<qiyong>
i'm tired of random shocking news
<qiyong>
the run over toddler deserve it. her mother came to such a evil city to contribute
RyanV joined #ruby
<qiyong>
the taxi took the longer route on purpose when i was there, if it's the city shenzhen
<qiyong>
in my city, that's unimaginable.
<araujo>
qiyong, what is your city?
<qiyong>
and the driver would be beaten
<qiyong>
Dalian
<araujo>
north city right?
<qiyong>
right
* araujo
hopes to visit north next time :)
<araujo>
I worry about the weather though ... I have heard north can get very extreme (cold/hot/storms) weather
<qiyong>
-10 degree
<araujo>
qiyong, but that can reacher lower? ... for example in Beijing?
<araujo>
reach*
<qiyong>
-15 in beijing
<araujo>
qiyong, that is usually the lower temperature?
j3r0m3 joined #ruby
<qiyong>
araujo: i guess so. most of the time, you stay you buildings, why care
looopy joined #ruby
<araujo>
qiyong, I don't like too cold
wyhaines joined #ruby
<araujo>
but I heard it could be much colder than -15 in the north
ryanf joined #ruby
<qiyong>
araujo: -20 for some days
acts_as_david joined #ruby
goodieboy joined #ruby
sythe joined #ruby
sythe joined #ruby
Cervajz joined #ruby
Eaven joined #ruby
xol joined #ruby
Targen joined #ruby
iamjarvo joined #ruby
sdwrage joined #ruby
poseidon_work left #ruby
iDespera` joined #ruby
x0F__ joined #ruby
robyurkowski joined #ruby
nanoyak joined #ruby
pencilcheck joined #ruby
travisjeffery joined #ruby
pen__ joined #ruby
mksm joined #ruby
travisjeffery joined #ruby
travisjeffery joined #ruby
travisjeffery joined #ruby
<rcs>
Anyone happen to be familiar with MongoMapper? Calling something like artist.books.published (published is a scope) works, but artist.books.send(:published) doesn't. Happening through a proxy_association delegation. How would I send a call like that without using the obj.method notation?
sayem joined #ruby
<sullx>
whats a good way to grab multiple strings from one large string like "foo\r\nbar\r\nbaz\r\nfoo\r\n" and dump each individual string into an array
<rcs>
What do you want to match out of that?
<sullx>
foo, bar, and baz
<rcs>
Not the second foo?
<sullx>
yes, for the second foo.
<sullx>
foo, bar, and baz, foo
fixl joined #ruby
marting_ joined #ruby
<rcs>
sullx: [4] pry(main)> "foo\r\nbar\r\nbaz\r\nfoo\r\n".scan(/^.+\r$/) returns an array for each matched
<rcs>
I can't get rid of the \r, sadly.
<rcs>
But str.scan is what you want.
<mksm>
any alternative to rmagick?
<sullx>
perfect! what is the regex your using?
<rcs>
You can do something like "foo\r\nbar\r\nbaz\r\nfoo\r\n".scan(/^(.+)[\r]$/) , but that returns [['foo'],['bar'] etc
<sullx>
mksm, light weight or a comparable library?
<rcs>
sullx: /^.+$/
<rcs>
Match between the start and end of line.
<mksm>
sullx, comparable
<rcs>
But if you just want to do that, you might also consider splitting the string.
marcuspat joined #ruby
<mksm>
actually i need some recent imagemagick routines that are not mapped into rmagick
macmartine joined #ruby
<rcs>
mksm: I went down a rabbit hole with rmagick ,and just now started execing the command line things instead :-/
<shevy>
mksm hmm isn't rmagick dead?
<mksm>
shevy, it is.
<mksm>
rcs, yeah, i'm doing that but it spawns a ton of processes
tomzx joined #ruby
<mksm>
and the server goes kaboom :D
<rcs>
You may very well be able to be a lot more clever with what you do with the command line.
ryanf joined #ruby
xol joined #ruby
<mksm>
rcs, so it wouldn't spawn so many child processes?
<Bardosity>
How do I set the default ruby version? rvm use 1.9.3 only lasts for the current session but then defaults back to the system
<rcs>
mksm: Yeah. You can do a lot with a single convert command, for instance.
<mksm>
rvm use --default
j3r0m3 joined #ruby
<Bardosity>
thanks mksm :)
<mksm>
rcs, yes, it's already chaining a bunch of stuff in a single convert command. Problem is that I have to fetch an image, run convert on it and then store it.
<mksm>
And I can't download all the images and THEN run convert.
epochwolf joined #ruby
<rcs>
Ah, yeah. So a proc per image.
<mksm>
Yeah that's the problem ...
looopy joined #ruby
raincole joined #ruby
xol_ joined #ruby
monkey13 joined #ruby
Cervajz joined #ruby
radic joined #ruby
rhinux joined #ruby
gianlucadv joined #ruby
ksinkar joined #ruby
radmacd joined #ruby
pen joined #ruby
kawa_xxx joined #ruby
minijupe joined #ruby
jetblack joined #ruby
LittleBill902 joined #ruby
ABK joined #ruby
LittleBill902 joined #ruby
a_a_g joined #ruby
bluOxigen joined #ruby
<Bardosity>
I don't suppose anyone here used Rhodes or has developed with Rhomobile?
<shevy>
not me
robyurkowski joined #ruby
trivol joined #ruby
Beoran_ joined #ruby
mengu joined #ruby
pen joined #ruby
jetblack joined #ruby
terraUNDverra joined #ruby
michael_mbp joined #ruby
apok joined #ruby
poseidon joined #ruby
<poseidon>
anyone know of a good guide for installing redmine?
<poseidon>
specifically for centos with apache
Draco_ joined #ruby
terraUND_ joined #ruby
dnyy joined #ruby
goodieboy joined #ruby
j3r0m3 joined #ruby
looopy joined #ruby
gh joined #ruby
diverdude joined #ruby
a_a_g joined #ruby
a_a_g joined #ruby
mikeric joined #ruby
advorak joined #ruby
looopy joined #ruby
xol joined #ruby
acts_as_david joined #ruby
j3r0m3 joined #ruby
wookiehangover joined #ruby
Indian joined #ruby
savage- joined #ruby
terraUNDverra joined #ruby
roaminghorse joined #ruby
nomadmonad joined #ruby
randym joined #ruby
tugosavi_ joined #ruby
yumike joined #ruby
zwang joined #ruby
yumike left #ruby
eeadc joined #ruby
zommi joined #ruby
jensn joined #ruby
Amirh joined #ruby
deadbea7 joined #ruby
lusory joined #ruby
ryanf joined #ruby
d3c joined #ruby
yxhuvud joined #ruby
<abstrakt>
poseidon, well, IMO you should use RVM to install ruby and your gems
kjkim joined #ruby
<abstrakt>
poseidon, and, isn't redmine actually a gem? i can't remember
smgt joined #ruby
<abstrakt>
hmm, nevermind I guess
<abstrakt>
poseidon, does CentOS not have redmine packages?
<StitchedKite>
arch makes it so that i don't have really heavy software preinstalled and uneeded daemons
<shevy>
funny that you say that abstrakt. I've lately started a "don't make me think" way to program. Its basic rule is that every time ruby code makes me think too much, it must be wrong and must become simpler.
amacgregor joined #ruby
<abstrakt>
hahah
<rpowell>
guys, #linux
<Norrin>
lol ^
<abstrakt>
StitchedKite, that's what "server" distros are for, Ubuntu Server for example, as opposed to Ubuntu Desktop
<StitchedKite>
abstrakt: my computers from 1999 so any desktop flavour is wayy too heavy
<abstrakt>
StitchedKite, ubuntu server fits very nicely in my 10G 256M virtual machines that I usually use for dev
<shevy>
ewww 1999
<StitchedKite>
year of the 8gb internal hard drive
<StitchedKite>
3dfx's voodo gpu
<abstrakt>
yeah, I remember when 64M of RAM was a lot
<abstrakt>
hahah, yeah I remember 3dfx too
<StitchedKite>
yeah, i also remember having to fiddle for 30 minutes to get the driver working right
j3r0m3 joined #ruby
ryanf_ joined #ruby
Dangr_ joined #ruby
Nss joined #ruby
<shevy>
hey I am using linux, my drivers never work completely right
axisys joined #ruby
ikaros joined #ruby
Morkel joined #ruby
xol joined #ruby
mafolz joined #ruby
marcuspat joined #ruby
roaminghorse joined #ruby
ph^ joined #ruby
<StitchedKite>
well the nature of linux is to be configurable, whereas most things in windows can be done with point and click
burgestrand joined #ruby
heftig joined #ruby
<StitchedKite>
so most likely its a configuration issue or wrong drivers anyhow back on subject
<StitchedKite>
s/subject/topic/gi
sullx joined #ruby
nari joined #ruby
probst joined #ruby
fortysixandtwo joined #ruby
pi3r joined #ruby
mystline joined #ruby
petschbot joined #ruby
<mystline>
Hi everyone, i'm trying to install redmine on centOS 6. when i run the command rake config/initializers/session_store.rb i receive the message 'rake aborted! no such file to load -- rails/all'. I'm using ruby 1.8.7 and rails 2.3.5
beseku joined #ruby
ephemerian joined #ruby
<mystline>
actually wait, rails version 1.3.7 >_<
batlock666 joined #ruby
Seisatsu joined #ruby
zommi joined #ruby
gayasentinel joined #ruby
pen joined #ruby
otakutomo joined #ruby
iocor joined #ruby
berkes joined #ruby
Adman65 joined #ruby
<StitchedKite>
mystline: update your ruby
j3r0m3 joined #ruby
<StitchedKite>
1.9 is the newest
mengu joined #ruby
mengu joined #ruby
<StitchedKite>
though this might not pertain to what your problem might be
<mystline>
StitchedKite: i did something similar, seems to have worked okay. thanks for your help
<StitchedKite>
mystline: you get it working ?
<mystline>
nope, going to give it another shot tomorrow :3 home time!
flippingbits joined #ruby
Ch4rAzZz joined #ruby
james_cotterill joined #ruby
Programmer_ left #ruby
BiHi joined #ruby
xpot joined #ruby
<Bardosity>
rake is calling gcc with unrecognised options, but I can't figure out where those options are being specified
<Bardosity>
I'm very new to rake
iocor joined #ruby
adambeynon joined #ruby
<StitchedKite>
Bardosity: was that a question or a statement in regard to the last guy's question
<StitchedKite>
?
timonv joined #ruby
<Bardosity>
Nope, it was a question in regards to my hours of debugging this build problem :)
<Bardosity>
I should have written some sort of preamble, I suppose
<StitchedKite>
ahh ;p
<StitchedKite>
i'm a pretty green to rake as well
<Bardosity>
Anyone else here awake and actually know about rake? :)
Nss joined #ruby
jbpros joined #ruby
robotmay joined #ruby
<StitchedKite>
i'm not green to gcc however
<StitchedKite>
so if you knew what the flags where i could sort of help
robyurkowski joined #ruby
codespectator joined #ruby
nicoulaj joined #ruby
<shevy>
Bardosity probably somewhere in the Rakefile
<Bardosity>
I solved one problem by using clang instead of gcc
<StitchedKite>
*were lol geez its 4:12am here
<Bardosity>
that supports the options that gcc doesn't know about
ikaros joined #ruby
otakutomo joined #ruby
marcuspat joined #ruby
robyurkowski joined #ruby
mksm joined #ruby
flippingbits joined #ruby
<shevy>
hehe
qiyong left #ruby
nari joined #ruby
robyurkowski joined #ruby
robyurkowski joined #ruby
xol joined #ruby
bwwrd joined #ruby
hurikhan|Work joined #ruby
pen joined #ruby
petschbot joined #ruby
<frerich>
Hi, I'm embeding Ruby 1.9.2 into a C++ application and just noticed that 'puts' statements executed in the script don't actually yield any stdout output. A bit of research revealed the tiny C example program at http://pastebin.com/7sk1igHG but if I compile this on the command line (like 'cl ruby_puts.c /I... C:\path\to\ruby.lib') it doesn't actually print anything either.
<frerich>
I've been digging around the Rbuy source code, trying to find out whether I maybe need to set the stdout descriptor used by puts, but the only interesting thing I found (which already does this) is the 'Init_IO' function in io.c
<frerich>
Strangely enough, nobody seems to call this function!
<TheNumb>
Hey guys (:
Indian joined #ruby
<TheNumb>
Is there any good tutorial about deploying RoR applications?
<TheNumb>
I don't want to use ngix + passenger.
terraUNDverra joined #ruby
speggey left #ruby
<StitchedKite>
TheNumb: well if your on nix i'd recommed using dpkg ;p
nari joined #ruby
hemanth joined #ruby
beseku joined #ruby
jbpros joined #ruby
robyurkowski joined #ruby
Helius joined #ruby
chrisbuchholz joined #ruby
<chrisbuchholz>
Hey guys.
<frerich>
For the record, turned out my 'puts' didn't work since ruby_finalize() wasn't called (which, among other things, flushes file buffers).
<chrisbuchholz>
Can someone point me in the right direction of a ruby book to get started with? I have only looked at ruby code when i configured jekyll and a few homebrew formulas, but i have been programming in other languages for nearly 8 years, so a book that fits that description would be great.
roaminghorse joined #ruby
tatsuya_o joined #ruby
<randym>
hey hey tatsuya_o
fridim_ joined #ruby
otakutomo joined #ruby
Guedes joined #ruby
Guedes joined #ruby
Tuxist joined #ruby
Manhose joined #ruby
jbpros joined #ruby
<StitchedKite>
chrisbuchholz: if you've been programming that long and what to get started fast, a combination of why's poignant guide and tryruby.org
<StitchedKite>
there is also the translation of the book matz wrote
<StitchedKite>
though i don't recall the name atm
beseku joined #ruby
<terraUNDverra>
StitchedKite: you dont need a translation, he wrote in english with david flanagan "the ruby programming language"
<rpowell>
oh man don't you love it when something like this turns up in your search results? https://gist.github.com/639636
<StitchedKite>
terraUNDverra: ok
moondiamond joined #ruby
<StitchedKite>
i was told it was a translation so .... guess they were wrong
<terraUNDverra>
StitchedKite: they lied to you
<terraUNDverra>
StitchedKite: unless they're talking about his much earlier book that he wrote by himself
<terraUNDverra>
but that's likely way out of date now
djdb joined #ruby
<StitchedKite>
ahh probably was referencing the old book
<Mahoru`Tsunemi>
Tasser: do you have any idea ? i think that's linked to gem
speggey joined #ruby
<Tasser>
ruby version?
<Tasser>
does "require 'execjs'" in pry/irb work?
iamjarvo joined #ruby
<Mahoru`Tsunemi>
in 1.8 or 1.9.3 nothing
<Mahoru`Tsunemi>
(the same error :) )
sdavis joined #ruby
<Mahoru`Tsunemi>
brb
<Tasser>
Mahoru`Tsunemi, then fix that require error
<fgro>
anyone, how to control the precision of number_field view helper? in my case the mapped table field is of type decimal. Do I have to tweak the table definition?
<fgro>
sorry wrong channel
<Mahoru`Tsunemi>
back
<Mahoru`Tsunemi>
Tasser: i'm not an ruby programmer, i tried to search on google how to fix but i don't found anything :/
raincole joined #ruby
senny joined #ruby
pHcF joined #ruby
robyurkowski joined #ruby
crankycoder joined #ruby
apeiros_ joined #ruby
<robotmay>
What's the best way to sort an array of Time objects?
rsampaio joined #ruby
<apeiros_>
robotmay: define 'best'
<apeiros_>
but array_of_times.sort # should work
<apeiros_>
sort! if you want it sorted in-place
<robotmay>
apeiros_: Well, any really :D Will give that a try (being lazy)
tomzx joined #ruby
emmanuelux joined #ruby
steph021 joined #ruby
moondiamond joined #ruby
Amirh joined #ruby
<deryl>
apeiros_: if i have a file that contains the definition for a Hash that I need to use, I'm told that 'load'ing that file will not import that such that I get Object.that_hash_i_imported - If I want to import that file and have the hash created, if 'load' doesn't do that and I get 'no such method or variable include' when I: include "#{APP_ROOT}/config/github.rb" what would I do?
<deryl>
Object not being the literal class, just an example. Its really TestReport
* deryl
is thoroughly confused
LockeVendetta joined #ruby
rippa joined #ruby
looopy joined #ruby
<LockeVendetta>
hi, does anyone know how can i avoid conflit on class C for class Foo? http://pastie.org/2914495
radmacd joined #ruby
becom33 joined #ruby
<becom33>
whats a good open source ruby IDE for linux ?
<Afal>
vim
<Afal>
well vim is more of a text editor but you get the idea
<becom33>
I know vim . im not much of a vim fan .. its kinda confusing
<workmad3>
Afal: bah, calling vim a 'text editor' is like calling a hurricane 'strong winds' :P
<workmad3>
becom33: vimtutor ;)
<workmad3>
LockeVendetta: make use of exact names for your constants, so use ::B::Foo and ::A::Foo instead of just Foo
bier|tp joined #ruby
bier joined #ruby
robyurkowski joined #ruby
<LockeVendetta>
workmad3: what it for some reason those constants are inside a lot of modules? there's no easy way to reference the constant to the current module?
<workmad3>
LockeVendetta: not if you want to make use of the methods using those constants in mixin methods
ankhers joined #ruby
jcromartie joined #ruby
<workmad3>
LockeVendetta: the problem you're basically hitting is that, once the method has been mixed into another class the scope used to look up the constant changes
<workmad3>
LockeVendetta: if you are using it a lot in a method, you can always store the constant in a local variable though - e.g. 'foo_class = ::A::Foo'
wyhaines joined #ruby
<LockeVendetta>
workmad3: exactly, it's just that having something like A::B::C::D::F doesn't look very pretty, but we want our code functional, not pretty ,right?
usultis_ joined #ruby
<workmad3>
LockeVendetta: we'd prefer both, but functional does trump pretty
<workmad3>
LockeVendetta: I would be tempted to investigate as to whether one of the nested class names could be changed to avoid the conflict though ;
<workmad3>
)
Jackneill joined #ruby
<LockeVendetta>
workmad3: as an example i have a set of modules where some of them have the class Client
moshef joined #ruby
ksinkar joined #ruby
Amirh joined #ruby
<Amirh>
hello world
<Amirh>
happy thanksgiving
Draco_ joined #ruby
thepix joined #ruby
RomD joined #ruby
jwmann joined #ruby
jwmann joined #ruby
jwmann joined #ruby
bozhidar` joined #ruby
jbpros joined #ruby
robyurkowski joined #ruby
<moshef>
what does Preference.get(:suggestions, 7).to_i mean?
<moshef>
it asks for the preference called suggestions, but the 7 means ?
KenSentMe joined #ruby
<KenSentMe>
Hi, i'm working on a Mac and have installed the mysql gem for connections to my XAMPP installed database. However i get this error message when i try to connect to the database: http://pastie.org/2914624
fai|safe joined #ruby
sepp2k1 joined #ruby
ikaros joined #ruby
<KenSentMe>
Anyone have an idea what i'm doing wrong?
<ankhers>
KenSentMe: are you using rails, or is this just a pure ruby project?
<KenSentMe>
For now it's just a pure Ruby project
beakerman joined #ruby
<KenSentMe>
btw, i'm a real ruby novice, so be gentle :)
axisys joined #ruby
jbpros joined #ruby
Axilla joined #ruby
<ankhers>
Well, by the given error, you are passing it four arguments, and it is expecting 0. I use postgres so I'm not entirely sure how to initialize a mysql database in ruby. I will see if I can find anything.
<KenSentMe>
ankhers: when i use real_connect i get this: NoMethodError: undefined method `real_connect' for Mysql:Class
Cervajz joined #ruby
fayimora joined #ruby
<KenSentMe>
I think it has something to do with the combination of ruby and xampp. Someone suggested installing the gem with env ARCHFLAGS="-arch x86_64", but that doesn't work either
dnyy joined #ruby
CannedCorn joined #ruby
Rango joined #ruby
<esparkman>
Happy Giving of Thanks day everyone!!!!
bwwrd joined #ruby
<ankhers>
That is american only.
pen joined #ruby
p0y_ joined #ruby
enikar joined #ruby
travisjeffery joined #ruby
looopy joined #ruby
moshef joined #ruby
DarkFoxDK joined #ruby
travisjeffery joined #ruby
abstrakt joined #ruby
csavola joined #ruby
tmart joined #ruby
rmoriz left #ruby
travisjeffery joined #ruby
j3r0m3__ joined #ruby
<moshef>
can i use c++ to add 1 to c?
<rippa>
c += 1
<moshef>
thats the ruby way?
<rippa>
yes
<moshef>
thanks
<terraUNDverra>
moshef: are you my woman
<moshef>
i dont have to def it before the loop right?
lkba joined #ruby
Amirh joined #ruby
<terraUNDverra>
moshef: are you my woman???????
<moshef>
am i?
<terraUNDverra>
yes, the love of my life
<Amirh>
is this right in ruby? i % 2
<Amirh>
like 3 % 2 = 1
<rippa>
yes
marcuspat joined #ruby
<apeiros_>
Amirh: you mean ==, right?
<Amirh>
rippa: undefined method `%' for nil:NilClass
<Amirh>
apeiros_: no
<apeiros_>
Amirh: that means you're doing nil % 2
<apeiros_>
Amirh: then no, you can't assign to an expression
<Amirh>
apeiros_: oh ok
<apeiros_>
x % y = 2 # <-- illegal
<apeiros_>
x % y == 2 # <-- comparison
fayimora joined #ruby
<apeiros_>
a single = always means assignment in ruby
<rippa>
apeiros_: x % y = 2 actually works
Jake232 joined #ruby
<rippa>
if x is defined
<rippa>
x % (y = 2)
tobym joined #ruby
<Amirh>
ruby forced me to define the array
<Amirh>
why?
p0y joined #ruby
<Amirh>
i think it's dynamic
<apeiros_>
*sob*, because dynamic means I can do whatever the fuck I please…
* apeiros_
off
<moshef>
terraUNDverra: im not a women ....
looopy joined #ruby
heftig joined #ruby
bwwrd joined #ruby
<workmad3>
Amirh: what array?
<workmad3>
I feel like I'm missing half a conversation here
<Amirh>
workmad3: I just wanted to set this : freq[0] = 1 but freq hasnt been apeared before in the code
marcuspat joined #ruby
<workmad3>
Amirh: then yes, you will need to create an array
<Amirh>
workmad3: why? ruby is supports dynamic typing
<workmad3>
Amirh: dynamic typing doesn't mean no typing
airhorns joined #ruby
<Amirh>
workmad3: so I always have to define arrays before using them?
<csavola>
Amirh: if a variable hasn't been seen before it defaults to a NillClass… which is not an array
<rippa>
*NilClass
<workmad3>
Amirh: you need to create an array before using it yes
<workmad3>
Amirh: otherwise, what are you using?
<Amirh>
but it's not like that for numbers
<Amirh>
workmad3: gedit
<rippa>
foo[3] could be something other than array
<rippa>
it could be a hash
<rippa>
with numeric keys
<Amirh>
rippa: sure it could be
<workmad3>
it could be an instance of my SuperArray class :)
gregorg joined #ruby
gregorg joined #ruby
<rippa>
with numbers it's teh same
<rippa>
a = 3
<rippa>
you just initialized a
<Amirh>
workmad3: I don't use an ide
<rippa>
a = []
<rippa>
you initialized empty array
<Amirh>
yeah
<workmad3>
Amirh: yeah... I meant, what object are you using if you don't create an array before using it :P
<workmad3>
Amirh: you could also do a = [1]
<Amirh>
workmad3: lol, an array!
iocor joined #ruby
<workmad3>
Amirh: except that you don't have an array.... so you're using nothing
<Amirh>
freq = Array.new
<Amirh>
dice.each do |item|
<Amirh>
<Amirh>
freq[item-1] += 1
<Amirh>
end
<Amirh>
I'm counting the frequency
<Amirh>
of each item
shaman42 joined #ruby
<workmad3>
Amirh: would it help if you knew that 'freq[0] = 1' is the same as doing 'freq.[]=(0, 1)'?
<workmad3>
Amirh: so if you haven't created an array, then you're calling a method on nil...
<Amirh>
workmad3: well that's great help!
<Amirh>
very true
<Amirh>
workmad3: I'm learning through koans. so I need time to get hang o the language
flippingbits joined #ruby
heldopslippers joined #ruby
michael_mbp joined #ruby
lorandi joined #ruby
Dangr_ joined #ruby
raincole joined #ruby
sdavis joined #ruby
crankycoder left #ruby
Guest78465 joined #ruby
looopy joined #ruby
emptyflask joined #ruby
p0y joined #ruby
goodieboy joined #ruby
deryl joined #ruby
dasfugufish joined #ruby
sdavis joined #ruby
jfredett joined #ruby
fayimora joined #ruby
moshef joined #ruby
nerded joined #ruby
ph^ joined #ruby
fff joined #ruby
<fff>
hi
btanaka joined #ruby
macmartine joined #ruby
mengu joined #ruby
Spockz joined #ruby
fff left #ruby
dasfugufish joined #ruby
densebits joined #ruby
densebits joined #ruby
mksm joined #ruby
densebits joined #ruby
mengu joined #ruby
mengu joined #ruby
r0bby joined #ruby
trivol joined #ruby
thecreators joined #ruby
Rafalski joined #ruby
<Rafalski>
i'm trying to do something like this results.collect{|r| r.@column.to_f} by passing in the column name of a table into a method.. can this be done?
a_a_g joined #ruby
<mksm>
r.send(:column_name) ?
savage- joined #ruby
<Rafalski>
as in? results.collect{|r| r.send(:column_name).to_f}
<Mon_Ouie>
r.send(column_name)
alextan joined #ruby
Y_Ichiro joined #ruby
<Rafalski>
you guys rock, thanks
<Rafalski>
have to read up on the .send
looopy joined #ruby
cbuxton joined #ruby
j3r0m3 joined #ruby
ebobby joined #ruby
codespec_ joined #ruby
jfredett joined #ruby
sdavis joined #ruby
codespectator joined #ruby
travisjeffery joined #ruby
Rango joined #ruby
Vendethiel joined #ruby
lkba joined #ruby
Pip joined #ruby
Draco_ joined #ruby
robotmay joined #ruby
terraUNDverra joined #ruby
lobo_d_b joined #ruby
lobo_d_b joined #ruby
acts_as_david joined #ruby
Draco_ joined #ruby
josephwilk joined #ruby
sdavis joined #ruby
mdel joined #ruby
michael_mbp_ joined #ruby
shadoi joined #ruby
emocakes joined #ruby
dasfugufish joined #ruby
ping-pong joined #ruby
scribble1 joined #ruby
sdavis joined #ruby
xol joined #ruby
goodieboy joined #ruby
codespectator joined #ruby
marcuspat joined #ruby
a_a_g joined #ruby
notbrent joined #ruby
Russell^^ joined #ruby
tommylommykins left #ruby
Manhose joined #ruby
sdavis joined #ruby
macabre joined #ruby
mengu joined #ruby
eldariof joined #ruby
tvo joined #ruby
petschbot joined #ruby
atmosx joined #ruby
ryanf joined #ruby
flippingbits joined #ruby
sdavis joined #ruby
swarles joined #ruby
apeiros_ joined #ruby
dzhulk joined #ruby
j3r0m3 joined #ruby
becom33 joined #ruby
kirun joined #ruby
jensn joined #ruby
EddieBluh joined #ruby
goodieboy joined #ruby
Indian joined #ruby
Morkel joined #ruby
eldariof joined #ruby
goodieboy joined #ruby
michael_mbp_ joined #ruby
iocor joined #ruby
incluye joined #ruby
eldariof joined #ruby
michael_mbp_ joined #ruby
becom33 joined #ruby
albemuth joined #ruby
Jake232 joined #ruby
LouisJB joined #ruby
acts_as_david joined #ruby
<Guest74776>
meter456
incluye_ joined #ruby
moshef joined #ruby
a_a_g joined #ruby
fayimora joined #ruby
atmosx left #ruby
<swarles>
is there a library to edit files in a .jar without unzipping it?
<csavola>
As far as I know there is no way to change an archive in place… you would have to extract the files being edited and put them back into the archive
j3r0m3 joined #ruby
grekko joined #ruby
savage- joined #ruby
xol joined #ruby
petschbot joined #ruby
Draco_ joined #ruby
ryanf joined #ruby
Rango joined #ruby
marcuspat joined #ruby
Araxia_ joined #ruby
fayimora joined #ruby
<swarles>
oh ok :<
tatsuya_o joined #ruby
Helius joined #ruby
dnyy joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
sdavis joined #ruby
lobo_d_b joined #ruby
lobo_d_b joined #ruby
LouisJB joined #ruby
acts_as_david joined #ruby
jay_zawrotny joined #ruby
Mahoek joined #ruby
Draco_ joined #ruby
jbw joined #ruby
workmad3 joined #ruby
jbpros joined #ruby
TheSeparateFirst joined #ruby
jwmann joined #ruby
s0ber_ joined #ruby
eldariof joined #ruby
statarb3 joined #ruby
statarb3 joined #ruby
Helius joined #ruby
michael_mbp_ joined #ruby
j3r0m3 joined #ruby
marcuspat joined #ruby
crassus joined #ruby
GreaseMonkey joined #ruby
crassus left #ruby
Targen joined #ruby
incluye joined #ruby
thone joined #ruby
tayy joined #ruby
<zastaph>
I put my database in myproject/data (also have myproject/lib) and then I run ruby -Ilib myproject.rb and from there db = SQLite3::Database.new "../data/my.sqlite" however it can't be found like that.. Should I do ruby -Ilib:data and then Database.new "mysqlite" or have other suggestion?`
jfredett joined #ruby
cyri_ joined #ruby
<apeiros_>
zastaph: -I is only for require and load
<apeiros_>
filepaths (which is what you use here) are relative to the working directory
<zastaph>
ah, yes "data/my.sqlite" seemed to work, thanks :)
<apeiros_>
correct :)
<zastaph>
perhaps its a bad idea to put my database inside the gem folder structure
stetho joined #ruby
xol joined #ruby
AllStruck joined #ruby
tmart joined #ruby
dzhulk1 joined #ruby
sepp2k joined #ruby
tatsuya_o joined #ruby
king313 joined #ruby
king313 joined #ruby
Zoxc joined #ruby
<Zoxc>
anyone know of a irc library which can send messages from another thread?
KevinSjoberg joined #ruby
mongrelion joined #ruby
<KevinSjoberg>
If I alias a method in Ruby, is it possible to fetch the method_name of which it's being aliased as?
flippingbits joined #ruby
bugz^ joined #ruby
Rango joined #ruby
<csavola>
KevinSjoberg: I don't think so as I think the implementation creates a copy of the method with the new name
sdavis joined #ruby
<KevinSjoberg>
csavola, Are you referring to the method called alias_method or alias now?
<csavola>
KenvinSjobeg: alias_method
sdavis joined #ruby
<csavola>
KevinSjoberg: that's how you can change the name of a method… create a new one but still access the old code under the aliased name
michael_mbp_ joined #ruby
<KevinSjoberg>
csavola, Yeah. But alias is just creating a reference to the other method right? Because __method__ will return the actual method not the alias.
sdavis joined #ruby
albemuth joined #ruby
michael_mbp_ joined #ruby
Knodi joined #ruby
minijupe joined #ruby
workmad3 joined #ruby
kartouch joined #ruby
Pip joined #ruby
alanp joined #ruby
<csavola>
KevinSjoberg: I can't find any reference to the implementation of the alias keyword… I would assume it functions the same as alias_method in that it makes a copy of the code it's just a guess though
<KevinSjoberg>
csavola, I see. Thanks for the input then :)
Pip joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
<csavola>
KevinSjoberg: I'm tinkering in rib at the moment will let you know what I find
<csavola>
Foo.new.bar and Foo.new.bar2 point to 2 separate methods
Pip joined #ruby
<csavola>
So I would assume that alias and alias_method both have the same behaviour… one is just a keyword while the other is a method
sdavis joined #ruby
sdavis joined #ruby
AllStruck left #ruby
sdavis joined #ruby
Pip joined #ruby
flippingbits joined #ruby
Malgorath joined #ruby
albemuth joined #ruby
rsampaio joined #ruby
lkb joined #ruby
<Malgorath>
Hi, just trying to install ruby using RVM, I do rvm install 1.9.2 and I get an error in the make part. Here is the log http://paste.ubuntu.com/748651
<csavola>
Malgorath: did you follow 'rvm requirements' ?