tldr 0.6.1 → 0.7.0

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: 8e0c6abcfc7b58fc6de05591d61ceadfcbbed4867cfb140081f62877bb80d9a6
4
- data.tar.gz: e62acff5d7e667214527d5bcafef6ba2540abbe4a187f441da07575919a34da0
3
+ metadata.gz: 3db38676fc9f10ee01f3332c6dfcafb5dc7c0b5405d9c687d13ba3c5b5be008e
4
+ data.tar.gz: 874cbd810ed0ebff0e2bc92bba4d703903c10beb51220817314a9e6528308a01
5
5
  SHA512:
6
- metadata.gz: 9c31d1f3fba81d133e2ef570b2252504cc67150d0729e56e0690fe5dbb8e3bd0512bec39e95a178eb12a8108fa92e56365fa981c3fc528ee3c845939237c347f
7
- data.tar.gz: 3e35999424094dc072b6f2be670259e584dc14edf5621236a37efb0282c38c9ae434d63bd33fbe44b23f8fbf6f1b79fef801fb5f9375ff924d851c8063f63ba8
6
+ metadata.gz: c79d10782d1d15ba8bd782358ad1b45ecbbc7096542aba5d487fd97822a61163049247a6cff2e050de95226e112653418b5cc656278a0fdf55cd7c5b09ce5ccb
7
+ data.tar.gz: 429100174c63d3e9d917ef7a5b4f5ff14f105453c53a854a21369595272507b47e4629bd50edd067a6aaf46986f583f8327b9e4f66555e390440c86cd584c04b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
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
+
10
+ ## [0.6.2]
11
+
12
+ * Since TLDR runs fine on 3.1, reduce the gem requirement
13
+
1
14
  ## [0.6.1]
2
15
 
3
16
  * Correctly report the number of test classes that run
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.1"
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.1
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
@@ -100,14 +102,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
102
  requirements:
101
103
  - - ">="
102
104
  - !ruby/object:Gem::Version
103
- version: 3.2.0
105
+ version: '3.1'
104
106
  required_rubygems_version: !ruby/object:Gem::Requirement
105
107
  requirements:
106
108
  - - ">="
107
109
  - !ruby/object:Gem::Version
108
110
  version: '0'
109
111
  requirements: []
110
- rubygems_version: 3.4.17
112
+ rubygems_version: 3.3.26
111
113
  signing_key:
112
114
  specification_version: 4
113
115
  summary: TLDR will run your tests, but only for 1.8 seconds.