From 2b2ec9bbdde6b37449026eec01619d5ee159cbae Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Mon, 5 Feb 2018 12:02:01 +0100 Subject: gnu: ruby-listen: Add tests. --- gnu/local.mk | 1 + .../patches/ruby-listen-patch-gemspec.patch | 16 ++++++++++ gnu/packages/ruby.scm | 36 +++++++++++++++++----- 3 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 gnu/packages/patches/ruby-listen-patch-gemspec.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6b649e1f86..54702cd9b8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1214,6 +1214,7 @@ dist_patch_DATA = \ %D%/packages/patches/ruby-concurrent-ignore-broken-test.patch \ %D%/packages/patches/ruby-concurrent-test-arm.patch \ %D%/packages/patches/ruby-rack-ignore-failing-test.patch \ + %D%/packages/patches/ruby-listen-patch-gemspec.patch \ %D%/packages/patches/ruby-tzinfo-data-ignore-broken-test.patch\ %D%/packages/patches/rust-1.19-mrustc.patch \ %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \ diff --git a/gnu/packages/patches/ruby-listen-patch-gemspec.patch b/gnu/packages/patches/ruby-listen-patch-gemspec.patch new file mode 100644 index 0000000000..dd4b190b3e --- /dev/null +++ b/gnu/packages/patches/ruby-listen-patch-gemspec.patch @@ -0,0 +1,16 @@ +diff --git a/listen.gemspec b/listen.gemspec +index 4e110b0..cda047b 100644 +--- a/listen.gemspec ++++ b/listen.gemspec +@@ -14,9 +14,8 @@ Gem::Specification.new do |s| + s.description = 'The Listen gem listens to file modifications and '\ + 'notifies you about the changes. Works everywhere!' + +- s.files = `git ls-files -z`.split("\x0").select do |f| +- %r{^(?:bin|lib)\/} =~ f +- end + %w(CHANGELOG.md CONTRIBUTING.md LICENSE.txt README.md) ++ s.files = `find bin lib -type f |sort`.split("\n") + ++ %w(CHANGELOG.md CONTRIBUTING.md LICENSE.txt README.md) + + s.test_files = [] + s.executable = 'listen' diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 561cd8d732..70cf8cfb86 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -4099,18 +4099,38 @@ a native C extension.") (source (origin (method url-fetch) - (uri (rubygems-uri "listen" version)) + ;; The gem does not include a Rakefile, so we fetch the tarball from + ;; Github. + (uri (string-append "https://github.com/guard/listen/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "01v5mrnfqm6sgm8xn2v5swxsn1wlmq7rzh2i48d4jzjsc7qvb6mx")))) + "0f0mx4nzpd17svvmkcb2q66w3gdvs1zkrpc0p3wq1s2va5b5cnss")) + (patches (search-patches "ruby-listen-patch-gemspec.patch")))) (build-system ruby-build-system) - (arguments '(#:tests? #f)) ; no tests + (arguments + `(#:test-target "spec" + #:phases + (modify-phases %standard-phases + (add-before 'check 'fix-dependencies' + (lambda _ + (substitute* "Rakefile" + ((".*rubocop.*") "")) + #t))))) + (native-inputs + `(("bundler" ,bundler) + ("ruby-rspec" ,ruby-rspec))) + (inputs + `(("ruby-thor" ,ruby-thor))) (propagated-inputs - `(("ruby-rb-inotify" ,ruby-rb-inotify) - ("ruby-rb-fsevent" ,ruby-rb-fsevent))) - (synopsis "Listen to file modifications") - (description "The Listen gem listens to file modifications and notifies -you about the changes.") + `(("ruby-rb-fsevent" ,ruby-rb-fsevent) + ("ruby-rb-inotify" ,ruby-rb-inotify) + ("ruby-ruby-dep" ,ruby-ruby-dep))) + (synopsis + "The Listen gem listens to file modifications and notifies you about the changes. Works everywhere!") + (description + "The Listen gem listens to file modifications and notifies you about the changes. Works everywhere!") (home-page "https://github.com/guard/listen") (license license:expat))) -- cgit v1.2.3