History

Use String#remove

Thibaut committed 12 years ago

Commit bcd4a5b1 parent a0b795934 files · +79 −79Browse files

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

Unified · Split

lib/docs/filters/javascript/entries.rb+4−4
@@ -19,9 +19,9 @@ module Docs · 18 unmodified lines
1919 name
2020 else
2121 name = super
22− name.sub! 'Functions and function scope.', ''
23− name.sub! 'Operators.', ''
24− name.sub! 'Statements.', ''
22+ name.remove! 'Functions and function scope.'
23+ name.remove! 'Operators.'
24+ name.remove! 'Statements.'
2525 name
2626 end
2727 end
@@ -34,7 +34,7 @@ module Docs · 6 unmodified lines
3434 elsif slug.start_with? 'Functions_and_function_scope'
3535 'Function'
3636 elsif slug.start_with? 'Global_Objects'
37− object, method = *slug.sub('Global_Objects/', '').split('/')
37+ object, method = *slug.remove('Global_Objects/').split('/')
3838 if object.end_with? 'Error'
3939 'Errors'
4040 elsif INTL_OBJECTS.include?(object)