Class: PM::Recorder
- Inherits:
-
Object
- Object
- PM::Recorder
- Includes:
- Singleton
- Defined in:
- lib/cocoapods-byte-panglem-beta/recorder.rb
Overview
记录方
Instance Attribute Summary collapse
-
#adapter_list ⇒ Object
Returns the value of attribute adapter_list.
-
#global_note ⇒ Object
Returns the value of attribute global_note.
-
#is_debug ⇒ Object
readonly
Returns the value of attribute is_debug.
-
#is_load_plugin ⇒ Object
readonly
Returns the value of attribute is_load_plugin.
-
#lockfile_data ⇒ Object
readonly
Returns the value of attribute lockfile_data.
-
#plugin_version ⇒ Object
readonly
Returns the value of attribute plugin_version.
-
#rely_original_version ⇒ Object
Returns the value of attribute rely_original_version.
-
#rely_target_version ⇒ Object
Returns the value of attribute rely_target_version.
-
#sdk_original_version ⇒ Object
Returns the value of attribute sdk_original_version.
-
#sdk_target_version ⇒ Object
Returns the value of attribute sdk_target_version.
-
#target_info ⇒ Object
Returns the value of attribute target_info.
Instance Method Summary collapse
- #add_global_note(note) ⇒ Object
- #find_global_note(option, is_force_update = false) ⇒ Object
- #get_global_note ⇒ Object
- #get_target(label) ⇒ Object
-
#initialize ⇒ Recorder
constructor
A new instance of Recorder.
- #is_release ⇒ Object
- #set_is_debug(is_debug) ⇒ Object
- #set_plugin_load(is_load) ⇒ Object
- #to_hash ⇒ Object
- #use_service_local ⇒ Object
Constructor Details
#initialize ⇒ Recorder
Returns a new instance of Recorder.
311 312 313 314 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 311 def initialize() @adapter_list = [] @is_debug = false end |
Instance Attribute Details
#adapter_list ⇒ Object
Returns the value of attribute adapter_list.
304 305 306 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 304 def adapter_list @adapter_list end |
#global_note ⇒ Object
Returns the value of attribute global_note.
298 299 300 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 298 def global_note @global_note end |
#is_debug ⇒ Object (readonly)
Returns the value of attribute is_debug.
308 309 310 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 308 def is_debug @is_debug end |
#is_load_plugin ⇒ Object (readonly)
Returns the value of attribute is_load_plugin.
305 306 307 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 305 def is_load_plugin @is_load_plugin end |
#lockfile_data ⇒ Object (readonly)
Returns the value of attribute lockfile_data.
307 308 309 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 307 def lockfile_data @lockfile_data end |
#plugin_version ⇒ Object (readonly)
Returns the value of attribute plugin_version.
306 307 308 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 306 def plugin_version @plugin_version end |
#rely_original_version ⇒ Object
Returns the value of attribute rely_original_version.
301 302 303 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 301 def rely_original_version @rely_original_version end |
#rely_target_version ⇒ Object
Returns the value of attribute rely_target_version.
303 304 305 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 303 def rely_target_version @rely_target_version end |
#sdk_original_version ⇒ Object
Returns the value of attribute sdk_original_version.
300 301 302 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 300 def sdk_original_version @sdk_original_version end |
#sdk_target_version ⇒ Object
Returns the value of attribute sdk_target_version.
302 303 304 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 302 def sdk_target_version @sdk_target_version end |
#target_info ⇒ Object
Returns the value of attribute target_info.
299 300 301 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 299 def target_info @target_info end |
Instance Method Details
#add_global_note(note) ⇒ Object
325 326 327 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 325 def add_global_note(note) @global_note = note end |
#find_global_note(option, is_force_update = false) ⇒ Object
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 329 def find_global_note(option, is_force_update = false) return @global_note if !is_force_update && @global_note != nil @global_note = GlobalNote.new(false, PM::BuildConfig.update_value_non, false) load_key = PM::BuildConfig.get_load_key update_key = PM::BuildConfig.get_update_key load_detect_key = PM::BuildConfig.get_load_detect_key auto_load_whitelist_key = PM::BuildConfig.get_load_whitelist_key is_release_key = PM::BuildConfig.get_is_release_key use_service_local_key = PM::BuildConfig.get_use_service_local_key case option when true, false @global_note = PM::GlobalNote.new(option,option,option,{}) when Hash load_value = option.has_key?(load_key) ? option[load_key] : true update_value = option.has_key?(update_key) ? option[update_key] : true detect_value = option.has_key?(load_detect_key) ? option[load_detect_key] : true auto_load_whitelist = option.has_key?(auto_load_whitelist_key)?option[auto_load_whitelist_key] : {} is_release = option.has_key?(is_release_key)?option[is_release_key] : false @global_note = PM::GlobalNote.new(load_value, update_value,detect_value,auto_load_whitelist, is_release) @global_note.use_service_local = option.has_key?(use_service_local_key)?option[use_service_local_key] : false else raise ArgumentError, "[cocoapods-byte-panglem][error] `#{option.inspect}`, should be a boolean or hash." end @global_note end |
#get_global_note ⇒ Object
357 358 359 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 357 def get_global_note @global_note end |
#get_target(label) ⇒ Object
361 362 363 364 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 361 def get_target(label) @target_info ||= {} @target_info[label] ||= Target.new(label) end |
#is_release ⇒ Object
366 367 368 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 366 def is_release() @global_note.is_release end |
#set_is_debug(is_debug) ⇒ Object
321 322 323 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 321 def set_is_debug(is_debug) @is_debug = is_debug end |
#set_plugin_load(is_load) ⇒ Object
316 317 318 319 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 316 def set_plugin_load(is_load) @is_load_plugin = is_load @plugin_version = CocoapodsBytePanglem::Version.version end |
#to_hash ⇒ Object
374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 374 def to_hash hash = {} hash["IS_LOAD_PLUGIN"] = @is_load_plugin hash["PLUGIN_VERSION"] = @plugin_version hash["SDK_ORIGINAL_VERSION"] = @sdk_original_version hash["RELY_ORIGINAL_VERSION"] = @rely_original_version hash["SDK_TARGET_VERSION"] = @sdk_target_version hash["RELY_TARGET_VERSION"] = @rely_target_version hash["ADAPTER_LIST"] = @adapter_list checksum = Digest::SHA1.hexdigest(hash.inspect) checksum = checksum.encode('UTF-8') if checksum.respond_to?(:encode) hash["RECODER_CHECKSUM"] = checksum hash end |
#use_service_local ⇒ Object
370 371 372 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 370 def use_service_local() @global_note.use_service_local end |