Sha256: 20db76fafc649a78277c3b364cd2119026f83c2036846f5c4a09354a9df4a63f

Contents?: true

Size: 765 Bytes

Versions: 3

Compression:

Stored size: 765 Bytes

Contents

require 'i18n/tasks/version'
require 'i18n/tasks/railtie'
require 'active_support/core_ext/hash'
require 'active_support/core_ext/string'
require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/object/try'
require 'term/ansicolor'

module I18n
  module Tasks
    CONFIG_FILE = 'config/i18n-tasks.yml'
    class << self
      def config
        @config ||= begin
          file = File.read(CONFIG_FILE) if File.exists?(CONFIG_FILE)
          file = YAML.load(file) if file.present?
          HashWithIndifferentAccess.new.merge(file.presence || {})
        end
      end

      def warn_deprecated(message)
        STDERR.puts Term::ANSIColor.yellow Term::ANSIColor.bold "i18n-tasks: [DEPRECATED] #{message}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
i18n-tasks-0.2.4 lib/i18n/tasks.rb
i18n-tasks-0.2.3 lib/i18n/tasks.rb
i18n-tasks-0.2.2 lib/i18n/tasks.rb