回退 'Pull Request !6 : Update to 6.0.3.4-1'

This commit is contained in:
木得感情的openEuler机器人 2021-12-20 14:05:28 +00:00 committed by Gitee
parent 07ce53ab8f
commit e2a92a3bc2
6 changed files with 68 additions and 46 deletions

BIN
actioncable-5.2.4.4.gem Normal file

Binary file not shown.

Binary file not shown.

37
recompile_js.rb Normal file
View File

@ -0,0 +1,37 @@
require 'pathname'
require 'sprockets'
require 'coffee-script'
require 'action_cable'
dir = File.dirname(__FILE__)
root_path = Pathname.new(dir)
destination_path = root_path.join("lib/assets/compiled")
puts 'Compiling Action Cable assets...'
precompile_list = %w(action_cable.js)
environment = Sprockets::Environment.new
environment.gzip = false
Pathname.glob(root_path.join("app/assets/*/")) do |subdir|
environment.append_path subdir
end
compile_path = root_path.join("tmp/sprockets")
compile_path.rmtree if compile_path.exist?
compile_path.mkpath
manifest = Sprockets::Manifest.new(environment.index, compile_path)
manifest.compile(precompile_list)
destination_path.rmtree if destination_path.exist?
manifest.assets.each do |path, fingerprint_path|
destination_path.join(path).dirname.mkpath
FileUtils.cp(compile_path.join(fingerprint_path), destination_path.join(path))
end
puts 'Done'

View File

@ -1,58 +1,47 @@
%global pkg_name %{name}
%global gem_name actioncable
%global gem_require_name %{gem_name}
%global recompile_js 1
Name: rubygem-%{gem_name}
Version: 6.0.3.4
Version: 5.2.4.4
Release: 1
Summary: WebSocket framework for Rails
Group: Development/Languages
License: MIT
URL: https://rubyonrails.org
URL: http://rubyonrails.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/rails/rails/archive/refs/tags/v%{version}.tar.gz
Requires: ruby(release)
Requires: ruby >= 2.5.0
Requires: ruby(rubygems)
Requires: rubygem(actionpack) = 6.0.3.4
Requires: rubygem(nio4r) >= 2.0
Requires: rubygem(nio4r) < 3
Requires: rubygem(websocket-driver) >= 0.6.1
BuildRequires: ruby(release)
BuildRequires: ruby >= 2.5.0
BuildRequires: rubygems-devel
BuildRequires: %{_bindir}/redis-server rubygem(redis)
Source1: https://github.com/rails/rails/archive/v%{version}.tar.gz
# Recompile with script extracted from
# https://github.com/rails/rails/blob/71d406697266fc2525706361b86aeb85183fe4c7/actioncable/Rakefile
Source2: recompile_js.rb
BuildRequires: ruby(release) rubygems-devel > 1.3.1 ruby >= 2.2.2
BuildRequires: rubygem(actionpack) = %{version} rubygem(mocha) rubygem(nio4r) rubygem(puma)
BuildRequires: %{_bindir}/redis-server rubygem(redis) rubygem(websocket-driver)
%if 0%{?recompile_js} > 0
BuildRequires: rubygem(coffee-script) rubygem(sprockets) nodejs
%endif
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}
Obsoletes: tfm-ror52-rubygem-%{gem_name} <= 5.2.1
%description
Structure many real-time application concerns into channels over a single
WebSocket connection.
%package doc
Summary: Documentation for %{pkg_name}
Group: Documentation
Requires: %{pkg_name} = %{version}-%{release}
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{pkg_name}.
Documentation for %{name}.
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
%setup -q -D -T -n %{gem_name}-%{version} -a 1
ln -s rails-%{version}/%{gem_name}/app app
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build
%if 0%{?recompile_js} > 0
cp -a %{SOURCE2} .
rm -rf lib/assets/compiled
RUBYOPT=-Ilib ruby recompile_js.rb
%endif
gem build %{gem_name}.gemspec
%gem_install
%install
@ -68,14 +57,13 @@ mv test/client_test.rb{,.disable}
mv test/subscription_adapter/postgresql_test.rb{,.disable}
REDIS_DIR=$(mktemp -d)
redis-server --dir $REDIS_DIR --pidfile $REDIS_DIR/redis.pid --daemonize yes
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb"'
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
kill -INT $(cat $REDIS_DIR/redis.pid) || echo end
popd
%files
%dir %{gem_instdir}
%license %{gem_instdir}/MIT-LICENSE
%{gem_instdir}/app
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
@ -86,9 +74,6 @@ popd
%doc %{gem_instdir}/README.md
%changelog
* Mon Jun 07 2021 jiangxinyu <jiangxinyu@kylinos.cn> - 6.0.3.4-1
- Update to 6.0.3.4
* Mon Feb 8 2021 sunguoshuai <sunguoshuai@huawei.com> - 5.2.4.4-1
- Upgrade to 5.2.4.4

BIN
v5.2.4.4.tar.gz Normal file

Binary file not shown.

Binary file not shown.