intranet-core 2.0.0 → 2.1.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2a43e959280a59c8d78aca617cfe1cce627a91f
|
4
|
+
data.tar.gz: 0c6a14aceaf6386eafdf9df74d44348f7cd4e19c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7aa8f0cf791ce22fd5098176bcc1431f6742e6268f6a244d731a211c6b28510505885d216b2b1ef8f2a2fbd4e321b5f08552c9a7d20d8673b84a34f1d0f243e
|
7
|
+
data.tar.gz: 5af64c4232442843117fbd865cd06c228d29ef682a647169c2f78c5dbfca9113214864ca673c8c75338ee7df4a87558fada653391565b0c77138e581c2ae77a4
|
@@ -22,6 +22,15 @@ module Intranet
|
|
22
22
|
true
|
23
23
|
end
|
24
24
|
|
25
|
+
# Specifies the absolute path to the resources directory for that module. This directory should
|
26
|
+
# contain three subdirectories: +haml/+, +locales/+ and +www/+.
|
27
|
+
# This method should be redefined to overwrite this default value with the actual resources
|
28
|
+
# directory path.
|
29
|
+
# @return [String] The absolute path to the resources directory for the module.
|
30
|
+
def resources_dir
|
31
|
+
File.join(__dir__, 'resources')
|
32
|
+
end
|
33
|
+
|
25
34
|
# Destroys the responder instance.
|
26
35
|
# This method gets called when server is shut down.
|
27
36
|
def finalize
|
data/lib/intranet/core.rb
CHANGED
@@ -52,7 +52,7 @@ module Intranet
|
|
52
52
|
# mounted under +<path>/design+ on the web server.
|
53
53
|
# @raise [ArgumentError] If the +path+ is not valid.
|
54
54
|
# @raise [Errno::EALREADY] If the server is already running.
|
55
|
-
def register_module(responder, path, resources_dir)
|
55
|
+
def register_module(responder, path, resources_dir = responder.resources_dir)
|
56
56
|
raise Errno::EALREADY if @server.status != :Stop
|
57
57
|
|
58
58
|
@builder.register(responder, path)
|
data/spec/intranet/core_spec.rb
CHANGED
@@ -127,8 +127,9 @@ RSpec.describe Intranet::Core do
|
|
127
127
|
before(:each) do
|
128
128
|
@intranet = described_class.new(Intranet::Logger.new(Intranet::Logger::FATAL))
|
129
129
|
responder = Intranet::TestResponder.new('/index.html' => [200, 'text/html', ''])
|
130
|
+
# Third argument of register_module() is optional, so we test both cases.
|
130
131
|
@intranet.register_module(responder, %w[responder], responder.resources_dir)
|
131
|
-
@intranet.register_module(responder, %w[resp onder]
|
132
|
+
@intranet.register_module(responder, %w[resp onder])
|
132
133
|
@thread = Thread.new do
|
133
134
|
@intranet.start
|
134
135
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intranet-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ebling Mis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -189,7 +189,6 @@ files:
|
|
189
189
|
- spec/intranet/logger_spec.rb
|
190
190
|
- spec/spec_helper.rb
|
191
191
|
- spec/test_responder/responder.rb
|
192
|
-
- spec/test_responder/www/style.css
|
193
192
|
homepage: https://rubygems.org/gems/intranet-core
|
194
193
|
licenses:
|
195
194
|
- MIT
|