webby 0.9.3-x86-mswin32 → 0.9.4-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/History.txt +20 -0
  2. data/{README.txt → README.rdoc} +9 -9
  3. data/Rakefile +19 -6
  4. data/examples/blog/content/css/blueprint/ie.css +26 -0
  5. data/examples/blog/content/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  6. data/examples/blog/content/css/blueprint/plugins/buttons/icons/key.png +0 -0
  7. data/examples/blog/content/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  8. data/examples/{website/content/css/blueprint/plugins/buttons/Readme → blog/content/css/blueprint/plugins/buttons/readme.txt} +3 -2
  9. data/examples/{website/content/css/blueprint/plugins/buttons/buttons.css → blog/content/css/blueprint/plugins/buttons/screen.css} +1 -1
  10. data/examples/blog/content/css/blueprint/plugins/fancy-type/readme.txt +14 -0
  11. data/examples/{website/content/css/blueprint/plugins/fancy-type/fancy-type.css → blog/content/css/blueprint/plugins/fancy-type/screen.css} +2 -5
  12. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
  13. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/email.png +0 -0
  14. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/external.png +0 -0
  15. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
  16. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/im.png +0 -0
  17. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  18. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
  19. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
  20. data/examples/blog/content/css/blueprint/plugins/link-icons/readme.txt +18 -0
  21. data/examples/blog/content/css/blueprint/plugins/link-icons/screen.css +40 -0
  22. data/examples/blog/content/css/blueprint/plugins/rtl/readme.txt +10 -0
  23. data/examples/blog/content/css/blueprint/plugins/rtl/screen.css +109 -0
  24. data/examples/blog/content/css/blueprint/print.css +30 -0
  25. data/examples/blog/content/css/blueprint/screen.css +251 -0
  26. data/examples/blog/content/css/blueprint/src/forms.css +49 -0
  27. data/examples/blog/content/css/blueprint/src/grid.css +212 -0
  28. data/examples/{website/content/css/blueprint/lib → blog/content/css/blueprint/src}/grid.png +0 -0
  29. data/examples/blog/content/css/blueprint/src/ie.css +59 -0
  30. data/examples/blog/content/css/blueprint/src/print.css +85 -0
  31. data/examples/{website/content/css/blueprint/lib → blog/content/css/blueprint/src}/reset.css +14 -15
  32. data/examples/blog/content/css/blueprint/src/typography.css +105 -0
  33. data/examples/blog/content/css/coderay.css +111 -0
  34. data/examples/blog/content/css/site.css +67 -0
  35. data/examples/blog/layouts/default.txt +61 -0
  36. data/examples/blog/tasks/blog.rake +5 -1
  37. data/examples/presentation/Sitefile +2 -2
  38. data/examples/tumblog/tasks/tumblog.rake +5 -1
  39. data/examples/webby/Sitefile +2 -2
  40. data/examples/webby/content/communicate/index.txt +2 -2
  41. data/examples/webby/content/index.txt +1 -1
  42. data/examples/webby/content/release-notes/rel-0-9-3/index.txt +0 -2
  43. data/examples/webby/content/release-notes/rel-0-9-4/index.txt +33 -0
  44. data/examples/webby/content/sitemap.txt +2 -2
  45. data/examples/webby/content/user-manual/index.txt +3 -3
  46. data/examples/website/content/css/blueprint/ie.css +26 -0
  47. data/examples/website/content/css/blueprint/plugins/buttons/readme.txt +32 -0
  48. data/examples/website/content/css/blueprint/plugins/buttons/screen.css +97 -0
  49. data/examples/website/content/css/blueprint/plugins/fancy-type/readme.txt +14 -0
  50. data/examples/website/content/css/blueprint/plugins/fancy-type/screen.css +71 -0
  51. data/examples/website/content/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
  52. data/examples/website/content/css/blueprint/plugins/link-icons/icons/email.png +0 -0
  53. data/examples/website/content/css/blueprint/plugins/link-icons/icons/external.png +0 -0
  54. data/examples/website/content/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
  55. data/examples/website/content/css/blueprint/plugins/link-icons/icons/im.png +0 -0
  56. data/examples/website/content/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  57. data/examples/website/content/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
  58. data/examples/website/content/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
  59. data/examples/website/content/css/blueprint/plugins/link-icons/readme.txt +18 -0
  60. data/examples/website/content/css/blueprint/plugins/link-icons/screen.css +40 -0
  61. data/examples/website/content/css/blueprint/plugins/rtl/readme.txt +10 -0
  62. data/examples/website/content/css/blueprint/plugins/rtl/screen.css +109 -0
  63. data/examples/website/content/css/blueprint/print.css +30 -68
  64. data/examples/website/content/css/blueprint/screen.css +251 -22
  65. data/examples/website/content/css/blueprint/src/forms.css +49 -0
  66. data/examples/website/content/css/blueprint/src/grid.css +212 -0
  67. data/examples/website/content/css/blueprint/src/grid.png +0 -0
  68. data/examples/website/content/css/blueprint/src/ie.css +59 -0
  69. data/examples/website/content/css/blueprint/src/print.css +85 -0
  70. data/examples/website/content/css/blueprint/src/reset.css +38 -0
  71. data/examples/website/content/css/blueprint/src/typography.css +105 -0
  72. data/examples/website/layouts/default.txt +5 -2
  73. data/lib/webby.rb +36 -102
  74. data/lib/webby/apps/generator.rb +2 -2
  75. data/lib/webby/apps/main.rb +36 -62
  76. data/lib/webby/auto_builder.rb +3 -3
  77. data/lib/webby/builder.rb +5 -13
  78. data/lib/webby/config.rb +172 -0
  79. data/lib/webby/filters.rb +2 -0
  80. data/lib/webby/filters/haml.rb +13 -0
  81. data/lib/webby/filters/maruku.rb +16 -0
  82. data/lib/webby/filters/outline.rb +1 -1
  83. data/lib/webby/filters/sass.rb +14 -0
  84. data/lib/webby/filters/slides.rb +2 -2
  85. data/lib/webby/filters/tidy.rb +5 -0
  86. data/lib/webby/helpers/coderay_helper.rb +27 -3
  87. data/lib/webby/helpers/graphviz_helper.rb +20 -3
  88. data/lib/webby/helpers/tex_img_helper.rb +25 -5
  89. data/lib/webby/helpers/ultraviolet_helper.rb +19 -5
  90. data/lib/webby/link_validator.rb +59 -51
  91. data/lib/webby/renderer.rb +9 -6
  92. data/lib/webby/resources.rb +2 -1
  93. data/lib/webby/resources/page.rb +4 -1
  94. data/lib/webby/tasks/create.rake +1 -1
  95. data/lib/webby/tasks/validate.rake +1 -1
  96. data/spec/data/html/anchor.html +11 -0
  97. data/spec/data/html/external.html +10 -0
  98. data/spec/data/html/invalid-relative.html +10 -0
  99. data/spec/data/html/relative-anchor.html +10 -0
  100. data/spec/data/html/relative-invalid-anchor.html +10 -0
  101. data/spec/data/html/relative.html +10 -0
  102. data/spec/data/site/tasks/tumblog.rake +5 -1
  103. data/spec/spec_helper.rb +8 -1
  104. data/spec/webby/apps/generator_spec.rb +36 -3
  105. data/spec/webby/apps/main_spec.rb +2 -1
  106. data/spec/webby/filters/basepath_spec.rb +2 -2
  107. data/spec/webby/filters/maruku_spec.rb +31 -0
  108. data/spec/webby/filters/textile_spec.rb +15 -4
  109. data/spec/webby/helpers/capture_helper_spec.rb +1 -1
  110. data/spec/webby/link_validator_spec.rb +154 -0
  111. data/spec/webby/resources/db_spec.rb +24 -24
  112. data/spec/webby/resources/layout_spec.rb +1 -1
  113. data/spec/webby/resources/page_spec.rb +8 -2
  114. data/spec/webby/resources/resource_spec.rb +1 -1
  115. data/spec/webby/resources_spec.rb +1 -1
  116. data/tasks/ann.rake +1 -2
  117. data/tasks/bones.rake +0 -1
  118. data/tasks/gem.rake +48 -34
  119. data/tasks/git.rake +0 -1
  120. data/tasks/mswin32.rake +38 -0
  121. data/tasks/notes.rake +0 -1
  122. data/tasks/post_load.rake +4 -9
  123. data/tasks/rdoc.rake +4 -4
  124. data/tasks/setup.rb +50 -26
  125. data/tasks/spec.rake +1 -2
  126. data/tasks/svn.rake +47 -0
  127. data/tasks/test.rake +40 -0
  128. data/tasks/website.rake +0 -1
  129. data/tasks/zentest.rake +36 -0
  130. metadata +104 -33
  131. data/Manifest.txt +0 -228
  132. data/examples/website/content/css/blueprint/License.txt +0 -21
  133. data/examples/website/content/css/blueprint/Readme.txt +0 -100
  134. data/examples/website/content/css/blueprint/compressed/print.css +0 -76
  135. data/examples/website/content/css/blueprint/compressed/screen.css +0 -696
  136. data/examples/website/content/css/blueprint/lib/forms.css +0 -45
  137. data/examples/website/content/css/blueprint/lib/grid.css +0 -193
  138. data/examples/website/content/css/blueprint/lib/ie.css +0 -30
  139. data/examples/website/content/css/blueprint/lib/typography.css +0 -116
  140. data/examples/website/content/css/blueprint/plugins/css-classes/Readme +0 -14
  141. data/examples/website/content/css/blueprint/plugins/css-classes/css-classes.css +0 -24
  142. data/examples/website/content/css/blueprint/plugins/fancy-type/Readme +0 -22
  143. data/examples/website/content/css/blueprint/plugins/fancy-type/fancy-type-compressed.css +0 -5
  144. data/lib/webby/stelan/spawner.rb +0 -339
  145. data/tasks/manifest.rake +0 -48
@@ -0,0 +1,31 @@
1
+
2
+ require ::File.expand_path(
3
+ ::File.join(::File.dirname(__FILE__), %w[.. .. spec_helper]))
4
+
5
+ # ---------------------------------------------------------------------------
6
+ describe 'Webby::Filters::Maruku' do
7
+
8
+ it 'should regsiter the maruku filter handler' do
9
+ Webby::Filters._handlers['maruku'].should_not be_nil
10
+ end
11
+
12
+ if try_require('maruku')
13
+
14
+ it 'processes maruku markup into HTML' do
15
+ input = "## Heading Two\n\nAnd some text about this heading."
16
+ output = Webby::Filters._handlers['maruku'].call(input)
17
+
18
+ output.should == %Q{<h2 id='heading_two'>Heading Two</h2>\n\n<p>And some text about this heading.</p>}
19
+ end
20
+
21
+ else
22
+
23
+ it 'raises an error when maruku is used but not installed' do
24
+ input = "## Heading Two\n\nAnd some text about this heading."
25
+ lambda {Webby::Filters._handlers['maruku'].call(input)}.should raise_error(Webby::Error, "'maruku' must be installed to use the maruku filter")
26
+ end
27
+
28
+ end
29
+ end
30
+
31
+ # EOF
@@ -9,11 +9,22 @@ describe 'Webby::Filters::Textile' do
9
9
  Webby::Filters._handlers['textile'].should_not be_nil
10
10
  end
11
11
 
12
- it 'processes textile markup into HTML' do
13
- input = "p(foo). this is a paragraph of text"
14
- output = Webby::Filters._handlers['textile'].call(input)
12
+ if try_require('redcloth')
13
+
14
+ it 'processes textile markup into HTML' do
15
+ input = "p(foo). this is a paragraph of text"
16
+ output = Webby::Filters._handlers['textile'].call(input)
17
+
18
+ output.should == %q{<p class="foo">this is a paragraph of text</p>}
19
+ end
20
+
21
+ else
22
+
23
+ it 'raises an error when RedCloth is used but not installed' do
24
+ input = "p(foo). this is a paragraph of text"
25
+ lambda {Webby::Filters._handlers['textile'].call(input)}.should raise_error(Webby::Error, "'RedCloth' must be installed to use the textile filter")
26
+ end
15
27
 
16
- output.should == %q{<p class="foo">this is a paragraph of text</p>}
17
28
  end
18
29
  end
19
30
 
@@ -30,7 +30,7 @@ describe Webby::Helpers::CaptureHelper do
30
30
  ::FileUtils.rm_f(CFN)
31
31
  end
32
32
 
33
- it 'should not "leak" any content to containing page' do
33
+ it 'should not "leak" any content to the containing page' do
34
34
  @page_content.should_not be_nil
35
35
  @page_content.should eql("Hello world!\n")
36
36
  end
@@ -0,0 +1,154 @@
1
+ require File.expand_path(
2
+ File.join(File.dirname(__FILE__), %w[.. spec_helper]))
3
+
4
+ # ---------------------------------------------------------------------------
5
+ describe Webby::LinkValidator do
6
+ before do
7
+ @validator = Webby::LinkValidator.new
8
+ @@old = Webby.site.output_dir
9
+ Webby.site.output_dir = Webby.datapath('html')
10
+ end
11
+
12
+ after do
13
+ Webby.site.output_dir = @@old
14
+ end
15
+
16
+ describe ".validate" do
17
+ it "passes options to a new validator" do
18
+ new_validator = stub('validator', :validate => true)
19
+ Webby::LinkValidator.should_receive(:new).with(:options).and_return(new_validator)
20
+ Webby::LinkValidator.validate(:options)
21
+ end
22
+
23
+ it "checks each file" do
24
+ #TODO: test fake site
25
+ files = ["a file", "another file"]
26
+ Dir.stub!(:glob).and_return(files)
27
+
28
+ validator = Webby::LinkValidator.new
29
+ files.each do |file|
30
+ validator.should_receive(:check_file).with(file)
31
+ end
32
+ validator.validate
33
+ end
34
+ end
35
+
36
+ describe "checking a file" do
37
+ describe "with an anchor" do
38
+ before do
39
+ @filename = Webby.datapath('html', 'anchor.html')
40
+ end
41
+
42
+ it "validates the anchor" do
43
+ @validator.should_receive(:validate_anchor)
44
+ @validator.check_file(@filename)
45
+ end
46
+
47
+ it "does not add the file to the valid uri list" do
48
+ lambda { @validator.check_file(@filename) }.should_not change(@validator.instance_variable_get('@valid_uris'), :size)
49
+ end
50
+
51
+ it "***CURRENTLY*** returns nil" do
52
+ @validator.check_file(@filename).should be_nil
53
+ end
54
+ end
55
+
56
+ describe "with a valid relative href" do
57
+ before do
58
+ @filename = Webby.datapath('html', 'relative.html')
59
+ end
60
+
61
+ it "adds the file to the valid uri list" do
62
+ lambda { @validator.check_file(@filename) }.should change(@validator.instance_variable_get('@valid_uris'), :size).by(1)
63
+ end
64
+
65
+ it "***CURRENTLY*** returns nil" do
66
+ @validator.check_file(@filename).should be_nil
67
+ end
68
+ end
69
+
70
+ describe "with an invalid relative href" do
71
+ before do
72
+ @filename = Webby.datapath('html', 'invalid-relative.html')
73
+ end
74
+
75
+ it "does not add the file to the invalid uri list" do
76
+ lambda { @validator.check_file(@filename) }.should_not change(@validator.instance_variable_get('@valid_uris'), :size)
77
+ end
78
+
79
+ it "***CURRENTLY*** returns nil" do
80
+ @validator.check_file(@filename).should be_nil
81
+ end
82
+ end
83
+
84
+ describe "with a valid relative href that contains an anchor" do
85
+ before do
86
+ @filename = Webby.datapath('html', 'relative-anchor.html')
87
+ end
88
+
89
+ it "adds the file to the valid uri list" do
90
+ lambda { @validator.check_file(@filename) }.should change(@validator.instance_variable_get('@valid_uris'), :size).by(1)
91
+ end
92
+
93
+ it "***CURRENTLY*** returns nil" do
94
+ @validator.check_file(@filename).should be_nil
95
+ end
96
+ end
97
+
98
+ describe "with a valid relative href that contains an invalid anchor" do
99
+ before do
100
+ @filename = Webby.datapath('html', 'relative-invalid-anchor.html')
101
+ end
102
+
103
+ it "does not the file to the valid uri list" do
104
+ lambda { @validator.check_file(@filename) }.should_not change(@validator.instance_variable_get('@valid_uris'), :size)
105
+ end
106
+
107
+ it "***CURRENTLY*** returns nil" do
108
+ @validator.check_file(@filename).should be_nil
109
+ end
110
+ end
111
+
112
+ if $test_externals
113
+ describe "with a valid external href" do
114
+ before do
115
+ FakeWeb.register_uri('http://www.google.com/', :string => 'google')
116
+ @filename = Webby.datapath('html', 'external.html')
117
+ @validator.validate_externals = true
118
+ end
119
+
120
+ it "adds the file to the valid uri list" do
121
+ lambda { @validator.check_file(@filename) }.should change(@validator.instance_variable_get('@valid_uris'), :size).by(1)
122
+ end
123
+
124
+ it "does not add the file to the invalid uri list" do
125
+ lambda { @validator.check_file(@filename) }.should_not change(@validator.instance_variable_get('@invalid_uris'), :size)
126
+ end
127
+
128
+ it "***CURRENTLY*** returns nil" do
129
+ @validator.check_file(@filename).should be_nil
130
+ end
131
+ end
132
+
133
+ describe "with an invalid external href" do
134
+ before do
135
+ FakeWeb.register_uri('http://www.google.com/', :string => 'google', :status => [ 404, "Not Found" ])
136
+ @filename = Webby.datapath('html', 'external.html')
137
+ @validator.validate_externals = true
138
+ end
139
+
140
+ it "does not add the file to the valid uri list" do
141
+ lambda { @validator.check_file(@filename) }.should_not change(@validator.instance_variable_get('@valid_uris'), :size)
142
+ end
143
+
144
+ it "adds the file to the invalid uri list" do
145
+ lambda { @validator.check_file(@filename) }.should change(@validator.instance_variable_get('@invalid_uris'), :size).by(1)
146
+ end
147
+
148
+ it "***CURRENTLY*** returns nil" do
149
+ @validator.check_file(@filename).should be_nil
150
+ end
151
+ end
152
+ end
153
+ end
154
+ end
@@ -7,7 +7,7 @@ describe Webby::Resources::DB do
7
7
 
8
8
  before :each do
9
9
  layout = Webby::Resources::Layout.
10
- new(Webby.datapath %w[site layouts tumblog default.txt])
10
+ new(Webby.datapath(%w[site layouts tumblog default.txt]))
11
11
  Webby::Resources.stub!(:find_layout).and_return(layout)
12
12
 
13
13
  @db = Webby::Resources::DB.new
@@ -53,13 +53,13 @@ describe Webby::Resources::DB do
53
53
  ary = []
54
54
  @db.each {|page| ary << page.url}
55
55
  ary.should == %w[
56
- /tumblog
56
+ /tumblog/
57
57
  /tumblog/rss.xml
58
- /tumblog/200806/the-noble-chicken
59
- /tumblog/200807/historical-perspectives-on-the-classic-chicken-joke
60
- /tumblog/200807/mad-city-chickens
61
- /tumblog/200807/the-wisdom-of-the-dutch
62
- /tumblog/200807/up-a-tree
58
+ /tumblog/200806/the-noble-chicken/
59
+ /tumblog/200807/historical-perspectives-on-the-classic-chicken-joke/
60
+ /tumblog/200807/mad-city-chickens/
61
+ /tumblog/200807/the-wisdom-of-the-dutch/
62
+ /tumblog/200807/up-a-tree/
63
63
  ]
64
64
  end
65
65
 
@@ -70,11 +70,11 @@ describe Webby::Resources::DB do
70
70
 
71
71
  page = Webby::Resources::Page.new('content/tumblog/rss.txt')
72
72
  parent = @db.parent_of(page)
73
- parent.url.should == '/tumblog'
73
+ parent.url.should == '/tumblog/'
74
74
 
75
75
  page = Webby::Resources::Page.new('content/tumblog/200807/up-a-tree/index.txt')
76
76
  parent = @db.parent_of(page)
77
- parent.url.should == '/tumblog'
77
+ parent.url.should == '/tumblog/'
78
78
  end
79
79
 
80
80
  it 'returns the siblings of a resource' do
@@ -97,11 +97,11 @@ describe Webby::Resources::DB do
97
97
 
98
98
  children.length.should == 5
99
99
  children.map {|page| page.url}.sort.should == %w[
100
- /tumblog/200806/the-noble-chicken
101
- /tumblog/200807/historical-perspectives-on-the-classic-chicken-joke
102
- /tumblog/200807/mad-city-chickens
103
- /tumblog/200807/the-wisdom-of-the-dutch
104
- /tumblog/200807/up-a-tree
100
+ /tumblog/200806/the-noble-chicken/
101
+ /tumblog/200807/historical-perspectives-on-the-classic-chicken-joke/
102
+ /tumblog/200807/mad-city-chickens/
103
+ /tumblog/200807/the-wisdom-of-the-dutch/
104
+ /tumblog/200807/up-a-tree/
105
105
  ]
106
106
  end
107
107
 
@@ -111,11 +111,11 @@ describe Webby::Resources::DB do
111
111
 
112
112
  children.length.should == 5
113
113
  children.map {|page| page.url}.should == %w[
114
- /tumblog/200806/the-noble-chicken
115
- /tumblog/200807/historical-perspectives-on-the-classic-chicken-joke
116
- /tumblog/200807/mad-city-chickens
117
- /tumblog/200807/the-wisdom-of-the-dutch
118
- /tumblog/200807/up-a-tree
114
+ /tumblog/200806/the-noble-chicken/
115
+ /tumblog/200807/historical-perspectives-on-the-classic-chicken-joke/
116
+ /tumblog/200807/mad-city-chickens/
117
+ /tumblog/200807/the-wisdom-of-the-dutch/
118
+ /tumblog/200807/up-a-tree/
119
119
  ]
120
120
  end
121
121
 
@@ -125,11 +125,11 @@ describe Webby::Resources::DB do
125
125
 
126
126
  children.length.should == 5
127
127
  children.map {|page| page.url}.should == %w[
128
- /tumblog/200806/the-noble-chicken
129
- /tumblog/200807/historical-perspectives-on-the-classic-chicken-joke
130
- /tumblog/200807/mad-city-chickens
131
- /tumblog/200807/the-wisdom-of-the-dutch
132
- /tumblog/200807/up-a-tree
128
+ /tumblog/200806/the-noble-chicken/
129
+ /tumblog/200807/historical-perspectives-on-the-classic-chicken-joke/
130
+ /tumblog/200807/mad-city-chickens/
131
+ /tumblog/200807/the-wisdom-of-the-dutch/
132
+ /tumblog/200807/up-a-tree/
133
133
  ].reverse
134
134
  end
135
135
  end
@@ -6,7 +6,7 @@ require File.expand_path(
6
6
  describe Webby::Resources::Layout do
7
7
  before :each do
8
8
  layout = Webby::Resources::Layout.
9
- new(Webby.datapath %w[site layouts tumblog default.txt])
9
+ new(Webby.datapath(%w[site layouts tumblog default.txt]))
10
10
  Webby::Resources.stub!(:find_layout).and_return(layout)
11
11
 
12
12
  @default = File.join %w[layouts tumblog default.txt]
@@ -6,7 +6,7 @@ require File.expand_path(
6
6
  describe Webby::Resources::Page do
7
7
  before :each do
8
8
  layout = Webby::Resources::Layout.
9
- new(Webby.datapath %w[site layouts default.txt])
9
+ new(Webby.datapath(%w[site layouts default.txt]))
10
10
  Webby::Resources.stub!(:find_layout).and_return(layout)
11
11
 
12
12
  @filename = File.join %w[content index.txt]
@@ -55,7 +55,13 @@ describe Webby::Resources::Page do
55
55
  it "uses only the directory name for 'index' files" do
56
56
  filename = File.join %w[content tumblog index.txt]
57
57
  resource = Webby::Resources::Page.new(filename)
58
- resource.url.should == '/tumblog'
58
+ resource.url.should == '/tumblog/'
59
+ end
60
+
61
+ it "avoids adding a double trailing slash on the end" do
62
+ filename = File.join %w[content index.txt]
63
+ resource = Webby::Resources::Page.new(filename)
64
+ resource.url.should == '/'
59
65
  end
60
66
  end
61
67
 
@@ -7,7 +7,7 @@ describe Webby::Resources::Resource do
7
7
 
8
8
  before :each do
9
9
  layout = Webby::Resources::Layout.
10
- new(Webby.datapath %w[site layouts default.txt])
10
+ new(Webby.datapath(%w[site layouts default.txt]))
11
11
  Webby::Resources.stub!(:find_layout).and_return(layout)
12
12
 
13
13
  @filename = File.join %w[content index.txt]
@@ -47,7 +47,7 @@ describe Webby::Resources do
47
47
  describe "#new" do
48
48
  before :each do
49
49
  layout = Webby::Resources::Layout.
50
- new(Webby.datapath %w[site layouts default.txt])
50
+ new(Webby.datapath(%w[site layouts default.txt]))
51
51
  Webby::Resources.stub!(:find_layout).and_return(layout)
52
52
  end
53
53
 
@@ -1,4 +1,3 @@
1
- # $Id$
2
1
 
3
2
  begin
4
3
  require 'bones/smtp_tls'
@@ -43,7 +42,7 @@ namespace :ann do
43
42
  desc "Send an email announcement"
44
43
  task :email => ['ann:prereqs', PROJ.ann.file] do
45
44
  ann = PROJ.ann
46
- from = ann.email[:from] || PROJ.email
45
+ from = ann.email[:from] || Array(PROJ.authors).first || PROJ.email
47
46
  to = Array(ann.email[:to])
48
47
 
49
48
  ### build a mail header for RFC 822
@@ -1,4 +1,3 @@
1
- # $Id$
2
1
 
3
2
  if HAVE_BONES
4
3
 
@@ -4,13 +4,17 @@ require 'rake/packagetask'
4
4
  require 'rubygems/user_interaction'
5
5
  require 'rubygems/builder'
6
6
 
7
- class Bones::GemPackageTask < Rake::PackageTask
7
+ module Bones
8
+ class GemPackageTask < Rake::PackageTask
8
9
  # Ruby GEM spec containing the metadata for this package. The
9
10
  # name, version and package_files are automatically determined
10
11
  # from the GEM spec and don't need to be explicitly provided.
11
12
  #
12
13
  attr_accessor :gem_spec
13
14
 
15
+ # Tasks from the Bones gem directory
16
+ attr_reader :bones_files
17
+
14
18
  # Create a GEM Package task library. Automatically define the gem
15
19
  # if a block is given. If no block is supplied, then +define+
16
20
  # needs to be called to define the task.
@@ -28,6 +32,12 @@ class Bones::GemPackageTask < Rake::PackageTask
28
32
  super(gem.name, gem.version)
29
33
  @gem_spec = gem
30
34
  @package_files += gem_spec.files if gem_spec.files
35
+ @bones_files = []
36
+
37
+ local_setup = File.join(Dir.pwd, %w[tasks setup.rb])
38
+ if !test(?e, local_setup)
39
+ Dir.glob(::Bones.path(%w[lib bones tasks *])).each {|fn| bones_files << fn}
40
+ end
31
41
  end
32
42
 
33
43
  # Create the Rake tasks and actions specified by this
@@ -38,7 +48,7 @@ class Bones::GemPackageTask < Rake::PackageTask
38
48
  super
39
49
  task :prereqs
40
50
  task :package => ['gem:prereqs', "#{package_dir_path}/#{gem_file}"]
41
- file "#{package_dir_path}/#{gem_file}" => [package_dir_path] + package_files do
51
+ file "#{package_dir_path}/#{gem_file}" => [package_dir_path] + package_files + bones_files do
42
52
  when_writing("Creating GEM") {
43
53
  chdir(package_dir_path) do
44
54
  Gem::Builder.new(gem_spec).build
@@ -48,6 +58,26 @@ class Bones::GemPackageTask < Rake::PackageTask
48
58
  end
49
59
  }
50
60
  end
61
+
62
+ file package_dir_path => bones_files do
63
+ mkdir_p package_dir rescue nil
64
+
65
+ gem_spec.files = (gem_spec.files +
66
+ bones_files.map {|fn| File.join('tasks', File.basename(fn))}).sort
67
+
68
+ bones_files.each do |fn|
69
+ base_fn = File.join('tasks', File.basename(fn))
70
+ f = File.join(package_dir_path, base_fn)
71
+ fdir = File.dirname(f)
72
+ mkdir_p(fdir) if !File.exist?(fdir)
73
+ if File.directory?(fn)
74
+ mkdir_p(f)
75
+ else
76
+ raise "file name conflict for '#{base_fn}' (conflicts with '#{fn}')" if test(?e, f)
77
+ safe_ln(fn, f)
78
+ end
79
+ end
80
+ end
51
81
  end
52
82
 
53
83
  def gem_file
@@ -57,7 +87,8 @@ class Bones::GemPackageTask < Rake::PackageTask
57
87
  "#{package_name}-#{@gem_spec.platform}.gem"
58
88
  end
59
89
  end
60
- end # class Bones::GemPackageTask
90
+ end # class GemPackageTask
91
+ end # module Bones
61
92
 
62
93
  namespace :gem do
63
94
 
@@ -76,6 +107,10 @@ namespace :gem do
76
107
  s.add_dependency(*dep)
77
108
  end
78
109
 
110
+ PROJ.gem.development_dependencies.each do |dep|
111
+ s.add_development_dependency(*dep)
112
+ end
113
+
79
114
  s.files = PROJ.gem.files
80
115
  s.executables = PROJ.gem.executables.map {|fn| File.basename(fn)}
81
116
  s.extensions = PROJ.gem.files.grep %r/extconf\.rb$/
@@ -124,6 +159,13 @@ namespace :gem do
124
159
  puts PROJ.gem._spec.to_ruby
125
160
  end
126
161
 
162
+ desc 'Write the gemspec '
163
+ task :spec => 'gem:prereqs' do
164
+ File.open("#{PROJ.name}.gemspec", 'w') do |f|
165
+ f.write PROJ.gem._spec.to_ruby
166
+ end
167
+ end
168
+
127
169
  desc 'Install the gem'
128
170
  task :install => [:clobber, 'gem:package'] do
129
171
  sh "#{SUDO} #{GEM} install --local pkg/#{PROJ.gem._spec.full_name}"
@@ -147,41 +189,13 @@ namespace :gem do
147
189
  task :cleanup do
148
190
  sh "#{SUDO} #{GEM} cleanup #{PROJ.gem._spec.name}"
149
191
  end
150
-
151
- namespace :mswin32 do
152
- win32_spec = PROJ.gem._spec.dup
153
- win32_spec.platform = 'x86-mswin32'
154
-
155
- pkg = Bones::GemPackageTask.new(win32_spec)
156
- class << pkg
157
- def package_dir_path() "#{package_dir}/#{package_name}-x86-mswin32"; end
158
- end
159
- pkg.define
160
-
161
- file "#{pkg.package_dir_path}/#{pkg.gem_file}" => :unix2dos
162
-
163
- task :unix2dos do
164
- reject = %w[.gif .jpg .jpeg]
165
- Find.find(File.join(pkg.package_dir_path, 'examples')) do |fn|
166
- next unless test(?f, fn)
167
- next if reject.include?(File.extname(fn))
168
- sh %{unix2dos #{fn}}
169
- end
170
- end
171
- end # namespace :mswin32
172
192
  end # namespace :gem
173
193
 
174
194
 
175
195
  desc 'Alias to gem:package'
176
- task :gem => ['gem:package', 'gem:mswin32:package']
177
-
178
- task :clobber => ['gem:clobber_package', 'gem:mswin32:clobber_package']
196
+ task :gem => 'gem:package'
179
197
 
180
- %w[
181
- gem:clobber_package
182
- gem:mswin32:clobber_package
183
- gem:mswin32:package
184
- gem:mswin32:repackage
185
- ].each {|name| remove_desc_for_task name}
198
+ task :clobber => 'gem:clobber_package'
199
+ remove_desc_for_task 'gem:clobber_package'
186
200
 
187
201
  # EOF