Permalink
Browse files

Merge pull request #9 from IlanFrumer/master

fixed some issues
  • Loading branch information...
mustardamus committed Mar 19, 2013
2 parents 03e8169 + bbc5bc2 commit f7a137834d9f4b7a6b0bcb125dcbecd1239d8820
Showing with 24 additions and 4 deletions.
  1. +7 −2 app/assets/javascripts/entry.js.coffee
  2. +8 −2 app/assets/javascripts/header.js.coffee
  3. +9 −0 tasks/documentation.thor
@@ -82,10 +82,15 @@ class jqapi.Entry
joinArr = [] # generate the comma seperated string with join
for arg in argsArr
- joinArr.push arg.name if arg and arg.name # push argument name to join array
+ comma = ""
+ comma = ", " unless joinArr.length is 0
+ if arg and arg.optional
+ joinArr.push "[#{comma}#{arg.name}]" if arg and arg.name
+ else
+ joinArr.push "#{comma}#{arg.name}" if arg and arg.name
methodName = title.substr(0, title.length - 2) # cut out the empty ()
- sigTitle = "#{methodName}(#{joinArr.join(', ')})" # and fill it with arguments
+ sigTitle = "#{methodName}(#{joinArr.join(' ')})" # and fill it with arguments
sigTitle # return full title
@@ -43,8 +43,14 @@ class jqapi.Header
joinArr = []
for arg in argsArr
- joinArr.push arg.name if arg and arg.name
+ comma = ""
+ comma = ", " unless joinArr.length is 0
+ if arg and arg.optional
+ joinArr.push "[#{comma}#{arg.name}]" if arg and arg.name
+ else
+ joinArr.push "#{comma}#{arg.name}" if arg and arg.name
+
+ retArr.push joinArr.join(' ')
- retArr.push joinArr.join(', ')
retArr
View
@@ -62,6 +62,15 @@ class Docs < Thor
Dir.glob("#{xmlPath}/*.xml").each do |filepath| # each .xml file in directory
contentXml = File.open(filepath).read # read the xml content of the file
+
+ regex = /<xi:include href="(.+?)".+>/ # including xml xi:include tags
+ contentXml = contentXml.gsub regex do
+ icontentXml = File.open("#{xmlPath}/#{$1}").read
+ reg = /<\?xml.*\?>/
+ icontentXml = icontentXml.gsub reg , ''
+ icontentXml
+ end
+
contentObj = Crack::XML.parse(contentXml) # parse xml to a object
filename = filepath.split('/').last.gsub('.xml', '') # get the filename (-selector variation for example)
entryObj = {} # will hold entry details, written to file as json

0 comments on commit f7a1378

Please sign in to comment.