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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d7150a87197f1366f4f451b84ec214d3f39e86b
4
- data.tar.gz: 16d164673b493e94bd45395c49caa208fb8c113c
3
+ metadata.gz: 3eec8659815b53951e2445dbeec09cb9f346c3e2
4
+ data.tar.gz: 50d5412e21b40b89220852f4cdb45a92d40acdc3
5
5
  SHA512:
6
- metadata.gz: 5d9d59b0e9cae6e6624a7977717018cc6297ab32b1a381acd7c2215a6d30d4b7eaf896bee0b920fcb13b90df09e993c62951c2e7791cf040a5504778a3502a70
7
- data.tar.gz: 9977c0ef0785acb7fe7bf228edbb78b4446bc487e14dd35c2b058f6a03c07404bb9a878ea2e25089e209f56804e5a01d15676899612b0c59f7057141f5692de8
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.0'
27
+ gem 'i18n-tasks', '~> 0.9.1'
28
28
  ```
29
29
 
30
30
  Copy the default [configuration file](#configuration):
@@ -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.license = 'MIT'
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)
@@ -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']
@@ -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.dup.tap do |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
@@ -83,7 +83,7 @@ module I18n::Tasks::Scanners
83
83
  end
84
84
 
85
85
  def translate_call_re
86
- /(?<=^|[^\w'\-])t(?:ranslate)?/
86
+ /(?<=^|[^\w'\-.]|[^\w'\-]I18n\.|I18n\.)t(?:ranslate)?/
87
87
  end
88
88
 
89
89
  # Match literals:
@@ -44,7 +44,7 @@ module I18n::Tasks
44
44
  end
45
45
 
46
46
  def scanner(strict: nil)
47
- (@scanner ||= {})[strict.nil? ? search_config[:strict] : strict] ||= begin
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?
@@ -1,5 +1,5 @@
1
1
  module I18n
2
2
  module Tasks
3
- VERSION = '0.9.0'
3
+ VERSION = '0.9.1'
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.9.0
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-10-28 00:00:00.000000000 Z
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: '0'
317
+ version: '2.1'
318
318
  required_rubygems_version: !ruby/object:Gem::Requirement
319
319
  requirements:
320
320
  - - ">="