<commit_before>/*
 * grunt-qiniu-deploy
 * https://github.com/chenboxiang/grunt-qiniu-deploy
 *
 * Copyright (c) 2014 chenboxiang
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

    // Please see the Grunt documentation for more information regarding task
    // creation: http://gruntjs.com/creating-tasks

    var qn = require('qn');
    var glob = require('glob');
    var async = require('async');
    var path = require('path');

    grunt.registerMultiTask('qiniu', 'qiniu upload grunt task', function() {
        var done = this.async();

        // ----------- normalize config
        var options = this.options({
            domain: 'http://{bucket}.qiniudn.com',
            // 1分钟
            timeout: 60 * 1000,
            /**
             * 生成qiniu上的存储路径(key)
             *
             * @param cwd
             * @param file
             */
            keyGen: function(cwd, file) {
                return file;
            }
        });

        if (!options.accessKey || !options.secretKey || !options.bucket || !options.resources) {
            grunt.fail.fatal('accessKey, secretKey, bucket and resources are all required!');
        }<commit_msg>替换掉domain中的{bucket}<commit_after>/*
 * grunt-qiniu-deploy
 * https://github.com/chenboxiang/grunt-qiniu-deploy
 *
 * Copyright (c) 2014 chenboxiang
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

    // Please see the Grunt documentation for more information regarding task
    // creation: http://gruntjs.com/creating-tasks

    var qn = require('qn');
    var glob = require('glob');
    var async = require('async');
    var path = require('path');

    grunt.registerMultiTask('qiniu', 'qiniu upload grunt task', function() {
        var done = this.async();

        // ----------- normalize config
        var options = this.options({
            domain: 'http://{bucket}.qiniudn.com',
            // 1分钟
            timeout: 60 * 1000,
            /**
             * 生成qiniu上的存储路径(key)
             *
             * @param cwd
             * @param file
             */
            keyGen: function(cwd, file) {
                return file;
            }
        });

        if (!options.accessKey || !options.secretKey || !options.bucket || !options.resources) {
            grunt.fail.fatal('accessKey, secretKey, bucket and resources are all required!');
        }
        // 替换掉domain中的bucket
        options.domain = options.domain.replace('{bucket}', options.bucket);

{'fraction_non_alphanumeric': 0.1391407173827355, 'fraction_numerical': 0.008671659440283799, 'mean_word_length': 1.8972602739726028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1420646', 'n_tokens_mistral': 776, 'n_tokens_neox': 740, 'n_words': 170}