<csmrfx>
(just replace Tests::run_tests() line with extend Tests)
esad has joined #ruby-lang
robbyoconnor is now known as r0bby
r0bby is now known as robbyoconnor
cored has quit [Read error: Operation timed out]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
uuair has quit [Quit: uuair]
qwerxy has joined #ruby-lang
datanoise has joined #ruby-lang
datanoise has quit [Ping timeout: 240 seconds]
KA__ has joined #ruby-lang
postmodern has joined #ruby-lang
savage- has joined #ruby-lang
arubin_ has joined #ruby-lang
<csmrfx>
I would like to divide methods in a module into several sub-modules. Is extending the methods from the sub-modules into their containing module a proper approach?
wyhaines has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
cschwart1 has joined #ruby-lang
datanoise has quit [Ping timeout: 260 seconds]
nertzy has joined #ruby-lang
cschwartz has quit [Ping timeout: 252 seconds]
Kingy has quit [Quit: Leaving]
datanoise has joined #ruby-lang
lsegal has joined #ruby-lang
buscapepe has quit [Remote host closed the connection]
nertzy has quit [Quit: This computer has gone to sleep]
nertzy has joined #ruby-lang
phaedrix has joined #ruby-lang
uuair has joined #ruby-lang
sent_hil has left #ruby-lang [#ruby-lang]
jarred has joined #ruby-lang
<jarred>
How do I prevent a thread from dying? I tried sticking a loop block in side the thread's block but it still dies after a few seconds
chimkan has joined #ruby-lang
KA_ has quit [Quit: KA_]
ryanf has quit [Quit: broken pipes |||]
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
justinmc_ has joined #ruby-lang
justinmcp has quit [Ping timeout: 240 seconds]
sn0wb1rd has quit [Read error: Connection reset by peer]
sn0wb1rd has joined #ruby-lang
<rking>
jarred: Hehe, threads don't just "die"
KA_ has joined #ruby-lang
<jarred>
rking: Am I inadvertently killing the thread? Here's the relevant code https://gist.github.com/10e08cfb9b6f33427df5. I require the module in IRB, add a request to it, and it never gets processed. When I call "@thread", I get #<Thread:0x007fe1fc57b288 dead>
<jarred>
(Yeah, spacing is horrible. It looks good in Sublime Text 2 though)
KA_ has quit [Quit: KA_]
<rking>
jarred: Divide & conquer.
KA_ has joined #ruby-lang
<rking>
jarred: Take the body of Thread.new do … end and make it its own method, then call it
havenn has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has quit [Changing host]
|Vargas| has joined #ruby-lang
cirwin has joined #ruby-lang
chendo_ has quit [Read error: Operation timed out]
stardiviner has joined #ruby-lang
kitallis has quit [Ping timeout: 252 seconds]
<catepillar>
nokogiri can do it
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
siyusong has quit [Quit: Computer has gone to sleep.]
Mon_Ouie has quit [Ping timeout: 244 seconds]
kitallis has joined #ruby-lang
apeiros_ has quit [Ping timeout: 260 seconds]
gsav has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby-lang
havenn has joined #ruby-lang
jarred has quit [Quit: jarred]
areil has quit [Ping timeout: 252 seconds]
havenn has quit [Ping timeout: 256 seconds]
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
Averna has quit [Quit: Leaving.]
dhruvasagar has quit [Ping timeout: 265 seconds]
apeiros_ has joined #ruby-lang
rue|w has joined #ruby-lang
justinmcp has quit [Ping timeout: 255 seconds]
batdorf has quit [Quit: Leaving]
ryanf has quit [Quit: leaving]
areil has joined #ruby-lang
uuair has quit [Quit: uuair]
dhruvasagar has joined #ruby-lang
savage- has quit [Quit: savage-]
workmad3 has joined #ruby-lang
cschwart1 has quit [Ping timeout: 244 seconds]
wallerdev has quit [Quit: wallerdev]
seoaqua has joined #ruby-lang
datanoise has joined #ruby-lang
workmad3 has quit [Ping timeout: 246 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
solars has joined #ruby-lang
cschwartz has joined #ruby-lang
seoaqua has quit [Ping timeout: 252 seconds]
havenn has joined #ruby-lang
Kichael has quit [Ping timeout: 256 seconds]
havenn has quit [Ping timeout: 252 seconds]
rolfb has joined #ruby-lang
jarib has quit [Excess Flood]
jarib_ has joined #ruby-lang
<yorickpeterse>
Morning
facest has joined #ruby-lang
faces has quit [Ping timeout: 260 seconds]
qwerxy has joined #ruby-lang
qwerxy has quit [Client Quit]
agarcia has joined #ruby-lang
banisterfiend has joined #ruby-lang
erichmenge has quit [Quit: Be back later]
blacktulip has joined #ruby-lang
justinmcp has joined #ruby-lang
laszlokorte has joined #ruby-lang
anannie has joined #ruby-lang
anannie has quit [Remote host closed the connection]
seoaqua has joined #ruby-lang
cyri_ has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
havenn has joined #ruby-lang
seoaqua has quit [Ping timeout: 260 seconds]
kjr has quit [Quit: kjr]
anannie has joined #ruby-lang
adambeynon has joined #ruby-lang
rebelcan has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
havenn has quit [Ping timeout: 265 seconds]
seoaqua has joined #ruby-lang
seoaqua has quit [Client Quit]
fsvehla has left #ruby-lang [#ruby-lang]
justinmcp has quit [Ping timeout: 260 seconds]
gnufied has joined #ruby-lang
cyri__ has joined #ruby-lang
cyri_ has quit [Ping timeout: 264 seconds]
cyri__ is now known as cyri_
wyhaines has joined #ruby-lang
jarib_ has quit [Quit: bye]
b3nt_pin has quit [Ping timeout: 246 seconds]
banisterfiend has quit [Ping timeout: 256 seconds]
jarib has joined #ruby-lang
workmad3 has joined #ruby-lang
cirwin has quit [Ping timeout: 256 seconds]
qwerxy has joined #ruby-lang
jsaak has joined #ruby-lang
adambeynon has quit [Quit: Computer has gone to sleep.]
anannie has quit [Ping timeout: 256 seconds]
toretore has joined #ruby-lang
mhag has joined #ruby-lang
jsaak has quit [Quit: leaving]
jsaak has joined #ruby-lang
runeb- has joined #ruby-lang
runeb- is now known as runeb
d3vic3 has joined #ruby-lang
havenn has joined #ruby-lang
havenn has quit [Ping timeout: 256 seconds]
xD34 has joined #ruby-lang
<xD34>
Hello everyone, I would like to know if there is a simple way to add a line of text at the beginning of a file, without fully loading it into memory. Indeed, it's a very very large text, so I would like to avoid this, thanks :)
Hakon has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
xD34 has quit [Quit: Page closed]
<yorickpeterse>
When you create a file descriptor it doesn't load it into memory unless you start reading the file
<yorickpeterse>
I believe that if you open the file with "r+" you can prepend text to it without overwriting it
sush24 has joined #ruby-lang
<heftig>
yorickpeterse: nope.
<yorickpeterse>
Hm, come to think of it that would overwrite the first line
<heftig>
if you want to prepend, write a new file with the to-prepended data, then copy the rest from the old file. afterwards, rename the new over the old file
<yorickpeterse>
Comedy option: use Bash :>
Assurbanipal has joined #ruby-lang
Assurbanipal has quit [Client Quit]
<steveklabnik>
i was going to sarcastically write something like %x[...some bash here]
cultureulterior_ has joined #ruby-lang
kain has joined #ruby-lang
judofyr has joined #ruby-lang
b3nt_pin has joined #ruby-lang
kain has quit [Quit: exit]
kain has joined #ruby-lang
woollyams has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
wyhaines has quit [Remote host closed the connection]
laszlokorte has quit [Ping timeout: 256 seconds]
esad has quit [Quit: Computer has gone to sleep.]
esad has joined #ruby-lang
Hakon has joined #ruby-lang
sepp2k has joined #ruby-lang
brunocoelho has joined #ruby-lang
nofxx has quit [Ping timeout: 264 seconds]
havenn has joined #ruby-lang
brunocoelho has quit [Remote host closed the connection]
mytrile has quit [Remote host closed the connection]
ramonmaruko has quit [Remote host closed the connection]
telemachus has joined #ruby-lang
nitti has joined #ruby-lang
tubbo is now known as tubbo`cloud
Madis has joined #ruby-lang
ramonmaruko has joined #ruby-lang
nitti has quit [Ping timeout: 244 seconds]
nitti has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
banister_ has joined #ruby-lang
jxie has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
banisterfiend has quit [Ping timeout: 255 seconds]
mihar has quit [Ping timeout: 260 seconds]
mihar has joined #ruby-lang
banister_ has quit [Ping timeout: 255 seconds]
runeb has quit [Remote host closed the connection]
erichmenge has joined #ruby-lang
ananna has joined #ruby-lang
anannie has quit [Ping timeout: 240 seconds]
<whitequark>
judofyr: re
postmodern has quit [Quit: Leaving]
<judofyr>
whitequark: I'm still wondering about state. how are going to compile this: class Foo; def self.bar; @bar ||= {} end; bar[1] = 2; end;
davidbalber|away is now known as davidbalbert
<judofyr>
whitequark: will yout store @bar or not?
vlad_starkov has quit [Remote host closed the connection]
runeb has joined #ruby-lang
mistym has quit [Remote host closed the connection]
svyatov has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
lcdhoffman has joined #ruby-lang
<yorickpeterse>
I'd say so since it's called
<yorickpeterse>
(self.bar, which creates it)
mistym has quit [Ping timeout: 240 seconds]
Hakon has quit [Quit: Leaving...]
kurko_ has quit [Ping timeout: 260 seconds]
kurko_ has joined #ruby-lang
ananna has quit [Remote host closed the connection]
stardiviner has quit [Ping timeout: 245 seconds]
wallerdev has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
heftig has quit [Quit: leaving]
davidbalbert is now known as davidbalber|away
havenn has joined #ruby-lang
kurko_ has joined #ruby-lang
<whitequark>
judofyr: hm.
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<whitequark>
the answer is "it depends". if a compiler determines that there are no references to the Foo.bar, then it could optimize both the method and ivar out
<judofyr>
whitequark: and if there are?
havenn has quit [Ping timeout: 244 seconds]
gsav has joined #ruby-lang
gsav has quit [Client Quit]
gsav has joined #ruby-lang
gsav_ has joined #ruby-lang
<whitequark>
judofyr: then obviously I will
<whitequark>
but the placement can vary. if the class itself never changes, it could as well go to .rodata
<whitequark>
etc
kurko_ has quit [Ping timeout: 252 seconds]
thinkdevcode has joined #ruby-lang
<whitequark>
I'm not sure what you are actually asking here
<judofyr>
whitequark: and what about this: Foo.bar[1] = File.open("foo")
kurko_ has joined #ruby-lang
<whitequark>
open files can not be marshalled anyway
<whitequark>
steveklabnik: well, the optimizer has a certain granularity
<whitequark>
here the receiver is determined and constant, Foo
<whitequark>
but the method is not
thinkdevcode has quit [Remote host closed the connection]
<whitequark>
so, every method in the ancestrance chain of Foo will be translated, and will be forcibly uninlined
<whitequark>
(or at least have an uninlined copy)
<whitequark>
compiled foundry code won't be an efficiency miracle if your code is too uncertain to analyze statically
<whitequark>
this is expected.
<whitequark>
we have some plans to have foundry execute in a JIT mode, but this will take at least 1-1.5 years to be stable enough for any sort of production. probably more.
<judofyr>
whitequark: sure, I was mostly working about state. because it seemed to me initially that you didn't want to serialize objects; just store the methods etc.
esad has quit [Quit: Computer has gone to sleep.]
<judofyr>
but I probably misunderstood :)
<whitequark>
judofyr: oh, you did. I couldn't take away without serializing objects
<judofyr>
goodie
gsav has quit [Quit: Lost terminal]
<whitequark>
classes are objects, for that matter, and I don't treat classes differently than any other objects
<whitequark>
i.e. singleton methods are totally supported in all circumstances
<whitequark>
(except, as usual, for the runtime definition of them. that applies to obj.extend as well.)
<judofyr>
(yes, I know that some consider that the last step :-)
<whitequark>
cool, I'll take a lot
<whitequark>
ruby definitely needs more good, non-LALR parser toolkits
<judofyr>
LL(k) in O(n) time, all context-free grammars in O(n^3)
burgestrand has joined #ruby-lang
<whitequark>
*look
wyhaines has joined #ruby-lang
rue|w has quit [Ping timeout: 260 seconds]
<whitequark>
oh wait, it's LALR
<whitequark>
the thing I dislike about Bison-like parser generators is the way they handle precedency
<judofyr>
whitequark: how so?
<whitequark>
as in "either it's defined by a rule and deviates from strict definition of LALR, which cannot have conflicting rules, or it's sort of random"
<judofyr>
whitequark: I'm still not quite satisfied with my precedency solution
<whitequark>
in contrast, PEG parsers like treetop have a well-defined precedency rule
<whitequark>
the topmost rule wins
<whitequark>
(or the bottommost. well, doesn't matter anyway.)
havenn has joined #ruby-lang
<whitequark>
in bison, you need to have %prec and %expect and that kind of sucks, I'd say.
<judofyr>
whitequark: well, that's a shitty way of handling ambiguity IMO. if there's an ambiguity you should be able to choice how to handle it yourself.
<apeiros_>
whitequark: have you looked at parslet?
<judofyr>
choose*
<whitequark>
a very ad-hoc solution.
<whitequark>
judofyr: exactly. you do so by ordering the rules.
<whitequark>
whereas in bison, you use some flakey precedency constructs which don't even always work, and when they do, it's not always what you expect.
<whitequark>
apeiros_: I did
<judofyr>
whitequark: oh, also note that my parser tool handles all kind of ambiguity in the grammar. you'll just end up with Multiple-nodes in the AST if there's an ambiguity
<whitequark>
apeiros_: IIRC, both parslet and treetop have abysmal runtime performance of parsers
<apeiros_>
do you like it? (I haven't yet looked at it)
<whitequark>
I'm absolutely sure about treetop 'cause I used it extensively
<apeiros_>
ah, hah, I can imagine that
<whitequark>
it creates a Ruby object, and quite heavy one, for each input symbol
<whitequark>
that really sucks
<apeiros_>
I thought they wanted to add a treetop->ragel converter which promised a good performance boost. has that not happened yet?
<whitequark>
and parslet does the same, yeah
<judofyr>
whitequark: even then, choosing "first parse tree" isn't always the best solution. sometimes it would be better to barf out and say "oops, there's an ambiguity in this input; can't parse it"
<whitequark>
apeiros_: honestly I don't see how they actually differ, except for incompatible DSLs
<whitequark>
apeiros_: uh, as far as I know it did not
<judofyr>
whitequark: and sometimes you want to keep both trees and prune them later using different information
<apeiros_>
hm, in my own toy parser, I use structs
<whitequark>
apeiros_: ragel is a perfect lexer. I currently use racc for performance as the parser.
<apeiros_>
and keep referencing a single string (i.e. I just have the offsets in the struct + additional info))
areil has quit [Read error: Operation timed out]
<whitequark>
ragel can be abused to work as a parser, but that's not really a good idea IMO
<whitequark>
apeiros_: sounds nice. could I take a look?
<judofyr>
yeah, I also have a single string + offsets
<apeiros_>
whitequark: preferably not :)
<apeiros_>
or not yet
<whitequark>
judofyr: well, that kind of makes sense
<apeiros_>
it's by far too embarrassing and incomplete
<whitequark>
as per keeping both trees, GLR does that at the first point where it's possible
<whitequark>
i.e. if one of the trees resolves to an error, it discards it
<whitequark>
apeiros_: sure. just note that I'm interested in it. racc is... far from a good solution.
<apeiros_>
whitequark: pm?
<whitequark>
bending rules to not have identical first children, including nested, is quite hard, and leads to completely unreadable code
<apeiros_>
i.e., whether you mind a private message :)
<whitequark>
apeiros_: ah, obviously not. why would I? :) just send
<whitequark>
judofyr: hm, that makes sense
<whitequark>
I need to think more about it
yalue has joined #ruby-lang
<whitequark>
the fact that sometimes you might have deeply ambiguous grammars (e.g. C++) isn't really a reason to write a parser generator which could accomodate one
<apeiros_>
heh, you know, some people mind, so I just ask before ;-)
burgestrand has quit [Ping timeout: 264 seconds]
<whitequark>
clang for example has a handwritten C++ parser
<whitequark>
due to the fact that none of existing generators can handle it with the required precision
<whitequark>
(just imagining a handwritten C++ parser makes me wince)
esad has joined #ruby-lang
<judofyr>
whitequark: yes, that's why I think ambiguity has to be embraced if we want to abandon handwritten parsers
<judofyr>
whitequark: also, checking if a CFG is ambiguous or not isn't deterministic
<judofyr>
heck, I'd love if me toolkit could say "dude, this is ambiguous"
<judofyr>
my*
outoftime has joined #ruby-lang
<judofyr>
but there's no general solution to that question
<judofyr>
(other than choosing LL/LR which are just narrow subsets of unambiguous grammars)
<whitequark>
judofyr: I'm not sure if the problem you're trying to solve is realistic
<judofyr>
whitequark: my goal is that Kramer can handle all types of ambiguity: fail on ambiguity, choose first on ambiguity or choose all on ambiguity
<judofyr>
err
<judofyr>
types of ambiguity resolution*
<whitequark>
the amount of languages with non-LL/LR CFG is vanishingly small
<whitequark>
C++ has in fact CSG, as far as I understand it
<judofyr>
well, there's one thing writing a LR grammar, another problem is resolving shift/reduce errors
<whitequark>
yes. in fact, resolving S/R conflicts already gets us out of the scope of pure LL/LR
<judofyr>
A recent case study by Malloy et al. [37] gives an
<judofyr>
interesting insight into the typical development process of
<judofyr>
a Bison-based LALR parser for the C# language. The case
<judofyr>
study started with a grammar from the C# language defi-
<judofyr>
nition, and described how over the course of 19 revisions
<judofyr>
it was painstakingly factored to eliminate all 40 shift/reduce
<judofyr>
and 617 reduce/reduce conflicts that were reported for it.
<judofyr>
durr
<judofyr>
crappy pasting
<judofyr>
sorry
<judofyr>
"According to Malloy et al., this is not a surprising number of conflicts for a grammar not specifically designed for the targeted grammar class."
<whitequark>
R/R conflicts are especially evil
sush24 has joined #ruby-lang
<whitequark>
S/R means you need to add a precedence rule, R/R that you need to refactor the grammar
<whitequark>
and it's a royal pain
<judofyr>
exactly
thinkdevcode has joined #ruby-lang
<judofyr>
:)
roadt_ has quit [Ping timeout: 260 seconds]
<judofyr>
which is why I'm using GLL
<whitequark>
hm. PEGs are just never ambiguous.
<judofyr>
yes, but they also can't handle all complexity of CFG
<whitequark>
and they're strictly more powerful than LL/LR, but I'm not sure how they relate to LL/LR with precedence
<whitequark>
indeed
<judofyr>
I'm not sure if it's a real problem
<judofyr>
but every time I've been playing with PEGs I feel I need to re-write the grammar to handle the simplest things
<judofyr>
it can e.g. parse whitespace indentation
<judofyr>
and detecting duplicate function definitions
<judofyr>
right in the grammar
<whitequark>
well, the fact is that we can perfectly do both outside
<judofyr>
that is true
<whitequark>
detecting duplicate functions is a nice example of a scope of CSG, but is hardly practical
Hakon has joined #ruby-lang
<judofyr>
I'm just mentioning it :)
burgestrand1 is now known as burgestrand
|Vargas| has quit [Quit: ...]
<judofyr>
anyway, I still want to write a parser tool that embraces ambiguity and gives *you* the choice of how to handle it, instead of just bailing out on possibly-ambigious grammars :)
<whitequark>
the trick is to create a parser where you couldn't possibly define an ambiguous grammar :)
burgestrand has quit [Quit: Leaving.]
<judofyr>
well, there's always LL/LR :)
<whitequark>
I'd really love to hear any cases where your way is better than how PEGs work
<whitequark>
except C++ of course
<judofyr>
I like my left-recursion :)
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
<judofyr>
whitequark: or, let's define a grammar and implement it in GLL and PEG and see how they compare :)
jbwiv has quit [Remote host closed the connection]
<whitequark>
we'd need to use some real-world language
<whitequark>
otherwise the grammar would be biased according to the author's preference
<judofyr>
I'd prefer one that supports both ; and \n as separators
<judofyr>
because (1) many programmers like the style and (2) it's often tricky to implement correctly
<zzak>
you should have to manually type NEXT_LINE
<zzak>
just my input, as you were
<judofyr>
whitequark: other than that, feel free to pick anything :)
cschwartz has quit [Ping timeout: 240 seconds]
davidbalber|away is now known as davidbalbert
ttilley has joined #ruby-lang
<whitequark>
judofyr: rrrruby!
<judofyr>
whitequark: subset I hope…
<whitequark>
the problem is that the complexity of implementing a parser for a real-world language is quite substantial
<whitequark>
I'd probably not be able to pull it off on a weekend, and any toy language is not quite representative in my opinion.
davidbalbert is now known as davidbalber|away
<whitequark>
bbl, need to go
jbwiv has joined #ruby-lang
bfreeman has quit [Quit: bfreeman]
thatdutchguy has quit [Remote host closed the connection]
kjr has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
<Spaceghostc2c>
Roobee.
Serial_Killer_C has joined #ruby-lang
judofyr has quit [Remote host closed the connection]
slyphon has joined #ruby-lang
anachronistic has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
sush24 has quit [Quit: This computer has gone to sleep]
headius has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
ryanlecompte has joined #ruby-lang
sush24 has joined #ruby-lang
kurko_ has joined #ruby-lang
Assurbanipal has joined #ruby-lang
cultureulterior_ has quit [Ping timeout: 256 seconds]
macmartine has joined #ruby-lang
cultureulterior_ has joined #ruby-lang
agarcia has quit [Quit: Konversation terminated!]
Serial_Killer_C has quit [Remote host closed the connection]
senekis has joined #ruby-lang
cyri_ has quit [Quit: cyri_]
kith_ has joined #ruby-lang
alvaro_o has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
kith has quit [Ping timeout: 244 seconds]
apeiros_ has quit [Remote host closed the connection]
Serial_Killer_C has joined #ruby-lang
krohrbaugh1 has quit [Read error: Operation timed out]
<mistym>
I'm trying to debug a mysterious abort during my minitest tests. rake aborts with an empty status and a backtrace that doesn't include any of my code. Any advice?
esad has quit [Quit: Computer has gone to sleep.]
sn0wb1rd has quit [Quit: sn0wb1rd]
<devn>
I have a script I'm running that clones a bunch of repos using system('git clone foo@bar:foo.git`) and then symlinks them
esad has joined #ruby-lang
<devn>
the method calls to do these two operations are in initialize()
mistym_ has joined #ruby-lang
<devn>
for some reason on Ubuntu, both operations seem to occur at the same time
<devn>
on OSX this doesn't happen
<devn>
any ideas?
<lianj>
no
Mon_Ouie has joined #ruby-lang
<mistym>
devn: Can I see the code? Are you using the same software setup on both OSs?
blazes816 has joined #ruby-lang
mistym_ has quit [Remote host closed the connection]
Assurbanipal has quit [Remote host closed the connection]
jonathangreenber has joined #ruby-lang
<devn>
mistym: sure, one sec
<devn>
mistym: give me one sec, need to clean it up as this is not public
wyhaines has quit [Remote host closed the connection]
<mistym>
Under what circumstances can #exitstatus return nil?
<devn>
are you asking me?
<mistym>
No, asking the channel.
<devn>
so -- here's the issue
<devn>
just figured it out
<devn>
system('ls &>/dev/null') doesn't cause the process to block
<devn>
system('ls') does
<devn>
it *does* block on OSX though, redirecting output to /dev/null or not
cschwartz has joined #ruby-lang
<devn>
is this a bug?
banisterfiend has joined #ruby-lang
kingcrawler has joined #ruby-lang
erichmenge has quit [Quit: Be back later]
woollyams has joined #ruby-lang
dhruvasagar has joined #ruby-lang
woollyams has quit [Client Quit]
wyhaines has joined #ruby-lang
kjr has quit [Read error: Connection reset by peer]
bfreeman has joined #ruby-lang
kjr_ has joined #ruby-lang
<wnd>
devn, sounds like a feature of your default shell
<telemachus>
The output is blocking?
<wnd>
&>foo -redirect
cschwartz has quit [Ping timeout: 268 seconds]
<wnd>
dash doesn't seem to interpret that the same way bash or zsh does
<wnd>
my guess is that 'ls >/dev/null 2>&1' would block
<mistym>
devn: Are you using the same shell on ubuntu and OS X?
chimkan has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
<wnd>
wikipedia page on bash sort of suggests bourne shell doesn't understand "&>": "Bash can redirect standard output (stdout) and standard error (stderr) at the same time using the &> operator. This is simpler to type than the Bourne shell equivalent 'command > file 2>&1'."
sepp2k has quit [Read error: Connection reset by peer]
sn0wb1rd has joined #ruby-lang
sepp2k has joined #ruby-lang
bfreeman_ has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
mhag has quit [Ping timeout: 240 seconds]
<erikh>
probably depends on which shell you're on
cschwartz has joined #ruby-lang
bfreeman has quit [Ping timeout: 268 seconds]
<devn>
wnd: it returns 0 in bash AFAICT
<devn>
but im on a pretty recent version of bash
<devn>
it's possible the other system has a more dated version
<eam>
but what you can't do is reliably invoke the shell on a single-string call
thatdutchguy has joined #ruby-lang
<eam>
eg system "ls -l # "; vs system "ls -l # *" where the contents of the comment trick the lame ruby processor into changing the way it runs the command
<erikh>
I'd just use Process.spawn
<eam>
yeah agreed, avoiding those codepaths entirely is smart
kingcrawler has quit [Quit: Computer has gone to sleep]
davidbalber|away is now known as davidbalbert
banisterfiend has quit [Ping timeout: 256 seconds]
Carnage\ has quit []
thone_ has joined #ruby-lang
datanoise has quit [Ping timeout: 245 seconds]
Carnage\ has joined #ruby-lang
nitti has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
thone has quit [Ping timeout: 264 seconds]
CoverSlide has quit [Remote host closed the connection]
injekt has joined #ruby-lang
CoverSlide has joined #ruby-lang
steez_ has left #ruby-lang [#ruby-lang]
gearaholic has joined #ruby-lang
steez has joined #ruby-lang
kingcrawler has joined #ruby-lang
kingcrawler has left #ruby-lang [#ruby-lang]
lcdhoffman has joined #ruby-lang
chimkan has quit [Quit: chimkan]
gearaholic has quit [Remote host closed the connection]
qpingu has joined #ruby-lang
datanoise has joined #ruby-lang
apeiros_ has joined #ruby-lang
qwerxy has joined #ruby-lang
savage- has quit [Remote host closed the connection]
ryanlecompte has joined #ruby-lang
<tocki_>
is there a way to execute code on ruby exit
<tocki_>
i know of at_exit & END {}.. but still would like to handle termination on per-object basis :/
qwerxy has quit [Quit: offski]
<tocki_>
these things look like global hooks
wyhaines has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 240 seconds]
justinram has joined #ruby-lang
banisterfiend has joined #ruby-lang
cschwartz has quit [Ping timeout: 256 seconds]
Uranio has joined #ruby-lang
<apeiros_>
tocki_: there are finalizers, but those are unreliable, also they're run after the object was collected
<apeiros_>
i.e., they're not destructors.
<tocki_>
yes.. i've tried them, and they didn't execute
<tocki_>
something else ?
<tocki_>
hmmz... at_exit is private member of every object... but which one gets executed.. hmmz...
<tocki_>
Kernel probably
<tocki_>
It would be nice to allow object to cleanup after himself
<apeiros_>
tocki_: method(:at_exit).owner # no need for "probably" :-p
<apeiros_>
and yes, Kernel. module_function, as all other methods on Kernel btw.
chimkan has joined #ruby-lang
<tocki_>
it would be nice if overriding this method would mean something :(
<tocki_>
however it seems that only mains at_exit counts..
Mon_Ouie has quit [Ping timeout: 244 seconds]
<apeiros_>
at_exit is before termination of the application, yes
Mon_Ouie has joined #ruby-lang
<tocki_>
ok?
<tocki_>
i agree
<tocki_>
:/
rolfb has joined #ruby-lang
workmad3 has joined #ruby-lang
erichmenge has joined #ruby-lang
mistym_lunch is now known as mistym
s0ber has quit [Read error: Connection reset by peer]
blacktulip has quit [Remote host closed the connection]
<apeiros_>
did you override dup too?
wyhaines has quit [Remote host closed the connection]
<mistym>
No.
nitti_ has joined #ruby-lang
<mistym>
Hmm. Actually, I think it must be somewhere else...
Uranio has quit [Quit: WeeChat 0.3.8]
sush24 has joined #ruby-lang
kjr_ has quit [Ping timeout: 244 seconds]
<apeiros_>
should work IMO
<apeiros_>
at least I don't see why it doesn't…
<mistym>
I'm getting a sigabrt when trying to free a pointer in a finalizer somewhere. I thought my initialize_copy wasn't properly creating a new pointer (resulting in it being freed twice), but that's not the case.
davidbalbert is now known as davidbalber|away
nitti has quit [Ping timeout: 256 seconds]
carloslopes has quit [Remote host closed the connection]
bfreeman_ has quit [Read error: Connection reset by peer]
bfreeman has joined #ruby-lang
aetcore has joined #ruby-lang
nazty has quit [Ping timeout: 256 seconds]
rippa has quit [Ping timeout: 244 seconds]
<mistym>
I can at least verify that my bug is only happening if a pointer created via #dup is subsequently freed along with its originator... so I wonder if the issue is in the C library and not my code?
<erikh>
whoa, a ft2 player?
<mistym>
Haha, no. That would be cool though.
<erikh>
oh, bummer
kjr has joined #ruby-lang
<mistym>
Actually I named my gem "fasttrack" because it's a wrapper around a C lib for the XMP metadata format. And "XMP" in my mind permutated to "XM" => "FT2" => "Fasttracker", hence "fasttrack"
<erikh>
heh
<erikh>
Justin Frankel (WinAMP) is working on a modern tracker
runeb has quit [Remote host closed the connection]
<erikh>
keep forgetting the name though, starts with an R
<mistym>
That said: I *am* doing a high-level C wrapper around an ft2 player library (along with a player). Plus other formats!
<erikh>
there's also buzz, but it has some unfortunate problems
<erikh>
buzz is such a sad state of affairs
<erikh>
the author lost all the source code
<mistym>
erikh: Cool! I didn't know about that.
<erikh>
so all the patches now are deltas against the binaries
<mistym>
Ewww
tbuehlmann has quit [Remote host closed the connection]
<mistym>
This is why you release your source code and let other people do your backups for you
<erikh>
eh, hindsight is 20/20
<erikh>
:)
qwerxy has joined #ruby-lang
<erikh>
but yeah, buzz is basically a tracker with midi machines
<erikh>
reaper's a little more than that
<oddmunds>
mistym: very cool
<oddmunds>
erikh: extremely cool
qwerxy has quit [Client Quit]
<oddmunds>
erikh: i bought reaper not long ago
<oddmunds>
erikh: hey
<oddmunds>
you got my hopes up
<oddmunds>
you tricked me
<mistym>
Actually, I kinda halted my ruby-based player a few months ago when I ran against irritating thread priority issues using MRI that resulted in my audio sounding terrible if background jobs were executing anything. Been meaning to try again with jruby or macruby.
<oddmunds>
reaper is not a tracker at all
<erikh>
maybe I'm thinking of something else then?
<oddmunds>
mistym: i've been toying around with ideas for my own tracker since i switched to ruby as my go-to-language
<oddmunds>
erikh: it's a daw
<mistym>
oddmunds: Cool, were you going to make your own format?
<oddmunds>
mistym: i think my tracker will be midi only at first
datanoise has joined #ruby-lang
<erikh>
hahahah
justinmcp has joined #ruby-lang
<erikh>
yeah, I do imagine he'd do a good job with it.
<oddmunds>
i find new trackers (like sunvox) interesting, but i still do all my tracking in milkytracker
carter has quit [Disconnected by services]
carter has joined #ruby-lang
cschwartz has joined #ruby-lang
<erikh>
the last time I actually wrote music with a tracker (as opposed to playing with one) was on ST3
<erikh>
which I imagine dates me some
zspencer has joined #ruby-lang
<erikh>
anyhow, laundry time yo. later.
bradland has joined #ruby-lang
<oddmunds>
screamtracker was my first one
qwerxy has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
davidbalber|away is now known as davidbalbert
datanoise has quit [Ping timeout: 276 seconds]
dc5ala has quit [Quit: Ex-Chat]
davidbalbert is now known as davidbalber|away
cschwartz has quit [Ping timeout: 264 seconds]
nitti_ has quit [Remote host closed the connection]
kain has quit [Quit: exit]
cored has quit [Ping timeout: 252 seconds]
nitti has joined #ruby-lang
methods has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
benanne has quit [Quit: kbai]
Serial_Killer_C has quit [Remote host closed the connection]
nitti has quit [Remote host closed the connection]
Serial_Killer_C has joined #ruby-lang
Serial_Killer_C has quit [Remote host closed the connection]
dr_bob has quit [Read error: Connection reset by peer]
Serial_Killer_C has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
bradland has quit [Quit: bradland]
kurko_ has joined #ruby-lang
heftig has joined #ruby-lang
yxhuvud has quit [Ping timeout: 248 seconds]
davidbalber|away is now known as davidbalbert
erichmenge has joined #ruby-lang
cyri_ has joined #ruby-lang
yalue has quit [Quit: Leaving]
davidbalbert is now known as davidbalber|away
datanoise has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
davidbalber|away is now known as davidbalbert
Mon_Ouie has quit [Ping timeout: 244 seconds]
urbanmonk has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
davidbalbert is now known as davidbalber|away
justinmcp has quit [Ping timeout: 240 seconds]
datanoise has quit [Ping timeout: 265 seconds]
codewrangler has quit [Quit: Computer has gone to sleep.]
carter has quit [Disconnected by services]
carter__ has joined #ruby-lang
datanoise has joined #ruby-lang
gix has quit [Read error: Connection reset by peer]
kurko_ has quit [Ping timeout: 252 seconds]
CaptainJet has joined #ruby-lang
kurko_ has joined #ruby-lang
jarib has quit [Excess Flood]
gix has joined #ruby-lang
jarib has joined #ruby-lang
davidbalber|away is now known as davidbalbert
runeb has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
davidbalbert is now known as davidbalber|away
burgestrand has quit [Ping timeout: 260 seconds]
havenn has quit [Remote host closed the connection]
burgestrand1 has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
havenn has joined #ruby-lang
kurko_ has joined #ruby-lang
burgestrand1 has quit [Read error: Connection reset by peer]
runeb has quit [Ping timeout: 260 seconds]
burgestrand has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
havenn has quit [Ping timeout: 240 seconds]
woollyams has joined #ruby-lang
Serial_Killer_C has quit [Remote host closed the connection]
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
davidbalber|away is now known as davidbalbert
Carnage\ has quit []
justinmcp has joined #ruby-lang
esad has quit [Ping timeout: 255 seconds]
esad has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
Serial_Killer_C has joined #ruby-lang
scampbell has quit [Remote host closed the connection]
dsenkus has quit [Ping timeout: 256 seconds]
Hakon has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
nitti has joined #ruby-lang
kurko_ has joined #ruby-lang
neilc has joined #ruby-lang
<neilc>
x.flat_map.to_a != x.flat_map {|t| t}, where x is an Enumerable
<neilc>
does that strike anyone else as bizarre?
nitti has quit [Remote host closed the connection]
nitti has joined #ruby-lang
<mistym>
When I clone/dup, the cloned object inherits the original object's finalizer, with a reference to an instance variable from the original object - not the ivar it was replaced by in #initialize_clone.
<mistym>
Oh, there's an undefine_finalizer... guess I need to undefine the old one, then define a new one.
kain has joined #ruby-lang
mhag has joined #ruby-lang
<zspencer>
Anyone know of a simple way to assert an array is sorted?
hahuang65 has joined #ruby-lang
<apeiros_>
zspencer: ary.each_cons(2) { |a,b| a <= b }
<zspencer>
Danke
<apeiros_>
or >=, depending on the order
<zspencer>
Yea
<zspencer>
each_cons?
svyatov has quit [Quit: svyatov]
<zspencer>
each_consective
<zspencer>
derpaderp
<zspencer>
thanks
spuk has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
bfreeman has quit [Read error: Connection reset by peer]
bfreeman has joined #ruby-lang
kurko_ has joined #ruby-lang
esad has quit [Quit: Computer has gone to sleep.]
esad has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
neilc has quit [Quit: leaving]
nitti has quit [Ping timeout: 256 seconds]
urbanmonk has quit [Quit: Bye!]
kith_ is now known as kith
davidbalbert is now known as davidbalber|away
zspencer has quit [Quit: zspencer]
solars has quit [Ping timeout: 252 seconds]
davidbalber|away is now known as davidbalbert
wyhaines has joined #ruby-lang
toretore has quit [Quit: Leaving]
nitti has joined #ruby-lang
nitti has quit [Remote host closed the connection]
woollyams has joined #ruby-lang
nitti has joined #ruby-lang
bougyman_ has joined #ruby-lang
bougyman has quit [Ping timeout: 260 seconds]
bougyman_ has quit [Changing host]
bougyman_ has joined #ruby-lang
bougyman_ is now known as bougyman
gregmoreno has quit [Ping timeout: 248 seconds]
nitti has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
runeb has joined #ruby-lang
nitti_ has joined #ruby-lang
sailias has quit [Quit: Leaving.]
qwerxy has quit [Quit: offski]
qwerxy has joined #ruby-lang
qwerxy has quit [Client Quit]
runeb has quit [Ping timeout: 244 seconds]
<chris2>
anyone know why JSON.parse("5") does not work?
<steveklabnik>
that's not valid json
kurko_ has quit [Ping timeout: 252 seconds]
<Spaceghostc2c>
chris2: ^
burgestrand has quit [Read error: Connection reset by peer]
<chris2>
steveklabnik: according to the rfc4627 it is
burgestrand has joined #ruby-lang
kurko_ has joined #ruby-lang
<steveklabnik>
JSON-text = object / array
<chris2>
aah
<steveklabnik>
from the rfc
<steveklabnik>
a value can be a number
<steveklabnik>
:)
<chris2>
why ever they do that
<eam>
it's nice because every json structure has a termination character
<steveklabnik>
it's grammar
<eam>
big plus over yaml
<steveklabnik>
all json is yaml ;)
<eam>
but not vice versa
<steveklabnik>
yes
<steveklabnik>
most people dont know that, i know it doesnt refute your point
<eam>
steveklabnik: yeah I agree it's a cool fact :)
<chris2>
except yaml can >> YAML.load 5.to_yaml
<chris2>
=> 5
<steveklabnik>
right
<steveklabnik>
hecne all yaml is not json
<eam>
it's a feature!
apeiros_ has quit [Remote host closed the connection]
gsav has joined #ruby-lang
gsav_ has quit [Read error: Operation timed out]
cyri_ has quit [Quit: cyri_]
gsav has quit [Read error: Operation timed out]
nitti_ has quit [Remote host closed the connection]
thatdutchguy has quit [Remote host closed the connection]
chimkan has quit [Quit: chimkan]
herpless has quit [Remote host closed the connection]
herpless_ has joined #ruby-lang
Spaceghost|cloud has quit [Remote host closed the connection]
Spaceghost|cloud has joined #ruby-lang
pkondzior_ has quit [Remote host closed the connection]
pkondzior_ has joined #ruby-lang
bluepojo has quit [Remote host closed the connection]
Kingy has joined #ruby-lang
mhag has quit [Remote host closed the connection]
cyri_ has joined #ruby-lang
cyri_ has quit [Client Quit]
anachronistic has left #ruby-lang [#ruby-lang]
datanoise has quit [Ping timeout: 260 seconds]
bluepojo has joined #ruby-lang
Averna has joined #ruby-lang
DEac- has quit [Read error: No route to host]
thatdutchguy has joined #ruby-lang
DEac- has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
benanne has quit [Quit: kbai]
outoftime has quit [Quit: Leaving]
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
Serial_Killer_C has quit [Remote host closed the connection]
guns has joined #ruby-lang
kjr has quit [Quit: kjr]
justinmcp has quit [Ping timeout: 256 seconds]
chimkan has joined #ruby-lang
davpoind has joined #ruby-lang
justinmcp has joined #ruby-lang
mistym has quit [Remote host closed the connection]
kurko_ has quit [Ping timeout: 244 seconds]
kurko_ has joined #ruby-lang
esad has quit [Ping timeout: 260 seconds]
nertzy has joined #ruby-lang
esad has joined #ruby-lang
datanoise has joined #ruby-lang
davidbalbert is now known as davidbalber|away
davidbalber|away is now known as davidbalbert
jamjam has joined #ruby-lang
kurko_ has quit [Ping timeout: 244 seconds]
davidbalbert is now known as davidbalber|away
kurko_ has joined #ruby-lang
zspencer has joined #ruby-lang
datanoise has quit [Ping timeout: 265 seconds]
justinram has quit [Remote host closed the connection]
Hakon has quit [Ping timeout: 244 seconds]
<Harzilein>
hi
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
xalei has joined #ruby-lang
davpoind has quit [Quit: Be back later]
<Harzilein>
what is the advantage of using mruby over mri on desktop platforms? mri seems to embed fine in e.g. kazehakase, so what, if anything, would an application like that gain from using mruby instead?