<thomasfl>
drbrain: Thank's again. I'll hopefully have a open-uri-and-write gem soon.
wyhaines has joined #ruby-lang
fayimora has joined #ruby-lang
uniqanomaly has joined #ruby-lang
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
Indian has joined #ruby-lang
havenn has joined #ruby-lang
kain has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
havenn has joined #ruby-lang
<whatasunnyday>
I'm sort of confused. If I put puts in a method and another class calls on that method, why doesn't it always print to standard output?
<whatasunnyday>
well, when i say standard output, i mean my terminal screen
<drbrain>
whatasunnyday: it prints to $stdout which may be reassigned
<whatasunnyday>
how do i reassign stdout back to the original? STDOUT.commandline?
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
<drbrain>
$stdout = STDOUT (so long as STDOUT was not reopened)
<drbrain>
sometimes people use STDOUT.reopen, but I don't recommend it since it prevents ^^
<whatasunnyday>
thanks drbrain
<drbrain>
I think my years-old blog post made people forget about STDOUT.reopen
<whatasunnyday>
i think STDOUT was reeopened
Austin__ has quit [#ruby-lang]
<whatasunnyday>
i guess i should ask a better question, thanks to outoftimes help, i was able to discover my problem. however, i'm not sure what class link is in this library. i was trying to figure it out so i could get the entire url instead of its relative path.
srbartlett has joined #ruby-lang
<whatasunnyday>
its a uri
<whatasunnyday>
all is in the world
<whatasunnyday>
i just logged link.class
_bryanp has joined #ruby-lang
<whatasunnyday>
well in the world*
slyphon has joined #ruby-lang
darkf_ has joined #ruby-lang
<whitequark>
drbrain: I'd say that you want to STDOUT.dup, and then STDOUT.reopen it
<drbrain>
whatasunnyday: yeah, but nobody ever bothered to do that
<whitequark>
this fixes all code which may have already captured the value of $stdout/STDOUT, _and_ fixes the code which assumes that STDOUT.fd == 1
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
jtoy has joined #ruby-lang
ylluminate has joined #ruby-lang
jxie has joined #ruby-lang
Luxx_ has joined #ruby-lang
jxie has joined #ruby-lang
zenspider has joined #ruby-lang
jtoy has joined #ruby-lang
chimkan___ has joined #ruby-lang
parzo has joined #ruby-lang
andrewhl has joined #ruby-lang
monkeysmuggler has joined #ruby-lang
plusk has joined #ruby-lang
<zenspider>
rawr
Heimidal_ has joined #ruby-lang
<whatasunnyday>
thanks again drbrain and outoftime
<whatasunnyday>
see everyone later
neoesque has joined #ruby-lang
lele has joined #ruby-lang
lele|w has joined #ruby-lang
Heimidal has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
ryez has joined #ruby-lang
jtoy has joined #ruby-lang
nofxx has joined #ruby-lang
heppy_ has joined #ruby-lang
<andrewhl>
I remember hearing about a gem that extends IRB with a bunch of helpful tools. I can't remember what it's called, though. Does this ring a bell for anyone?
<zenspider>
there's about 70 of them
<drbrain>
andrewhl: pry is the popular one these days
<andrewhl>
yeah that was it, thanks!
<zenspider>
that doesn't really extend irb so much as replace it
gix has joined #ruby-lang
Randroid has joined #ruby-lang
gjaldon has joined #ruby-lang
PatrixCR has joined #ruby-lang
srbartlett has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
srbartlett has joined #ruby-lang
PatrixCR has quit [#ruby-lang]
Banistergalaxy has joined #ruby-lang
havenn has joined #ruby-lang
plusk has quit ["Leaving"]
plusk has joined #ruby-lang
plusk has quit [#ruby-lang]
monkeysmuggler has joined #ruby-lang
looopy has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
Telmo has joined #ruby-lang
dberg has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
slimfit has joined #ruby-lang
MistyM has joined #ruby-lang
grough has joined #ruby-lang
fayimora_ has joined #ruby-lang
Heimidal has joined #ruby-lang
macmartine has joined #ruby-lang
monkeysmuggler has joined #ruby-lang
igotnolegs has joined #ruby-lang
dv310p3r has joined #ruby-lang
willdrew has joined #ruby-lang
delinquentme has joined #ruby-lang
<delinquentme>
hey all I'm looking at some exercises regarding using "self" http://pastie.org/3398838
<delinquentme>
This makes me wonder if there is a way to reference the class WhatIsSelf using self
<delinquentme>
or is that whats actually happening here
<whitequark>
self.class called from within instance context will give you the class
<whitequark>
if you really want some deep understanding of `self' and friends in Ruby, then read http://yugui.jp/articles/846
Nisstyre has joined #ruby-lang
<WillMarshall>
I have an interesting little conundrum. I have a Class that is basically a presenter wrapped around two different instances of a second class
<WillMarshall>
I want to access attributes of the two wrapped classes via the superclass, by delegating method calls through to one of the two wrapped classes, based on a list I can store in the presenter
<WillMarshall>
Is there a nicer way of doing this than just defining a zillion short little delegation methods in my presenter?
<whitequark>
WillMarshall: method_missing is your friend
<WillMarshall>
whitequark: Yeah, if I cache my attributes as two sets of symbols in the wrapper class I can do a little included? switch in method_missing
nofxx has joined #ruby-lang
<whitequark>
method_missing is also slow. if this is an often-called piece of code and the method lists are predefined and do not change, then consider using define_method to automatically define a "zillion of short delegation methods"
<whitequark>
the latter would allow for efficient optimizations in e.g. JRuby, unlike method_missing
<WillMarshall>
Would it make any difference when using straight-up 1.8.7?
<WillMarshall>
That said, define_method would be a little nicer
slyphon has joined #ruby-lang
<whitequark>
not much
<WillMarshall>
I guess I'll save an array lookup on each attribute query
<whitequark>
and you'll have your method defined with a lambda. that's a small penalty iirc
<whitequark>
anyway, just benchmark it
<WillMarshall>
Whereas with method_missing I either need to check my arrays of attributes each time, or lazily using define_method
<whitequark>
oh, please do not do lazy define_method
<WillMarshall>
Why's that?
<whitequark>
it is quite evil and can lead to sudden performance degradations at unexpected times
<whitequark>
in, ahem, sane implementations (not MRI)
Austin__ has joined #ruby-lang
<WillMarshall>
If I'm just going to define this set of methods from an array of symbols at runtime, which seems cleanest...
<whitequark>
basically define_method flushes a lot optimizations. you'd better do them all at once and then keep VM caches alone
<whitequark>
yeah, that's a good variant
Indian has joined #ruby-lang
<WillMarshall>
Is there anywhere logical to stick that other than straight into the class?
<whitequark>
I think the class is ok
<whitequark>
you can also use eval.
<WillMarshall>
Just thinking about initialize … but I doubt it matters
<whitequark>
it's faster than define_method.
<WillMarshall>
define_method is easier to read than eval, though
<whitequark>
mhm, kind of
<whitequark>
if performance matters, use eval. that's how Rails do it, for example
<whitequark>
define_method is fine too in most cases
<WillMarshall>
Cheers
<WillMarshall>
Is there anything neater than subclass_one.send(symbol) I can do to delegate through?
<WillMarshall>
send makes me a little twitchy
<whitequark>
it should not
<whitequark>
send is a perfectly good way to do delegation
<WillMarshall>
Sweet
<whitequark>
it isn't an internal thing or whatever. Ruby objects "send" messages to each others, but some call them method calls
<whitequark>
if you'd been using 1.9, I would suggest using public_send
<whitequark>
which is a bit nicer for this purpose (`send' ignores private/protected modifiers)
<whitequark>
why are you using 1.8 for a new project anyway? it will be dead after the summer
<WillMarshall>
Not my project
<WillMarshall>
I'm just cleaning out a bunch of the weirdness and trying to DRY things up.
<whitequark>
ok
<WillMarshall>
define_method will let me create instance methods, yeah?
<whitequark>
yes
<whitequark>
define_method in a class context creates instance methods
<whitequark>
like `def'
<whitequark>
there's also define_singleton_method which behaves like `def self.'
Guest99123 has joined #ruby-lang
<WillMarshall>
whitequark: Thanks dude :)
<WillMarshall>
There's a handy little way for me to try a method call on something that might be nil, yes?
<WillMarshall>
I've got a bunch of foo ? foo.method : nil stuff
<WillMarshall>
Hoping for a terser way of doing the same thing
<injekt>
evenix: it looks like lexicon isn't being loaded
<andkerosine>
Globbing as a function.
<andkerosine>
Very nice.
<evenix>
from the test or from ex48.rb
<injekt>
evenix: where is your test file located?
<andkerosine>
Single-method modules = bad?
<evenix>
ex48>test>test_lexicon.rb
<injekt>
evenix: and how're you running it?
<injekt>
ruby test/test_lexicon.rb ?
<evenix>
ruby test_lexicon.rb
virunga has joined #ruby-lang
<injekt>
andkerosine: depends what it's for?
<andkerosine>
Well, originally I had my wrapper set up as just Objects and Actions, and I mixed Actions into everything.
<injekt>
evenix: oh, you never require ex48.rb
<injekt>
evenix: you need to load it
<injekt>
andkerosine: if it's a mixin, one method is fine
<andkerosine>
I just hate module Reply; def reply..., but I guess it makes the most sense.
<evenix>
injekt: from the test?
<evenix>
ok
<evenix>
just did I'm getting the same error
<evenix>
hold on.. wrong file
robwilliamsukio has joined #ruby-lang
zmack has joined #ruby-lang
<evenix>
i added require 'ex48' but I'm getting a "no such file" injekt
<shevy>
today I shall learn how to use #unpack
<injekt>
evenix: you need to require it relative to the file you're requring it from
<evenix>
injekt: yes, i did require '../lib/ex48'
<injekt>
evenix: that wont work
<evenix>
require_relative?
<injekt>
yeah
<injekt>
or use require File.expand_path('../../lib/ex48', __FILE__)
<andkerosine>
s/__FILE__/$0
<injekt>
no, __FILE__
<andkerosine>
How come?
tekin has joined #ruby-lang
<injekt>
__FILE__ is the name of the current file, $0 is the name of the script being executed
<evenix>
injekt: require_relative worked.. I'm going to make a new pastebin
<injekt>
andkerosine: that's how you can do if __FILE__ == $0 and it'l return true if the current file is the one being executed
<andkerosine>
Hm, fair enough.
<andkerosine>
Equivalent in this case, though, no?
leriksenau has joined #ruby-lang
<injekt>
yeah, I just dont want to preach bad practice :)
<leriksenau>
Is it possible, from a script, or from a rib or debug session, to get the ruby interpreter to tell you its version ? E.g. <code>puts Interpreter->version</code>
<injekt>
RUBY_VERSION
futurechimp has joined #ruby-lang
<leriksenau>
is that an envvar or a constant ?
<injekt>
constant
<leriksenau>
constant I guess
<leriksenau>
ta
<injekt>
open irb and type RUBY_[tab]
<injekt>
those are all the constants you can use
QaDeS has joined #ruby-lang
<injekt>
and may find useful
<leriksenau>
schweet
<Phlogistique>
require 'irb/completion' before that
<leriksenau>
ok - I thought it might be part of a class available for introspection, didn't think of looking at constants
fayimora has joined #ruby-lang
<leriksenau>
is the constant defined in the Kernel class ?
<leriksenau>
I'll grep the ruby source for the def's
<manveru>
ack rb_define_global_const
<evenix>
injekt: thing is I should be able to see whats wrong from the test.. when I'm running the test it is obviously not working because I might have approach that test in a wrong way
<evenix>
i can add the errors message from running the test
<injekt>
oh, the test fails?
<injekt>
now that's your job to fix it
<injekt>
:)
<injekt>
manveru: you played with erlang before?
leriksenau has quit [#ruby-lang]
<shevy>
manveru tried them all
<shevy>
he even wrote his own language
<manveru>
injekt: yeah
<injekt>
manveru: thoughts? Thinking of making it the next
<manveru>
not much though... the syntax slaps me in the face every 5 seconds
<manveru>
the issue i have with go is lack of generics
<manveru>
rust has that, but rust also has semicolons :(
<shevy>
hehehe
<injekt>
heh
<evenix>
this thing is confusing me.. i think I'm going to email the author for a solution and learn from it
rohit has quit [#ruby-lang]
<injekt>
evenix: the idea isn't confusing you
<injekt>
the ruby is
<injekt>
it's basic things you're doing wrong, ruby things
<evenix>
true
<injekt>
grab a book or something
<evenix>
lol thats what I've been doing for a while now
<injekt>
maybe you're just rushing it
<injekt>
(writing this)
<evenix>
do my approach look right?
<shevy>
evenix, look at this:
<shevy>
def Pair(token, word)
<shevy>
this isn't typical ruby
<shevy>
def pair
<shevy>
would it be
<manveru>
using class variables?
<shevy>
if you look at modules and classes, they all start with an upcased character
futurechimp has joined #ruby-lang
<shevy>
upcased leading character is a constant evenix
<evenix>
true yea i rushed writing this it was "initialize(token ,word)
<evenix>
on the previous pastebin
<shevy>
it's not even consistent with the rest of that code
<shevy>
def scan(stuff)
<injekt>
shevy: it's supposed to be a class
<injekt>
that's why
<andkerosine>
evenix: Lbh'er shpxrq, qhqr.
<shevy>
he wanted to do a class?
<evenix>
this is what I've been doing: i looked at that test and I was looking for ways to create a file that it is going to test
<injekt>
shevy: yes, look at his tests
<injekt>
evenix: simplify it
<injekt>
one test, one method
<injekt>
make sure it passes
<shevy>
evenix to make a class you use the keyword "class" like ... class Pair
<injekt>
add a new test, then add a new method
<manveru>
andkerosine: :)
<andkerosine>
^_^
<injekt>
nerds
* manveru
beats urxvt with a massive mace
<evenix>
shevy: i understand those basics what confuses me right now is the test.
<evenix>
ill make a shorter paste bin.. I've been actually trying to solve the test in part
<shevy>
ok but there are errors even before you come to the actual testing ... :P
<evenix>
but i posted everything at once
<andkerosine>
Protip: stop using pastebin.
<manveru>
see the topic :)
<shevy>
use pastie.org
<shevy>
it has nicer colours. it looks better. and someone feeds a kitten every time one uses it. compared that with pastebin, where a kitten gets killed every time someone uses it
futurechimp has joined #ruby-lang
<shevy>
so you see the arguments are all in favour of pastie.org
<shevy>
right andkerosine???
<injekt>
use gist.github.com
<andkerosine>
evenix: You are the cause of global warming.
<manveru>
you guys must be bored to death that you're still helping that guy
<injekt>
heh
<injekt>
i'm supposed to be launching a startup
<injekt>
but im the only eu person so everyone else is asleep anyway :-)
<manveru>
everything he needs to know is in the books, it's just a matter of discipline
<manveru>
injekt: likewise :(
<evenix>
injekt: thanks
<shevy>
manveru you run a startup?
<evenix>
shevy: yes but when you need to look for bugs it saves time
<manveru>
shevy: yeah
<shevy>
evenix, I also don't like bugs
<shevy>
manveru: cool!
<manveru>
shevy: it's called The Rubyists, LLC. based in nevada, and doing fancy gluing with FreeSWITCH and Ruby :)
<shevy>
nevada??
<evenix>
manveru: i think I'm disciplined enough to wake up at 10 everyday and go to bed at 6 everyday just because I'm trying to learn ruby to better master rails
<shevy>
isn't that like at the end of the world?
<manveru>
cheapest tax
<shevy>
ah
<andkerosine>
Holy shit, only 98 steps?
<manveru>
evenix: yet you can't start from step 1?
<shevy>
hehe
<shevy>
rails teaches people to count from top down...
<evenix>
shevy: ill just go in the rdoc and figure it out
<shevy>
ewwww rdoc!
<manveru>
good luck :)
<shevy>
:(
<manveru>
rdoc is particularly helpful when it comes to ruby syntax and idioms
<manveru>
just needs a lot of [show source] clicking
<manveru>
</sarcasm>
<manveru>
bbl
<evenix>
just a random question: how long you guys been coding in ruby?
<manveru>
around 8 years now
NARKOZ has joined #ruby-lang
<injekt>
around 5 and a half
<injekt>
(days)
<injekt>
bwahaha
<evenix>
well i started 5 days ago. I am clearly a beginner..so i am not making "obvious" mistake as a pro
<shevy>
about 7 years I think
<injekt>
you just need to make every lesson count
<evenix>
thats what i am doing i am really taking this thing seriously.. been reading a lot in a few days
<evenix>
and the frustration doesn't help lol…
<injekt>
maybe that's where you're going wrong
<evenix>
i make sure i understand before moving on
<evenix>
but sometimes there is thing we think we understand until we face them differently
<injekt>
sure
<shevy>
"<evenix> i make sure i understand before moving on "
<shevy>
but you did not!
<shevy>
I think it's really that book
<injekt>
if you get confused with classes, modules and whatnot, you can do some basic exercises. Build a system which requires something enumerable, a mixin, a base class, and inherited classes
<andkerosine>
Make a class that discovers the Higgs boson.
<shevy>
higgs had a bosom?
<andkerosine>
Using only bitwise arithmetic.
<shevy>
andkerosine you are such a pervy
<andkerosine>
I see what you did there, and it is delicious.
<andkerosine>
So... I have 400,000 reddit usernames.
<rippa>
find them and kill them
mytrile has joined #ruby-lang
<andkerosine>
My intention is to crawl every users comments list to determine all of the subreddits they post in and then make it searchable.
<andkerosine>
To find the sorts of people who post in /r/programming and /r/mylittlepony.
<shevy>
take a chainsaw and hunt these bastards down
<andkerosine>
Or some such.
<shevy>
start with the mylittlepony users first
<andkerosine>
Naturally.
<shevy>
they are suspicious
<shevy>
rippa could be their group leader
<andkerosine>
My logs confirm that it is so.
<andkerosine>
"?limit=#{[100, limit].min}"
<andkerosine>
Don't do things like this?
<shevy>
dunno
<shevy>
I think it's hard to read
* manveru
does that all the time
* injekt
does too
* shevy
feels very alone
<manveru>
the next-best thing is a ternary with repetition :(
<andkerosine>
Well, I meant interpolating it.
<andkerosine>
Concatenating /is/ a little easier on the eyes.
<injekt>
then concat?
<andkerosine>
But I use interpolation just about everywhere else and I'd like to remain consistent.
<injekt>
then interpolate
<injekt>
>.>
<andkerosine>
Everything I know is a lie.
<andkerosine>
Heh, concatenating forms a bad URI.
<injekt>
interpolation it is!
<injekt>
that was easy
<andkerosine>
Quite.
jtoy has joined #ruby-lang
<andkerosine>
Am I sick for sometimes changing the wording of a comment to have all the lines flush with column 80?
jbsan has joined #ruby-lang
brownies has joined #ruby-lang
<andkerosine>
jtoy: Watashi no ninja wa doko desu ka.
<andkerosine>
*ninjin
kaiwren has joined #ruby-lang
<tobiasvl>
andkerosine: no, i thought everyone did that
csherin has joined #ruby-lang
Gekz has joined #ruby-lang
futurechimp has joined #ruby-lang
fayimora has joined #ruby-lang
csherin has joined #ruby-lang
<jtoy>
andkerosine: sorry, I'm not japanese
<jtoy>
yamate
jtoy has quit [#ruby-lang]
jtoy has joined #ruby-lang
jtoy has quit [#ruby-lang]
Stalkr_ has joined #ruby-lang
Tanaka has joined #ruby-lang
tomzx has joined #ruby-lang
Stalkr_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
<evenix>
nani wa hanashimasu ka?
fritzek has joined #ruby-lang
<ddfreyne>
namaste
naz has joined #ruby-lang
divoxx has joined #ruby-lang
<andkerosine>
Watashi no ninjin wa doko desu ka?!
RubyHead has joined #ruby-lang
<evenix>
watashi was nihongo o byenkyu shimasu
<evenix>
anata wa nihonjin desu ka?
<yorickpeterse>
Can we stick to English?
<shevy>
lol
<shevy>
wieso nicht deutsch!
<yorickpeterse>
Oh fuck that
<Phlogistique>
there's #ruby-ja if you want to speak 日本語
<evenix>
lool
tbuehlmann has joined #ruby-lang
QaDeS has joined #ruby-lang
<andkerosine>
From "phlogiston"?
divoxx_ has joined #ruby-lang
<ddfreyne>
Nein!!!
Sailias_ has joined #ruby-lang
burgestrand has joined #ruby-lang
mark_locklear has joined #ruby-lang
Stalkr_ has joined #ruby-lang
virunga has joined #ruby-lang
banister`sleep has joined #ruby-lang
gianlucadv has joined #ruby-lang
rohit has joined #ruby-lang
MistyM has joined #ruby-lang
<Cope>
Is there some difference between 1.8.7 and 1.9.[23] where $stdin.flush reports an error on the former but not the latter?
<Cope>
irb(main):002:0> $stdin.flush
<Cope>
IOError: not opened for writing
<Cope>
vs
<Cope>
irb(main):001:0> $stdin.flush
<Cope>
=> #<IO:<STDIN>>
malev has joined #ruby-lang
codewrangler has joined #ruby-lang
Spooner has joined #ruby-lang
rohit has joined #ruby-lang
<manveru>
Cope: looks like
<Cope>
any idea what I need to do to make 1.8.7 not bitch?
<andkerosine>
Proxy it?
malev has joined #ruby-lang
<manveru>
$stdin.sync = true :)
dv310p3r has joined #ruby-lang
<Cope>
as an alternative to flush?
<manveru>
kidding, mostly
xaio has joined #ruby-lang
stephenp has joined #ruby-lang
<Cope>
hmm
<andkerosine>
Putting single-statement methods on one line with semicolons: frowned upon?
<andkerosine>
rue: Might I pick your brain for a bit?
<rue>
Maybe, what's it?
<andkerosine>
Familiar with reddit, presumably?
shevy2 has joined #ruby-lang
<andkerosine>
K.
wmoxam has joined #ruby-lang
lake has joined #ruby-lang
erpuds_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
heppy has joined #ruby-lang
<rue>
andkerosine: I don't really read Reddit
<rue>
Used to a bit, when it was still better than /.
<andkerosine>
Mm-hmm.
<andkerosine>
I just thought I'd throw it out as a preliminary question. My issue isn't "directly" related.
divoxx has joined #ruby-lang
<devn>
banister`sleep: check ur twitterz
<andkerosine>
Essentially, is it possible for a method to know that it is the beginning of a chain?
<rue>
As in obj.foo.bar #foo to know it's got something after? (And possibly that there's nothing preceeding?)
delinquentme has joined #ruby-lang
<delinquentme>
so you've got a newly defined class and you want to leave some instructions for the next guy working with it ... whats the format / placement of the code comments so that the next guy can bring it up with the class help
<delinquentme>
also .. i forgot how to call help on a specific object
outoftime_ has joined #ruby-lang
<rue>
delinquentme: #python?
chimkan has joined #ruby-lang
<rue>
Or do you mean ri/rdoc documentation? Ruby doesn't have runtime docstrings
<delinquentme>
rue, yeah i've been programming in python for a while and I was expecting something equivalent to that in ruby
<delinquentme>
ahhhh ok ok
<erikh>
we have to have documentation first
* erikh
runs
<rue>
delinquentme: With pry (or irb, if you set it up) you can pull up ri docs, of course, so that might help.
<delinquentme>
rue, so there is not operation like method.help()
fayimora has joined #ruby-lang
abuiles has joined #ruby-lang
<andkerosine>
rue: Yes, that precisely, though not the parenthetical bit.
hopkinsju has joined #ruby-lang
<andkerosine>
delinquentme: From a terminal, `ri method`.
<andkerosine>
Of course, you could execute that from within Ruby if you so chose.
willdrew_ has joined #ruby-lang
hacketeer has joined #ruby-lang
slimfit has joined #ruby-lang
<rue>
andkerosine: No, there isn't (without parsing). You might want to return a proxy object of some kind
malev_ has joined #ruby-lang
<rue>
andkerosine: Consider how Enumerable and Enumerator work (although they have the advantage of #block_given?)
rpall has joined #ruby-lang
r0bby has joined #ruby-lang
futurechimp has joined #ruby-lang
r0bby_ has joined #ruby-lang
tekin has joined #ruby-lang
Jake232 has joined #ruby-lang
<erikh>
something that tracks the call stack
<Jake232>
Why is it not possible to OR EQUALS a cookie?
<Jake232>
cookies.permanent[:some_cookie] ||=
<erikh>
Jake232: I think you want #ror
<Jake232>
Damnit, wrong roo
<Jake232>
room*
<Jake232>
Thanks
<erikh>
yerp
lordofthedance has joined #ruby-lang
Indian has joined #ruby-lang
willdrew has joined #ruby-lang
<rue>
erikh: Mm, yeah. I suppose you could have an external stack ordered by objects involved somehow
RomyRomy has joined #ruby-lang
<erikh>
you could also look forward by using respond_to?
<erikh>
dunno. I haven't been reading too closely
<erikh>
(work)
dustacio has joined #ruby-lang
<rue>
You won't know which method will be called
<erikh>
yeah, I guess you're right
<andkerosine>
The reddit API asks that you only make one call every two seconds.
<andkerosine>
So, for example, some_user.comments[0].reply('some comment')
<andkerosine>
Because it's chained, there should be a 2-second sleep called within the comments method.
<judofyr>
andkerosine: you can use fancy delegation stuff
<andkerosine>
But it's silly to make the user wait two extra seconds to continue execution if they're only grabbing the comments with no immediate intention of working on them.
<judofyr>
in Rails: user.posts # doesn't really load the posts
<andkerosine>
Completely different story here.
<andkerosine>
I absolute /have/ to make the API call to get any meaningful information.
<judofyr>
oh
<judofyr>
I see now
<andkerosine>
Mm-hmm. Deferred loading = awesome, but not applicable in this case unfortunately.
bitrot has joined #ruby-lang
<judofyr>
why not just store the "previous request timestamp" in the Connection-object?
<judofyr>
or whatever the object is
<judofyr>
Request*
<andkerosine>
It is indeed a connection.
<andkerosine>
And that /sounds/ like it might work, but I can't quite wrap my head around it.
<judofyr>
class Response; def reply; connection.request("…") end; end
<andkerosine>
Sleep on the chain's tail if a call has recently been made?
<judofyr>
yeah
<andkerosine>
Absolutely brilliant.
<andkerosine>
Hm...
<judofyr>
def request; sleep left if @last <= TRESHOLD; carry_on! end
<andkerosine>
But to avoid the potential issues that come with timing, could I not just have a boolean?
<judofyr>
that ended up very pseudo-ish
<judofyr>
what should the boolean say?
<erikh>
moar like typo-ish
<erikh>
:P
<andkerosine>
Check the value at the beginning of the method and then reset it at the end?
<andkerosine>
Eh, that only works for length-2 chains, I think.
<judofyr>
doesn't work well for "only 1 per 2 second" either
<andkerosine>
Well, no, I don't mind a manual call to sleep inside /my/ code, I'd just prefer that users of the wrapper not have to do it.
<judofyr>
def request(thing);since = Time.now - @previous; sleep(2 - since) if since < 2; carry_on! end
<judofyr>
err, and update @previous
<judofyr>
andkerosine: that would only need a sleep in the general request-method
wyhaines has joined #ruby-lang
<judofyr>
which should be very low level (just take an URL and method perhaps)
Indian has joined #ruby-lang
slimfit has joined #ruby-lang
methods2 has joined #ruby-lang
<methods2>
is there a web irb that lets multiple people use it ?
<methods2>
like a shared session
dberg has joined #ruby-lang
<andkerosine>
If not, I'm on it. : )
<methods2>
you talking to me ?
<andkerosine>
Nah.
<andkerosine>
: P
<methods2>
:\
<andkerosine>
I am.
<andkerosine>
I've never heard of it, which means there's probably a huge logistical problem.
<andkerosine>
But that would be an amazing teaching tool.
<andkerosine>
methods2: Sorry, Internet shat out. Missed it if you said anything.
<methods2>
nope
<andkerosine>
Well, all right.
darchitect has quit ["Saliendo"]
havenn has joined #ruby-lang
<andkerosine>
I imagine it would need to use sockets to be optimally functional, and I'm alas not yet familiar.
erpuds has joined #ruby-lang
<andkerosine>
Seriously great idea, though.
<methods2>
also a great interview tool
<methods2>
jump on a tech phone call with a shared ruby web console
<andkerosine>
Absolutely.
<methods2>
andkerosine: shall we build it ?
<andkerosine>
I'm actually kind of stunned this isn't a thing.
<methods2>
i have 10 days to an interview..
<andkerosine>
Sinatra + Heroku is kind of my forte...
jaimef has joined #ruby-lang
<judofyr>
methods2: at first I read "is there a web irc that lets…"
<judofyr>
and wondered, wtf?
<methods2>
i bet we can just take one of the tryruby sites if they are open sourced and quickly add the feature
<andkerosine>
Not my style. : )
<methods2>
well just as a quick proof of concept ?
<judofyr>
you'll get pretty far with common SSH + screen -r
<methods2>
yea sure but on a phone interview ?
<methods2>
yo interview guy ssh to this machine now please
<andkerosine>
Heh.
<judofyr>
why not?
<methods2>
i think just sending someone a url and bam! shared irb .. that's cool..
<rue>
methods2: pry-remote
<judofyr>
then I think it's more useful to have a broadcasted session
<judofyr>
like, "broadcast irb"
<judofyr>
it gives you an URL
<rue>
There's some ‘multiplayer’ support but I've not kept up to what the current status is. Ask #pry
<judofyr>
and anyone can watch there
<judofyr>
methods2: allowing two people to edit makes it way more complex
divoxx has joined #ruby-lang
<rue>
judofyr: See above
<methods2>
yea a broadcast is good enough
<judofyr>
rue: that's not a shard session in the sense that the other user can see what you do
<judofyr>
right?
<methods2>
rue: so pry just lets you basically jump into a point of execution of an app with an irb session ?
<methods2>
irb style session
<judofyr>
shared*
<rue>
There's been some recent development in the paradigm but, like I said, I'm not sure what the status is now. It worked to some extent earlier, so best ask over there
Heimidal has joined #ruby-lang
mtkd has joined #ruby-lang
<methods2>
actually isn't that a huge security issue though ? I'd rather the idea of the a web irb since it's sandboxed properly
<judofyr>
methods2: and what if you need some gems?
<methods2>
i guess maybe that's going to far ?
dejongge has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
futurechimp has joined #ruby-lang
heppy has joined #ruby-lang
fayimora_ has joined #ruby-lang
jacktrick has joined #ruby-lang
Luxx_ has joined #ruby-lang
RomyRomy has joined #ruby-lang
wmoxam has joined #ruby-lang
andrewhl has joined #ruby-lang
gnufied has joined #ruby-lang
danishman has joined #ruby-lang
methods2 has joined #ruby-lang
methods2 has quit [#ruby-lang]
ylg has joined #ruby-lang
savage- has joined #ruby-lang
savage- has joined #ruby-lang
rshackleford has joined #ruby-lang
macmartine has joined #ruby-lang
robotmay has joined #ruby-lang
<delinquentme>
@var is an instance var?
* delinquentme
is reviewing from his haitus to python
<shevy>
delinquentme yeah
<shevy>
all one @ are
<delinquentme>
and the double ?
<shevy>
class variable, but if you can, do not try to use it
<whitequark>
how can I get the ext/ directory of my gem?
Heimidal has joined #ruby-lang
csherin has joined #ruby-lang
looopy has joined #ruby-lang
<hopkinsju>
I'm having trouble getting this code to run on a remote server, but it runs just fine on my local machine. I'm using the same ruby version on both boxes. Can anyone point me in the right direction? http://pastie.org/3402143
<hopkinsju>
There's a few notes about ruby version and output at the bottom of that paste
<hopkinsju>
Also - I'm a Ruby nub
<banister`sleep>
whitequark: you probably have to use the rubygems api
<whitequark>
banister`sleep: obviously
<whitequark>
I'm currently looking at the API and the closest match is:
<whitequark>
err, obviously I should File.join and so on
<whitequark>
you got the idea
<banister`sleep>
whitequark: yeah we use something similar to that
<rue>
hopkinsju: First, get off 1.9.1
<rue>
hopkinsju: But the error is what it tells you it is: size = output.to_s.scan(site_pat).flatten!.collect!{|s| s.to_i}.inject(:+), #collect! is sent to nil, which means that your #flatten! is returning nil.
<banister`sleep>
whitequark: we use: `cli_options_file = File.join(spec.full_gem_path, "lib/#{spec.name}/cli.rb")` which is pretty much the same thing
<hopkinsju>
rue: I'm using 1.9.1, but I've tried several different versions (older and newer) and the result is always the same. Doesn't work on the remote server, works fine on my laptop.
<rue>
Regardless, don't use .1
<rue>
It's buggy
<rue>
At least .2 if you can't for some reason go to .3
<erikh>
.2 is a nice stable release at this point, if that's a concern
<whitequark>
rue: IIRC .1 and .3 use the same rules for constant lookup
Gekz has joined #ruby-lang
Gekz has joined #ruby-lang
<whitequark>
whereas for .2 it has been changed
<erikh>
.3 isn't really much worse unless you're using extensions
<hopkinsju>
rue: Ok. It's just what I happened to be on at the time, but I had started with .2 and have also tried .3 - I can tell that the problem is that .flatten is coming back nil, but I don't understand why the behavior is different on the two machines.
<whitequark>
about 1.9.3
<whitequark>
I've found a segfault bug in it
<whitequark>
without any extensions
<whitequark>
(-p0)
<banister`sleep>
whitequark: me too
<banister`sleep>
whitequark: how do you repro it?
<erikh>
nice
<whitequark>
I have a set of data, on which I perform some rather GC-heavy graph transformations
<whitequark>
and it just fails each time
<erikh>
I've only seen differences in GC that tend to break on certain ... wow
<erikh>
maybe it wasn't the extension
<banister`sleep>
whitequark: yeah 1.9.3 also segfaults sometimes with set_trace_func() but it's hard to reproduce
<whitequark>
but the bug is very heisen-like
<banister`sleep>
whitequark: but it was related to GC too
<erikh>
although the ffi-rzmq stuff I've been doing has been solid
<whitequark>
I move one line and it vanishes
<whitequark>
I'll try to reproduce it now. maybe I'd be able to catch a backtrace
<whitequark>
either it dies each time or just works correctly
<rue>
hopkinsju: You might want to see what the output you receive is at that point, might be it's not in the correct format for your matcher
<banister`sleep>
whitequark: when i migrated binding_of_caller to 1.9.3 i got occasional segfaults too, all related to GC
<banister`sleep>
1.9.2 had no issues there whatsoever
<erikh>
right
seanstickle has joined #ruby-lang
<erikh>
generate a couple of hundred objects and 1.9.3 (or the C extension) soils itself
<banister`sleep>
but i turned off GC for the tiny binding->filename string and all is well (though still a tiny memleak)
<hopkinsju>
rue: Ok, so maybe the problem lies in the ssh connection? Maybe the OS X implementation of of ssh results in different characters being returned than the Ubuntu version...
<erikh>
err, hundred thousand
<epitron>
banister is sleepchatting again
<rue>
Might be
<whitequark>
even worse, sometimes it did not segfault
<whitequark>
but just randomly corrupted some values
<whitequark>
very weird
krz has joined #ruby-lang
pieterm has joined #ruby-lang
<shevy>
when I have a string "abc1", and I iterate through the tokens via .split(//).each, how to check whether the character is a number or not? I could use a regex but I wonder if there is something faster
<erikh>
if you & when you meant to *, you're gonna have a bad time
<whitequark>
s.to_i.to_s == s
<erikh>
fuck it -- I'm going to tweet that
<shevy>
whoa cool whitequark
<whitequark>
as per the 1.9.3-p0 bug. I'm unable to trigger it now.
havenn has joined #ruby-lang
<whitequark>
shevy: actually, .to_i is just marginally slower
<seanstickle>
shevy: s.is_a? String is faster than s.to_i.to_s == s
<whitequark>
seanstickle: but it does not work as expected
<seanstickle>
Oh?
<shevy>
well my input is string like "abc123def"
<whitequark>
shevy: hm wait. do you need single characters or strings?
Indian has joined #ruby-lang
<whitequark>
can you elaborate on your overall task?
<seanstickle>
He said single chars, via split(//)
<whitequark>
seanstickle: still does not work
<shevy>
yeah, actually I am calculating the atom weight of molecules. Like "NH3" or "H2O"
Mchl has joined #ruby-lang
<seanstickle>
whitequark: ah, good point
<whitequark>
shevy: then you're alredy using regexen. try str.scan(/[A-Z][0-9]?/)
<shevy>
aaaaah lol good point
<whitequark>
ruby has fast regexes. afaik oniguruma dynamically compiles FSM's from the source regexp on the fly and then executes them
<whitequark>
take advantage of that
<seanstickle>
s.to_i.to_s == s is faster than single character regexes
<whitequark>
seanstickle: but shevy already uses regexes to split the string. using a more specialized regexp to split it will be faster than both of our ways
<seanstickle>
Ah, I thought he needed to know if the number/letter status of each item in the string
<shevy>
yeah, I completely forgot that I use a regex in scan
<whitequark>
actually, few know that Oniguruma regexen can actually parse a LALR(n) grammar
<whitequark>
that is, the balanced parentheses problem can be solved with it
<shevy>
I never saw s.to_i.to_s == s before btw so I am still kind of enthusiastic
<whitequark>
and yes, you can parse HTML with Oniguruma regexps
<whitequark>
as in "really parse"
<shevy>
but this brought me down again :( whitequark> shevy: actually, .to_i is just marginally slower
<whitequark>
shevy: scanning with a right kind of regex is the way to go
<banister`sleep>
how do i link to a tweet from the new twitter UI?
<whitequark>
right-click on Open
<seanstickle>
banister`sleep: step 1, download a twitter client
<necromancer>
is there a way i can make the Mail gem mark a message as read? i see Mail::Message.mark_for_delete=, but what if i just want to make it look like it was read, but not deleted?
<Asher>
whitequark - why not?
<seanstickle>
shevy: is Conway's game of Life in APL. You can see the beauty.
<whitequark>
Asher: a robot is supposed to have some control core, some actuators and some program. this thingy is more like a molecular contraption which happens to bind to some structures
<whitequark>
it has some resemblance with "not-very-live" things like viruses
<whitequark>
but definitely not robots
<Asher>
meh
<Asher>
it is all of those things
<Asher>
just doesn't look like you're used to
<whitequark>
a robot is supposed to act on its own
<whitequark>
the DNA thingy just interacts with its environment in a very special way
leonL has joined #ruby-lang
<whitequark>
it is pretty much passive
<yawniek>
whitequark: hmm suggestions?
<Asher>
that's a silly understanding of artificial intelligence
<Asher>
passivity is the basis for responsivity
<Asher>
that's the foundation of cybernetics
<Asher>
passivity is how the robot is brought "to life" so to speak
<Asher>
a condition activates its responsivity
malev_ has joined #ruby-lang
* whitequark
looks at the channel name
<Asher>
it's a channel about the status of a programming language as a language
<Asher>
understandings of AI in relation to language concepts seem pretty relevant to me
<erikh>
artificial philosophy
<Asher>
cybernetics?:P
<necromancer>
erikh: religion?
<erikh>
hrm. topics I don't discuss? check.
<necromancer>
;-)
<necromancer>
jk
<necromancer>
too much work to get done right now to be having theological discussions on IRC
<seanstickle>
Particularly without being able to use the notation of modal logic.
<shevy>
whitequark well if it works... it has like 90% enthusiasm and probably only 10% real thing inside
<necromancer>
i was told that most of the use for C++ these days is in robotics
achiu has joined #ruby-lang
<erikh>
yeah. that windows thing? nobody uses it
<necromancer>
haha
<whitequark>
shevy: what are you talking about?
<whitequark>
the DNA thingy? it actually works, and it works well
<necromancer>
erikh: do they still use C++ on windows? i was under the impression apps are made with C# and .NET these days (unless it's a game or something)
<shevy>
whitequark: <whitequark> the DNA thingy just interacts with its environment in a very special way
<whitequark>
especially if you'll take into account that it's a prototype
<erikh>
necromancer: there's still a lot of native stuff out there
<necromancer>
oh cool
<whitequark>
yes, it is very real and the article does not exaggregate its usefulness/abilites
<erikh>
but yes, a lot of shops are transitioning -- still, there's managed C++ and so forth.
<Asher>
C# is just C++ clobbered with a sledge hammer and fit into a MS break-all-the-time-box
<necromancer>
erikh: i've never programmed for windows, nor have i even used a windows machine since 2005
<erikh>
nonononononoon
<erikh>
C# is *nice*
<necromancer>
Asher: it's not THAT bad haha
<Asher>
compared to windows programming
<Asher>
it is "nice"
<erikh>
C# is fucking beautiful
<necromancer>
compared to C++...
<whitequark>
erikh, necromancer: ^ that
<necromancer>
C# makes a LITTLE more sense
<erikh>
I'd use it instead of ruby if it ran nicely on unix boxes.
<Asher>
erikh- why?
<necromancer>
...really?
<rue>
Mono runs just fine
<erikh>
yes.
<necromancer>
erikh: that's a hard comparison to make, they serve very different purposes. now comparing Obj-C to C# and Java makes more sense to me
<erikh>
C# has a ton of absolutely awesome features
<erikh>
horsepucky
<whitequark>
horsepucky?
<erikh>
bullshit.
<necromancer>
you really can't say shit? lol
<necromancer>
;-)
<whitequark>
rofl
<necromancer>
this channel is not FCC regulated btw
<erikh>
I'm getting chided at work for being a potty mouth
<erikh>
so I'm working on it
<necromancer>
ahah
<necromancer>
tell your co-workers to suck my dick
* Asher
doesn't know what the fuck swear words are
<Asher>
… if it's in the dictionary it's a legit word
<erikh>
nah, I just compared pingdom to the reliability of a drug fiend's bank account balance earlier
<Asher>
… and if people use it and it's not in the dictionary it's a legit word
<deryl>
HORSE PUCKIES!
<erikh>
so I'm dealing with my issues
<necromancer>
erikh: honestly that's a pretty good comparison lol
<erikh>
yes
<Asher>
erikh - seriously tho i'm curious what you have in mind as the distinguishing features
<Asher>
not to argue w/them just curious what they are
<erikh>
where to start
Heimidal_ has joined #ruby-lang
andkerosine has quit [#ruby-lang]
<erikh>
it has pretty much everything ruby does, plus optional static typing, decorators, in-situ parser support (manipulate the ast not unlike lisp macros)
<erikh>
that's just a taste
<whitequark>
the bad thing about .NET anything is that it's plagued with patents
<erikh>
the libraries are brilliant too
<whitequark>
so, while it may be a good language
<whitequark>
it is not a good FOSS language
<erikh>
correct
<whitequark>
tomorrow MS will change their mind and mono will have to die
<erikh>
that and it's about 4 bazillion times faster
<whitequark>
theoretically
<whitequark>
mono isn't really fast
<erikh>
mono isn't
<erikh>
maybe
<whitequark>
monodevelop is fucking slow
<erikh>
but on windows box?
<whitequark>
I don't care about windows for ~5 years
<whitequark>
and I'm not going to start
<erikh>
meh
<Asher>
yea the windows problem is a terminal disease
<whitequark>
nah, windows isn't that bad
Heimidal_ has joined #ruby-lang
<whitequark>
NT kernel is better than Linux
<Asher>
in that it's dying out, sure
<seanstickle>
Windows on Mach will be awesome
<Asher>
it's really awesome to see MS in its death throes
<whitequark>
for example, Linux has no real usable asynchronous I/O
<erikh>
it was also one of the few options on intel hardware
<seanstickle>
Banistergalaxy: nihil sub sole novum
<whitequark>
I think I was at age of three at that time, or something like that...
<erikh>
oh. er, how old are you?
<whitequark>
~19
<erikh>
ah
<whitequark>
so, I obviously don't remember SCO being alive/useful :D
<erikh>
:)
<seanstickle>
I remember buying a copy of SCO Unix
<erikh>
fwiw, it was on its way out when I was your age
<erikh>
and next was already more or less gone
<erikh>
I had a professor with a cube and I was entranced
<skryking>
wow 19, that was a long time ago...
<shevy>
you old farts!
<seanstickle>
Although I think it was Tarantula Unix at the time.
<whitequark>
time goes fast
<shevy>
wow that's a name
<erikh>
tarantella
<shevy>
Tarantula Aggro Unix!
<seanstickle>
Yeah
<shevy>
tagliatella?
<seanstickle>
Tarantella
<erikh>
it was still unixware/openserver when I last messed with it
<seanstickle>
I just remember it as a big spider that provided Unix to me.
<erikh>
we had it hooked up to a digiboard pushing a cobol app to around 25 wyse terms
<shevy>
I never saw Unix, my first exposure to Linux was with a debian installation (it failed to start X11R6 or something, but that way I learned the commandline)
<whitequark>
>cobol
<whitequark>
ffuuuuu
<erikh>
I learned more at that job than I've learned at most
<erikh>
it was pretty awesome
headius has joined #ruby-lang
<seanstickle>
I like COBOL in some respects.
<seanstickle>
Although I like ALGOL-68 more.
<erikh>
I've never written either
<skryking>
I break out in a rash when I look at the old COBOL code I use to write
<seanstickle>
Did anyone ever write ALGOL-68?
<seanstickle>
I just wrote it on paper. Never had a compiler.
* whitequark
had to look it up in Wikipedia
<whatasunnyday>
I'm using the nokogiri gem. I can easily extract all the links on a page but I'm having problems getting the link text. For example, <ahref=#foo>Bar</a>
ylg has joined #ruby-lang
<whatasunnyday>
I can get the #foo but how do I associate with a hash, array, or any other data structure the relation ship between #foo and bar?
<whitequark>
oh, case..esac
<whitequark>
so that's where sh got these weird construtcs
ylg has joined #ruby-lang
macmartine has joined #ruby-lang
tyfighter has joined #ruby-lang
hagabaka has joined #ruby-lang
delinquentme has joined #ruby-lang
<darix>
whitequark: you grab the text child of the <a> tag
outoftime_ has joined #ruby-lang
xaio has joined #ruby-lang
Heimidal has joined #ruby-lang
banister`sleep has joined #ruby-lang
<banister`sleep>
hey dudes
rushed has joined #ruby-lang
kain has joined #ruby-lang
<erikh>
hey banister
<rue>
Dudeman
<erikh>
duuuuuuuude
duckinatorr has joined #ruby-lang
<banistergalaxy>
erikh: hey homes
<banistergalaxy>
erikh: i implemented 'up regex' which i think is slick, have you seen it anywhere else?
<erikh>
"up regex"?
<bougyman>
up regex?
<banistergalaxy>
sorry not being clear, instead of 'up 2' when walking stackframes, you can type `up hel` for example, and i'll jump to the next parent frame whose method name matches that regex, so it'll jump to a method called 'hello' up the stack, or 'help', same with 'down regex'
<banistergalaxy>
it's great for jumping around a huge backtrace
<banistergalaxy>
IMO
<erikh>
oh neat
<erikh>
yeah I thought you were talking about a regex construct
<rue>
Sounds useful
<rue>
That should work for a string, too
<erikh>
like a NFA that can search both ways or something.
<banistergalaxy>
yeah it just takes a string but i wrap it in Regexp.new()
<rue>
Although you're approaching the stage where you start seeing the brilliance of the vim movement commands
<erikh>
cf,
<erikh>
I probably type that 30 times a day
<banistergalaxy>
interesting
<banistergalaxy>
could probably hook those in .inputrc
<rue>
Or especially the combination of the command and movements
<banistergalaxy>
or is it .editrc
<erikh>
.inputrc for readline
<erikh>
.editrc might be libedit
<banistergalaxy>
libedit is a ghetto, why did apple default to that?
<rue>
GPL thing maybe?
<erikh>
readline 6 has a really really really painful license
<banistergalaxy>
rb-readline is actually pretty nice
<erikh>
lusis just pointed out something with nagios today too
<erikh>
one of its clauses is that you CANNOT fork it.
<unsymbol>
urgh...
<erikh>
yeah.
<rue>
Well, it *is* The Enterprise Industry Standard
Heimidal has joined #ruby-lang
<erikh>
just seems like an odd clause
<erikh>
I guess it's the author's choice though
Sailias has joined #ruby-lang
m3nd3s has joined #ruby-lang
<banistergalaxy>
erikh: have you seen coolline?
<erikh>
I have not
Heimidal has joined #ruby-lang
<erikh>
I actually need to find a replacement for either highline or its readline integration
<rue>
But I still haven't solved my pry input problem
<erikh>
yeah, no 1.9 here
<rue>
Not that I've tried much
<erikh>
or where this code lives at least
<banistergalaxy>
erikh: wildfireapp is still 1.8?
<rue>
Anytime I try to go up in history, it only goes up one, moves the cursor to the start of the line, and doesn't allow going further back or forward in history
<erikh>
lots of rails apps still are
<banistergalaxy>
rue: did you try ^P ?
<banistergalaxy>
rue: it works fine with emacs keybindings
<banistergalaxy>
but i have some trouble with normal up/down keys
<rue>
Mh
lordofthedance has joined #ruby-lang
<rue>
Should probably look at this at some point, I'd venture arrow keys are the default for others. I figured it was just me :P
<banistergalaxy>
i use emacs keybindings anyway so it doesnt bother me
<banistergalaxy>
but i generally dont use coolline cos we dont support auto-indenting for it yet (dont ask me why, it looks easy enough)
csherin has joined #ruby-lang
<rue>
Yep, it is just on coolline that I've noticed it.
postmodern has joined #ruby-lang
eydaimon has joined #ruby-lang
<eydaimon>
1.9.3 lets me know iconv is going to be removed in the future. I've not found a good way to deal with invalid bytecode in UTF-8. Does anyone know how to use String.encode in it's place? Here's an example ready: https://gist.github.com/e9d4b390bf11b1689c73
<banistergalaxy>
eydaimon: did u see the keynes vs hayek rap battle
<rue>
It looks like in that case the replacement will be of 2 bytes, so 2 characters inserted
<eydaimon>
rue: I can't replicate the behavior of iconv by using String.encode. I'm trying to address this issue: "iconv will be deprecated in the future, use String#encode instead."
<rue>
eydaimon: Hm, I see
<rue>
eydaimon: It looks like you can just force_encoding there
Defusal_ has joined #ruby-lang
Defusal_ has joined #ruby-lang
<rue>
But maybe that doesn't work for the general case?
<eydaimon>
i'll try :)
<eydaimon>
nope, doesn't work for my use-case :/
<eydaimon>
see if I can replicate mine in a different way now
<petercooper>
"I think the Law of Demeter is shit and never follow it." hehe
willdrew_ has joined #ruby-lang
elux has joined #ruby-lang
<elux>
drbrain: you there?
looopy has joined #ruby-lang
anjen has joined #ruby-lang
sora_h has joined #ruby-lang
<eydaimon>
wtf
<rue>
eydaimon: What about this replacing with ""?
<eydaimon>
ah, I got it to repro
<eydaimon>
for some reason it didn't work to have the data segment as part of the file