alki-reload 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/README.adoc +38 -20
- data/Rakefile +2 -1
- data/alki-reload.gemspec +1 -4
- data/bin/alki +17 -0
- data/bin/bundler +17 -0
- data/bin/listen +17 -0
- data/bin/rake +17 -0
- data/lib/alki/reload/reloadable_delegator.rb +0 -1
- data/lib/alki/reload/version.rb +1 -1
- metadata +9 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65642f82e0d553cec6756fedc41accc08f648750
|
4
|
+
data.tar.gz: 6abe7c4cd9206ba8399a9fb3dc41233a04d9ce72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1a31ba7529595181497607d8546da97d36e07706a073952242c8bb754bf1cdb83f85c250396c3c43e1eb77bd7db3460feaf450c5d66f5adca189e98847ed5fe
|
7
|
+
data.tar.gz: fd14180efcbca8774f7f716c6db2378c44a6263775f0344434205bf3c871cedbca2d98d0dfd63d33b5fcf70f8e59bb5733910dde1a7f163df655b5d394e0268e
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
@@ -34,9 +34,7 @@ will not actively watch files or actively hook into services. Setting `enable` t
|
|
34
34
|
.config/assembly.rb
|
35
35
|
```ruby
|
36
36
|
Alki do
|
37
|
-
|
38
|
-
set(:enable) { true }
|
39
|
-
end
|
37
|
+
try_mount :reloader, 'alki/reload', enable: true
|
40
38
|
# ...
|
41
39
|
end
|
42
40
|
```
|
@@ -51,30 +49,50 @@ of development mode.
|
|
51
49
|
Alki do
|
52
50
|
set(:development?) { ENV['APP_ENV'] != 'production' }
|
53
51
|
|
54
|
-
|
52
|
+
try_mount :reloader, 'alki/reload' do
|
55
53
|
set(:enable) { development? }
|
56
54
|
end
|
57
55
|
# ...
|
58
56
|
end
|
59
57
|
```
|
60
58
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
Most applications, when running, spend most of their time inside a "main loop". If it's a server,
|
65
|
-
it might be the loop listening for incoming data, if it's a console application it might be the loop
|
66
|
-
waiting for user input.
|
59
|
+
In addition, using `try_mount` instead of the normal `mount`
|
60
|
+
will only mount the reloader if the gem can be found,
|
61
|
+
which can be controlled using Bundler.
|
67
62
|
|
68
|
-
|
69
|
-
provides a feature to help work around this.
|
70
|
-
|
71
|
-
First off, because the service the main loop is in can't be reloaded, it should be made as small and
|
72
|
-
simple as possible, offloading all other functionality into secondary services that it takes as
|
73
|
-
dependencies.
|
63
|
+
### Main Loops
|
74
64
|
|
75
|
-
|
76
|
-
|
77
|
-
|
65
|
+
One of the core issues in code reloading is when to actually do
|
66
|
+
the reload.
|
67
|
+
If your Assembly is called from some other code
|
68
|
+
(such as a Rails application),
|
69
|
+
then reloading can just be done between calls into the assembly.
|
70
|
+
|
71
|
+
But, if the entire application is running inside the assembly, then
|
72
|
+
a way to reload the assembly while it's still running is needed.
|
73
|
+
|
74
|
+
Most applications spend most of their time inside a "main loop".
|
75
|
+
If it's a server,
|
76
|
+
it might be the loop listening for incoming data,
|
77
|
+
if it's a console application
|
78
|
+
it might be the loop waiting for user input.
|
79
|
+
|
80
|
+
Because the main loop is always running,
|
81
|
+
there is never an opportunity to reload it.
|
82
|
+
Alki::Reload provides a feature to help work around this.
|
83
|
+
|
84
|
+
First off, because the service the main loop is in can't be reloaded,
|
85
|
+
it should be made as small and simple as possible,
|
86
|
+
offloading all other functionality
|
87
|
+
into secondary services that it takes
|
88
|
+
as dependencies.
|
89
|
+
|
90
|
+
Second, it should be tagged with a `main_loop` tag.
|
91
|
+
By tagging your main loop service,
|
92
|
+
Alki::Reload will actively hook into the service
|
93
|
+
and wrap it's dependencies with wrapper objects
|
94
|
+
that will pick up the new version of those dependencies
|
95
|
+
whenever the project is reloaded.
|
78
96
|
|
79
97
|
Alki::Loader must be enabled for this feature to be active.
|
80
98
|
|
@@ -122,7 +140,7 @@ is running the prompt and handler can be changed and reloaded.
|
|
122
140
|
By default, `lib`, `config` and any files or directories configured in
|
123
141
|
https://github.com/alki-project/alki-loader[Alki::Loader] are watched.
|
124
142
|
|
125
|
-
Additional directories can be added by overriding the dirs element. Additional directories must also
|
143
|
+
Additional directories can be added by overriding the `dirs` element. Additional directories must also
|
126
144
|
be in `$LOAD_PATH`.
|
127
145
|
|
128
146
|
.config/assembly.rb
|
data/Rakefile
CHANGED
data/alki-reload.gemspec
CHANGED
@@ -20,9 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.13"
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
23
|
spec.add_dependency "listen", "~> 3.0"
|
26
|
-
spec.add_dependency "alki", "~> 0.
|
27
|
-
spec.add_dependency "alki-testing", "~> 0.1"
|
24
|
+
spec.add_dependency "alki", "~> 0.13.1"
|
28
25
|
end
|
data/bin/alki
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'alki' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("alki", "alki")
|
data/bin/bundler
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'bundler' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("bundler", "bundler")
|
data/bin/listen
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'listen' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("listen", "listen")
|
data/bin/rake
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'rake' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("rake", "rake")
|
data/lib/alki/reload/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alki-reload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
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
|
+
date: 2017-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.13'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.13'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: listen
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,28 +30,14 @@ dependencies:
|
|
58
30
|
requirements:
|
59
31
|
- - "~>"
|
60
32
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0.12'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: alki-testing
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0.1'
|
33
|
+
version: 0.13.1
|
76
34
|
type: :runtime
|
77
35
|
prerelease: false
|
78
36
|
version_requirements: !ruby/object:Gem::Requirement
|
79
37
|
requirements:
|
80
38
|
- - "~>"
|
81
39
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
40
|
+
version: 0.13.1
|
83
41
|
description:
|
84
42
|
email:
|
85
43
|
- matt.edlefsen@gmail.com
|
@@ -94,6 +52,10 @@ files:
|
|
94
52
|
- README.adoc
|
95
53
|
- Rakefile
|
96
54
|
- alki-reload.gemspec
|
55
|
+
- bin/alki
|
56
|
+
- bin/bundler
|
57
|
+
- bin/listen
|
58
|
+
- bin/rake
|
97
59
|
- config/assembly.rb
|
98
60
|
- lib/alki/reload.rb
|
99
61
|
- lib/alki/reload/assembly_delegator.rb
|
@@ -125,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
87
|
version: '0'
|
126
88
|
requirements: []
|
127
89
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.6.12
|
129
91
|
signing_key:
|
130
92
|
specification_version: 4
|
131
93
|
summary: Automatic reloading of alki projects
|