Skip to content

Commit

Permalink
fix: vendored engines
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmoss committed Jan 3, 2025
1 parent e9e22ab commit 4a6b8e8
Show file tree
Hide file tree
Showing 34 changed files with 353 additions and 44 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ group :test do
gem 'gem2', path: './fixtures/external/gem2'
gem 'gem3', path: './fixtures/dummy/vendor/gem3'
gem 'gem4', path: './fixtures/external/gem4'
gem 'gem5', path: './fixtures/dummy/vendor/bundle/ruby/3.3.0/bundler/gems/gem5'
gem 'maxitest'
gem 'minitest-focus'
gem 'minitest-spec-rails'
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ PATH
railties (>= 7.1.0, < 8.0)
ruby-next (~> 1.0.1)

PATH
remote: fixtures/dummy/vendor/bundle/ruby/3.3.0/bundler/gems/gem5
specs:
gem5 (0.1.0)
rails (>= 7.0.4)

PATH
remote: fixtures/dummy/vendor/gem1
specs:
Expand Down Expand Up @@ -350,6 +356,7 @@ DEPENDENCIES
gem2!
gem3!
gem4!
gem5!
htmlbeautifier
maxitest
minitest-focus
Expand Down
7 changes: 7 additions & 0 deletions fixtures/dummy/lib/engines/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@font-face {
font-family: SomeFont;
font-weight: 300;
font-style: normal;
font-display: swap;
src: local("SomeFont"), url("/gem5/somefont.woff2") format("woff2");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in gem5.gemspec
gemspec
153 changes: 153 additions & 0 deletions fixtures/dummy/vendor/bundle/ruby/3.3.0/bundler/gems/gem5/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
PATH
remote: .
specs:
gem5 (0.1.0)
rails (>= 7.0.4)

GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.4)
actionpack (= 7.0.4)
activesupport (= 7.0.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.4)
actionpack (= 7.0.4)
activejob (= 7.0.4)
activerecord (= 7.0.4)
activestorage (= 7.0.4)
activesupport (= 7.0.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.4)
actionpack (= 7.0.4)
actionview (= 7.0.4)
activejob (= 7.0.4)
activesupport (= 7.0.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.4)
actionview (= 7.0.4)
activesupport (= 7.0.4)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.4)
actionpack (= 7.0.4)
activerecord (= 7.0.4)
activestorage (= 7.0.4)
activesupport (= 7.0.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.4)
activesupport (= 7.0.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.4)
activesupport (= 7.0.4)
globalid (>= 0.3.6)
activemodel (7.0.4)
activesupport (= 7.0.4)
activerecord (7.0.4)
activemodel (= 7.0.4)
activesupport (= 7.0.4)
activestorage (7.0.4)
actionpack (= 7.0.4)
activejob (= 7.0.4)
activerecord (= 7.0.4)
activesupport (= 7.0.4)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
builder (3.2.4)
concurrent-ruby (1.1.10)
crass (1.0.6)
erubi (1.11.0)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
loofah (2.19.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.8.0)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.16.3)
net-imap (0.3.1)
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.0)
timeout
net-smtp (0.3.3)
net-protocol
nio4r (2.5.8)
nokogiri (1.13.9-arm64-darwin)
racc (~> 1.4)
racc (1.6.1)
rack (2.2.4)
rack-test (2.0.2)
rack (>= 1.3)
rails (7.0.4)
actioncable (= 7.0.4)
actionmailbox (= 7.0.4)
actionmailer (= 7.0.4)
actionpack (= 7.0.4)
actiontext (= 7.0.4)
actionview (= 7.0.4)
activejob (= 7.0.4)
activemodel (= 7.0.4)
activerecord (= 7.0.4)
activestorage (= 7.0.4)
activesupport (= 7.0.4)
bundler (>= 1.15.0)
railties (= 7.0.4)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
railties (7.0.4)
actionpack (= 7.0.4)
activesupport (= 7.0.4)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
thor (1.2.1)
timeout (0.3.1)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.6)

PLATFORMS
arm64-darwin-21

DEPENDENCIES
gem5!

BUNDLED WITH
2.3.17
16 changes: 16 additions & 0 deletions fixtures/dummy/vendor/bundle/ruby/3.3.0/bundler/gems/gem5/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.libs << 'lib'
t.test_files = FileList['test/**/test_*.rb']
end

require 'rubocop/rake_task'

RuboCop::RakeTask.new

task default: %i[test rubocop]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log(1);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class Gem5::Components::Flash::Component < Proscenium::Phlex::ReactComponent
end
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'open-props/shadows';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("gem5/views/user");
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Gem5::Views
class User < Proscenium::Phlex
def view_template
h1 { 'Hello' }
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require_relative 'lib/gem5/version'

Gem::Specification.new do |spec|
spec.name = 'gem5'
spec.version = Gem5::VERSION
spec.authors = ['Joel Moss']
spec.email = ['[email protected]']
spec.required_ruby_version = '>= 2.7.0'
spec.summary = 'Test gem 5'

spec.require_paths = ['lib']
spec.metadata['rubygems_mfa_required'] = 'true'

spec.add_dependency 'rails', '>= 7.0.4'
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

require_relative 'gem5/version'
require_relative 'gem5/engine'

module Gem5
class Error < StandardError; end
module Components; end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@define-mixin blue {
color: blue;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("gem5");
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require 'proscenium'

module Gem5
class Engine < ::Rails::Engine
# isolate_namespace Gem5
engine_name 'gem5'

config.proscenium.engines << self

initializer 'gem5.autoload' do
# ActiveSupport::Dependencies.autoload_paths << "#{root}/app"

# Rails.autoloaders.main.push_dir(root.join('app'), namespace: Gem5)

ActiveSupport::Dependencies.autoload_paths.delete("#{root}/app/components")
Rails.autoloaders.main.push_dir("#{root}/app/components", namespace: Gem5::Components)
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("foo");
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { one } from "mypackage/treeshake";
import imported from "./imported";
import "/lib/foo.js"; // app
import "./foo";
import "/gem5/lib/gem5/console.js";
import styles from "./styles.module.css";

console.log(styles);
console.log("gem5");
imported();
one();
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default () => {
console.log("gem5/imported");
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@define-mixin red {
color: red;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
h1 {
@mixin red from url("./red.css");
}
h2 {
@mixin blue from url("/gem5/lib/gem5/blue.css");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

module Gem5
VERSION = '0.1.0'
end
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("/public/gem5.js");
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/stretchr/testify v1.10.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/tools v0.28.0 // indirect
Expand All @@ -29,6 +31,7 @@ require (
github.com/dop251/goja v0.0.0-20241024094426-79f3a7efcdbd
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/h2non/gock v1.2.0
github.com/k0kubun/pp/v3 v3.4.1
github.com/kr/pretty v0.3.1 // indirect
github.com/mitchellh/mapstructure v1.5.0
github.com/onsi/gomega v1.36.1
Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ github.com/h2non/gock v1.2.0 h1:K6ol8rfrRkUOefooBC8elXoaNGYkpp7y2qcxGG6BzUE=
github.com/h2non/gock v1.2.0/go.mod h1:tNhoxHYW2W42cYkYb1WqzdbYIieALC99kpYr7rH/BQk=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
github.com/k0kubun/pp/v3 v3.4.1 h1:1WdFZDRRqe8UsR61N/2RoOZ3ziTEqgTPVqKrHeb779Y=
github.com/k0kubun/pp/v3 v3.4.1/go.mod h1:+SiNiqKnBfw1Nkj82Lh5bIeKQOAkPy6Xw9CAZUZ8npI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=
Expand Down Expand Up @@ -68,6 +74,7 @@ github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
Expand Down
Loading

0 comments on commit 4a6b8e8

Please sign in to comment.