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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11562e09e4e7087bbaefaeb911d0ce5a87cf80e6
4
- data.tar.gz: deefda74befc47f77bc3c7c6f65b0420772a936a
3
+ metadata.gz: 2df00445bf28113e1aae2013345dad70f163dc27
4
+ data.tar.gz: 860463dbdc86d2c72fb41fad5745a9c58cd31371
5
5
  SHA512:
6
- metadata.gz: 290f0f4386397f899f4101268c12d0ccc1a7ab06d6ecb224f141915994544bfb77021b34f52eea87b109e0b67a8f7910a25c17ad15b8ca3eea6a3c60f714d6be
7
- data.tar.gz: db9c38482271907d84fd88db8de910b228f77a2c7f7be0ee08c20584b86c6f59c8a0b74496eac020ba9feb39b89199b9f04a9f0f8c52fc2d51c4dd38a7c6ba52
6
+ metadata.gz: aa27e35b11ea46817f6b91d31e64fc7b1ddee0148d11c6dcac3e236e1afbb0dd35e00fdc212f33a75462535078d495d2f9691d099e41d3a4e60341860dca1708
7
+ data.tar.gz: 67fa1277b0fcedc5119ad9d9ba848274083f62ec3012461681f47c47baeb72eadd4491caf63aac16a1148ee637600ea4a3c2483063fdb4facf726cc343f6d4db
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rack::Appi [![Build Status][travis-image]][travis-link]
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.9.2
1
+ 0.10.1
@@ -2,24 +2,34 @@ class Rack::App::File::Streamer
2
2
 
3
3
  include Enumerable
4
4
 
5
- def each(&blk)
6
- @file.each(&blk)
7
- ensure
8
- @file.close
5
+ def each(&block)
6
+ file { |f| f.each(&block) }
9
7
  end
10
8
 
11
- def to_a
12
- @file.to_a.map(&:chomp)
9
+ def render(object=nil)
10
+ file { |f| f.read }
13
11
  end
14
12
 
15
- def render(object=nil)
16
- return self
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(path)
22
- @file = File.open(path)
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.9.2
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-09 00:00:00.000000000 Z
12
+ date: 2016-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler