<johnjaye>
well i should probably work with them a little first then.
<johnjaye>
are there any important reflection type things to know? i can check an objects methods with .methods()
<leftylink>
I like Method#owner and Kernel#caller, but I see that I'm going off-topic since i didn't actually answer the question. Method#owner helps make sense of others' metaprogramming, and didn't have anything to do with reflection, so I failed to answer the question
<leftylink>
so I guess Module#ancestors is the on-topic answer
crespire1 has joined #ruby
crespire has quit [Killed (NickServ (GHOST command used by crespire1!~crespire@user/crespire))]
<leftylink>
but well if it needs to be able to deal with an arbitrarily complicated <a attr="val" attr="val" ref="tgt"> then dang
Sankalp has joined #ruby
Terminus has left #ruby [#ruby]
<BazzaBazaa>
yeah, I'm hoping to test an autogenerated file. So after the html file is built I need to check that the correct links exist on the page.
<BazzaBazaa>
test 1 is test the file is there, that passes, now I'm trying to work out how to test the content of the page that was generated
<isene>
rsh is now a fairly functional shell. I'll be migrating from zsh in a couple of weeks (I think)
<isene>
Done with less than 500 lines of code and in less than 20 hours. But it should prove a neat challenge to make all the features I want into it (basically replicating much of my zsh+antibody setup)
shokohsc2 has joined #ruby
shokohsc has quit [Ping timeout: 268 seconds]
shokohsc2 is now known as shokohsc
<BazzaBazaa>
@isene you have a github link to the project?
<BazzaBazaa>
can I use a require_relative call from inside an rspec test? I'm creating a page,then checking the content of the page
fercell has quit [Read error: Connection reset by peer]
BazzaBazaa has quit [Remote host closed the connection]
BazzaBazaa has joined #ruby
<BazzaBazaa>
Hi, anyone knows about the require_all gem? Do I link it at the top of the code then reference the path in any tests I do?
<BazzaBazaa>
so in an 'it' block I would reference the path?
<BazzaBazaa>
for example top of file require 'require_all'
<BazzaBazaa>
then reference the path at the top of the `it` block
<BazzaBazaa>
for example: it 'can foobar' do ; require_all 'foo/folder'
<isene>
How do I get the username "root" when a user has done `sudo -s` (as Etc.getlogin will only give the original user name)?
BazzaBazaa has quit [Remote host closed the connection]
BazzaBazaa has joined #ruby
BazzaBazaa has quit [Remote host closed the connection]
jess has quit []
donofrio has joined #ruby
<ccooke>
isene: Generally you do not want to use Etc.getlogin for that - it's quite easy to fool (Check the docs for it)
<ccooke>
Mechanically, what you want is to retrieve the EUID (Effective UID)
<ccooke>
You can get that from Process.euid (That is: The effective UID of the currently-running process)
<ccooke>
(And to get the name, something like Etc.getpwuid(Process.euid).name or the like
BazzaBazaa has joined #ruby
cek has joined #ruby
<cek>
how do I obtain bearer token in oauth via ruby ?
<hexology>
ruby newb here. does ruby have something like python where i can loop over lines of stdin without reading the entire thing into a string? `for line in sys.stdin: ...` -- python here will do its own internal buffering (as well as whatever the OS provides), but this can handle arbitrarily large or even infinite input streams. do i just loop with `gets`, or is there something nicer?