summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-01-27 20:15:27 +0000
committerChristopher Baines <christopher.baines@digital.cabinet-office.gov.uk>2019-01-29 22:56:12 +0000
commit24eeb874facba4dca63863b64abfae5252269b32 (patch)
tree8e45ff07bc6e21527582ebf50a2ccd8407ccbf2a
parent9e0dd9525af51eff41440c4c3b1e62dd783c6dc1 (diff)
downloadgnu-guix-24eeb874facba4dca63863b64abfae5252269b32.tar
gnu-guix-24eeb874facba4dca63863b64abfae5252269b32.tar.gz
gnu: Add ruby_version.
Required for ruby-rspec-pending-for. * gnu/packages/ruby.scm (ruby_version): New variable.
-rw-r--r--gnu/packages/ruby.scm47
1 files changed, 47 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 864863480c..ea4cfba5cc 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -5189,6 +5189,53 @@ display width of strings in Ruby.")
(home-page "https://github.com/janlelis/unicode-display_width")
(license license:expat)))
+;; There is another gem called 'ruby-version' so we use an underscore in this
+;; name
+(define-public ruby_version
+ (package
+ (name "ruby_version")
+ (version "1.0.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (rubygems-uri "ruby_version" version))
+ (sha256
+ (base32
+ "0854i1bjy56176anr05l5m0vc81nl53c7fyfg7sljj62m1d64dgj"))))
+ (build-system ruby-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'fix-dependencies
+ (lambda _
+ ;; Remove the Gemfile.lock, as we want to use Guix packages at
+ ;; whatever versions.
+ (delete-file "Gemfile.lock")
+ ;; Remove the incldued gem file as it's unnecessary.
+ (delete-file "pkg/ruby_version-1.0.0.gem")
+ (substitute* "ruby_version.gemspec"
+ ;; Don't require rdoc and rubygems-tasks as they're unnecessary
+ ((".*rdoc.*") "\n")
+ ((".*rubygems-tasks.*") "\n")
+ ;; Accept any version of rake and rspec
+ (("%q<rake.*") "%q<rake>)\n")
+ (("%q<rspec.*") "%q<rspec>)\n"))
+ ;; Remove the use of rubygems-tasks from the Rakefile, as it's
+ ;; unnecessary.
+ (substitute* "Rakefile"
+ (("^require 'rubygems/tasks'") "")
+ (("Gem::Tasks.new") ""))
+ #t)))))
+ (native-inputs
+ `(("bundler" ,bundler)
+ ("ruby-rspec" ,ruby-rspec)))
+ (synopsis "Ruby library to help check the Ruby version")
+ (description
+ "@code{ruby_version} provides a @code{RubyVersion} module to simplify
+checking for the right Ruby version in software.")
+ (home-page "https://github.com/janlelis/ruby_version")
+ (license license:expat)))
+
(define-public ruby-domain-name
(package
(name "ruby-domain-name")