foobara-files-generator 0.0.5 → 0.0.7

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: 582f4d8d9181bc813f61b852cbac39898e1b7f6d7269bab9a311e797f9be4f0b
4
- data.tar.gz: be104c5b5f734afd1def3939b7f50ed89cb3715ed3bfb8579d26a9d38c5ad9e0
3
+ metadata.gz: 5caa518db174a21a13145f96490e06c433c4349b8b2bf5f022d5d4b3b593ab36
4
+ data.tar.gz: 7ed979f5baf140244598a5c6769a60f3d9ebba74c30092239f4d245bd1e87f0f
5
5
  SHA512:
6
- metadata.gz: 2ca5762ec9d22dcaa728b921ca770b88eca09f8ad7b83439a52aabd05e1f1b5e7286fd9be3fee9ad6dc9c8ec82ec72cdfe9ed9ed8e7d8beeafd2f7a6dd5f3ba0
7
- data.tar.gz: 3cdc6959cccf0557e6b5656bdb0f529a158a58e829e1c6d292ddf804f8eda416c3b71c4010495726382f3c190e76dc2cba338baf520063e6f95e3d0a09f30cf7
6
+ metadata.gz: 3764cad8d83d6dfe07e554774aeea61d1a2659b670c726284c9bba5ea793d5ede066433f61fc3d4b3ed41fb050a7242c6f7270ad6fc85d41ecda59c0218465d0
7
+ data.tar.gz: a25ec4f56c92690de30230c0e1e4c558baa38f074ed8ab58ccee052a34b6ff4f3742237ce6acecf621f7e16b3429b479f7052b9d359833c155dd278875e4ebd5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.6] - 2025-05-03
2
+
3
+ - Return consistent errors when unable to shell out commands
4
+
5
+ ## [0.0.5] - 2025-05-03
6
+
7
+ - Honor raise_if_fails even when the command to shell out to doesn't exist
8
+
1
9
  ## [0.0.4] - 2025-01-06
2
10
 
3
11
  - Bump Ruby to 3.4.1
@@ -3,6 +3,8 @@ require "open3"
3
3
  module Foobara
4
4
  module Generators
5
5
  class WriteGeneratedFilesToDisk < Foobara::Command
6
+ class CouldNotExecuteError < StandardError; end
7
+
6
8
  class << self
7
9
  def generator_key
8
10
  nil
@@ -77,16 +79,30 @@ module Foobara
77
79
  end
78
80
 
79
81
  exit_status = wait_thr.value
82
+
80
83
  unless exit_status.success?
81
84
  # :nocov:
85
+ message = "Could not #{cmd}\n#{stderr.read}"
82
86
  if raise_if_fails
83
- raise "could not #{cmd}\n#{stderr.read}"
87
+ raise CouldNotExecuteError, message
84
88
  else
85
- warn "WARNING: could not #{cmd}\n#{stderr.read}"
89
+ warn "WARNING: #{message}"
86
90
  end
87
91
  # :nocov:
88
92
  end
93
+
94
+ exit_status
95
+ end
96
+ rescue Errno::ENOENT
97
+ message = "Could not run: #{cmd}\nMaybe it is not installed?"
98
+
99
+ if raise_if_fails
100
+ raise CouldNotExecuteError, message
101
+ else
102
+ warn "WARNING: #{message}"
89
103
  end
104
+
105
+ nil
90
106
  end
91
107
 
92
108
  def run_cmd_and_return_output(cmd)
@@ -103,12 +119,12 @@ module Foobara
103
119
  exit_status = wait_thr.value
104
120
  unless exit_status.success?
105
121
  # :nocov:
106
- raise "could not #{cmd}\n#{stderr.read}"
122
+ raise CouldNotExecuteError, "could not #{cmd}\n#{stderr.read}"
107
123
  end
108
124
  # :nocov:
109
125
  end
110
-
111
- retval
126
+ rescue Errno::ENOENT
127
+ raise CouldNotExecuteError, "Could not run: #{cmd}\nMaybe it is not installed?"
112
128
  end
113
129
 
114
130
  def stats
metadata CHANGED
@@ -1,28 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-files-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-06 00:00:00.000000000 Z
10
+ date: 2025-05-03 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ">="
16
+ - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '0'
18
+ version: 0.0.116
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - ">="
23
+ - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '0'
25
+ version: 0.0.116
26
26
  email:
27
27
  - azimux@gmail.com
28
28
  executables: []