locraft 1.6.0 → 1.6.1

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: f05f425b17af04f40e9be5687a0c45f64da9b13c
4
- data.tar.gz: f831400edf7b067bc89a03a0975914cea5ab7dc1
3
+ metadata.gz: b9fbae31c3e0817361c65a49b13bf0f7cd18350c
4
+ data.tar.gz: 1cb2cbb81c6216398523c5ab8b50f0d3332432cd
5
5
  SHA512:
6
- metadata.gz: ac1feeb0999be9597522f6b2c01e18d63aaa44c5953f4f9def9559a8a23f1d0f50d49c401a341d3e0063736884396da4a4e341bc464ea8a040917fd26dafc0e2
7
- data.tar.gz: 25ee60923dcfa36f6a90918e8caecaaceaf35781ec228767b99d17d1ec547270ff290a1005d496d60682b6b649b9547ce6ecf22141c54c438ae7a3b7268fc5bc
6
+ metadata.gz: 9ef2c10ec144f892fb6d63532c6ccb29db0915d6ea309b4d5b10eae9b826a25f2f8b81766c9901c42f4d8a3e4ff8ce649a750d9e5d54ebc784bad905362911fc
7
+ data.tar.gz: '011978afaf7afcf04463dd376519986bc33caea934b4e4a066e83774cfe46e30d563b4afc3b32945254275c5390e72c88755ba1dcab6a56cfa0c5862544ca807'
@@ -17,7 +17,7 @@ module Locraft
17
17
  def parse_csv(csv_body)
18
18
  rows = csv_rows(csv_body)
19
19
  localizations_hash = {}
20
- @config.langs.keys.each do |lang|
20
+ @config.langs.each_key do |lang|
21
21
  localizations_hash[lang] = parse_rows_for_lang(rows, lang) || []
22
22
  end
23
23
  localizations_hash
@@ -2,8 +2,8 @@ require_relative 'constants_generator'
2
2
 
3
3
  module Locraft
4
4
  class ObjcConstantsGenerator < ConstantsGenerator
5
- OBJC_CONST_TEMPLATE_H = 'extern NSString *const __nonnull %{const};'.freeze
6
- OBJC_CONST_TEMPLATE_M = 'NSString *const %{const} = @"%{key}";'.freeze
5
+ OBJC_CONST_TEMPLATE_H = 'extern NSString *const __nonnull %<const>s;'.freeze
6
+ OBJC_CONST_TEMPLATE_M = 'NSString *const %<const>s = @"%<key>s";'.freeze
7
7
 
8
8
  def generate
9
9
  destination_dir = @config.relative_macro_destination
@@ -25,7 +25,7 @@ module Locraft
25
25
  end
26
26
 
27
27
  def constant_from(key)
28
- parts = key.split(/\W/).select { |p| !p.empty? }.map do |p|
28
+ parts = key.split(/\W/).reject(&:empty?).map do |p|
29
29
  p[0] = p[0].capitalize
30
30
  p
31
31
  end
@@ -9,7 +9,6 @@ module Locraft
9
9
  puts 'constants files was created for [swift] language'
10
10
  end
11
11
 
12
-
13
12
  def file
14
13
  content = constants_keys.map { |d| const_template % d }.join("\n")
15
14
  resource_file('swift_macro_template.txt') % content
@@ -17,14 +16,14 @@ module Locraft
17
16
 
18
17
  def const_template
19
18
  <<EOF
20
- static var %{const}: String {
21
- return localized("%{key}")
19
+ static var %<const>s: String {
20
+ return localized("%<key>s")
22
21
  }
23
22
  EOF
24
23
  end
25
24
 
26
25
  def constant_from(key)
27
- parts = key.split(/\W/).select { |p| !p.empty? }
26
+ parts = key.split(/\W/).reject(&:empty?)
28
27
  parts.map! do |p|
29
28
  p[0] = p[0].capitalize if p != parts[0]
30
29
  p
@@ -1,5 +1,4 @@
1
1
  module Locraft
2
-
3
2
  SAMPLE_CONFIG_DIR = 'locraft'.freeze
4
3
  SAMPLE_CONFIG_FILE = 'locraft.config'.freeze
5
4
 
@@ -23,7 +23,7 @@ module Locraft
23
23
  content = ''
24
24
  if valid?
25
25
  content += "/* #{comment} */" unless comment.nil?
26
- content += %(\n"#{key}" = "#{value}";\n)
26
+ content += %(\n"#{key}" = "#{value.gsub("\n", "\\n") }";\n)
27
27
  end
28
28
  content
29
29
  end
@@ -0,0 +1,3 @@
1
+ module Locraft
2
+ VERSION = '1.6.1'.freeze
3
+ 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.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sroik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-24 00:00:00.000000000 Z
11
+ date: 2018-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google_drive
@@ -42,42 +42,70 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ">"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ">"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: gem-release
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ">="
73
+ - - ">"
60
74
  - !ruby/object:Gem::Version
61
75
  version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ">="
80
+ - - ">"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.52'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.52'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: test-unit
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
- - - ">="
101
+ - - ">"
74
102
  - !ruby/object:Gem::Version
75
103
  version: '0'
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
- - - ">="
108
+ - - ">"
81
109
  - !ruby/object:Gem::Version
82
110
  version: '0'
83
111
  description: application localizator
@@ -107,6 +135,7 @@ files:
107
135
  - lib/locraft/resources/sample_locraft.config
108
136
  - lib/locraft/resources/swift_macro_template.txt
109
137
  - lib/locraft/runner.rb
138
+ - lib/locraft/version.rb
110
139
  homepage: https://github.com/app-craft/locraft
111
140
  licenses:
112
141
  - MIT