- Timestamp:
- 01/26/09 03:46:46 (4 years ago)
- Location:
- lang/javascript/dollar-mod.js/dolmod/trunk
- Files:
-
- 13 added
- 16 modified
-
. (modified) (1 prop)
-
Makefile (modified) (1 diff)
-
scripts/ar.sh (modified) (4 diffs)
-
scripts/dolmod (modified) (3 diffs)
-
scripts/perl/drop-comments.pl (added)
-
scripts/perl/libs.pl (modified) (1 diff)
-
src/ReservedAction.js (modified) (2 diffs)
-
src/dollar-mod/init.js (modified) (1 diff)
-
src/dollar-mod/interface.js (modified) (5 diffs)
-
src/dollar-mod/util.js (modified) (3 diffs)
-
src/dollar-mod/util/console/CLI.js (modified) (1 diff)
-
src/dollar-mod/util/console/Pseudo.js (modified) (1 diff)
-
src/pod/version.pod (modified) (1 diff)
-
templates/Makefile.in (modified) (5 diffs)
-
templates/apiindex.html (added)
-
templates/coMake.mk (modified) (3 diffs)
-
templates/licence (added)
-
templates/licence/new-bsd (added)
-
templates/sampleindex.html (added)
-
templates/testindex.html (added)
-
templates/unit.t.js (added)
-
templates/web (added)
-
templates/web/css (added)
-
templates/web/css/web.css (added)
-
templates/webindex.html (added)
-
tests/HARNESS.js (added)
-
tests/dollar-mod/ModuleDriver.t.js (modified) (2 diffs)
-
tests/index.html (modified) (1 diff)
-
tests/testlib (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/dollar-mod.js/dolmod/trunk
-
Property
svn:ignore set
to
sandbox
-
Property
svn:ignore set
to
-
lang/javascript/dollar-mod.js/dolmod/trunk/Makefile
r27649 r29022 27 27 src/modify.check: 28 28 @scripts/check-modification $@ src '*.js' 29 30 29 31 30 install: -
lang/javascript/dollar-mod.js/dolmod/trunk/scripts/ar.sh
r27649 r29022 5 5 6 6 DIR=`cat $ARNAME` 7 8 if test -z $DIR; then 9 echo $ARNAME is empty file >&2 10 exit 1; 11 fi 12 7 13 PROJECT=`echo $DIR|sed -e 's/-[^\/]*$//'` 8 14 AR=$DIR.ar.js; … … 23 29 |grep -v '/my/'\ 24 30 |grep -v 'dollar-mod.js$'\ 31 |grep -v '\.m4\.js'\ 32 |grep -v '\.inc\.js'\ 33 |grep -v '\.s\.js'\ 34 |grep -v '\.t\.js'\ 25 35 >ar.srcs 26 cat ar.srcs |xargs cat 36 cat ar.srcs |xargs cat|dolmod drop-comments 27 37 echo "\$mod.endArchive('$PROJECT');" 28 38 } … … 37 47 mkdir $DIR; 38 48 mkdir $DIR/lib 49 mkdir $DIR/m4lib 39 50 $ARCMD > $DIR/lib/$AR; 40 51 cp DEPENDS $DIR … … 43 54 fi 44 55 56 for f in `find lib -type f -name '*.js' |grep -v '/m4lib/'\ 57 |grep -e '\.m4\.inc\.js'`;do 58 dir=`dirname $f` 59 if ! test -d $DIR/m4$dir ; then mkdir -p $DIR/m4$dir; fi 60 echo $DIR/m4$f 61 cp $f $DIR/m4$f 62 done 63 45 64 find $DIR -type d -name '.svn'|xargs rm -rf 46 65 find $DIR -type d -name '.git'|xargs rm -rf 47 66 tar -cvzf $ZIP $DIR 48 67 49 50 68 rm -fr $DIR -
lang/javascript/dollar-mod.js/dolmod/trunk/scripts/dolmod
r27334 r29022 37 37 38 38 39 ### get-version <version-from | module-name> 40 ### 41 ### 42 get-version) 43 versionfrom=$1 44 if ! test -f $versionfrom ;then 45 versionfrom=`echo $versionfrom\ 46 |sed -e 's/\./\//g'\ 47 |sed -e 's/$/.js/'\ 48 |sed -e 's/^/lib\//'` 49 fi 50 if ! test -f $versionfrom; then 51 exit 1 52 fi 53 echo VERSION FROM ... $versionfrom >&2 54 cat $versionfrom \ 55 |grep -e '[ ]*VERSION:'\ 56 | sed -e 's/[^0-9\.]//g'\ 57 |head -n 1 58 ;; 59 39 60 40 61 ### libs <project-name> [<archive-name> ... ] … … 56 77 ARCHIVE_STORE=$ARCHIVE_STORE \ 57 78 perl $PL/makefile.pl $* 79 ;; 80 81 ### comake 82 ### 83 ### 84 comake) 85 cat $TMPL/coMake.mk >coMake.mk 58 86 ;; 59 87 … … 114 142 ;; 115 143 144 ### testindex 145 ### Outputs source of the tests/index.html. 146 ### 147 testindex) 148 PROJECT=$1 149 cat $TMPL/testindex.html |sed -e 's/@PROJECT@/'$PROJECT'/g' 150 ;; 151 152 ### sampleindex 153 ### Outputs source of the samples/index.html 154 ### 155 sampleindex) 156 PROJECT=$1 157 cat $TMPL/sampleindex.html |sed -e 's/@PROJECT@/'$PROJECT'/g' 158 ;; 159 160 ### sampleindex 161 ### Outputs source of the samples/index.html 162 ### 163 apiindex) 164 PROJECT=$1 165 cat $TMPL/apiindex.html |sed -e 's/@PROJECT@/'$PROJECT'/g' 166 ;; 167 168 169 170 ### licence 171 ### create LICENCE file. 172 ### 173 licence) 174 AUTHOR=$1 175 cat $TMPL/licence/$type\ 176 | sed -e 's/@YEAR@/'``'/g'\ 177 | sed -e 's/@AUTHOR@/'$AUTHOR'/g' 178 ;; 179 180 ### webcss 181 ### 182 ### 183 webcss) 184 cat $TMPL/web/css/web.css 185 ;; 186 187 188 189 ### webindex 190 ### 191 ### 192 webindex) 193 PROJECT=$1 194 echo PROJECT ... $PROJECT >&2 195 VERSION=`${dolmod} get-version $PROJECT.Meta` 196 echo VERSION ... $VERSION >&2 197 M4OPTS="-P -I." 198 if test -d samples ; then 199 M4OPTS="${M4OPTS} -DSAMPLES" 200 fi 201 if test -d tests ; then 202 M4OPTS="${M4OPTS} -DTESTS" 203 fi 204 if test -d doc ; then 205 M4OPTS="${M4OPTS} -DAPIDOCS" 206 fi 207 if test -f LICENCE ; then 208 M4OPTS="${M4OPTS} -DLICENCE" 209 fi 210 if test -f doc/$PROJECT.Meta.xml ;then 211 M4OPTS="${M4OPTS} -DREADME" 212 fi 213 echo M4OPTS ... $M4OPTS >&2 214 cat $TMPL/webindex.html \ 215 |sed -e 's/@PROJECT@/'$PROJECT'/g'\ 216 |sed -e 's/@VERSION@/'$VERSION'/g'\ 217 |m4 $M4OPTS 218 ;; 219 220 ### unittest 221 ### Outputs source template of an unit test. 222 ### 223 unittest) 224 TESTTARGET=$1 225 LOCAL=`echo $TESTTARGET|sed -e 's/\([^.]*\.\)*\([^.]*\)$/\2/'` 226 cat $TMPL/unit.t.js \ 227 |sed -e 's/@TESTTARGET@/'$TESTTARGET'/g'\ 228 |sed -e 's/@LOCAL@/'$LOCAL'/g' 229 ;; 230 ### drop-comments 231 ### removes comments from javascript source. 232 ### 233 drop-comments) 234 file=$1; 235 if test -z $file ;then 236 file=/dev/stdin; 237 fi 238 cat $file | perl $PL/drop-comments.pl 239 ;; 240 116 241 *) 117 242 $dolmod help >&2 -
lang/javascript/dollar-mod.js/dolmod/trunk/scripts/perl/libs.pl
r27334 r29022 50 50 push @QUEUE, $_; 51 51 push @DEPENDS, $_; 52 $DEP{$_} = 1; 52 53 } 53 54 close $fh; -
lang/javascript/dollar-mod.js/dolmod/trunk/src/ReservedAction.js
r27649 r29022 26 26 var mod = depends[i]; 27 27 if( 'string' !== typeof mod ){ 28 throw new Error('illegal module specification : ' + mod); 28 throw new Error('illegal module specification : "' + mod + '" at ' + 29 this.__mod); 29 30 } 30 31 this.__modules[ mod ] = i; … … 78 79 var proc = this.__proc; 79 80 var args = this.__args; 80 81 81 db('run', this.__mod, this); 82 83 GLOBAL.setTimeout(function(){ 84 proc.apply( null, args ); 85 }, 0); 82 GLOBAL.setTimeout(function(){ proc.apply( null, args ); }, 0); 86 83 }; 87 84 -
lang/javascript/dollar-mod.js/dolmod/trunk/src/dollar-mod/init.js
r27649 r29022 18 18 //>>>,//<<< 19 19 20 GLOBAL.$mod = theModuleDriver.gen$mod(); 21 20 22 theModuleDriver.lock(); 23 21 24 registerOnloadAction( function(){ 22 25 theModuleDriver.unlock(); 26 var doc = GLOBAL.document; 27 var $mod = GLOBAL.$mod; 28 var pathes = []; 29 var pathconfig = null; 30 var main = null; 31 32 var links = doc.getElementsByTagName('link'); 33 for(var i=0, l=links.length; i<l; i++){ 34 var link = links[i]; 35 var rel = link.rel || ''; 36 var match = null; 37 38 match = rel.match(/^\$mod\.path\.(.*)/); 39 if(match){ 40 $mod.path(match[1], link.href); 41 continue; 42 } 43 44 if(rel == '$mod.main'){ 45 main = link.href; 46 continue; 47 } 48 } 49 50 var metas = doc.getElementsByTagName('meta'); 51 for(var i=0,l=metas.length; i<l; i++){ 52 var meta = metas[i]; 53 if(meta.name == '$mod.pathconfig'){ 54 pathconfig = meta.content; 55 } 56 } 57 58 var appmain = main ? function(){ $mod.load(main); } : function(){}; 59 var runarg = pathconfig ? [pathconfig, appmain] : [appmain]; 60 $mod.withModule.apply( $mod, runarg ); 61 23 62 }); 24 25 GLOBAL.$mod = theModuleDriver.gen$mod();26 63 27 64 //>>>) -
lang/javascript/dollar-mod.js/dolmod/trunk/src/dollar-mod/interface.js
r27649 r29022 86 86 */ 87 87 88 $mod.log = log; 89 $mod.warn = warn; 90 $mod.error = error; 91 $mod.info = info; 88 (function(){ 89 var gen = function(p){ 90 return function(){ 91 if(!GLOBAL.console) return; 92 GLOBAL.console[p].apply(GLOBAL.console, arguments); 93 } 94 } 95 for(var i=0,l=FIREBUGMETHODS.length;i<l;i++){ 96 var meth = FIREBUGMETHODS[i]; 97 $mod[meth] = gen(meth); 98 } 99 100 })(); 92 101 93 102 /* … … 200 209 $mod.meta = function(name){ return self.getMeta(name); }; 201 210 211 $mod.get = function(name){ 212 var mod = self.getModuleStore().get(name); 213 if(mod) return mod.entity(); 214 return null; 215 } 216 202 217 /* 203 218 … … 209 224 210 225 */ 226 211 227 212 228 … … 219 235 220 236 237 221 238 /* 222 239 … … 255 272 256 273 $mod.endArchive = function(name){ self.endArchive(name);}; 274 257 275 258 276 -
lang/javascript/dollar-mod.js/dolmod/trunk/src/dollar-mod/util.js
r27649 r29022 2 2 /// UTILITIES 3 3 4 var FIREBUGMETHODS = ['log','warn', 'error', 'info', 'assert','debug','time', 5 'timeEnd', 'dir', 'dirxml', 'trace']; 4 6 5 7 //m4_ifdef(//<<<CLI//>>>,//<<< … … 18 20 //>>>) 19 21 20 var log, warn, error, info ;22 var log, warn, error, info, assert; 21 23 22 24 (function(){ … … 27 29 } 28 30 } 29 log = gen('log'); 30 warn = gen('warn'); 31 error = gen('error'); 32 info = gen('info'); 31 log = gen('log'); 32 warn = gen('warn'); 33 error = gen('error'); 34 info = gen('info'); 35 assert = gen('assert'); 33 36 })(); 34 37 -
lang/javascript/dollar-mod.js/dolmod/trunk/src/dollar-mod/util/console/CLI.js
r27649 r29022 33 33 })(f); 34 34 } 35 }).apply(GLOBAL.console, ['warn', 'error', 'info']);35 }).apply(GLOBAL.console,FIREBUGMETHODS); -
lang/javascript/dollar-mod.js/dolmod/trunk/src/dollar-mod/util/console/Pseudo.js
r27649 r29022 19 19 })(f); 20 20 } 21 })(GLOBAL.console, ['log','warn', 'error', 'info']);21 })(GLOBAL.console, FIREBUGMETHODS); 22 22 23 23 (function(){ 24 var TIMERS = {}; 25 GLOBAL.console.tiem = function(name){ 26 TIMERS[name] = (new Date).getTime(); 27 } 28 GLOBAL.console.timeEnd = function(name){ 29 if(!(name in TIMERS)) return; 30 GLOBAL.console.info(name + ':' + ((new Date).getTime() - TIMERS[name]) + 31 'ms'); 32 delete TIMERS[name]; 33 } 34 })(); -
lang/javascript/dollar-mod.js/dolmod/trunk/src/pod/version.pod
r27649 r29022 1 m4_define(M_VERSTR,//<<<0.0 51//>>>);1 m4_define(M_VERSTR,//<<<0.07//>>>); 2 2 3 3 */ -
lang/javascript/dollar-mod.js/dolmod/trunk/templates/Makefile.in
r27499 r29022 11 11 all: archive install 12 12 13 archive: ar.name 13 js: m4.opts 14 @for f in `find lib -type f|grep -e '\.m4\.js$$'`; do \ 15 dst=`echo $$f|sed -e 's/\.m4\.js$$/.js/'`;\ 16 echo "cnverting...";\ 17 echo " src ... $$f";\ 18 echo " dst ... $$dst";\ 19 env m4 `cat m4.opts` -Ilib -P $$f > $$dst || exit 1;\ 20 echo "done";\ 21 done 22 @rm -f m4tmp* m4.log 23 24 m4.opts: 25 echo lib `find lib -type d -name m4lib`\ 26 |sed -e 's/ / -I/g'\ 27 |sed -e 's/^/-I/'\ 28 > $@ 29 30 31 archive: ar.name js 14 32 rm -f *.tar.gz 15 $(mod) ar $<33 $(mod) ar ar.name 16 34 17 35 install: … … 21 39 22 40 ar.name: $(VERSION_FROM) 23 cat $< |grep -e '[ ]*VERSION:'\ 24 | sed -e 's/VERSION[^0-9]*//' \ 25 | sed -e 's/[^0-9]*$$//'\ 26 | sed -e 's/^[ ]*/$(PROJECT)-/'\ 27 | head -n 1 >$@ 41 $(mod) get-version $(VERSION_FROM)|sed -e 's/^/'$(PROJECT)'-/' > $@ 28 42 29 43 update: DEPENDS 44 rm -f m4.opts 30 45 $(mod) update $(PROJECT) `cat $<` 31 46 $(mod) makefile $(PROJECT) `cat $<` … … 34 49 rm -fr *.tar.gz 35 50 36 #### 37 38 39 test: 40 rm -f tests/index.html 41 make unittests 42 make $(TESTS)/index.html 43 44 runtest: 51 ### 52 runfile: 45 53 @PWD=`pwd`;\ 46 FILE=$$(PWD)/$( TESTS)/index.html;\54 FILE=$$(PWD)/$(FILE);\ 47 55 URIPREFIX=file://;\ 48 56 if test $(CYGWIN) = yes ; then\ … … 56 64 done 57 65 58 tests/index.html: 59 echo '<!doctype html>' >>$@ 60 echo '<html>' >>$@ 61 echo '<head>'>>$@ 62 echo '<meta name="%24mod.DEBUG" content="false">' >>$@ 63 echo '<title>$(PROJECT)</title>' >>$@ 64 echo -n '<script type="text/javascript"' >>$@ 65 echo -n ' src="../lib/dollar-mod.js">'>>$@ 66 echo '</script>'>>$@ 67 echo '<script type="text/javascript">' >>$@ 68 echo >>$@ 69 echo '$$mod.withModule("site.pathconfig", function(){'>>$@ 70 echo ' $$mod.withModule("KaeL.Test.runtests", function(runtests){' >>$@ 71 echo ' runtests(' >>$@ 66 67 #### 68 runsample: samples/index.html 69 @make runfile FILE=samples/index.html BROWSERS='$(BROWSERS)' 70 71 sample: samples\ 72 drop-sample-harness.js\ 73 samples/index.html\ 74 samples/harness.js 75 76 samples: 77 mkdir $@ 78 79 samples/harness.js: samples 80 echo -n '$$mod.withModule("KaeL.Test.runsamples",' >$@ 81 echo 'function(runsamples){runsamples(' >>$@ 82 find samples -name '*.s.js' \ 83 | sed -e 's/^samples\//.\//;s/^/"/;s/$$/",/;$${s/,$$//}' >>$@ 84 echo ')});' >>$@ 85 86 samples/index.html: samples 87 $(mod) sampleindex $(PROJECT) >$@ 88 89 90 drop-sample-harness.js: 91 rm -f samples/harness.js 92 93 94 #### 95 96 97 test: drop-test-harness.js\ 98 $(TESTS)/index.html\ 99 unittests $(TESTS)/harness.js 100 101 drop-test-harness.js: 102 rm -f $(TESTS)/harness.js 103 104 runtest: 105 @make runfile FILE=$(TESTS)/index.html BROWSERS='$(BROWSERS)' 106 107 $(TESTS)/harness.js: 108 echo -n '$$mod.withModule("KaeL.Test.runtests",' > $@ 109 echo 'function(runtests){ runtests(' >>$@ 72 110 find tests -name \*.t.js \ 73 111 | sed -e 's/^tests\//.\//;s/^/"/;s/$$/",/;$${s/,$$//}' >>$@ 74 echo ');});});' >>$@ 75 echo '</script>' >>$@ 76 echo '</head>' >>$@ 77 echo '<body></body>' >>$@ 78 echo '</html>' >>$@ 112 echo ')});'>>$@ 113 114 $(TESTS)/index.html: 115 $(mod) testindex $(PROJECT) >$@ 79 116 80 117 unittests: TEST.ignore 81 @MODS=` \ 82 BASE=$(LIB)/\`echo $(PROJECT)|sed -e 's/\./\//g'\`; \ 83 find $$BASE -name '*.js' \ 118 MODS=` \ 119 BASE=$(LIB)/\`echo $(PROJECT)|sed -e 's/\./\//g'\`; \ 120 find $$BASE -name "*.js" \ 121 |grep -v '\.m4\.' \ 84 122 |sed -e 's/^lib\///; s/\.js$$//;s/\//./g' \ 85 123 `; \ … … 96 134 TESTTTARGET= 97 135 unittest: 98 @T=$(TESTS)/$(TESTTARGET).t.js;\ 99 LOCAL=`echo $(TESTTARGET)|sed -e 's/\([^.]*\.\)*\([^.]*\)$$/\2/'`;\ 100 echo 'creating '$$T'...';\ 101 echo '$$mod.withModule( "KaeL.Test.MORE",' >$$T;\ 102 echo ' "$(TESTTARGET)",' >>$$T;\ 103 echo ' function(TEST,' >>$$T;\ 104 echo ' '$$LOCAL'){' >>$$T;\ 105 echo ' with(TEST){' >>$$T;\ 106 echo ' plan({tests: null});' >>$$T;\ 107 echo ' begin(function(end){' >>$$T;\ 108 echo ' ' >>$$T;\ 109 echo ' end();' >>$$T;\ 110 echo ' })' >>$$T;\ 111 echo ' }' >>$$T;\ 112 echo '});' >>$$T 136 dolmod unittest $(TESTTARGET) >$(TESTS)/$(TESTTARGET).t.js; 137 138 #################### 139 140 runweb: 141 make runfile FILE=web/index.html 142 143 web: 144 mkdir web 145 mkdir web/css 146 mkdir web/lib 147 mkdir web/pub 148 make update-web 149 150 update-web: web archive install apidoc 151 dolmod webindex $(PROJECT) >web/index.html 152 dolmod webcss >web/css/web.css 153 for f in samples tests doc; do\ 154 if test -d $$f ;then \ 155 find $$f -type f|grep -v '/\.svn'|xargs tar -cO|tar -C web -xv;\ 156 fi;\ 157 done 158 cd web; $(mod) libs - $(PROJECT) 159 cd web; $(mod) pathconfig 160 161 162 apidoc: 163 rm -fr doc 164 if ! test -d doc; then mkdir doc; fi 165 $(mod) apiindex $(PROJECT) >doc/index.html 166 for f in \ 167 `find lib -type f -name '*.js'|xargs grep -sle '=head1 NAME'`; do\ 168 name=`echo $$f\ 169 |sed -e 's/\(\.[a-zA-Z0-9]*\)*$$//'\ 170 |sed -e 's/lib\///'\ 171 |sed -e 's/\//./g'`;\ 172 pod2xml $$f > doc/$$name.xml;\ 173 done 174 make doc/harness.js 175 176 doc/harness.js: samples 177 echo -n '$$mod.withModule("KaeL.Test.rundoc",' >$@ 178 echo 'function(runsamples){runsamples(' >>$@ 179 find doc -name '*.xml' \ 180 | sed -e 's/^doc\//.\//;s/^/"/;s/$$/",/;$${s/,$$//}' >>$@ 181 echo ')});' >>$@ -
lang/javascript/dollar-mod.js/dolmod/trunk/templates/coMake.mk
r27499 r29022 1 1 WORKDIR= 2 RESOURCES=rsc ext 2 RESOURCES=rsc ext scripts css templates 3 3 4 4 all: … … 6 6 archive: 7 7 for f in $(RESOURCES);do \ 8 if test - f$$f ; then \8 if test -x $$f ; then \ 9 9 cp -a $$f $$WORKDIR; \ 10 10 fi; \ … … 13 13 dist: 14 14 for f in $(RESOURCES);do \ 15 if test - f$$f ; then \15 if test -x $$f ; then \ 16 16 cp -a $$f $WORKDIR; \ 17 17 fi; \ -
lang/javascript/dollar-mod.js/dolmod/trunk/tests/dollar-mod/ModuleDriver.t.js
r27649 r29022 46 46 }); 47 47 }, function(){ 48 return GLOB.fuga;48 return !!GLOB.fuga; 49 49 }, function(){ 50 50 eq(GLOB.fuga, 'hoge.fuga'); … … 92 92 93 93 },function(){ 94 return GLOB.ev;94 return !!GLOB.ev 95 95 }, function(){ 96 96 -
lang/javascript/dollar-mod.js/dolmod/trunk/tests/index.html
r27649 r29022 3 3 <html lang=ja> 4 4 <head> 5 <meta http-equiv="Content-Type" content="text/html;charset=EUC-JP">6 <meta name="$mod. DEBUG" content="false">5 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 6 <meta name="$mod.pathconfig" content="site.pathconfig"> 7 7 <title>dollar-mod.js</title> 8 8 <script type="text/javascript" src="../lib/dollar-mod.js"></script> 9 <script type="text/javascript"> 10 //$mod.logTime('start'); 11 $mod.withModule('site.pathconfig',function(){ 12 //$mod.logTime('pathconfig'); 13 $mod.withModule('KaeL.Test.runtests', function(runtests){ 14 //$mod.logTime('runTests'); 15 runtests( 16 17 'dollar-mod/Module.t.js', 18 'dollar-mod/PathResolver.t.js', 19 'dollar-mod/ModuleStore.t.js', 20 'dollar-mod/ModuleLoader.t.js', 21 'dollar-mod/ModuleDriver.t.js' 22 23 ); 24 }); 25 }); 26 </script> 9 <link rel="$mod.path.testlib" href="."> 10 <link rel="$mod.main" href="harness.js"> 27 11 </head> 28 12 <body>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)