# Jdl 根据指定目录,扫描内部扩展名为*的所有文件,并输出到jdl.js内,主要用于js测试 创建jdl.gem的初衷是我在给backbone app增加qunit测试的时候,每次都要有很多引用,在app里要写一次,在test里又要写一次,而且每次的相对路径都不一样的,这让人十分恼火...于是... TODO: ## History - 增加生成模板,可以从本地读取(v0.0.4已实现) - 增加-v查看版本,可以从本地读取(v0.0.5已实现) ## Installation Add this line to your application's Gemfile: gem 'jdl' And then execute: $ bundle Or install it yourself as: $ gem install jdl ## Usage ➜ jdl git:(master) ✗ jdl --help import js from directory loader . -p, --path Set options as path -e, --file_ex Set options as file_ex -o, --output Set options as output_name -t, --template t_name Set options as template_name -d. --verbose print debug log -v, --version Show version - '-p' 指定扫描路径 : 默认值 . - '-e' 指定扫描文件的扩展名 : 默认值 js - '-o' 指定输出文件名称 : 默认值 jdl.js - '-t' 指定模板名称 : 默认值 无 - '-d' 是否打印日志 : 默认值 false - '-v' 是否打印版本 : 默认值 无 ### 模板用法 创建t.txt ##item## 生成的文件 ➜ jdl git:(master) ✗ cat jdl.js ./test/collection.js ./test/environment.js ./test/events.js ./test/model.js ./test/noconflict.js ./test/router.js ./test/sync.js ./test/vendor/backbone.js ./test/vendor/jquery.js ./test/vendor/json2.js ./test/vendor/qunit.js ./test/vendor/runner.js ./test/vendor/underscore.js ./test/view.js 测试方法 ruby -Ilib bin/jdl -p . -t t.txt ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request ## License this project is released under the MIT license: http://www.opensource.org/licenses/mit-license.php ## 欢迎fork和反馈 在issue提问或邮件shiren1118@126.com