Sha256: e383f3bd2cfa77097c1b1e68fb2e30b5ced7fe675eebeb267d5cdf7ee55480c0

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

require 'erb'

require_relative 'specification_loader'

module Babelyoda
	class Specification
		include Babelyoda::SpecificationLoader

    attr_accessor :name
    attr_accessor :development_language
    attr_accessor :localization_languages
    attr_accessor :plain_text_keys
    attr_accessor :engine
    attr_accessor :source_files    
    attr_accessor :resources_folder
    attr_accessor :xib_files    
    attr_accessor :strings_files
    attr_accessor :scm
    
    FILENAME = 'Babelfile'
    
    def self.generate_default_babelfile
      template_file_name = File.join(BABELYODA_PATH, 'templates', 'Babelfile.erb')
      template = File.read(template_file_name)
      File.open(FILENAME, "w+") do |f|
        f.write(ERB.new(template).result())
      end
    end
    
    def self.load
      trace_spec = @spec.nil? && ::Rake.application.options.trace
	    @spec ||= load_from_file(filename = FILENAME)
      @spec.plain_text_keys = true if @spec.plain_text_keys.nil?
      @spec.dump if trace_spec && @spec
	    return @spec
    end
    
    def all_languages
      [ development_language, localization_languages].flatten!
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
babelyoda-2.1.15 lib/babelyoda/specification.rb
babelyoda-2.1.14 lib/babelyoda/specification.rb
babelyoda-2.1.13 lib/babelyoda/specification.rb
babelyoda-2.1.12 lib/babelyoda/specification.rb
babelyoda-2.1.11 lib/babelyoda/specification.rb
babelyoda-2.1.10 lib/babelyoda/specification.rb