From 2d8b3206f65445abf460f62925112a3d3ef255e7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 04 2015 07:14:12 +0000 Subject: import rh-ror41-rubygem-coffee-script-2.2.0-6.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f182136 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/coffee-script-2.2.0.gem +SOURCES/coffee-script-tests-2.2.0.tgz diff --git a/.rh-ror41-rubygem-coffee-script.metadata b/.rh-ror41-rubygem-coffee-script.metadata new file mode 100644 index 0000000..628b774 --- /dev/null +++ b/.rh-ror41-rubygem-coffee-script.metadata @@ -0,0 +1,2 @@ +f63e4a5a86295e3011c9e561fe8a9177468abb08 SOURCES/coffee-script-2.2.0.gem +96d56bc01eb39e3136e2e517e5a45ba5361094c3 SOURCES/coffee-script-tests-2.2.0.tgz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/rubygem-coffee-script-2.2.0-Condition-minitest.patch b/SOURCES/rubygem-coffee-script-2.2.0-Condition-minitest.patch new file mode 100644 index 0000000..49f7e52 --- /dev/null +++ b/SOURCES/rubygem-coffee-script-2.2.0-Condition-minitest.patch @@ -0,0 +1,40 @@ +From 60900187617ce7dcbb6ccd94fbdfddaa8022bd0a Mon Sep 17 00:00:00 2001 +From: Joshua Peek +Date: Mon, 17 Feb 2014 17:25:02 -0600 +Subject: [PATCH] Condition minitest + +--- + test/test_coffee_script.rb | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/test/test_coffee_script.rb b/test/test_coffee_script.rb +index 9d27279..d43fbea 100644 +--- a/test/test_coffee_script.rb ++++ b/test/test_coffee_script.rb +@@ -1,8 +1,21 @@ ++begin ++ require 'minitest/autorun' ++rescue LoadError ++ require 'test/unit' ++end ++ ++TestCase = if defined? Minitest::Test ++ Minitest::Test ++ elsif defined? MiniTest::Unit::TestCase ++ MiniTest::Unit::TestCase ++ else ++ Test::Unit::TestCase ++ end ++ + require 'coffee_script' +-require 'test/unit' + require 'stringio' + +-class TestCoffeeScript < Test::Unit::TestCase ++class TestCoffeeScript < TestCase + def test_compile + assert_equal "(function() {\n puts('Hello, World!');\n}).call(this);\n", + CoffeeScript.compile("puts 'Hello, World!'\n") +-- +1.9.3 + diff --git a/SOURCES/rubygem-coffee-script-2.2.0-Export-generic-CoffeeScript-Error.patch b/SOURCES/rubygem-coffee-script-2.2.0-Export-generic-CoffeeScript-Error.patch new file mode 100644 index 0000000..248085c --- /dev/null +++ b/SOURCES/rubygem-coffee-script-2.2.0-Export-generic-CoffeeScript-Error.patch @@ -0,0 +1,42 @@ +From eeee9a0cf4c092c034d49be531678fb2f6d1acd8 Mon Sep 17 00:00:00 2001 +From: Joshua Peek +Date: Mon, 17 Feb 2014 18:07:01 -0600 +Subject: [PATCH] Export generic CoffeeScript::Error + +--- + lib/coffee_script.rb | 1 + + test/test_coffee_script.rb | 5 ++++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lib/coffee_script.rb b/lib/coffee_script.rb +index 9787565..bc154ec 100644 +--- a/lib/coffee_script.rb ++++ b/lib/coffee_script.rb +@@ -2,6 +2,7 @@ + require 'coffee_script/source' + + module CoffeeScript ++ Error = ExecJS::Error + EngineError = ExecJS::RuntimeError + CompilationError = ExecJS::ProgramError + +diff --git a/test/test_coffee_script.rb b/test/test_coffee_script.rb +index 0b3f897..eb4fd73 100644 +--- a/test/test_coffee_script.rb ++++ b/test/test_coffee_script.rb +@@ -48,8 +48,11 @@ def test_compile_with_no_wrap + end + + def test_compilation_error +- assert_raises CoffeeScript::CompilationError do ++ begin + CoffeeScript.compile("unless") ++ flunk ++ rescue CoffeeScript::Error => e ++ assert e + end + end + +-- +1.9.3 + diff --git a/SOURCES/rubygem-coffee-script-2.2.0-Fix-assertions.patch b/SOURCES/rubygem-coffee-script-2.2.0-Fix-assertions.patch new file mode 100644 index 0000000..0f25a7a --- /dev/null +++ b/SOURCES/rubygem-coffee-script-2.2.0-Fix-assertions.patch @@ -0,0 +1,70 @@ +From 9b34e37d7ecfa750f5185a0e16df1c131732e318 Mon Sep 17 00:00:00 2001 +From: Joshua Peek +Date: Mon, 17 Feb 2014 17:30:04 -0600 +Subject: [PATCH] Fix assertions + +--- + test/test_coffee_script.rb | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/test/test_coffee_script.rb b/test/test_coffee_script.rb +index d43fbea..ad3c692 100644 +--- a/test/test_coffee_script.rb ++++ b/test/test_coffee_script.rb +@@ -17,42 +17,46 @@ + + class TestCoffeeScript < TestCase + def test_compile +- assert_equal "(function() {\n puts('Hello, World!');\n}).call(this);\n", ++ assert_match "puts('Hello, World!')", + CoffeeScript.compile("puts 'Hello, World!'\n") + end + + def test_compile_with_io + io = StringIO.new("puts 'Hello, World!'\n") +- assert_equal "(function() {\n puts('Hello, World!');\n}).call(this);\n", ++ assert_match "puts('Hello, World!')", + CoffeeScript.compile(io) + end + + def test_compile_with_bare_true +- assert_equal "puts('Hello, World!');", ++ assert_no_match "function()", + CoffeeScript.compile("puts 'Hello, World!'\n", :bare => true) + end + + def test_compile_with_bare_false +- assert_equal "(function() {\n puts('Hello, World!');\n}).call(this);\n", ++ assert_match "function()", + CoffeeScript.compile("puts 'Hello, World!'\n", :bare => false) + end + + def test_compile_with_no_wrap_true +- assert_equal "puts('Hello, World!');", ++ assert_no_match "function()", + CoffeeScript.compile("puts 'Hello, World!'\n", :no_wrap => true) + end + + def test_compile_with_no_wrap +- assert_equal "(function() {\n puts('Hello, World!');\n}).call(this);\n", ++ assert_match "function()", + CoffeeScript.compile("puts 'Hello, World!'\n", :no_wrap => false) + end + + def test_compilation_error +- assert_raise CoffeeScript::CompilationError do ++ assert_raises CoffeeScript::CompilationError do + CoffeeScript.compile("unless") + end + end + ++ def assert_no_match(expected, actual) ++ assert !expected.match(actual) ++ end ++ + def assert_exception_does_not_match(pattern) + yield + flunk "no exception raised" +-- +1.9.3 + diff --git a/SOURCES/rubygem-coffee-script-2.2.0-Test-error-messages-across-versions.patch b/SOURCES/rubygem-coffee-script-2.2.0-Test-error-messages-across-versions.patch new file mode 100644 index 0000000..564609e --- /dev/null +++ b/SOURCES/rubygem-coffee-script-2.2.0-Test-error-messages-across-versions.patch @@ -0,0 +1,38 @@ +From 62abd5a9522b50e75f1756d550d4845c49b4a29f Mon Sep 17 00:00:00 2001 +From: Joshua Peek +Date: Thu, 13 Mar 2014 15:21:28 -0400 +Subject: [PATCH] Test error messages across versions + +--- + test/test_coffee_script.rb | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/test/test_coffee_script.rb b/test/test_coffee_script.rb +index eb4fd73..a7988e5 100644 +--- a/test/test_coffee_script.rb ++++ b/test/test_coffee_script.rb +@@ -48,11 +48,20 @@ def test_compile_with_no_wrap + end + + def test_compilation_error ++ error_messages = [ ++ # <=1.5 ++ "Error: Parse error on line 1: Unexpected 'POST_IF'", ++ # 1.6 ++ "SyntaxError: unexpected POST_IF", ++ # 1.7 ++ "[stdin]:1:1: error: unexpected unless\nunless\n^^^^^^" ++ ] + begin + CoffeeScript.compile("unless") + flunk + rescue CoffeeScript::Error => e +- assert e ++ assert error_messages.include?(e.message), ++ "message was #{e.message.inspect}" + end + end + +-- +1.9.3 + diff --git a/SPECS/rubygem-coffee-script.spec b/SPECS/rubygem-coffee-script.spec new file mode 100644 index 0000000..434f897 --- /dev/null +++ b/SPECS/rubygem-coffee-script.spec @@ -0,0 +1,116 @@ +%{?scl:%scl_package rubygem-%{gem_name}} +%{!?scl:%global pkg_name %{name}} + +# Generated from coffee-script-2.2.0.gem by gem2rpm -*- rpm-spec -*- +%global gem_name coffee-script + +Summary: Ruby CoffeeScript Compiler +Name: %{?scl_prefix}rubygem-%{gem_name} +Version: 2.2.0 +Release: 6%{?dist} +Group: Development/Languages +License: MIT +URL: http://github.com/josh/ruby-coffee-script +Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem +# To get the tests: +# git clone https://github.com/josh/ruby-coffee-script && cd ruby-coffee-script +# git checkout v2.2.0 && tar czf coffee-script-tests-2.2.0.tgz test/ +Source1: coffee-script-tests-%{version}.tgz +# Proposed upstream https://github.com/josh/ruby-coffee-script/pull/16 +# For initial report see https://github.com/josh/ruby-coffee-script/issues/15 +#Patch0: coffee-script-fix-newlines-in-tests.patch + +# Minitest 5.x compatibility fixes. +# https://github.com/josh/ruby-coffee-script/commit/60900187617ce7dcbb6ccd94fbdfddaa8022bd0a +Patch0: rubygem-coffee-script-2.2.0-Condition-minitest.patch +# https://github.com/josh/ruby-coffee-script/commit/9b34e37d7ecfa750f5185a0e16df1c131732e318 +Patch1: rubygem-coffee-script-2.2.0-Fix-assertions.patch +# https://github.com/josh/ruby-coffee-script/commit/eeee9a0cf4c092c034d49be531678fb2f6d1acd8 +Patch2: rubygem-coffee-script-2.2.0-Export-generic-CoffeeScript-Error.patch +# https://github.com/josh/ruby-coffee-script/commit/62abd5a9522b50e75f1756d550d4845c49b4a29f +Patch3: rubygem-coffee-script-2.2.0-Test-error-messages-across-versions.patch +Requires: %{?scl_prefix_ruby}ruby(release) +Requires: %{?scl_prefix_ruby}ruby(rubygems) +Requires: %{?scl_prefix}rubygem(coffee-script-source) +Requires: %{?scl_prefix}rubygem(execjs) +BuildRequires: %{?scl_prefix_ruby}ruby(release) +BuildRequires: %{?scl_prefix_ruby}rubygems-devel +BuildRequires: %{?scl_prefix_ruby}ruby +BuildRequires: %{?scl_prefix}rubygem(coffee-script-source) +BuildRequires: %{?scl_prefix}rubygem(execjs) +BuildRequires: %{?scl_prefix_ruby}rubygem(minitest) +BuildRequires: %{?scl_prefix}rubygem(therubyracer) +BuildRequires: %{?scl_prefix_v8}v8 +BuildArch: noarch +Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} + +%description +Ruby CoffeeScript is a bridge to the JS CoffeeScript compiler. + + +%package doc +Summary: Documentation for %{pkg_name} +Group: Documentation +Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{pkg_name} + +%prep +%setup -n %{pkg_name}-%{version} -q -c -T +%{?scl:scl enable %scl - << \EOF} +%gem_install -n %{SOURCE0} +%{?scl:EOF} + +%build + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%check +pushd .%{gem_instdir} +# unpack and patch the tests +tar xzf %{SOURCE1} +patch -p1 < %{PATCH0} +patch -p1 < %{PATCH1} +patch -p1 < %{PATCH2} +patch -p1 < %{PATCH3} + +%{?scl:scl enable %scl %scl_v8 - << \EOF} +ruby -Ilib -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' +%{?scl:EOF} +popd + +%files +%dir %{gem_instdir} +%doc %{gem_instdir}/LICENSE +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/README.md + +%changelog +* Mon Jan 26 2015 Josef Stribny - 2.2.0-6 +- rebuilt for rh-ror41 + +* Mon Feb 17 2014 Josef Stribny - 2.2.0-5 +- Depend on scldevel(v8) virtual provide + +* Tue Nov 26 2013 Josef Stribny - 2.2.0-4 +- Use v8 scl macro + +* Wed Jun 12 2013 Josef Stribny - 2.2.0-3 +- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 + +* Thu Jul 26 2012 Bohuslav Kabrda - 2.2.0-2 +- Introduce test suite. +- Specfile cleanup + +* Tue Jul 17 2012 Bohuslav Kabrda - 2.2.0-1 +- Initial package