<adramalech>
i am trying to create methods that pass in two-dimensional arrays. I have declared 2d_array = Array.new(x, Array.new(y, 0)). I was wondering how can i verify size? and how to iterate over the 2d-array for say each element.
devoldmx has joined #ruby
cj3kim has quit [Remote host closed the connection]
Jalada has joined #ruby
marr has quit [Ping timeout: 264 seconds]
druonysuse has quit [Ping timeout: 252 seconds]
druonysuse has joined #ruby
druonysuse has quit [Changing host]
druonysuse has joined #ruby
Davey has joined #ruby
airlok has quit [Remote host closed the connection]
airlok has joined #ruby
airlok has quit [Remote host closed the connection]
richiebkr has quit [Quit: richiebkr]
axsuul has quit [Quit: axsuul]
arya has quit [Ping timeout: 248 seconds]
ivanoats has quit [Remote host closed the connection]
benlieb has joined #ruby
slash_nick has joined #ruby
slash_nick has quit [Changing host]
slash_nick has joined #ruby
yshh has quit [Remote host closed the connection]
MrZYX is now known as MrZYX|off
Asher has joined #ruby
moted has joined #ruby
vwoo has quit [Ping timeout: 276 seconds]
L8D has joined #ruby
RonScagz has joined #ruby
<L8D>
How can I use method_missing in order to make:
<L8D>
"Hello World"
<L8D>
becomes:
<L8D>
puts "Hello World"
ColKurtz has joined #ruby
<L8D>
As in have a method
dmiller has joined #ruby
<L8D>
method_missing for straight strings.
<L8D>
Or would that not work very well
hogeo has joined #ruby
bionhart has quit [Remote host closed the connection]
vwoo has joined #ruby
<heftig>
not possible
saarinen has quit [Quit: saarinen]
zeade has quit [Quit: Leaving.]
slash_nick has quit [Ping timeout: 256 seconds]
richiebkr has joined #ruby
freeayu has joined #ruby
wallerdev has quit [Quit: wallerdev]
tkuchiki has joined #ruby
werdnativ has quit [Quit: werdnativ]
c0rn has quit [Quit: Computer has gone to sleep.]
ericmathison has quit [Quit: Lost terminal]
richiebkr has quit [Client Quit]
wargasm has joined #ruby
druonysuse has quit [Quit: Konversation terminated!]
lunarjar has quit [Ping timeout: 251 seconds]
paranox has quit [Remote host closed the connection]
<L8D>
How can I create a hash object that contains a function? So I can then do something like: `myHash['functionname'](args)` ?
lunarjar has joined #ruby
astomp has quit [Quit: Computer has gone to sleep.]
mfollett has joined #ruby
zeade has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
adramalech has quit [Quit: leaving]
mfollett has quit [Ping timeout: 255 seconds]
burlyscudd has quit [Remote host closed the connection]
saarinen has joined #ruby
benlieb has quit [Quit: benlieb]
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
ablemike has joined #ruby
bradhe has quit [Remote host closed the connection]
rickruby has joined #ruby
<ablemike>
I have a small sinatra app using datamapper and sqlite
<ablemike>
locally, when I create records, they are available throughout the app all the time. Even if I restart the app
<Godd2>
I'm writing a simple sentence generator to learn the basics of Ruby and Object Oriented Programming. Is it bad to have 59 classes? It's broken down like this: https://gist.github.com/nicklink483/5779186
tw1sted has joined #ruby
<Godd2>
I just wanted to know if I'm going in a completely wrong direction or if that's okay.
<davidcelis>
smells like abusing inheritance
saarinen has joined #ruby
blitzkev has joined #ruby
quazimodo has joined #ruby
<Godd2>
okay thank you davidcelis Im reading up inheritance abuse now
rezzack has quit [Quit: Leaving.]
generalissimo has quit [Remote host closed the connection]
blitz has quit [Ping timeout: 252 seconds]
sevenseacat has joined #ruby
blitzkev is now known as blitz
Opettaja has quit [Quit: WeeChat 0.4.1]
kofno_ has quit [Remote host closed the connection]
<pontiki>
do all those classes have clearly distinct behaviours?
<pontiki>
that looks fine for a taxonomy
<pontiki>
but awful for a class hierarchy
dhruvasagar has joined #ruby
Michae___ has quit [Remote host closed the connection]
alvaro_o has quit [Quit: Ex-Chat]
buzzybron has joined #ruby
Michae___ has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
Opettaja has joined #ruby
kofno has joined #ruby
<Godd2>
Well a Syntax is an ordered list of Word objects, and each of those have a part of speech which dictates what they can be next to. So am I correct in saying that "what it's next to" is a 'behavior' in the sense you're asking?
Michae___ has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
<pontiki>
not particularly
Michae___ has joined #ruby
<pontiki>
that's a relationship, not a behaviour
viszu has quit [Quit: Leaving.]
<pontiki>
a behaviour in the sense i'm thinking would be (to pick just one example) changing a SingularNoun into a PluralNoun
<pontiki>
but i wouldn't create two classes to do that, personally
<pontiki>
these things are strings, and the type of thing they are could simply be an attribute of that
<pontiki>
the taxonomy could be stored as a structure
adkron has joined #ruby
<pontiki>
and a particular string taxonomy attribute could be a pointer into this structure
<pontiki>
it would probably be useful if each node in the taxonomy structure had a pointer to it's parent, and a collection of children
<Godd2>
ok then Ill read up on structures right now
paissad_ has quit [Quit: This computer has gone to sleep]
dhruvasagar has quit [Ping timeout: 264 seconds]
<Godd2>
when you say structure, do you mean a Struct?
<pontiki>
i was being more generic than that
nezumi has quit [Ping timeout: 276 seconds]
paissad_ has joined #ruby
<pontiki>
you could use Struct to create each taxonomy node, for example, and assemble it into a hash
<pontiki>
so, in your case, you could create the :name, :parent, and :children similarly, as different data structures inside the TaxonomyNode
<pontiki>
then you taxonomy is a collection and hierarchive of TaxonomyNodes
<Godd2>
Ill have to come back to that once Ive read up on what a Struct is
<pontiki>
Struct is a class that creates new classes
<Godd2>
but thank you very much for showing me where to look :)
<Godd2>
Trust me, you don't want me trying to learn a whole new concept from you, haha
arya_ has joined #ruby
<Godd2>
I ask a lot of annoying and pedantic questions and Ill do way better just reading it :P
<pontiki>
yes you will
kofno has quit [Remote host closed the connection]
arya has quit [Ping timeout: 248 seconds]
n_blownapart has joined #ruby
lewix has quit [Remote host closed the connection]
lewix has joined #ruby
cburyta has joined #ruby
lewix has quit [Read error: Connection reset by peer]
lewix has joined #ruby
vlad_starkov has joined #ruby
<Godd2>
Why don't you just put attr_reader :stuff, :and, :nonsense instead of inheriting from that Struct.new ?
cburyta has quit [Ping timeout: 256 seconds]
<n_blownapart>
hi I added this code/gem to deploy a barebones rails app on heroku (from tutorial)...later added the 'thin' gem to no avail. getting errors. any ideas? thanks: http://pastie.org/8041321
<sevenseacat>
what are the errors?
vwoo has joined #ruby
<n_blownapart>
shit one sec sevenseacat
splittingred has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
Cyrus has joined #ruby
jonahR has joined #ruby
prsn has quit [Ping timeout: 256 seconds]
prsn has joined #ruby
sambao21 has joined #ruby
burlyscudd has joined #ruby
burlyscudd has joined #ruby
Asher1 has joined #ruby
Michae___ has quit [Remote host closed the connection]
tommyvyo has quit [Quit:]
lewix has quit [Remote host closed the connection]
mikepack has joined #ruby
Michae___ has joined #ruby
Taranis has quit [Read error: Operation timed out]
<n_blownapart>
sevenseacat: sorry I need to figure out whats going on. I was working on it last night. pax
Asher has quit [Ping timeout: 260 seconds]
nomenkun has joined #ruby
Michae___ has quit [Remote host closed the connection]
<Godd2>
ok, pontiki so you're suggesting I have a list of the classes I want to construct, and then cycle through that list and create a Struct for each one? Or am I a little off?
Michae___ has joined #ruby
<pontiki>
nooooooo....
mikepack has quit [Remote host closed the connection]
<pontiki>
you only need one class for all the taxonomy nodes
io_syl has quit [Ping timeout: 240 seconds]
OnyxDragoon has joined #ruby
<pontiki>
let me throw a little gist up
wsterling has quit [Remote host closed the connection]
bradhe has joined #ruby
burlyscudd has quit [Ping timeout: 276 seconds]
mansi has quit [Remote host closed the connection]
scrollback has joined #ruby
wmoxam has quit [Ping timeout: 252 seconds]
mansi has joined #ruby
freerobby has quit [Quit: Leaving.]
i_s has joined #ruby
johnrlive has joined #ruby
Taranis has joined #ruby
<Godd2>
and if taxonomy is a new Taxonomy with (:top, nil, []), what do I do with all the children?
zeade has joined #ruby
<davidcelis>
i'm just gonna interject here
<davidcelis>
because this seems like a GOD AWFUL project to use for learning ruby
<davidcelis>
are you a linguist? because english is fuggin' hard. and dumb. :(
<davidcelis>
i'd really suggest you find something else to get started with ruby and OOP
bradhe has quit [Ping timeout: 245 seconds]
<davidcelis>
Godd2: perhaps Practical Object-Oriented Design with Ruby? people seem to love that book
<Godd2>
My grasp of proper syntax in the English language is fine, I just have no idea how the underlying structure of my program should look to support the behavior of syntax generation.
<sevenseacat>
its a good book.
<davidcelis>
Godd2: i can give you an idea of how it would look
johnrlive has quit [Read error: Operation timed out]
<davidcelis>
because english has so many edge cases
<davidcelis>
and exceptions to rules
mansi has quit [Ping timeout: 268 seconds]
<davidcelis>
even making a library for pluralization and singularization in ruby is hard
<davidcelis>
look at ActiveSupport::Inflector for godsake, they totally flunked it
freerobby has joined #ruby
<davidcelis>
sure they may have meant well
Sherwyn has quit [Remote host closed the connection]
<Godd2>
I suppose I should have simplified what I'm working on to learn about it from a basic standpoint and then extend it later when Im comfortable with that level of abstraction
<davidcelis>
adding some exceptions here and there
freerobby has quit [Client Quit]
<davidcelis>
but now they've got themselves a goddamned plate of spaghetti
<davidcelis>
and the spaghetti isn't good, Godd2
<davidcelis>
it's old
<davidcelis>
and stale
<davidcelis>
and there's really no sauce to speak of
<n_blownapart>
you still sevenseacat ?
<n_blownapart>
on*
<Godd2>
I think my problem is that Im trying to do too much at once
<Godd2>
Ill scale back and then come back if I have a problem with a simpler scheme.
<sevenseacat>
cool so i guess you're trying to use sqlite in dev and postgres only in production? in that case, you should run bundle --without production
saarinen has joined #ruby
<davidcelis>
that tutorial uses sqlite
<sevenseacat>
davidcelis: yes but it deploys to heroku :p
<davidcelis>
ah
RORgasm has quit [Read error: Operation timed out]
<davidcelis>
yeah, do what sevenseascat says
<sevenseacat>
davidcelis: i am still not scat
<n_blownapart>
I cant get that far it doesn't like bundle update
<n_blownapart>
the without production tag comes next ^^
<sevenseacat>
i wouldnt be running bundle update
uxp has joined #ruby
yacks has quit [Ping timeout: 268 seconds]
<n_blownapart>
oh just by pass it? sevenseacat
vwoo has quit [Quit: Computer has gone to sleep.]
yacks has joined #ruby
<n_blownapart>
sevenseacat: shit how did you determine that?
rgrinberg has joined #ruby
<sevenseacat>
from seeing that error numerous times before :p
<n_blownapart>
thanks the odd thing is I don't see the pg gem listed is that because of the tag?
<n_blownapart>
sevenseacat: ^^
<sevenseacat>
well yeah, you don't want that gem installed in development.
khushildep has joined #ruby
khushildep has quit [Client Quit]
<n_blownapart>
please elaborate. That gem is strictly used during deployment?
khushildep has joined #ruby
<sevenseacat>
yes. you're using sqlite as your database in development, and then deploying to heroku which uses postgres as its database
<sevenseacat>
i do not condone this behaviour, i would prefer that it directed to use postgres in all environments, but hey
<n_blownapart>
sevenseacat: thanks. I don't understand why the tutorial didn't walk me through that.
<sevenseacat>
no idea. that tutorial's been rewritten a couple times since i followed it and i dont like the direction it's gone, I don't generally recommend it to people.
<n_blownapart>
dang. sevenseacat what do you recommend?
<n_blownapart>
sweet sevenseacat I'll check it out thanks !
<sevenseacat>
np
nomenkun has quit [Remote host closed the connection]
crankyco_ has joined #ruby
corehook_ has joined #ruby
mbytes has joined #ruby
girija has joined #ruby
crankyco_ has quit [Ping timeout: 240 seconds]
hakunin has quit [Read error: Connection reset by peer]
<n_blownapart>
sevenseacat: hey one more thing if you have time. Is that book appropriate for someone with a moderate comprehension of ruby ( I went through the Well Grounded Rubyist book)
hakunin has joined #ruby
<sevenseacat>
i would think so
khushildep has quit [Quit: khushildep]
<n_blownapart>
thanks
Domon has quit [Remote host closed the connection]
saarinen has quit [Quit: saarinen]
ner0x has quit [Quit: Leaving]
crankyco_ has joined #ruby
jesly has quit [Ping timeout: 240 seconds]
bigmac has quit [Read error: Connection reset by peer]
mansi has joined #ruby
vlad_starkov has joined #ruby
jojosiao has quit [Ping timeout: 250 seconds]
poincare1011 has quit [Ping timeout: 252 seconds]
tommyvyo has joined #ruby
binw_ has joined #ruby
crankyco_ has quit [Ping timeout: 276 seconds]
pootler__ has quit [Ping timeout: 256 seconds]
Solnse has joined #ruby
ivanoats has quit [Remote host closed the connection]
mansi has quit [Remote host closed the connection]
pootler_ has quit [Ping timeout: 264 seconds]
vlad_starkov has quit [Ping timeout: 252 seconds]
mansi has joined #ruby
corehook__ has joined #ruby
werdnativ has joined #ruby
binw__ has quit [Ping timeout: 256 seconds]
Jackneill has joined #ruby
Jackneill has joined #ruby
kenneth has quit [Quit: kenneth]
corehook_ has quit [Ping timeout: 252 seconds]
mansi has quit [Ping timeout: 252 seconds]
byprdct has joined #ruby
generalissimo has joined #ruby
jesly has joined #ruby
tommyvyo has quit [Quit:]
johnrlive has joined #ruby
jhn has joined #ruby
adkron has quit [Ping timeout: 276 seconds]
ivanoats has joined #ruby
johnrlive has quit [Read error: Operation timed out]
Davey has quit [Quit: Computer has gone to sleep.]
cofin has quit [Quit: cofin]
tommyvyo has joined #ruby
freakazoid0223 has quit [Ping timeout: 252 seconds]
kenneth has joined #ruby
jojosiao has joined #ruby
sayan has joined #ruby
lyanchih has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
Davey has joined #ruby
Nisstyre has quit [Quit: Leaving]
i_s has quit [Quit: i_s]
m_3 has quit [Ping timeout: 256 seconds]
kenneth has quit [Quit: kenneth]
mduvall has quit [Quit: mduvall]
huoxito has quit [Quit: Leaving]
tw1sted has quit [Quit: tw1sted]
jalcine_ has joined #ruby
Michae___ has quit [Remote host closed the connection]
nomenkun has joined #ruby
stonevil has joined #ruby
lewix has joined #ruby
timkohrumel has quit [Remote host closed the connection]
arubin has quit [Ping timeout: 246 seconds]
wallerdev has quit [Quit: wallerdev]
splittingred has quit [Quit: splittingred]
atno has joined #ruby
ehaliewicz has joined #ruby
tommyvyo has quit [Quit:]
davetherat has joined #ruby
dankest has joined #ruby
Opettaja has quit [Quit: WeeChat 0.4.1]
eldariof has quit [Ping timeout: 264 seconds]
jalcine_ is now known as jalcine
Hanmac1 has joined #ruby
m_3 has joined #ruby
ivanoats has quit [Remote host closed the connection]
boblu has joined #ruby
rickruby has quit [Read error: No route to host]
codecop has joined #ruby
rickruby has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
wargasm has quit [Read error: Connection reset by peer]
arubin has joined #ruby
eldariof has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
generalissimo has quit [Remote host closed the connection]
atno has quit [Ping timeout: 246 seconds]
c0rn has joined #ruby
DonRichie has joined #ruby
allure has joined #ruby
allure has quit [Changing host]
allure has joined #ruby
DomKM has quit [Quit: Leaving.]
syamajala has joined #ruby
devoldmx has quit [Ping timeout: 252 seconds]
rickruby_ has joined #ruby
rickruby has quit [Ping timeout: 252 seconds]
Domon has joined #ruby
Davey has joined #ruby
yshh has quit [Remote host closed the connection]
zacts has joined #ruby
vlad_starkov has joined #ruby
Davey has quit [Ping timeout: 260 seconds]
philcrissman_ has joined #ruby
andikr has joined #ruby
mansi_ has joined #ruby
vlad_starkov has quit [Ping timeout: 246 seconds]
Domon has quit [Remote host closed the connection]
pontiki has quit [Ping timeout: 246 seconds]
tagrudev has joined #ruby
Domon has joined #ruby
jesly has quit [Ping timeout: 245 seconds]
pontiki has joined #ruby
mansi_ has quit [Ping timeout: 252 seconds]
Domon has quit [Remote host closed the connection]
braoru has joined #ruby
Domon has joined #ruby
rickruby has joined #ruby
rickruby_ has quit [Ping timeout: 252 seconds]
Domon has quit [Remote host closed the connection]
ffio_ has quit [Ping timeout: 240 seconds]
syamajala has quit [Quit: leaving]
Domon has joined #ruby
aganov has joined #ruby
subbyyy has quit [Ping timeout: 252 seconds]
johnrlive has joined #ruby
axsuul has joined #ruby
mansi_ has joined #ruby
krz has joined #ruby
ananthakumaran has joined #ruby
philcrissman_ has quit [Remote host closed the connection]
johnrlive has quit [Read error: Operation timed out]
corehook__ is now known as corehook
yshh has joined #ruby
Leighton has left #ruby ["Leaving"]
apeiros has quit [Remote host closed the connection]
mansi_ has quit [Ping timeout: 240 seconds]
kobain has quit [Quit: l'unica verità.. è la morte stessa!]
BizarreCake has joined #ruby
timkohrumel has joined #ruby
jprovazn has joined #ruby
havenwood has joined #ruby
subbyyy_ has joined #ruby
scipi0 has quit [Ping timeout: 264 seconds]
timkohrumel has quit [Remote host closed the connection]
n_blownapart has quit [Remote host closed the connection]
danman has joined #ruby
danman has quit [Client Quit]
madhatter has joined #ruby
RORgasm has joined #ruby
dash_ has joined #ruby
yashshah has quit [Read error: Connection reset by peer]
ffio_ has joined #ruby
tomzx_mac has quit [Ping timeout: 252 seconds]
pootler_ has joined #ruby
pootler__ has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
yashshah has joined #ruby
TheNumb has quit [Read error: Connection reset by peer]
io_syl has joined #ruby
rickruby has quit [Ping timeout: 245 seconds]
RORgasm has quit [Ping timeout: 264 seconds]
atno has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
stkowski has quit [Quit: stkowski]
codesoda has joined #ruby
BizarreCake has quit [Read error: Connection reset by peer]
braoru has quit [Remote host closed the connection]
stonevil has quit [Remote host closed the connection]
robscomputer has joined #ruby
werdnativ has quit [Quit: werdnativ]
bionhart has quit [Remote host closed the connection]
adamholt has quit [Read error: Operation timed out]
Raboo has joined #ruby
braoru has quit [Read error: Operation timed out]
braoru has joined #ruby
lyanchih has quit [Ping timeout: 240 seconds]
Astralum has joined #ruby
adamholt has joined #ruby
epta has quit [Ping timeout: 252 seconds]
lunarjar has quit [Ping timeout: 260 seconds]
jimg has quit [Ping timeout: 256 seconds]
epta has joined #ruby
lunarjar has joined #ruby
burlyscudd has joined #ruby
bionhart has quit [Remote host closed the connection]
kloeri has quit [Remote host closed the connection]
kloeri has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
Zai00 has quit [Quit: Zai00]
nari has joined #ruby
burlyscudd has quit [Ping timeout: 240 seconds]
Zai00 has joined #ruby
sepp2k has joined #ruby
lyanchih has joined #ruby
Hobogrammer has quit [Read error: Connection reset by peer]
adambeynon has joined #ruby
Zai00 has quit [Read error: Connection reset by peer]
noname001 has joined #ruby
dankest has quit [Quit: Leaving...]
ivanoats has joined #ruby
dmiller has joined #ruby
yashshah has quit [Read error: Operation timed out]
timmow has joined #ruby
dmiller has quit [Read error: Operation timed out]
crankyco_ has joined #ruby
ivanoats has quit [Ping timeout: 240 seconds]
senayar_ has joined #ruby
vlad_starkov has joined #ruby
lolmaus has joined #ruby
ferdev has joined #ruby
Zai00 has joined #ruby
senayar has quit [Ping timeout: 240 seconds]
senayar_ has quit [Remote host closed the connection]
end_guy has quit [Ping timeout: 240 seconds]
crankyco_ has quit [Ping timeout: 246 seconds]
<lolmaus>
I've got a fairly large block of code with an `if foo` appended to the last `end`. https://gist.github.com/lolmaus/5780439 I'm worried that this if clause is difficult to notice when reading the code. But moving the if clause to the beginning will create another level of nesting, which will make code more complicated. Is there a recommended way to put the if clause to the beginning without creating
<lolmaus>
extra indentation and extra `end`?
mansi has joined #ruby
senayar has joined #ruby
obs has quit [Read error: No route to host]
obs has joined #ruby
johnrlive has joined #ruby
leonidlm has joined #ruby
<canton7>
the extra level of indentation isn't that bad, and indeed makes it clearer that there's exception handling going on
nomenkun has joined #ruby
ferdev has quit [Read error: Connection reset by peer]
ferdev has joined #ruby
johnrlive has quit [Read error: Operation timed out]
<canton7>
lolmaus, use 2-space indents to keep with the rest of your code (and general ruby style), but sure
corehook has joined #ruby
mansi has quit [Ping timeout: 276 seconds]
nomenkun has quit [Remote host closed the connection]
Nisstyre has quit [Read error: Connection reset by peer]
slainer68 has quit [Ping timeout: 245 seconds]
Alina-malina has quit [Read error: Connection reset by peer]
jimg has joined #ruby
slainer68 has joined #ruby
<lolmaus>
canton7, a dude from #ruby-lang suggested a cleaner variant that i was looking for: <yorickpeterse> lolmaus: you can just put a `return unless sass_code` at the very top
Nisstyre has joined #ruby
Alina-malina has joined #ruby
stonevil has quit [Remote host closed the connection]
stef_204 has joined #ruby
<canton7>
lolmaus, yeah I'm reading both channels. and yes that works unless you need the method to continue executing after that if statement, if sass_code isn't set
<lolmaus>
canton7, thank you. ^__^
jojosiao has quit [Quit: Page closed]
timonv has joined #ruby
slainer6_ has quit [Ping timeout: 252 seconds]
stonevil has joined #ruby
slainer68 has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
jimg has quit [Ping timeout: 252 seconds]
<ekarlso>
win 45
<mikecmpbll>
i prefer the if block statement.
Al__ has joined #ruby
pi3r has quit [Ping timeout: 252 seconds]
mklappstuhl has quit [Remote host closed the connection]
arya has quit [Ping timeout: 256 seconds]
jamesaxl has joined #ruby
corehook has quit [Read error: Connection reset by peer]
pandawarrior has joined #ruby
slainer68 has quit [Ping timeout: 240 seconds]
advorak has joined #ruby
benlieb has joined #ruby
yashshah has joined #ruby
artofraw has joined #ruby
ananthakumaran has quit [Ping timeout: 276 seconds]
<artofraw>
how would you measure unicorn vs webrick in development mode? using ab?
jhowarth has joined #ruby
benlieb has quit [Remote host closed the connection]
workmad3 has joined #ruby
benlieb has joined #ruby
darkc0met has quit [Changing host]
darkc0met has joined #ruby
darkc0met has joined #ruby
fixl has joined #ruby
ananthakumaran has joined #ruby
_Andres has joined #ruby
<nyuszika7h>
is there some one-liner way to sum an array's items? (just plain Ruby, not Rails)
slainer68 has joined #ruby
<nyuszika7h>
hmm, arr.reduce(:+) seems to work
sayan has joined #ruby
stonevil has quit [Remote host closed the connection]
arya has joined #ruby
maasha has joined #ruby
<maasha>
hi
arya has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Remote host closed the connection]
dangerousdave has joined #ruby
stonevil has joined #ruby
arya has joined #ruby
codeluggage has quit [Quit: Leaving...]
sammmmm has joined #ruby
slainer68 has quit [Ping timeout: 264 seconds]
nomenkun has joined #ruby
sammmmm has quit [Remote host closed the connection]
sammmmm has joined #ruby
slainer68 has joined #ruby
vx17_ has quit [Quit: leaving]
<maasha>
I want to run a external command "check_stuff" using system(). Now the check_stuff command can fail on its own and I catch that with .success? - but the output of check_stuff is a message to stdout and in the case this message says error - I want check_stuff to fail as well. Can this be done with the system() call somehow?
<maasha>
For the sake of the log file I would like to avoid two steps
Rizzle has quit [Read error: Connection reset by peer]
amedeiros has quit [Ping timeout: 256 seconds]
jimg has quit [Ping timeout: 252 seconds]
amedeiros has joined #ruby
horofox has joined #ruby
Rizzle has joined #ruby
Giorgio has quit [Ping timeout: 245 seconds]
lyanchih has joined #ruby
<quazimodo>
sevenseacat: nm :D
akemrir has joined #ruby
<quazimodo>
<- might be getting a job in usa to do rubies
b0oh has quit [Quit: Leaving.]
RORgasm has quit [Ping timeout: 276 seconds]
vlad_starkov has quit [Ping timeout: 240 seconds]
lyanchih has quit [Client Quit]
RonScagz has joined #ruby
lyanchih has joined #ruby
amedeiros has quit [Ping timeout: 260 seconds]
agjacome has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
lyanchih has quit [Client Quit]
amedeiros has joined #ruby
agjacome has quit [Client Quit]
tkuchiki has quit [Remote host closed the connection]
corehook has quit [Read error: Connection reset by peer]
asellus has joined #ruby
himsin has joined #ruby
ananthakumaran has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
lyanchih has joined #ruby
a_a_g has joined #ruby
dhruvasagar has joined #ruby
b0oh has joined #ruby
ttt has quit [Remote host closed the connection]
BeLucid has joined #ruby
lkba has joined #ruby
Asher has quit [Ping timeout: 240 seconds]
amedeiros has quit [Ping timeout: 252 seconds]
amedeiros has joined #ruby
nettoweb has joined #ruby
horofox has quit [Quit: horofox]
ananthakumaran has quit [Quit: Leaving.]
tkuchiki has joined #ruby
ananthakumaran has joined #ruby
ybart has quit [Quit: ybart]
amedeiros has quit [Remote host closed the connection]
camilasan has quit [Remote host closed the connection]
amedeiros has joined #ruby
amedeiros has left #ruby [#ruby]
samuel02 has quit [Remote host closed the connection]
_JamieD_ has joined #ruby
corehook has joined #ruby
dhruvasagar has quit [Ping timeout: 268 seconds]
dhruvasagar has joined #ruby
camilasan has joined #ruby
pandawarrior has joined #ruby
LennyLinux has joined #ruby
workmad3 has quit [Read error: Operation timed out]
yashshah has joined #ruby
camilasan has quit [Remote host closed the connection]
a_a_g has quit [Quit: Leaving.]
corehook has quit [Read error: Connection reset by peer]
artofraw has left #ruby ["bb"]
scrollback has quit [Remote host closed the connection]
mixel has joined #ruby
jimg has joined #ruby
slainer6_ has joined #ruby
arya has quit [Ping timeout: 245 seconds]
nalaginrut has quit [Ping timeout: 276 seconds]
Lennier has quit [Quit: Lennier]
danslo has joined #ruby
burlyscudd has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Changing host]
pandawarrior has quit [Ping timeout: 276 seconds]
tkuchiki has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 276 seconds]
tkuchiki has joined #ruby
gyre007 has joined #ruby
jimg has quit [Ping timeout: 264 seconds]
gildo has joined #ruby
<nyuszika7h>
what's the best way to initialize class instance variables to nil?
Al__ has quit [Quit: Al__]
L8D has quit [Read error: Connection reset by peer]
mikecmpbll has quit [Quit: Computer has gone to sleep.]
arya has joined #ruby
Gues_____ has joined #ruby
Gues_____ is now known as Guest89034
burlyscudd has quit [Ping timeout: 246 seconds]
ayaz has quit [Ping timeout: 256 seconds]
aspiers has quit [Ping timeout: 256 seconds]
ivanoats has joined #ruby
<ericmathison>
nyuszika7h: aren't class instance variables nil by default or am i missing something?
<nyuszika7h>
oh, they are?
<nyuszika7h>
I forgot, thanks for reminding me
<ericmathison>
yeah
<apeiros>
nyuszika7h: class X; @var = nil
jonahR has quit [Quit: jonahR]
<apeiros>
ericmathison: all ivars are autovivified to nil, they are however NOT defaulted to nil (that'd require a declaration, which ruby does not have)
<apeiros>
i.e. if you run ruby with -w, accessing an undefined ivar will resolve to nil, but print a warning
pandawarrior has joined #ruby
nerdman has joined #ruby
<nyuszika7h>
apeiros: will a "@socket.nil?" check raise a warning too?
<ericmathison>
apeiros: ok. thanks for clarifying
lyanchih has quit [Ping timeout: 264 seconds]
h8R has joined #ruby
ivanoats has quit [Ping timeout: 260 seconds]
<apeiros>
nyuszika7h: warnings are not raised
<apeiros>
they simply get printed
<nyuszika7h>
whatever
camilasan has joined #ruby
<nyuszika7h>
prined
<nyuszika7h>
printed
<apeiros>
and yes, all read access to an undefined ivar will
Al__ has joined #ruby
ayaz has joined #ruby
Al__ has quit [Client Quit]
boblu has joined #ruby
ravster has left #ruby [#ruby]
jimg has joined #ruby
alexwh has joined #ruby
mansi has joined #ruby
kasper_ has joined #ruby
blitz has quit [Quit: This computer has gone to sleep]
<nyuszika7h>
is TCPSocket.open just an alias for TCPSocket.new?
johnrlive has quit [Read error: Operation timed out]
<canton7>
nyuszika7h, With no associated block, IO.open is a synonym for ::new. If the optional code block is given, it will be passed io as an argument, and the IO object will automatically be closed when the block terminates. In this instance, ::open returns the value of the block.
<ghr>
Lennier you haven't defined what performer is
<ghr>
try
<ghr>
puts ticket1.sendtest(:performer)
<ghr>
or
<ghr>
puts ticket1.sendtest('performer')
<ghr>
either of those should work for you
timmow has joined #ruby
<Lennier>
ghr: thanks! it worked
dhruvasagar has quit [Ping timeout: 264 seconds]
<ghr>
:)
<shambat>
I have a quick question about the rails console. I'm trying to perform a simple iteration: e.each { |x| puts x.name }, which works fine, except it also prints the whole "e" object afterwards. This makes it hard to read the actual printout I want to perform. What am I doing wrong?
<Lennier>
that's great
samuel02 has joined #ruby
<ghr>
You were trying to pass an undefined variable as a method argument
hogeo has quit [Remote host closed the connection]
<ghr>
Lennier in the method you're calling puts, not returning the string
atno has quit [Ping timeout: 268 seconds]
BizarreCake has quit [Quit: Leaving]
burlyscudd has quit [Ping timeout: 252 seconds]
TIJ has quit [Quit: Konversation terminated!]
verto has joined #ruby
TIJ has joined #ruby
myappleguy has quit [Quit: Leaving.]
<Lennier>
ghr: thanks, that was it!
jimg has quit [Ping timeout: 264 seconds]
ldnunes has joined #ruby
dmyers_ has joined #ruby
<ghr>
:)
kasper_ has quit [Remote host closed the connection]
crankyco_ has joined #ruby
kasper_ has joined #ruby
advorak has quit [Quit: Leaving.]
girija has joined #ruby
myappleguy has joined #ruby
sevenseacat has left #ruby [#ruby]
ivanoats has joined #ruby
dEPy has joined #ruby
bamorim has joined #ruby
dmyers has quit [Ping timeout: 264 seconds]
dmyers_ is now known as dmyers
bamorim is now known as bdornellas
postmodern has quit [Quit: Leaving]
gyre007 has quit [Remote host closed the connection]
Guest58710 is now known as zai
bdornellas has quit [Client Quit]
lkba has joined #ruby
boblu has quit [Ping timeout: 245 seconds]
ivanoats has quit [Ping timeout: 264 seconds]
gyre007 has joined #ruby
mansi has joined #ruby
horofox_ has quit [Quit: horofox_]
advorak has joined #ruby
skasio has quit [Ping timeout: 240 seconds]
<nyuszika7h>
how can I prevent a child thread from exiting when the main thread reaches its end? http://ix.io/69T/ruby
johnrlive has joined #ruby
sailias has quit [Ping timeout: 264 seconds]
pen has quit [Read error: Connection reset by peer]
<canton7>
nyuszika7h, make the main thread wait for the child thread
<canton7>
do you really want that thread, though?
<nyuszika7h>
yes
<nyuszika7h>
it's the read loop of my IRC bot
pen has joined #ruby
<nyuszika7h>
when that thread exits, the main program exits too and the connection dies
skasio has joined #ruby
<canton7>
most IRC bot read/write loops are implemented with Kernel#select
geekbri has joined #ruby
<nyuszika7h>
oh?
johnrlive has quit [Read error: Operation timed out]
<nyuszika7h>
I'll look into it, thanks
threesome has quit [Quit: Leaving]
BSaboia has joined #ruby
<ccooke>
canton7: some are threaded
<nyuszika7h>
anyway, a workaround I've found is "rloop = Thread.new { ... }", then sending messages, then "rloop.join" - although this will probably block after sending messages
<canton7>
single-threaded, Kernel#select blocks until data is received from the socket, stdin, etc, then takes appropriate action and goes back to waiting
<canton7>
ccooke, some are, but they're developed by people who are more familiar with threads
<canton7>
nyuszika7h, that's the solution, not just a workaround
<nyuszika7h>
it is?
<ccooke>
canton7: yeah.
<nyuszika7h>
but will it work if I need to make the bot send messages later?
<nyuszika7h>
oh wait, I'll make it send them inside the thread
<nyuszika7h>
so, never mind me :P
<ccooke>
canton7: I find that Ruby has vastly increased my familiarity with threads
<canton7>
then you need to be waiting for stdin input, rather than the child thread
<ccooke>
canton7: which is a bugger when I have to code in perl, I can tell you
<canton7>
ccooke, haha, sounds painful
b0oh has joined #ruby
mansi has quit [Ping timeout: 264 seconds]
<ccooke>
canton7: perl threading works, and it's high performance and can be a great solution, especially taking the habits I've built using Ruby. But ugh, it's painful :-)
rockets has joined #ruby
Giorgio has joined #ruby
chattmatt has joined #ruby
boblu has joined #ruby
zastern has quit [Ping timeout: 246 seconds]
osvico has quit [Ping timeout: 245 seconds]
ToApolytoXaos has joined #ruby
jamesaxl has quit [Ping timeout: 260 seconds]
yshh has joined #ruby
Giorgio has quit [Ping timeout: 268 seconds]
tonini has quit [Ping timeout: 248 seconds]
RORgasm has joined #ruby
devoldmx3 has joined #ruby
tonini has joined #ruby
RORgasm has quit [Read error: Operation timed out]
devoldmx has quit [Ping timeout: 264 seconds]
kenneth has quit [Ping timeout: 252 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
niceguyjames has joined #ruby
niceguyjames has quit [Client Quit]
camilasan has quit [Remote host closed the connection]
mark_locklear has joined #ruby
freeayu has quit [Ping timeout: 252 seconds]
brbcoding has joined #ruby
avril14th has joined #ruby
ctp_ has joined #ruby
advorak has quit [Quit: Leaving.]
Evropi has joined #ruby
kristiandelay has joined #ruby
<Evropi>
hey there, if I'm using a gem, do I need to require it in main or can I require it in other files in the work
<Evropi>
I require those with require_relative
<Evropi>
do I need to also require gems in main
skasio has quit [Read error: Operation timed out]
samuel02 has quit [Ping timeout: 264 seconds]
ctp has quit [Ping timeout: 252 seconds]
skasio has joined #ruby
adkron has joined #ruby
devoldmx3 has quit [Ping timeout: 264 seconds]
_Andres has joined #ruby
subbyyy_ has joined #ruby
atno has joined #ruby
pandawarrior has joined #ruby
camilasan has joined #ruby
bamdad has quit [Quit: bamdad]
BSaboia has quit [Ping timeout: 264 seconds]
niceguyjames has joined #ruby
burlyscudd has joined #ruby
burlyscudd has quit [Changing host]
burlyscudd has joined #ruby
<nyuszika7h>
why isn't this code working as intended? if line =~ /^PING / then client.send("PONG #{line.sub('^PING (.+)$', '\1')}") end
<nyuszika7h>
also, is regex faster than split+slice or the other way around?
Macaveli has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
atmosx has quit [Quit: And so the story goes…]
<ccooke>
regex is expensive. But that only matters if you're doing lots of them in a second
girija has quit [Ping timeout: 276 seconds]
ctp_ has quit [Read error: Operation timed out]
burlyscudd has quit [Ping timeout: 276 seconds]
vlad_starkov has joined #ruby
machuga is now known as machuga|away
<buzzybron>
regex sucks imo, avoid it if you can
<Evropi>
indeed
<Evropi>
so will anyone answer my question ;_;
gildo has quit [Ping timeout: 252 seconds]
Squarepy has joined #ruby
stonevil_ has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
<avril14th>
Evropi: requiring as many places as you need is no different
<avril14th>
it will just ensure you that it is loaded
<Evropi>
okay
<Evropi>
it just sounds expensive, that's all
<Evropi>
so I'd rather not load everywhere
<avril14th>
I might be wrong but I don't think it is
jinie is now known as jinie_
devoldmx has joined #ruby
<avril14th>
there's a unless loaded mechanism I think
<avril14th>
so it's not expensive
<avril14th>
but I might be wrong
<Evropi>
hmm yeah I could certainly do that, thanks
<avril14th>
Evropi: I think it's included
mansi_ has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
<avril14th>
Evropi: IIRC is just a load with a check whether it was previously loaded
<buzzybron>
whats your question again? sorry... drunk here try my best to help
<Evropi>
buzzybron: when requiring a gem
<Evropi>
do I need to just require them all in main
synthetix has quit [Read error: Operation timed out]
<Evropi>
or do I need to require them in other modules in different files too
corehook has joined #ruby
<Evropi>
it's not really for the expense to be fair, it's just a pain in the ass as there are dozens of files here
jimg has joined #ruby
F1skr has quit [Quit: WeeChat 0.4.1]
<nyuszika7h>
#python tells me to use regex, #ruby tells me to avoid it... seems legit.
<buzzybron>
Evropi : question of how you want to build your app and what mods/lib we are talking about
<buzzybron>
i mean if it's a web app, you might wanna just keep the sessions/db libs loaded in the main
carloslopes has joined #ruby
<Evropi>
buzzybron: cinch framework, to build an IRC bot
pen has quit [Read error: No route to host]
<buzzybron>
and then the rest loaded as we need them like maybe paging and stuff
pen has joined #ruby
<Evropi>
so it isn't global
<Evropi>
there will be no threading magic in this
<buzzybron>
so you might wanna build your app and load all the shit in one place, then slowly refactor it and see where it is possible to load in file or in main, i mean no point over thinking it right now
<dominikh>
(saying there will be no threading magic while using Cinch is a bit of a long stretch, but okay :>)
Lubinski has joined #ruby
jimg has quit [Ping timeout: 268 seconds]
<buzzybron>
hope you understand what i'm saying, no point brooding over where to load your libs just yet
adkron has quit [Ping timeout: 260 seconds]
iamjarvo1 has joined #ruby
iamjarvo1 has quit [Client Quit]
ivanoats has joined #ruby
<Evropi>
I see, thanks
<buzzybron>
hope you understand whats my point
iamjarvo_ has joined #ruby
<Evropi>
yeah, I'll just put them all in main, most likely they will work. If they don't, just add them elsewhere
<buzzybron>
so there are certain libs, that you will def wanna load in your main, and then some which are loaded where and when you need them, refactor refactor refactor
<Evropi>
so basically, if they are not called in main, don't require them in main?
_JamieD_ has quit [Quit: _JamieD_]
Asher has quit [Quit: Leaving.]
razi has joined #ruby
<buzzybron>
lol, hmm just code, and go back and refactor
krawchyk has joined #ruby
<Evropi>
ah. okay, thanks :D
krz has quit [Quit: krz]
<buzzybron>
have fun
chattmatt has quit [Quit: chattmatt]
ivanoats has quit [Ping timeout: 276 seconds]
DaniG2k has quit [Quit: Leaving.]
<Evropi>
cheers
crankyco_ has quit [Read error: Connection reset by peer]
erry is now known as evilerry
crankyco_ has joined #ruby
sailias has joined #ruby
maasha has quit [Quit: Page closed]
johnmlocklear_ has joined #ruby
mark_locklear has quit [Ping timeout: 268 seconds]
mklappstuhl has joined #ruby
mklappst_ has quit [Read error: Connection reset by peer]
<buzzybron>
cheers
evilerry is now known as erry
mljsimone|away is now known as mljsimone
johnrlive has joined #ruby
sethetter has joined #ruby
johnrlive has quit [Read error: Operation timed out]
milardovich has joined #ruby
corehook has quit [Read error: Connection reset by peer]
<trr_>
canton7: I get TypeError: can't convert String into Integer
freeayu has joined #ruby
<canton7>
oops, ["0AFF".hex].pack("V")
bamdad has joined #ruby
<trr_>
now I get "\377\n\000\000"
<wuest>
That's correct.
<wuest>
0x0a is a newline
himsin has left #ruby [#ruby]
<wuest>
See man 7 ascii
<canton7>
the 377 is octal isn't it
<canton7>
that or asciitable.com
<trr_>
thankyou so much wuest and canton7 :)
<wuest>
Yes
ferdev has quit [Ping timeout: 264 seconds]
[Fudge] is now known as nope
nettoweb has quit [Quit: nettoweb]
iamjarvo_ is now known as iamjarvo
LennyLinux has joined #ruby
synthetix has joined #ruby
redgirl has quit [Read error: Connection reset by peer]
<trr_>
ciao :)
camilasa_ has joined #ruby
trr_ has quit [Quit: leaving]
wmoxam has joined #ruby
camilasan has quit [Read error: No route to host]
redgirl has joined #ruby
* lupine
looks into rev
ferdev has joined #ruby
<Lennier>
guys, how can i change the application to use a newer version of a gem?
<Lennier>
i updated the builder gem
<Lennier>
but i see that, actionpack and activemodel are still using the old version
<Lennier>
how can i force them to use the updated version?
r0bgleeson has quit [Ping timeout: 252 seconds]
adkron has joined #ruby
Mattix has joined #ruby
<beilabs_>
remove the Gemfile.lock + do a bundle install
mansi_ has quit [Remote host closed the connection]
<beilabs_>
or gem update actionpack
blaxter has quit [Quit: foo]
blaxter has joined #ruby
mansi has joined #ruby
Mattix has quit [Remote host closed the connection]
Mattx has quit [Remote host closed the connection]
Mattix has joined #ruby
akells` has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
iamjarvo has quit [Quit: iamjarvo]
<Lennier>
beilabs: thanks a lot!
hoofed has joined #ruby
banghouse2 has joined #ruby
awarner has joined #ruby
awarner has quit [Remote host closed the connection]
awarner has joined #ruby
cmarques has joined #ruby
Michae___ has joined #ruby
banghouse2 is now known as banghouse
mansi has quit [Ping timeout: 264 seconds]
bamdad has quit [Quit: bamdad]
jinie_ is now known as jinie
generalissimo has joined #ruby
ivanoats has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
bamdad has joined #ruby
bamdad has quit [Client Quit]
scrollback has joined #ruby
huoxito has joined #ruby
Zai00 has quit [Read error: Connection reset by peer]
scrollback has quit [Remote host closed the connection]
scrollback has joined #ruby
jrajav has joined #ruby
fuzzyhorns has joined #ruby
denken has quit [Remote host closed the connection]
scottmey has joined #ruby
scrollback has quit [Remote host closed the connection]
scrollback has joined #ruby
Zai00 has joined #ruby
ivanoats has quit [Ping timeout: 252 seconds]
razi has quit [Ping timeout: 252 seconds]
Banistergalaxy has joined #ruby
esaym153 has joined #ruby
burlyscudd has quit [Remote host closed the connection]
wesside has joined #ruby
wesside has quit [Remote host closed the connection]
jlast has joined #ruby
AndChat| has quit [Ping timeout: 264 seconds]
tomzx_mac has joined #ruby
alx- has joined #ruby
_ffio_ has joined #ruby
akemrir has quit [Quit: WeeChat 0.4.1]
browndawg has joined #ruby
ffio_ has quit [Ping timeout: 240 seconds]
denken has joined #ruby
<esaym153>
what is the best way to have a short ruby script close after a certian period of time? I assume if I made a thread with a timer in it that called exit after x minutes then it would only just kill that thread?
ioNull has joined #ruby
predator117 has quit [Ping timeout: 252 seconds]
stonevil has quit [Remote host closed the connection]
predator117 has joined #ruby
nettoweb has joined #ruby
_Renegade has joined #ruby
fandikurnia01 has joined #ruby
nettoweb has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
BizarreCake has joined #ruby
stonevil has joined #ruby
khushildep_ has joined #ruby
khushildep has quit [Ping timeout: 268 seconds]
khushildep_ is now known as khushildep
DaniG2k has joined #ruby
johnnyfuchs has joined #ruby
tkuchiki has quit [Read error: Operation timed out]
Sherwyn has joined #ruby
v0n has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
lewix has quit [Remote host closed the connection]
RORgasm has joined #ruby
scrollback has quit [Remote host closed the connection]
nettoweb has joined #ruby
scrollback has joined #ruby
pen has quit [Remote host closed the connection]
nkr has quit [Ping timeout: 246 seconds]
jtharris has joined #ruby
dpritchett has joined #ruby
Sherwyn has quit [Remote host closed the connection]
Guest82036 has joined #ruby
vlad_starkov has joined #ruby
RORgasm has quit [Read error: Operation timed out]
stonevil has quit [Remote host closed the connection]
shadoi has joined #ruby
hamakn has joined #ruby
myappleguy has joined #ruby
cj3kim has joined #ruby
razi has joined #ruby
burlyscudd has joined #ruby
filipe has quit [Remote host closed the connection]
saarinen has joined #ruby
DaniG2k has quit [Quit: Leaving.]
saarinen has quit [Client Quit]
burlyscudd has quit [Client Quit]
bigoldrock has joined #ruby
arya_ has quit [Ping timeout: 264 seconds]
wmoxam has joined #ruby
ferdev_ has joined #ruby
ShapeShifter499 has joined #ruby
hoofed has quit [Remote host closed the connection]
ferdev has quit [Ping timeout: 240 seconds]
ferdev_ is now known as ferdev
cj3kim has quit [Ping timeout: 246 seconds]
johnmlocklear_ has quit [Quit: Leaving]
timkohrumel has quit [Remote host closed the connection]
Michae___ has joined #ruby
sayan has joined #ruby
arya has joined #ruby
devoldmx3 has quit [Ping timeout: 245 seconds]
devoldmx has joined #ruby
ferdev has quit [Ping timeout: 264 seconds]
burlyscudd has joined #ruby
stonevil has joined #ruby
RORgasm has quit [Ping timeout: 264 seconds]
ferdev has joined #ruby
v0n has quit [Ping timeout: 252 seconds]
synthetix has joined #ruby
fomatin has quit [Ping timeout: 268 seconds]
apeiros has joined #ruby
Michae___ has quit [Remote host closed the connection]
nope is now known as [Fudge]
hadees has joined #ruby
Michae___ has joined #ruby
Hien has joined #ruby
jtharris has quit [Quit: WeeChat 0.4.0]
slash_nick has joined #ruby
slash_nick has quit [Changing host]
slash_nick has joined #ruby
danslo has quit [Quit: danslo]
timonv has joined #ruby
Voodoofish430 has joined #ruby
apeiros has quit [Ping timeout: 256 seconds]
timonv_ has joined #ruby
noname001 has quit [Remote host closed the connection]
Michae___ has quit [Ping timeout: 252 seconds]
ghr has quit [Quit: Computer has gone to sleep.]
Shirakawasuna has quit [Ping timeout: 252 seconds]
khushildep_ has joined #ruby
axl_ has quit [Quit: axl_]
timonv has quit [Ping timeout: 256 seconds]
senayar_ has quit [Remote host closed the connection]
bionhart has joined #ruby
khushildep has quit [Ping timeout: 245 seconds]
khushildep_ is now known as khushildep
krawchyk has quit [Remote host closed the connection]
jonno11 has joined #ruby
AlbireoX has quit [Ping timeout: 246 seconds]
<jonno11>
Hi guys. I have a string "19882MB" and I want to get just the numbers. str[/[0-9]/] only returns "1". How can I get all the numbers?
sepp2k has quit [Quit: Leaving.]
arturaz has quit [Ping timeout: 268 seconds]
F1skr has joined #ruby
ivanoats_ has quit [Remote host closed the connection]
<Morrolan>
/[0-9]*/
rcsheets has joined #ruby
rcsheets has quit [Changing host]
heidar has joined #ruby
heidar has quit [Changing host]
bluehavana has quit [Changing host]
bluehavana has joined #ruby
robscomputer has quit [Changing host]
robscomputer has joined #ruby
tylersmith has joined #ruby
<terrellt>
So I just wrote something and it seems nice to me, but I want an opinion - https://gist.github.com/terrellt/5783296 . Is pushing the details of your connection into a method like that pretty standard?
<jonno11>
Morrolan: That returns nothing
Criztian has quit [Remote host closed the connection]
ferdev has quit [Ping timeout: 260 seconds]
<Morrolan>
>> "19882MB"[/[0-9]*/]
mklappstuhl has quit [Remote host closed the connection]
freeayu has quit [Remote host closed the connection]
Michae___ has joined #ruby
f0ster has quit [Remote host closed the connection]
jesly has quit [Ping timeout: 252 seconds]
stef_204 has joined #ruby
<aedorn>
terrellt: I don't see anything inherently wrong with what you have since it's pulling information from other points of references. Except the "preferred_record_syntax" but then it may not matter.
<terrellt>
That's a good point, I'll probably refactor that out into a method.
slainer6_ has quit [Remote host closed the connection]
jdunck has joined #ruby
i_s has quit [Quit: i_s]
blitz has joined #ruby
timmow has quit [Remote host closed the connection]
jtharris has joined #ruby
dagobah has quit [Remote host closed the connection]
jinie is now known as jinie_
sambao21 has quit [Quit: Computer has gone to sleep.]
Michae___ has quit [Remote host closed the connection]
cj3kim has joined #ruby
DomKM has quit [Quit: Leaving.]
Michae___ has joined #ruby
geggam has joined #ruby
jimg has joined #ruby
carloslopes has quit [Remote host closed the connection]
binaryplease has quit [Read error: Operation timed out]
takezawa has quit [Remote host closed the connection]
<fryguy>
& is the to_proc operator, which might be helpful to you as well
c0rn has joined #ruby
takezawa has joined #ruby
jdunck has quit [Ping timeout: 240 seconds]
<MrZYX>
describe your concrete usecase if you want a less generic advice
andikr has quit [Remote host closed the connection]
Guest50943 has quit [Changing host]
Guest50943 has joined #ruby
Guest50943 is now known as C0deMaver1ck
lewix has joined #ruby
rickruby has quit [Remote host closed the connection]
yacks has joined #ruby
dayepa has quit [Read error: Connection reset by peer]
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
echevemaster has quit [Read error: Operation timed out]
dayepa has joined #ruby
mljsimone|away is now known as mljsimone
<diddlybop>
MrZyx are you talking to me?
<MrZYX>
yes
jdunck has joined #ruby
<diddlybop>
ok ha, I'm using this gem among otehrs to parse and split up a pdf...i have just tried to set up my program on a new machine and am getting the following error:
kenneth has quit [Quit: kenneth]
saarinen has quit [Quit: saarinen]
sarkis has quit [Quit: leaving]
takezawa has quit [Ping timeout: 252 seconds]
<diddlybop>
"Unknown glyph width for 9 Helvetica"
Faris11 has joined #ruby
<diddlybop>
this is not an issue on other machines, i tried changing versions of the gem, still teh same error
<pellis>
i think the Ruby world accelerated insanely in the past 6 months - am I right?
keep has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<pellis>
i don't remember such a period of new stuff
<pellis>
at the last year or two at least
nomenkun has joined #ruby
JMcAfreak has quit [Quit: Leaving]
sethetter has joined #ruby
elaptics is now known as elaptics`away
marr has joined #ruby
<sethetter>
What's the difference in a Ruby class between using self.varname = something; and @varname = something; ?
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
<r0bgleeson>
sethetter: one calls a method to indirectly set @varname, one sets an instance variable directly
devoldmx3 has joined #ruby
mhahn has joined #ruby
zad0xsis has quit [Quit: Bye.]
fmcgeough has joined #ruby
jesly has quit [Quit: Leaving.]
<seitensei>
Anyone manage to get the NaCl version of Ruby to work?
<mhahn>
sorry, not really a ruby guy, but what is the best way to check the version of a ruby package within a script? if I want to ensure that it is within versions 1.2.5 and 1.3.5
rsahae_ has quit [Quit: rsahae_]
<Godd2>
and if you create the class from a Struct.new(:varname) you have to use self.varname since the Struct made the method for you.
<seitensei>
mhahn: You could use bundler
ravster has joined #ruby
<fryguy>
mhahn: try bundler
JMcAfreak has joined #ruby
jesly has joined #ruby
LennyLinux has joined #ruby
<mhahn>
fryguy: that is what i'm trying to check :)
<fryguy>
mhahn: if you are using bundler, update the gemfile for the gem dependency so that it has teh version range you want specified in it
Xeago has quit [Remote host closed the connection]
<sethetter>
r0bgleeson: Is there any advantage to using one over the other? Currently I'm using @varname for variables and self.method for method calls. Is that alright?
<pellis>
mhahn, you can create a vagrant box prepackaged with that bundler that you like
<mhahn>
pellis: i need bundler on the OS not vagrant, we're doing some stuff with librarian-puppet before we run provision
<r0bgleeson>
sethetter: exposing a setter & getter exposes internal state of your object, you should be careful about what state you're exposing in a public API. in a perfect world, methods would operate on a state, and you would never have a setter or getter.
skogis_ has quit [Quit: leaving]
<mhahn>
Godd2: i know how to get the version, and what I have for checking if the version is within the two I've tested works, I'm just wondering if there is a better way to do it that I'm not aware of
tw1sted has quit [Quit: tw1sted]
<Godd2>
mhahn: Oh Im not sure. It seems like a good idea to be asking Bundler what it's version is directly though, I would think.
jimg has quit [Ping timeout: 276 seconds]
<mhahn>
Godd2: yea that makes sense
Guest61929 is now known as fred
fred has joined #ruby
fred has quit [Changing host]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonathanwallace has quit [Quit: WeeChat 0.4.0]
arya has joined #ruby
jonathanwallace has joined #ruby
Neomex has joined #ruby
geekbri has quit [Remote host closed the connection]
Neomex has quit [Client Quit]
bionhart has quit [Remote host closed the connection]
icole has joined #ruby
pyrac has joined #ruby
DrShoggoth has joined #ruby
browndawg has quit [Quit: Leaving.]
mfollett has quit [Remote host closed the connection]
jtharris has quit [Quit: WeeChat 0.4.0]
hadees has quit [Quit: hadees]
pellis has quit [Quit: This computer has gone to sleep]
crankyco_ has quit [Remote host closed the connection]
hadees has joined #ruby
vwoo has quit [Ping timeout: 252 seconds]
sepp2k1 has joined #ruby
tspike has joined #ruby
pellis has joined #ruby
vwoo has joined #ruby
jinie is now known as jinie_
sepp2k has quit [Ping timeout: 252 seconds]
Michae___ has joined #ruby
forrest has joined #ruby
ryannielson has quit [Quit: ryannielson]
pellis has quit [Client Quit]
pitzips has quit [Ping timeout: 252 seconds]
DonRichie has quit [Read error: Connection reset by peer]
vwoo has quit [Ping timeout: 260 seconds]
DonRichie has joined #ruby
<keep>
clear
Kabaka has quit [Max SendQ exceeded]
<keep>
Sorry
rlb3 has quit [Quit: rlb3]
druonysus has joined #ruby
druonysus has quit [Changing host]
druonysus has joined #ruby
danneu has quit [Quit: Leaving.]
instinkt has quit [Ping timeout: 268 seconds]
cj3kim has joined #ruby
vwoo has joined #ruby
ivanoats has quit [Remote host closed the connection]
Rizzle has quit [Read error: Connection reset by peer]
c0rn has joined #ruby
JustinAiken has quit [Quit: Leaving.]
Rizzle has joined #ruby
pitzips has joined #ruby
dangerousdave has quit [Ping timeout: 248 seconds]
Morrolan has quit [Ping timeout: 245 seconds]
larissa has joined #ruby
ldnunes has quit [Quit: Leaving]
Morrolan has joined #ruby
cj3kim_ has joined #ruby
dangerousdave has joined #ruby
kasper has quit [Remote host closed the connection]
Guest45915 has quit [Ping timeout: 246 seconds]
cj3kim has quit [Ping timeout: 260 seconds]
ericmath1son has quit [Quit: leaving]
ericmathison has joined #ruby
pentameter has quit [Remote host closed the connection]
arya has quit [Ping timeout: 248 seconds]
Guga_ has quit [Remote host closed the connection]
kristiandelay has quit [Remote host closed the connection]
Guga_ has joined #ruby
saarinen has joined #ruby
arya has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
sethetter has left #ruby [#ruby]
interactionjaxsn has joined #ruby
kasper has joined #ruby
stonevil has joined #ruby
robscomputer has quit [Read error: Connection reset by peer]
robscomputer_ has joined #ruby
stonevil has quit [Remote host closed the connection]
soyapi has joined #ruby
burlyscudd has quit [Ping timeout: 260 seconds]
orien has joined #ruby
jcromartie has quit [Quit: Computer has gone to sleep.]
<aedorn>
I really don't like that bundle package does a bundle install as well. I really just want it to package my dependencies so I can put everything into a glorious tarball. I suppose if that's my only complaint than it's not that bad, though.
maycon has quit [Quit: Saindo]
interactionjaxsn has quit [Ping timeout: 268 seconds]
jcromartie has joined #ruby
<r0bgleeson>
aedorn: C extensions.
iamjarvo has quit [Quit: iamjarvo]
niklasb has quit [Read error: Operation timed out]
jcromartie has quit [Client Quit]
niklasb has joined #ruby
iamjarvo has joined #ruby
sailias has joined #ruby
fschuindt has joined #ruby
instinkt has quit [Ping timeout: 246 seconds]
JMcAfreak has quit [Quit: Leaving]
duper is now known as a
a is now known as duper
JMcAfreak has joined #ruby
Kar- has quit [Remote host closed the connection]
Michae___ has quit [Remote host closed the connection]
dankest has joined #ruby
Michae___ has joined #ruby
<dankest>
How do I read from environmental variables in Ruby 1.8.7?
<aedorn>
r0bgleeson: That isn't related to this ... end result of bundle-package are gem files in vendor/cache that you can use to install, but it also calls bundle-install, which doesn't really seem to be necessary.
fcatojo has joined #ruby
vwoo has joined #ruby
RORgasm has quit [Remote host closed the connection]
mansi_ has quit [Remote host closed the connection]
mansi has joined #ruby
Astralum has quit [Ping timeout: 260 seconds]
scrollback has quit [Remote host closed the connection]
mansi has quit [Read error: Connection reset by peer]
Michae___ has quit [Remote host closed the connection]
scrollback has joined #ruby
mansi has joined #ruby
Michae___ has joined #ruby
sayan has quit [Quit: Leaving]
butblack has joined #ruby
Apane has quit [Ping timeout: 240 seconds]
mixel has quit [Quit: mixel]
jonno11 has joined #ruby
guardian has joined #ruby
skogis has joined #ruby
ivanoats has joined #ruby
mansi has quit [Remote host closed the connection]
mansi has joined #ruby
<guardian>
hello. I want to parser few (5-10) C headers to extract enums, structs as well as special DSL constructs (with a syntax close to doxygen comments). would you recommend parslet or treetop? or something else/
<guardian>
?
vipaca has quit [Quit: Leaving...]
tonini has quit [Ping timeout: 248 seconds]
<alexspeller>
guardian: I like parselet but haven't used treetop
mansi has quit [Ping timeout: 245 seconds]
<guardian>
ok
<guardian>
well I'll give it a go. I can switch later anyways
<wormwood>
Using Sinatra for a small service api and am running into issues testing ( using rspec ). Basically the sinatra app when called with a route of '/' hits the database and returns some entries. However when using "get '/'" in rspec its not hitting the database I'm guessing because it is a mock request. Anyway around this?
reset has joined #ruby
Nisstyre has joined #ruby
matti has quit [Quit: Oh dear...]
spider-mario has quit [Remote host closed the connection]
ianbrandt_ has joined #ruby
tomzx_mac has joined #ruby
pellis has joined #ruby
mklappst_ has joined #ruby
jfelchner has quit [Ping timeout: 245 seconds]
ssvo_ has quit [Remote host closed the connection]
jfelchner has joined #ruby
Davey has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
ianbrandt has quit [Ping timeout: 248 seconds]
ianbrandt_ is now known as ianbrandt
mklappstuhl has quit [Ping timeout: 240 seconds]
syamajala has quit [Quit: leaving]
freerobby has quit [Quit: Leaving.]
Iszak has joined #ruby
fomatin has joined #ruby
terrellt has quit [Ping timeout: 252 seconds]
jfelchner has quit [Ping timeout: 245 seconds]
instinkt has quit [Read error: Operation timed out]
generalissimo has joined #ruby
ssvo has joined #ruby
arya has quit [Ping timeout: 248 seconds]
jfelchner has joined #ruby
ssvo has quit [Client Quit]
ssvo has joined #ruby
instinkt has joined #ruby
Guedes has quit [Quit: Saindo]
robscomputer has quit [Read error: Connection reset by peer]
Nom- has quit [Read error: Connection reset by peer]
alekst has quit [Ping timeout: 246 seconds]
robscomputer has joined #ruby
Nom- has joined #ruby
jimg has quit [Remote host closed the connection]
hadees has quit [Quit: hadees]
butblack has joined #ruby
advorak has joined #ruby
<Eiam>
I have a date, 04/05/13 so I call DatEtime.strptime(date,"%m/%d/%y").to_time and I get 2013-04-04
<Eiam>
what gives, I lost a day.
<Eiam>
probably need to specify a timezone somehow
ivanoats has joined #ruby
alexwh has left #ruby [#ruby]
lewix has quit [Remote host closed the connection]
<pellis>
Eiam, works well here
cdelo has joined #ruby
alexwh has joined #ruby
<pellis>
try adding a #utc call
workmad3 has quit [Ping timeout: 276 seconds]
_maes_ has quit [Ping timeout: 254 seconds]
<Eiam>
I'm trying with DateTime(date+"/pdt","%m/%d/%y/%z").to_time
<Eiam>
i think its this god damn VM
Rix has quit [Quit: No One Lives Forever]
verto has joined #ruby
zastern has joined #ruby
vlad_starkov has joined #ruby
ssickle1 has joined #ruby
ivanoats has quit [Ping timeout: 264 seconds]
ssickle has quit [Ping timeout: 245 seconds]
Rix has joined #ruby
matti has joined #ruby
mklappst_ has quit [Remote host closed the connection]
havenwood has joined #ruby
<advorak>
I'm having problems with variable scope .. https://gist.github.com/advorak/5785917 -- my block can't access the @name class variable .... Any ideas? :-)
<Xeago>
advorak: what context
vlad_starkov has quit [Ping timeout: 256 seconds]
<Xeago>
what scope does the block run in?
<Xeago>
(what is self)
<advorak>
let's just say i ran that within irb ..
<Xeago>
I think if no argument exists it does an instance_eval
<heftig>
i assume the parameter-less version uses instance_exec
<Xeago>
instance_exec, fine :)
mklappstuhl has joined #ruby
<Xeago>
so line 8 is evaluated on the scope of a Prawn::Document instance
<heftig>
advorak: you can't access @name. at least not cleanly
<advorak>
hrm .. ok. It's going to be messy to change my code to use do |t| , which is what I'm trying to avoid ..
<heftig>
you'd do foobar = @name first
<heftig>
foobar = @name; pdf = Prawn::Document.new do; text foobar; ....
<Xeago>
don't refer to it as a instance variable
rhys has quit [Quit: Leaving]
butblack has quit [Quit: butblack]
burlyscudd has joined #ruby
<advorak>
oh thanks! that works, heftig ..
_Renegade has quit [Read error: Connection reset by peer]
Faris13 has quit [Ping timeout: 256 seconds]
dmiller has joined #ruby
Apane has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
<advorak>
so I get what you're saying re how instance_eval and instance_exec handles things depending on how I invoke Prawn::Document .. I don't know enough about either of those methods to understand the concept of why one handles the block of a context of the Prawn::Document class and one handles it in the context of the "parent" scope .. should I be reading more on instance_eval, instance_exec, or might I do better to look at the prawn gem code to better understand
burlyscudd has quit [Quit: Leaving.]
ivanoats has joined #ruby
tommyvyo has quit [Quit:]
jdunck has quit [Quit: Computer has gone to sleep.]
<heftig>
advorak: no, it's how Prawn::Document handles things
<heftig>
advorak: it checks the arity of the block and then decides to use instance_exec if it's 0
devoldmx3 has quit [Ping timeout: 245 seconds]
<advorak>
heftig: gotcha. thanks :-)
devoldmx has joined #ruby
Nisstyre has quit [Quit: Leaving]
tatsuya_o has quit [Remote host closed the connection]
butblack has joined #ruby
ddv has quit [Changing host]
ddv has joined #ruby
jimg has joined #ruby
awarner has quit [Remote host closed the connection]
butblack has left #ruby [#ruby]
srji has quit [Ping timeout: 248 seconds]
orien has quit [Quit: Computer has gone to sleep.]
kasper has quit [Remote host closed the connection]
jimg has quit [Ping timeout: 245 seconds]
devoldmx has quit [Read error: Connection reset by peer]
<advorak>
heftig: I just realized my code is using a method and not a class variable https://gist.github.com/advorak/5785917 -- is your suggestion still to use a local variable as in: name2 = name ?
<heftig>
advorak: yes
<heftig>
unless the name changes later on
<heftig>
in which case you should get a reference to self instead
<advorak>
thanks.
<heftig>
i.e. this = self .... text this.name
<advorak>
right.
arya has joined #ruby
predator217 has joined #ruby
mansi has joined #ruby
bionhart has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 276 seconds]
mklappstuhl has quit [Remote host closed the connection]
c0rn has joined #ruby
fomatin has quit [Quit: Computer has gone to sleep.]
robscomputer has quit [Remote host closed the connection]
fomatin has joined #ruby
mklappstuhl has joined #ruby
robscomputer has joined #ruby
kaichanvong has quit []
kasper_ has joined #ruby
Godd2 has quit [Quit: Page closed]
predator117 has quit [Ping timeout: 264 seconds]
<bricker>
What's the purpose of Array#hash, just for faster comparison?
_reset has joined #ruby
sepp2k1 has quit [Quit: Leaving.]
mansi has quit [Ping timeout: 256 seconds]
apeiros has joined #ruby
shadoi1 has joined #ruby
shadoi1 has quit [Client Quit]
<heftig>
bricker: used by Hash
robscomputer_ has joined #ruby
dmiller has quit [Remote host closed the connection]