alki-reload 0.3.2 → 0.3.3

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: 65642f82e0d553cec6756fedc41accc08f648750
4
- data.tar.gz: 6abe7c4cd9206ba8399a9fb3dc41233a04d9ce72
3
+ metadata.gz: 0f5ba8066bdca7a668ada39dce7efb5c47795578
4
+ data.tar.gz: cd3e3dbb13c21703215f2cd264fc5d70f847eabb
5
5
  SHA512:
6
- metadata.gz: d1a31ba7529595181497607d8546da97d36e07706a073952242c8bb754bf1cdb83f85c250396c3c43e1eb77bd7db3460feaf450c5d66f5adca189e98847ed5fe
7
- data.tar.gz: fd14180efcbca8774f7f716c6db2378c44a6263775f0344434205bf3c871cedbca2d98d0dfd63d33b5fcf70f8e59bb5733910dde1a7f163df655b5d394e0268e
6
+ metadata.gz: 90a4a2e06115368471dc474dbf2088553a20f6b8d396a30bc2448f8afa6b67ca0c9c01fc90f8ad33ae55b1ce134a5816d6375de9325b29e65c8983a1bc606aca
7
+ data.tar.gz: dc0e560d4a0e5c40a14e4a5bfebb27caff2f54e5b9c43e5f4071a63b1b281a3e64bdd9d85b16e0a105b62cbc8f0bdff165055072e80fb17f56f11b8ee038b65b
data/README.adoc CHANGED
@@ -39,6 +39,38 @@ Alki do
39
39
  end
40
40
  ```
41
41
 
42
+ ### Naming Pitfalls
43
+
44
+ Alki::Reload attempts to be conservative in what it reloads.
45
+ By default, it will only reload files which are in your project,
46
+ and are either in the ruby load path
47
+ or registered with https://github.com/alki-project/alki-loader[Alki::Loader].
48
+
49
+ Additionally, Alki::Reload will only reload files where it can find a
50
+ corresponding constant.
51
+ This is done via a straightforward "classify" method which does *not* take
52
+ abbreviations into account.
53
+
54
+ #### Examples of Classes that Alki::Reload will not reload
55
+
56
+ .lib/my_project/foo.rb
57
+ ```ruby
58
+ class Foo
59
+ end
60
+ ```
61
+
62
+ Expects `Foo` to be in the module `MyProject`.
63
+
64
+ .lib/my_project/http_client.rb
65
+ ```ruby
66
+ module MyProject
67
+ class HTTPClient
68
+ end
69
+ end
70
+ ```
71
+
72
+ Doesn't know that "HTTP" is an acronym, so it expects class to be `HttpClient`.
73
+
42
74
  ### Conditional usage
43
75
 
44
76
  Because enabling reload can have a performance impact, typically it's only enabled when in some sort
data/alki-reload.gemspec CHANGED
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib"]
22
22
 
23
23
  spec.add_dependency "listen", "~> 3.0"
24
- spec.add_dependency "alki", "~> 0.13.1"
24
+ spec.add_dependency "alki", "~> 0.13.3"
25
25
  end
@@ -5,9 +5,10 @@ module Alki
5
5
  class AssemblyDelegator < Delegator
6
6
  def initialize(obj,watcher,reloader)
7
7
  @obj = obj
8
- @loaded = false
8
+ @loaded = true
9
9
  @watcher = watcher
10
10
  @reloader = reloader
11
+ @watcher.start
11
12
  end
12
13
 
13
14
  def __unload__
@@ -32,8 +32,8 @@ module Alki
32
32
  class Listener
33
33
  def initialize(dirs,reloader)
34
34
  @count = 0
35
- @listen = Listen.to(*dirs) do |modified, _added, _removed|
36
- if @count > 0 && modified
35
+ @listen = Listen.to(*dirs) do |modified, added, removed|
36
+ if @count > 0 && (modified || added || removed)
37
37
  reloader.reload
38
38
  end
39
39
  end
@@ -1,5 +1,5 @@
1
1
  module Alki
2
2
  module Reload
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alki-reload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Edlefsen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-23 00:00:00.000000000 Z
11
+ date: 2018-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.13.1
33
+ version: 0.13.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.13.1
40
+ version: 0.13.3
41
41
  description:
42
42
  email:
43
43
  - matt.edlefsen@gmail.com