Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 105 lines (89 sloc) 3.321 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 doc...
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
9 dir = File.dirname(__FILE__)
10 $: << "#{dir}/lib"
c9fdc16 Move erector version to its own file and just include that file,
jkingdon authored
11 require "erector/version"
bc332a5 using a patched-up hoe.rb, got it packaged up and released to RubyForge
alexch authored
12
c9fdc16 Move erector version to its own file and just include that file,
jkingdon authored
13 GEM_VERSION = Erector::VERSION # defined in lib/erector/version.rb
5d71123 clean up documentation and Rakefile
alexch authored
14 GEM_NAME = "erector"
15
16 Hoe.new(GEM_NAME, GEM_VERSION) do |hoe|
17 hoe.name = GEM_NAME
bc332a5 using a patched-up hoe.rb, got it packaged up and released to RubyForge
alexch authored
18 hoe.developer("Pivotal Labs", "alex@pivotallabs.com")
19 hoe.rdoc_dir = "rdoc"
20 hoe.remote_rdoc_dir = "rdoc"
b4003ef Exclude the three copies of rails from the gem we generate.
jkingdon authored
21
22 specs = Dir.glob("spec/**/*").reject{|file| file =~ %r{^spec/rails_root}}
23 hoe.files = [specs, "lib/**/*", "README.txt", "bin/erect"]
6d77363 erect: runs on directories, works with namespaced attributes, converts D...
alexch authored
24 hoe.extra_deps = [['treetop', ">= 1.2.3"], "rake"]
bc332a5 using a patched-up hoe.rb, got it packaged up and released to RubyForge
alexch authored
25 end
fdaa413 improving docs, and generation thereof
alexch authored
26 Hoe::remove_tasks("audit", "check_manifest", "post_blog", "multi", "test", "test_deps", "docs")
bc332a5 using a patched-up hoe.rb, got it packaged up and released to RubyForge
alexch authored
27
ccaf8f5 tidy up rakefile; improve docs; document Jim's merge
alexch authored
28 desc "Default: run tests"
8e0bbea copied from svn://rubyforge.org/var/svn/pivotalrb/erector/trunk. See doc...
alexch authored
29 task :default => :spec
30
949e196 add test task to call spec, so default rake task runs under hoe
thewoolleyman authored
31 task :test => :spec
32
257fd0d try to get geminstaller to run from cruise
alexch authored
33 task :cruise => [:geminstaller, :test]
057704b try to get geminstaller to run from cruise
alexch authored
34
35 task :geminstaller do
c345c9a caw - fix geminstaller task
Pivotal Labs authored
36 require 'geminstaller'
37 GemInstaller.run('--sudo --exceptions') || raise("GemInstaller failed")
057704b try to get geminstaller to run from cruise
alexch authored
38 end
39
8e0bbea copied from svn://rubyforge.org/var/svn/pivotalrb/erector/trunk. See doc...
alexch authored
40 desc "Run the specs for the erector plugin"
caa7c7c rake spec is using SpecSuite.all. Adding SpecSuite.all, SpecSuite.core, ...
btakita authored
41 task :spec do
1758bd0 Run install_dependencies taks before running the spec task if Rails is n...
btakita authored
42 rails_root = "#{File.dirname(__FILE__)}/spec/rails_root"
43 unless File.exists?("#{rails_root}/vendor/rails/railties/lib/initializer.rb")
44 warn "Rails not cloned into #{rails_root}. Installing dependencies."
45 Rake.application[:install_dependencies].invoke
46 end
caa7c7c rake spec is using SpecSuite.all. Adding SpecSuite.all, SpecSuite.core, ...
btakita authored
47 require "spec/spec_suite"
48 SpecSuite.all
8e0bbea copied from svn://rubyforge.org/var/svn/pivotalrb/erector/trunk. See doc...
alexch authored
49 end
4811034 erect tool now works the other way too (from rb to html). Also img tags ...
alexch authored
50
51 desc "Build the web site from the .rb files in web/"
52 task :web do
b7e225c Remove page.rb and sidebar.rb from web generation.
btakita authored
53 dir = File.dirname(__FILE__)
54 files = Dir["web/*.rb"] - ["web/page.rb", "web/sidebar.rb"]
38fa169 Fix "rake web" by having it require the rest of erector.
jkingdon authored
55 require 'erector'
56 require 'erector/erect'
070e7fb Reorganizing.
btakita authored
57 Erector::Erect.new(["--to-html", *files]).run
4811034 erect tool now works the other way too (from rb to html). Also img tags ...
alexch authored
58 end
fdaa413 improving docs, and generation thereof
alexch authored
59
60 desc "Generate rdoc"
61 task :docs do
62 FileUtils.rm_rf("rdoc")
63 options = %w(-o rdoc --inline-source --main README.txt)
64 options << "-t \"Erector #{Erector::VERSION}\""
65 options << '-d' if RUBY_PLATFORM !~ /win32/ and `which dot` =~ /\/dot/ and not ENV['NODOT']
66 system "rdoc #{options.join(" ")} lib bin README.txt"
67 end
ed32516 Adding example rails project. Adding specs for supported versions of Ra...
btakita authored
68
69 desc "Install dependencies to run the build. This task uses Git."
70 task(:install_dependencies) do
71 require "lib/erector/rails/supported_rails_versions"
24d5c1e Raise error if there is an issues cloning Rails.
btakita authored
72 system("git clone git://github.com/rails/rails.git spec/rails_root/vendor/rails_versions/edge") || raise("Git clone of Rails failed")
0cdee04 Fixing install_dependencies when run for the first time.
btakita authored
73 require "fileutils"
74 edge_path = "spec/rails_root/vendor/rails_versions/edge"
75 FileUtils.mkdir_p(edge_path)
76 Dir.chdir(edge_path) do
ed32516 Adding example rails project. Adding specs for supported versions of Ra...
btakita authored
77 begin
78 Erector::Rails::SUPPORTED_RAILS_VERSIONS.each do |version, data|
79 unless version == 'edge'
80 system("git checkout #{data['git_tag']}")
81 system("cp -R ../edge ../#{version}")
82 end
83 end
84 ensure
85 system("git checkout master")
86 end
87 end
88 end
89
90 desc "Updates the dependencies to run the build. This task uses Git."
91 task(:update_dependencies) do
341cb94 Move spec/rails/rails_root to spec/rails_root
btakita authored
92 system "cd spec/rails_root/vendor/rails_versions/edge; git pull origin"
ed32516 Adding example rails project. Adding specs for supported versions of Ra...
btakita authored
93 end
2af6fa8 Add character method and argument-less nbsp.
jkingdon authored
94
95 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"
96 task(:build_unicode) do
97 require 'lib/erector/unicode_builder'
98 builder = Erector::UnicodeBuilder.new(
99 File.open("/usr/lib/perl5/5.8.8/unicore/UnicodeData.txt"),
100 File.open("lib/erector/unicode.rb", "w")
101 )
102 builder.generate
103 end
104
Something went wrong with that request. Please try again.