fixes Rails version for the stable API [ci skip]

This commit is contained in:
Xavier Noria 2013-07-06 22:40:02 +02:00
parent 7948d78905
commit 374fd6693a
2 changed files with 13 additions and 1 deletions

View File

@ -47,7 +47,11 @@ task :install => :build do
end
desc "Generate documentation for the Rails framework"
Rails::API::RepoTask.new('rdoc')
if ENV['EDGE']
Rails::API::EdgeTask.new('rdoc')
else
Rails::API::StableTask.new('rdoc')
end
desc 'Bump all versions to match version.rb'
task :update_versions do

View File

@ -135,12 +135,20 @@ module Rails
def api_dir
'doc/rdoc'
end
end
class EdgeTask < RepoTask
def rails_version
"master@#{`git rev-parse HEAD`[0, 7]}"
end
end
class StableTask < RepoTask
def rails_version
File.read('RAILS_VERSION').strip
end
end
class AppTask < Task
def component_root_dir(gem_name)
$:.grep(%r{#{gem_name}[\w.-]*/lib\z}).first[0..-5]