Skip to content
Newer
Older
100644 132 lines (112 sloc) 4.03 KB
ccaf8f5 tidy up rakefile; improve docs; document Jim's merge
alexch authored
1 require 'rubygems'
8e0bbea copied from svn://rubyforge.org/var/svn/pivotalrb/erector/trunk. See …
alexch authored
2 require 'rake'
3 require 'rake/testtask'
4 require 'rake/rdoctask'
5 require 'rake/gempackagetask'
ccaf8f5 tidy up rakefile; improve docs; document Jim's merge
alexch authored
6 require 'spec/rake/spectask'
7 require './tasks/hoex.rb' # Alex's patched version of Hoe
c771796 bulk up web site, slim down README
alexch authored
8
4c5f610 @nakajima saves the day!
nakajima authored
9 def rails_root
10 "#{File.dirname(__FILE__)}/spec/rails_root"
11 end
12
c771796 bulk up web site, slim down README
alexch authored
13 dir = File.dirname(__FILE__)
14 $: << "#{dir}/lib"
c9fdc16 Move erector version to its own file and just include that file,
jkingdon authored
15 require "erector/version"
bc332a5 using a patched-up hoe.rb, got it packaged up and released to RubyForge
alexch authored
16
66a89be @btakita Readded hoe definition so we can deploy html and docs to the Erector …
btakita authored
17 gem_definition = lambda do |s|
18 s.name = "erector"
19 s.summary = "Html Builder library."
c605848 @alexch tracking down more references to erector-devel and replacing them with
alexch authored
20 s.email = "erector@googlegroups.com"
66a89be @btakita Readded hoe definition so we can deploy html and docs to the Erector …
btakita authored
21 s.description = "Html Builder library."
22 specs = Dir.glob("spec/**/*").reject{|file| file =~ %r{^spec/rails_root}}
4db3286 @alexch Renamed 'erect' binary to 'erector'. (Note that the source files and …
alexch authored
23 s.files = ["lib/**/*", "README.txt", "VERSION.yml", "bin/erector", specs]
66a89be @btakita Readded hoe definition so we can deploy html and docs to the Erector …
btakita authored
24 s.test_files = specs
25 end
26
3643273 Using Jeweler instead of Hoe to build gems.
Brian Takita authored
27 begin
28 require 'jeweler'
29 Jeweler::Tasks.new do |s|
66a89be @btakita Readded hoe definition so we can deploy html and docs to the Erector …
btakita authored
30 gem_definition.call(s)
3643273 Using Jeweler instead of Hoe to build gems.
Brian Takita authored
31 s.homepage = "http://erector.rubyforge.org/"
32 s.authors = [
33 "Alex Chaffee",
34 "Brian Takita",
35 "Jeff Dean",
36 "Jim Kingdon",
37 ]
38 s.add_dependency 'treetop', ">= 1.2.3"
39 end
40 rescue LoadError
41 puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
bc332a5 using a patched-up hoe.rb, got it packaged up and released to RubyForge
alexch authored
42 end
43
d0e05d9 @btakita Merge branch 'master' into rails
btakita authored
44
e5d7216 Run suite only for Rails 2.2.2.
Brian Takita authored
45 RAILS_PATH = "spec/rails_root/vendor/rails"
66a89be @btakita Readded hoe definition so we can deploy html and docs to the Erector …
btakita authored
46 Hoe.new("erector", Erector::VERSION) do |hoe|
47 gem_definition.call(hoe)
48 hoe.developer("Pivotal Labs", "pivotallabsopensource@googlegroups.com")
49 hoe.rdoc_dir = "rdoc"
50 hoe.remote_rdoc_dir = "rdoc"
51
52 # Many of these options are based on what will work with rubyforge and
53 # groups and permissions
67b6456 @alexch fix up documentation
alexch authored
54 hoe.rsync_args = "-rlv --delete --inplace --exclude .svn"
66a89be @btakita Readded hoe definition so we can deploy html and docs to the Erector …
btakita authored
55 end
56 Hoe::remove_tasks("audit", "check_manifest", "post_blog", "multi", "test", "test_deps", "docs")
57
3f984ee Added rake refresh_rails_versions task.
Jeff Dean & Brian Takita authored
58 EDGE_PATH = "spec/rails_root/vendor/rails_versions/edge"
59
ccaf8f5 tidy up rakefile; improve docs; document Jim's merge
alexch authored
60 desc "Default: run tests"
8e0bbea copied from svn://rubyforge.org/var/svn/pivotalrb/erector/trunk. See …
alexch authored
61 task :default => :spec
62
949e196 add test task to call spec, so default rake task runs under hoe
thewoolleyman authored
63 task :test => :spec
64
e5d7216 Run suite only for Rails 2.2.2.
Brian Takita authored
65 task :cruise => [:geminstaller, :install_dependencies, :switch_to_rails_version_tag, :test]
057704b try to get geminstaller to run from cruise
alexch authored
66
67 task :geminstaller do
c345c9a caw - fix geminstaller task
Pivotal Labs authored
68 require 'geminstaller'
69 GemInstaller.run('--sudo --exceptions') || raise("GemInstaller failed")
057704b try to get geminstaller to run from cruise
alexch authored
70 end
71
8e0bbea copied from svn://rubyforge.org/var/svn/pivotalrb/erector/trunk. See …
alexch authored
72 desc "Run the specs for the erector plugin"
caa7c7c rake spec is using SpecSuite.all. Adding SpecSuite.all, SpecSuite.cor…
btakita authored
73 task :spec do
1758bd0 Run install_dependencies taks before running the spec task if Rails i…
btakita authored
74 unless File.exists?("#{rails_root}/vendor/rails/railties/lib/initializer.rb")
75 warn "Rails not cloned into #{rails_root}. Installing dependencies."
76 Rake.application[:install_dependencies].invoke
77 end
caa7c7c rake spec is using SpecSuite.all. Adding SpecSuite.all, SpecSuite.cor…
btakita authored
78 require "spec/spec_suite"
79 SpecSuite.all
8e0bbea copied from svn://rubyforge.org/var/svn/pivotalrb/erector/trunk. See …
alexch authored
80 end
4811034 erect tool now works the other way too (from rb to html). Also img ta…
alexch authored
81
82 desc "Build the web site from the .rb files in web/"
83 task :web do
b7e225c Remove page.rb and sidebar.rb from web generation.
btakita authored
84 dir = File.dirname(__FILE__)
76cade6 @alexch major documentation update; also fixed minor bug with close_tag
alexch authored
85 files = Dir["web/*.rb"] - ["web/page.rb", "web/sidebar.rb", "web/clickable_li.rb"]
38fa169 Fix "rake web" by having it require the rest of erector.
jkingdon authored
86 require 'erector'
87 require 'erector/erect'
0aa0d48 @jkingdon Merge branch 'svn/master'.
jkingdon authored
88 Erector::Widget.prettyprint_default = true
070e7fb Reorganizing.
btakita authored
89 Erector::Erect.new(["--to-html", *files]).run
4811034 erect tool now works the other way too (from rb to html). Also img ta…
alexch authored
90 end
fdaa413 improving docs, and generation thereof
alexch authored
91
92 desc "Generate rdoc"
93 task :docs do
94 FileUtils.rm_rf("rdoc")
95 options = %w(-o rdoc --inline-source --main README.txt)
96 options << "-t \"Erector #{Erector::VERSION}\""
97 options << '-d' if RUBY_PLATFORM !~ /win32/ and `which dot` =~ /\/dot/ and not ENV['NODOT']
98 system "rdoc #{options.join(" ")} lib bin README.txt"
99 end
ed32516 Adding example rails project. Adding specs for supported versions of…
btakita authored
100
101 desc "Install dependencies to run the build. This task uses Git."
102 task(:install_dependencies) do
e5d7216 Run suite only for Rails 2.2.2.
Brian Takita authored
103 require "lib/erector/rails/rails_version"
104 FileUtils.rm_rf(RAILS_PATH)
105 system("git clone git://github.com/rails/rails.git #{RAILS_PATH}") || raise("Git clone of Rails failed")
106 Rake.application[:switch_to_rails_version_tag].invoke
3f984ee Added rake refresh_rails_versions task.
Jeff Dean & Brian Takita authored
107 end
108
109 desc "Refreshes the Rails versions from edge git repo"
e5d7216 Run suite only for Rails 2.2.2.
Brian Takita authored
110 task(:switch_to_rails_version_tag) do
111 require "lib/erector/rails/rails_version"
112 Dir.chdir(RAILS_PATH) do
113 system("git fetch origin")
114 system("git checkout #{Erector::Rails::RAILS_VERSION_TAG}")
ed32516 Adding example rails project. Adding specs for supported versions of…
btakita authored
115 end
116 end
117
118 desc "Updates the dependencies to run the build. This task uses Git."
119 task(:update_dependencies) do
e5d7216 Run suite only for Rails 2.2.2.
Brian Takita authored
120 system "cd #{RAILS_PATH}; git fetch origin"
ed32516 Adding example rails project. Adding specs for supported versions of…
btakita authored
121 end
2af6fa8 Add character method and argument-less nbsp.
jkingdon authored
122
123 desc "Regenerate unicode.rb from UnicodeData.txt from unicode.org. Only needs to be run when there is a new version of the Unicode specification"
124 task(:build_unicode) do
125 require 'lib/erector/unicode_builder'
126 builder = Erector::UnicodeBuilder.new(
3f984ee Added rake refresh_rails_versions task.
Jeff Dean & Brian Takita authored
127 File.open("/usr/lib/perl5/5.8.8/unicore/UnicodeData.txt"),
2af6fa8 Add character method and argument-less nbsp.
jkingdon authored
128 File.open("lib/erector/unicode.rb", "w")
129 )
130 builder.generate
131 end
Something went wrong with that request. Please try again.