ca25f72c7607aa7209c576a4b15769a4a5e5684e
- all catalog services (update/software/highlighted/builds/file/file-manager/ download/image + SoftwareResponseBuilder), the SoftwareUpdater platform services and their concerns, Blueprinter serializers (incl. TimestampFields) and the 4 DTOs now live in the engine under WarpEngine:: - constantize dispatch strings use absolute names (WarpEngine::SoftwareUpdater::<Platform>Service) - container paths read from WarpEngine.config everywhere (FileService, DownloadService, FileManagerService, ArchiveExtraction, ReleaseSerializer path rewriting); FileManagerService base path is now lazy - engine requires blueprinter itself; gemspec declares blueprinter + rubyzip - engine test suite: spec/dummy app (mysql warp_engine_test, catalog-only schema), rails_helper with engine-local factories; catalog model/service specs and factories moved from the host - host suite keeps TTG specs and loads catalog factories from the engine Verified: engine suite 40 green, host suite 14 green, /api/software and /api/builds byte-identical to baselines, admin OK. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WarpEngine
Mountable Rails engine: retro szoftverkatalógus CI-pipeline-ból hívható release-updaterrel, publikus read-only JSON API-val és a host adminjába betöltődő ActiveAdmin erőforrásokkal.
Használat
# Gemfile
gem "warp_engine", path: "../../libs/ruby/warp_engine"
# config/routes.rb — utolsó sorként, hogy a host route-jai nyerjenek
mount WarpEngine::Engine => "/"
# config/initializers/warp_engine.rb
WarpEngine.configure do |c|
c.file_container_path = ENV.fetch("FILE_CONTAINER_PATH", "/softwares")
c.image_container_path = ENV.fetch("IMAGE_CONTAINER_PATH", "/images")
c.update_secret = ENV["UPDATE_SECRET"]
# Ha a host modelljei is használnak katalógus-képeket:
c.image_owners << {
label: "member",
image_ids: -> { Member.where.not(image_id: nil).distinct.pluck(:image_id) },
usage_label: ->(image) { "member" if Member.where(image_id: image.id).exists? }
}
end
Megjegyzések
- A modellek soft-delete-et használnak (
default_scope { where(deleted_at: nil) }); az updater.unscoped-dal "feltámasztja" az újra beküldött, korábban törölt rekordokat. - A táblanevek prefix nélküliek (
softwares,releases, ...). - Az admin erőforrások a host ActiveAdmin példányába töltődnek be; auth (Devise) a host dolga.
Languages
Ruby
100%