Blob Blame History Raw
# Generated from spring-watcher-listen-2.0.0.gem by gem2rpm -*- rpm-spec -*-
%global gem_name spring-watcher-listen

Name: rubygem-%{gem_name}
Version: 2.0.0
Release: 1%{?dist}
Summary: Makes spring watch files using the listen gem
Group: Development/Languages
License: MIT
URL: https://github.com/jonleighton/spring-watcher-listen
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(spring)
BuildRequires: rubygem(listen)
BuildRequires: rubygem(activesupport)
# spring requires bundler as a runtime dependency.
BuildRequires: rubygem(bundler)

BuildArch: noarch

%description
This gem makes Spring watch the filesystem for changes using Listen rather than
by polling the filesystem. On larger projects this means spring will be more
responsive, more accurate and use less cpu on local filesystems.


%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
gem unpack %{SOURCE0}

%setup -q -D -T -n  %{gem_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec

%build
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec

# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/

# Run the test suite
%check
pushd .%{gem_instdir}
sed -i '/bundler\/setup/ s/^/#/' test/helper.rb
# Run only unit test now, acceptance test wants to compile gems extensions
mv test/acceptance_test.rb{,.disable}
# Asking about tests finish with a error "undefined method callback!".
# https://github.com/jonleighton/spring-watcher-listen/issues/12
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd

%files
%dir %{gem_instdir}
%exclude %{gem_instdir}/.*
%license %{gem_instdir}/LICENSE.txt
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%{gem_instdir}/spring-watcher-listen.gemspec
%{gem_instdir}/test

%changelog
* Thu Jul 28 2016 Jun Aruga <jaruga@redhat.com> - 2.0.0-1
- Initial package