Skip to content
This repository
Browse code

removes binary? hack for RDoc, API requires RDoc 3 and horo 1.0.3

  • Loading branch information...
commit 55f2e9f898cb6d1c518eaef23592638813c23450 1 parent 09195f1
Xavier Noria fxn authored

Showing 2 changed files with 3 additions and 30 deletions. Show diff stats Hide diff stats

  1. +2 2 Gemfile
  2. +1 28 Rakefile
4 Gemfile
@@ -12,8 +12,8 @@ gem "rack", :git => "git://github.com/rack/rack.git"
12 12
13 13 gem "rake", ">= 0.8.7"
14 14 gem "mocha", ">= 0.9.8"
15   -gem "rdoc", "~> 2.5"
16   -gem "horo", ">= 1.0.2"
  15 +gem "rdoc", "~> 3.0"
  16 +gem "horo", "= 1.0.3"
17 17
18 18 # for perf tests
19 19 gem "faker"
29 Rakefile
... ... @@ -1,5 +1,5 @@
1 1 #!/usr/bin/env rake
2   -gem 'rdoc', '>= 2.5.10'
  2 +gem 'rdoc', '~> 3.0'
3 3 require 'rdoc'
4 4
5 5 require 'rdoc/task'
@@ -14,31 +14,6 @@ task :build => "all:build"
14 14 desc "Release all gems to gemcutter and create a tag"
15 15 task :release => "all:release"
16 16
17   -# RDoc skips some files in the Rails tree due to its binary? predicate. This is a quick
18   -# hack for edge docs, until we decide which is the correct way to address this issue.
19   -# If not fixed in RDoc itself, via an option or something, we should probably move this
20   -# to railties and use it also in doc:rails.
21   -def hijack_rdoc!
22   - require "rdoc/parser"
23   - class << RDoc::Parser
24   - def binary?(file)
25   - s = File.read(file, 1024) or return false
26   -
27   - if s[0, 2] == Marshal.dump('')[0, 2] then
28   - true
29   - elsif file =~ /erb\.rb$/ then
30   - false
31   - elsif s.index("\x00") then # ORIGINAL is s.scan(/<%|%>/).length >= 4 || s.index("\x00")
32   - true
33   - elsif 0.respond_to? :fdiv then
34   - s.count("^ -~\t\r\n").fdiv(s.size) > 0.3
35   - else # HACK 1.8.6
36   - (s.count("^ -~\t\r\n").to_f / s.size) > 0.3
37   - end
38   - end
39   - end
40   -end
41   -
42 17 PROJECTS = %w(activesupport activemodel actionpack actionmailer activeresource activerecord railties)
43 18
44 19 desc 'Run all tests by default'
@@ -76,8 +51,6 @@ end
76 51
77 52 desc "Generate documentation for the Rails framework"
78 53 RDoc::Task.new do |rdoc|
79   - hijack_rdoc!
80   -
81 54 rdoc.rdoc_dir = 'doc/rdoc'
82 55 rdoc.title = "Ruby on Rails Documentation"
83 56

0 comments on commit 55f2e9f

Please sign in to comment.
Something went wrong with that request. Please try again.