cocoapods-prune-localizations 0.2.0 → 0.2.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 +4 -4
- data/.bundle/config +3 -0
- data/.gitignore +1 -1
- data/Gemfile.lock +78 -0
- data/README.md +6 -0
- data/lib/cocoapods-prune-localizations.rb +2 -2
- data/lib/pruner.rb +20 -16
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4db9c40af8ea2e0724e988e9f671dbf10a8ba78
|
4
|
+
data.tar.gz: 03ffbfe845c116eb304f2b84ee64c68c116dbaa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74ef00c0e04c746eb90b9d99553d06ef554c1c344664a56df682e8576f1df969afd9e096d800b3bed5b1c1b67fa17138cb5ab67e3046c885aee51e0c55bcd398
|
7
|
+
data.tar.gz: ad8f0292150db95eb697e7173481510ccd4f6f9b3fa30a47c93139b94d7ade455a7ffe4d314849e2dc8bb426e2dd297cbf20c4203de18521c1f4834a4e0267e2
|
data/.bundle/config
ADDED
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cocoapods-prune-localizations (0.2.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (4.2.6)
|
10
|
+
i18n (~> 0.7)
|
11
|
+
json (~> 1.7, >= 1.7.7)
|
12
|
+
minitest (~> 5.1)
|
13
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
14
|
+
tzinfo (~> 1.1)
|
15
|
+
bacon (1.2.0)
|
16
|
+
claide (1.0.0)
|
17
|
+
cocoapods (1.0.0)
|
18
|
+
activesupport (>= 4.0.2)
|
19
|
+
claide (>= 1.0.0, < 2.0)
|
20
|
+
cocoapods-core (= 1.0.0)
|
21
|
+
cocoapods-deintegrate (>= 1.0.0, < 2.0)
|
22
|
+
cocoapods-downloader (>= 1.0.0, < 2.0)
|
23
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
24
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
25
|
+
cocoapods-stats (>= 1.0.0, < 2.0)
|
26
|
+
cocoapods-trunk (>= 1.0.0, < 2.0)
|
27
|
+
cocoapods-try (>= 1.0.0, < 2.0)
|
28
|
+
colored (~> 1.2)
|
29
|
+
escape (~> 0.0.4)
|
30
|
+
fourflusher (~> 0.3.0)
|
31
|
+
molinillo (~> 0.4.5)
|
32
|
+
nap (~> 1.0)
|
33
|
+
xcodeproj (>= 1.0.0, < 2.0)
|
34
|
+
cocoapods-core (1.0.0)
|
35
|
+
activesupport (>= 4.0.2)
|
36
|
+
fuzzy_match (~> 2.0.4)
|
37
|
+
nap (~> 1.0)
|
38
|
+
cocoapods-deintegrate (1.0.0)
|
39
|
+
cocoapods-downloader (1.0.0)
|
40
|
+
cocoapods-plugins (1.0.0)
|
41
|
+
nap
|
42
|
+
cocoapods-search (1.0.0)
|
43
|
+
cocoapods-stats (1.0.0)
|
44
|
+
cocoapods-trunk (1.0.0)
|
45
|
+
nap (>= 0.8, < 2.0)
|
46
|
+
netrc (= 0.7.8)
|
47
|
+
cocoapods-try (1.0.0)
|
48
|
+
colored (1.2)
|
49
|
+
escape (0.0.4)
|
50
|
+
fourflusher (0.3.0)
|
51
|
+
fuzzy_match (2.0.4)
|
52
|
+
i18n (0.7.0)
|
53
|
+
json (1.8.3)
|
54
|
+
minitest (5.9.0)
|
55
|
+
molinillo (0.4.5)
|
56
|
+
nap (1.1.0)
|
57
|
+
netrc (0.7.8)
|
58
|
+
rake (11.1.2)
|
59
|
+
thread_safe (0.3.5)
|
60
|
+
tzinfo (1.2.2)
|
61
|
+
thread_safe (~> 0.1)
|
62
|
+
xcodeproj (1.0.0)
|
63
|
+
activesupport (>= 3)
|
64
|
+
claide (>= 1.0.0, < 2.0)
|
65
|
+
colored (~> 1.2)
|
66
|
+
|
67
|
+
PLATFORMS
|
68
|
+
ruby
|
69
|
+
|
70
|
+
DEPENDENCIES
|
71
|
+
bacon
|
72
|
+
bundler (~> 1.3)
|
73
|
+
cocoapods
|
74
|
+
cocoapods-prune-localizations!
|
75
|
+
rake
|
76
|
+
|
77
|
+
BUNDLED WITH
|
78
|
+
1.10.6
|
data/README.md
CHANGED
@@ -16,6 +16,12 @@ Requires CocoaPods 0.36
|
|
16
16
|
|
17
17
|
In your Podfile, add this line:
|
18
18
|
|
19
|
+
plugin 'cocoapods-prune-localizations'
|
20
|
+
|
21
|
+
Localizations will be inferred from your project.
|
22
|
+
|
23
|
+
or if you would prefer to specify the localizations:
|
24
|
+
|
19
25
|
plugin 'cocoapods-prune-localizations', {:localizations => ["en", "es"]}
|
20
26
|
|
21
27
|
This will keep the English and Spanish localizations in the Pods. Modify the localizations to your needs.
|
@@ -1,3 +1,3 @@
|
|
1
1
|
module CocoapodsPruneLocalizations
|
2
|
-
VERSION = "0.2.
|
3
|
-
end
|
2
|
+
VERSION = "0.2.1"
|
3
|
+
end
|
data/lib/pruner.rb
CHANGED
@@ -48,9 +48,11 @@ module CocoapodsPruneLocalizations
|
|
48
48
|
Pod::UI.title 'Pruning unused localizations' do
|
49
49
|
|
50
50
|
#Group all the Pods
|
51
|
-
pod_groups =
|
52
|
-
|
53
|
-
|
51
|
+
pod_groups = []
|
52
|
+
pod_items = @pod_project["Pods"]
|
53
|
+
dev_pod_items = @pod_project["Development Pods"]
|
54
|
+
pod_groups += pod_items.children.objects if pod_items
|
55
|
+
pod_groups += dev_pod_items.children.objects if dev_pod_items
|
54
56
|
|
55
57
|
pod_groups.each do |group|
|
56
58
|
|
@@ -72,8 +74,8 @@ module CocoapodsPruneLocalizations
|
|
72
74
|
elsif file.path.end_with? ".bundle"
|
73
75
|
trimmed_bundle = self.trimmed_bundle(file.real_path)
|
74
76
|
if trimmed_bundle
|
75
|
-
subTrimmedBundlesToAdd[file.real_path] = trimmed_bundle
|
76
|
-
keep =
|
77
|
+
subTrimmedBundlesToAdd[file.real_path] = [trimmed_bundle, file]
|
78
|
+
keep = true
|
77
79
|
end
|
78
80
|
end
|
79
81
|
if !keep
|
@@ -89,14 +91,12 @@ module CocoapodsPruneLocalizations
|
|
89
91
|
markForRemoval.each do |file|
|
90
92
|
Pod::UI.message "- Pruning #{file}"
|
91
93
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
lines[i] = ""
|
99
|
-
end
|
94
|
+
relative_path = file.real_path.relative_path_from @sandbox_root
|
95
|
+
rsrc_scripts_files.each_value do |lines|
|
96
|
+
for i in 0...lines.length
|
97
|
+
line = lines[i]
|
98
|
+
if line.include?(relative_path.to_s)
|
99
|
+
lines[i] = ""
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
@@ -110,13 +110,17 @@ module CocoapodsPruneLocalizations
|
|
110
110
|
group_path = File.join(@pruned_bundles_path, group.path)
|
111
111
|
FileUtils.mkdir group_path unless Dir.exist? group_path
|
112
112
|
trimmedBundlesToAdd.each_pair do |resGroup, bundleArray|
|
113
|
-
bundleArray.each_pair do |original_bundle_path,
|
113
|
+
bundleArray.each_pair do |original_bundle_path, bundle_arr|
|
114
|
+
bundle_path = bundle_arr[0]
|
115
|
+
original_file = bundle_arr[1]
|
114
116
|
bundle_name = File.basename(original_bundle_path)
|
115
117
|
new_bundle_path = File.join(group_path, bundle_name)
|
116
118
|
FileUtils.rm_r(new_bundle_path) if File.exist? new_bundle_path
|
117
119
|
FileUtils.mv(bundle_path, new_bundle_path)
|
118
|
-
|
119
|
-
|
120
|
+
# Update Project path
|
121
|
+
original_file.set_path(new_bundle_path)
|
122
|
+
|
123
|
+
# Update Resource Scripts path
|
120
124
|
relative_path = original_bundle_path.relative_path_from(@sandbox_root).to_s
|
121
125
|
new_relative_path = Pathname.new(new_bundle_path).relative_path_from(@sandbox_root).to_s
|
122
126
|
rsrc_scripts_files.each_value do |lines|
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-prune-localizations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Torres
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Remove unused localizations from your app
|
@@ -45,8 +45,10 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
-
|
48
|
+
- .bundle/config
|
49
|
+
- .gitignore
|
49
50
|
- Gemfile
|
51
|
+
- Gemfile.lock
|
50
52
|
- LICENSE.txt
|
51
53
|
- README.md
|
52
54
|
- Rakefile
|
@@ -65,17 +67,17 @@ require_paths:
|
|
65
67
|
- lib
|
66
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
69
|
requirements:
|
68
|
-
- -
|
70
|
+
- - '>='
|
69
71
|
- !ruby/object:Gem::Version
|
70
72
|
version: '0'
|
71
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
74
|
requirements:
|
73
|
-
- -
|
75
|
+
- - '>='
|
74
76
|
- !ruby/object:Gem::Version
|
75
77
|
version: '0'
|
76
78
|
requirements: []
|
77
79
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.4.
|
80
|
+
rubygems_version: 2.4.8
|
79
81
|
signing_key:
|
80
82
|
specification_version: 4
|
81
83
|
summary: Upon running pod install, this plugin will remove unused localizations by
|