Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b066b7c523
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (38 sloc) 1.118 kb
Dir["#{File.dirname(__FILE__)}/stencil/*.rb"].each do |path|
require path
end
class Stencil
def initialize(args)
path = Dir.pwd
name = File.basename(path).intern
# If template, do a template merge
if Config.exists?(:templates, path)
Merge.template(path, args.include?('push'))
# If project
elsif Config.exists?(:projects, path)
# If upstream commit, merge upstream
if args.first == '^'
Merge.upstream *args[1..-1].unshift(name) and return
# If template specified, update config
elsif args.first
Config.update(:projects => {
name => {
:template => args.shift,
:branches => args
}
})
end
# Do a project merge
Merge.project(name, path)
# If not configured
else
# Update config
Msg.is_template_or_project?(name)
Config.update((STDIN.gets[0..0].downcase == 't' ? :templates : :projects) => {
name => { :path => path }
})
# Re-run
initialize args
end
end
end
Jump to Line
Something went wrong with that request. Please try again.