require 'active_model' require 'active_support' require 'rspec/matchers' require 'flash_validators/version' require 'flash_validators/validators/alpha_validator' require 'flash_validators/validators/alpha_numeric_validator' require 'flash_validators/validators/base64_validator' require 'flash_validators/validators/boolean_validator' require 'flash_validators/validators/credit_card_validator' require 'flash_validators/validators/currency_validator' require 'flash_validators/validators/cusip_validator' require 'flash_validators/validators/email_validator' require 'flash_validators/validators/equality_validator' require 'flash_validators/validators/gtin_validator' require 'flash_validators/validators/hex_validator' require 'flash_validators/validators/imei_validator' require 'flash_validators/validators/ip_validator' require 'flash_validators/validators/isbn_validator' require 'flash_validators/validators/isin_validator' require 'flash_validators/validators/latitude_validator' require 'flash_validators/validators/longitude_validator' require 'flash_validators/validators/mac_address_validator' require 'flash_validators/validators/name_validator' require 'flash_validators/validators/password_validator' require 'flash_validators/validators/phone_validator' require 'flash_validators/validators/sedol_validator' require 'flash_validators/validators/slug_validator' require 'flash_validators/validators/ssn_validator' require 'flash_validators/validators/url_validator' require 'flash_validators/validators/username_validator' require 'flash_validators/validators/uuid_validator' if defined?(RSpec) require 'flash_validators/matchers/ensure_valid_alpha_format_of' require 'flash_validators/matchers/ensure_valid_alpha_numeric_format_of' require 'flash_validators/matchers/ensure_valid_base64_format_of' require 'flash_validators/matchers/ensure_valid_boolean_format_of' require 'flash_validators/matchers/ensure_valid_credit_card_format_of' require 'flash_validators/matchers/ensure_valid_currency_format_of' require 'flash_validators/matchers/ensure_valid_cusip_format_of' require 'flash_validators/matchers/ensure_valid_email_format_of' require 'flash_validators/matchers/ensure_valid_equality_matcher_of' require 'flash_validators/matchers/ensure_valid_gtin_format_of' require 'flash_validators/matchers/ensure_valid_hex_format_of' require 'flash_validators/matchers/ensure_valid_imei_format_of' require 'flash_validators/matchers/ensure_valid_ip_format_of' require 'flash_validators/matchers/ensure_valid_isbn_format_of' require 'flash_validators/matchers/ensure_valid_isin_format_of' require 'flash_validators/matchers/ensure_valid_latitude_format_of' require 'flash_validators/matchers/ensure_valid_longitude_format_of' require 'flash_validators/matchers/ensure_valid_mac_address_format_of' require 'flash_validators/matchers/ensure_valid_name_format_of' require 'flash_validators/matchers/ensure_valid_password_format_of' require 'flash_validators/matchers/ensure_valid_phone_format_of' require 'flash_validators/matchers/ensure_valid_sedol_format_of' require 'flash_validators/matchers/ensure_valid_slug_format_of' require 'flash_validators/matchers/ensure_valid_ssn_format_of' require 'flash_validators/matchers/ensure_valid_url_format_of' require 'flash_validators/matchers/ensure_valid_username_format_of' require 'flash_validators/matchers/ensure_valid_uuid_format_of' end if defined?(Rails) require 'rails' module FlashValidators class Railtie < ::Rails::Railtie initializer 'flash_validators' do |app| FlashValidators::Railtie.instance_eval do locales = locales_from(app.config.i18n.available_locales) locales.each do |locale| add(locale) end end end protected def self.add(locale) I18n.load_path << File.expand_path("../../config/locales/#{locale}.yml", __FILE__) end def self.locales_from(args) array = Array(args || []) array.blank? ? '*' : array end end end end