Class: Flog::Status
- Inherits:
-
Object
- Object
- Flog::Status
- Defined in:
- lib/flog/status.rb
Overview
Status returns checke result of switch files
Constant Summary collapse
- SWITCH_FILE_NAME =
'no-flog.txt'
- SQL_SWITCH_FILE_NAME =
'no-flog-sql.txt'
- PARAMS_SWITCH_FILE_NAME =
'no-flog-params.txt'
Class Method Summary collapse
- .enabled? ⇒ Boolean
- .params_formattable? ⇒ Boolean
- .sql_formattable? ⇒ Boolean
- .switch_file_base_path ⇒ Object
- .switch_file_dir_path ⇒ Object
Class Method Details
.enabled? ⇒ Boolean
12 13 14 15 16 |
# File 'lib/flog/status.rb', line 12 def enabled? !switch_file_exists?(SWITCH_FILE_NAME) rescue StandardError true end |
.params_formattable? ⇒ Boolean
24 25 26 27 28 |
# File 'lib/flog/status.rb', line 24 def params_formattable? enabled? && !switch_file_exists?(PARAMS_SWITCH_FILE_NAME) rescue StandardError true end |
.sql_formattable? ⇒ Boolean
18 19 20 21 22 |
# File 'lib/flog/status.rb', line 18 def sql_formattable? enabled? && !switch_file_exists?(SQL_SWITCH_FILE_NAME) rescue StandardError true end |
.switch_file_base_path ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/flog/status.rb', line 30 def switch_file_base_path if Rails.root&.exist? Rails.root else Pathname.new(File.(File.dirname(__FILE__) + '../../')) end end |
.switch_file_dir_path ⇒ Object
38 39 40 |
# File 'lib/flog/status.rb', line 38 def switch_file_dir_path switch_file_base_path.join('tmp') end |