From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:58957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goAqJ-0008T2-5Y for guix-patches@gnu.org; Mon, 28 Jan 2019 12:37:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goAqI-0001PN-1i for guix-patches@gnu.org; Mon, 28 Jan 2019 12:37:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1goAqH-0001PH-UG for guix-patches@gnu.org; Mon, 28 Jan 2019 12:37:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1goAqH-0001Sf-RN for guix-patches@gnu.org; Mon, 28 Jan 2019 12:37:05 -0500 Subject: [bug#30689] [PATCH 07/39] gnu: Add ruby_version. Resent-Message-ID: From: Christopher Baines Date: Mon, 28 Jan 2019 17:35:48 +0000 Message-Id: <20190128173620.27999-7-mail@cbaines.net> In-Reply-To: <20190128173620.27999-1-mail@cbaines.net> References: <87h8dshesk.fsf@cbaines.net> <20190128173620.27999-1-mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30689@debbugs.gnu.org Required for ruby-rspec-pending-for. * gnu/packages/ruby.scm (ruby_version): New variable. --- gnu/packages/ruby.scm | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 7b6c56b4ef..19c0734fc9 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -5186,6 +5186,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)\n") + (("%q)\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") -- 2.20.1