rack-livereload 0.3.17 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,8 +4,9 @@ module Rack
4
4
  class LiveReload
5
5
  class BodyProcessor
6
6
  LIVERELOAD_JS_PATH = '/__rack/livereload.js'
7
- HEAD_TAG_REGEX = /<head>|<head[^(er)][^<]*>/
7
+ HEAD_TAG_REGEX = /<head( [^<]+)?>/
8
8
  LIVERELOAD_PORT = 35729
9
+ LIVERELOAD_SCHEME = "ws"
9
10
 
10
11
  attr_reader :content_length, :new_body, :livereload_added
11
12
 
@@ -14,12 +15,14 @@ module Rack
14
15
  end
15
16
 
16
17
  def livereload_local_uri
17
- "#{protocol}://localhost:#{@options[:live_reload_port]}/livereload.js"
18
+ "#{protocol}://localhost:#{@options[:live_reload_port]}/" +
19
+ 'livereload.js'
18
20
  end
19
21
 
20
22
  def initialize(body, options)
21
23
  @body, @options = body, options
22
24
  @options[:live_reload_port] ||= LIVERELOAD_PORT
25
+ @options[:live_reload_scheme] ||= LIVERELOAD_SCHEME
23
26
 
24
27
  @processed = false
25
28
  end
@@ -37,7 +37,7 @@ module Rack
37
37
  end
38
38
 
39
39
  def html?
40
- @headers['Content-Type'] =~ %r{text/html}
40
+ @headers['Content-Type'] =~ %r{text/html|application/xhtml\+xml}
41
41
  end
42
42
 
43
43
  def get?
@@ -1,6 +1,6 @@
1
1
  require "rack/livereload"
2
2
 
3
3
  class Rack::LiveReload
4
- VERSION = '0.3.17'
4
+ VERSION = '0.5.2'
5
5
  end
6
6
 
@@ -36,6 +36,6 @@ Gem::Specification.new do |s|
36
36
  s.add_development_dependency "webmock"
37
37
  s.add_development_dependency "nokogiri", ("< 1.6" if RUBY_VERSION < "1.9") # Nokogiri >= 1.6 requires Ruby >= 1.9
38
38
  s.add_development_dependency 'appraisal', '~> 2.2.0'
39
- s.add_runtime_dependency "rack"
39
+ s.add_runtime_dependency "rack", "< 3"
40
40
  end
41
41
 
@@ -10,6 +10,7 @@
10
10
  <% end %>
11
11
  <script type="text/javascript">
12
12
  RACK_LIVERELOAD_PORT = <%= @options[:live_reload_port] %>;
13
+ RACK_LIVERELOAD_SCHEME = "<%= @options[:live_reload_scheme] %>";
13
14
  </script>
14
15
  <script type="text/javascript" src="<%= livereload_source %>"></script>
15
16
 
@@ -95,6 +95,12 @@ describe Rack::LiveReload::ProcessingSkipAnalyzer do
95
95
  it { should be_html }
96
96
  end
97
97
 
98
+ context 'XHTML content' do
99
+ let(:headers) { { 'Content-Type' => 'application/xhtml+xml' } }
100
+
101
+ it { should be_html }
102
+ end
103
+
98
104
  context 'PDF content' do
99
105
  let(:headers) { { 'Content-Type' => 'application/pdf' } }
100
106
 
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.3.17
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bintz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-06 00:00:00.000000000 Z
11
+ date: 2024-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -238,16 +238,16 @@ dependencies:
238
238
  name: rack
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ">="
241
+ - - "<"
242
242
  - !ruby/object:Gem::Version
243
- version: '0'
243
+ version: '3'
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
- - - ">="
248
+ - - "<"
249
249
  - !ruby/object:Gem::Version
250
- version: '0'
250
+ version: '3'
251
251
  description: Insert LiveReload into your app easily as Rack middleware
252
252
  email:
253
253
  - john@coswellproductions.com
@@ -256,7 +256,6 @@ extensions: []
256
256
  extra_rdoc_files: []
257
257
  files:
258
258
  - ".gitignore"
259
- - ".ruby-version"
260
259
  - ".travis.yml"
261
260
  - Appraisals
262
261
  - Gemfile
@@ -270,9 +269,9 @@ files:
270
269
  - features/step_definitions/then/i_should_not_have_livereload_code.rb
271
270
  - features/step_definitions/when/i_make_a_request_with_headers.rb
272
271
  - features/support/env.rb
273
- - gemfiles/rails32.gemfile
274
- - gemfiles/rails40.gemfile
275
272
  - gemfiles/rails51.gemfile
273
+ - gemfiles/rails602.gemfile
274
+ - gemfiles/rails7.gemfile
276
275
  - index.html
277
276
  - js/WebSocketMain.swf
278
277
  - js/livereload.js
@@ -292,7 +291,7 @@ homepage: https://github.com/onesupercoder/rack-livereload
292
291
  licenses:
293
292
  - MIT
294
293
  metadata: {}
295
- post_install_message:
294
+ post_install_message:
296
295
  rdoc_options: []
297
296
  require_paths:
298
297
  - lib
@@ -307,9 +306,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
306
  - !ruby/object:Gem::Version
308
307
  version: '0'
309
308
  requirements: []
310
- rubyforge_project: rack-livereload
311
- rubygems_version: 2.7.6
312
- signing_key:
309
+ rubygems_version: 3.5.3
310
+ signing_key:
313
311
  specification_version: 4
314
312
  summary: Insert LiveReload into your app easily as Rack middleware
315
313
  test_files:
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.5.1
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "~> 3.2.0"
6
-
7
- gemspec :path=>"../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "~> 4.0.0"
6
-
7
- gemspec :path=>"../"