forest_liana 2.14.0 → 2.14.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: 0e5ad26fa4fc70fb9b65e3327884b7d2c9f0b7bb
4
- data.tar.gz: 06a6093675ef2b6906dd45b585d3be366230a718
3
+ metadata.gz: 1ce4030cedcac769bd40e4afd1306ad13ed9dea3
4
+ data.tar.gz: bf9dc1cdd5707b44785d01d25d0ffa430209c50e
5
5
  SHA512:
6
- metadata.gz: 4a209c7f717e94558c2c2f23235b3f45d65542d5cb52a2b9d559dea1e3d31ee3bea929ab77c8502c7923013c4e97b9fea713a107741f17aab5d1805f16722c91
7
- data.tar.gz: 05ac2085057362df3aa8bd4424d53d15399fad2efe1bc97a64e6ec56be8451bd04e4c279d3c069ae893a232aeaa9ebd43b04b5a4b15cdf3e28d4c7feff9a8457
6
+ metadata.gz: 74ae6028636c45a649ffaa79feac4e87cbdff5a3a2998280f2334ae4f5c156949751fb5646e382c172a3a2a941ffff677f84e37a173a02317e34269ed31d94c7
7
+ data.tar.gz: 4973bc1d6fe9fd409fee6541c309093d1aa21a25a3645f12f59618c207cdc4cc4d39ed1855c19c9249b0fcdd0d7e4b773b456c875acc2354305f80868c8aae8f
@@ -13,35 +13,27 @@ module ForestLiana
13
13
  ForestLiana.env_secret = ForestLiana.secret_key
14
14
  ForestLiana.auth_secret = ForestLiana.auth_key
15
15
  end
16
- end
17
16
 
18
- def perform(with_feedback=false)
19
- introspect_and_generate_factories
17
+ fetch_models
18
+ check_integrations_setup
19
+ namespace_duplicated_models
20
+ create_factories
20
21
 
21
- if ForestLiana.env_secret
22
- generate_apimap
23
- send_apimap(with_feedback)
24
- end
22
+ generate_apimap if ForestLiana.env_secret
25
23
  end
26
24
 
27
- def display_apimap
28
- introspect_and_generate_factories
25
+ def synchronize(with_feedback=false)
26
+ send_apimap(with_feedback) if ForestLiana.env_secret
27
+ end
29
28
 
29
+ def display_apimap
30
30
  if ForestLiana.env_secret
31
- generate_apimap
32
31
  puts " = Current Forest Apimap:\n#{JSON.pretty_generate(get_apimap_serialized)}"
33
32
  end
34
33
  end
35
34
 
36
35
  private
37
36
 
38
- def introspect_and_generate_factories
39
- fetch_models
40
- check_integrations_setup
41
- namespace_duplicated_models
42
- create_factories
43
- end
44
-
45
37
  def generate_apimap
46
38
  create_apimap
47
39
  require_lib_forest_liana
@@ -61,18 +61,21 @@ module ForestLiana
61
61
  end
62
62
 
63
63
  config.after_initialize do |app|
64
- if !Rails.env.test? && !rake?
64
+ if !Rails.env.test?
65
65
  if error
66
66
  FOREST_LOGGER.error "Impossible to set the whitelisted Forest " \
67
67
  "domains for CORS constraint:\n#{error}"
68
68
  end
69
69
 
70
- unless ENV['FOREST_DEACTIVATE_AUTOMATIC_APIMAP']
71
- eager_load_active_record_descendants(app)
70
+ eager_load_active_record_descendants(app)
72
71
 
73
- if database_available?
74
- # NOTICE: Do not run the code below on rails g forest_liana:install.
75
- Bootstraper.new().perform if ForestLiana.env_secret || ForestLiana.secret_key
72
+ if database_available?
73
+ # NOTICE: Do not run the code below on rails g forest_liana:install.
74
+ if ForestLiana.env_secret || ForestLiana.secret_key
75
+ unless rake?
76
+ bootstraper = Bootstraper.new
77
+ bootstraper.synchronize unless ENV['FOREST_DEACTIVATE_AUTOMATIC_APIMAP']
78
+ end
76
79
  end
77
80
  end
78
81
  end
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "2.14.0"
2
+ VERSION = "2.14.1"
3
3
  end
@@ -2,7 +2,7 @@ namespace :forest do
2
2
  desc "Display the current Forest Apimap version"
3
3
  task(:display_apimap).clear
4
4
  task display_apimap: :environment do
5
- bootstraper = ForestLiana::Bootstraper.new()
5
+ bootstraper = ForestLiana::Bootstraper.new
6
6
  bootstraper.display_apimap
7
7
  end
8
8
  end
@@ -3,8 +3,8 @@ namespace :forest do
3
3
  task(:send_apimap).clear
4
4
  task send_apimap: :environment do
5
5
  if ForestLiana.env_secret
6
- bootstraper = ForestLiana::Bootstraper.new()
7
- bootstraper.perform(true)
6
+ bootstraper = ForestLiana::Bootstraper.new
7
+ bootstraper.synchronize(true)
8
8
  else
9
9
  puts 'Cannot send the Apimap, Forest cannot find your env_secret'
10
10
  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: 2.14.0
4
+ version: 2.14.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: 2018-10-25 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails