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
10 10
11 def get_name11 def get_name
12 name = at_css('#firstHeading').content.strip12 name = at_css('#firstHeading').content.strip
13 name.sub! 'C++ concepts: ', ''13 name.remove! 'C++ concepts: '
14 name.sub! 'C++ keywords: ', ''14 name.remove! 'C++ keywords: '
15 name.sub! 'C++ ', ''15 name.remove! 'C++ '
16 name.sub! %r{\s\(.+\)}, ''16 name.remove! %r{\s\(.+\)}
17 name.sub! %r{\AStandard library header <(.+)>\z}, '\1'17 name.sub! %r{\AStandard library header <(.+)>\z}, '\1'
18 name = name.split(',').first18 name = name.split(',').first
19 REPLACE_NAMES[name] || name19 REPLACE_NAMES[name] || name
@@ -24,9 +24,9 @@ module Docs · 4 unmodified lines
24 'Keywords'24 'Keywords'
25 elsif type = at_css('.t-navbar > div:nth-child(4) > :first-child').try(:content)25 elsif type = at_css('.t-navbar > div:nth-child(4) > :first-child').try(:content)
26 type.strip!26 type.strip!
27 type.sub! ' library', ''27 type.remove! ' library'
28 type.sub! ' utilities', ''28 type.remove! ' utilities'
29 type.sub! 'C++ ', ''29 type.remove! 'C++ '
30 type.capitalize!30 type.capitalize!
31 type31 type
32 end32 end
@@ -34,7 +34,7 @@ module Docs · 1 unmodified line
34 34
35 def additional_entries35 def additional_entries
36 return [] unless include_default_entry?36 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]
38 names.each(&:strip!).reject! do |name|38 names.each(&:strip!).reject! do |name|
39 name.size <= 2 || name == '...' || name =~ /\A[<>]/ || name.start_with?('operator')39 name.size <= 2 || name == '...' || name =~ /\A[<>]/ || name.start_with?('operator')
40 end40 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