rack-app 0.9.2 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/VERSION +1 -1
- data/lib/rack/app/file/streamer.rb +20 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2df00445bf28113e1aae2013345dad70f163dc27
|
4
|
+
data.tar.gz: 860463dbdc86d2c72fb41fad5745a9c58cd31371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa27e35b11ea46817f6b91d31e64fc7b1ddee0148d11c6dcac3e236e1afbb0dd35e00fdc212f33a75462535078d495d2f9691d099e41d3a4e60341860dca1708
|
7
|
+
data.tar.gz: 67fa1277b0fcedc5119ad9d9ba848274083f62ec3012461681f47c47baeb72eadd4491caf63aac16a1148ee637600ea4a3c2483063fdb4facf726cc343f6d4db
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rack::
|
1
|
+
# [Rack::App](http://rack-app.com/) [![Build Status][travis-image]][travis-link]
|
2
2
|
|
3
3
|
[travis-image]: https://secure.travis-ci.org/adamluzsi/rack-app.rb.png?branch=master
|
4
4
|
[travis-link]: http://travis-ci.org/adamluzsi/rack-app.rb
|
@@ -121,6 +121,10 @@ i feared do this for Rails that is usually slower than Grape :S
|
|
121
121
|
|
122
122
|
## Roadmap
|
123
123
|
|
124
|
+
### Team [Backlog](https://docs.google.com/spreadsheets/d/19GGX51i6uCQQz8pQ-lvsIxu43huKCX-eC1526-RL3YA/edit?usp=sharing)
|
125
|
+
|
126
|
+
If you have anything to say, you can leave a comment. :)
|
127
|
+
|
124
128
|
### 0.10.0
|
125
129
|
|
126
130
|
* serializer block/method for class shared serialization logic
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.10.1
|
@@ -2,24 +2,34 @@ class Rack::App::File::Streamer
|
|
2
2
|
|
3
3
|
include Enumerable
|
4
4
|
|
5
|
-
def each(&
|
6
|
-
|
7
|
-
ensure
|
8
|
-
@file.close
|
5
|
+
def each(&block)
|
6
|
+
file { |f| f.each(&block) }
|
9
7
|
end
|
10
8
|
|
11
|
-
def
|
12
|
-
|
9
|
+
def render(object=nil)
|
10
|
+
file { |f| f.read }
|
13
11
|
end
|
14
12
|
|
15
|
-
def
|
16
|
-
|
13
|
+
def mtime(object=nil)
|
14
|
+
::File.mtime(@file_path).httpdate
|
15
|
+
end
|
16
|
+
|
17
|
+
def length(object=nil)
|
18
|
+
::Rack::Utils.bytesize(render())
|
17
19
|
end
|
18
20
|
|
19
21
|
protected
|
20
22
|
|
21
|
-
def initialize(
|
22
|
-
@
|
23
|
+
def initialize(file_path)
|
24
|
+
@file_path = file_path
|
25
|
+
@file = File.open(file_path)
|
26
|
+
end
|
27
|
+
|
28
|
+
def file(&block)
|
29
|
+
@file.reopen(@file_path) if @file.closed?
|
30
|
+
return block.call(@file)
|
31
|
+
ensure
|
32
|
+
@file.close
|
23
33
|
end
|
24
34
|
|
25
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|