Sha256: 99c70651fb1c415066e696932cd53efd36d07e029991c01b614a1292a3de7ef6
Contents?: true
Size: 1.49 KB
Versions: 2
Compression:
Stored size: 1.49 KB
Contents
module ExtJS module MVC module Generator class App < Base def initialize(name, namespace=nil) @name = name @namespace = namespace || Extlib::Inflection.camelize(name) end def generate! if File.exists?(@name) raise ExtJS::MVC::AppAlreadyExists.new("An app named #{@name} already exists") end FileUtils.mkdir(@name) Dir["#{TEMPLATE_PATH}/app/*"].each do |f| FileUtils.cp_r(f, @name) end FileUtils.cp_r("#{ExtJS::MVC::ROOT}/js", "#{@name}/vendor") FileUtils.mv("#{@name}/vendor/js", "#{@name}/vendor/mvc") show_files # Build assets. ExtJS::MVC::BuilderManager.dispatch(:setup, { :asset_root => File.expand_path('.', @name) }) end private def notify(f) @re ||= Regexp.new("#{@name}\/(.*)") ExtJS::MVC.ui.confirm(" create #{f.match(@re)[1]}") end def show_files Dir["#{@name}/*"].reject {|dir| dir.match(/public|vendor/) ? true : false }.each do |dir| Dir["#{dir}/**/*.*"].each do |f| notify(f) end end Dir["#{@name}/vendor/*"].each do |f| notify(f) end Dir["#{@name}/public/*"].each do |f| notify(f) end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
extjs-mvc-0.4.0.b | lib/extjs-mvc/generators/app.rb |
extjs-mvc-0.4.0.a | lib/extjs-mvc/generators/app.rb |