-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate_rdoc.cmd
More file actions
98 lines (88 loc) · 2.25 KB
/
Copy pathgenerate_rdoc.cmd
File metadata and controls
98 lines (88 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@ECHO OFF
REM ########################################################################
REM File: generate_rdoc.cmd
REM
REM Purpose: Generates documentation
REM
REM Created: 14th August 2026
REM Updated: 30th August 2026
REM
REM ########################################################################
SETLOCAL
SET "ProjectDir=%~dp0"
SET "ProjectNameFile=%~dp0.sis\project_name.txt"
SET "ProjectName="
IF EXIST "%ProjectNameFile%" FOR /F "usebackq tokens=* delims=" %%A IN ("%ProjectNameFile%") DO IF NOT DEFINED ProjectName SET "ProjectName=%%A"
IF "%ProjectName%"=="" SET "ProjectName=Ruby project"
SET "DocDir=%SIS_RDOC_DOC_DIR%"
IF "%DocDir%"=="" SET "DocDir=doc"
SET "RDocArgs="
:parse_args
IF "%~1"=="" GOTO parsed_args
IF /I "%~1"=="--help" GOTO show_help
IF /I "%~1"=="--pwd" GOTO use_pwd
SET "RDocArgs=%RDocArgs% "%~1""
GOTO next_arg
:use_pwd
SET "ProjectDir=%CD%"
:next_arg
SHIFT
GOTO parse_args
:show_help
IF EXIST "%~dp0.sis\script_info_lines.txt" TYPE "%~dp0.sis\script_info_lines.txt"
ECHO Generates RDoc documentation for %ProjectName%
ECHO.
ECHO %~nx0 [ ... flags/options ... ]
ECHO.
ECHO Flags/options:
ECHO.
ECHO --pwd
ECHO operates in the caller's current directory instead of the
ECHO script's directory
ECHO.
ECHO -C
ECHO --coverage-report
ECHO generates an RDoc coverage report and fails if the report is
ECHO less than 100%% documented
ECHO.
ECHO --help
ECHO displays this help and terminates
ECHO.
ECHO Environment variables:
ECHO.
ECHO SIS_RDOC_DOC_DIR
ECHO sets the generated-document directory (default: doc)
EXIT /B 0
:parsed_args
PUSHD "%ProjectDir%" || (
ECHO %~nx0: project directory "%ProjectDir%" not found 1>&2
EXIT /B 1
)
IF EXIST "%DocDir%" RMDIR /S /Q "%DocDir%"
rdoc ^
--title "%ProjectName% API Reference" ^
--op "%DocDir%" ^
-x build_gem.cmd ^
-x build_gem.sh ^
-x generate_rdoc.cmd ^
-x generate_rdoc.sh ^
-x run_all_unit_tests.sh ^
-x .*\.gemspec ^
-x .*\.gem ^
-x .*\.md ^
-x Gemfile ^
-x LICENSE ^
-x Rakefile ^
-x doc/ ^
-x docs/ ^
-x examples/ ^
-x gems/ ^
-x old-gems/ ^
-x test/performance/ ^
-x test/scratch/ ^
-x tc_.*\.rb ^
-x ts_all.rb ^
%RDocArgs%
SET "RDocResult=%ERRORLEVEL%"
POPD
ENDLOCAL & EXIT /B %RDocResult%