gempilot 0.3.3 → 0.3.5

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: bf9c32d806a0ad04b75555b83b55d8b4a18260b47aa850ccbce7932932c87053
4
- data.tar.gz: 21f589564965ef3245e0fa8706a5c2f186dc7dd56a9f4b3434b75ec8f523c052
3
+ metadata.gz: ab55a4c336ff8612280f38c41b6c4471e9f7791ae9fd40998af6608c016f5031
4
+ data.tar.gz: 1d29b54f07c0c66a0a6781a394d29d0cb73c14ceba5c3cf8278601e5e1db4df9
5
5
  SHA512:
6
- metadata.gz: 836b9b171fc9fc91ce30aa3cfa3f7b9f5fa71b80f63f0050b86cddce9981c3621bca5d36247288c8d3edbd557b0d6eb05c4b8fcf246398cc0fee5c1b02578da8
7
- data.tar.gz: 0c8973e059cd627a91a72fb21608871df90b49c32e528f10db2db469513fdf8cbd87432f7ac9679e26e5ad030255283886f69b61d6359530cce0f88b2586adb3
6
+ metadata.gz: 22f56e4d465bd05cfb95f4286599ae1c8242c56a63855aefad5878b74eb277dae5f0a497f11a43ccc2e4539cb9e4b18345907fe991ca8a4b93657fb9265138d7
7
+ data.tar.gz: 7edb37e82f9f3595bfe6d2002684c8dec2a40dbd7b7cd04440dad519a2e68d521793831fd717786cb53f6466385eb264e2196e4f8c67500feb3ac08bb2eb28d3
data/issues.rec CHANGED
@@ -317,3 +317,9 @@ Description: 1. Documentation is improperly formatted. sizing is all over the pl
317
317
  +
318
318
  + Fixing this should rely on idiomatic zeitwerk & zeitwerk inflector usage, and thoroughly thinking through how to fit this into user's loader. DO NOT rely on regexes of any kind to handle this.
319
319
  Status: open
320
+
321
+ Id: C2BD1E80-C1DB-11F1-8378-FE6CB9572C2E
322
+ Updated: Tue, 06 Oct 2026 19:15:03 -0400
323
+ Title: gempilot new should not auto-override existing file
324
+ Description: Use same pattern that rails uses. Prompt for y/n/m/d whatever the options are
325
+ Status: open
@@ -5,7 +5,9 @@ module Gempilot
5
5
  ## Backs the +release:source_control_push+ task. Idempotent: pushing an
6
6
  ## already-pushed branch or tag is a no-op, so re-running a release never
7
7
  ## fails on an existing tag (unlike bundler's +already_tagged?+ guard, which
8
- ## skips the push entirely once the tag exists locally).
8
+ ## skips the push entirely once the tag exists locally). From a detached
9
+ ## HEAD, such as a CI checkout of the tag, there is no branch to push, so
10
+ ## only the tag goes to +origin+.
9
11
  class Origin
10
12
  include StrictShell
11
13
 
@@ -16,21 +18,21 @@ module Gempilot
16
18
  end
17
19
 
18
20
  def push
19
- sh "git", "push", remote, "refs/heads/#{branch}"
21
+ sh "git", "push", remote, "refs/heads/#{branch}" if branch
20
22
  sh "git", "push", remote, "refs/tags/#{tag}"
21
23
  end
22
24
 
23
25
  private
24
26
 
25
27
  def branch
26
- @branch ||= resolve_branch
27
- end
28
+ return @branch if defined?(@branch)
28
29
 
29
- def resolve_branch
30
- name = capture("git", "rev-parse", "--abbrev-ref", "HEAD")
31
- raise "Cannot push from a detached HEAD; check out a branch first" if name == "HEAD"
30
+ @branch = attached_branch
31
+ end
32
32
 
33
- name
33
+ def attached_branch
34
+ out, status = Open3.capture2("git", "symbolic-ref", "--quiet", "--short", "HEAD")
35
+ out.strip if status.success?
34
36
  end
35
37
 
36
38
  def remote
@@ -38,15 +40,10 @@ module Gempilot
38
40
  end
39
41
 
40
42
  def configured_remote
43
+ return unless branch
44
+
41
45
  out, status = Open3.capture2("git", "config", "--get", "branch.#{branch}.remote")
42
46
  out.strip if status.success?
43
47
  end
44
-
45
- def capture(*args)
46
- out, status = Open3.capture2(*args)
47
- raise "Command #{args.join(" ").inspect} failed (exit #{status.exitstatus})" unless status.success?
48
-
49
- out.strip
50
- end
51
48
  end
52
49
  end
@@ -15,8 +15,9 @@ module Gempilot
15
15
 
16
16
  attr_reader :root
17
17
 
18
- def initialize(root = Dir.pwd)
18
+ def initialize(root = Dir.pwd, name: nil)
19
19
  @root = Pathname(root)
20
+ @declared_name = name
20
21
  @verifications = Set.new
21
22
  end
22
23
 
@@ -89,6 +90,18 @@ module Gempilot
89
90
  end
90
91
 
91
92
  def fetch_lib_project
93
+ case @declared_name
94
+ in String then declared_lib_project
95
+ in nil then discover_lib_project
96
+ end
97
+ end
98
+
99
+ def declared_lib_project
100
+ name_segments = @declared_name.split("-")
101
+ lib.join(*name_segments).tap { verify_existence! it }
102
+ end
103
+
104
+ def discover_lib_project
92
105
  dirs = shallowest_entry_dirs
93
106
  case dirs.count
94
107
  in 0 then raise ProjectIntrospectionError, "Could not identify project dir"
@@ -1,3 +1,3 @@
1
1
  module Gempilot
2
- VERSION = "0.3.3".freeze
2
+ VERSION = "0.3.5".freeze
3
3
  end
@@ -8,9 +8,9 @@ module Gempilot
8
8
 
9
9
  attr_reader :project
10
10
 
11
- def initialize(root: Dir.pwd)
11
+ def initialize(root: Dir.pwd, project_name: nil)
12
12
  super()
13
- @project = Project.new(root)
13
+ @project = Project.new(root, name: project_name)
14
14
  define_tasks
15
15
  end
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gempilot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Gillis
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  requirements: []
168
- rubygems_version: 4.0.22
168
+ rubygems_version: 4.0.20
169
169
  specification_version: 4
170
170
  summary: A toolkit for creating, managing, and releasing your own rubygems
171
171
  test_files: []