<zenspider>
I tried to get them to correct the English of some of the names way back when and I got "ruby is not english" as the response... I tried to argue that ruby uses english, so it should use proper english, but nothin'
livinded joined #ruby-lang
<ReinH>
Ruby should do a better job of respecting my grammar CDO
<steveklabnik>
:)
<steveklabnik>
ReinH: ActiveGrammar?
<ReinH>
heh
<steveklabnik>
wow, that'd be a great gem, actually.
<steveklabnik>
lol
<ReinH>
zenspider: at least you tried...
<zenspider>
yeah
<ReinH>
would that be some horrendous approach to writing a lexer?
<Rakko>
yeah, if the word 'include' isn't inflected for 3rd-person singular, 'is_a' shouldn't be either
<steveklabnik>
ActiveGrammar could use i18n to only alias if you're in certain locales.
<steveklabnik>
heh
ryanf joined #ruby-lang
zcdny joined #ruby-lang
<zcdny>
Hi, there, who know the iRC channel of THOR ?
<andrewvos>
zcdny: There probably isn't one. RAAARRR
<drbrain>
#asgard ?
<ReinH>
heh
<andrewvos>
So much for going to sleep early tonight :(
amh345 joined #ruby-lang
wmoxam joined #ruby-lang
<amh345>
im having a synchronization issue. i have a method that writes a file and than right after i have another method that encrypts it. I'm finding that if there is a lot of data being written/appended to the file it doesn't complete being written to HDD before the encryption starts. resulting in only partial data encryption. what is the best way to handle this?
<steveklabnik>
mutex.
artOfWar joined #ruby-lang
ognevsky left #ruby-lang
* steveklabnik
shrugs
<andrewvos>
amh345: Encrypt the file *while* writing it.
<mksm>
amh345, close the file before encrypting
<zenspider>
amh345: a system call to sync will flush disk caches... but that should be transparent to userland processes
<zenspider>
haha. that too
<mksm>
now he's confused :D
<mksm>
but helped
<drbrain>
I would encrypt the file while writing it
<andrewvos>
Right sleepy time.
<amh345>
i like the idea of encrypting while writing. can that be done with GPG?
<amh345>
how would one even encrypt while writing?
<andrewvos>
amh345: By encrypting small chunks of data and writing them when a certain buffer size is reached.
lightcap joined #ruby-lang
stepnem joined #ruby-lang
<ReinH>
amh345: incremental cryptography
muzone joined #ruby-lang
<amh345>
the content that is being written is in an .each. data_to_write.each ……. at the end of the each i append that content to a file.
<amh345>
hey ReinH
<ReinH>
hey
<ReinH>
the real question is: why are you encrypting *after* writing?
<amh345>
the idea of encrypting while writing is pretty cool. and awesome for security. is there any ruby specific googlefu terms i could look for? we're getting into territory that is totally unknown for me
<ReinH>
no matter what you do you'll still be susceptible to timing attacks
<amh345>
ReinH: exactly
<ReinH>
read the file, modify in memory, encrypt, write
<yfeldblum>
what's the attack?
<amh345>
no attack. only potential
<ReinH>
read the file before after it's written and before it's encrypted
gregmore_ joined #ruby-lang
<ReinH>
s/before after/after
<amh345>
ReinH: so you're saying right to memory?
<amh345>
store*
<ReinH>
encrypt in process
<drbrain>
amh345: a) use OpenSSL to do whatever your encrypting program does
<yfeldblum>
hmm ... a good implementation of a good cipher should typically not be susceptible to timing attacks
<ReinH>
if you care enough to encrypting in the first place, you should never be writing the data unencrypted to the filesystem
<drbrain>
amh345: b) if your encrypting program accepts data from stein, pipe to it
<yfeldblum>
that being part of the criteria for judging goodness
<ReinH>
yfeldblum: if you're encrypting the file after it's written it will always be susceptible
dv310p3r joined #ruby-lang
<ReinH>
drbrain: ofc that presents MITM vectors
<yfeldblum>
yes, so encrypt blocks before writing them
<ReinH>
yfeldblum: right
<amh345>
ReinH: i know. right now i've been relying on a very quick write and ecrypt. but it's not solid. obviously. im trying to automate now do i can make it run smoother and more secure.
<drbrain>
yfeldblum: filesystem timing attacks to grab the unencrypted data, not timing attacks to expose secret bits
<ReinH>
drbrain: Not sure about piping. I wouldn't trust sending unencrypted data to one fd any more than another
dreinull joined #ruby-lang
<drbrain>
ReinH: yeah, you'd also have to be careful about exec() and so on
<drbrain>
to make sure that exec() is running the right program
<ReinH>
would be easy to link hijack
<ReinH>
well not easy
<ReinH>
but another vector you have to consider
<amh345>
ReinH: are you avail yet for freelance? like writing what your saying i need to do here?
<ReinH>
amh345: heh no, just got hired :p
<amh345>
damnit!
<ReinH>
:(
<amh345>
i missed the window :)
<ReinH>
totes
<amh345>
is what you're saying i need to do for this encrypt a big deal?
<ReinH>
amh345: depends on how big a deal the encryption is
<ReinH>
and what vectors you need to consider
resetexistence joined #ruby-lang
<amh345>
i need to find some ruby specific info on this on the googles
<ReinH>
in general I would avoid writing unencrypted bits anywhere in userspace
<ReinH>
it's considerably harder to scrub active memory
<ReinH>
so keeping them in process is basically fine
<amh345>
in honesty, im having a a rough time understanding the process here.
<ReinH>
if you're encrypting something, do it in the Ruby process
<ReinH>
not by writing somewhere or piping somewhere
<amh345>
ok, so i write to a process (need to google that) and than gpg that data stored in the process?
<drbrain>
amh345: what are you using for the encryption part?
<havenn>
shevy: kk, hrm, how bout: "hello hello".gsub! 'lo',''
<shevy>
indeed
<shevy>
though I thought it was about .delete. I am already using gsub, I am just curious whether .include? is worth to be used before calling .gsub
<shevy>
I am going to go with what is common
<shevy>
the first!
<densebits>
I guess it would depend on the use case.
<Ruthenium>
anyway
<Ruthenium>
>ruby
<Ruthenium>
>speed
workmad3 joined #ruby-lang
livinded joined #ruby-lang
Neil joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
aroop joined #ruby-lang
naz joined #ruby-lang
workmad3 joined #ruby-lang
heppy joined #ruby-lang
alip joined #ruby-lang
dc5ala joined #ruby-lang
Mchl joined #ruby-lang
yorickpeterse joined #ruby-lang
dr_bob joined #ruby-lang
burgestrand joined #ruby-lang
Defusal joined #ruby-lang
Defusal joined #ruby-lang
cyri_ joined #ruby-lang
solars joined #ruby-lang
gnufied joined #ruby-lang
<manveru>
>> "abcd".delete('bd')
<manveru>
=> "ac"
molgrew joined #ruby-lang
roadkith joined #ruby-lang
heppy joined #ruby-lang
ryanf joined #ruby-lang
saLOUt joined #ruby-lang
Manhose joined #ruby-lang
uniqanomaly_ joined #ruby-lang
Pupeno joined #ruby-lang
Pupeno joined #ruby-lang
tla joined #ruby-lang
heftig joined #ruby-lang
mytrile joined #ruby-lang
<mytrile>
Hey, guys. I want to parse a line of Gemfile and get the name of the gem and the version. I've tried like this but I want to merge that into one regex - https://gist.github.com/54ea7c7fb1349c0e5f74
michael_mbp joined #ruby-lang
Manhose_ joined #ruby-lang
lenilson_dias joined #ruby-lang
Locke23rus_ joined #ruby-lang
adambeynon joined #ruby-lang
Pip joined #ruby-lang
Pip joined #ruby-lang
Locke23rus joined #ruby-lang
<manveru>
oh my
Locke23rus joined #ruby-lang
Locke23rus joined #ruby-lang
jimmy1980 joined #ruby-lang
benanne joined #ruby-lang
woollyams joined #ruby-lang
<shevy>
hmmm
<shevy>
I am very proud of myself now
<shevy>
I have moved all german umlauts into a standalone yaml file
<shevy>
now let's see for ruby 1.9.x ...
<shevy>
ansicolour.rb:24: warning: duplicated when clause is ignored
<shevy>
now if it would just tell me which one is duplicated precisely...
zmack joined #ruby-lang
thrcka joined #ruby-lang
skade joined #ruby-lang
looopy joined #ruby-lang
<shevy>
hmm can someone confirm:
<shevy>
- a,b: foobar
<shevy>
is valid yaml
<shevy>
- ,b: foobar
Fiel joined #ruby-lang
<shevy>
is invalid
<shevy>
correct?
jensn joined #ruby-lang
Fiel joined #ruby-lang
kvs joined #ruby-lang
jasox joined #ruby-lang
<hipe_>
shevy: a quick check in irb with Psych::VERSION "1.0.0" confirms your findings -- the latter returns a Psych::SyntaxError
kleech_ joined #ruby-lang
<kleech_>
Is there any difference between Devise::friendly_token and Devise.friendly_token, both would call the same class method? (I'm only using Devise as an example)
<hipe_>
kleech_: iirc Foo::bar is syntactic sugar for Foo.bar which i'm not particularly fond of ;)
<hipe_>
so, no
<kleech_>
Thanks, but do you "so, yes" i.e they are the same? (ie. always same the result)
<hipe>
constants must have a leading capitalized first letter, but method names need not so it can lead to some confusing magic
<hipe>
:D no there is no difference, yes they are the same (according to my extensive 20 seconds of playing with in in irb)
<kleech_>
hipe: Thanks - Just sugar :)
<kleech_>
Any ideas - Given a hash how do I remove all keys not in an array of keys? Using hash.select returns an Array.
<Ruthenium>
convert it back to hash
<kleech_>
Ruthenium: I tried .to_h and to_hash neither methods exist, is there some other way?
<Ruthenium>
Hash#[]
<Ruthenium>
though Hash#select returns hash for me
<kleech_>
Ruthenium: Perfect thanks - re: select, I'm using 1.8, are you using 1.9?
<Ruthenium>
yep
jimmy1980 joined #ruby-lang
<shevy>
thanks hipe
workmad3 joined #ruby-lang
gix- joined #ruby-lang
michael_mbp_ joined #ruby-lang
hebz0rl joined #ruby-lang
Locke23rus joined #ruby-lang
jimmy1980 joined #ruby-lang
beiter joined #ruby-lang
car joined #ruby-lang
rohit joined #ruby-lang
Xzyx987X joined #ruby-lang
Manhose joined #ruby-lang
Spooner joined #ruby-lang
Pip joined #ruby-lang
oddmunds joined #ruby-lang
takaokouji joined #ruby-lang
vmatiyko joined #ruby-lang
adambeynon joined #ruby-lang
Indian joined #ruby-lang
vmatiyko left #ruby-lang
sepp2k joined #ruby-lang
vmatiyko joined #ruby-lang
vmatiyko left #ruby-lang
xhx joined #ruby-lang
Spooner joined #ruby-lang
vmatiyko joined #ruby-lang
vmatiyko left #ruby-lang
fridim_ joined #ruby-lang
car left #ruby-lang
<muzone>
morning yall
* muzone
sprinkles coffee around the place as if it was champagne
beiter joined #ruby-lang
* shevy
sprinkles dirt on muzone as if he was needing it
<muzone>
hhhhhhh :P
<muzone>
we're talking road dirt though right?
<muzone>
or maybe mud wrestling with your wife?
<muzone>
while you're jerking off in the corner
<muzone>
lol nah
<muzone>
that one went too far
hebz0rl joined #ruby-lang
rohit left #ruby-lang
<shevy>
muzone I just took the dirt around your cold corpse :>
cjs226 joined #ruby-lang
roadkith_ joined #ruby-lang
malev joined #ruby-lang
wmoxam joined #ruby-lang
robbyoconnor joined #ruby-lang
saLOUt joined #ruby-lang
wyhaines joined #ruby-lang
roadkith joined #ruby-lang
xhx joined #ruby-lang
imperator joined #ruby-lang
yalue joined #ruby-lang
fvollero joined #ruby-lang
<imperator>
hm, RbConfig::CONFIG['COMMON_HEADERS'] is empty on osx
tommyvyo joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
DEac- joined #ruby-lang
<imperator>
huh, not set on linux either, wtf
<imperator>
they've been screwing with it
skade joined #ruby-lang
toretore joined #ruby-lang
jimmy1980 joined #ruby-lang
leopard_me joined #ruby-lang
RomD` joined #ruby-lang
gearaholic joined #ruby-lang
<shevy>
["COMMON_HEADERS", ""],
<shevy>
["COMMON_LIBS", ""],
<shevy>
["COMMON_MACROS", ""],
<shevy>
hmm on 1.8.7 is also empty
jimmy1980 joined #ruby-lang
AlHafoudh joined #ruby-lang
robbrit joined #ruby-lang
dv310p3r joined #ruby-lang
<imperator>
didn't used to be
<imperator>
at least i don't think they were
yfeldblum joined #ruby-lang
Neil joined #ruby-lang
<Defusal>
Brb is officially one of the worst gems i have used :/
<Defusal>
It could really do with some love
<Defusal>
I've been working around issues, using my own reconnecting logic, even though it shouldnt randomly disconnect or disconnect repeatedly for no reason, requiring the app to be restarted
<Defusal>
but now it made ruby 1.9.2 segfault :|
<Defusal>
sure its unlikely that it alone caused the segfault, and its probably related to EM, but EM has never segfaulted with any other code, heh
jensn joined #ruby-lang
<imperator>
EM?
<roadkith>
eventmachine?
jimmy1980 joined #ruby-lang
michael_mbp joined #ruby-lang
cyri_ joined #ruby-lang
scottschecter joined #ruby-lang
floyd2 joined #ruby-lang
mantono joined #ruby-lang
ddfreyne joined #ruby-lang
<dreinull>
so droplr runs on 1.9.3 - and it throws an error
<envygeeks>
rue: Returns the current execution stack—an array containing strings in the form “file:line” or “file:line: in `method’”. The optional start parameter determines the number of initial stack entries to omit from the result. is plain english, and that example shows it not working
<rue>
caller(start=1) -> array or nil
Tref joined #ruby-lang
<burgestrand>
Try invoking it with 0
<burgestrand>
… or in fact any parameter except 1 :p
<envygeeks>
ah yeah I see now
<envygeeks>
it's pry and irb corrupting the stack somehow because doing what you guys said with 0, 1 and 2 showed it working but in pry and irb it fails miserably and the count is off
<burgestrand>
envygeeks: that’s because the line needs to be processed and finally executed, if you look through the stack you’ll notice that on top of it lies the line where pry runs the command
<burgestrand>
same with IRB
<envygeeks>
is there no way to avoid that? Not trying to fight just trying to understand it so I can figure out how to work around it when I'm testing in pry
<burgestrand>
I’m not sure what kind of stacktrace you are expecting
gregmoreno joined #ruby-lang
<envygeeks>
well I was testing my Kernel.raise adjustment that would throw a user into pry when a raise is brought up, and I was in Kernel messing about playing with caller to /try/ and see how my function saw it, but it turns out they see caller 2 different ways
<envygeeks>
because I remove my Kernel.raise from the caller and send off the caller from before the point I called parent_raise
<envygeeks>
So I'll have to tell him about it tonight and see if he can look into it more
<burgestrand>
Latest HEAD as in latest pry installed from GitHub after that issue was closed?
<burgestrand>
(just saying, since the latest version from rubygems is released at november 5th, long before that issue)
<envygeeks>
Yessum :P my pry updates whenever they push a new update because I'm using the new hooks and helping to test and break binding_of_caller and stack-explorer
<envygeeks>
(via git)
kitallis joined #ruby-lang
<envygeeks>
ah nevermind I read the commit which explains it better
<envygeeks>
I need to use the backtrace command in pry and not caller, using backtrace will show me how my method sees it
<envygeeks>
wait, no
<envygeeks>
now I'm confused
<envygeeks>
nevermind, I'll just beat up banister later tonight about it
soulnafein joined #ruby-lang
srbaker joined #ruby-lang
slackstation joined #ruby-lang
tenderlove joined #ruby-lang
Pip joined #ruby-lang
<shevy>
yay
<shevy>
some snuggling and cuddling right envygeeks
<envygeeks>
I'm gonna light the fury! No not really, I'll probably forget by then since I've had a rough day already because it's been so busy here but meh
Neil_ joined #ruby-lang
Austin__ joined #ruby-lang
Austin__ left #ruby-lang
Austin__ joined #ruby-lang
lightcap joined #ruby-lang
lsegal joined #ruby-lang
<envygeeks>
wait, what does tap(&:shift) do?
thone_ joined #ruby-lang
<samuelkadolph>
The same thing as shift
edwardsharp joined #ruby-lang
fridim_ joined #ruby-lang
Oloryn_lt1 joined #ruby-lang
slant joined #ruby-lang
jbwiv_ joined #ruby-lang
rushed joined #ruby-lang
slaytanic joined #ruby-lang
shevy joined #ruby-lang
tallship joined #ruby-lang
scampbell joined #ruby-lang
alexkane joined #ruby-lang
yorickpeterse joined #ruby-lang
ndch joined #ruby-lang
ttilley joined #ruby-lang
hahuang65 joined #ruby-lang
amerine joined #ruby-lang
slaytanic joined #ruby-lang
root_ joined #ruby-lang
<root_>
could someone help me with this ruby script?
<Asher>
hm? i've seen the docs, at least i thought...
resetexistence joined #ruby-lang
<headius>
huh, can there really be no way?
<drbrain>
headius: I'm tracing
<imperator>
Asher, it's a module, with methods meant to be mixed in, generally for use in conjunction with ffi
<imperator>
i separate out the compiled code using templates and erb
<imperator>
instead of the big ball of mud that mkmf uses
<headius>
drbrain: oh, I just stumbled onit...SystemCallError.new does it for you
<imperator>
and it doesn't emit crap to stdout or stderr
<Asher>
drbrain - oh the big annoyance i had was the use of relative paths as the base path caused gdb to get confused in xcode… having ../../../../ at the beginning of every path
lianj joined #ruby-lang
<headius>
>> SystemCallError.new(3)
<headius>
=> #<Errno::ESRCH: No such process>
<headius>
a little weird, but ok
<drbrain>
sweet
<imperator>
headius, not cross platform though i don't thin
<imperator>
k
<headius>
what's not x-platform about it?
fayimora joined #ruby-lang
<headius>
ignore the fact that I just used '3' there
<samuelkadolph>
I wanted to rewrite my xbox gamertag api but I can't find a sinatra async library for jruby. Aspen doesn't work for me.
<headius>
ahhh
lightcap joined #ruby-lang
<samuelkadolph>
I have it running with node.js right now but it's soooo slow for screen scraping live.xbox.com. But it would need to be async since the website is also slow to respond.
<samuelkadolph>
And it broke with their redesign. lol
floyd2 joined #ruby-lang
lianj joined #ruby-lang
lianj joined #ruby-lang
marcostoledo joined #ruby-lang
flip_digits joined #ruby-lang
lightcap joined #ruby-lang
nofxx joined #ruby-lang
gearaholic joined #ruby-lang
<headius>
that figures
<gearaholic>
is there a way to determin a files mime type?