Sha256: 305f81bbfad2181171c6675fa19528e623f750e035ba562f2b774159c1d16650

Contents?: true

Size: 1.79 KB

Versions: 12

Compression:

Stored size: 1.79 KB

Contents

# frozen_string_literal: true

# define all the modules to be able to use ::
module I18n
  module Tasks
    class << self
      def gem_path
        File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
      end

      def verbose?
        @verbose
      end

      attr_writer :verbose

      # Add a scanner to the default configuration.
      #
      # @param scanner_class_name [String]
      # @param scanner_opts [Hash]
      # @return self
      def add_scanner(scanner_class_name, scanner_opts = {})
        scanners = I18n::Tasks::Configuration::DEFAULTS[:search][:scanners]
        scanners << [scanner_class_name, scanner_opts]
        scanners.uniq!
        self
      end

      # Add commands to i18n-tasks
      #
      # @param commands_module [Module]
      # @return self
      def add_commands(commands_module)
        ::I18n::Tasks::Commands.send :include, commands_module
        self
      end
    end

    @verbose = !ENV['VERBOSE'].nil?

    module Data
    end
  end
end

# Per https://github.com/rails/rails/commit/0181f0edd57a2149278bd59c3519233ca1e0a413#commitcomment-60940992
# 'active_support' must be required first even if we only use parts of it.
require 'active_support'

require 'active_support/inflector'
require 'active_support/core_ext/hash'
require 'active_support/core_ext/array/access'
require 'active_support/core_ext/array/extract_options'
require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/try'

require 'rainbow'
require 'erubi'

require 'i18n/tasks/version'
require 'i18n/tasks/base_task'

# Add internal locale data to i18n gem load path
require 'i18n'

Dir[File.join(I18n::Tasks.gem_path, 'config', 'locales', '*.yml')].each do |locale_file|
  I18n.config.load_path << locale_file
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
i18n-tasks-1.0.8 lib/i18n/tasks.rb
i18n-tasks-1.0.7 lib/i18n/tasks.rb
i18n-tasks-1.0.6 lib/i18n/tasks.rb
i18n-tasks-1.0.5 lib/i18n/tasks.rb
i18n-tasks-1.0.4 lib/i18n/tasks.rb
i18n-tasks-1.0.3 lib/i18n/tasks.rb
i18n-tasks-1.0.2 lib/i18n/tasks.rb
i18n-tasks-1.0.1 lib/i18n/tasks.rb
i18n-tasks-1.0.0 lib/i18n/tasks.rb
i18n-youdao-tasks-0.9.37 lib/i18n/tasks.rb
i18n-tasks-0.9.37 lib/i18n/tasks.rb
i18n-tasks-0.9.36 lib/i18n/tasks.rb