Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 4461 Bytes
1 | require 'rubygems' |
2 | require 'rake' |
3 | |
4 | volatile_requires = ['rcov/rcovtask'] |
5 | not_loaded = [] |
6 | volatile_requires.each do |file| |
7 | begin |
8 | require file |
9 | rescue LoadError |
10 | not_loaded.push file |
11 | end |
12 | end |
13 | |
14 | # For some crazy reason, |
15 | # some Rake tasks interfere with others |
16 | # (specifically, benchmarking). |
17 | # Thus, it's advantageous to only show |
18 | # the task currently being used. |
19 | def is_task?(*tasks) |
20 | ARGV[0].nil? || tasks.include?(ARGV[0]) |
21 | end |
22 | |
23 | # ----- Default: Testing ------ |
24 | |
25 | desc 'Default: run unit tests.' |
26 | task :default => :test |
27 | |
28 | if is_task?('test', 'default') |
29 | require 'rake/testtask' |
30 | |
31 | desc 'Test the Haml plugin' |
32 | Rake::TestTask.new(:test) do |t| |
33 | t.libs << 'lib' |
34 | t.pattern = 'test/**/*_test.rb' |
35 | t.verbose = true |
36 | end |
37 | end |
38 | |
39 | # ----- Packaging ----- |
40 | |
41 | if is_task?('package', 'repackage', 'clobber_package') |
42 | require 'rake/gempackagetask' |
43 | |
44 | spec = Gem::Specification.new do |spec| |
45 | spec.name = 'haml' |
46 | spec.summary = 'An elegant, structured XHTML/XML templating engine.' |
47 | spec.version = File.read('VERSION').strip |
48 | spec.author = 'Hampton Catlin' |
49 | spec.email = 'haml@googlegroups.com' |
50 | spec.description = <<-END |
51 | Haml (HTML Abstraction Markup Language) is a layer on top of XHTML or XML |
52 | that's designed to express the structure of XHTML or XML documents |
53 | in a non-repetitive, elegant, easy way, |
54 | using indentation rather than closing tags |
55 | and allowing Ruby to be embedded with ease. |
56 | It was originally envisioned as a plugin for Ruby on Rails, |
57 | but it can function as a stand-alone templating engine. |
58 | END |
59 | |
60 | readmes = FileList.new('*') { |list| list.exclude(/[a-z]/) }.to_a |
61 | spec.executables = ['haml'] |
62 | spec.files = FileList['lib/**/*', 'bin/*', 'test/**/*', 'Rakefile'].to_a + readmes |
63 | spec.homepage = 'http://haml.hamptoncatlin.com/' |
64 | spec.has_rdoc = true |
65 | spec.extra_rdoc_files = readmes |
66 | spec.rdoc_options += [ |
67 | '--title', 'Haml', |
68 | '--main', 'REFERENCE', |
69 | '--exclude', 'lib/haml/buffer.rb', |
70 | '--line-numbers', |
71 | '--inline-source' |
72 | ] |
73 | spec.test_files = FileList['test/**/*_test.rb'].to_a |
74 | end |
75 | |
76 | Rake::GemPackageTask.new(spec) do |pkg| |
77 | pkg.need_zip = true |
78 | pkg.need_tar_gz = true |
79 | pkg.need_tar_bz2 = true |
80 | end |
81 | end |
82 | |
83 | # ----- Benchmarking ----- |
84 | |
85 | if is_task?('benchmark') |
86 | temp_desc = <<END |
87 | Benchmark HAML against ERb. |
88 | TIMES=n sets the number of runs. Defaults to 100. |
89 | END |
90 | |
91 | desc temp_desc.chomp |
92 | task :benchmark do |
93 | require 'test/benchmark' |
94 | |
95 | puts '-'*51, "Benchmark: Haml vs. ERb", '-'*51 |
96 | puts "Running benchmark #{ENV['TIMES']} times..." if ENV['TIMES'] |
97 | times = ENV['TIMES'].to_i if ENV['TIMES'] |
98 | benchmarker = Haml::Benchmarker.new |
99 | puts benchmarker.benchmark(times || 100) |
100 | puts '-'*51 |
101 | end |
102 | end |
103 | |
104 | # ----- Documentation ----- |
105 | |
106 | if is_task?('rdoc', 'rerdoc', 'clobber_rdoc', 'rdoc_devel', 'rerdoc_devel', 'clobber_rdoc_devel') |
107 | require 'rake/rdoctask' |
108 | |
109 | rdoc_task = Proc.new do |rdoc| |
110 | rdoc.title = 'Haml' |
111 | rdoc.options << '--line-numbers' << '--inline-source' |
112 | rdoc.rdoc_files.include('REFERENCE') |
113 | rdoc.rdoc_files.include('lib/**/*.rb') |
114 | rdoc.rdoc_files.exclude('lib/haml/buffer.rb') |
115 | end |
116 | |
117 | Rake::RDocTask.new do |rdoc| |
118 | rdoc_task.call(rdoc) |
119 | rdoc.rdoc_dir = 'rdoc' |
120 | end |
121 | |
122 | Rake::RDocTask.new(:rdoc_devel) do |rdoc| |
123 | rdoc_task.call(rdoc) |
124 | rdoc.rdoc_dir = 'rdoc_devel' |
125 | rdoc.options << '--all' |
126 | rdoc.rdoc_files.include('test/*.rb') |
127 | rdoc.rdoc_files = Rake::FileList.new(*rdoc.rdoc_files.to_a) |
128 | rdoc.rdoc_files.include('lib/haml/buffer.rb') |
129 | end |
130 | end |
131 | |
132 | # ----- Coverage ----- |
133 | |
134 | if is_task?('rcov', 'clobber_rcov') |
135 | unless not_loaded.include? 'rcov/rcovtask' |
136 | Rcov::RcovTask.new do |t| |
137 | t.libs << "test" |
138 | t.test_files = FileList['test/**/*_test.rb'] |
139 | if ENV['NON_NATIVE'] |
140 | t.rcov_opts << "--no-rcovrt" |
141 | end |
142 | t.verbose = true |
143 | end |
144 | end |
145 | end |
146 | |
147 | # ----- Profiling ----- |
148 | |
149 | if is_task?('profile') |
150 | temp_desc = <<END |
151 | Run a profile of HAML. |
152 | TIMES=n sets the number of runs. Defaults to 100. |
153 | FILE=n sets the file to profile. Defaults to 'standard'. |
154 | END |
155 | desc temp_desc.chomp |
156 | task :profile do |
157 | require 'test/profile' |
158 | |
159 | puts '-'*51, "Profiling Haml::Template", '-'*51 |
160 | |
161 | args = [] |
162 | args.push ENV['TIMES'].to_i if ENV['TIMES'] |
163 | args.push ENV['FILE'] if ENV['FILE'] |
164 | |
165 | profiler = Haml::Profiler.new |
166 | res = profiler.profile(*args) |
167 | puts res |
168 | |
169 | puts '-'*51 |
170 | end |
171 | end |