vedeu 0.4.42 → 0.4.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/application/application_view.rb +2 -1
- data/lib/vedeu/bootstrap.rb +11 -6
- data/lib/vedeu/cli/generator/templates/application/Gemfile +1 -1
- data/lib/vedeu/cli/generator/templates/application/application.erb +1 -0
- data/lib/vedeu/configuration/api.rb +10 -0
- data/lib/vedeu/configuration/configuration.rb +12 -0
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/configuration/api_test.rb +7 -0
- data/test/lib/vedeu/configuration/configuration_test.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cffdbe3379ae8f53f8e224ad01f554f697291aeb
|
4
|
+
data.tar.gz: 48dacd852a9ece5238fd2986a64897335416f0c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36dc6810c4e595f8ddacb09f2c076c0b9d00d457b281a4d03b31cb980db8a547881b458707e6f456b4be1a5ab2c7cbdfd65a8da3b8d06fb7c2463a03b440857
|
7
|
+
data.tar.gz: 2709588855899d5f3d107ab9ccccc66d6b93bfb7693d59cad06865d84bff61e3be0398b8c07d532d3614ffd32bf019c1c96c576941fec30da6d075127c56f08a
|
@@ -40,7 +40,8 @@ module Vedeu
|
|
40
40
|
# @param value [String]
|
41
41
|
# @return [String]
|
42
42
|
def template(value)
|
43
|
-
@template =
|
43
|
+
@template = Vedeu::Configuration.base_path +
|
44
|
+
"/app/views/templates/#{value}.erb"
|
44
45
|
end
|
45
46
|
|
46
47
|
end # ApplicationView
|
data/lib/vedeu/bootstrap.rb
CHANGED
@@ -27,13 +27,18 @@ module Vedeu
|
|
27
27
|
def start
|
28
28
|
Vedeu.configure { log('/tmp/vedeu_bootstrap.log') }
|
29
29
|
|
30
|
+
# config/configuration.rb is already loaded so don't load it twice
|
31
|
+
Dir[File.join(Vedeu::Configuration.base_path, 'config/**/*')].each do |f|
|
32
|
+
next if f =~ %r{config/configuration\.rb}
|
33
|
+
load f
|
34
|
+
end
|
35
|
+
|
30
36
|
[
|
31
|
-
'
|
32
|
-
'
|
33
|
-
'
|
34
|
-
'
|
35
|
-
|
36
|
-
].each { |path| load(path) }
|
37
|
+
'app/controllers/**/*',
|
38
|
+
'app/helpers/**/*',
|
39
|
+
'app/views/**/*',
|
40
|
+
'app/models/keymaps/**/*',
|
41
|
+
].each { |path| load(File.join(Vedeu::Configuration.base_path, path)) }
|
37
42
|
|
38
43
|
entry_point
|
39
44
|
|
@@ -277,6 +277,16 @@ module Vedeu
|
|
277
277
|
end
|
278
278
|
alias_method :renderers, :renderer
|
279
279
|
|
280
|
+
# Override the base path for the application (for locating templates and
|
281
|
+
# other resources). By default the base path is just cwd but this will
|
282
|
+
# not work for many applications.
|
283
|
+
#
|
284
|
+
# @param value [String]
|
285
|
+
# @return [String]
|
286
|
+
def base_path(path = nil)
|
287
|
+
options[:base_path] = path
|
288
|
+
end
|
289
|
+
|
280
290
|
# Sets the value of STDIN.
|
281
291
|
#
|
282
292
|
# @example
|
@@ -34,6 +34,13 @@ module Vedeu
|
|
34
34
|
|
35
35
|
class << self
|
36
36
|
|
37
|
+
# Returns the base_path value
|
38
|
+
#
|
39
|
+
# @return [String]
|
40
|
+
def base_path
|
41
|
+
instance.options[:base_path]
|
42
|
+
end
|
43
|
+
|
37
44
|
# Configure Vedeu with sensible defaults. If the client application sets
|
38
45
|
# options, override the defaults with those, and if command-line arguments
|
39
46
|
# are provided at application invocation, override any options with the
|
@@ -241,6 +248,7 @@ module Vedeu
|
|
241
248
|
# @return [Hash]
|
242
249
|
def defaults
|
243
250
|
{
|
251
|
+
base_path: set_base_path,
|
244
252
|
colour_mode: detect_colour_mode,
|
245
253
|
debug: false,
|
246
254
|
drb: false,
|
@@ -272,6 +280,10 @@ module Vedeu
|
|
272
280
|
end
|
273
281
|
end
|
274
282
|
|
283
|
+
def set_base_path
|
284
|
+
File.expand_path('.')
|
285
|
+
end
|
286
|
+
|
275
287
|
end # Configuration
|
276
288
|
|
277
289
|
end # Vedeu
|
data/lib/vedeu/version.rb
CHANGED
@@ -12,6 +12,13 @@ module Vedeu
|
|
12
12
|
before { Configuration.reset! }
|
13
13
|
after { test_configuration }
|
14
14
|
|
15
|
+
describe '#base_path' do
|
16
|
+
it 'sets the option to the desired value' do
|
17
|
+
configuration = Vedeu.configure { base_path 'somewhere' }
|
18
|
+
configuration.base_path.must_equal('somewhere')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
15
22
|
describe '.configure' do
|
16
23
|
it 'returns the configuration singleton' do
|
17
24
|
Vedeu.configure do
|
@@ -9,6 +9,14 @@ module Vedeu
|
|
9
9
|
before { Configuration.reset! }
|
10
10
|
after { test_configuration }
|
11
11
|
|
12
|
+
describe '#base_path' do
|
13
|
+
it { described.must_respond_to(:base_path) }
|
14
|
+
|
15
|
+
it 'returns the value of the base_path option' do
|
16
|
+
Configuration.base_path.must_equal(Dir.pwd)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
12
20
|
describe '#debug?' do
|
13
21
|
it { described.must_respond_to(:debug) }
|
14
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vedeu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Laking
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|