sassamo has quit [Remote host closed the connection]
sassamo has joined #ruby
Red_Onyx has joined #ruby
psyl0n has quit [Remote host closed the connection]
kitak_ has joined #ruby
alekst has joined #ruby
benlieb has quit [Quit: benlieb]
dayepa has quit [Ping timeout: 276 seconds]
Xeago has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
ce_afk is now known as cescalante
kuzushi has joined #ruby
sassamo has quit [Ping timeout: 272 seconds]
pel_daniel has left #ruby [#ruby]
aryaching has joined #ruby
Deele has quit [Ping timeout: 260 seconds]
fgo has quit [Remote host closed the connection]
mklappstuhl has quit [Remote host closed the connection]
RagingDave has joined #ruby
dayepa1 has joined #ruby
guardianx has joined #ruby
alekst has quit [Quit: Computer has gone to sleep.]
Hobogrammer_ has joined #ruby
RagingDave has quit [Client Quit]
benzrf has joined #ruby
<benzrf>
whats new
<benzrf>
new adventure time and new archer tonite!
ndrei has quit [Ping timeout: 245 seconds]
sLi_ has joined #ruby
vlad_starkov has joined #ruby
dayepa has joined #ruby
teddyp1cker has joined #ruby
psst has joined #ruby
SilentHobo has quit [Ping timeout: 276 seconds]
troyready has joined #ruby
dayepa1 has quit [Ping timeout: 276 seconds]
snath has quit [Ping timeout: 252 seconds]
dayepa1 has joined #ruby
VTLob has quit [Quit: VTLob]
vlad_starkov has quit [Read error: Connection reset by peer]
lifestream has joined #ruby
lifestream has joined #ruby
deens has quit [Remote host closed the connection]
dayepa has quit [Ping timeout: 276 seconds]
teddyp1cker has quit [Ping timeout: 265 seconds]
ndrei has joined #ruby
nide has quit [Quit: Leaving]
psyl0n has joined #ruby
Jdubs has quit [Remote host closed the connection]
dayepa has joined #ruby
cj3kim_ has joined #ruby
dayepa1 has quit [Ping timeout: 276 seconds]
cj3kim has quit [Read error: Connection reset by peer]
binw has quit [Read error: Connection reset by peer]
byprdct has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Megtastique has quit []
gusblan has quit [Remote host closed the connection]
thenovices has joined #ruby
mneorr has quit [Remote host closed the connection]
dayepa1 has joined #ruby
vlad_starkov has joined #ruby
deception has quit [Quit: Goodbye]
mneorr has joined #ruby
awkwords has quit [Quit: Connection closed for inactivity]
kevind has quit [Quit: kevind]
m00nlight has joined #ruby
troyready has quit [Ping timeout: 245 seconds]
benlieb has joined #ruby
psst has quit [Ping timeout: 260 seconds]
SilentHobo has joined #ruby
geggam has quit [Remote host closed the connection]
NCS_One has joined #ruby
dayepa has quit [Ping timeout: 276 seconds]
<NCS_One>
hi
mneorr has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
dayepa has joined #ruby
nowthatsamatt has joined #ruby
<NCS_One>
can someone help me with this error on Ocra: /var/lib/gems/1.8/gems/ocra-1.3.1/bin/ocra:18:in `quote': can't convert nil into String (TypeError)
shadoi has joined #ruby
thenovices has quit [Ping timeout: 248 seconds]
binw has joined #ruby
Hobogrammer_ has quit [Read error: Operation timed out]
lockweel has quit [Ping timeout: 272 seconds]
dayepa1 has quit [Ping timeout: 276 seconds]
cj3kim_ has quit [Ping timeout: 245 seconds]
dayepa1 has joined #ruby
predator217 has joined #ruby
<shevy>
NCS_One seems like sloppy code in that gem
<shevy>
you also seem to run an ancient debian ruby
Spami_ has quit [Quit: This computer has gone to sleep]
Virtualize has joined #ruby
Liquid-- has quit [Quit: Computer has gone to sleep.]
<NCS_One>
shevy: ruby 1.9.3
predator117 has quit [Read error: Operation timed out]
<shevy>
unlikely
<shevy>
I have 1.9.3 myself and the site dir is at /usr/lib/ruby/gems/1.9.1/gems/
<shevy>
to have a path 1.8 in a directory while you have a version that is not 1.8.x shows that someone or something messed with the system
fphilipe has joined #ruby
dayepa has joined #ruby
IcyDragon has joined #ruby
yarou has joined #ruby
yarou has quit [Changing host]
yarou has joined #ruby
sassamo has joined #ruby
<bnagy>
using gems from 1.8 ABI with 1.9 is also unlikely to be fun
byprdct has joined #ruby
tkuchiki has joined #ruby
zz_karupanerura is now known as karupanerura
<NCS_One>
shevy: yes, ubuntu
IceDragon has quit [Disconnected by services]
IcyDragon is now known as IceDragon
<shevy>
Hanmac here also uses ubuntu
<bnagy>
NCS_One: long story short, I'd try installing 1.9 properly then reinstall the gem
dayepa1 has quit [Ping timeout: 276 seconds]
blackmesa has quit [Ping timeout: 248 seconds]
figgleberry has joined #ruby
dayepa1 has joined #ruby
<benzrf>
i use it too B)
<NCS_One>
I'm going to try to uninstall and install all
<bnagy>
benzrf: wow, that's super softcore for you, dude. I would have picked you as a gentoo or slack user
<bnagy>
with twm
sLi_ has quit [Remote host closed the connection]
dayepa has quit [Ping timeout: 276 seconds]
fphilipe has quit [Ping timeout: 252 seconds]
psyl0n has quit [Remote host closed the connection]
<bnagy>
or maybe awesome, so you can tile all your vim windows
aspires has quit []
sLi_ has joined #ruby
dayepa has joined #ruby
<shevy>
benzrf one day you will become a powerful user
fgo has joined #ruby
<shevy>
and the unity world can be left behind
tylersmith has quit [Remote host closed the connection]
momomomomo has joined #ruby
NCS_One has quit [Quit: leaving]
habanany has joined #ruby
dayepa1 has quit [Ping timeout: 276 seconds]
figgleberry has quit [Ping timeout: 272 seconds]
Hobogrammer_ has joined #ruby
rudisimo has joined #ruby
habanany has quit [Client Quit]
dayepa1 has joined #ruby
byprdct has quit [Ping timeout: 272 seconds]
gusblan has joined #ruby
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
mocfive has quit [Remote host closed the connection]
Hamburglr has joined #ruby
asteros has quit [Quit: asteros]
wildroman2 has quit [Remote host closed the connection]
gusblan has quit [Remote host closed the connection]
amacgregor__ has joined #ruby
sLi_ has quit [Ping timeout: 272 seconds]
dweeb_ has quit [Quit: Computer has gone to sleep.]
benlieb has quit [Quit: benlieb]
dayepa has quit [Ping timeout: 276 seconds]
cbetta is now known as cbetta_afk
dayepa has joined #ruby
mojjojo has quit [Quit: mojjojo]
amacgregor_ has quit [Ping timeout: 246 seconds]
SilentHobo has quit [Ping timeout: 248 seconds]
gusblan has joined #ruby
flubba has quit [Remote host closed the connection]
<benzrf>
bnagy: haha rly?
mary5030 has joined #ruby
<benzrf>
bnagy: i do not see the point in making things hard for yourself
<benzrf>
using slax or w/e does not give significant advantages over ubuntu so why go to the trouble ?
flubba has joined #ruby
stryek has joined #ruby
<Hamburglr>
could someone help me with using rbenv? I have a gem installed and trying to run it gets this error: https://gist.github.com/anonymous/166c0c9aca9ff31758ba as far as I can tell it's because I don't have my gem path right but I don't know where to specify it
cescalante is now known as ce_afk
<benzrf>
i tried xmonad and it was p nice but my screen is not nearly big enough to really get the most out of it
dayepa1 has quit [Ping timeout: 276 seconds]
habanany has joined #ruby
lfox has joined #ruby
lfox has quit [Client Quit]
deens has joined #ruby
lfox has joined #ruby
dayepa1 has joined #ruby
robustus has quit [Ping timeout: 252 seconds]
Lewix has joined #ruby
gusblan has quit [Ping timeout: 245 seconds]
binaryhat has joined #ruby
dayepa has quit [Ping timeout: 276 seconds]
robustus has joined #ruby
flubba has quit [Ping timeout: 252 seconds]
dayepa has joined #ruby
burlyscudd has joined #ruby
sLi_ has joined #ruby
Alina-malina has quit [Ping timeout: 252 seconds]
dayepa1 has quit [Ping timeout: 276 seconds]
asteros has joined #ruby
troyready has joined #ruby
Alina-malina has joined #ruby
Spami_ has joined #ruby
dayepa1 has joined #ruby
Hobogrammer_ has quit [Ping timeout: 276 seconds]
dayepa has quit [Ping timeout: 276 seconds]
burlyscudd has quit [Ping timeout: 272 seconds]
vlad_starkov has joined #ruby
dayepa has joined #ruby
earthquake has quit [Quit: earthquake]
agjacome has quit [Ping timeout: 272 seconds]
shadoi has quit [Quit: Leaving.]
vlad_starkov has quit [Read error: Connection reset by peer]
dayepa1 has quit [Ping timeout: 276 seconds]
<shevy>
benzrf do you use debian ruby?
petey has quit [Remote host closed the connection]
<RubyPanther>
rbenv generally does compile everything from source
<shevy>
it falls flat on the face in this case
psyl0n has quit [Remote host closed the connection]
psyl0n has joined #ruby
psyl0n has joined #ruby
<shevy>
RubyPanther what do you use to get the latest ruby running?
MrZYX is now known as MrZYX|off
<RubyPanther>
Hamburglr: it looks like your gem got installed with the system ruby or something
marr has quit [Ping timeout: 272 seconds]
sLi_ has quit [Ping timeout: 272 seconds]
dayepa has quit [Ping timeout: 276 seconds]
dayepa1 has joined #ruby
<Hamburglr>
RubyPanther: I don't think it's that either, I can see the gems in /usr/local/opt/gems
<RubyPanther>
Hamburglr: you should remove other rubies, or fix your PATH so that the rbenv bin dir is before the system bin dirs. And then install the gem
<RubyPanther>
on slackware people fix their problems before they admit to them, so it always looks smooth ;)
<postmodern>
copy/paste those commands, should be good
<shevy>
postmodern, pacman on archlinux I group together with slackware
<shevy>
so people who use either these distributions are usually clever
<RubyPanther>
Or, they cry a lot
<postmodern>
shevy, im on fedora, does that make me dumb :P
<postmodern>
shevy, or shall i say doomb
<shevy>
yes
<shevy>
sorry :(
<shevy>
I think slackware is slowly dying
<RubyPanther>
fedora is for devs, historically
<shevy>
#archlinux +1600 vs. #slackware ~+200
<postmodern>
shevy, jokes on you, i ran Gentoo for years, i've paid my dues
<shevy>
hah!
<shevy>
gentoo!
<shevy>
that python shit!
zxd has joined #ruby
dayepa has quit [Ping timeout: 276 seconds]
kep has quit [Quit: WeeChat 0.4.2]
zarul has joined #ruby
<postmodern>
i believe capistrano was a gentoo project originally
<benzrf>
come now python is pretty nice
<shevy>
wheee... +1040 people on #gentoo
<RubyPanther>
gentoo was cool, that was the difference with fedora. gentoo drew off the fanboys and let fedora focus on bridging the server/workstation gap
cj3kim has quit [Remote host closed the connection]
kitak has joined #ruby
<postmodern>
shevy, only the package manager was python, the package definitions were actually bash
<shevy>
benzrf I want a ruby centric distribution, not portage/emerge/eselect
<postmodern>
shevy, only used python to extract metadata and build the db
<shevy>
debian still uses perl in dpkg
<shevy>
I found out when I removed perl
dayepa has joined #ruby
<postmodern>
pfff i want a Rust centric package manager
<shevy>
stupid dpkg was no longer working :(
cj3kim has joined #ruby
mneorr_ has joined #ruby
zeade has quit [Quit: Leaving.]
<shevy>
Rust? is anyone using that?
_mtr has joined #ruby
cj3kim has quit [Remote host closed the connection]
Virtualize has quit [Quit: Leaving...]
<RubyPanther>
yum is also python, I know this from years of making fun of the error messages.
dayepa1 has quit [Ping timeout: 276 seconds]
Virtualize has joined #ruby
Virtualize has quit [Client Quit]
kitak_ has quit [Ping timeout: 245 seconds]
dayepa1 has joined #ruby
<shevy>
hmm
<shevy>
python is like the ultimate virus
Virtualize has joined #ruby
diegoviola has joined #ruby
<shevy>
very successful
freezey has quit [Ping timeout: 252 seconds]
<postmodern>
we should write a package manager in PHP, just because
<krainboltgreene>
But I'm fairly sure it's from before they removed it from the spec.
<krainboltgreene>
shevy: ^
snath has joined #ruby
sLi_ has quit [Ping timeout: 246 seconds]
kenndel_ has joined #ruby
mneorr has joined #ruby
kenndel has quit [Ping timeout: 245 seconds]
gusblan has joined #ruby
fgo has joined #ruby
gwb3 has joined #ruby
simoz4 has joined #ruby
bkparso has joined #ruby
tyl has joined #ruby
aspires has joined #ruby
rylinaux has quit [Quit: Quit - ZNC]
sepp2k has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
gwb3 has quit [Quit: leaving]
Wolland has quit [Remote host closed the connection]
lioninawhat has quit [Ping timeout: 252 seconds]
rylinaux has joined #ruby
gwb3 has joined #ruby
rylinaux is now known as Guest80723
digital-ghost has quit [Remote host closed the connection]
diegoviola has quit [Quit: WeeChat 0.4.2]
gwb3 has quit [Client Quit]
gwb3 has joined #ruby
carif has joined #ruby
diegoviola has joined #ruby
asteros has joined #ruby
ss_ has quit [Remote host closed the connection]
asteros has quit [Client Quit]
reset has quit [Ping timeout: 248 seconds]
Voodoofish430 has quit [Quit: Leaving.]
Guest80723 has quit [Quit: Quit - ZNC]
Xaitec has quit [Remote host closed the connection]
Targen has joined #ruby
heidi has joined #ruby
gja has joined #ruby
tyl has quit [Ping timeout: 248 seconds]
radic has quit [Ping timeout: 252 seconds]
tyl has joined #ruby
radic has joined #ruby
lfox has quit [Quit: ZZZzzz…]
pu22l3r_ has quit [Remote host closed the connection]
fgo has quit [Remote host closed the connection]
heidi has quit [Ping timeout: 246 seconds]
coderhs has joined #ruby
rylinaux_ has joined #ruby
rickruby has joined #ruby
smathieu has quit [Remote host closed the connection]
smathieu has joined #ruby
<hostess>
I'm trying to refactor some ugly code. Can anyone prettify this? configs.grep(/http_username=(\S+)/i)[0].match(/http_username=(\S+)/i)[1] it's essentially reading through an array (configs) and just pulling out the value of the http_username=asdf for the single item in the array named "http_username"
gwb3 has quit [Quit: leaving]
havenwood has joined #ruby
lioninawhat has joined #ruby
Hobogrammer has joined #ruby
<ddd>
hrmm. say I have a @user.role string. where the string is like 'rescue_group'. How would I turn that into @user.rescue_groups ?. I mean @user.role = "rescue_group". @user has a plural collection of the same name as the role. So, I want to do something like @collection = @user.#{@user.role.pluralize}
kenndel_ has quit [Ping timeout: 245 seconds]
<ddd>
the reason for this is role can change, but role will always contain the singular form of @user's attached collection
<ddd>
so I want to turn that into the attr name to call on @user
vedic has joined #ruby
<RubyPanther>
hostess: I'm trying to picture what the larger codebase would look like that has that excerpt... I'm picturing a full rewrite
<hostess>
RubyPanther: it's a really small script actually. I'm just a ruby retard
<hostess>
If it were C#, I could use Linq like a master, but I still can't grasp enumerables in ruby, which is almost the same thing
mneorr has quit [Remote host closed the connection]
freerobby has joined #ruby
smathieu has quit [Ping timeout: 276 seconds]
<hostess>
Interesting, this kinda works: configs.grep(/http_username=(\S+)/i) { |v| $1 }
luckyruby has quit [Remote host closed the connection]
mneorr has joined #ruby
aspires has quit []
yedimind has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<hostess>
bnagy: That returns an array with a nil for every item in the original array that doesn't match, and then matches on the 1 config value properly. I'd then have to remove all nil values
gwb3 has joined #ruby
i_s has quit [Remote host closed the connection]
<hostess>
RubyPanther: that just returns the first item in the original array
gwb3 has quit [Client Quit]
<centrx>
Hold on, I feel an inspiration coming on
<RubyPanther>
hostess: Without seeing the whole script, or test data, I'm not really sure what is going on
danshultz has quit [Ping timeout: 272 seconds]
<hostess>
RubyPanther: no worries, I think I can go with this pretty well: configs.grep(/http_username=(\S+)/i) { |v| $1 }
i_s has joined #ruby
<hostess>
it returns the value of the one config key that matches the regex
<hostess>
well, technically it would return multiple if they existed
nateberkopec has joined #ruby
<bnagy>
match globals are awful
petey has quit [Remote host closed the connection]
<RubyPanther>
On my test data, that is what mine did, except giving at most 1 result
gwb3 has joined #ruby
i_s has quit [Remote host closed the connection]
danijoo has quit [Read error: Connection reset by peer]
Mars has joined #ruby
marcgg_ has quit [Ping timeout: 272 seconds]
<RubyPanther>
If you really want $1 you can leave out the |v|, but yeah... I'm allergic to globals
danijoo has joined #ruby
Mars is now known as Guest30150
marcgg has joined #ruby
gwb3 has quit [Client Quit]
_mtr has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
IcyDragon has joined #ruby
<centrx>
hostess, May want to use reduce/inject
havenwood has joined #ruby
gwb3 has joined #ruby
gwb3 has quit [Client Quit]
<centrx>
hostess, Also as mentioned if there is other code, there might be a better way to do the code over-all, e.g. if it splits on new line to get the config option
<bnagy>
hostess: add .compact to the end, then
parduse has quit [Ping timeout: 272 seconds]
<RubyPanther>
yeah just stick it in the compactor, that will fix it
lioninawhat has quit [Ping timeout: 276 seconds]
lifestream has quit [Quit: Leaving]
sandGorgon has joined #ruby
nateberkopec has quit [Ping timeout: 272 seconds]
<hostess>
Ok, that may be a slightly better option than the global method
IceDragon has quit [Ping timeout: 252 seconds]
parduse has joined #ruby
gwb3 has joined #ruby
parduse has quit [Changing host]
parduse has joined #ruby
parduse has quit [Killed (hitchcock.freenode.net (Nickname regained by services))]
parduse has joined #ruby
parduse has quit [Changing host]
parduse has joined #ruby
troyready has quit [Ping timeout: 272 seconds]
axl_ has quit [Quit: axl_]
sassamo has quit [Remote host closed the connection]
havenwood has quit []
lfox has joined #ruby
sassamo has joined #ruby
_mtr has joined #ruby
HashNuke has left #ruby [#ruby]
Virtualize has quit [Quit: Leaving...]
thomasxie has joined #ruby
parduse has quit [Ping timeout: 265 seconds]
lyanchih_ has quit [Quit: lyanchih_]
sandGorgon has quit [Ping timeout: 246 seconds]
ss_ has joined #ruby
sassamo has quit [Ping timeout: 260 seconds]
sLi_ has joined #ruby
sLi_ has quit [Client Quit]
parduse has joined #ruby
parduse is now known as Guest354
fgo has joined #ruby
stryek has quit [Ping timeout: 246 seconds]
Montes has joined #ruby
yfeldblu_ has quit [Remote host closed the connection]
braincrash has quit [Quit: bye bye]
ss_ has quit [Ping timeout: 248 seconds]
Montes has quit [Remote host closed the connection]
pardusf has joined #ruby
pardusf has quit [Changing host]
pardusf has joined #ruby
pardusf is now known as parduse
Guest354 has quit [Ping timeout: 260 seconds]
cyberarm has quit [Quit: Bye]
_mtr has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
braincrash has joined #ruby
freerobby has quit [Quit: Leaving.]
meatherly has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
JohnBat26 has joined #ruby
vpretzel has quit [Read error: Connection reset by peer]
vpretzel has joined #ruby
mneorr has joined #ruby
braincra- has joined #ruby
simoz4 has joined #ruby
_mtr has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
meatherly has joined #ruby
tylersmith has joined #ruby
tharindu has joined #ruby
braincrash has quit [Ping timeout: 272 seconds]
larissa has quit [Quit: Leaving]
i_s has joined #ruby
subbyyy__ has joined #ruby
aspires has quit []
Guest30150 has quit [Remote host closed the connection]
aspires has joined #ruby
juni0r has quit [Ping timeout: 245 seconds]
heidi has joined #ruby
aspires has quit [Client Quit]
alexfreidah has joined #ruby
mneorr has quit [Remote host closed the connection]
fphilipe has joined #ruby
caesura has quit [Quit: Leaving]
mneorr has joined #ruby
aspires has joined #ruby
rezzack has quit [Quit: Leaving.]
juni0r has joined #ruby
heidi has quit [Client Quit]
i_s has quit [Ping timeout: 276 seconds]
brunops has quit [Ping timeout: 272 seconds]
mocfive has quit [Remote host closed the connection]
amacgregor_ has quit [Read error: Connection reset by peer]
fphilipe has joined #ruby
amacgregor_ has joined #ruby
Kar- has joined #ruby
<Fractional>
Going to experience some more with regexs :D
<Fractional>
regexes*
<Hanmac>
reg-hexes ;P
wildroman3 has quit [Remote host closed the connection]
jprovazn has joined #ruby
Parker0 has joined #ruby
Parker0 has quit [Client Quit]
phipes has quit [Remote host closed the connection]
<Fractional>
There is no \h on that website
nateberkopec has joined #ruby
vpretzel has quit [Ping timeout: 272 seconds]
dweeb_ has quit [Quit: Computer has gone to sleep.]
senayar has quit [Remote host closed the connection]
<tobiasvl>
sure there is
<tobiasvl>
/\h/ - A hexdigit character ([0-9a-fA-F])
senayar has joined #ruby
kreantos has joined #ruby
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<Fractional>
I can't see it on the Rubular website.
wildroman2 has joined #ruby
<tobiasvl>
oh, yeah.
tharindu has quit [Ping timeout: 248 seconds]
Fractional has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
apeiros has joined #ruby
vpretzel has joined #ruby
nateberkopec has quit [Ping timeout: 252 seconds]
Wolland has quit [Remote host closed the connection]
dukz has joined #ruby
ferr has joined #ruby
Fly80 has joined #ruby
sergicles has joined #ruby
ahmedelg_ has quit [Remote host closed the connection]
aryaching has quit [Ping timeout: 260 seconds]
drumusician has joined #ruby
troessner has joined #ruby
io_syl has quit []
Spami has quit [Quit: This computer has gone to sleep]
phansch has joined #ruby
maoko has joined #ruby
ace_striker has quit [Ping timeout: 272 seconds]
timonv has joined #ruby
dagobah has joined #ruby
<Fly80>
hello everybody
gja has quit [Quit: This computer has gone to sleep]
dukz_ has joined #ruby
noop has quit [Ping timeout: 246 seconds]
<Fly80>
i would like to write some text (in my ERB script) and return it as a file to the client. Is it possible with Ruby? How to do that? Should I set the http response header?
cj3kim has joined #ruby
jlebrech has joined #ruby
claymore has quit [Ping timeout: 276 seconds]
ahmedelgabri has joined #ruby
terrellt_ has joined #ruby
CpuID has quit [Quit: This computer has gone to sleep]
claymore has joined #ruby
dukz has quit [Ping timeout: 252 seconds]
terrellt has quit [Ping timeout: 265 seconds]
marr has joined #ruby
klaut has quit [Remote host closed the connection]
meatherly has joined #ruby
Xeago has joined #ruby
sergicles has quit [Quit: sergicles]
thenovices has joined #ruby
roolo has joined #ruby
darthdeus has joined #ruby
Fractional has joined #ruby
m00nlight has quit [Quit: Konversation terminated!]
decoponio has joined #ruby
rdark has joined #ruby
meatherly has quit [Ping timeout: 252 seconds]
monkegjinni has joined #ruby
cj3kim has quit [Ping timeout: 272 seconds]
sergicles has joined #ruby
arturaz has joined #ruby
thenovices has quit [Ping timeout: 260 seconds]
cbetta_afk is now known as cbetta
sergicles has quit [Client Quit]
noop has joined #ruby
zegerjan has quit [Ping timeout: 260 seconds]
mehlah has joined #ruby
heftig has joined #ruby
ephemerian has joined #ruby
fella6s has joined #ruby
joumunji has joined #ruby
fgo has joined #ruby
Mon_Ouie has joined #ruby
rootshift has joined #ruby
Kneferilis has quit [Read error: Connection reset by peer]
carif has quit [Ping timeout: 252 seconds]
dukz has joined #ruby
_Andres has joined #ruby
wildroman2 has quit [Remote host closed the connection]
krz has quit [Ping timeout: 276 seconds]
fgo has quit [Ping timeout: 272 seconds]
lewellyn has quit [Ping timeout: 276 seconds]
dseitz has joined #ruby
TMM has joined #ruby
dukz_ has quit [Ping timeout: 276 seconds]
krz has joined #ruby
mechanicles has joined #ruby
<mechanicles>
Hi all
ozgun has joined #ruby
<mechanicles>
How do I convert binary file into text file?
sassamo has joined #ruby
<mechanicles>
I have csv file which has type as binary? How can read it?
zegerjan has joined #ruby
timonv has quit [Remote host closed the connection]
<Hanmac>
mechanicles: show me your code in a gist and then tell me what is wrong ... (normally it should automaticlly open files in the correct mode ... )
juni0r has quit [Ping timeout: 245 seconds]
juni0r has joined #ruby
maoko has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
camilasan has joined #ruby
<Fly80>
hello, I would like to write some text (in my ERB script) and return it as a file to the client. Is it possible with Ruby? How to do that? Should I set the http response header?
sassamo has quit [Ping timeout: 260 seconds]
lsmola_ has quit [Ping timeout: 276 seconds]
<Hanmac>
Fly80 isnt erb more used in rails? if yes you can try #rubyonrails for more help
shaunbaker has joined #ruby
ss_ has joined #ruby
dweeb_ has joined #ruby
_tpavel has quit [Quit: Leaving]
tt1187 has joined #ruby
olivier_bK has joined #ruby
nateberkopec has joined #ruby
psyl0n has joined #ruby
Advocation has joined #ruby
alexherbo2 has quit [Quit: WeeChat 0.4.2]
alexherbo2 has joined #ruby
Olipro has joined #ruby
Macaveli has quit [Ping timeout: 272 seconds]
tvw has joined #ruby
joumunji has quit [Remote host closed the connection]
Kneferilis has joined #ruby
ferr has quit [Remote host closed the connection]
workmad3 has joined #ruby
lsmola_ has joined #ruby
nateberkopec has quit [Ping timeout: 260 seconds]
Macaveli has joined #ruby
<mechanicles>
Hanmac: If I open bynary typed csv file like File.readlines(path)...it shows me some different output
<mechanicles>
Hanmac: I just tried in rails console
<Takumo>
Hi all, I'm writing a REST client using Faraday (and the Twitter gem as a reference) but I've not seen any documentation on how to work with a dynamic endpoint
<Hanmac1>
mechanicles: PS: DONT open a csv file with readlines ... there is a CSV module in stdlib for that
braddeicide has left #ruby ["Leaving"]
Hanmac has quit [Ping timeout: 252 seconds]
h0lyalg0rithm has quit [Client Quit]
diegoviola has quit [Quit: WeeChat 0.4.2]
Hanmac1 is now known as Hanmac
<mechanicles>
Hanmac1: File.readlines(path,:mode=>"rb") did not work. It does not show me text format. Now testing with CSV standard library.
<Hanmac>
mechanicles: What "textFormat" do you mean? are you sure you didnt do something wrong?
<Fly80>
Hanmac: i'll ask there, thx
<workmad3>
Takumo: sorry, I don't understand what you mean by 'dynamic endpoint'
aspiers has quit [Quit: WeeChat 0.4.1]
maoko has joined #ruby
aspiers has joined #ruby
krz has quit [Ping timeout: 246 seconds]
<Takumo>
workmad3: I think I've solved it, e.g. the twitter APi is always at https://api.twitter.com/api/1.1/ , some have endpoints like "https://#{account}.myapp.com"
<Takumo>
I've just given my client an .endpoint method
_Andres has quit [Read error: Connection reset by peer]
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<workmad3>
Takumo: ah, you threw me because 'account.app.com' actually went to a site ;)
<Takumo>
really? well someone paid top $$ for that domain
tvw has quit []
<workmad3>
Takumo: but what you meant is that you need to set the account name or potentially even the entire API endpoint url
wildroman2 has joined #ruby
gja has joined #ruby
xjiujiu has quit [Read error: Connection reset by peer]
albertgrala has joined #ruby
<Takumo>
yeah
poulson has joined #ruby
<workmad3>
Takumo: it didn't help that you said 'i.e.' instead of 'e.g.' for an example :)
<Takumo>
so instead of having a constant "ENDPOINT" I've defined a method to use to get the endpoint
<Takumo>
wildroman2: i.e = informative example
vpretzel has quit [Read error: Connection reset by peer]
<Takumo>
i.e. giving an example which has additional information to illustrate a concept :)
<wildroman2>
Takumo: you must have meant workmad3 :)
psyl0n has quit [Remote host closed the connection]
meatherly has quit [Ping timeout: 252 seconds]
ndrei has joined #ruby
emocakes has joined #ruby
emocakes has left #ruby [#ruby]
cj3kim has quit [Ping timeout: 260 seconds]
cgore has joined #ruby
mordocai has joined #ruby
popl has joined #ruby
popl has joined #ruby
Fractional has quit [Remote host closed the connection]
fphilipe has quit []
petey has quit [Ping timeout: 272 seconds]
thenovices has quit [Ping timeout: 272 seconds]
MrZYX|off is now known as MrZYX
<Hanmac>
mechanicles: i think your data format is shitty ... i tryed : CSV.parse(s.b.encode("UTF-8",invalid: :replace,undef: :replace,replace: "",fallback: "").gsub("\x00",""), :col_sep=> "|") #=> [["id", "system_code", "assembly_code", "description", "created_at", "updated_at"]]
rickruby has joined #ruby
digital-ghost has quit [Remote host closed the connection]
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
<mechanicles>
Hanmac: could you share your code?
klaut has joined #ruby
camilasan has quit []
<Hanmac>
oO i already shared my code with you if you had read my line to the end oO
Jrz has joined #ruby
noop has joined #ruby
Jrz has quit [Max SendQ exceeded]
skaflem has joined #ruby
h0lyalg0rithm has joined #ruby
h0lyalg0rithm has quit [Max SendQ exceeded]
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
camilasan has joined #ruby
razibog has joined #ruby
h0lyalg0rithm has joined #ruby
klaut_ has joined #ruby
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
Bosox20051 has joined #ruby
krz has joined #ruby
<Hanmac>
mechanicles: i found your problem ... the file is not "binary" its UTF-16LE encoded ... try something like that: s.force_encoding("UTF-16").encode("UTF-8",invalid: :replace,undef: :replace,replace: "",fallback: "")
rickruby has quit [Ping timeout: 248 seconds]
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
xjiujiu has joined #ruby
decoponio has quit [Quit: My PC Restarting]
Eiam has quit [Ping timeout: 260 seconds]
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
bluenemo has joined #ruby
klaut has quit [Ping timeout: 245 seconds]
gregoriokusowski has joined #ruby
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
mojjojo has joined #ruby
h0lyalg0rithm has quit [Client Quit]
Jrz has joined #ruby
dukz has quit [Remote host closed the connection]
m00nlight has joined #ruby
mengu has quit [Remote host closed the connection]
dukz has joined #ruby
ewnd9 has joined #ruby
dukz has quit [Read error: Connection reset by peer]
<mechanicles>
Hanmac: How do you know that file is UTF-16LE encoded?
alexfreidah has joined #ruby
soukihei has quit [Ping timeout: 260 seconds]
<Hanmac>
because s.force_encoding("UTF-16LE") #=> "\uFEFF\"id\"|\"system_code\"|\"assembly_code\"|\"description\"|\"created_at\"|\"updated_at\"\r\x0A" ... then i encode it back to UTF-8 and remove the unwanted stuff like "\uFEFF"
<mechanicles>
Hanmac: cool and thanks for your help :)
diegoviola has joined #ruby
sandGorgon has quit [Ping timeout: 246 seconds]
mpereira_ has quit [Excess Flood]
alexfreidah has quit [Ping timeout: 252 seconds]
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
juarlex has joined #ruby
marcgg has joined #ruby
mpereira has joined #ruby
xjiujiu has joined #ruby
nomenkun has joined #ruby
niharvey has quit [Quit: No Ping reply in 180 seconds.]
niharvey has joined #ruby
sassamo has joined #ruby
shime has joined #ruby
supergeek has joined #ruby
marcgg_ has quit [Ping timeout: 252 seconds]
juarlex has quit [Ping timeout: 272 seconds]
nari has quit [Ping timeout: 276 seconds]
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
coderhs has quit [Ping timeout: 272 seconds]
xjiujiu has joined #ruby
sassamo has quit [Ping timeout: 245 seconds]
mklappstuhl has joined #ruby
lsmola_ has quit [Ping timeout: 252 seconds]
h0lyalg0rithm has joined #ruby
billiam has quit [Quit: WeeChat 0.4.1]
gigetoo has quit [Remote host closed the connection]
gigetoo has joined #ruby
kreantos has quit [Ping timeout: 245 seconds]
sandGorgon has joined #ruby
joonty_ has joined #ruby
joonty has quit [Ping timeout: 252 seconds]
kreantos has joined #ruby
gja has joined #ruby
joonty_ has quit [Client Quit]
joonty has joined #ruby
nateberkopec has joined #ruby
LekeFly has joined #ruby
zipper has quit [Ping timeout: 276 seconds]
zipper has joined #ruby
psst has joined #ruby
nateberkopec has quit [Ping timeout: 245 seconds]
lsmola_ has joined #ruby
aspiers has quit [Ping timeout: 276 seconds]
nettoweb has joined #ruby
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
diegoviola has quit [Quit: WeeChat 0.4.2]
joshwines_ has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
marcgg_ has joined #ruby
psyl0n has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chrisseaton has joined #ruby
marcgg has quit [Ping timeout: 245 seconds]
h0lyalg0rithm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dukz has joined #ruby
decoponio has joined #ruby
gja has joined #ruby
lewellyn has joined #ruby
_5kg has joined #ruby
mikecmpbll has quit [Read error: Operation timed out]
mengu has quit [Ping timeout: 272 seconds]
h0lyalg0rithm has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
aryaching has joined #ruby
h0lyalg0rithm has quit [Client Quit]
coderhs has joined #ruby
GeorgesLeYeti has joined #ruby
<GeorgesLeYeti>
Hi
[_aeris_] is now known as _aeris_
Speed has joined #ruby
<GeorgesLeYeti>
I want to truncate a string with 2 separators
zeeraw has joined #ruby
<shevy>
example string looks like?
mikecmpbll has joined #ruby
<GeorgesLeYeti>
and i can't find the syntax for 2 separators
<workmad3>
GeorgesLeYeti: example input and output strings, and work from there
cj3kim has joined #ruby
lyanchih has quit [Ping timeout: 272 seconds]
meatherly has joined #ruby
<workmad3>
GeorgesLeYeti: and what do you mean 'syntax for 2 separators'?
<GeorgesLeYeti>
Let say : "Hello World!\nCow"
<GeorgesLeYeti>
The 2 separators are ' ' and \n
<shevy>
GeorgesLeYeti there are several ways
<GeorgesLeYeti>
So the result should be: "Hello"
<GeorgesLeYeti>
"World!"
<GeorgesLeYeti>
and "Cow"
<shevy>
a simple way is via .split() method
<workmad3>
GeorgesLeYeti: ah, so you want to split the string, not truncate it
<GeorgesLeYeti>
heu yes sorry
<workmad3>
GeorgesLeYeti: yeah, just use split with a regex or
<shevy>
or for simplicity, you can convert the \n into ' ' and then split via "Hello World!\nCow".split(' ')
<shevy>
GeorgesLeYeti well there you go, workmad3 found the simplest way :D .split(" ")
<Hanmac>
shevy: "ruby - the language where everything is odd, even if its even too" ;P
<workmad3>
GeorgesLeYeti: ok, so there you go... in general, you can either .tr the separators so that they're all the same, then split on the one separator, or you can use a regex with .split with a [] character class to determine what to split on
<workmad3>
GeorgesLeYeti: but if your separators are just newlines and spaces, then .split(" ") seems to be your man ;)
<workmad3>
GeorgesLeYeti: on top of that, if you happen to have your separators in an array, you can do something like 'str.split(Regexp.union(array_of_separators))
Xeago has quit [Ping timeout: 248 seconds]
<workmad3>
Hanmac: ruby is real - everything is even!
* Hanmac
really like Regexp.union ;P
mklappstuhl has quit [Read error: Connection reset by peer]
w4pm has quit [Ping timeout: 272 seconds]
thenovices has quit [Ping timeout: 272 seconds]
senayar_ has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
senayar has joined #ruby
<Hanmac>
workmad3: ri String#split => "If pattern is a single space, str is split on whitespace, with leading whitespace and runs of contiguous whitespace characters ignored."
<workmad3>
Hanmac: awesome :)
ndrei has quit [Ping timeout: 276 seconds]
<workmad3>
Hanmac: unless you want to split on single spaces...
zegerjan has quit [Ping timeout: 260 seconds]
fedesilva has joined #ruby
<workmad3>
Hanmac: now I just need to get the dalek out of my head :(
vlad_starkov has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
<Hanmac>
workmad3: did you already see the DoctorWho 50th year and the last Christmas special?
vlad_starkov has quit [Remote host closed the connection]
<Hanmac>
tobiasvl: "If pattern is omitted, the value of $; is used. If $; is nil (which is the default), str is split on whitespace as if ` ' were specified."
ocline`` has joined #ruby
<tobiasvl>
:)
<tobiasvl>
interesting
decoponio has joined #ruby
<workmad3>
Hanmac: yup
<workmad3>
Hanmac: I get to watch Doctor Who as it happens on UK tv ;)
tharindu is now known as tharindu|away
psyl0n has left #ruby [#ruby]
ocline` has quit [Ping timeout: 246 seconds]
<Hanmac>
workmad3: i mean the last Christmas was AWESOME ... i mean a wooden Cyberman? a WOOD-MAN? now thats what i call "low-tec" ;P
klip has joined #ruby
ndrei has joined #ruby
fgo has quit [Ping timeout: 260 seconds]
agjacome has joined #ruby
wildroman2 has quit [Remote host closed the connection]
colonolGron has joined #ruby
MindfulMonk has joined #ruby
<workmad3>
Hanmac: except, logically, it was still very hi-tec
<workmad3>
Hanmac: it's still a highly advanced machine, it still seemed to have electricity powering it, it was carrying a flamethrower...
<Hanmac>
workmad3: and also the darlek "meat puppets" ;P ... specially the SILENCE Darlek meat puppets ... (its like pick your two most frightening monsters and splice them together xD )
<workmad3>
the dalek meat puppets had been seen before, iirc :)
<workmad3>
but not the silence ones... I did like that the silence were just confessional priests :)
<shevy>
you guys are geeks
<Hanmac>
yeah but they are "fighting priests" ;P with the lightning powers they could nearly stop the invasion
<workmad3>
shevy: yup
canton7-mac has joined #ruby
<workmad3>
shevy: got any more facts to state? :)
mojjojo has quit [Quit: mojjojo]
sassamo has joined #ruby
freggles has joined #ruby
mojjojo has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
monkegjinni has quit [Remote host closed the connection]
karupanerura is now known as zz_karupanerura
gregoriokusowski has quit [Ping timeout: 246 seconds]
postmodern has quit [Quit: Leaving]
<shevy>
workmad3 regexes are hard on the brain
<workmad3>
:)
gregoriokusowski has joined #ruby
sassamo has quit [Ping timeout: 245 seconds]
monkegjinni has joined #ruby
sandGorgon has quit [Ping timeout: 245 seconds]
<Hanmac>
other facts for share: "Hanmacs code is creepy but mostly the best way" ;P
mklappstuhl has quit [Remote host closed the connection]
<workmad3>
Hanmac: how is your code creepy? :/
<shevy>
only hanmac understands it
<workmad3>
that's not creepy, that's job security
gja has joined #ruby
mklappstuhl has joined #ruby
w_alexus has left #ruby [#ruby]
<Hanmac>
workmad3: something like that:
<Hanmac>
>> data=["/path/to/file/file.fil", "/path/to/file/dir1/file.fil"].map {|s|s.split(/\//) }.sort_by(&:size); chunk = data[1].to_enum(:zip,data[0]).chunk{|a,b| a == b };[chunk.first.last.map(&:first).join("/"),chunk.to_a.last.last.map {|s| s.compact.join("/")}]
wildroman2 has quit [Remote host closed the connection]
<workmad3>
Hanmac: nice :)
wildroman2 has joined #ruby
ndrei has joined #ruby
chihhsin has quit [Ping timeout: 260 seconds]
nateberkopec has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
Xeago has joined #ruby
banister has quit [Ping timeout: 265 seconds]
tharindu|away has quit [Ping timeout: 260 seconds]
gja has quit [Quit: This computer has gone to sleep]
nateberkopec has quit [Ping timeout: 276 seconds]
claymore has quit [Read error: Operation timed out]
gregoriokusowski has quit [Ping timeout: 252 seconds]
freggles has quit [Remote host closed the connection]
gregoriokusowski has joined #ruby
chrisseaton has quit []
Kar- has quit [Ping timeout: 272 seconds]
senayar_ has joined #ruby
lkba has joined #ruby
LadyRainicorn has joined #ruby
coderhs has quit [Read error: Connection timed out]
mklappstuhl has joined #ruby
dukz has quit [Remote host closed the connection]
coderhs has joined #ruby
ewnd9 has joined #ruby
Jetchisel has quit [Ping timeout: 252 seconds]
senayar has quit [Ping timeout: 252 seconds]
<Takumo>
Does faraday not have a JSON encoding middleware for requests?
sandGorgon has joined #ruby
adac has joined #ruby
coderhs has quit [Client Quit]
soba has quit [Ping timeout: 260 seconds]
coderhs has joined #ruby
gokul has joined #ruby
ohwhoa has quit [Quit: woah!]
banister has joined #ruby
claymore has joined #ruby
<adac>
I would need to connect to mysql database via tcp and not via socket, and using "host" for the active_record configuration file which should than automatically use the tcp connection. However it does not work and it still tries to use the unix socket. Does anyone know what might be wrong
cj3kim has joined #ruby
meatherly has joined #ruby
<Takumo>
adac: do you have "socket" defined?
<adac>
Takumo, nope just using "host" and leaving socket undfined
fwaokda has quit [Remote host closed the connection]
<MrZYX>
you might get better answers in #rubyonrails
petey has joined #ruby
fwaokda has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
_aeris_ is now known as [_aeris_]
wildroman2 has quit [Remote host closed the connection]
<shevy>
hmm
<shevy>
is there a simple way to have like a system where there are lots of ruby objects running in the background
<shevy>
and you can specifically call any of these at any time
<shevy>
like making 1000 .rb files persistent and running all the time (in idle mode)
justsee has quit [Quit: leaving]
mklappstuhl has joined #ruby
<MrZYX>
why would you want to?
<MrZYX>
also making "ruby objects" == "rb file" confuses me...
HansPampel has joined #ruby
<shevy>
MrZYX certain .rb files take rather long to do their specific tasks
thenovices has joined #ruby
<shevy>
MrZYX for instance, one is reading in data from 2500 yaml files here and processing that
hiall has joined #ruby
<HansPampel>
what is the recommended way to include rake tasks in a self-built gem? I want to install the gem and execute a certain raketask afterwards ?
meatherly has quit [Ping timeout: 252 seconds]
<shevy>
then it generates several files
<MrZYX>
shevy: top level code? so you spawn a new ruby process for each "task"?
afhammad has joined #ruby
<shevy>
MrZYX it is spawned right now every time that .rb file is run. there is a slight delay before it can start generating the new files
<shevy>
that delay is rather annoying
petey has quit [Ping timeout: 276 seconds]
rdark has quit [Ping timeout: 272 seconds]
<MrZYX>
make it a class
bkparso has quit [Quit: bkparso]
<shevy>
it already is
shime has quit [Ping timeout: 272 seconds]
<MrZYX>
then just keep a process running and build a cli to it, might as simple as starting it through irb
claymore has quit [Ping timeout: 252 seconds]
<shevy>
hmm
sergicles has joined #ruby
rudisimo has quit [Remote host closed the connection]
thenovices has quit [Ping timeout: 272 seconds]
claymore has joined #ruby
rickruby has joined #ruby
supergeek has quit [Quit: Goodbye, cruel world.]
fgo has quit [Remote host closed the connection]
nfk has joined #ruby
pranny has quit [Quit: Leaving.]
rdark has joined #ruby
nettoweb has quit [Quit: nettoweb]
LekeFly has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rickruby has quit [Ping timeout: 245 seconds]
mehlah has quit [Quit: Leaving...]
ss_ has quit [Remote host closed the connection]
ss_ has joined #ruby
TheLarkInn has joined #ruby
alexfreidah has joined #ruby
failshell has joined #ruby
nettoweb has joined #ruby
BrixSat has quit [Quit: No Ping reply in 180 seconds.]
banister has quit [Read error: Connection reset by peer]
vulcfunc has joined #ruby
[_aeris_] is now known as _aeris_
gja has joined #ruby
shredding has joined #ruby
ss_ has quit [Ping timeout: 245 seconds]
afhammad has quit []
gregoriokusowski has quit [Ping timeout: 245 seconds]
BrixSat has joined #ruby
vulcfunc is now known as auget
dukz has joined #ruby
amacgregor_ has quit [Read error: Connection reset by peer]
wildroman2 has quit [Remote host closed the connection]
wildroman2 has joined #ruby
gregoriokusowski has joined #ruby
sassamo has quit [Ping timeout: 245 seconds]
gja has joined #ruby
manfred_macx has quit [Read error: Connection reset by peer]
vim_shim_ has joined #ruby
OdNairy has quit []
nettoweb has quit [Quit: nettoweb]
kep has joined #ruby
_aeris_ is now known as [_aeris_]
fgo has quit [Remote host closed the connection]
OdNairy has joined #ruby
karnowski__ has left #ruby [#ruby]
nettoweb has joined #ruby
pmlarocque has joined #ruby
tharindu has joined #ruby
shredding has quit [Quit: shredding]
nateberkopec has joined #ruby
MindfulMonk has quit [Ping timeout: 260 seconds]
figgleberry has joined #ruby
timonv has quit [Remote host closed the connection]
fixl has quit [Remote host closed the connection]
tharindu has quit [Ping timeout: 276 seconds]
figgleberry has quit [Ping timeout: 245 seconds]
yalue has joined #ruby
nateberkopec has quit [Ping timeout: 252 seconds]
chihhsin has joined #ruby
<Takumo>
Anyone here familiar with WebMock?
colonolGron has quit [Ping timeout: 260 seconds]
banister has joined #ruby
Xeago has quit [Remote host closed the connection]
pmlarocque has quit [Quit: pmlarocque]
Xeago has joined #ruby
wildroman2 has quit [Remote host closed the connection]
colonolGron has joined #ruby
ndrei has quit [Read error: Operation timed out]
tt1187 has quit [Ping timeout: 272 seconds]
spyderman4g63 has joined #ruby
tt1187 has joined #ruby
Briareos1 has joined #ruby
ss_ has joined #ruby
ewnd9 has quit [Ping timeout: 245 seconds]
phansch has quit [Quit: Leaving]
MindfulMonk has joined #ruby
nowthatsamatt has quit [Quit: nowthatsamatt]
zegerjan has joined #ruby
nickchow has joined #ruby
nettoweb has quit [Quit: nettoweb]
<HansPampel>
what is the recommended way/pattern to include rake tasks in a self-built gem? I want to install the gem and execute a certain raketask afterwards ? I could add a class that to ./bin and add the execution of a rake task to it, but i am not sure if that is what i want..
coderhs has quit [Read error: Connection timed out]
sLi_ has joined #ruby
coder_neo has quit [Quit: This computer has gone to sleep]
coderhs has joined #ruby
coder_neo has joined #ruby
dukz has joined #ruby
nateberkopec has quit [Quit: Leaving...]
danijoo has quit [Read error: Connection reset by peer]
juarlex has quit [Ping timeout: 272 seconds]
danijoo has joined #ruby
thomasxie has quit [Remote host closed the connection]
wildroman2 has quit [Remote host closed the connection]
pedda has joined #ruby
mojjojo has joined #ruby
<LadyRainicorn>
You know Ruby has support for pipes, right?
marcgg_ has quit [Ping timeout: 245 seconds]
lyanchih_ has joined #ruby
browndawg has joined #ruby
kcombs has joined #ruby
<LadyRainicorn>
Omg, I was thinking of Python.
<LadyRainicorn>
It actually doesn't.
jkamenik has joined #ruby
<LadyRainicorn>
Such wow.
<LadyRainicorn>
Anyway.
marcgg has joined #ruby
<lupine>
for named pipes? sure it does
hypnosb has quit [Quit: Leaving]
<LadyRainicorn>
maasha: require 'mkfifo'
kevind has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
<LadyRainicorn>
lupine: Sure? All I can see on Google are people talming about how Ruby doesn't have a builtin for named pipes.
flubba has joined #ruby
wildroman2 has joined #ruby
Xeago has quit [Remote host closed the connection]
wildroman2 has quit [Remote host closed the connection]
Xeago has joined #ruby
wildroman2 has joined #ruby
<LadyRainicorn>
I was pretty shocked too.
vlad_starkov has joined #ruby
<maasha>
LadyRainicorn: I did note the mkfifo gem, but I simple used a system call instead.
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
vlad_sta_ has joined #ruby
<lupine>
ohhh. no, you're right
<lupine>
no mknod() wrapper
<lupine>
*vomit*
<LadyRainicorn>
Yeah I know. ;-;
<LadyRainicorn>
wtf right?
<LadyRainicorn>
maasha: Your solution is insecure.
<lupine>
well, could be worse
<LadyRainicorn>
You need to call system with multiple arguments.
dkamioka has quit [Remote host closed the connection]
coderhs has quit [Read error: Connection timed out]
<LadyRainicorn>
Using interpolation with it is vert bad.
<maasha>
LadyRainicorn: worse, it aint working
<LadyRainicorn>
And chmod 666 is bad too.
mojjojo has quit [Quit: mojjojo]
ss_ has quit [Remote host closed the connection]
<sweeper>
mark of the beast
coderhs has joined #ruby
zeeraw has joined #ruby
ambushsabre has joined #ruby
<LadyRainicorn>
What error do you get?
Xeago has quit [Ping timeout: 246 seconds]
lfox has joined #ruby
<maasha>
No error, but it hangs - so I have missed something
Shidash has joined #ruby
vlad_starkov has quit [Ping timeout: 252 seconds]
Bira has joined #ruby
<LadyRainicorn>
Why are you opening with r+ and w+?
<LadyRainicorn>
You want r and either w or a.
vlad_sta_ has quit [Remote host closed the connection]
<LadyRainicorn>
You want to send if you must instead of method(x).call
himsin has joined #ruby
<Fractional>
Looking for a ruby mentor or programming partner! :)
<maasha>
LadyRainicorn: After googling examples of named pipes I saw they were using r+ and w+ (besides, without + it still hangs)
Megtastique has joined #ruby
<LadyRainicorn>
You'll get extra newlines with puts.
Briareos1 has quit [Remote host closed the connection]
* maasha
makes a note of send
jlast has joined #ruby
tyl has joined #ruby
<maasha>
LadyRainicorn: Sure, but that is not my main concern.
<LadyRainicorn>
Ah, you're not closing the fifo.
xjiujiu has quit [Ping timeout: 272 seconds]
interactionjaxsn has joined #ruby
cj3kim has joined #ruby
<LadyRainicorn>
It will hang reading until you do.
<LadyRainicorn>
You can't just iterate over them.
<LadyRainicorn>
You need to specifically send an EOF.
razibog has quit [Ping timeout: 272 seconds]
sassamo has quit [Remote host closed the connection]
yasushi has quit [Remote host closed the connection]
sassamo has joined #ruby
<maasha>
LadyRainicorn: hm, yeah, I was suspecting some buffer issue. But input and output which are IO objects are invoked in block context and hence closed?
<maasha>
Oh, but not without EOF.
<LadyRainicorn>
No, the FIFO is still alive.
arturaz has quit [Remote host closed the connection]
<maasha>
So how can I do this?
wallerdev has joined #ruby
Macaveli has quit [Ping timeout: 272 seconds]
gijsje has joined #ruby
<LadyRainicorn>
system("cat blah.txt | wc -l")
<LadyRainicorn>
(This is why you never interpolate with system.
gja has joined #ruby
<gijsje>
k i'm totally confused about ruby, why is: (if hash.keys.first == "string") not true?
<LadyRainicorn>
Or IO.pipe with your solution.
axl_ has joined #ruby
<LadyRainicorn>
That's not valid syntax?
<tobiasvl>
gijsje: well, what is the first key of your hash?
<gijsje>
so my first key is "name" and i want to compare it to "name"
<gijsje>
MrZYX, i'm using CSV.foreach(file.path, col_sep: ';', headers: true) do |row|
arturaz has joined #ruby
<gijsje>
in where row.to_hash has the key
<gijsje>
and that doesn't match
marcgg_ has joined #ruby
<MrZYX>
print it using p (not puts or print)
<MrZYX>
p row.to_hash.keys.first
<LadyRainicorn>
p
<gijsje>
lemme try it
<gijsje>
don't see how its different tho
interactionjaxsn has quit [Remote host closed the connection]
gja has quit [Client Quit]
<MrZYX>
copy paste the output
monkegjinni has quit [Remote host closed the connection]
<apeiros>
gijsje: possible reasons: a) your hash.keys.first is not "string", b) it is "string" but in a different encoding, c) it is something which just has the same inspect
<apeiros>
I suspect b) without further information.
<maasha>
LadyRainicorn: so the commands in the Pipe class here are place holders for something more advanced that needs to be coded, so I am particularly interested in a way of piping commands which is easy to fork.
diegoviola has quit [Quit: WeeChat 0.4.2]
<LadyRainicorn>
What do you need to code?
axl_ has quit [Ping timeout: 272 seconds]
<gijsje>
row.to_hash.keys.first says name, if row.to_hash.keys.first == "name" is false
<LadyRainicorn>
Ask the question you need answered rather than the one you think you need.
<apeiros>
encoding is an integral part of a string.
<gijsje>
:p
DouweM has quit [Ping timeout: 252 seconds]
Cephalostrum has joined #ruby
<gijsje>
i mean in the compare
<apeiros>
you can inform ruby about what encoding your string actually has, and you can transcode a string into another encoding.
dkamioka has joined #ruby
interactionjaxsn has joined #ruby
coder_neo has quit [Quit: This computer has gone to sleep]
<apeiros>
again, you don't. you can't compare two strings in different encodings. so what you do is make sure they're in the same encoding before comparing.
<gijsje>
ok, how do i check the current encoding, i know the file is utf8
MrThePlague has joined #ruby
MrThePlague has joined #ruby
wildroman2 has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
heftig has quit [Quit: Quitting]
tesuji has quit [Ping timeout: 272 seconds]
<gijsje>
hmm both say utf-8
mary5030 has joined #ruby
xjiujiu has joined #ruby
<gijsje>
the key and the string
<apeiros>
then the remaining possibilities are a) you do something wrong (can't tell without code and data) or b) you have unprintables and did't check the inspects
pu22l3r_ has quit [Remote host closed the connection]
<gijsje>
i'm gonna pastebin
<apeiros>
please use something that is not ad-ridden like pastebin.com
<apeiros>
you can publish multiple files in the same gist
thenovices has joined #ruby
nateberkopec has joined #ruby
sassamo has joined #ruby
ctp has quit [Quit: Leaving...]
danijoo has quit [Read error: Connection reset by peer]
tylersmith has joined #ruby
mojjojo has joined #ruby
Txandy is now known as Txandy|away
danijoo has joined #ruby
Txandy|away is now known as Txandy
ohwhoa has quit [Quit: woah!]
<fbernier>
I've got lots of .yml files to which I want to add a namespace node... I'd look through them all, add it, but then how do I indent the rest of the file?
<Fractional>
Looking for mentor or programming partner in the Ruby language! :)
<gijsje>
65279
* Hanmac
thinks there is a "\n" inside the keys ...
<gijsje>
chomp is the same
mary5030_ has joined #ruby
ahri_ has joined #ruby
SCommette has joined #ruby
<apeiros>
that's a BOM
<ahri_>
hi, is there any way to determine the call chain resulting in the current running instance of ruby? ideally i'd like to find out the names of the binaries -- this is on windows
<apeiros>
while utf-8 doesn't need one, it can have one
mary5030 has quit [Read error: Connection reset by peer]
<apeiros>
gijsje: use CSV.foreach(file.path, col_sep: ';', headers: true, encoding: "bom|utf-8") do |row|
<apeiros>
annoying that .inspect doesn't print that one
<gijsje>
sorry for not googling i was a bit frustrated
<apeiros>
lol
fire has joined #ruby
mdpatrick_ has quit [Quit: No Ping reply in 180 seconds.]
vongrippen has quit [Quit: No Ping reply in 180 seconds.]
mansi has joined #ruby
figgleberry has quit [Ping timeout: 260 seconds]
sambao21 has joined #ruby
thenovices has joined #ruby
mojjojo has joined #ruby
<bline79>
I want to create an 8 character string. The first 3-4 characters are predefined, but then I want to have the remaining 4-5 characters be the randomized numbers
fmcgeough has joined #ruby
nari has quit [Ping timeout: 272 seconds]
freerobby1 has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
coder_neo has quit [Quit: This computer has gone to sleep]
<apeiros>
bline79: will you also ask a question?
bluenemo has quit [Remote host closed the connection]
<bline79>
good point, just one moment. :p
Targen has quit [Ping timeout: 260 seconds]
thesheff17 has joined #ruby
<Fractional>
Looking for mentor or programming partner in the Ruby language! :)
geggam has joined #ruby
monkegjinni has quit [Remote host closed the connection]
ambushsabre has quit [Quit: rip]
gokul has quit [Quit: Leaving]
vlad_starkov has joined #ruby
vlad_sta_ has joined #ruby
freezey has joined #ruby
<bline79>
so, I have a variable assigned to the prefix. That prefix will be 3-4 characters. What function should I use to create the remaining 4-5 characters as numberic digits randomly?
<workmad3>
Fractional: think integer division and then tell me ;)
colonolGron has quit [Read error: Operation timed out]
<workmad3>
Fractional: also think in terms of precedence
CogitoErgoSum has quit [Ping timeout: 260 seconds]
kpshek has quit []
CogitoErgoSum has joined #ruby
ylluminate has joined #ruby
<apeiros>
Fractional: I assume `self` is a sorted array?
<Fractional>
data = [6,2,4,5,7,1,9,7,9]
<Fractional>
puts data.median #=> 7
<workmad3>
Fractional: right... now try with an array with an even number of elements
himsin has quit [Ping timeout: 276 seconds]
<apeiros>
Fractional: which would be wrong…
BuSerD_away has quit [Remote host closed the connection]
<Fractional>
Oh, thanks :P
<Fractional>
Weird, I thought I got the right answer before.
joshu has quit [Ping timeout: 272 seconds]
<workmad3>
Fractional: and yeas, as apeiros says, that is not the right answer with that data set
lorelei_ has quit [Quit: Leaving.]
<workmad3>
Fractional: the median is only the middle value on *sorted* data sets
CaptainJet has joined #ruby
<workmad3>
Fractional: what you have there is basically meaningless in statistical terms ;)
<workmad3>
wald0: it's not 'broken'
<apeiros>
workmad3: oh, no, it's a semi-random number :D
<apeiros>
sample
<workmad3>
wald0: it's just not the same as a class-instance variable
cyberarm has joined #ruby
<workmad3>
wald0: the issue really is that the default behaviour is a bit surprising and not as useful as the slightly harder to use class-instance variable stuff
<workmad3>
wald0: not that it's broken :)
moshef has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
RaCx has joined #ruby
<workmad3>
apeiros: I think you'd have a bit of trouble getting a single value past a statistician as a 'sample' ;)
<moshef>
Hi. I have a mixing module (A) that is included in B. I want to make some of the methods in module B private, how do I do that?
<moshef>
simply adding private doesn't do much
mklappstuhl has joined #ruby
<apeiros>
workmad3: reminds me of a comedy show… "we did a survey about the upcoming elections, we asked one person, who voted for party X. we extrapolated from there and predict, that the whole Bundestag will be occupied by party X."
<bline79>
I ran it a bunch of times and once it was 7 digits
<workmad3>
bline79: I did say you might need to padd :P
fedesilva has joined #ruby
heftig has quit [Quit: Quitting]
<apeiros>
bline79: didn't you say 4-5? :D
ahawkins has quit [Quit: leaving]
<bline79>
4-5 randoms because the prefix can vary
<bline79>
between 3-4
<workmad3>
bline79: e.g. with hostname.rjust(8-prefix.length, "0")
Spami has joined #ruby
<apeiros>
moshef: `private` marks instance methods as private
sambao21 has joined #ruby
blackmesa has joined #ruby
<apeiros>
moshef: so assuming you define class methods like the poster in that SO thread, of course it won't work
<moshef>
I'm not defining class methods, I don't have a deal
<moshef>
i have 2 modules
<workmad3>
bline79: btw, there's also no guarantees at all about uniqueness here
<apeiros>
moshef: then show your code?
<bline79>
that's okay. We won't have more then a dozen or two hostnames with any particular prefix
<apeiros>
moshef: yeah, "I have 2 modules" is not equivalent to "I don't have class methods". modules can have class methods. they're those you define with def self.foo
<bline79>
changes of conflict are pretty small i think
<apeiros>
chances?
<bline79>
yes :( sorry
<apeiros>
:)
senj has joined #ruby
Soulcutter has quit [Quit: WeeChat 0.4.2]
<apeiros>
typohunt!
<workmad3>
bline79: 2.5% if the random generator was *truly* random
<Fractional>
self[(self.size / 2)].to_f #=> 4 self[(self.size-1 / 2)].to_f #=> 0 when it should return 2
<workmad3>
bline79: but it's not
<Fractional>
On the array data = [6,2,4,6]
_maes_ has quit [Read error: Connection reset by peer]
<Fractional>
What looks wrong?
h_kon has quit [Remote host closed the connection]
<workmad3>
Fractional: precedence
Virtualize has quit [Ping timeout: 272 seconds]
<workmad3>
Fractional: which is *not* managed with whitespace ;)
thenovices has quit [Remote host closed the connection]
<workmad3>
Fractional: if you wanted, you could do self[((size + 1) * 0.5).to_i]
tharindu has joined #ruby
<workmad3>
Fractional: but that introduces another layer of braces
marcgg_ has quit [Ping timeout: 252 seconds]
<shevy>
Fractional you could get .succ-like behaviour on an array by applying .each on it, then call .next. array = %w( a b c d ); _ = array.each; _.next; _.next
<workmad3>
Fractional: there you go - 'def median; self[size >> 1]; end' ;)
kreisys has joined #ruby
marcgg has joined #ruby
marcgg has quit [Remote host closed the connection]
marcgg has joined #ruby
<apeiros>
or /2 if you prefer :)
<apeiros>
I'll just pretend that I didn't completely mess up my rationale
<workmad3>
:)
* apeiros
looks clever now
<workmad3>
apeiros: although looking again, I now see what Fractional is doing in his median example... the definition of the median on an array with an even number of items is the middle two items divided by 2
<workmad3>
although it does need to be sorted for that result to make sense
<apeiros>
average?
<workmad3>
apeiros: only of the middle two items
agent_white has joined #ruby
<apeiros>
I mean, average of the two median values?
<apeiros>
blergh. not been to uni for a decade. I don't even remember what that is.
<Fractional>
Anyone here who can give me some array-algorithm based problems to solve?
<Fractional>
For a beginner.
<apeiros>
I thought about automatic polynomial interpolation
<workmad3>
apeiros: a 3-sphere is a sphere in 4d space
<apeiros>
but I have not the faintest idea anymore how to do that
<apeiros>
workmad3: ah, the equivalent of a hypercube?
<workmad3>
apeiros: yeah
drumusician has joined #ruby
noname001__ has quit [Read error: Operation timed out]
<workmad3>
apeiros: you could call it a 4d hypersphere too, but 3-sphere works (because it's a sphere where you need 3 co-ordinates to specify a point on the surface)
<workmad3>
apeiros: and the only reason I know much about it is because that's what you do with quaternions to do smooth interpolations for rotations :)
* LadyRainicorn
lives in an infinite-dimensional world.
DaniG2k has joined #ruby
brunosanches has joined #ruby
alexfreidah has quit [Ping timeout: 245 seconds]
brunops has quit [Changing host]
brunops has joined #ruby
<workmad3>
LadyRainicorn: if you're counting 'the world' as a phase space of particle configurations and assume that the universe is infinite in extent then yes, arguably you do ;)
LekeFly has joined #ruby
slick- has joined #ruby
<LadyRainicorn>
No silly, an infinite number of spacial dimensions!
alexherbo2 has quit [Quit: WeeChat 0.4.3-dev]
egomez has joined #ruby
alexherbo2 has joined #ruby
pu22l3r__ has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
Bira has quit [Remote host closed the connection]
bluOxigen has quit [Remote host closed the connection]
kep has quit [Quit: WeeChat 0.4.2]
bluOxigen has joined #ruby
<workmad3>
LadyRainicorn: iirc, the dimensions in such a phase space are space-like
gja has quit [Quit: This computer has gone to sleep]
sambao21 has quit [Quit: Computer has gone to sleep.]
pu22l3r_ has quit [Ping timeout: 245 seconds]
Txandy is now known as Txandy|away
sambao21 has joined #ruby
cj3kim has quit [Remote host closed the connection]
moshef has quit [Quit: moshef]
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
cj3kim has joined #ruby
burlyscudd has quit [Quit: Leaving.]
gja has joined #ruby
<LadyRainicorn>
Yes, but they're not physical spatial dimensions.
wildroman2 has quit [Remote host closed the connection]
fijimunkii has quit [Ping timeout: 276 seconds]
maletor has joined #ruby
Hobogrammer has joined #ruby
arturaz has quit [Ping timeout: 272 seconds]
coder_neo has joined #ruby
rickruby has joined #ruby
<Fractional>
apeiros: Mind if I ask how I "use" a regex on a string? Like you did earlier on when I needed help
<apeiros>
Fractional: depends on what you understand as "use"
<apeiros>
"string" =~ /regex/ # test whether a string matches a regex
<wald0>
workmad3: so it is not going to be "fixed" (improved) in the future versions of ruby?
Txandy|away is now known as Txandy
spider-mario has joined #ruby
<Fractional>
I want to exclude everything that doesn't match my regex and pass a command to it on one line.
<wald0>
i want to use @@objects_created :)
<wald0>
well, @@sides :)
gijsje has quit [Ping timeout: 245 seconds]
<apeiros>
Fractional: I don't understand that
<Fractional>
string/regex/.each do |obj| end
<DaniG2k>
ive been thinking of writing a program lately :\
<DaniG2k>
but totally not sure what
<DaniG2k>
actually I have no idea
<DaniG2k>
just an itch to program
<DaniG2k>
any suggestions?
<DaniG2k>
something not tooooo hard
<apeiros>
Fractional: do you have an example? with input and desired output?
<apeiros>
(gist)
<workmad3>
wald0: the behaviour of class variables is well specified and sometimes useful
<workmad3>
wald0: there's nothing to be 'fixed'
ahri_ has quit [Ping timeout: 272 seconds]
egomez has quit [Quit: egomez]
<workmad3>
wald0: it sounds like you want a class instance variable but don't like that you need jump through a couple of hoops for it ;)
<Fractional>
string/\h{2]/.each do |obj| array << obj end
samuel02 has joined #ruby
<wald0>
workmad3: well defined? not in the book that i readed about :) is was thanks to a friend which reviewed my tutorial which says "do not use @@ its b0rk3d!"
<wald0>
workmad3: well, ruby was made for make the life of the developer easier so your statement is against ruby lol :) j/k
<workmad3>
wald0: class instance variables work exactly the same as any other instance variable
Fly80 has quit [Quit: Konversation terminated!]
<workmad3>
wald0: to do otherwise would be a greater violation of the principle of least surprise
senj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Targen has joined #ruby
petey has quit [Remote host closed the connection]
<workmad3>
wald0: you could argue that @@ class vars (which are not class instance variables) could probably be removed
MrThePlague has quit [Remote host closed the connection]
TheLarkInn has quit [Quit: Leaving.]
<workmad3>
wald0: but not easily that they should act as another way to access an instance variable that happens to be on the class
petey has joined #ruby
<wald0>
no, i dont mean removed, i meant the problematic of their inheritance modifications, like shown on that link
TheLarkInn has joined #ruby
<wald0>
bad side-effect
<workmad3>
wald0: you mean the very thing thang makes them not just a class instance variable?
<apeiros>
Fractional: that's not really an example, also it lacks in-/output
kraljev1 has joined #ruby
<workmad3>
wald0: and the *well-known* way that they behave?
<apeiros>
I need something concrete
dukz has quit [Remote host closed the connection]
troyready has joined #ruby
<shevy>
apeiros a HAMMER!
<Fractional>
apeiros: Someone here helped me with it this morning but the code is on my laptop.
<kraljev1>
Hello guys, is it possible to use PRY or other REPL engine
<kraljev1>
to pass the typed thing as a string
ahmedelgabri has joined #ruby
m00nlight has quit [Quit: Konversation terminated!]
<apeiros>
Fractional: well, I'm afraid, I'm not your laptop
<shevy>
wat
<kraljev1>
to a custom function
<wald0>
workmad3: not sure, i just discovered this "problem" told by a friend to not use @@ because this bug and im asking here :)
m8 has quit [Quit: Sto andando via]
<shevy>
you want another language than ruby?
godd2 has joined #ruby
cj3kim has quit [Remote host closed the connection]
h0lyalg0rithm has joined #ruby
<shevy>
foo('bla') there is a string passed
<workmad3>
wald0: your friend mis-informed you that it's a bug
petey_ has joined #ruby
<shevy>
wald0 @@stink
lethjakman has quit [Ping timeout: 252 seconds]
<wald0>
well, its an unwanted side-effect
petey has quit [Read error: Connection reset by peer]
burlyscudd has joined #ruby
<shevy>
the use of @@ is a whole unwanted side effect
<kraljev1>
So, if I write SELECT * FROM x
<workmad3>
wald0: in the cases where @@cvars are suitable, it's not an unwanted side-effect
mityaz has joined #ruby
<kraljev1>
then it gets passed to a function as a while
<workmad3>
wald0: just those cases are limited
<shevy>
a while?
<workmad3>
wald0: and your case is not one of them
<kraljev1>
*whole
<wald0>
shevy: maybe, im just asking here about the unwanted bug behaviour asking if ruby would fix that in the future (removing inheritance access/modification) like:
<apeiros>
workmad3: so limited that I haven't come across it in the last 10 years :)
colonolGron has joined #ruby
<colonolGron>
hi
<kraljev1>
in other words, is it possible for pry not to eval the input?
coder_neo has quit [Quit: This computer has gone to sleep]
<workmad3>
wald0: it's exactly the same, but on a class
<workmad3>
wald0: as classes are instances of Class themselves
cj3kim has joined #ruby
<godd2>
Any feedback (positive ot negative) is welcome :)
Txandy is now known as Txandy|away
IcyDragon has joined #ruby
rodneyfool has joined #ruby
bluOxigen has quit [Ping timeout: 252 seconds]
mercwithamouth has joined #ruby
bluOxigen has joined #ruby
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
<wald0>
mmh, just use @var ? what is the difference with @@var then ? im a bit confused now
mneorr has joined #ruby
shime has quit [Ping timeout: 276 seconds]
aganov has quit [Remote host closed the connection]
<DaniG2k>
godd2: well done Dominic
IceDragon has quit [Disconnected by services]
digital-ghost has joined #ruby
IcyDragon is now known as IceDragon
zigomir has quit [Ping timeout: 248 seconds]
_mtr has joined #ruby
<workmad3>
wald0: @@var creates a class variable
<workmad3>
wald0: which is shared across the entire inheritance tree below the point it is first defined
<workmad3>
wald0: @var creates an instance variable
coder_neo has joined #ruby
LekeFly has joined #ruby
ephemerian has quit [Quit: Leaving.]
<workmad3>
wald0: if you do it at the class level, it creates an instance variable on the class
LekeFly has quit [Client Quit]
<workmad3>
wald0: which is not shared across the inheritance tree
thenovices has joined #ruby
einarj has quit [Remote host closed the connection]
dkamioka has joined #ruby
Bira has joined #ruby
<godd2>
DaniG2k: Thank you :)
RaCx has joined #ruby
ewnd9 has quit [Remote host closed the connection]
<wald0>
my last conclusion is that there's no any valid "technique" or tool or anything that can solve the procrastination problem, the only way is "when you ignore the tools for help you and you just do it, no-matter-what"
<kraljev1>
Looking for something like pry, except that it would not eval
<kraljev1>
but rather give me a raw string
<itadder>
yea I guess so
<itadder>
how do I sneak time at work on my windows box to do ruby
<itadder>
learning
<itadder>
with out getting in trouble
<wald0>
so basically, forget tools, forget all, do only what you want to do IF you want to do it, otherwise, do another thing lol
<itadder>
bbl
w4pm has quit [Ping timeout: 252 seconds]
senj has joined #ruby
<itadder>
yea I want to acutally learn becuase I find it very usefull and fun
<wald0>
when you really want, youll simply do it, you will found time "magically" lol
<itadder>
but when it gets complex I feel like giving up
<itadder>
okay will take those words
<itadder>
brb
fedez77 has quit [Ping timeout: 265 seconds]
* wald0
reading up
<wald0>
as a suggestion, if you want to work "out of trouble" in a windows box... well, first remove windows, its totally useless to "try" to work on it, you will just lose your time
<CorySimmons>
workmad3: Hi again. :) So if I put RMagick in my Rails app on Heroku, I'd need to also put ImageMagick on Heroku?
<Fractional>
I want to learn more Ruby but I am not sure what to do/learn =<
<havenwood>
Fractional: Read some Ruby code for inspiration maybe?
pel_daniel has joined #ruby
RaCx has joined #ruby
<Fractional>
havenwood: But what code? I'm a beginner. Perhaps I should start doing some basic 2D games? Yes.
pml has quit [Remote host closed the connection]
<Fractional>
Then I could make a clone of some classics.
<Fractional>
That would be fun to do.
<workmad3>
Fractional: start with zork ;)
Hobogrammer has quit [Ping timeout: 272 seconds]
<jane_doe>
Fractional: Have you tried codecademy or something similar?
end_guy has joined #ruby
<havenwood>
Fractional: Maybe try some text based games, tic-tac-toe, checkers, chess, a card game.
<Fractional>
jane_doe: For math & physics
colonolGron has quit [Quit: leaving]
<havenwood>
Fractional: If you know or want to learn a bit of math, going through Project Euler problems is good practice.
pel_daniel1 has quit [Ping timeout: 245 seconds]
<jane_doe>
codecademy's python curriculum teachs you how to write a battleship game.
<Fractional>
havenwood: Already done tic-tac-toe, checkers and a card game in text.
<havenwood>
Fractional: excellent!
lethjakman has joined #ruby
RaCx has quit [Client Quit]
h0lyalg0rithm has joined #ruby
<Fractional>
Havenwood: But there are plenty of card games! What is a quite easy one to write?
sassamo has quit [Ping timeout: 245 seconds]
petey has quit [Remote host closed the connection]
petey has joined #ruby
pel_daniel1 has joined #ruby
<havenwood>
Fractional: Blackjack maybe?
i_s has joined #ruby
zoscoy has joined #ruby
camilasan has quit []
<havenwood>
with an auto-dealer
pel_daniel has quit [Ping timeout: 260 seconds]
thenovices has joined #ruby
<havenwood>
and for a bit extra, expose the command line game to the web with a little Sinatra app :O
<itadder>
wald0: are you on twitter
<itadder>
who should I follow in the ruby community on twitter
<itadder>
what is the IOS ruby app that you people liek to use
<wald0>
itadder: i removed my twitter and facebook accounts because they are useless in my life and a hole of distractions, very bad for procrastinator ppl like me :)
<itadder>
ahh same here good point
godd2|away is now known as godd2
<wald0>
in fact i lost the entire conctact with my family and friends removing facebook, but i dont give a shit, i want time -for me-
<itadder>
maybe thier a IOS ruby app for the iphone so when I am in line wating for something I can write code
petey_ has joined #ruby
<itadder>
wald0: oh wow, I can't leave FB my family will nto be happy
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<itadder>
and call me antisocial
sassamo has joined #ruby
petey has quit [Read error: Connection reset by peer]
<CorySimmons>
What is a memory leak? I keep looking at using RMagick but there's a lot of mentions of it being terrible at memory leaks
<itadder>
it would be cool to test out and learn ruby while I wait for stuff
<wald0>
itadder: for iphone, the best is to have a pdf reader and put some books on it :), i even hilighted my books on it and so i have my own summaries for future checks
<havenwood>
itadder: here are some just looking down my twitter feed: @rubygems @rubyrogues @postmodern_mod3 @bascule @steveklabnik @avdi @tenderlove @drbrain
Neomex has joined #ruby
<havenwood>
itadder: i tweet like twice annually, and one is probably retweet, so following me would be *super* exciting
heidi has joined #ruby
<CorySimmons>
Also just out of curiosity, what are your favorite image manipulation libraries in Ruby?
pel_daniel1 has quit [Ping timeout: 272 seconds]
<havenwood>
@rubygems will flood you, but fun to watch every newly cut gem go by
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
Bira has quit []
Neomex has quit [Client Quit]
bline79 has quit [Quit: leaving]
brunops has joined #ruby
deens has joined #ruby
<ddd>
i won't follow steveklabnic but the rest we match on
thesheff17 has quit [Read error: Operation timed out]
SilentHobo has joined #ruby
shaunbaker has quit [Remote host closed the connection]
Txandy|away is now known as Txandy
claymore has joined #ruby
nanoyak_ has joined #ruby
browndawg has quit [Quit: Leaving.]
ndrei has joined #ruby
tt1187 has quit [Read error: Operation timed out]
bluOxigen has quit [Read error: Connection reset by peer]
mocfive has joined #ruby
bluOxigen has joined #ruby
nanoyak has quit [Ping timeout: 265 seconds]
Hobogrammer_ has quit [Read error: Connection reset by peer]
h0lyalg0rithm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hobogrammer has joined #ruby
deens has joined #ruby
nwertman has joined #ruby
h0lyalg0rithm has joined #ruby
tharindu has quit [Ping timeout: 260 seconds]
kobain has quit []
SilentHobo has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
thesheff17 has joined #ruby
Cephalostrum has joined #ruby
jonbradley has joined #ruby
<jonbradley>
: am i wrong in thinking i can do something like @object[0]."#{i}_amount" in ruby?
Cephalostrum has quit [Remote host closed the connection]
cads has joined #ruby
m8 has quit [Quit: Sto andando via]
mengu has joined #ruby
mengu has joined #ruby
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
gja has quit [Quit: This computer has gone to sleep]
mneorr_ has joined #ruby
<Hanmac>
jonbradley: yes you can, look at #send method
Sc0rp10n has joined #ruby
Mars has joined #ruby
<jonbradley>
thanks reading on send now
tyl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hobogrammer has quit [Read error: Operation timed out]
<Sc0rp10n>
hey guys
Mars is now known as Guest54044
<Sc0rp10n>
a quick question
<Sc0rp10n>
I created my first gem yesterday and pushed it to ruby gems
Advocation has quit [Quit: Advocation]
<Sc0rp10n>
but today I saw it already had 33 downloads. Can anyone tell me who's downloading it? I mean how do people know about my gem?
h0lyalg0rithm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alexfreidah has joined #ruby
Guest54044 has quit [Read error: Connection reset by peer]
timonv has quit [Remote host closed the connection]
<apeiros>
Sc0rp10n: mirrors probably
<Sc0rp10n>
is there a list of latest gems or something?
maasha has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
<Sc0rp10n>
hey apeiros , can you tell me the mirror sites for ruby gems?
gregoriokusowski has quit [Quit: gregoriokusowski]
senayar has quit [Remote host closed the connection]
mneorr has quit [Ping timeout: 252 seconds]
<shevy>
Sc0rp10n bot downloads
Asher has quit [Quit: Leaving.]
alexfreidah has quit [Ping timeout: 272 seconds]
kenndel_ has quit [Read error: Connection reset by peer]
jonbradley has quit [Quit: jonbradley]
<apeiros>
Sc0rp10n: no, I can't
kenndel_ has joined #ruby
_Andres has quit [Read error: Connection reset by peer]
dweeb_ has quit [Quit: Computer has gone to sleep.]
mneorr_ has quit [Remote host closed the connection]
jbueza has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Txandy is now known as Txandy|away
banister has joined #ruby
mneorr has joined #ruby
sassamo has quit [Remote host closed the connection]
sassamo has joined #ruby
Morrolan has quit [Max SendQ exceeded]
Morrolan has joined #ruby
mneorr_ has joined #ruby
momomomomo has joined #ruby
momomomomo has quit [Client Quit]
CorySimmons has quit [Quit: Leaving.]
mengu has quit [Remote host closed the connection]
Lewix has joined #ruby
zoscoy has joined #ruby
zoscoy has quit [Client Quit]
tylerdmace has quit [Ping timeout: 276 seconds]
tjbiddle has joined #ruby
rdark has quit [Quit: leaving]
mneorr has quit [Ping timeout: 245 seconds]
mocfive has quit [Remote host closed the connection]
Hobogrammer has joined #ruby
w4pm has joined #ruby
CorySimmons has joined #ruby
mocfive has joined #ruby
zahna has joined #ruby
nanoyak_ has quit [Quit: Computer has gone to sleep.]
sassamo has quit [Ping timeout: 245 seconds]
<zahna>
is there a way to have Socket.getaddrinfo() bypass nscd?
catphish has quit [Quit: Leaving]
RaCx has quit [Ping timeout: 248 seconds]
nanoyak has joined #ruby
petertretyakov has quit [Quit: Computer has gone to sleep.]
Asher has joined #ruby
RaCx has joined #ruby
zipper has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
momomomomo has joined #ruby
ewnd9 has quit [Ping timeout: 272 seconds]
mocfive has quit [Ping timeout: 252 seconds]
danshultz has joined #ruby
dkamioka has joined #ruby
<Sc0rp10n>
alright, thanks guys
Es0teric has joined #ruby
jbueza has joined #ruby
phipes has quit [Remote host closed the connection]
<zahna>
i'm seeing that libc allows __nss_not_use_nscd_hosts to be set to allow getaddrinfo() to not use nscd and was just wondering if there's a way to access that from the ruby Socket.getaddrinfo method
mocfive has joined #ruby
<zahna>
i'm just not seeing it in the documentation i'm reading
danijoo has quit [Read error: Connection reset by peer]
danijoo_ has joined #ruby
CorySimmons has quit [Quit: Leaving.]
CorySimmons has joined #ruby
petertretyakov has joined #ruby
Eiam has joined #ruby
reset has joined #ruby
zipper has quit [Ping timeout: 245 seconds]
blaxter has quit [Quit: foo]
TheLarkInn has joined #ruby
finnnnnnnnnnn_ has joined #ruby
mmcdaris_ has joined #ruby
sandGorgon has quit [Ping timeout: 253 seconds]
Sc0rp10n has quit [Quit: Leaving]
Liquid-- has quit [Quit: Computer has gone to sleep.]
senayar has joined #ruby
Sc0rp10n has joined #ruby
mephux has joined #ruby
jprovazn has joined #ruby
mmcdaris has quit [Ping timeout: 245 seconds]
mmcdaris_ is now known as mmcdaris
mmcdaris has left #ruby [#ruby]
hiall has quit [Read error: Operation timed out]
dkamioka has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
mikepack has quit [Remote host closed the connection]
kuzushi has joined #ruby
_aeris_ is now known as [_aeris_]
senayar has joined #ruby
DrShoggoth has quit [Quit: Leaving]
keen__ has joined #ruby
<godd2>
CorySimmons: just shootin in the dark, but maybe it needs foooo.svg to exist beforehand?
shadoi has joined #ruby
momomomomo has quit [Quit: momomomomo]
Hobogrammer has quit [Ping timeout: 246 seconds]
<godd2>
On line ~254 of lib/mini_magick.rb it says it runs the identify command to "Verify that we have a good image"
keen_ has quit [Ping timeout: 272 seconds]
DrShoggoth has joined #ruby
yekta has joined #ruby
<godd2>
presumably if the file doesn't exist yet, that can cause a problem?
<shevy>
I think the whole MiniMagick project seems to be sloppy
<shevy>
it should check before running any system-commands
shime has joined #ruby
laphlaw has joined #ruby
colonolGron has left #ruby [#ruby]
mneorr has joined #ruby
<CorySimmons>
shevy: I brew installed ImageMagick
IceDragon_ has joined #ruby
IceDragon has quit [Disconnected by services]
IceDragon_ is now known as IceDragon
senayar has quit [Ping timeout: 252 seconds]
<CorySimmons>
godd2: I don't think so. It creates it.
<CorySimmons>
shevy: Prefer RMagick?
<shevy>
well it obviously did not create it :)
<shevy>
no
<CorySimmons>
It creates it
<shevy>
you have a .svg ?
<CorySimmons>
It just creates a horrible version of it and it's 30MB!!!
<shevy>
hahaha
<CorySimmons>
400kb.pdf to 30mb.svg horrible quality with black background
<CorySimmons>
X_____X
Azure has joined #ruby
RaCx has quit [Ping timeout: 260 seconds]
tannerburson has quit [Quit: tannerburson]
<shevy>
that's some quality there
mikepack has joined #ruby
<shevy>
why dont you file a bug report?
saarinen has quit [Quit: saarinen]
Virtualize|away has quit [Read error: Connection reset by peer]
Virtualize has joined #ruby
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
gf3 has quit [Quit: LOLeaving]
<Nilium>
The questions I get about how to use my OpenGL bindings gem are always kind of weird..
OdNairy has quit [Ping timeout: 252 seconds]
gf3 has joined #ruby
RaCx has joined #ruby
<Nilium>
Pretty sure everyone who's emailed me about it has never used C or C++ or OpenGL.
<godd2>
CorySimmons: try this from the command line to see if imagemagick does the same thing: `convert illustrator_17.pdf fooooo.svg`
dobie_gillis has joined #ruby
aspires has quit []
rootshift has joined #ruby
<Nilium>
Which would be kind of normal for most Ruby people, I guess. I doubt a lot of them leave their cloistered Rails-holes.
danijoo has quit [Read error: Connection reset by peer]
Mars___ has joined #ruby
Briareos1 has joined #ruby
danijoo has joined #ruby
decoponio has quit [Quit: Leaving...]
Spami_ has quit [Quit: This computer has gone to sleep]
m8 has joined #ruby
<benlieb>
Are the differences in procs and lambdas meant to solve specific common programming challenges?
<CorySimmons>
godd2: Good idea
CorySimmons has quit [Quit: Leaving.]
<benlieb>
Because I thing of procs as "not strict" lambdas, as there is no argument enforcement.
lorelei_ has joined #ruby
lorelei_ has quit [Changing host]
lorelei_ has joined #ruby
<shevy>
benlieb no idea, they seem artificial a separation but so is module vs. class distinction
<benlieb>
Right now the differences are just something I've memorized, but have not really learned that one or the other is more or less useful, or more applicable to specific situations
<shevy>
what do you mean with "learn"
<shevy>
as far as I know the main difference is that one has mandatory arguments, the other has not
timonv has quit [Remote host closed the connection]
<benlieb>
shevy: I mean I can almost always use either, I just have to make sure my implementation accounts for their behavior
IceDragon_ has joined #ruby
<shevy>
yeah
<benlieb>
which makes me feel that one or the other is kinda unnecessary
<shevy>
yeah
<godd2>
benlieb: sometimes you want to "save" a return for "later", in which case, lambda is your friend. A Proc will faithfully have a return get called even if it's in the body of the block, but a lambda will keep it hidden away until you acually call it.
Mars____ has joined #ruby
IceDragon has quit [Ping timeout: 272 seconds]
rootshift has quit [Quit: rootshift]
<Nilium>
Consider the difference in behavior when using `return` in a proc vs. a lambda and you'll probably have an idea of what it solves (e.g., like a function vs. control structure)
mneorr has quit [Ping timeout: 245 seconds]
rootshift has joined #ruby
<godd2>
You can think of the binding of a lambda to be tighter than a proc. when a lambda is called, the code is more encapsulated from its environment than a proc
IceDragon_ is now known as IceDragon
<benlieb>
Nilium: godd2: right so proc is more like a block (like 'if'), and lambda is more like a function when return is concerned?
<Nilium>
You had it right. Nevermind, this cold is scrambling my brain.
Mars___ has joined #ruby
kevinykc_ has quit [Quit: Computer has gone to sleep.]
Mars____ has quit [Read error: Connection reset by peer]
<godd2>
if you call a return in a proc, it will behave as if that return is at the scope of the function "outside" of it. but if you have a return in a lambda, it's walled off from it's surrounding scope
kuzushi has quit [Ping timeout: 245 seconds]
<godd2>
so the return in the lambda won't interfere with the return in a function that it's embedded in
<benlieb>
godd2: ok I get that
Jake232 has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
<benlieb>
godd2: so a lambda is kind of like an anonymous function (kinda)
securitycrush has quit [Ping timeout: 240 seconds]
<godd2>
a lambda is precisely an anonymous function
Hobogrammer has joined #ruby
albertgrala has quit [Quit: Leaving]
<godd2>
and a proc is just a useful chunk of code floating around
shaunbaker has joined #ruby
<benlieb>
and a proc is like a 'saved' block?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
glundgren has joined #ruby
glundgren is now known as guilund
RaCx has joined #ruby
<benlieb>
do they behave the same in terms of closure-"ness"?
<i_s>
main diff between proc and lambda is that 'return' does different things
<i_s>
proc will return from the outer scope, whereas return in lambda just returns from the lambda
<workmad3>
benlieb: lambdas also throw argument errors if called with incorrect numbers of args
<workmad3>
benlieb: but yes, they create the same kind of closure
Mars___ has quit [Remote host closed the connection]
shaunbaker has quit [Remote host closed the connection]
nanoyak has quit [Quit: Computer has gone to sleep.]
charliesome has joined #ruby
petey has quit [Remote host closed the connection]
kate_r has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
maasha has quit [Quit: Page closed]
<benlieb>
when you pass a block to a method via 'do' is that a block, a proc, or a lambda?
lockweel has joined #ruby
saarinen has joined #ruby
mocfive has quit [Remote host closed the connection]
mocfive has joined #ruby
ahmedelgabri has joined #ruby
<apeiros>
benlieb: neither
dweeb_ has joined #ruby
<apeiros>
benlieb: when you convert it, it's a proc
<godd2>
"By passing a block to a method whose last parameter is prefixed with an ampersand. That parameter will receive the block as a Proc object." - Programming Ruby
yosafbridge has quit [Ping timeout: 245 seconds]
<benlieb>
so if it's not 'converted' it's just a block that can be 'yielded' to...
shaunbaker has joined #ruby
<guilund>
hey guys
<apeiros>
benlieb: yes
<benlieb>
is there a way to convert it to a lambda?
<apeiros>
hm, could try lambda(&block)
mneorr has joined #ruby
<guilund>
i have a 2 modules, with the same method_names, i require and include both, but how can i access the method in the specific module? i mean: Module1::method_name
<benlieb>
apeiros: in the method params def?
Txandy|away is now known as Txandy
<guilund>
something like that
<apeiros>
benlieb: no, in the method body
Hanmac1 has joined #ruby
<workmad3>
guilund: please don't cross-post after it was suggested in #rubyonrails that you do some research on OO design :P
<benlieb>
wouldn't it just be lamda(block) at that point if you have &block in the params area?
aryaching has quit [Ping timeout: 272 seconds]
<guilund>
workmad: they told me to ask here, for christ sake :P
tannerburson has joined #ruby
<apeiros>
benlieb: hm, nope, seems lambda(&block) is a noop
sepp2k has joined #ruby
g3orge has joined #ruby
<guilund>
workmad3: and you are what? the polcie of ruby?
mocfive has quit [Ping timeout: 252 seconds]
<guilund>
police
<guilund>
ruby police
<guilund>
:P
alexfreidah has joined #ruby
mansi has quit [Read error: Connection reset by peer]
CorySimmons has joined #ruby
<workmad3>
guilund: no, I leave that to apeiros who has ban-stick command and an intolerance for cross-posting ;)
mansi has joined #ruby
<guilund>
apeiros is ma brotha from anotha matha man
petey has joined #ruby
<guilund>
he always help me
<guilund>
sorry!!!
<benlieb>
apeiros: so if at some point I want to get a lambda into a method, I would pass it as a regular param, and not rely no whatever the mechanism is that grabs the block started with "do" ?
<guilund>
i need help
Hanmac has quit [Ping timeout: 265 seconds]
lorelei_ has quit [Read error: Operation timed out]
<benlieb>
rely *on*
<guilund>
apeiros: put that gun down man
<apeiros>
guilund when you cross-post, inform the channels where you're cross-posting. that's the least.
momomomomo has joined #ruby
* apeiros
bang
<guilund>
:P
wallerdev has joined #ruby
shaunbaker has quit []
mansi has quit [Read error: Connection reset by peer]
momomomomo has quit [Client Quit]
<guilund>
cross posting? i mean, you are independent entitys, different channels?
<apeiros>
I really really need a canned reply why cross-posting people usually are dicks.
maasha has joined #ruby
<guilund>
i can assure you i have a dick, but im not
Sawbones has joined #ruby
smathieu has quit [Remote host closed the connection]
<workmad3>
guilund: there's a lot of people in both, and it's polite to let people know that you've asked in multiple places so that it isn't a slap in the face when someone cross-posting questions suddenly ups and vanishes because a different channel answered it
<guilund>
now im offende
<guilund>
sorry...
<guilund>
i'll google for help
<guilund>
thanks
asteros has quit [Quit: asteros]
smathieu has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
asteros has joined #ruby
<guilund>
workmad3: thaks for the explanation, but i didnt get an answer in one place, THEN i came here
<apeiros>
guilund: 99% of all cross-posters abandon the question once answered. I for one don't want to waste my time on somebody doing that.
alexfreidah has quit [Ping timeout: 265 seconds]
<guilund>
apeiros: i get the logic
<guilund>
apeiros: but it doesnt apply on my case :P
<apeiros>
guilund: said every cross-poster ever.
jenskarlsen_ has joined #ruby
<apeiros>
yet in the last 10 years I've seen, I think, two cases
<Sawbones>
"I'm a special snowflake"
jenskarlsen_ has quit [Client Quit]
<maasha>
workmad3: that Pipe class ... I am trying something new in order to make it run on multiple cores.
<guilund>
no, not because of that, the guys on rails told me to ask here
<maasha>
workmad3: seems flawed though. It works on small test data sets, but bigger files are hanging.
<guilund>
you guys are stressed out today, holy mother :P
deception has quit [Quit: Goodbye]
Hobogrammer has quit [Ping timeout: 248 seconds]
<apeiros>
Sawbones: that quote sounds familiar, where's it from? :)
Xeago has quit [Remote host closed the connection]
<guilund>
where is the brogramming i'm used to over here?
<guilund>
hehehe
Xeago has joined #ruby
<Sawbones>
apeiros: Couldn't tell you, but my gf quotes it all the time to people who complain too much
<apeiros>
workmad3: btw., I usually only kick for cross-posting (and that only because people proved not to listen/care if I just tell them)
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
<guilund>
apeiros: sorry dude, i didnt know about this cross-posting, but now i'm aware
<guilund>
can i ask again here? or it still will be considered cross posting
<guilund>
?
punkcat has joined #ruby
<shevy>
you'll never know beforehand!
<apeiros>
guilund: I told you the rule - just state that you're crossposting
kuzushi has joined #ruby
<benlieb>
guilund: you've apologized. just re-ask your question.
drumusician has quit [Read error: Connection reset by peer]
<lilly19>
Do you know know a way to get all of the gem dependencies recursively, 'gem dependency [name] -R' is not what I saying, dependencies of a gem with all of it's dependences and so on..?
Mars has joined #ruby
drumusician has joined #ruby
<guilund>
i have two modules, they have the same method names, how can i call a method specifying the module? something like Module1.method_name Module2.method_name
<guilund>
it makes any sense?
<guilund>
in ruby?
Valesk has joined #ruby
Mars is now known as Guest7218
mansi has quit [Read error: Connection reset by peer]
mansi has joined #ruby
<benlieb>
guilund do the modules rely on vars defined in the class?
mocfive has joined #ruby
<benlieb>
in the class their included into?
<benlieb>
*they
<benlieb>
r
<shevy>
guilund several ways. a simple one is to add extend self in that module
<maasha>
godd2: right, multi-threading is easy with ruby, but multi CPU is different
<godd2>
If you want multi-core, you should be using Rubinius or JRuby
Hobogrammer has joined #ruby
CpuID has quit [Ping timeout: 260 seconds]
petertretyakov has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
<godd2>
Or just switch to Scala :P
CpuID has joined #ruby
CpuID has quit [Changing host]
CpuID has joined #ruby
senayar has joined #ruby
CpuID has quit [Client Quit]
asteros has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
fmcgeough has quit [Ping timeout: 272 seconds]
smathieu has quit [Remote host closed the connection]
asteros has quit [Client Quit]
smathieu has joined #ruby
asteros has joined #ruby
teddyp1cker has quit []
RaCx has quit [Quit: Computer has gone to sleep.]
<benlieb>
on the block / proc / lambda theme again: is there a way for a passed block to interact with the internal environment of a method, or is it always separate? This behavior kind of surprised me: https://gist.github.com/pixelterra/8425653
sambao21 has joined #ruby
lockweel has quit [Ping timeout: 272 seconds]
Guest7218 has quit [Remote host closed the connection]
Leehro2 has joined #ruby
JohnBat26 has quit [Ping timeout: 245 seconds]
rootshift has quit [Ping timeout: 245 seconds]
<canton7>
benlieb, I prefer to avoid the 'yield' syntax when explaining how blocks work: http://pastie.org/8633683
shime has quit [Ping timeout: 272 seconds]
<canton7>
so line 4 calls a method - why should that method be scoped to the test method?
<apeiros>
benlieb: local variables you have to pass
heftig has joined #ruby
<apeiros>
benlieb: you can "rebind" a block to be executed in the context of self, using instance_eval or instance_exec
<canton7>
*calls something like a method
<apeiros>
that'll affect ivars and method calls
alexherbo2 has quit [Quit: WeeChat 0.4.2]
Txandy is now known as Txandy|away
alexherbo2 has joined #ruby
shime has joined #ruby
asteros has quit [Quit: asteros]
dweeb_ has quit [Quit: Computer has gone to sleep.]
<Hanmac>
you can use binding to get the local variables ... but it still does not work as you want
<godd2>
benlieb: "Some people like to think of the association of a block with a method as a kind of argument passing. This works on one level, but it isn’t really the whole story. You may be better off thinking of the block and the method as coroutines, which transfer control back and forth between themselves." - Programming Ruby
lockweel has joined #ruby
<godd2>
So in your example, you can think of the code "jumping back" to the point at which you wrote the block and looks around for the variables you wrote in it, and uses those local variables, not the ones in the method definition
kcombs has quit [Remote host closed the connection]
<leo-the-manic>
Can I replae File.open('foo') { | f | bar(f) } with something like File.open('foo') bar?
ambushsabre has quit [Quit: rip]
brunops has joined #ruby
lassebunk has quit []
prc1 has joined #ruby
<godd2>
leo-the-manic: What are you trying to do, run the method bar on every line of the file?
Advocation has quit [Quit: Advocation]
centrx has joined #ruby
<leo-the-manic>
godd2: I guess it's a poor example. One method generates a stream of bytes pre-split into chunks, and I want to write it to a Gzip file. So I have two nested do's and it just looks a little noisy
jlast_ has quit [Remote host closed the connection]
ambushsabre has joined #ruby
[_aeris_] is now known as _aeris_
IceDragon has quit [Ping timeout: 246 seconds]
<IceyEC>
File.open('foo').map(&:bar) might work leo-the-manic
lockweel has quit [Ping timeout: 272 seconds]
<canton7>
that calls f.bar, not bar(f)
<IceyEC>
but you'd be calling the method bar on a string
Jdubs has joined #ruby
vikhyat has joined #ruby
ry4nn has joined #ruby
punkcat has quit [Quit: punkcat]
ry4nn has quit [Remote host closed the connection]
thesheff17 has quit [Quit: Leaving]
_aeris_ is now known as [_aeris_]
nanoyak has joined #ruby
ryan__ has joined #ruby
thesheff17 has joined #ruby
Txandy|away is now known as Txandy
Liquid-- has quit [Quit: Computer has gone to sleep.]
jprovazn has quit [Quit: Odcházím]
BizarreCake has quit [Ping timeout: 260 seconds]
petey has quit [Remote host closed the connection]
laphlaw has joined #ruby
petey has joined #ruby
sassamo has quit [Remote host closed the connection]
sassamo has joined #ruby
Spami_ has joined #ruby
lockweel has joined #ruby
yalue has quit [Quit: Leaving]
IceDragon has joined #ruby
petey has quit [Ping timeout: 246 seconds]
Fernandos has joined #ruby
gregoriokusowski has joined #ruby
<Fernandos>
Is there a downside to using middleman?
<Fernandos>
I'm just thinking about using that for coming up projects which involve a cms
eka has quit [Quit: Computer has gone to sleep.]
whomp has joined #ruby
<whomp>
what's the best way these days to set a breakpoint in ruby?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
framling has quit [Read error: Connection reset by peer]
<Fernandos>
I prefer having an API first CMS, such that I have A) command-line-tools for it B) A REST API which I can use to integrate business data or to consume from mobile devices
Txandy is now known as Txandy|away
neoice has joined #ruby
<Fernandos>
whomp: check the jetbrains IDE
<whomp>
*without having to change IDEs
<itadder>
what so good about jetbrains
<itadder>
another ide
<benlieb>
For those not sick of my questions about lambdas / procs, here' my last one: if a lambda is a Proc (lambda{}.class = > Proc < Object), why is it different from a proc?
<whomp>
yeah like... how can i break a program without moving off vim?
<neoice>
I'm trying to do something like: log.level = Logger::#{sev}... I've seen .send() for using variables as method names, but I'm not sure how to instantiate an object identified by a variable.
kep has joined #ruby
<canton7>
neoice, Logger.const_get(...)
clamstar has quit [Quit: Computer has gone to sleep.]
<MrZYX>
whomp: IMO binding.pry
<Fernandos>
itadder: it's just an editor which works out of the box, that's about it. I can tune me vim to do the same, but I'm more comfortable with an IDE sometimes than with vim. It's about coding, not luxury or coolness
<centrx>
Fernandos, It seems like with middleman you would need to set up a system to generate pages that are saved in the CMS
<Fernandos>
I use vim in addition to the ide, here btw.
<whomp>
MrZYX, how do i break with pry?
<itadder>
I like vim and textmate
prc1 has quit [Quit: Leaving.]
<centrx>
Fernandos, It does not seem to be designed for a CMS with unprivileged users, without adding extra scripting on top of it
<MrZYX>
whomp: check pry-byebug (or pry-debugger for 1.9)
sLi_ has quit [Ping timeout: 260 seconds]
fedez77 has quit [Ping timeout: 246 seconds]
<Fernandos>
centrx: oh good point! No ACL,RBAC.. big thing
<MrZYX>
or just write binding.pry where you want to break
jkamenik has quit [Quit: Leaving.]
<centrx>
benlieb, For one, lambda requires the exact number of argument specified
Targen has joined #ruby
Targen_ has quit [Ping timeout: 248 seconds]
<benlieb>
centrx: I understand that, but my question in this case is if they're different, why is a lambda a proc? Why not make it a lambda class, that is maybe a subclass of proc. The whole syntax around this makes the subtle differences a bit dicier than it needs to be, in my opinion
<whomp>
MrZYX, thx :)
mityaz has quit [Quit: See ya!]
<benlieb>
normally in programming when something is mostly like something else but a bit different, it's a subclass
<Fernandos>
centrx: I really think about creating a binary cms that can be used as cli tool to manage other cms remotely and then generate client libraries that leverage it on the server-side
<Fernandos>
centrx: do you think that's a good idea?
<centrx>
benlieb, lambda is a language keyword, not a class of anything
<whomp>
MrZYX, now it dumps all of the variables at the breakpoint. i just want it to stop there!
<Fernandos>
And what could go wrong with a binary cms having client libraries in many languages?
<Fernandos>
I know a lot about cms, workflows and that there is no single cms with a decent gui. Also tinymce and wysiwyg sucks a big time, because it takes too much time to do what you want.
<centrx>
MrZYX, Thanks
<centrx>
MrZYX, benlieb -> is a keyword though... ?
<benlieb>
it seems like internally it would have to subclass Proc, or at least somehow set some internal environment to make it behave differently.
Mars___ has joined #ruby
jlast has joined #ruby
<MrZYX>
whomp: never saw it dumping all variables, it is intended to drop you into a pry session and that prints the current context
<MrZYX>
centrx: yep
<godd2>
Anyone have any resources so I can learn to "professionalize" my gem? The code is kinda hacked together and messy.
<neoice>
canton7: thanks for the tip. is there a place I can learn about things like .send() and .const_get()?
<centrx>
Fernandos, Sounds like a great idea. If it is really an empty space with no available free software for that.
<MrZYX>
neoice: read the docs of Object, Kernel, Class and Module
<Fernandos>
Also permissions, roles , caching and extensions are a pain in the ass in most cms. Deploying permissions isn't even possible in any of those for example.
<centrx>
Fernandos, I would recommend making as much use of existing libraries as possible
lockweel has joined #ruby
<godd2>
neoice: You could check out Metaprogramming Ruby by Paolo Perrotta. It's nto as intimidating as it sounds.
<canton7>
neoice, IRC? :) Otherwise, reading all methods on the lower-level classes can be very handy (Object, BasicObject, Kernel, IO, etc)
wildroman2 has joined #ruby
<Fernandos>
centrx: hmm.. idk. if there is already such a thing. I was thinking of a single binary and didn't want to use a huge framework and am still not sure of the language to use.
<centrx>
Fernandos, Web apps is the trend these days. Does help for compatibility across platforms
<benlieb>
Proc.new{}.proc? => undefined method
<neoice>
godd2: I wasn't sure if "metaprogramming" was the right term. "metaprogramming" always sounds like such a lofty concept
<Fernandos>
centrx: no idea about the language to choose really, but would you use such a thing? Having client libraries in many languages, remote control via cli and a realtime interface connecting to the API that's just static html/js/css interface.
sparrovv has joined #ruby
<godd2>
neoice: ruby is built for it, and trust me when I say that book is pretty straightforward
<centrx>
Fernandos, I am not sure I am the target user. I don't have any content :)
<Fernandos>
I mean CMS's are doomed to fail, because you say it. People need webapps, not a cms.
beneggett has joined #ruby
<Fernandos>
But webapps almost always evolve to a cms
<Fernandos>
but a cms very rarely evolves to a webapp and when it does it's big, clunky and ugly, not even talking about security here
<centrx>
I would think that a webapp could be a CMS. Maybe I am wrong, but the concept does not require a desktop application
deens has quit [Remote host closed the connection]
<centrx>
A CMS deployed internally on an internet with a web interface is still a "webapp" even if no one on the "World Wide Web" connects to it via the public Internet
<centrx>
intranet
guilund has quit [Remote host closed the connection]
kewubenduben has joined #ruby
dj21 has joined #ruby
pu22l3r__ has quit [Remote host closed the connection]
<Fernandos>
A webapp often times evolves to a cms, when projects grow, like facebook for example. They have a highly complex RBAC/ACL system that manages security and access and a way to add content. That's it
<dj21>
is there a gem that'll let me take a screenshot of a webpage - preferably besides ancient selenium-webdriver?
<kewubenduben>
Hi guys, how do you do a regex if you have a variable? trying like -> a="sfs" ; "mysfs01" =~ /a/ <- is not possible
geggam_ has joined #ruby
w4pm has quit [Ping timeout: 248 seconds]
<Fernandos>
dj21: idk about a gem, but there are many SaaS services that do that. phantomjs could help you do that yourself, iirc
<dj21>
i just found one actually, link_thumbnailer, thx
<centrx>
kewubenduben, Either: /#{a}/ or Regexp.new(a)
mengu has quit [Remote host closed the connection]
<dj21>
kewubenduben: what are you trying to do, match or substitute?
phansch has quit [Quit: Leaving]
lockweel has quit [Ping timeout: 272 seconds]
<dj21>
oh n/m
robert_ has joined #ruby
lorelei_ has joined #ruby
thenovices has quit [Remote host closed the connection]
<dj21>
what does ~> mean in the context of bundler?
<Fernandos>
centrx: what would you need? I mean what project do you think would help you other than a cms then?
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Fernandos>
just trying to fix shit, because email and cms suck so hard I wanna fix it asap
ambushsabre has joined #ruby
Usse has joined #ruby
mocfive has quit [Read error: Connection reset by peer]
burlyscudd has joined #ruby
<centrx>
Fernandos, What's wrong with e-mail?
mocfive has joined #ruby
CogitoErgoSum has quit [Ping timeout: 248 seconds]
<shevy>
dj21 I believe it somehow checks for major or minor version (probably major)
RaCx has joined #ruby
<Fernandos>
centrx: idk, where to start... your question sounds so legitimate, but when you look at how email works at the protocol level, you'll see how bad it is and how much it sucks.
<centrx>
Oh SMTP, yeah I don't think you are going to be able to change that :)
jkline has quit [Quit: jkline]
<dj21>
my app depends on nokogiri 1.6.1, but a new gem (link_thumbnailer) demands ~. 1.4.0
sambao21 has quit [Quit: Computer has gone to sleep.]
IceyEC has quit [Quit: IceyEC]
<dj21>
~> *
geggam_ has quit [Client Quit]
<dj21>
rock and a hard place
<godd2>
dj21: its says "look for the newest release that is in the same minor release category"
<Fernandos>
centrx: smtp, pop3, exchange, imap etc.. there is a lot of bullshit that re-invents the wheel
CogitoErgoSum has joined #ruby
itadder has quit [Read error: Connection reset by peer]
Virtualize has quit [Quit: Leaving...]
<dj21>
ahhh cutycapt :]
timonv has joined #ruby
<Fernandos>
centrx: and that's "low-level", on the interface side the things are even worse than that. That's why social networks sprout, because email sucks. Each and everyone tries to solve a similar problem, without knowing the actual problem.
gijsje has joined #ruby
Liquid-- has joined #ruby
Spami_ has quit [Quit: Leaving]
Spami has joined #ruby
<centrx>
Fernandos, I am all for anything that eliminates Facebook
lorelei_ has quit [Ping timeout: 245 seconds]
mary5030_ has quit [Ping timeout: 248 seconds]
klaut has quit [Remote host closed the connection]
<Fernandos>
centrx: what frustrates me personaly is that I cannot integrate flows in to what I used to do, the sofware is dumb and writing extension requires too much time, because the software sucks at making things "easy" to extend
<Fernandos>
not joking, I tested many more than 100 cms, didn't count after a while..
dweeb_ has joined #ruby
<Fernandos>
and I looked through the source of almost all of them, regardless of the language they were written in (excluding any commercial or SaaS cms)
timonv has quit [Ping timeout: 276 seconds]
w4pm has joined #ruby
olivier_bK has joined #ruby
<Fernandos>
Adva CMS is the only one in that list I didn't know
<Fractional>
binagy: Didn't find anything it earlier on.
whomp has quit [Ping timeout: 245 seconds]
parduse has quit [Ping timeout: 272 seconds]
nanoyak has joined #ruby
<shevy>
Hanmac hehe. could be decoay
ItSANgo has quit [Quit: Leaving...]
<shevy>
*decoy
el_cristobal has joined #ruby
<shevy>
Hanmac or just raise awareness
cbetta_afk is now known as cbetta
<Sawbones>
So a symbol is a string?
havenwood has joined #ruby
<shevy>
Sawbones of course not
<godd2>
Sawbones: a symbol is very much like a string,but there're things you cant do to it like a string
<bnagy>
Fractional: well it took me about as long as it took to type 'rubymine run program' into google, so maybe you weren't looking right
<shevy>
Sawbones the first thing one should remember is that symbols are super boring, they only have a cool name
Mars___ has quit [Read error: Connection reset by peer]
<Sawbones>
because in the rails code it calls params[:id]
LekeFly has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Mars has joined #ruby
<Sawbones>
Is :id a variable in this case?
<Sawbones>
I'm confused.
<bnagy>
no, it's a symbol
Mars is now known as Guest86704
<centrx>
Sawbones, A symbol is a constant that looks very much like a string to the programmer
<shevy>
Sawbones what does a symbol have as identifier for you?
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<centrx>
Sawbones, The only difference between a symbol and a string is a) it is stored once internally, as a constant, so it is more efficient to re-use, and b) the syntax is cleaner, : vs ""
<godd2>
Sawbones: we use symbols as keys in hashes. in the params hash, the :id symbol will get you the id in that hash. so if params = {:id => 3, :name => "Jim"} then params[:id] will spit back 3 to you
<Fractional>
bnagy: I only found it for rails.
<LadyRainicorn>
Also, importantly, symbols are not garbage collected.
Xeago has quit [Ping timeout: 260 seconds]
<shevy>
ponicorns are not garbage collected either!
<centrx>
Sawbones, A symbol also lacks many of the methods a string has, it is less bulky
<Sawbones>
godd2: Can I just get the id from that hash with 'id'?
<LadyRainicorn>
That is true shevy.
yekta has quit [Quit: yekta]
<shevy>
Sawbones of course not
* LadyRainicorn
flies around uncollected.
beneggett has joined #ruby
<bnagy>
so when we say 'the only difference between a symbol and a string' we really mean 'they're pretty much different in ever significant way'
<shevy>
because 'id' is a string Sawbones
rayners has quit [Remote host closed the connection]
<Hanmac>
Sawbones: did you had other programing exp before with other language?
nanoyak has quit [Quit: Computer has gone to sleep.]
<Sawbones>
Yeah
<shevy>
Sawbones there exists this abomination HashWithIndifferentAccess or something
<bnagy>
unless you use Fails "hash with indifferent access" or whatever horror they have
<shevy>
if symbols are too DIFFICULT for you, use that hash
<bnagy>
heh
<Sawbones>
but usually hashes use a string for their key
mark_locklear has quit [Ping timeout: 260 seconds]
<Hanmac>
Sawbones: ... Symbols are rubys way like a creepy hybrid between a String and the Enums in C
<bnagy>
no
<shevy>
Sawbones in which language though?
<Sawbones>
It's not difficult I just want to understand why they chose these symbols and when I should use them
<shevy>
Sawbones because a symbol has the same object_id all the time, always. a string object does not have
<bnagy>
string keys are uncommon in ruby
<shevy>
but they are garbage collected!!!
<LadyRainicorn>
Symbols are for when you care about identity.
<LadyRainicorn>
Strings are for when you care about value.
<bnagy>
in idiomatic ruby you'll mostly only see them when a hash is going into or coming out of json or some other serialisation format
<godd2>
youll see that "a" got created twice and has two different object ids because they aren't the same object, but when :a was created, it was created once and forever in that code
<LadyRainicorn>
Also, never use to_sym.
<LadyRainicorn>
Ever.
nanoyak has joined #ruby
LekeFly has joined #ruby
claymore has quit [Quit: Leaving]
<LadyRainicorn>
You will die
<bnagy>
eh?
<Sawbones>
bnagy: I just started using the ruby json library and I acquired my values with strings
<LadyRainicorn>
Painfully.
<Hanmac>
Sawbones: for sample : 1000.times.map {"a"} creates 1000 different strings ... 1000.times.map {:a} create ONE symbol
sethen has quit [Ping timeout: 252 seconds]
beneggett has quit [Client Quit]
<godd2>
LadyRainicorn: unless you're getting a string that you want to send as a method, then object.send(some_string.to_sym) would be the way
CogitoErgoSum has quit [Ping timeout: 245 seconds]
rakm has joined #ruby
<bnagy>
send works with strings these days
<Sawbones>
Hanmac: ok, see that makes sense then
Fractional has quit [Quit: Leaving]
<LadyRainicorn>
If some_string is user controlled, to_sym is a DoS vuln.
<Sawbones>
that would explain why you'd write attr_accessor :thing :another_thing, because you want the same object
Fernandos has left #ruby ["PONG :hubbard.freenode.net"]
<Hanmac>
attr_accessor "thing" would work too but it is not nessary
postmodern has joined #ruby
alexfreidah has joined #ruby
<Sawbones>
wait what?
mneorr has joined #ruby
<Sawbones>
that's stupid
synergy_ has joined #ruby
<centrx>
*~*~**!*!~*~* YOU SAID THE WORD OF THE DAY ~*~**!*!*!**~*~*~
<bnagy>
there's no particular reason for attr_* to use symbols apart from style
<bnagy>
you could easily write those methods to take string params
<Hanmac>
for sample most of the methods that takes Symbols like define_method or send does work with Strings too
<bnagy>
now
vikhyat has quit [Read error: Connection reset by peer]
<bnagy>
used to be a pain in the ass
<Sawbones>
bbl to discuss more
heftig has quit [Quit: Quitting]
Sawbones has quit []
CogitoErgoSum has joined #ruby
<LadyRainicorn>
Not accepting strings is very bad.
<godd2>
Fun fact, if you want a space in your symbol, just wrap it in quotes. :"Hello, world!"
vikhyat has joined #ruby
parduse has joined #ruby
<bnagy>
:<
<centrx>
:"Hello, world!".to_s
ItSANgo has joined #ruby
<rakm>
how do I get rake to invoke consecutive tasks?
<shevy>
anyone who would use "a#{"b#{String.new("c")}d"}e" should be killed on the spot
Jake232 has quit [Ping timeout: 272 seconds]
LekeFly has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cads has quit [Ping timeout: 272 seconds]
<Hanmac>
godd2: the difference is that they are not only string literals ... for sample "a#{1}b" is not autmaticlly cutted by the parser to "a1b"
jasonpp has left #ruby [#ruby]
CogitoErgoSum has quit [Ping timeout: 252 seconds]
sLi_ has joined #ruby
marr has quit [Ping timeout: 245 seconds]
ctp has joined #ruby
Txandy is now known as Txandy|away
jasonpp has joined #ruby
<Mon_Ouie>
It's just a form of constant folding: since you're preforming that operation with string literals, the result can be calculated at constant time, no need to do it everytime the string is evaluated
mansi has quit [Read error: Connection reset by peer]
mansi has joined #ruby
madb055 has quit [Ping timeout: 272 seconds]
sLi_ has quit [Ping timeout: 252 seconds]
gasbakid has quit [Read error: Connection reset by peer]
CodeBunny has joined #ruby
<CodeBunny>
Cucumber SUCKS!
mansi has quit [Read error: Connection reset by peer]
drumusician has quit [Remote host closed the connection]
<CodeBunny>
Shoot me!
mansi has joined #ruby
drumusician has joined #ruby
drumusician has quit [Remote host closed the connection]
drumusician has joined #ruby
deens has quit [Remote host closed the connection]
lioninawhat has joined #ruby
laphlaw has quit [Quit: Computer has gone to sleep.]
mercwithamouth has quit [Ping timeout: 246 seconds]
mercwithamouth has joined #ruby
<shevy>
why would anyone shoot you
DJJeff has quit []
gijsje has quit []
sailias has quit [Quit: Leaving.]
mneorr has joined #ruby
Animawish has joined #ruby
* Hanmac
throws an apple
Liquid-- has joined #ruby
jkline has joined #ruby
jkline has quit [Client Quit]
<CodeBunny>
So sick of cucumber. It takes an hour to do in cucumber to do what I can do in minitest in 5 minutes
m8 has quit [Quit: Sto andando via]
<Hanmac>
cucumber are only for kappas
<CodeBunny>
kappas?
adil_jarulin has joined #ruby
beneggett has joined #ruby
yfeldblum has quit [Remote host closed the connection]
clamstar has joined #ruby
drumusician has quit [Ping timeout: 252 seconds]
<Hanmac>
CodeBunny: Japanese Water Daemons ... they like cucumber :P
lfox has quit [Quit: ZZZzzz…]
mary5030 has quit [Remote host closed the connection]
<CodeBunny>
Oh good. Now I know what it's useful for.
Virtualize has joined #ruby
Virtualize has quit [Remote host closed the connection]
<CodeBunny>
Because it's certainly not useful for what this guy wants to use it for
<CodeBunny>
NOT a testing tool people. Not a testing tool
Virtualize has joined #ruby
yfeldblu_ has joined #ruby
<godd2>
I'm having trouble finding some good resources to learn about Unit Testing and best practices in the Ruby ocmmunity regarding testing. Anyone have any links or recommendations?
mikepack_ has joined #ruby
kenndel_ is now known as kenndel
<CodeBunny>
Oooh.... google micheal feathers
mikepack_ has quit [Remote host closed the connection]
<CodeBunny>
and POOTR
fgo has joined #ruby
spastorino has joined #ruby
sassamo has joined #ruby
<CodeBunny>
poodr rather
<bnagy>
godd2: the general practice is to have hundreds of tests written in a DSL that is a sexily natural language looking as possible, while never actually writing any tests that expose actual bugs or security issues
Liquid-- has quit [Quit: Computer has gone to sleep.]
petey has quit [Remote host closed the connection]
<godd2>
I tried to use test/unit with one project, and I was following along, but I didn't really grok what I was doing even though it worked
xea has joined #ruby
shadoi has quit [Quit: Leaving.]
Zackio has quit [Read error: Connection reset by peer]
<CodeBunny>
The minitest docs are much better
beneggett has quit [Ping timeout: 245 seconds]
<CodeBunny>
and you will suddenly grob your test unit tests
petey has joined #ruby
<nateberkopec>
godd2: it took me a while to understand too. reading other project's tests helped me a lot - so did contributing to open-source and having to write unit tests for the stuff I did :)
lioninawhat has quit [Remote host closed the connection]
Txandy|away is now known as Txandy
<CodeBunny>
Travis will make you understand
petey has quit [Read error: Connection reset by peer]
<CodeBunny>
With a big red stick
charliesome has joined #ruby
Wolland has quit [Remote host closed the connection]
petey has joined #ruby
Fractional has joined #ruby
e62 has quit [Ping timeout: 272 seconds]
larissa has joined #ruby
nhhagen has joined #ruby
<Fractional>
Can you do like: "if !foo" in ruby? foo is a boolean
<LastWhisper>
CodeBunny: How come you hate cucumber?
<godd2>
Fractional: fire up irb and try it out! THats what it's for :)
<CodeBunny>
LastWhisper: Because it takes going back and forth between umteen files to get anything done, and it doesn't play nice in my build system, and.... overhead overhead overhead
fedesilva has quit [Remote host closed the connection]
<Fractional>
godd2: It works but Rubymine gives me errors :/
lifestream has joined #ruby
<Fractional>
bnagy: Thanks! Exactly what I was looking for! :D
kirun has quit [Quit: Client exiting]
<CodeBunny>
LastWhisper: if something is really truely borked and I can't figure it out, I have to go gather up all the bits that are strewn from hell to breakfast, pull them into a single minitest file, debug, then go fix it in cucumber
<nhhagen>
I have a tab seperated file that I want to read each line from, split it, select a column and only keep unique values of that column. This is what I though was right: File.open("NO.txt", "r:utf-8").each_line.map {|line| line.split("\t")[1]}.uniq do |place|
<CodeBunny>
LastWhisper:It's a pain in a ankle
<LastWhisper>
Gotcha. CodeBunny Is your test suite that large that it happens that often?
<nhhagen>
but that does not work
shime has quit [Ping timeout: 272 seconds]
<bnagy>
nhhagen: there's a csv lib in stdlib
<nateberkopec>
nhagen: require 'csv' #BOOM
<CodeBunny>
LastWhisper:it's not a matter of large...
<bnagy>
which works with tab separators as well, obviously
<Fractional>
I recently started using Rubymine and there is something weird with the IDE. It gives me errors unless I give the optional parameters of a method arguments.
Zackio has joined #ruby
<Fractional>
Has anyone experienced anything in the like?
<nhhagen>
bnagy: I'm not suprised, I'll check it out, but it is the selecting unique part I need help with. I'm guessing that my method chaining does not work as I expected
<CodeBunny>
LastWhisper:it's more a matter of 'how do I get this fiddley bit to work... Oh hell, I have to get it to work in this stupid DSL on top of getting it to work in the first place. fuck me
Some-body_ is now known as DarthGandalf
<bnagy>
nhhagen: well 'doesn't work' is not a useful problem description
<godd2>
Fractional: I think it's only a warning, not an error. While it's probably a good idea to use unless in that case, always choose the control statement which makes the most sense and don't force yourself to use one that feels uncomfortable.
<bnagy>
if you can provide sample input that's the best way
<CodeBunny>
LastWhisper:It's not hard. It's just very time consuming.
<nhhagen>
bnagy: well, I get duplicates
<Fractional>
godd2: Rubymines highlights the code with underlined red unless I fill in all the arguments for a method (even the ones that are optional). Unless feels more ruby-ish :)
<godd2>
nhhagen: you're using #uniq when you should use #uniq!
<godd2>
nhhagen: without the exclamation point, you aren't changing the object
vikhyat has quit [Read error: Connection reset by peer]
<bnagy>
no, it's not that
<LastWhisper>
I hear ya CodeBunny
<bnagy>
you're passing a block straight to uniq - doubt that's what you want
<bnagy>
try uniq.each
<nhhagen>
godd2: thx, I'm new to ruby, and haven't read enough yep
<LastWhisper>
Are any of you guys familiar with WebMock at all? In terms of creating stub_requests and then checking pages via a web browser/driving it?
iceden has quit [Remote host closed the connection]
vikhyat has joined #ruby
danshultz has joined #ruby
<Hanmac>
nhhagen & godd2: but you need to beware from ! methods ... some of them might return nil, so you need to be careful when you want the return value for chaining
jtbw has joined #ruby
<bnagy>
uniq {|blah| ... uses the block result for the uniqueness test
<godd2>
nhhagen: a couple others like that to be aware of are .sort vs .sort! and reverse! vs reverse
deever_ has quit [Ping timeout: 265 seconds]
<bnagy>
basically just don't chain with ! methods
<Hanmac>
nhhagen: also beware, use File.open() always with a block like File.open() { ... } otherwise you leave the FileDescriptor open
<bnagy>
it makes no sense anyway
deever has joined #ruby
<godd2>
bnagy: unless you want to iterate over a uniq array and have the array still be uniq afterward, surely?
<bnagy>
well if you're chaining then the intermediate result is lost anyway
<bnagy>
so it's pointless
<nhhagen>
Hanmac: ok, what would I put the in the block in the case
<bnagy>
plus the wacked return values - basically it's just safer and cleaner to never do it
<Fractional>
http://puu.sh/6lb8i.png <- Rubymine tell me that I need to fill in 4 more optional arguments.
<Fractional>
Anyone knows how to fix this?
<bnagy>
nhhagen: where you have uniq do use uniq.each do
<nhhagen>
#uniq! worked, I got the correct number of objects
<godd2>
Fractional: that's not an error. Gosu::Image.new can take three arguments just fine
troyready has joined #ruby
<nhhagen>
bnagy: I'll try that to, just to learn
MatthewsFace has joined #ruby
<Fractional>
godd2: Yes, but the red underlining that comes from "Missing 4 arguments" is annoying.
<Fractional>
How can one disable it?
<bnagy>
by uninstalling rubymine
danshultz has quit [Ping timeout: 245 seconds]
<Hanmac>
nhhagen: for sample: File.open("NO.txt", "r:utf-8") {|f|f.each_line.map { ... } } so let the block close it ... otherwise look at File.foreach which does all you want for you
<bnagy>
it's linting is idiotic
shadoi has joined #ruby
<bnagy>
isn't there File.each, anyway?
<Hanmac>
bnagy: i meaned the class method
<godd2>
Fractional: I don't know enough about RubyMine to answer your question. My solution is to use Notepad++ :P
hiall has quit [Ping timeout: 248 seconds]
kpshek has quit []
<workmad3>
there's also File.readlines(filename).each
wildroman2 has joined #ruby
<nhhagen>
Hanmac: thx, this script only reads the file and loads the content into elasticsearch, just didn't want to spam to much
lockweel has quit [Ping timeout: 272 seconds]
mikepack has joined #ruby
hiall has joined #ruby
<Fractional>
godd2: Then back to Sublime it is! :)
<Hanmac>
"File.foreach(filename) VS File.readlines(filename).each " know the difference
jovon_ has joined #ruby
<nhhagen>
Hanmac: thx
<bnagy>
something obscure and horrible that you're going to tell us anyway?
* Hanmac
uses Eclipse for Ruby and C++, but i would not recommend it for everyone
<godd2>
Fractional: if you ctrl+click on the error, what libraray does it open up?
mneorr has quit [Remote host closed the connection]
Txandy is now known as Txandy|away
petey has quit [Remote host closed the connection]
mansi has quit [Remote host closed the connection]
vikhyat has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
<shevy>
hehe
mansi has joined #ruby
duggiefresh has quit [Remote host closed the connection]
jlast has quit [Remote host closed the connection]
<Hanmac>
godd2: i have the feeling that the gosu interface documentation (a fake method list for the parsers) is not 100% that what it is
vikhyat has joined #ruby
aryaching has joined #ruby
<Hanmac>
Fractional: i wanted to make you a Tileset class ... i forgot it again ... maybe i have time tomorrow ... (try to remember me about that)
jovon has quit [Ping timeout: 272 seconds]
MatthewsFace has quit [Quit: This computer has gone to sleep]
<godd2>
Fractional: have you heard of Ludum Dare?
<Fractional>
godd2: I've heard about it yes :)
wildroman2 has quit [Ping timeout: 260 seconds]
<Fractional>
Hanmac: I will if I remember as well! :D
mikepack has quit [Ping timeout: 252 seconds]
vikhyat has quit [Read error: Connection reset by peer]
nateberkopec has quit [Quit: Leaving...]
workmad3 has quit [Ping timeout: 272 seconds]
alvaro_o has joined #ruby
<Fractional>
godd2: Why do you ask? :)
marr has joined #ruby
vikhyat has joined #ruby
<shevy>
Fractional are you already thinking in ruby?
juarlex has quit [Remote host closed the connection]
mansi has quit [Ping timeout: 252 seconds]
<Fractional>
shevy: I'm doing my best to do so! Currently writing gamestate and gamestate manager classes.
<godd2>
Unfortunately Hasu requires Ruby 2.0 and Gosu will only work with 1.9.3 on windows
mikepack has joined #ruby
* Hanmac
point an laugh about gosu because it cant be installed on my system because pango is not where gosu think it is
mneorr_ has joined #ruby
Soliah has joined #ruby
juarlex has joined #ruby
<shevy>
Hanmac where is pango?
<Fractional>
Godd2: The biggest project I've made is a improved "clone" of the Asteroids game in Chingu. You can give it a play if you want! www.github.com/freddan962
<godd2>
nhhagen: bnagy was right, File.open("NO.txt", "r:utf-8").each_line.map {|line| line.split("\t")[1]}.uniq.each do |place|; #place logic; end will work since youre passing a block to the each iterator.
Lewix has quit [Remote host closed the connection]
<nhhagen>
bnagy: that is what I tried
mordocai has quit [Remote host closed the connection]
<Fractional>
godd2: I like that video a lot!
Lewix has joined #ruby
<nhhagen>
godd2: that is what I am doing, do the descriptor should close right
<godd2>
Fractional: but yea, fair warning, if you're on windows, dont get your hopes up
meatherly has quit [Ping timeout: 272 seconds]
tyl has quit [Ping timeout: 260 seconds]
<bnagy>
nhhagen: provide sample input then
<Fractional>
godd2: I'm on Ubuntu, OS X and Windows.
<bnagy>
cause I don't believe you :)
<nhhagen>
bnagy: ?
tyl has joined #ruby
<shevy>
down with your pants!
<shevy>
show the code
<godd2>
nhhagen: I would use File.read personally, if you pass it a block, it will iterate over each line for you and close the file in one go like this: https://gist.github.com/nicklink483/8428254
asteros has quit [Quit: asteros]
sparrovv has quit [Remote host closed the connection]
nanoyak has joined #ruby
timonv has joined #ruby
deens has joined #ruby
lorelei_ has quit [Ping timeout: 252 seconds]
<bnagy>
eh?
<bnagy>
on what version does read do that?
rudisimo has quit []
Lewix has quit [Ping timeout: 272 seconds]
<bnagy>
read should read the whole thing as one string
<bnagy>
readlines is by line
sambao21 has quit [Quit: Computer has gone to sleep.]
tyl has quit [Client Quit]
<bnagy>
or File.read(...).lines, which I guess is quite pretty
vlad_starkov has quit [Remote host closed the connection]
Animawish has quit [Quit: Animawish]
benlieb has joined #ruby
vlad_starkov has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
Guest86704 has quit [Remote host closed the connection]
mneorr_ has quit [Remote host closed the connection]