Skip to content

Commit 88ca1dc

Browse files
authored
Merge branch 'master' into reduce-1char-for-windows
2 parents dd3549f + 8f9f4c1 commit 88ca1dc

File tree

7 files changed

+42
-30
lines changed

7 files changed

+42
-30
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ rvm:
99
- 2.5.3
1010
- ruby-head
1111
- jruby-9.1.17.0
12-
- jruby-9.2.4.0
12+
- jruby-9.2.4.1
1313
env:
1414
global:
1515
NOBENCHMARK=1
@@ -18,4 +18,4 @@ matrix:
1818
allow_failures:
1919
- rvm: ruby-head
2020
- rvm: jruby-9.1.17.0
21-
- rvm: jruby-9.2.4.0
21+
- rvm: jruby-9.2.4.1

README.rdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
home :: https://github.com/ruby/rdoc
44
rdoc :: https://ruby.github.io/rdoc
55
bugs :: https://github.com/ruby/rdoc/issues
6-
build status :: {<img src="https://travis-ci.org/ruby/rdoc.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/ruby/rdoc]
6+
build status :: {<img src="https://travis-ci.org/ruby/rdoc.svg?branch=master" alt="Build Status on Travis CI" />}[https://travis-ci.org/ruby/rdoc] {<img src="https://ci.appveyor.com/api/projects/status/github/ruby/rdoc?branch=master&svg=true" alt="Build Status on AppVeyor" />}[https://ci.appveyor.com/project/ruby/rdoc]
77
code quality :: {<img src="https://codeclimate.com/github/ruby/rdoc/badges/gpa.svg" alt="Code Climate">}[https://codeclimate.com/github/ruby/rdoc]
88

99
== Description

appveyor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
init:
3+
# Set UTF-8 to use Unicode property because the defualt encoding on AppVeyor is Encoding::IBM437
4+
- set RUBYOPT=-EUTF-8
35
# To avoid duplicated executables in PATH, see https://github.com/ruby/spec/pull/468
46
- set PATH=C:\ruby%RUBY_VERSION%\bin;C:\msys64\usr\bin;C:\Program Files\7-Zip;C:\Program Files\AppVeyor\BuildAgent;C:\Program Files\Git\cmd;C:\Windows\system32;C:\Program Files;C:\Windows
57
# Loads trunk build and updates MSYS2 / MinGW to most recent gcc compiler
@@ -29,4 +31,6 @@ environment:
2931
- ruby_version: 23-x64
3032
- ruby_version: 24
3133
- ruby_version: 24-x64
34+
- ruby_version: 25
35+
- ruby_version: 25-x64
3236
- ruby_version: _trunk

lib/rdoc/markup/to_markdown.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def accept_verbatim verbatim
131131
@res << part
132132
end
133133

134-
@res << "\n" unless @res =~ /\n\z/
134+
@res << "\n"
135135
end
136136

137137
##

lib/rdoc/markup/to_rdoc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def accept_verbatim verbatim
234234
@res << part
235235
end
236236

237-
@res << "\n" unless @res =~ /\n\z/
237+
@res << "\n"
238238
end
239239

240240
##

lib/rdoc/options.rb

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class RDoc::Options
164164
##
165165
# Files matching this pattern will be excluded
166166

167-
attr_accessor :exclude
167+
attr_writer :exclude
168168

169169
##
170170
# The list of files to be processed
@@ -493,6 +493,20 @@ def encode_with coder # :nodoc:
493493
end
494494
end
495495

496+
##
497+
# Create a regexp for #exclude
498+
499+
def exclude
500+
if @exclude.nil? or Regexp === @exclude then
501+
# done, #finish is being re-run
502+
@exclude
503+
elsif @exclude.empty? then
504+
nil
505+
else
506+
Regexp.new(@exclude.join("|"))
507+
end
508+
end
509+
496510
##
497511
# Completes any unfinished option setup business such as filtering for
498512
# existent files, creating a regexp for #exclude and setting a default
@@ -505,13 +519,7 @@ def finish
505519
root = @root.to_s
506520
@rdoc_include << root unless @rdoc_include.include?(root)
507521

508-
if @exclude.nil? or Regexp === @exclude then
509-
# done, #finish is being re-run
510-
elsif @exclude.empty? then
511-
@exclude = nil
512-
else
513-
@exclude = Regexp.new(@exclude.join("|"))
514-
end
522+
@exclude = self.exclude
515523

516524
finish_page_dir
517525

lib/rdoc/stats/normal.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ def print_file files_so_far, filename
2626
files_so_far,
2727
@num_files)
2828

29-
# Print a progress bar, but make sure it fits on a single line. Filename
30-
# will be truncated if necessary.
31-
size = IO.respond_to?(:console_size) ? IO.console_size : IO.console.winsize
32-
terminal_width = size[1].to_i.nonzero? || 80
33-
max_filename_size = (terminal_width - progress_bar.size) - 1
34-
35-
if filename.size > max_filename_size then
36-
# Turn "some_long_filename.rb" to "...ong_filename.rb"
37-
filename = filename[(filename.size - max_filename_size) .. -1]
38-
filename[0..2] = "..."
39-
end
40-
41-
line = "#{progress_bar}#{filename}"
4229
if $stdout.tty?
30+
# Print a progress bar, but make sure it fits on a single line. Filename
31+
# will be truncated if necessary.
32+
size = IO.respond_to?(:console_size) ? IO.console_size : IO.console.winsize
33+
terminal_width = size[1].to_i.nonzero? || 80
34+
max_filename_size = (terminal_width - progress_bar.size) - 1
35+
36+
if filename.size > max_filename_size then
37+
# Turn "some_long_filename.rb" to "...ong_filename.rb"
38+
filename = filename[(filename.size - max_filename_size) .. -1]
39+
filename[0..2] = "..."
40+
end
41+
4342
# Clean the line with whitespaces so that leftover output from the
4443
# previous line doesn't show up.
45-
$stdout.print("\r" + (" " * @last_width) + ("\b" * @last_width) + "\r") if @last_width && @last_width > 0
46-
@last_width = line.size
47-
$stdout.print("#{line}\r")
44+
$stdout.print("\r\e[K") if @last_width && @last_width > 0
45+
@last_width = progress_bar.size + filename.size
46+
term = "\r"
4847
else
49-
$stdout.puts(line)
48+
term = "\n"
5049
end
50+
$stdout.print(progress_bar, filename, term)
5151
$stdout.flush
5252
end
5353

0 commit comments

Comments
 (0)