lib/r2-oas/schema/editor.rb in r2-oas-0.2.0 vs lib/r2-oas/schema/editor.rb in r2-oas-0.3.0
- old
+ new
@@ -3,11 +3,10 @@
require 'docker'
require 'eventmachine'
require 'watir'
require 'tempfile'
require 'fileutils'
-require 'shell'
require 'forwardable'
# Can't use ActiveSupport::Autroload
# ThreadError: can't be called from trap context
require 'r2-oas/schema/analyzer'
@@ -71,10 +70,14 @@
conv_after_schema_data = YAML.load(@after_schema_data)
analyzer = Analyzer.new(@before_schema_data, conv_after_schema_data, options)
analyzer.analyze_docs
end
+ # MEMO
+ # TargetRubyVersion is 2.7 and there is a warning
+ # Because it is necessary to support from ruby2.3 series where begin cannot be omitted
+ # rubocop:disable Style/RedundantBegin
def ensure_save_tmp_schema_file
EM.add_periodic_timer(interval_to_save_edited_tmp_schema) do
m = Mutex.new
return nil unless @browser.exists?
@@ -88,9 +91,10 @@
end
end
end
end
end
+ # rubocop:enable Style/RedundantBegin
def save_after_fetch_local_strage
@after_schema_data = @browser.driver.local_storage[storage_key] || @after_schema_data
save_edited_schema
puts "\nwait for signal trap ..."