Module: FIR::Util::ClassMethods
Constant Summary
Constants included
from Config
Config::API_YML_PATH, Config::APP_FILE_TYPE, Config::CONFIG_PATH
Constants included
from Http
Http::DEFAULT_TIMEOUT
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Mapping
#find_or_create_bughd_full_version, #mapping, #upload_mapping_file
Methods included from Publish
#fetch_app_info, #fetch_uploading_info, #logger_info_app_short_and_qrcode, #logger_info_publishing_message, #publish, #update_app_info, #upload_app, #upload_app_binary, #upload_app_icon, #upload_device_info, #upload_mapping_file_with_publish, #uploading_binary_info, #uploading_icon_info
Methods included from BuildApk
#build_apk
Methods included from BuildIpa
#build_ipa
#convert_hash_to_assignment_string, #git_clone_build_dir, #initialize_build_common_options, #initialize_build_dir, #initialize_output_path, #logger_info_and_run_build_command, #publish_build_app, #split_assignment_array_to_hash
Methods included from Info
#apk_info, #info, #ipa_info
Methods included from Me
#me
Methods included from Login
#login
Methods included from Config
#bughd_api, #config, #current_token, #fir_api, #reload_config, #write_config
Methods included from Http
#get
Instance Attribute Details
Returns the value of attribute logger.
33
34
35
|
# File 'lib/fir/util.rb', line 33
def logger
@logger
end
|
Instance Method Details
#check_file_exist(path) ⇒ Object
44
45
46
47
48
49
|
# File 'lib/fir/util.rb', line 44
def check_file_exist(path)
return if File.file?(path)
logger.error 'File does not exist'
exit 1
end
|
#check_logined ⇒ Object
65
66
67
68
69
70
|
# File 'lib/fir/util.rb', line 65
def check_logined
return unless current_token.blank?
logger.error 'Please use `fir login` first'
exit 1
end
|
#check_supported_file(path) ⇒ Object
51
52
53
54
55
56
|
# File 'lib/fir/util.rb', line 51
def check_supported_file(path)
return if APP_FILE_TYPE.include?(File.extname(path))
logger.error 'Unsupported file type'
exit 1
end
|
#check_token_cannot_be_blank(token) ⇒ Object
58
59
60
61
62
63
|
# File 'lib/fir/util.rb', line 58
def check_token_cannot_be_blank(token)
return unless token.blank?
logger.error 'Token can not be blank'
exit 1
end
|
#fetch_user_info(token) ⇒ Object
35
36
37
|
# File 'lib/fir/util.rb', line 35
def fetch_user_info(token)
get fir_api[:user_url], api_token: token
end
|
#fetch_user_uuid(token) ⇒ Object
39
40
41
42
|
# File 'lib/fir/util.rb', line 39
def fetch_user_uuid(token)
user_info = fetch_user_info(token)
user_info[:uuid]
end
|
#generate_rqrcode(string, png_file_path) ⇒ Object
80
81
82
83
84
|
# File 'lib/fir/util.rb', line 80
def generate_rqrcode string, png_file_path
qrcode = ::RQRCode::QRCode.new(string.to_s)
qrcode.as_png(size: 500, border_modules: 2, file: png_file_path)
png_file_path
end
|
#logger_info_blank_line ⇒ Object
72
73
74
|
# File 'lib/fir/util.rb', line 72
def logger_info_blank_line
logger.info ''
end
|
#logger_info_dividing_line ⇒ Object
76
77
78
|
# File 'lib/fir/util.rb', line 76
def logger_info_dividing_line
logger.info '✈ -------------------------------------------- ✈'
end
|