ktec-subtrac 0.1.56 → 0.1.57

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 1
3
- :patch: 56
3
+ :patch: 57
4
4
  :major: 0
data/bin/subtrac CHANGED
@@ -28,7 +28,7 @@ command :create do |c|
28
28
  c.option '-p','--project PROJECT', 'Name of project to create.'
29
29
  c.option '-c','--client CLIENT', 'Name of client to create the project for.'
30
30
  c.option '-t','--template TEMPLATE', 'Name of template to use when creating the project.'
31
- c.when_called Subtrac::Commands::CreateProject
31
+ c.when_called Subtrac::Commands::Create
32
32
  end
33
33
 
34
34
  command :create_template do |c|
@@ -40,7 +40,6 @@ command :create_template do |c|
40
40
  c.when_called Subtrac::Commands::CreateTemplate
41
41
  end
42
42
 
43
- =begin
44
43
  command :delete do |c|
45
44
  c.syntax = 'subtrac delete [options]'
46
45
  c.summary = ''
@@ -48,6 +47,5 @@ command :delete do |c|
48
47
  c.example 'description', 'deletes an existing project'
49
48
  c.option '--project', 'Name of project to delete'
50
49
  c.option '--client', 'Name of client the project was for'
51
- c.when_called Devserver::Commands::Create
50
+ c.when_called Subtrac::Commands::Delete
52
51
  end
53
- =end
data/lib/subtrac.rb CHANGED
@@ -116,6 +116,50 @@ module Subtrac
116
116
  Config.save()
117
117
 
118
118
  end
119
+
120
+ def delete_project(project,client)
121
+
122
+ load_config()
123
+
124
+ if client
125
+ # test the client exists
126
+ client_exists = Dir.exist?(File.join(Config.svn_dir,client))
127
+ end
128
+
129
+ unless client or client_exists
130
+ list_of_clients = Dir.entries(Config.svn_dir)
131
+ choose do |menu|
132
+ menu.prompt = "Which client contains the project you would like to delete? "
133
+ list_of_clients.each do |t|
134
+ unless File.directory?(t)
135
+ menu.choice t do client = t end
136
+ end
137
+ end
138
+ end
139
+ end
140
+
141
+ if project
142
+ # test the project exists
143
+ project_exists = Dir.exist?(File.join(Config.svn_dir,client,project))
144
+ end
145
+
146
+ unless project or project_exists
147
+ list_of_projects = Dir.entries(File.join(Config.svn_dir,client))
148
+ choose do |menu|
149
+ menu.prompt = "Which client contains the project you would like to delete? "
150
+ list_of_projects.each do |t|
151
+ unless File.directory?(t)
152
+ menu.choice t do project = t end
153
+ end
154
+ end
155
+ end
156
+ end
157
+
158
+ # remove the folder
159
+ puts "Dir.delete(" + File.join(Config.svn_dir,client,project) + ")"
160
+
161
+ end
162
+
119
163
 
120
164
  def create_project(project,client,template=nil)
121
165
 
@@ -1,7 +1,8 @@
1
1
  module Subtrac
2
2
  module Commands
3
3
  autoload :Install, "subtrac/commands/install"
4
+ autoload :Create, "subtrac/commands/create"
5
+ autoload :Delete, "subtrac/commands/delete"
4
6
  autoload :CreateTemplate, "subtrac/commands/create_template"
5
- autoload :CreateProject, "subtrac/commands/create_project"
6
7
  end
7
8
  end
@@ -0,0 +1,9 @@
1
+ module Subtrac
2
+ module Commands
3
+ class Delete
4
+ def initialize(args, options)
5
+ Subtrac.delete_project(options.project,options.client)
6
+ end
7
+ end
8
+ end
9
+ end
data/subtrac.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{subtrac}
5
- s.version = "0.1.56"
5
+ s.version = "0.1.57"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Keith Salisbury"]
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "lib/subtrac/commands.rb",
31
31
  "lib/subtrac/commands/create.rb",
32
32
  "lib/subtrac/commands/create_template.rb",
33
+ "lib/subtrac/commands/delete.rb",
33
34
  "lib/subtrac/commands/install.rb",
34
35
  "lib/subtrac/common/favicon.ico",
35
36
  "lib/subtrac/common/images/trac/banner_bg.jpg",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ktec-subtrac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.56
4
+ version: 0.1.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Salisbury
@@ -47,6 +47,7 @@ files:
47
47
  - lib/subtrac/commands.rb
48
48
  - lib/subtrac/commands/create.rb
49
49
  - lib/subtrac/commands/create_template.rb
50
+ - lib/subtrac/commands/delete.rb
50
51
  - lib/subtrac/commands/install.rb
51
52
  - lib/subtrac/common/favicon.ico
52
53
  - lib/subtrac/common/images/trac/banner_bg.jpg