hotloader 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -17
- data/lib/hotloader.rb +18 -18
- data/lib/hotloader/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a673a1d22853218f0aa0a072438d91c37f9bd13006f4375a47537e19451bbad3
|
4
|
+
data.tar.gz: e4ef452b3beb541e31bd1c699500b7381fd5197195be37d4f14909f76eb8cb33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7740cc2959b2d35f092131e6ab020a85b47a6fdad0e777984b00b072dd42c937361c6b1e9454afabffb156d8fcc39a73d1f88ef225b6d78ace255774232dd317
|
7
|
+
data.tar.gz: bf19adcf780a5e0f4f3e5ca0bf8c16e6ab9aa23feb72af3083f50551f1f7e4d82abe16926bcb1457fbdb104632d92902baf96043d0b5c4e332bf80c837a0effb
|
data/README.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
|
-
# Hotloader
|
2
|
-
|
1
|
+
# Hotloader
|
2
|
+
Ya know that :expressionless: face when you're waiting for your views to load. _Every_ time you change a 'lil bit of CSS. Well Hotloader auto refreshes :open_mouth: :smirk:
|
3
|
+
|
4
|
+
|
5
|
+
Hate faffing with Guard, Guardfiles, GuardLiveReload, bundle exec guard blah blah blah? :unamused: A problem no longer! :smirk:
|
6
|
+
|
7
|
+
Everytime you save a file in your rails app folder, your browser will automatically refresh. Save a view, a controller, a css component, your browser will auto refresh.
|
8
|
+
|
9
|
+
Give ActionCable time to boot on launch of server and voila.
|
10
|
+
|
11
|
+
[![Gem Version](https://badge.fury.io/rb/hotloader.svg)](https://badge.fury.io/rb/hotloader)
|
12
|
+
|
13
|
+
https://rubygems.org/gems/hotloader
|
3
14
|
|
4
15
|
## Installation
|
5
16
|
|
@@ -9,29 +20,17 @@ Add this line to your application's Gemfile:
|
|
9
20
|
gem 'hotloader'
|
10
21
|
```
|
11
22
|
|
12
|
-
And then execute:
|
13
|
-
|
14
|
-
$ bundle
|
15
|
-
|
16
23
|
Or install it yourself as:
|
17
24
|
|
18
25
|
$ gem install hotloader
|
19
|
-
|
26
|
+
|
27
|
+
|
28
|
+
Dont' forget the javascript in application.js
|
20
29
|
|
21
30
|
``` javascript
|
22
31
|
//= require hotloader
|
23
32
|
```
|
24
33
|
|
25
|
-
## Usage
|
26
|
-
|
27
|
-
Do the above. Everytime you save a a file in your rails app folder, your page will automatically refresh.
|
28
|
-
|
29
|
-
## Development
|
30
|
-
|
31
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
32
|
-
|
33
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
34
|
-
|
35
34
|
## Contributing
|
36
35
|
|
37
36
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hotloader. 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.
|
data/lib/hotloader.rb
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
require
|
1
|
+
require 'hotloader/version'
|
2
2
|
module Hotloader
|
3
3
|
class Engine < ::Rails::Engine
|
4
4
|
isolate_namespace Hotloader
|
5
|
+
if Rails.env.development?
|
6
|
+
initializer 'refresh', before: :load_config_initializers do |app|
|
7
|
+
Rails.application.routes.append do
|
8
|
+
mount ActionCable.server => '/cable'
|
9
|
+
end
|
5
10
|
|
6
|
-
|
7
|
-
Rails.application.routes.append do
|
8
|
-
mount ActionCable.server => '/cable'
|
9
|
-
end
|
10
|
-
Rails.application.configure do
|
11
|
+
Rails.application.configure do
|
11
12
|
ActionCable.server.config.logger = Logger.new(nil)
|
12
|
-
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
Hotloader.load_files.each do |file|
|
16
|
+
require_relative File.join('../', file)
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
+
app.config.assets.precompile << 'hotloader.js'
|
19
20
|
|
20
|
-
|
21
|
-
|
21
|
+
listener = Listen.to('app') do
|
22
|
+
ActionCable.server.broadcast 'refresh_channel', { title: "refresh" }
|
23
|
+
end
|
24
|
+
listener.start
|
22
25
|
end
|
23
|
-
listener.start
|
24
26
|
end
|
25
27
|
end
|
26
28
|
def self.load_files
|
27
29
|
[
|
28
|
-
|
30
|
+
'app/channels/refresh_channel.rb'
|
29
31
|
]
|
30
|
-
end
|
32
|
+
end
|
31
33
|
end
|
32
|
-
|
33
|
-
|
data/lib/hotloader/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Voxoff
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,22 +76,22 @@ dependencies:
|
|
76
76
|
name: rails
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '5.2'
|
82
79
|
- - ">="
|
83
80
|
- !ruby/object:Gem::Version
|
84
81
|
version: 5.1.0
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '5.2'
|
85
85
|
type: :runtime
|
86
86
|
prerelease: false
|
87
87
|
version_requirements: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- - "~>"
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: '5.2'
|
92
89
|
- - ">="
|
93
90
|
- !ruby/object:Gem::Version
|
94
91
|
version: 5.1.0
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '5.2'
|
95
95
|
description: Hotloader uses ActionCable to serve your page every time you save a file
|
96
96
|
in your app dir. That's your views, css, controllers etc.
|
97
97
|
email:
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.7.
|
129
|
+
rubygems_version: 2.7.8
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Hate refreshing every time you edit your views? Start Hotloading.
|