locraft 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4bd5c1de7ef5f595dbd17b5e1e307ef737bc28e
4
- data.tar.gz: c0c659e7fe9fc364161d523f7b2532f3ca54f5f8
3
+ metadata.gz: f05f425b17af04f40e9be5687a0c45f64da9b13c
4
+ data.tar.gz: f831400edf7b067bc89a03a0975914cea5ab7dc1
5
5
  SHA512:
6
- metadata.gz: '049ef18ea0329a9f107d3504ff91a8856237a1dac8afa8c698e9a6eb3496d2b7c4607f1bbe515eee05155d4fdf803ca9cb61ac2bc61740421dec712ca0743ce7'
7
- data.tar.gz: 2d03e0cc5c7550415dab8e9569ab1898dbc8f94b618901781d1252b3a7b5aab2c03cd1c67566013fe17ffc09d2892c469b462425d4f7a0607c485087570ca3a9
6
+ metadata.gz: ac1feeb0999be9597522f6b2c01e18d63aaa44c5953f4f9def9559a8a23f1d0f50d49c401a341d3e0063736884396da4a4e341bc464ea8a040917fd26dafc0e2
7
+ data.tar.gz: 25ee60923dcfa36f6a90918e8caecaaceaf35781ec228767b99d17d1ec547270ff290a1005d496d60682b6b649b9547ce6ecf22141c54c438ae7a3b7268fc5bc
@@ -4,9 +4,12 @@ module Locraft
4
4
  OBJC = 'objc'.freeze
5
5
 
6
6
  class Config
7
+ attr_accessor :gdoc_file
8
+ attr_accessor :info_plist_destination
9
+ attr_accessor :macro_destination
10
+ attr_accessor :strings_destination
7
11
  attr_accessor :langs
8
12
  attr_accessor :default_lang
9
- attr_accessor :gdoc_file
10
13
  attr_accessor :gdoc_sheet
11
14
  attr_accessor :gdoc_keys_column
12
15
  attr_accessor :gdoc_comments_column
@@ -14,11 +17,8 @@ module Locraft
14
17
  attr_accessor :dev_prefix
15
18
  attr_accessor :keys_map
16
19
  attr_accessor :macro_file
17
- attr_accessor :macro_destination
18
20
  attr_accessor :strings_basename
19
- attr_accessor :strings_destination
20
21
  attr_accessor :info_plist_basename
21
- attr_accessor :info_plist_destination
22
22
 
23
23
  # fill automatically in load_from method
24
24
  attr_accessor :from_file
@@ -32,11 +32,8 @@ module Locraft
32
32
  self.dev_prefix = 'XYZ'
33
33
  self.keys_map = {}
34
34
  self.macro_file = 'LocalizedConstants'
35
- self.macro_destination = './'
36
35
  self.strings_basename = 'Localizable'
37
- self.strings_destination = './Localizations'
38
36
  self.info_plist_basename = 'InfoPlist'
39
- self.info_plist_destination = './Localizations'
40
37
  self.langs = {
41
38
  'English' => 'en',
42
39
  'Russian' => 'ru'
@@ -25,14 +25,17 @@ module Locraft
25
25
  end
26
26
 
27
27
  def generate_strings(localizations_hash)
28
+ return if @config.strings_destination.nil?
28
29
  StringsGenerator.new(@config, localizations_hash).generate
29
30
  end
30
31
 
31
32
  def generate_info_plist(localizations_hash)
33
+ return if @config.info_plist_destination.nil?
32
34
  InfoPlistGenerator.new(@config, localizations_hash).generate
33
35
  end
34
36
 
35
37
  def generate_constant(localizations_hash)
38
+ return if @config.macro_destination.nil?
36
39
  localizations = localizations_hash[@config.default_lang]
37
40
  if @config.dev_lang.equal? OBJC
38
41
  ObjcConstantsGenerator.new(@config, localizations).generate
@@ -3,6 +3,15 @@ Locraft::Config.new do |conf|
3
3
  # @!required
4
4
  ############
5
5
  conf.gdoc_file = 'google doc file name here'
6
+ conf.macro_destination = './' # default: './'
7
+
8
+ # strings destination directory
9
+ # related to this file, default: './Localizations'
10
+ conf.strings_destination = './Localizations'
11
+
12
+ # info plist destination directory
13
+ # related to this file, default: './Localizations'
14
+ conf.info_plist_destination = './Localizations'
6
15
 
7
16
  ############
8
17
  # @!optional
@@ -11,6 +20,7 @@ Locraft::Config.new do |conf|
11
20
  'English' => 'en',
12
21
  'Russian' => 'ru'
13
22
  } # default: { 'English' => 'en', 'Russian' => 'ru' }
23
+
14
24
  conf.default_lang = 'English' # default: 'English'
15
25
  conf.gdoc_sheet = 0 # default: 0
16
26
  conf.gdoc_keys_column = 'Keys' # default: 'Keys'
@@ -19,15 +29,6 @@ Locraft::Config.new do |conf|
19
29
  conf.dev_prefix = 'XYZ' # default: 'XYZ'
20
30
  conf.keys_map = {}
21
31
  conf.macro_file = 'LocalizedConstants' # default: 'LocalizedConstants'
22
- conf.macro_destination = './' # default: './'
23
-
24
- # strings destination directory
25
- # related to this file, default: './Localizations'
26
- conf.strings_destination = './Localizations'
27
32
  conf.strings_basename = 'Localizable' # default: 'Localizable'
28
-
29
- # info plist destination directory
30
- # related to this file, default: './Localizations'
31
- conf.info_plist_destination = './Localizations'
32
33
  conf.info_plist_basename = 'InfoPlist' # default: 'InfoPlist'
33
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locraft
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sroik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google_drive
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.6.11
130
+ rubygems_version: 2.6.12
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: locraft