ConfigPP: preprocessor for configuration files
DL:
- http://websvn.nyaxtstep.com/viewvc.cgi/configpp/configpp.rb
- svn://home.nyaxtstep.com/configpp/configpp.rb
æ¦è¦
è¨å®ãã¡ã¤ã«ç®¡çç¨ããªããã»ããµã§ããè¤æ°ã®ç°ãªãç°å¢ã§è¨å®ãã¡ã¤ã«ãå ±æãããå ´åã«ä½¿ãã¾ãã
ç®ç
å ¨ãåãè¨å®ãã¡ã¤ã«ãè¤æ°ã®ç°ãªãç°å¢ã§ä½¿ç¨ãããã¨ã¯ä¸è¬çã«å°é£ã§ãã
vim, emacsçã¯é«åº¦ãªè¨å®ãã¡ã¤ã«ãã¼ãµãåãã¦ãã*1ããæ¡ä»¶åå²çãå©ç¨ããç°å¢ä¾åã®è¨å®ãè¡ããã¨ãå¯è½ã§ãããã»ã¨ãã©ã®ã½ããã¦ã§ã¢ã¯ãã®ãããªæ©è½ãæã£ã¦ãã¾ããã
ConfigPPãå©ç¨ãããã¨ã§ãç°¡æãã¼ãµã®ã¿æè¼ãã¦ãããããªã½ããã¦ã§ã¢ã§ãç°¡åã«ç°å¢ä¾åã®è¨å®ã管çãããã¨ãå¯è½ã«ãªãã¾ãã
使ç¨æ¹æ³
ã¾ããconfigppç¨ã®ã½ã¼ã¹ãã¡ã¤ã«ãæ¸ãã¾ããåºæ¬çã«erubyã§æ¸ãã°ããã®ã§ãããããã¤ã注æç¹ãããã¾ãã
configppç¨èå¥è¡ãå ¥ãã
æ¸å¼ï¼
# configpp: åºåãã¡ã¤ã«å, ãã¼ã¸ã§ã³
ã³ã¡ã³ãprefixã®"# "ã¯å¤æ´å¯è½ã§ãã
ä»ã«ãªã«ããã£ãããªï¼
ConfigPPUtilã®ä½¿ç¨
ConfigPPã¯ãè¨å®ãã¡ã¤ã«ã§ä½¿ç¨ãããå ¸åçãªå¦çãã¾ã¨ããã¯ã©ã¹ConfigPPUtilãæã£ã¦ãã¾ãã
ConfigPPUtilã®ã¤ã³ã¹ã¿ã³ã¹ã¯ã¯ã©ã¹å¤æ°@cppã«ä»£å ¥ããã¦ããã®ã§ãèªç±ã«ã¹ã¯ãªããä¸ã§ä½¿ããã¨ãã§ãã¾ãã
ãããã¼ã®åºå
<%= @cpp.header %>
OSå¤å®
使ç¨ä¾
<% if @cpp.os == 'linux' %> linuxç°å¢ä¾åå¦ç <% end %>
ãã£ã¹ããªãã¥ã¼ã·ã§ã³å¤å®
<% case @cpp.dist %> <% when 'debian' %> Debian Linuxä¾å <% when 'zaurus' %> Sharp Linuxä¾å <% else %> ä»ç°å¢ <% end %>
ã¦ã¼ã¶æ¡å¼µãªãã·ã§ã³
./configpp.rb --ext ãªãã·ã§ã³å=å¤
ã¨ãã¦æ¸¡ã
./configpp.rb --ext custom=value
<% if @cpp.custom == 'value' %> asdffdsa <% end %>
使ç¨ä¾ï¼
screenrc.configpp
# configpp: .screenrc, $Id$ <%= @cpp.header %> escape ^Pp vbell off autodetach on bind w windowlist -b defscrollback 300 defhstatus l^En:^Etl shell -$SHELL caption always "%{= wk} %-w%{=bu dr}%n %t%{-}%+w %= %{=b wb}%y/%m/%d %{=b wb}%c" startup_message off encoding utf8 <% if @cpp.dist == 'zaurus' %> acladd zaurus <% end %> # launcher settings <% if @cpp.dist == 'zaurus' %> bind ^b exec sudo /home/zaurus/bin/backlightutil.sh bind -c app d screen sudo chroot /mnt/card/debroot/ su - zaurus <% else %> bind -c app t screen top bind -c app v screen vim <% end %> bind ^t command -c app # screen blanker <% if @cpp.dist == 'zaurus' %> idle 120 blanker blankerprg powersaver.sh <% end %>
*1:ã¨ãããããã¹ã¯ãªããå®è¡ç°å¢ã§è¨å®ãã¡ã¤ã«ããã¼ã¹ãã¦ãã