rack-livereload 0.5.2 → 0.6.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 +6 -0
- data/features/step_definitions/given/i_have_a_rack_app_with_live_reload.rb +1 -1
- data/lib/rack/livereload/processing_skip_analyzer.rb +3 -3
- data/lib/rack/livereload.rb +3 -3
- data/lib/rack-livereload.rb +1 -1
- data/rack-livereload.gemspec +1 -2
- data/spec/rack/livereload/processing_skip_analyzer_spec.rb +5 -5
- metadata +11 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b02682c5d7071bd83d9d775003aecb931df6fde77c6a1b2198cd19b5b8946ac
|
4
|
+
data.tar.gz: d069792c4104474146c0cc03c6ea237fe2e8bf14224c12f228041b947a0706a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d22d71d86510883ad4e9708aa19ddf5f4d541a90f717760a2f7367396f679cbede5c7e687f264ddd4e5b8b3d1af835a643f695a2f193fb4f54a50a9aad021ff
|
7
|
+
data.tar.gz: ad734b7f1195709ffd6b59bbfcf8acaa131f77b42dfeb49612c69f5bdf8292c3015a9e1d570a49a36d1b183dae31d71f4b475f9f1c53603d53885b9785adc1c0
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
** LOOKING FOR MAINTAINER ** Please contact me if interested.
|
2
2
|
|
3
|
+
I recommend https://github.com/kirillplatonov/hotwire-livereload instead.
|
4
|
+
|
3
5
|
|
4
6
|
# Rack::LiveReload [![Build Status](https://travis-ci.org/onesupercoder/rack-livereload.svg?branch=master)](https://travis-ci.org/onesupercoder/rack-livereload) [![Maintainability](https://api.codeclimate.com/v1/badges/6b3cafaf0d8752d0ac55/maintainability)](https://codeclimate.com/github/onesupercoder/rack-livereload/maintainability)
|
5
7
|
|
@@ -105,3 +107,7 @@ use Rack::LiveReload, no_swf: true
|
|
105
107
|
Once more browsers support WebSockets than don't, this option will be reversed and you'll have
|
106
108
|
to explicitly include the Flash shim.
|
107
109
|
|
110
|
+
### Rack support
|
111
|
+
|
112
|
+
- Rack 2 is supported until version `0.5.x` and is maintained in the `rack2` branch
|
113
|
+
- Rack 3 is supported in version `0.6.0` and later
|
@@ -2,6 +2,6 @@ Given /^I have a Rack app with Rack::LiveReload$/ do
|
|
2
2
|
@app = Rack::Builder.new do
|
3
3
|
use Rack::LiveReload
|
4
4
|
|
5
|
-
run lambda { |env| [ 200, { '
|
5
|
+
run lambda { |env| [ 200, { 'content-type' => 'text/html' }, [ "<html><head></head><body></body></html>" ] ] }
|
6
6
|
end
|
7
7
|
end
|
@@ -20,11 +20,11 @@ module Rack
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def chunked?
|
23
|
-
@headers['
|
23
|
+
@headers['transfer-encoding'] == 'chunked'
|
24
24
|
end
|
25
25
|
|
26
26
|
def inline?
|
27
|
-
@headers['
|
27
|
+
@headers['content-disposition'] =~ %r{^inline}
|
28
28
|
end
|
29
29
|
|
30
30
|
def ignored?
|
@@ -37,7 +37,7 @@ module Rack
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def html?
|
40
|
-
@headers['
|
40
|
+
@headers['content-type'] =~ %r{text/html|application/xhtml\+xml}
|
41
41
|
end
|
42
42
|
|
43
43
|
def get?
|
data/lib/rack/livereload.rb
CHANGED
@@ -27,10 +27,10 @@ module Rack
|
|
27
27
|
processor = BodyProcessor.new(body, @options)
|
28
28
|
processor.process!(env)
|
29
29
|
|
30
|
-
headers['
|
30
|
+
headers['content-length'] = processor.content_length.to_s
|
31
31
|
|
32
32
|
if processor.livereload_added
|
33
|
-
headers['
|
33
|
+
headers['x-rack-livereload'] = '1'
|
34
34
|
end
|
35
35
|
|
36
36
|
[ status, headers, processor.new_body ]
|
@@ -46,7 +46,7 @@ module Rack
|
|
46
46
|
'application/swf'
|
47
47
|
end
|
48
48
|
|
49
|
-
[ 200, { '
|
49
|
+
[ 200, { 'content-type' => type, 'content-length' => ::File.size(file).to_s }, [ ::File.read(file) ] ]
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
data/lib/rack-livereload.rb
CHANGED
data/rack-livereload.gemspec
CHANGED
@@ -25,7 +25,6 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_development_dependency "httparty"
|
26
26
|
s.add_development_dependency "sinatra"
|
27
27
|
s.add_development_dependency "shotgun"
|
28
|
-
s.add_development_dependency "thin"
|
29
28
|
s.add_development_dependency "rake"
|
30
29
|
s.add_development_dependency "mocha"
|
31
30
|
s.add_development_dependency "guard"
|
@@ -36,6 +35,6 @@ Gem::Specification.new do |s|
|
|
36
35
|
s.add_development_dependency "webmock"
|
37
36
|
s.add_development_dependency "nokogiri", ("< 1.6" if RUBY_VERSION < "1.9") # Nokogiri >= 1.6 requires Ruby >= 1.9
|
38
37
|
s.add_development_dependency 'appraisal', '~> 2.2.0'
|
39
|
-
s.add_runtime_dependency "rack", "< 3"
|
38
|
+
s.add_runtime_dependency "rack", ">= 3.0", "< 3.2"
|
40
39
|
end
|
41
40
|
|
@@ -40,7 +40,7 @@ describe Rack::LiveReload::ProcessingSkipAnalyzer do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
context 'chunked response' do
|
43
|
-
let(:headers) { { '
|
43
|
+
let(:headers) { { 'transfer-encoding' => 'chunked' } }
|
44
44
|
|
45
45
|
it { should be_chunked }
|
46
46
|
end
|
@@ -48,7 +48,7 @@ describe Rack::LiveReload::ProcessingSkipAnalyzer do
|
|
48
48
|
|
49
49
|
describe '#inline?' do
|
50
50
|
context 'inline disposition' do
|
51
|
-
let(:headers) { { '
|
51
|
+
let(:headers) { { 'content-disposition' => 'inline; filename=my_inlined_file' } }
|
52
52
|
|
53
53
|
it { should be_inline }
|
54
54
|
end
|
@@ -90,19 +90,19 @@ describe Rack::LiveReload::ProcessingSkipAnalyzer do
|
|
90
90
|
|
91
91
|
describe '#html?' do
|
92
92
|
context 'HTML content' do
|
93
|
-
let(:headers) { { '
|
93
|
+
let(:headers) { { 'content-type' => 'text/html' } }
|
94
94
|
|
95
95
|
it { should be_html }
|
96
96
|
end
|
97
97
|
|
98
98
|
context 'XHTML content' do
|
99
|
-
let(:headers) { { '
|
99
|
+
let(:headers) { { 'content-type' => 'application/xhtml+xml' } }
|
100
100
|
|
101
101
|
it { should be_html }
|
102
102
|
end
|
103
103
|
|
104
104
|
context 'PDF content' do
|
105
|
-
let(:headers) { { '
|
105
|
+
let(:headers) { { 'content-type' => 'application/pdf' } }
|
106
106
|
|
107
107
|
it { should_not be_html }
|
108
108
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-livereload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bintz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: thin
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: rake
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -238,16 +224,22 @@ dependencies:
|
|
238
224
|
name: rack
|
239
225
|
requirement: !ruby/object:Gem::Requirement
|
240
226
|
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '3.0'
|
241
230
|
- - "<"
|
242
231
|
- !ruby/object:Gem::Version
|
243
|
-
version: '3'
|
232
|
+
version: '3.2'
|
244
233
|
type: :runtime
|
245
234
|
prerelease: false
|
246
235
|
version_requirements: !ruby/object:Gem::Requirement
|
247
236
|
requirements:
|
237
|
+
- - ">="
|
238
|
+
- !ruby/object:Gem::Version
|
239
|
+
version: '3.0'
|
248
240
|
- - "<"
|
249
241
|
- !ruby/object:Gem::Version
|
250
|
-
version: '3'
|
242
|
+
version: '3.2'
|
251
243
|
description: Insert LiveReload into your app easily as Rack middleware
|
252
244
|
email:
|
253
245
|
- john@coswellproductions.com
|
@@ -306,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
306
298
|
- !ruby/object:Gem::Version
|
307
299
|
version: '0'
|
308
300
|
requirements: []
|
309
|
-
rubygems_version: 3.5.
|
301
|
+
rubygems_version: 3.5.18
|
310
302
|
signing_key:
|
311
303
|
specification_version: 4
|
312
304
|
summary: Insert LiveReload into your app easily as Rack middleware
|