rails_live_reload 0.3.0 → 0.3.2

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
  SHA256:
3
- metadata.gz: 88846a7af50ff0f2941eeb26795f7156ef4c92b8397453d9810d0196a27851ba
4
- data.tar.gz: 70337f1ce69e0fab74a7272633629a565f6106a86e00590e4eb0f2d49e71281e
3
+ metadata.gz: 1750367f18660b1f44055cf60de3a56b3d115055bd33ed3fb3f9736ef54ef110
4
+ data.tar.gz: 1c4ae3308c85a213a82606775a03d0b66465f9678471c7192f6b66e8f94cee20
5
5
  SHA512:
6
- metadata.gz: 5c4a756e0c3cd05ae4e8d75c5d221d2bd18ec17bd36d70ad8b720244f849a058d3788ec401d5f53eb88e99d0cfe8c5f09afd8610acaaf60e194b162465eb6bcf
7
- data.tar.gz: e23b0b4b83ed08589cd9a11066419e91fb58f4d3cf2dff4724de276408877b328829b96c598edaf77f9c90b251d8993486472bdde4a7d1bd88f5ed7c27c5e68c
6
+ metadata.gz: 3b0eef0d9a4754dcc2abd53c63142b34a4106e1c9668f93f3352aabb056bc5862e032beb51a54946fd731f7f12fc02a03db8002652c772afbb049e17d419f961
7
+ data.tar.gz: 7abd8952bdc1c08d785721dc3ee27b5ec1610437ad958591e8296fbfbddc38a427dabef8cfcf0cfdff558fcd69ccd69cc7116b1ede9a285ae9156e46d1e4bcf3
data/README.md CHANGED
@@ -86,6 +86,10 @@ You are welcome to contribute. See list of `TODO's` below.
86
86
  - CI (github actions)
87
87
  - auto reload when rendered controller was changed
88
88
 
89
+ ## Troubleshooting
90
+
91
+ - `Too many open files - pipe` - increase limits by `ulimit -n 10000`
92
+
89
93
  ## License
90
94
 
91
95
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -32,7 +32,7 @@ module RailsLiveReload
32
32
  initializer "rails_live_reload.routes" do
33
33
  config.after_initialize do |app|
34
34
  app.routes.prepend do
35
- mount RailsLiveReload.server => RailsLiveReload.config.url, internal: true, anchor: true
35
+ mount RailsLiveReload.server => RailsLiveReload.config.url, internal: true
36
36
  end
37
37
  end
38
38
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rails Live Reload 0.3.0
2
+ Rails Live Reload 0.3.2
3
3
  Copyright © 2022 RailsJazz
4
4
  https://railsjazz.com
5
5
  */
@@ -31,11 +31,11 @@ module RailsLiveReload
31
31
  private
32
32
 
33
33
  def make_new_response(body)
34
- body = body.sub("</head>", <<~HTML.html_safe)
34
+ index = body.rindex(/<\/body>/i) || body.rindex(/<\/html>/i)
35
+ return body if index.nil?
36
+
37
+ body.insert(index, <<~HTML.html_safe)
35
38
  <script defer type="text/javascript" src="#{RailsLiveReload.config.url}/script"></script>
36
- </head>
37
- HTML
38
- body.sub("</body>", <<~HTML.html_safe)
39
39
  <script id="rails-live-reload-options" type="application/json">
40
40
  #{{
41
41
  files: CurrentRequest.current.data.to_a,
@@ -43,7 +43,6 @@ module RailsLiveReload
43
43
  url: RailsLiveReload.config.url
44
44
  }.to_json}
45
45
  </script>
46
- </body>
47
46
  HTML
48
47
  end
49
48
 
@@ -1,3 +1,3 @@
1
1
  module RailsLiveReload
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_live_reload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-07-25 00:00:00.000000000 Z
12
+ date: 2022-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties