Sha256: 82c0f5d5e4953d9f17938f447e2d976c72f2b1772320f8a20baa2e4264174bee
Contents?: true
Size: 1.17 KB
Versions: 7
Compression:
Stored size: 1.17 KB
Contents
# encoding: utf-8 require "simple-templater/hooks/preprocess/github" require "simple-templater/hooks/preprocess/full_name" # This hook will be executed before templater start to generate new files. # It runs in context of current generator object. # pupu create mootools --full-name="Jakub Stastny" # --javascripts=mootools-core,mootools-more | --no-javascripts # --stylesheets=one,two | --no-stylesheets # --dependencies=mootools,blueprint | --no-dependencies hook do |generator, context| generator.before Hooks::FullName, Hooks::GithubUser generator.target = "pupu-#{context[:name]}" unless generator.target.match(/^pupu-/) # this is the convention context[:javascripts] = [context[:name]] unless context.has_key?(:javascripts) context[:stylesheets] = [context[:name]] unless context.has_key?(:stylesheets) context[:javascripts] ||= Array.new # will be used when --no-javascripts context[:stylesheets] ||= Array.new context[:dependencies] ||= Array.new context[:github_repository] = generator.target unless context[:github_repository] && context[:github_repository].match(/^pupu-/) context[:github_repository] = "pupu-#{context[:github_repository]}" end end
Version data entries
7 entries across 7 versions & 1 rubygems