* [PATCH] gnu: Add ruby-rack.
@ 2015-09-04 20:50 David Thompson
2015-09-07 16:02 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: David Thompson @ 2015-09-04 20:50 UTC (permalink / raw
To: guix-devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-ruby-rack.patch --]
[-- Type: text/x-patch, Size: 2244 bytes --]
From a740a5ca98c02bd0e9c792677dfc8ff8464c8365 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Fri, 4 Sep 2015 16:47:52 -0400
Subject: [PATCH] gnu: Add ruby-rack.
* gnu/packages/ruby.scm (ruby-rack): New variable.
---
gnu/packages/ruby.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 9bfa14c..906b6eb 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1072,3 +1072,40 @@ build on. It provides breakpoint handling and bindings for stack frames among
other things and it comes with a command line interface.")
(home-page "http://github.com/deivid-rodriguez/byebug")
(license license:bsd-3)))
+
+(define-public ruby-rack
+ (package
+ (name "ruby-rack")
+ (version "1.6.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (rubygems-uri "rack" version))
+ (sha256
+ (base32
+ "09bs295yq6csjnkzj7ncj50i6chfxrhmzg1pk6p0vd2lb9ac8pj5"))))
+ (build-system ruby-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'fix-tests
+ (lambda _
+ ;; A few of the tests use the length of a file on disk for
+ ;; Content-Length and Content-Range headers. However, this file
+ ;; has a shebang in it which an earlier phase patches, growing
+ ;; the file size from 193 to 239 bytes.
+ (substitute* '("test/spec_file.rb")
+ (("193") "239")
+ ;; Adjust by 46 bytes to accomodate patched shebang.
+ (("bytes(.)22-33" all delimiter)
+ (string-append "bytes" delimiter "68-79")))
+ #t)))))
+ (native-inputs
+ `(("ruby-bacon" ,ruby-bacon)))
+ (synopsis "Unified web application interface for Ruby")
+ (description "Rack provides a minimal, modular and adaptable interface for
+developing web applications in Ruby. By wrapping HTTP requests and responses,
+it unifies the API for web servers, web frameworks, and software in between
+into a single method call.")
+ (home-page "http://rack.github.io/")
+ (license license:expat)))
--
2.5.0
[-- Attachment #2: Type: text/plain, Size: 38 bytes --]
--
David Thompson
GPG Key: 0FF1D807
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gnu: Add ruby-rack.
2015-09-04 20:50 [PATCH] gnu: Add ruby-rack David Thompson
@ 2015-09-07 16:02 ` Ludovic Courtès
2015-09-07 17:45 ` Thompson, David
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2015-09-07 16:02 UTC (permalink / raw
To: David Thompson; +Cc: guix-devel
David Thompson <dthompson2@worcester.edu> skribis:
> From a740a5ca98c02bd0e9c792677dfc8ff8464c8365 Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Fri, 4 Sep 2015 16:47:52 -0400
> Subject: [PATCH] gnu: Add ruby-rack.
>
> * gnu/packages/ruby.scm (ruby-rack): New variable.
[...]
> + (add-before 'check 'fix-tests
> + (lambda _
> + ;; A few of the tests use the length of a file on disk for
> + ;; Content-Length and Content-Range headers. However, this file
> + ;; has a shebang in it which an earlier phase patches, growing
> + ;; the file size from 193 to 239 bytes.
> + (substitute* '("test/spec_file.rb")
> + (("193") "239")
I think this phase should use the actual length of the shebang, in case
the store is not at /gnu/store, with something like:
(- (string-length (which "ruby")) (string-length "/usr/bin/ruby"))
Could you look into it?
TIA,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gnu: Add ruby-rack.
2015-09-07 16:02 ` Ludovic Courtès
@ 2015-09-07 17:45 ` Thompson, David
0 siblings, 0 replies; 3+ messages in thread
From: Thompson, David @ 2015-09-07 17:45 UTC (permalink / raw
To: Ludovic Courtès; +Cc: guix-devel
On Mon, Sep 7, 2015 at 12:02 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> David Thompson <dthompson2@worcester.edu> skribis:
>
>> From a740a5ca98c02bd0e9c792677dfc8ff8464c8365 Mon Sep 17 00:00:00 2001
>> From: David Thompson <dthompson2@worcester.edu>
>> Date: Fri, 4 Sep 2015 16:47:52 -0400
>> Subject: [PATCH] gnu: Add ruby-rack.
>>
>> * gnu/packages/ruby.scm (ruby-rack): New variable.
>
> [...]
>
>> + (add-before 'check 'fix-tests
>> + (lambda _
>> + ;; A few of the tests use the length of a file on disk for
>> + ;; Content-Length and Content-Range headers. However, this file
>> + ;; has a shebang in it which an earlier phase patches, growing
>> + ;; the file size from 193 to 239 bytes.
>> + (substitute* '("test/spec_file.rb")
>> + (("193") "239")
>
> I think this phase should use the actual length of the shebang, in case
> the store is not at /gnu/store, with something like:
>
> (- (string-length (which "ruby")) (string-length "/usr/bin/ruby"))
>
> Could you look into it?
Good point. It was easy to implement, too:
(let ((size-diff (- (string-length (which "ruby"))
(string-length "/usr/bin/env ruby"))))
(substitute* '("test/spec_file.rb")
(("193")
(number->string (+ 193 size-diff)))
(("bytes(.)22-33" all delimiter)
(string-append "bytes"
delimiter
(number->string (+ 22 size-diff))
"-"
(number->string (+ 33 size-diff))))))
Pushed, thanks!
- Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-07 17:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-04 20:50 [PATCH] gnu: Add ruby-rack David Thompson
2015-09-07 16:02 ` Ludovic Courtès
2015-09-07 17:45 ` Thompson, David
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.