<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 27 June 2013 11:03, Oliver Legg <span dir="ltr"><<a href="mailto:ollylegg@gmail.com" target="_blank">ollylegg@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="im"><div><blockquote type="cite"><div dir="ltr"><div>2. create a custom assets:precompile task that does some bullshit magic to make the assets gems available. I worry about this because "bullshit magic".</div>
</div></blockquote><br></div></div><div>I haven't really looked into this change, but I think I'd go with this option. The "bullshit magic" is probably just:</div><div><br></div><div><font face="Menlo"> Rake::Task['environment'].invoke</font></div>
<div><font face="Menlo"> Bundler.require(:assets)</font></div><div><font face="Menlo"> Rake::Task['assets:precompile'].invoke</font></div><div> </div><div>That, if it works, doesn't seem like too much magic.</div>
<br></div></blockquote><div><br></div><div style>I haven't tried that, but you're right, it does seem like not too much magic. I did try finding out if you can safely call Bundler.require multiple times. The bundler docs are sparse to say the leave and as that apparently left me the sole option of reading the bundler source code to work out what it does, I felt that I'd rather die than go spelunking in there. Clearly I should have just tried it in the console!</div>
<div style><br></div><div style>I suppose my real worry is that suddenly you have to do something *different* to compile the assets. It's not a big enough worry to avoid doing it, but I like to minimise anything in an app where doing a standard rails-y thing has to be done differently for <%= reasons %> as it's a stumbling block for new developers (or even yourself from the future)</div>
<div style><br></div><div style>Cheers,</div><div style><br></div><div style>Murray</div></div><br></div></div>