Forum: Ruby on Rails Problem creating appdoc documentation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eb3d791b9544a96a61c1566ad16914a1?d=identicon&s=25 Radek Hnilica (Guest)
on 2006-02-15 19:17
(Received via mailing list)
Hello, can anyone help me.

After a few weeks I returned to the rails to play with it.  But I
recognize that I'm now not abble to build appdoc.  The same thing that
few weeks ago worked without an problem now give me an error:
unrecognized option `--line-numbers --inline-source'

$ rake --trace --verbose reappdoc
(in /home/radek/src/firma/giga-net/ncc/work)
** Invoke reappdoc (first_time)
** Invoke clobber_appdoc (first_time)
** Execute clobber_appdoc
rm -r doc/app
rm -r doc/app
** Invoke appdoc (first_time)
** Invoke doc/app/index.html (first_time)
** Invoke doc/README_FOR_APP (first_time, not_needed)
** Invoke app/controllers/application.rb (first_time, not_needed)
** Invoke app/helpers/application_helper.rb (first_time, not_needed)
** Invoke Rakefile (first_time, not_needed)
** Invoke TODO.rd (first_time, not_needed)
** Execute doc/app/index.html
rm -r doc/app

unrecognized option `--line-numbers --inline-source'

For help on options, try 'rdoc --help'

rake aborted!
exit


The appdoc.rake file:
desc "Generate documentation for the application"
Rake::RDocTask.new("appdoc") { |rdoc|
    rdoc.rdoc_dir = 'doc/app'
    rdoc.title    = "NCC Application Documentation"
    rdoc.options << '--line-numbers --inline-source -c iso-8859-2'
    rdoc.rdoc_files.include('doc/README_FOR_APP')
    rdoc.rdoc_files.include('app/**/*.rb')
    rdoc.rdoc_files.include('doc/*.rd')
    rdoc.rdoc_files.include('*.rd')
}


--
Radek Hnilica <Radek at Hnilica dot CZ>  http://www.hnilica.cz
==============================================================
No matter how far down the wrong road you've gone, turn back.
						Turkish proverb
... so turn back ... Now!
9106340a33a2407d63d22e6275300d33?d=identicon&s=25 Anonymous (Guest)
on 2006-02-15 21:21
I'm having the exact same problem with my rails environment running on
OS X 10.4
0f1e2ec122971063c71677aa03bfe038?d=identicon&s=25 Oliver Legg (Guest)
on 2006-02-16 00:30
(Received via mailing list)
As did I. I changed the line in /vendor/rails/railties/lib/tasks/
documentation.rake from   rdoc.options << '--line-numbers --inline-
source' (or similar) to   rdoc.options << '-SN'.
Eb3d791b9544a96a61c1566ad16914a1?d=identicon&s=25 Radek Hnilica (Guest)
on 2006-02-16 09:46
(Received via mailing list)
On Wed, Feb 15, 2006 at 11:30:10PM +0000, Oliver Legg wrote:
> As did I. I changed the line in /vendor/rails/railties/lib/tasks/
> documentation.rake from   rdoc.options << '--line-numbers --inline-
> source' (or similar) to   rdoc.options << '-SN'.

Ok, I try to modify the rails gem in place and recognize that I do not
underestand anything.

yoda:/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/tasks# diff -u
documentation.rake.orig  documentation.rake
yoda:/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/tasks# diff -u
documentation.rake.orig  documentation.rake
--- documentation.rake.orig     2006-02-16 09:01:23.000000000 +0100
+++ documentation.rake  2006-02-16 09:16:43.000000000 +0100
@@ -2,7 +2,7 @@
 Rake::RDocTask.new("appdoc") { |rdoc|
   rdoc.rdoc_dir = 'doc/app'
   rdoc.title    = "Rails Application Documentation"
-  rdoc.options << '--line-numbers --inline-source'
+  rdoc.options << '-SN'
   rdoc.rdoc_files.include('doc/README_FOR_APP')
   rdoc.rdoc_files.include('app/**/*.rb')
 }

After this modification, my thinks still do not work.  Yes, I can
build my documentation but not properly.

I think, there is something in rake, that adds '--' in options which
stopped me adding my own options.

My lib/tasks/appdoc.rake file:
desc "Generate documentation for the application"
Rake::RDocTask.new("appdoc") { |rdoc|
    rdoc.rdoc_dir = 'doc/app'
    rdoc.title    = "NCC Application Documentation"
    rdoc.options  << ' -c iso-8859-2' # <-- this do not work
    rdoc.rdoc_files.include('doc/README_FOR_APP')
    rdoc.rdoc_files.include('app/**/*.rb')
    rdoc.rdoc_files.include('doc/*.rd')
    rdoc.rdoc_files.include('*.rd')
}
#EOF

I got:
File not found:  -c iso-8859-2
rake aborted!
exit

--
Radek Hnilica <Radek.Hnilica at Moraviapress dot CZ>
              <Radek.Hnilica at Giga-NET dot CZ
              <Radek at Hnilica dot CZ>  http://www.hnilica.cz
==============================================================
No matter how far down the wrong road you've gone, turn back.
						Turkish proverb
... so turn back ... Now!
317aad7f9f0b69a440faca74bbe22b20?d=identicon&s=25 Jakob Skjerning (Guest)
on 2006-02-16 14:06
(Received via mailing list)
Radek Hnilica wrote:
> After a few weeks I returned to the rails to play with it.  But I
> recognize that I'm now not abble to build appdoc.  The same thing that
> few weeks ago worked without an problem now give me an error:
> unrecognized option `--line-numbers --inline-source'

This is a known bug, with a patch available:
http://dev.rubyonrails.org/ticket/3757

As a workaround you can simply copy the line that rake outputs and run
it manually.
Eb3d791b9544a96a61c1566ad16914a1?d=identicon&s=25 Radek Hnilica (Guest)
on 2006-02-16 14:27
(Received via mailing list)
On Thu, Feb 16, 2006 at 02:05:07PM +0100, Jakob Skjerning wrote:
> This is a known bug, with a patch available:
> http://dev.rubyonrails.org/ticket/3757
>
> As a workaround you can simply copy the line that rake outputs and run
> it manually.

Thanks, this was very helpfull.  I patch the rails and use the patch
as a guideline to modify my own task.  Now it works like I need it,
including my own options.

--
Radek Hnilica <Radek at Hnilica dot CZ>  http://www.hnilica.cz
==============================================================
No matter how far down the wrong road you've gone, turn back.
						Turkish proverb
... so turn back ... Now!
This topic is locked and can not be replied to.