Sha256: 0d7add120cd7a50e8c12c0c418a7a08bfbb81e5d9af92c63f50ce728c90b3af4

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 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 :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.dump if trace_spec && @spec
	    return @spec
    end
    
    def all_languages
      [ development_language, localization_languages].flatten!
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
babelyoda-2.0.7 lib/babelyoda/specification.rb
babelyoda-2.0.6 lib/babelyoda/specification.rb
babelyoda-2.0.5 lib/babelyoda/specification.rb
babelyoda-2.0.4 lib/babelyoda/specification.rb
babelyoda-2.0.3 lib/babelyoda/specification.rb
babelyoda-2.0.2 lib/babelyoda/specification.rb
babelyoda-2.0.1 lib/babelyoda/specification.rb
babelyoda-2.0.0 lib/babelyoda/specification.rb