Class: BBItools::SizeResult

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-bb-PodAssistant/tools/link_map.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSizeResult

Returns a new instance of SizeResult.



357
358
359
360
# File 'lib/cocoapods-bb-PodAssistant/tools/link_map.rb', line 357

def initialize
   @file_serial_numers = []
   @size = 0
end

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



356
357
358
# File 'lib/cocoapods-bb-PodAssistant/tools/link_map.rb', line 356

def file_name
  @file_name
end

#file_serial_numersObject

Returns the value of attribute file_serial_numers.



356
357
358
# File 'lib/cocoapods-bb-PodAssistant/tools/link_map.rb', line 356

def file_serial_numers
  @file_serial_numers
end

#folder_nameObject

Returns the value of attribute folder_name.



356
357
358
# File 'lib/cocoapods-bb-PodAssistant/tools/link_map.rb', line 356

def folder_name
  @folder_name
end

#sizeObject

Returns the value of attribute size.



356
357
358
# File 'lib/cocoapods-bb-PodAssistant/tools/link_map.rb', line 356

def size
  @size
end

#space_countObject

Returns the value of attribute space_count.



356
357
358
# File 'lib/cocoapods-bb-PodAssistant/tools/link_map.rb', line 356

def space_count
  @space_count
end

Class Method Details

.getSaveFileName(path_para) ⇒ Object

获取结果文件保存到目录



372
373
374
375
376
377
# File 'lib/cocoapods-bb-PodAssistant/tools/link_map.rb', line 372

def self.getSaveFileName(path_para)
   path = Pathname.new(path_para)
   # 要保存的地址
   save_file_path = path.dirname.to_s + "/" + "parse_" + path.basename.to_s + "_result(#{Time.new.strftime("%Y%m%d%H%M%S")}).xls"
   return save_file_path
end

.handleSize(size) ⇒ Object

size字符化



362
363
364
365
366
367
368
369
370
# File 'lib/cocoapods-bb-PodAssistant/tools/link_map.rb', line 362

def self.handleSize(size)
   if size > 1024 * 1024
      return format("%.2f",(size.to_f/(1024*1024))) + "MB"
   elsif size > 1024
      return format("%.2f",(size.to_f/1024)) + "KB"
   else
      return size.to_s + "B"
   end
end