History

Improve JavaScript scraper

Thibaut committed 11 years ago

Commit c5ace7e1 parent 0812ee03 files · +5 −3Browse files

Showing the changes to lib/docs/filters/javascript (1 of 3 files). Show all

Unified · Split

lib/docs/filters/javascript/entries.rb+2−2
@@ -8,14 +8,14 @@ module Docs · 7 unmodified lines
88
99 def get_name
1010 if slug.start_with? 'Global_Objects/'
11− name, method = *slug.sub('Global_Objects/', '').split('/')
11+ name, method, *rest = *slug.sub('Global_Objects/', '').split('/')
1212 name.prepend 'Intl.' if INTL_OBJECTS.include?(name)
1313
1414 if method
1515 unless method == method.upcase || method == 'NaN'
1616 method = method[0].downcase + method[1..-1] # e.g. Trim => trim
1717 end
18− name << ".#{method}"
18+ name << ".#{([method] + rest).join('.')}"
1919 end
2020
2121 name