BuildMaster 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/buildmaster/buildnumber +1 -1
- data/lib/buildmaster/site/template_builder.rb +0 -1
- data/lib/buildmaster/svn_driver.rb +8 -11
- data/lib/buildmaster/templatelets/href.rb +6 -2
- data/test/buildmaster/manifest.mf +1 -1
- data/test/buildmaster/site/tc_template_builder.rb +9 -1
- data/test/buildmaster/tc_source_file_handler.rb +1 -1
- data/test/buildmaster/templatelets/tc_href.rb +8 -1
- data/test/buildmaster/templatelets/tc_when.rb +3 -3
- metadata +2 -2
data/lib/buildmaster/buildnumber
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
15
|
@@ -12,22 +12,19 @@ class SvnInfo
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def analyze_entry_file(path)
|
15
|
-
|
16
|
-
|
17
|
-
xml.root.each_element_with_attribute('name', '', 1) do |element|
|
18
|
-
@repository_root = element.attributes['repos']
|
15
|
+
File.open(path, 'r') do |file|
|
16
|
+
parse_xml_load_repository_root(file)
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
20
|
+
private
|
21
|
+
def parse_xml_load_repository_root(file)
|
22
|
+
xml = REXML::Document.new(file)
|
23
|
+
xml.root.each_element_with_attribute('name', '', 1) do |element|
|
24
|
+
@repository_root = element.attributes['repos']
|
28
25
|
end
|
29
|
-
return buffer.string
|
30
26
|
end
|
27
|
+
|
31
28
|
end
|
32
29
|
|
33
30
|
class SvnDriver
|
@@ -22,7 +22,11 @@ class Href
|
|
22
22
|
def construct_href(url, current_path)
|
23
23
|
href = url
|
24
24
|
if (URI.parse(url).scheme.nil?)
|
25
|
-
|
25
|
+
path = Pathname.new(url)
|
26
|
+
if (not path.relative?)
|
27
|
+
path = path.relative_path_from(Pathname.new('/'))
|
28
|
+
end
|
29
|
+
href = path.relative_path_from(current_path.parent)
|
26
30
|
end
|
27
31
|
return href
|
28
32
|
end
|
@@ -36,4 +40,4 @@ class Href
|
|
36
40
|
end
|
37
41
|
end
|
38
42
|
end
|
39
|
-
end
|
43
|
+
end
|
@@ -77,7 +77,15 @@ class TemplateBuilderTest < Test::Unit::TestCase
|
|
77
77
|
releases.snap_shot_version = 'n/a'
|
78
78
|
releases.download_link = 'download.html'
|
79
79
|
releases.versioning_link = 'versioning.html'
|
80
|
-
builder.generate
|
80
|
+
document = builder.generate
|
81
|
+
assert_equal('Latest Versions', REXML::XPath.first(document, '/html/body/template:when/div[@class="right"]/div/h1').text)
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_should_have_no_release_info_if_not_assigned
|
85
|
+
builder = TemplateBuilder.new
|
86
|
+
builder.releases.download_link = nil
|
87
|
+
document = builder.generate
|
88
|
+
assert_equal(0, REXML::XPath.match(document, '/html/body/template:when/div/*').size)
|
81
89
|
end
|
82
90
|
|
83
91
|
def test_should_read_from_yaml
|
@@ -11,7 +11,7 @@ class SourceFileHandlerTest < Test::Unit::TestCase
|
|
11
11
|
attr_reader :path_info
|
12
12
|
|
13
13
|
def test_should_be_able_to_find_source
|
14
|
-
server = WEBrick::HTTPServer.new
|
14
|
+
server = WEBrick::HTTPServer.new(:Port => 2000)
|
15
15
|
dir = File.dirname(__FILE__)
|
16
16
|
spec = SiteSpec.new
|
17
17
|
spec.template =<<TEMPLATE
|
@@ -43,6 +43,13 @@ class HrefTest < CommonTemplateletTest
|
|
43
43
|
@href.process(@target_element, @template_element, source('download/download.html'))
|
44
44
|
assert_equal('http://www.google.com', @target_element.attributes['src'])
|
45
45
|
end
|
46
|
+
|
47
|
+
def test_should_handle_absolute_path
|
48
|
+
@template_element.attributes['url'] = '/doc.html'
|
49
|
+
@target_element = create_element('img')
|
50
|
+
@href.process(@target_element, @template_element, source('download/download.html'))
|
51
|
+
assert_equal('../doc.html', @target_element.attributes['src'])
|
52
|
+
end
|
46
53
|
|
47
54
|
end
|
48
|
-
end
|
55
|
+
end
|
@@ -45,15 +45,15 @@ CONTENT
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def expression_for_true(path)
|
48
|
-
return
|
48
|
+
return 'word two' =~ /word/
|
49
49
|
end
|
50
50
|
|
51
51
|
def expression_for_false(path)
|
52
|
-
return
|
52
|
+
return 'one word two' =~ /nomatch/
|
53
53
|
end
|
54
54
|
|
55
55
|
def load_templatelets
|
56
56
|
return Hash.new
|
57
57
|
end
|
58
58
|
end
|
59
|
-
end
|
59
|
+
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: BuildMaster
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.8.
|
7
|
-
date: 2006-08-
|
6
|
+
version: 0.8.1
|
7
|
+
date: 2006-08-31 00:00:00 -06:00
|
8
8
|
summary: A project that hosts a series of scripts to be used in project building, project releasing, and site building.
|
9
9
|
require_paths:
|
10
10
|
- lib
|