diff --git a/importmap-rails-1.0.3-tests.txz b/importmap-rails-1.0.3-tests.txz new file mode 100644 index 0000000..d3a43f5 Binary files /dev/null and b/importmap-rails-1.0.3-tests.txz differ diff --git a/importmap-rails-1.0.3.gem b/importmap-rails-1.0.3.gem new file mode 100644 index 0000000..f996ae7 Binary files /dev/null and b/importmap-rails-1.0.3.gem differ diff --git a/rubygem-importmap-rails.spec b/rubygem-importmap-rails.spec new file mode 100644 index 0000000..73cf5e3 --- /dev/null +++ b/rubygem-importmap-rails.spec @@ -0,0 +1,85 @@ +%global gem_name importmap-rails + +Name: rubygem-%{gem_name} +Version: 1.0.3 +Release: 1 +Summary: Manage modern JavaScript in Rails without transpiling or bundling +License: MIT +URL: https://github.com/rails/importmap-rails +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# To get the test suite: +# git clone https://github.com/rails/importmap-rails.git --no-checkout +# git -C importmap-rails archive -v -o importmap-rails-1.0.3-tests.txz v1.0.3 test/ +Source1: %{gem_name}-%{version}%{?prerelease}-tests.txz + +BuildRequires: ruby +BuildRequires: ruby(release) +BuildRequires: rubygem(bundler) +BuildRequires: rubygem(rails) +BuildRequires: rubygem(sqlite3) +BuildRequires: rubygems-devel rubygem(did_you_mean) +BuildArch: noarch +# Bundles ES Module Shims +# app/assets/javascripts/es-module-shims.js +Provides: bundled(es-module-shims) = 1.4.1 + +%description +Use ESM with importmap to manage modern JavaScript in Rails without +transpiling or bundling. + + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{name}. + +%prep +%setup -q -n %{gem_name}-%{version} -b1 + +%build +gem build ../%{gem_name}-%{version}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%check +pushd .%{gem_instdir} +ln -s %{_builddir}/test + +echo 'gem "rails"' >> Gemfile +echo 'gem "sqlite3"' >> Gemfile + +# Test requires network access +mv test/packager_integration_test.rb{,.disable} + +export BUNDLE_GEMFILE="$(pwd)/Gemfile" + +# Tests require building rails app (currently fails) +echo > test/dummy/config/initializers/assets.rb +mv test/importmap_test.rb{,.disable} + +ruby -Ilib:test -rbundler -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' +popd + +%files +%dir %{gem_instdir} +%license %{gem_instdir}/MIT-LICENSE +%{gem_instdir}/app +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/README.md +%{gem_instdir}/Rakefile + +%changelog +* Wed Jan 18 2023 wangkai - 1.0.3-1 +- Init package