i18n-tasks 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: 66781586bda6c38de2ca767c265c7e1fbaf6e11184997f00a77c215e2270a7d7
4
- data.tar.gz: 3a94d73244c34887758d208cdc807a930467ac6cde95545dea6acdbed5563c36
3
+ metadata.gz: adca7ca6bf65af74c2a4e88e30179281471f1b391a9dec1885031f6e4b5d104c
4
+ data.tar.gz: 82bfb0f4dd4d614fc93b34427e9e4d6aee2c2e3f9a9115d3b89bb1938edfeb8b
5
5
  SHA512:
6
- metadata.gz: b51f3bf32fc208a9845b79f9a074ed2bcd2f0ff648309b93dbf7431df7154103a63c298bdb197cfae611012423d315df1552ad600a20135dfd76592df5d853d8
7
- data.tar.gz: 4cc284d8c283c4159333310f4deb2e78ec064f60c024ccdadd4007d883955ca08d1e765b69529744dff2f953973d3cab6ff46138919c5cc41c3c4f986ea2a88a
6
+ metadata.gz: ac7dfdb7bcfa4ccf412b9afeb5d309d86d6a49dbbfe6c39d2128aff5e5cf8b1ee29cc8a7089975e1c0677c79c63985f19ebf6175010e9a7e21e02ebf2aca3323
7
+ data.tar.gz: f05bc85a3df41d6eb857fb3f52f20328093c28ee3595c5dc3acbbbab8a2dfd5462712052e6237b53cff2f53c5971f006dd5a840fc09987ef6b246d5a4b6fd214
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', '~> 1.0.2'
27
+ gem 'i18n-tasks', '~> 1.0.3'
28
28
  ```
29
29
 
30
30
  Copy the default [configuration file](#configuration):
@@ -223,7 +223,7 @@ See the full list of tasks with `i18n-tasks --help`.
223
223
 
224
224
  ### Features and limitations
225
225
 
226
- `i18n-tasks` uses an AST scanner for `.rb` files, and a regexp-based scanner for other files, such as `.haml`.
226
+ `i18n-tasks` uses an AST scanner for `.rb` and `.html.erb` files, and a regexp-based scanner for other files, such as `.haml`.
227
227
 
228
228
  #### Relative keys
229
229
 
@@ -52,6 +52,8 @@ module I18n::Tasks::Scanners
52
52
  # @param local_location {Parser::Source::Map} Local location in the parsed string
53
53
  # @return {Parser::Source::Map}
54
54
  def updated_location(global_location, local_location)
55
+ return global_location if local_location.expression.nil?
56
+
55
57
  range = ::Parser::Source::Range.new(
56
58
  global_location.expression.source_buffer,
57
59
  global_location.expression.to_range.begin + local_location.expression.to_range.begin,
@@ -48,7 +48,7 @@ module I18n::Tasks
48
48
  # rubocop:enable Metrics/ParameterLists
49
49
 
50
50
  def inspect
51
- "Occurrence(path: #{@path}, line_num: #{@line_num}, line_pos: #{@line_pos}, pos: #{@pos}, raw_key: #{@raw_key}, default_arg: #{@default_arg}, line: #{@line})"
51
+ "Occurrence(#{@path}:#{@line_num}, line_pos: #{@line_pos}, pos: #{@pos}, raw_key: #{@raw_key}, default_arg: #{@default_arg}, line: #{@line})"
52
52
  end
53
53
 
54
54
  def ==(other)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module I18n
4
4
  module Tasks
5
- VERSION = '1.0.2'
5
+ VERSION = '1.0.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebm