tldr 0.9.3 → 0.9.4

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: 0c87b13131b7bdbd2307b55c7cc4f60dd9033f086063786aed52f3dbe9be0516
4
- data.tar.gz: b4d5f7589dee0f5f94b585d930c8d225beb10ba42c3dad22c5321e57b80e96ec
3
+ metadata.gz: 661e0ea905baa7122eba59c8f5954a3228698a2972a3567447bca5d8e7478f7e
4
+ data.tar.gz: 15ca7a5c88ee2406952f760bfbb58143b37a2ba929d34183722a4eb2cb05d7ac
5
5
  SHA512:
6
- metadata.gz: 1a5196a70159c64afc23eff6278b310fa44c1ed5c86a50a9aecc55229309c10d46f20aedd7fb04e0f743053b53859b80a09509cd2c56ca8f359532e98bcfd40d
7
- data.tar.gz: 9d31131b6b72e80c4ff1c81e2e13bbb7e942d25adaf0d3e7524032ff293d3a94458886320f2b3f3ab6c924f8fdd2ae83acab87e0f45cf4e487a39ecf04faed52
6
+ metadata.gz: 62b464ca2538db776cc6d8f3b664f465c230c1faff70196342ef48b04b98b5419bc4a43718cad80b159887c64f840816caaf79f8451baa8adea05f5424e2ab98
7
+ data.tar.gz: 1c7b685b900c2b47de3750c6e5ae4706853d9d1b8758cd514373e56dcfca580a40e9ca0bc7c391a52286acee9d25a1147673d86bdf4b95d14ae67e808146c4a9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+
2
+ ## [0.9.4]
3
+
4
+ * Fix Sorbet compatibility [#5](https://github.com/tendersearls/tldr/issues/5)
5
+
6
+ ## [0.9.3]
7
+
1
8
  * Print how many tests ran vs. didn't even when suppressing TLDR summary
2
9
 
3
10
  ## [0.9.2]
data/README.md CHANGED
@@ -8,12 +8,12 @@ We initially meant this as a joke [while
8
8
  pairin'](https://www.youtube.com/live/bmi-SWeH4MA?si=p5g1j1FQZrbYEOCg&t=63), but
9
9
  in addition to being funny, it was also a pretty good idea. So we fleshed out
10
10
  `tldr` to be a full-featured, mostly
11
- [Minitest-compatible](#minitest-compatibility), and downright pleasant test
11
+ [Minitest-compatible](#minitest-compatibility), and dare-we-say pleasant test
12
12
  framework for Ruby.
13
13
 
14
14
  The "big idea" here is TLDR is designed for users to run the `tldr` command
15
15
  repeatedly as they work—as opposed to only running the tests for whatever is
16
- being worked on. Even if the suite run over the 1.8 second time limit. Because
16
+ being worked on. Even if the suite runs over the 1.8 second time limit. Because
17
17
  TLDR shuffles and runs in parallel and is guaranteed to take less than two
18
18
  seconds,
19
19
  **you'll actually wind up running _all_ of your tests quite often as you work**,
@@ -39,5 +39,13 @@ class TLDR
39
39
  location.file == test.file && (location.line.nil? || test.covers_line?(location.line))
40
40
  }
41
41
  end
42
+
43
+ def self.chdir_maybe path
44
+ if path.nil?
45
+ yield
46
+ else
47
+ Dir.chdir(path) { yield }
48
+ end
49
+ end
42
50
  end
43
51
  end
@@ -3,7 +3,13 @@ class TLDR
3
3
  def self.unwrap_method method
4
4
  return method unless defined? ::T::Private::Methods
5
5
 
6
- T::Private::Methods.signature_for_method(method).method || method
6
+ sig_or_method = ::T::Private::Methods.signature_for_method(method) || method
7
+
8
+ if sig_or_method.is_a?(Method) || sig_or_method.is_a?(UnboundMethod)
9
+ sig_or_method
10
+ else # it's a T::Private::Methods::Signature
11
+ sig_or_method.method
12
+ end
7
13
  end
8
14
  end
9
15
  end
@@ -36,6 +36,7 @@ class TLDR
36
36
 
37
37
  Config = Struct.new(*CONFIG_ATTRIBUTES, keyword_init: true) do
38
38
  def initialize(**args)
39
+ original_base_path = Dir.pwd
39
40
  unless args[:config_intended_for_merge_only]
40
41
  change_working_directory_because_i_am_bad_and_i_should_feel_bad!(args[:base_path])
41
42
  args = merge_dotfile_args(args) unless args[:no_dotfile]
@@ -43,6 +44,7 @@ class TLDR
43
44
  args = undefault_parallel_if_seed_set(args)
44
45
  unless args[:config_intended_for_merge_only]
45
46
  args = merge_defaults(args)
47
+ revert_working_directory_change_because_itll_ruin_everything!(original_base_path)
46
48
  end
47
49
 
48
50
  super(**args)
@@ -239,6 +241,10 @@ class TLDR
239
241
  Dir.chdir(base_path) unless base_path.nil?
240
242
  end
241
243
 
244
+ def revert_working_directory_change_because_itll_ruin_everything! original_base_path
245
+ Dir.chdir(original_base_path) unless Dir.pwd == original_base_path
246
+ end
247
+
242
248
  def merge_dotfile_args args
243
249
  return args if args[:no_dotfile]
244
250
 
data/lib/tldr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class TLDR
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
data/lib/tldr.rb CHANGED
@@ -38,7 +38,9 @@ class TLDR
38
38
  if config.watch
39
39
  Watcher.new.watch(config)
40
40
  else
41
- Runner.new.run(config, Planner.new.plan(config))
41
+ PathUtil.chdir_maybe(config.base_path) do
42
+ Runner.new.run(config, Planner.new.plan(config))
43
+ end
42
44
  end
43
45
  end
44
46
 
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.9.3
4
+ version: 0.9.4
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-10-04 00:00:00.000000000 Z
12
+ date: 2023-10-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: super_diff
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.3.26
113
+ rubygems_version: 3.4.6
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: TLDR will run your tests, but only for 1.8 seconds.