bundler-hyperdrive 0.2.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fd29a6711faa11866dd5b001fd09a94b70e42e3cc7c102e9cb4b1cf073039dd7
4
+ data.tar.gz: 9e9b7c2bd9f394f36d1031a28d4e8d56403335b90df736b2db6da1cbfc5dcfad
5
+ SHA512:
6
+ metadata.gz: 91c6f2481def0efcf29a5abca2abefe1c1f7377670cb4188790cd3342c028215325f67fb17a40a9e595ace1c344223c1fdb5b170a1ddb1ae5cb0108bf207295b
7
+ data.tar.gz: 825b9447666a8277fb7ba19bb313bba2b926d14b82af52b8f9e83b76ab69b4bb961120e53727d6269e2419b02eb2e09f521f74da10f8bb6b5ecc191a432e3f47
data/CHANGELOG.md ADDED
@@ -0,0 +1,41 @@
1
+ # Changelog
2
+
3
+ All notable changes to `bundler-hyperdrive` are documented in this file.
4
+ The gem versions and releases independently of `rails-hyperdrive`.
5
+
6
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ ## [Unreleased]
10
+
11
+ ## [0.2.0] - 2026-08-26
12
+
13
+ ### Changed
14
+
15
+ - Renamed the gem from `bundler-rails-hyperdrive` to `bundler-hyperdrive`. The
16
+ Gemfile directive becomes `plugin "bundler-hyperdrive"` and releases are
17
+ tagged `bundler-hyperdrive/vX.Y.Z`. The `Bundler::Hyperdrive` namespace and
18
+ the hook's behavior are unchanged.
19
+
20
+ ## [0.1.1] - 2026-08-24
21
+
22
+ ### Fixed
23
+
24
+ - The `bundle install` hook now rescues `ScriptError` (`LoadError`, `SyntaxError`)
25
+ alongside `StandardError`, in both `Bundler::Hyperdrive.auto_install` and the
26
+ hook block itself. A failure to load rails-hyperdrive's code — possible for any
27
+ release in the deliberately uncapped supported range — degrades to the usual
28
+ one-line `[hyperdrive] auto-install skipped (…)` report instead of failing the
29
+ user's `bundle install`.
30
+
31
+ ## [0.1.0] - 2026-08-04
32
+
33
+ ### Added
34
+
35
+ - Initial release: an `after-install-all` Bundler hook that installs missing
36
+ hyperdrive artifacts during `bundle install`, with zero runtime dependencies.
37
+
38
+ [Unreleased]: https://github.com/rails-hyperdrive/rails-hyperdrive/compare/bundler-hyperdrive/v0.2.0...HEAD
39
+ [0.2.0]: https://github.com/rails-hyperdrive/rails-hyperdrive/releases/tag/bundler-hyperdrive/v0.2.0
40
+ [0.1.1]: https://github.com/rails-hyperdrive/rails-hyperdrive/releases/tag/bundler-hyperdrive/v0.1.1
41
+ [0.1.0]: https://github.com/rails-hyperdrive/rails-hyperdrive/releases/tag/bundler-hyperdrive/v0.1.0
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bakaface
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ module Bundler
2
+ module Hyperdrive
3
+ VERSION = "0.2.0".freeze
4
+ end
5
+ end
@@ -0,0 +1,55 @@
1
+ require_relative "hyperdrive/version"
2
+
3
+ module Bundler
4
+ module Hyperdrive
5
+ HOST_GEM = "rails-hyperdrive".freeze
6
+ SUPPORTED_RAILS_HYPERDRIVE = Gem::Requirement.new(">= 0.2")
7
+ PREFIX = "[hyperdrive] ".freeze
8
+ DEVELOPMENT = "development".freeze
9
+
10
+ module_function
11
+
12
+ # Runs inside `bundle install`: every failure must degrade to a printed
13
+ # line, never a raised error that fails the install.
14
+ def auto_install
15
+ return unless development_environment?
16
+
17
+ spec = ::Bundler.load.specs.find { |s| s.name == HOST_GEM }
18
+ unless spec
19
+ report "#{HOST_GEM} is not in the bundle; nothing to auto-install"
20
+ return
21
+ end
22
+
23
+ unless SUPPORTED_RAILS_HYPERDRIVE.satisfied_by?(spec.version)
24
+ report "auto-install skipped: #{HOST_GEM} #{spec.version} is outside " \
25
+ "the supported range (#{SUPPORTED_RAILS_HYPERDRIVE}); run bin/rails hyperdrive:sync manually"
26
+ return
27
+ end
28
+
29
+ lib = File.join(spec.full_gem_path, "lib")
30
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
31
+ require "rails/hyperdrive/auto_install"
32
+
33
+ result = ::Rails::Hyperdrive::AutoInstall.run(root: ::Bundler.root.to_s)
34
+ result.messages.each do |line|
35
+ line.match?(/\A\s/) ? $stdout.puts(line) : report(line)
36
+ end
37
+ rescue StandardError, ScriptError => e
38
+ report "auto-install skipped (#{e.class}: #{e.message}); run bin/rails hyperdrive:sync manually"
39
+ nil
40
+ end
41
+
42
+ # The hook fires on every install — CI and deploys included — where any
43
+ # output would be noise, so outside development it returns silently
44
+ # before touching the host application's code.
45
+ def development_environment?
46
+ env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || DEVELOPMENT
47
+ return false unless env == DEVELOPMENT
48
+ ENV["CI"].nil? || ENV["CI"].empty?
49
+ end
50
+
51
+ def report(message)
52
+ $stdout.puts("#{PREFIX}#{message}")
53
+ end
54
+ end
55
+ end
data/plugins.rb ADDED
@@ -0,0 +1,9 @@
1
+ require_relative "lib/bundler/hyperdrive"
2
+
3
+ # An exception escaping this block fails the user's `bundle install`, so this
4
+ # rescue backs up auto_install's own.
5
+ Bundler::Plugin.add_hook("after-install-all") do |_dependencies|
6
+ Bundler::Hyperdrive.auto_install
7
+ rescue StandardError, ScriptError => e
8
+ puts "[hyperdrive] auto-install skipped (#{e.class}: #{e.message}); run bin/rails hyperdrive:sync manually"
9
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bundler-hyperdrive
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Bakaface
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: |
13
+ A Bundler plugin for applications using rails-hyperdrive. After every
14
+ `bundle install` in development it installs the artifacts (skills and
15
+ guidelines) that newly bundled companion gems ship — additively, never
16
+ overwriting or deleting a file — and reports anything that needs
17
+ `bin/rails hyperdrive:sync`. It never fails an install.
18
+ email:
19
+ - afaceisnomore@gmail.com
20
+ executables: []
21
+ extensions: []
22
+ extra_rdoc_files: []
23
+ files:
24
+ - CHANGELOG.md
25
+ - LICENSE.txt
26
+ - lib/bundler/hyperdrive.rb
27
+ - lib/bundler/hyperdrive/version.rb
28
+ - plugins.rb
29
+ homepage: https://github.com/rails-hyperdrive/rails-hyperdrive
30
+ licenses:
31
+ - MIT
32
+ metadata:
33
+ homepage_uri: https://github.com/rails-hyperdrive/rails-hyperdrive
34
+ source_code_uri: https://github.com/rails-hyperdrive/rails-hyperdrive
35
+ changelog_uri: https://github.com/rails-hyperdrive/rails-hyperdrive/blob/main/bundler-hyperdrive/CHANGELOG.md
36
+ allowed_push_host: https://rubygems.org
37
+ rubygems_mfa_required: 'true'
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 3.2.0
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubygems_version: 3.6.9
53
+ specification_version: 4
54
+ summary: Bundler plugin that installs rails-hyperdrive companion artifacts on bundle
55
+ install.
56
+ test_files: []