i18nliner 0.0.7 → 0.0.8

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.
@@ -11,6 +11,10 @@ module I18nliner
11
11
  TRANSLATE_CALLS = [:t, :translate]
12
12
  attr_reader :current_line
13
13
 
14
+ def self.pattern
15
+ /(^|\W)(t|translate)(\W|$)/
16
+ end
17
+
14
18
  def initialize(sexps, scope)
15
19
  @sexps = sexps
16
20
  @scope = scope
@@ -9,6 +9,7 @@ module I18nliner
9
9
  default_pattern '*.rb'
10
10
 
11
11
  def check_contents(source, scope = Scope.new)
12
+ return if source !~ Extractors::RubyExtractor.pattern
12
13
  sexps = RubyParser.new.parse(pre_process(source))
13
14
  extractor = Extractors::RubyExtractor.new(sexps, scope)
14
15
  extractor.each_translation do |key, value|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18nliner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-19 00:00:00.000000000 Z
12
+ date: 2014-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport