i18n-tasks 0.9.0 → 0.9.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/README.md +1 -1
- data/i18n-tasks.gemspec +4 -1
- data/lib/i18n/tasks.rb +21 -0
- data/lib/i18n/tasks/cli.rb +1 -4
- data/lib/i18n/tasks/scanners/pattern_scanner.rb +1 -1
- data/lib/i18n/tasks/used_keys.rb +1 -1
- data/lib/i18n/tasks/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eec8659815b53951e2445dbeec09cb9f346c3e2
|
4
|
+
data.tar.gz: 50d5412e21b40b89220852f4cdb45a92d40acdc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c146fec3dd23aa4de882f510d781c8a64ae189fe3c2a6520b84ec27d46add3f8030a0705ddf3b60ee63f143c40c031f20cb5dc93baa2783079bbf44c1f9d6f5b
|
7
|
+
data.tar.gz: 5f79e425a080e8824d5f85ae77f98a8e81b086989b5ced527e2e83f552f0ce9b4e798d3ef137c922c5e1b7ae16b110b487c11b1a4883281be28bace1cf1d880a
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ i18n-tasks can be used with any project using the ruby [i18n gem][i18n-gem] (def
|
|
24
24
|
Add i18n-tasks to the Gemfile:
|
25
25
|
|
26
26
|
```ruby
|
27
|
-
gem 'i18n-tasks', '~> 0.9.
|
27
|
+
gem 'i18n-tasks', '~> 0.9.1'
|
28
28
|
```
|
29
29
|
|
30
30
|
Copy the default [configuration file](#configuration):
|
data/i18n-tasks.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = I18n::Tasks::VERSION
|
8
8
|
s.authors = ['glebm']
|
9
9
|
s.email = ['glex.spb@gmail.com']
|
10
|
+
s.license = 'MIT'
|
10
11
|
s.summary = %q{Manage localization and translation with the awesome power of static analysis}
|
11
12
|
s.description = <<-TEXT
|
12
13
|
i18n-tasks helps you find and manage missing and unused translations.
|
@@ -24,7 +25,9 @@ TEXT
|
|
24
25
|
if s.respond_to?(:metadata=)
|
25
26
|
s.metadata = { 'issue_tracker' => 'https://github.com/glebm/i18n-tasks' }
|
26
27
|
end
|
27
|
-
s.
|
28
|
+
if s.respond_to?(:required_ruby_version=)
|
29
|
+
s.required_ruby_version = '~> 2.1'
|
30
|
+
end
|
28
31
|
|
29
32
|
s.files = `git ls-files`.split($/)
|
30
33
|
s.files -= s.files.grep(%r{^(doc/|\.|spec/)}) + %w(CHANGES.md config/i18n-tasks.yml Gemfile)
|
data/lib/i18n/tasks.rb
CHANGED
@@ -13,6 +13,27 @@ module I18n
|
|
13
13
|
def verbose=(value)
|
14
14
|
@verbose = value
|
15
15
|
end
|
16
|
+
|
17
|
+
# Add a scanner to the default configuration.
|
18
|
+
#
|
19
|
+
# @param scanner_class_name [String]
|
20
|
+
# @param scanner_opts [Hash]
|
21
|
+
# @return self
|
22
|
+
def add_scanner(scanner_class_name, scanner_opts = {})
|
23
|
+
scanners = I18n::Tasks::Configuration::DEFAULTS[:search][:scanners]
|
24
|
+
scanners << [scanner_class_name, scanner_opts]
|
25
|
+
scanners.uniq!
|
26
|
+
self
|
27
|
+
end
|
28
|
+
|
29
|
+
# Add commands to i18n-tasks
|
30
|
+
#
|
31
|
+
# @param commands_module [Module]
|
32
|
+
# @return self
|
33
|
+
def add_commands(commands_module)
|
34
|
+
::I18n::Tasks::Commands.send :include, commands_module
|
35
|
+
self
|
36
|
+
end
|
16
37
|
end
|
17
38
|
|
18
39
|
@verbose = !!ENV['VERBOSE']
|
data/lib/i18n/tasks/cli.rb
CHANGED
@@ -48,10 +48,7 @@ class I18n::Tasks::CLI
|
|
48
48
|
def commands
|
49
49
|
# load base task to initialize plugins
|
50
50
|
base_task
|
51
|
-
@commands ||= ::I18n::Tasks::Commands.cmds.
|
52
|
-
# Hash#transform_keys is only available since activesupport v4.0.0
|
53
|
-
cmds.keys.each { |k| cmds[k.to_s.tr('_'.freeze, '-'.freeze)] = cmds.delete(k) }
|
54
|
-
end
|
51
|
+
@commands ||= ::I18n::Tasks::Commands.cmds.transform_keys { |k| k.to_s.tr('_'.freeze, '-'.freeze) }
|
55
52
|
end
|
56
53
|
|
57
54
|
private
|
data/lib/i18n/tasks/used_keys.rb
CHANGED
@@ -44,7 +44,7 @@ module I18n::Tasks
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def scanner(strict: nil)
|
47
|
-
(@scanner ||= {})[strict
|
47
|
+
(@scanner ||= {})[strict?(strict)] ||= begin
|
48
48
|
shared_options = search_config.dup
|
49
49
|
shared_options.delete(:scanners)
|
50
50
|
shared_options[:strict] = strict unless strict.nil?
|
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.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -312,9 +312,9 @@ require_paths:
|
|
312
312
|
- lib
|
313
313
|
required_ruby_version: !ruby/object:Gem::Requirement
|
314
314
|
requirements:
|
315
|
-
- - "
|
315
|
+
- - "~>"
|
316
316
|
- !ruby/object:Gem::Version
|
317
|
-
version: '
|
317
|
+
version: '2.1'
|
318
318
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
319
319
|
requirements:
|
320
320
|
- - ">="
|