Class: I18nExport::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_export/config.rb

Defined Under Namespace

Classes: FileDefinition

Instance Method Summary collapse

Constructor Details

#initialize(filename = I18nExport.config_file) ⇒ Config

Returns a new instance of Config.

Raises:

  • (Errno::ENOENT)


8
9
10
11
12
13
# File 'lib/i18n_export/config.rb', line 8

def initialize(filename=I18nExport.config_file)
  # lets make sure the file exists
  raise Errno::ENOENT unless File.file?(filename)

  @filename = filename
end

Instance Method Details

#file_definitionsObject



15
16
17
18
19
# File 'lib/i18n_export/config.rb', line 15

def file_definitions
  (config["translations"] || []).map do |defn|
    FileDefinition.new(defn["file"], defn["only"])
  end
end