pry 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b83f87075bc0f4eb1ef5d0b090f3fa1a6d9ca2881eae973926401ac9083d4db
4
- data.tar.gz: 73ec4ca6ffb8be28cdbc9477dd1ae03157437d218717e77df29d2b9edebc228f
3
+ metadata.gz: d3d394fb61f0a41511177954f810a8aa4ab0c390baa89e538878121806a28c08
4
+ data.tar.gz: d36e350eb1e8ff448e088dab7233f6c9f28849f6ae94d3eed0b9ad4768ade770
5
5
  SHA512:
6
- metadata.gz: c25aa1210bf8711f542b4ac2df1c92f102a7f2860e13d80feaa4559a3172c49a5777a102bbcb76fd022debbfbe4b5b2d00ef30c48c9f1890df6913b57d61c2eb
7
- data.tar.gz: a7f63286e060ad30d7a0ddbba3d97deb9a0a2f5c585c46419bff53c6661e07e2d1d0da89b2a193710437fe7bc8d05432cea0c16c29c008a196098b0351809166
6
+ metadata.gz: fe3608e5e7046c474a6e8b077dded9bfc091bfdeaa44d178bb69e66bbeaafaca2a3447fac31dd6d5d5bab8ecc10cbb2e2de327f3c4f55393d4024a45f6407b55
7
+ data.tar.gz: 1596aef2f91334198c2705f79fa6c93e324cd89071a1f6c04c60c471a5c168864c8a3bb991c1d362b5fd5e040782c4a680e7b1eb3cbf4324258c11379d8019f0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  ### master
2
2
 
3
+ ### [v0.14.1][v0.14.1] (April 12, 2021)
4
+
5
+ #### Bug fixes
6
+
7
+ * Fixed bad coloring of some RDoc-style docs
8
+ ([#2182](https://github.com/pry/pry/pull/2182))
9
+ * Fixed broken `--plugins` option. It shows a warning now
10
+ ([#2180](https://github.com/pry/pry/pull/2180))
11
+ * Fixed bad output on printing non-visible characters with color codes
12
+ ([#2154](https://github.com/pry/pry/pull/2154))
13
+ * Fixed bad output when colors are disabled and a string with color codes is
14
+ printed ([#2158](https://github.com/pry/pry/pull/2158))
15
+
3
16
  ### [v0.14.0][v0.14.0] (February 8, 2021)
4
17
 
5
18
  #### Features
@@ -1094,3 +1107,4 @@ complete CHANGELOG:
1094
1107
  [v0.13.0]: https://github.com/pry/pry/releases/tag/v0.13.0
1095
1108
  [v0.13.1]: https://github.com/pry/pry/releases/tag/v0.13.1
1096
1109
  [v0.14.0]: https://github.com/pry/pry/releases/tag/v0.14.0
1110
+ [v0.14.1]: https://github.com/pry/pry/releases/tag/v0.14.1
data/lib/pry/cli.rb CHANGED
@@ -163,11 +163,8 @@ Pry::CLI.add_options do
163
163
  end
164
164
 
165
165
  on "plugins", "List installed plugins." do
166
- puts "Installed Plugins:"
167
- puts "--"
168
- Pry.locate_plugins.each do |plugin|
169
- puts plugin.name.to_s.ljust(18) << plugin.spec.summary
170
- end
166
+ warn "The --plugins option is deprecated and has no effect"
167
+ warn "Try using `gem list pry-`"
171
168
  Kernel.exit
172
169
  end
173
170
 
@@ -17,12 +17,13 @@ class Pry
17
17
  last_match_ruby = proc do
18
18
  SyntaxHighlighter.highlight(Regexp.last_match(1))
19
19
  end
20
+
20
21
  comment.gsub(%r{<code>(?:\s*\n)?(.*?)\s*</code>}m, &last_match_ruby)
21
22
  .gsub(%r{<em>(?:\s*\n)?(.*?)\s*</em>}m) { "\e[1m#{Regexp.last_match(1)}\e[0m" }
22
23
  .gsub(%r{<i>(?:\s*\n)?(.*?)\s*</i>}m) { "\e[1m#{Regexp.last_match(1)}\e[0m" }
23
24
  .gsub(%r{<tt>(?:\s*\n)?(.*?)\s*</tt>}m, &last_match_ruby)
24
25
  .gsub(/\B\+(\w+?)\+\B/) { "\e[32m#{Regexp.last_match(1)}\e[0m" }
25
- .gsub(/((?:^[ \t]+.+(?:\n+|\Z))+)/, &last_match_ruby)
26
+ .gsub(/((?:^[ \t]+(?:(?!.+\e\[)).+(?:\n+|\Z))+)/, &last_match_ruby)
26
27
  .gsub(/`(?:\s*\n)?([^\e]*?)\s*`/) { "`#{last_match_ruby.call}`" }
27
28
  end
28
29
 
@@ -21,20 +21,20 @@ class Pry
21
21
 
22
22
  COLORS.each_pair do |color, value|
23
23
  define_method color do |text|
24
- "\033[0;#{30 + value}m#{text}\033[0m"
24
+ "\001\033[0;#{30 + value}m\002#{text}\001\033[0m\002"
25
25
  end
26
26
 
27
27
  define_method "bright_#{color}" do |text|
28
- "\033[1;#{30 + value}m#{text}\033[0m"
28
+ "\001\033[1;#{30 + value}m\002#{text}\001\033[0m\002"
29
29
  end
30
30
 
31
31
  COLORS.each_pair do |bg_color, bg_value|
32
32
  define_method "#{color}_on_#{bg_color}" do |text|
33
- "\033[0;#{30 + value};#{40 + bg_value}m#{text}\033[0m"
33
+ "\001\033[0;#{30 + value};#{40 + bg_value}m\002#{text}\001\033[0m\002"
34
34
  end
35
35
 
36
36
  define_method "bright_#{color}_on_#{bg_color}" do |text|
37
- "\033[1;#{30 + value};#{40 + bg_value}m#{text}\033[0m"
37
+ "\001\033[1;#{30 + value};#{40 + bg_value}m\002#{text}\001\033[0m\002"
38
38
  end
39
39
  end
40
40
  end
@@ -44,7 +44,7 @@ class Pry
44
44
  # @param [String, #to_s] text
45
45
  # @return [String] _text_ stripped of any color codes.
46
46
  def strip_color(text)
47
- text.to_s.gsub(/(\001)?\e\[.*?(\d)+m(\002)?/, '')
47
+ text.to_s.gsub(/(\001)?(\e\[(\d[;\d]?)*m)(\002)?/, '')
48
48
  end
49
49
 
50
50
  # Returns _text_ as bold text for use on a terminal.
@@ -52,7 +52,7 @@ class Pry
52
52
  # @param [String, #to_s] text
53
53
  # @return [String] _text_
54
54
  def bold(text)
55
- "\e[1m#{text}\e[0m"
55
+ "\001\e[1m\002#{text}\001\e[0m\002"
56
56
  end
57
57
 
58
58
  # Returns `text` in the default foreground colour.
data/lib/pry/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Pry
4
- VERSION = '0.14.0'.freeze
4
+ VERSION = '0.14.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mair (banisterfiend)
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-02-08 00:00:00.000000000 Z
14
+ date: 2021-04-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: coderay