Fantastic...will do a fresh install of HTML Help and try from scratch. A few questions:
1) Must install the http://www.microsoft.com/download/en/details.aspx?id=21138 version?
2) Can build both 1.8.x and 1.9.x CHMs using existing RubyInstaller recipes using 1.9.3 as the build Ruby?
3) Can build CHMs using 1.8.7 as the build Ruby?...IMO, a "who cares if it doesn't"
4) Can build CHMs with both RDoc 3.12 and legacy 2.5.11?...if only 3.10+ I think it's OK
Jon
Fantastic...will do a fresh install of HTML Help and try from scratch. A few questions:
1) Must install the http://www.microsoft.com/download/en/details.aspx?id=21138 version?
2) Can build both 1.8.x and 1.9.x CHMs using existing RubyInstaller recipes using 1.9.3 as the build Ruby?
3) Can build CHMs using 1.8.7 as the build Ruby?...IMO, a "who cares if it doesn't"
4) Can build CHMs with both RDoc 3.12 and legacy 2.5.11?...if only 3.10+ I think it's OK
I'm guessing you installed HTML Help Workshop at some time in order to get `hhc.exe` as I couldn't find it on my Win7 32bit in C:\Windows or C:\Program Files.
https://github.com/vertiginous/rdoc_chm/blob/master/lib/rdoc/generator/chm.rb#L23
Probably should add a FAQ entry in our Development section to make sure this is clear since MSFTs doco and version mismatches muddies the water for any newcomer...is it 1.3 or 1.0!? :(
http://msdn.microsoft.com/en-us/library/windows/desktop/ms670169%28v=vs.85%29.aspx
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21138
> > 2) Can build both 1.8.x and 1.9.x CHMs using existing RubyInstaller
> > recipes using 1.9.3 as the build Ruby?
> >
> Yes, there is an important caveat that I forgot to mention though. RDoc #106<https://github.com/rdoc/rdoc/issues/106> is
> a encoding bug and
> Ruby 1.9 has some characters that require UTF-8. You can fix this by adding
> '--encoding=UTF-8' to 'default_ops'.
Good to know...FAQ entry on our wiki?
> > 3) Can build CHMs using 1.8.7 as the build Ruby?...IMO, a "who cares if it doesn't"
> >
> I'm like 99% sure it does. I think I tested this case, but I don't remember.
> Either way I think that is more dependent on RDoc. If it doesn't work I'll
> let you know.
I don't think we should do anything special to support building with 1.8.7. If it works, great. If not, download our latest 1.9.x and be happy. Of course, Luis' perspective is the final one :)
> > 4) Can build CHMs with both RDoc 3.12 and legacy 2.5.11?...if only 3.10+ I think it's OK
> >
> I know it can't with 2.5.11, it requires atleast RDoc 3.12 as a dependency
> also. So there is that...
I have no real issue with a 3.12+ dep, but we may want more flexibility by allowing 3.10+ (2011-10-08 release)...Luis' decision.
Jon
I'm guessing you installed HTML Help Workshop at some time in order to get `hhc.exe` as I couldn't find it on my Win7 32bit in C:\Windows or C:\Program Files.
https://github.com/vertiginous/rdoc_chm/blob/master/lib/rdoc/generator/chm.rb#L23
Probably should add a FAQ entry in our Development section to make sure this is clear since MSFTs doco and version mismatches muddies the water for any newcomer...is it 1.3 or 1.0!? :(
http://msdn.microsoft.com/en-us/library/windows/desktop/ms670169%28v=vs.85%29.aspx
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21138
> > 2) Can build both 1.8.x and 1.9.x CHMs using existing RubyInstaller
> > recipes using 1.9.3 as the build Ruby?
> >
> Yes, there is an important caveat that I forgot to mention though. RDoc #106<https://github.com/rdoc/rdoc/issues/106> is
> a encoding bug and
> Ruby 1.9 has some characters that require UTF-8. You can fix this by adding
> '--encoding=UTF-8' to 'default_ops'.Good to know...FAQ entry on our wiki?
I don't think we should do anything special to support building with 1.8.7. If it works, great. If not, download our latest 1.9.x and be happy. Of course, Luis' perspective is the final one :)
I have no real issue with a 3.12+ dep, but we may want more flexibility by allowing 3.10+ (2011-10-08 release)...Luis' decision.
With these mods to our `recipes\tools\docs.rake`
diff --git a/recipes/tools/docs.rake b/recipes/tools/docs.rake
index 1359fb7..966213f 100644
--- a/recipes/tools/docs.rake
+++ b/recipes/tools/docs.rake
@@ -4,9 +4,10 @@ require 'rubygems'
interpreters = [RubyInstaller::Ruby18, RubyInstaller::Ruby19]
begin
- gem 'rdoc', '~> 2.5.11'
+ gem 'rdoc', '3.10'
require 'rdoc/rdoc'
- gem 'rdoc_chm', '~> 2.4.2'
+ gem 'rdoc_chm', '>= 2.4.3'
+ puts 'RDoc version: %s' % RDoc::VERSION
rescue Gem::LoadError
if Rake.application.options.show_tasks
puts "You need rdoc 2.5.11 and rdoc_chm 2.4.2 gems installed"
@@ -45,7 +46,7 @@ interpreters.each do |package|
stdlib_files = ['./lib', './ext']
- default_opts = ['--format=chm']
+ default_opts = ['--format=chm', '--encoding=UTF-8']
# build file dependencies
rdocs = [
I get this failure when attempting to build with rdoc 3.10 and 3.11....rdoc 3.12 works fine:
C:\projects\rubyinstaller-git>rake ruby19:docs local=c:\Users\Jon\Documents\RubyDev\ruby-git
RDoc version: 3.10
cd c:/Users/Jon/Documents/RubyDev/ruby-git
invalid options: --format=chm
(invalid options are ignored)
Parsing sources...
100% [75/75] vsnprintf.c
Generating Darkfish format into C:/projects/rubyinstaller-git/sandbox/doc/ruby19/ruby19-core...
Files: 75
Classes: 88 ( 7 undocumented)
Modules: 18 ( 4 undocumented)
Constants: 93 (42 undocumented)
Attributes: 1 ( 1 undocumented)
Methods: 1611 (31 undocumented)
Total: 1811 (85 undocumented)
95.31% documented
Elapsed: 36.9s
cp C:/projects/rubyinstaller-git/sandbox/doc/ruby19/ruby19-core/ruby19-core.chm C:/projects/rubyinstaller-git/sandbox/doc/ruby19/ruby19-core.chm
rake aborted!
No such file or directory - C:/projects/rubyinstaller-git/sandbox/doc/ruby19/ruby19-core/ruby19-core.chm
Tasks: TOP => ruby19:docs => C:/projects/rubyinstaller-git/sandbox/doc/ruby19/ruby19.chm => C:/projects/rubyinstaller-git/sandbox/doc/ruby19/ruby19-core.chm
As rdoc 3.12 came out 2012-12-15, I say use `gem 'rdoc', '~> 3.12'` and other `docs.rake` tweaks, see if uber-debugger Luis can break things, and move on to the next thing :)
Jon
---
Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.
http://thecodeshop.github.com | http://jonforums.github.com/
twitter: @jonforums
I get this failure when attempting to build with rdoc 3.10 and 3.11....rdoc 3.12 works fine:
As rdoc 3.12 came out 2012-12-15, I say use `gem 'rdoc', '~> 3.12'` and other `docs.rake` tweaks, see if uber-debugger Luis can break things, and move on to the next thing :)
Or should it be hoisted all the way up to gem install time?
https://github.com/Azolo/rdoc_chm/blob/master/Rakefile#L22
Haven't really spelunked rdoc_chm, but I think it's cleaner to try to keep all the dependent gem versions handled in one place...the gemspec.
It's an RDoc discovery thing. So you can say that this is less of a dependency and more of a guard.Right now, it's requiring the file then the file is throwing the LoadError there. We should be throwingthe LoadError in the discover.rb so that another file doesn't get loaded.
If the guard is trying to do part of the package management role of RG, then it's doing too much.
It's OK for client code to guard library/gem usage like we're doing in `docs.rake`
https://github.com/oneclick/rubyinstaller/blob/9223cac4c31e91d29680da2f7856dcb36f753381/recipes/tools/docs.rake#L6-18
but a library/gem should delegate it's dependency/guard management to the package manager. As I said, I haven't looked in detail at `rdoc_gem` but this look contradictory as the gemspec says it's OK to install a downrev version, but the guard code causes failures unless an uplevel version is used.
https://github.com/Azolo/rdoc_chm/blob/master/Rakefile#L22
https://github.com/Azolo/rdoc_chm/blob/eea54d6829bb6f523f78f8a4cfe48e94fe452d55/lib/rdoc/generator/chm.rb#L1
You know the `rdoc_gem` much better than I do, but it looks like this part of the code is best delegated to RG.
> > If the guard is trying to do part of the package management role of RG,
> > then it's doing too much.
> >
> > It's OK for client code to guard library/gem usage like we're doing in
> > `docs.rake`
> >
> > https://github.com/oneclick/rubyinstaller/blob/9223cac4c31e91d29680da2f7856dcb36f753381/recipes/tools/docs.rake#L6-18
> >
> > but a library/gem should delegate it's dependency/guard management to the
> > package manager. As I said, I haven't looked in detail at `rdoc_gem` but
> > this look contradictory as the gemspec says it's OK to install a downrev
> > version, but the guard code causes failures unless an uplevel version is
> > used.
> >
> > https://github.com/Azolo/rdoc_chm/blob/master/Rakefile#L22
> > https://github.com/Azolo/rdoc_chm/blob/eea54d6829bb6f523f78f8a4cfe48e94fe452d55/lib/rdoc/generator/chm.rb#L1
> >
> > You know the `rdoc_gem` much better than I do, but it looks like this part
> > of the code is best delegated to RG.
> >
>
> Oops, I didn't notice forgot to update the gem dependencies =X
>
> That being said, you'll have to talk to Eric Hodel about the discover.rb
> thing. I don't know exactly how it all works. But here is the page that tells me to do that =P
>
> https://github.com/rdoc/rdoc/blob/v3.12/DEVELOPERS.rdoc
Ah, I see. Looks like the `discover.rb` file allows customization of how rdoc loads your rdoc plugin gem. Even though his example shows a version check, it's not a requirement.
For your `rdoc_chm` branch, I think it's OK for `discover.rb` to contain only `require 'rdoc/generator/chm'` and rely RG to do the right thing due to your recent `~> 3.12` gemspec update.
It will also be DRYer as no one will have to remember to maintain version constraints in two places.
> > Ah, I see. Looks like the `discover.rb` file allows customization of how
> > rdoc loads your rdoc plugin gem. Even though his example shows a version
> > check, it's not a requirement.
> >
> > For your `rdoc_chm` branch, I think it's OK for `discover.rb` to contain
> > only `require 'rdoc/generator/chm'` and rely RG to do the right thing due
> > to your recent `~> 3.12` gemspec update.
> >
> > It will also be DRYer as no one will have to remember to maintain version
> > constraints in two places.
> >
>
> Touché. So what kind of magic is going in Gem.find_files that I'm missing?
> I looked at this for hours yesterday wanting to know how.
> I'm pretty sure I'm more confused today than I was yesterday, haha.
I looked again and I'm wrong. Even though the version check in `discover.rb` isn't DRY, it's a red herring. Your mod is more robust and looks to be how the rdoc plugin system is meant to work.
# file: rdoc/rdoc.rb
if Gem.respond_to? :find_files then
rdoc_extensions = Gem.find_files 'rdoc/discover'
rdoc_extensions.each do |extension|
begin
load extension
# file: rubygems.rb
...
# Note that find_files will return all files even if they are from different
# versions of the same gem.
...
The `discover.rb` check handles the scenario where one has multiple installed rdoc versions and client code tries to use an unacceptable downrev rdoc version with `rdoc_chm`. The gemspec install-time version check will not catch this runtime issue.
Sorry for the distraction, b761775 should be reverted. Hopefully we can get your branch committed, a new rdoc_chm gem released, and update our `docs.rake` recipe.
It may turn out to be a BS scenario, but don't give up on your
solutions too early...make someone *prove* they've discovered a better
mousetrap. :)
Active debate leads to higher quality code. Short-term, it may feel
more "combative", but the back-and-forth tussle of ideas is one of the
few defenses we have to guard against crappy code. It's important to
let the tussle of ideas organically play out. It's why I rarely play
the bike-shedding card as I've found it's very easy to play the card
too early and stifle creativity and innovation.
Of course, discussion style is crucial, but you've got the discussion
style nailed: focus on the issue and don't take issue feedback
personally. If someone ever does take your legitimate, issue-specific
feedback too personally, it's their problem and they need find a way
to get over it and move on.
Thanks for this work and hopefully a few others will test it out and
see if they can make it fall down ;)
I took a look to the changes and everything seems to be good withrdoc_chm, meaning I will merge and prepare for a release.
However, I'm having problems using this against RubyInstaller.
It has been 15 minutes since it started building stdlib documentation,
eating 50% of CPU (Core 2 Duo) and around 250MB of RAM:
C:\Users\Luis\Projects\oss\oneclick\rubyinstaller>tasklist | find "ruby"
ruby.exe 4124 Console 1 238.724 K
On previous versions that process didn't take that long. I'm using TCS
builds but I don't think that could be the culprit.
I've also used your rdoc changes against RubyInstaller
(docs_config_refactor branch)
Would you mind taking a look to figure out why is taking that long?
(there is no progress on what is doing also, seems to be creating the
topic files)
Thank you.
On Wed, May 9, 2012 at 8:09 PM, Luis Lavena <luisl...@gmail.com> wrote:I took a look to the changes and everything seems to be good withrdoc_chm, meaning I will merge and prepare for a release.
However, I'm having problems using this against RubyInstaller.
It has been 15 minutes since it started building stdlib documentation,
eating 50% of CPU (Core 2 Duo) and around 250MB of RAM:
C:\Users\Luis\Projects\oss\oneclick\rubyinstaller>tasklist | find "ruby"
ruby.exe 4124 Console 1 238.724 K
On previous versions that process didn't take that long. I'm using TCS
builds but I don't think that could be the culprit.
I've also used your rdoc changes against RubyInstaller
(docs_config_refactor branch)
Would you mind taking a look to figure out why is taking that long?
(there is no progress on what is doing also, seems to be creating the
topic files)
The weird thing is that it stuck when saying "creating chm" (from thetop of my head)
All the HTML files already existed before the process got stuck.
My computer is off for tonight, but will check tomorrow morning.
On Thu, May 10, 2012 at 2:46 PM, Luis Lavena <luisl...@gmail.com> wrote:And the "piece of ressistance":
>
> Here you go:
>
> Outputting to C:/Users/Luis/Projects/oss/oneclick/rubyinstaller/sandbox/doc/ruby19/ruby19-stdlib/ruby19-stdlib.hhp
> rendering C:/Users/Luis/Projects/oss/oneclick/rubyinstaller/sandbox/doc/ruby19/ruby19-stdlib/contents.hhc
> Outputting to C:/Users/Luis/Projects/oss/oneclick/rubyinstaller/sandbox/doc/ruby19/ruby19-stdlib/contents.hhc
>
> (here stalls for 10 minutes with 250MB RAM)
>
> After that it output the list of topics, but don't have more than 3K
> of buffer to scroll back.
>
Compression decreased file by 18,782,232 bytes.
Files: 614
Classes: 1165 ( 631 undocumented)
Modules: 279 ( 147 undocumented)
Constants: 1391 ( 756 undocumented)
Attributes: 858 ( 441 undocumented)
Methods: 7118 (2596 undocumented)
Total: 10811 (4571 undocumented)
57.72% documented
Elapsed: 504.8s
500 seconds...
:-P