@@ -110,18 +110,18 @@ def parsexml(filename)
110
110
# Controls the parsing for the commands
111
111
def parsebrs ( script , package , parentxmlfile )
112
112
113
- # Account for the path being relative, versus using package root
114
- ref_brs_script = File . join ( @ROOT_DIR , package , script )
113
+ # FUTURE: Account for the path being relative, versus using package root
114
+ @ ref_brs_script = File . join ( @ROOT_DIR , package , script )
115
115
116
116
# html to be written to the documentation
117
117
brs_doc_content = Hash . new
118
118
brs_doc_content [ :functions ] = Array . new
119
- brs_doc_content [ :name ] = File . basename ( ref_brs_script )
119
+ brs_doc_content [ :name ] = File . basename ( @ ref_brs_script)
120
120
121
121
begin
122
- lines = IO . readlines ( ref_brs_script )
122
+ lines = IO . readlines ( @ ref_brs_script)
123
123
rescue Errno ::ENOENT
124
- puts "Warn: BrightScript file not found: #{ ref_brs_script } Referenced from: #{ parentxmlfile } "
124
+ puts "Warn: BrightScript file not found: #{ @ ref_brs_script} Referenced from: #{ parentxmlfile } "
125
125
return
126
126
else
127
127
# look through the saved lines for comments to parse
@@ -146,13 +146,13 @@ def parsebrs( script, package, parentxmlfile)
146
146
# Document brightscript file
147
147
brs_doc_loc = File . join (
148
148
@doc_dir ,
149
- File . dirname ( ref_brs_script ) . split ( @ROOT_DIR ) [ 1 ] ,
150
- File . basename ( ref_brs_script )
149
+ File . dirname ( @ ref_brs_script) . split ( @ROOT_DIR ) [ 1 ] ,
150
+ File . basename ( @ ref_brs_script)
151
151
) << ".html"
152
152
brs_file = File . open ( brs_doc_loc , "w" , 0755 )
153
153
brs_file . write ( template . result ( binding ) )
154
154
brs_file . close
155
- return { :content => brs_doc_content , :file => brs_doc_loc , :ref => ref_brs_script }
155
+ return { :content => brs_doc_content , :file => brs_doc_loc , :ref => @ ref_brs_script }
156
156
end
157
157
end
158
158
@@ -170,7 +170,12 @@ def parseComments(comments)
170
170
break
171
171
end
172
172
full_comment = /('|(?i:rem))\s *(?<comment>\w .*$)/ . match ( comments [ line_num ] )
173
- brs_html_content [ :description ] . push ( parseDescription ( full_comment [ 'comment' ] ) )
173
+ if not full_comment
174
+ puts "fatal! Bad comment in file #{ @ref_brs_script } "
175
+ abort
176
+ else
177
+ brs_html_content [ :description ] . push ( parseDescription ( full_comment [ 'comment' ] ) )
178
+ end
174
179
line_num += 1
175
180
end
176
181
brs_html_content [ :params ] = Array . new
0 commit comments