tldr 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82e76ebc309cbf643c22244a1674aa3a7ae32578006ce05fac262aec15292bec
4
- data.tar.gz: 99610ebabba0d069f3618f6fa7cf79793c44491c4764463283e304fe329c7247
3
+ metadata.gz: 3db38676fc9f10ee01f3332c6dfcafb5dc7c0b5405d9c687d13ba3c5b5be008e
4
+ data.tar.gz: 874cbd810ed0ebff0e2bc92bba4d703903c10beb51220817314a9e6528308a01
5
5
  SHA512:
6
- metadata.gz: de39822a1208f86b69a45ac1185d2c6de22462282a6fa2f59054e84bfa55b135f61279ae3b9be2f61463557a2a04516397bd02083a6c2c8a26c8e627875a44d1
7
- data.tar.gz: ae0c0ed4ec84f2969a0b223a668351ce475536121fb59e2b56a4fbd7be18be844d5fec3aaf3d5ebfd5cf37ddb6a0a02afeef1f0e1f2f975c7d2796d322ab0ccb
6
+ metadata.gz: c79d10782d1d15ba8bd782358ad1b45ecbbc7096542aba5d487fd97822a61163049247a6cff2e050de95226e112653418b5cc656278a0fdf55cd7c5b09ce5ccb
7
+ data.tar.gz: 429100174c63d3e9d917ef7a5b4f5ff14f105453c53a854a21369595272507b47e4629bd50edd067a6aaf46986f583f8327b9e4f66555e390440c86cd584c04b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [0.7.0]
2
+
3
+ * Add a `tldt` alias for folks who have another executable named `tldr` on their
4
+ paths
5
+ * BREAKING: Reverse decision in 0.1.1 to capture_io on every TLDR subclass;
6
+ moving back to the MinitestCompatibility mixin
7
+ * Fix `assert_in_delta` defaultarg to retain Minitest compatibility
8
+ * Add `mu_pp` to the MinitestCompatibility mixin
9
+
1
10
  ## [0.6.2]
2
11
 
3
12
  * Since TLDR runs fine on 3.1, reduce the gem requirement
data/README.md CHANGED
@@ -319,6 +319,14 @@ TLDR will run all your tests in CI without the time bomb going off. If
319
319
  `tldr` is run in a non-interactive shell and a `CI` environment variable is set
320
320
  (as it is on virtually every CI service), then the bomb will be defused.
321
321
 
322
+ ### What if I already have another `tldr` executable on my path?
323
+
324
+ There's a [command-line utility named tldr](https://tldr.sh) that might conflict
325
+ with this gem's binary in your PATH. If that's the case you could change your
326
+ path, invoke `bundle exec tldr`, run [with Rake](#running-tldr-with-rake), or
327
+ use the `tldt` ("too long; didn't test") executable alias that ships with this
328
+ gem.
329
+
322
330
  ### Is there a plugin system?
323
331
 
324
332
  There is not.
data/exe/tldt ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "tldr"
4
+
5
+ TLDR::Run.cli(ARGV)
@@ -33,6 +33,23 @@ class TLDR
33
33
 
34
34
  assert receiver.__send__(method, *args), message
35
35
  end
36
+
37
+ def capture_io(&blk)
38
+ Assertions.capture_io(&blk)
39
+ end
40
+
41
+ def mu_pp obj
42
+ s = obj.inspect.encode(Encoding.default_external)
43
+
44
+ if String === obj && (obj.encoding != Encoding.default_external ||
45
+ !obj.valid_encoding?)
46
+ enc = "# encoding: #{obj.encoding}"
47
+ val = "# valid: #{obj.valid_encoding?}"
48
+ "#{enc}\n#{val}\n#{s}"
49
+ else
50
+ s
51
+ end
52
+ end
36
53
  end
37
54
  end
38
55
  end
@@ -28,7 +28,7 @@ class TLDR
28
28
  SuperDiff::EqualityMatchers::Main.call(expected:, actual:)
29
29
  end
30
30
 
31
- def capture_io
31
+ def self.capture_io
32
32
  captured_stdout, captured_stderr = StringIO.new, StringIO.new
33
33
 
34
34
  original_stdout, original_stderr = $stdout, $stderr
@@ -85,7 +85,7 @@ class TLDR
85
85
  refute expected == actual, message
86
86
  end
87
87
 
88
- def assert_in_delta expected, actual, delta, message = nil
88
+ def assert_in_delta expected, actual, delta = 0.001, message = nil
89
89
  difference = (expected - actual).abs
90
90
  message = Assertions.msg(message) {
91
91
  "Expected |#{expected} - #{actual}| (#{difference}) to be within #{delta}"
@@ -204,7 +204,7 @@ class TLDR
204
204
  def assert_output expected_stdout, expected_stderr, message = nil, &block
205
205
  assert_block "assert_output requires a block to capture output" unless block
206
206
 
207
- actual_stdout, actual_stderr = capture_io(&block)
207
+ actual_stdout, actual_stderr = Assertions.capture_io(&block)
208
208
 
209
209
  if Regexp === expected_stderr
210
210
  assert_match expected_stderr, actual_stderr, "In stderr"
data/lib/tldr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class TLDR
2
- VERSION = "0.6.2"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tldr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-09-29 00:00:00.000000000 Z
12
+ date: 2023-10-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: super_diff
@@ -45,6 +45,7 @@ email:
45
45
  - tenderlove@ruby-lang.org
46
46
  executables:
47
47
  - tldr
48
+ - tldt
48
49
  extensions: []
49
50
  extra_rdoc_files: []
50
51
  files:
@@ -54,6 +55,7 @@ files:
54
55
  - README.md
55
56
  - Rakefile
56
57
  - exe/tldr
58
+ - exe/tldt
57
59
  - lib/tldr.rb
58
60
  - lib/tldr/argv_parser.rb
59
61
  - lib/tldr/assertions.rb