doc/Rakefile in ruby-vpi-12.0.0 vs doc/Rakefile in ruby-vpi-12.0.1
- old
+ new
@@ -16,22 +16,35 @@
You should have received a copy of the GNU General Public License
along with Ruby-VPI; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
=end
-$: << File.join(File.dirname(__FILE__), 'lib')
-
require 'rake/clean'
+
+
+$: << File.join(File.dirname(__FILE__), '..', 'lib')
+require 'ruby-vpi'
+include RubyVpi::Config
+HISTORY_URL = WEBSITE_URL + "/history.html"
+RSS_URL = WEBSITE_URL + '/rss.xml'
+RSS_INFO = "RSS feed for this project."
+
+require 'ruby-vpi/erb'
+
+
+$: << File.join(File.dirname(__FILE__), 'lib')
require 'doc_proxy'
-FileList['*.erb'].each do |src|
- prefix = File.basename(src, '.erb')
+
+FileList['*.doc'].each do |src|
+ prefix = File.basename(src, File.extname(src))
helper = prefix + '.rb'
dst = prefix + '.html'
+ deps = FileList[prefix + '*'].exclude(src, dst)
desc "Process file #{src.inspect}."
- file dst => [src, 'common.tpl'] do |t|
+ file dst => [src, 'common.tpl', *deps] do |t|
content = DocProxy.new.instance_eval do
# default output configuration
table_of_contents = true
page_title = nil
@@ -50,14 +63,27 @@
template.result(binding)
end
File.open(dst, 'w') do |f|
f << content
+ puts f.path
end
-
- puts "wrote #{dst.inspect}"
end
task :default => dst
+ CLOBBER.include dst
end
-CLOBBER.include '*.html'
+
+desc "Generate RSS feed."
+file 'rss.xml' => FileList['rss.erb', 'history*'] do |t|
+ template = ERB.new(File.read(t.prerequisites[0]))
+ content = template.result
+
+ File.open(t.name, 'w') do |f|
+ f << content
+ puts f.path
+ end
+end
+
+task :default => 'rss.xml'
+CLOBBER.include 'rss.xml'