Skip to content

Commit

Permalink
fixes Rails version for the stable API [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed Jul 6, 2013
1 parent 7948d78 commit 374fd66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Rakefile
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions railties/lib/rails/api/task.rb
Expand Up @@ -135,12 +135,20 @@ def component_root_dir(component)
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]
Expand Down

0 comments on commit 374fd66

Please sign in to comment.