me
/
guix
Archived
1
0
Fork 0

gnu: ruby-thor: Update to 1.2.1.

* gnu/packages/ruby.scm (ruby-thor): Update to 1.2.1.
[source]: Update URI.
[arguments]: Use gexps.  Delete trailing #t.
[phases] {fix-readline-tests, disable-network-tests}
{make-files-writable}: Delete phases.
{remove-coveralls-dependency}: Do not remove webmock requires.
{disable-quality-tests}: Rename to...
{disable-problematic-tests}: ... this.  Disable a new failing test.
{check}: Honor TESTS?.
master
Maxim Cournoyer 2023-03-01 23:17:26 -05:00
parent a9173e626e
commit f1b0625428
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 30 additions and 53 deletions

View File

@ -2737,69 +2737,46 @@ Ruby.")
(define-public ruby-thor
(package
(name "ruby-thor")
(version "1.0.1")
(version "1.2.1")
(source (origin
;; Pull from git because the gem has no tests.
(method git-fetch)
(uri (git-reference
(url "https://github.com/erikhuda/thor")
(url "https://github.com/rails/thor")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"1anrx5vynk57hn5c8ig5pgkmcsbj9q5mvckd5rviw1jid7n89k57"))))
"1vjm628ks5kw8q6dskh38dqyz2j8c3n694wsqkj4jb4jrn6rkfzx"))))
(build-system ruby-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
(add-after 'unpack 'fix-readline-tests
(lambda _
;; Ensure Readline is initialized before running the
;; test to avoid a type clash with the mock ::Readline.
;; See <https://github.com/erikhuda/thor/pull/717>.
(substitute* "spec/line_editor/readline_spec.rb"
(("unless defined\\? ::Readline" all)
(string-append "Thor::LineEditor::Readline.available?\n"
all)))
#t))
(add-after 'unpack 'remove-coveralls-dependency
(lambda _
;; Do not hook the test suite into the online
;; coveralls service.
(substitute* "Gemfile"
((".*coveralls.*") ""))
(substitute* "spec/helper.rb"
(("require \"coveralls\"") "")
(("Coveralls::SimpleCov::Formatter") "")
;; Also drop the WebMock dependency which is only
;; present to allow a coveralls.io connection, and
;; would otherwise introduce a circular dependency.
(("require \"webmock/rspec\"") "")
(("WebMock\\.disable_net_connect.*") ""))
#t))
(add-after 'unpack 'disable-network-tests
(lambda _
;; These tests attempt to look up example.com.
(substitute* "spec/actions/file_manipulation_spec.rb"
(("it \"accepts (https?) remote sources" _ proto)
(string-append "xit \"accepts " proto " remote sources")))
#t))
(add-after 'unpack 'disable-quality-tests
(lambda _
;; These tests attempt to check the git repository for
;; tabs vs spaces, double vs single quotes, etc, and
;; depend on the git checkout.
(delete-file "spec/quality_spec.rb")
#t))
(add-before 'check 'make-files-writable
(lambda _
;; The tests needs rw access to the test suite.
(for-each make-file-writable (find-files "spec"))
#t))
(replace 'check
(lambda _
(invoke "rspec" "spec"))))))
(native-inputs
(list ruby-rspec ruby-simplecov))
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'remove-coveralls-dependency
(lambda _
;; Do not hook the test suite into the online coveralls service.
(substitute* "Gemfile"
((".*coveralls.*") ""))
(substitute* "spec/helper.rb"
(("require \"coveralls\"") "")
(("Coveralls::SimpleCov::Formatter") ""))))
(add-after 'unpack 'disable-problematic-tests
(lambda _
;; These tests attempt to check the git repository for
;; tabs vs spaces, double vs single quotes, etc, and
;; depend on the git checkout.
(delete-file "spec/quality_spec.rb")
(substitute* "spec/parser/options_spec.rb"
;; This test fails for unknown reasons (see:
;; https://github.com/rails/thor/issues/814).
(("it \"raises an error for unknown switches" all)
(string-append "x" all)))))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "rspec" "spec" )))))))
(native-inputs (list ruby-rspec ruby-simplecov ruby-webmock))
(synopsis "Ruby toolkit for building command-line interfaces")
(description "Thor is a toolkit for building powerful command-line
interfaces.")