xlocalize 0.3.0 → 0.3.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: 5e9711c270d3b8f1436b0b740d56adc3cf167316
4
- data.tar.gz: fc2ef80a45346002dc7fe9d188f038df232b33d7
3
+ metadata.gz: f18a1267e6b51f35e4ed9744bb3d0fb93aa19350
4
+ data.tar.gz: d5761da399cbc9057322506902fb6aabe797de8b
5
5
  SHA512:
6
- metadata.gz: 136703bed8b27bced211d7e073990a3e2f38f8f593e50cdfd15c754b87abcae20ed41293142f05c4d4363f12f416c77682ac213ad8c355fb00a57565d2031ada
7
- data.tar.gz: e9a79bec1f3466ff2e5b98fdcdf41123724d640bfe6ef102d3db20752957f1f1614a88fe8aaf9963aaba16722b2b8a2a0700758329f319b0315bb4d86cb45d3a
6
+ metadata.gz: e7239c52d390a97c8dd1b0e9ff0e9943e05a059e7186919b399a6a50aadcb15d3b4272470ad8114d006ce76869ab0e0d85a9bebacaf294771e6b526305188114
7
+ data.tar.gz: ce3ca40f1c3285255afb7c397994fe47fa69eab9dab68752f3e2cb0509d48fe26a81e15a39916ad8e3550eaf1e398ed4d239f8c659d8e9b9d399913f44b1b4c5
data/.travis.yml CHANGED
@@ -1,13 +1,13 @@
1
1
  language: ruby
2
2
  cache: bundler
3
- rvm: 2.0.0
4
- osx_image: xcode8
3
+ rvm: 2.2
4
+ matrix:
5
+ include:
6
+ - {os: osx, osx_image: xcode8.3}
7
+ - {os: osx, osx_image: xcode9.2}
5
8
  git:
6
9
  depth: 1
7
- before_install: gem install bundler
8
- install: bundle install
9
10
  script: bundle exec rspec -f d -c
10
- os: osx
11
11
  addons:
12
12
  code_climate:
13
13
  repo_token: b4206ed2b9443314c998e8909dfa31f0ed476ea5ab460b98e102cd20508ff564
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ## [v0.3.1](https://github.com/viktorasl/xlocalize/releases/tag/0.3.1)
2
+
3
+ * [7eb4563](https://github.com/viktorasl/xlocalize/commit/7eb4563456932b72fab0b3579a9d9ed1d5b97f0c) Fixes plurals export on Xcode9 and later
4
+ * [758ef1e](https://github.com/viktorasl/xlocalize/commit/758ef1eae39ec5cc15d58b39eda93cc423f1dfa8) Tests on multiple Xcode versions
@@ -1,5 +1,6 @@
1
1
  require 'xlocalize/webtranslateit'
2
2
  require 'xlocalize/xliff'
3
+ require 'xlocalize/helper'
3
4
  require 'colorize'
4
5
  require 'nokogiri'
5
6
  require 'yaml'
@@ -17,15 +18,20 @@ module Xlocalize
17
18
 
18
19
  def export_master(wti, project, targets, excl_prefix, master_lang)
19
20
  master_file_name = locale_file_name(master_lang)
20
-
21
- # hacky way to finish xcodebuild -exportLocalizations script, because
22
- # since Xcode7.3 & OS X Sierra script hangs even though it produces
23
- # xliff output
24
- # http://www.openradar.me/25857436
21
+
25
22
  File.delete(master_file_name) if File.exist?(master_file_name)
26
- system "xcodebuild -exportLocalizations -localizationPath ./ -project #{project} & sleep 0"
27
- while !File.exist?(master_file_name) do
28
- sleep(1)
23
+
24
+ if Helper.xcode_at_least?(9)
25
+ system "xcodebuild -exportLocalizations -localizationPath ./ -project #{project}"
26
+ else
27
+ # hacky way to finish xcodebuild -exportLocalizations script, because
28
+ # since Xcode7.3 & OS X Sierra script hangs even though it produces
29
+ # xliff output
30
+ # http://www.openradar.me/25857436
31
+ system "xcodebuild -exportLocalizations -localizationPath ./ -project #{project} & sleep 0"
32
+ while !File.exist?(master_file_name) do
33
+ sleep(1)
34
+ end
29
35
  end
30
36
 
31
37
  purelyze(master_lang, targets, excl_prefix, project)
@@ -0,0 +1,16 @@
1
+
2
+ module Xlocalize
3
+
4
+ class Helper
5
+
6
+ def self.xcode_version
7
+ output = `xcodebuild -version`
8
+ output.split("\n").first.split(' ')[1]
9
+ end
10
+
11
+ def self.xcode_at_least?(version)
12
+ v = xcode_version
13
+ Gem::Version.new(v) >= Gem::Version.new(version)
14
+ end
15
+ end
16
+ end
@@ -1,4 +1,4 @@
1
1
  module Xlocalize
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  DESCRIPTION = "Xcode localizations import/export helper tool"
4
4
  end
@@ -46,6 +46,7 @@ module Xlocalize
46
46
  end
47
47
  plurals[fname_stringsdict] = translations
48
48
  }
49
+ plurals.each { |k, _| self.css('file[original="' << k << '"]').remove }
49
50
  return plurals
50
51
  end
51
52
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xlocalize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viktoras Laukevičius
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-21 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -148,6 +148,7 @@ extra_rdoc_files: []
148
148
  files:
149
149
  - ".gitignore"
150
150
  - ".travis.yml"
151
+ - CHANGELOG.md
151
152
  - CODE_OF_CONDUCT.md
152
153
  - Gemfile
153
154
  - LICENSE.txt
@@ -158,6 +159,7 @@ files:
158
159
  - bin/xlocalize
159
160
  - lib/xlocalize.rb
160
161
  - lib/xlocalize/executor.rb
162
+ - lib/xlocalize/helper.rb
161
163
  - lib/xlocalize/version.rb
162
164
  - lib/xlocalize/webtranslateit.rb
163
165
  - lib/xlocalize/xliff.rb
@@ -187,3 +189,4 @@ signing_key:
187
189
  specification_version: 4
188
190
  summary: Xcode localizations import/export helper tool
189
191
  test_files: []
192
+ has_rdoc: