History

Use String#remove

Thibaut committed 12 years ago

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

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

Unified · Split

lib/docs/filters/cpp/entries.rb+8−8
@@ -10,10 +10,10 @@ module Docs · 9 unmodified lines
1010
1111 def get_name
1212 name = at_css('#firstHeading').content.strip
13− name.sub! 'C++ concepts: ', ''
14− name.sub! 'C++ keywords: ', ''
15− name.sub! 'C++ ', ''
16− name.sub! %r{\s\(.+\)}, ''
13+ name.remove! 'C++ concepts: '
14+ name.remove! 'C++ keywords: '
15+ name.remove! 'C++ '
16+ name.remove! %r{\s\(.+\)}
1717 name.sub! %r{\AStandard library header <(.+)>\z}, '\1'
1818 name = name.split(',').first
1919 REPLACE_NAMES[name] || name
@@ -24,9 +24,9 @@ module Docs · 4 unmodified lines
2424 'Keywords'
2525 elsif type = at_css('.t-navbar > div:nth-child(4) > :first-child').try(:content)
2626 type.strip!
27− type.sub! ' library', ''
28− type.sub! ' utilities', ''
29− type.sub! 'C++ ', ''
27+ type.remove! ' library'
28+ type.remove! ' utilities'
29+ type.remove! 'C++ '
3030 type.capitalize!
3131 type
3232 end
@@ -34,7 +34,7 @@ module Docs · 1 unmodified line
3434
3535 def additional_entries
3636 return [] unless include_default_entry?
37− names = at_css('#firstHeading').content.gsub(%r{\(.+?\)}, '').split(',')[1..-1]
37+ names = at_css('#firstHeading').content.remove(%r{\(.+?\)}).split(',')[1..-1]
3838 names.each(&:strip!).reject! do |name|
3939 name.size <= 2 || name == '...' || name =~ /\A[<>]/ || name.start_with?('operator')
4040 end

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t