xyzodiac has quit [Quit: Computer has gone to sleep.]
xyzodiac has joined #ruby-lang
Drekonus has joined #ruby-lang
Drekonus has quit [Quit: Leaving.]
quellhorst has quit [Remote host closed the connection]
Axsuul has joined #ruby-lang
postmodern has joined #ruby-lang
seanstickle has quit [Quit: seanstickle]
ryanlecompte has quit [Remote host closed the connection]
CaptainJet has joined #ruby-lang
irevert has joined #ruby-lang
irevert has left #ruby-lang [#ruby-lang]
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
synthetix has joined #ruby-lang
jhn has joined #ruby-lang
methods has joined #ruby-lang
<jhn>
Does anyone have experience with super basic sinatra and the twilio api and wants to pair with a newbie for like 15 minutes? :(
<shachaf>
You'll probably have better luck if you ask specific questions that you have. :-)
<jhn>
shachaf: Yeah, I had to give it a shot though... I'm putting everything into a gist right now to be as clear as possible.
methods has quit [Quit: Leaving.]
rohit_ has joined #ruby-lang
<jhn>
So what I'm trying to do is to use the Twilio API to call my cellphone and have it say some text that is generated from an external source...
<jhn>
The whole thing lives on Heroku as an app—here's what it looks like: https://gist.github.com/4192650 ; the actual text is generated locally on my machine.
<jhn>
I just want to find a way to pass the text to this app using the terminal directly. I was trying to do it with curl but I haven't had any luck so far.
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
epitron has joined #ruby-lang
epitron has joined #ruby-lang
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
imperator has quit [Quit: Leaving]
tenderlove has quit [Remote host closed the connection]
<petercooper>
jhn: You know about params[]?
<petercooper>
jhn: You could use params[:text] in there, then call it with curl -d "text=whatever" http://localhost:XXXX/instructions
<jhn>
petercooper: Yeah, that's sort of what I was trying to do before. I'll try again.
<zzak>
petercooper: passing off the reins for jsweekly, eh?
<petercooper>
Yesh
<zzak>
still going to do the other newsletters tho?
<petercooper>
For now!
<zzak>
looking for new maintainers?
areil has joined #ruby-lang
<petercooper>
Eventually, but want to see how it works out first.
<zzak>
that should free you up some, how much time do you spend a week for those newsletters?
<jhn>
petercooper: I don't think it'll work because I need to make a call to /call so that Twilio picks it up...
<petercooper>
Oh right, so you never personally hit /instructions, just your app does?
<jhn>
petercooper: If I post directly to instructions then it doesn't work
<jhn>
Yes
<Spaceghostc2c>
petercooper: Cooper no cooping! :p
wardrop has quit [Ping timeout: 256 seconds]
wardrop has joined #ruby-lang
<petercooper>
zzak: I don't know for sure, it's hard to pin down. But several hours, at least.
rohit_ has quit [Read error: Connection reset by peer]
<zzak>
petercooper: if and when you decide to step down from the news related stuff, you will suffer from some serious information addiction
nertzy has joined #ruby-lang
<zzak>
withdrawls*
<petercooper>
Possibly but that probably won't happen
<petercooper>
Since the goal is to hand off already established newsletters to have time to launch new ones ;-)
<zzak>
haha nice, i was more or less joking anyways
Aria has joined #ruby-lang
<zzak>
what's next? cooper press ladygaga weekly?
<petercooper>
from what i understand of modern Rubyists, a Ke$ha Weekly would do well
<matti>
zzak: ;]
<zzak>
even better
xyzodiac has quit [Quit: Computer has gone to sleep.]
<jhn>
petercooper: Solved it by creating an another POST route that saved params[:value] into a class variable.
<Spaceghostc2c>
Oh dear.
<jhn>
petercooper: Now I can POST the info I want to pass to that address with curl and then curl /call so that the Twilio call is triggered. It's ugly but it works I guess...
<postmodern>
apod, and is that only for Mountain Lion?
Hakon has quit [Quit: Leaving...]
<apod>
postmodern: i think there is a Lion version also there
Paradox has quit [Read error: Operation timed out]
heftig has quit [Quit: leaving]
Paradox has joined #ruby-lang
Hakon has joined #ruby-lang
Hakon has quit [Client Quit]
cultureulterior_ has quit [Ping timeout: 260 seconds]
cultureulterior_ has joined #ruby-lang
blacktul_ has joined #ruby-lang
marr has quit [Ping timeout: 260 seconds]
blacktulip has quit [Ping timeout: 264 seconds]
runeb has joined #ruby-lang
vlad_starkov has joined #ruby-lang
ioga_wrk has joined #ruby-lang
rohit_ has joined #ruby-lang
<kke>
is there some beautiful way to do something like first_row = true; foo.parse { |row| if first_row { do_stuff; first_row = false; } else { .. } }
<darix>
kke: what is so bad about this code?
<andrewvos>
postmodern: I'm actually just installing all the dev stuff on a new ML box
<andrewvos>
postmodern: Let me know if you have any questions
<kke>
darix: nothing, it works, but it always bugs me.
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
<darix>
kke: well if you just do templating stuff
<darix>
i saw something cool with iterators in a presentation recently
<kke>
perhaps some local scoped "once { .... }" would be nice
<darix>
ah you just need special treatment for the very first row?
<kke>
yes
<darix>
hm
<kke>
and assigning a temp variable for that feels like 20 goto 10
<darix>
for iterating over normal arrays or so you could use each_with_index { |row,i| if i ..
<darix>
but hm
<apod>
kke: foo.parse.with_index { |row, i | if i.zero? { do_stuff; first_row = false; } else { .. } } not sure if this would work with parse, but it works fine with map etc.
<kke>
and that assigns a throwaway variable for each row for the GC to munch on
rohit_ has quit [Ping timeout: 260 seconds]
<darix>
kke: well you will have to bite one bullet
<darix>
unless your row object has someone you can use as indicator
cantonic has joined #ruby-lang
postmodern has quit [Quit: Leaving]
replore has joined #ruby-lang
<judofyr>
kke: I've been thinking about an Array#with_state: [1, 2, 3].with_state { |ele, state| p [ele, state.first?, state.last?, state.next, state.prev, state.index] }
<judofyr>
I think it would be useful
kristofferrr has joined #ruby-lang
kristofferrr has quit [Client Quit]
jds has quit [Ping timeout: 260 seconds]
jds has joined #ruby-lang
gaveen has left #ruby-lang ["Leaving"]
mindbender1 has quit [Ping timeout: 265 seconds]
rohit_ has joined #ruby-lang
GarethAdams has joined #ruby-lang
banisterfiend has joined #ruby-lang
rsl has joined #ruby-lang
<apeiros_>
judofyr: .iterator ?
mindbender1 has joined #ruby-lang
<apeiros_>
though, testing for an iteration property on every iteration, even though you know it will only be true in a single one, feels bad
<apeiros_>
I prefer to do: do_special_thing(ary.first); ary[1..-1].each do …do_normal_thing… end
nyuszika7h has quit [Ping timeout: 246 seconds]
<kke>
apeiros_: yeah that's fine if you have an array, but if you're doing something like parsing a large file line by line then you need something else
spuk has joined #ruby-lang
<apeiros_>
kke: and why'd that be?
heftig has joined #ruby-lang
<apeiros_>
do_special_thing(fh.gets); fh.each_line do …do_normal_thing… end
<kke>
apeiros_: CSV.foreach('foo.csv') do |row|
<apeiros_>
in that case a special method won't help you either. you'd need it on every class which provides iteration. see Enumerator for that.
fireglow has quit [Remote host closed the connection]
<apeiros_>
csv = CSV.enum_for(:foreach, …); do_special_thing(csv.next); loop do do_normal_thing(csv.next) end
<kke>
exotic
<apeiros_>
generic
chaosis has joined #ruby-lang
nyuszika7h has joined #ruby-lang
<kke>
if you need to do special_thing plus the normal thing for first row, then you must rewind somehow
<apeiros_>
no
<apeiros_>
then you refactor and use *methods*
<kke>
gasp
<apeiros_>
you know, like what you normally do when you do OO…
<apeiros_>
csv = CSV.enum_for(:foreach, …); first_line = csv.next; do_special_thing(first_line); do_normal_thing(first_line); loop do do_normal_thing(csv.next) end
<apeiros_>
2 more statements, yikes! :)
<apeiros_>
kke: but yeah, you can even rewind, if you want
<apeiros_>
csv = CSV.enum_for(:foreach, …); first_line = csv.next; do_special_thing(first_line); csv.each do …do_normal_thing… end
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
<apeiros_>
as in: you can use a way which works in general and use that as a fallback, and implement optimized versions for containers which support it
banisterfiend has quit [Ping timeout: 260 seconds]
banisterfiend has joined #ruby-lang
synthetix has quit [Ping timeout: 245 seconds]
xyzodiac has joined #ruby-lang
mindbender1 has joined #ruby-lang
m3nd3s has quit [Remote host closed the connection]
chaosis has quit [Ping timeout: 260 seconds]
Carnage\ has quit [Ping timeout: 265 seconds]
Carnage\ has joined #ruby-lang
rippa has joined #ruby-lang
workmad3 has joined #ruby-lang
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
rippa has quit [Ping timeout: 248 seconds]
runeb has quit [Remote host closed the connection]
rohit_ has quit [Quit: Leaving]
Swimming_Bird has joined #ruby-lang
nyuszika7h has joined #ruby-lang
nertzy2 has joined #ruby-lang
nertzy has quit [Ping timeout: 248 seconds]
rue|w has quit [Ping timeout: 264 seconds]
slyphon has quit [Ping timeout: 245 seconds]
runeb has joined #ruby-lang
jperry2 has quit [Quit: jperry2]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
slyphon has joined #ruby-lang
slyphon has quit [Read error: Connection reset by peer]
slyphon has joined #ruby-lang
slyphon_ has joined #ruby-lang
slyphon has quit [Ping timeout: 245 seconds]
outoftime has joined #ruby-lang
AndChat| has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 245 seconds]
m3nd3s has joined #ruby-lang
sailias has joined #ruby-lang
slyphon_ has quit [Ping timeout: 244 seconds]
S2kx has joined #ruby-lang
S1kx has quit [Ping timeout: 265 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
Hakon has joined #ruby-lang
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
nyuszika7h has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
Hakon has joined #ruby-lang
synthetix_ has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
xyzodiac has joined #ruby-lang
xyzodiac has quit [Max SendQ exceeded]
xyzodiac has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
mars777 has joined #ruby-lang
synthetix_ has quit [Remote host closed the connection]
<tockitj_>
if class includes module, and at the same time overrides one of its methods, is it possible to call that overridden method on object other than self ?
justinseiter has quit [Ping timeout: 250 seconds]
dr_bob has quit [Quit: Leaving.]
judofyr has quit [Remote host closed the connection]
slyphon__ has joined #ruby-lang
justinseiter has joined #ruby-lang
intellitech has quit [Ping timeout: 260 seconds]
slyphon_ has quit [Ping timeout: 245 seconds]
<andrewvos>
tockitj_: super?
<andrewvos>
I might be wrong
davidbalber|away is now known as davidbalbert
banisterfiend has quit [Read error: Connection reset by peer]
<tockitj_>
andrewvos, super implicitly sends 'self'
just495 has quit [Read error: Connection reset by peer]
justinseiter has quit [Ping timeout: 265 seconds]
cored has quit [Ping timeout: 252 seconds]
davidbalbert is now known as davidbalber|away
sush24_ has quit [Quit: This computer has gone to sleep]
justinseiter_ has quit [Ping timeout: 248 seconds]
__butch__ has joined #ruby-lang
cored has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
justinseiter has joined #ruby-lang
Carnage\ has quit []
justinseiter_ has joined #ruby-lang
Carnage\ has joined #ruby-lang
xyzodiac has joined #ruby-lang
justinseiter has quit [Ping timeout: 252 seconds]
bastilian has quit [Quit: Leaving...]
sn0wb1rd has joined #ruby-lang
justinseiter_ has quit [Ping timeout: 245 seconds]
justinseiter has joined #ruby-lang
areil has quit [Remote host closed the connection]
sent-hil has joined #ruby-lang
fushi has joined #ruby-lang
justinseiter_ has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
alvaro_o has joined #ruby-lang
Carnage\ has quit []
BigO has quit [Remote host closed the connection]
justinseiter has quit [Ping timeout: 256 seconds]
Carnage\ has joined #ruby-lang
justinseiter_ has quit [Ping timeout: 264 seconds]
bhus has joined #ruby-lang
BigO has joined #ruby-lang
justinseiter has joined #ruby-lang
swav has quit [Remote host closed the connection]
justinseiter_ has joined #ruby-lang
mindbender1 has joined #ruby-lang
fushi has quit [Quit: fushi]
ivanoats has joined #ruby-lang
justinseiter_ has quit [Read error: Operation timed out]
justinseiter has quit [Ping timeout: 248 seconds]
towski has joined #ruby-lang
davidbalber|away is now known as davidbalbert
justinseiter has joined #ruby-lang
dalekurt_ has quit [Read error: Operation timed out]
justinseiter_ has joined #ruby-lang
sush24_ has joined #ruby-lang
BigO_ has joined #ruby-lang
sepp2k has joined #ruby-lang
justinseiter has quit [Read error: Operation timed out]
BigO has quit [Ping timeout: 256 seconds]
banister_ has left #ruby-lang [#ruby-lang]
banisterfiend has joined #ruby-lang
<banisterfiend>
anyone here use rbenv?
justinseiter has joined #ruby-lang
sent-hil has quit [Remote host closed the connection]
justinseiter_ has quit [Ping timeout: 256 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby-lang
<foucist>
banisterfiend: hey, i'm sure a lot of people do.. why not ask your question anyways :P
__butch__ has quit [Quit: Leaving.]
<banisterfiend>
ok, how do i pass along compile options when building a ruby? I specifically want -O0
<banisterfiend>
(no optimization)
<banisterfiend>
building a ruby with rbenv
mrsolo has joined #ruby-lang
justinseiter has quit [Ping timeout: 248 seconds]
<cout>
banisterfiend: I think you can just set CFLAGS when you ru nmake
<cout>
e.g. CFLAGS=-O0 make
xyzodiac has joined #ruby-lang
<cout>
or maybe it's make CFLAGS=-O0
<cout>
I can never remember which one works
<reactormonk>
cout, both should actually work
<banisterfiend>
cout: ah, but im not explicitly using 'make' im just using rbenv commands, but you think if i set CFLAGS rbenv will use those anyway?
<reactormonk>
the first is usual bash syntax for env vars, the second one make syntax
<reactormonk>
banisterfiend, if you export them
<foucist>
banisterfiend: yeah i mean, you could try alias rbenv="CFLAGS=-O0 rbenv" or export CFLAGS=-O0 in your shell config
<cout>
reactormonk: I've seen makefiles that ignore CFLAGS in one case and not in the other
<foucist>
dunno if the alias trick would actually pass that to the compile
justinseiter has joined #ruby-lang
<banisterfiend>
foucist: but really, wondered if rbenv had some built in options or strategy for doing this
<banisterfiend>
i wondered*
<foucist>
i'm not familiar with rbenv personally
m3nd3s has quit [Remote host closed the connection]
Hakon has joined #ruby-lang
hahuang65 has joined #ruby-lang
hahuang65 has quit [Client Quit]
<reactormonk>
cout, then it's a fail of a makefile...
<reactormonk>
cout, but that's possible either way
<cout>
yep
sush24_ has quit [Quit: Leaving]
esad has joined #ruby-lang
apod has joined #ruby-lang
<rking>
If you step back and think about the editing you do, you will invariably find the 'end' is a burdensome thing to edit.
<banisterfiend>
rking: y?
<rking>
Indentation-significant blocks, for whatever argument might exist against it, is less redundant
<rking>
banisterfiend: I just find myself constantly having to fiddle with them
bastilian has joined #ruby-lang
<banisterfiend>
rking: in emacs i have a hot key, i just press it, and it fixes up all indentation in teh buffer immediately
<rking>
Yep, vim has that too, but you shouldn't have to hit it so much
<rking>
Take the case of a simple 'Extract Method'
<cout>
gg=G
sent-hil has joined #ruby-lang
<rking>
Instead of taking the original sub-method, replacing it with a name, then going down and saying 'def newname' and pasting the body, you have to hop down and type a stupid 'end'
banisterfiend has quit [Remote host closed the connection]
<rking>
It's probably 20 little things like that, all not in favor of 'end'
<rking>
I argumentated so greatly that he quit. \o/
<bougyman>
when I type dev newname the end automatically gets inserted.
<bougyman>
I can't remember the last time I typed an 'end'
<bougyman>
er def newname
cultureulterior_ has quit [Quit: cultureulterior_]
<bougyman>
tis a habit from lisp where I always wanted the closing paren.
<rking>
bougyman: I have that, too, thanks to endwise.vim — but they *still* get in the way
<bougyman>
doesn't seem to happen here, i just have a one-liner that does it i got from some vimtip
<rking>
Even with several layers of editor hacks to make up for the misfeature, they're still a nuisance
banisterfiend has joined #ruby-lang
<rking>
bougyman: Just try to step back and see how many 'end'-related edits happen. It's a lot
<rking>
All for IMO nothing
__butch__ has joined #ruby-lang
<bougyman>
i don't do many end-related edits, that's what i'm saying.
<bougyman>
i can't remember the last time I had to touch and end line
<eam>
I'd rather make a bit of work for the author than to lose clear semantic meaning for subsequent readers
<eam>
a good language is not about ease of writing, it's about ease of reading
<bougyman>
+1
<rking>
Heh, except the 'end's don't do anything for that.
<eam>
I strongly disagree
<rking>
Just redundant against what you already said with the blocks.
<bougyman>
as do I.
<banisterfiend>
eam: so you find python code harder to read?
<bougyman>
are you proposing dropping the end and replacing it with indentation rules?
<eam>
banisterfiend: yes, I do
<bougyman>
are you aware there's python out there?
<rking>
bougyman: For the next language after Ruby, yes.
<bougyman>
python is a great language that I rarely touch because doing so makes me want to poke my eyes out.
<eam>
in fact I even dislike ruby's end-of-statment semantics
<rking>
eam: Hehe, OK. We're very different people. Screw explicit ;'s.
<banisterfiend>
eam: what do u mean?
<eam>
banisterfiend: I favor the semicolon
<bougyman>
ew
<bougyman>
now I fight you, too. hate explicit semicolon.
vlad_starkov has quit [Remote host closed the connection]
justinseiter_ has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
<eam>
and I hate any situation where some whitespace is more significant than other whitespace :)
<eam>
but to each his own
<banisterfiend>
eam: so, if you had a method that was just returning 'x' you'd just have: x;
<banisterfiend>
on a line by itself?
<bougyman>
i like as little punctuation as possible. but no less.
<eam>
banisterfiend: sure
<banisterfiend>
eam: that would look weird :)
<eam>
banisterfiend: though I prefer "return x"
<bougyman>
he probably would type 'return x;' even if it were implicit.
<bougyman>
I do that often.
<bougyman>
because then if I move code around I know that that's supposed to return.
<eam>
I think implied contextual behavior makes code harder to read
<bougyman>
well, i do 'return x', not 'return x;'
<bougyman>
the semicolon seems to add nothing.
<bougyman>
just works your pinkie
vlad_starkov has joined #ruby-lang
<banisterfiend>
eam: i guess you're against 'everything is an expression' too?
<eam>
bougyman: if it makes you feel better I don't feel as strongly about the semicolon as I do about explicit block ends
<eam>
banisterfiend: how do you mean?
<eam>
bougyman: but the thing the semicolon adds in value is an explicit, clear delineation between statements.
<banisterfiend>
eam: in ruby, everything (or nearly everything) is an expression, everything returns a value. So you can go: x = if cond; y; z; end
<banisterfiend>
eam: even class definitions return values, and method definitions
bastilian has quit [Quit: Leaving...]
<banisterfiend>
eam: there is no distinction between "statements" and "expressions"
<eam>
banisterfiend: that's fine. The reason I would use a return is to make intent clear
esad has quit [Quit: Computer has gone to sleep.]
Guest50800 is now known as ged
anjen has joined #ruby-lang
<eam>
the utility and design of the language is distinct from the effort necessary to write code which makes intent clear
<eam>
I can make many syntatically correct constructs in English, but I would be a poor writer if I used many of them
<banisterfiend>
eam: so...you would have to maek such a distinction (which would be artificial in ruby) as i doubt you'd want people to end if-expressions with semicolons ?
Theueip has joined #ruby-lang
ged has joined #ruby-lang
<eam>
banisterfiend: "end" and "}" and ";" are all non-whitespace identifiers. I'm ok with any of them ending a statement
esad has joined #ruby-lang
<bougyman>
eam: you'd need end;, though
<rking>
eam: Explicit returns punish short methods
<bougyman>
to keep consistent
<eam>
The use of the semicolon is in clearly distinguishing between two adjacent statements
<banisterfiend>
eam: but that would be confusing to people coming from C, whre struct definitions to end with a ;
vlad_starkov has quit [Ping timeout: 260 seconds]
<banisterfiend>
do*
<rking>
And short methods are something I ♥, so explicit returns are something I ☠.
<eam>
banisterfiend: blocks in C do not end with a ;
<banisterfiend>
eam: struct definitions do
<eam>
banisterfiend: I agree C's syntax is not as clean as it could be
<eam>
I prefer ruby's syntax over C's, all told
<banisterfiend>
yeah.
<banisterfiend>
eam: so..in your idea, a pure method invocation would end with a ';' but a method invocation that takes a block wouldn't need one?
workmad3 has quit [Ping timeout: 250 seconds]
<eam>
the reason I like the semicolon is to remove this kind of confusion: eval("1 - 1") vs eval("1 \n - 1") vs eval("1 - \n 1")
<eam>
banisterfiend: something like that, sure
<eam>
banisterfiend: I like perl's handling of the semicolon, for example
dc5ala has joined #ruby-lang
<rking>
eam: Backslash also removes that confusion
<eam>
rking: well, the semicolon only works if it's always required
<rking>
Multi-line statements are less common, so it's a misoptimization to require a token for single-line statements.
<eam>
see, again I prefer slightly more verbose syntax in the interest of removing ambiguity
<eam>
anyway, it's a relatively minor thing
<rking>
There isn't any ambiguity. The only ambiguity would be for people that don't know the language.
rins has joined #ruby-lang
m3nd3s has joined #ruby-lang
<rking>
And again, people that don't know the language are less common, so catering to them is a misoptimization.
<eam>
well, I disagree. People aren't perfect and mistakes happen
<ggreer>
rking: just curious, why didn't you use if (pattern[0] == '/') ?
<eam>
I've personally been bitten by placing an operator on the wrong line
<rking>
ggreer: D'oh! Not thinking at all.
<ggreer>
no biggie. that strcmp takes like 1 nanosecond
<rking>
ggreer: I was mostly just trying to think about if I was going to be screwing up the behavior.
<ggreer>
heh
<ggreer>
it's fine
* ggreer
merges
<rking>
ggreer: I'd rather it be the char comparison so it communicates intent better. The strncmp() makes people stop and scratch their heads
<rking>
ggreer: Can I redo it with that patch before you do?
<ggreer>
hmm... well I need to find an appropriate animated gif before I can merge it
<ggreer>
so... yeah go for it
datanoise has quit [Ping timeout: 260 seconds]
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
<rking>
ggreer: (k)
sent-hil has quit [Remote host closed the connection]
sent-hil has joined #ruby-lang
<sent-hil>
how to get list of constants defined by user?
<sent-hil>
I did Object.constants(false), that listed everything
<KU0N>
Is it possible, when loading a file, to put it into a namespace (Module). For example if I require 'json' I want to access JSON like Something::JSON instead of JSON directly.
<lupine>
progressively building up larger and larger strings over time is remarkably slow
<rking>
lupine: I like that one *so* much better.
<rking>
s/lupine/bradland/
MaddinXx has quit [Remote host closed the connection]
<lupine>
shame it's incorrect ^^
<bradland>
it is?
<lupine>
f||b rather than f&&b
<lupine>
at least, if I understand the problem description correctly
<bradland>
f&&b would only print if both were true
<lupine>
right, which is what you want
<lupine>
"fizzbuzz" printed if the number is divisible by both 3 and 5
<rking>
lupine: You're being dumb.
<lupine>
?
<rking>
That's the most accurate thing you've said so far.
<rking>
bradland's is identical in output to yours.
* rking
is being surly. Sorry.
nignaztic has joined #ruby-lang
dankest is now known as dankest|away
adambeynon has quit [Quit: Computer has gone to sleep.]
<bradland>
lupine: the key to my solution is that f or b may be nil, in which case it won't be printed
<bradland>
but that's a good sign that my example is bad
<bradland>
it should be easily interpreted
<bradland>
if it's non-obvious, it's no good, IMO
<rking>
bradland: It's plenty obvious to someone who knows Ruby
<bradland>
i should have left it with the if/elsif statements
<rking>
And if someone is unsure about how it acts, they're in for an educational moment.
savage- has joined #ruby-lang
tridge has joined #ruby-lang
lordnaz has quit [Ping timeout: 256 seconds]
<lupine>
oh $deity, you're right
<bradland>
:)
<yorickpeterse>
lianj: "the syntax sucks" "it's more annoying that prototype based" wat
nignaztic has quit [Client Quit]
nignaztic has joined #ruby-lang
<lupine>
it's been a long, bad day
<lianj>
yorickpeterse: yea, unrelated failures
ryanlecompte has quit [Ping timeout: 244 seconds]
davidbalbert is now known as davidbalber|away
tridge has quit [Remote host closed the connection]
bhus has quit [Quit: Leaving]
leopard_me has quit [Quit: Computer has gone to sleep.]
mjio has joined #ruby-lang
heftig_ is now known as heftig
chimkan has quit [Quit: chimkan]
bluepojo has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
<tockitj_>
quote of a friend: 'If I have a private method called `foo=`, I *must* use `self`. If I have a private method called `foo`, I am *forbidden* to use `self`.'
<tockitj_>
this is... ugly
elephants has joined #ruby-lang
elephants has left #ruby-lang [#ruby-lang]
<bradland>
tockitj_: not sure I understand? i thought the purpose of 'self' is to make a class method, versus an instance method. i'm not sure what that has to do with wether the method is private.
<bradland>
(asking because I'm learning, not because I think I'm right )
KU0N has left #ruby-lang [#ruby-lang]
<drbrain>
bradland: when calling the method
lcdhoffman has quit [Quit: lcdhoffman]
<bradland>
ah, ok. that makes sense then.
charliesome has joined #ruby-lang
<reactormonk>
tockitj_, yep. in the first case, you would otherwise assign a local var.