Class: Babelyoda::Specification

Inherits:
Object
  • Object
show all
Includes:
SpecificationLoader
Defined in:
lib/babelyoda/specification.rb

Constant Summary collapse

FILENAME =
'Babelfile'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SpecificationLoader

#dump, included, #initialize, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Babelyoda::SpecificationLoader

Instance Attribute Details

#development_languageObject

Returns the value of attribute development_language.



10
11
12
# File 'lib/babelyoda/specification.rb', line 10

def development_language
  @development_language
end

#engineObject

Returns the value of attribute engine.



12
13
14
# File 'lib/babelyoda/specification.rb', line 12

def engine
  @engine
end

#localization_languagesObject

Returns the value of attribute localization_languages.



11
12
13
# File 'lib/babelyoda/specification.rb', line 11

def localization_languages
  @localization_languages
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/babelyoda/specification.rb', line 9

def name
  @name
end

#resources_folderObject

Returns the value of attribute resources_folder.



14
15
16
# File 'lib/babelyoda/specification.rb', line 14

def resources_folder
  @resources_folder
end

#scmObject

Returns the value of attribute scm.



17
18
19
# File 'lib/babelyoda/specification.rb', line 17

def scm
  @scm
end

#source_filesObject

Returns the value of attribute source_files.



13
14
15
# File 'lib/babelyoda/specification.rb', line 13

def source_files
  @source_files
end

#strings_filesObject

Returns the value of attribute strings_files.



16
17
18
# File 'lib/babelyoda/specification.rb', line 16

def strings_files
  @strings_files
end

#xib_filesObject

Returns the value of attribute xib_files.



15
16
17
# File 'lib/babelyoda/specification.rb', line 15

def xib_files
  @xib_files
end

Class Method Details

.generate_default_babelfileObject



21
22
23
24
25
26
27
# File 'lib/babelyoda/specification.rb', line 21

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

.loadObject



29
30
31
32
33
34
# File 'lib/babelyoda/specification.rb', line 29

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

Instance Method Details

#all_languagesObject



36
37
38
# File 'lib/babelyoda/specification.rb', line 36

def all_languages
  [ development_language, localization_languages].flatten!
end