translations_sync 0.2.0 → 0.2.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.
Files changed (4) hide show
  1. data/README +1 -2
  2. data/Rakefile +1 -1
  3. data/lib/translations_sync.rb +3 -3
  4. metadata +4 -4
data/README CHANGED
@@ -52,8 +52,7 @@ translations occuring only in one locale.
52
52
 
53
53
  3. rake translations:move KEY=key.to.move TO=where.to.move
54
54
 
55
- This task moves the given KEY under the TO. Please note, that the TO
56
- must not have the last part of the KEY at the end.
55
+ This task moves the content of given KEY under the TO.
57
56
  You can use all the parameters available for the translations:sync task with the default
58
57
  value for the NAME equal to 'moved'.
59
58
  In order to overwrite the existing file both NAME and SOURCE should be given
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rubygems/specification'
6
6
  require 'date'
7
7
 
8
8
  GEM = "translations_sync"
9
- GEM_VERSION = "0.2.0"
9
+ GEM_VERSION = "0.2.1"
10
10
  AUTHOR = "Dmitri Koulikoff"
11
11
  EMAIL = "koulikoff@gmail.com"
12
12
  HOMEPAGE = "http://github.com/dima4p/translations_sync/"
@@ -143,13 +143,13 @@ class TranslationsSync
143
143
 
144
144
  def move(key, destination)
145
145
  key = key.split('.').map(&:to_sym)
146
- key_length = key.length - 1
147
- return false if key_length < 0
146
+ return false if key_length < 1
148
147
  destination ||= ''
149
148
  destination = destination.split('.').map(&:to_sym)
149
+ destination << key.last if destination.size == 0
150
150
  result = false
151
151
  @flat.each_pair do |array, val|
152
- if array[0, key_length + 1] == key
152
+ if array[0, key_length] == key
153
153
  array[0, key_length] = destination
154
154
  result = true
155
155
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: translations_sync
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dmitri Koulikoff
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-16 00:00:00 +03:00
18
+ date: 2011-03-22 00:00:00 +03:00
19
19
  default_executable: translations_sync
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency