Class: Locraft::IOSConfig
Instance Attribute Summary collapse
-
#dev_lang ⇒ Object
Returns the value of attribute dev_lang.
-
#dev_prefix ⇒ Object
Returns the value of attribute dev_prefix.
-
#info_plist_basename ⇒ Object
Returns the value of attribute info_plist_basename.
-
#info_plist_destination ⇒ Object
Returns the value of attribute info_plist_destination.
-
#keys_map ⇒ Object
Returns the value of attribute keys_map.
-
#macro_destination ⇒ Object
Returns the value of attribute macro_destination.
-
#macro_file ⇒ Object
Returns the value of attribute macro_file.
Attributes inherited from Config
#default_lang, #from_file, #gdoc_comments_column, #gdoc_file, #gdoc_keys_column, #gdoc_sheet, #langs, #platform, #strings_basename, #strings_destination
Instance Method Summary collapse
- #constants_generator ⇒ Object
- #info_plist_file ⇒ Object
- #info_plist_generator ⇒ Object
-
#initialize {|_self| ... } ⇒ IOSConfig
constructor
A new instance of IOSConfig.
- #relative_macro_destination ⇒ Object
- #relative_plist_destination ⇒ Object
- #strings_file ⇒ Object
- #strings_generators ⇒ Object
Methods inherited from Config
#from_folder, load_from, #relative_strings_destination
Constructor Details
#initialize {|_self| ... } ⇒ IOSConfig
Returns a new instance of IOSConfig.
80 81 82 83 84 85 86 87 88 |
# File 'lib/locraft/model/config.rb', line 80 def initialize super() self.platform = IOS self.dev_lang = OBJC self.dev_prefix = 'XYZ' self.macro_file = 'LocalizedConstants' self.info_plist_basename = 'InfoPlist' yield self if block_given? end |
Instance Attribute Details
#dev_lang ⇒ Object
Returns the value of attribute dev_lang.
75 76 77 |
# File 'lib/locraft/model/config.rb', line 75 def dev_lang @dev_lang end |
#dev_prefix ⇒ Object
Returns the value of attribute dev_prefix.
76 77 78 |
# File 'lib/locraft/model/config.rb', line 76 def dev_prefix @dev_prefix end |
#info_plist_basename ⇒ Object
Returns the value of attribute info_plist_basename.
73 74 75 |
# File 'lib/locraft/model/config.rb', line 73 def info_plist_basename @info_plist_basename end |
#info_plist_destination ⇒ Object
Returns the value of attribute info_plist_destination.
72 73 74 |
# File 'lib/locraft/model/config.rb', line 72 def info_plist_destination @info_plist_destination end |
#keys_map ⇒ Object
Returns the value of attribute keys_map.
77 78 79 |
# File 'lib/locraft/model/config.rb', line 77 def keys_map @keys_map end |
#macro_destination ⇒ Object
Returns the value of attribute macro_destination.
74 75 76 |
# File 'lib/locraft/model/config.rb', line 74 def macro_destination @macro_destination end |
#macro_file ⇒ Object
Returns the value of attribute macro_file.
78 79 80 |
# File 'lib/locraft/model/config.rb', line 78 def macro_file @macro_file end |
Instance Method Details
#constants_generator ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/locraft/model/config.rb', line 116 def constants_generator if dev_lang == SWIFT SwiftConstantsGenerator.new(self) elsif dev_lang == OBJC ObjcConstantsGenerator.new(self) end end |
#info_plist_file ⇒ Object
104 105 106 |
# File 'lib/locraft/model/config.rb', line 104 def info_plist_file "#{info_plist_basename}#{STRINGS_EXT}" end |
#info_plist_generator ⇒ Object
112 113 114 |
# File 'lib/locraft/model/config.rb', line 112 def info_plist_generator InfoPlistGenerator.new(self) end |
#relative_macro_destination ⇒ Object
95 96 97 98 |
# File 'lib/locraft/model/config.rb', line 95 def relative_macro_destination return nil if macro_destination.nil? File.('../' + macro_destination, from_file) end |
#relative_plist_destination ⇒ Object
90 91 92 93 |
# File 'lib/locraft/model/config.rb', line 90 def relative_plist_destination return nil if info_plist_destination.nil? File.('../' + info_plist_destination, from_file) end |
#strings_file ⇒ Object
100 101 102 |
# File 'lib/locraft/model/config.rb', line 100 def strings_file "#{strings_basename}#{STRINGS_EXT}" end |
#strings_generators ⇒ Object
108 109 110 |
# File 'lib/locraft/model/config.rb', line 108 def strings_generators [StringsGenerator.new(self), info_plist_generator, constants_generator].select(&:valid?) end |