<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/lost_in_translation/string_to_hash.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
+.DS_Store
 /pkg/
 /doc/
 /coverage/
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -12,10 +12,10 @@ spec = Gem::Specification.new do |s|
   s.has_rdoc         = true
   s.extra_rdoc_files = %w(README.rdoc)
   s.rdoc_options     = %w(--main README.rdoc)
-  s.summary          = &quot;This gem does ... &quot;
-  s.author           = 'First Last'
-  s.email            = 'user@example.com'
-  s.homepage         = 'http://my-site.net'
+  s.summary          = &quot;Encuentra todas las traducciones de la API I18n de rails y las guarda en yaml&quot;
+  s.author           = 'Jose Galisteo'
+  s.email            = 'ceritium@gmail.com'
+  s.homepage         = 'http://ceritium.net'
   s.files            = %w(README.rdoc Rakefile) + Dir.glob(&quot;{lib,test}/**/*&quot;)
   # s.executables    = ['lost-in-translation']
   </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -2,4 +2,4 @@
 
 require 'pathname'
 require 'lost_in_translation/lost_in_translation'
-
+require 'lost_in_translation/string_to_hash'</diff>
      <filename>lib/lost_in_translation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,8 +8,12 @@ class LostInTranslation
     @locale = 'en'
     @file = &quot;config/locales/#{@locale}.yml&quot;
     @translations = []
-    @hash = {}
-    @path = 'app/'
+    @path = 'app'
+    @sth = StringToHash.new
+  end
+  
+  def hash
+    @sth.hash
   end
 
   # Escaneamos la carpeta en busca de todas las cadenas coincidentes con la expresi&#243;n regular
@@ -26,56 +30,22 @@ class LostInTranslation
   def store
     scan if @translations.empty?
     @translations.each do |translation|
-      key_value = to_deep_hash({translation =&gt; nil})
-      translation = deep_symbolize_keys(key_value)
-      merger = proc { |key, v1, v2| Hash === v1 &amp;&amp; Hash === v2 ? v1.merge(v2, &amp;merger) : v2 }
-      @hash.merge!(translation, &amp;merger)
+      @sth.add(translation)
     end
-    @hash = deep_stringify_keys({@locale  =&gt; @hash})
+    @sth.add_prefix(@locale)
   end
   
   # Guarda en el .yml las nuevas traducciones encontradas
   def save
-    store if @hash.empty?
+    store if hash.empty?
     File.open(@file, &quot;w&quot;) do |file|
-      file.puts @hash.to_yaml
+      file.puts hash.to_yaml
     end
   end
 
   
   private
   
-  def deep_symbolize_keys(hash)
-    hash.inject({}) { |result, (key, value)|
-      value = deep_symbolize_keys(value) if value.is_a? Hash
-      result[(key.to_sym rescue key) || key] = value
-      result
-    }
-  end
-  
-  def to_deep_hash(hash)    
-    hash.inject({}) do |deep_hash, (key, value)|
-      keys = key.split('.').reverse
-      leaf_key = keys.shift
-      key_hash = keys.inject({leaf_key.to_sym =&gt; value}) { |hash, key| {key.to_sym =&gt; hash} }
-      deep_merge!(deep_hash, key_hash)
-      deep_hash
-    end
-  end
-  
-  def deep_merge!(hash1, hash2)
-    merger = proc { |key, v1, v2| Hash === v1 &amp;&amp; Hash === v2 ? v1.merge(v2, &amp;merger) : v2 }
-    hash1.merge!(hash2, &amp;merger)
-  end
-  
-  def deep_stringify_keys(hash)
-    hash.inject({}) { |result, (key, value)|
-      value = deep_stringify_keys(value) if value.is_a? Hash
-      result[(key.to_s rescue key) || key] = value
-      result
-    }
-  end
-  
   # Convertimos el hash que le pasemos a un array
   # NOTA: Este m&#233;todo est&#225; sacado del plugin translate
   # http://github.com/newsdesk/translate
@@ -113,5 +83,4 @@ class LostInTranslation
     end
   end
   
-end
-
+end
\ No newline at end of file</diff>
      <filename>lib/lost_in_translation/lost_in_translation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module LostInTranslation
   module Version
     
     MAJOR = 0
-    MINOR = 1
+    MINOR = 2
     TINY  = 0
     
     def self.to_s # :nodoc:</diff>
      <filename>lib/lost_in_translation/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,20 +2,20 @@
 
 Gem::Specification.new do |s|
   s.name = %q{lost-in-translation}
-  s.version = &quot;0.1.0&quot;
+  s.version = &quot;0.2.0&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
-  s.authors = [&quot;First Last&quot;]
-  s.date = %q{2009-06-28}
-  s.email = %q{user@example.com}
+  s.authors = [&quot;Jose Galisteo&quot;]
+  s.date = %q{2009-07-04}
+  s.email = %q{ceritium@gmail.com}
   s.extra_rdoc_files = [&quot;README.rdoc&quot;]
-  s.files = [&quot;README.rdoc&quot;, &quot;Rakefile&quot;, &quot;lib/lost_in_translation&quot;, &quot;lib/lost_in_translation/lost_in_translation.rb&quot;, &quot;lib/lost_in_translation/version.rb&quot;, &quot;lib/lost_in_translation.rb&quot;, &quot;test/test_helper.rb&quot;, &quot;test/unit&quot;, &quot;test/unit/lost_in_translation_test.rb&quot;]
+  s.files = [&quot;README.rdoc&quot;, &quot;Rakefile&quot;, &quot;lib/lost_in_translation&quot;, &quot;lib/lost_in_translation/lost_in_translation.rb&quot;, &quot;lib/lost_in_translation/string_to_hash.rb&quot;, &quot;lib/lost_in_translation/version.rb&quot;, &quot;lib/lost_in_translation.rb&quot;, &quot;test/test_helper.rb&quot;, &quot;test/unit&quot;, &quot;test/unit/lost_in_translation_test.rb&quot;]
   s.has_rdoc = true
-  s.homepage = %q{http://my-site.net}
+  s.homepage = %q{http://ceritium.net}
   s.rdoc_options = [&quot;--main&quot;, &quot;README.rdoc&quot;]
   s.require_paths = [&quot;lib&quot;]
   s.rubygems_version = %q{1.3.1}
-  s.summary = %q{This gem does ...}
+  s.summary = %q{Encuentra todas las traducciones de la API I18n de rails y las guarda en yaml}
 
   if s.respond_to? :specification_version then
     current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION</diff>
      <filename>lost-in-translation.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1fd72c64b7ea7a22063b0a583e95491a128a6239</id>
    </parent>
  </parents>
  <author>
    <name>Jos&#233; Galisteo Ruiz</name>
    <email>ceritium@gmail.com</email>
  </author>
  <url>http://github.com/ceritium/lost-in-translation/commit/df2018f7af355fd10c6d81e0479bc60b3342f0c5</url>
  <id>df2018f7af355fd10c6d81e0479bc60b3342f0c5</id>
  <committed-date>2009-07-04T05:52:51-07:00</committed-date>
  <authored-date>2009-07-04T05:52:51-07:00</authored-date>
  <message>sacada a otra clase los m&#233;todos que se encargaban de generar los yaml</message>
  <tree>a65bb53ff7d7031566874b7475e3816a65d044f6</tree>
  <committer>
    <name>Jos&#233; Galisteo Ruiz</name>
    <email>ceritium@gmail.com</email>
  </committer>
</commit>
