forest_liana 4.0.0.pre.beta.0 → 4.0.0.pre.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/forest_liana.rb +10 -0
- data/lib/forest_liana/bootstraper.rb +1 -2
- data/lib/forest_liana/version.rb +1 -1
- data/test/forest_liana_test.rb +18 -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: 279b9a8779c336b9d7595ea50a14dc2a035dd40d
|
4
|
+
data.tar.gz: 4fda854a5dab3e00afbb5a47bc633df20031dccf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12abe891a9f317483198788a4f3a0bccf989b10062da6b1335edc1ff351a4bf80fb23672c6a03c3016bfa8bf9bf3b6fa4be7e3367f18609cacd532a6d7c371e7
|
7
|
+
data.tar.gz: 94832dfe0e227576d3c1a92ede23352a103a53fca26511a0bcb47e28c85f2fda150f97c95db4193fa0466e6e2a5509725d55fc5eead55e8245d9d801db6d056f
|
data/lib/forest_liana.rb
CHANGED
@@ -37,9 +37,19 @@ module ForestLiana
|
|
37
37
|
self.names_overriden = {}
|
38
38
|
self.meta = {}
|
39
39
|
|
40
|
+
@config_dir = 'lib/forest_liana/**/*.rb'
|
41
|
+
|
40
42
|
# TODO: Remove once lianas prior to 2.0.0 are not supported anymore.
|
41
43
|
self.names_old_overriden = {}
|
42
44
|
|
45
|
+
def self.config_dir=(config_dir)
|
46
|
+
@config_dir = config_dir
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.config_dir
|
50
|
+
Rails.root.join(@config_dir)
|
51
|
+
end
|
52
|
+
|
43
53
|
def self.schema_for_resource resource
|
44
54
|
self.apimap.find do |collection|
|
45
55
|
SchemaUtils.find_model_from_collection_name(collection.name)
|
@@ -211,8 +211,7 @@ module ForestLiana
|
|
211
211
|
end
|
212
212
|
|
213
213
|
def require_lib_forest_liana
|
214
|
-
|
215
|
-
Dir.glob(File.expand_path(path, __FILE__)).each do |file|
|
214
|
+
Dir.glob(ForestLiana.config_dir).each do |file|
|
216
215
|
load file
|
217
216
|
end
|
218
217
|
end
|
data/lib/forest_liana/version.rb
CHANGED
data/test/forest_liana_test.rb
CHANGED
@@ -4,4 +4,22 @@ class ForestLianaTest < ActiveSupport::TestCase
|
|
4
4
|
test "truth" do
|
5
5
|
assert_kind_of Module, ForestLiana
|
6
6
|
end
|
7
|
+
|
8
|
+
test 'config_dirs with no value set' do
|
9
|
+
assert_equal(
|
10
|
+
Rails.root.join('lib/forest_liana/**/*.rb'),
|
11
|
+
ForestLiana.config_dir
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
test 'config_dirs with a value set' do
|
16
|
+
ForestLiana.config_dir = 'lib/custom/**/*.rb'
|
17
|
+
|
18
|
+
assert_equal(
|
19
|
+
Rails.root.join('lib/custom/**/*.rb'),
|
20
|
+
ForestLiana.config_dir
|
21
|
+
)
|
22
|
+
|
23
|
+
ForestLiana.config_dir = nil
|
24
|
+
end
|
7
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.pre.beta.
|
4
|
+
version: 4.0.0.pre.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|