lib/i18n/tasks/configuration.rb in i18n-tasks-0.2.12 vs lib/i18n/tasks/configuration.rb in i18n-tasks-0.2.13

- old
+ new

@@ -36,22 +36,31 @@ I18n::Tasks.warn_deprecated 'please rename "grep" key to "search" in config/i18n-tasks.yml' end search_config = (config[:search] || {}).with_indifferent_access search_config.tap do |conf| conf[:paths] = %w(app/) if conf[:paths].blank? + conf[:relative_roots] = %w( app/views ) if conf[:relative_roots].blank? conf[:include] = Array(conf[:include]) if conf[:include].present? conf[:exclude] = Array(conf[:exclude]) conf[:pattern] = conf[:pattern].present? ? Regexp.new(conf[:pattern]) : DEFAULT_PATTERN end end end + def relative_roots + @config_sections[:relative_roots] ||= config[:relative_roots].presence || %w(app/views) + end + + def relative_roots=(paths) + @config_sections[:relative_roots] = paths + end + # translation config # @return [Hash{String => String,Hash,Array}] def translation_config @config_sections[:translation] ||= begin conf = (config[:translation] ||= {}).with_indifferent_access conf[:api_key] ||= ENV['GOOGLE_TRANSLATE_API_KEY'] conf end end -end \ No newline at end of file +end