gem_kit-release 0.2.0 → 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 +25 -2
- data/lib/gem_kit/release/version.rb +1 -1
- data/lib/gem_kit/release.rb +5 -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
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
require "thor"
|
|
4
4
|
|
|
5
|
-
require_relative
|
|
5
|
+
# `require`, not `require_relative`: gem_kit is a separate gem, and inside an
|
|
6
|
+
# installed gem_kit-release there is no ../gem_kit to reach. It works in the
|
|
7
|
+
# monorepo, where both gems share one lib/, which is exactly why this is worth
|
|
8
|
+
# a comment.
|
|
9
|
+
require "gem_kit"
|
|
6
10
|
require_relative "version"
|
|
7
11
|
require_relative "changelog"
|
|
8
12
|
require_relative "project"
|
|
@@ -169,7 +173,12 @@ module GemKit
|
|
|
169
173
|
def self.run(arguments, out: $stdout, err: $stderr)
|
|
170
174
|
CLI.start(arguments)
|
|
171
175
|
0
|
|
172
|
-
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.
|
|
173
182
|
err.puts(failure.message)
|
|
174
183
|
1
|
|
175
184
|
rescue SystemExit => exit_exception
|
|
@@ -214,6 +223,20 @@ describe "gem_kit/release/cli" do
|
|
|
214
223
|
end
|
|
215
224
|
end
|
|
216
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
|
+
|
|
217
240
|
it "fails on an unknown command" do
|
|
218
241
|
with_gem do |dir|
|
|
219
242
|
invoke(["nonsense"], dir).first.should.not == 0
|
data/lib/gem_kit/release.rb
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative
|
|
3
|
+
# `require`, not `require_relative`: gem_kit is a separate gem, and inside an
|
|
4
|
+
# installed gem_kit-release there is no ../gem_kit to reach. It works in the
|
|
5
|
+
# monorepo, where both gems share one lib/, which is exactly why this is worth
|
|
6
|
+
# a comment.
|
|
7
|
+
require "gem_kit"
|
|
4
8
|
require_relative "release/version"
|
|
5
9
|
require_relative "release/changelog"
|
|
6
10
|
require_relative "release/project"
|