forest_liana 9.15.8 → 9.16.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
  SHA256:
3
- metadata.gz: 196dd946e590abc0f8d08471986655e8bd3244638cb278e91fd9e13ae446dcf4
4
- data.tar.gz: 6fc5262c9b202656e03f6f490d0c25776cee50c5af1743705667f06aee69d205
3
+ metadata.gz: e5b410cf0b004c0b725119f7f0d4328165b344579181d022930a3965c53569b6
4
+ data.tar.gz: 0c69947edf290b25d2fa53503f9f754a3d0d73e571ef6af525969c201bb0e469
5
5
  SHA512:
6
- metadata.gz: 72a7ce8cca5d0e3d0e3829a5db69120d30c1c99e6ce09a766a00bb9816b52e071c4ed2c8a57879d0ce2e09213bc24b32ee782cd382ec4328af2131baa5b30167
7
- data.tar.gz: d78f92c535f06d035ea1eb896621dfc8cb0c9f77001f252b84f594c8f5c58215b57a7bdb7cac5f339f7e7f7612baf506ef94e6a983bcec8f7cd849cedde6072b
6
+ metadata.gz: 8391f47c0f3731827d4170eaae994e230b8567a6166b344581876576d10eabf1df964ae51b1480823ba2d50b3ef08bd53a99851d29dc4db26b92fe60d3df126e
7
+ data.tar.gz: 5a934a2555b71fed7b80d49546435c1141223b9d6ba00a7443bf8503e76c1aa38211c906cd95da091242a024e30da9c1007ce5491a4d70a1731cbf4df1b19b07
@@ -264,6 +264,11 @@ module ForestLiana
264
264
  end
265
265
 
266
266
  def send_apimap(with_feedback=false)
267
+ if should_skip_schema_update?
268
+ log_schema_skip
269
+ return
270
+ end
271
+
267
272
  if ForestLiana.env_secret && ForestLiana.env_secret.length != 64
268
273
  FOREST_LOGGER.error "Your env_secret does not seem to be correct. " \
269
274
  "Can you check on Forest that you copied it properly in the " \
@@ -275,7 +280,12 @@ module ForestLiana
275
280
  puts " = Sending Forest Apimap:\n#{JSON.pretty_generate(apimap)}" if with_feedback
276
281
  uri = URI.parse("#{forest_url}/forest/apimaps")
277
282
  http = Net::HTTP.new(uri.host, uri.port)
278
- http.use_ssl = true if forest_url.start_with?('https')
283
+ if forest_url.start_with?('https')
284
+ http.use_ssl = true
285
+ if ENV['FOREST_URL'].present?
286
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
287
+ end
288
+ end
279
289
  http.start do |client|
280
290
  request = Net::HTTP::Post.new(uri.path)
281
291
  request.body = apimap.to_json
@@ -667,5 +677,15 @@ module ForestLiana
667
677
  'unknown'
668
678
  end
669
679
  end
680
+
681
+ def should_skip_schema_update?
682
+ ForestLiana.skip_schema_update == true
683
+ end
684
+
685
+ def log_schema_skip
686
+ FOREST_LOGGER.warn '[ForestAdmin] Schema update skipped (skip_schema_update flag is true)'
687
+ environment = Rails.env.production? ? 'production' : 'development'
688
+ FOREST_LOGGER.info "[ForestAdmin] Running in #{environment} mode"
689
+ end
670
690
  end
671
691
  end
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "9.15.8"
2
+ VERSION = "9.16.0"
3
3
  end
data/lib/forest_liana.rb CHANGED
@@ -29,6 +29,7 @@ module ForestLiana
29
29
  mattr_accessor :meta
30
30
  mattr_accessor :logger
31
31
  mattr_accessor :reporter
32
+ mattr_accessor :skip_schema_update
32
33
  # TODO: Remove once lianas prior to 2.0.0 are not supported anymore.
33
34
  mattr_accessor :names_old_overriden
34
35
 
@@ -42,6 +43,7 @@ module ForestLiana
42
43
  self.meta = {}
43
44
  self.logger = nil
44
45
  self.reporter = nil
46
+ self.skip_schema_update = false
45
47
 
46
48
  @config_dir = 'lib/forest_liana/**/*.rb'
47
49
 
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,17 @@
1
1
  require 'simplecov'
2
+ require 'simplecov_json_formatter'
3
+ require 'simplecov-html'
4
+
5
+ SimpleCov.formatters = [SimpleCov::Formatter::JSONFormatter, SimpleCov::Formatter::HTMLFormatter]
2
6
  SimpleCov.start 'rails'
3
7
  SimpleCov.add_filter ['app/services/forest_liana/ability/fetch.rb', 'lib/forest_liana/version.rb']
4
8
 
9
+ SimpleCov.coverage_dir 'coverage'
10
+ SimpleCov.at_exit do
11
+ result = SimpleCov.result
12
+ result.format!
13
+ end
14
+
5
15
  # This file was generated by the `rails generate rspec:install` command. Conventionally, all
6
16
  # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
7
17
  # The generated `.rspec` file contains `--require spec_helper` which will cause
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: 9.15.8
4
+ version: 9.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-03 00:00:00.000000000 Z
11
+ date: 2025-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails