Module: FIR::Util::ClassMethods

Includes:
BuildApk, BuildCommon, BuildIpa, Config, Http, Info, Login, Mapping, Me, Publish
Defined in:
lib/fir/util.rb

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, #publish, #update_app_info, #upload_app, #upload_app_binary, #upload_app_icon, #upload_device_info

Methods included from BuildApk

#build_apk

Methods included from BuildIpa

#build_ipa

Methods included from BuildCommon

#initialize_build_common_options, #logger_info_and_run_build_command, #publish_build_app

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

#loggerObject

Returns the value of attribute logger.



31
32
33
# File 'lib/fir/util.rb', line 31

def logger
  @logger
end

Instance Method Details

#check_file_exist(path) ⇒ Object



42
43
44
45
46
47
# File 'lib/fir/util.rb', line 42

def check_file_exist path
  unless File.file?(path)
    logger.error "File does not exist"
    exit 1
  end
end

#check_loginedObject



63
64
65
66
67
68
# File 'lib/fir/util.rb', line 63

def check_logined
  if current_token.blank?
    logger.error "Please use `fir login` first"
    exit 1
  end
end

#check_supported_file(path) ⇒ Object



49
50
51
52
53
54
# File 'lib/fir/util.rb', line 49

def check_supported_file path
  unless APP_FILE_TYPE.include?(File.extname(path))
    logger.error "Unsupported file type"
    exit 1
  end
end

#check_token_cannot_be_blank(token) ⇒ Object



56
57
58
59
60
61
# File 'lib/fir/util.rb', line 56

def check_token_cannot_be_blank token
  if token.blank?
    logger.error "Token can't be blank"
    exit 1
  end
end

#fetch_user_info(token) ⇒ Object



33
34
35
# File 'lib/fir/util.rb', line 33

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

#fetch_user_uuid(token) ⇒ Object



37
38
39
40
# File 'lib/fir/util.rb', line 37

def fetch_user_uuid token
   = (token)
  [:uuid]
end

#logger_info_blank_lineObject



70
71
72
# File 'lib/fir/util.rb', line 70

def logger_info_blank_line
  logger.info ""
end

#logger_info_dividing_lineObject



74
75
76
# File 'lib/fir/util.rb', line 74

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