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 +4 -4
- data/lib/gem_kit/release/cli.rb +20 -1
- data/lib/gem_kit/release/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c57bae0a6fbc182e752ab68d4e5eaa6f1441354e9f906d9ee6d336c8c51c9e4
|
|
4
|
+
data.tar.gz: 73cc9921720bad183c573a5cd7bdb077bd118ed6f3eb2d1a0f417f0c9a1bf9de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 507b97ad08897e529ba1d471b696beeeb8af74fdd782e7067de2ac0f6ffa51f20010d782de808727083781b4e4b766fa7327cf122b300b284e88441e2d2899ef
|
|
7
|
+
data.tar.gz: 1fc2b130909d685e609f30e54a59faa8ad8e047ec057be23a5cfbea5648d1919a4b28fbf2bf2076239a7af4a3523ccd9b49cdc899333b0d1cd7d1e8bab113080
|
data/lib/gem_kit/release/cli.rb
CHANGED
|
@@ -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
|