bundler-rails-hyperdrive 0.1.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 +7 -0
- data/LICENSE.txt +21 -0
- data/lib/bundler/hyperdrive/version.rb +5 -0
- data/lib/bundler/hyperdrive.rb +55 -0
- data/plugins.rb +5 -0
- metadata +55 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9db59a71369ff4729d982332032e7f9493b4db3fa4194b906f3d0a6ae563d6f7
|
|
4
|
+
data.tar.gz: 40046282b8ecd15b68624fb38f574d1cd0be78b768c938eb3a6f3255805c141a
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: a42dd430a4991863f031c6ac9e320ded42bb45bf62d10c1564a14a2f21a28b0333d3297e8a3530846a947c7757378b0465e30e18b8b1b9822332fc8ffb0259e1
|
|
7
|
+
data.tar.gz: 6b7588378334f4fc527551341f1094769ccbd4ed7b438b9df102ebbf61dcd000b5c7848e850c13cc6a31b1c27f95621c6ad97d65ae0ec9a29e4dd112ef8b1c85
|
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,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 => 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
metadata
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: bundler-rails-hyperdrive
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.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
|
+
- LICENSE.txt
|
|
25
|
+
- lib/bundler/hyperdrive.rb
|
|
26
|
+
- lib/bundler/hyperdrive/version.rb
|
|
27
|
+
- plugins.rb
|
|
28
|
+
homepage: https://github.com/rails-hyperdrive/rails-hyperdrive
|
|
29
|
+
licenses:
|
|
30
|
+
- MIT
|
|
31
|
+
metadata:
|
|
32
|
+
homepage_uri: https://github.com/rails-hyperdrive/rails-hyperdrive
|
|
33
|
+
source_code_uri: https://github.com/rails-hyperdrive/rails-hyperdrive
|
|
34
|
+
changelog_uri: https://github.com/rails-hyperdrive/rails-hyperdrive/blob/main/CHANGELOG.md
|
|
35
|
+
allowed_push_host: https://rubygems.org
|
|
36
|
+
rubygems_mfa_required: 'true'
|
|
37
|
+
rdoc_options: []
|
|
38
|
+
require_paths:
|
|
39
|
+
- lib
|
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
41
|
+
requirements:
|
|
42
|
+
- - ">="
|
|
43
|
+
- !ruby/object:Gem::Version
|
|
44
|
+
version: 3.2.0
|
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
|
+
requirements:
|
|
47
|
+
- - ">="
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '0'
|
|
50
|
+
requirements: []
|
|
51
|
+
rubygems_version: 3.6.9
|
|
52
|
+
specification_version: 4
|
|
53
|
+
summary: Bundler plugin that installs rails-hyperdrive companion artifacts on bundle
|
|
54
|
+
install.
|
|
55
|
+
test_files: []
|