<da_goat_milker>
does anyone know of a step by step guide to writing a smiple ruby program?
nateberkopec has quit [Quit: Leaving...]
echooo has joined #ruby
<jhass>
da_goat_milker: wouldn't that lead to always the same program?
nickjj has quit [Ping timeout: 244 seconds]
<jhass>
try tryruby.org
<da_goat_milker>
ya i've tried that
<da_goat_milker>
im thinking like a hangman game
<da_goat_milker>
something that uses classes
st1gma has joined #ruby
mary5030 has quit [Remote host closed the connection]
<da_goat_milker>
i can't find anything taht will walk you through a programmers through process on making somethign like that
<da_goat_milker>
thought* process
tkuchiki has joined #ruby
<jhass>
I think that's because that process is something rather personal
dorei has quit []
<jhass>
you don't ask for a writers thought process or a composers thought process
Lewix has quit [Quit: Leaving...]
<jhass>
programming often involves a lot of creativity too
jtdowney has joined #ruby
jtdowney has quit [Max SendQ exceeded]
danman has quit [Quit: danman]
jtdowney has joined #ruby
lmickh has quit [Remote host closed the connection]
michael4 has joined #ruby
yfeldblum has joined #ruby
skolman_ has quit [Remote host closed the connection]
lw has joined #ruby
machete has quit [Ping timeout: 272 seconds]
<da_goat_milker>
i guess what i mean is...the first thing we need to do is setup a class because xyz
adriancb has joined #ruby
<da_goat_milker>
more of a thought process
<rpag>
yeah, i don't think anything like that exists, most people experiment by themselves and refactor as they go along
jenrzzz has quit [Quit: MTLOV]
machete has joined #ruby
jenrzzz has joined #ruby
eka_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Sgeo has joined #ruby
nickjj has joined #ruby
eka has joined #ruby
<jhass>
da_goat_milker: you only learn that by experience
<jhass>
not by trying to retrofit someones thought process into your brain
<da_goat_milker>
okay
<jhass>
go, try to solve your ideas your way, if it's small enough post it here, once you thought it through, and ask for hints or other versions
<jhass>
you can then ask why someone made that specific decisions and in my experience, since you already thought through it yourself, gain a lot more from that
davasaurous has quit [Remote host closed the connection]
<porfa>
that looks so clean! and more easy to read even for me, i’ve seen all theese ruby examples online on that stye of formating but didn’t knew how to use it
robustus has joined #ruby
Vile` has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
Vile` has joined #ruby
Areessell has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
dkb20k has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
pietr0 has quit [Quit: pietr0]
emmesswhy has quit [Quit: Leaving]
hamakn has joined #ruby
Areessell has quit [Ping timeout: 255 seconds]
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bmurt has quit []
jtdowney has joined #ruby
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aspires has quit []
jtdowney has quit [Max SendQ exceeded]
jtdowney has joined #ruby
jtdowney has quit [Max SendQ exceeded]
jtdowney has joined #ruby
mib_mib has quit [Ping timeout: 250 seconds]
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_djbkd has quit [Quit: My people need me...]
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
owen2 has quit [Ping timeout: 258 seconds]
skolman has joined #ruby
jimmyhoughjr has joined #ruby
tchebb has quit [Ping timeout: 245 seconds]
cpruitt has quit [Quit: cpruitt]
agrinb has joined #ruby
freerobby has joined #ruby
freerobby has quit [Client Quit]
michael4 has quit [Ping timeout: 240 seconds]
skolman has quit [Ping timeout: 250 seconds]
zB0hs has joined #ruby
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tier has joined #ruby
rkalfane has joined #ruby
tchebb has joined #ruby
agrinb has quit [Ping timeout: 265 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Spami has joined #ruby
davasaurous has joined #ruby
poweratom_ has joined #ruby
JaMz has quit []
eka has joined #ruby
arescorpio has joined #ruby
davasaurous has quit [Remote host closed the connection]
melik has quit [Quit: (null)]
davasaurous has joined #ruby
pen has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
Insanity133 has joined #ruby
Spami has joined #ruby
<porfa>
i can’t remove quotation marks from my output :(
<porfa>
specs3 = "#{specs2}".gsub(/",/, '\\n•') when i put the first “ the whole syntax changes, how can i pass the “ with a code/charcode ?
arup_r has joined #ruby
<Cat_1_>
What do you want to remove?
<porfa>
“ <— this
xanderwebs has quit [Quit: Connection closed for inactivity]
<Cat_1_>
why don't you just do specs2.gsub?
<Cat_1_>
Is specs2 a string?
<porfa>
gsub(/160.chr/) ?
fandi has joined #ruby
<Cat_1_>
you want to remove the " contained in the variable specs2?
<nickenchuggets>
yeah, I’m trying to press F6, through tmux, and the terminal
<nickenchuggets>
on a mac
<nickenchuggets>
I thought it was alt, because my macbook air by default uses function keys for other things
viet_power has quit [Ping timeout: 265 seconds]
<nickenchuggets>
like F1 turns down the brightness on a macbook air
<nickenchuggets>
so if I wanted F1 instead of turning down the brightness, I’d have to press like alt+F1… or so I thought
<elemenopy>
do i need to use regular expressions?
msx has joined #ruby
tier has quit []
<nickenchuggets>
ahhh, it’s the fn key
<nickenchuggets>
and aha, I have a ruby server running already
poweratom_ has quit [Remote host closed the connection]
emmesswhy has joined #ruby
poweratom_ has joined #ruby
IrishGringo has joined #ruby
<nickenchuggets>
except it says spring app
<nickenchuggets>
O.o
<bricker`work>
elemenopy: depends what you mean by "parse out"
moritzs has quit [Remote host closed the connection]
<jenrzzz>
anybody want to speculate how Module#prepend is implemented in MRI?
<elemenopy>
so i just need to tie the items index to a buyout or ~b/o somehow in a hash table
<bricker`work>
elemenopy: use Nokogiri, regex is not good at HTML parsing
phutchins has quit [Ping timeout: 245 seconds]
<elemenopy>
im using nokogiri to get the text to that point right now. any ideas on how to get the middle text part tho? i can get all the divs already in a hash
<bricker`work>
elemenopy: text is represented in a nokogiri NodeSet as a special type of node
msmith_ has joined #ruby
<bricker`work>
elemenopy: you'd just have to iterate and check something like, if node.type == "text" && node.content.match(/~b\/o/) or whatever
msmith_ has quit [Read error: Connection reset by peer]
<godd2>
imagine a file cabinet where the folders have names on them. in that example hash, a folder was named :blah and had contents that were the string "hello"
<elemenopy>
so if i needed two keys perrow it would be like? my_hash = {}; my_hash[:index,:buyout] = "0,32ex"
wallerdev has joined #ruby
<godd2>
no, you don't reference more than one key at a time like that
<elemenopy>
should i be using an array then?
<godd2>
probably
<elemenopy>
okey dokey thx!
<godd2>
arrays are useful when you want things in order
<godd2>
hashes are useful when you want to name things.
<godd2>
(among other tradeoffs)
jenrzzz has joined #ruby
tratrala has quit [K-Lined]
mkaesz has quit [Ping timeout: 272 seconds]
SpikeMaster has joined #ruby
wallerdev has quit [Client Quit]
xenomorph is now known as {xenomorph}
yfeldblum has joined #ruby
emmesswhy has quit [Quit: Leaving]
linojon has quit [Quit: linojon]
wallerdev has joined #ruby
{xenomorph} is now known as xenomorph
sambao21 has quit [Ping timeout: 260 seconds]
ixti has quit [Ping timeout: 260 seconds]
aewffwea has quit []
aewffwea has joined #ruby
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
koderok has joined #ruby
lw has quit [Quit: s]
aspires has quit []
mocchi has joined #ruby
SpikeMaster has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
owen2 has joined #ruby
arup_r1 has joined #ruby
aspires has joined #ruby
MrDoctor has quit [Remote host closed the connection]
koderok has quit [Client Quit]
Areessell has joined #ruby
MrDoctor has joined #ruby
arup_r has quit [Ping timeout: 240 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
drexxler has joined #ruby
drexxler has quit [Client Quit]
ClarusCogitatio has quit [Ping timeout: 265 seconds]
marcdel has joined #ruby
mediachicken has joined #ruby
<elemenopy>
this is odd
caveat- has quit [Ping timeout: 260 seconds]
<mediachicken>
Hey, I'm new to ruby and was wondering if anybody would be willing to take a glance at the very short source of my project and maybe give me some pointers/criticism? https://github.com/mediachicken/420
<godd2>
mediachicken it is customary to wrap all of the functionality in your gem inside some namespace
radic has quit [Disconnected by services]
<mediachicken>
godd2: Are you referring to the weirdness between 420 and FourTwenty?
radic_ has joined #ruby
bmurt has quit []
<godd2>
elemenopy when you do Array#push and pass more than one argument, it just pushes each argument as if you pushed separately
<godd2>
mediachicken yes, specifically line 20 in lib/420.rb
caveat- has joined #ruby
<elemenopy>
so based on what we're looking for where would you recommend i look into? we are trying to create an array of two columns. then later in the code we simply want to add rows to aforementioned array
davedev24_ has quit [Remote host closed the connection]
Insanity144 has joined #ruby
mib_mib has quit [Ping timeout: 250 seconds]
<godd2>
elemenopy what you may want to try is pushing arrays into your buyout array.
ClarusCogitatio has quit [Ping timeout: 250 seconds]
<mediachicken>
I was running into issues using a pure numerical name, this was of course after I wanted to call it simply 420, so I was forced to write out an alpha string. Is there no way around this?
caveat- has quit [Read error: Connection reset by peer]
ClarusCogitatio has joined #ruby
<mediachicken>
godd2: Gotcha, I'm not sure why I decided it should have been left outside of a class (or a module?)
<elemenopy>
oh i did it differentlyy, yours looks nicer
KC9YDN has quit [Remote host closed the connection]
Insanity133 has quit [Ping timeout: 244 seconds]
<godd2>
mediachicken yea I would generally expect your timeUntil method to be inside the FourTwenty module. then, from the oustide, you'd call FourTwenty.timeUntil(some_time)
lw has quit [Read error: Connection reset by peer]
<godd2>
mediachicken my other criticism is of your choice of method name there. It seems like timeUntil is going to tell you how long until the time that you pass it, NOT the time between the time you pass and 04:20
lw_ has joined #ruby
<godd2>
but that's a naming issue
<mediachicken>
godd2: What would you suggest for naming?
zachrab has joined #ruby
nahtnam has joined #ruby
ClarusCogitatio has quit [Ping timeout: 255 seconds]
marcdel has joined #ruby
wallerdev has quit [Quit: wallerdev]
<mediachicken>
I seem to struggle with naming quite often. Is there some sort of cheat-sheet for naming, or recommended reading?
<godd2>
timeUntil420 perhaps?
braincrash has quit [Quit: bye bye]
<nahtnam>
Anyone know of a tutorial that shows how to setup testing when creating a gem?
<mediachicken>
godd2: Ah, I gotcha. That makes sense
<godd2>
mediachicken Chapter 2 of Clean Code by Bob Martin
<godd2>
the chapter is titled Meaningful Names
<godd2>
nahtnam which testing framework?
<mediachicken>
godd2: Thank's a lot! I'll check it out
<nahtnam>
godd2: It doesnt really matter to me. I just need some place to get started at. I can learn the rest
benzrf is now known as benzrf|offline
<jhonnyboy>
hey guys, I'm trying to figure out the best way to interact with spreadsheets. I want to be able to read their content and replace the text in certain cells. Any advice? I heard breaking it down to XML is an option
<godd2>
jhonnyboy if I'm not mistaken, excel sheets can be converted to cvs files? I guess formulas are an issue there though, but I haven't looked into it
benzrf|offline is now known as benzrf
<jhonnyboy>
yeah, trying to keep a template together and just modify certain parts of it
<godd2>
nahtnam also, if you're in for the long haul, check out The RSpec Book by the Pragmatic Programmers
Vivekananda has joined #ruby
ClarusCogitatio has joined #ruby
<nahtnam>
godd2: Will do. Im really just making one gem to make life a little easier. I dont expect to make more
oo_ has joined #ruby
Musashi007 has joined #ruby
coderhs has quit [Read error: Connection reset by peer]
davasaurous has quit [Remote host closed the connection]
pen has joined #ruby
Lucky__ has joined #ruby
russt has quit [Quit: russt]
chipotle has quit [Ping timeout: 245 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
agrinb has quit [Ping timeout: 245 seconds]
noop has joined #ruby
rockdon_ has joined #ruby
pen has quit [Ping timeout: 255 seconds]
sigurding has quit [Quit: sigurding]
rockdon_ has quit [Client Quit]
freerobby has quit [Quit: Leaving.]
davedev24_ has quit []
levity_island has joined #ruby
st1gma has quit [Quit: Leaving]
st1gma has joined #ruby
pizzahead has joined #ruby
<pizzahead>
I'm trying to quickly get yesterday date at 00:00:00 and eventually converting to_i for epoch by doing start_time = Time.new((Time.now - 86400).strftime('%Y,%m,%d'))
<pizzahead>
unfortunately the date is fed with quotes which gives back 2014-01-01
poweratom_ has joined #ruby
<pizzahead>
what's the ideal way to do what I'm trying to do?
lxsameer has joined #ruby
lxsameer has joined #ruby
it0a has quit [Ping timeout: 255 seconds]
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
t_mmyv has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<st1gma>
start_time = Time.new - 86400
<st1gma>
start_epoc = start_time.to_i
<st1gma>
Not tested it but I believe it should do what you want
pietr0 has joined #ruby
aganov has joined #ruby
Morkel_ has joined #ruby
t_mmyv has joined #ruby
t_mmyv has quit [Client Quit]
Morkel has quit [Ping timeout: 265 seconds]
Morkel_ is now known as Morkel
emmesswhy has quit [Quit: This computer has gone to sleep]
coderhs has joined #ruby
patrick99e99 has joined #ruby
oo_ has quit [Remote host closed the connection]
Flyingdog has joined #ruby
<pizzahead>
st1gma: so the issue with that is I'm not sure how to round down to midnight
<pizzahead>
st1gma: that's why I was trying to pass just the year,month,date to time.new because it will set time to 00:00:00
sepp2k has quit [Read error: Connection reset by peer]
<shevy>
pizzahead!
<shevy>
you make me hungry
<pizzahead>
shevy!
<pizzahead>
I get that a... bit
<rockdon>
good god, i'm trying to write python to use frida for some things
<shevy>
better than php
D9 has quit [Ping timeout: 260 seconds]
oo_ has joined #ruby
<rockdon>
something as simple as running Array.map{|x| puts if x =~ /this/} makes head explode
michaeldeol has joined #ruby
<rockdon>
its like 10 lines
<rockdon>
haha
<shevy>
hmm
<st1gma>
python way or the hard way
<st1gma>
high way*
<shevy>
but python has regexes as well
<st1gma>
good god.. I think I need to sleep
charliesome has joined #ruby
<st1gma>
So the one thing that drives me mad about Python is the no "end"
<st1gma>
Everything else I'm ok with
tagrudev has joined #ruby
patrick99e99 has quit [Ping timeout: 245 seconds]
<st1gma>
pizzahead, your stuff seems to work just fine for me.
<maasha>
delicate problem: I purged macports in favor of homebrew. However, purging macports broke homebrew. To fix this I need to recompile my ruby, but that errors: bison: error: unable to find utility "bison", not a developer tool or in PATH
<maasha>
hen/egg problem
<maasha>
paradox
<maasha>
c22
agrinb_ has quit [Ping timeout: 265 seconds]
vyorkin has joined #ruby
abuzze has joined #ruby
kaspergrubbe has joined #ruby
luisalima has joined #ruby
JohnBat26 has joined #ruby
wald0 has quit [Client Quit]
<zenspider>
maasha: you have ruby in /usr/bin/ruby as well
<zenspider>
and bison is also in /usr/bin/
<zenspider>
so either it's just a pathing issue, or something like not having dev cmdline tools installed?
<maasha>
zenspider: was purged long time ago to try and fix that nasty gem version bug to install inline.
t_p has quit [Quit: Computer has gone to sleep.]
<zenspider>
sudo xcode-select --install
mile has quit [Quit: 离开]
<zenspider>
purged?
jenrzzz has quit [Ping timeout: 256 seconds]
<zenspider>
don't mess with your base install
jenrzzz_ has joined #ruby
<maasha>
zenspider: I removed the systems ruby
shredding has quit [Quit: shredding]
robustus is now known as robustus|Off
<zenspider>
don't do that
<maasha>
somehow having multiple version of ruby on you machine screws things up.
<zenspider>
inline?
<maasha>
the rubyinline gem
<zenspider>
I'm the author
<zenspider>
I know of no such problem
<maasha>
I know. Luve that gem!!!
josephndenton has joined #ruby
<zenspider>
if you have a problem, please file a bug BEFORE you obliterate your base install
<zenspider>
do you have /usr/bin/bison?
<maasha>
zenspider: yes I have /usr/bin/bison
mile has joined #ruby
<zenspider>
ok. so that's good. `which bison` comes up fine?
bMalum has quit [Quit: bMalum]
mile is now known as garycruise
bMalum has joined #ruby
<maasha>
it does
<zenspider>
kk. that's good
lxsameer has quit [Ping timeout: 255 seconds]
garycruise is now known as garycrusie
rodfersou has joined #ruby
josephndenton has quit [Ping timeout: 240 seconds]
<zenspider>
so, you can hand build / install ruby using --prefix /usr/local/Cellar/ruby/1.2.3
<zenspider>
then use that to bootstrap into the real thing
<maasha>
zenspider: if I run bison --version it says: bison: error: unable to find utility "bison", not a developer tool or in PATH
garycrusie has quit [Client Quit]
<zenspider>
but I highly recommend you reinstall the base ruby package
<zenspider>
huh... ok.
<zenspider>
then run the xcode-select line from above
Insanity133 has quit [Remote host closed the connection]
<maasha>
I did this already, but that was before purging macports
<maasha>
possibly also before purging the system's ruby
<zenspider>
so try it again
<zenspider>
sudo xcode-select --install
<maasha>
Yeah, it fails, it says its not available from the update server.
reinaldob has joined #ruby
<zenspider>
sudo xcode-select --reset
<zenspider>
wtf did you do?
chiel has joined #ruby
Insanity133 has joined #ruby
chiel has joined #ruby
<maasha>
Methinks Apple hates me :o)
einarj has joined #ruby
<zenspider>
you broke some fundamental stuff. dunno how or why
garycruise has joined #ruby
<zenspider>
I suggest reinstalling the OS to try to fix the base problems
wald0 has joined #ruby
TPBallbag has joined #ruby
<zenspider>
should go quick
Hightower666 has quit [Ping timeout: 255 seconds]
TPBallbag is now known as TPSchoolBag
<maasha>
Right, ready for battle
<zenspider>
good luck
lxsameer has joined #ruby
Insti has joined #ruby
<maasha>
The Yosemite update is due anyway
<zenspider>
don't change EVERYTHING all at once
Insanity133 has quit [Read error: Connection reset by peer]
<zenspider>
if you do the yosemite update tho, move /usr/local to your home folder first
<zenspider>
then move it back after
Insanity133 has joined #ruby
<maasha>
good advice
<maasha>
and I do have backup
maasha has quit [Quit: Page closed]
siwica has quit [Ping timeout: 245 seconds]
siwica1 has joined #ruby
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ohcibi_ is now known as ohcibi
<pontiki>
zenspider: is that general advice for all doing the yosemite update, or only for this particular case?
TPSchoolBag is now known as JessyS
JessyS is now known as TPBallbag
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
heftig_ has joined #ruby
heftig has quit [Read error: Connection reset by peer]
mengu has quit [Remote host closed the connection]
zwer_x has quit [Remote host closed the connection]
kaspergr_ has joined #ruby
kaspergrubbe has quit [Read error: Connection reset by peer]
Takle_ has joined #ruby
terlar has quit [Quit: WeeChat 1.0.1]
Takle has quit [Read error: Connection reset by peer]
zwer has joined #ruby
moritzs has quit [Remote host closed the connection]
Insanity133 has quit [Remote host closed the connection]
ringarin has joined #ruby
mrfoto has joined #ruby
agrinb has joined #ruby
terlar has quit [Quit: WeeChat 1.0.1]
terlar has joined #ruby
otherj has joined #ruby
ctp has left #ruby ["Connection reset by peer... Isn't he that short little Mexican with the wire cutters heading your way?"]
PotatoChipz has quit [Quit: Page closed]
bMalum has quit [Quit: bMalum]
robustus|Off is now known as robustus
DrCode has quit [Remote host closed the connection]
garycruise has joined #ruby
Wolland has joined #ruby
agrinb has quit [Ping timeout: 265 seconds]
rpag has quit [Ping timeout: 240 seconds]
DrCode has joined #ruby
Wolland has quit [Ping timeout: 244 seconds]
moritzs has joined #ruby
Spami has joined #ruby
Areessell has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
vifino has quit [Read error: Connection reset by peer]
Morkel_ has joined #ruby
vifino- has joined #ruby
<godd2>
rgb_to_rgb should be a fairly simple method
Morkel has quit [Ping timeout: 240 seconds]
Morkel_ is now known as Morkel
Mattias has quit [Ping timeout: 244 seconds]
Areessell has quit [Ping timeout: 260 seconds]
vyorkin has quit [Ping timeout: 272 seconds]
<Timgauthier>
lol
vyorkin has joined #ruby
moritzs has quit [Ping timeout: 245 seconds]
garycruise has quit [Quit: 离开]
poweratom_ has joined #ruby
yfeldblum has quit [Ping timeout: 256 seconds]
MattB2 has joined #ruby
nrsk has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<zenspider>
pontiki: any dev. upgrade time is proportional to the amount of shit you have in /usr/local for some reason. move it out and it is much faster
tkuchiki has joined #ruby
bMalum has joined #ruby
poweratom_ has quit [Ping timeout: 245 seconds]
dc has joined #ruby
drawingthesun has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
MattB2 has quit []
tkuchiki has quit [Ping timeout: 255 seconds]
arup_r has quit [Remote host closed the connection]
Mattias has joined #ruby
shortCircuit__ is now known as nuts
nuts is now known as shortCircuit__
<pontiki>
thanks, zenspider
toretore has joined #ruby
mskaesz has joined #ruby
mkaesz has quit [Ping timeout: 272 seconds]
wallerdev has joined #ruby
weaksauce has quit [Ping timeout: 244 seconds]
otherj has quit [Quit: .]
wallerdev has quit [Client Quit]
jtdowney has joined #ruby
hanmac1 has joined #ruby
nrsk has quit [Ping timeout: 256 seconds]
jtdowney has quit [Max SendQ exceeded]
jtdowney has joined #ruby
<Takumo>
anyone kow why Sidekiq never shuts down when I ^C?
echooo1 has quit [Quit: echooo1]
DrCode has quit [Remote host closed the connection]
DrCode has joined #ruby
boombadaroomba has joined #ruby
<Takumo>
nvm, bug in Sidekiq 3.2.4
rbrs has quit [Ping timeout: 256 seconds]
DarthGandalf has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
DrCode has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
DrCode has joined #ruby
noop has quit [Ping timeout: 244 seconds]
rbrs has joined #ruby
rbrs has quit [Remote host closed the connection]
noop has joined #ruby
boombadaroomba has quit [Ping timeout: 255 seconds]
snovity has joined #ruby
<krz>
Takumo: my sidekiq gets stuck every so often, nothing useful in logs
<krz>
as in jobs dont get processed, they are "stuck" in the queue
Xeago_ has quit [Ping timeout: 244 seconds]
<Takumo>
only had that when sidekiq isn't listening to the queue
Xeago_ has joined #ruby
larsam has joined #ruby
tkuchiki has joined #ruby
mtakkman has joined #ruby
Takle_ has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby
User458764 has joined #ruby
Xeago has quit [Ping timeout: 265 seconds]
Takle has joined #ruby
Areessell has joined #ruby
vyorkin has quit [Ping timeout: 250 seconds]
doev has quit [Ping timeout: 250 seconds]
renderful has joined #ruby
yfeldblu_ has quit [Ping timeout: 250 seconds]
mikepack has joined #ruby
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
nrsk has joined #ruby
yeticry has quit [Ping timeout: 258 seconds]
agrinb has joined #ruby
ClarusCogitatio has quit [Ping timeout: 265 seconds]
mikepack has quit [Ping timeout: 265 seconds]
renderful has quit [Ping timeout: 256 seconds]
ClarusCogitatio has joined #ruby
yeticry has joined #ruby
robustus is now known as robustus|Off
luisalima has joined #ruby
agrinb has quit [Ping timeout: 265 seconds]
vyorkin has joined #ruby
mtakkman has quit [Remote host closed the connection]
max96at|off is now known as max96at
Fire-Dragon-DoL has joined #ruby
josephndenton has joined #ruby
Wolland has joined #ruby
Fire-Dragon-DoL has quit [Client Quit]
Fire-Dragon-DoL has joined #ruby
jespada has joined #ruby
josephndenton has quit [Ping timeout: 255 seconds]
jtdowney has joined #ruby
jtdowney has joined #ruby
Wolland has quit [Ping timeout: 272 seconds]
jtdowney has quit [Client Quit]
matchaw_ has joined #ruby
vifino- has quit [Remote host closed the connection]
benzrf|offline is now known as benzrf
mrfoto has quit []
matchaw has quit [Ping timeout: 255 seconds]
kp666 has joined #ruby
vifino has joined #ruby
moritzs has joined #ruby
Takle has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
noop has quit [Ping timeout: 250 seconds]
noop has joined #ruby
rpag has joined #ruby
apeiros has joined #ruby
agrinb has joined #ruby
DarthGandalf has joined #ruby
bMalum has quit [Quit: bMalum]
tkuchiki has quit [Ping timeout: 255 seconds]
mikecmpbll has joined #ruby
VanillaGoat_ has joined #ruby
ferr has quit [Quit: Lost terminal]
exadeci has quit [Ping timeout: 260 seconds]
machty has quit [Ping timeout: 260 seconds]
knotty66 has joined #ruby
noop has quit [Ping timeout: 272 seconds]
<knotty66>
Is there a ruby method to remove an element of an array by index and return the array?
moritzs has quit [Ping timeout: 250 seconds]
vyorkin has quit [Quit: WeeChat 1.0.1]
exadeci has joined #ruby
<jhass>
.tap {|ary| ary.delete_at(n) }
VanillaGoat has quit [Ping timeout: 250 seconds]
quimrstorres has joined #ruby
machty has joined #ruby
krandi has joined #ruby
rshetty_ has joined #ruby
andikr has quit [Ping timeout: 272 seconds]
<knotty66>
jhass: Thanks. Not considered tap.
Vile` has quit [Ping timeout: 256 seconds]
rshetty has quit [Ping timeout: 265 seconds]
larsam has quit [Read error: Connection reset by peer]
arup_r has quit [Remote host closed the connection]
krz has quit [Quit: WeeChat 1.0.1]
phutchins has joined #ruby
dangerousdave has joined #ruby
shiru has joined #ruby
spacemud has quit [Ping timeout: 245 seconds]
krandi has quit [Quit: No Ping reply in 180 seconds.]
<hoffmanc>
hello; has anyone run into a situation where thor does not honor quoted strings in options? like thor --some-opt="a quoted string" fails, indicating that it tried to interpret "quoted" and "string" as additional arguments
yfeldblum has joined #ruby
linduxed has quit [Ping timeout: 265 seconds]
<hoffmanc>
but something like ruby -e "puts 'hello'" works fine, so I don't think it is something odd with my shell environment
patrick99e99 has quit [Ping timeout: 245 seconds]
krz has quit [Remote host closed the connection]
arup_r has quit [Remote host closed the connection]
sk87 has joined #ruby
heftig_ is now known as heftig
dc has quit [Remote host closed the connection]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 258 seconds]
<shevy>
hello world!
<shevy>
hello hoffmanc!
<shevy>
might be a shell oddity perhaps
<shevy>
I have had problems with shell filenames including ' ' and '(' characters
davidhq has joined #ruby
<hoffmanc>
@shevy thanks for the thought - yeah it seemed to just started happening, and I'm trying to pinpoint the offender
spacemud has quit [Ping timeout: 256 seconds]
davidhq has quit [Read error: Connection reset by peer]
davidhq has joined #ruby
agrinb has quit [Remote host closed the connection]
nrsk has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
mengu has quit [Remote host closed the connection]
arup_r has joined #ruby
Takle has joined #ruby
IrishGringo has quit [Ping timeout: 264 seconds]
ardianta has joined #ruby
spacemud has joined #ruby
davidhq has quit [Ping timeout: 255 seconds]
andikr has quit [Ping timeout: 255 seconds]
jottr has joined #ruby
dc has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
<toretore>
anyone know how zips work?
renier_ is now known as renier
vifino has quit [Quit: Oh, what does this button do?]
vifino has joined #ruby
larsam has joined #ruby
kamilc__ has joined #ruby
<tobiasvl>
toretore: what do you mean? the algorithm?
IrishGringo has joined #ruby
<tobiasvl>
or the gem?
<apeiros>
zip drives, the storage system from the 90's
techsethi has joined #ruby
<jhass>
maybe zip codes?
<apeiros>
the stuff in the trousers
<tmoore>
zippers on pants or a jacket surely
<tmoore>
heh
<apeiros>
^5
<toretore>
i just wanted to know if it's possible to stream a file from a zip coming in on a socket
<toretore>
that is, without seeking
spyderman4g63 has quit [Read error: Connection reset by peer]
<tobiasvl>
toretore: sure, isn't that exactly what rubyzip and zip do
spyderman4g63 has joined #ruby
<toretore>
no, they need a seekable file
<tmoore>
I know you can with gzip, but I'm not sure if the pk zip format allows it
Wolland has joined #ruby
<apeiros>
you mean you have a zip archive, possibly containing multiple files, which is streamed to you and you wish to "forward" a single file from it?
workmad3 has joined #ruby
<hanmac1>
shevy sorry if you are waiting about rwx ... currently i have 20-30 commits pending at home ... i did some massive rewrite again ... replacing macros with templates ;P
<apeiros>
i.e. forward -> push to another stream/IO
<toretore>
apeiros: exactly
pwestlun1 has joined #ruby
alem0lar_ has joined #ruby
<shevy>
hanmac1 nah I am not waiting right now - I am more waiting towards the long distant future where gstreamer + wxwidgets will give me zero problems ;D
<toretore>
1) start reading io; 2) skip file unless target 3) when target, forward to other io
<toretore>
tmoore: yeah, that's exactly what i want to do
<toretore>
but i can't "seek" like they do on s3
<tmoore>
sounds like a pain
alem0lar_ has quit [Client Quit]
<toretore>
i guess i'll have to buffer to disk or mem :/
moritzs has joined #ruby
ardianta has quit [Ping timeout: 265 seconds]
rshetty_ has quit [Remote host closed the connection]
Wolland has quit [Ping timeout: 256 seconds]
<toretore>
it's not really a problem, i just wanted to avoid it if possible
<tmoore>
"Tools that correctly read .ZIP archives must scan for the end of central directory record signature, and then, as appropriate, the other, indicated, central directory records. They must not scan for entries from the top of the ZIP file, because only the central directory specifies where a file chunk starts."
<apeiros>
sounds like zips design works against that
<toretore>
yeah
<apeiros>
probably been designed with the zipfile writer in mind, not reader or streaming
<tmoore>
what a terrible format :-P
<jhass>
"originally created in 1989"
<apeiros>
iirc ID3 tags had the same issue in the first version :)
<jhass>
so maybe try something from this century
<toretore>
like.. gzip? ;)
<apeiros>
jhass: *millenium
fandi has joined #ruby
<apeiros>
zip… so yestermillenial
Tuxero has joined #ruby
<tmoore>
I'm pretty sure tar is older, and it didn't make that mistake
codecop has joined #ruby
<tmoore>
"Most modern tar programs read and write archives in the UStar (Uniform Standard Tape ARchive) format, introduced by the POSIX IEEE P1003.1 standard from 1988." http://en.wikipedia.org/wiki/Tar_(computing)
<apeiros>
yeah. but tar has other funny design decisions. based on being mostly used on tapes at that time.
Takle has quit [Remote host closed the connection]
<apeiros>
like e.g. padding everything to 512 bytes or somesuch
mattstratton has joined #ruby
robustus|Off is now known as robustus
mattstratton has quit [Max SendQ exceeded]
<tmoore>
separation of concerns between archiving and compression seems like a good thing, though
<apeiros>
yes
mattstratton has joined #ruby
<apeiros>
overall, tar is one of the better though through things in computing.
<toretore>
thinking through your solution is for suckers
<toretore>
no time to pivot that way
<apeiros>
less opportunities to charge for updates
tesuji has quit [Ping timeout: 272 seconds]
dkphenom has joined #ruby
govg has joined #ruby
poulet_a has left #ruby ["Quitte"]
Takle has joined #ruby
einarj has quit [Remote host closed the connection]
ardianta has joined #ruby
kobain has joined #ruby
arup_r has quit [Remote host closed the connection]
spyderman4g63 has quit []
mattstratton has quit [Ping timeout: 265 seconds]
razieliyo has joined #ruby
razieliyo has joined #ruby
robustus is now known as robustus|Off
<shevy>
hmmm
<shevy>
should the top namespace be a module
<shevy>
or a class
<apeiros>
you know the answer :-p
<shevy>
no
ferr has joined #ruby
<shevy>
I have just put up everything so neatly into a module
<shevy>
now I realized that I can not do Foo.new
<apeiros>
shevy: what can a class do what a module can't?
<shevy>
not much!
sevenseacat has joined #ruby
<apeiros>
correct, not much. but there is this one little but crucial thing!
<shevy>
don't know of one
<shevy>
one can store state in module constants
<apeiros>
come on shevy, I know that you know it
<shevy>
subclassing!
dorei has joined #ruby
<apeiros>
hm, ok, not what I meant
<apeiros>
instantiation
<shevy>
aaaah
<apeiros>
a class can create instances of itself
russt has joined #ruby
russt has quit [Client Quit]
tobago has joined #ruby
<apeiros>
so the question is reeeeally simple: do you need instances of whatever your toplevel namespace is? if not -> module (common case), if yes -> class (less common case)
<rpag>
shevy, i think its common to use a module but i've seen a class used as well (for example pry uses a class)
triple_b has joined #ruby
<shevy>
yeah I need instances of my toplevel namespace but I also need it to retain its ability to mix it into other classes :(
ardianta is now known as iyan
havenwood has joined #ruby
<rpag>
'bundle gem xxx' defaults to a module though
<apeiros>
toretore: I think it was mostly a decision of having conceptually different things. but no idea what really was the motivation.
<toretore>
implementation details perhaps..
<shevy>
matz' C++ past must have shaped his decision
<apeiros>
personally I dislike the concept of inheritance by now. I think it leads to bad solutions and there are better mechanisms for functionality-sharing
TPBallbag is now known as aDuude
<apeiros>
toretore: I doubt, given that modules just end up in the ancestry too
<apeiros>
but maybe
<shevy>
just as hanmac1's code becomes progressively stranger
<max96at>
maybe the fact that modules don't have constructors you inherit?
<hanmac1>
shevy newest code will it make even more strange when i try to use more templates than macros to make the code more nicer ... (but like i said its not pushed yet)
Wolland has joined #ruby
<toretore>
i think inheritance can still be a useful way to model things
last_staff has quit [Quit: last_staff]
aDuude is now known as TPBallbag
blueOxigen has quit [Ping timeout: 250 seconds]
roolo has quit [Ping timeout: 265 seconds]
<toretore>
who was it that implemented transducers in ruby?
hoffmanc has quit []
<hanmac1>
hm what are transducers? or do i need them for my spacecraft? ;P
<toretore>
google clojure hickey transducers
<shevy>
lol
<toretore>
should give you the information
Wolland has quit [Ping timeout: 255 seconds]
<toretore>
it's basically an abstraction of stream processing functionality that doesn't depend on the implementation
<toretore>
like map or inject
enebo has joined #ruby
fsapo has quit [Remote host closed the connection]
tlarevo_ has quit [Remote host closed the connection]
jerius has joined #ruby
sambao21 has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<apeiros>
symbols and strings are two different kind of objects. just as `"1" != 1`
benzrf|offline is now known as benzrf
<ed_t>
thats what I missed
<ed_t>
thanks
mistermocha has joined #ruby
tadassce has quit []
linduxed has joined #ruby
<ed_t>
learning a new lang is a pita. There are all sorts of little assumptions that u need to understand.
rshetty has quit [Remote host closed the connection]
hamakn has quit [Remote host closed the connection]
<ccooke>
ed_t: what languages do you know?
baroquebobcat has joined #ruby
moritzs has quit [Ping timeout: 258 seconds]
<benzrf>
strings are for text, symbols are for identifiers
<ed_t>
many assemblers, forth, c, cobol, abap, modula II, pascal, java, netrexx, rexx - i've probably forgotten others
Channel6 has quit [Quit: Leaving]
Xeago_ has quit [Remote host closed the connection]
Tuxero has quit [Ping timeout: 264 seconds]
pasties has quit [Ping timeout: 250 seconds]
jobewan has joined #ruby
mkrank has quit [Quit: Wychodzi]
mkrank has joined #ruby
ki0 has quit [Remote host closed the connection]
dc_ has joined #ruby
benzrf is now known as benzrf|offline
it0a has joined #ruby
ki0 has joined #ruby
mary5030 has quit [Remote host closed the connection]
Timgauthier is now known as timgauthier_away
exgf has quit [Remote host closed the connection]
balazs has joined #ruby
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby
michael_mbp has quit [Excess Flood]
nateberkopec has joined #ruby
<ed_t>
ccooke I find that when learning a new lang the hardest part is understand the _detailed_ syntax. Then you need to learn the libraries which is a long process - you never stop learning them
ghr has joined #ruby
timgauthier_away is now known as Timgauthier
zz_jrhorn424 is now known as jrhorn424
jimbach has joined #ruby
michael_mbp has joined #ruby
<apeiros>
ed_t: ruby's syntax is luckily comparatively small. at least if you glance over all the edge cases (which usually will not tangent you - unless you write a ruby parser)
ericli has joined #ruby
<apeiros>
same for its core set of idioms
iamjarvo has joined #ruby
davidhq_ has joined #ruby
mary5030 has joined #ruby
Brothmars has joined #ruby
Wolland has joined #ruby
viet_power has quit [Ping timeout: 260 seconds]
agrinb has joined #ruby
doev has joined #ruby
andikr has joined #ruby
zB0hs has joined #ruby
<ccooke>
ed_t: One thing that might help with Strings and Symbols - Strings are like java Stringbuffers, while Symbols are more like java strings
mary5030 has quit [Remote host closed the connection]
jenrzzz_ has quit [Ping timeout: 265 seconds]
siwica has quit [Ping timeout: 250 seconds]
treehug88 has joined #ruby
tobago has quit [Remote host closed the connection]
AnonGuy has joined #ruby
Hijiri has quit [Quit: WeeChat 1.0.1]
agrinb_ has joined #ruby
<ccooke>
ed_t: Symbols are immediate, immutable and memory efficient. They're used a lot to refer to other things by name - you can call methods on an object by sending a symbol named after the method you want, for instance. Or get and set constants and instance variables by using symbols to refer to them
<ed_t>
I've got the difference now. As I said it was a beginner question. I knew I was missing something very very basic
jrhorn424 is now known as zz_jrhorn424
<ccooke>
good, good
lw has joined #ruby
momomomomo has joined #ruby
Takle has quit [Remote host closed the connection]
agrinb has quit [Ping timeout: 265 seconds]
agrinb has joined #ruby
mengu has quit []
godd2 has quit [Ping timeout: 258 seconds]
<AnonGuy>
Hello Guys , I wanna learn Ruby and i am a beginner to programming. Any suggestions where I can start. I have done basic python
sepp2k has quit [Read error: Connection reset by peer]
<AnonGuy>
Also , can any one tell what exactly ruby is used for ?
zz_jrhorn424 is now known as jrhorn424
Wolland has quit [Ping timeout: 255 seconds]
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
doev has quit [Ping timeout: 245 seconds]
josephndenton has joined #ruby
<balazs>
AnonGuy: ruby is used for the same kinds of things python is. There is plenty of documentation online.
agrinb_ has quit [Ping timeout: 272 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
* ed_t
is looking at pseudo bnf definition of ruby
sk87 has joined #ruby
Takle has joined #ruby
<hanmac1>
ed_t: think about symbols like the Enum values in C which are also uniq
agrinb has quit [Ping timeout: 265 seconds]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
ed_t: there are two schools for blocks. A) use do/end for side-effect, use {} for return value
AnonGuy has left #ruby [#ruby]
<apeiros>
ed_t: B) use {} for single-line, do/end for multiline
<ccooke>
ed_t: depends on context. {} is better for one liners or if you're chaining the results
<apeiros>
personally, I follow A)
zarubin has quit [Client Quit]
amigo99 has joined #ruby
axl_ has joined #ruby
<apeiros>
ed_t: note that do/end has different precedence than {}. `foo bar {}` is `foo(bar {})`, i.e. the block belongs to bar. `foo bar do; end` is `foo(bar) do; end`, i.e. the block belongs to foo
wald0 has quit [Quit: Lost terminal]
josephndenton has quit [Ping timeout: 244 seconds]
msmith__ has joined #ruby
Takle_ has joined #ruby
<apeiros>
of course, if you always parenthesize your methods, you won't note that difference :)
kaspergrubbe has quit [Read error: Connection reset by peer]
kaspergr_ has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrhorn424 is now known as zz_jrhorn424
Takle has quit [Read error: Connection reset by peer]
<ed_t>
apeiros thanks. Was wondering if one syntax replaced the other and its not the case. precedence maters - especially when you do not expect it to be different
iwishiwerearobot has quit [Remote host closed the connection]
sdegutis has joined #ruby
<apeiros>
ed_t: well then: and/or have different precedence than &&/||
<hanmac1>
ed_t: same difference for && and "and"
<apeiros>
since that trips up people too :)
<sdegutis>
What's a good simple static site generator that allows me to generate 1:N pages and supports Sass and Slim?
troulouliou_dev has joined #ruby
Pupeno_ has joined #ruby
<workmad3>
sdegutis: jekyll, middleman...
quimrstorres has quit [Remote host closed the connection]
zarubin has joined #ruby
lw has quit [Quit: s]
<sdegutis>
Jekyll doesn't support N:1 pages, does it?
<ed_t>
thanks those little details are the things that trip you up flipping langs
* ed_t
takes notes
msmith_ has quit [Ping timeout: 265 seconds]
haroldwu has quit [Ping timeout: 245 seconds]
<apeiros>
ed_t: google for "zenspiders quickref"
<apeiros>
contains almost, if not all of ruby's syntax condensed
haroldwu has joined #ruby
<hanmac1>
ed_t: also there is an interesting difference between "-1" and "- 1" ... the second one is a method call, so you might get syntax errors if you do spaces wrong
Pupeno has quit [Ping timeout: 250 seconds]
AnonGuy has joined #ruby
arup_r has quit [Quit: Leaving.]
TPBallbag has quit [Remote host closed the connection]
fabrice31 has quit [Remote host closed the connection]
renderful has joined #ruby
lolmaus_ has joined #ruby
dangerousdave has joined #ruby
Luser_ has joined #ruby
oo_ has quit [Ping timeout: 245 seconds]
speaking1ode is now known as speakingcode
lxsameer has joined #ruby
<Luser_>
Hey guys. I've got a for loop which takes two integers as arguments eg: for num in a..b and inside it i want to check if square root of num is 'integer', but i dont know how to do it because Math.sqrt(num) converts it to float even if its 4.0 for example
<Luser_>
Any ideas how to solve it?
dangerousdave has quit [Client Quit]
<Luser_>
Forcing it .to_i doesn't help either obviously.
lolmaus has quit [Ping timeout: 240 seconds]
livathin_ has joined #ruby
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
phrozen77 has joined #ruby
phrozen77 has quit [Changing host]
<Luser_>
if Math.sqrt(num) % 1 == 0 is that a good way to solve it?
moted has quit []
mistermocha has quit [Remote host closed the connection]
<apeiros>
Luser_: a) .round it, square it, and compare to original value
siwica has joined #ruby
zz_jrhorn424 is now known as jrhorn424
<apeiros>
Luser_: b) .round it and compare difference to unrounded number. note that small deviations are possible, so you should make a delta comparison
livathinos has quit [Ping timeout: 255 seconds]
Hightower_ has quit [Ping timeout: 245 seconds]
Trynemjoel has quit [Ping timeout: 265 seconds]
livathin_ has quit [Ping timeout: 244 seconds]
pwestlun1 has joined #ruby
moritzs has quit [Ping timeout: 245 seconds]
<tercenya>
_luser: if you know that the item is always Float, you could check #denominator == 1
abuzze has quit [Remote host closed the connection]
kobain has quit [Read error: Connection timed out]
<beneggett>
I'm pretty much always on, but not necessarily staring at the channel
<siwica>
Ok, sounds good. I might ocme back to you later
<beneggett>
if I'm around, I'll respond, if not I'll get back to you when i am
<beneggett>
sure thing
DTSCode has joined #ruby
treehug88 has joined #ruby
gaganjyot has joined #ruby
skolman_ has quit [Ping timeout: 256 seconds]
oo_ has quit [Ping timeout: 245 seconds]
Trynemjoel has joined #ruby
red_horned_rihno has quit [Client Quit]
freerobby has quit [Quit: Leaving.]
mistermocha has quit [Ping timeout: 265 seconds]
joonty has quit [Quit: Leaving]
gaganjyot has quit [Ping timeout: 256 seconds]
i_s has joined #ruby
josephndenton has joined #ruby
freerobby has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
IrishGringo has quit [Ping timeout: 256 seconds]
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
moritzs has joined #ruby
cantonic has joined #ruby
Trynemjoel has quit [Ping timeout: 265 seconds]
sk87 has joined #ruby
stunder has joined #ruby
danjordan has quit [Quit: danjordan]
Wolland has joined #ruby
josephndenton has quit [Ping timeout: 255 seconds]
timonv_ has joined #ruby
danjordan has joined #ruby
oo_ has joined #ruby
enebo has quit [Quit: enebo]
triple_b has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
benzrf|offline is now known as benzrf
rkalfane has joined #ruby
sailias1 has joined #ruby
timonv_ has quit [Remote host closed the connection]
sailias has quit [Read error: Connection reset by peer]
ghostmoth has joined #ruby
poweratom_ has joined #ruby
luksaur has joined #ruby
Pupeno_ has joined #ruby
apeiros has joined #ruby
timonv_ has joined #ruby
EminenceHC has joined #ruby
<EminenceHC>
I am using the roo gem to parse an imported excel file and create records in the DB. My excel file has a lot of columns I would like to simply ignore. What is the best approach to do this? https://gist.github.com/EminenceHC/cd0fc16d20baea2f941c
Wolland has quit [Ping timeout: 255 seconds]
sdegutis has joined #ruby
oo_ has quit [Ping timeout: 240 seconds]
<sdegutis>
Is it possible to use variables inside a Middleman frontmatter?
Pupeno has quit [Ping timeout: 265 seconds]
yelluke has joined #ruby
gaganjyot has joined #ruby
Brothmars has joined #ruby
timonv_ has quit [Remote host closed the connection]
gaganjyot has quit [Remote host closed the connection]
D9 has joined #ruby
gaganjyot has joined #ruby
Pupeno_ has quit [Remote host closed the connection]
poweratom_ has quit [Ping timeout: 264 seconds]
sambao21 has joined #ruby
Hijiri has joined #ruby
Trynemjoel has joined #ruby
Morkel has quit [Quit: Morkel]
lolmaus_ has quit [Quit: Konversation terminated!]
yelluke has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
yfeldblum has joined #ruby
baroquebobcat has joined #ruby
poweratom_ has joined #ruby
aspires has quit []
yelluke has joined #ruby
ramfjord has joined #ruby
danjordan has quit [Quit: danjordan]
Brothmars has quit [Quit: Be back later ...]
danjordan has joined #ruby
wallerdev has joined #ruby
moritzs has quit [Ping timeout: 272 seconds]
dkb20k has joined #ruby
kaspergr_ has quit [Remote host closed the connection]
Luser_ has quit [Read error: Connection reset by peer]
kaspergrubbe has joined #ruby
Trynemjoel has quit [Ping timeout: 265 seconds]
* lupine
still uses system ruby religiously
yfeldblum has quit [Ping timeout: 258 seconds]
<lupine>
it's nice to be able to lean on debian for patches
Takle has quit [Read error: Connection reset by peer]
klaut_ has joined #ruby
Takle_ has joined #ruby
cpruitt has joined #ruby
klaut has quit [Ping timeout: 264 seconds]
joshua__ has joined #ruby
iamjarvo has joined #ruby
it0a has quit [Quit: WeeChat 1.0.1]
<joshua__>
Hey guys, I have an array and want to instantiate a new empty array for each of those objects. e.g. ['a', 'b'].each { |x| x = Array.new }
it0a has joined #ruby
yelluke has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<joshua__>
I know I'm doing something stupid...
elaptics is now known as elaptics`away
<jhass>
joshua__: Array.new(array.size) { [] }, but this doesn't sound like your actual problem
it0a has quit [Client Quit]
kaspergrubbe has quit [Ping timeout: 245 seconds]
it0a has joined #ruby
<joshua__>
jhass: not following you there..
oleo__ has joined #ruby
skolman_ has joined #ruby
Trynemjoel has joined #ruby
SCHAAP137 has joined #ruby
<jhass>
you described a solution you think you need, not its underlying problem
Takle_ has quit [Ping timeout: 255 seconds]
<apeiros>
tercenya: should not use .to_i there. to_i truncates.
<apeiros>
delta comparisons of x with int x always: (x.round-x).abs <= EPSILON
<apeiros>
where you choose a proper value for your use-case for epsilon
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<Hanmac>
joshua__: oO ae you try to asign local variables?
jwang__ has quit [Ping timeout: 244 seconds]
<joshua__>
Hanmac: yes
<apeiros>
joshua__: local variables are not a hash. use a hash.
<Hanmac>
joshua__: i just say: DONT
<joshua__>
lol, ok
oleo is now known as Guest82659
<joshua__>
my ruby is very very rusty
tier has quit [Remote host closed the connection]
<apeiros>
I know of precisely one use case where dynamically assigning locals is remotely acceptable: template engines.
dkb20k has quit [Ping timeout: 258 seconds]
jxf has quit [Ping timeout: 260 seconds]
Guest82659 has quit [Ping timeout: 245 seconds]
<apeiros>
and there you'd use local_variable_set on the binding object you use to eval the compiled template (newer rubies only - dirty tricks necessary for older rubies)
neoxquick has joined #ruby
DrCode has quit [Remote host closed the connection]
lw has joined #ruby
lw has quit [Max SendQ exceeded]
oo_ has joined #ruby
Trynemjoel has quit [Ping timeout: 265 seconds]
bricker`work has joined #ruby
lw has joined #ruby
lw has quit [Remote host closed the connection]
sk87 has joined #ruby
User458764 has quit [Ping timeout: 255 seconds]
yelluke has joined #ruby
tvw has quit []
alex88 has quit []
tvw has joined #ruby
klaas has joined #ruby
spyderman4g63 has quit [Remote host closed the connection]
maestrojed has joined #ruby
sk87 has quit [Client Quit]
spyderman4g63 has joined #ruby
Trynemjoel has joined #ruby
DrCode has joined #ruby
DrCode has quit [Remote host closed the connection]
yelluke has left #ruby [#ruby]
oo_ has quit [Ping timeout: 244 seconds]
ctp has quit [Quit: Connection reset by peer... Isn't he that short little Mexican with the wire cutters heading your way?]
DrCode has joined #ruby
roolo has quit [Remote host closed the connection]
<amigo99>
hi all, i wrote a gem that shows you the exact file:line of an ERB/haml template that rendered a DOM element - https://github.com/redgetan/view_inspect
<amigo99>
feedback welcome
troyready has joined #ruby
_maes_ has joined #ruby
allcentury has quit [Ping timeout: 272 seconds]
roolo has joined #ruby
viet_power has joined #ruby
spyderman4g63 has quit [Ping timeout: 256 seconds]
DrCode has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 245 seconds]
<EminenceHC>
I am using the roo gem to parse an imported excel file and create records in the DB. My excel file has a lot of columns I would like to simply ignore. What is the best approach to do this? https://gist.github.com/EminenceHC/cd0fc16d20baea2f941c
axl_ has quit [Quit: axl_]
joshua__ has quit [Quit: Page closed]
freerobby has quit [Quit: Leaving.]
jwang__ has joined #ruby
dopie has joined #ruby
Trynemjoel has quit [Ping timeout: 265 seconds]
bMalum has joined #ruby
DrCode has joined #ruby
drawingthesun has quit [Ping timeout: 245 seconds]
dc_ has joined #ruby
govg has joined #ruby
Hightower_ has joined #ruby
marcdel has joined #ruby
mskaesz has quit [Quit: Leaving...]
marcdel has quit [Client Quit]
spyderman4g63 has joined #ruby
Trynemjoel has joined #ruby
mikecmpbll has quit [Ping timeout: 258 seconds]
DrCode has quit [Remote host closed the connection]
tadassce_ has joined #ruby
jrhorn424 is now known as zz_jrhorn424
thagomizer has joined #ruby
patrick99e99 has joined #ruby
timonv_ has joined #ruby
ndrei has joined #ruby
tadassce has quit [Ping timeout: 245 seconds]
DrCode has joined #ruby
mtakkman has joined #ruby
sdegutis has quit [Quit: Leaving...]
D9 has quit [Ping timeout: 255 seconds]
abuzze has joined #ruby
andikr has quit [Remote host closed the connection]
<apeiros>
I'll translate that answer to: "an array of integers". correct?
flobin has joined #ruby
<mary5030>
yes
<flobin>
hi everyone
<apeiros>
mary5030: so what do you want? check if all integers of some_array_of_numbers occur in the result? or only if some occur?
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mary5030>
if any
<flobin>
so I have a bunch of .less files that I’d like to convert to .scss, and as far as I could see, this rakefile is the only automated solution to doing that: https://gist.github.com/rosskevin/ddfe895091de2ca5f931
<mary5030>
as long as any of them is in the array i am good
Eiam has joined #ruby
<flobin>
however, I don’t know Ruby, so I was wondering if someone would mind walking me through using this rakefile
<apeiros>
mary5030: use Array's set methods then. O(n) instead of O(n^2)
<siwica>
having an object how can I get an array of all methods that can be called on it?
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
.methods
<gr33n7007h>
obj.public_methods
<siwica>
ok, thanks :)
ghr has quit [Ping timeout: 244 seconds]
clauswitt has joined #ruby
<tier>
hey, hopefully a simple ruby question here. if i have a version #, like 2.2.x and want to strip off the .x to just get 2.2, what's the simplest way to do that
<tier>
do a split on . then rejoin?
altamic has quit [Quit: altamic]
<bricker`work>
tier: Why?
<bricker`work>
tier: you should use Gem::Version, it's intelligent about version numbers
<bricker`work>
Gem::Version.new("2.2.x").segments, for example
<tier>
i should have been more specific, the 2.2.x is actually just an attribute in chef so really it's a string i'm trying to split so i can pass it back into a url
jimmyhoughjr has joined #ruby
bMalum has quit [Quit: bMalum]
zz_jrhorn424 is now known as jrhorn424
clauswitt has quit [Client Quit]
clauswitt has joined #ruby
<tier>
ah i think i got it
<tier>
byteslice method will easily hack up a string
dseitz has joined #ruby
timonv_ has quit [Remote host closed the connection]
kireevco has quit [Quit: Leaving.]
Takle has joined #ruby
<apeiros>
tier: you use byteslice instead of normal slice (or []) because…?
oo_ has joined #ruby
dumdedum has joined #ruby
Soda has quit [Remote host closed the connection]
dangerousdave has joined #ruby
<shevy>
guys let's kick some ass
larissa has quit [Ping timeout: 264 seconds]
<tier>
good question, probably because it's the first thing i found in the documentation :)
CustosLimen has joined #ruby
<tier>
foo[0,3] gets the same thing eh
<apeiros>
only partially true
cndiv has joined #ruby
aspires has joined #ruby
<apeiros>
[] operates on characters
<apeiros>
byteslice operates on bytes
<ericwood>
hey what's the cool HTTP lib to use these days that does session/cookie management?
<ericwood>
mechanize?
oo_ has quit [Ping timeout: 245 seconds]
knotty66 has left #ruby [#ruby]
Trynemjoel has quit [Quit: Quitting]
larissa has joined #ruby
TPBallbag has joined #ruby
djbkd has joined #ruby
<apeiros>
no idea about "cool", but mechanize does that. yes.
<ericwood>
basically I want to authenticate and hold onto the session for subsequent requests
<toretore>
the cool one would be proxygen
Trynemjoel has joined #ruby
<toretore>
sessions aren't that complicated.. it's just a header sent back and forth
sinequanon has joined #ruby
hamakn has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<ericwood>
yeah, but if someone did a good job with a lib for it I don't want to reinvent it for the dumb stuff I'm about to write :)
hamakn has joined #ruby
<siwica>
I want to have a function foo(a,f) with f being an optional argument that by default is a method that always returns true. How can I do this?
ctp has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
<toretore>
siwica: gist your real code
rdark has quit [Quit: leaving]
<siwica>
toretore: there is no real code yet
x1337807x has joined #ruby
klaut_ has quit [Remote host closed the connection]
<apeiros>
siwica: pass in an object which defines call and returns true
<apeiros>
but why you're not using a block is beyond me
<toretore>
you'd be better off using a separate branch for that case
<apeiros>
+1
TPBallbag has quit [Ping timeout: 272 seconds]
<toretore>
instead of calling the block n times when it's not necessary
<siwica>
apeiros: I want to be able to call foo([1,2,3,4,5]) and get returned all values of the array
mikecmpbll has joined #ruby
<apeiros>
siwica: is that supposed to be the answer to "why aren't you using a block?"?
<toretore>
if block_given?; use block; else; dont use block; end
<apeiros>
because if so - it's not.
bayed has quit [Quit: Connection closed for inactivity]
<siwica>
apeiros: no it is not
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<toretore>
i think it's not
<siwica>
apeiros: because I might want to further abstract it do actually do this with two methods that I pass to foo
abuzze has quit [Ping timeout: 264 seconds]
<siwica>
*do -> to
cantonic has quit [Quit: cantonic]
agrinb has quit [Ping timeout: 244 seconds]
Wolland has quit [Ping timeout: 258 seconds]
<banister>
apeiros i bought mario 3d world
<apeiros>
banister: worth it?
<banister>
apeiros idk bought it 2 weeks ago and haven't played it yet
<apeiros>
lol
claw has joined #ruby
<banister>
apeiros i tried to play it with my woman but she didn't really dig it
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DrCode has quit [Remote host closed the connection]
x1337807x has joined #ruby
Trynemjoel has quit [Ping timeout: 265 seconds]
x1337807x has quit [Max SendQ exceeded]
jrhorn424 is now known as zz_jrhorn424
ptrrr has quit [Quit: ptrrr]
sambao21 has quit [Quit: Computer has gone to sleep.]
abuzze has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
codezomb has joined #ruby
x1337807x has joined #ruby
aspires has quit []
Trynemjoel has joined #ruby
DrCode has joined #ruby
oo_ has joined #ruby
Soda has joined #ruby
beneggett has quit [Read error: Connection reset by peer]
robbyoconnor has quit [Ping timeout: 256 seconds]
beneggett has joined #ruby
dangerousdave has joined #ruby
mtakkman has quit [Remote host closed the connection]
aspires has joined #ruby
zz_jrhorn424 is now known as jrhorn424
oo_ has quit [Ping timeout: 256 seconds]
lolmaus has joined #ruby
BadQuanta has joined #ruby
chiel has quit [Ping timeout: 264 seconds]
<toretore>
anyone know a good way to remove/ignore duplicates in a stream of values?
j416 is now known as noshi
<yxhuvud>
duplicates as in identical objects following each other or removing any object that is recognized?
kaspergrubbe has joined #ruby
quimrstorres has quit [Remote host closed the connection]
DrCode has quit [Remote host closed the connection]
<toretore>
any value that's equal to another that's been seen previously
claw_ has joined #ruby
<yxhuvud>
store everything you have seen in a set. (or at least store enough to recognize it)
<toretore>
i understand that i'm going to have to keep track of them, but i'm looking for an efficient way to do so
Insanity133 has joined #ruby
<apeiros>
set/hash, as yxhuvud already said
<toretore>
i'm doing that now, but it's slow (unsurprisingly)
<yxhuvud>
yes, hash also works (of course, as sets are implemented using hashes)
claw has quit [Ping timeout: 272 seconds]
<apeiros>
toretore: then profile
iamjarvo has joined #ruby
DrCode has joined #ruby
<apeiros>
you won't get anything faster than O(1). the only things you can optimize is your use-case and your specific implementation.
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
i know why it's slow, it's because it's checking for duplicates every time it emits
DrCode has quit [Remote host closed the connection]
ptrrr has joined #ruby
<apeiros>
toretore: did you profile it? because if not, you only *think* you know.
Insanity133 has quit [Remote host closed the connection]
<apeiros>
also, the use-case you describe asks for testing each incoming element separately. if you can bundle up a couple, Array's set operations might become faster.
<toretore>
if hsh.include?(obj); emit; end
<apeiros>
I thought you wanted to remove them?
Soda has quit [Remote host closed the connection]
<toretore>
that's the emit part (not being emitted)
<apeiros>
which would be `unless`, not `if`
poulet_a has quit [Quit: Quitte]
<toretore>
it's a lazy sequence
DrCode has joined #ruby
lemur has quit [Remote host closed the connection]
Trynemjoel has quit [Ping timeout: 265 seconds]
<toretore>
generator, whatever you want to call it
<EminenceHC>
I am using the roo gem to parse an excel file. .row(1)[0] returns the first value of the first row. However I cant change the value by simply doing foo.row(1)[0] = 'New Value'. What am I doing wrong?
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Wolland has joined #ruby
<siwica>
^^
DrCode has joined #ruby
Soda has joined #ruby
<apeiros>
a) pseudo function (no use of self), b) superfluous use of lambda construct in `&(->(a) {a == 5}`, c) potential N times calling of a void block, d) use of .call instead of yield (though, required by the way it's currently implemented)
wldcordeiro_ has joined #ruby
DrCode has quit [Remote host closed the connection]
Brothmars has quit [Quit: Be back later ...]
poulet_a has quit [Ping timeout: 258 seconds]
DrCode has joined #ruby
moritzschaefer has joined #ruby
o0oo0o has joined #ruby
<siwica>
how would you implement it?
<apeiros>
I think toretore already explained it
ChoiKyuSang has quit [Quit: Going offline, see ya! ( www.adiirc.com]
gaganjyot has quit [Quit: Leaving]
noop has quit [Ping timeout: 265 seconds]
DrCode has quit [Remote host closed the connection]
<siwica>
I didnt understand "you'd be better off using a separate branch for that case"
ChoiKyuSang has joined #ruby
pyon has quit [Ping timeout: 240 seconds]
o0oo0o has quit [Client Quit]
Junaos has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ton31337>
I have the same script in another location and it works
sambao21 has quit [Client Quit]
tlarevo has joined #ruby
DrCode has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DrCode has quit [Remote host closed the connection]
tier has quit [Ping timeout: 256 seconds]
dangerousdave has joined #ruby
Soda has quit [Remote host closed the connection]
Takle has quit [Remote host closed the connection]
stunder has quit [Remote host closed the connection]
sambao21 has joined #ruby
DrCode has joined #ruby
<siwica>
To foo I want to pass an array of elements and do something with each element if the passed relation holds true for each element of the array and a *special*element
momomomomo has quit [Ping timeout: 272 seconds]
lolmaus has quit [Quit: Konversation terminated!]
momomomomo_ has joined #ruby
EminenceHC has quit [Remote host closed the connection]
agrinb has joined #ruby
spider-mario has joined #ruby
max96at is now known as max96at|off
tlarevo has quit [Ping timeout: 244 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aspires has quit []
wallerdev has quit [Quit: wallerdev]
sinkensabe has joined #ruby
jrhorn424 is now known as zz_jrhorn424
spyderman4g63 has quit []
andrewlio has quit [Quit: Leaving.]
robustus|Off is now known as robustus
agrinb has quit [Ping timeout: 272 seconds]
aspires has joined #ruby
iwishiwerearobot has quit [Read error: Connection reset by peer]
emmesswhy has quit [Quit: This computer has gone to sleep]
sambao21 has quit [Quit: Computer has gone to sleep.]
iwishiwerearobot has joined #ruby
Musashi007 has joined #ruby
econerd4ever has quit [Read error: Connection reset by peer]
atomical has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
RitterJack has quit [Remote host closed the connection]
<toretore>
apeiros, yxhuvud this reduced it to an acceptable level: `seen = Set.new; prev_size = seen.size; while val = get; seen << val.hash; emit if seen.size > prev_size; end`
<yxhuvud>
so << is faster than inclusion check? *sceptical*
<toretore>
well, i have to << anyway
<toretore>
otherwise the check wouldn't work
<toretore>
the faster bit is comparing the size instead of include? and using hash values instead of the actual objects
nrsk has joined #ruby
<apeiros>
toretore: adding val.hash instead of val sets you up for false positives.
dkb20k has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
chrishou_ has joined #ruby
<toretore>
yes
<apeiros>
and if false positives are ok, a bloom filter might be worth a consideration. depends on the details. (bloom filter is O(1) too with a potentially higher constant cost, but lower memory requirements)
chrishough has quit [Ping timeout: 260 seconds]
aspires has quit []
chrishou_ has quit [Client Quit]
<toretore>
wait, how does it mean more chance of false positives?
aspires has joined #ruby
<apeiros>
not "more". hash doesn't have false positives.
chrishough has joined #ruby
<toretore>
then i'm not understanding what you're saying
<apeiros>
you're only adding the hash value to your set. hash values can collide. different objects can have the same hash value.
<apeiros>
21:10 apeiros: not "more". hash doesn't have false positives. # <-- Hash, the class
<toretore>
doesn't Hash use #hash ?
alvaro_o has joined #ruby
<apeiros>
yes. to find the bucket.
<toretore>
oh wait
<apeiros>
it uses eql? to check for equality.
<toretore>
i've been here before
<toretore>
yes
<toretore>
i remember now
graydot has joined #ruby
<toretore>
do you know what the chances of collision are for #hash ?
MattB2 has joined #ruby
<apeiros>
impossible to tell
beef-wellington has joined #ruby
<apeiros>
for the simple reason that it depends on multiple factors. one of them being the actual implementation of #hash for the given object.
<toretore>
sure
<toretore>
nm i asked that
triple_b_ has joined #ruby
<apeiros>
assuming a perfectly distributed hash value, you can use pidgeon hole algorithm (aka birthday paradoxon) to figure out probability
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<apeiros>
hash value is iirc 32bit
<toretore>
but that's the best case
<apeiros>
correct
iamjarvo has joined #ruby
zz_jrhorn424 is now known as jrhorn424
aspires has quit [Client Quit]
triple_b has quit [Read error: Connection reset by peer]
jrhorn424 is now known as zz_jrhorn424
spider-mario has quit [Ping timeout: 265 seconds]
emmesswhy has joined #ruby
govg has quit [Read error: Connection reset by peer]
ldnunes has quit [Quit: Leaving]
<apeiros>
err, remove "pidgeon hole problem" from above. birthday paradoxon is correct
<toretore>
this is one of those times when i wish i could math
Guest82 has quit [Client Quit]
psyprus has quit [Ping timeout: 258 seconds]
<toretore>
or basic algorithms and data structures
<apeiros>
all you have to do is go to wikipedia, find the formula, insert the numbers :-p
benzrf is now known as benzrf|offline
<toretore>
hah
Guest82 has joined #ruby
<toretore>
that's like saying "all you have to do is go to github, find the program and insert the values"
<apeiros>
ok, granted, for a couple of calculations, math helps, as you'll need to rearrange the formula to better suit how computer aided calculation works.
psyprus has joined #ruby
Guest82 has quit [Client Quit]
<apeiros>
otherwise you'll get no good result due to numeric stability (too small/large floats)
Soda has joined #ruby
chrishough has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
skolman has quit [Ping timeout: 255 seconds]
<apeiros>
*numerical
spider-mario has joined #ruby
boombadaroomba has quit [Remote host closed the connection]
<apeiros>
fuck, I'm tired. why does this stupid meat machine suffer such bad deterioration?
spider-mario has quit [Remote host closed the connection]
<mozzarella>
guys ( ;____;)
ferr has joined #ruby
<apeiros>
1/3 of the time is maintenance time… :-S
<toretore>
apeiros: who produced it? maybe ask them
<toretore>
ask for a refund
<apeiros>
flying spaghetti monster never answered my questions :-|
<apeiros>
replacement bodies aren't yet available =(
<jhass>
eris did it on "purpose" this way ;)
<toretore>
those corporate idiots with their sucky customer service
sinkensabe has quit [Remote host closed the connection]
<toretore>
i'd go to a competitor
<apeiros>
seems to be a world wide monopoly atm :-<
<toretore>
it's all a scam
afhammad has joined #ruby
kedare has joined #ruby
skolman_ has joined #ruby
msmith__ has quit [Ping timeout: 240 seconds]
<apeiros>
indeed. no matter what you do, the ultimate achievement is always death.
<acidrainfall>
It's a system provisioning / ENC system
<sweeper>
mmm
<acidrainfall>
So these are for linux kickstarts
<sweeper>
I use foreman
<sinequanon>
i've heard of Foreman the gem, but not The Foreman
<acidrainfall>
and this is a kickstart snippet
<acidrainfall>
Well
<acidrainfall>
it's theforeman.org
<acidrainfall>
maybe they put 'the' on it because of george
<acidrainfall>
I use the RPM for install, not the gem, but same thing
dc has joined #ruby
Eiam has quit [Ping timeout: 256 seconds]
<n_blownapart>
<< can't learn ruby. blocked.
<acidrainfall>
Not allowed?
owen2 has joined #ruby
<acidrainfall>
sinequanon: So the reason I'm calling @host.params[''] is because I have that defined on a host group / per node basis, each one gets 'flavor' defined
<acidrainfall>
it's for an old system that I haven't been able to bring up to modern standards yet haha
<acidrainfall>
note that it's on centos5
21WAAGIJS has quit [Ping timeout: 265 seconds]
aspires has quit []
Insanity133 has joined #ruby
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
siwica has quit [Remote host closed the connection]
<n_blownapart>
why do they name that method like that? ^
siwica has joined #ruby
<sinequanon>
n_blownapart: it's a clue
Soda has quit [Remote host closed the connection]
benzrf|offline is now known as benzrf
skolman_ has quit [Remote host closed the connection]
tier has quit [Read error: Connection reset by peer]
<n_blownapart>
sinequanon: please explain
tier has joined #ruby
Trynemjoel has quit [Ping timeout: 265 seconds]
failshell has quit []
<sinequanon>
n_blownapart: it's a clue as to what type of error the assertion will raise
<sinequanon>
(the ___ part you're supposed to fill in)
nickjj has quit [Quit: WeeChat 1.0.1]
jdj_dk has joined #ruby
<n_blownapart>
sinequanon: I know thanks, but why do they set the name within a method def. it is confusing to me.
Insanity133 has quit [Ping timeout: 245 seconds]
cpruitt has quit [Quit: cpruitt]
JohnBat26 has joined #ruby
<n_blownapart>
oh i.e. you cannot set the name in a method definition? sinequanon
<sinequanon>
it's perfectly acceptable to call methods from inside other methods
ProductionBeast has joined #ruby
Trynemjoel has joined #ruby
aspires has joined #ruby
skolman_ has joined #ruby
owen2 has quit [Ping timeout: 264 seconds]
<n_blownapart>
why do they use 'variables cannot be accessed outside the class' as the name?
<sinequanon>
cause that's the name of the test/method, and it's also a clue as to why that test will fail
timonv_ has quit [Remote host closed the connection]
thezanke has left #ruby [#ruby]
thezanke has joined #ruby
<sinequanon>
n_blownapart: fido.name will call the instance method #name on the fido object....do you see def name...end anywhere in the class definition?
KC9YDN has quit [Ping timeout: 245 seconds]
<n_blownapart>
oh yeah sinequanon so you need attr_accessor :name in the class def... to have it work from within a method.
<n_blownapart>
?
<sinequanon>
yeah
<n_blownapart>
excellent thanks sinequanon
<sinequanon>
np
jxf has joined #ruby
<sinequanon>
i think the point that test is trying to make is that fido.name != @name
kaspergrubbe has quit [Remote host closed the connection]
<n_blownapart>
sinequanon: one thing, wouldn't it better to call the method on 15 something else? it seems like it doesn't quite describe the transgression well. apeiros too late for that I'm a geezer.
govg has quit [Quit: leaving]
Takle has joined #ruby
<sinequanon>
n_blownapart: i'm not understanding why you're getting hung up on the method name
<apeiros>
n_blownapart: in that case - rest in pieces :D
Trynemjoel has quit [Ping timeout: 265 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<apeiros>
sorry, couldn't resist
<n_blownapart>
apeiros: np !
DLSteve has quit [Quit: Leaving]
DLSteve has joined #ruby
nickjj has joined #ruby
Brothmars has joined #ruby
Trynemjoel has joined #ruby
<n_blownapart>
sinequanon: it's fido.name !=name because the lack of the getter/setter, so in the set_name method it is merely a container that cannot be accessed. that is my understanding of it..
tesaf has joined #ruby
<sinequanon>
right
jottr_ has quit [Ping timeout: 258 seconds]
<sinequanon>
slight correction: it's just the missing getter
<n_blownapart>
cool I get it thanks sinequanon << good moniker
<sinequanon>
haha thanks
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
momomomomo has joined #ruby
n_blownapart has quit [Remote host closed the connection]
levity_island has joined #ruby
jxf has quit [Ping timeout: 260 seconds]
coderhs has joined #ruby
andrewlio has quit [Quit: Leaving.]
Trynemjoel has quit [Ping timeout: 265 seconds]
coderhs has quit [Client Quit]
ringarin has quit [Ping timeout: 255 seconds]
ctp has joined #ruby
aclearman037 has joined #ruby
Trynemjoel has joined #ruby
riceandbeans has quit [Quit: leaving]
aspires has quit []
aspires has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nettoweb_ has joined #ruby
nettoweb_ has quit [Max SendQ exceeded]
kaspergrubbe has joined #ruby
nettoweb_ has joined #ruby
riceandbeans has joined #ruby
riceandbeans has quit [Changing host]
riceandbeans has joined #ruby
Morkel has quit [Quit: Morkel]
amigo99 has quit [Quit: Leaving]
wallerdev has joined #ruby
djbkd has quit [Remote host closed the connection]
tercenya has quit [Read error: Connection reset by peer]
jthomp has quit [Ping timeout: 264 seconds]
fr1eza has quit []
BTRE has quit [Quit: Leaving]
BTRE has joined #ruby
benzrf is now known as benzrf|offline
MattB2_ has joined #ruby
tercenya has joined #ruby
jthomp has joined #ruby
axl_ has quit [Quit: axl_]
MattB2 has quit [Ping timeout: 265 seconds]
n_blownapart has joined #ruby
agrinb has joined #ruby
larsam has quit [Quit: No Ping reply in 60 seconds.]
davy_ has quit [Quit: Leaving...]
s00pcan has quit [Ping timeout: 250 seconds]
axl_ has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
n008f4g_ has quit [Quit: leaving]
govg has joined #ruby
MattB2_ has quit []
MattB2 has joined #ruby
agrinb has quit [Ping timeout: 265 seconds]
boombadaroomba has quit [Remote host closed the connection]
skolman_ has quit [Remote host closed the connection]
jerius has quit []
allcentury has quit [Ping timeout: 260 seconds]
duncannz has quit [Remote host closed the connection]
olivier_bK has quit [Ping timeout: 260 seconds]
cpruitt has joined #ruby
ProductionBeast has quit [Ping timeout: 255 seconds]
boombadaroomba has joined #ruby
livingstn has quit []
<MattB2>
mozzarella: example?
<siwica>
what is a good zipping gem for ruby?
skolman_ has joined #ruby
cpruitt has quit [Quit: cpruitt]
<toretore>
rubyzip
Pumukel has quit [Ping timeout: 264 seconds]
KC9YDN has joined #ruby
freerobby has joined #ruby
jtdowney has joined #ruby
<daxroc>
What's the best way to run your own gem server ?
nfk has quit [Quit: yawn]
ProductionBeast has joined #ruby
doritostains has quit [Quit: doritostains]
doritostains has joined #ruby
renderfu_ has joined #ruby
Insanity133 has joined #ruby
Vile` has joined #ruby
renderf__ has joined #ruby
Brothmars has quit [Quit: Be back later ...]
KC9YDN has quit [Quit: ☭ Karl Marx & Friedrich Engels, Vladimir Lenin, Josef Stalin, Mao Tse-Tung, Kim Il Sung, Ho Chi Minh, Fidel Castro & Ernesto Guevara ☭]
dkphenom has joined #ruby
pietr0 has joined #ruby
sailias1 has quit [Quit: Leaving.]
KC9YDN has joined #ruby
renderful has quit [Ping timeout: 240 seconds]
roolo has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
silkfox has quit [Ping timeout: 245 seconds]
m8 has quit [Quit: Sto andando via]
renderfu_ has quit [Ping timeout: 260 seconds]
Insanity133 has quit [Ping timeout: 260 seconds]
sts has joined #ruby
nateberkopec has quit [Quit: Leaving...]
disKounted has joined #ruby
<sts>
what would be a nice pattern to define a object with methods which are executed sequentially?
gsd has joined #ruby
<sts>
the methods don't even need to return something its they just split up functionality.
Lewix has joined #ruby
reinaldob has quit [Remote host closed the connection]
nateberkopec has joined #ruby
Lewix has quit [Remote host closed the connection]
kaspergrubbe has quit [Remote host closed the connection]
govg has quit [Ping timeout: 256 seconds]
<gr33n7007h>
How do you surpress output of `^C` when trapping a signal, `trap(2) { exit }` to stdout?
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oo_ has joined #ruby
<gr33n7007h>
is even possible?
allcentury has joined #ruby
jtdowney has joined #ruby
jtdowney has quit [Changing host]
jtdowney has joined #ruby
ndrei has quit [Ping timeout: 245 seconds]
isaick has quit [Quit: isaick]
zwer_i has joined #ruby
jheg has joined #ruby
jxf has quit [Ping timeout: 258 seconds]
<n_blownapart>
more drama : http://pastie.org/9701489 I left my error on line 25 so some kind person would explain what is happening with inspect.
zwer has quit [Ping timeout: 250 seconds]
<jhass>
n_blownapart: this has nothing to do with the inspect yet
oo_ has quit [Ping timeout: 256 seconds]
Kricir has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
josephndenton has joined #ruby
charliesome has joined #ruby
allcentury has quit [Ping timeout: 256 seconds]
Cheezebox has joined #ruby
thagomizer has quit [Quit: Leaving.]
<tmoore>
n_blownapart: could you explain what you're trying to do in that code?
wldcordeiro_ has quit [Quit: Leaving]
<n_blownapart>
jhass: tmoore its a tutorial. apparently line 25 should read <Dog named 'Fido'>
<jhass>
n_blownapart: no
<n_blownapart>
^ instead of the array
benzrf|offline is now known as benzrf
<jhass>
the error uses inspect to describe what it's inspecting
jheg has quit [Ping timeout: 264 seconds]
<jhass>
it doesn't actually expect inspects output here
<jhass>
the question you need to ask is, "what is this trying to teach me?"
<jhass>
(try to answer it for yourself first)
josephndenton has quit [Ping timeout: 250 seconds]
Joufflu has quit [Quit: Leaving]
byprdct has quit [Ping timeout: 250 seconds]
<n_blownapart>
line 21 has the hint 'self refers to the containing object, so I thought self would return the container [:@name].
<n_blownapart>
jhass: ^
byprdct has joined #ruby
<jhass>
[:@name] is the Symbol :@name inside an array. I don't see any connection to "container" or "containing object"
<tmoore>
n_blownapart: can you link us to the tutorial... there's a lot of weird stuff happening in that code
Trynemjoel has quit [Ping timeout: 265 seconds]
<jhass>
tmoore: it's the koans
phutchins has quit [Ping timeout: 260 seconds]
jimms has quit [Remote host closed the connection]
<jhass>
n_blownapart: the question you need to answer is what get_self returns
<n_blownapart>
yeah tmoore complicated. before line 16 there was no mention, instruction re: inspect at all anywhere preceding.
nb_bez___ has joined #ruby
<jhass>
the koans aren't exactly meant for somebody who's new to programming btw
<n_blownapart>
nothing is jhass that I've seen.
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider>
I don't think the RUBY koans are bad for new programmers... but I def start ppl on chris pine's book first
Trynemjoel has joined #ruby
alvaro_o has quit [Read error: Connection reset by peer]
Musashi007 has quit [Quit: Musashi007]
<n_blownapart>
but how does line 25 relate to inspect method on 16 ?
mistermocha has quit [Remote host closed the connection]
Tab__ has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jtdowney has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mg^>
Writing tests reminds me why I didn't want to become a professional programmer.
<mg^>
but my professional programmer colleagues bullied me into it so frustration ensues.
<tmoore>
as a professional programmer, dealing untested code is what makes me sometimes want to change careers ;-)
<jhass>
n_blownapart: it doesn't in a way you need to care about yet
<tmoore>
s/dealing/dealing with/
djstorm has quit [Ping timeout: 264 seconds]
agrinb has joined #ruby
jtdowney has quit [Client Quit]
vinleod has joined #ruby
<mg^>
Yeah well as a sysadmin I prefer making stuff work and moving on :)
<zenspider>
tmoore: exactly
Axy has joined #ruby
Axy has joined #ruby
<zenspider>
and time and time again I find that sysadmins make the worst programmers. :/
<mg^>
But no, we want to release my /internal/ project to the /public/ now
<n_blownapart>
jhass but is it that complicated?
oo_ has joined #ruby
<zenspider>
halfassed programs held together with duct tape and twine. ready to break once a single thing changes but you can never tell where unless you run the whole thing... why? no tests.
<jhass>
n_blownapart: no, it's fairly simple if you got how object oriented programming works
acidrainfall has left #ruby [#ruby]
cantonic has joined #ruby
workmad3 is now known as wm3|away
<mg^>
zenspider: I'll try not to be personally offended by the generalization
<mg^>
Mainly because most of my code has to be maintained by other sysadmins
jobewan has quit [Quit: Leaving]
<mg^>
and 99% of the time they will change something that breaks the tests
<mg^>
and not know how to fix them
<mg^>
It comes from require
<mg^>
Anyway, since I just started learning rspec today, I am sure I will have my problem figured out shortly
User458764 has quit [Ping timeout: 265 seconds]
<sinequanon>
humblebrag
<mg^>
I'm just at the point where I'd rather be doing than reading
Cheezebox has quit []
triple_b_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
bMalum has joined #ruby
dc has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
<n_blownapart>
jhass: well in the dark. so shouldn't self return the object_id or just the name attribute at this point? I read inspect docs but don't see how inspect is called when self is returned.
<jimms>
Hey everyone! Is there a quick ruby way to duplicate an array member? like to make [1, 2, 3, 4, 5] into [1, 2, 2, 2, 3, 4, 5]?
dkb20k has joined #ruby
mary5030 has joined #ruby
s00pcan has joined #ruby
jack_rabbit has joined #ruby
<jhass>
n_blownapart: the thing that generates the error message calls inspect. Stop carying about that fact
atomi has quit [Remote host closed the connection]
<dopie>
jhass, is ruby gangster :)
<jhass>
and no, self does not return object_id or an abitrary instance variable
<sinequanon>
(but you're close)
<n_blownapart>
jhass: ok many thanks I can work with that.
mib_mib has joined #ruby
<mg^>
and also, I really want to write a test that starts with it "puts the lotion on its skin or else it gets the hose again"
<wm3|away>
mg^: that should be two tests ;)
<mg^>
yeah probably
oo_ has joined #ruby
<mg^>
I will find a way to hide that somewhere
<mg^>
To be found years later by zenspider and submitted to thedailywtf
<wm3|away>
mg^: it "gets the hose when it doesn't put the lotion on its skin" and it "doesn't get the hose when it puts the lotion on its skin"
<sinequanon>
n_blownapart: pm
<n_blownapart>
alright thanks
<mg^>
yeah but that doesn't quote the movie accurately :)
dkb20k has quit [Ping timeout: 250 seconds]
mary5030 has quit [Ping timeout: 245 seconds]
Spami has joined #ruby
Spami has quit [Client Quit]
duggiefresh has joined #ruby
robustus|Off has quit [Ping timeout: 255 seconds]
levity_island has quit [Quit: levity_island]
DTSCode has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
oo_ has quit [Ping timeout: 264 seconds]
rkalfane has joined #ruby
robustus has joined #ruby
Spami has joined #ruby
SloggerKhan has joined #ruby
levity_island has joined #ruby
gregf has joined #ruby
coderhs has joined #ruby
<SloggerKhan>
I came across code where initialize is given as `def initialize(*)` Is there a default name for an arguments array? Normally you'd see `def initialize(*args)`, right?
duggiefresh has quit [Ping timeout: 256 seconds]
oo_ has joined #ruby
<zenspider>
SloggerKhan: that's for when you want to throw them away
<zenspider>
(or are always calling super w/ no args, so they just get passed up as-is
<zenspider>
)
<SloggerKhan>
Ah, so if calling super without args, then I have to look at the code for the super class to know what to do, I suppose.