lib/fdoc.fy in fancy-0.8.0 vs lib/fdoc.fy in fancy-0.9.0

- old
+ new

@@ -131,11 +131,11 @@ str = ["{"] keys = obj keys keys each: |i| { str << $ to_json: i str << ":" - str << $ to_json: (obj at: i) + str << $ to_json: (obj[i]) } in_between: { str << ", " } str << "}" str join } @@ -160,11 +160,11 @@ mdoc = Fancy Documentation for: exec { next } unless: mdoc # skip methods with no documentation if: mdoc then: { mattr['doc]: $ mdoc format: 'fdoc if: (mdoc meta) then: { - mattr['arg]: $ mdoc meta at: 'argnames + mattr['arg]: $ mdoc meta['argnames] } } if: (exec class() == Rubinius CompiledMethod) then: { relative_file = exec file() # HACK: We simply delete everything before lib/ @@ -174,11 +174,11 @@ mattr['file]: $ relative_file # TODO calculate line numbers from compiled method # right now we only use the first line of code in the body. mattr['lines]: $ [exec definition_line, exec last_line] } - attr[(type ++ "s") intern()] [n]: mattr + attr["#{type}s" intern()] [n to_s]: mattr } } def generate_map { map = <['title => "Fancy Documentation", 'date => Time now() to_s(), @@ -191,26 +191,26 @@ doc = Fancy Documentation for: cls attr = <[ 'doc => doc format: 'fdoc, 'instance_methods => <[]>, 'methods => <[]>, - 'ancestors => cls ancestors() map: |c| { c name() gsub("::", " ") } + 'ancestors => cls ancestors() map: |c| { (c name || "") gsub("::", " ") } ]> popuplate_methods: cls on: attr type: 'instance_method known: methods popuplate_methods: cls on: attr type: 'method known: methods map['classes][name]: attr } methods each: |cm| { cls = cm scope() module() - cls_name = cls name() gsub("::", " ") - cls_attr = map['classes] at: cls_name + cls_name = cls name gsub("::", " ") + cls_attr = map['classes][cls_name] - full_name = cls_name ++ "#" ++ (cm name()) + full_name = "#{cls_name}##{cm name}" doc = Fancy Documentation for: cm attr = <[ - 'args => doc meta at: 'argnames, + 'args => doc meta['argnames], 'doc => doc format: 'fdoc ]> map['methods][full_name]: attr }