auto_reloader 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: 3e68a0ebbf63e459d5a910ec3a989a23967ee950
4
- data.tar.gz: 9a92639f3c1d818f35bcce6bcf7d51d1e5c1aa6e
3
+ metadata.gz: 7e177122757b5b4f8c555813ae048ed0f8ed1905
4
+ data.tar.gz: fcd9ad0f2847ecd33e109cf2a452655f3405defe
5
5
  SHA512:
6
- metadata.gz: ef00d96db1f52fcf5e36776b8b0fbb0ceeba146440a4eae3ac11a19f7750a7a99907fce687e2442a80647d6992955e69534c4e9db9317b1eed4f04c4889f1feb
7
- data.tar.gz: 0b025c02a9ddc94bb2e23db839cb079e112d89bc577152ab4a5d327d528e66c520deb9513da7ee333b0541f82e06d2652ff33f8bff33aee97e3693aecce43a18
6
+ metadata.gz: e117321d8a5a284b018a027477d0ae7fa420049dbf1d0a5687f9d925f194d594bd35e0bc82d188c05a3dd82c846b23cbcde77b9b189acae7a1526aac1c7b407f
7
+ data.tar.gz: 13f25050c47b0ec2b8d9ec93aa1062bff51471fcbd27ee3dd5219c9e2a3988124ffec5f8bf76cec73ece2ee4ef1cf475c9d739573af6278258a27266756ee3be
data/README.md CHANGED
@@ -47,7 +47,10 @@ else
47
47
  # in the reload! call below
48
48
  AutoReloader.activate reloadable_paths: [__dir__], delay: 1
49
49
  run ->(env) {
50
- AutoReloader.reload! do
50
+ AutoReloader.reload! do |unloaded|
51
+ # by default, AutoReloader only unloads constants when a watched file changes;
52
+ # when it unloads code before calling this block, the value for unloaded will be true.
53
+ ActiveSupport::Dependencies.clear if unloaded && defined?(ActiveSupport::Dependencies)
51
54
  require_relative 'app'
52
55
  App.call env
53
56
  end
@@ -143,7 +143,7 @@ class AutoReloader
143
143
  if block_given?
144
144
  @reload_lock.synchronize{ @requests_count += 1 }
145
145
  begin
146
- result = yield
146
+ result = yield !reload_ignored
147
147
  ensure
148
148
  @reload_lock.synchronize{
149
149
  @requests_count -= 1
@@ -1,3 +1,3 @@
1
1
  class AutoReloader
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_reloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Rosenfeld Rosas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-06 00:00:00.000000000 Z
11
+ date: 2017-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler