ktec-subtrac 0.1.54 → 0.1.55

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: 54
3
+ :patch: 55
4
4
  :major: 0
data/bin/subtrac CHANGED
@@ -21,14 +21,6 @@ command :install do |c|
21
21
  end
22
22
 
23
23
  command :create do |c|
24
- c.syntax = 'subtrac create [options]'
25
- c.summary = 'Provides access to subtrac create menu.'
26
- c.description = 'Provides access to subtrac create menu.'
27
- c.example 'subtrac create', 'Provides access to subtrac create menu.'
28
- c.when_called Subtrac::Commands::Create
29
- end
30
-
31
- command :create_project do |c|
32
24
  c.syntax = 'subtrac create_project [options]'
33
25
  c.summary = 'Creates a new Subversion repository and associated Trac site for to specified project and client.'
34
26
  c.description = 'Creates a new Subversion repository and associated Trac site for the specified project and client.'
@@ -0,0 +1,9 @@
1
+ module Subtrac
2
+ module Commands
3
+ class Create
4
+ def initialize(args, options)
5
+ Subtrac.create_project(options.project,options.client,options.template)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,7 +1,7 @@
1
1
  module Subtrac
2
2
  module Commands
3
3
  autoload :Install, "subtrac/commands/install"
4
- autoload :Create, "subtrac/commands/create"
5
4
  autoload :CreateTemplate, "subtrac/commands/create_template"
5
+ autoload :CreateProject, "subtrac/commands/create_project"
6
6
  end
7
7
  end
@@ -26,6 +26,9 @@ development: &non_production_settings
26
26
  :bind_dn:
27
27
  :bind_passwd:
28
28
 
29
+ :smtp:
30
+ :enable: false
31
+
29
32
  :trac:
30
33
  :permissions:
31
34
  admins: TRAC_ADMIN
@@ -268,6 +268,16 @@ module Subtrac
268
268
  @data[:ldap][:bind_passwd] = @ldap_bind_passwd = value
269
269
  end
270
270
 
271
+
272
+ # SMTP
273
+ def enable_smtp
274
+ @enable_smtp ||= @data[:smtp][:enable]
275
+ end
276
+
277
+ def enable_smtp=(value)
278
+ @data[:smtp][:enable] = @enable_smtp = value
279
+ end
280
+
271
281
  end
272
282
 
273
283
  end
data/lib/subtrac.rb CHANGED
@@ -110,17 +110,38 @@ module Subtrac
110
110
  configure_admin_user()
111
111
 
112
112
  # create default project
113
- create_project(Config.default_project,Config.default_client)
113
+ create_project(Config.default_project,Config.default_client,"blank")
114
114
 
115
115
  # store any user preferences for later use
116
116
  Config.save()
117
117
 
118
118
  end
119
119
 
120
- def create_project(project,client,template="blank")
120
+ def create_project(project,client,template=nil)
121
121
 
122
122
  load_config()
123
123
 
124
+ project = ask("What is the name of the project you would like to create? ") if project.nil?
125
+ client = ask("Which client is this project for? ") if client.nil?
126
+ use_custom_template = agree("Would you like to use a custom template for this project? [y/n]") if template.nil?
127
+ if use_custom_template then
128
+ list_of_templates = Dir.entries(File.join(Config.svn_dir,"templates"))
129
+
130
+ # The new and improved choose()...
131
+ #choices = %{#{list_of_templates}} # %w{ruby python perl}
132
+ say("\nThis is the new mode (default)...")
133
+ choose do |menu|
134
+ menu.prompt = "Which template would you like to use for this project? "
135
+ list_of_templates.each do |t|
136
+ unless File.directory?(t)
137
+ menu.choice t do template = t end
138
+ end
139
+ end
140
+ end
141
+ else
142
+ template = "blank"
143
+ end
144
+
124
145
  # create default project
125
146
  project = Project.new(project,client,template)
126
147
 
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.54"
5
+ s.version = "0.1.55"
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"]
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  "lib/subtrac/apache/vhost.conf.erb",
29
29
  "lib/subtrac/client.rb",
30
30
  "lib/subtrac/commands.rb",
31
- "lib/subtrac/commands/create_project.rb",
31
+ "lib/subtrac/commands/create.rb",
32
32
  "lib/subtrac/commands/create_template.rb",
33
33
  "lib/subtrac/commands/install.rb",
34
34
  "lib/subtrac/common/favicon.ico",
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.54
4
+ version: 0.1.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Salisbury
@@ -45,7 +45,7 @@ files:
45
45
  - lib/subtrac/apache/vhost.conf.erb
46
46
  - lib/subtrac/client.rb
47
47
  - lib/subtrac/commands.rb
48
- - lib/subtrac/commands/create_project.rb
48
+ - lib/subtrac/commands/create.rb
49
49
  - lib/subtrac/commands/create_template.rb
50
50
  - lib/subtrac/commands/install.rb
51
51
  - lib/subtrac/common/favicon.ico
@@ -1,29 +0,0 @@
1
- module Subtrac
2
- module Commands
3
- class Create
4
- def initialize(args, options)
5
- options.project = ask("What is the name of the project you would like to create? ") if options.project.nil?
6
- options.client = ask("Which client is this project for? ") if options.client.nil?
7
- use_custom_template = agree("Would you like to use a custom template for this project? [y/n]") if options.template.nil?
8
- if use_custom_template then
9
- Subtrac.load_config()
10
- list_of_templates = Dir.entries(File.join(Config.svn_dir,"templates"))
11
-
12
- # The new and improved choose()...
13
- choose do |menu|
14
- menu.prompt = "Which template would you like to use for this project? "
15
- list_of_templates.each do |t|
16
- unless File.directory?(t)
17
- menu.choice t do options.template = t end
18
- end
19
- end
20
- end
21
-
22
- Subtrac.create_project(options.project,options.client,options.template)
23
- else
24
- Subtrac.create_project(options.project,options.client)
25
- end
26
- end
27
- end
28
- end
29
- end