svn_wc_tree 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README.rdoc +2 -2
  2. data/bin/svn_wc_tree +61 -32
  3. metadata +5 -7
data/README.rdoc CHANGED
@@ -6,7 +6,7 @@ Subversion (SVN) repository.
6
6
 
7
7
  == VERSION:
8
8
 
9
- Version 0.0.2
9
+ Version 0.0.3
10
10
 
11
11
  NOTE: THIS IS ALPHA QUALITY SOFTWARE, use at your own risk!
12
12
 
@@ -293,7 +293,7 @@ See the ChangeLog file for details.
293
293
  Copyright 2010 David Wright (david_v_wright@yahoo.com), all rights reserved.
294
294
 
295
295
 
296
- svn_wc_tree 0.0.2 is released under the LGPL license.
296
+ svn_wc_tree 0.0.3 is released under the LGPL license.
297
297
 
298
298
 
299
299
  == AUTHOR:
data/bin/svn_wc_tree CHANGED
@@ -83,15 +83,13 @@ opts.each do |opt, arg|
83
83
  when '--help'
84
84
  RDoc::usage
85
85
  when '--html'
86
- if arg == '' then raise ArgumentError, 'path cannot be empty!'
86
+ if arg == '' then puts 'path cannot be empty!' and exit 1
87
87
  else html_dir = arg
88
88
  end
89
89
  when '--cgi'
90
- if arg != '' then cgi_dir = arg end
90
+ if arg != '' then cgi_dir = arg end
91
91
  when '--php'
92
- if arg != ''
93
- php = true
94
- end
92
+ if arg != '' then php = true end
95
93
  when '--post_to_url'
96
94
  #if php then raise ArgumentError, 'post_to_url, is not used when php'
97
95
  if arg != '' then post_to_url = arg end
@@ -151,40 +149,71 @@ def set_cgi_path_in_js(html_dir, post_to_url)
151
149
  end
152
150
 
153
151
  # actions
154
- if html_dir
152
+ if not html_dir
153
+ puts "Required argument missing. try --help"
154
+ exit 0
155
+ end
156
+
157
+ # ok, html_dir should be set
158
+ swt_gem_ins_dir = File.join(File.dirname(__FILE__), '..')
155
159
 
156
- swt_gem_ins_dir = File.join File.dirname(__FILE__), '..'
160
+ puts 'Exception: cannot find this lib gem install path' and exit 1 \
161
+ unless File.directory? swt_gem_ins_dir
157
162
 
163
+ html_dest = File.join(html_dir, 'svn_wc_tree')
164
+ begin
165
+ # copy web app (html related) files
166
+ FileUtils.rm_rf html_dest
167
+ FileUtils.mkdir html_dest
168
+ FileUtils.cp_r(File.join(swt_gem_ins_dir, 'svn_wc_tree/'), html_dir)
169
+ rescue Exception => e
170
+ puts "line:#{__LINE__} Exception: #{e.message}" and exit 1
171
+ end
172
+
173
+ # cgi script
174
+ cgi_path = html_dest if php
175
+ # if set, will overwrite php cgi url
176
+ cgi_path = cgi_dir if cgi_dir
177
+
178
+ if cgi_path
158
179
  begin
159
- # copy web app (html related) files
160
- html_dest = File.join(html_dir, 'svn_wc_tree')
161
- FileUtils.rm_rf html_dest
162
- FileUtils.mkdir html_dest
163
- FileUtils.cp_r(File.join(swt_gem_ins_dir, 'svn_wc_tree/'), html_dir)
164
-
165
- # cgi script
166
- cgi_path = html_dest if php
167
- cgi_path = cgi_dir if cgi_dir # if set, will overwrite php cgi url
168
180
  # copy web app cgi script to web app specified location
169
181
  FileUtils.cp(File.join(swt_gem_ins_dir, 'cgi', 'svn_wc_broker.cgi'), cgi_path)
170
- set_conf_file_in_cgi(cgi_path, conf_location, php) if conf_location
171
-
172
- # edit js/swt.js file to full web accessible CGI URL
173
- set_cgi_path_in_js(html_dest, post_to_url)
182
+ rescue Exception => e
183
+ puts "line:#{__LINE__} Exception: #{e.message}"
184
+ exit 1
185
+ end
186
+ end
174
187
 
175
- # conf file
176
- if move_conf_from or move_conf_to
177
- if not (move_conf_from and move_conf_to)
178
- raise ArgumentError, \
179
- 'if using "move_", both move_conf_to and move_conf_from must be set'
180
- end
181
- handle_conf(move_conf_from, move_conf_to, cgi_dir)
188
+ if conf_location
189
+ if cgi_path and conf_location
190
+ begin
191
+ set_conf_file_in_cgi(cgi_path, conf_location, php)
192
+ rescue Exception => e
193
+ puts "line:#{__LINE__} Exception: #{e.message}"
194
+ exit 1
182
195
  end
183
- rescue Exception => e
184
- raise "Exception: #{e.message}"
185
196
  end
186
- else
187
- puts "Required argument missing. try --help"
188
- exit 0
189
197
  end
190
198
 
199
+ begin
200
+ # edit js/swt.js file to full web accessible CGI URL
201
+ set_cgi_path_in_js(html_dest, post_to_url)
202
+ rescue Exception => e
203
+ puts "line:#{__LINE__} Exception: #{e.message}"
204
+ exit 1
205
+ end
206
+
207
+ begin
208
+ # conf file
209
+ if move_conf_from or move_conf_to
210
+ if not (move_conf_from and move_conf_to)
211
+ puts 'if using "move_", both move_conf_to and move_conf_from must be set'
212
+ exit 1
213
+ end
214
+ handle_conf(move_conf_from, move_conf_to, cgi_dir)
215
+ end
216
+ rescue Exception => e
217
+ puts "line:#{__LINE__} Exception: #{e.message}"
218
+ exit 1
219
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Wright
@@ -14,15 +14,13 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-10 00:00:00 -08:00
17
+ date: 2010-03-12 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
21
21
  description: |-
22
- svn_wc_tree aims to provide an Web Application Front End GUI
23
- to a working copy of an remote SVN Repository,
24
- It does not do any sort of repository administration type
25
- operations, just working directory repository management.
22
+ svn_wc_tree provides an Web Application Front End GUI
23
+ to a working copy of an remote SVN Repository.
26
24
  email: david_v_wright@yahoo.com
27
25
  executables:
28
26
  - svn_wc_tree