i18n-tasks 0.2.21 → 0.2.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/i18n-tasks.gemspec +1 -1
- data/lib/i18n/tasks/key.rb +0 -1
- data/lib/i18n/tasks/key_group.rb +2 -1
- data/lib/i18n/tasks/missing_keys.rb +1 -1
- data/lib/i18n/tasks/reports/terminal.rb +1 -1
- data/lib/i18n/tasks/version.rb +1 -1
- metadata +2 -3
- data/doc/img/i18n-usages.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 563f9b661577921d66001c94c5f6e860762bb5a6
|
4
|
+
data.tar.gz: 14ef151e45ddaf53c720fc91c48630465bfe05aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c253a433900be103dccdee48ecdad65053b694a0ca497f75c3acf7d1a094d4e4b6bf9c279667b391db5701c5a4e56b5b761638129e1a8016892e43927cfefb83
|
7
|
+
data.tar.gz: 16ad12978adba7925e0ad2851d753e3c266b07fdcfc58c44717b93c07992629343b2c56c372feb5dc09e9007eed8e96813c6349e1de72c830e59383289c0a495
|
data/i18n-tasks.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
end
|
20
20
|
s.license = 'MIT'
|
21
21
|
|
22
|
-
s.files = `git ls-files`.split($/) - %w(doc/img/i18n-tasks.gif)
|
22
|
+
s.files = `git ls-files`.split($/) - %w(doc/img/i18n-tasks.gif doc/img/i18n-usages.png)
|
23
23
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
24
24
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
25
25
|
s.require_paths = ['lib']
|
data/lib/i18n/tasks/key.rb
CHANGED
data/lib/i18n/tasks/key_group.rb
CHANGED
@@ -32,13 +32,14 @@ module I18n
|
|
32
32
|
key_names_set.include?(key.to_s)
|
33
33
|
end
|
34
34
|
|
35
|
-
# order, e.g: {locale: :asc, type: :desc, key: :asc}
|
36
35
|
def sort!(&block)
|
37
36
|
@keys.sort!(&block)
|
38
37
|
@key_names = @keys.map(&:to_s)
|
39
38
|
self
|
40
39
|
end
|
41
40
|
|
41
|
+
# Sort keys by their attributes in order
|
42
|
+
# @param [Hash] order e.g. {locale: :asc, type: :desc, key: :asc}
|
42
43
|
def sort_by_attr!(order)
|
43
44
|
order_keys = order.keys
|
44
45
|
sort! { |a, b|
|
@@ -9,7 +9,7 @@ module I18n::Tasks
|
|
9
9
|
if type == :missing_from_base
|
10
10
|
keys_missing_from_base
|
11
11
|
else
|
12
|
-
locales.map { |locale| send("keys_#{type}", locale) }.reduce(:+)
|
12
|
+
locales.map { |locale| send("keys_#{type}", locale) }.reduce(:+) || KeyGroup.new([])
|
13
13
|
end
|
14
14
|
else
|
15
15
|
missing_keys(type: :missing_from_base) +
|
@@ -41,7 +41,7 @@ module I18n
|
|
41
41
|
keys.sort_by_attr!(key: :asc)
|
42
42
|
if keys.present?
|
43
43
|
keys.each do |k|
|
44
|
-
puts "#{bold "#{k.key}"} #{k[:usages].size if k[:usages].size > 1}"
|
44
|
+
puts "#{bold "#{k.key}"} #{green k[:usages].size if k[:usages].size > 1}"
|
45
45
|
k[:usages].each do |u|
|
46
46
|
line = u[:line].dup.tap { |line|
|
47
47
|
line.strip!
|
data/lib/i18n/tasks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -196,7 +196,6 @@ files:
|
|
196
196
|
- LICENSE.txt
|
197
197
|
- README.md
|
198
198
|
- Rakefile
|
199
|
-
- doc/img/i18n-usages.png
|
200
199
|
- i18n-tasks.gemspec
|
201
200
|
- lib/i18n/tasks.rb
|
202
201
|
- lib/i18n/tasks/base_task.rb
|
data/doc/img/i18n-usages.png
DELETED
Binary file
|