Rakefile 1.9 KB
Newer Older
1
require "net/http"
2

B
bogdanvlviv 已提交
3
$:.unshift __dir__
4
require "tasks/release"
5
require "railties/lib/rails/api/task"
6 7

desc "Build gem files for all projects"
8
task build: "all:build"
9

10
desc "Prepare the release"
11
task prep_release: "all:prep_release"
12

13
desc "Release all gems to rubygems and create a tag"
14
task release: "all:release"
15

16
desc "Run all tests by default"
17
task default: %w(test test:isolated)
18

19
%w(test test:isolated package gem).each do |task_name|
20 21
  desc "Run #{task_name} task for all projects"
  task task_name do
22
    errors = []
23
    FRAMEWORKS.each do |project|
24 25
      system(%(cd #{project} && #{$0} #{task_name} --trace)) || errors << project
    end
26
    fail("Errors in #{errors.join(', ')}") unless errors.empty?
27 28
  end
end
J
Jeremy Kemper 已提交
29

30 31
desc "Smoke-test all projects"
task :smoke do
32
  (FRAMEWORKS - %w(activerecord)).each do |project|
33
    system %(cd #{project} && #{$0} test:isolated --trace)
34
  end
35
  system %(cd activerecord && #{$0} sqlite3:isolated_test --trace)
36
end
C
Carlhuda 已提交
37

J
José Valim 已提交
38
desc "Install gems for all projects."
39
task install: "all:install"
40

J
Jeremy Kemper 已提交
41
desc "Generate documentation for the Rails framework"
42 43
if ENV["EDGE"]
  Rails::API::EdgeTask.new("rdoc")
44
else
45
  Rails::API::StableTask.new("rdoc")
46
end
J
Jeremy Kemper 已提交
47

48
desc "Bump all versions to match RAILS_VERSION"
49
task update_versions: "all:update_versions"
50

P
Prathamesh Sonpatki 已提交
51
# We have a webhook configured in GitHub that gets invoked after pushes.
52 53 54 55 56 57 58 59
# This hook triggers the following tasks:
#
#   * updates the local checkout
#   * updates Rails Contributors
#   * generates and publishes edge docs
#   * if there's a new stable tag, generates and publishes stable docs
#
# Everything is automated and you do NOT need to run this task normally.
60
desc "Publishes docs, run this AFTER a new stable tag has been pushed"
61
task :publish_docs do
62 63
  Net::HTTP.new("api.rubyonrails.org", 8080).start do |http|
    request  = Net::HTTP::Post.new("/rails-master-hook")
64 65 66 67
    response = http.request(request)
    puts response.body
  end
end