Class: AppInfo::PackInfo
- Inherits:
-
File
- Object
- File
- AppInfo::PackInfo
show all
- Defined in:
- lib/app_info/pack_info.rb
Overview
HarmonyOS pack.info parser
Instance Attribute Summary
Attributes inherited from File
#file, #logger
Instance Method Summary
collapse
Methods inherited from File
#device, #format, #initialize, #manufacturer, #not_implemented_error!, #platform, #size
Constructor Details
This class inherits a constructor from AppInfo::File
Instance Method Details
#app ⇒ JSON
27
28
29
|
# File 'lib/app_info/pack_info.rb', line 27
def app
@app ||= summary['app']
end
|
#bundle_name ⇒ String
Also known as:
bundle_id
21
22
23
|
# File 'lib/app_info/pack_info.rb', line 21
def bundle_name
app['bundleName']
end
|
#content ⇒ JSON
47
48
49
|
# File 'lib/app_info/pack_info.rb', line 47
def content
JSON.parse(::File.read(@file))
end
|
#modules ⇒ Array<JSON>
32
33
34
|
# File 'lib/app_info/pack_info.rb', line 32
def modules
@modules ||= summary['modules']
end
|
#packages ⇒ Array<JSON>
42
43
44
|
# File 'lib/app_info/pack_info.rb', line 42
def packages
@packages ||= content['packages']
end
|
#summary ⇒ JSON
37
38
39
|
# File 'lib/app_info/pack_info.rb', line 37
def summary
@summary ||= content['summary']
end
|
#version_code ⇒ String
Also known as:
build_version
9
10
11
|
# File 'lib/app_info/pack_info.rb', line 9
def version_code
app['version']['code']
end
|
#version_name ⇒ String
Also known as:
release_version
15
16
17
|
# File 'lib/app_info/pack_info.rb', line 15
def version_name
app['version']['name']
end
|