bin/uki in uki-1.0.1 vs bin/uki in uki-1.0.2
- old
+ new
@@ -5,11 +5,11 @@
require 'rubygems'
require 'commander/import'
require File.join(UKI_ROOT, 'lib', 'uki')
program :name, 'uki tools'
-program :version, '1.0.0'
+program :version, File.read(File.join(UKI_ROOT, 'VERSION'))
program :description, 'uki development tools'
command :"new project" do |c|
c.syntax = 'uki new project <dest>'
@@ -61,10 +61,44 @@
project.create_class 'model.js', path
say "Model #{path} created"
end
end
+command :'new layout' do |c|
+ c.syntax = 'uki new layout <name>'
+ c.summary = 'Create uki layout'
+ c.description = "Create template for uki layout with given <name>
+ and add include to the project file"
+ c.example "Create myapp.layout.editor()", "uki new layout editor"
+ c.example "Create view in arbitary package", "uki new layout mypackage.editor"
+
+ c.when_called do |args, options|
+ path = args.shift or raise 'Layout name required'
+ project = Uki::Project.new('.')
+ path = "#{project.name}.layout.#{path}"
+ project.create_function 'layout.js', path
+ say "Layout #{path} created"
+ end
+end
+
+command :'new controller' do |c|
+ c.syntax = 'uki new controller <name>'
+ c.summary = 'Create uki controller'
+ c.description = "Create template for uki controller with given <name>
+ and add include to the project file"
+ c.example "Create myapp.controller.editor()", "uki new controller editor"
+ c.example "Create view in arbitary package", "uki new controller mypackage.editor"
+
+ c.when_called do |args, options|
+ path = args.shift or raise 'Controller name required'
+ project = Uki::Project.new('.')
+ path = "#{project.name}.controller.#{path}"
+ project.create_function 'controller.js', path
+ say "Controller #{path} created"
+ end
+end
+
command :run do |c|
c.syntax = 'uki run [host[:port]]'
c.summary = 'Run development server'
c.description = 'Run development server on [host]:[port].
Server can process .cjs calls to merge javascript files.
@@ -94,9 +128,26 @@
c.option '-C', '--nocompiler', 'Disable Google Closure Compiler'
c.when_called do |args, option|
target = args.shift || 'build'
project = Uki::Project.new('.')
project.build target, :compile => !option.nocompiler
- say "Build complete at `#{target}'"
+ say "Build complete at '#{target}'"
end
+end
+
+command :ie_images do |c|
+ c.syntax = 'uki ie_images [file]'
+ c.summary = 'Creates image files for IE6,7'
+ c.description = 'Creates image files for IE6,7 from
+ data urls in the theme file.
+
+ [file] defaults to <project_name>/theme.js
+ '
+ c.when_called do |args, option|
+ project = Uki::Project.new('.')
+ target = args.shift || File.join(project.name, 'theme.js')
+ place = project.ie_images target
+ say "IE images are at #{place}"
+ end
+
end