dangerousdave has quit [Ping timeout: 252 seconds]
mpereira has quit [Ping timeout: 246 seconds]
mpereira has joined #ruby
stephenjudkins has joined #ruby
savage- has joined #ruby
ViperMaul|_ has quit [Ping timeout: 252 seconds]
Rizzle has joined #ruby
hotovson has quit [Remote host closed the connection]
prath has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
<rburton->
shtirlic have you used any of these and recommend one more so over the other?
<rburton->
I also was trying Reek as well
<shtirlic>
rburton-: used simplecov
maxer has quit [Quit: maxer]
<shtirlic>
rburton-: with some tuning
<rburton->
Hmm what kind of tuning?
Elico1 has joined #ruby
<Elico1>
Jdubs: you'd better talk with your doctor..
Michael__ has quit [Remote host closed the connection]
elico has quit [Ping timeout: 252 seconds]
<Jdubs>
elico1?
<shtirlic>
rburton-: include needed files etc
<rburton->
I apperiate the feedbcak as well
<rburton->
ah Okay makes sense
<Elico1>
about your sleeping problems..
<rburton->
to make srue all files are covered
<shtirlic>
rburton-: yeh and exclude some of them
davidokner has quit [Quit: Lost terminal]
Jasko has quit [Read error: Connection reset by peer]
<Jdubs>
elico1 oh lol
Jasko has joined #ruby
tchebb has joined #ruby
<Elico1>
Jdubs: there are pretty tough pills you can get today :D
<rburton->
I take 5HTP
<rburton->
It breaks down into other things and gives you a pure restful sleep. its not the number of hours slept, but the quality of sleep
<Jdubs>
elico1: i used to be on ambien, but it got to where 5 times the max dose wouldn't make me sleep
davidd12 has joined #ruby
<Jdubs>
elico1 :/
<rburton->
If you're heavier, you won't get good sleep because of breathing problems as well
centipedefarmer has quit [Remote host closed the connection]
<Jdubs>
rburton: sleep apnea and back problems runn my family :(
<rburton->
Jdubs When I had this problem I was younger, I use to pretend that people were looking for me and I had to stay very very still and not move or make a sound since they would kill me lol
<rburton->
Jdubs same here
<rburton->
I use to be up for 2 days
<Jdubs>
you know what i wish?
<Jdubs>
i wish i could sleep on my back
spo12 has left #ruby [#ruby]
<Jdubs>
when i lay on my back im so comfortable
<Jdubs>
i feel like the sleep would be very restful
<Jdubs>
but i can't fall asleep that way
<Jdubs>
:(
adeponte has quit [Remote host closed the connection]
<Jdubs>
only on my stomach
<rburton->
Jdubs I use to be that way as well. You really need to condition yourself to adjust. Try working out in the morning as well
mercwithamouth has joined #ruby
vickaita has quit [Ping timeout: 245 seconds]
<Elico1>
Jdubs: this is bad!
vickaita has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
<Elico1>
Jdubs: and what the doctor says?
arya has quit [Ping timeout: 245 seconds]
<Jdubs>
elico1 meh i gave up on doctors lol
<Jdubs>
i can usually get to sleep nowadays
<phelps>
I'm patching the Array class to include a sort of reused .find, but I only ever use it on one Array, is it possible to patch just that array ?
<Jdubs>
i just don't want to go to bed, because the sleep is never restful
<Elico1>
Jdubs: are you on the computer a lot?
<Jdubs>
lately I am, for studying/work etd
<Jdubs>
etc*
ablankfield has quit [Ping timeout: 252 seconds]
<Elico1>
I know that I'm getting good and restful sleep only once in a while.
horofox has quit [Quit: horofox]
joelio has quit [Quit: Lost terminal]
Elico1 is now known as Elico
`brendan has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
F1skr has quit [Quit: WeeChat 0.3.9]
arya has joined #ruby
Michael__ has joined #ruby
roadt has joined #ruby
charliesome has joined #ruby
davidd12 has quit [Remote host closed the connection]
jaygen has quit [Remote host closed the connection]
jaygen has joined #ruby
ablankfield has joined #ruby
Jdubs has quit [Quit: Jdubs]
cj3kim has quit [Quit: This computer has gone to sleep]
qwerxy has quit [Quit: offski]
slainer68 has quit [Remote host closed the connection]
fyolnish has joined #ruby
u89 has joined #ruby
niklasb has quit [Ping timeout: 255 seconds]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
horofox has joined #ruby
arya has quit [Ping timeout: 264 seconds]
yaymukund has quit [Ping timeout: 248 seconds]
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
tbrock has quit [Quit: Computer has gone to sleep.]
jimeh has joined #ruby
thone has joined #ruby
itnomad has quit [Ping timeout: 255 seconds]
thone_ has quit [Read error: Operation timed out]
horofox has quit [Quit: horofox]
jenrzzz has joined #ruby
yaymukund has joined #ruby
postmodern has joined #ruby
nitti has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
mercwithamouth has quit [Ping timeout: 252 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
<shtirlic>
hoelzro|away: pull request to core_ext of AS ;)
nitti has joined #ruby
<Spaceghostc2c>
lol
arya has quit [Ping timeout: 268 seconds]
starship has quit [Ping timeout: 255 seconds]
nari_ has joined #ruby
pkrnj has joined #ruby
Araxia has quit [Quit: Araxia]
tjbiddle has quit [Quit: tjbiddle]
arya has joined #ruby
<Edward_>
havenn, ty
kristopolous has joined #ruby
nitti has quit [Ping timeout: 260 seconds]
ejnahc has quit [Remote host closed the connection]
<kristopolous>
Hi! I think I'm working with a code-base that is perhaps using some modified ruby syntax? I don't know ... I see a number of lines like this "wrap_parameters format: [:json]" which my rubies (1.8.7, 1.9.3) both seem to be very upset with
rburton- has joined #ruby
linoj has quit [Quit: linoj]
ejnahc has joined #ruby
<kristopolous>
I've been doing ruby for about 2 years and I don't remember seeing that type of syntax before ... maybe I'm missing something big
<kristopolous>
here is another, similar error: ...sion_store :cookie_store, key: '_betakit_session'
<kristopolous>
read(3, "#!/usr/bin/ruby1.8\n#\n# This file"..., 4096) = 367
jimeh has quit [Quit: Computer has gone to sleep.]
<kristopolous>
someone is being bad here
starship has joined #ruby
<kristopolous>
could this be gemset related?!
linoj has joined #ruby
<kristopolous>
I guess I could just grep my whole disk for that line
<kristopolous>
but that sounds like a night poorly spent
<kristopolous>
let me dump 1.8 entirely, system wide
daniel_- has quit [Quit: WeeChat 0.3.9]
<kristopolous>
ack, now everything is screwed ... this is silly ...
<havenn>
kristopolous: I've been pleased with rbfu, just to handle modifying environment variables as necessary to get things to work between rubies: https://github.com/hmans/rbfu
yaymukund has quit [Ping timeout: 252 seconds]
<havenn>
even have mruby working with rbfu :)
<kristopolous>
yeah, I'm going to just go to the evil rvm route ... it's the devil I know
Michael__ has quit [Remote host closed the connection]
pu22l3r has joined #ruby
<havenn>
kristopolous: I decided I agree that gemsets are the devil, but I'd switch to rvm or rbenv if rbfu ever gives me too much headache.
AndChat| has quit [Ping timeout: 265 seconds]
<postmodern>
havenn, checkout chgems
<postmodern>
havenn, it's like chroot for ruby projects
<postmodern>
havenn, keeps gems installed into the project dir
<postmodern>
havenn, as opposed to ~/.foo/gemsets/bar
Michael__ has quit [Remote host closed the connection]
n_blownapart has joined #ruby
mpereira has quit [Ping timeout: 245 seconds]
mpereira has joined #ruby
charliesome has quit [Ping timeout: 245 seconds]
adelcampo has quit [Quit: Leaving...]
tungd has joined #ruby
<n_blownapart>
hi I'm having trouble understand the idea of an implicit creation of a proc. here I anticipated a proc created but it is still an array. thanks : http://pastie.org/5363494
<n_blownapart>
ing*
<shtirlic>
n_blownapart: map returns array
aantix has joined #ruby
pu22l3r has quit [Remote host closed the connection]
Michael__ has joined #ruby
<havenn>
postmodern: Nice, already have it working with all my existing ruby installs. Very cool!
<shtirlic>
with applied capitalize to each element
BoomCow has quit [Quit: Leaving]
TechZombie has left #ruby [#ruby]
PolPot_ has quit []
<postmodern>
havenn, excellent!
<n_blownapart>
shtirlic: thanks, so when/how does the symbol#to_proc instantiate a proc?
<postmodern>
havenn, what environment btw?
<havenn>
OS X with zsh. Did a brew install local config.
<shtirlic>
n_blownapart: & do the trick converts it proc
<postmodern>
havenn, awesome, good to know that worked (not on OSX here)
<n_blownapart>
shtirlic: Please say that more concisely I don't follow
Ruler_Of_Heaven_ has quit [Read error: Operation timed out]
<n_blownapart>
shtirlic: thanks I'll check it out.
swarley has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
pipopopo has joined #ruby
swarley has quit [Client Quit]
swarley has joined #ruby
stephenjudkins has joined #ruby
carlyle has joined #ruby
manizzle has quit [Ping timeout: 245 seconds]
<n_blownapart>
that's essentially what I understood. but where does &:capitalize get "coerced" into an "implicit" proc? i.e. why doesn't x turn out to be a proc? http://pastie.org/5363494 shtirlic
<n_blownapart>
thanks ^^
aaronmacy has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
Michael__ has quit [Ping timeout: 240 seconds]
<havenn>
n_blownapart: What don't you expect about the returned value?: => ["This", "Is", "Supposed", "To", "Work"]
aantix has quit [Quit: aantix]
Slivka has quit [Remote host closed the connection]
<shtirlic>
n_blownapart: x = %w{this is supposed to work}.map{|z|:capitalize.to_proc.call(z)}
<n_blownapart>
oh shit. well I'm a beginner havenn. I thought the whole expression (x) would turn out to be a proc. so, the output is assigned to x, not the expression. correct? duh...
<havenn>
n_blownapart: You can just think of the &:capitalize as syntactic sugar for: { |word| word.capitalize }
<swarley>
That sounds like haskell closures
<swarley>
If only ruby had those... What a world it would be
nitti has joined #ruby
<n_blownapart>
havenn: thanks, but the textbook is talking about an implicit proc being created. I thought &:sym would actually create an object that I could identify somewhere.
gyre007 has joined #ruby
tehlulz has quit [Ping timeout: 246 seconds]
<havenn>
n_blownapart: Ahh, gotcha.
<swarley>
"".method :capitalize would give you the method, unbound I think
<havenn>
%w{this does not work}.each &:puts
<n_blownapart>
havenn: I thought that any object could be gleaned out of an expression with #class. No?
<havenn>
%w{this works}.each &method(:puts)
<n_blownapart>
swarley: oh, cool I'll try it. cool I'll try that too thanks havenn
pu22l3r has joined #ruby
<swarley>
The method is a proc of sorts
<swarley>
But I've never tried to handle Method objects by themselves
<n_blownapart>
swarley: the method including map , you mean?
nitti has quit [Ping timeout: 246 seconds]
<shtirlic>
swarley: it's usefull when u don't want inplace lambda
<n_blownapart>
swarley: hmm, I think you're right ...I may have read that somewhere. thanks much. shtirlic I read that a long time ago. maybe its no longer over my head thanks.
slainer68 has joined #ruby
<shtirlic>
Creates a new Proc object, bound to the current context. Proc::new may be called without a block only within a method with an attached block, in which case that block is converted to the Proc object.
<swarley>
Weird
<shtirlic>
I did not see anything about args or my english is bad
mfridh has quit [Ping timeout: 255 seconds]
skcin7 has joined #ruby
skcin7 has quit [Max SendQ exceeded]
skcin7 has joined #ruby
<n_blownapart>
swarley: shtirlic well at least I'm not the only one perplexed. many thanks. the author sometimes brings it all together at the end of the chapter.
Michae___ has joined #ruby
<swarley>
Which book?
<shtirlic>
n_blownapart: ) np
slainer68 has quit [Ping timeout: 240 seconds]
<n_blownapart>
swarley: the Well-Grounded Rubyist. well-written I think.
mfridh has joined #ruby
adelcampo has quit [Quit: Leaving...]
wpaulson has joined #ruby
<swarley>
Oh yes, I've read that
<swarley>
I've read just about every general ruby programming book at this point..
<n_blownapart>
swarley: excellent I intend to do the same until my dull brain complies.
Michae___ has quit [Remote host closed the connection]
Grieg has joined #ruby
Grieg has quit [Changing host]
Grieg has joined #ruby
<swarley>
Once you have better basics, Elegant Ruby is good
<n_blownapart>
swarley: I bought it on kindle I went through some of it. When an example is missing code that is assumed to be known, I'm in trouble, though !
<swarley>
Yeah haha. Sometimes practice is better than reading though . I recommend finding a project that interests you on github and trying to fill some of the feature requests
mpereira has quit [Ping timeout: 246 seconds]
<n_blownapart>
swarley: how would I go about finding one and filling in features?
<n_blownapart>
swarley: I am utterly reliant on textbooks at this point.
aantix has quit [Quit: aantix]
mpereira has joined #ruby
<swarley>
Just look around on github.com until you find a popular project that interests you. And then look at feature requests in the issues section
tbrock has quit [Quit: Computer has gone to sleep.]
<swarley>
I do it with pry when I don't have any inspiration
<swarley>
It is a good exercise to learn how big projects and their code work together
chrisramon has joined #ruby
jonahb has joined #ruby
rippa has joined #ruby
<swarley>
Also seeing good code is good for your own habits
TechZombie has left #ruby [#ruby]
chrisramon has quit [Client Quit]
<jonahb>
Anyone know if shoulda 3 requires Ruby 1.9?
<n_blownapart>
projects are rated for popularity swarley ? sorry, many questions, but if you have time what do you do with pry? I have only looked a bit at its features such as show-input, amend-line et al.
<swarley>
Oh, well recently I was working on the pipe syntax for pry commands
Tania has joined #ruby
mpereira has quit [Ping timeout: 255 seconds]
<n_blownapart>
swarley: thanks I'll climb that hill later. I'm still learning my editor (sublime2) geez ...
mpereira has quit [Remote host closed the connection]
tomsthumb has quit [Ping timeout: 255 seconds]
qwerxy has joined #ruby
caleb_io has joined #ruby
zigomir has joined #ruby
ifdefnull has quit [Quit: Leaving]
filipe has joined #ruby
ifdefnull has joined #ruby
ifdefnull has quit [Read error: Connection reset by peer]
hackerdude has quit [Remote host closed the connection]
<shafi>
Why no activity in this channel?
casheew has quit [Read error: Connection reset by peer]
aaronmacy has quit [Quit: Leaving.]
casheew has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
psycho_one has quit [Remote host closed the connection]
u89 has quit [Remote host closed the connection]
u89 has joined #ruby
dr_bob has joined #ruby
CaptainJet has quit []
stephenjudkins has quit [Quit: stephenjudkins]
elentras has joined #ruby
timonv has quit [Remote host closed the connection]
aaronmacy has joined #ruby
mpereira has joined #ruby
chussenot has quit [Quit: chussenot]
rellin has quit [Ping timeout: 268 seconds]
und3f has joined #ruby
nitti has joined #ruby
ChampS666 has quit [Ping timeout: 252 seconds]
shafi has quit [Ping timeout: 276 seconds]
gauravag has joined #ruby
u89 has quit [Remote host closed the connection]
jds_ has quit [Remote host closed the connection]
shafi has joined #ruby
nitti has quit [Ping timeout: 246 seconds]
Virunga has joined #ruby
Elico has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
`Mew_ has quit [Quit: Cya.]
hamed_r has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
kil0byte has joined #ruby
tjbiddle has joined #ruby
arietis has joined #ruby
k610 has joined #ruby
u89 has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Whackatre has joined #ruby
Whackatre has quit [Changing host]
Whackatre has joined #ruby
qwerxy has quit [Quit: offski]
Tearan has quit [Quit: Sleepy Badger....]
mercwithamouth has quit [Ping timeout: 252 seconds]
Elico has quit [Quit: elico]
schaary has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
dhruvasagar has joined #ruby
cezar-b has joined #ruby
hiroyuki_ has joined #ruby
yshh has joined #ruby
havenn has joined #ruby
hiroyuki has quit [Ping timeout: 276 seconds]
havenn has quit [Ping timeout: 252 seconds]
u89 has quit [Remote host closed the connection]
Elhu has joined #ruby
g-ram has joined #ruby
arturaz has joined #ruby
aaronmacy has left #ruby [#ruby]
kalleth has joined #ruby
wreckimnaked has joined #ruby
TommyBotten has quit [Ping timeout: 256 seconds]
d3vic3 has joined #ruby
timonv has joined #ruby
pcarrier has quit []
maxer has joined #ruby
maesbn has joined #ruby
LouisGB has joined #ruby
AlHafoudh has joined #ruby
<AlHafoudh>
hi all
u89 has joined #ruby
<AlHafoudh>
where can I find status of ruby patches? for example, does latest ruby-1.9.3-p327 include the falcon patch, require patch etc. ?
rburton- has quit [Quit: Leaving...]
hakunin_ has quit [Remote host closed the connection]
hakunin has joined #ruby
u89 has quit [Remote host closed the connection]
francisfish has quit [Ping timeout: 265 seconds]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
blacktulip has joined #ruby
kil0byte_ has joined #ruby
<Gate>
AlHafoudh: you can look at 1.9.3-p327's changelog
francisfish has joined #ruby
colinbm has joined #ruby
jimeh has joined #ruby
frozon has joined #ruby
codecaster has joined #ruby
Iszak has joined #ruby
Iszak has joined #ruby
Iszak has quit [Changing host]
hakunin has quit [Ping timeout: 240 seconds]
<frozon>
Hello, got an issue with a CSV which ends with a semicolon, when trying to do CSV.open(file_path, 'r:iso-8859-15', {col_sep: ';', headers: true, header_converters: :symbol}) it end up with undefined encode for nil:NilClass. Is there a way to discard last column if nil?
chussenot has joined #ruby
kil0byte has quit [Ping timeout: 265 seconds]
Elico has joined #ruby
Averna has joined #ruby
Amirh has quit [Read error: Connection reset by peer]
Elico has quit [Client Quit]
chendo_ is now known as chendo
Amirh has joined #ruby
gener1c has quit [Remote host closed the connection]
polymar has joined #ruby
timonv has quit [Remote host closed the connection]
beiter has joined #ruby
maesbn_ has joined #ruby
ztirf has quit [Ping timeout: 252 seconds]
becom33 has joined #ruby
nari_ has quit [Ping timeout: 260 seconds]
JohnBat26 has joined #ruby
Zai00 has joined #ruby
elaptics`away is now known as elaptics
<becom33>
I'm wring this help class to store help commands and command discription . well the problem is commads are set ban a another class . and I should be able to view the set commands by a another class
vlad_starkov has joined #ruby
maesbn has quit [Ping timeout: 246 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<RantriX>
i thought u were referring to those bootcamps in SF
nitti has quit [Ping timeout: 246 seconds]
<osirisx11>
they make learning fun
robotmay has joined #ruby
<becom33>
soo anyone care to help me ?
<RantriX>
yeah
<RantriX>
what u need help with becom33
<becom33>
I'm wring this help class to store help commands and command discription . well the problem is commads are set ban a another class . and I should be able to view the set commands by a another class
slainer68 has quit [Remote host closed the connection]
k610 has joined #ruby
slainer68 has joined #ruby
hotovson_ has joined #ruby
<BryanWB_>
how can i require a file that is w/in a separate gem?
<BryanWB_>
i can require 'chef' but `require 'chef/dsl' ` fails :(
<BryanWB_>
but their is a chef/dsl.rb at chef/lib/chef/dsl.rb w/in my gems
<Hanmac>
BryanWB_ what is your ruby version? did you look at require_relative?
<BryanWB_>
Hanmac: 1.9.3
zz_chrismcg is now known as chrismcg
nkts has quit []
Axsuul has quit [Ping timeout: 246 seconds]
<BryanWB_>
and iirc require_relative it is for my current path, however perhaps I can figure out the path for the chef gem and use require_relative w/ that?
pcarrier has joined #ruby
pcarrier has quit [Read error: Operation timed out]
yshh has quit [Read error: No route to host]
yshh has joined #ruby
pcarrier has joined #ruby
fyolnish has quit [Remote host closed the connection]
codezombie has joined #ruby
<Hanmac>
BryanWB_ i thought that you are inside the chef gem (yours?) and want to require chef/dsl from there? or i am wrong?
<BryanWB_>
Hanmac: i am not inside the gem, i have a separate gem that monkey patches the chef gem
rburton- has quit [Ping timeout: 252 seconds]
<BryanWB_>
i hope to get the code merged in the future but in the meantime i need to maintain a separate gem
<Muz>
09:28 < BryanWB_> i can require 'chef' but `require 'chef/dsl' ` fails :( # define 'fails'
<Muz>
What's the error message you get?
<BryanWB_>
Muz LoadError: cannot load such file -- chef/dsl
h4mz1d has joined #ruby
g_bleezy has joined #ruby
<BryanWB_>
hmm, looks like Gem.find_files may be my new best friend
xorigin has joined #ruby
qwerxy has joined #ruby
<Hanmac>
what happends if you first require 'chef' and than after that require 'chef/dsl' ?
<Hanmac>
or what happends if you try require 'chef/chef/dsl' instead ?
<BryanWB_>
same error
snuglepuss has joined #ruby
shafi has quit [Ping timeout: 240 seconds]
<BryanWB_>
here it is Gem::Specification.find_by_name('chef').gem_dir
<BryanWB_>
tks for helping me folks
timonv has joined #ruby
g_bleezy has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
Slivka has joined #ruby
sepp2k has quit [Remote host closed the connection]
caleb_io has quit [Quit: caleb_io]
jaygen_ has joined #ruby
h4mz1d has quit [Ping timeout: 240 seconds]
Iszak has quit [Quit: User has gone to sleep.]
jaygen has quit [Ping timeout: 252 seconds]
fantazo has quit [Remote host closed the connection]
lowg has joined #ruby
_bart has joined #ruby
psycho_one has joined #ruby
morf has joined #ruby
Iszak has joined #ruby
Iszak has quit [Changing host]
Iszak has joined #ruby
u89 has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
Iszak has quit [Client Quit]
Iszak has joined #ruby
Iszak is now known as Guest21865
Jdubs_ has joined #ruby
dd72ddd has joined #ruby
shiin has joined #ruby
dd72ddd has left #ruby [#ruby]
rh1n0 has joined #ruby
qwerxy has quit [Quit: offski]
JonnieCache has quit [Ping timeout: 240 seconds]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
ayanb has joined #ruby
vitoravelino has joined #ruby
vitoravelino has quit [Changing host]
vitoravelino has joined #ruby
a_a_g has joined #ruby
Villadelfia has quit [Read error: Operation timed out]
SeySayux has quit [Read error: Operation timed out]
SeySayux_ has joined #ruby
samphippen has joined #ruby
Villadelfia has joined #ruby
lampe2 has joined #ruby
berserkr has joined #ruby
<osirisx11>
RantriX: i am a professional web dev
a_a_g has quit [Quit: Leaving.]
<RantriX>
that's great. ruby on rails?
jhgaylor has quit [Read error: Connection reset by peer]
<Hanmac>
osirisx11 & Rantrix: if you want to talk about rails goto #rubyonrails
ztirf has joined #ruby
<osirisx11>
thanks Hanmac we thought it would be ok since no one is actually helping anyone
nitti has joined #ruby
robotmay has quit [Remote host closed the connection]
<Hanmac>
if #rubyonrails is not helpful than its not our problem :D
staafl has joined #ruby
a_a_g has quit [Ping timeout: 264 seconds]
a_a_g1 is now known as a_a_g
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
schaary has quit [Quit: Leaving.]
nitti has quit [Ping timeout: 246 seconds]
arkiver has joined #ruby
cdt has joined #ruby
Kyril has quit [Ping timeout: 240 seconds]
moshef has joined #ruby
<RantriX>
good night all
RantriX has quit [Remote host closed the connection]
sheerun has joined #ruby
lenodroid has joined #ruby
a_a_g has quit [Quit: Leaving.]
jimeh has quit [Quit: Bye.]
lenovodroid has quit [Ping timeout: 246 seconds]
losh has joined #ruby
sheerun_ has joined #ruby
virtuose has joined #ruby
codecaster has quit [Read error: Connection reset by peer]
<losh>
Hello, I have an object that has 4 arguments, they all have default values. e.g. Class initialize(name="", min=4, max=10, count=1). When I create an instance of this class, I only want to supply a value for the third argument, e.g. Object.new(max=40). Is this supported in Ruby?
sheerun has quit [Ping timeout: 256 seconds]
sheerun_ is now known as sheerun
<Hanmac>
losh if you define that the initialize method takes an hash
jprovazn has quit [Remote host closed the connection]
codecaster has joined #ruby
<Hanmac>
then you can do Object.new(:max=>40) or on newer ruby Object.new( :max 40)
<losh>
Hanmac: OK, I see. Thanks for the help.
statarb3 has joined #ruby
statarb3 has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
<Hanmac>
oh its Object.new( max: 40) on newer ruby
statarb3 has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
lenodroid has quit [Ping timeout: 246 seconds]
d3vic3 has quit [Ping timeout: 268 seconds]
roadt has quit [Ping timeout: 246 seconds]
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
d3vic3 has joined #ruby
<losh>
Hanmac: newer being 1.9.x?
<Xeago>
yes
<Xeago>
hash 'key: value' is 1.9 syntax
<Hanmac>
1.9.3 supports Object.new( :max 40), i dont know about 1.9.2 or 1.9.1
<apeiros_>
as of 1.9.0 afair
<apeiros_>
also, max: 40, not :max 40 ;-)
pavilionXP has quit [Ping timeout: 276 seconds]
moshef has quit [Quit: moshef]
<apeiros_>
Hanmac: had a chance to take a look at the game?
<Hanmac>
not yet, but last time i could not go out of the game ... maybe this is not wanted? :D
<Xeago>
apeiros_: sorry for not showing up this weekend, lonestarclash happened.. :)
<apeiros_>
Hanmac: of course it is not wanted that you leave the game!
<apeiros_>
Hanmac: na, Q should usually get you out of the game
<apeiros_>
there are some rare occasions where Q won't work, though
<apeiros_>
but ctrl-C should always work
<apeiros_>
Xeago: np
heftig has quit [Quit: leaving]
jaygen_ has quit [Ping timeout: 252 seconds]
gauravag has quit [Ping timeout: 248 seconds]
<apeiros_>
Hanmac: but not everything works yet as intended. e.g. in the battle screen, I haven't really implemented anything but "attack"
<apeiros_>
need to think about ways to create an interesting battle anyway :)
<apeiros_>
retreat is theoretically implemented, but I haven't tested it.
kil0byte has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
reinaldob has joined #ruby
adeponte has joined #ruby
nari_ has quit [Ping timeout: 260 seconds]
chussenot has quit [Quit: chussenot]
<Hanmac>
apeiros_ okay Q works ... but the rendering is slower ... that means it does flickering :/
<apeiros_>
hm, doesn't flicker here. what machine/OS/ruby version?
<apeiros_>
(though, ascii implementation is only temporary anyway)
kil0byte_ has quit [Ping timeout: 256 seconds]
<osirisx11>
wow great people are talking in here!
kil0byte_ has joined #ruby
gauravag has joined #ruby
roadt has joined #ruby
<Hanmac>
apeiros_ "AMD A10-5800K APU with Radeon(tm) HD Graphics"/"Ubuntu 12.10"/"ruby 1.9.3p194 (2012-04-20 revision 35410)"
adeponte has quit [Ping timeout: 260 seconds]
<apeiros_>
ok
cascalheira has joined #ruby
<apeiros_>
Hanmac: oh, you did set the console to a size of 120x40 or bigger, yes? otherwise the display will look garbled and not make any sense :)
qwerxy has joined #ruby
<apeiros_>
(haven't added a warning yet)
kil0byte has quit [Ping timeout: 264 seconds]
Slivka has quit [Remote host closed the connection]
<Hanmac>
PS: make the mapview a bit smaller, and you may not get any flickering
pcarrier has quit []
yshh has quit [Remote host closed the connection]
robotmay has joined #ruby
pcarrier has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
fermion has joined #ruby
stayarrr has joined #ruby
fermion has quit [Client Quit]
pcarrier has quit [Ping timeout: 265 seconds]
pcarrier has joined #ruby
baphled has joined #ruby
horofox has joined #ruby
chussenot has joined #ruby
beiter has quit [Quit: beiter]
ndrei has joined #ruby
beiter has joined #ruby
justsee has quit [Read error: Connection reset by peer]
fermion has joined #ruby
sheerun has quit [Quit: sheerun]
vlad_starkov has quit [Ping timeout: 260 seconds]
stayarrr has quit [Quit: Leaving...]
AxonetBE has joined #ruby
Shrink has quit [Ping timeout: 240 seconds]
LouisGB has quit [Ping timeout: 240 seconds]
<AxonetBE>
I want to overwrite a module and add a method to it, can I keep the standard module and do something like module_eval to only add my method and use the rest of the module? https://gist.github.com/4058740
<ij>
Why would one prefer module X; class Y; end; end instead of class X::Y; end if there's nothing else except for that one class defined in the module.
SeySayux_ is now known as SeySayux
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
carloslopes has joined #ruby
nitti has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
<Xeago>
because of line 7, it overwrites the @help_core variable everytime it is set
<becom33>
aww . Xeago how I keep it like a help class to keep everything in a one hash
nitti has quit [Ping timeout: 246 seconds]
snuglepuss has quit [Remote host closed the connection]
<Xeago>
you could merge it into the hash
<Xeago>
@help_core.merge {name => desc}
<becom33>
Xeago, wait let me try that
<Xeago>
I see no reason why you should nest a hash in there
<Xeago>
or you can do this: @help_core[name]=desc
<becom33>
undefined method `merge='
Edward_ has quit [Ping timeout: 260 seconds]
kil0byte has joined #ruby
gauravag has quit [Ping timeout: 268 seconds]
gauravag has joined #ruby
<Xeago>
merge(anotherhash)
<Xeago>
or @hash[key]=value
<Xeago>
merge= is not a method
<Xeago>
merge is a method
<becom33>
test.rb:7:in `set_help': undefined method `[]=' for nil:NilClass (NoMethodError)
Michae___ has joined #ruby
<Xeago>
do you know what that means?
kil0byte_ has quit [Ping timeout: 248 seconds]
tanathos has joined #ruby
neutrino_ has joined #ruby
<becom33>
yes it says cant find the method set_help
<Xeago>
nope
clj_newb has quit [Ping timeout: 245 seconds]
<Xeago>
it says it can't find the method []= for a nil object
<becom33>
oh
sheerun has joined #ruby
neutrino_ has left #ruby [#ruby]
<Xeago>
you never initialize @help_core
<becom33>
aww .
<Xeago>
you should follow a rubytutorial
<becom33>
Xeago, ok I did
<becom33>
def initialize
<becom33>
@help_core = {}
<becom33>
end
ottbot has quit [Quit: WeeChat 0.3.9]
<becom33>
but still getting the same error
<Xeago>
ok, that looks good
rdark has joined #ruby
carloslo_ has joined #ruby
jimeh has joined #ruby
gauravag has quit [Ping timeout: 246 seconds]
<becom33>
umm ?
<becom33>
test.rb:11:in `set_help': undefined method `[]=' for nil:NilClass (NoMethodError)
<Xeago>
you never create an instance of the class Help, therefore no initialize methods gets run
<becom33>
I used it outside the initialize and it worked :)
<becom33>
thanks
carloslopes has quit [Ping timeout: 246 seconds]
kiddy56842 has joined #ruby
horofox has quit [Ping timeout: 240 seconds]
wreckimnaked has quit [Read error: Operation timed out]
Michae___ has quit [Remote host closed the connection]
slainer68 has quit [Remote host closed the connection]
cmarques has joined #ruby
elentras has left #ruby ["Quitte"]
bier has quit [Ping timeout: 240 seconds]
kiddy10159 has quit [Ping timeout: 246 seconds]
bier_ has quit [Ping timeout: 248 seconds]
horofox has joined #ruby
arkiver has quit [Quit: Leaving]
darkc0met has quit [Changing host]
darkc0met has joined #ruby
darkc0met has joined #ruby
jrajav has joined #ruby
sheerun has quit [Quit: and thanks for all the fish]
acrocity_ has joined #ruby
<apeiros_>
Hanmac: I think the flickering is due to me using "\e[2J" to clear the screen
<apeiros_>
that creates a scrollback
<apeiros_>
I should just move the cursor to 0,0 and redraw from there
<apeiros_>
and only clear the screen upon window resize (SIGWINCH) and at very specific events (atm, that'd be game start and game end)
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
acrocity has quit [Ping timeout: 240 seconds]
acrocity_ is now known as acrocity
JonnieCache has joined #ruby
stayarrr has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
u89 has quit [Read error: No route to host]
elentras has joined #ruby
bier has joined #ruby
shafi has joined #ruby
u89 has joined #ruby
cmarques has quit [Ping timeout: 260 seconds]
bier_ has joined #ruby
iamjarvo has joined #ruby
dekroning has joined #ruby
larissa has joined #ruby
rafter has joined #ruby
cmarques has joined #ruby
Averna has quit [Quit: Leaving.]
Gmind has joined #ruby
yshh has joined #ruby
margle has quit [Ping timeout: 240 seconds]
<Gmind>
perhaps ruby channel is way more ppl than many others..
Shrink has joined #ruby
whowantstolivefo has joined #ruby
chussenot has quit [Quit: chussenot]
<Hanmac>
Gmind there are only 6 users, the other 700 are bots that redirects you to #rubyonrails :D
<workmad3>
Hanmac: for rails questions, ask in #rubyonrails
<Hanmac>
that what i meant xD
<Xeago>
we sure are a troll :)
<workmad3>
Xeago: for troll questions, ask in #trollonrails
sheerun has joined #ruby
<Hanmac>
xD
<Gmind>
=)))))
<Gmind>
funny
AlHafoudh_ has joined #ruby
<Gmind>
at least, it's not very heat conflict like in some others fiece channels
AlHafoudh has quit [Ping timeout: 252 seconds]
<jrajav>
I'll heat your conflict
robertotauille has joined #ruby
<Gmind>
yes please
<AxonetBE>
I overwrite a class with class_eval but there he doesn't know anymore the ProductFilters module https://gist.github.com/4058988, but he is included in the initial class. What is wrong?
<Gmind>
I just want to see the world burn
slainer68 has joined #ruby
Averna has joined #ruby
mvangala has quit [Read error: Connection reset by peer]
flip_digits has joined #ruby
kil0byte_ has joined #ruby
adamdonahue has quit [Quit: adamdonahue]
mvangala has joined #ruby
<shevy>
not true!
<shevy>
the joker was always doing "planned chaos"
kil0byte has quit [Ping timeout: 246 seconds]
<shevy>
for true chaos he'd never would have had to bother to make any plan at all
adambeynon has joined #ruby
[Neurotic] has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 240 seconds]
<workmad3>
shevy: most people, when acting without a plan, don't act chaotically :P
<shevy>
it's a side effect!
<shevy>
I just go around and do stuff!!!
<shevy>
like punch your nuts!!!!!!!!
margle has joined #ruby
<shevy>
then you fall on the street and a car driver gets shocked
<shevy>
and CRASHES into a McDonalds and everything EXPLODES!!!!!!!!!!!!!!!!!!!!
<workmad3>
shevy: I can agree with that :) the side effects from a person performing actions (both in a planned or an unplanned manner) can have emergent behaviour that is very chaotic :)
<shevy>
I watched too many movies from Christopher Nolan :(
joeycarmello has joined #ruby
nitti has joined #ruby
Xeago has quit [Ping timeout: 260 seconds]
heftig has joined #ruby
vlad_starkov has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
<Gmind>
inception :D
* apeiros_
ponders creating a shell/color template "language"
Jasko has joined #ruby
yalue has joined #ruby
Virunga has quit [Remote host closed the connection]
stayarrr has quit [Quit: Leaving...]
<apeiros_>
those escape sequences are rather unreadable…
<apeiros_>
and with added interpolation, it doesn't get better…
<shevy>
yeah apeiros_ !
<shevy>
how do you actually output coloured text on the console right now?
joeycarmello has quit [Ping timeout: 260 seconds]
<shevy>
I still have not found a really pleasent way for my own stuff
banisterfiend has joined #ruby
nitti has quit [Ping timeout: 246 seconds]
<apeiros_>
shevy: right now I write raw escape sequences
<apeiros_>
maybe I should take another look at existing gems, but iirc they only deal with those puny 16 standard colors
<shevy>
hehe
vlad_starkov has quit [Ping timeout: 246 seconds]
_justin has joined #ruby
ViperMaul|_ has joined #ruby
<apeiros_>
at the moment I collect what kinds of information I want to embedd
wreckimnaked has joined #ruby
<apeiros_>
so far I see: fg/bg color, bold, variables, with variables: padding, truncating, formatting
<apeiros_>
anything I'm missing?
kkiero has joined #ruby
<shevy>
BLINKING
<apeiros_>
no
dorei has joined #ruby
<apeiros_>
but yes, theoretically the idea I currently have would allow adding that
<shevy>
hmm... the gnome-terminal allows hyperlinks to be underlined when a mouse-over effent occurs... but unfortunately that is not standard across the terminals at all, I'd wish underlined text would be possible
<shevy>
*event
Rizzle has quit [Ping timeout: 255 seconds]
<shevy>
no idea how I managed to write "effent"......
kalleth has joined #ruby
<apeiros_>
it effing happend!
Morkel_ has joined #ruby
slainer68 has joined #ruby
emergion has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
cmarques has quit [Ping timeout: 260 seconds]
banisterfiend has quit [Ping timeout: 246 seconds]
<apeiros_>
ah, "fill line"
Morkel has quit [Ping timeout: 268 seconds]
Morkel_ is now known as Morkel
Croms has joined #ruby
Tania has joined #ruby
Monie has joined #ruby
<dorei>
shevy: there is a terminal code for underline
Takehiro has joined #ruby
AlHafoudh_ has quit [Read error: Connection reset by peer]
AlHafoudh has joined #ruby
AlHafoudh has quit [Client Quit]
<dorei>
shevy: try "\e[4m#{str}\e[0m"
<shevy>
ah true, cool
qwerxy has quit [Quit: offski]
<apeiros_>
dorei: is that on-hover?
fermion has quit [Ping timeout: 268 seconds]
<dorei>
nop
<apeiros_>
I think the on-hover part is nonstandard
<shevy>
never used that so far in my console-output stuff... wonder in how many places I could use it. I don't want to underline too much, only sometimes when focus on specific parts of the text is very necessary
<dorei>
u cant hover with terminals, they're a bit old
Amirh has quit [Ping timeout: 268 seconds]
<apeiros_>
oh you can. you can even translate mouseclicks.
<dorei>
aren't these xterm extensions? not standard VT stuff
<apeiros_>
but yeah, of course, that wouldn't be part of xterm and similar
Monie has quit [Client Quit]
<apeiros_>
that'd be the "non" in "nonstandard" ;-p
cmarques has joined #ruby
Amirh has joined #ruby
somazero has joined #ruby
Mkman has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
niklasb has joined #ruby
ztirf has quit [Ping timeout: 252 seconds]
vickaita has joined #ruby
lushious has quit [Remote host closed the connection]
maesbn_ has quit [Ping timeout: 265 seconds]
pac1 has joined #ruby
geekbri has joined #ruby
<becom33>
shevy, sup bro ?
mar1 has joined #ruby
<shevy>
hey becom33
<shevy>
not doing awfully much with ruby lately, next on my todo list is continue work on a ftp "client" (basically just a big case when menu for common ftp-related tasks)
maesbn has joined #ruby
mar1 has left #ruby [#ruby]
<becom33>
bro need a help can I pm . for somereason my internet is damn slow cant load websites . if ur ok can I flood ur private window with 4 lines
samphippen has quit [Quit: Computer has gone to sleep.]
hamed_r has quit [Quit: Leaving]
g_bleezy has joined #ruby
Hanmac has joined #ruby
krz has quit [Quit: krz]
pavilionXP has joined #ruby
g_bleezy has quit [Read error: Connection reset by peer]
samphippen has joined #ruby
dr_bob has quit [Quit: Leaving.]
F1skr has joined #ruby
TechZombie has joined #ruby
TechZombie has left #ruby [#ruby]
dr_bob has joined #ruby
<shevy>
becom33: always ask in #ruby
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
breaker has quit [Quit: Verlassend]
rh1n0 has joined #ruby
iPhoneMRZ has joined #ruby
iPhoneMRZ has quit [Client Quit]
kil0byte has joined #ruby
Zai00 has quit [Read error: Connection reset by peer]
iPhoneMRZ has joined #ruby
psycho_one has quit [Remote host closed the connection]
gauravag has quit [Read error: Connection reset by peer]
gauravag has joined #ruby
ttt has quit [Remote host closed the connection]
kil0byte_ has quit [Ping timeout: 240 seconds]
freeayu has quit [Remote host closed the connection]
shtirlic has joined #ruby
tommyvyo has joined #ruby
krawchyk has joined #ruby
tbrock has quit [Quit: Computer has gone to sleep.]
nzko has joined #ruby
somazero has joined #ruby
johnjohnson has joined #ruby
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
jeffreybaird has joined #ruby
aquaranto has joined #ruby
<nzko>
hello, I currently have this code : "hello foo bar héhé".split(' ').each {|w| w.gsub!(/(\W|\d)/, "")} , but it stripes my accentuated chars (héhé->hh)
bbttxu has joined #ruby
<nzko>
(ruby 1.9.3p286)
iamjarvo has quit [Quit: Computer has gone to sleep.]
<apeiros_>
\W is [^A-Za-z0-9_]
<nzko>
oh
<apeiros_>
you want one of the \p{} classes
<apeiros_>
I'm not sure how you'd negate it, but I'd say you're looking for \p{word}
shtirlic has quit [Remote host closed the connection]
brendan` has quit [Quit: Leaving]
robotmay has quit [Remote host closed the connection]
maesbn_ has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
carlyle has joined #ruby
enderx86 has joined #ruby
krawchyk_ has joined #ruby
nitti has joined #ruby
Grieg has quit [Read error: Connection reset by peer]
<Hanmac>
apeiros_ & nzko : /[[:alpha:]]/
krawchyk has quit [Read error: Operation timed out]
<Hanmac>
and the revert: /[^[:alpha:]]/
maesbn has quit [Ping timeout: 246 seconds]
nari_ has joined #ruby
<Hanmac>
and if you want numbers too use /[[:alnum:]]/
<apeiros_>
(no explicit receiver means that not even `self.some_private_method` will work)
<strangeworks>
it works
<strangeworks>
correctly
banister_ has joined #ruby
<strangeworks>
so where the difference
<apeiros_>
strangeworks: where do you have an explicit receiver in that code?
<JonnieCache>
my ruby app is a daemon. i have it running a loop, and i want to block this loop until it recieves some notification on a TCP socket. whats the simplest way to do that? by hand?
<apeiros_>
JonnieCache: most IO read methods block until something is received
<JonnieCache>
hmm yes i suppose so
<JonnieCache>
basically i kindof want some sort of ultra ultra lightweight eventmachine style thing, with one one event
<JonnieCache>
something to do by hand i suppose
csaunders has joined #ruby
<JonnieCache>
*only one
tnk1 has joined #ruby
binarypl1 has quit [Ping timeout: 276 seconds]
cakehero has joined #ruby
reinaldob has joined #ruby
yakko has joined #ruby
<JonnieCache>
lol ive exposed my utter systems programming n00bness and everyones gone quiet :)
<withnale>
hello. is there any way to get detailed information about a gem (including names/versions/deps/filelist) from a gem prior to installing it? I can't find it in the gem manual
<equus>
withnale: look at the corresponding github page? :P
<equus>
withnale: look in the .gemspec there
fyolnish has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
Rydefalk_ has joined #ruby
fmcgeough has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
<Jdubs_>
i added a binding.pry to my file, nothing changed
<Jdubs_>
i already installed pry before i did that as well
<equus>
Jdubs_: do you put the binding.pry inside the test?
becom33 has quit [Read error: Connection timed out]
enderx86 has quit [Remote host closed the connection]
horofox has joined #ruby
<Jdubs_>
I put it inside the file that the test runs through
<Hanmac>
Jbubs_ i does 3D programming with ruby :D
<apeiros_>
if we can, we will move to gosu. but since it's about learning to code ruby, that's not a focus.
larissa has quit [Quit: Leaving]
mib_mib has joined #ruby
<Jdubs_>
apeiros_ :)
DrShoggoth has joined #ruby
Guest6524 has quit [Read error: Operation timed out]
<mib_mib>
hi guys, i have a list of words that i am searching for boolean occurence in a larger string, i.e.txt = "some long string of word1 word2 word3'; ['word1', 'word2', 'word3'].each do |w| txt.match(w); -- how can I speed up this process?
koffiekop has joined #ruby
<Jdubs_>
mib_mib I think you could use / /
<Jdubs_>
rational expressions?
<Jdubs_>
i'm new though, don't listen to me
<Jdubs_>
lol
<mib_mib>
Jdubs_: u mean regular expressions
<Jdubs_>
doh!
<Jdubs_>
yeah that's the one
<Hanmac>
mib_mib does you want to match all the words or is one match enough?
<mib_mib>
Hanmac: i just want to verify if the word occurs at all in the text, if it does, i don't need to know anything more about it
<mib_mib>
Hanmac: i tried building a large OR'd regular expression, but then i need to match every occurence of this...
<mib_mib>
Hanmac: which then slows it down
Slivka has joined #ruby
losh has left #ruby ["Leaving"]
Slivka has quit [Read error: Connection reset by peer]
<Hanmac>
['word1', 'word2', 'word3'].all? {|w|txt =~ /#{w}/} returns true if all words are in the text
<Hanmac>
['word1', 'word2', 'word3'].any? {|w|txt =~ /#{w}/} returns true if any words are in the text
gmci has joined #ruby
<apeiros_>
16:27 mib_mib: Hanmac: i tried building a large OR'd regular expression, but then i need to match every occurence of this...
* apeiros_
doesn't follow…
gmci is now known as Guest67861
_alejandro has joined #ruby
OldOats has joined #ruby
tonini has quit [Remote host closed the connection]
kil0byte_ has joined #ruby
<shevy>
hmm
<shevy>
I need to make use of .any? more
<shevy>
often
lateau has quit [Ping timeout: 260 seconds]
<mib_mib>
apeiros_: for instance, if i have an input of ['word1', 'word2', 'word3',....,'word1000'] an output should be like [1, nil, 1] if that word occured in the text - however, if i build a regular expression like "some large text string".scan(/word1||word2||word3/} then this is really slow, because the regular expression is large and i have to use the 'scan' method
kil0byt__ has joined #ruby
<apeiros_>
mib_mib: oh, so your initial problem description was incomplete
<apeiros_>
you don't just want to know whether any out of the words matched
<apeiros_>
you also want to know which
<apeiros_>
anything else`
<apeiros_>
?
<mib_mib>
apeiros_: inotherwords, i eithe rhave to iterate the whole array (~ 5000 words) and do a 'match' on each of them, or build one regular expression with a large number of OR'd but have to use the scan method, which is then slow
wargasm has left #ruby [#ruby]
kil0byte has quit [Ping timeout: 245 seconds]
tpe11etier has joined #ruby
<mib_mib>
apeiros_: correct - nope thats it, i only need to know boolean occurence
<apeiros_>
and the text you match against is large?
niklasb has joined #ruby
<Jdubs_>
equus, did you see my git? i can't figure out the problem :/
<mib_mib>
apeiros_: around 10k
<mib_mib>
apeiros_: wasnt sure if there was an easier way or if i would need to build a suffix tree or otherwise...
<apeiros_>
mib_mib: and you figure that scan is slow by what measurement method?
tagrudev has quit [Quit: Me = Awesome]
<apeiros_>
also, what's the threshold for "slow"?
<mib_mib>
apeiros_: because i'm using it now and its slower than just individually matching each
gauravag has quit [Read error: Connection reset by peer]
<apeiros_>
mib_mib: words are full words?
<mib_mib>
apeiros_: i did some profiling and it takes 1.2 seconds
<mib_mib>
apeiros_: words are words or phrases
kil0byte_ has quit [Ping timeout: 260 seconds]
<apeiros_>
i.e., you could prepare your search string? e.g. create a word-set from the text and do a set-intersection
Whackatre has quit [Quit: Cya.]
bwlang has joined #ruby
<mib_mib>
apeiros_: the phrases parts kinda kicks that though right
<mib_mib>
apeiros_: i guess unless i prepared it for n-grams
<OldOats>
hello all, I'm a little bit new to using exceptions in code and was wondering if it appropriate to use the ruby built in exceptions for my own classes (e.g. ConnectionException thrown in a is_connected? method I created), or if I need/should make my own exception classes.
CaptainJet has joined #ruby
<apeiros_>
OldOats: s/thrown/raised/
<mib_mib>
apeiros_: i.e. support different lengths.... hmmm hopefuly that wouldn't take too long - i would have to split it on every 1 word, then 2 words, then 3 words, then 4 words.... i could try it
<apeiros_>
throw has a different meaning in ruby
gauravag has joined #ruby
<apeiros_>
mib_mib: ok, phrases makes the thing difficult
<mib_mib>
apeiros_: do you know an easy way to split on 4 words? i guess i could just build a regex to do it...
<apeiros_>
but with 5000 words being searched, I'd look for algorithms where you prepare the string to be searched.
krawchyk_ has quit [Remote host closed the connection]
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
<apeiros_>
mib_mib: well, split on words, then use each_cons(4) to get pairs of 4 words
<mib_mib>
apeiros_: oh that could be nice - or actually i could just iterate though it once and build all 4
krawchyk has joined #ruby
<apeiros_>
OldOats: core exceptions are certainly fine, but if you can, define your own exception classes
<Jdubs_>
Apeiros: any chance you can check my recent push? I'm stuck on an error
<mib_mib>
apeiros_: what data structure does ruby use for sets internally? is is a tree?
<apeiros_>
mib_mib: a hash
<OldOats>
ok thanks for the info.
tomsthumb1 has quit [Quit: Leaving.]
<apeiros_>
Jdubs_: what error do you get?
<mib_mib>
apeiros_: ok cool - you gave me some ideas thanks
<mib_mib>
apeiros_: i like the set intersection idea
butblack has joined #ruby
<Jdubs_>
apeiros: it's saying a method doesn't exist that does
<Jdubs_>
apeiros: i checked the spelling
<Jdubs_>
apeiros: not really sure what else the prob could be
<apeiros_>
Jdubs_: how do I reproduce your error?
cj3kim has quit [Client Quit]
nari_ has quit [Ping timeout: 276 seconds]
djdb has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 260 seconds]
<Jdubs_>
just run the test file
<apeiros_>
Battle.fight(hero, hero) # this calls the class method fight
awarner has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
<Jdubs_>
I tried that, didn't work
<apeiros_>
`class Battle; def fight` this defines the instance method fight
nzko has quit [Quit: Page closed]
<JonnieCache>
goddamn it feels good to be doing TDD, OOP and all that good stuff again
<apeiros_>
that is, you try to call an instance method on the class itself
<Jdubs_>
uhhh
<apeiros_>
you need an instance of Battle to call fight on
idzuna has quit [Read error: Connection reset by peer]
infinite_ has quit [Read error: Connection reset by peer]
joeycarmello has quit [Ping timeout: 246 seconds]
idzuna has joined #ruby
idzuna has quit [Changing host]
idzuna has joined #ruby
<Jdubs_>
apeiros: i got the test running properly, but the block/crits aren't working quite properly, got time to take a look ? ill do apush real quick
kil0byte has quit [Read error: Connection reset by peer]
Raboo has joined #ruby
rcvalle has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
jrajav has joined #ruby
sailias has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
csalvato has joined #ruby
<csalvato>
anyone here use prawn?
<davidcelis>
csalvato: Rather than guru hunting and asking if someone has used this or that, just ask your question with as much detail as possible. Even if someone hasn't used X Y or Z, there's a high chance someone can help, but only if they have details to work with.
shafi has joined #ruby
<csalvato>
davidcelis: sure
<csalvato>
I am getting an error using Prawn to drawn grids on a pdf
brendan` has quit [Quit: Leaving]
pu22l3r has joined #ruby
<csalvato>
I am trying to subclass Prawn, and then call grid.show_all within the subclass, but it is giving me an error every time
roadt has quit [Ping timeout: 248 seconds]
nat26101 has joined #ruby
brianpWins has joined #ruby
<csalvato>
giving me an argument error when the method does not take any args
<stephenjudkins>
csalvato: why are you trying to subclass Prawn?
nat2610 has quit [Ping timeout: 260 seconds]
<csalvato>
I am making a subclass of Prawn::Document because as of 0.11.1 that is the recommended means of making a template
elaptics is now known as elaptics`away
tbrock has joined #ruby
<csalvato>
basically, in the initialize() method i can set up a pre-set group of tasks for all documents that will be created
<csalvato>
and then i can implement other methods that are particular to my document
cakehero has joined #ruby
<csalvato>
such as, say, entering the value of a field in the right place
pu22l3r has quit [Remote host closed the connection]
<stephenjudkins>
csalvato: what is the exact error?
<stephenjudkins>
gist it?
mengu_ has joined #ruby
mengu_ has quit [Changing host]
mengu_ has joined #ruby
Xeago has joined #ruby
<csalvato>
sure just a moment
brendan` has joined #ruby
makerbreakr has joined #ruby
ilyam has joined #ruby
<makerbreakr>
hi, I am adding a series of integers together in a method
<stephenjudkins>
csalvato: have you looked at the source where the error is being thrown from?
<csalvato>
hm no i haven't - still new to ruby from PHP and Java - how can i check the source?
<csalvato>
do this : subl /Users/csalvato/.rvm/gems/ruby-1.9.3-p286@searchwordcreator/gems/prawn-0.12.0/lib/prawn/text/formatted/box.rb
<csalvato>
?
makerbreakr has left #ruby ["Leaving"]
<stephenjudkins>
yes
<csalvato>
sec troubleshooting
EyesIsMine has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
<csalvato>
stephenjudkins: sorry for being a newb - i was defining @font_size which was aleady an instance variable, apparently
<csalvato>
stephenjudkins: was just banging my head on the wall for a while and couldn't get it, thanks a lot
<stephenjudkins>
csalvato: i didn't even have to tell you anything, really…
jaygen has joined #ruby
<stephenjudkins>
IMO you should avoid inheritance whenever you can
<csalvato>
didn't realize i could look at the source, stephenjudkins
<stephenjudkins>
when you don't control the base class
<stephenjudkins>
you can end up stepping on the internal implementation of stuff you don't control
<csalvato>
stephenjudkins: yeah that makes sense - i thought ruby inheritence was more protected, such that the variables need to be particularly flagged for inheritance
<csalvato>
but apparently i was wrong >.<
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<csalvato>
still new - sorry for being a bother :D
daniel_-_ has joined #ruby
equus has joined #ruby
jrist is now known as jrist-afk
jonathanwallace has joined #ruby
obryan has joined #ruby
flagg0204 has quit [Quit: leaving]
seanyo has joined #ruby
u89 has joined #ruby
undersc0re97 has quit [Quit: Leaving]
undersc0re97 has joined #ruby
rafter has quit [Remote host closed the connection]
headius has joined #ruby
elentras has quit [Quit: Quitte]
chussenot has quit [Quit: chussenot]
csalvato has quit [Quit: csalvato]
undersc0re97 has quit [Client Quit]
elentras has joined #ruby
elentras_ has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
elentras_ has quit [Remote host closed the connection]
elentras has quit [Remote host closed the connection]
elentras has joined #ruby
qwerxy has joined #ruby
tvw has joined #ruby
aaronmacy has joined #ruby
robbyoconnor has quit [Ping timeout: 260 seconds]
flagg0204 has joined #ruby
xorigin has joined #ruby
C0deMaver1ck has quit [Read error: Connection reset by peer]
minijupe has quit [Ping timeout: 252 seconds]
cdehaan has joined #ruby
alerticus has quit [Ping timeout: 240 seconds]
pcarrier has quit []
Nisstyre-laptop has quit [Quit: Leaving]
u89 has quit [Remote host closed the connection]
<cdehaan>
Hello! I'm getting a UTF-8 error that seems to correspond with a CSV::MalformedCSVError, but I can't quite figure out why or what to do about it. Error here: http://pastebin.com/PGSuvGbk Any ideas?
ethik has joined #ruby
arturaz_ has quit [Remote host closed the connection]
Drewch has quit [Read error: Connection reset by peer]
l3ck has joined #ruby
caleb_io has quit [Quit: caleb_io]
monokrome1 has joined #ruby
schaary has quit [Quit: Leaving.]
daniel_-_ has quit [Ping timeout: 240 seconds]
Servidorv has joined #ruby
l3ck has quit [Client Quit]
nat26101 has quit [Quit: Leaving.]
LastBeerEver has quit [Ping timeout: 246 seconds]
<Servidorv>
hey guys
<Servidorv>
how are you
<Servidorv>
??
kil0byte has joined #ruby
nat2610 has joined #ruby
ethik has left #ruby [#ruby]
heftig has joined #ruby
<Ry>
cdehaan: you've just provided the error with no data for us to wonder about.. but if you'd read it, it says " Unquoted fields do not allow \r or \n (line 1)."
LastBeerEver has joined #ruby
tenmilestereo has joined #ruby
<cdehaan>
Ry: Apologies, this is tough because it's a github project that I downloaded that they claim works (though I can't get it to), and I'm not super familiar with Ruby. I seem to be having Encoding errors, though, and I think this is part of it, note the UTF-8 warning at the beginning of the file.
<stephenjudkins>
cdehaan: the UTF-8 warning comes from mysql
<stephenjudkins>
are you talking to mysql?
<cdehaan>
Yes.
binroot has quit [Ping timeout: 255 seconds]
dekroning has joined #ruby
whitedawg has quit [Quit: Leaving.]
<stephenjudkins>
cdehaan: there is nothing in the stack trace that indicates this is involved. further, we have no isea what the data is, where it's coming from, or any other context
<stephenjudkins>
further, the error seems pretty clear. have you confirmed that the CSV is, in fact, not malformed?
Ry_ has joined #ruby
alerticus has joined #ruby
jayteesr has joined #ruby
<Ry_>
cdehaan: it's non-trivial to assist you without some example of the data you're using, I mean it says pretty clearly that your csv data is malformed?
pkrnj has quit [Quit: Computer has gone to sleep.]
apeiros_ has joined #ruby
mahmoudimus has joined #ruby
Ry has quit [Ping timeout: 245 seconds]
Ry_ is now known as Ry
<shevy>
anyone of you guys know how to store binary numbers in yaml files?
<shevy>
so I can use them in ruby, when loading that yaml file
pkrnj has joined #ruby
<GorbiE>
anyone that know work fine with mechanize. would like send my code to try find what i'm missing the code please. urgent!
LastBeerEver has quit [Ping timeout: 240 seconds]
fms has joined #ruby
<cdehaan>
Ry_, stephenjudkins: This is all true, I think the error is actually stemming from encoding problems at the database level. Is there a way to resolve that warning?
emmanuelux has joined #ruby
itchyouch has joined #ruby
<stephenjudkins>
cdehaan: i have no idea what the exact problem is
Rydefalk has quit [Read error: Connection reset by peer]
LastBeerEver has joined #ruby
<Maoz>
Could anyone please help me converting an array to hash using the map method in git://gist.github.com/4061349.git?
Rydefalk has joined #ruby
<stephenjudkins>
why do you believe the error is caused by DB encoding problems?
linoj has quit [Read error: Connection reset by peer]
<cdehaan>
stephenjudkins: Because I was told by the developer that if there were any UTF-8 encoding issues, that it could cause issues with importer.rb, which is where I'm seeing the CSV error.
<itchyouch>
Is there a shorthand way in ruby like in bash to do something like: [[ $var1 == $var2 ]] && echo x
linoj has joined #ruby
kirun has joined #ruby
bluOxigen has quit [Remote host closed the connection]
<cdehaan>
stephenjudkins: I'm doing my best, like I said, I didn't write this code, have been assured that it works, and I'm trying my best, but I don't know exactly how to figure it out either. I do appreciate your help.
<stephenjudkins>
cdehaan: the error says you have a malformed CSV; have you confirmed the CSV is properly formed?
<itchyouch>
Actually, id be doing && echo $var1, so I guess puts #{var1} ?
<cdehaan>
stephenjudkins: It's a TSV, the relevant line is: header = CSV.open(decompressed_file, "r", :col_sep => "\t", :row_sep => line_separator, :quote_char => '"').first
haxrbyt__ has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
aquaranto has quit [Remote host closed the connection]
binroot has joined #ruby
<cdehaan>
stephenjudkins: And the files seem completely fine when I open them on my mac.
<cdehaan>
stephenjudkins: And that is what leads me to believe that perhaps my computer is understanding the UTF-8 encoding properly, but that something in the ruby file is not.
<shevy>
and if it will be merged, what will you say?
<GorbiE>
shevy: u understand about mechanize? would like send u my code to try find anything i'm missing..
clj_newb has quit [Ping timeout: 260 seconds]
robbyoconnor has joined #ruby
<davidcelis>
shevy: so leave a comment on the pull request voicing your concerns
u89 has joined #ruby
<shevy>
GorbiE: I used to use mechanize years ago, then it switched to nokogiri, which did not work for me back then. I haven't looked back at it
c0rn has quit [Quit: Computer has gone to sleep.]
ij has quit [Read error: Connection reset by peer]
somazero has joined #ruby
Michael_ has joined #ruby
<shevy>
now I have to wait until the merge is in
<GorbiE>
shevy: my problems are related with submit buttons, can I send you my code ? I also can show you the output i got from the terminal it's smething related to the submit buttons
<davidcelis>
shevy: why would you have to wait? there's a big comment box
<shevy>
I have not used it GorbiE, how could I help?
<davidcelis>
shevy: leave a "hey fuck you and your class variables, buddy" comment or something
<shevy>
davidcelis: eh? why should I do that?
ij has joined #ruby
robertotauille has quit [Quit: Leaving...]
<davidcelis>
why shouldn't you?
<shevy>
it's up to matz entirely
<davidcelis>
you seem to care that they might make it in
<shevy>
yup, I hate them
<davidcelis>
you think matz and other ruby commiters don't listen to the community?
<shevy>
hmm for the most part, no. or rather, you need to give extremely convincing arguments
<shevy>
they have the advantage that a lot of working ruby code relies on class variables
<davidcelis>
gross
<davidcelis>
apparently mruby has survived without them so far
nomenkun has quit [Remote host closed the connection]
<shevy>
yeah, it's tiny still
<davidcelis>
wait
<davidcelis>
lol dude, mruby already has class variables
<Kovensky>
<shevy> we will never get rid of them <-- why would you get rid of them
<davidcelis>
that's just a method to return an array of them
<GorbiE>
bahhhhhh
<davidcelis>
god
noyb has joined #ruby
frem has joined #ruby
<shevy>
Kovensky: I see no real valid use case for them
horofox has quit [Quit: horofox]
JeanMertz has joined #ruby
<shevy>
the only one I found so far was to keep a counter of how many instances of a class were created
<Kovensky>
limited-scope globals
<Beoran_>
yeahn I don't mind clas variables.
<Beoran_>
even in mruby
<Kovensky>
lets you have globals around that don't pollute the ENTIRE global scope
chrisbolton has joined #ruby
<shevy>
and constants in namespaces? you can change them in ruby too
<Kovensky>
and not everything is haskell-pure that you don't need globals
alfism has quit [Quit: alfism]
haxrbyte has joined #ruby
adeponte has quit [Remote host closed the connection]
<Maoz>
Could anyone please help me converting an array to hash using the map method in https://gist.github.com/4061349 ? (I fixed the link)
<samara>
Hi, I need to Extract map information from photos.. can that be done using ruby?
ltsstar has quit [Quit: ltsstar]
clj_newb has quit [Ping timeout: 256 seconds]
jrist-afk is now known as jrist
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
clj_newb has joined #ruby
pkrnj has joined #ruby
bluenemo has quit [Read error: Connection reset by peer]
enderx86 has joined #ruby
Neomex has joined #ruby
enderx86 has quit [Remote host closed the connection]
<fms>
samara: when you say map information what you mean?
<samara>
fms: geo map info
Mkman has quit [Quit: Lost terminal]
jslowe has joined #ruby
Neomex has quit [Client Quit]
codecaster has joined #ruby
Uranio has quit [Remote host closed the connection]
<fms>
samara: I think you can use this : http://exifr.rubyforge.org/ I use it to extract other kind of information but I think the lat/lon are part of exif as well
<samara>
hmm will check it out thanks fms =)
qubit has joined #ruby
<fms>
samara: you are welcome
Markvilla has joined #ruby
Markvilla has quit [Client Quit]
lowg has quit [Read error: Connection reset by peer]
lowg has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
haxrbyte has quit [Remote host closed the connection]
samara has quit [Quit: Page closed]
Amirh1 has quit [Quit: Leaving.]
nat2610 has quit [Quit: Leaving.]
geekbri has quit [Remote host closed the connection]
nat2610 has joined #ruby
stayarrr has joined #ruby
arya_ has quit [Ping timeout: 252 seconds]
philcrissman has quit [Remote host closed the connection]
<qubit>
in a rails app, how would I run a bit of code in the background on a specific interval (every few seconds)? I see lots of solutions using cron, or cron-like implementations, but these seem to only go down to the minute and/or require using external tools (I want to keep everything completely within the application, no external anything). I'm coming from a perl background, and my solution there would be an interval timer which forks off the worker and exits w
<Beoran_>
qubit, I think that would work, by playing with processes or threads, however, it might be better to get some externam dependencies or libraries in
Tuxist has quit [Read error: Connection reset by peer]
techazard has quit [Quit: This computer has gone to sleep]
Daman has joined #ruby
timonv has joined #ruby
chrishunt has joined #ruby
tbrock has joined #ruby
insulator has joined #ruby
Appineer has quit [Remote host closed the connection]
seanyo has joined #ruby
cmarques has quit [Ping timeout: 246 seconds]
tvw has joined #ruby
<qubit>
Eiam: not periodic per client, but periodic for the application itself. The application needs to generate some data which is stored in a cache. this generation needs to run every few seconds so that it's ready for requests that come in
<qubit>
...and so that clients don't have to wait for the data to be generated
pfaff has quit [Quit: leaving]
<Elico>
Anyone have an idea of chat from html\web point of view?
emergion has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
codecaster has quit [Read error: Connection reset by peer]
insulator has quit [Remote host closed the connection]
<workmad3>
mrbrdo: I'd extract the condition into a method (or several methods) that kept it to a single line
SuperrMann has joined #ruby
<mrbrdo>
workmad3: yeah I understand I can refactor
<mrbrdo>
but when bad comes to worse, what to do?
sailias has joined #ruby
<workmad3>
mrbrdo: I fail to see how you can end up in a situation where you couldn't refactor it...
sailias has quit [Client Quit]
<mrbrdo>
workmad3: sometimes there is no time to refactor or whatever
<workmad3>
mrbrdo: if you're that time constrained, you won't have time to indent either...
<mrbrdo>
do you think there is no "convetion" of how people usually do it?
<mrbrdo>
except for refactoring of course
<mrbrdo>
I know it's the right thing to do but I'm just wondering about the indenting
niklasb has quit [Ping timeout: 252 seconds]
<workmad3>
mrbrdo: the only 'convention' I've seen is 'don't do that shit'
itchyouch has joined #ruby
<mrbrdo>
workmad3: I'll give you another example
<workmad3>
mrbrdo: I don't need examples, I know what you mean
<mrbrdo>
say you have a long AR chain (where().order()… whatever)
<mrbrdo>
and you call .each at the end
<workmad3>
mrbrdo: I'd break it up
<mrbrdo>
but again how to indent it ;)
<mrbrdo>
you could extract into a scope I know, but lets say you have a very specific query you use only here
<workmad3>
mrbrdo: this is like asking 'how to test this really crappy class with TDD', the answer is 'you don't get there in the first place'
<workmad3>
mrbrdo: I'd split it over multiple lines
<mrbrdo>
workmad3: would you assign to a var in each line or just continue the first line?
<workmad3>
mrbrdo: assign to a var
Iszak_ has joined #ruby
<mrbrdo>
okay I guess then there is no indent problem
<mrbrdo>
thanks for some insight
<workmad3>
mrbrdo: because long chains of calls don't look good indented
<mrbrdo>
yeah especially if you .each at the end, then the code in the block will have the same indentation
insulator has joined #ruby
<mrbrdo>
I actually like chains in multiple lines in Ruby 1.9 if you just assign it to something
<mrbrdo>
because you can put the dot in the next line start
hackerdude has joined #ruby
dekroning has left #ruby [#ruby]
<mrbrdo>
I wish there was a .= operator :)
swex has joined #ruby
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
<workmad3>
mrbrdo: long chains of methods like that and assigning to the same variable is frequently an anti-pattern
<workmad3>
mrbrdo: it's only because AR provides a query-builder fluent interface that makes it reasonable (and I wouldn't want a language operator making this seem ok all over the place)
csaunders has quit [Quit: Computer has gone to sleep.]
<mrbrdo>
I see
<mrbrdo>
although
<mrbrdo>
I do find myself often doing a lot of "map-reduce"-like things in ruby nowadays
<mrbrdo>
and I think there are some problems with the syntax in this case
reset has quit [Read error: Connection reset by peer]
<mrbrdo>
mostly with the indenting and if using do/end it looks ugly to chain on end, but I guess I can use {}
moted has quit [Remote host closed the connection]
yalue has quit [Read error: Connection reset by peer]
<workmad3>
it increases the vertical height, but it still has the same amount of information
butblack has joined #ruby
<workmad3>
but not as heavily compressed
Michael_ has quit [Remote host closed the connection]
<workmad3>
a long chain isn't shorter, it's just denser
<mrbrdo>
yeah but objects = ary.map do .. ; selected_objects = objects.compact.select do … It's kind of redundant information in a way
<mrbrdo>
instead of ary.map { }.compact.select { }
SmoothSage_ has quit [Ping timeout: 246 seconds]
bigmcq77 has quit [Quit: Computer has gone to sleep.]
<workmad3>
sure, if you're naming your vars like that
<mrbrdo>
there's less noise
codecaster has quit [Quit: Leaving.]
<workmad3>
but then, selected_objects is a shit name
<mrbrdo>
well how would you name them?
nitti has quit [Remote host closed the connection]
<workmad3>
depends on what I'm selecting :P
iamjarvo has quit [Quit: Computer has gone to sleep.]
<mrbrdo>
let me try find an example where I did this
niklasb has joined #ruby
LucidDreamZzZ has quit [Ping timeout: 276 seconds]
jonathanwallace has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
cakehero has quit [Quit: Computer has gone to sleep.]
bigmcq77 has joined #ruby
<mrbrdo>
not exactly what we are talking about right now, but one example, how would you write it: http://pastie.org/5368415 (its just random part of a project, I didn't put extra thought in it)
<mrbrdo>
here is also an example of one-liner ifs problem when you have a long command to run if… :) since you can't really split it up into multiple lines
<apeiros_>
mrbrdo: coll an AR class?
<apeiros_>
/instance
<mrbrdo>
it's not AR here
<mrbrdo>
it's mongo
<apeiros_>
k, in AR, you could just do .find(model: assigned_model)
<apeiros_>
instead of supplying both, _type and _id
<workmad3>
:)
xorigin has quit [Quit: leaving]
jonathanwallace has joined #ruby
Morkel has joined #ruby
bwlang has left #ruby [#ruby]
<mrbrdo>
apeiros_: I know, but this is beside the point anyway, I am talking about splitting long lines and indentation and so on
<workmad3>
mrbrdo: it's not besides the point
cdehaan has joined #ruby
<equus>
if people here have a class def with class methods and instancem ethods in it, do they always define the class methods first?
<equus>
...or last/
<workmad3>
mrbrdo: because it's things like that which you need to know in order to reduce the length of lines and avoid having to split them
<equus>
?
<mrbrdo>
workmad3: it could just as easily be 3 random attributes
<cdehaan>
Hello! I've got a ruby project that I'm trying to use "adapter: mysql2" with, but I keep getting the error: no such file to load -- dm-mysql2-adapter. However, my Gemfile includes dm-mysql-adapter, and as far as I can tell there's no dm-mysql2-adapter. Any ideas?
<workmad3>
mrbrdo: except that it isn't
<mrbrdo>
sorry but you don't see my point
<workmad3>
mrbrdo: context matters... I couldn't really say what I'd do with that code tbh, because I don't have enough surrounding context
<workmad3>
mrbrdo: you're looking for style guides
<workmad3>
mrbrdo: google them
<mrbrdo>
exactly
<apeiros_>
mrbrdo: don't do long lines
<apeiros_>
don't be afraid of local variables
<workmad3>
mrbrdo: I'm telling you that I'd avoid that type of code
<apeiros_>
they give meaning to code
<apeiros_>
lvars are awesome
<workmad3>
mrbrdo: and you're saying 'but what if you didn't' and *you* can't seem to grasp that I *do*, so the question is immaterial
<apeiros_>
they're the letters in your code soup
allsystemsarego has quit [Quit: Leaving]
OliverEiman is now known as hderms
<workmad3>
mrbrdo: I know exactly what your 'point' is though... it's just one that I cba to answer because it's such a pointless 'what-if' tail-chasing exercise in futility
<workmad3>
mrbrdo: so instead I try to give you useful advice
linoj has quit [Quit: linoj]
<workmad3>
mrbrdo: which apeiros_ has just repeated ;)
<mrbrdo>
well I don't agree. you can't always avoid having a long line, and even if you can most of the time it will take considerably more time to refactor than just styling for readability. you very well know (I hope) that not always you have the luxury of time to refactor everything. yes it leads to worse code but in IT resources are limited
<mrbrdo>
I know what you're saying and yes probably in 99% you can just avoid the issue by refactoring. So yeah I won't argue anymore about it, but I think it's useful to think about these kind of issues also.
<apeiros_>
…
hackerdude has quit [Remote host closed the connection]
psykotron has quit [Remote host closed the connection]
<apeiros_>
mrbrdo: you've gotten good advice. go with it, or ignore it.
<mrbrdo>
apeiros_: I didn't really get any new information...
<workmad3>
mrbrdo: if I'm in the 1% of the time I still wouldn't think about it
mnaser has quit [Excess Flood]
<apeiros_>
mrbrdo: then here's another "not new information": there's no silver bullets.
Banistergalaxy has quit [Ping timeout: 260 seconds]
<workmad3>
mrbrdo: I'd just use the indentation that my editor had and not care about it
<apeiros_>
there's no general and overarching rule.
<mrbrdo>
apeiros_: there can be code style recommendations...
<apeiros_>
but what you've posted is code soup.
<apeiros_>
and workmad3 and I told you how to make it readable.
<mrbrdo>
you did?
Takehiro has joined #ruby
cakehero has joined #ruby
khakimov has joined #ruby
<apeiros_>
yes. but it seems you're a full glass. hard to fill in more.
<mrbrdo>
by refactoring i don't know 30 characters into 15
h4mz1d has quit [Ping timeout: 260 seconds]
<mrbrdo>
you really solved that problem thanks
<workmad3>
mrbrdo: actually, more likely you'll increase the number of characters
<workmad3>
mrbrdo: but you'll make it more readable :P
<apeiros_>
mrbrdo: are you really seeking advice? seems to me you're just out for a fight.
<davidcelis>
Everybody ready for today's RUBY METAPROGRAMMING CHALLENGE!?
insulator has quit [Remote host closed the connection]
<davidcelis>
GorbiE: who are you and why did you just PRIVMSG me
<GorbiE>
need some help with my private code
jrajav has quit [Ping timeout: 245 seconds]
<GorbiE>
thats why pmed u
<Spaceghostc2c>
GorbiE: WHO ARE YOU AND WHY DID YOU JUST PRIVATE MESSAGE davidcelis?!
bbttxu has quit [Quit: bbttxu]
<davidcelis>
do i know you?
<GorbiE>
no
<workmad3>
are you paying him?
<Spaceghostc2c>
davidcelis: Do I know you?
<davidcelis>
then why did you PM me?
<davidcelis>
Spaceghostc2c: !davidcelis
<davidcelis>
oh wtf this is #rubby!?
AxonetBE has joined #ruby
<Spaceghostc2c>
GorbiE: You know what they call people who help privately, right? Consultants.
insulator has joined #ruby
CamonZ has joined #ruby
insulator|away has joined #ruby
<Spaceghostc2c>
Until then, your code is not special, it isn't private, and it isn't all that interesting. :D
insulator has quit [Remote host closed the connection]
<davidcelis>
$125/hr, or you can get public help here for free
insulator|away has quit [Remote host closed the connection]
<Spaceghostc2c>
davidcelis: Are you running a charity?
* erichmenge
only charges $100/hr
<davidcelis>
yeah bro
<davidcelis>
tax benefits
<Spaceghostc2c>
Seems like it bruv.
<erichmenge>
Though, no one has ever taken me up on it so... I guess I can't really say that as if it occurs.
k610 has joined #ruby
<apeiros_>
^^
<cdehaan>
Does anyone know why using rake with MySQL defined in my database.yml would produce: warning: "Encoding UTF8 is not a known Ruby encoding for MySQL"
Russell^^ has joined #ruby
minijupe has quit [Quit: minijupe]
nitti has joined #ruby
LouisGB has quit [Ping timeout: 255 seconds]
emptyflask has quit [Remote host closed the connection]
swex has quit [Read error: Connection reset by peer]
k610 has quit [Ping timeout: 268 seconds]
Cultofmetatron has quit [Ping timeout: 246 seconds]
swex has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
joshman_ has quit [Ping timeout: 246 seconds]
jrist is now known as jrist-afk
UberNerdGirl_ has joined #ruby
<UberNerdGirl_>
greetings.. what are some good irc chatbot libraries?
qwerxy has joined #ruby
v0n has quit [Ping timeout: 268 seconds]
mercwithamouth has quit [Ping timeout: 248 seconds]
Slivka has quit [Remote host closed the connection]
<hderms>
UberNerdGirl_: i'll get back to you in a second
chichou_ has quit [Remote host closed the connection]
<shevy>
everyone's redirecting to cinch
nari_ has joined #ruby
emptyflask has joined #ruby
<davidcelis>
HTTP 303 SEE CINCH
noyb has quit [Ping timeout: 276 seconds]
ndrei has quit [Read error: Connection reset by peer]
Iszak_ has quit []
BrianJ has joined #ruby
dakine has joined #ruby
<shevy>
hmm what is the rationale for a module to be unable to store data on its own?
<apeiros_>
shevy: hu?
<apeiros_>
a module is an object, of course it can store information
<shevy>
hmm but how would you store a hash in a module?
workmad3 has quit [Ping timeout: 246 seconds]
beiter has quit [Quit: beiter]
<equus>
shevy: module MyModule; @my_hash = { :shevy_is_a_noob => tru e}; end
<shevy>
equus: quit trolling one day
nari_ has quit [Ping timeout: 245 seconds]
blacktulip has quit [Remote host closed the connection]
ndrei has joined #ruby
reinaldob has quit [Remote host closed the connection]
jslowe has quit [Read error: Connection reset by peer]
nitti has quit [Remote host closed the connection]
jds_ has joined #ruby
reinaldob has joined #ruby
anachronistic has quit [Quit: anachronistic]
reinaldob has quit [Remote host closed the connection]
<Maoz>
Another quesion, I have an array[1] of hashes like [{"date"=>"1/1", "morning_meetings"=>5}, {"date"=>"1/1", "evening_meetings"=>3}, {"date"=>"1/2", "morning_meetings"=>10] and I would like to know how can I get [{date"=>"1/1", "morning_meetings"=>5, "evening_meetings"=>3}, {"date"=>"1/2", "morning_meetings"=>10}]
k610 has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9.1]
<Maoz>
please ignore the [1]
tenmilestereo has quit [Quit: Leaving]
Edward_ has joined #ruby
macabre has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
philcrissman has joined #ruby
AndroUser has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
philcrissman has quit [Remote host closed the connection]
k610 has quit [Ping timeout: 256 seconds]
<apeiros_>
the second one looks exactly like the first?
<apeiros_>
minus syntax errors? (typos?)
k610 has joined #ruby
iamjarvo has joined #ruby
philcrissman has joined #ruby
reinaldob has joined #ruby
<shevy>
hmm you want to merge corresponding entries into the proper array
AndroUser has quit [Client Quit]
<shevy>
but using a hash would be easier
<apeiros_>
ah, seems to merge a part of the information, but not clear by what rule
alanp has quit [Read error: Connection reset by peer]
<rossimatteo>
77 chat
<shevy>
hehe
jenrzzz has joined #ruby
<Maoz>
just merge, almost like the first one
<shevy>
hash['1/1'] = "hi"
<shevy>
hash['1/2'] = "hi"
peregrine81 has quit [Quit: Computer sleeping.]
wroathe has joined #ruby
<shevy>
now that's an unusual key but it seems to work
alanp has joined #ruby
<apeiros_>
it's a string
<apeiros_>
how's a string an unusual key?
philcrissman has quit [Remote host closed the connection]
rossimatteo has quit [Remote host closed the connection]
<apeiros_>
anyway, any object works as key as long as it properly supports #hash and #eql?
apeiros has joined #ruby
k610 has quit [Ping timeout: 276 seconds]
<Maoz>
apeiros_, the rule is by date, I got lost there with the hash/array...
k610 has joined #ruby
nari_ has joined #ruby
<apeiros>
Maoz: get a hash with date as key and merge the values on it
freakazoid0223 has joined #ruby
<Maoz>
I'm a c++ developer, and I cannot get used to ruby :_
alanp_ has quit [Ping timeout: 256 seconds]
AxonetBE has quit [Quit: Leaving.]
Michael_ has quit [Remote host closed the connection]
Nykolla has joined #ruby
Michael_ has joined #ruby
<shevy>
well, if you change your array into a hash, it will look easier and cleaner
jrajav has quit []
<apeiros>
by_date = ary.group_by { |h| h["date"] }; by_date.each do |key, hashes| by_date[key] = hashes.inject(&:merge) end
<Maoz>
how should I change the array into hash :)?
apeiros_ has quit [Ping timeout: 245 seconds]
<apeiros>
by iterating over it. or by using above code.
<Maoz>
Thanks, you are a life saver!
reinaldob has quit [Remote host closed the connection]
rmcafee_ has joined #ruby
davehimself has quit [Read error: Connection reset by peer]
butblack has quit [Quit: butblack]
Morkel has quit [Quit: Morkel]
davehimself has joined #ruby
thinkdevcode has quit [Remote host closed the connection]
k610 has quit [Ping timeout: 256 seconds]
centipedefarmer has quit [Remote host closed the connection]
equus has quit [Read error: Connection reset by peer]
hsbt is now known as hsbt_away
k610 has joined #ruby
Monie has quit [Quit: Quit]
fantazo has joined #ruby
rmcafee has quit [Ping timeout: 245 seconds]
TechZombie has joined #ruby
reinaldob has joined #ruby
Serial_Killer_C has quit [Remote host closed the connection]
h4mz1d has joined #ruby
k610 has quit [Ping timeout: 260 seconds]
k610 has joined #ruby
Juul has joined #ruby
bluehavana has joined #ruby
hackerdude has joined #ruby
Michael_ has quit [Remote host closed the connection]
monokrome1 has quit [Ping timeout: 260 seconds]
Michael_ has joined #ruby
rudolf_ has joined #ruby
kpshek has quit []
adeponte has joined #ruby
k610 has quit [Ping timeout: 255 seconds]
maxer has quit [*.net *.split]
friskd has quit [*.net *.split]
BrianJ has quit [*.net *.split]
daniel_- has quit [*.net *.split]
Mon_Ouie has quit [*.net *.split]
dstywho has quit [*.net *.split]
sepp2k1 has quit [*.net *.split]
shtirlic has quit [*.net *.split]
awarner has quit [*.net *.split]
meekohi has quit [*.net *.split]
tnk1 has quit [*.net *.split]
ipsifendus has quit [*.net *.split]
wallerdev has quit [*.net *.split]
mrkris has quit [*.net *.split]
healpay has quit [*.net *.split]
radic has quit [*.net *.split]
francisfish has quit [*.net *.split]
bier has quit [*.net *.split]
Liothen has quit [*.net *.split]
RandyInLA has quit [*.net *.split]
anildigital_work has quit [*.net *.split]
shammancer has quit [*.net *.split]
tr4656 has quit [*.net *.split]
thorncp has quit [*.net *.split]
SegFaultAX has quit [*.net *.split]
sphera has quit [*.net *.split]
ddv has quit [*.net *.split]
Spaceghost|cloud has quit [*.net *.split]
perun_ has quit [*.net *.split]
lupine_85 has quit [*.net *.split]
SecretAgent has quit [*.net *.split]
Poapfel has quit [*.net *.split]
maddog_ has quit [*.net *.split]
jrist-afk has quit [*.net *.split]
stigmux has quit [*.net *.split]
jeedey has quit [*.net *.split]
ohcibi has quit [*.net *.split]
mephux has quit [*.net *.split]
dash_ has quit [*.net *.split]
kiela has quit [*.net *.split]
rmc3 has quit [*.net *.split]
phrame has quit [*.net *.split]
oddraisin has quit [*.net *.split]
peregrine81 has joined #ruby
k610 has joined #ruby
maxer has joined #ruby
shtirlic has joined #ruby
mmitchell has joined #ruby
ohcibi has joined #ruby
<rudolf_>
Often in Ruby I see that ppl are defining the set/get methods for an instance variable using attr_accessor. But in the initialize method it's common to set the init values using @foo = foo instead of self.foo = foo. Why is that? Shouldn't it be better to actual set the values via the defined setter?
TonyPCB has joined #ruby
theRoUS has quit [Ping timeout: 276 seconds]
havenn has quit [Remote host closed the connection]
h4mz1d has quit [Ping timeout: 260 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
<TonyPCB>
is this chat a forum for Ruby on rails?
SecretAgent has joined #ruby
<TonyPCB>
nvm
<TonyPCB>
:D
stigmux has joined #ruby
tpe11etier has quit [Ping timeout: 260 seconds]
nwertman has joined #ruby
jonan has quit [Quit: jonan]
k610 has quit [Ping timeout: 252 seconds]
carlyle has quit [Remote host closed the connection]
mmitchell has quit [Ping timeout: 264 seconds]
k610 has joined #ruby
reinaldob has quit [Remote host closed the connection]
jds_ has quit [Remote host closed the connection]
lenovodroid has joined #ruby
<reactormonk>
TonyPCB, #rubyonrails
<reactormonk>
rudolf_, what's your background?
DrShoggoth has quit [Quit: Leaving]
TonyPCB has left #ruby ["Leaving"]
alex__c2022 has quit [Quit: alex__c2022]
medik has joined #ruby
medik has quit [Excess Flood]
BrianJ has joined #ruby
daniel_- has joined #ruby
sepp2k1 has joined #ruby
friskd has joined #ruby
mrkris has joined #ruby
ipsifendus has joined #ruby
Mon_Ouie has joined #ruby
awarner has joined #ruby
dstywho has joined #ruby
wallerdev has joined #ruby
meekohi has joined #ruby
tnk1 has joined #ruby
bier has joined #ruby
francisfish has joined #ruby
radic has joined #ruby
Liothen has joined #ruby
RandyInLA has joined #ruby
anildigital_work has joined #ruby
shammancer has joined #ruby
SegFaultAX has joined #ruby
tr4656 has joined #ruby
thorncp has joined #ruby
ddv has joined #ruby
sphera has joined #ruby
Spaceghost|cloud has joined #ruby
perun_ has joined #ruby
lupine_85 has joined #ruby
dash_ has joined #ruby
Poapfel has joined #ruby
maddog_ has joined #ruby
jrist-afk has joined #ruby
jeedey has joined #ruby
mephux has joined #ruby
rmc3 has joined #ruby
oddraisin has joined #ruby
kiela has joined #ruby
phrame has joined #ruby
<shevy>
rudolf_: I always use methods to manipulate or query ivars
4JTAANFMQ has joined #ruby
[Neurotic] has quit [Excess Flood]
k610 has quit [Ping timeout: 255 seconds]
4JTAANFMQ has quit [Client Quit]
ephemerian has joined #ruby
<rudolf_>
reactormonk: nothing really, just curious. Whats the advantage?
jaygen has quit [Remote host closed the connection]
[Neurotic] has joined #ruby
twinturbo has joined #ruby
<reactormonk>
rudolf_, I could make some references to java/c++ fields vs. accessors
<shevy>
rudolf_: no, I never do self.bla within a method either
butblack has joined #ruby
<reactormonk>
rudolf_, usually, it's an initialization problem. Some of the setters might expect other stuff to be setup already, so you want your constructor as self-containing as possible
<shevy>
rudolf_: what I usually do is, when the class gets bigger, use a reset() method to set to default states, and a separate run() method that is called when things were all setup properly
<rudolf_>
shevy: yeah I see a lot of ppl doing like that
<rudolf_>
reactormonk: okay, that's enough reason for me, thanks!
nari_ has quit [Ping timeout: 240 seconds]
k611 has joined #ruby
k610 has quit [Ping timeout: 245 seconds]
kirun has quit [Quit: Client exiting]
C0deMaver1ck has quit [Read error: Connection reset by peer]
tvw has quit [Remote host closed the connection]
nari_ has joined #ruby
sj26 has quit [Ping timeout: 245 seconds]
alejandro_ has quit [Remote host closed the connection]
ilyam has quit [Remote host closed the connection]
phelps has quit [Read error: Operation timed out]
epochwolf has quit [Ping timeout: 245 seconds]
ilyam has joined #ruby
Virunga has quit [Remote host closed the connection]
tr4656 has quit [Ping timeout: 240 seconds]
phelps has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
samphippen has joined #ruby
Michael_ has quit [Remote host closed the connection]
mengu_ has quit [Ping timeout: 245 seconds]
JeanMertz has quit []
epochwolf has joined #ruby
k611 has quit [Ping timeout: 252 seconds]
<davidcelis>
where'd equus go
<davidcelis>
i wanted to tell him that was a good play
jeffreybaird has quit [Quit: jeffreybaird]
k610 has joined #ruby
C0deMaver1ck has joined #ruby
C0deMaver1ck has quit [Remote host closed the connection]
ilyam_ has joined #ruby
ilyam_ has quit [Client Quit]
sailias has joined #ruby
sj26 has joined #ruby
ilyam has quit [Ping timeout: 246 seconds]
tommyvyo has joined #ruby
mrkris has quit [Ping timeout: 240 seconds]
k610 has quit [Ping timeout: 265 seconds]
k610 has joined #ruby
Monie has joined #ruby
ephemerian has quit [Quit: Leaving.]
pkrnj has quit [Quit: Computer has gone to sleep.]
stephenjudkins has quit [Quit: stephenjudkins]
qwerxy has quit [Quit: offski]
ipsifendus has joined #ruby
k610 has quit [Ping timeout: 264 seconds]
TechZombie has quit [Quit: Leaving.]
Russell^^ has quit [Quit: Russell^^]
k610 has joined #ruby
meekohi has left #ruby [#ruby]
daniel_- has quit [Ping timeout: 240 seconds]
Michael_ has joined #ruby
k610 has quit [Ping timeout: 240 seconds]
dmiller has joined #ruby
DarthGandalf has quit [Ping timeout: 260 seconds]
k610 has joined #ruby
daniel_- has joined #ruby
kil0byte_ has quit [Ping timeout: 260 seconds]
SCommette has quit [Quit: SCommette]
rellin has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]