meta_project 0.4.8 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,11 @@
1
1
  = MetaProject Changelog
2
2
 
3
+ == Version 0.4.9
4
+
5
+ This release makes the validation of Browser objects more robust.
6
+
7
+ * Moved Browser spec attributes to validating setters.
8
+
3
9
  == Version 0.4.8
4
10
 
5
11
  This release fixes some bugs with XForge (RubyForge) Rake tasks.
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = MetaProject 0.4.8
1
+ = MetaProject 0.4.9
2
2
 
3
3
  MetaProject (formerly XForge) is a library that allows interaction with various project hosting servers, issue trackers, SCMs and SCM browsers through a common API.
4
4
 
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ require 'rake/rdoctask'
24
24
  #
25
25
  # REMEMBER TO KEEP PKG_VERSION IN SYNC WITH THE CHANGES FILE!
26
26
  PKG_NAME = "meta_project"
27
- PKG_VERSION = "0.4.8"
27
+ PKG_VERSION = "0.4.9"
28
28
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
29
29
  PKG_FILES = FileList[
30
30
  '[A-Z]*',
@@ -15,20 +15,46 @@ module MetaProject
15
15
  # * previous_revision
16
16
  #
17
17
  def initialize(dir_spec=nil, history_spec=nil, raw_spec=nil, html_spec=nil, diff_spec=nil, child_dirs_pattern=nil, child_files_pattern=nil)
18
- @dir_spec, @history_spec, @raw_spec, @html_spec, @diff_spec, @child_dirs_pattern, @child_files_pattern = dir_spec, history_spec, raw_spec, html_spec, diff_spec, child_dirs_pattern, child_files_pattern
19
-
20
- # TODO: move to setters. maybe create a spec class?
21
- validate_presence_of("dir_spec", @dir_spec, "path")
22
- validate_presence_of("history_spec", @history_spec, "path")
23
- validate_presence_of("raw_spec", @raw_spec, "path")
24
- validate_presence_of("raw_spec", @raw_spec, "revision")
25
- validate_presence_of("html_spec", @html_spec, "path")
26
- validate_presence_of("html_spec", @html_spec, "revision")
18
+ self.dir_spec = dir_spec unless dir_spec.nil?
19
+ self.history_spec = history_spec unless history_spec.nil?
20
+ self.raw_spec = raw_spec unless raw_spec.nil?
21
+ self.html_spec = html_spec unless html_spec.nil?
22
+ self.diff_spec = diff_spec unless diff_spec.nil?
23
+
24
+ @child_dirs_pattern = child_dirs_pattern
25
+ @child_files_pattern = child_files_pattern
26
+ end
27
+
28
+ def dir_spec=(spec)
29
+ validate_presence_of("dir_spec", spec, "path")
30
+ @dir_spec = spec
31
+ end
32
+
33
+ def history_spec=(spec)
34
+ validate_presence_of("history_spec", spec, "path")
35
+ @history_spec = spec
36
+ end
37
+
38
+ def raw_spec=(spec)
39
+ validate_presence_of("raw_spec", spec, "path")
40
+ validate_presence_of("raw_spec", spec, "revision")
41
+ @raw_spec = spec
42
+ end
43
+
44
+ def html_spec=(spec)
45
+ validate_presence_of("html_spec", spec, "path")
46
+ validate_presence_of("html_spec", spec, "revision")
47
+ @html_spec = spec
48
+ end
49
+
50
+ def diff_spec=(spec)
51
+ validate_presence_of("diff_spec", spec, "revision")
52
+ # Can't assume path and previous_revision to be present (Trac doesn't use them)
27
53
  #validate_presence_of("diff_spec", @diff_spec, "path")
28
- validate_presence_of("diff_spec", @diff_spec, "revision")
29
54
  #validate_presence_of("diff_spec", @diff_spec, "previous_revision")
55
+ @diff_spec = spec
30
56
  end
31
-
57
+
32
58
  def dir(path)
33
59
  file_uri(path, nil, @dir_spec, nil)
34
60
  end
@@ -71,13 +97,8 @@ module MetaProject
71
97
 
72
98
  def validate_presence_of(spec_name, spec, var)
73
99
  raise "Missing \#{#{var}} in #{spec_name}: '#{spec}'" unless spec =~ /\#\{#{var}\}/
74
- end
100
+ end
75
101
 
76
- # Returns the file URI for +path+. Valid options are:
77
- #
78
- # * :type => ["dir"|"html"|"diff"|"raw"]
79
- # * :revision
80
- # * :previous_revision
81
102
  def file_uri(path, revision, spec, previous_revision)
82
103
  begin
83
104
  eval("\"#{spec}\"", binding)
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: meta_project
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.8
6
+ version: 0.4.9
7
7
  date: 2005-09-06 00:00:00 -04:00
8
8
  summary: Ruby based make-like utility.
9
9
  require_paths: