fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
<daftspunk>
shevy: no i haven't thankyou. i had no idea ruby was japanese invented either. i love japanese products, my middle name is ruby, all signs to this language
Matt_S_G has joined #ruby
<Rezwan>
wow
ianbrandt has quit [Quit: ianbrandt]
<shevy>
back when I was writing PHP for almost 2 years, I wanted a better language and I chose between python and ruby
<shevy>
that interview was what made me try out ruby first
<Rezwan>
reading it right now!
<shevy>
daftspunk, these days, matz is working on mruby (minimal ruby, for embedded things), you can "watch" him add code :D 3 hours ago ... https://github.com/mruby/mruby/
<shevy>
but mruby is kinda limited ... no load() nor require()
<Rezwan>
daftspunk: are you learning Ruby?
centipedefarmer has joined #ruby
<daftspunk>
Rezwan: considering it
<Rezwan>
me too!
<centipedefarmer>
hi what can/should I do about this? Unable to resolve dependencies: google-api-client requires addressable (>= 2.2.3), faraday (~> 0.7.0), launchy (>= 2.0.0); autoparse requires addressable (~> 2.2.3); signet requires addressable (>= 2.2.3), faraday (~> 0.8.1), jwt (>= 0.1.5)
<Rezwan>
shevy: what is the best place to start learning Ruby do you think?
<rking>
Help a n00b out? I'm trying to remember how to access a class's instance variables. Obviously this won't work, because inside y() self is the instance, not the class; https://gist.github.com/50017e275555621d1f5d
<centipedefarmer>
ClassName.variablename
<shevy>
Rezwan well. only real way is to write rbuy code on your own really
<shevy>
*ruby
<krz>
how do i subtract 5 minutes from Date.today ?
<rking>
centipedefarmer: Ahh, odd. I wouldn't have guessed.
byronb has joined #ruby
byronb has quit [Excess Flood]
<ddouglas>
OK, to the Array class I go then
<centipedefarmer>
you might have to write an accessor method on the class, i'm not sure
<centipedefarmer>
thing is, I have no such gem installed as signet
baroquebobcat has joined #ruby
<daftspunk>
Tasser: what is the syntax? implements class_one, class_two, etc. ?
<rking>
centipedefarmer: Then it's probably further down in the dependency chain.
<centipedefarmer>
anyone have any idea what's going on with this? I already have this gem installed on another similar with the same version of Ruby and it installed fine there
<rking>
centipedefarmer: Try to install them one at a time until you see what is the issue.
<centipedefarmer>
this same app, even
<Tasser>
daftspunk, there is no static typing
nari has quit [Ping timeout: 264 seconds]
<centipedefarmer>
the only one i'm really trying to install is google-api-client
mikepack has quit [Remote host closed the connection]
mneorr has quit [Quit: Leaving.]
linoj has joined #ruby
<rking>
centipedefarmer: Maybe they goofed, or something in one of the deps changed unexpectedly. Plan on getting your hands dirty digging around github versions of various gems.
<daftspunk>
Tasser: i'm not sure i follow
<centipedefarmer>
ugggh
<centipedefarmer>
f*ckers
<centipedefarmer>
this installed fine on another server. admittedly it was, oh fgeez, a month ago
v0n has quit [Client Quit]
v0n has joined #ruby
<centipedefarmer>
but of course as soon as I want to turn artound and dpeploy the same thing to the _production_ server, then it's f*cked, of course. stuff like this makes me want to hang this crap up and become a truck driver.
<rking>
Hrm. Could be any one of a number of things. Are you 100% sure it's the same source?
<rking>
centipedefarmer: If it's that dire, just copy the gems from the other server. =)
darren has joined #ruby
<centipedefarmer>
hmmmmm....
ZachBeta has joined #ruby
<rking>
centipedefarmer: Hehe. I pretty much did that literal thing, and the non-programming parts of programming were definitely a factor. It's not worth giving up, I decided. =)
<daftspunk>
Tasser: found it, define with module, mixin with include, is that right?
benson has quit [Read error: Connection reset by peer]
<centipedefarmer>
need to add that as a source methink
<shevy>
daftspunk yes
<shevy>
a module can act like a functional skeleton
<daftspunk>
w00t php cant do that!
<shevy>
yeah but really the biggest difference is the philosophy and that ruby code is poetry
<rking>
centipedefarmer: I thought Github was getting out of the gem hosting business?
<centipedefarmer>
yeah i got into programming because i like programming, aparently that was a mistake :D
<centipedefarmer>
maybe they are, i probably missed that news
<centipedefarmer>
anyway adding it didn't help
<rking>
I'd seriously think about copying them.
<centipedefarmer>
yeah
<shevy>
rking man what's up with you lately
<centipedefarmer>
i'm just... what's this signet?
<shevy>
your mojo kinda ... disappeared :(
tiripamwe has quit [Ping timeout: 264 seconds]
jjbohn has quit [Quit: Leaving...]
<centipedefarmer>
hmm, I checked the staging environment where this is already installed, it has signet 0.3.4. Thought maybe I could try installing that specific version on the new environment, like maybe whatever depends on signet is not being specific enough and causing rubygems to try to install a newer version
<centipedefarmer>
wonder if there's someone i should tell about this
<shevy>
perhaps the signet owner
Liothen has quit [Read error: Connection reset by peer]
i0n has joined #ruby
jmcphers has joined #ruby
liluo has quit [Remote host closed the connection]
<centipedefarmer>
heh. yeah looking at the google-api-gemspec on github, it seems to be asking for a 0.3 version of signet, so I don't know why gem was trying to give me the 'latest'
<centipedefarmer>
oh well
yoklov has quit [Quit: bye!]
<centipedefarmer>
oh wait no ot says >=0.3.1 not ~>
<centipedefarmer>
ah.
cakehero has joined #ruby
hunglin has joined #ruby
<centipedefarmer>
it's been changed to ~>0.3.0 since but that isnt released yet
<centipedefarmer>
or maybe not. this is confusing. never mind, i'll leave off my ramblings.
artOfWar has quit [Remote host closed the connection]
davidcelis has quit [Quit: K-Lined.]
<shevy>
as long as you keep those centipedes floating
classix has joined #ruby
xaq has quit [Remote host closed the connection]
josefig has quit [Ping timeout: 272 seconds]
jrajav has joined #ruby
cousine has joined #ruby
justsee is now known as justsee|away
drago757 has joined #ruby
ryh has joined #ruby
minijupe has quit [Quit: minijupe]
nateberkopec has quit [Quit: Leaving...]
MatthewGA_ has quit [Quit: Leaving]
iamjarvo has joined #ruby
adeponte has quit [Remote host closed the connection]
codeman has joined #ruby
adeponte has joined #ruby
justsee|away is now known as justsee
Cool_Fire has joined #ruby
<Cool_Fire>
Hello
sailias has joined #ruby
adamkittelson has quit [Read error: Operation timed out]
ciopte7 has quit [Quit: ciopte7]
<Cool_Fire>
I wanted to confirm that a case/when statement is broken down to the same thing as an if/elsif statement by the interpreter. Is this correct?
ggreer has quit [Excess Flood]
hunglin has left #ruby [#ruby]
mxweas has joined #ruby
classix has quit [Remote host closed the connection]
AngryParsley has joined #ruby
AngryParsley has quit [Excess Flood]
AngryParsley has joined #ruby
AngryParsley is now known as ggreer
linguini has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ZachBeta has quit [Quit: Computer has gone to sleep.]
exchgr has joined #ruby
cousine has quit [Remote host closed the connection]
bosent has joined #ruby
<bosent>
hi
<Rezwan>
hi Bosent
<fowl>
welcome to the ruby
ciopte7 has joined #ruby
<bosent>
hi thanks guys
<drago757>
hello gentlemen
artOfWar has joined #ruby
<drago757>
how is everyone this evening
<jrajav>
Cool_Fire: I'm not sure about the internals, but from a language standpoint, yes they are equivalent
<bosent>
I am trying to start a project and was looking for some talented programmers who may want to join
<Rezwan>
drago757: fine :) even it's morning over here! ;p
artOfWar_ has joined #ruby
<drago757>
I'm very excited I am finally getting back into programing
<drago757>
and I am planing on making ruby one of the three lang I focus on
<drago757>
i need to work on my regex
<Rezwan>
awesome
<bosent>
no one is interested?
<drago757>
bosent
<bosent>
compensation obv
<drago757>
i am
<Cool_Fire>
jrajav: Yeah, I'm just trying to figure out if using one over the other is going to give me any performance difference.
<drago757>
but I am a newbie
<drago757>
Rezwan how did you become a good coder
adeponte has quit [Remote host closed the connection]
<Rezwan>
drago757: I'm not a good coder yet. but hopefully to become. yet a complete newbie!
<Cool_Fire>
A simple benchmark I wrote seems to indicate the difference is negligible
<Cool_Fire>
Certainly not statistically significant
<Rezwan>
bosent: I think better you post it on a message board
savage-_ has quit [Ping timeout: 244 seconds]
<jrajav>
Cool_Fire: 1) No. 2) You're optimizing *way* too early and worrying about a very trivial construct
artOfWar has quit [Ping timeout: 240 seconds]
<bosent>
you could be right
<bosent>
thought it would be worth a shot
liluo has joined #ruby
<jrajav>
If performance is so important to you that you're worried about the relative speeds of difference branching constructs (which aren't actually different), why are you even writing this application in Ruby?
<Cool_Fire>
When optimizing it's never too early or too trivial ;)
<jrajav>
Yes, yes it is ;)
<jrajav>
You risk obfuscating your code and making it less maintainable by overoptimizing -- not to mention the time you waste and the stress you suffer
<Cool_Fire>
Also, realistically it doesn't matter in this specific case no. But as high performance computing is my profession it's comes natural to me to worry about it
drPoggs has joined #ruby
<jrajav>
Again, why are you even using Ruby then?
lupine_85 has joined #ruby
<Cool_Fire>
Because Ruby is fun to write
<jrajav>
Dynamically typed languages are going to suffer an order-of-magnitude performance hit already, and Ruby doesn't even perform that well in that category
<krz>
why does (3.hours.ago..Time.now.utc).map { |time| { :hour => time.hour } }.uniq return the results: [{:hour=>22}, {:hour=>23}, {:hour=>0}, {:hour=>1}] but with the following messages: /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.2/lib/active_support/time_with_zone.rb:328: warning: Time#succ is obsolete; use time + 1
<jrajav>
So write clear, maintainable code instead of worrying about tiny, irrelevant performance gains
<Cool_Fire>
<Cool_Fire> Also, realistically it doesn't matter in this specific case no. <- that
<jrajav>
Right, I'm just trying to give you some general advice
<Cool_Fire>
It's not so much a concern as it is a point of interest
<Cool_Fire>
And if I'm writing something serious it's usually in C yeah
<Cool_Fire>
(or Java actually)
erichmenge has quit [Quit: Be back later]
erichmenge has joined #ruby
janelwang has joined #ruby
<FriarTech>
Cool_Fire: C but not C++?
<jrajav>
Why would you use C++ for anything ever
<Cool_Fire>
^ Besides that :p
erichmenge has quit [Client Quit]
<Cool_Fire>
No, I've never really used C++ for such things
<krz>
anyone?
<FriarTech>
Why? I use C C++ Ruby Python Perl ----whatever I choose or projects I join
erichmenge has joined #ruby
<FriarTech>
Not that its worth a debate - was just wondering
bglusman has quit [Remote host closed the connection]
<cmyers>
I never wrote a lot of C. I feel like if I needed performance *and* had to write it "every day as part of my job", I would greatly prefer C++ to C for scoping, type safety, etc.
apok has quit [Ping timeout: 244 seconds]
<FriarTech>
Sorta depends on the project
<cmyers>
is the perf benefits of C over C++ really that significant (even given I've already said a situation where perf is "important")?
<Cool_Fire>
For me personally it's more a matter of familiarity. I've written C++ a few times. I've done a lot more C though
erichmenge has quit [Client Quit]
erichmenge has joined #ruby
<FriarTech>
Perf of C over C++ is within 5% whatever that means - but that's in the spec of C++
<cmyers>
I think for a pet project it's not that relevant, but I've seen a lot of C++ enterprise code, and some C enterprise code too, and I know which I'd ratehr maintain =D
<jrajav>
The performance difference between C and C++ is completely negligible, and both are second only to Fortran and assembly (for the most part)
<FriarTech>
Meaning c is slightly faster
alexim has quit [Quit: sleep]
<jrajav>
No, the reason you don't write in C++ is because it's nonsensical and bloated and utterly obfuscated
justsee has joined #ruby
<jrajav>
If you want object-oriented, go with Objective-C
<FriarTech>
I C
ryh has quit [Remote host closed the connection]
<FriarTech>
ugh objective c
<cmyers>
obfuscated, really? Hmm.
<Cool_Fire>
I must say, when I write C++, it usually comes out looking an awful lot like C
<Cool_Fire>
XD
erichmenge has quit [Client Quit]
<jrajav>
^ That too
erichmenge has joined #ruby
<jrajav>
It's not even *designed* to write pure object-oriented code in, just to "wrap" imperative C code
<Cool_Fire>
It's unpleasant to write imo.
<jrajav>
cmyers: Yes, obfuscated
<FriarTech>
But of all the languages I really ENJOY ruby....
<jrajav>
cmyers: Have you ever worked with a heavily template-based framework?
<heftig>
C++ has horrible compile-time performance
<FriarTech>
heftig :)
erichmenge has quit [Client Quit]
<cmyers>
Yes, but it was written in a careful enterprise environment with top-notch c++ d00ds, and was carefully reviewed
Hanmac has quit [Ping timeout: 255 seconds]
erichmenge has joined #ruby
nadirvardar has quit [Quit: Computer has gone to sleep.]
<cmyers>
the same company had millions of lines of perl
<heftig>
nobody sane would export C++ interfaces from shared libraries
<cmyers>
and every line was fucking beautiful
<jrajav>
I have written many applications in both C++ and Java, both hobby and professional
pdtpatrick has quit [Quit: pdtpatrick]
<jrajav>
I loathe both for various reasons
<cmyers>
so perhaps the relevant argument is comparative ease, rather than what is possible.
devth_ has quit [Remote host closed the connection]
<i0n>
hi
joshman_ has joined #ruby
linoj has quit [Quit: linoj]
<i0n>
File.stat(file).mtime > Time.now-3600 is saying if files mtime is greater than 3600 seconds?
justsee|away is now known as justsee
ryh has quit [Remote host closed the connection]
<i0n>
compared to current time *
wjimenez_5271_ has joined #ruby
<wjimenez_5271_>
hi
balki_ is now known as balki
darren has joined #ruby
<wjimenez_5271_>
it seems I am getting an error when converting a variable to an integer that is 0
<wjimenez_5271_>
the variable value is being set by the output of a bash command: %x[virsh list |grep i-|wc -l]
<wjimenez_5271_>
but when it is 0, it seems to crash my program
<wjimenez_5271_>
any value other than 0 it works fine
<cloud|office>
I have an array which has data in this format - {"name1"=>"value1", "name2"=>"value2" } , {"name3"=>"value3", "name4"=>"value4"} How can I split it so that all of it comes like {"name1"=>"value1", "name2"=>"value2", "name3"=>"value3"} like in a serial way! http://pastebin.com/cdeDhz0E
<wjimenez_5271_>
wondering if there is a graceful way to handle situations when it is 0
Beoran_ has joined #ruby
khakimov has joined #ruby
<wjimenez_5271_>
thinking begin, rescue, end?
sent-hil has quit [Remote host closed the connection]
<EstanislaoStan>
bnagy: Thanks, that helped me solve an issue that had me stumped for quite a while.
sgronblo1 has joined #ruby
<bnagy>
wjimenez_5271_: why would 0 not convert? Can you give an example of the faulting input and the failure message?
sent-hil_ has joined #ruby
sent-hil_ has quit [Remote host closed the connection]
<bnagy>
personally, I would just shell out to virsh list and handle the rest in ruby, btw
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<wjimenez_5271_>
and yea, you're right it probably does make more sense to do the counting in ruby
<bnagy>
so kvm_instances there will be something like " 0\n"
kawa_xxx has quit [Remote host closed the connection]
<bnagy>
you might want to use to_i on that first
pdtpatrick has quit [Client Quit]
<wjimenez_5271_>
well, it should just be a number like '0' or '25' b/c i am calling the word count command which should just output numbers
kawa_xxx has joined #ruby
<wjimenez_5271_>
yea, good point I'll try that
<bnagy>
no, it won't
sgronblo1 has quit [Ping timeout: 240 seconds]
<bnagy>
it outputs a string
Tomasso has quit [Ping timeout: 272 seconds]
<wjimenez_5271_>
oh I see, so the output technically has a newline in it b/c it is bash
gtuckerkellogg has joined #ruby
Banistergalaxy has quit [Ping timeout: 246 seconds]
<bnagy>
to_i _should_ be smart enough to ignore all the spaces and newlines
hunglin has quit [Quit: Leaving.]
_justin has joined #ruby
<bnagy>
but if you want to be paranoid you could do [.... | wc -l].strip.to_i
<cloud|office>
bnagy: I need to match the values to values in some other table, like one table will consit the "remarks" and get the values from the array of hashes corresponding to remarks http://pastebin.com/vF8NKMDy
<cloud|office>
the pastebin contains beter description of what I wrote
crankycoder has joined #ruby
crankycoder has quit [Remote host closed the connection]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
TPFC-SYSTEM has joined #ruby
crazed has joined #ruby
<crazed>
what's the proper way to do something like "00:00".gsub(/:/, '\\\1')
<crazed>
where the result is 00\\:00
<crazed>
seems \\\1 doesn't do what i want
<bnagy>
try adding more backslashes
<bnagy>
if in dount, MOAR BACKSLASH
<crazed>
what
LBRapid has quit [Read error: Connection reset by peer]
mahmoudimus has joined #ruby
<crazed>
more slashes aren't going to fix my problem
<crazed>
just not sure how to do what i want
savage- has joined #ruby
banisterfiend has quit [Remote host closed the connection]
<bnagy>
hm, weird
<bnagy>
maybe block form "00:00".gsub(/:/) {|s| "\\\\#{s}"}
<i0n>
so the if conditional is asking "is compare_file_to_1hour true?" .. since it is true then puts prints the file names... but what i dont understand is HOW puts knows which files passed the time compare?
rbanffy_ has quit [Read error: Connection reset by peer]
rbanffy_ has joined #ruby
<bnagy>
because Dir.foreach passes directory entries one by one into the block
<i0n>
so the block is always iterating?
<bnagy>
where each one is referred to by the variable 'file'
<cloud|office>
if there is a hash like array5 = {"hello"=>0, "hello1"=>0, "hello2"=>0}
<cloud|office>
how can I increase the values of "hello" or "hello1"
piotr_ has joined #ruby
hubub has joined #ruby
<hoelzro>
array5['hello'] += 1?
<apeiros_>
i0n: '/\//' is a string, not a regex, you realize that?
<apeiros_>
cloud|office: why do you call your hash `array`?
<hoelzro>
also, why is the hash stored in a variable called 'array5''?
workmad3 has joined #ruby
<apeiros_>
an array is not a hash, and a hash is not an array…
<i0n>
apeiros_: nope.. I didnt
<i0n>
apeiros_: guess i need " " ?
<apeiros_>
i0n: ok, then that's probably your issue. a regex is /regex/, not 'regex'
<apeiros_>
i0n: also for future reference "what am I doing wrong" is a lousy problem description
<apeiros_>
i0n: you should tell: what you do (that part you did, props!) what input you have, what output you get, and why you consider your output/result to be wrong
EstanislaoStan has quit []
monkegjinni has joined #ruby
<i0n>
apeiros_: I have an array, you can see here http://pastie.org/private/nd0ruiofjblqhuckp2muja.. The output is listed in the pastie as well.. I am trying to split and grab the end so.. chicken, lazy and cara
nari has joined #ruby
Stormbytes has joined #ruby
cantonic has joined #ruby
Stormbytes has quit [Client Quit]
<i0n>
apeiros_: and you alreayd told me my answer
rushed has quit [Quit: rushed]
<i0n>
apeiros_: results in what i want.. >> array.each { |files| puts files.split(/\//).last }
<i0n>
apeiros_: thanks
ciopte7 has quit [Quit: ciopte7]
bigkevmcd has joined #ruby
cantonic has quit [Client Quit]
Eldariof-ru has joined #ruby
jimeh has joined #ruby
apeiros_ has quit [Remote host closed the connection]
sepp2k has joined #ruby
mengu has joined #ruby
arturas has quit [Remote host closed the connection]
bigkevmcd has quit [Quit: outta here]
jhunter has quit [Ping timeout: 272 seconds]
bigkevmcd has joined #ruby
virunga has joined #ruby
jhunter has joined #ruby
luckyruby has quit [Remote host closed the connection]
bigkevmcd has quit [Client Quit]
und3f has quit [Ping timeout: 244 seconds]
br4ndon has joined #ruby
timonv has joined #ruby
chichou has quit [Remote host closed the connection]
bigkevmcd has joined #ruby
m104 has joined #ruby
chichou has joined #ruby
Kuro has joined #ruby
BiHi has joined #ruby
arkiver has quit [Ping timeout: 252 seconds]
Ionic` has quit [Ping timeout: 272 seconds]
Spooner has joined #ruby
arkiver has joined #ruby
vlad_starkov has joined #ruby
arkiver has quit [Max SendQ exceeded]
tfittsy has joined #ruby
arkiver has joined #ruby
Derander has quit [Ping timeout: 248 seconds]
ViperMaul has joined #ruby
arkiver has quit [Max SendQ exceeded]
Rizzle has quit [Ping timeout: 255 seconds]
arkiver has joined #ruby
tfitts has quit [Ping timeout: 252 seconds]
m104 has quit [Quit: Leaving...]
Rochefort has quit [Read error: Connection reset by peer]
Rochefort has joined #ruby
Derander has joined #ruby
Rochefortes has joined #ruby
robozahn has quit [Ping timeout: 265 seconds]
monkegjinni has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
workmad3 has quit [Ping timeout: 252 seconds]
Rochefort has quit [Ping timeout: 252 seconds]
pskosinski has joined #ruby
zemanel has quit [Quit: Remote hottie closed the connection]
arturaz has joined #ruby
monkegjinni has joined #ruby
brianpWins has quit [Quit: brianpWins]
banisterfiend has quit [Read error: Connection reset by peer]
und3f has joined #ruby
banisterfiend has joined #ruby
monkegjinni has quit [Remote host closed the connection]
cezar has joined #ruby
<virunga>
HI, who did install mountain lion? I saw that the default ruby version is still the 1.8.7 :(
<workmad3>
beginner rails books do tend to be boring if you know anything at all about ruby or web development
chussenot has joined #ruby
hubub has quit [Read error: No route to host]
<workmad3>
i0n: you can't have arguments with default values before arguments without default values in a parameter list
<i0n>
ahhh
<i0n>
thanks, much appreciated
arkiver has quit [Ping timeout: 272 seconds]
AlbireoX is now known as AlbireoX`Away
Speed has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
berserkr has joined #ruby
sent-hil_ has quit [Remote host closed the connection]
Criztian has joined #ruby
kawa_xxx_ has joined #ruby
<virunga>
i'd like learn to rails but the fact i have to pay to put online a small site stops me.
kawa_xx__ has joined #ruby
<virunga>
(sorry for the bad english :P)
Banistergalaxy has joined #ruby
<hoelzro>
virunga: well, you could always deploy a simple web application on your laptop or desktop
<virunga>
true
<workmad3>
virunga: or you could use a free heroku instance
<hoelzro>
I'd suggest starting that way
CaptainJet has quit []
<hoelzro>
workmad3: ah, good suggestion
hubub has joined #ruby
kawa_xxx has quit [Ping timeout: 246 seconds]
<workmad3>
virunga: or redhat openshift
<virunga>
workmad3: but i see that one web dyno on heroku costs 36 dollars
<virunga>
i'll give a look at openshift
<workmad3>
virunga: you're not reading well enough... you get free time on heroku
kawa_xxx_ has quit [Ping timeout: 240 seconds]
monkegjinni has joined #ruby
<virunga>
i'll go deeper
anderse_ has joined #ruby
<workmad3>
virunga: which is why, if you go to the pricing site here with 1 dyno: http://www.heroku.com/pricing#1-0 it says 'monthly 720hrs - free 750 hrs'
<virunga>
thanks
<workmad3>
virunga: for a total monthly cost of 0 ;)
<virunga>
ops u're right
<virunga>
awkward
<virunga>
so the first 750 hr are free
<workmad3>
750 hours free each month
<workmad3>
per app
<virunga>
nice
<workmad3>
yeah, it's nice and easy... it has various limitations (such as no user file upload storage), and they automatically shut down 1 dyno apps if they're inactive for a period of time, after which the first request spins the app up again but takes a while
<workmad3>
but for playing around and getting stuff out there, heroku is pretty nice and easy :)
<virunga>
workmad3: heroku vs openshift? what's your choise?
robozahn has joined #ruby
artOfWar_ has quit [Ping timeout: 272 seconds]
monkegjinni has quit [Remote host closed the connection]
<virunga>
shevy: i saw you in the bioruby channel, do you work in that environment?
<workmad3>
virunga: not really got a preference... I'm more familiar with heroku, but from my limited playing around with openshift that has some really nice features that heroku doesn't
<workmad3>
virunga: but not quite as smooth a process from my limited experience
<workmad3>
virunga: as with almost all questions, the answer is 'it depends' :)
<shevy>
virunga in some ways
<shevy>
virunga but bioruby confuses me
chussenot has quit [Remote host closed the connection]
<virunga>
workmad3: true. thanks for the help, i'll start a little project then.
<virunga>
shevy: the project confuses you?
chussenot has joined #ruby
monkegjinni has joined #ruby
<shevy>
yeah
<shevy>
it seems hard to use
<shevy>
when I make a break like 2 weeks, I need to look at the docs again in order to use it
<virunga>
:D wow
elhu has quit [Ping timeout: 250 seconds]
<virunga>
shevy: where are you from?
<shevy>
vienna
elhu has joined #ruby
zemanel has joined #ruby
flype has joined #ruby
<virunga>
when i went to bed this night the channel was in full activity.. now they're sleeping and we're here
<virunga>
XD
ramblex has joined #ruby
<virunga>
relax
jjang has quit [Remote host closed the connection]
apeiros_ has joined #ruby
<apeiros_>
i0n: yes, I said "for future reference"
<apeiros_>
I told you how you can improve your question the next time. better questions yield better answers.
<shevy>
The UK is an island on its way to the USA, doesn't count for european time anymore :P
<Muz>
No shit.
<Kwpolska>
Unfortunately.
<Muz>
If you want to be picky, GMT != UTC either.
<shevy>
I hate summer/winter time switches btw
<Kwpolska>
shevy: not quite right… The Nazis changed time in the countries they invaded. They didn’t get to the UK.
<Muz>
I believe this discussion has just been Godwon.
<shevy>
lol
<oddmunds>
hehe
<shevy>
the only bad part about UK is that the guys there are driving the wrong way
<i0n>
I'm attempting to set an array by calling a method and pass that variable into another method. http://pastie.org/private/xtsij3tvwxicpteh64dda . In irb these variables return the expected values, I'm not exactly sure if something is out of scope but I can't seem to pass these objects into my zip method.
<shevy>
i0n, why is your indent so off in that pastie
Richie has joined #ruby
<shevy>
Zip::ZipFile.open has indent level of like 6 ' ' chars or more
<shevy>
glob = File.jo has indent 0
<shevy>
wtf man
<hoelzro>
i0n: commas on line 22?
<hoelzro>
I think Ruby is interpreting it as zipup(aname(aloc))
kawa_xx__ has quit [Remote host closed the connection]
<shevy>
next, where is the , character i0n
RichieEvan has quit [Client Quit]
AlbireoX`Laptop has quit [Remote host closed the connection]
RichieEvan has joined #ruby
bullicon has joined #ruby
kawa_xxx has joined #ruby
<shevy>
"Use two spaces per indentation level."
<shevy>
this one I agree with
<shevy>
"Indent when as deep as case" also agree
<shevy>
"Use empty lines between defs and to break up a method into logical paragraphs." dont agree
* Kwpolska
is using 4 spaces, it’s more readable
<shevy>
"Align the parameters of a method call if they span over multiple lines." agree
<shevy>
Kwpolska I dont see a real difference to 2 spaces
<i0n>
hoelzro: im not seeing these commas :/
strnx has quit [Excess Flood]
<shevy>
exactly i0n
<i0n>
ah
<virunga>
lol
<shevy>
foo(arg1,arg2)
<shevy>
is not the same as
<shevy>
foo(arg1 arg2)
<shevy>
nor
<shevy>
foo arg1 arg2
<hoelzro>
i0n: that's the problem
<shevy>
do you see it now?
<i0n>
sigh i dont know.. `open': wrong number of arguments (3 for 2) (ArgumentError)
<Muz>
10:23 < shevy> "Use empty lines between defs and to break up a method into logical paragraphs." dont agree # why not, out of curiosity?
<workmad3>
Kwpolska: I find 4 spaces less readable nowadays
blacktulip has joined #ruby
<virunga>
me too
<workmad3>
Kwpolska: eyes need to scan too far to the right and left when changing indent levels
<Kwpolska>
workmad3: 4-spaced code is more readable, and I always follow PEP 8 where applicable. And it wants 4-space tabs.
peterhellberg has joined #ruby
<shevy>
Muz I tend to have extremely small/short methods, and following that would mean that a method, that has 5 lines of code, would suddenly have 7 lines in total (two newlines splitting up)
<shevy>
(I included def and end, so actually 3 lines of code)
M- has quit [Quit: This computer has gone to sleep]
<Kwpolska>
shevy: one newline is enough.
<shevy>
but the example there has two
<Muz>
shevy: http://pastie.org/4341562 that's how I interpreted it as suggesting one should format code. Whch makes sense to me.
<shevy>
Muz yeah but that was not the example
<vectorshelve>
I added a new gem into my Gemfile and now when I run bundle install, its installing the gem into vendor... any idea why ?
<vectorshelve>
shevy: ^^
<workmad3>
Kwpolska: 'more readable' is subjective
<shevy>
def some_method
<shevy>
data = initialize(options)
<workmad3>
Kwpolska: so please don't dictate to me what is and isn't more readable
<shevy>
(NEWLINE)
<Kwpolska>
workmad3: I can read 4-spaced code better, and usually write such code. Notable exception: interactive mode.
<shevy>
data.manipulate!
<shevy>
(NEWLINE)
<i0n>
this damn thing keeps saying wrong number of arguments 3 of 2
<shevy>
data.result
<shevy>
end
<workmad3>
Kwpolska: that's better :)
<Muz>
shevy: oh jesus, just saw that example. Yeah, that's atrocious.
tonini has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 250 seconds]
<Kwpolska>
shevy: do not paste code here, as it is unreadable.
<Muz>
Use newlines as sparingly and appropriately as comments. ¬_¬
<shevy>
Kwpolska please stop being a 10 year old
<shevy>
Muz well what about a method definition, then a newline, then code, then newline, then "end"
<workmad3>
shevy: I'll sometimes split up a test into setup, empty line, test, assertions
<Muz>
shevy: also trribad.
<shevy>
hmm
<i0n>
im going to punch something
<i0n>
ive been at this for hours and hours
<shevy>
the cat
<vectorshelve>
shevy: I lveo kids :)
<shevy>
punch the cat
ntfox has joined #ruby
<workmad3>
shevy: but generally only when the setup is a few lines... and then I'll probably try and pull it out the test itself anyway :)
<shevy>
oh
<i0n>
dont have one, have a fish though.
lxsameer has joined #ruby
<shevy>
vectorshelve, I mixed you up with virunga
<vectorshelve>
shevy: cute ;)
<vectorshelve>
I added a new gem into my Gemfile and now when I run bundle install, its installing the gem into vendor... any idea why ? shevy
<shevy>
ack
<shevy>
you should not ask me, I avoid bundler like the plague
<i0n>
whats wrong with my code shevy
<shevy>
everything
<shevy>
also where is your code?
<i0n>
fawk
lxsameer has quit [Max SendQ exceeded]
<shevy>
your updated code
<shevy>
not the version from 1 hour ago
lxsameer has joined #ruby
<vectorshelve>
shevy: <i0n> whats wrong with my code shevy [15:05] <shevy> everything lol :D
arkiver has joined #ruby
<vectorshelve>
shevy: also where is ur code.. dt was epic :)
<shevy>
well
<shevy>
if he didn't change his code, then it means he is lazy
<vectorshelve>
Muz: the issue now is that when I cloned the project and ran bundle install it worked fine and then when I run the app I get ExecJS::RuntimeError error so I added gem 'therubyracer' into the Gemfile and ran bundle install and then when I do git status it shows the gems to be installed in vendor.. why so ?
<i0n>
shevy: that works and its what i was building my method after
<workmad3>
vectorshelve: run 'bundle config'
<workmad3>
vectorshelve: because instal path is a bundle config option
<workmad3>
*install
<workmad3>
vectorshelve: and more specifically... it's a *cached* config option
<vectorshelve>
workmad3: ok
<vectorshelve>
workmad3: bundle config returned this line Settings are listed in order of priority. The top value will be used.
arkiver has quit [Ping timeout: 272 seconds]
sspiff has joined #ruby
<Muz>
vectorshelve: the actual .gem files? If so, that's becuase bundler is caching and bundling them with the project.
<Muz>
Just because the .gem file is there doesn't mean it's installed to and being read from there.
vlad_starkov has quit [Ping timeout: 246 seconds]
RichieEvan has quit [Quit: RichieEvan]
<Muz>
It's a bundler option so that you can do bundle install --local on another machine with this checked out code and it will install it /from/ those local .gem files /to/ wherever the install destination would be.
RichieEvan has joined #ruby
<i0n>
shevy: maybe my arrays are spitting out too much?
<vectorshelve>
Muz: ok but still the ExecJS::RuntimeError is not going despite having install therubyracer gem as well as node.js :(
<Muz>
You're not really providing a full error, or stacktrack, which makes your problem too vague for anyone to be remotely useful.
<vectorshelve>
sure
<Muz>
*stacktrace
<vectorshelve>
Muz: one sec
arkiver has joined #ruby
<workmad3>
vectorshelve: that's because a RuntimeError has nothing to do with the presence or lack of a JS runtime
mxweas has quit [Quit: Computer has gone to sleep.]
<workmad3>
vectorshelve: a runtime error is an error from the js runtime itself
<vectorshelve>
workmad3: but in the net they all have suggested the same solution for ExecJS::RuntimeError issue
arkiver has quit [Max SendQ exceeded]
<workmad3>
vectorshelve: no... that's a RuntimeUnavailable error
<workmad3>
vectorshelve: and if that *was* your error, it would also tell you with the message that no runtime is available and give you a link listing possible runtimes
<workmad3>
vectorshelve: not, as you have just revealed, a f**king javascript syntax error
arkiver has quit [Max SendQ exceeded]
arkiver has joined #ruby
<vectorshelve>
workmad3: no bt itsnt not I pulled the latest code as it as mate... and tried running everybody else here are running the same latest code as well they aint getting this error
Berglund has quit [Quit: Computer died.]
<workmad3>
vectorshelve: we don't tell you to a) read error messages and b) give full stack traces because we just like making you do work
arkiver has quit [Max SendQ exceeded]
arkiver has joined #ruby
<vectorshelve>
workmad3: this isnt a solution to a wierd error that only I am getting
Araxia has quit [Quit: Araxia]
<Muz>
vectorshelve: this has aboslutely nothing to do with Bundler...
<vectorshelve>
Muz: then what is the issue... its not the syntax issue since its a cloned repo which has already been deployed and running.. I havent made any changes..
arkiver has quit [Max SendQ exceeded]
bbttxu has joined #ruby
jprovazn has quit [Read error: Operation timed out]
<workmad3>
vectorshelve: the only thing we can go by is the error message
arkiver has joined #ruby
<workmad3>
vectorshelve: and that says syntax error... meaning it's a syntax error in a JS file
sonne has joined #ruby
<sonne>
greetings!
<sonne>
is it possible to turn off command echoing in a Rakefile?
<workmad3>
vectorshelve: going 'oh, but it can't be because of X' doesn't alter the fact that it *is*
arquebus has joined #ruby
arkiver has quit [Max SendQ exceeded]
<Muz>
workmad3: how do you know that exact copy is working elsewhere? You could have HEAD from a repo, and they could be running from a tag or produced build. How do you know your machine is configured in the same way as theirs etc too. You can't presume that just because someone's published code, just checking it out and trying to run it will work.
<workmad3>
Muz: was that meant for me or vectorshelve? :)
arkiver has joined #ruby
<Muz>
workmad3: sorry, yes. :p
<workmad3>
Muz: np :)
Squarepy has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
arkiver has quit [Max SendQ exceeded]
arkiver has joined #ruby
arkiver has quit [Max SendQ exceeded]
arkiver has joined #ruby
<vectorshelve>
workmad3: Muz I got ur point.. will try debugging from all aspects :)
justsee is now known as justsee|away
arkiver has quit [Max SendQ exceeded]
<workmad3>
vectorshelve: good... and try not to ignore evidence in the future because it doesn't fit with what you've assumed is the problem :P
arkiver has joined #ruby
ZachBeta has joined #ruby
<vectorshelve>
workmad3: sure sir :)
arkiver has quit [Max SendQ exceeded]
lxsameer has joined #ruby
arkiver has joined #ruby
jprovazn has joined #ruby
eddie_ has quit [Quit: Ex-Chat]
arkiver has quit [Max SendQ exceeded]
mneorr1 has joined #ruby
chimkan_ has joined #ruby
arkiver has joined #ruby
mneorr has quit [Ping timeout: 244 seconds]
arkiver has quit [Max SendQ exceeded]
strnx has joined #ruby
arkiver has joined #ruby
<shevy>
i0n well just build slowly, step by step
<shevy>
and always check that things still work
ntfox has quit [Quit: Leaving]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
justsee|away is now known as justsee
x0F_ is now known as x0F
harcher has quit [Quit: leaving]
sgronblom has joined #ruby
mdupont has joined #ruby
<mdupont>
hi all
hubub has quit [Ping timeout: 264 seconds]
nari has quit [Ping timeout: 245 seconds]
arquebus has quit [Read error: Connection reset by peer]
<mdupont>
i patched eventmachine, and ran setup.rb to install it, but rake does not find it. debian sid
ppawel has quit [Ping timeout: 240 seconds]
_bart has joined #ruby
<_bart>
Hi
heftig has quit [Ping timeout: 246 seconds]
hubub has joined #ruby
<_bart>
I was wondering, if I do: if matches and matches[1], will it not check for matches[1] if matches was already found false/nil?
arkiver has quit [Ping timeout: 250 seconds]
monkegjinni has quit [Remote host closed the connection]
<workmad3>
_bart: a) use &&, not and
<workmad3>
_bart: b) yes, && short-circuits, so it 'matches' is falsey, then 'matches[1]' won't be evaluated
<workmad3>
s/it/if
lkba has joined #ruby
fermion has joined #ruby
<_br_>
Isn't the nil problem something which we can scratch with the andand gem? What a pity that no operator .? is included in ruby like in coffeescript.
Foxandxss has joined #ruby
<_bart>
workmad3: why use &&? It isn't English
tvw has joined #ruby
bluOxigen has quit []
tk__ has joined #ruby
<Hanmac>
_bart && and "and" have different priority
<Muz>
&& and 'and' are pretty much functionally the same, HOWEVER, && has precedence over other operators, which "and" doesn't.
<Muz>
So if you're chaining things together, depending on if you use "&&" or "and" you may get varying results as different parts are evaluated first.
<Muz>
"and" and "or" are at the bottom of the precedence pile as it were.
<Hanmac>
its the same with do ... end and { ... }
<Muz>
Or "||" or "or". ;)
vlad_starkov has joined #ruby
<workmad3>
_bart: also, && may not be english, but it is more familiar to programmers, and in addition '&' is a symbol used to mean 'and'
<workmad3>
_bart: many programming languages use '&' to mean a bitwise and, and '&&' to mean a boolean and
mpereira has joined #ruby
arkiver has joined #ruby
monkegjinni has joined #ruby
liluo has quit [Remote host closed the connection]
heftig has joined #ruby
kpshek has joined #ruby
kpshek has quit [Client Quit]
Nanuq has quit [Ping timeout: 245 seconds]
Nanuq has joined #ruby
etehtsea has joined #ruby
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
justsee has quit [Ping timeout: 265 seconds]
cezar has joined #ruby
spry_dave has joined #ruby
Mon_Ouie has quit [Read error: Connection reset by peer]
BiHi has quit [Quit: Computer has gone to sleep]
cezar has quit [Client Quit]
Axsuul has quit [Ping timeout: 255 seconds]
vlad_starkov has quit [Remote host closed the connection]
justsee has joined #ruby
Rochefort has joined #ruby
jjbohn has joined #ruby
mpereira has quit [Ping timeout: 250 seconds]
vlad_starkov has joined #ruby
<_bart>
I understand the difference but I think I'll stick to and/or because it's cleaner / more readable
<Hanmac>
okay ... but you will come back when your code does not what you want
<workmad3>
^^
<workmad3>
_bart: the precedence differences between '&&' and 'and' are *not* trivial and ignorable, unless you are going to put () around every single boolean expression
<workmad3>
_bart: 'and' is intended for control flow, not boolean tests
<workmad3>
_bart: in all honesty, I find '&&' much more readable because it's more distinctive on a line ;)
<apeiros_>
workmad3: I guess it's easier to let others read your logs and tell you what to look for…
<workmad3>
apeiros_: yeah... I should start charging for doing it :)
cousine has joined #ruby
<vectorshelve>
workmad3: so now I stopped solr by bundle exec rake sunspot:solr:stop and then rerun foreman start to get this http://pastie.org/4341930
<workmad3>
vectorshelve: if I read this, am I going to be confronted with an obvious error that you haven't bothered reading?
<vectorshelve>
workmad3: the foreman log is disturbing.. I guess so
<workmad3>
vectorshelve: right... in that case, I'm not going to bother looking
<vectorshelve>
workmad3: a work around for this ? 16:43:00 rails.1 | /home/mithun/.rvm/gems/ruby-1.9.3-p194/gems/eventmachine-1.0.0.rc.4/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
jgarvey has quit [Quit: Leaving]
<workmad3>
vectorshelve: try reading it and thinking through what could cause it
<i0n>
can you split on a array then push the split you want into a string?
<vectorshelve>
workmad3: so I did lsof -wni tcp:3000 and killed the process
<vectorshelve>
i0n: yes u can
<_bart>
workmad3: good point
heftig has quit [Ping timeout: 246 seconds]
bigzed has quit [Ping timeout: 240 seconds]
<vectorshelve>
workmad3: now its seems to be runnig alryt :) thanks man
gmci has joined #ruby
<i0n>
vectorshelve: can you show me some syntax for that?
dross_ has joined #ruby
<virunga>
i0n: use inspect
<virunga>
ops
<virunga>
forget about it
<virunga>
sorry
<i0n>
np
<virunga>
use join instead
any-key has quit [Quit: leaving]
anykey__ has joined #ruby
dross has quit [Ping timeout: 276 seconds]
anykey__ is now known as any-key
burgestrand1 has joined #ruby
Cool_Fire has joined #ruby
flype has joined #ruby
burgestrand has quit [Ping timeout: 246 seconds]
Xethron has joined #ruby
spry_dave has quit [Remote host closed the connection]
<bnagy>
moshef: no, but it works :) What are you trying, and what's the error?
<Hanmac>
_bart use alias_method
jeff_sebring has quit [Quit: Leaving]
rbanffy has joined #ruby
<moshef>
bnagy: i'd like to call this as - b = ":gsub, 'o', 'b'" and then "foo".send :b
<_bart>
bnagy: to make sure locks are removed at .remove_queue, because.. and this is important.. the jobs are not properly dequeue'ed (no hooks are called) when removing an entire queue
<_bart>
Hanmac: okay thanks
<moshef>
but i guess my syntax is wrong
nicoulaj has joined #ruby
<Hanmac>
moshef: b = [:gsub, 'o', 'b']; "foo".send(*b)
dross has joined #ruby
<moshef>
you're the man Hanmac
<moshef>
thanks
<moshef>
bnagy: thanks too
<bnagy>
_bart: either wrap it in something of your own, or just do your own cleanup before you remove the queue, you shouldn't be monkey patching a core method with coupled code, especially involving hardcoded key prefixes
s1n4 has left #ruby ["leaving"]
<_bart>
bnagy: there is no plugin hook called when doing remove_queue
dross_ has quit [Ping timeout: 250 seconds]
moshef has quit [Quit: moshef]
<bnagy>
ok I don't know what any of this resque jargon means :)
<bnagy>
but basically just make sure you do whatever you think needs doing before you remove the queue
<_bart>
alright, fixed it by alias_method
<_bart>
the author of resque should dequeue jobs before a queue gets removed. but well, I can't wait for that
<bnagy>
why should they do that?
<bnagy>
if you want to drop a queue that's not empty that's surely your business
nedbat has joined #ruby
_justin has joined #ruby
pskosinski has joined #ruby
<shevy>
bnagy!
<shevy>
let's marry
<bnagy>
whom?
<shevy>
lol
<shevy>
the smartest person on #ruby perhaps
<bnagy>
is that like winning gold in the special olympics?
<shevy>
kinda
* Hanmac
hopes its not him
linoj has quit [Quit: linoj]
<bnagy>
Hanmac is saving himself for banisterfiend
<shevy>
Hanmac you write too much C++ code as of late
tbrock has quit [Remote host closed the connection]
nwest has joined #ruby
dr_diamond has joined #ruby
verto|off is now known as verto
nari has joined #ruby
<_bart>
bnagy: it should be the business of the plugin, but right now there isn't a hook method to catch that event like I said
cakehero has quit [Quit: Computer has gone to sleep.]
Ste11a has joined #ruby
awarner has quit [Remote host closed the connection]
_justin has quit [Ping timeout: 264 seconds]
jjbohn has quit [Quit: Leaving...]
<shevy>
ok brainstorming
<shevy>
What features should a ruby package manager have or offer?
jonathanwallace has joined #ruby
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
und3f has joined #ruby
<sonne>
shevy, what would a ruby package manager be?
gogiel has joined #ruby
jjbohn has joined #ruby
<shevy>
sonne dunno. I figure something similar to emerge (gentoo) or dpkg
<sonne>
isn't there gem already then?
<rking>
shevy: I'd be shocked if `gem` can't already do it.
<shevy>
rking I think gem handles only .gem files
<rking>
shevy: …?
<shevy>
and most of the time installs into SITE DIR
<rking>
emerge handles only .ebuild
<sonne>
well gems are ruby packages
<shevy>
an .ebuild can be anything
<rking>
shevy: All it does is run the instructions given to it.
<Spooner_>
shevy What do you actually mean by "package"?
<shevy>
glibc .ebuild, how would you make a glibc .gem?
geekbri has joined #ruby
<shevy>
Spooner_ every piece of software that can be installed somehow
<rking>
shevy: Have it do stuff then copy stuff (?)
<Spooner_>
I have Releasy. That is nice, but a bit buggy until I have some will to fix it :)
<shevy>
dunno, sounds like a misuse of gems :)
carlyle has joined #ruby
<sonne>
$ file i18n-0.6.0.gem
<sonne>
i18n-0.6.0.gem: POSIX tar archive
<shevy>
Releasy?
ExistentAtrophy has joined #ruby
carlyle has quit [Remote host closed the connection]
<Spooner_>
Yes, creates windows and osx executable and packages up and deploys.
<Muz>
shevy: it should have features like what Bundler has.
<shevy>
Spooner_ whoa
rbanffy has quit [Quit: Ex-Chat]
<sonne>
bundler rocks :D
carlyle has joined #ruby
<Muz>
In fact, what does Bundler not do that your proposed package manager would do?
<shevy>
Spooner_, you mean, an .exe file ?
<shevy>
Muz, Bundler seems to be used only for gems
<Spooner_>
Muz It doesn't really help you to make stuff useful for people who don't have ruby installed.
drupin has left #ruby ["Leaving"]
<Muz>
Oh, you want to actually ship an interpreter?
<shevy>
Releasy? :)
<rking>
shevy: Doing things and putting things are the easy parts of package managers. A harder problem is subtleties of dependency management, and that's the part that Bundler seems to do pretty well.
<sonne>
Spooner_, so that would produce a self contained and self sufficient binary?
<sonne>
with all gems and stuff?
<shevy>
how much work was Releasy?
<shevy>
in approximate amount of hours spent coding and polishing
<Spooner_>
It does that, yes and you can build OSX/windows on any OS.
<shevy>
whoa
<Spooner_>
A million :D
<sonne>
Spooner_, you must be a wizard!
<sonne>
where's the like button on github
<shevy>
hehehe
jprovazn has quit [Quit: Leaving]
<Spooner_>
However, what it _doesn't_ do is use a compiler, so you can't install any gems that you can't get compiled.
<rking>
Aww, bummer.
<sonne>
what does that mean?
nari has quit [Ping timeout: 264 seconds]
<sonne>
you mean you can't package gems that are not pure ruby?
<Spooner_>
That is, if you are building crossplatform, the gem has to be pre-compiled on rubygems.
<sonne>
aha, i see
<sonne>
so you couldn't build, for example, passenger
leoncamel has quit [Remote host closed the connection]
chson has quit [Remote host closed the connection]
verto|off is now known as verto
<Spooner_>
I need to add the ability to include arbitrary pre-compiled gems, but for now, it only downloads the binary gems from rubygems if they exist.
<sonne>
i see.... still awesome :)
bequick has joined #ruby
wangr has joined #ruby
<Spooner_>
It mostly works, but it needs a bit more work to be really idiot-proof. I use it all the time to distribute games, as do a couple of other people, but it is a little fragile :/
<Spooner_>
Fragile in that it isn't too friendly if you misconfigure it, not that it is unstable :D
<Spooner_>
Just read the readme if you need more explanation of its capabilities.
<Spooner_>
And if more people bug me, I'll fix it properly :D
<Spooner_>
And then I can publicise it, since no-one has heard of it :D
jprovazn has joined #ruby
<shevy>
hehe
lledet has quit [Quit: lledet]
flype_ has joined #ruby
flype has quit [Ping timeout: 252 seconds]
<banisterfiend>
Spooner_: hey spoonie
devdazed has joined #ruby
<Spooner_>
'lo
atmosx has joined #ruby
vectorshelve has quit [Quit: Page closed]
devdazed has quit [Client Quit]
noyb has quit [Quit: Leaving.]
devdazed has joined #ruby
lorandi has joined #ruby
hynkle has joined #ruby
akem has quit [Ping timeout: 272 seconds]
strife25 has quit [Quit: Computer has gone to sleep.]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
hynkle has quit [Read error: Connection reset by peer]
<heda>
hi all, is there an easy way to get a module with class methods to extend a class even if the module is a couple of include levels deep? (see https://gist.github.com/3188107)
und3f has quit [Quit: Leaving.]
beakerma_ has joined #ruby
cjlicata has joined #ruby
rizzy has joined #ruby
carlyle has quit [Read error: Operation timed out]
<hoelzro>
heda: won't 'include ClassMethods' from within A have the same effect?
cakehero has joined #ruby
<Spooner_>
I think you'd need to have the self.included also inside the ClassMethods module.
<heda>
hoelzro: in the simple instance of the gist yes i suppose, i should have pointed out the classmethods are there to handle some state unique to each type
beakerman has quit [Ping timeout: 272 seconds]
<heda>
Spooner_: yeah I have that running as expected but was wondering if there was a shortcut I could use in the base that I wasn't aware of
hollyw00d has joined #ruby
hollyw00d has quit [Client Quit]
<Spooner_>
Oh, fair enough.
<heda>
Spooner_: thanks for the double check though
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
anderse_ has left #ruby [#ruby]
akem has joined #ruby
whitedawg has joined #ruby
v0n has joined #ruby
stopbit has joined #ruby
whitedawg1 has quit [Ping timeout: 246 seconds]
liluo has quit [Remote host closed the connection]
br4ndon has joined #ruby
DrShoggoth has joined #ruby
<otters>
I cannot get eventmachine installed
<otters>
mac os mountain lion, it tells me I need to install developer tools
<otters>
I have Xcode 4.4
mvangala has quit [Remote host closed the connection]
mvangala has joined #ruby
<hoelzro>
otters: I'm not certain, but I'd bet you need the command line tools as well
<otters>
heh, I guess the upgrade nuked them
<Mon_Ouie>
Set your CC env variable to the path to the compiler you want to use
mvangala has quit [Remote host closed the connection]
<otters>
well, I don't have any compilers
<Mon_Ouie>
from what I've seen last time someone asked, they've been moved to /usr/local/ instead of /usr/
<otters>
that must be the problem
mvangala has joined #ruby
techhelp has joined #ruby
Long has joined #ruby
ExistentAtrophy has quit []
hynkle has quit [Read error: Connection reset by peer]
<Long>
Hi everyone
Stalkr_ has quit [Quit: Leaving...]
mvangala has quit [Remote host closed the connection]
mvangala has joined #ruby
Long has left #ruby [#ruby]
johnlcox has quit [Ping timeout: 264 seconds]
mucker has joined #ruby
habib has quit [Remote host closed the connection]
internet_user has joined #ruby
mvangala has quit [Read error: Connection reset by peer]
umttumt has quit [Remote host closed the connection]
mvangala has joined #ruby
hynkle has joined #ruby
<shevy>
hmmmm
<shevy>
those paths never made any sense
<shevy>
they should install applications into versioned directories, and make these work
<otters>
good lord
<otters>
cucumber is the gimmickyest thing I have probably ever seen in software development
<shevy>
otter!
<shevy>
all cuddle the otter
<shevy>
what's with cucumber
<otters>
I may have to use it for a job interview
sailias has quit [Ping timeout: 240 seconds]
jwmann has joined #ruby
<otters>
but it looks ridiculous
<otters>
write tests in English, then *parse them with regex* in the test code?
<Muz>
It's fucking shit.
* Muz
says, after using it for almost 2 years at his current workplace.
<otters>
apparently I have to use both rspec and cucumber
<otters>
at the same time...on the same project
<Muz>
Welcome to my world.
<otters>
so this is what it's like to not make your own architecture decisions
<otters>
I am not fond of it
Criztian has quit [Remote host closed the connection]
<workmad3>
hmm... I'm quite a proponent of the style, although I do admit it took me quite a while (about 18 months) to actually get the hang of writing good scenarios
<shevy>
my grand goal is to start my own company, then noone can boss me around (other than myself when I need to finish something)
<otters>
my grand goal is to get a job to pay for college
<otters>
we can't all be heroes
mvangala_home has joined #ruby
<workmad3>
shevy: don't forget about your clients who will be giving you money :P
<otters>
rspec looks alright
vitoravelino`afk is now known as vitoravelino
dr_diamond has quit [Quit: Bye !]
<shevy>
workmad3 yeah
<workmad3>
otters: I am with you that the regex parsing of steps is pretty nasty... I much prefer the placeholder style some variants provide... but writing acceptance criteria in something other than code can be quite revealing and useful (but it does depend a lot on if your clients are willing to collaborate on them)
mvangala has quit [Ping timeout: 255 seconds]
techhelp has quit [Quit: This computer has gone to sleep]
josefig has joined #ruby
<workmad3>
otters: and hitting the right level of granularity in scenarios is hard... too high, and the scenario doesn't tell you anything useful, too low and it gets bogged down in implementation steps
br4ndon has quit [Ping timeout: 250 seconds]
kaushal has joined #ruby
<kaushal>
Hi
mahmoudimus has joined #ruby
<shevy>
hi kaushal - new to ruby?
<Muz>
It doesn't help that the cucumber spec runner is fueled by crack and first-borns.
<otters>
workmad3: well, this is the first-ever time I've done automated testing
<Muz>
Given a choice, I'd use rspec over cucumber.
<otters>
so I'm hoping I don't heck it up
<shevy>
Muz I like that you use '.' in your sentences :)
<workmad3>
too much implementation detail in scenarios is a pretty common problem in scenarios :)
<Muz>
shevy: I can stop if you'd like.
<shevy>
kaushal this error gets fixed via require 'yaml'
<workmad3>
Muz: ah, I've actually switched away to Turnip almost exclusively now, which uses the Gherkin parser for scenario files and hooks it into the rspec test runner :)
dv310p3r has quit [Read error: Connection reset by peer]
<Muz>
workmad3: I'm not sure if that's a best of both worlds, or lesser of two evils, kind of compromise.
<workmad3>
Muz: and also uses placeholders rather regex
<kaushal>
shevy: ok
<workmad3>
*rather than regex
mvangala_home is now known as mvangala
hynkle has quit [Read error: Connection reset by peer]
<kaushal>
shevy: is yaml the package name?
Goles has joined #ruby
<workmad3>
(or rather, placeholders rather than raw regex... regex are still used to define what a placeholder will match, but they get pushed lower down and more out of sight)
<shevy>
kaushal, when you do require 'yaml', YAML namespace will be available to you
<kaushal>
i dont see it on ubuntu 12.04
<shevy>
kaushal, YAML is the name of the constant. the file that you require is yaml.rb
<shevy>
kaushal, start "irb"
<shevy>
do:
<shevy>
require 'yaml'
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
<shevy>
look if an error happens
<workmad3>
otters: welcome to the BDD world then :)
<kaushal>
shevy: ok
<otters>
workmad3: thanks :P
<workmad3>
otters: so... how long do you have to cram automated testing knowledge into your head?
chichou has quit [Ping timeout: 264 seconds]
<otters>
I got five days to complete the assignment
<otters>
dunno if I should write tests or code first
<rking>
Tests.
sailias has joined #ruby
<rking>
One at a time, though. Little test, little implement, big win.
mvangala has quit [Remote host closed the connection]
<workmad3>
otters: if they're looking for TDD/BDD knowledge, then tests first... if they're also looking @ cucumber, you should probably do ATDD (acceptance-test driven development) and start with a cucumber scenario
mvangala has joined #ruby
<Muz>
require 'yaml'
<Muz>
kaushal: ^ that's the line you want.
<kaushal>
shevy: what package i need to install to get yaml.rb
<kaushal>
Muz: you mean in the code?
<workmad3>
otters: and follow the 'red-green-refactor' cycle... get a failing test, get it to pass, refactor your code to remove duplication
<kaushal>
Muz: got it
<shevy>
kaushal, you forgot the quotes
<shevy>
<shevy> require 'yaml'
<shevy>
not
<shevy>
<shevy> require yaml
<kaushal>
shevy: its returns true
<shevy>
ok good, that means yaml works
bluOxigen has joined #ruby
<shevy>
you can type
<shevy>
YAML
<shevy>
and see that irb returns something
<kaushal>
YAML
<shevy>
now to your earlier problem, you could add require 'yaml' before that error happens
<shevy>
at the top of the file
<kaushal>
ok
<shevy>
but if you did not write that file on your own, chances are that there will still be an error somewhere
<workmad3>
otters: with ATDD, that cycle occurs at two levels... get a failing scenario step, drop down into writing rspec tests using the red-green-refactor until the step passes, have a broader look for refactoring and cleanup steps, get the next step failing, repeat
hynkle has joined #ruby
nari has joined #ruby
lateau has joined #ruby
<workmad3>
otters: if you're new to this stuff, 5 days is a very tight timescale to get efficient in though :(
<kaushal>
so what does require 'yaml' mean it loads yaml.rb file?
<rking>
It works up until line 43, where it's trying to FactoryGirl.create :child1, but failing because: undefined method `x='
hynkle has joined #ruby
the_jeebster has joined #ruby
<rking>
shevy: Yeah, I'm having a hard time writing a simple case that shows my problem.
<shevy>
hehe
<rking>
Actually, I'm having trouble simplifying this solution in general.
andrewhl has joined #ruby
<kaushal>
shevy: so require 'yaml' mean it loads yaml.rb file?
<kaushal>
shevy: Thanks a lot
<kaushal>
really appreciated
<cout>
kaushal: yes, unless it's already been required
<kaushal>
where is yaml.rb located?
<cout>
kaushal: (so you don't need guards like you do with #include)
jbw has quit [Read error: Operation timed out]
<kaushal>
ok
<rking>
I would make "BaseyBase" an actual base class, but for some reason the other metaprogramming in that class gets fouled up (part from a lib I'm using), so I successfully did the mixin thing. But now that I'm trying to make some class data accessible to the child methods, I'm getting stuck.
mahmoudimus has quit [Quit: Computer has gone to sleep.]
hynkle has quit [Read error: Connection reset by peer]
shevy has quit [Read error: Operation timed out]
nedbat_ is now known as nedbat
jbw has joined #ruby
SQLStud has joined #ruby
reuf has quit [Quit: Leaving]
carloslopes has joined #ruby
zodiak has joined #ruby
erichmenge has quit [Quit: Be back later]
hynkle has joined #ruby
maletor has joined #ruby
maletor has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
ryh has joined #ruby
hynkle has quit [Read error: Connection reset by peer]
gmci has quit [Quit: Computer has gone to sleep.]
mvangala has quit [Remote host closed the connection]
mvangala has joined #ruby
mengu has quit [Quit: Konversation terminated!]
EstanislaoStan has joined #ruby
D4T has quit [Ping timeout: 244 seconds]
Ionic` has joined #ruby
theRoUS has quit [Ping timeout: 272 seconds]
timonv has quit [Remote host closed the connection]
jprovazn is now known as jprovazn_away
<EstanislaoStan>
So in "player.inventory_hash[room_things_hash_key] = @dungeon_things[room_things_hash_key]" if I delete @dungeon_things will player.inventory_hash[room_things_hash_key] equal nil?
hynkle has joined #ruby
kjellski has quit [Quit: Leaving]
andrewpthorp has quit [Quit: Leaving...]
mockra has joined #ruby
mockra has quit [Remote host closed the connection]
mvangala has quit [Read error: Connection reset by peer]
mockra has joined #ruby
bullicon has joined #ruby
andrewpthorp has joined #ruby
alek_b has joined #ruby
shevy has joined #ruby
Morkel has joined #ruby
sailias has joined #ruby
havenn has joined #ruby
spry_da__ has quit [Remote host closed the connection]
andrewpthorp has quit [Client Quit]
apok has joined #ruby
nari has quit [Ping timeout: 240 seconds]
runa has joined #ruby
<runa>
heyas. I'm using Rmagick::ImageList#display but I would like to programatically close the window. is this possible?
alek_b_ has joined #ruby
digitalcakestudi has joined #ruby
alek_b has quit [Read error: Operation timed out]
Guedes has quit [Ping timeout: 264 seconds]
Eldariof-ru has quit [Ping timeout: 272 seconds]
Z_Mass has joined #ruby
tfittsy is now known as tfitts
hynkle has quit [Read error: Connection reset by peer]
bluOxigen has quit []
erichmenge has joined #ruby
BrenoPerucchi has joined #ruby
mvangala_home has quit [Read error: Connection reset by peer]
timonv has joined #ruby
mvangala has joined #ruby
hynkle has joined #ruby
<twinturbo>
hey
atmosx has joined #ruby
<twinturbo>
can I redirect $stdout to a socket? I have a bunch of process I want to run but they can only communicate by printting to $stdout. I'd like to have them print messages to a stock which a master can process
enroxorz has quit [Quit: Leaving]
MasterIdler_ has joined #ruby
carloslopes has quit [Quit: Leaving.]
jvdz has joined #ruby
heda has quit [Quit: heda]
havenn has quit [Remote host closed the connection]
<Mon_Ouie>
$stdout is a variable, which you can set to any IO-like object that can be written to
jubei has joined #ruby
Jay_Levitt has joined #ruby
harcher has joined #ruby
<jubei>
guys I made some changes to an .rb file that apparently requires that I restart my server
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<jvdz>
Can someone point me to a the accepted way to output a list of items and get output like "(item1, item2, item3)" (no trailing comma)
<jvdz>
^Total Ruby newbie
<jubei>
since this is a ruby app that I didn't setup, i don't know how to do that
vitoravelino`afk is now known as vitoravelino
flype has joined #ruby
<Mon_Ouie>
jvdz: String#join
<Mon_Ouie>
Array#join I mean
ckrailo has joined #ruby
baroquebobcat has joined #ruby
aganov has quit [Quit: aganov]
Stalkr_ has joined #ruby
<twinturbo>
Mon_Ouie: ya, but I need to be able to run command > /tmp/msg.sock or something like that
<jubei>
guys how do I restart my ruby on rails app?
tagrudev has quit [Remote host closed the connection]
<jvdz>
Mon_Ouie: Thanks, will check that out. - Other question I had was: Is there a shortcut to doing the above, but omit the parenthesis if the array is empty?
BrenoPerucchi has left #ruby [#ruby]
<jvdz>
(avoiding having to wrap the loop with a "if this array has items")
<Mon_Ouie>
twinturbo: Use IO.popen to get a stream which you can read out of your commands
<Mon_Ouie>
And just forward the output to your socket
<twinturbo>
Mon_Ouie: ok
xaq has joined #ruby
apeiros_ has joined #ruby
oscardelben has quit [Quit: oscardelben]
atmosx has quit [Ping timeout: 255 seconds]
vlad_starkov has quit [Remote host closed the connection]
eywu has joined #ruby
chimkan___ has joined #ruby
mvangala has quit [Remote host closed the connection]
mvangala has joined #ruby
carloslopes has joined #ruby
<shevy>
oh man
Vert has quit [Ping timeout: 252 seconds]
mvangala has quit [Remote host closed the connection]
mvangala has joined #ruby
<Muz>
jubei: #rubyonrails can probably give a more definitive answer than "kill whatever's running it, and re-start it." ¬_¬
sixteneighty has quit [Ping timeout: 246 seconds]
chimkan has quit [Ping timeout: 264 seconds]
chimkan___ is now known as chimkan
<Muz>
Given you could be running your rails app through any number of different ways.
<jubei>
Muz, ic thank you!!
jubei has left #ruby ["Leaving"]
erichmenge has quit [Quit: Be back later]
Z_Mass has quit [Quit: Leaving]
apeiros_ has quit [Remote host closed the connection]
wvms has quit [Ping timeout: 240 seconds]
wjimenez_5271_ has joined #ruby
arkiver has quit [Ping timeout: 240 seconds]
twinturbo has quit [Quit: twinturbo]
<virunga>
Maybe a silly question, i'm going to create a web site, should i create it as a rubygem?
twinturbo has joined #ruby
<Muz>
Depends on what the site is going to do and how yo want to deploy and distribute it.
<Muz>
Chances are "no" though.
<JonnieCache>
almost certainly not
<sernin>
virunga: what Muz said. I'm also having a hard time thinking of a use case where that would be a good idea
beneggett has quit [Ping timeout: 252 seconds]
<virunga>
ok, thank you
<JonnieCache>
although it is an intruiguing idea
<virunga>
:)
verto is now known as verto|off
cantbecool has joined #ruby
sonne has quit [Quit: Leaving]
strife25 has joined #ruby
bglusman has joined #ruby
prometheus has joined #ruby
apeiros_ has joined #ruby
MatthewGA has joined #ruby
beneggett has joined #ruby
arturaz has quit [Ping timeout: 240 seconds]
asobrasil has joined #ruby
Rochefort has quit [Remote host closed the connection]
fabrice31 has quit [Remote host closed the connection]
benson has quit [Remote host closed the connection]
blazes816 has joined #ruby
fbernier has quit [Ping timeout: 264 seconds]
hoelzro is now known as hoelzro|away
havenn has joined #ruby
sixteneighty has joined #ruby
abdulkarim has joined #ruby
_bart has quit [Ping timeout: 240 seconds]
Vert has joined #ruby
twinturbo has quit [Quit: twinturbo]
abstrusenick has quit [Quit: abstrusenick]
abstrusenick has joined #ruby
Morkel has quit [Quit: Morkel]
elhu has quit [Ping timeout: 244 seconds]
devdazed has quit [Quit: Computer has gone to sleep.]
harcher has quit [Ping timeout: 272 seconds]
harcher has joined #ruby
andrewhl has quit [Remote host closed the connection]
atmosx has joined #ruby
elhu has joined #ruby
devdazed has joined #ruby
harcher has quit [Client Quit]
TheTFEF has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 272 seconds]
Rochefort has joined #ruby
sendoushi has joined #ruby
codespectator has quit [Ping timeout: 244 seconds]
greasegum has quit [Ping timeout: 244 seconds]
Guedes has joined #ruby
nedbat has quit [Disconnected by services]
nedbat_ has joined #ruby
dhruvasagar has joined #ruby
savage- has joined #ruby
fermion has quit [Quit: P]
SphericalCow has joined #ruby
t0mmyvyo has joined #ruby
wallerdev has joined #ruby
techhelp has quit [Quit: Leaving]
mikepack has joined #ruby
kenichi has joined #ruby
mvangala_home has joined #ruby
mvangala has quit [Remote host closed the connection]
tommyvyo has quit [Quit: Computer has gone to sleep.]
t0mmyvyo is now known as tommyvyo
<jvdz>
Working on an ERB for Nanoc — Adding tags to a template like: <%= @item[:tags].collect {|tag| "<span class='label'>#{tag}</span>"}.join(' ') %>
<jvdz>
Works OK, except chokes for pages without tags
<jvdz>
What's a good way to NOT try to include these tags when the variable doesn't even exist
cynosure has quit [Remote host closed the connection]
<workmad3>
jvdz: the best way would be to have @item[:tags] default to an empty array
atmosx has quit [Ping timeout: 244 seconds]
strnx has quit [Ping timeout: 252 seconds]
Progster has quit [Ping timeout: 260 seconds]
<jvdz>
workmad3: How would I do that; an assignment statement just before it?
<workmad3>
jvdz: failing that, you could either do an '<% if @item[:tags] %>...<%end%>' block around your tag display, or use (@item[:tags] || []) in your template
apok has quit [Quit: apok]
<jvdz>
workmad3: Can you explain that last statement (|| [])
adeponte has joined #ruby
AudreyJean has joined #ruby
<apeiros_>
workmad3: meh, such logic doesn't belong into the template IMO
<workmad3>
apeiros_: I agree
ctp has joined #ruby
<apeiros_>
jvdz: ensure in the logic which invokes your template that @item[:tags] is always an array
<apeiros_>
even if only an empty one
TheTFEF has joined #ruby
<workmad3>
apeiros_: which is why that was my first suggestion ;)
blazes816 has quit [Quit: Leaving]
<apeiros_>
workmad3: ooooh
<apeiros_>
my fault
<apeiros_>
(that's called normalization, btw., and it's a very good concept and should be broadly applied)
<jvdz>
apeiros_: Ok thanks
<workmad3>
apeiros_: but I'm not sure what Nanoc is, or how much control it gives over that sort of detail... so was presenting alternatives if that isn't possible :)
<jvdz>
nanoc: is one of those static website builders
<apeiros_>
workmad3: yeah, good call. I know nanoc, it's by ddfreyne (he's on irc quite often too)
<apeiros_>
but I haven't used it myself for a long time and I'm don't really remember how it works anymore
wallerdev has quit [Quit: wallerdev]
<apeiros_>
s/I'm/I/
<workmad3>
:)
<jvdz>
Hmm still geting NoMethodError: undefined method `collect' for nil:NilClass
<jvdz>
I wrapped it in " <% if @item[:tags].any? %>"
parus has quit [Ping timeout: 265 seconds]
Rochefort has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
<workmad3>
jvdz: quick hint... that wasn't one of my suggestions
<workmad3>
jvdz: and it wasn't one for a reason
parus has joined #ruby
benson has joined #ruby
<workmad3>
jvdz: it's generally considered polite that, if you're going to ignore advice, then you don't thereafter complain that it still doesn't work...
Progster has joined #ruby
AudreyJean has left #ruby [#ruby]
abstrusenick has quit [Quit: abstrusenick]
<jvdz>
workmad3: My apologies, my previous message didn't send (connections a little shoddy here) -- I tried yours and got same error, so I was googling around for checking for items in an array
<Progster>
is there a for each loop in ruby? or do you just use .each?
<workmad3>
Progster: yes and yes
<jvdz>
does (@item[:tags] || []) basically return an empty array object?
<workmad3>
jvdz: it @item[:tags] is nil, then it evaluates to []
<workmad3>
Progster: in more detail - yes, ruby does have the 'normal' for loops, and a for var in collection construct, but the preference is to use .each and other enumerator methods instead of direct iteration
greasegum has joined #ruby
<jvdz>
workmad3: Ah thanks - that works; I messed up the syntax originally
<workmad3>
jvdz: it's worth investigating if you can get @item[:tags] to default to an empty array btw
<workmad3>
jvdz: it's the nicest solution from a template perspective, as you then won't need to worry about it ever being nil :)
<jvdz>
workmad3: I believe is a weird one — because @item[:SOMETHING] is grabbed out of YAML, whose attribuets are completely arbitrary
<workmad3>
jvdz: yeah, I was wondering if that was the case
paradoja has joined #ruby
mahmoudimus has joined #ruby
havenn has quit [Remote host closed the connection]
<workmad3>
jvdz: the other option would be to have a tags: [] in your yaml front-matter on pages that have no tags
<jvdz>
workmad3: But agreed; I'll probab;y end up writing a tag helper function, wrapped with check-if-exists logic, so i don't have to worry about ugly code in the template
<workmad3>
jvdz: that's also a good option btw :)
<jvdz>
workmad3: Hmm that's a good idea; I saw someone do that with assigning "kind: article" to every item in /article/ folder
<jvdz>
workmad3: To avoid having to constantly add the YAML metadata to each new file
<Tasser>
I've got an array of 2565 elements and I'd like to find a pair that makes a block tru
<Tasser>
y
<workmad3>
Tasser: fun :D
<Tasser>
each_cons kinda works for some pairs, but what if no match is found?
<Tasser>
workmad3, it's on jruby and peach, so parallel processing should be possible
SphericalCow has quit [Remote host closed the connection]
<Tasser>
robacarp, and looks like the guy doesn't have the balls to monkey-patch core
verto|off is now known as verto
BiHi has quit [Quit: bye]
<Tasser>
and looks like it doesn't deal well with lazy enums
<Tasser>
... but that's kind of an edge case in ruby
ianbrandt has joined #ruby
<robacarp>
hmm, I've never heard of peach. I just stumbled onto parallel yesterday.
lxsameer has quit [Quit: Leaving]
maletor has joined #ruby
rasbonics has joined #ruby
_justin has quit [Read error: Connection reset by peer]
rasbonics has quit [Client Quit]
SphericalCow has joined #ruby
arkiver has joined #ruby
chussenot has quit [Read error: Connection reset by peer]
rubylancer has joined #ruby
chussenot has joined #ruby
<rubylancer>
Hey, is anyone here a freelancer who can get me some tips on kicking off as one? I have a potential contract, but I haven't dabbled in freelancing since college.
<robacarp>
heh...get a detailed contract and stick to it
kenichi has quit [Remote host closed the connection]
<rubylancer>
Well I guess ultimately that's the biggest challenge right haha
jordanscales has joined #ruby
<robacarp>
well, I mean, for this job. Get what they want done written, and what you'll do written, put a price and a date on it and have everybody sign it.
kenichi has joined #ruby
mvangala has quit [Remote host closed the connection]
mvangala has joined #ruby
bequick has quit [Ping timeout: 246 seconds]
<rubylancer>
I guess one thing that I'm not completely sure how to approach is price. I know this varies widely by region, but being based out of an urban area of the US, is there a going rate? Or a point I should start negotiating from?
<jordanscales>
if I wanted to change String's "upcase" method to convert it to uppercase, then do something with the string, how would I do that?
mutewinter has joined #ruby
<rubylancer>
jordan - what do you mean by 'do something with the string'?
<rubylancer>
Execute more string methods on it?
Russell^^ has joined #ruby
<robacarp>
rubylancer: it varies...I prefer to set my price based on something concrete, like a feature or a project. Some prefer to charge hourly.
Know1edge has joined #ruby
kevinbond has left #ruby [#ruby]
apok has joined #ruby
tommyvyo_ has joined #ruby
<jordanscales>
rubylancer, correct :)
timonv has quit [Remote host closed the connection]
<jordanscales>
i want to extend .upcase, but use .upcase in this new method
nedbat_ is now known as nedbat
<jordanscales>
but use "the old" up case in this new method
<jordanscales>
to clarify, this is a rails app and when i have String.upcase I want to actually do String.mb_chars.upcase.to_s
nadirvardar has joined #ruby
<nedbat>
jordanscales: why not change the callers to do the right thing?
artOfWar has joined #ruby
<jordanscales>
nedbat, lots of them, I globally want to change how my application uses .upcase
<nedbat>
jordanscales: global search/replace? Won't it be confusing to have the std ".upcase" mean something different in your project?
strnx has joined #ruby
<jordanscales>
nedbat, if that's convention then I can get behind it :) I see what you mean
codespectator has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
artOfWar_ has joined #ruby
stephenjudkins has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
<nedbat>
jordanscales: i can't address "convention," just what sounds like good practice to me.
timonv has joined #ruby
<jordanscales>
nedbat, okay, thank you
tiripamwe has joined #ruby
<jvdz>
Having difficulties getting .reject to work. Trying to remove @items with [:is_hidden]=="true". http://dpaste.com/776370/
artOfWar has quit [Ping timeout: 255 seconds]
blazes816 has joined #ruby
<Mon_Ouie>
It would help to know what @items is first
<apeiros_>
jordanscales: shouldn't globally change core methods. you probably break code with that.
<jvdz>
Mon_Ouie: It's a nanoc site; @items are static text files (e.g. markdown files) which have arbitrary YAML at the top (e.g. title: abc)
<Mon_Ouie>
Btw, there's Enumerable#flat_map (which has another name that I forgot)
<Spooner_>
jvdz @items.map{|item| [item[:category]]}.flatten => @items.map{|item| item[:category]} - why make an array of one-element arrays then flatten it out?
<apeiros_>
jordanscales: I think a sane/acceptable compromise between not breaking stuff and comfort is to add String#mb and let it provide a proxy object for mb operations
_justin has joined #ruby
<Mon_Ouie>
Oh, true, it's not even needed here
<apeiros_>
e.g. str.mb.upcase
mvangala has quit [Read error: Connection reset by peer]
mrsolo has joined #ruby
<jordanscales>
apeiros: hm, okay I can agree with that
<Mon_Ouie>
(and the other name is collect_concat)
mvangala has joined #ruby
<jordanscales>
this application deals with a lot of translations, and having .mb_chars.upcase.to_s is just frustrating, so I wanted to globally replace the .upcase method to do this for me
<jvdz>
Spooner_: Noted, mistake on my part
Vert has quit [Ping timeout: 252 seconds]
<apeiros_>
jordanscales: you can use String#replace for bang methods
Eldariof-ru has joined #ruby
<jvdz>
Is my syntax actually correct for .reject ? or is it failing because (most) items don't have :is_hidden
<apeiros_>
e.g. class String; def mb; MbString.new(self); end; end; class MbString; def initialize(str); @to_s=str; end; def upcase!; @to_s.replace(upcase); end; end
<jordanscales>
replace in code, that is. I want to change so that mystring.upcase actually calls mystring.mb_chars.upcase.to_s
excellentdrums has joined #ruby
<Spooner_>
jvdz Not entirely sure what you want to achieve though, so can't tell you if your code is "correct"
kevinbond has joined #ruby
banisterfiend is now known as Spooner
jameshyde has quit [Ping timeout: 245 seconds]
<excellentdrums>
Has anyone seen activerecord not include the RETURNING clause in it's generated INSERT statement for create? (Sorry, know it's not a rails room but no one is answering me over there)
kevinbond has left #ruby [#ruby]
Spooner is now known as banisterfiend
sifue has joined #ruby
chussenot has quit [Read error: Operation timed out]
<jvdz>
Spooner_: 1) Loop through all items, get a list of unique categories; 2) Loop through each category; 3) For each category list all items tagged with that category 3.5) Exclude any @items which have is_hidden=true
jrajav has quit [Quit: The best darkness is strange and surprising]
<Mon_Ouie>
I'd put stuff like that in a helper method though, to make the templates clearer
<Spooner_>
I'd recommend putting line 1 and 5 into helper methods.
flype has quit [Quit: Computer has gone to sleep.]
mvangala has quit [Remote host closed the connection]
mvangala has joined #ruby
<jvdz>
Spooner_ & Mon_Ouie : Definitely agree on the helper method
<jvdz>
Spooner_: Using your code, got: NoMethodError: undefined method `<=>' for nil:NilClass (on the first line)
<Spooner_>
jvdz : Oh and since an item might not have :category, you need to #compact the result on 1 - yes, that, before you sort :)
<jvdz>
Spooner_: K one sec
arkiver has quit [Quit: Leaving]
<jvdz>
Spooner_: Success!
<Spooner_>
jvdz : By the way, is_hidden will be turned into true, not "true" since YAML understands stuch things. So simply x[:is_hidden] rather than x[:is_hidden]=="true"
<jvdz>
Spooner_: Good to know; wasn't sure how literal YAML was
<Spooner_>
Unless you've manually added the quotes in the YAML, of course :)
<Spooner_>
YAML is pretty Ruby-centric, compared to say JSON.
<Spooner_>
And while you are there, use haml or slim, because erb is fugly :)
<jvdz>
Spooner_: I am finding Ruby interesting so far; a bit hard to wrap my head around
indian has quit [Read error: Operation timed out]
<jvdz>
Spooner_: I saw HAML, looked pretty decent
<jvdz>
Spooner_: Many of the complicated examples for Nanoc were in ERB, so I did not want to stray my boat too far away from the shore
khakimov has quit [Quit: Computer has gone to sleep.]
<david`>
anyone can help me configuring ruby on apache (osx)?
<david`>
i already installed ruby
<shevy>
and why do you want to configure ruby with apache
digitalcakestudi has quit [Quit: Leaving.]
<david`>
i want to run ruby on my dev machine
<atmosx>
david`: I've configured ruby + lighttpd from macports once upon a time (3 years ago)
<atmosx>
was way easier as far as I remember
br4ndon has quit [Remote host closed the connection]
_bart has joined #ruby
<atmosx>
david`: you mean ruby on rails?
Squarepy has joined #ruby
<david`>
no, ruby
<atmosx>
and what apache has to do with it?
Squarepy has quit [Changing host]
Squarepy has joined #ruby
br4ndon has joined #ruby
<blazes816>
david`, are you coming from PHP by chance?
MatthewGA has quit [Ping timeout: 252 seconds]
<david`>
ins`t ruby server-side?
<blazes816>
yes
<blazes816>
that does not necessarily imply Apache
<atmosx>
apache has nothing to do with ruby
<Squarepy>
I've heard of client side ruby, rumors?
<atmosx>
wtf is client side ruby suppose to mean?
<blazes816>
Squarepy: fantasies
<Spooner_>
: david` But usually people use it with Rails or Sinatra frameworks.
hynkle has joined #ruby
br4ndon has quit [Client Quit]
mvangala has quit [Remote host closed the connection]
<blazes816>
david`: at the very least, Rack will get you http support
<Squarepy>
haha, thought chrome was gearing up for it,
<Spooner_>
Client-side ruby is supposed to have been hacked in via Google NaCl.
br4ndon has joined #ruby
<atmosx>
unicorn_rails + nginx + other shit just to avoid webrick shit
MatthewGA has joined #ruby
* atmosx
bad bad mouth
tiripamwe has quit [Read error: Connection reset by peer]
mvangala has joined #ruby
<david`>
Spooner_ sure, but don`t i have to setup ruby in the first place to be able to run the rails framework?
<blazes816>
david`: type "ruby -v"
<blazes816>
if you're on osx you should have it
<atmosx>
david`: sure
<atmosx>
blazes816: 1.8? c'mon..
shadoi has quit [Quit: Leaving.]
<blazes816>
atmosx: sorry, i don't use osx
<atmosx>
ah k
<blazes816>
I figured apple would stay up to date on these things
<shevy>
haha
<Spooner_>
david` : You have to set up Ruby, yes, but Rails/Sinatra use their own hosting systems, separate to Apache.
<atmosx>
david`: OSX comes with ruby preinstalled but uses ruby1.8 which is becoming 'obsolete'
shadoi has joined #ruby
<david`>
blazes816 i already installed ruby, my problem is configurin apache to run ruby
<atmosx>
david`: try installing RVM or macports.. rvm works fine, I'm using in one system and macrpots in the second one… both are working fine with ruby1.9
<blazes816>
david`: you don't
fflush has joined #ruby
<shevy>
david` what is your ruby version
<blazes816>
david`,
<atmosx>
david`: you don't need apache for anything on a dev machine
<shevy>
for apache, you modify httpd.conf
krz has joined #ruby
krz has quit [Client Quit]
RudyValencia has quit [Quit: My IRC client doesn't advertise in /quit messages.]
<blazes816>
david`, if you have run 1.9 installed, and ruby gems, do "gem install rails" then find a tutorial
<blazes816>
if not, install RVM, then 1.9, then proceed
<cmyers>
I'm looking for a "parallel task runner" - I have a pile of tasks which are high-latency but low CPU (e.g. making restful service calls). I'd like something where I pass a list of argument lists, a "max_jobs" parameter, then say "go". Then it evaluates the block once for each item in the list of arg lists, up to max_jobs at a time in parallel, then I can block till it is done and ask for a list of results.
<cmyers>
there must be *something* like this already...
dr_diamond has joined #ruby
dr_diamond has quit [Changing host]
dr_diamond has joined #ruby
<banisterfiend>
cmyers: objc has great support for that
<banisterfiend>
grand central dispatch
<cmyers>
objective C? cool. I want it in ruby though =)
<cmyers>
I see a ruby gem to wrap the API on mac... =/
<cmyers>
the_jeebster: I found celluloid and figured I would use it to write my own if I had to
<cmyers>
looks like sidekiq is what I need though
<cmyers>
as long as it isn't too heavyweight, this shoudl work great =)
<the_jeebster>
sidekiq is basically thread-safe resque
adeponte has quit [Remote host closed the connection]
atmosx has quit [Ping timeout: 244 seconds]
beneggett has quit [Ping timeout: 244 seconds]
beneggett has joined #ruby
tk__ has quit [Quit: ばいばい]
<cmyers>
hmm, I'm not using rails though and looking at the "plain old ruby" example, it seems pretty heavy-weight
<cmyers>
I wish I could just run it all in a simple script, without having to use ports and processes and connections and so on
ypaq has left #ruby [#ruby]
krusty_ar has quit [Read error: Connection reset by peer]
<cmyers>
hmm, might still be ok
<the_jeebster>
well both of those gems are using resque to store the tasks
<the_jeebster>
err redus
<the_jeebster>
redis*
<the_jeebster>
incase of failure, etc.
krusty_ar has joined #ruby
bullicon has quit [Quit: Computer has gone to sleep.]
<lectrick>
I sure wish they would (could?) backport this to 1.9: In Ruby 2.0 HEAD you can apparently now use %i[ symbol1 symbol2 ] to get a list of symbols, like you can strings now with %w[]
cantonic has joined #ruby
mahlon has quit [Quit: nine foot long outhouse ladle]
CaptainJet has joined #ruby
<Spooner_>
lectrick : Yeah, odd that they missed that out. Still, I'm sure there are nicer things we could do with in 1.9 :)
runa has quit [Ping timeout: 240 seconds]
<lectrick>
i agree. and i can always just do %w[ words more_words ].map(&:to_sym)
<lectrick>
it would be cool if ruby had a way to define new syntax though
MatthewGA_ has joined #ruby
* lectrick
pretends to not know about Lisp
ph^ has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
MasterIdler has quit [Quit: MasterIdler]
arkiver has joined #ruby
<shevy>
cool lectrick
<banisterfiend>
lectrick: you can hijack syntax that u dont use
<Spooner_>
lectrick : If you are following the 2.0 development, are there any (many) syntax breakers? I remember the amount of time it took to fix all those 1.8 case statements in people's gems back when 1.9 appeared (not even going to talk about all the other breakages).
JustinCampbell has joined #ruby
dankest has joined #ruby
<lectrick>
There's probably about the same number of breakages :/
<lectrick>
Growing pains
<lectrick>
I don't mind a little pain upfront if it means the code (or the running of it) is better long-term
<Spooner_>
If it makes hash parameters any less fiddly, I'm all for it breaking a lot of things :)
<lectrick>
otherwise it's pure job security lol
<lectrick>
there's a pretty good amount of ruby code out there at this point
<banisterfiend>
Spooner_: matz said that 2.0 will be backwards compat with 1.9.3
<lectrick>
banisterfiend: 100% backwards compat?
<banisterfiend>
lectrick: i think so
<Spooner_>
That would be excellent, but if it needs to break, then it should (rather than being half-arsed).
<banisterfiend>
that's the aim anyway
mxweas has joined #ruby
Criztian_ has quit [Remote host closed the connection]
<cmyers>
the_jeebster: bam, all I had to do was google the exact perl module name + "ruby"
<Gurpartap>
i'm using redisstorage so that i can have remote servers participate
<Gurpartap>
but i have some practical coding question around how exactly to get started with that
blazes816 has joined #ruby
<Gurpartap>
halp!
fflush has joined #ruby
<shevy>
hey Gurpartap
<Gurpartap>
hey man
<Gurpartap>
:)
<shevy>
what is ruote
Berglund has quit [Quit: Computer died.]
<JeremieDeNoob>
anyone know of a good gem to make a blog?
<shevy>
and why is it not spelled route
conor_ireland has quit [Quit: conor_ireland]
EricKamsky has joined #ruby
<Gurpartap>
shevy: it's a workflow engine
bglusman_ has joined #ruby
<Gurpartap>
shevy: like a master ensuring a step of things happen according to the preset conditions and flow
havenn has joined #ruby
<shevy>
aha
<Spooner_>
I'd recommend you try #ruote if you want specific answers about it, Gurpartap
fermion has joined #ruby
<Gurpartap>
shevy: like a combo of state_machine + resque/sidekiq + workers. except that with ruote, it acts as a master, to whom everyone must respond, so that eventually things do get handled
<Gurpartap>
Spooner_: been there. hardly any members there.
codezombie has joined #ruby
<shevy>
sorry, I have no idea what it is still
<Gurpartap>
barely 5, except me and a log bot
<shevy>
it sounds like a list of dependencies
<shevy>
like rake dependencies
conor_ireland has joined #ruby
<shevy>
and when it comes to handling, I demand instant fast food delivery
bglusman has quit [Ping timeout: 272 seconds]
<shevy>
I think I have finally reached the point where I need to think about tests
<shevy>
when I make changes, I no longer know whether everything still works or does not
<oz>
that's when you wish you had some tests actually :)
<sernin>
Sure, if you learn Ruby you never have to learn bullshit like Java.
<sernin>
IMO.
<Spooner_>
It rather depends what you want from the language.
greggawatt has joined #ruby
<austinallen>
Oh yeah defiantly sernin
<shevy>
austinallen it's a lot less code you have to write to solve a given problem in ruby, compared to java
<nedbat>
austinallen: there's a downside to learning ruby first: if you do, as you're learning java, you'll just keep thinking, why would I put up with this BS? If you do it the other way around, as you're learning RUby, you'll think, "this is fabulous!"
<shevy>
yeah
<shevy>
you can learn ruby easily lateron
<shevy>
start with java
<greggawatt>
i have a ruby question that relates to mkdir
<sernin>
However, I am a sysadmin/devops guy,not a developer, so I am quite biased
<austinallen>
Well i would mainly like to learn java for android development and i would like to learn ruby as my "hobby" language
<greggawatt>
i have the following vars first, middle and last. but Dir.mkdir "/home/usr/"+first+"/"+middle+"/"+last+"/"
hasrb has joined #ruby
tiripamwe has quit [Ping timeout: 240 seconds]
<greggawatt>
shoots the error mkdir': No such file or directory
<shevy>
austinallen, really. ruby will make you want to not use java anymore, so it is better if you learn java first. lateron, add ruby + jruby to that. I am trying the other way... I ahve been using ruby since a long time... and learning java is sooo boring now that I find it hard to motivate myself to do so :(
<shevy>
greggawatt, and tell what puts _ reports to you
<greggawatt>
ok
<austinallen>
I have a lot of experience with javascript and a good bit in php, it seems to me ruby is very similar to php in some forms
<shevy>
austinallen, kind of. the philosophy is quite different though
<Spooner_>
austinallen It really isn't.
davidpk has quit [Quit: Computer has gone to sleep.]
<shevy>
if you dont like objects then ruby won't be for you
<austinallen>
Oh i love objects since I've been working with them partially in javascript
<sernin>
javascript has a nice object model
<austinallen>
Some people claim javascript isn't oop, but it most certainly is in my opinion
<greggawatt>
and that works! what does the puts do differently?
<twoism>
wow. just wow
andrewhl has quit [Remote host closed the connection]
Norrin has joined #ruby
<austinallen>
Well thank you guys for your support, i most certainly will learn ruby very soon, thanks :D
<Hanmac>
austinallen in ruby mostly everything is an object ...
<Hanmac>
and with some of my bindings something could be multible objects at the same time :P
<austinallen>
Then ill love the language Hanmac because objects make a lot of sense to me
<davidcelis>
I need a good way to have my Rake TestTask only load one test file at a time, but still run all test files. What's the best way to do that?
<davidcelis>
I've got a problem where i have separate test files to test my library in different languages, but each file is loaded so only the last language gets loaded. Then all tests are run with that language
<Hanmac>
boolean: objects, simple numbers: objects, classes: objects: methods: not realy objects, but can be turned into one, blocks: turnable too
beneggett has quit [Ping timeout: 244 seconds]
eywu has quit [Quit: Leaving.]
<shevy>
nedbat remember when I wrote about crazy people in the ruby world?
<shevy>
Hanmac is one of em
<shevy>
:D
khakimov has joined #ruby
* Hanmac
is only ruby on the outside ... under them is a c++ Layer and in the Core is pure C
cantonic has quit [Quit: cantonic]
<Spooner_>
But with his special bindings, he is more than one of the crazy people :)
jonathanwallace has joined #ruby
eywu has joined #ruby
THE_GFR|WORK has quit [Ping timeout: 248 seconds]
<Hanmac>
when it has *.h or *.hpp files, then you could make a binding
beneggett has joined #ruby
lledet has quit [Read error: Connection reset by peer]
lledet has joined #ruby
cjlicata has joined #ruby
fantazo has joined #ruby
geekbri has quit [Remote host closed the connection]
cjlicata has quit [Remote host closed the connection]
thone has quit [Read error: Operation timed out]
otters has joined #ruby
mrwalker has quit [Remote host closed the connection]
greasegum has quit [Ping timeout: 252 seconds]
krusty_ar has quit [Quit: No Ping reply in 180 seconds.]
wallerdev has quit [Quit: wallerdev]
<ViperMaul>
Regex Question: Given a multiline text full of string literals following the pattern "items=118;" or "items=23;" or "items=73;" etc. Is there a way to Regex Replace by increasing each number by 1 or 2?
<ViperMaul>
So the example above results in "items=119;" "items=24;" "items=74;"
<ViperMaul>
Wow. That would be cool. Thanks I will try it.
<Hanmac>
or gsub! when you want inplace-replacement
<ViperMaul>
aye
<otters>
so if a class inherits from EM::Connection
<otters>
wait
tommyvyo has joined #ruby
rbanffy has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
gmci has joined #ruby
Maniacal has quit [Quit: Leaving]
Maniacal has joined #ruby
wvms has joined #ruby
krusty_ar has joined #ruby
baroquebobcat has quit [Ping timeout: 246 seconds]
balki has quit [Read error: Connection reset by peer]
THE_GFR|WORK has quit [Ping timeout: 240 seconds]
beneggett has quit [Ping timeout: 272 seconds]
shadoi has quit [Quit: Leaving.]
habib has quit [Remote host closed the connection]
stopbit has quit [Quit: Leaving]
nazty has quit [Quit: WeeChat 0.3.7]
shadoi has joined #ruby
dv310p3r has quit [Ping timeout: 272 seconds]
sebicas has quit [Quit: sebicas]
beneggett has joined #ruby
hunglin has quit [Quit: Leaving.]
chson has quit [Remote host closed the connection]
lorandi has quit [Quit: Leaving]
reuf has quit [Quit: Leaving]
THE_GFR|WORK has joined #ruby
sgronblom has quit [Ping timeout: 244 seconds]
dpritchett has quit [Quit: Leaving...]
Foxandxss has joined #ruby
baroquebobcat has joined #ruby
the_jeebster has quit [Quit: Leaving.]
vlad_starkov has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Leaving...]
timonv has quit [Remote host closed the connection]
DrShoggoth has quit [Quit: Leaving]
v0n has quit [Remote host closed the connection]
khakimov has joined #ruby
baroquebobcat has quit [Ping timeout: 250 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
otters has quit [Ping timeout: 246 seconds]
khakimov has quit [Ping timeout: 240 seconds]
<rking>
Hrm. How bad am I if I val.to_s.empty?
awarner has quit [Remote host closed the connection]
krusty_ar has quit [Ping timeout: 272 seconds]
<Hanmac>
hm rking what class is val?
cakehero has quit [Quit: Computer has gone to sleep.]
chrisbolton has joined #ruby
headius has joined #ruby
krusty_ar has joined #ruby
otters has joined #ruby
<rking>
Hanmac: Some junky thing of whateverness.
<rking>
Hanmac: It's actually an ActiveRecord::Base child field
<rking>
All I'm trying to say is, "Don't display this field if it's more or less empty.", and I figured the .to_s is doing its own logic that boils it down to an empty string anyway. (For the case where it's an actual String, a number, a boolean, a nil, etc.)
klipeto has quit [Ping timeout: 248 seconds]
snearch has joined #ruby
krz has joined #ruby
<X-Jester>
can you just val.empty? ?
<X-Jester>
or is val not implicitly a method that inherits empty?
carloslopes has quit [Quit: Leaving.]
<X-Jester>
er, s/method/object
bradhe has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
<rking>
X-Jester: #empty? is not on a bunch of classes, e.g. TrueClass/FalseClass/NilClass
jrist is now known as jrist-brb
<rking>
X-Jester: ActiveRecord does a good bit of type conversion, so boolean fields are true Ruby booleans.
<X-Jester>
alright, i wondered if every object inherited empty?
<X-Jester>
but that doesn't make sense
ramblex has quit [Ping timeout: 264 seconds]
<X-Jester>
so i'm dumb, and plesae ignore my stupid question
<rking>
It'd be a good meditation, to try to define .empty? one at a time, on each class.
<X-Jester>
my (furthermore useless) observation is, as long as to_s doesn't bark at nilclass, your method seems pretty efficient
bradhe has quit [Read error: Connection reset by peer]
<rking>
X-Jester: Cool. Thanks. (Also thanks to Hanmac up there for asking the thing I should've prespecified)
bradhe has joined #ruby
austinallen_ has joined #ruby
<X-Jester>
i'd say it's probably more precise to check the reference itself for nil, and then specifically check references within the class for nil if they're 'has-a' objects
<X-Jester>
but that can be tedious and often unnecessary in ruby
pskosinski has quit [Ping timeout: 255 seconds]
austinallen has quit [Ping timeout: 246 seconds]
austinallen_ is now known as austinallen
<rking>
Hrm, that might be a good solution for a BasicObject#empty?
RichieEvan has quit [Quit: RichieEvan]
Criztian has quit [Remote host closed the connection]
uris has quit [Quit: leaving]
johnlcox has quit [Ping timeout: 272 seconds]
<rking>
FalseClass would be more quirky. In this very case I want it to mean non-empty, but elsewhere I'm sure I'd think otherwise.
bradhe_ has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
mikepack has quit [Remote host closed the connection]
tvw has quit [Read error: Connection reset by peer]
RichieEvan has joined #ruby
PaciFisT has joined #ruby
dpritchett has joined #ruby
SCommette_ has joined #ruby
RichieEvan has quit [Client Quit]
bradhe_ has quit [Read error: Connection reset by peer]
JustinCampbell has quit [Remote host closed the connection]
<shevy>
lies!
<shevy>
lieeees
<shevy>
everywhere!
RichieEvan has joined #ruby
linoj has joined #ruby
dross_ has joined #ruby
nicoulaj has quit [Read error: Connection reset by peer]
krusty_ar has quit [Ping timeout: 252 seconds]
<rking>
FalseClass.lies! => true
dross has quit [Ping timeout: 246 seconds]
krusty_ar has joined #ruby
savage- has joined #ruby
<blazes816>
there're a lot of sublime text users here yeah? any idea how to get a terminal window? I found a few plugins but they didn't seem to be what i want.
<davidcelis>
what
sebastorama has quit [Quit: Computer has gone to sleep.]
<blazes816>
? I mean in the editor
Dreamer3 has joined #ruby
<blazes816>
like in aptana, there was a bottom pain that was a terminal
<rking>
Hehe. Maybe *some day* I'll understand the appeal of some editor that is not vim? A guy can dream.
<blazes816>
rking: i'm trying it out, normally I use vim
<blazes816>
i just installed it earlier today
savage-_ has quit [Ping timeout: 245 seconds]
<rking>
blazes816: Anything you found yet that's like, "Ohh, nice." ?
<blazes816>
and the first thing I did was install vim short cuts ;)
<blazes816>
only that there seem to be more supported stuff for newer langauges. stylus, coffescript, etc
savage-_ has joined #ruby
ciopte7 has quit [Quit: ciopte7]
<blazes816>
but i don't think i'll have too long a stay
austinallen has quit [Quit: austinallen]
kirun has quit [Quit: Client exiting]
savage- has quit [Ping timeout: 244 seconds]
MasterIdler_ has joined #ruby
MasterIdler_ has quit [Client Quit]
nedbat has quit [Disconnected by services]
beneggett has joined #ruby
nedbat_ has joined #ruby
Rezwan has joined #ruby
brianpWins has quit [Quit: brianpWins]
MasterIdler has quit [Ping timeout: 246 seconds]
RichieEvan has quit [Quit: RichieEvan]
Gavilan has joined #ruby
chrisbolton has quit [Quit: chrisbolton]
hasrb has quit [Remote host closed the connection]
manizzle has quit [Read error: Connection reset by peer]
awarner has joined #ruby
manizzle has joined #ruby
SCommette_ has quit [Quit: SCommette_]
chson has joined #ruby
<rking>
blazes816: BTW the vim-coffee-script addon is pretty decent.
snearch has quit [Quit: Verlassend]
fantazo has quit [Remote host closed the connection]
minijupe has quit [Quit: minijupe]
<rking>
I'd like to know what the "supported stuff" means. Syntax highlighting is easy (and already done for everything like CoffeeScript)
<blazes816>
rking: just stuff like stylus, and handlebars. I havn't found nearly as good of implementations for vim.
<ForSpareParts>
Does anybody have strong opinions on Slim vs Haml? I'm digging into templating languages, and I'd like to know the pros and cons...
<blazes816>
i like eco ....
<rking>
blazes816: Oh dang.
<rking>
I've been using Sass and loving it, but Stylus looks even more aggressive.
adeponte has quit [Remote host closed the connection]
<Spooner_>
ForSpareParts : There isn't a massive difference really.
ryh has joined #ruby
nateberkopec has quit [Ping timeout: 265 seconds]
xiphiasx_ has quit [Quit: leaving]
<Spooner_>
ForSpareParts : I found slim a little slim on decent docs, if that matters.
<rking>
mrsolo: You can easily set it so that whenever you save .coffee it compiles to .js, and then there's stuff like :CoffeeCompile watch vert
xiphiasx_ has joined #ruby
<ForSpareParts>
Spooner_: Hm. It probably does.
ddouglas has joined #ruby
dankest has quit [Ping timeout: 246 seconds]
<ForSpareParts>
I'm working on a project that will probably be maintained by people with little to no coding knowledge, so at this point the thinking is we'll go with ERB
<Gavilan>
ForSpareParts: That's every project :)
<ForSpareParts>
but I like the concept of haml, based on what little I've seen, so I wanted to make sure there wasn't some sort of good compromise.
indian has joined #ruby
<blazes816>
rking: it's the future! ;)
<rking>
It is.
<rking>
blazes816: Thanks for the ref.
<rking>
blazes816: BTW I want to make this one superawesome syntax file to make use of 256 colors.
<rking>
All it does is colorize indent levels uniquely.
<rking>
But it would be a better YAML syntax highlighter than what we have now, and for any new nested language.
bglusman has quit [Ping timeout: 272 seconds]
<blazes816>
interesting...
ciopte7 has joined #ruby
adeponte has joined #ruby
sebastorama has joined #ruby
<rking>
In fact, I'm going to do one of ~3 goofball saw-sharpenings along that lines. If anyone wants to vote for it, send an email to yeahidlikethat256colorindentedthing@sharpsaw.org , and I'll do it then email you back.
<rking>
I'm going to do one of those things next week, that is.
SQLStud has quit [Quit: Leaving]
ciopte7 has quit [Client Quit]
<rking>
Or feel free to vote by sending to pry-docmore_ohthatllhelpthen00bsandevenme@sharpsaw.org , if you want me to finish pry-docmore, a thing so that you can say "? $'" in pry and it'll show you what $' is all about.
xaq has quit [Remote host closed the connection]
<rking>
(Plus also "? alias", so you can see which order the args go, and all the other keywords too)
xaq has joined #ruby
<ddouglas>
excuse me, folks, but I have a simple query... when I declare a local variable inside of a block, why can't I access it outside of the blocK? Why do I have to use instance variables?
<otters>
is there a tool that will print out every function that gets executed
strife25 has joined #ruby
ryh has quit [Remote host closed the connection]
<rking>
ddouglas: If you want that variable to access outside of that, you'll want to declare it before the block starts. That way the block "closes" on it and has a reference to it. You wouldn't want random vars leaking out from a block.
<rking>
otters: Yeah, there are several.
<ddouglas>
that makes sense
<ddouglas>
thanks
beneggett has quit [Ping timeout: 244 seconds]
<rking>
otters: I'm logging out so I can't search for the exact things, but there's the debugger in trace mode and also you can simply define that one method, set_trace_func or something.
* rking
out! Don't forget to vote! ☝
<otters>
neato!
RichieEvan has joined #ruby
awarner has quit [Remote host closed the connection]
devdazed has quit [Quit: Computer has gone to sleep.]
Stalkr_ has quit [Quit: Leaving...]
nadirvardar has quit [Remote host closed the connection]
sailias has joined #ruby
greyEAX has quit [Read error: Connection reset by peer]
blazes816 has quit [Quit: Leaving]
savage-_ has quit [Remote host closed the connection]
billiam has quit [Read error: Connection reset by peer]
fermion has quit [Quit: Computer has gone to sleep.]
RichieEvan has quit [Read error: Connection reset by peer]
beneggett has joined #ruby
savage- has joined #ruby
RichieEvan has joined #ruby
RichieEvan has quit [Remote host closed the connection]