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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e224f994b90b2c2cac1787966d239addd12c90604042885a95cd28e99a9bbb1c
4
- data.tar.gz: 4d2a5e0eeb4c067dd7724a684ed74139e9cf8bbc24d2bf57dcd5893f3d279dfd
3
+ metadata.gz: 7c57bae0a6fbc182e752ab68d4e5eaa6f1441354e9f906d9ee6d336c8c51c9e4
4
+ data.tar.gz: 73cc9921720bad183c573a5cd7bdb077bd118ed6f3eb2d1a0f417f0c9a1bf9de
5
5
  SHA512:
6
- metadata.gz: 97fcf1a6509824873ec0bcf7e1f5ea170620c3a877153f394ee0b706f917cf51ca64537d6511398dddece0a86ff4181c1081c284574cdde5b5022a91f6ce7698
7
- data.tar.gz: d48ec9f51cfa5810635a7ee4eb8a63ed0ee58be5436901cc245534021884a35b784dc1ef8610661ae09f1dfd74e72460e30518da4ce90e323636da1dc211814a
6
+ metadata.gz: 507b97ad08897e529ba1d471b696beeeb8af74fdd782e7067de2ac0f6ffa51f20010d782de808727083781b4e4b766fa7327cf122b300b284e88441e2d2899ef
7
+ data.tar.gz: 1fc2b130909d685e609f30e54a59faa8ad8e047ec057be23a5cfbea5648d1919a4b28fbf2bf2076239a7af4a3523ccd9b49cdc899333b0d1cd7d1e8bab113080
@@ -2,7 +2,11 @@
2
2
 
3
3
  require "thor"
4
4
 
5
- require_relative "../../gem_kit"
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GemKit
4
4
  module Release
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
@@ -1,6 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../gem_kit"
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"
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.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Kidd