bin/pave in pave-0.2.2 vs bin/pave in pave-0.3.0

- old
+ new

@@ -10,12 +10,12 @@ default_command :help command :new do |c| c.syntax = "pave new APP_PATH [options]" c.description = "Create a new Concrete5 project." - c.action do |args, options| - Pave::Concrete.create(args.first, options) + c.action do |args| + Pave::Concrete.create(args.first) end end command :update do |c| c.syntax = "pave update" @@ -25,129 +25,124 @@ end end command :setup do |c| c.syntax = "pave setup APP_PATH" - c.description = "Setup app folder for project." + c.description = "Setup folders for project." c.action do |args| - name = args.first || Dir.getwd - Pave::Concrete.new(name).set_up_app_folder + name = args.first || Dir.pwd + Pave::Concrete.new(name).set_up_folders end end alias_command :"setup:app", :setup command :"setup:git" do |c| c.syntax = "pave setup:git APP_PATH" c.description = "Setup git repo for project." c.action do |args| - name = args.first || Dir.getwd - Pave::Concrete.new(name).initialize_git + name = args.first || Dir.pwd + Pave::Concrete.new(name).set_up_git end end -command :"setup:symlinks" do |c| - c.syntax = "pave setup:symlinks APP_PATH" - c.description = "Setup app folder symlinks for project." - c.action do |args| - name = args.first || Dir.getwd - Pave::Concrete.new(name).symlink_folders - end -end - command :"setup:permissions" do |c| c.syntax = "pave setup:permissions APP_PATH" c.description = "Setup folder permissions for project." c.action do |args| - name = args.first || Dir.getwd + name = args.first || Dir.pwd Pave::Concrete.new(name).modify_folder_permissions end end alias_command :"setup:chmod", :"setup:permissions" command :"setup:clean" do |c| c.syntax = "pave setup:cleanup APP_PATH" c.description = "Remove unused folders from project." c.action do |args| - name = args.first || Dir.getwd + name = args.first || Dir.pwd Pave::Concrete.new(name).remove_extra_folders end end alias_command :"setup:cleanup", :"setup:clean" command :"virtualhost:create" do |c| c.syntax = "pave virtualhost:create VHOST" c.description = "Setup virtual host for Concrete5 project." c.action do |args| - Pave::VirtualHost.new(args.first).create_vhost + host = args.first || "#{File.basename(Dir.pwd)}.site" + Pave::VirtualHost.new(host).create_vhost end end alias_command :"vh:create", :"virtualhost:create" command :"virtualhost:remove" do |c| c.syntax = "pave virtualhost:remove VHOST" c.description = "Delete virtual host." c.action do |args| - Pave::VirtualHost.new(args.first).remove_vhost + host = args.first || "#{File.basename(Dir.pwd)}.site" + Pave::VirtualHost.new(host).remove_vhost end end alias_command :"vh:remove", :"virtualhost:remove" alias_command :"virtualhost:delete", :"virtualhost:remove" alias_command :"vh:delete", :"virtualhost:remove" command :"virtualhost:backup" do |c| - c.syntax = "pave virtualhost:backup VHOST" + c.syntax = "pave virtualhost:backup" c.description = "Back up virtual hosts file. Restore with `pave virtualhost:restore`." - c.action do |args| - Pave::VirtualHost.new(args.first).backup_vhost + c.action do + Pave::VirtualHost.new("").backup_vhost end end alias_command :"vh:backup", :"virtualhost:backup" command :"virtualhost:restore" do |c| - c.syntax = "pave virtualhost:restore VHOST" + c.syntax = "pave virtualhost:restore" c.description = "Restore previously backed up virtual hosts file." - c.action do |args| - Pave::VirtualHost.new(args.first).restore_vhost + c.action do + Pave::VirtualHost.new("").restore_vhost end end alias_command :"vh:restore", :"virtualhost:restore" command :"virtualhost:restart" do |c| - c.syntax = "pave virtualhost:restart VHOST" + c.syntax = "pave virtualhost:restart" c.description = "Restarts apache." - c.action do |args| - Pave::VirtualHost.new.restart_apache + c.action do + Pave::VirtualHost.new("").restart_apache end end alias_command :"vh:restart", :"virtualhost:restart" command :"db:create" do |c| - c.syntax = "pave db:create" + c.syntax = "pave db:create DATABASE" c.description = "Create the Concrete5 project's database." c.action do |args| - say "`db:create` command not implemented yet." + name = args.first || "#{File.basename(Dir.pwd)}" + Pave::Database.create(name) end end command :"db:dump" do |c| - c.syntax = "pave db:dump" - c.description = "Create SQL dump of the Concrete5 project's database." + c.syntax = "pave db:dump DATABASE" + c.description = "Create SQL dump of the project's database." c.action do |args| - say "`db:dump` command not implemented yet." + name = args.first || "#{File.basename(Dir.pwd)}" + Pave::Database.new(name).dump end end command :"db:download" do |c| c.syntax = "pave db:download" - c.description = "Download the Concrete5 project's live database and replace local database." + c.description = "Download the project's live database and replace local database." c.action do |args| say "`db:download` command not implemented yet." end end command :"db:upload" do |c| c.syntax = "pave db:upload" - c.description = "Upload the Concrete5 project's local database and replace the live database." + c.description = "Upload the project's local database and replace the live database." c.action do |args| say "`db:upload` command not implemented yet." end end