Module: FIR::Util::ClassMethods
- Defined in:
- lib/fir/util.rb
Instance Method Summary collapse
- #check_supported_file(path) ⇒ Object
- #check_token_cannot_be_blank(token) ⇒ Object
- #fetch_user_info(token) ⇒ Object
- #logger_info_dividing_line ⇒ Object
Instance Method Details
#check_supported_file(path) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/fir/util.rb', line 25 def check_supported_file path unless File.file?(path) || APP_FILE_TYPE.include?(File.extname(path)) logger.error "File does not exist or unsupported file type" exit 1 end end |
#check_token_cannot_be_blank(token) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/fir/util.rb', line 32 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
21 22 23 |
# File 'lib/fir/util.rb', line 21 def fetch_user_info token get api[:user_url], api_token: token end |
#logger_info_dividing_line ⇒ Object
39 40 41 |
# File 'lib/fir/util.rb', line 39 def logger_info_dividing_line logger.info "✈ -------------------------------------------- ✈" end |