[rubygem-coffee-script] Initial import

Bohuslav Kabrda bkabrda at fedoraproject.org
Wed Jul 18 05:35:53 UTC 2012


commit 418dd8b68c9a9a649774cc0f1360d70ec8f028e6
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Wed Jul 18 07:35:39 2012 +0200

    Initial import

 .gitignore                                |    2 +
 coffee-script-fix-newlines-in-tests.patch |   50 +++++++++++++++++
 rubygem-coffee-script.spec                |   82 +++++++++++++++++++++++++++++
 sources                                   |    2 +
 4 files changed, 136 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..f0a966d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/coffee-script-2.2.0.gem
+/coffee-script-tests-2.2.0.tgz
diff --git a/coffee-script-fix-newlines-in-tests.patch b/coffee-script-fix-newlines-in-tests.patch
new file mode 100644
index 0000000..481e09a
--- /dev/null
+++ b/coffee-script-fix-newlines-in-tests.patch
@@ -0,0 +1,50 @@
+commit 76f8f92916c9a96913fa5db5eb9e1e7cf7d704c8
+Author: Bohuslav Kabrda <bkabrda at redhat.com>
+Date:   Tue Jul 17 15:20:04 2012 +0200
+
+    Make the test suite work with coffee-script versions, that use multiple newlines instead of just one
+
+diff --git a/test/test_coffee_script.rb b/test/test_coffee_script.rb
+index 9d27279..b492b14 100644
+--- a/test/test_coffee_script.rb
++++ b/test/test_coffee_script.rb
+@@ -4,33 +4,33 @@ require 'stringio'
+ 
+ class TestCoffeeScript < Test::Unit::TestCase
+   def test_compile
+-    assert_equal "(function() {\n  puts('Hello, World!');\n}).call(this);\n",
++    assert_match /\(function\(\) {\n+  puts\('Hello, World!'\);\n+}\).call\(this\);\n/,
+       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 /\(function\(\) {\n+  puts\('Hello, World!'\);\n+}\).call\(this\);\n/,
+       CoffeeScript.compile(io)
+   end
+ 
+   def test_compile_with_bare_true
+-    assert_equal "puts('Hello, World!');",
++    assert_match /\n*puts\('Hello, World!'\);\n/,
+       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\(\) {\n+  puts\('Hello, World!'\);\n+}\).call\(this\);\n/,
+       CoffeeScript.compile("puts 'Hello, World!'\n", :bare => false)
+   end
+ 
+   def test_compile_with_no_wrap_true
+-    assert_equal "puts('Hello, World!');",
++    assert_match /\n*puts\('Hello, World!'\);\n/,
+       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\(\) {\n+  puts\('Hello, World!'\);\n+}\).call\(this\);\n/,
+       CoffeeScript.compile("puts 'Hello, World!'\n", :no_wrap => false)
+   end
+ 
diff --git a/rubygem-coffee-script.spec b/rubygem-coffee-script.spec
new file mode 100644
index 0000000..0813a4a
--- /dev/null
+++ b/rubygem-coffee-script.spec
@@ -0,0 +1,82 @@
+# Generated from coffee-script-2.2.0.gem by gem2rpm -*- rpm-spec -*-
+%global gem_name coffee-script
+%global rubyabi 1.9.1
+
+Summary: Ruby CoffeeScript Compiler
+Name: rubygem-%{gem_name}
+Version: 2.2.0
+Release: 1%{?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
+Requires: ruby(abi) = %{rubyabi}
+Requires: ruby(rubygems)
+Requires: rubygem(coffee-script-source)
+Requires: rubygem(execjs)
+BuildRequires: ruby(abi) = %{rubyabi}
+BuildRequires: rubygems-devel
+BuildRequires: ruby
+BuildRequires: rubygem(coffee-script-source)
+BuildRequires: rubygem(execjs)
+BuildRequires: rubygem(minitest)
+BuildRequires: rubygem(therubyracer)
+BuildArch: noarch
+Provides: rubygem(%{gem_name}) = %{version}
+
+%description
+Ruby CoffeeScript is a bridge to the JS CoffeeScript compiler.
+
+
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
+
+%description doc
+Documentation for %{name}
+
+%prep
+%setup -q -c -T
+mkdir -p .%{gem_dir}
+gem install --local --install-dir .%{gem_dir} \
+            --force %{SOURCE0}
+
+%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}
+
+testrb -Ilib test
+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
+* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda at redhat.com> - 2.2.0-1
+- Initial package
diff --git a/sources b/sources
index e69de29..b35403d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+3d1d857270314059e8293be8e8a3bd1e  coffee-script-2.2.0.gem
+19cd3dd4f53df944908cc1e251fdeb15  coffee-script-tests-2.2.0.tgz


More information about the scm-commits mailing list