Class: PM::Target
- Inherits:
-
Object
- Object
- PM::Target
- Defined in:
- lib/cocoapods-byte-panglem-beta/recorder.rb
Overview
配置信息 (cocoapods target维度下)
Instance Attribute Summary collapse
-
#is_release_target ⇒ Object
Returns the value of attribute is_release_target.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#nots_info ⇒ Object
Returns the value of attribute nots_info.
-
#PM_info ⇒ Object
Returns the value of attribute PM_info.
-
#referenced_target ⇒ Object
Returns the value of attribute referenced_target.
Class Method Summary collapse
Instance Method Summary collapse
- #find_note(adn_name) ⇒ Object
- #has_adn?(adn_name) ⇒ Boolean
-
#initialize(label) ⇒ Target
constructor
A new instance of Target.
- #is_adn_detect?(adn_name) ⇒ Boolean
- #is_adn_update?(adn_name) ⇒ Boolean
- #is_adn_update_or_detect?(adn_name) ⇒ Boolean
- #to_hash ⇒ Object
Constructor Details
#initialize(label) ⇒ Target
Returns a new instance of Target.
237 238 239 240 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 237 def initialize(label) @label = label.clone @is_release_target = false end |
Instance Attribute Details
#is_release_target ⇒ Object
Returns the value of attribute is_release_target.
231 232 233 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 231 def is_release_target @is_release_target end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
233 234 235 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 233 def label @label end |
#nots_info ⇒ Object
Returns the value of attribute nots_info.
235 236 237 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 235 def nots_info @nots_info end |
#PM_info ⇒ Object
Returns the value of attribute PM_info.
234 235 236 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 234 def PM_info @PM_info end |
#referenced_target ⇒ Object
Returns the value of attribute referenced_target.
232 233 234 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 232 def referenced_target @referenced_target end |
Class Method Details
.from_hash(hash) ⇒ Object
280 281 282 283 284 285 286 287 288 289 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 280 def self.from_hash(hash) target = Target.new(hash["LABEL"]) target.is_release_target = true target.PM_info = PMInfo.from_hash hash["PM_INFO"] if hash.has_key?("PM_INFO") target.nots_info ||= {} hash["NOTS_INFO"].each do |name, note_info| target.nots_info[name] = AdnNote.from_hash note_info end target end |
Instance Method Details
#find_note(adn_name) ⇒ Object
242 243 244 245 246 247 248 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 242 def find_note(adn_name) @nots_info ||= {} global_note = PM::Recorder.instance.global_note note = (@nots_info.has_key?(adn_name) && @nots_info[adn_name]) || AdnNote.new(adn_name, global_note.auto_load, global_note.auto_update, global_note.load_detect) @nots_info[adn_name] = note unless @nots_info.has_key?(adn_name) note end |
#has_adn?(adn_name) ⇒ Boolean
250 251 252 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 250 def has_adn?(adn_name) PM::MapRelations.is_adn?(adn_name) && @nots_info.has_key?(adn_name) end |
#is_adn_detect?(adn_name) ⇒ Boolean
264 265 266 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 264 def is_adn_detect?(adn_name) has_adn?(adn_name) && @nots_info[adn_name].load_detect end |
#is_adn_update?(adn_name) ⇒ Boolean
259 260 261 262 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 259 def is_adn_update?(adn_name) result = has_adn?(adn_name) && @nots_info[adn_name].auto_update != PM::BuildConfig.update_value_non result end |
#is_adn_update_or_detect?(adn_name) ⇒ Boolean
254 255 256 257 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 254 def is_adn_update_or_detect?(adn_name) result = is_adn_update?(adn_name) || is_adn_detect?(adn_name) result end |
#to_hash ⇒ Object
268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/cocoapods-byte-panglem-beta/recorder.rb', line 268 def to_hash hash = {} hash["LABEL"] = @label hash["IS_RELEASE_TARGET"] = @is_release_target hash["PM_INFO"] = @pm_info.to_hash hash["NOTS_INFO"] = {} @nots_info.each {|key, value| hash["NOTS_INFO"][key] = value.to_hash } hash end |