Module: Flappy::Util::ClassMethods

Constant Summary

Constants included from Config

Config::API_YML_PATH, Config::APP_FILE_TYPE, Config::APP_INFO_PATH, Config::CONFIG_PATH

Constants included from Http

Http::MAX_RETRIES

Instance Attribute Summary collapse

Attributes included from IOSLogger

#logger_iOS, #logger_iOS_archive, #logger_iOS_build, #logger_iOS_pod

Instance Method Summary collapse

Methods included from IOSLogger

#initialize_iOS_logger, #log_iOS, #log_iOS_archive, #log_iOS_build, #log_iOS_pod

Methods included from IOSChecking

#check_archived_ipa_is_exist, #check_condition, #check_no_output_app

Methods included from IOSEnvConfig

#check_and_find_plist_file, #writeEnvToPlist

Methods included from ArchiveIpa

#archive_ipa, #archive_ipa_with_path

Methods included from Flappy::UpdatePod

#check_and_find_podfile, #check_and_find_podfile_lock, #initialize_pod_cmd, #merge_spec_hash, #read_podfile, #read_podfile_lock, #save_pod_file_and_lock, #save_spec_hash_to_file, #update_pod_if_needed, #update_pod_repos

Methods included from BuildIpa

#build_ipa, #git_clone_work_dir, #initialize_app_output_archive_info_path, #initialize_ipa_build_cmd, #initialize_ipa_output_path, #initialize_output_path, #initialize_work_dir, #ipa_info, #remove_build_cache, #rename_ipa, #save_dSYM_file

Methods included from Mapping

#mapping

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_device_info, #upload_mapping_file_with_publish, #uploading_binary_info, #uploading_icon_info

Methods included from BuildApk

#build_apk

Methods included from BuildCommon

#git_clone_build_dir, #initialize_build_common_options, #initialize_build_dir, #initialize_output_path, #logger_info_and_get_dependencies_command, #logger_info_and_run_build_command, #publish_build_app

Methods included from Info

#apk_info, #info

Methods included from Config

#config, #current_token, #fir_api, #reload_config, #write_app_info, #write_config

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



51
52
53
# File 'lib/flappy/util.rb', line 51

def logger
  @logger
end

Instance Method Details

#check_file_exist(path) ⇒ Object

def fetch_user_uuid(token)

 = (token)
[:uuid]

end



62
63
64
65
66
67
# File 'lib/flappy/util.rb', line 62

def check_file_exist(path)
  return if File.file?(path)

  logger.error 'File does not exist'
  exit 1
end

#check_loginedObject



83
84
85
86
87
88
# File 'lib/flappy/util.rb', line 83

def check_logined
  return unless current_token.blank?

  logger.error 'Please use `fir login` first'
  exit 1
end

#check_supported_file(path) ⇒ Object



69
70
71
72
73
74
# File 'lib/flappy/util.rb', line 69

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



76
77
78
79
80
81
# File 'lib/flappy/util.rb', line 76

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



53
54
55
# File 'lib/flappy/util.rb', line 53

def (token)
  get fir_api[:user_url], api_token: token
end

#generate_rqrcode(string, png_file_path) ⇒ Object



98
99
100
101
102
# File 'lib/flappy/util.rb', line 98

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_lineObject



90
91
92
# File 'lib/flappy/util.rb', line 90

def logger_info_blank_line
  logger.info 'flappy completed!'
end

#logger_info_dividing_lineObject



94
95
96
# File 'lib/flappy/util.rb', line 94

def logger_info_dividing_line
  logger.info '✈ -------------------------------------------- ✈'
end