Subject: [bug#76314] [PATCH ruby-team 11/71] gnu: ruby-flores: Update to 0.0.8-0.92fded0.

From: Nicolas Graves <[email-masked]>
Date: Sun, 16 Feb 2025 01:33:39 +0100

* gnu/packages/ruby.scm (ruby-flores): Update to 0.0.8-0.92fded0.
[origin]<source>: Move to git-fetch to be able to choose latest
commit. Use snippet to list files in flores.gemspec. Record patch to
fix deprecations.
* gnu/local.mk: Record patch.
* gnu/packages/patches/ruby-flores-fix-deprecations.patch: Add patch.
---
 gnu/local.mk                                  |  1 +
 .../ruby-flores-fix-deprecations.patch        | 38 +++++++++++++
 gnu/packages/ruby.scm                         | 56 +++++++++++--------
 3 files changed, 72 insertions(+), 23 deletions(-)
 create mode 100644 gnu/packages/patches/ruby-flores-fix-deprecations.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8f88654ef6..ecb91de430 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2182,6 +2182,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ruby-hydra-minimal-no-byebug.patch	\
   %D%/packages/patches/ruby-anystyle-data-immutable-install.patch	\
   %D%/packages/patches/ruby-anystyle-fix-dictionary-populate.patch	\
+  %D%/packages/patches/ruby-flores-fix-deprecations.patch	\
   %D%/packages/patches/ruby-latex-decode-fix-test.patch		\
   %D%/packages/patches/ruby-mustache-1.1.1-fix-race-condition-tests.patch \
   %D%/packages/patches/ruby-nokogiri.patch			\
diff --git a/gnu/packages/patches/ruby-flores-fix-deprecations.patch b/gnu/packages/patches/ruby-flores-fix-deprecations.patch
new file mode 100644
index 0000000000..036c308edf
--- /dev/null
+++ b/gnu/packages/patches/ruby-flores-fix-deprecations.patch
@@ -0,0 +1,38 @@
+From b1c38d58d5e94df8c74c9c69c2f9b5841589a4bd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?C=C3=A9dric=20Boutillier?= <[email-masked]>
+Date: Mon, 23 Sep 2024 23:47:22 +0200
+Subject: [PATCH] Replace deprecated Fixnum by Integer
+
+https://github.com/jordansissel/ruby-flores/pull/14
+
+---
+ lib/flores/random.rb       | 2 +-
+ spec/flores/random_spec.rb | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/flores/random.rb b/lib/flores/random.rb
+index e512b80..ec44f8b 100644
+--- a/lib/flores/random.rb
++++ b/lib/flores/random.rb
+@@ -32,7 +32,7 @@ module Flores::Random
+   # * The length can be a number or a range `x..y`. If a range, it must be ascending (x < y)
+   # * Negative lengths are not permitted and will raise an ArgumentError
+   #
+-  # @param length [Fixnum or Range] the length of text to generate
++  # @param length [Integer or Range] the length of text to generate
+   # @return [String] the generated text
+   def self.text(length)
+     return text_range(length) if length.is_a?(Range)
+diff --git a/spec/flores/random_spec.rb b/spec/flores/random_spec.rb
+index 9e479fb..0e792c3 100644
+--- a/spec/flores/random_spec.rb
++++ b/spec/flores/random_spec.rb
+@@ -108,7 +108,7 @@
+   end
+ 
+   describe "#integer" do
+-    it_behaves_like Numeric, Fixnum do
++    it_behaves_like Numeric, Integer do
+       subject { Flores::Random.integer(range) }
+     end
+   end
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 9afd5590da..09d3ed9ee1 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -4583,30 +4583,40 @@ fiber, and defaults to a shared thread-local state.")
     (license license:expat)))
 
 (define-public ruby-flores
-  (package
-    (name "ruby-flores")
-    (version "0.0.8")
-    (source (origin
-              (method url-fetch)
-              (uri (rubygems-uri "flores" version))
-              (sha256
-               (base32
-                "0pd8gqgy67rp1baq5r7himl0r9jzv5kqlhdmqh8wngynv548w2ai"))))
-    (build-system ruby-build-system)
-    (arguments
-     (list #:ruby ruby-2.7
-           #:phases
-           #~(modify-phases %standard-phases
-               (replace 'check
-                 (lambda* (#:key tests? #:allow-other-keys)
-                   (when tests?
-                     (invoke "ruby" (which "rspec"))))))))
-    (native-inputs (list ruby-rspec ruby-simplecov))
-    (synopsis "Fuzzing, randomization, and stress testing library")
-    (description "Flores is a fuzzing, randomization, and stress library to
+  (let ((commit "92fded00b04b1e3d308edb7440d7b7ab2c89ab5e")
+        (revision "0"))
+    (package
+      (name "ruby-flores")
+      (version (git-version "0.0.8" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/jordansissel/ruby-flores")
+               (commit commit)))
+         (sha256
+          (base32 "0jvnw0jli2zzxklfk751vfbi4acf9lijppk67346j3b2qxqi8xms"))
+         (patches
+          (search-patches "ruby-flores-fix-deprecations.patch"))))
+      (build-system ruby-build-system)
+      (arguments
+       (list #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'unpack 'fix-gemspec
+                   (lambda _
+                     (substitute* "flores.gemspec"
+                       ;; Since this is not a git repository, do not call 'git'.
+                       (("git ls-files") "find . -type f |sort"))))
+                 (replace 'check
+                   (lambda* (#:key tests? #:allow-other-keys)
+                     (when tests?
+                       (invoke "ruby" (which "rspec"))))))))
+      (native-inputs (list ruby-rspec ruby-simplecov))
+      (synopsis "Fuzzing, randomization, and stress testing library")
+      (description "Flores is a fuzzing, randomization, and stress library to
 help tests uncover more bugs.")
-    (home-page "https://github.com/jordansissel/ruby-flores")
-    (license license:asl2.0)))
+      (home-page "https://github.com/jordansissel/ruby-flores")
+      (license license:asl2.0))))
 
 (define-public ruby-ipaddr
   (package
-- 
2.48.1