keithsalisbury-subtrac 0.1.9 → 0.1.11

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
  :major: 0
3
3
  :minor: 1
4
- :patch: 9
4
+ :patch: 11
data/lib/subtrac.rb CHANGED
@@ -291,7 +291,7 @@ module Subtrac
291
291
  # TODO: implement a mask for .svn folders
292
292
  # TODO: refactor /common to the app config
293
293
  FileUtils.cp_r(Dir.glob(File.join(subtrac_path, "common/.")),docs_dir)
294
- FileUtils.cp_r(Dir.glob(File.join(subtrac_path, "shared/.")),File.join(trac_dir, ".shared"))
294
+ FileUtils.cp_r(Dir.glob(File.join(subtrac_path, "shared/.")),create_if_missing(File.join(trac_dir, ".shared")))
295
295
  end
296
296
 
297
297
  def self.create_environment_directories(overwrite=false)
@@ -321,9 +321,22 @@ module Subtrac
321
321
  # create svn+trac directory
322
322
  create_if_missing File.join(svn_dir,client_name)
323
323
  create_if_missing File.join(trac_dir,client_name)
324
+
325
+ # create a project for this clients trac theme
326
+ create_project("trac_theme", client_name,@APP_CONFIG[:default_theme_template])
327
+
328
+ # check the theme project out
329
+ client_theme_dir = File.join(trac_dir,client_name,".theme")
330
+ create_if_missing(client_theme_dir)
331
+ FileUtils.chown_R('www-data', 'www-data', client_theme_dir, :verbose => true) if SUBTRAC_ENV != 'test'
332
+ puts "Attempting checkout of theme project..."
333
+
334
+ `sudo svn co --username #{@APP_CONFIG[:admin][:username]} --password #{@APP_CONFIG[:admin][:password]} \
335
+ file://#{svn_dir}/#{client_name}/trac_theme/trunk #{client_theme_dir}` if SUBTRAC_ENV != 'test'
336
+
324
337
  end
325
338
 
326
- def self.create_project(project, client)
339
+ def self.create_project(project, client, project_type=@APP_CONFIG[:default_project_template])
327
340
  puts "\n==== Create a new project called #{project} for #{client} ===="
328
341
 
329
342
  client_name = client.downcase
@@ -345,7 +358,7 @@ module Subtrac
345
358
  create_if_missing project_svn_dir
346
359
  create_if_missing project_trac_dir
347
360
 
348
- project_template = File.join(subtrac_path, @APP_CONFIG[:templates][:projects],@APP_CONFIG[:default_project_template])
361
+ project_template = File.join(subtrac_path, @APP_CONFIG[:templates][:projects],project_type)
349
362
 
350
363
  # copy template svn project to a temp folder, then svn import it into the repo
351
364
  say("Create temporary project directory and copy template files...")
@@ -11,6 +11,7 @@ development: &non_production_settings
11
11
  :installation_dir: test
12
12
 
13
13
  :default_project_template: "blank"
14
+ :default_theme_template: "trac_theme"
14
15
  :default_client: "Subtrac"
15
16
  :default_project: "Public"
16
17
  :shared_trac_ini: "shared/trac.ini"
@@ -4,7 +4,7 @@
4
4
  PythonHandler trac.web.modpython_frontend
5
5
  PythonOption TracEnvParentDir <%= trac_dir %>/<%= client_name %>
6
6
  PythonOption TracUriRoot /<%= client_name %>
7
- PythonOption TracEnvIndexTemplate <%= trac_dir %>/<%= client_name %>/trac_theme/htdocs/index/index.html
7
+ PythonOption TracEnvIndexTemplate <%= trac_dir %>/<%= client_name %>/.theme/index/index.html
8
8
  PythonOption PYTHON_EGG_CACHE /tmp
9
9
  </location>
10
10
  <location <%= @APP_CONFIG[:urls][:svn] %>/<%= client_name %>>
@@ -8,15 +8,14 @@
8
8
  <title>Available Projects</title>
9
9
  </head>
10
10
  <body>
11
- <h1>Available Projects</h1>
11
+ <h1>Available Projects for Subtrac</h1>
12
12
  <ul>
13
- <li py:for="project in projects" py:choose="">
14
- <a py:when="project.href" href="$project.href"
15
- title="$project.description">$project.name</a>
16
- <py:otherwise>
17
- <small>$project.name: <em>Error</em> <br /> ($project.description)</small>
18
- </py:otherwise>
19
- </li>
13
+ <py:for each="project in projects" py:choose="">
14
+ <li py:when="project.href">
15
+ <a href="$project.href"
16
+ title="$project.description">$project.name</a>
17
+ </li>
18
+ </py:for>
20
19
  </ul>
21
20
  </body>
22
21
  </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keithsalisbury-subtrac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Salisbury