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
8 8
9 def get_name9 def get_name
10 if slug.start_with? 'Global_Objects/'10 if slug.start_with? 'Global_Objects/'
11 name, method = *slug.sub('Global_Objects/', '').split('/')11 name, method, *rest = *slug.sub('Global_Objects/', '').split('/')
12 name.prepend 'Intl.' if INTL_OBJECTS.include?(name)12 name.prepend 'Intl.' if INTL_OBJECTS.include?(name)
13 13
14 if method14 if method
15 unless method == method.upcase || method == 'NaN'15 unless method == method.upcase || method == 'NaN'
16 method = method[0].downcase + method[1..-1] # e.g. Trim => trim16 method = method[0].downcase + method[1..-1] # e.g. Trim => trim
17 end17 end
18 name << ".#{method}"18 name << ".#{([method] + rest).join('.')}"
19 end19 end
20 20
21 name21 name