Class: AppInfo::HarmonyOS
- Extended by:
- Forwardable
- Defined in:
- lib/app_info/harmonyos.rb
Overview
HarmonyOS base parser for hap and app file
Constant Summary
Constants included from AppInfo::Helper::HumanFileSize
AppInfo::Helper::HumanFileSize::FILE_SIZE_UNITS
Instance Attribute Summary
Attributes inherited from File
Instance Method Summary collapse
- #clear! ⇒ Object abstract
-
#contents ⇒ String
Unzipped file path.
- #device ⇒ Symbol
- #info_path ⇒ String
- #manufacturer ⇒ Symbol
- #name ⇒ Object abstract
- #pack_info ⇒ PackInfo
- #platform ⇒ Symbol
-
#size(human_size: false) ⇒ Integer, String
return file size.
Methods included from AppInfo::Helper::Archive
Methods included from AppInfo::Helper::HumanFileSize
#file_to_human_size, #number_to_human_size
Methods inherited from File
#format, #initialize, #not_implemented_error!
Constructor Details
This class inherits a constructor from AppInfo::File
Instance Method Details
#clear! ⇒ Object
This method is abstract.
Subclass and override #clear! to implement.
61 62 63 |
# File 'lib/app_info/harmonyos.rb', line 61 def clear! not_implemented_error!(__method__) end |
#contents ⇒ String
Returns unzipped file path.
51 52 53 |
# File 'lib/app_info/harmonyos.rb', line 51 def contents @contents ||= unarchive(@file, prefix: format.to_s) end |
#device ⇒ Symbol
Returns Device.
36 37 38 |
# File 'lib/app_info/harmonyos.rb', line 36 def device Device::Huawei::DEFAULT end |
#info_path ⇒ String
46 47 48 |
# File 'lib/app_info/harmonyos.rb', line 46 def info_path @info_path ||= ::File.join(contents, 'pack.info') end |
#manufacturer ⇒ Symbol
Returns Manufacturer.
26 27 28 |
# File 'lib/app_info/harmonyos.rb', line 26 def manufacturer Manufacturer::HUAWEI end |
#name ⇒ Object
This method is abstract.
Subclass and override #name to implement.
56 57 58 |
# File 'lib/app_info/harmonyos.rb', line 56 def name not_implemented_error!(__method__) end |
#pack_info ⇒ PackInfo
41 42 43 |
# File 'lib/app_info/harmonyos.rb', line 41 def pack_info @pack_info ||= PackInfo.new(info_path) end |
#platform ⇒ Symbol
Returns Platform.
31 32 33 |
# File 'lib/app_info/harmonyos.rb', line 31 def platform Platform::HARMONYOS end |
#size(human_size: false) ⇒ Integer, String
return file size
21 22 23 |
# File 'lib/app_info/harmonyos.rb', line 21 def size(human_size: false) file_to_human_size(@file, human_size: human_size) end |