forest_liana 4.0.0.pre.beta.0 → 4.0.0.pre.beta.1

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: dafadb3ed7cf1c34d0010729e459c13ba38e22de
4
- data.tar.gz: 6dff3ee72a4aa231b68508e3d87b0931fb16d718
3
+ metadata.gz: 279b9a8779c336b9d7595ea50a14dc2a035dd40d
4
+ data.tar.gz: 4fda854a5dab3e00afbb5a47bc633df20031dccf
5
5
  SHA512:
6
- metadata.gz: 48338ecfc6319ca9ab824fa47771167e9203e3bbe567b3d38ff907b0ae067dc01f20e5830ed7079bdeb67115d54ede8570ce53125a738a016874b90bbc76979f
7
- data.tar.gz: 052c0e82c436681276c2982480002adcc107b7e0b0018f1bd7056af1e6f6d5f3e281e9f9022d6b432b798224d08595bf9da81da04ab5c1fb52a87c2071c56d08
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
- path = Rails.root.join('lib', 'forest_liana', '**', '*.rb')
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
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "4.0.0-beta.0"
2
+ VERSION = "4.0.0-beta.1"
3
3
  end
@@ -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.0
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-08-07 00:00:00.000000000 Z
11
+ date: 2019-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails