gempilot 0.4.0 → 0.4.1
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/CLAUDE.md +2 -2
- data/data/templates/gem/Gemfile.erb +1 -0
- data/lib/gempilot/rbs_task.rb +17 -1
- data/lib/gempilot/rubygems/env.rb +37 -0
- data/lib/gempilot/version.rb +1 -1
- data/rbs_collection.lock.yaml +1 -1
- data/rbs_collection.yaml +15 -18
- data/sig/gempilot/rubygems/env.rbs +15 -0
- metadata +3 -2
- data/vendor/vendored.gemv +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 320de6965ef0089a0e50d5a51e272a2a5ef21a3c5f48e6fc9a6aac5a2e380925
|
|
4
|
+
data.tar.gz: 7bac12867b04d35d6ec2ca2d27bd239254ef6213b9d13384691532685aa2886e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 544b3fb273103b5cbcb14c3f6e68e6a207b93ebedc2cb5387ca3b85e7c45c9ce8947f61563e6078c93e16e98774806e95d48410cee1c7f479f0195ffb1a64bd3
|
|
7
|
+
data.tar.gz: 1da8891d7d49cf3f4d7099cdf8a0a4e695527d5ac8ca1448d6fc5e3363e46293b836659c7532386bd4225fe82b2b912969483ffbaa732b5763dfeb380b198c12
|
data/CLAUDE.md
CHANGED
|
@@ -23,7 +23,7 @@ A CLI tool for creating and managing Ruby gems, built on CommandKit.
|
|
|
23
23
|
- `GemScaffold` (`lib/gempilot/cli/gem_scaffold.rb`) renders a new gem's files and runs no commands; `Commands::Create` subclasses it to run `bin/setup` and commit
|
|
24
24
|
- GemContext module (`lib/gempilot/cli/gem_context.rb`) shared by new, destroy, release, console
|
|
25
25
|
- `GemConstant` value object (`lib/gempilot/gem_constant.rb`) owns constant→namespace/path resolution for `new`/`destroy`; constants are rooted at the gem module by construction
|
|
26
|
-
- `Gempilot::RBSTask` (`lib/gempilot/rbs_task.rb`, a `Rake::TaskLib`) wraps `rbs collection`: `rbs:setup`, `rbs:clobber`, `rbs:validate`, `rbs:collection:init/install/update` (requires `rbs` in the consuming gem's bundle)
|
|
26
|
+
- `Gempilot::RBSTask` (`lib/gempilot/rbs_task.rb`, a `Rake::TaskLib`) wraps `rbs collection`: `rbs:setup`, `rbs:clobber`, `rbs:validate`, `rbs:default_gems` (adds the bundle's default gems to `rbs_collection.yaml` via `Gempilot::Rubygems::Env`), `rbs:collection:init/install/update` (requires `rbs` in the consuming gem's bundle)
|
|
27
27
|
- `SegmentedVersion` value object (`lib/gempilot/segmented_version.rb`) owns version parsing and bump arithmetic; every bump moves to the smallest version of the requested shape greater than the current version (RubyGems ordering)
|
|
28
28
|
- CommandKit::Commands::AutoLoad maps filenames in `commands/` to command names
|
|
29
29
|
|
|
@@ -48,5 +48,5 @@ A CLI tool for creating and managing Ruby gems, built on CommandKit.
|
|
|
48
48
|
- GitHub Actions CI workflow (`.github/workflows/ci.yml`)
|
|
49
49
|
- `git ls-files`-based gemspec with glob fallback for non-git repos
|
|
50
50
|
- Version lifecycle rake tasks installed via `Gempilot::VersionTask.new` (a `Rake::TaskLib`): `version:current/bump/commit/tag/untag/reset/revert` and composite `version:release`/`version:unrelease`
|
|
51
|
-
- RBS collection rake tasks via `Gempilot::RBSTask.new`; `bin/setup` runs `rake setup`, which chains `rbs:setup` → `rbs:
|
|
51
|
+
- RBS collection rake tasks via `Gempilot::RBSTask.new`; `bin/setup` runs `rake setup`, which chains `rbs:setup` → `rbs:default_gems` → `rbs:collection:init`, then `rbs:collection:install`. `gempilot create` runs the new gem's `bin/setup`, so the collection (and `rbs_collection.lock.yaml`) exist before the initial commit
|
|
52
52
|
- Publishing rake tasks (mixed into `VersionTask` via `Gempilot::ReleaseTasks`): `release` (all remotes), `release:rubygems`, `release:github`, `release:list:github`, `unrelease`, `unrelease:github`. These override and reuse bundler's `bundler/gem_tasks` release chain; `release:source_control_push` is replaced with `Gempilot::Origin` to push commit+tag idempotently
|
data/lib/gempilot/rbs_task.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require "rake/clean"
|
|
2
2
|
require "rake/tasklib"
|
|
3
|
+
require "yaml"
|
|
3
4
|
require_relative "../gempilot"
|
|
4
5
|
|
|
5
6
|
module Gempilot
|
|
@@ -31,6 +32,7 @@ module Gempilot
|
|
|
31
32
|
define_setup_task
|
|
32
33
|
define_clobber_task
|
|
33
34
|
define_validate_task
|
|
35
|
+
define_default_gems_task
|
|
34
36
|
namespace(:collection) { define_collection_tasks }
|
|
35
37
|
end
|
|
36
38
|
define_top_level_hooks
|
|
@@ -44,7 +46,21 @@ module Gempilot
|
|
|
44
46
|
|
|
45
47
|
def define_setup_task
|
|
46
48
|
desc "Install the rbs collection rbs_collection.lock.yaml pins"
|
|
47
|
-
task setup: ["rbs:collection:install"]
|
|
49
|
+
task setup: ["rbs:default_gems", "rbs:collection:install"]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def define_default_gems_task
|
|
53
|
+
yaml = collection_yaml
|
|
54
|
+
desc "List the default gems the bundle uses in rbs_collection.yaml"
|
|
55
|
+
task(default_gems: ["rbs:collection:init"]) { add_collection_gems(yaml, Rubygems::Env.new.default_gems.map(&:name)) }
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def add_collection_gems(yaml, names)
|
|
59
|
+
collection = YAML.load_file(yaml) || {}
|
|
60
|
+
listed = collection.fetch("gems", nil) || []
|
|
61
|
+
missing = names - listed.map { it["name"] }
|
|
62
|
+
collection["gems"] = listed + missing.map { { "name" => it } }
|
|
63
|
+
File.write(yaml, YAML.dump(collection))
|
|
48
64
|
end
|
|
49
65
|
|
|
50
66
|
def define_clobber_task
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Gempilot
|
|
2
|
+
module Rubygems
|
|
3
|
+
# Finds the default gems (the gems that ship with Ruby) that the current bundle locks.
|
|
4
|
+
#
|
|
5
|
+
# Gempilot::Rubygems::Env.new.default_gems.map(&:name)
|
|
6
|
+
# # => ["erb", "pp", "prettyprint", "prism", "tsort"]
|
|
7
|
+
class Env
|
|
8
|
+
def default_gems_dir
|
|
9
|
+
Pathname(Gem.default_specifications_dir)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def default_gems
|
|
13
|
+
index = all_default_gems.to_h { [it.name, it] }
|
|
14
|
+
Bundler
|
|
15
|
+
.locked_gems
|
|
16
|
+
.specs
|
|
17
|
+
.select { index.key? it.name }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def all_default_gems
|
|
21
|
+
@all_default_gems ||= begin
|
|
22
|
+
default_gems_dir
|
|
23
|
+
.children
|
|
24
|
+
.map(&:to_s)
|
|
25
|
+
.map { load_spec it }
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
def load_spec(body)
|
|
32
|
+
# noinspection RubyMismatchedReturnType
|
|
33
|
+
Gem::Specification.load body
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
data/lib/gempilot/version.rb
CHANGED
data/rbs_collection.lock.yaml
CHANGED
data/rbs_collection.yaml
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
2
|
sources:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# # If you want to avoid installing rbs files for gems, you can specify them here.
|
|
18
|
-
# - name: GEM_NAME
|
|
19
|
-
# ignore: true
|
|
3
|
+
- type: git
|
|
4
|
+
name: ruby/gem_rbs_collection
|
|
5
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
6
|
+
revision: main
|
|
7
|
+
repo_dir: gems
|
|
8
|
+
path: ".gem_rbs_collection"
|
|
9
|
+
gems:
|
|
10
|
+
- name: erb
|
|
11
|
+
- name: pp
|
|
12
|
+
- name: prettyprint
|
|
13
|
+
- name: prism
|
|
14
|
+
- name: tsort
|
|
15
|
+
- name: io-console
|
|
16
|
+
- name: json
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Gempilot
|
|
2
|
+
module Rubygems
|
|
3
|
+
class Env
|
|
4
|
+
def default_gems_dir: () -> Pathname
|
|
5
|
+
|
|
6
|
+
def default_gems: () -> Array[Gem::Specification]
|
|
7
|
+
|
|
8
|
+
def all_default_gems: () -> Array[Gem::Specification]
|
|
9
|
+
|
|
10
|
+
private
|
|
11
|
+
|
|
12
|
+
def load_spec: (string body) -> Gem::Specification
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
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.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Gillis
|
|
@@ -140,6 +140,7 @@ files:
|
|
|
140
140
|
- lib/gempilot/project/version.rb
|
|
141
141
|
- lib/gempilot/rbs_task.rb
|
|
142
142
|
- lib/gempilot/release_tasks.rb
|
|
143
|
+
- lib/gempilot/rubygems/env.rb
|
|
143
144
|
- lib/gempilot/segmented_version.rb
|
|
144
145
|
- lib/gempilot/shell.rb
|
|
145
146
|
- lib/gempilot/shell/command_failed.rb
|
|
@@ -155,7 +156,7 @@ files:
|
|
|
155
156
|
- lib/gempilot/zeitwerk_task.rb
|
|
156
157
|
- rbs_collection.lock.yaml
|
|
157
158
|
- rbs_collection.yaml
|
|
158
|
-
-
|
|
159
|
+
- sig/gempilot/rubygems/env.rbs
|
|
159
160
|
homepage: https://github.com/gillisd/gempilot
|
|
160
161
|
licenses:
|
|
161
162
|
- MIT
|
data/vendor/vendored.gemv
DELETED
|
Binary file
|