gem_kit-release 0.2.1 → 0.2.2

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: fac6ed488799b5600b28ae659a401ce11529a86a7743345e4da7bf7b9d77aea8
4
- data.tar.gz: 6d19a8ec0c6aa3599902e454db16615622d6aeb13a8726b15a29bf1aee9c066d
3
+ metadata.gz: 7c57bae0a6fbc182e752ab68d4e5eaa6f1441354e9f906d9ee6d336c8c51c9e4
4
+ data.tar.gz: 73cc9921720bad183c573a5cd7bdb077bd118ed6f3eb2d1a0f417f0c9a1bf9de
5
5
  SHA512:
6
- metadata.gz: 2935c103860a72042601539c960a3f175d6e09b0e0bfaa24cd2a46f7e58c0ccd894d848ed68e40c99cf522ea4af4b157fa13a1a5777a2805f95ab49528cca476
7
- data.tar.gz: 9c5f857f4376e52415f9864abc6597d457719ead21b7c828fcf2e20895bde24e45bff885d15835045c2c2291718649c66cc8344c17d2ef29cacfe2f50917ea0c
6
+ metadata.gz: 507b97ad08897e529ba1d471b696beeeb8af74fdd782e7067de2ac0f6ffa51f20010d782de808727083781b4e4b766fa7327cf122b300b284e88441e2d2899ef
7
+ data.tar.gz: 1fc2b130909d685e609f30e54a59faa8ad8e047ec057be23a5cfbea5648d1919a4b28fbf2bf2076239a7af4a3523ccd9b49cdc899333b0d1cd7d1e8bab113080
@@ -173,7 +173,12 @@ module GemKit
173
173
  def self.run(arguments, out: $stdout, err: $stderr)
174
174
  CLI.start(arguments)
175
175
  0
176
- rescue Failure => failure
176
+ rescue Failure, Project::NotFound, Project::Ambiguous => failure
177
+ # NotFound and Ambiguous are rescued here rather than only in
178
+ # Commands::Command#project, because a Project is lazy: `detect` succeeds
179
+ # on a gemspec that exists, and the failure surfaces later, from whichever
180
+ # command first asks for `version` or `spec`. Catching it at the entry
181
+ # point is the only place that covers all of them.
177
182
  err.puts(failure.message)
178
183
  1
179
184
  rescue SystemExit => exit_exception
@@ -218,6 +223,20 @@ describe "gem_kit/release/cli" do
218
223
  end
219
224
  end
220
225
 
226
+ # A gemspec that exists but does not parse fails inside Gem::Specification
227
+ # rather than in Project.detect, which is a different place than it looks.
228
+ it "reports an unparseable gemspec instead of raising" do
229
+ Dir.mktmpdir do |dir|
230
+ File.write(File.join(dir, "demo.gemspec"),
231
+ %(Gem::Specification.new do |spec|\n spec.description = <<~D\n unterminated\n))
232
+
233
+ status, _out, err = invoke(["release", "--dry-run"], dir)
234
+
235
+ status.should == 1
236
+ err.should.match(/could not load .*demo\.gemspec/)
237
+ end
238
+ end
239
+
221
240
  it "fails on an unknown command" do
222
241
  with_gem do |dir|
223
242
  invoke(["nonsense"], dir).first.should.not == 0
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GemKit
4
4
  module Release
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_kit-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Kidd