Class: AppPermissionStatistics::Actuator

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/app_permission_statistics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, compare_file, report_path: nil, store_path: nil) ⇒ Actuator

Returns a new instance of Actuator.



16
17
18
19
20
21
# File 'lib/app_permission_statistics.rb', line 16

def initialize(file,compare_file, report_path: nil,store_path: nil)
  @file = file
  @compare_file = compare_file
  @report_path = report_path 
  @store_path = store_path
end

Instance Attribute Details

#compare_fileObject (readonly)

Returns the value of attribute compare_file.



12
13
14
# File 'lib/app_permission_statistics.rb', line 12

def compare_file
  @compare_file
end

#fileObject (readonly)

Returns the value of attribute file.



11
12
13
# File 'lib/app_permission_statistics.rb', line 11

def file
  @file
end

#report_pathObject (readonly)

Returns the value of attribute report_path.



14
15
16
# File 'lib/app_permission_statistics.rb', line 14

def report_path
  @report_path
end

#store_pathObject (readonly)

Returns the value of attribute store_path.



13
14
15
# File 'lib/app_permission_statistics.rb', line 13

def store_path
  @store_path
end

Instance Method Details

#analyzerObject



42
43
44
45
# File 'lib/app_permission_statistics.rb', line 42

def analyzer
  identifier = @extracter.plistInfo.identifier
  @analyzer ||=  Analyzer.new(identifier,@report_path,@store_path)
end

#extracterObject



38
39
40
# File 'lib/app_permission_statistics.rb', line 38

def extracter
  @extracter ||= Extracter.new(@file , @store_path)
end

#runObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/app_permission_statistics.rb', line 23

def run
  compare_extracter = Extracter.new(@compare_file , @store_path)
  if compare_extracter.plistInfo.identifier != extracter.plistInfo.identifier
    abort("compared files have different plist identifier")
  end
  if Gem::Version.new(compare_extracter.plistInfo.version)  == Gem::Version.new(extracter.plistInfo.version)
    abort("compared files  plist version is same")
  end
  compare_extracter.extract_update
  extracter.extract_update
  analyzer.analyze([extracter.plistInfo.version,compare_extracter.plistInfo.version])
  extracter.clear!
  compare_extracter.clear!
end