apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
patrick99e99 has joined #ruby
<patrick99e99>
is #rubyonrails down?
<patrick99e99>
I am trying to go there and I can't seem to connect...
moshee has joined #ruby
moshee has joined #ruby
<patrick99e99>
it's weird, it's like I bounce back here when I try to go there
liluo has joined #ruby
RORgasm has joined #ruby
wimplash has joined #ruby
frishi has joined #ruby
`brendan has joined #ruby
`brendan has joined #ruby
joaoh82 has joined #ruby
matti has joined #ruby
matti has joined #ruby
Sigma00 has joined #ruby
mikepack has joined #ruby
luckyruby has joined #ruby
tvw has joined #ruby
vintagejailbreak has joined #ruby
apeiros_ has joined #ruby
adeponte has joined #ruby
helichopter has joined #ruby
method_missing has joined #ruby
Sigma00 has joined #ruby
<shevy>
Long live ruby!
method_missing has quit [#ruby]
tommyvyo has joined #ruby
Faris has joined #ruby
nikhgupta has joined #ruby
dekz has joined #ruby
<__method_missing>
Hi, can anyone give me an example of the usage of the method "#tap" ?
seich has joined #ruby
TheIronWolf has joined #ruby
helichopter has quit [#ruby]
moshee has joined #ruby
moshee has joined #ruby
<__method_missing>
Hi, can anyone give me an example of the usage of the method "#tap" ?
__method_missing has quit [#ruby]
mcwise has joined #ruby
nobitanobi1 has joined #ruby
ryan_dev70 has joined #ruby
<adf_>
__main__: (1..10).map { |v| v * 2 }.select(&:even?).tap(&:display).map { |v| v ** 3 }
<wmoxam>
joener: I hadn't joined the channel yet when you did that
<joener>
:update => "specialistListingDiv") %>
<wmoxam>
joener: don't paste it here
<joener>
why?
<wmoxam>
joener: use pastie.org
<wmoxam>
joener: or gist.github.com
<joener>
can i pm you?
<banisterfiend_>
joener: i want to give u a knuckle sandwich
<wmoxam>
joener: no
<wmoxam>
you can't
<joener>
awts
<joener>
no one can help me
<wmoxam>
joener: use pastie or gist
<wmoxam>
joener: then post the URL here
<wmoxam>
then maybe someone can help you
<joener>
use pastie or gist?
<joener>
what do you mean?
<wmoxam>
joener: use pastie.org
<wmoxam>
joener: or gist.github.com
ctp_ has joined #ruby
<wmoxam>
joener: see the channel topic :p
<joener>
programming language
luckyruby has joined #ruby
albemuth has joined #ruby
S1kx has joined #ruby
S1kx has joined #ruby
prsimp has joined #ruby
nerdy_ has joined #ruby
flaggy has joined #ruby
<wmoxam>
lol
brianpWins has joined #ruby
luckyruby has joined #ruby
Hsparks has joined #ruby
adeponte has joined #ruby
__class__ has joined #ruby
brngardner has joined #ruby
__class__ has joined #ruby
mmokrysz has joined #ruby
chimkan has joined #ruby
dfamorato_ has joined #ruby
seanstickle has joined #ruby
shadoi has joined #ruby
abstrusenick has joined #ruby
jfelchner has joined #ruby
max_ has joined #ruby
kvirani has joined #ruby
Synthead has joined #ruby
geekfactor has joined #ruby
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
__class__ has joined #ruby
nerdy_ has joined #ruby
looopy has joined #ruby
ziggles has joined #ruby
RORgasm has joined #ruby
mxweas_ has joined #ruby
seanstickle has joined #ruby
lkba has joined #ruby
deobald has joined #ruby
rohit has joined #ruby
yoklov has joined #ruby
slartibartfast_ has joined #ruby
<slartibartfast_>
Hey
<slartibartfast_>
I need help. Preferably in private, since it involves the answer to a rubeque problem.
<slartibartfast_>
It's a question about date parsing.
slartibartfast_ has quit ["Leaving"]
crescendo has joined #ruby
patrick99e99 has joined #ruby
Targen has joined #ruby
ryanf has joined #ruby
mrtheshadow has joined #ruby
<icy`>
cool site ;P
<icy`>
too bad he's gone now ;P
<icy`>
i remember i did something similar, but it was very mathematical... Project Euler
redgetan has joined #ruby
dfamorato has joined #ruby
dfamorat_ has joined #ruby
igotnolegs has joined #ruby
snip_it has joined #ruby
Mekkis has joined #ruby
redgetan has quit ["Leaving"]
seitensei has joined #ruby
albemuth has joined #ruby
ziggles has joined #ruby
ben225 has joined #ruby
abra has joined #ruby
stepnem has joined #ruby
Synthead has joined #ruby
joaoh82 has joined #ruby
neersighted has joined #ruby
KL-7 has joined #ruby
kvirani_ has joined #ruby
shruggar has joined #ruby
adeponte has joined #ruby
nfluxx has joined #ruby
smoak has joined #ruby
Hsparks has joined #ruby
danielvdotcom has joined #ruby
Morkel has joined #ruby
danielvdotcom has quit [#ruby]
chimkan has joined #ruby
<smoak>
im issuing gem install sqlite3 and its erroring out with "make: /bin/install: Command not found"...for some reason its not finding my correct install binary (/usr/bin/install)
<smoak>
im using ruby version 1.9.2-p290
io_syl has joined #ruby
codezombie has joined #ruby
nfluxx has joined #ruby
edogawaconan has joined #ruby
nfluxx_ has joined #ruby
a_a_g has joined #ruby
savage- has joined #ruby
fowl has joined #ruby
JohnBat26 has joined #ruby
gen0cide_ has joined #ruby
ringotwo has joined #ruby
drKreso has joined #ruby
joni has joined #ruby
Advocation has joined #ruby
nfluxx has joined #ruby
chimkan_ has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
trivol has joined #ruby
tomsthumb has joined #ruby
keymone has joined #ruby
mikepack has joined #ruby
diegok has joined #ruby
uxp has joined #ruby
jayne has joined #ruby
two- has joined #ruby
cezar-b has joined #ruby
dfamorato has joined #ruby
jenglish has quit [#ruby]
dfamorato_ has joined #ruby
CheeToS has joined #ruby
seivan has joined #ruby
Gonzih has joined #ruby
RORgasm has joined #ruby
dshdsgdfdf has joined #ruby
MrGando has joined #ruby
<MrGando>
Hey guys, does anyone have any experience with hpricot? I'm having issues while trying to perform a very simple html parse… here's my issue in detail http://stackoverflow.com/questions/10099091/
sohocoke has joined #ruby
GoBin has joined #ruby
x0F__ has joined #ruby
djdb has joined #ruby
<rcs>
MrGando: Are you sure you're getting the document at all? curl, for instance, throws a 403 on that.
<lessless>
guys, i can't find any info how to prevent sql injections in sinatra, would someone help me please?
ken_barber has joined #ruby
shruggar has joined #ruby
shadoi has joined #ruby
mikeric has joined #ruby
drKreso_ has joined #ruby
kvirani has joined #ruby
BiHi has joined #ruby
iamjarvo has joined #ruby
abra has joined #ruby
mfridh has joined #ruby
eka has joined #ruby
paradisaeidae has joined #ruby
<lessless>
will be /\w{0,20}/.match(params[:name]) enough? (name is limited to 20 symbols here)
kstephens has joined #ruby
<fowl>
<lessless> guys, i can't find any info how to prevent sql injections in sinatra, would someone help me please?
<fowl>
dont let them pass things like " OR *; or whatever it is the kids are using to sql inject these days
iamjarvo1 has joined #ruby
<fowl>
or just use function like mysql_escape_string(php) i dunno the rb equivalent
blacktulip has joined #ruby
<burgestrand>
lessless: what database driver are you using?
<lessless>
burgestrand, seequel
<lessless>
it use pg, afaik
<burgestrand>
You can use many drivers with it
<lessless>
application will work only with postgresql
<burgestrand>
Off the bat I’d go with prepared statements, it’s much less to think about in comparison to manually escaping input
Dirkpitt has joined #ruby
sebastian_pl has joined #ruby
edogawaconan has joined #ruby
<fowl>
yes
<fowl>
prepared statements
<lessless>
burgestrand, are there any recommendations?
<burgestrand>
lessless: for what?
<lessless>
any prepared statements? :)
<burgestrand>
lessless: hehe, prepared statements are similar to regular queries, except instead of interpolating your values into the SQL query, you use placeholders
<burgestrand>
(although, actually, the examples on the online rdoc page are awfully confusing)
<fowl>
burgestrand is always here to fill in the missing parts/correct you when you're high :)
<vectorshelve>
fowl: hai mate.... Its too hot back here in India...
mikeric has joined #ruby
<burgestrand>
vectorshelve: :)
<fowl>
india is hot and smells like horrible food
<fowl>
(ive heard)
ales_ has joined #ruby
<fowl>
indians, please dont shoot me with ur bows n arrows :x
jlebrech has joined #ruby
fivetwentysix has joined #ruby
gyre007 has joined #ruby
<vectorshelve>
fowl: You are mistaken dude.. India isnt today the India that you are talking abt some 20 years back... i was talking abt the climate that it's summer now
<vectorshelve>
fowl: where are you from ?
<fowl>
lol, america, where else
tatsuya_o has joined #ruby
<lessless>
fowl, they can supply you and outdated antibiotic. lol
BiHi has joined #ruby
<lessless>
vectorshelve, how, you are from india buddy! namaste
<vectorshelve>
lessless: namaste
francisfish has joined #ruby
<vectorshelve>
fowl: India is one of the fastest growing countries in the world. It has the third largest army , fourth largest air force and the fifth navy... , having the third largest defence in the world..
<vectorshelve>
fowl: India has the richest person in the world... and has the third largest number of millionaires...
<fowl>
vectorshelve, well i dnno sir our textbooks were quite old in public school but that doesnt mean they were any less factual or relevant
<vectorshelve>
fowl: India has the 4th best Aerospace technology. India has one of the brainiest kids...
ales_ has joined #ruby
<lessless>
vectorshelve, tell him about culture!!
heftig has joined #ruby
<vectorshelve>
fowl: you should be reading more before you speak out stuff mate :)
<fowl>
one of the brainiest kids? are you going to say you lol
<fowl>
your country lets wild animals roam the streets in filth and squalor because they're "holy"
<lessless>
fowl, no that is true - india have had more philosophers than any american can imagine
<shevy>
where
<shevy>
in the callcenters???
* shevy
runs!
<vectorshelve>
fowl: you should know that toady some of the top IT and non IT bigshots in US and Silicon valley have Indians in top Positions...
<fowl>
no kidding, every time i call tech support its some indian
<fowl>
so you're takin our jobs, am i supposed to be proud
<lessless>
agh, this is going too far
<vectorshelve>
shevy: fowl Well its like people who are dump and rich.. as someone says.. americans have money bt no brains so they outsource work to India to get it done lol :D
<shevy>
nah, it is only logical, corporations are greedy and always seek to minimize their expenses anyway
<fowl>
vectorshelve, in america we dont say much about the indian people besides their food smelling *horrible*
<fowl>
way2be rude
<fowl>
we dont dwell on lesser things though :p
<fowl>
got things to do, white ppl are always in a rush
<vectorshelve>
fowl: Why should google facebook Microsoft sun and allmost all INC come to India start offices here hire Indians for millions and get works done... there are far more "intellingent " people in america right.. like our beloved fowl lol :D
<fowl>
it would have nothing to do with saving money
<shevy>
some weeks ago I saw a labor technician with a Phd working at a veterinary research facility. he was looking indian :)
<vectorshelve>
shevy: fowl we find many americans here as well :D
ales_ has joined #ruby
<fowl>
our corporations do what's best for them, cheap labor is a must
data21 has joined #ruby
<vectorshelve>
fowl: cheap labour is a must bt not at the cost of native's employments that means ur government doesnt care abt ppl in the country they just wanna save money
<vectorshelve>
fowl: shevy ok lets close this sensitive topic here... :) we are friends all right :)
<fowl>
vectorshelve, yet were do the smart indians go for school?
<fowl>
do you have colleges in your country or all they all over capacity
<vectorshelve>
fowl: americans do come to India also... I know more than 100's
<data21>
I'm trying to make an app with a GUI - and I was going to use shoes but it seems impossible to get working on Ubuntu 64 and also seems outdated - so is there any easy to set up GUI out there?
<fowl>
im sorry you know so many americans vectorshelve :(
<vectorshelve>
fowl: google abt india today before you talk abt India from your imagination :)
simao has joined #ruby
<vectorshelve>
brb
<fowl>
vectorshelve, our government is not able to tell a country they cant import their labor
mfridh has joined #ruby
<fowl>
its wrong, i know, but what you gonna do, "freedoms" and shit
<fowl>
data21, i think your best bet is ruby-gtk
ales_ has joined #ruby
SPYGAME has joined #ruby
Gonzih has joined #ruby
<data21>
fowl: okay thanks I'll give that a try
Gonzih has joined #ruby
Gonzih has joined #ruby
progzer has joined #ruby
berserkr has joined #ruby
neersighted has joined #ruby
Gonzih has joined #ruby
tvw has joined #ruby
<progzer>
Excuse me, I'm trying to install sqlite-ruby (to import a Trac environment into Redmine) on windows. I tried using gem and it told me I need the DevKit.
<progzer>
Got that and trying installing.
<progzer>
That seems to require the lib for sqlite
<progzer>
I see there is a "sqlite-ruby-2.2.3-mswin32.gem" on rubyforge.org
mengu has joined #ruby
<lessless>
fowl, you know, buddy, americans beginned their civilization with genocide, this not the best start ;)
kiddies has joined #ruby
<progzer>
Is that a pre-built version?
<fowl>
lessless, genocide is a beautiful thing. think of it like pruning the old leaves off the tree. it keeps the tree healthy and strong
sahli has joined #ruby
<progzer>
hmm, guess that worked.
<lessless>
and also gave the world some really ugly things, like hippies, rofl
<fowl>
hippies > brown people
<fowl>
with that though, i should probably /part
fowl has quit ["Leaving"]
ChampS666 has joined #ruby
artm has joined #ruby
<jlebrech>
does anyone think "do" should be optional when there are double pipes?
bier has joined #ruby
<banisterfiend_>
jlebrech: no
gyre007 has joined #ruby
<shruggar>
jlebrech: for single-statement blocks, then?
<jlebrech>
if you are doing. @foo.each |a| ... wouldn't a "do" be implied.
probst has joined #ruby
yxhuvud has joined #ruby
<shevy>
jlebrech that is missing a do or a {
<jlebrech>
shevy I know it is. i'm just talking about the language design.
<jlebrech>
it would be nice for 2.0
<shevy>
ok when would this block end then?
<banisterfiend_>
jlebrech: i would prefer it would |a| and keep the do
zhutingting has joined #ruby
<banisterfiend_>
jlebrech: i.e @foo.each { puts it }
<banisterfiend_>
where 'it' stands in for the |a| a
<banisterfiend_>
without |a| *
<jlebrech>
i just heard someone say it seemed a bit redundant and i thought it made sense.
Floydzy has joined #ruby
matti has joined #ruby
matti has joined #ruby
bb has joined #ruby
<Tasser>
banisterfiend_, I'd decide for either { or do :-)
edogawaconan has joined #ruby
DuoSRX has joined #ruby
<shevy>
jlebrech you didnt quite say when it would end. at the first newline that happens?
<matti>
Hi shevy :)
<shevy>
hey matti
<matti>
How's tricks?
<shevy>
struggling with Readline
<shevy>
I am now testing it with python :P
<matti>
LOL
<matti>
Out ->
<matti>
Python...
<matti>
shevy: You know, that we shoot traitors? ;d
<jlebrech>
shevy it would end at the next 'end'
<jlebrech>
shevy if it's a one liner the pipes would be in {} wouldn't they
<shevy>
jlebrech wait
<shevy>
I thought you want avoid the {}
<jlebrech>
shevy no, i think "do" is syntactically redundant
<shevy>
matti the API seems somewhat cleaner ... readline.insert_text
<slartibartfast_>
I have some questions about WWW::Mechanize
edibrac has joined #ruby
fowl_ has joined #ruby
replore has joined #ruby
sacarlson has joined #ruby
sacarlson has quit [#ruby]
<slartibartfast_>
Also, which is better: Watir or mechanize?
sacarlson has joined #ruby
dhruvasagar has joined #ruby
<banisterfiend_>
jlebrech: what if the block didnt take a parameter?
<banisterfiend_>
jlebrech: how would it know when to start then ? :P
atnight has joined #ruby
<banisterfiend_>
jlebrech: 10.times } ?
<jlebrech>
banisterfiend_ then use do
<jlebrech>
banisterfiend_ "do" + "|a|" is redundant.
<jlebrech>
but i'm being silly as ruby is sweet enough
ukd1 has joined #ruby
<banisterfiend_>
jlebrech: wait, so it's a special case for when and only when a block has parameters? :P
<banisterfiend_>
jlebrech: that's a pretty weird special case :)
berkes has joined #ruby
InBar has joined #ruby
<jlebrech>
banisterfiend_ it would be :D
<slartibartfast_>
jlebrech, I've got a mechanize question if you can answer it
<jlebrech>
go ahead.
<slartibartfast_>
Although, when I try to install watir, ffi, or watir-webdriver, I always get "failed to build gem native extensions"
KL-7 has joined #ruby
nexthoudini has joined #ruby
<slartibartfast_>
sorry
<slartibartfast_>
internet cycled
sn0lan has joined #ruby
<slartibartfast_>
jlebrech, I need to go to a website, login, go to a page on that website once logged in, and use some text from that page in a url within two seconds. I do all this, except that when I do that last task, it doesn't seem to remember I'm logged in.
<slartibartfast_>
I'm not sure how to fix that.
<slartibartfast_>
I keep the user agent
<jlebrech>
slartibartfast_ cookie issue
<slartibartfast_>
but have it do agent.get for each new page
<slartibartfast_>
Yes. I thought Mechanize kept cookies, though.
<jlebrech>
you need to reuse the cookie jar
<slartibartfast_>
Ah. How do I do that?
<jlebrech>
not that i'm any good with mechanize. but i've done similar with curl and it was cookie jar related.
fowl has joined #ruby
fowl_ has joined #ruby
nu7hatch has joined #ruby
chrismcg has joined #ruby
KL-7 has joined #ruby
Squee-D has joined #ruby
mdw has joined #ruby
nirjhor has joined #ruby
ctp has joined #ruby
<data21>
In Ruby I have an app that can connect to a TCP server do registration and stuff - but is there a way to do that with websockets? Like I tried ws = new WebSocket("tcp://hostname:port")
<Tasser>
data21, you sure did your therapy to lose the grip of java on you? :-)
<slartibartfast_>
jlebrech, I got it.
<banisterfiend>
Tasser: can you sing to me a gentle song in german
<jlebrech>
slartibartfast_ what did you do? :)
<data21>
Tasser haha see actually the assignment was write a java program to listen to some ports and register - but I decided to do it in Ruby - so all that went well till I tried to make a gui to display the info coming back from the server, so then I thought maybe I could make like a websocket so I can use the browser as the gui
<Tasser>
data21, console output should be good enough ^^
<Tasser>
banisterfiend, grab yourself some youtube
<slartibartfast_>
jlebrech, mechanize automatically keeps your cookies for you, but every get request is basically a new session and it removes session cookies. You can disable this behavior.
<Tasser>
slartibartfast_, or just use the same session? :-)
<slartibartfast_>
Or you can do what I did, and do "login_form.checkboxes.first.check" to check the "keep me logged in" box
<slartibartfast_>
Tasser, not sure how.
<slartibartfast_>
I was already doing it from the same page.
ChrisH_ has joined #ruby
<data21>
Tasser yea that's what I'm hoping worse come to worse since if you do it in java you are given like half of the code - although I suppose what I could do is the ruby program gets all the info then rebroadcast it as a websocket and then just listen on my browser locally?
<ChrisH_>
Hi, I am hiring Ruby on Rail professionals. I need some tutorials and the pay is also good.
<slartibartfast_>
Tasser, how do I keep the same session in mechanize?
<ChrisH_>
Please contact me via pm or mail me to chrishowart@gmail.com
<Tasser>
slartibartfast_, no idea
<slartibartfast_>
Tasser, then I'll stick by my method.
<slartibartfast_>
:D
<Tasser>
ChrisH_, you could also try #rubyonrails
<slartibartfast_>
jlebrech, I had it check the "keep me logged in" checkbox.
<Tasser>
and wasn't IRC famous for trolling? ^^
<ChrisH_>
Tasser: oh, didnt know they had a seperate channel
<ChrisH_>
This aint trolling!!
RORgasm has joined #ruby
<Tasser>
ChrisH_, I know about that, but you might get trolled ;-)
ChrisH_ has joined #ruby
ChrisH_ has joined #ruby
kvirani has joined #ruby
mcwise has joined #ruby
c0rn has joined #ruby
seivan has joined #ruby
<Afal>
TIL: Ruby and Ruby on Rails are the same thing
<banisterfiend>
Afal: in what sense
<banisterfiend>
Afal: cos i know a tonne of non-rails ruby programs :)
<Afal>
banisterfiend: I'm being sarcastic. I'm actually amused how people to this day still think Ruby and Rails are synonymous.
<banisterfiend>
Afal: oh lol
davidpk has joined #ruby
<vectorshelve>
Afal: please dont say that... rails survive on ruby's mercy :)
<data21>
Slight problem I have installed em-websocket and the gem is clearly there but when I run my file it comes back saying no such file to load
keymone has joined #ruby
falena has joined #ruby
netogallo has joined #ruby
drKreso has joined #ruby
richardlxc has joined #ruby
davidpk has joined #ruby
josefig has joined #ruby
<lessless>
how to translate string '[["text",1],["text",22.3],["text",3.0]]' into two-dimensional array? %)
Squee-D has joined #ruby
Guedes has joined #ruby
richardlxc has joined #ruby
pu22l3r has joined #ruby
Squee-D has quit [#ruby]
fr0gprince_mac has joined #ruby
Gonzih has joined #ruby
<apeiros_>
lessless: you mean you have a string containing that?
<banisterfiend>
apeiros_: hey what's up
<apeiros_>
banisterfiend: not much, going to railsberry soon, started using pry - what about you?
<banisterfiend>
apeiros_: what is railsberry
<banisterfiend>
i guess i can google it
<banisterfiend>
wow in krakow
<apeiros_>
railsconf in krakow
robotmay has joined #ruby
<banisterfiend>
apeiros_: are you presenting?
<apeiros_>
no, only attending
<burgestrand>
representing
* apeiros_
won't present if he can avoid it :)
<apeiros_>
even sponsoring :)
<banisterfiend>
burgestrand: are you going too burg?
<banisterfiend>
i guess it's not so far away from you
<banisterfiend>
though my geography isnt that good
<burgestrand>
banisterfiend: naw, I’m still in sweden and I’m also sick :p
<banisterfiend>
burgestrand: well apeiros_ has to get there from switzerland! isn't that further away? :)
<apeiros_>
switzerland is relatively close to krakow
<apeiros_>
the flight takes long though, no direct flights :(
<lessless>
apeiros_, yes
<apeiros_>
otherwise, it'd be ~2h I think
Divinite has joined #ruby
<burgestrand>
it *looks* about the same
<apeiros_>
lessless: how come you have that? json?
<burgestrand>
but maps are crazy
<banisterfiend>
apeiros_: must be weird to be in close proximity to countries so different to yours
<banisterfiend>
but perhaps that's just normal, in new zealand we're not close to anywhere :P kind of sucks
<apeiros_>
maps are distorted
<apeiros_>
banisterfiend: hehe
<burgestrand>
banisterfiend: must be crazy living with pretty much a bunch of sheep on an island in the middle of nowhere :d
<burgestrand>
… weird, not crazy
<banisterfiend>
burgestrand: Yeah, it's pretty weird i must admit
<banisterfiend>
burgestrand: are you going to euroko at least?
<burgestrand>
banisterfiend: haven’t planned on it, no
Bartzy has joined #ruby
<apeiros_>
lessless: you better hurry up with your replies, I got a tele-conference soon.
JCBK has joined #ruby
<lessless>
sorry:)
<lessless>
i'm back now
<banisterfiend>
burgestrand: ive been doing a bit of objc btw, pretty fun but frustrating too. Do you have any experience with macosx or are you mainly developing for ios?
<burgestrand>
banisterfiend: was only one ios application, have been peeking a bit at coreaudio for Hallon though
<apeiros_>
lessless: I'm off - if it is json, just require 'json', then JSON.parse. if not, take a look at https://gist.github.com/1100314
BeLucid_ has joined #ruby
<burgestrand>
banisterfiend: so neither, really
Guedes has joined #ruby
<banisterfiend>
burgestrand: it initially felt pretty ruby-ish when i first started out, now i've been coding it a while though it feels much less :P
<banisterfiend>
the verbosity is mindboggling
<burgestrand>
Yeah, I agree
<burgestrand>
don’t like building hashes
Liquid_X has joined #ruby
richardlxc has joined #ruby
iocor has joined #ruby
<banisterfiend>
burgestrand: taken me a surprisingly amount of time to grok wtf is going on with nib files and IB too ;) i've never seen anything like it before, kind of a weird idea
<fivetwentysix>
what can java programmers do that ruby programmers can't
<banisterfiend>
fivetwentysix: hate their jobs
<bodor>
I Love all languages
<bodor>
but opengl is this biggest annoyance in history at the moment not even SDL was this annoyihng
<banisterfiend>
bodor: what are you trying to do exactly, maybe you should use gosu instead?
<bodor>
I've made a little picture move around in gosu :D ,etc
<bodor>
with joypad controls
<bodor>
but yea um
<bodor>
I Believe my problem is in the glVertexAttribPointer
<bodor>
and I don't kno what I Need to do differently to fix it
davidcelis has joined #ruby
<banisterfiend>
bodor: ask on #gosu
<bodor>
they won't help me :P gosu is a rubygem that is for game development
bluenemo has joined #ruby
bluenemo has joined #ruby
<JCBK>
I'm trying to write a Jekyll plugin which generates an array of pages in a directory in a json file. so a directory contains index.html and a folder foo containing bar.html, it'd generate "index, /foo/bar". im completely new to Ruby, does somone have any pointers?
<banisterfiend>
bodor: they also know about opengl
<bodor>
lol I will try
<banisterfiend>
bodor: esp. the guy who wrote gosu, which is a wrapper on opengl
<fivetwentysix>
could you actually write a 3d game client in ruby?
<fivetwentysix>
would it be too slow
<happynoff>
Hi there. Small question about require and Interrupt. I have the following code http://pastie.org/3767399 When a script is loading and takes time, if hit ctrl-c the script stops but the method ends its execution and write the loaded file name :/
<happynoff>
Any idea on how to prevent this behavior ?
Guedes has joined #ruby
Guedes has joined #ruby
Ammar_Frameworks has joined #ruby
ken_barber1 has joined #ruby
<apeiros_>
lessless: I'm back. So what is it now? indeed json? or something else?
<lessless>
no, the data is retrieved from database, it is stored there in this way
<lessless>
literalparser works great except of i need explicitly do .to_f to each float number :)
ctp has joined #ruby
Ammar01 has joined #ruby
<lessless>
first step parse with LiteralParser, second step iterate through result and convert bigdecimal to float
strife25 has joined #ruby
dzhulk has joined #ruby
sohocoke has joined #ruby
Asebolka has joined #ruby
codespectator has joined #ruby
jenglish_ has joined #ruby
LMolr has joined #ruby
richardl1c has joined #ruby
Divinite has joined #ruby
<lessless>
apeiros_, or it can be possibly done more easy?
BrianE has joined #ruby
eka has joined #ruby
BiHi has joined #ruby
philcrissman has joined #ruby
richardlxc has joined #ruby
iamjarvo has joined #ruby
ctp has joined #ruby
fortysixandtwo has joined #ruby
ales has joined #ruby
ChampS666 has joined #ruby
nanderoo has joined #ruby
philcrissman_ has joined #ruby
kvirani has joined #ruby
shruggar1 has joined #ruby
wefawa has quit [#ruby]
Guedes has joined #ruby
Guedes has joined #ruby
davidpk has joined #ruby
ales has joined #ruby
nu7hatch has joined #ruby
dhruvasagar has joined #ruby
daidoji has joined #ruby
<daidoji>
sup everybody
mdw has joined #ruby
richardlxc has joined #ruby
pu22l3r has joined #ruby
geekfactor has joined #ruby
binman-rt has joined #ruby
flaggy has joined #ruby
ctp has joined #ruby
mattyoho has joined #ruby
richardlxc has joined #ruby
mattyoho has joined #ruby
workmad3 has joined #ruby
chopmo has joined #ruby
mikewintermute has joined #ruby
xcvd has joined #ruby
Guedes has joined #ruby
ph^ has joined #ruby
RORgasm has joined #ruby
ph^ has joined #ruby
n1x has joined #ruby
eka has joined #ruby
<mikewintermute>
I've got a "group :development" section and a "group: production" section in my Gemfile. How does bundler know which environment it's in?
happynoff has quit [#ruby]
Liquid_X has quit [#ruby]
ales has joined #ruby
otters has joined #ruby
jbw has joined #ruby
twinturbo has joined #ruby
punkrawkR has joined #ruby
jenglish has joined #ruby
<burgestrand>
it doesn’t
<burgestrand>
You tell it in Bundler.setup or Bundler.require
<burgestrand>
mikewintermute: ^
ales has joined #ruby
dshdsgdfdf has joined #ruby
<mikewintermute>
burgestrand: is that a file somewhere?
richardl1c has joined #ruby
nari has joined #ruby
nonotza has joined #ruby
dbgster has joined #ruby
fbernier has joined #ruby
jankly has joined #ruby
jubby has joined #ruby
ken_barber has joined #ruby
ctp has joined #ruby
`brendan has joined #ruby
sahli has joined #ruby
snearch has joined #ruby
<mikewintermute>
In here perhaps? ~/.rvm/gems/ruby-1.9.2-p318/gems/bundler-1.1.3/lib/bundler/setup.rb
tommyvyo has joined #ruby
<jubby>
Good morning all. Just installed rvm and ruby-1.9.3-p125 but ri documentation doesn't seem to work. Do I need to install this separately?
<jubby>
Running OSX Lion
JCBK has quit [#ruby]
dzhulk has joined #ruby
yalue has joined #ruby
dzhulk has joined #ruby
shevy has joined #ruby
reinaldob has joined #ruby
reinaldob has quit [#ruby]
ken_barber has joined #ruby
mengu_ has joined #ruby
ken_barber has joined #ruby
ken_barber has joined #ruby
Squarepy has joined #ruby
JCBK has joined #ruby
Squarepy has joined #ruby
<JCBK>
I've got a script which is meant to write all html files in a directory to a json file, comma-separated, but right now it seems to overwrite the first line with every next object. how would I be able to fix this? bear in mind, it's my first ever ruby script… http://pastie.org/3767859
alem0lars has joined #ruby
simao has joined #ruby
<burgestrand>
jubby: rvm docs generate I believe it is
<burgestrand>
jubby: rvm help docs
sbanwart has joined #ruby
<jubby>
burgestrand: docs generate prompted "'rvm docs ...' requires ruby sources to be available, run `rvm reinstall ruby-1.9.3-p125
<jubby>
"
<jubby>
burgestrand: Running that now
BSaboia has joined #ruby
Guedes0 has joined #ruby
tar_ has joined #ruby
ctp has joined #ruby
ctp has joined #ruby
linoj has joined #ruby
pu22l3r has joined #ruby
mstratman has joined #ruby
JCBK has quit [#ruby]
JCBK has joined #ruby
mattyoho has joined #ruby
KL-7 has joined #ruby
ph^_ has joined #ruby
<workmad3>
JCBK: you've just encountered the difference between opening a file for write and opening a file for append ;)
<JCBK>
I figured it'd be something like that :)
<JCBK>
how do I append it?
<workmad3>
JCBK: your code would work fine if you always kept the same file pointer ( so opened the file first, then iterated over the HTML files) or if you did 'File.open( ..., 'a')'
<workmad3>
JCBK: I'd probably personally go for keeping hold of the file pointer rather than open,write,close lots of times
<JCBK>
yeah that seems to have fixed it workmad3
<JCBK>
but it does introduce a new problem
waxjar has joined #ruby
kish has joined #ruby
dql has joined #ruby
<JCBK>
how do I let it overwrite any previous version?
<JCBK>
because right now it appends the new text every time i run the script (obviously), which brings in a lot of dupliucates
<workmad3>
JCBK: ah, you want to replace it if it exists before the initial run?
<JCBK>
yup
<workmad3>
JCBK: in which case, open the file for write, then iterate over the HTML files, writing each one, then close the file
<workmad3>
JCBK: which was my other suggestion ;)
<JCBK>
right :)
d3c has joined #ruby
<JCBK>
open in what "mode"?
<workmad3>
JCBK: write
<workmad3>
not append
td123 has joined #ruby
antonishen has joined #ruby
kanzure has joined #ruby
ben_alman has joined #ruby
<JCBK>
okay I cant seem to be able to wrap my head around it yet workmad3. I think I'm close…but could you take a look what I'm doing wrong? http://pastie.org/3767979
<workmad3>
JCBK: you don't need the File.close
<shevy>
ruby live long!
helichopter has joined #ruby
<JCBK>
workmad3: okay thats good to know. but still it throws an error "undefined method `write'"
geekbri has joined #ruby
dv310p3r has joined #ruby
CannedCorn has joined #ruby
mrwalker has joined #ruby
mikos has joined #ruby
williamcotton has joined #ruby
chico has joined #ruby
lorandi has joined #ruby
Squarepy_ has joined #ruby
jgarvey has joined #ruby
keymone has joined #ruby
LBRapid has joined #ruby
Bofu2U has joined #ruby
moshef has joined #ruby
brngardner has joined #ruby
iocor has joined #ruby
atnight has joined #ruby
looopy has joined #ruby
phantasm66 has joined #ruby
phantasm66 has joined #ruby
EvanR has joined #ruby
EvanR has joined #ruby
crankycoder has joined #ruby
KL-7 has joined #ruby
kish has joined #ruby
uris has joined #ruby
<burgestrand>
JCBK: you are using f variable twic
<burgestrand>
…e
Morkel has joined #ruby
looopy has joined #ruby
bbttxu_ has joined #ruby
_ack has joined #ruby
andrewhl has joined #ruby
theRoUS has joined #ruby
strife25 has joined #ruby
<apeiros_>
lessless: LiteralParser has a second arg, opts, which accepts :use_big_decimal => false
<apeiros_>
if you use that option, it'll parse them as floats
davidboy has joined #ruby
fr0gprince_mac has joined #ruby
jcblitz has joined #ruby
netrealm has joined #ruby
sectionme has joined #ruby
ecolitan has joined #ruby
chson has joined #ruby
internet_user has joined #ruby
rrad has joined #ruby
jitesh_shetty has joined #ruby
heftig has joined #ruby
chimkan_ has joined #ruby
Guedes has joined #ruby
Guedes has joined #ruby
kvirani has joined #ruby
RORgasm has joined #ruby
josefig has joined #ruby
josefig has joined #ruby
Sailias has joined #ruby
imsplitbit has joined #ruby
KensoDev has joined #ruby
thone has joined #ruby
chittoor has joined #ruby
KensoDev has joined #ruby
apok has joined #ruby
KensoDev has joined #ruby
mneorr has joined #ruby
Sailias has joined #ruby
Guedes has joined #ruby
RORgasm has joined #ruby
mariusbutuc has joined #ruby
Ryougi_Shiki has joined #ruby
chittoor has joined #ruby
ryan0x2 has joined #ruby
sahli__ has joined #ruby
d2dchat has joined #ruby
steg132 has joined #ruby
lorandi has joined #ruby
bean has joined #ruby
josefig has joined #ruby
josefig has joined #ruby
_312matt has joined #ruby
savage- has joined #ruby
kevinbond has joined #ruby
carlyle has joined #ruby
kaiwren has joined #ruby
carlyle has joined #ruby
d3vic3 has joined #ruby
headius has joined #ruby
io_syl has joined #ruby
Radium has joined #ruby
ph^ has joined #ruby
philcrissman has joined #ruby
chittoor has joined #ruby
philcrissman_ has joined #ruby
<MrBar>
hi
ryanf has joined #ruby
jjp has joined #ruby
rippa has joined #ruby
snip_it has joined #ruby
enroxorz has joined #ruby
enroxorz has joined #ruby
joaoh82 has joined #ruby
deception_ has joined #ruby
ckrailo has joined #ruby
<deception_>
New to ruby. Experience in python/c/java. What's a good guide to help me with getting started?
<deception>
Used Xvfd to run headless web app testing with Watir
<deception>
Everything is super clean
samuel02 has joined #ruby
<lectrick>
deception: Python gets some credit but I find Ruby to be the most fun to work with once you get used to it
ceej has joined #ruby
<deception>
It was also easier to get rubygems working vs setuptools w/ python
<lectrick>
deception: Also, ruby code can be extremely clean/readable. Or really dense and clever but concise. There's a lot of room for style/fashion lol
<lectrick>
deception: Don't forget to check out RVM
<deception>
TIL
<samuel02>
I have a method that takes an array it then performs some comparisons on each element in the array, if any of the comparisons return true the method should return true. How do I do it in a nice way?
<lectrick>
deception: It lets you work with multiple versions of ruby and multiple gemsets. You'll also want to look at Bundler for managing gem interdependencies.
<samuel02>
Right now it pushes an element to an array for each true and then returns the negative value of array.empty?
<samuel02>
which doesn't look very nice
MasterIdler has joined #ruby
<rippa>
samuel02: there's already method like that
<lectrick>
samuel02: There's already a method for that
<rippa>
Enumerable#any?
<samuel02>
rippa, which one
<deception>
lectrick: Thanks! Lots of research to do now :)
<lectrick>
samuel02: any?
<rippa>
[1,2,3].any? {|i| i % 2 == 0}
MrGando has joined #ruby
<lectrick>
samuel02: what rippa showed
<samuel02>
thanks! :)
xcvd has joined #ruby
<workmad3>
rippa: .any?(&:even?) <-- much prefer that :)
<workmad3>
but I guess the .any? was the important part, not the method :)
CheeToS has joined #ruby
whyuuse has joined #ruby
cha1tanya has joined #ruby
luckman212 has joined #ruby
lkba has joined #ruby
kenperkins has joined #ruby
<samuel02>
rippa, lectrick, why doesn't this work?
<samuel02>
lectrick, well they are not.. I tried in the console with some sample values and it returns true even if the date passed in is not in the range between any booked_from and booked_to
<rippa>
samuel02: and it should
<rippa>
it returns false if the date is between values
ales has joined #ruby
<samuel02>
rippa, is it something with the fact that it's dealing with DateTime objects?
<rippa>
no, it's your comparison operators
<rippa>
look at them
adeponte has joined #ruby
<rippa>
you are checking if date is earlier than booked_from or later than booked_to
<samuel02>
rippa, they seem ok?
<rippa>
so if your date is between the to dates
<rippa>
it will return false
baroquebobcat has joined #ruby
<rippa>
it seems, that is what you want
<samuel02>
rippa, no I want it to return true if the date parameter is between booked_from and booked_to, am I thinking wrong?
dfamorato has joined #ruby
<rippa>
then change your comparison operators
<rippa>
>= booked from || <= booked_to
dfamorato_ has joined #ruby
samuelk|away has joined #ruby
<lectrick>
samuel02: yes, yes you are haha
<samuel02>
rippa, that doesn't seem to make a difference though, it still returns true for all dates passed in.. maybe something else is wrong
<lectrick>
what rails library allows me to do 1.month.ago ?
jlogsdon has joined #ruby
<td123>
lectrick: activesupport monkey patching the Integer class
<lectrick>
td123: I did require 'active_support' and I still can't do that
<lectrick>
td123: so they either moved it into another type of require or something else
<workmad3>
they modularised it a lot more since rails 3
<workmad3>
so you either pull in the part(s) you need (can't remember what the date stuff is in though) or pull in /all
adeponte has joined #ruby
pygmael has joined #ruby
SphericalCow has joined #ruby
ken_barber has joined #ruby
Poapfel has joined #ruby
axl_ has joined #ruby
<shevy>
hmm
<shevy>
is that a new pattern?
<shevy>
require 'foo/all' ?
metamorfos has joined #ruby
ysiad has joined #ruby
jerg_phone has joined #ruby
ysiad has joined #ruby
davidcelis has joined #ruby
<lectrick>
workmad3: thank you!
kvirani has joined #ruby
<lectrick>
workmad3: for the record the exact one I wanted was "require 'active_support/core_ext'"
afomi has joined #ruby
schovi has joined #ruby
SphericalCow has joined #ruby
SphericalCow has joined #ruby
dhruvasagar has joined #ruby
blueadept has joined #ruby
<lectrick>
samuel02: http://pastie.org/3768870 for an example of your method. you want to swap the <=/>= and you also want to use && instead of ||. I included a test example so you know how to test your own code for validity in the future :)
williamcotton has joined #ruby
joaoh82 has joined #ruby
<lectrick>
samuel02: You basically, for a given datetime and a given event with a start and end time, you want to know if that datetime is BETWEEN the start and end time. In order to test this, the time in question has to be GREATER THAN the start time of the event AND LESS THAN the end time of the event. See how my verbal logic translates directly to ruby operators? :)
quest88 has joined #ruby
ziggles has joined #ruby
<lectrick>
samuel02: (with regards to time values, "greater than" == "later" FYI)
<samuel02>
lectrick, THANKS A LOT!
<samuel02>
lectrick, I totally understand, I just mess it up with all dates and stuff
<lectrick>
samuel02: Hope that helps. I've gotten into a habit of writing tests for even simple methods. It's super easy and you can use that template. Avoids having to test 50 different combinations manually in iRB, too
<shevy>
how do you write tests?
<any-key>
very slowly
<samuel02>
lectrick, yeah, I'm bad at using tests, I do them sometimes but always end up using irb :)
<shevy>
I need to start using tests too, but I dont feel like covering everything with tests
* shevy
mutes the any-key
savage- has joined #ruby
DarthGandalf has joined #ruby
<samuel02>
lectrick, another thing though, how can i extend so that two datetime object with the same date but different time are treated as equal?
<lectrick>
samuel02: shevy: it's too easy not to. like, it really is super-easy
<lectrick>
samuel02: Are you factoring in timezones? :O
<samuel02>
lectrick, nope
<samuel02>
why?
<shevy>
lectrick, AHA OK NOW I UNDERSTAND!!!
wmoxam has joined #ruby
theRoUS has joined #ruby
<lectrick>
samuel02: Well, if you're comparing two times, and these are web users... the web is global so you have to figure that out. For example, 3pm in New York should == 12pm in San Francisco
<davidcelis>
why's everybody yellin
<davidcelis>
stop yellin
<samuel02>
lectrick, yeah well for now the app will only be used in one timezone
<lectrick>
samuel02: For the trivial case of ignoring timezones though, it would be something like require 'date'; datetime_first.to_date == datetime_second.to_date ... but this means that if one fell on 11pm and the next fell on 1am the next day that it would say false... which may not be what you want
<samuel02>
lectrick, I just want the date to be the important thing in the DateTime object, not the time
<lectrick>
ok maybe this is better also require 'date'; datetime_first.utc.to_date == datetime_second.utc.to_date This converts both times to UTC time (GMT time) first
<samuel02>
that sounds like a plan!
<lectrick>
That should return true for datetimes falling on the same day.
<lectrick>
samuel02: If you're in a rails app you don't have to require 'date' as it is already loaded up. I just had to do that in IRB though
cloke has joined #ruby
<samuel02>
lectrick, yep :) thanks a lot
<lectrick>
np
iocor has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
mattyoho has joined #ruby
Q| has quit ["Leaving"]
mattyoho has joined #ruby
araujo has joined #ruby
yekta has joined #ruby
<yekta>
Is there anything like pypi that is a standard name for a hostname for internal gems? (geminabox)
drKreso has joined #ruby
Faris has joined #ruby
mrtheshadow has joined #ruby
macmartine has joined #ruby
moshef has joined #ruby
<lectrick>
Does Ruby do any optimization if all array elements are the same class?
tar_ has joined #ruby
decaf has joined #ruby
<yxhuvud>
uh. What opimizations should that be?
<decaf>
modruby.net doesn't work with www subdomain
linoj_ has joined #ruby
ctp has joined #ruby
visof has joined #ruby
visof has joined #ruby
a4lw has joined #ruby
albemuth has joined #ruby
SegFaultAX|work has joined #ruby
atnight has joined #ruby
io_syl has joined #ruby
apok has joined #ruby
brianpWins has joined #ruby
chimkan has joined #ruby
Araxia has joined #ruby
ed_hz_ has joined #ruby
n1x has joined #ruby
nonotza has joined #ruby
afomi has joined #ruby
adamkittelson has joined #ruby
kaiwren has joined #ruby
f0ster has joined #ruby
greenarrow has joined #ruby
<f0ster>
i am tryign to install a gem(pg), and i get an error from the linker, cant link -lruby_static. I'm looking the in ruby directory in /opt/ and there are many subfolders with static libraries. I am unsure what I have to have in the path /ldconfig for it to link properly with "-lruby_static", does anyone have any recommendations ?
ghanima has joined #ruby
ins\ has joined #ruby
<deception>
I'm reading in order details from a user, first name, last name, etc. I want to store them in a hash. Is it best to store them in temp vars and then put the hash together or just insert them into the hash as I go?
schovi has joined #ruby
dzhulk has joined #ruby
jaywastaken has joined #ruby
<lectrick>
yxhuvud: Well, if every element takes the same amount of memory, than conceivably, indexing an array would be quicker
codespectator has joined #ruby
<alem0lars>
astah
rramsden has joined #ruby
daniel_hinojosa has joined #ruby
robotmay has joined #ruby
johnmilton has joined #ruby
<ged>
f0ster: What command are you using to install pg?
<ged>
f0ster: Just 'gem install pg'?
francisfish has joined #ruby
<ged>
f0ster: And what platform are you installing on?
sam113101 has joined #ruby
<lectrick>
So I was awesome-printing the $: object ($LOAD_PATH) and I found that some elements of that array had a "@gem_prelude_index" hung off them. Any idea what that is for? I have to wonder if it's time to rework LOAD_PATH if we're starting to hang attributes off of string objects
apok has joined #ruby
<kanzure>
is there a way to get the current public key in a ruby session?
daniel_hinojosa has joined #ruby
<yxhuvud>
lectrick: uh. You do realize arrays are stored as an array of *references* to objects. references have uniform size.
<oooPaul>
You're a Python programmer, aren't you? :)
ringotwo has joined #ruby
<deception>
That obvious
<oooPaul>
Line 12, you have an if statement that doesn't have a matching end.
<deception>
It's ported from python
yoklov has joined #ruby
<oooPaul>
And line 18, you have case statement without a matching end.
<oooPaul>
So, like the error says, it was expecting the keyword "end", but got $end (end of file) instead.
<yxhuvud>
lectrick: I suppose one could imagine sort of organizing the objects the references are pointing to in memory to make it better for the caches, but that seems sorta hard.
ales has joined #ruby
nect has joined #ruby
<deception>
oooPaul:Thanks!
<oooPaul>
No sweat, that was easy. ;)
<deception>
Told ya
ringotwo has joined #ruby
<deception>
Anyway to make it more "Ruby"
cbuxton has joined #ruby
<SegFaultAX|work>
I'm trying to set an expectation in rspec on element refernce of a hash. h.should_receive(:[]).with(:a_key).and_return(:a_value) throws a method not found exception for #{}
<SegFaultAX|work>
eRr, #[]
cwang has joined #ruby
<Sou|cutter>
SegFaultAX|work: does :'[]' work?
<SegFaultAX|work>
I thought that h[:a_key] is equivalent to h.[](:a_key)
<SegFaultAX|work>
Sou|cutter: Same error.
brngardner has joined #ruby
rippa has joined #ruby
<Sou|cutter>
huh. That is interesting
<SegFaultAX|work>
Actually hang on, the plot thickens. So what I'm really trying to do is stub out the params hash in a rails controller. If I access the key directly in the spec, everything works as expected.
ukd1 has joined #ruby
<SegFaultAX|work>
So I do: h = {}; controller.stub(:params).and_return(h); h.should_receive(:[]).with(:a_key).and_return(:a_value)
<SegFaultAX|work>
When I execute the controller `get :show`, it errors out with no method found [] for {}:Hash
<Sou|cutter>
FWIW I'm not sure I like that style of using so much mocking and stubbing
<SegFaultAX|work>
Sou|cutter: Well this is an odd case.
<Sou|cutter>
I use those as a last resort usually
* Sou|cutter
nods
<Sou|cutter>
fair enough
voodoofish430 has joined #ruby
<SegFaultAX|work>
Sou|cutter: I have two possible params that are basically the same. eg @myparam = params[:herp] || params[:derp]
<SegFaultAX|work>
I'm trying to ensure that the controller does in fact use :derp if :herp is falsey.
<SegFaultAX|work>
Eg you can supply either, but not both, and :herp always takes precedence.
c0rn has joined #ruby
<SegFaultAX|work>
The cold hard truth is, the client is a mobile app that's already been released. One of the front-end guys responsible for using this API misspelled the param.
adeponte has joined #ruby
<SegFaultAX|work>
So now I have to cover both.
crankycoder has joined #ruby
sako has joined #ruby
<sako>
hey all, what log can i look into to troubleshoot unicorn
<lectrick>
[1,2,3,4,5,6].select(&:even?).map(&3.method(:*)) That last bit just blew my mind. Get the operator method of the particular parameter you want to give to that operator and then convert that to a block which is passed to an enumerator method that accepts blocks?
<sako>
we just had an outage where unicorn initiated a graceful shutdown and i have no idea why?
lorandi has joined #ruby
eeadc has joined #ruby
<lectrick>
sako: Inspect the logs?
nfluxx has joined #ruby
<sako>
lectrick: i am looking at the logs and all i see is idling as long as master is active. . . . . . . .initiating graceful shutdown
<lectrick>
samuel02: I know there's (or there was) quite a few calendar widgets for rails out there already. Usually there is a view component, a JS component and a CSS component
jacktrick has joined #ruby
jenglish has joined #ruby
<lectrick>
samuel02: google "date picker rails". Don't reinvent the wheel. Also, someone already answered your stackoverflow with a similar suggestion
dankest has joined #ruby
deception has quit [#ruby]
tatsuya_o has joined #ruby
<samuel02>
lectrick, yeah I know, I looked in to a few of them but didn't find anything that fit my needs, I don't want a datepicker but a big calendar that displays events and stuff so I used a calendar helper I found on GitHub and customized it for my needs
<samuel02>
lectrick, any link to the similar question on so?
d34th4ck3r has joined #ruby
eywu has joined #ruby
<lectrick>
samuel02: Yeah, that's cool too. Just don't write a new calendar view from scratch. It's boring, hard to get right and eighty other people already did it in a way that you can customize to your needs :)
kpshek has joined #ruby
eywu has quit [#ruby]
ank_ has joined #ruby
tewecske has joined #ruby
nlc has joined #ruby
Radium has joined #ruby
<samuel02>
lectrick, Yeah, the thing is now my helper method produces some html for a calendar but I have to generate new ones dynamically as the user goes back and forth.
berserkr has joined #ruby
williamcotton has joined #ruby
machine2 has joined #ruby
Russell^^ has joined #ruby
hukl has joined #ruby
FACEFOX has joined #ruby
Sailias has joined #ruby
jcromartie has joined #ruby
linoj has joined #ruby
<jcromartie>
anybody else having trouble installing gems right now?
<jcromartie>
gem can't seem to reach any of the gem servers
<SegFaultAX|work>
Sou|cutter: In case you're interested: instead of mocking out the params hash, I just split the logic into multiple specs that verify the `assigns` hash has the correct value.
<SegFaultAX|work>
Sou|cutter: When one, both, or neither is supplied.
<jcromartie>
meh, works now
mengu_ has joined #ruby
ghvandoorn has joined #ruby
dustybrains has joined #ruby
wallerdev has joined #ruby
<sako>
anyone know what this means in the unicorn logs? 2012-04-10_01:56:00.80858 .................
<sako>
i see a lot of .'s after what looks to be the pid?
<f0ster>
ged: i've tried various options for include and lib directories.. installing on ubuntu
danielvdotcom has joined #ruby
<Sou|cutter>
macmartine: Ahhh yes, I know all about that
<f0ster>
--disable-static, --with/without pq
Sailias has joined #ruby
Cache_Money has joined #ruby
<macmartine>
Sou|cutter: do tell :)
shadoi has joined #ruby
troessner has joined #ruby
danielvdotcom has quit [#ruby]
<Sou|cutter>
macmartine: require 'tzinfo'; TZInfo::Timezone.get("US/Pacific").utc_to_local(your_random_time) # you may want to handle TZInfo::PeriodNotFound or TZInfo::AmbiguousTime exceptions
Eldariof-ru has joined #ruby
<Sou|cutter>
something like that
shadoi has joined #ruby
<macmartine>
Sou|cutter: OK, but I can't find how to get that setting ("Your current timezone") for the account using the API
<macmartine>
Sou|cutter: It's not always my account, could be someone else's
strife25 has joined #ruby
<Sou|cutter>
macmartine: oh, I don't know how you are supposed to get a timezone from the api
<Sou|cutter>
ask the user for it?
<macmartine>
Sou|cutter: hmm, there's a way to do it..
<macmartine>
Sou|cutter: thanks for that snippet! I'll keep poking around
<Sou|cutter>
macmartine: FWIW the potential for TZInfo::PeriodNotFound or TZInfo::AmbiguousTime comes from the fact that some times don't exist (because DST jumps time ahead 1 hour), and other times may be able to represent two actual utc times (because of time going back to standard). It's a PITA
<macmartine>
Sou|cutter: ok, sounds fun
<Sou|cutter>
people generally don't think about it because time changes tend to occur around 2am -- but if you're an alcoholic and bars close at 2am, you know about it!
<oooPaul>
Or you're a server software engineer, in which case you start to remember it really quick.
danielvdotcom has joined #ruby
crankycoder has joined #ruby
bbttxu_ has joined #ruby
tomsthumb_ has joined #ruby
Ammar_Frameworks has joined #ruby
kenperkins has joined #ruby
dhruvasagar has joined #ruby
ctp has joined #ruby
kpshek has joined #ruby
jarred has joined #ruby
MrGando has joined #ruby
<shevy>
Long live ruby!
Gonzih has joined #ruby
<oooPaul>
In the immortal words of Franz Ferdinand... "Ruby Ruby Ruby Ruby!"
<shevy>
lol
guns has joined #ruby
d34th4ck3r has joined #ruby
cespare has joined #ruby
MrGando has joined #ruby
MrGando has joined #ruby
shruggar has joined #ruby
brunosaboia__ has joined #ruby
otters has joined #ruby
ed_hz_ has joined #ruby
dzhulk has joined #ruby
perturbedpanda has joined #ruby
trivol has joined #ruby
twinturbo has joined #ruby
OwenOu has joined #ruby
ben225 has joined #ruby
<relix>
hey guys, I'm building a system of two programs: one Ruby on Rails webapp, and one Ruby client
OwenOu has quit [#ruby]
<relix>
they both use ActiveRecord to interface with the DB - they use the same Model code etc for ease of use
<relix>
I was wondering if there's any article or whatever that has some best-practices for this usecase?
<lectrick>
If b = proc {|x| x.even?}, how do I define a method to take b? def meth(&block)? Or if it's implicit, can I just call meth(&b) and it works? Or do I call meth b?
phantomfakeBNC has joined #ruby
<davidcelis>
relix: so youre duplicating your code?
<relix>
right now, I copy the files over manually, and obviously they're duplicated - the webapp and the ruby client each have their own Git repo
<relix>
davidcelis: yes exactly, I'm guessing there must be a better way
<relix>
especially since rapid development is annoying like this
<davidcelis>
relix: what's up with the Ruby client? is it only meant to interface with this Rails app?
pastjean has joined #ruby
dzhulk has joined #ruby
andrewhl has joined #ruby
<relix>
davidcelis: the Rails app is like a dashboard where the admin can configure stuff that is saved in the DB. The ruby client then loads these same settings from the same DB - the client runs on different servers
chimkan has joined #ruby
<davidcelis>
Why does the Ruby client need to communicate with the db? Why not make the Rails app an API that the ruby client interfaces through?
<lectrick>
Basically I want to "def []" on my own object and make it able to take a block
<davidcelis>
lectrick: Add &block as the last argument
<davidcelis>
lectrick: yield to the block at some point in the method to call it
ChampS666 has joined #ruby
KL-7 has joined #ruby
rtdp has joined #ruby
<relix>
davidcelis: because it's double work? why build another system to interface with the data if there already is a proven one (here: the DB)
<relix>
this is all happening on an internal server so security isn't an issue, the clients are running on my own servers
<relix>
internal system*
<davidcelis>
relix: It shouldn't be "building another system"
<davidcelis>
relix: It should be using the system that's already in your Rails app
strife25 has joined #ruby
sacarlson has joined #ruby
iamjarvo has quit [#ruby]
iamjarvo has joined #ruby
ghanima has joined #ruby
luckyruby has joined #ruby
berkes has joined #ruby
Mrono has quit [#ruby]
Dreamer3 has joined #ruby
skammer has joined #ruby
snearch has joined #ruby
brngardner has joined #ruby
<ghanima>
hey guys... I was wondering if I can ask for recommendation for an HTTP Library... It's my understand that the native Net:HTTP library is very slow and that there are other alternatives, but all my searches show that their isn't much information as to options since 2011... I found the following options typhoeus faraday httparty httpclient curb patron em-http.... Does anyone have any recommendations
banisterfiend has joined #ruby
<ged>
f0ster: Weird. I've never seen it try to link against the static ruby library before. Would you mind posting your mkmf.log somewhere?
<f0ster>
ged.. hmm yueah
<ged>
f0ster: Or describing your situation on the mailing list and posting it there? I don't have all that much experience on Ubuntu.
<f0ster>
well now I installed rvm and I had no problem installing pg
<f0ster>
ged, now however, I ahve to type ./script/server else it says cannot load such file -- script/../config/boot
mengu has joined #ruby
<f0ster>
and when i type ./script/server, it says i dont have rails installed, although i just ran the gem command to install rails successfully before that
<f0ster>
probably an RVM issue.. havent used it much
jlogsdon_ has joined #ruby
falsetto has joined #ruby
jlogsdon has joined #ruby
<ged>
Yeah, I've seen similar issues with rvm on occasion. It's brilliant, but not without some idiosyncrasies.
<ged>
Especially when you're using something that already does gem path manipulation like Bundler.
<f0ster>
hmm okay
Targen has joined #ruby
dankest has joined #ruby
n3m has joined #ruby
kenperkins has joined #ruby
dbgster has joined #ruby
<ged>
I have come to distrust Ubuntu's Ruby. It's installed with (IMO) strange paths and options.
<ged>
But like I said, I don't use it that often either, so I'm sure they had good reasons.
td123 has joined #ruby
danielvdotcom has joined #ruby
MrGando has joined #ruby
krz has joined #ruby
<iamjarvo>
when a varaible or method has !! in front of it what exactly is that?
demian`_ has joined #ruby
kjellski has joined #ruby
nurbs999 has joined #ruby
<nurbs999>
hello
<shevy>
damn it
<shevy>
matti, what torrent client were you using?
<shevy>
I forgot
sts has joined #ruby
emmanuelux has joined #ruby
mengu has joined #ruby
<burgestrand>
iamjarvo: a double negative
<burgestrand>
iamjarvo: essentially converts the value into a boolean
<burgestrand>
rarely needed, but sometimes useful
<lectrick>
Can someone explain "curry" to me, in English?
<iamjarvo>
burgestrand: thanks, once i found out what it was called i found it on stackoverflow
looopy has joined #ruby
<bean>
lectrick: currying is the technique of transforming a function that takes multiple arguments in such a way that it can be called as a chain of functions each with a single argument.
nikhgupta has joined #ruby
<lectrick>
bean: How do you write such a function or block?
<burgestrand>
lectrick: you don’t do it very often in ruby
<burgestrand>
Actually, I don’t think I’ve ever seen it used in Ruby, even though we have Proc#curry
<lectrick>
burgestrand: I know. Just curious. Came across it when reading docs
<shevy>
Proc#pepper is faster
nikhgupta has quit [#ruby]
otters has joined #ruby
bean has joined #ruby
uris has joined #ruby
chopmo has joined #ruby
Tomasso has joined #ruby
<Tomasso>
how do you get a copy of an object?
robotmay has joined #ruby
apeiros_ has joined #ruby
<shadoi>
#clone or #dup
<Tomasso>
mm thanks xD
bbttxu_ has joined #ruby
IPGlider has joined #ruby
<sts>
hello folks. is there a way to do something like this? localpart, fqdn = address.match(/^([^@]+)@(.+)$/)
micah has joined #ruby
<micah>
what is the ruby way to move a directory from one filesystem to another
<micah>
File.Rename seems to fail cross filesystems
<sts>
bean: or something else, if you have a better way to do it. :)
<bean>
sts, easy with split. name = "bean@bean.com"; un, fqdn = name.split('@')
<bean>
"
<bean>
sts, also works with regex though. If that regex is valid, you can do, localpart, fqdn = address.match(/^([^@]+)@(.+)$/).captures
<bean>
sts, which is coincidentally the same as .to_a
<sts>
bean: i see, i'd have to look at MatchData instead. thanks
<sts>
:)
ringotwo has joined #ruby
BryanWB_ has joined #ruby
<BryanWB_>
what is an easy way to set vars I can use throughout a minitest testcase?
<BryanWB_>
it have tried putting @vars in add_setup_hook w/out success
<micah>
sts: thanks!
Akuma has joined #ruby
trivol has joined #ruby
<alex__c2022>
anyone have a good example of Rack::Callbacks ? Seems the way I'm using it all the callbacks get called twice ...
<Tomasso>
when you dont need an object anymore.. how do you destroy it?
<lectrick>
undef it?
<lectrick>
or let it go out of scope? :)
<Tomasso>
mm does undef exist?
<Tomasso>
i mean destroy the instance
<lectrick>
actually that's just for methods. for objects just set the variable = nil and the garbage collector should reclaim the former memory on the next pass
slverwing has joined #ruby
nurbs999 has quit [#ruby]
slverwing has quit [#ruby]
<lectrick>
I don't think there's a way to explicitly destroy an object. you just remove all references to it and let the GC handle it
<Tomasso>
oo great thanks
wefawa has joined #ruby
ken_barber has joined #ruby
chopmo has joined #ruby
xcvd has joined #ruby
d3c has joined #ruby
maveoanir has joined #ruby
kpshek has joined #ruby
<lectrick>
If I monkeypatched Array, is there an existing test on Array that I can run to make sure I didn't break anything else? :)
maveoanir has quit [#ruby]
maveoanir has joined #ruby
jeffmess has joined #ruby
chimkan has joined #ruby
ianbrandt has joined #ruby
looopy has joined #ruby
<shevy>
lectrick dont think so
<shevy>
but the question is odd
<shevy>
if you add a method to Array, do you also call that monkeypatching?
<f0ster>
I installed rvm. now when I install gems, nothing shows up under gem list
<shevy>
shows you how good rvm is doesn't i :D
<shevy>
*it
<shadoi>
f0ster: it's likely you're not using rvm to install the gems then.
workmad3 has joined #ruby
<fowl_>
word shevy
<jeffmess>
rvm is sweet.
yekta has joined #ruby
<f0ster>
shadoi: like its using some other gems.. not one that is configured with rvm?
<shadoi>
f0ster: from the docs: rvm 1.8.6,1.9.1 do gem install rspec json --no-rdoc --no-ri
<shadoi>
installs those gems for those rubies
<lectrick>
shevy: I am basically alias_method_chaining [] on Array.
<shadoi>
f0ster: "rvm info" is enlightening also
<f0ster>
thanks shadoi
hashpuppy has joined #ruby
<hashpuppy>
blacking out here... (too much coffeescript). what am i looking for: a["1"] ?= {}
<hashpuppy>
i want to set to {} if it isn't already a hash
<oooPaul>
a["1"] = {} unless a["1"].is_a?(Hash)
iamjarvo has joined #ruby
<fowl_>
||=
strife25 has joined #ruby
ken_barber has joined #ruby
tatsuya_o has joined #ruby
Boohbah has joined #ruby
krusty_ar has joined #ruby
philcrissman_ has joined #ruby
looopy has joined #ruby
td123 has joined #ruby
<Tomasso>
how do i execute a block inside a array and pass its arguments ? [{:flor => do |mycards||pl|
<Tomasso>
end}]
<shevy>
what is that ugly thing there
<shevy>
looks as if a hash tried to evolve into something vaguely resembling a block
<bean>
shevy: word.
<Tomasso>
hahah like used to do in javascript
<shevy>
though I am not sure, what is the four '|' there
<shevy>
is that |mycards OR pl| ?
<shevy>
foo = 5 if foo || bar
<shevy>
:D
<shadoi>
Tomasso: what are you trying to end up with?
<shevy>
[{:flor => do |mycards||pl| end}]
<shevy>
kinda creative
h4mz1d has joined #ruby
<Tomasso>
mm if lets say a = [{:flor => do |mycards||pl| end}] , then i would like to execute that block as a[0](mycards)(pl)
_null has joined #ruby
<shevy>
lol what is that even
<shevy>
I suppose the variable a is an Array, right?
<shevy>
and the first member is a hash
<shevy>
the {}
<shevy>
the key is :flor
<shevy>
but the value... what is the value?
<shevy>
that does not even seem legal syntax to me
<shevy>
I've never seen someone want to decorate an array member with an associated block yet :)
andrewhl has joined #ruby
Natch| has joined #ruby
<shadoi>
Tomasso: you're thinking about it inside out for ruby, you need to create a hash and iterate over something to modify the hash contents.
<Tomasso>
yess a is arrayy
<shadoi>
Don't do it in the hash/array declaration unless you use the "Hash.new do" type syntax.
delinquentme has joined #ruby
<delinquentme>
if i want to open a file and read it... replace a particular string within it
<shevy>
ok Tomasso ... that does not work as syntax then
<shadoi>
Tomasso: in other words, objects aren't prototypes like in Javascript.
<delinquentme>
do I need to open the file in both a r and w capacity?
<shadoi>
delinquentme: yes
<shevy>
a[0] will give you an array. Then you call the () on it, with mycards as the input... that can not work
<delinquentme>
sidenote: this is a multi-line replace so AWK or SED wont work
<delinquentme>
ok so you cant do both a read and a write on a single fine
<delinquentme>
file**
<shadoi>
delinquentme: use "w", it will be read-write
<shadoi>
sorry, w+
<Tomasso>
mm gonna try irb..
<delinquentme>
bingo!
<delinquentme>
shadoi, u win!!!!!!!
<shadoi>
delinquentme: but check out all the rules on the IO doc page
<shadoi>
delinquentme: w+ truncates the file
robotmay has joined #ruby
klaas_ has joined #ruby
<shevy>
you could read the new bytes - and set the old bytes that were already read to ponies :>
<shadoi>
the ruby docs are fine, just use something like gotapi.com to simplify searching for stuff.
<shadoi>
or use pry
<shadoi>
apidock.com is nice too
<shadoi>
I just love the live search gotapi.com has
cpruitt has joined #ruby
<delinquentme>
yeah that looks pretty cool
<ghanima>
Is anyone familiar with the gem typhoeus
visof has joined #ruby
visof has joined #ruby
xrl has joined #ruby
Guedes has joined #ruby
<shadoi>
ghanima: yeah, parallel HTTP lib
<ghanima>
shdoi: I am trying to process fire the body of each request after I execture hydra.run, but I can't tell what is returned by that method
<ghanima>
curious if you know if its a hash or an array
Cache_Money has joined #ruby
BrianE has joined #ruby
<shadoi>
run executes an asynchronous process
<shadoi>
you need to use the callback hooks to make things fire when you want them
<shadoi>
like after_request_before_on_complete do … end
<shadoi>
or on_complete do ... end
<Cache_Money>
I was posed a challenge: write a function that finds the first letter in a string that isn't duplicated somewhere else in the string. This is my code http://pastie.org/3770571 Can anyone come up with a one-liner?
<td123>
havenn: just don't let your current boss catch you forking it
<havenn>
td123: Hope that doesn't bite anyone! I'm freelance so no worries here. =)
<matti>
shevy: rtorrent
<havenn>
td123: My entry is the "Tabby Cat" =P
krz has joined #ruby
strife25 has joined #ruby
afomi has quit [#ruby]
John______ has joined #ruby
VegetableSpoon has joined #ruby
iocor has joined #ruby
albemuth has joined #ruby
Squarepy has joined #ruby
Squarepy has joined #ruby
axl__ has joined #ruby
davidcelis has joined #ruby
ezkl has joined #ruby
ghvandoorn has joined #ruby
flaggy has joined #ruby
axl__ has joined #ruby
apeiros_ has joined #ruby
krzkrzkrz has joined #ruby
BigFatFatty has joined #ruby
pu22l3r has joined #ruby
dfamorato has joined #ruby
jlogsdon has joined #ruby
pu22l3r has joined #ruby
dfamorato_ has joined #ruby
Guedes has joined #ruby
keymone_ has joined #ruby
riyonuk has joined #ruby
<riyonuk>
How can I make an API in ruby? I wrote a simple 30+ line script, and want to make it an API for learning reasons. I'm not finding anything on Google. :/
artm has joined #ruby
<Asher>
riyonuk - what do you take that to mean?
<riyonuk>
I'm not sure really. Where do /users/1 and get a JSON response :)
<Asher>
you mean a REST api?
<Asher>
for web purposes?
<riyonuk>
Yes! (are there non-web purposes? Just curious)
robotmay has joined #ruby
<Asher>
yeah lots of people here won't work with the web and use ruby for other purposes
<Asher>
check out sinatra
<fowl_>
webrick pwns
jaywastaken has joined #ruby
z15tea has joined #ruby
strife25 has joined #ruby
<riyonuk>
wait
<riyonuk>
what
<riyonuk>
ruby for non-web stuff? like, command-line?
<riyonuk>
cause that's pretty much all I know how to do :/
ales has joined #ruby
kvirani has joined #ruby
<shadoi>
riyonuk: try Sinatra for a REST API
<shadoi>
riyonuk: an API is a very vague thing, it just means code that other code can use.
<riyonuk>
Hmm. My understanding it was POST/GET to URLS, so you could interact with that date (most tutorials online are very vague on this subject)
<shadoi>
that's a specific type of API called REST.
<shadoi>
and it uses all of the HTTP verbs: GET, PUT, POST, DELETE
<riyonuk>
I *think* I already know about that. It just records what "state" you were in when you viewed the page, stores it, and when you access the URL, it's as if you never left
<eatnumber1>
I just switched from using sequel's sqlite driver to mysql. Now, my script doesn't exit when the end of the file is reached. I added a call to exit at the end of the file and the script still doesn't exit. I added a call to exit! at the end of the file and the script exits. What's going on?
<shadoi>
apparently you have a blocking call, figure out which one it is.
camilo has joined #ruby
n1x has joined #ruby
<eatnumber1>
shadoi: a blocking call?
_adeponte has joined #ruby
<shadoi>
eatnumber1: something that never returns or takes a really long time.
<eatnumber1>
but my script reaches the end of the file
snip_it has joined #ruby
<shadoi>
not all the threads
<shadoi>
or possibly you're rescuing the SystemExit exception for some reason
<shadoi>
exit! bypasses that
<eatnumber1>
I'm not doing that
<eatnumber1>
maybe a library is
<eatnumber1>
I'm also not starting any threads
<eatnumber1>
but again, maybe a library is
<eatnumber1>
is it possible to see all the running threads
<shadoi>
yeah something maybe created an exit handler somewhere using "at_exit" that hangs
<shadoi>
Thread.list
moshee has joined #ruby
hadees has joined #ruby
ryan_dev70 has joined #ruby
dhruvasagar has joined #ruby
RORgasm has joined #ruby
mrtheshadow has joined #ruby
cbuxton has joined #ruby
cbuxton has quit [#ruby]
cbuxton has joined #ruby
strife25 has joined #ruby
cbuxton has joined #ruby
cbuxton has quit [#ruby]
Guest71832 has joined #ruby
Guedes has joined #ruby
<eatnumber1>
shadoi: I figured it out. My mysql-connector was broken.