rails_hotreload 0.1.1 → 0.1.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: 77b77f1636381592f5f6bb38fd5a4dc27828334f7199508cc101eb5039c51627
4
- data.tar.gz: 3f554fa167136aac6e05a01940ccd0cd8df86ec86827cc8616d9e88fa481c40d
3
+ metadata.gz: 388ccd4d1e7a486cc28be26eabe8b3c28c5d9b94cb0a7a14f1e909c7985d3859
4
+ data.tar.gz: 914e3b8205f31a1b78574a3477caac9f7e46da301ec70ee57a2c6ce48cdb2a36
5
5
  SHA512:
6
- metadata.gz: 4518ee9c387178705cbb28f6a6777537382b2f80cf1902ed264bfa0cf41b2d5a4fdc614559f913df91d17765000287266913a75c39f5fbcf22dc686dad7aabe4
7
- data.tar.gz: 8e0f6f3a68e1246631dc0bc5fa60d2e3966de80fde3e884a1129e91a1e6dd16753aca7904203ec1e70b35ddb11895e20aa726ec5142e09c9194f717e10534fad
6
+ metadata.gz: 5666308a1b207c064d4e3b2d0a039215cbee1f983d2694ca2664213c286417c0c90462999091bcb5265a165437a197abe3fb8924c0cc6379c022fd6fdc76d633
7
+ data.tar.gz: 657b7072b30182d445b529a20b79744bc6f599d5a92c3a0c12d23823f3b5e6fd7a0e8e18620967dc14659e27d9ec1508304b7e03c2c371557f38019e06a3de4e
data/README.md CHANGED
@@ -35,6 +35,7 @@ rails_hotreload: bin/rails rails_hotreload:start
35
35
  - Start your rails application and try editing your views or stylesheets or js files to see immediate changes in your browser
36
36
 
37
37
  ## Configuration
38
+ - Make sure your Turbo settings are well configured. See https://github.com/hotwired/turbo-rails#installation (Specially #4)
38
39
  - This gem by default is watching changes in: `app/assets/builds,app/views/`. This can be customized as the following:
39
40
  ```
40
41
  bin/rails rails_hotreload:start app/javascripts,app/stylesheets,app/views/
@@ -45,13 +46,9 @@ bin/rails rails_hotreload:start app/javascripts,app/stylesheets,app/views/
45
46
  ```
46
47
 
47
48
  ## Contributing
48
- Bug reports and pull requests are welcome on GitHub at https://github.com/owen2345/pub_sub_model_sync. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
+ Bug reports and pull requests are welcome on https://github.com/owen2345/rails-hotreload. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
50
 
50
- You can run the tests with: `docker-compose run test`
51
+ To ensure your contribution changes, run the tests with: `docker-compose run test`
51
52
 
52
53
  ## License
53
54
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
54
-
55
- ## **Code of Conduct**
56
-
57
- Everyone interacting in the PubSubModelSync project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/pub_sub_model_sync/blob/master/CODE_OF_CONDUCT.md).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsHotreload
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
@@ -2,12 +2,9 @@
2
2
  <%= turbo_stream_from 'rails_hotreload' %>
3
3
  <span>Hot-reloading: <input type="checkbox" style="vertical-align: middle;" checked></span>
4
4
  <script type="text/javascript">
5
- window.addEventListener('DOMContentLoaded', function() {
6
- const panel = document.getElementById('rails_hotreload');
7
- panel.addEventListener('DOMNodeInserted', () => {
8
- const enabled = panel.querySelector('input').checked;
9
- if (enabled) window.location.reload();
10
- });
5
+ document.getElementById('rails_hotreload').addEventListener('DOMNodeInserted', function(){
6
+ const enabled = document.body.querySelector('#rails_hotreload input').checked;
7
+ if (enabled) window.location.reload();
11
8
  });
12
9
  </script>
13
10
  </div>
@@ -23,6 +23,7 @@ module RailsHotreload
23
23
 
24
24
  private
25
25
 
26
+ # TODO: detach delays when consecutive changes
26
27
  def stream_reload
27
28
  puts 'Changes detected, reloading...'
28
29
  klass = Turbo::StreamsChannel
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_hotreload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo Diaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-05 00:00:00.000000000 Z
11
+ date: 2022-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen