示例#1
0
def doc():
    puke.display.header("Documenting")

    source = puke.find("src")
    destination = puke.fs.join(yawner.paths().tmp, 'doc')
    replace = yawner.replacer()
    puke.copy(source, destination, replace=replace)

    Helpers.doc(
        destination, "bower_components/ink-docstrap/template/", yawner.paths().doc)
示例#2
0
def tests_build():
    puke.display.header("Testygryfing")

    # ============================
    # Build tests
    # ============================
    replace = yawner.replacer()

    list = puke.find(yawner.paths().tests,
                     filter="*.js,*.html,*.css", exclude="*xxx*")
    puke.copy(
        list, puke.fs.join(yawner.paths().build, 'tests'), replace=replace)
示例#3
0
    def deployer(self, src, filter="", exclude="", withversion=False, destination=False):
        list = puke.find(src, filter=filter, exclude=exclude)
        dist = self.config.paths.dist
        if withversion and dist != 'dist':
            v = self.config.package.version.split('-').pop(0).split('.')
            d = puke.fs.join(
                dist, self.config.package.name, "%s.%s" % (v[0], v[1]))
        else:
            d = dist

        if destination:
            d = puke.fs.join(d, destination)

        puke.copy(list, d)
示例#4
0
def hint(files):
    if isinstance(files, str):
        files = puke.find(files, filter="*.js", exclude="*-min.js")

    h = jsHint()
    try:
        h.go(files)
    except Exception as e:
        return e.stderr or e.stdout

    h = gjsLint()
    try:
        h.go(files)
    except Exception as e:
        return e.stderr or e.stdout

    return ""
示例#5
0
def tidy(files):
    if isinstance(files, str):
        files = puke.find(files, filter="*.js", exclude="*-min.js")

    h = fixJsStyle()
    try:
        h.go(files)
    except Exception as e:
        return e.stderr or e.stdout

    h = fixMyJs()
    try:
        h.go(files)
    except Exception as e:
        return e.stderr or e.stdout

    return ""
示例#6
0
 def stats(path, exclude=''):
     list = puke.find(
         path, filter="*.js", exclude="*-min.js,%s" % exclude)
     puke.display.header("Javascript")
     puke.utils.stats(list)
     list = puke.find(path, filter="*-min.js", exclude="%s" % exclude)
     puke.display.header("Minified javascript")
     puke.utils.stats(list)
     list = puke.find(
         path, filter="*.css", exclude="*-min.css,%s" % exclude)
     puke.display.header("Css")
     puke.utils.stats(list)
     list = puke.find(
         path, filter="*-min.css", exclude="%s" % exclude)
     puke.display.header("Minified css")
     puke.utils.stats(list)
     list = puke.find(
         path, filter="*.html,*.xml,*.tpl,*.txt", exclude="%s" % exclude)
     puke.display.header("(ht|x)ml, tpl, txt")
     puke.utils.stats(list)
     list = puke.find(
         path, exclude="*.html,*.xml,*.tpl,*.txt,*.js,*.css,%s" % exclude)
     puke.display.header("Other")
     puke.utils.stats(list)
示例#7
0
def build():
    puke.display.header("Building")

    # source = puke.find("src")
    destination = yawner.paths().build
    replace = yawner.replacer()

    # Mini tiojs
    puke.combine(
        ['bower_components/spitfire.js/dist/gulliver.js',
            'src/onegateisopening/b.js'],
        puke.fs.join(destination, "t.i.o.j.js"), replace=replace)

    puke.copy(
        puke.find('src', filter="*index.html,*miniboot*,*assets*"), destination)

    # There is only
    spitfireList = [
        'src/strict.js',
        'bower_components/spitfire.js/dist/spitfire-lab.js',
        'src/onegateisopening/boot.js',
        'src/gister/packman.js'
    ]
    puke.combine(spitfireList, puke.fs.join(
        destination, "there.is.only.jsboot.js"), replace=replace)

    # There is only.css
    puke.fs.copyfile('bower_components/spitfire.js/dist/burnscars.css',
                     puke.fs.join(destination, "there.is.only.jsboot.css"))

    # ================================
    # Build-up the gate framy
    # ================================
    # XXX this must die and be replaced by a proper postmessage shim
    gateList = [
        'src/strict.js',
        'bower_components/spitfire.js/dist/spitfire-lab.js',
        'src/mingus/postmessage.js',
        'src/onegateisopening/gate.js'
    ]

    puke.combine(gateList, puke.fs.join(
        destination, 'toobsj.ylno.si.ereht.js'), replace=replace)

    shortversion = yawner.config.version.split('.')
    shortversion = shortversion[0] + "." + shortversion[1]

    # Build-up the frame to deploy connect to
    # XXX whether this works is undefined... because of shortversion and
    # selectable versioned deploy

    replace.add('{PUKE-GATE-OPENER}', puke.fs.join(
        yawner.config.config.self, yawner.config.name, shortversion, "toobsj.ylno.si.ereht.js"))
    puke.combine('src/onegateisopening/gate.html',
                 puke.fs.join(destination, 'gate.html'), replace=replace)

    # ================================
    # Standalone mingus
    # ================================
    mingusList = [
        # Have postmessage shit
        'src/mingus/postmessage.js',
        # Better safe than sorry - always include that
        # "src/lib/com/wiu/mingus/shim-plus/console.js",
        # "src/lib/com/wiu/mingus/shim-plus/cookies.js",
        # "src/lib/com/wiu/mingus/shim-plus/string.js",
        # "src/lib/com/wiu/mingus/shim-plus/iegetset.js",
        #      "src/lib/com/wiu/mingus/shim/postmessage.js",
        # Mingus NS
        "src/mingus/namespace.js",
        # Base dep
        "src/mingus/grammar/ABNF.js",
        # "src/lib/com/wiu/mingus/converters/entity.js",
        # "src/lib/com/wiu/mingus/converters/bencoder.js",
        # "src/lib/com/wiu/mingus/converters/wikimedia.js",
        # And parsers / grammars
        "src/mingus/grammar/IMF.js",
        "src/mingus/grammar/IRI.js",
        "src/mingus/grammar/HTTP.js",

        # Then md5 dep
        "src/mingus/crypto/md5.js",


        # Not necessary per-se, but darn useful
        "src/mingus/converters/entity.js",

        # Then bases
        "src/mingus/xhr/ungate.js",
        "src/mingus/xhr/appkey.js",
        "src/mingus/xhr/digest.js",
        # Then the final XHR
        "src/mingus/xhr/appkeydigestxhr.js"
    ]

    # Shimmy yeah
    puke.combine(mingusList, puke.fs.join(
        destination, "mingus.js"), replace=replace)

    # ================================
    # jsBoot modules
    # ================================
    list = puke.find('src/jsboot/debug', filter='*.js')
    puke.combine(list, puke.fs.join(destination, "debug.js"), replace=replace)

    # list = FileList('src/jsboot/gister', filter = '*.js')
    list = puke.find('src/jsboot/core', filter='*.js')
    # list.merge(FileList('src/jsboot/gister', filter = '*.js'));
    list.merge(['src/jsboot/types/eventdispatcher.js'])

    # Not exactly "core" per-se
    list.merge(['src/jsboot/types/mutable.js'])
    list.merge(['src/jsboot/controllers/idle.js'])
    list.merge(['src/jsboot/controllers/singleapp.js'])
    list.merge(['src/jsboot/utils/storage.js'])
    list.merge(['src/jsboot/utils/tweener.js'])

    puke.combine(list, puke.fs.join(destination, "core.js"), replace=replace)

    list = [
        'src/jsboot/service/errors.js',
        'src/jsboot/service/client.js',
        'src/jsboot/service/core.js',
        'src/jsboot/service/flaves/account.js',
        'src/jsboot/controllers/application.js'
    ]

    puke.combine(
        list, puke.fs.join(destination, "service.js"), replace=replace)

    list = puke.find('src/jsboot/ui', filter='*.js')
    puke.combine(list, puke.fs.join(destination, "ui.js"), replace=replace)
示例#8
0
 def mint(path, filter='', exclude='', mode=puke.web.STRICT):
     list = puke.find(
         path, filter=filter, exclude="*-min.js,*-min.css,%s" % exclude)
     for burne in list:
         puke.web.minify(
             burne, re.sub(r"(.*)[.]([^.]+)$", r"\1-min.\2", burne), mode=mode)