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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d02f77ecd3ceb644a2a5a86d1b5dc622880e170
4
- data.tar.gz: e859f73a4891034d5e1e95b7b5938aa7d3dace73
3
+ metadata.gz: 563f9b661577921d66001c94c5f6e860762bb5a6
4
+ data.tar.gz: 14ef151e45ddaf53c720fc91c48630465bfe05aa
5
5
  SHA512:
6
- metadata.gz: 4d821eab3b6e9f54870ccaa4c76869cea3ca79dc7eebdd62566c2464997bcd08485826b98a2d3d83f27d4ee8c609f502db9f1f5c528f1f1db133894e48f7835d
7
- data.tar.gz: 44be3b83606e217455633dbb806e972bac6071a238c5f9f74b499a3fc883199d2edb22804dc160e8c5f3708e0f22c122680a6ea2bbe007d15f15f72873f1986f
6
+ metadata.gz: c253a433900be103dccdee48ecdad65053b694a0ca497f75c3acf7d1a094d4e4b6bf9c279667b391db5701c5a4e56b5b761638129e1a8016892e43927cfefb83
7
+ data.tar.gz: 16ad12978adba7925e0ad2851d753e3c266b07fdcfc58c44717b93c07992629343b2c56c372feb5dc09e9007eed8e96813c6349e1de72c830e59383289c0a495
@@ -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']
@@ -11,7 +11,6 @@ module I18n
11
11
  else
12
12
  (own_attr || {}).merge(key: key_or_attr)
13
13
  end
14
-
15
14
  @own_attr[:key] = @own_attr[:key].to_s
16
15
  end
17
16
 
@@ -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!
@@ -1,5 +1,5 @@
1
1
  module I18n
2
2
  module Tasks
3
- VERSION = '0.2.21'
3
+ VERSION = '0.2.22'
4
4
  end
5
5
  end
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.21
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-24 00:00:00.000000000 Z
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
Binary file