i18n-tasks 0.2.14 → 0.2.15

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: 760bba77247fae6727219b0e36b605c01f760dff
4
- data.tar.gz: 12e5076cdf6279ae466e8137c84ea7f08f155eb7
3
+ metadata.gz: 217d5375c8adaf43404a25edbb7b8d1e0ace0846
4
+ data.tar.gz: 7cb0ada61b7e6d10f4da54c879eb8955eed92400
5
5
  SHA512:
6
- metadata.gz: 739772e09dde3095da37f5e0e47e53ce03564448479867de3b6b4bc7300d1aad9c331b7182ce28f942e29032b6ba30524e398b627ae04d6ce2a05373c09a321c
7
- data.tar.gz: 39e7fad91f6269ab0aff4e60ef9d44a6e48baa34c134b177e21974a2aaf2828382af8b640817e6a53efd482531742bcb788a1ce0d8727cb6d0f661b526acccb1
6
+ metadata.gz: c8a931302b28482f56cef52028280832c0a9e963c9e6c4ee28131c139db5b4e2667719f7776f192a8106b91200704ca80e8e1b5c2152a04dfa8b5410dc7c1579
7
+ data.tar.gz: 4e9597da0828551fcd2fb82ae0a2a21d84bf4f699137d6b16e58b4de57433554ea2f6b44a21f64841271ddc71b21b87cd1aa6458db9b5b59da24dd504c3b8ca6
data/.travis.yml CHANGED
@@ -1,9 +1,11 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- - jruby
6
- - rbx
3
+ - 2.1.0
4
+ - 2.0.0
5
+ - 1.9.3
6
+ - jruby
7
+ - rbx
7
8
  env:
8
9
  global:
9
- - TRAVIS=1
10
+ - TRAVIS=1
11
+ - secure: Clln+r2rG6adnmVjS0zGMVHs1hOq58UPIqRE73xW3MPLOdozGUyIZ0RrAU2new1h4sqk/5HVwG5NSW7AsUJDGgkNCDx4saJbf/G+oKIity1zNxlHZu5ijZOZGyxYNzGGM4cb2OO6RS6lfzA6TFv2TQtw8DDfKjzG2gpuJOje8sU=
data/i18n-tasks.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_dependency 'rake'
26
26
  s.add_dependency 'erubis'
27
27
  s.add_dependency 'activesupport'
28
- s.add_dependency 'easy_translate'
28
+ s.add_dependency 'easy_translate', '>= 0.4.0'
29
29
  s.add_dependency 'term-ansicolor'
30
30
  s.add_dependency 'terminal-table'
31
31
  s.add_dependency 'highline'
@@ -26,7 +26,7 @@ module I18n::Tasks::Configuration
26
26
  end
27
27
  end
28
28
 
29
- DEFAULT_PATTERN = /\bt[( ]\s*(:?".+?"|:?'.+?'|:\w+)/
29
+ DEFAULT_PATTERN = /\bt(?:ranslate)?[( ]\s*(:?".+?"|:?'.+?'|:\w+)/
30
30
  # search config
31
31
  # @return [Hash{String => String,Hash,Array}]
32
32
  def search_config
@@ -41,17 +41,15 @@ module I18n::Tasks::SourceKeys
41
41
  end
42
42
 
43
43
  # Extract i18n keys from file
44
- # @return [String] list of unique, absolut keys
44
+ # @return [String] keys used in file (absolutized and unique)
45
45
  def extract_keys(path)
46
46
  keys = []
47
47
  File.open(path, 'rb') do |f|
48
- while (line = f.gets)
49
- line.scan(search_config[:pattern]) do |match|
50
- key = parse_key(match)
51
- key = absolutize_key(key, path) if key.start_with? '.'
52
- if key =~ /^[\w.\#{}]+$/
53
- keys << key
54
- end
48
+ f.read.scan(search_config[:pattern]) do |match|
49
+ key = parse_key(match)
50
+ key = absolutize_key(key, path) if key.start_with? '.'
51
+ if key =~ /^[\w.\#{}]+$/
52
+ keys << key
55
53
  end
56
54
  end
57
55
  end
@@ -59,6 +57,7 @@ module I18n::Tasks::SourceKeys
59
57
  end
60
58
 
61
59
  private
60
+ # remove the leading colon and unwrap quotes from the key match
62
61
  def parse_key(match)
63
62
  key = match[0]
64
63
  key.slice!(0) if ':' == key[0]
@@ -1,5 +1,5 @@
1
1
  module I18n
2
2
  module Tasks
3
- VERSION = '0.2.14'
3
+ VERSION = '0.2.15'
4
4
  end
5
5
  end
@@ -8,7 +8,7 @@ describe 'Source keys' do
8
8
  ['t "a.b"', "t 'a.b'", 't("a.b")', "t('a.b')",
9
9
  "t('a.b', :arg => val)", "t('a.b', arg: val)",
10
10
  "t :a_b", "t :'a.b'", 't :"a.b"', "t(:ab)", "t(:'a.b')", 't(:"a.b")',
11
- 'I18n.t("a.b")'].each do |s|
11
+ 'I18n.t("a.b")', 'I18n.translate("a.b")'].each do |s|
12
12
  it "matches #{s}" do
13
13
  pattern.should match s
14
14
  end
@@ -20,4 +20,4 @@ describe 'Source keys' do
20
20
  end
21
21
  end
22
22
  end
23
- end
23
+ 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.14
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-15 00:00:00.000000000 Z
11
+ date: 2014-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '>='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.4.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 0.4.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: term-ansicolor
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  version: '0'
259
259
  requirements: []
260
260
  rubyforge_project:
261
- rubygems_version: 2.1.11
261
+ rubygems_version: 2.0.14
262
262
  signing_key:
263
263
  specification_version: 4
264
264
  summary: Tasks to manage missing and unused translations in ruby applications using