From 6fa70c5cdeee53de779f3d63e34284f5e87bfa2b Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Fri, 21 Nov 2014 20:41:43 -0800 Subject: [PATCH 1/4] Introduce RDoc::RI::Task --- lib/rdoc/ri/task.rb | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lib/rdoc/ri/task.rb diff --git a/lib/rdoc/ri/task.rb b/lib/rdoc/ri/task.rb new file mode 100644 index 0000000000..8914f5d054 --- /dev/null +++ b/lib/rdoc/ri/task.rb @@ -0,0 +1,51 @@ +#-- +# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +#++ + +require 'rubygems' +begin + gem 'rdoc' +rescue Gem::LoadError +end unless defined?(RDoc) + +require 'rdoc/task' + +module RDoc::RI + class Task < RDoc::Task + def clobber_task_description + "Remove RDoc RI data files" + end + + def defaults + super + @rdoc_dir = 'doc/ri' + end + + def rdoc_task_description + 'Build RDoc RI data files' + end + + def rerdoc_task_description + 'Rebuild RDoc RI data files' + end + end +end From d131fe60fdbdbb600199e2d733d22febc235e675 Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Fri, 21 Nov 2014 20:53:43 -0800 Subject: [PATCH 2/4] Remove copyright notice /cc https://github.com/rdoc/rdoc/pull/332#discussion_r20754684 --- lib/rdoc/ri/task.rb | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/lib/rdoc/ri/task.rb b/lib/rdoc/ri/task.rb index 8914f5d054..fdce260bbb 100644 --- a/lib/rdoc/ri/task.rb +++ b/lib/rdoc/ri/task.rb @@ -1,26 +1,3 @@ -#-- -# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#++ - require 'rubygems' begin gem 'rdoc' From 8caa354a2dcd02b594e3a2f20410f41e01d607e9 Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Fri, 21 Nov 2014 20:54:29 -0800 Subject: [PATCH 3/4] Use '.rdoc' for output dir to work with rdoc-tags /cc https://github.com/rdoc/rdoc/pull/332#discussion_r20754689 --- lib/rdoc/ri/task.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rdoc/ri/task.rb b/lib/rdoc/ri/task.rb index fdce260bbb..0216598cc3 100644 --- a/lib/rdoc/ri/task.rb +++ b/lib/rdoc/ri/task.rb @@ -14,7 +14,7 @@ def clobber_task_description def defaults super - @rdoc_dir = 'doc/ri' + @rdoc_dir = '.rdoc' end def rdoc_task_description From f161ae60207b30c7f31f39c85606a86dd8426528 Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Fri, 21 Nov 2014 20:55:15 -0800 Subject: [PATCH 4/4] Flatten class /cc https://github.com/rdoc/rdoc/pull/332#discussion_r20754697 --- lib/rdoc/ri/task.rb | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/rdoc/ri/task.rb b/lib/rdoc/ri/task.rb index 0216598cc3..199c5eee8b 100644 --- a/lib/rdoc/ri/task.rb +++ b/lib/rdoc/ri/task.rb @@ -6,23 +6,21 @@ require 'rdoc/task' -module RDoc::RI - class Task < RDoc::Task - def clobber_task_description - "Remove RDoc RI data files" - end +class RDoc::RI::Task < RDoc::Task + def clobber_task_description + "Remove RDoc RI data files" + end - def defaults - super - @rdoc_dir = '.rdoc' - end + def defaults + super + @rdoc_dir = '.rdoc' + end - def rdoc_task_description - 'Build RDoc RI data files' - end + def rdoc_task_description + 'Build RDoc RI data files' + end - def rerdoc_task_description - 'Rebuild RDoc RI data files' - end + def rerdoc_task_description + 'Rebuild RDoc RI data files' end end