Class: Birdspotting::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/birdspotting/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#add_column_position_checkObject

Returns the value of attribute add_column_position_check.



2
3
4
# File 'lib/birdspotting/configuration.rb', line 2

def add_column_position_check
  @add_column_position_check
end

#check_bypass_env_varObject

Returns the value of attribute check_bypass_env_var.



2
3
4
# File 'lib/birdspotting/configuration.rb', line 2

def check_bypass_env_var
  @check_bypass_env_var
end

#encoding_checkObject

Returns the value of attribute encoding_check.



2
3
4
# File 'lib/birdspotting/configuration.rb', line 2

def encoding_check
  @encoding_check
end

#encoding_check_messageObject

Returns the value of attribute encoding_check_message.



2
3
4
# File 'lib/birdspotting/configuration.rb', line 2

def encoding_check_message
  @encoding_check_message
end

#remove_column_checkObject

Returns the value of attribute remove_column_check.



2
3
4
# File 'lib/birdspotting/configuration.rb', line 2

def remove_column_check
  @remove_column_check
end

#rename_column_checkObject

Returns the value of attribute rename_column_check.



2
3
4
# File 'lib/birdspotting/configuration.rb', line 2

def rename_column_check
  @rename_column_check
end

#rename_column_messageObject

Returns the value of attribute rename_column_message.



2
3
4
# File 'lib/birdspotting/configuration.rb', line 2

def rename_column_message
  @rename_column_message
end

#start_check_at_versionObject

Returns the value of attribute start_check_at_version.



2
3
4
# File 'lib/birdspotting/configuration.rb', line 2

def start_check_at_version
  @start_check_at_version
end

Class Method Details

.defaultObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/birdspotting/configuration.rb', line 11

def self.default
  new.tap do |config|
    config.start_check_at_version = nil
    config.check_bypass_env_var = "BYPASS_SCHEMA_STATEMENTS_CHECK"
    config.add_column_position_check = true
    config.encoding_check = true
    config.encoding_check_message = "\n/!\\ You are dealing with a %<type>s field" \
      "(%<column_name>s): did you think about emojis and used the appropriate encoding? /!\\ \n\n"
    config.rename_column_check = true
    config.rename_column_message = "Don't use rename_column! https://stackoverflow.com/a/18542147"
    config.remove_column_check = true
  end
end