#19 new
joe_kuban

Added C-Style preprocessor functionality

Reported by joe_kuban | July 24th, 2009 @ 09:33 PM

hi sam ,

i am using sprockets since a few days. its nice.

i was i need of some preprocessor functionality, which gives the possibility to do things like:

//= ifdef DO_DEBUG alert('SOME_DEBUG_CODE_HERE_1');
//= ifend

//= ifndef DO_DEBUG alert('DO_NOT_DEBUG_1');
//= ifend

//= define DO_DEBUG //= ifdef DO_DEBUG alert('DO_DEBUG_2');
//= ifend

//= ifndef DO_DEBUG alert('DO_NOT_DEBUG_2');
//= ifend

//= undefine DO_DEBUG //= ifdef DO_DEBUG alert('DO_DEBUG_3');
//= ifend

//= ifndef DO_DEBUG alert('DO_NOT_DEBUG_3');
//= ifend

so i added them. maybe it helps other people too

comments are welcome.

best regards
joe

Comments and changes to this ticket

  • joe_kuban

    joe_kuban July 24th, 2009 @ 09:37 PM

    The editor pulled the code statements into one line.
    They need to be in three different lines ...

    
    //= ifdef DO_DEBUG 
    alert('SOME_DEBUG_CODE_HERE_1'); 
    //= ifend
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

JavaScript dependency management and concatenation
<a href="http://getsprockets.org/">http://getsprockets.org/</a>

People watching this ticket

Attachments

Pages