<havenwood>
rubie: Ruby allows top level stuff for easy examples. In gems and apps you'll use modules as the default or switch to a class if you need instantiation.
<rubie>
i think i could finish avoiding making a class, but thats not the point of it
rshetty has joined #ruby
<havenwood>
rubie: it's common to see a Module used. it's the Bundler default for a new gem for example.
<havenwood>
rubie: use a Module unless you need a Class
<athan>
Hello everyone, I seem to be running into a wall with compass - I can't seem to install it. I've got the latest RVM working, with Ruby version 2.1.2 up to speed. `gem install compass` throws this at me: http://lpaste.net/112151 . What's the usual way to handle dependency errors like this?
<rubie>
im just frustrated because i'm having a hard time writing something, using classes, to understand them better
<havenwood>
athan: a typical RVM install is user local, so no sudo
<havenwood>
athan: #rvm is a helpful channel
krisquigley has joined #ruby
maletor_ has joined #ruby
<athan>
havenwood: Thank you!!!
Takle has joined #ruby
yakko has quit [Read error: Connection reset by peer]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
silkfox has quit [Ping timeout: 245 seconds]
rshetty has quit [Remote host closed the connection]
endash has joined #ruby
<havenwood>
rubie: maybe approach it by not using classes until you start having pain that makes you look to them
yakko has joined #ruby
<havenwood>
rubie: modules should take you a long way
<rubie>
ya probably a good idea, i've wasted a lot of time on this
<havenwood>
rubie: it becomes apparent when you'll want a class
<rubie>
okay
krisquigley has quit [Ping timeout: 246 seconds]
bobishh has joined #ruby
robustus|Off has quit [Ping timeout: 250 seconds]
emocakes has joined #ruby
thsig has joined #ruby
robustus|Off has joined #ruby
dx7 has joined #ruby
thomasxie has joined #ruby
robustus|Off is now known as robustus
<athan>
I'm getting an "UnknownHost" error... is there some kind of cache I need to refresh?
<pontiki>
Brain: Pinky, Are you thinking what I'm thinking?
<pontiki>
I think so, Brain, but why would anyone want to see Snow White and the Seven Samurai?
rshetty has joined #ruby
alem0lars has quit [Quit: AFK..]
Wolland has joined #ruby
* Hanmac
raises hand "i would"
HelperW_ has quit [Remote host closed the connection]
alem0lars has joined #ruby
skammer3 has joined #ruby
HelperW_ has joined #ruby
bascht has joined #ruby
<pontiki>
actually, so would i...
bMalum has joined #ruby
ghr has joined #ruby
Wollan___ has quit [Ping timeout: 240 seconds]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Hanmac>
yeah ... and then let TimBurton do it ;P
<pontiki>
whoa
<pontiki>
now we are TALKING
Wolland_ has joined #ruby
elaptics`away is now known as elaptics
AFKGeek has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
skammer3 has quit [Ping timeout: 272 seconds]
emocakes__ has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
Wolland has quit [Ping timeout: 240 seconds]
emocakes has quit [Ping timeout: 245 seconds]
alem0lars has quit [Quit: AFK..]
justinmburrous has quit [Remote host closed the connection]
alem0lars has joined #ruby
lsmola has joined #ruby
ocx has joined #ruby
Scotteh_ has quit [Quit: Later, folks]
kyb3r_ has quit [Read error: Connection reset by peer]
Akagi201 has joined #ruby
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Musashi007 has quit [Quit: Musashi007]
<ocx>
hi so i have <MOH width="200" height="100" data="http://www.moh.com allown></MOH> i would like to extract the htto addrss from this, best way to do it?
jonmorehouse has quit [Ping timeout: 260 seconds]
startupality has joined #ruby
bal has quit [Read error: Connection reset by peer]
<pontiki>
i'm not sure if schemes needs to be an array or not
hiyosi has joined #ruby
<pontiki>
might try it and see
<pontiki>
oh, you need a comma between them, as well
<ocx>
yea
Wolland_ has joined #ruby
Wolland__ has joined #ruby
timonv_ has quit [Ping timeout: 245 seconds]
<pontiki>
the extract isn't parsing that, it's just looking for things that look like URLs. if you need a bit more intelligence with your string, go with either oga or nokogiri
<jhass>
Nokogiri::HTML(myvar).at('moh')['data'] # much safer, URI.extract sucks
<jhass>
it's correct but not smart
<pontiki>
4am
<pontiki>
i'm out
Wolland has quit [Ping timeout: 240 seconds]
<jhass>
sleep well!
<pontiki>
doubt it :(((
<pontiki>
but will try
<jhass>
good
bMalum has quit [Quit: bMalum]
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
jusmyth has joined #ruby
hiyosi has quit [Ping timeout: 272 seconds]
Wolland_ has quit [Ping timeout: 240 seconds]
benlieb has quit [Quit: benlieb]
kaspertidemann has quit []
narcan has joined #ruby
Wolland__ has quit [Remote host closed the connection]
dawkirst has quit [Remote host closed the connection]
AndChat| has quit [Ping timeout: 240 seconds]
jaznow has joined #ruby
yetanotherdave has quit [Ping timeout: 246 seconds]
kaspertidemann has joined #ruby
dawkirst has joined #ruby
dawkirst has quit [Remote host closed the connection]
lolmaus__ has joined #ruby
startupality has joined #ruby
lolmaus_ has quit [Ping timeout: 240 seconds]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
kamilc__ has joined #ruby
mkaesz has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
GriffinHeart has joined #ruby
startupality has quit [Client Quit]
alem0lars has quit [Quit: AFK..]
andrewlio has joined #ruby
alem0lars has joined #ruby
startupality has joined #ruby
AlSquire has joined #ruby
sevenseacat has quit [Remote host closed the connection]
Advocation has quit [Quit: Advocation]
dawkirst has joined #ruby
narcan has joined #ruby
hidek_ has joined #ruby
hidek_ has left #ruby ["Leaving..."]
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hobogrammer has quit [Ping timeout: 272 seconds]
phutchin1 has joined #ruby
ctp has joined #ruby
nerium has quit [Quit: nerium]
<ocx>
jhass: URL = Nokogiri::HTML(parsedText[targetKey]).at('moh')['http'] draws an exception
<jhass>
ocx: aha
mindlessdemon has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
sorry, don't work for the NSA (hi buddies!), so can't see your screen
Advocation has joined #ruby
mindlessdemon has joined #ruby
ctp has quit [Ping timeout: 272 seconds]
phutchin1 has quit [Ping timeout: 272 seconds]
skammer3 has joined #ruby
Advocation has quit [Client Quit]
ARCADIVS has quit [Ping timeout: 260 seconds]
Cort3z has joined #ruby
froggy has joined #ruby
froggy is now known as Guest99532
SqREL___________ has joined #ruby
<ocx>
jhass: it actually works but returns nothing
<jhass>
same answer
<jhass>
detail your input properly or give me a reproducing example I can run on my computer
<jhass>
for example you changed the attribute to http there
froggy_ has quit [Ping timeout: 244 seconds]
<jhass>
which indicates the example input you gave earlier has basically nothing to do with what you're actually using
skammer3 has quit [Ping timeout: 250 seconds]
govg has quit [Quit: leaving]
<ocx>
i actually need to use it on different data
govg has joined #ruby
SqREL___________ has quit [Ping timeout: 258 seconds]
SqREL___________ has joined #ruby
nerium has joined #ruby
<jhass>
ocx: can you at least detail on how you'd expect any of us to magically know what the right query for your real data would be?
tvw has joined #ruby
Takle has quit [Read error: Connection reset by peer]
Takle has joined #ruby
thomasxie has joined #ruby
bMalum has joined #ruby
skammer3 has joined #ruby
kate_r has joined #ruby
kate_r has quit [Client Quit]
dawkirst has quit [Remote host closed the connection]
sandelius has joined #ruby
<shevy>
ocx you must provide the source code + error you get + how you invoke it
<shevy>
usually it is best to isolate the problem to the smallest reproducible component
krisquigley has joined #ruby
Pumukel has joined #ruby
bMalum has quit [Quit: bMalum]
RyanV has joined #ruby
timonv_ has joined #ruby
Cort3z has quit [Ping timeout: 246 seconds]
krisquigley has quit [Ping timeout: 240 seconds]
dawkirst has joined #ruby
hiyosi has joined #ruby
joonty has joined #ruby
dx7 has joined #ruby
qba73 has quit [Remote host closed the connection]
ocx has quit [Quit: Dead]
Liendre has joined #ruby
<Liendre>
hello
pdais has joined #ruby
timonv_ has quit [Ping timeout: 245 seconds]
qba73 has joined #ruby
Takle has quit [Remote host closed the connection]
Spami has quit [Ping timeout: 272 seconds]
<jhass>
hi
v0n has quit [Quit: WeeChat 1.0]
hiyosi has quit [Ping timeout: 258 seconds]
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dx7 has quit [Ping timeout: 258 seconds]
Takle has joined #ruby
willgo has joined #ruby
Cort3z has joined #ruby
Spami has joined #ruby
<Cort3z>
Does anyone know if it is possible to compile ruby for osx and include openssl and other dependencies within the ruby itself (no external dependencies)?
arup_r has joined #ruby
<Hanmac>
Cort3z: hm why do you want to do that?
<Cort3z>
I have a built a portable Ruby, and I want to be able to use SSL when moving the package about
kristofferR has joined #ruby
thsig has joined #ruby
<Hanmac>
hm it might be possible but that would be very VERY ugly ... and osx would it make even more ugly
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<Cort3z>
yeah.. I am aware. I can be ok with a little ugly, as long as it works
phutchins has quit [Ping timeout: 250 seconds]
mijicd has quit [Remote host closed the connection]
lolmaus has joined #ruby
fabrice31 has quit [Remote host closed the connection]
<emocakes__>
shevy!
<emocakes__>
meinle
<emocakes__>
* mein liebling!!
thsig_ has joined #ruby
phutchins has joined #ruby
mijicd has joined #ruby
Spami has quit [Ping timeout: 272 seconds]
alem0lars has quit [Quit: AFK..]
lolmaus__ has quit [Ping timeout: 240 seconds]
thsig has quit [Ping timeout: 245 seconds]
Aaaal has joined #ruby
Sharker_ has joined #ruby
alem0lars has joined #ruby
Sharker has quit [Remote host closed the connection]
nettoweb has joined #ruby
sandelius has joined #ruby
justinmburrous has joined #ruby
Sharker has joined #ruby
Sharker_ has quit [Ping timeout: 264 seconds]
<shevy>
hey emocakes__
<emocakes__>
how are you babe?
Interpolex has quit [Ping timeout: 260 seconds]
justinmburrous has quit [Ping timeout: 272 seconds]
tlarevo_ has joined #ruby
jusmyth has left #ruby [#ruby]
sepp2k has joined #ruby
tlarevo has quit [Ping timeout: 245 seconds]
nfk has joined #ruby
<shevy>
tired!
fabrice31 has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
dawkirst has quit [Remote host closed the connection]
mindlessdemon has quit [Ping timeout: 245 seconds]
<charliebr73>
I also did lynda.com courses on Ruby and then Rails. They are very good.
qba73 has quit [Remote host closed the connection]
<charliebr73>
You can also explore some projects from GitHub, fork a couple and then experiment with them
<Liendre>
yes i know lynda. they are good .
<Hanmac>
Liendre: my suggestion learn ruby before rails ... otherwise it might confuse you to much
cajone has quit [Remote host closed the connection]
<charliebr73>
Read through the project, check the way projects are organised, how different developers organise their classes, methods, etc
<Liendre>
thanks Hanmac , I am planning to do so. Ruby and then RoR. I think I like more Rubu but I see job opportunities on Ror.
mindlessdemon has joined #ruby
<Liendre>
I will save and check your three links charliebr73 , thanks
mindlessdemon has quit [Max SendQ exceeded]
<charliebr73>
I agree Hanmac. Learning Ruby first will help you understand how Rails works backstage.
qba73 has joined #ruby
arup_r has quit [Ping timeout: 272 seconds]
phutchins has quit [Ping timeout: 272 seconds]
Morkel has joined #ruby
<charliebr73>
And keep practising.
yfeldblum has joined #ruby
mindlessdemon has joined #ruby
mindlessdemon has quit [Max SendQ exceeded]
mindlessdemon has joined #ruby
mindlessdemon has quit [Max SendQ exceeded]
<Hanmac>
otherwise you might think AS features like "blank?" or similar are available in ruby itself too
phutchins has joined #ruby
Rollabunna has quit [Remote host closed the connection]
<charliebr73>
Also, not for now but for the future, explore other Ruby frameworks, such as Sinatra. Don't restrict yourself to Rails only.
<Liendre>
I like the idea of just copying code. I think I can learn a lot of just copying and realizing later what does it do.
<sevenseacat>
Liendre: that sounds like a terrible idea.
<charliebr73>
Copying helps with memorising syntax, not understanding it
<Liendre>
sevenseacat, oh. I was thinking one nice method to learn new languajes for other countries i mean
<charliebr73>
You need to learn how things fit together. Copying only will not teach you that.
<Liendre>
but it doesnt have to be the same
<Liendre>
ok ok charliebr73
<Liendre>
thanks for the advice
arup_r has joined #ruby
<charliebr73>
Besides, copying will show you only how ONE developer works with Ruby. There are many ways to achieve the same result
<Liendre>
exploring github will do the kob
<Liendre>
job*
<charliebr73>
:)
codenoob_ has joined #ruby
<Liendre>
it is hard the start. Like you are blind and cant move at all
cajone has joined #ruby
<codenoob_>
How do I delete or update posts ? I created a post and it displayed fine when I deleted the post from _post folder and re added with some changes now it is not shown anywhere -- talking about jekyll here
imastef has joined #ruby
yfeldblum has quit [Ping timeout: 258 seconds]
<tobiasvl>
codenoob_: what's a post?
<charliebr73>
Well, you can't run if you don't know how to walk first. =oP
<tobiasvl>
codenoob_: doesn't jekyll have its own channel?
<tobiasvl>
codenoob_: this is a channel for the ruby programming language, not the myriad of projects programmed in ruby :P
pskosinski has joined #ruby
<codenoob_>
Nobody is active there
SqREL___________ has joined #ruby
<charliebr73>
Ruby is conquering the world! >.<
apeiros has joined #ruby
<Liendre>
there are 888 users here. It is a good channel
<Hanmac>
apeiros: is back in the house ;P
<tobiasvl>
yeah, this is a great channel… about the ruby programming language
<sevenseacat>
'i know im asking in the wrong place, but answer my question anyway'
lolmaus has joined #ruby
<Liendre>
elaptics, Do you like it more than Codeschool?
emrox has joined #ruby
ctp has joined #ruby
<elaptics>
Liendre: I've never used codeschool. I've seen a few lessons from makeitwithcode and was quite impressed with the way they present it. It's made so that you create some practical things and forces you to learn how to do it but they also provide help as you do the course
<elaptics>
Liendre: I helped to run a seminar at the weekend where they did a few of the early lessons and it was well received
IceDragon has joined #ruby
<sevenseacat>
i only did one course at codeschool (the ember one) and i didnt get much from it.
lolmaus__ has quit [Ping timeout: 240 seconds]
<elaptics>
If I were learning now I think the makeitwithcode way would have suited me as someone who learns best by doing
<charliebr73>
Bottom line is, there are many resources to teach out Ruby out there. You just need to find one that suits your.
lolmaus_ has joined #ruby
<Liendre>
It is good elaptics but money talks. I will spend money when I get more knowledge so I can be sure it is well used.
willgo has quit [Remote host closed the connection]
<charliebr73>
For example, there are loads of youTube videos teaching the same topic but in completely different ways.
hiyosi has joined #ruby
jasooon has joined #ruby
<Liendre>
yes charliebr73 , there many. But I found Michael Hartl ror book and it is perfect for me. I was hoping to find something similar for plain ruby.
<charliebr73>
:)
<elaptics>
Liendre: all depends how you value your time :)
<Liendre>
but thanks for your help to all
<Liendre>
elaptics, my time is gold, saddly.
<Liendre>
I will think about all of this.
lolmaus has quit [Ping timeout: 240 seconds]
justinmburrous has joined #ruby
<shevy>
Liendre ultimately the only way to learn ruby is to write lots and lots of ruby code
lw has joined #ruby
shredding has joined #ruby
paulfm has joined #ruby
Paul_McFreely has joined #ruby
uber has quit [Changing host]
uber has joined #ruby
fgo has quit [Remote host closed the connection]
jasooon has quit [Ping timeout: 260 seconds]
ponga has joined #ruby
<ponga>
hi ruby
monkeypatch has joined #ruby
YamakasY has joined #ruby
kobain has joined #ruby
<YamakasY>
hi guys
<YamakasY>
I'm trying to find a way if a directly hold files and doesn't check . and .. but .hidden, is this a way to ? http://pastebin.com/FY2ZRNUP
mxrguspxrt has quit [Remote host closed the connection]
Tricon has quit [Quit: Leaving...]
<tobiasvl>
YamakasY: couldn't you just check if Dir.glob('*').empty?
sumark_ has quit [Remote host closed the connection]
lxsameer has quit [Read error: No route to host]
bMalum has quit [Quit: bMalum]
<tobiasvl>
YamakasY: it matches anything that doesn't start with a . (unless you also pass File::FNM_DOTMATCH)
<YamakasY>
tobiasvl: yes but that crawles also large folders
<tobiasvl>
YamakasY: it won't traverse subdirectories though, will it? not without "**"? what do you mean by "crawles also large folders"
rshetty has quit [Remote host closed the connection]
lolmaus__ has joined #ruby
thsig_ has quit [Remote host closed the connection]
fantazo has joined #ruby
emiemia has quit []
Rollabunna has joined #ruby
lolmaus_ has quit [Ping timeout: 240 seconds]
justinmburrous has quit [Remote host closed the connection]
<YamakasY>
tobiasvl: ok, sorry phone :)
ffranz has joined #ruby
bMalum has joined #ruby
codenoob_ has quit [Quit: Page closed]
bmurt has joined #ruby
<YamakasY>
tobiasvl: just make that the if ?
Darryl has joined #ruby
<tobiasvl>
YamakasY: I dunno. if it does what you want it to, then sure
fsapo has joined #ruby
grenierm has joined #ruby
<YamakasY>
tobiasvl: I need to do something in a puppet manifest like if file_exists ("/etc/somedir") >= 1
<YamakasY>
{}
<tobiasvl>
if file_exists >= 1
<tobiasvl>
uh
<tobiasvl>
isn't that a boolean
mastr_bennett[x] has joined #ruby
mastr_bennett[x] has quit [Client Quit]
Xeago has quit [Remote host closed the connection]
<YamakasY>
tobiasvl: uhm, yeah I'm not that good :) I can better return true
zorak__ has quit [Ping timeout: 240 seconds]
mindlessdemon has joined #ruby
mindlessdemon has quit [Max SendQ exceeded]
mindlessdemon has joined #ruby
mindlessdemon has quit [Client Quit]
andrewlio has quit [Quit: Leaving.]
arrnas has joined #ruby
qmfnp has joined #ruby
Hanmac has quit [Ping timeout: 272 seconds]
twohlix has joined #ruby
peteretep has joined #ruby
<peteretep>
CPAN has automated static code quality metrics that run over all distributions and are published; has someone seen anything similar for Ruby Gems?
charliebr73 has quit [Quit: Leaving]
Kricir has joined #ruby
bMalum has quit [Quit: bMalum]
coderdad has joined #ruby
grenierm has left #ruby [#ruby]
bMalum has joined #ruby
cpruitt has joined #ruby
pastry has joined #ruby
<pastry>
In "duplicate.send(association).send(:<<associated_object)", what would that ":<<" be? I've never seen that before
<pastry>
it looks like a clever shortcut to capture something anonymously and push an object onto it
<apeiros>
pastry: it'd be a syntax error
TJT is now known as celend
otherj has joined #ruby
tessi is now known as tessi_zz
<apeiros>
that's not valid ruby pastry. make sure you paste valid ruby. did you mean `.send(:<<, associated_object)` ?
<pastry>
apeiros: thanks, I'm not really used to ruby and I'm trying to parse this code
<pastry>
mmmh, let's see
<arrnas>
hey guys, i'm a bit confused about instance and class variables, instances = variable for all instances of the class, class = variable shared with all instances of the class and instances of its subclasses?
dblessing has joined #ruby
<arrnas>
instance =*
<apeiros>
arrnas: and a bit more. yes
<pastry>
what would that if it was like that mean? it's still obscure to me
<pastry>
apparently I'm also writing horrible obscure sentences now
<apeiros>
shared with class, instances of class, subclasses, instances of subclasses. and it gets a lot more fun with modules. my advice is to avoid them since most people simply don't really understand how it works.
mattstratton has joined #ruby
yfeldblum has joined #ruby
<apeiros>
pastry: :<< is a symbol. at this point, think of a symbol as a slightly special string, e.g. "<<" (which would work there too)
iamjarvo has joined #ruby
<apeiros>
it's one of the two arguments passed to the method `send`
<pastry>
ah, got it!
<pastry>
wouldn't have believed that << could be a symbol
<apeiros>
<< is not a symbol
<arrnas>
apeiros: but what's the use case for class variables, seems like a static variable with some magic to share it around
<apeiros>
:<< is
<pastry>
:<< I mean
<pastry>
yeah, I though it only worked with alphanums
<pastry>
thank you
<apeiros>
arrnas: the use case is when you need to share data between said entities
<apeiros>
pastry: every valid method name can be used as a symbol without quotes
<apeiros>
pastry: and with quotes, about everything is valid
<YamakasY>
I need to be able to check /my/path but would like to do file_exists(/my/path)
fgo has joined #ruby
freezey has quit [Remote host closed the connection]
devdazed has joined #ruby
Advocation has joined #ruby
<volty>
fast instructions on removing shims altogether ?
<Hanmac>
volty what are you trying to build? if you make an extension ruby does set the paths for you, if you try to include ruby itself into your stuff, use pkg-config
jasooon has joined #ruby
<volty>
Hanmac: an extension for qtruby (and else), in local, no pkg-configs
Dreamer3 has joined #ruby
<Hanmac>
what do you mean "in local"?
<volty>
I just need the right ruby.h header. So I am going to get read of shims & other funnies (I do not switch anyway)
<volty>
local compiling, for personal use, for personal apps to be packed & distrib in own manner
fgo has quit [Ping timeout: 258 seconds]
oozzal has joined #ruby
freezey has joined #ruby
<Hanmac>
volty: if you mean "/usr/local" then it has its own pkg-config
jasooon has quit [Ping timeout: 244 seconds]
iamjarvo has quit [Read error: No route to host]
iamjarvo has joined #ruby
oozzal has quit [Client Quit]
yeticry has quit [Ping timeout: 260 seconds]
<ducklobster>
apeiros: I am defining a method in my MainClass that will be passed down to an instance of ExtraClass and it uses methods only available in ExtraClass, which is causing errors
<volty>
Hanmac: I need to compile and link, before placing in /usr/local. I am talking about the necessary ruby header to do it, without going crazy on getting the respective source and placing it & adding include paths.
<ducklobster>
apeiros: I can fix this by wrapping my method in a Proc and passing that down but is there a way to just define in the method without it throwing errors about unknown methods?
enebo has joined #ruby
freerobby has joined #ruby
rippa has joined #ruby
iamjarvo has quit [Client Quit]
yeticry has joined #ruby
phao_ has quit [Quit: Leaving]
<apeiros>
ducklobster: I can't make sense of your description, sorry. can you make a reproducable example and gist it?
noop has joined #ruby
<ducklobster>
apeiros: sure
<apeiros>
also, what's wrong with wrapping it in a proc?
<Hanmac>
volty: if you make a extension for ruby, use mkmf or similar for the paths
Xeago has quit [Remote host closed the connection]
fijimunkii has joined #ruby
<volty>
Hanmac: I just need the right ruby header files, no need for mkmf (that anyway cannot produce it on-fly)
rismoney1 has quit [Ping timeout: 260 seconds]
<Hanmac>
without asking ruby you never cant get the right header or include dirs, because the header might be installed with multiarch
linojon_ has joined #ruby
<Hanmac>
volty: just look at the use-case building an extension is perfect for mkmf and (most) ruby does ship it, you very need to rethink why you cant use it
<volty>
Hanmac: one step at time, I have other things to think at.
linojon has quit [Ping timeout: 260 seconds]
linojon_ is now known as linojon
phantummm has joined #ruby
W0rmDr1nk has quit [Ping timeout: 244 seconds]
<volty>
I'll try to switch to ruby -2, since that one has header installed. Thx!
icebourg has joined #ruby
roolo has quit [Read error: Connection reset by peer]
lukevinc has joined #ruby
roolo has joined #ruby
<Hanmac>
volty: ah i think the problem it seems that you do not have the -dev packages installed
qba73 has quit [Remote host closed the connection]
<ducklobster>
apeiros: reason for not wrapping in a Proc is just that I think the nonProc version is cleaner and if possible to avoid it I would prefer it
schaerli has quit [Ping timeout: 250 seconds]
<apeiros>
ducklobster: that's not reproducable. I can't take this code and run it.
Dreamer3 has quit [Remote host closed the connection]
<apeiros>
and your proc won't have an issue because the code in it is not being executed
<apeiros>
at least not in your example
fsapo has quit [Ping timeout: 250 seconds]
twohlix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
claw_ has joined #ruby
linojon_ has joined #ruby
claw has quit [Ping timeout: 244 seconds]
arup_r has joined #ruby
<ducklobster>
apeiros: sorry, i tried to strip out some things to focus on the problem
lukevinc has quit [Quit: ChatZilla 0.9.91 [Firefox 24.8.0/20000101000000]]
<ducklobster>
apeiros: I think i'll just go with the Proc way, thanks for the help though
linojon has quit [Ping timeout: 244 seconds]
linojon_ is now known as linojon
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qba73 has joined #ruby
Dreamer3 has joined #ruby
Dreamer3 has quit [Client Quit]
coderdad has quit [Remote host closed the connection]
hamakn has quit [Remote host closed the connection]
aizu has joined #ruby
fgo has joined #ruby
bal has quit [Quit: bal]
ringarin has quit [Read error: Connection reset by peer]
jusmyth has quit [Quit: Leaving.]
oo_ has quit [Remote host closed the connection]
Soda has joined #ruby
coderdad has joined #ruby
twohlix has joined #ruby
aizu has quit [Ping timeout: 260 seconds]
AFKGeek has quit [Quit: Leaving]
yfeldblum has joined #ruby
fgo has quit [Ping timeout: 272 seconds]
Dreamer3 has joined #ruby
hfp has quit [Ping timeout: 272 seconds]
Dreamer3 has quit [Max SendQ exceeded]
Dreamer3 has joined #ruby
Takle has quit [Remote host closed the connection]
rshetty has joined #ruby
hfp has joined #ruby
mastr_bennett[x] has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
IrishGringo has joined #ruby
rshetty has quit [Remote host closed the connection]
v0n has joined #ruby
krisquigley has joined #ruby
endash has joined #ruby
linojon_ has joined #ruby
yfeldblum has quit [Ping timeout: 244 seconds]
ahhMichael has joined #ruby
linojon has quit [Ping timeout: 260 seconds]
linojon_ is now known as linojon
Danibal has joined #ruby
ki0 has quit [Remote host closed the connection]
ht__th has quit [Remote host closed the connection]
ki0 has joined #ruby
timonv_ has joined #ruby
krisquigley has quit [Ping timeout: 240 seconds]
ht__th has joined #ruby
pdais has quit [Quit: Leaving.]
Takle has joined #ruby
pwh has joined #ruby
Dreamer3 has quit [Quit: Leaving...]
Dreamer3 has joined #ruby
ht__th has quit [Remote host closed the connection]
echevemaster has joined #ruby
Cichol has quit [Ping timeout: 260 seconds]
joonty has quit [Ping timeout: 240 seconds]
ereslibre has quit [Quit: No Ping reply in 180 seconds.]
ereslibre has joined #ruby
chrishough has joined #ruby
ht__th has joined #ruby
joonty has joined #ruby
thsig has joined #ruby
freezey has quit [Remote host closed the connection]
justinmburrous has joined #ruby
klaut has joined #ruby
timonv_ has quit [Remote host closed the connection]
agrinb has joined #ruby
noop has quit [Ping timeout: 246 seconds]
aspires has joined #ruby
olivier_bK has quit [Ping timeout: 245 seconds]
timonv_ has joined #ruby
sevenseacat has quit [Remote host closed the connection]
phao has joined #ruby
treehug88 has joined #ruby
slester has joined #ruby
freezey has joined #ruby
freezey has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
thsig has quit [Ping timeout: 272 seconds]
justinmburrous has quit [Ping timeout: 272 seconds]
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has quit [Quit: zzz]
thsig has joined #ruby
Kricir has joined #ruby
ctp has joined #ruby
ndrei has quit [Ping timeout: 272 seconds]
mattstratton has joined #ruby
rkalfane has joined #ruby
Akagi201 has quit [Ping timeout: 246 seconds]
spyderman4g63 has joined #ruby
freezey has joined #ruby
Kricir has quit [Read error: Connection reset by peer]
Kricir_ has joined #ruby
ctp has quit [Client Quit]
HelperW__ has joined #ruby
jasooon has joined #ruby
fabrice31 has quit [Remote host closed the connection]
<axilla>
afternoon all, i'm working with an API integrate the importing of images from instagram into our app. anyone have any tips on cacheing the images temporarily while the user browses through and selects the ones they want to import into our system? I'm thinking I don't want to have to make another call to the API everytime I want to do something(i.e. search or pagination)
ghostmoth has joined #ruby
jonathanwallace has quit [Quit: ZNC - http://znc.in]
ereslibre has quit [Quit: No Ping reply in 180 seconds.]
fgo has joined #ruby
<axilla>
i want to call the images just once and then work with them for all of my actions afterwards.
zorak__ has joined #ruby
ereslibre has joined #ruby
ereslibre has joined #ruby
zorak__ has quit [Remote host closed the connection]
neoxquick has joined #ruby
zorak8 has joined #ruby
fgo has quit [Read error: No route to host]
cndiv has joined #ruby
fgo has joined #ruby
alem0lars has quit [Quit: AFK..]
Channel6 has quit [Quit: Leaving]
otherj has quit []
kamilc__ has quit [Quit: Leaving...]
finisherr has joined #ruby
yfeldblum has quit [Ping timeout: 244 seconds]
pwh has quit [Read error: Connection reset by peer]
<finisherr>
Let’s say I have thre threads doing some work. Eventually, each thread will want to print a whole lot to the console. How can I do this without having each thread trying to print to stdout at the same time. Do I lock stdout somehow?
maestrojed has joined #ruby
<waxjar>
you could put whatever they try to print on a queue
rshetty has joined #ruby
<apeiros>
finisherr: get a fourth thread. pipe the output into a queue. let the fourth thread process that queue.
<waxjar>
and either empty the queue at the end or empty it from the main thread
<finisherr>
ok
joonty has quit [Quit: Leaving]
thagomizer has joined #ruby
fgo has quit [Ping timeout: 272 seconds]
silkfox has quit [Ping timeout: 258 seconds]
Hightower660 has joined #ruby
braincrash has quit [Ping timeout: 258 seconds]
cherwin has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hamakn has joined #ruby
spyderman4g63 has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
braincrash has joined #ruby
jimmyhoughjr has joined #ruby
pwh has joined #ruby
<eam>
the stdio layer already has a mutex around access
<eam>
that's part of why printf and so on isn't reentrant
hamakn has quit [Ping timeout: 240 seconds]
<apeiros>
eam: sure. but it doesn't ensure e.g. a puts being in one piece.
andikr has quit [Remote host closed the connection]
Takle has quit [Remote host closed the connection]
* apeiros
has seen puts split up text and newline in threaded env
<eam>
does puts split input into multiple calls?
* eam
checks
schaerli has joined #ruby
<waxjar>
yeah, i've also seen interleaved output
Tomme has joined #ruby
spyderman4g63 has quit [Ping timeout: 272 seconds]
zorak8 has quit [Ping timeout: 246 seconds]
bluenemo has joined #ruby
shredding has quit [Quit: shredding]
Channel6 has joined #ruby
IrishGringo has quit [Ping timeout: 245 seconds]
tokik has quit [Ping timeout: 244 seconds]
Hobogrammer has joined #ruby
<eam>
well that's interesting, for sufficiently large buffers ruby does a tiny (and afaict unnecessary) write after one single large write
michaeldeol has joined #ruby
Xiti has joined #ruby
Takle has joined #ruby
jobewan has joined #ruby
mattstratton has joined #ruby
emanu has joined #ruby
michaeldeol has quit [Client Quit]
douglasssssss has joined #ruby
<eam>
and it depends on whether the buffer is a power of two hmmmmhmmmm
dawkirst has joined #ruby
<eam>
lame
dawkirst has quit [Remote host closed the connection]
ryanleesipes has joined #ruby
<eam>
puts "a" * (2**16-1) => write(64512); write(1024)
silkfox has joined #ruby
<eam>
puts "a" * (2**16) => write(65536); write(1)
michaeldeol has joined #ruby
<eam>
well, it doesn't have to be that way
<eam>
one of the best features of unix i/o are the provisions for interleaving writes without doing your own locking
alem0lars has joined #ruby
siwica has joined #ruby
<eam>
#write should get around this problem
<epitron>
haha! weird
<epitron>
what the hell, ruby?
dx7 has quit [Remote host closed the connection]
imastef has quit [Quit: imastef]
<waxjar>
maybe it so the GIL won't be for taken too long?
chthon has quit [Ping timeout: 245 seconds]
Tomme has quit [Ping timeout: 245 seconds]
<epitron>
so you think it's checking what the buffer size is for the FD, and making the write fill it up?
ktun has joined #ruby
<waxjar>
i have no idea :p
<eam>
I'm just observing behavior with strace -ewrite; not sure why yet
<epitron>
running strace on ruby is always scary
<epitron>
ruby does a lot of weird things
<eam>
eh not really:P
teddyp1cker has joined #ruby
<epitron>
try "strace ruby -r<any gem> -e 1" :D
Liendre has quit [Read error: Connection reset by peer]
Scotteh has joined #ruby
<epitron>
compare to "strace python -c 'import anything'"
stunder has joined #ruby
<eam>
oh agreed, ruby is super noisy
fsapo has joined #ruby
<epitron>
i don't mind noise, but excessive filesystem access for no reason is kinda bad
emrox has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goodenough has joined #ruby
lkba has joined #ruby
baroquebobcat has joined #ruby
centrx has quit [Quit: The plan is programmed into every one of my one thousand robots]
<yxhuvud>
why do you think it is for no reason? There are no cache or other system to dictate where something should be found, so it has to look in the whole search path
andrewlio has quit [Quit: Leaving.]
kinduff has joined #ruby
benlieb has joined #ruby
yakko has joined #ruby
bobishh has quit [Ping timeout: 260 seconds]
zorak8 has joined #ruby
roolo has quit [Remote host closed the connection]
bricker`LA has quit [Ping timeout: 272 seconds]
merqlove has quit [Quit: Connection closed for inactivity]
<epitron>
it does that for every thing that gets required
pwh has quit []
<epitron>
meaning that it stats /home about 5 million times
Soda has quit [Remote host closed the connection]
<epitron>
or /usr in this case
MCDev has joined #ruby
ephemerian has quit [Quit: Leaving.]
skammer3 has quit [Ping timeout: 260 seconds]
<yxhuvud>
ok, that seems a bit excessive.
schaerli has quit [Ping timeout: 260 seconds]
<waxjar>
sounds like it's worth an issue at least
<epitron>
heh
<epitron>
i can't remember if i filed it already
<eam>
stat spam is a common problem, stuff calls access() before open(), etc
Wolland has quit [Ping timeout: 250 seconds]
alex88 has quit [Quit: Leaving...]
roolo has quit [Ping timeout: 260 seconds]
mpistone has joined #ruby
Nova_ has joined #ruby
jasooon has quit [Ping timeout: 272 seconds]
emocakes__ has quit []
<eam>
hm, ruby 2.x appears to do a single write() for the data, but sends a second write "\n" after
<epitron>
oh, maybe that's so it doesn't have to realloc the string
<epitron>
appending to the buffer would require allocating new memory
<eam>
yeah
<eam>
that's different than 1.8 (which is what I was looking at before)
frozenfoxx has left #ruby [#ruby]
bwilson has joined #ruby
<eam>
logic is: for arg, write() each arg, write \n
nisstyre has quit [Ping timeout: 260 seconds]
<epitron>
anyhow, wc -l for strace is 3100 for requiring a gem, and 948 for not requiring a gem
<epitron>
meaning it takes ~2000 system calls to require a gem :)
<eam>
anyway, use #write to avoid this if you want
<epitron>
most of them lstat/open
<eam>
gem is a package loading system on top of a package loading system
<epitron>
this is an exponential problem too -- the more gems you have, the worse it gets
linguini has joined #ruby
iceden has quit [Read error: Connection reset by peer]
HelperW__ has joined #ruby
<epitron>
i think ruby could kill most of that stat spam by checking for the most common case when you do "require 'gemname'", which is to see if "gemname-<latest version>/lib/gemname.rb" exists
<epitron>
that's one stat! :)
<epitron>
(i mean, you know, after checking the path)
nisstyre has joined #ruby
tessi is now known as tessi_zz
ndrei has joined #ruby
<eam>
or we could just go back to using $: and ignore the whole gem filesystem structure
Pumukel has quit [Ping timeout: 272 seconds]
jcdesimp has quit [Remote host closed the connection]
<epitron>
that... what? :)
<epitron>
how is that a solution?
niftylettuce has joined #ruby
<eam>
it removes the work ruby is doing in the strace you pasted!
HelperW__ has quit [Ping timeout: 260 seconds]
<epitron>
i'm just trying to make startup time faster
Nova_ has quit [Killed (idoru (Spam is off topic on freenode.))]
ki0 has quit [Ping timeout: 240 seconds]
<eam>
yeah me too
<epitron>
right, but you're being a dick about it
<eam>
and the entire structure of gem is fundamentally the issue
<eam>
why is that me being a dick?
deric_skibotn has joined #ruby
<epitron>
because you're throwing out the baby with the bathwater
<eam>
it's an ugly baby ...
<epitron>
i mean, we could redesign rubygems
<eam>
seriously, everything gets better with $:
<epitron>
make it a better system
<eam>
everyone bundles anyway. All I want is to push GEM_HOME as a SINGLE directory on the front of $:
rshetty has quit [Remote host closed the connection]
<epitron>
so, you're saying to add every single gem to the path?
nisstyre has quit [Quit: WeeChat 1.0.1]
Darryl has quit [Quit: Connection closed for inactivity]
<eam>
epitron: are you familiar with both the gem codepath and the $: codepath?
<epitron>
or are you saying to unpack gemname-<version>/lib/ to gem/, so you don't need all that gemspec crap?
Asher has joined #ruby
<epitron>
eam: codepath? do you mean, the gem directories?
yfeldblum has joined #ruby
<eam>
I mean the code that traverses and loads from there yes
p0sixpscl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<epitron>
oh, you're asking if i've looked at the monkeypatched require?
<epitron>
yeah, i have
<epitron>
i actually rewrote it to make it cache all the gem files so it doesn't have to stat as much
<epitron>
it cut load time by a half
<eam>
I'm saying it'd be better to do it like it was done before gem: put the .rb files under $:; traverse $: in order; load the first hit
dawkirst has joined #ruby
<eam>
if you want to do multiple versions or local installs, you do that and you push the directory to the front of $:
<epitron>
that sounds like an exponential problem too
<eam>
the runtime on fetching a record from sqlite is fine
<epitron>
i'm guessing there's a complex initialization step when you load the DB as well :)
<epitron>
it was slow, is my point
<eam>
there really isn't, it's less than the cost of a few stat() calls either way
<epitron>
sigh
<eam>
this is beside the point
<eam>
sdbm is fine too
jbueza has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lukevinc has quit [Quit: ChatZilla 0.9.91 [Firefox 24.8.0/20000101000000]]
<epitron>
all the gemspecs was the other issue. instead of loading them all, i just marshalled them
claymore has joined #ruby
<epitron>
i stopped at trying to monkeypatch rubygems though
lw has joined #ruby
<epitron>
it was too complicated
tyll has joined #ruby
malkomalko has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
ixqjdx has quit [Remote host closed the connection]
<epitron>
apeiros: yeah, you're right... if one gem steals another gem's filenames, there should be some kind of warning to the author when they submit the gem
skolman_ has joined #ruby
malkomalko has quit [Client Quit]
<apeiros>
the author should be removed from the gem ecosystem entirely
mrsolo has joined #ruby
<epitron>
haha
<epitron>
it could've been a mistake :)
<apeiros>
epitron: not so much about stealing. but writing into another gem dir? that's fucked up.
momomomomo has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
<epitron>
well, i mean, that's how some extensions work, right?
deepy has joined #ruby
<epitron>
basegem/extrastuff
<apeiros>
no
hellangel7 has quit [Remote host closed the connection]
<epitron>
net/gopher? :)
iliketurtles has joined #ruby
<apeiros>
no sane extension works this way.
<apeiros>
and I haven't seen one working that way.
<epitron>
this is true
<epitron>
that isn't a good idea
blackmesa has joined #ruby
rimenes has joined #ruby
<apeiros>
they have their own files in their own structures with overlapping names.
<apeiros>
there's no *writing into another gem* happening
<epitron>
wait, are you talking about literally writing a file to another gem's directory directly? or are you talking about overlapping filename spaces?
<apeiros>
that's how I understood you
<epitron>
you're missing some context
<epitron>
we were talking about a new gem system that unpacked all the gems' lib/ dirs into one place
reisl is now known as larissa
<epitron>
so that you didn't need to stat a billion files
<apeiros>
yes, I had that. and you enumerated things which would cause problems with a potential new system.
<epitron>
ok
<apeiros>
but if I misunderstood you then all is good :)
<epitron>
it sounded like you thoguht i meant a gem was doing File.write("other gem dir")
<apeiros>
yes, that is how I understood what you said. that you were saying there were gems which actually install themselves by modifying another gem.
<epitron>
no
<apeiros>
I guess you understand why I found it horrible :D
<epitron>
just name clashes
<apeiros>
yes, I see now. different kind of beast :)
<epitron>
i could make a gem called "butts" whose lib/ contained "lib/rails"
dx7 has joined #ruby
<apeiros>
yes
<epitron>
those should be warned about too :)
yakko has quit [Read error: Connection reset by peer]
<apeiros>
gem naming conventions & requirements are bad IMO. but I don't want to start a new discussion on that :)
<epitron>
hey, why not?
<epitron>
we can fix rubygems!
<epitron>
or make a better one!
<epitron>
gemrubies.rb
<apeiros>
because I'm busy elsewhere and I doubt we can fix rubygems
mekhami has joined #ruby
yakko has joined #ruby
<epitron>
i guess it's too late once it's bundled with ruby :)
<mekhami>
what're the appropriate ways to write long lists in ruby? didn't see anything in a quick lookup for style guides
carraroj has quit [Ping timeout: 246 seconds]
<havenwood>
mekhami: longs lists of what?
<epitron>
define an array with a bunch of constant values?
<mekhami>
strings
ptrrr has joined #ruby
<mekhami>
just line length is an issue
dawkirst has quit [Remote host closed the connection]
<epitron>
(c is a syntax-highlighting + less-ing version of "cat")
<epitron>
(works on markdown)
Wolland__ has joined #ruby
Wolland has quit [Ping timeout: 240 seconds]
lw has quit [Quit: s]
havenwood has quit [Remote host closed the connection]
<epitron>
for performance, the markdown renderer is in DATA, and it evals it if it's passed a markdown file ^_^
robustus|Off has joined #ruby
robustus|Off is now known as robustus
momomomomo has joined #ruby
d[x_x]b has joined #ruby
pwh has joined #ruby
Suchit has joined #ruby
sanguisdex has joined #ruby
havenwood has joined #ruby
lolmaus_ has quit [Quit: Konversation terminated!]
fgo has joined #ruby
apeiros has quit [Ping timeout: 260 seconds]
Gendalph has quit [Ping timeout: 272 seconds]
<kinduff>
woah, data looks neat
Wolland_ has quit [Ping timeout: 260 seconds]
skolman_ has joined #ruby
Aaaal has quit [Quit: Aaaal]
wallerdev has quit [Quit: wallerdev]
volty has quit [Ping timeout: 240 seconds]
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
yakko has quit [Read error: Connection reset by peer]
skolman_ has quit [Remote host closed the connection]
michael__ has joined #ruby
Genda1ph has quit [Ping timeout: 272 seconds]
nickjj has joined #ruby
michael__ is now known as Guest40068
x1337807x has joined #ruby
skolman_ has joined #ruby
otherj has quit [Ping timeout: 272 seconds]
ctp has joined #ruby
yakko has joined #ruby
treehug8_ has joined #ruby
bayed has quit [Quit: Connection closed for inactivity]
Soda has joined #ruby
siwica has quit [Quit: siwica]
clauswitt has joined #ruby
mkaesz has joined #ruby
mary5030 has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 264 seconds]
jonmorehouse has joined #ruby
wallerdev has joined #ruby
Wolland has joined #ruby
clauswitt has quit [Client Quit]
fgo has quit [Ping timeout: 272 seconds]
treehug88 has quit [Ping timeout: 245 seconds]
dope is now known as goldman
Channel6 has quit [Quit: Leaving]
otherj has joined #ruby
rshetty has quit [Remote host closed the connection]
sailias has joined #ruby
mary5030 has joined #ruby
treehug8_ has quit [Ping timeout: 245 seconds]
kwd has quit [Quit: I'm using a Free IRC Bouncer from BNC4FREE - http://bnc4free.com/]
mkaesz has quit [Client Quit]
Wolland__ has quit [Ping timeout: 260 seconds]
megaputer has joined #ruby
yetanotherdave has joined #ruby
yetanoth1rdave has joined #ruby
tylersmith has joined #ruby
parduse is now known as Guest81569
Guest81569 has quit [Killed (sendak.freenode.net (Nickname regained by services))]
justinmburrous has quit [Remote host closed the connection]
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
parduse has joined #ruby
otherj has quit [Read error: Connection reset by peer]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
devdazed has quit [Ping timeout: 260 seconds]
yakko has quit [Read error: Connection reset by peer]
treehug88 has joined #ruby
chrishough has joined #ruby
yakko has joined #ruby
St_Marx has quit [Remote host closed the connection]
r4um has quit [Ping timeout: 272 seconds]
<cndiv>
Hi all, brand new to Ruby (and programming) and could use a little help. I'm trying to write a script that parses a CSV of data containing names and dates doors were opened in my office. Goal is to get a result like "John Doe was in the office date1, date2, date3." I've gotten pretty far, and can now get an output of the name and the unique date each name opened a door...
klaut_ has joined #ruby
<cndiv>
But what I can't figure out is how to get those results into a sortable... hash, I think?
<cndiv>
j2p2: OH, so what I'm doing is making a hash, one key (the name) and multiple values (the dates)?
<jhass>
ryannielson: what kind of script?
<cndiv>
j2p2: I didn't realize that was possible.
<toretore>
step 1: create an empty hash, 2: for each record: 2a: create an array in hash for person if it doesn't exist; 2b: add record to array
hfp__work has joined #ruby
<j2p2>
cndiv: you can do it that way, or what toretore is suggesting
<ryannielson>
jhass: It's going to be a command line script to install some stuff. I'd like to write in in Ruby instead of bash, but I don't want people with different or non-existant rubies having issues running it.
dawkirst has quit [Remote host closed the connection]
<cndiv>
j2p2 and toretore: really appreciate the help, thank you!
<j2p2>
np! :)
<jhass>
ryannielson: mmh, might be possible to do in crystal already ;) http://crystal-lang.org
<toretore>
ryannielson: not worth the trouble imo
Suchit has quit [Quit: Computer has gone to sleep.]
<toretore>
you could write a script that assumes 1.8.7 with no "advanced" dependencies like openssl or readline
<ryannielson>
toretore: Well it's either that or I make sure the user has Ruby installed so it'll work properly. Just trying to find the best way to make the users feel as little pain as possible. Considering they could be on different Distros from Ubuntu, to CentOS, to Redhat.
wallerdev has joined #ruby
phutchins has quit [Ping timeout: 272 seconds]
hfp_work has quit [Ping timeout: 260 seconds]
hfp__work is now known as hfp_work
hfp has quit [Ping timeout: 272 seconds]
tyll has quit [Ping timeout: 258 seconds]
hfp_ has joined #ruby
<j2p2>
honest (possibly stupid) question: if you were going to give the executable to people on different distros, wouldn't it have to be built on those distros anyways? or would one executable be compatible with all of them?
hfp_ is now known as hfp
ndrei has joined #ruby
kwd has joined #ruby
tyll has joined #ruby
jerius has quit []
shime has joined #ruby
benzrf|offline is now known as benzrf
shevy has quit [Read error: Connection reset by peer]
<Hanmac>
hm or you could write a script that does kick 1.8.7 in the face ;P
jerius has joined #ruby
sanguisdex has quit [Ping timeout: 272 seconds]
<eam>
almost possible
IrishGringo has joined #ruby
<eam>
give it another year
tbrock_ has joined #ruby
Tricon has quit [Ping timeout: 272 seconds]
txdv has quit [Remote host closed the connection]
havenwood has joined #ruby
<Hanmac>
good that my stuff will not work with 1.8.7 ... or maybe 1.9 probably
jasooon has joined #ruby
beneggett has joined #ruby
<eam>
unfortunate :P
TorpedoSkyline has joined #ruby
blackmesa has joined #ruby
<eam>
ruby is definitely the most fragile ecosystem of all the platforms I work in
tyll has quit [Ping timeout: 258 seconds]
tyll_ has joined #ruby
clauswitt has joined #ruby
tessi_zz is now known as tessi
spider-mario has joined #ruby
tvw has joined #ruby
jasooon has quit [Ping timeout: 260 seconds]
<ryannielson>
j2p2: Well I'm hoping I could make a Ruby script that is as cross compatiable as a bash script or something.
dideler has joined #ruby
fijimunkii has quit [Quit: leaving]
justinmburrous has joined #ruby
AlSquire has quit [Quit: This computer has gone to sleep]
kaspergrubbe has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
justinmburrous has quit [Ping timeout: 245 seconds]
krisquigley has joined #ruby
shevy has joined #ruby
bluenemo has quit [Quit: Verlassend]
skolman_ has quit [Remote host closed the connection]
wallerdev has joined #ruby
agrinb has quit [Remote host closed the connection]
alem0lars has quit [Quit: AFK..]
skolman_ has joined #ruby
agrinb has joined #ruby
ephemerian has joined #ruby
benzrf is now known as benzrf|offline
phutchin1 has quit [Ping timeout: 250 seconds]
jay__ is now known as rubyonrailed
timonv_ has quit [Remote host closed the connection]
cajone has left #ruby [#ruby]
timonv_ has joined #ruby
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Remote host closed the connection]
marr has joined #ruby
iliketurtles has joined #ruby
jcdesimp_ has joined #ruby
wolves_cs has joined #ruby
skammer3 has joined #ruby
dte has joined #ruby
chrishough has joined #ruby
Barrayar has joined #ruby
momomomomo has quit [Ping timeout: 245 seconds]
<havenwood>
aep: if you want gem in the user home directory you can set --user-install in your ~/gemrc: echo "gem: \"--user-install\"" >> ~/.gemrc
<havenwood>
gems*
dangerousdave has joined #ruby
<havenwood>
~/.gemrc*
ldnunes has quit [Ping timeout: 245 seconds]
momomomomo has joined #ruby
jcdesimp has quit [Ping timeout: 272 seconds]
priscmu has joined #ruby
jcdesimp_ has quit [Ping timeout: 260 seconds]
skolman has joined #ruby
<priscmu>
i wanna connect via datamapper to a mysql table │ ducklobster
<priscmu>
| - the table is called radreply but datamapper │ e^ipi
<priscmu>
| tries to get to radreplies :/ n
<priscmu>
oh sorry
yetanotherdave has quit [Ping timeout: 244 seconds]
<priscmu>
i wanna connect via datamapper to a mysql table. the table is called radreply, but datamapper tries to connect to radreplies.... how to change this
yetanoth1rdave has quit [Ping timeout: 260 seconds]
<ducklobster>
priscmu: what does your DataMapper.setup line look like
IrishGringo has joined #ruby
tyll_ has quit [Ping timeout: 260 seconds]
<ducklobster>
priscmu: oh nevermind that doesn't matter for this problem
Avahey has quit [Quit: Connection closed for inactivity]
ldnunes has joined #ruby
spyderma_ has joined #ruby
sepp2k has joined #ruby
spyderman4g63 has quit [Read error: Connection reset by peer]
cocotton_ has quit [Remote host closed the connection]
treehug8_ has quit [Read error: Connection reset by peer]
cocotton_ has joined #ruby
treehug88 has joined #ruby
mary5030 has joined #ruby
Schmidt has quit [Ping timeout: 260 seconds]
louism2wash has joined #ruby
tvw has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cherwin has joined #ruby
aspires has quit []
mwlang has joined #ruby
agjacome has joined #ruby
cocotton has quit [Ping timeout: 272 seconds]
pcp135 has joined #ruby
felipebalbi has left #ruby [#ruby]
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jcdesimp has joined #ruby
yfeldblum has joined #ruby
<mwlang>
has anybody written a TextMate shortcut to replace :hash_key => “value” with hash_key: “value” ?
x1337807x has joined #ruby
clauswitt has joined #ruby
jcdesimp has quit [Read error: Connection reset by peer]
jcdesimp has joined #ruby
chrishough has quit [Read error: Connection reset by peer]
yfeldblu_ has quit [Ping timeout: 244 seconds]
fgo has quit [Ping timeout: 272 seconds]
lukevinc has quit [Quit: ChatZilla 0.9.91 [Firefox 24.8.0/20000101000000]]
jbw_ has quit [Ping timeout: 260 seconds]
Schmidt has joined #ruby
jbw has quit [Ping timeout: 240 seconds]
txdv has joined #ruby
bobishh has joined #ruby
carraroj has joined #ruby
mary5030 has quit [Remote host closed the connection]
claymore has quit [Quit: Leaving]
freezey has quit []
postmodern has joined #ruby
Jackneill has quit [Remote host closed the connection]
ht__th has quit [Remote host closed the connection]
<shevy>
lol textmate
wpp has quit []
michaeldeol has joined #ruby
spider-mario has quit [Remote host closed the connection]
jcdesimp has quit [Remote host closed the connection]
n_blownapart has quit []
benlieb has joined #ruby
omosoj has quit [Quit: leaving]
Morkel has quit [Quit: Morkel]
pwh has joined #ruby
<benlieb>
is there something like `select` that collects the return value instead of the orig value?
jcdesimp has joined #ruby
bwilson has quit [Quit: bwilson]
jonmorehouse has quit [Ping timeout: 272 seconds]
<shevy>
can't you use select.map and .compact
<shevy>
it is easier to work with a given example
yalue has quit [Quit: Leaving]
jbw has joined #ruby
RyanV has quit [Quit: Computer has gone to sleep.]
<louism2wash>
Hey guys, I have a question regarding memory usage when using a recursive method vs using two separate methods that call each other. I think the way a recursive method works is that every time the method calls itself a stack frame is added to the stack, none of which can be released until the recursive method is done executing, thus taking up a lot of memory if the recursive method calls itself many times. Conversely, it seems
<louism2wash>
like having a system where two method call each other back and forth would allow for memory to clear each stack frame from memory as soon as each method is done executing. From a memory standpoint, would a recursive method be more memory intensive than having two methods that call each other? Here is an example of what I am talking about: https://gist.github.com/louism2/00f5b49767a3e58e4b2f Thanks for the help
mary5030 has joined #ruby
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
carraroj has quit [Quit: Konversation terminated!]
omosoj has joined #ruby
priscmu has quit [Quit: WeeChat 1.0.1]
chrishough has joined #ruby
<snzmn>
does ruby have tail calls?
<waxjar>
no(t yet)
chrishough has joined #ruby
Morkel has joined #ruby
boombadaroomba has quit [Remote host closed the connection]
<waxjar>
louism2wash: i doubt it'd make much of a difference
boombadaroomba has joined #ruby
<louism2wash>
waxjar: what consideration am I missing then? I can't think of anything other than memory usage?
<snzmn>
louism2wash: calling the separate function wouldn't clear the stack frame i believe
jbw_ has joined #ruby
WillAmes has joined #ruby
cherwin has quit [Ping timeout: 260 seconds]
<waxjar>
louism2wash: the call to increment_num can be taken off the stack, but the call to test_num_size it makes can't
rkalfane has joined #ruby
rkalfane has quit [Client Quit]
<waxjar>
actually, i think not even that
grzywacz has quit [Quit: :wq]
Morkel has left #ruby [#ruby]
omosoj has quit [Quit: leaving]
boombadaroomba has quit [Ping timeout: 245 seconds]
rkalfane has joined #ruby
sanguisdex has quit [Ping timeout: 260 seconds]
grzywacz has joined #ruby
chipotle has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<louism2wash>
Can you guys think of a way to write that which would allow each stack frame to be released when a value is returned?
cherwin has joined #ruby
rkalfane has quit [Client Quit]
<waxjar>
not recursively
Gunni has quit [Ping timeout: 260 seconds]
<snzmn>
afaict not until there are tail calls in ruby
<snzmn>
but that'd basically be the same as iteration anyway
txdv has quit [Quit: leaving]
Barrayar has quit [Quit: Leaving]
txdv has joined #ruby
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dawkirst has quit [Read error: Connection reset by peer]
Gunni has joined #ruby
mekhami has quit [Quit: Leaving]
Morkel has joined #ruby
Photism has quit [Quit: Leaving]
mistergibson has quit [Quit: Quitting ... be good to each other :)]
dideler has quit [Ping timeout: 260 seconds]
andrewlio has quit [Remote host closed the connection]
<havenwood>
was going to say, it has TCO it just isn't enabled by default
rkalfane has joined #ruby
rubie has quit [Quit: Page closed]
krisquigley has quit [Ping timeout: 260 seconds]
Advocation has quit [Quit: Advocation]
IrishGringo has quit [Ping timeout: 260 seconds]
justinmburrous has joined #ruby
cherwin has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Remote host closed the connection]
<louism2wash>
waxjar: awesome, I'll take a look
yfeldblum has joined #ruby
<waxjar>
it isn't pretty though :p
bmurt has quit []
wallerdev has joined #ruby
Asher has quit [Quit: Leaving.]
cherwin has joined #ruby
arup_r has quit [Quit: Leaving.]
mary5030 has quit [Remote host closed the connection]
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rkalfane has joined #ruby
justinmburrous has quit [Ping timeout: 272 seconds]
fsapo has quit [Remote host closed the connection]
rkalfane has quit [Client Quit]
ursooperduper has joined #ruby
lewix has quit [Remote host closed the connection]
jcdesimp has quit [Remote host closed the connection]
justinmburrous has joined #ruby
qmfnp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qmfnp has joined #ruby
merqlove has joined #ruby
qmfnp has quit [Client Quit]
dopie has quit [Remote host closed the connection]
yetanotherdave has joined #ruby
yetanoth1rdave has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
benzrf|offline is now known as benzrf
jonmorehouse has quit [Ping timeout: 272 seconds]
lmmendes has joined #ruby
Juanchito has quit [Quit: Connection closed for inactivity]
aspires has joined #ruby
IrishGringo has joined #ruby
govg has joined #ruby
yetanoth1rdave has quit [Ping timeout: 240 seconds]
rkalfane has joined #ruby
iliketurtles has joined #ruby
KC9YDN has quit [Quit: "Let a hundred flowers bloom: let a hundred schools of thought contend." - Mao Zedong]
rkalfane has quit [Client Quit]
yetanotherdave has quit [Ping timeout: 272 seconds]
insaneinside has joined #ruby
mary5030 has joined #ruby
fgo has joined #ruby
skolman has quit [Remote host closed the connection]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thsig has joined #ruby
jbw_ has quit [Ping timeout: 272 seconds]
douglasssssss has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jbw has quit [Ping timeout: 272 seconds]
Macaveli has joined #ruby
boombadaroomba has joined #ruby
fgo has quit [Ping timeout: 260 seconds]
aspires has quit []
Morkel has quit [Quit: Morkel]
BTRE has quit [Quit: Leaving]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ptrrr has quit [Quit: ptrrr]
justinmburrous has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
justinmburrous has joined #ruby
benzrf is now known as benzrf|offline
Macaveli has quit [Ping timeout: 272 seconds]
The has joined #ruby
tectonic has joined #ruby
rkalfane has joined #ruby
yetanotherdave has joined #ruby
yetanoth1rdave has joined #ruby
marr has quit [Ping timeout: 272 seconds]
aspires has joined #ruby
justinmburrous has quit [Ping timeout: 272 seconds]
The has quit [Client Quit]
lw has joined #ruby
bobishh has quit [Ping timeout: 272 seconds]
gilr00y has joined #ruby
lw has quit [Client Quit]
thsig_ has joined #ruby
jgrevich has joined #ruby
jbw_ has joined #ruby
thsig has quit [Ping timeout: 260 seconds]
jbw has joined #ruby
<insaneinside>
question: does Minitest *really* monkeypatch EVERYTHING?
IrishGringo has quit [Ping timeout: 272 seconds]
<insaneinside>
and is there a better ( => concise, not too "wordy", + widely-used) alternative?
<wallerdev>
hey zenspider whats a better test suite than minitest
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
D9 has joined #ruby
Synthead has quit [Quit: Leaving]
Synthead has joined #ruby
benlieb has quit [Quit: benlieb]
<D9>
in vim I can used the regex command ":%s/<\/\=\(\w\+\)\>/\L&/g) to make all html tags lowercase, what is the proper format for this regex in ruby using gsub?
ldnunes has quit [Quit: Leaving]
MCDev has quit [Ping timeout: 250 seconds]
benlieb has joined #ruby
Deejay_ has quit [Quit: Computer has gone to sleep.]
<insaneinside>
D9: I think you have to handle the match yourself...
<wallerdev>
yeah youll want to use the block form of downcase
sinkensabe has quit [Remote host closed the connection]
sinkensabe has joined #ruby
<eam>
I'd return the array and p() the result of bubble_sort() though :D
sinkensabe has quit [Remote host closed the connection]
Pupeno has quit [Remote host closed the connection]
<rubie>
i'm more worried about the text below being correct
dte has quit [Remote host closed the connection]
Pupeno has joined #ruby
ereslibre has quit [Quit: No Ping reply in 180 seconds.]
devdazed has joined #ruby
j_mcnally has joined #ruby
ereslibre has joined #ruby
ereslibre has quit [Changing host]
ereslibre has joined #ruby
<eam>
UnneededPercentX is the worst cop ever
<insaneinside>
eam: IYSS.
havenwood has joined #ruby
<insaneinside>
hey wallerdev: still looking for some thoughts on why minitest is so popular even though it appears to monkeypatch the things being tested. ;)
<eam>
I disallow `` :(
<wallerdev>
its lightweight and fast
d[x_x]b has quit [Quit: May the 4th be with you!]
<wallerdev>
zenspider knows more about it than me if hes around
<insaneinside>
he's got a hand in maintaining it or something, right?
ghostmoth has joined #ruby
<wallerdev>
yeah i think he made it
<wallerdev>
lol
dte has joined #ruby
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
crunk_bear has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kricir has quit [Remote host closed the connection]
D9 has quit [Ping timeout: 260 seconds]
Kricir has joined #ruby
sailias has quit [Ping timeout: 244 seconds]
fgo has joined #ruby
deric_skibotn has quit [Ping timeout: 272 seconds]
{xenomorph} has quit [Remote host closed the connection]
wjimenez_ has joined #ruby
jerius has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Ping timeout: 244 seconds]
drdanmaku has left #ruby [#ruby]
krz has quit [Quit: WeeChat 1.0.1]
ryanleesipes has quit [Quit: Leaving]
Kricir has quit [Ping timeout: 272 seconds]
tuelz has quit [Read error: Connection reset by peer]
wjimenez5271 has quit [Ping timeout: 260 seconds]
jottr has quit [Ping timeout: 246 seconds]
tvw has quit []
skolman_ has joined #ruby
tuelz has joined #ruby
tvw has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
devdazed has quit [Quit: Computer has gone to sleep.]
cherwin has joined #ruby
<dr_toboggan>
i can't find a good explanation of when you're supposed to use "then" and when you aren't
dogweather has joined #ruby
ixti has quit [Quit: WeeChat 1.0]
<dr_toboggan>
actually, are you supposed to ever use then?
kirun has quit [Quit: Client exiting]
<insaneinside>
dr_toboggan: only when writing the conditionally-executed code on the SAME LINE as the "if"
wjimenez_ has quit [Remote host closed the connection]
<insaneinside>
dr_toboggan: i never use it. ;)
russt has quit [Quit: russt]
<dr_toboggan>
oh. and do you still use "end"?
<insaneinside>
erp, i actually don't know that one.
tuelz has quit [Read error: Connection reset by peer]
wjimenez5271 has joined #ruby
<dr_toboggan>
ok, well, that answers my questions, thanks
<insaneinside>
I tend to use postfix notation for single-statement conditionals: do_something if i_said_so
aspires has quit []
tkuchiki has joined #ruby
davasaurous has joined #ruby
<dr_toboggan>
right
<shime>
insaneinside: minitest is popular? where?
tuelz has joined #ruby
aspires has joined #ruby
GriffinHeart has joined #ruby
boombadaroomba has quit [Remote host closed the connection]
maestrojed has quit [Quit: Computer has gone to sleep.]
<insaneinside>
shime: i, uh, think i read that on the webernets somewhere...
<havenwood>
shime: yeah, it's pretty popular
<shime>
yeah, if pretty means the second most popular testing framework for ruby
phantummm has quit [Quit: phantummm]
GriffinHeart has quit [Remote host closed the connection]
rimenes has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tuelz has quit [Read error: Connection reset by peer]
tkuchiki has quit [Remote host closed the connection]
<insaneinside>
shime: well, it's also rather attractive with makeup on. :P
tuelz has joined #ruby
<lewix>
anyone has the book build ruby gem?
<lewix>
or rather can anyone point me to some good material on the topic
<shime>
insaneinside: I'm too tired to process humour at the moment :(
momomomomo has quit [Quit: momomomomo]
Pupeno has quit [Ping timeout: 260 seconds]
<shime>
Lewix: there are a lot of resources on the interwebz about it
chipotle_ has joined #ruby
xenomorph is now known as {xenomorph}
<lewix>
shime: I came across an interesting book, $120 - people are insane =)
chipotle has quit [Ping timeout: 272 seconds]
KC9YDN has joined #ruby
twohlix has quit [Ping timeout: 245 seconds]
chipotle_ is now known as chipotle
phutchins has quit [Ping timeout: 240 seconds]
skammer3 has joined #ruby
<cndiv>
Hi all, I'm brand new to Ruby (and programming) and would really appreciate some help. I'm trying to gather information from a .csv that contains information about each time a door was opened in my office, and use it to find out how many days John Doe was in the office...
<lewix>
for that price we can buy 6 books on different topics, ruby has become a language good for marketing it seems
lmmendes has quit [Quit: lmmendes]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<cndiv>
I think I'm close but need some help with the array of hashes... here's the pastebin http://pastebin.com/TbNnsE4w
kenneth has joined #ruby
<lewix>
there's a good csv gem cndiv
moritzs has joined #ruby
<lewix>
ah
<cndiv>
Lewix: I have the information from the csv, I'm just too new to figure out how to use it properly...
Pupeno has joined #ruby
<dogweather>
Lewix: yep, especially when the online free docs are so poor.
thsig_ has quit [Remote host closed the connection]
* insaneinside
notes that 'people are insane' would indeed be a valid Ruby expression.
<cndiv>
Goal is to give the script a name and it to spit out the number of unique days they were in the office. Hopefully someone can help :-)
<lewix>
cndiv: what does line 15 return
Liendre has quit [Read error: Connection reset by peer]
<cndiv>
Lewix: I think all of the CSV? To be honest I got that part from another example online. It works, though. You can puts name + instanceDate and get all the right info
<cndiv>
I think line 26 is what I'm doing totally wrong
<lewix>
cndiv: How does the csv file look like
<cndiv>
Lewix: let me make another pastebin of an example. There's a lot of useless (to me) data in there..
<dr_toboggan>
line 5, i'm getting an error: void value expression
choke has quit [Read error: Connection reset by peer]
jasooon has joined #ruby
msmith has quit [Remote host closed the connection]
<insaneinside>
dr_toboggan: what does 'match' return?
<dr_toboggan>
boolean
<insaneinside>
pastie, please?
choke has joined #ruby
kotk_ has quit [Ping timeout: 272 seconds]
<epitron>
that is some weird looking code
maestrojed has joined #ruby
<insaneinside>
also, i *think* the Ruby convention is to avoid explicit use of the return keyword except where necessary -- the last statement in a compound is the result of that compound anyway.
pot8to has joined #ruby
<dr_toboggan>
insaneinside: yeah, i prefer to avoid using return
<dr_toboggan>
can you return multiple values though without using an explicit return?
<cndiv>
Lewix: Goal is to be told the number of unique dates each name opened a door. That CSV is each time a door opens. So I'm looking for John Doe: day1, day2, day3
<shevy>
insaneinside yeah
<shevy>
insaneinside but ruby was written for lazy humans, not for lazy computers
<epitron>
dr_toboggan: what is "if !spec false" supposed to mean?
<wallerdev>
no its not inconsistent lol, why would you even write that
rubie has quit [Ping timeout: 246 seconds]
<cndiv>
Lewix: John Doe: day1, day2, day3 - 3 days total
<dr_toboggan>
epitron: it returns false if the variable spec is false
<epitron>
seriously? that's legal code? :)
<shevy>
you normally have to use [5,6] for an array, or use Array.new or %w()
<insaneinside>
shevy: but ... but.... gah!
<shevy>
insaneinside well, you can also omit {} in arguments to a method if it comes last
<dr_toboggan>
wallerdev: ah, so receiving multiple return values is just matching from a returned array object?
Musashi007 has quit [Read error: Connection reset by peer]
<epitron>
it's very old though, and sucks in some ways
<dr_toboggan>
heh, really, i'd just be doing this in scheme. but i have to use a business friendly language, so i can be easily replaced. so i'm using ruby
<epitron>
yes, i remember
<dr_toboggan>
eh, i think my match code works, theoretically. i just have to get used to ruby syntax
<dr_toboggan>
ah
<insaneinside>
dr_toboggan: business-friendly? COBOL is where it's at.
<epitron>
it might make more sense for you to write a DSL
<insaneinside>
>>require 'stringio'; $stdout = StringIO.new; begin; raise 'why not use standard ERROR for errors?!'; ensure; $stderr.puts("stdout contents: #{$stdout.string}); end
<epitron>
eg: class DSL; def nested(&block); DSL.new.evaluate(&block); end; end
<epitron>
s/evaluate/instance_eval/ :)
enebo has quit [Quit: enebo]
<cndiv>
Lewix: oh wow, let me read that over. That works? :-)!
<lewix>
cndiv: idk
kinduff has quit [Ping timeout: 272 seconds]
LiohAu has quit [Quit: LiohAu]
<cndiv>
Lewix: let's find out! Appreciate the help, though :-)
<lewix>
cndiv: finalHash[name_of_person].count
<cndiv>
Lewix: I mean, regardless :-)
davasaurous has joined #ruby
Pupeno has quit [Remote host closed the connection]
<dr_toboggan>
epitron: hmm, i'll look into it
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonmorehouse has quit [Ping timeout: 260 seconds]
jontmorehouse has joined #ruby
chipotle_ has joined #ruby
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
freerobby has quit [Quit: Leaving.]
<epitron>
you might also wanna ask around about JSON REST API wrapper gem things :)
<epitron>
this is something people do in ruby a lot
<epitron>
people who aren't me
chipotle has quit [Ping timeout: 272 seconds]
chipotle_ is now known as chipotle
<cndiv>
Lewix: it doesn't error, but doesn't return anything. I want to replace the name_of_person with a string like "Doe, John" right? What's captured by line 26?
dogweather has quit [Remote host closed the connection]
<lewix>
cndiv: yes
fgo has joined #ruby
<cndiv>
Lewix: hmm, ok, trying known values and not getting anything. I'll keep trying, I know you're much closer than I was!
jonmorehouse has joined #ruby
<lewix>
cndiv: finalHash["Leevin, Ori"].count
<cndiv>
Lewix: Yeah, no luck. :-/
tbrock_ has joined #ruby
centrx has quit [Quit: The plan is programmed into every one of my one thousand robots]
D9 has quit [Ping timeout: 260 seconds]
<lewix>
cndiv: it works fine on my side
jontmorehouse has quit [Ping timeout: 272 seconds]
<cndiv>
Lewix: you put it at the end? post line 29?
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
fgo has quit [Ping timeout: 246 seconds]
<lewix>
cndiv: line 30
nettoweb_ has joined #ruby
<cndiv>
Lewix: trying.
reset has joined #ruby
Takle has quit [Remote host closed the connection]
RyanV has quit [Quit: Computer has gone to sleep.]
blackmesa has quit [Ping timeout: 244 seconds]
cajone has quit [Remote host closed the connection]
nettoweb_ has quit [Client Quit]
rkalfane has joined #ruby
cpruitt has quit [Quit: cpruitt]
justinmburrous has joined #ruby
nettoweb has quit [Ping timeout: 272 seconds]
lmickh has quit [Remote host closed the connection]
GriffinHeart has joined #ruby
cajone has joined #ruby
vt102 has quit [Remote host closed the connection]
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
mrbobman has joined #ruby
<cndiv>
Lewix: sorry on phone
beneggett has joined #ruby
justinmburrous has quit [Ping timeout: 260 seconds]
thsig has joined #ruby
MCDev has quit [Ping timeout: 250 seconds]
GriffinHeart has quit [Ping timeout: 250 seconds]
Avahey has joined #ruby
WormDrink has joined #ruby
<mrbobman>
oh god, oh god... it looks like my company is about to switch from Ruby to PHP!! Primarily because we can't find any decent Ruby developers out there. :-(
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tvw has quit []
louism2wash has quit [Quit: This computer has gone to sleep]
thsig has quit [Ping timeout: 260 seconds]
asteros has quit [Quit: asteros]
lw has quit [Quit: s]
freerobby has joined #ruby
asteros has joined #ruby
<insaneinside>
mrbobman: hey, I'm looking for a job. ;)
thsig has joined #ruby
cherwin has quit [Ping timeout: 245 seconds]
<mrbobman>
The north-west of England
<lnormous>
urgh
<lnormous>
that's your problem
<mrbobman>
lnormous: ?
skammer3 has joined #ruby
<lnormous>
Oh, I just grew up in the north east :p
<havenwood>
mrbobman: they should do remote Rubyists not PHP, yeeks
cherwin has joined #ruby
<mrbobman>
It's important that the developers work on-site
<havenwood>
mrbobman: why?
tokik has joined #ruby
<mrbobman>
havenwood: because the developer needs to constantly liase with the staff in the building
migimunz has joined #ruby
<insaneinside>
telepresence robots!
<mrbobman>
Is it possible to namespace a collection of classes without modifying the original files?
<insaneinside>
sure. module A; Foo = ::Foo; end
nettoweb has joined #ruby
<insaneinside>
A::Foo is now an alias of ::Foo.
<migimunz>
Hi, I'm doing something with ruby and opengl, and I was wondering if someone could help me with Fiddle, since the docs seem to be somewhat lacking. I need to allocate an int-sized buffer, get a pointer to it, and later do a .to_i on it.
tbrock_ has quit [Quit: Computer has gone to sleep.]
<migimunz>
any ideas?
<eam>
migimunz: ffi?
pdais has joined #ruby
<mrbobman>
insaneinside: is it possible to do it without creating ::Foo in the first place? It seems like ::Foo is just pollution here
linguini has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<insaneinside>
migimunz: I've had mixed results with the FFI libraries. The 'inline' gem (by zenspider here, I think) lets you just write the C inline with your Ruby.
<cndiv>
Lewix: that's close! but it spits out the amount of doors I opened total, not the amount of days I opened doors.
<cndiv>
Lewix: I'm looking for the amount of unique days in which a user opened doors.
dev_ryan has quit [Ping timeout: 260 seconds]
<migimunz>
insaneinside, the thing is, I'm already using the opengl-core gem, so I'm sure it can be done without talking to C directly
<cndiv>
Lewix: I'm trying to judge how many days people actually came to the office
<migimunz>
however, the documentation for that gem is lacking too
<insaneinside>
mrbobman: well, you could do Module.const_remo-- er... hmm.
<insaneinside>
mrbobman: yep, that'll do it -- but there could be namespacing issues in the VM if Foo's code references e.g. ::Foo instead of just Foo.
<mrbobman>
insaneinside: say I had two different libraries that just hapenned to share the same namespace, how could I easily separate them?
<jnylen>
is there a way to do : s.{type} = type_id
<jnylen>
where type is a variable
<cndiv>
Lewix: Really, really appreciate the help. That's perfect.
D9 has joined #ruby
freerobby has quit [Quit: Leaving.]
<insaneinside>
mrbobman: you'd have to assign a new constant for the first one, remove the constant, then include the second
mrsolo has quit [Quit: Leaving]
iliketurtles has quit [Quit: zzzzz…..]
<mrbobman>
insaneinside: seems nasty. It's a pity you can't require files so they directly live within an existing namespace. I think in python this isn't an issue.
<insaneinside>
mrbobman: yeah, that's one thing that's nice about Python
<insaneinside>
also: not sure if the Ruby VM resolves *all* constants to their referands at inclusion time -- if not, you'd get some very confused code
justinmburrous has quit [Ping timeout: 260 seconds]
sdwrage_ has joined #ruby
<insaneinside>
mrbobman: so you want Object.remove_const, not Module.(...). And it looks like simple const assignment won't do here
Pumukel has quit [Ping timeout: 260 seconds]
iliketurtles has joined #ruby
sdwrage has quit [Ping timeout: 260 seconds]
dx7_ has joined #ruby
magic has quit [Ping timeout: 260 seconds]
Takle has quit [Ping timeout: 250 seconds]
ctp_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pwh has quit []
dx7 has quit [Ping timeout: 240 seconds]
mferrier has joined #ruby
magic_ has joined #ruby
ffranz has quit [Quit: Leaving]
dev_ryan has joined #ruby
sdwrage_ has quit [Ping timeout: 260 seconds]
x1337807x has joined #ruby
dx7_ has quit [Ping timeout: 260 seconds]
wjimenez_ has joined #ruby
lw has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
Akagi201 has joined #ruby
endash has quit [Quit: endash]
IrishGringo has joined #ruby
wjimenez5271 has quit [Ping timeout: 260 seconds]
x1337807x has quit [Client Quit]
j_mcnally has joined #ruby
sevvie has joined #ruby
wjimenez_ has quit [Ping timeout: 244 seconds]
bmurt has joined #ruby
<insaneinside>
mrbobman: it's worse than that, even. Looks like all modules, classes, etc. -- including mixins! -- are indexed by name, not reference, so deleting the original constant and defining a new module will break previous inclusions of the original module.
nisstyre has joined #ruby
grzywacz has quit [Ping timeout: 240 seconds]
sdwrage has joined #ruby
Spami has joined #ruby
nisstyre has quit [Changing host]
nisstyre has joined #ruby
michaeldeol has joined #ruby
govg has joined #ruby
rfi_ has joined #ruby
omosoj has joined #ruby
<rfi_>
is this the right channel to ask questions about gems ?
<havenwood>
rfi_: yup, it'd be a good one
<dr_toboggan>
wait, did we come to a conclusion how you do: not something
<rfi_>
so I have a ruby lib called hiera that is installed by an rpm into /usr/lib/ruby/site_ruby/1.8/, but its an old version. If I do 'gem install' to get the newest it goes into '/usr/lib/ruby/gems/1.8'
<dr_toboggan>
i wanted to use: !variable
<rfi_>
will this cause a conflict or does the newer version get resolved properly ?
<dr_toboggan>
but that attemps to call variable as a function