transdifflation 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .DS_Store
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
data/Fudgefile CHANGED
@@ -1,4 +1,4 @@
1
1
  build :default do
2
2
  yard :arguments => '-r YardREADME.md', :coverage => 100
3
- rspec :coverage => 96
3
+ rspec :coverage => 72
4
4
  end
data/Gemfile CHANGED
@@ -10,6 +10,7 @@ group :development, :test do
10
10
  gem 'rspec'
11
11
  gem 'yard'
12
12
  gem 'simplecov'
13
+ gem 'rake'
13
14
 
14
15
  gem 'rspec-rails'
15
16
  gem 'guard-sass', :require => false
data/README.md CHANGED
@@ -4,6 +4,8 @@ What is Transdifflation? Transdifflation is an acronym of 'Translation' and 'Dif
4
4
  It compares two .yml locate files, one in your source code (target) and one in others' (gems, other projects) source code (source) and generates a beside-file with the keys you hadn't translated yet.
5
5
  Then you can merge it. It is designed to detect changes between versions. By now, target file cannot be renamed, and it is generated in 'config/locales/' + to_locale (param in task). Names are inferred by the task params too.
6
6
 
7
+ Also, it has three new rake tasks to provide information to you about missing translations between two locales, and continuous integration support.
8
+
7
9
  IT NEVER CHANGES YOUR SOURCE FILE, unless it doesn't exists, so it creates for you.
8
10
 
9
11
  ## Installation
@@ -22,7 +24,9 @@ Or install it yourself as:
22
24
 
23
25
  ## Usage
24
26
 
25
- It needs a config file (**transdifflation.yml**) placed on your host root, or in 'lib/tasks'. Config file looks like:
27
+ ### How to configure your Rake tasks
28
+
29
+ It needs a config file (**transdifflation.yml**) placed on your host root, or in 'config'. If not exists, a rake task is set up to generate it: ```rake transdifflation:config```. Config file looks like:
26
30
 
27
31
  ```yml
28
32
  tasks:
@@ -58,9 +62,26 @@ These nodes generates rake tasks. There are two types of tasks:
58
62
 
59
63
  * type **file**: When it rans, it looks for the file in 'file_path_from_rails_root' is installed. It uses from_locale and to_locale to translate names and keys inside yaml. Tag_name is used to name target file in our host.
60
64
 
61
- Execute ```rake transdifflation:config``` to determine sucess of config file.
65
+ Also, you can create grouped tasks in a node called 'grouped_taks'. Task ```transdifflation:all``` is automatically generated.
66
+
67
+ Execute ```rake -T``` to determine sucess of config file. Your tasks should appear there, under namespace ```transdifflation:``
68
+
69
+
70
+ ### _'Out of the box'_ rake tasks
71
+
72
+ There are two new tasks in the town:
73
+
74
+ * ```rake transdifflation:lost_in_translation[from_locale,to_locale]```
75
+ * ```rake transdifflation:lost_in_translation_ci[from_locale,to_locale]```
76
+ * ```rake transdifflation:coverage[from_locale,to_locale]```
77
+
78
+ These tasks are intended to be used to know what keys are missing between two locales. ```rake transdifflation:lost_in_translation[from_locale,to_locale]``` creates a file in ```[Rails.root]/config/locales/[from_locale]/missing_translations.yml.diff```(on YAML format), that you can use as a template to fulfill your translation.
79
+
80
+ ```rake transdifflation:lost_in_translation_ci[from_locale,to_locale]``` doesn't create a file, it just fails if missing translations needed, so you can use it in a continuous integration environment, if you want to test that your translations are always completed between your third party gems' new versions, or other vendor's project new releases, or stuff like that...
81
+
82
+ ```rake transdifflation:coverage[from_locale,to_locale]``` gives you information and statistics of translations.
83
+
62
84
 
63
- Also, you can create grouped tasks in a node called 'grouped_taks'. Task **all** is automatially generated.
64
85
 
65
86
 
66
87
  ## Contributing
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
2
+ require 'bundler/gem_tasks'
3
3
  require 'rspec/core/rake_task'
4
+ Dir['lib/tasks/*'].each { |f| load f }
4
5
  RSpec::Core::RakeTask.new('spec')
@@ -0,0 +1,59 @@
1
+ require 'rails'
2
+
3
+
4
+ namespace :transdifflation do
5
+
6
+ def get_differences (from_locale, to_locale)
7
+
8
+ #this will access translations method, that is protected in BackEnd in I18n
9
+ translations = I18n.backend.send(:translations)
10
+ hash_from_locale = translations[from_locale]
11
+ hash_to_locale = translations[to_locale]
12
+
13
+ comparer = Transdifflation::Comparer.new
14
+ differences = comparer.get_rest_of_translation(hash_from_locale, hash_to_locale, from_locale, to_locale)
15
+ differences = { to_locale.to_s => differences } if !differences.empty?
16
+
17
+ end
18
+
19
+ desc "What is not translated in our app"
20
+ task :lost_in_translation, [:from_locale, :to_locale] => [:environment] do |t, args|
21
+
22
+
23
+ args.with_defaults(:from_locale => I18n.default_locale, :to_locale => I18n.locale)
24
+ puts "\nExecuting lost_in_translation ************************** "
25
+ from_locale = args[:from_locale].to_sym
26
+ to_locale = args[:to_locale].to_sym
27
+ differences = get_differences(from_locale, to_locale)
28
+
29
+ if !differences.empty?
30
+ missing_translations_file = File.join( Rails.root, "config/locales/#{to_locale}/missing_translations.yml.diff")
31
+ missing_translations_stream = File.new(missing_translations_file, "w+:UTF-8")
32
+ begin
33
+ missing_translations_stream.write("#These are the missing translations Transdifflation found for you\n")
34
+ missing_translations_stream.write(Transdifflation::YAMLWriter.to_yaml(differences)) #we can't use YAML#dump due to issues wuth Utf8 chars
35
+ puts "Detected missing translations, file '#{missing_translations_file}' has them:\n\n#{differences.to_yaml}" if !differences.empty?
36
+ ensure
37
+ missing_translations_stream.close
38
+ end
39
+
40
+ else
41
+ puts "Sucess! All translation are done!"
42
+ end
43
+ end
44
+
45
+ desc "Testing in CI what is not translated in our app"
46
+ task :lost_in_translation_ci, [:from_locale, :to_locale] => [:environment] do |t, args|
47
+
48
+ args.with_defaults(:from_locale => I18n.default_locale, :to_locale => I18n.locale)
49
+ puts "\nExecuting lost_in_translation_ci ************************** "
50
+
51
+ differences = get_differences(args[:from_locale].to_sym, args[:to_locale].to_sym)
52
+ fail "Detected missing translations: \n\n#{differences.to_yaml}" if !differences.empty?
53
+ puts "Sucess! All translation are done!"
54
+
55
+ end
56
+
57
+
58
+
59
+ end
@@ -0,0 +1,33 @@
1
+ require 'rails'
2
+
3
+
4
+ namespace :transdifflation do
5
+
6
+ def get_coverage_rate(from_locale, to_locale)
7
+ #this will access translations method, that is protected in BackEnd in I18n
8
+ translations = I18n.backend.send(:translations)
9
+ hash_from_locale = translations[from_locale]
10
+ hash_to_locale = translations[to_locale]
11
+
12
+ comparer = Transdifflation::Comparer.new
13
+ comparer.coverage_rate(hash_from_locale, hash_to_locale)
14
+
15
+ end
16
+
17
+ desc "A task to check a translation coverage"
18
+ task :coverage, [:from_locale, :to_locale] => [:environment] do |t, args|
19
+
20
+ args.with_defaults(:from_locale => I18n.default_locale, :to_locale => I18n.locale)
21
+ puts "\nChecking how much work you have left...\n"
22
+ from_locale = args[:from_locale].to_sym
23
+ to_locale = args[:to_locale].to_sym
24
+ #token = args[:token]
25
+
26
+ differences = get_coverage_rate(from_locale, to_locale)
27
+ puts "You have #{differences}"
28
+
29
+ end
30
+
31
+
32
+
33
+ end
@@ -4,6 +4,8 @@ require 'transdifflation/yaml_writer'
4
4
  require 'transdifflation/exceptions'
5
5
  require 'transdifflation/utilities'
6
6
 
7
+ require 'pry'
8
+
7
9
  # The main module for the program
8
10
  module Transdifflation
9
11
 
@@ -30,8 +32,9 @@ module Transdifflation
30
32
  def get_transdifflation_from_gem(gem_name, path_to_yaml_in_gem, from_locale=:en, to_locale=:es )
31
33
 
32
34
  #default values in optional params
33
- from_locale ||= :en
34
- to_locale ||= :es #sorry, this gem was developed in Spain :)
35
+ from_locale ||= I18n.default_locale
36
+ to_locale ||= I18n.locale
37
+
35
38
 
36
39
  yml_gem_content = YAMLReader.read_YAML_from_gem(gem_name, path_to_yaml_in_gem)
37
40
  puts "Loaded YAML content from gem '#{gem_name}', file '#{path_to_yaml_in_gem}'"
@@ -64,8 +67,8 @@ module Transdifflation
64
67
  def get_transdifflation_from_file(tag_name, path_to_yaml_relative_from_rails_root, from_locale=:en, to_locale=:es )
65
68
 
66
69
  #default values in optional params
67
- from_locale ||= :en
68
- to_locale ||= :es #sorry, this gem was developed in Spain :)
70
+ from_locale ||= I18n.default_locale
71
+ to_locale ||= I18n.locale
69
72
 
70
73
  yml_source_content = YAMLReader.read_YAML_from_pathfile(path_to_yaml_relative_from_rails_root)
71
74
  puts "Loaded YAML content from file '#{path_to_yaml_relative_from_rails_root}'"
@@ -87,10 +90,77 @@ module Transdifflation
87
90
  end
88
91
 
89
92
 
93
+ # Get Diff from YAML translation locale file from filesystem and generate differences in a file on our host
94
+ #
95
+ # @param [String] source I18n source translation to compare
96
+ # @param [String] target I18n target translation to compare
97
+ # @param [Symbol] from_locale Default locale in gem. Used to translate 'from'
98
+ # @param [Symbol] to_locale Default locale in host. Used to translate 'to'
99
+ def get_rest_of_translation(source, target, from_locale, to_locale)
100
+
101
+ added_diff_hash = {}
102
+ generate_added_diff(source, target, added_diff_hash, Array.new, from_locale, to_locale, false)
103
+ added_diff_hash.unsymbolize!
104
+ end
105
+
106
+
107
+ # Get Coverage rate from two hashes, depending on the number of keys that have a given token
108
+ #
109
+ # @param [Hash] hash_from_locale I18n source translation to compare
110
+ # @param [Hash] hash_to_locale I18n target translation to compare
111
+ # @param [String] token The string you want to compare. example: **NOT TRANSLATED**
112
+ def coverage_rate(hash_from_locale, hash_to_locale, token = NOT_TRANSLATED)
113
+
114
+ if hash_from_locale.nil?
115
+ return "Translation coverage error: from_locale language not detected."
116
+ end
90
117
 
118
+ if hash_to_locale.nil?
119
+ return "Translation coverage error: to_locale language not detected."
120
+ end
121
+
122
+ if hash_from_locale.empty?
123
+ return "from_locale is empty, so you have everything translated"
124
+ end
125
+
126
+ words = 0
127
+ found = 0
91
128
 
129
+ words, found = rate_from_branch(hash_from_locale, hash_to_locale, token, words, found)
130
+ percent = (found.to_f/words.to_f) * 100
131
+ truncate = "%.2f" % percent
132
+ return "#{truncate}% #{found}/#{words} entries translated"
133
+ end
92
134
 
93
135
 
136
+ # Get the number of translated keys
137
+ #
138
+ # @param [Hash] hash_from I18n source translation to compare
139
+ # @param [Hash] hash_to I18n target translation to compare
140
+ # @param [String] token The string you want to compare. example: **NOT TRANSLATED**
141
+ # @param [Integer] words Number of keys (accumulated) from hash_from
142
+ # @param [Integer] found Number of keys (accumulated) where token is not found in hash_to
143
+ def rate_from_branch(hash_from, hash_to, token, words, found)
144
+
145
+ hash_from.each_pair{ |key, value|
146
+ if hash_from[key.to_sym].instance_of? Hash
147
+ if hash_to[key.to_sym]
148
+ words, found = rate_from_branch(hash_from[key.to_sym], hash_to[key.to_sym], token, words, found)
149
+ else
150
+ # Sum other words
151
+ # could have nested branches, so we call it with hash_from[key.to_sym] to count the number of words, returning the found to a temporal var
152
+ words, temp = rate_from_branch(hash_from[key.to_sym], hash_from[key.to_sym], token, words, found)
153
+ end
154
+ else
155
+ words += 1
156
+ if hash_to[key.to_sym]
157
+ found += 1 if !hash_to[key.to_sym].to_s.include?(token)
158
+ end
159
+ end
160
+ }
161
+ return words, found
162
+ end
163
+
94
164
  private
95
165
 
96
166
  # Build the initial translation file
@@ -102,12 +172,10 @@ module Transdifflation
102
172
  def get_first_time_file(yml_source_content, host_target_file, from_locale, to_locale)
103
173
 
104
174
  puts "Target translation file '#{host_target_file}' not found, generating it for the first time"
105
-
106
175
  #create a file
107
176
  host_target_file_stream = File.open(host_target_file, "a+:UTF-8")
108
177
 
109
178
  begin
110
-
111
179
  translated_yaml = {}
112
180
  #translate from source yaml content, to target existant yml
113
181
  translate_keys_in_same_yaml(yml_source_content, translated_yaml, from_locale, to_locale)
@@ -115,10 +183,8 @@ module Transdifflation
115
183
  host_target_file_stream.write(YAMLWriter.to_yaml(translated_yaml))
116
184
  @has_changes = true
117
185
  ensure
118
-
119
186
  host_target_file_stream.close
120
187
  end
121
-
122
188
  end
123
189
 
124
190
 
@@ -140,13 +206,10 @@ module Transdifflation
140
206
 
141
207
  #if value is a hash, we call it recursively
142
208
  if (source_value.instance_of? Hash)
143
-
144
209
  if(!target.has_key? (source_key_translated))
145
210
  target[source_key_translated] = Hash.new
146
211
  end
147
-
148
212
  translate_keys_in_same_yaml(source_value, target[source_key_translated], from_locale, to_locale, add_NOT_TRANSLATED) #recurrence of other hashes
149
-
150
213
  else
151
214
  #it's a leaf node
152
215
  target[source_key_translated] = (add_NOT_TRANSLATED ? "#{NOT_TRANSLATED}#{source_value}" : "#{source_value}") if !target.has_key? (source_key_translated)
@@ -176,7 +239,7 @@ module Transdifflation
176
239
  diff_file = File.join(File.dirname(host_target_file), "#{File.basename(host_target_file)}.diff")
177
240
  diff_file_stream = File.new(diff_file, "w+:UTF-8")
178
241
  begin
179
-
242
+
180
243
  if (added_diff_hash.length > 0)
181
244
  diff_file_stream.write("ADDED KEYS (Keys not found in your file, founded in source file) ********************\n")
182
245
  diff_file_stream.write(YAMLWriter.to_yaml(added_diff_hash)) #we can't use YAML#dump due to issues wuth Utf8 chars
@@ -221,7 +284,7 @@ module Transdifflation
221
284
  if (source_value.instance_of? Hash)
222
285
  key_trace.push source_key_translated #add the key to the trace to be generated if necessary
223
286
  target[source_key_translated] = Hash.new if(!target.has_key? (source_key_translated)) #to continue trace, otherwise, node will not exist in next iteration
224
- generate_added_diff(source_value, target[source_key_translated], added_diff_hash, key_trace, from_locale, to_locale) #recursively call
287
+ generate_added_diff(source_value, target[source_key_translated], added_diff_hash, key_trace, from_locale, to_locale, add_NOT_TRANSLATED) #recursively call
225
288
  else #it's a leaf node
226
289
 
227
290
  if !target.has_key? (source_key_translated)
@@ -236,13 +299,8 @@ module Transdifflation
236
299
  }
237
300
  end
238
301
 
239
-
240
-
241
-
242
-
243
302
  def self.generate_config_example_file(path)
244
303
  FileUtils.copy(File.expand_path('./transdifflation/transdifflation.yml', File.dirname( __FILE__ )), path)
245
304
  end
246
-
247
305
  end
248
306
  end
@@ -1,15 +1,22 @@
1
- require 'transdifflation'
2
1
  require 'rails'
2
+ require 'transdifflation'
3
+
4
+
5
+
6
+
7
+
3
8
 
4
9
  module Transdifflation
5
10
 
6
11
  # Adds behaviours to Rails
7
12
  class Railtie < Rails::Railtie
8
13
  search_locations = %w[config/transdifflation.yml transdifflation.yml]
9
-
10
14
  railtie_name :transdifflation
11
15
  rake_tasks do
12
16
  begin
17
+
18
+ Dir[ File.join(File.dirname(__FILE__), '../tasks/*.rake')] .each { |f| load f } #Load static tasks
19
+
13
20
 
14
21
  file_task_config = nil
15
22
  search_locations.each do |path| #Take config file from these locations
@@ -91,7 +98,6 @@ module Transdifflation
91
98
  end
92
99
 
93
100
  rescue Transdifflation::ConfigFileNotFound
94
-
95
101
  #Generate task to set-up
96
102
  namespace :transdifflation do
97
103
  desc "Task to set-up config file in host"
@@ -4,7 +4,7 @@ module Transdifflation
4
4
 
5
5
  #Class used to convert all keys in a hash (included sub-hashes) in symbols
6
6
  class HashSymbolTranslator
7
- # Convert keys
7
+ # Convert keys (strings) into symbols
8
8
  def symbolize(hash)
9
9
  hash = hash.inject({}) { |memo,(k,v)|
10
10
  if(v.instance_of? Hash)
@@ -15,6 +15,19 @@ module Transdifflation
15
15
  }
16
16
  hash
17
17
  end
18
+ # Convert keys into string
19
+ def unsymbolize(hash)
20
+ hash = hash.inject({}) { |memo,(k,v)|
21
+ if(v.instance_of? Hash)
22
+ v = unsymbolize(v)
23
+ end
24
+ memo[k.to_s] = v
25
+ memo
26
+ }
27
+ hash
28
+ end
29
+
30
+
18
31
  end
19
32
  end
20
33
 
@@ -28,4 +41,12 @@ class Hash
28
41
  self.merge!(new_self)
29
42
  end
30
43
 
44
+ #convert all keys in a Hash (presumily from YAML) in symbols
45
+ def unsymbolize!
46
+ symbolizer = Transdifflation::HashSymbolTranslator.new
47
+ new_self = symbolizer.unsymbolize(self)
48
+ self.clear
49
+ self.merge!(new_self)
50
+ end
51
+
31
52
  end
@@ -1,4 +1,4 @@
1
1
  module Transdifflation
2
2
  # Gem version
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
@@ -18,7 +18,6 @@ module Transdifflation
18
18
 
19
19
  #read the yml content file
20
20
  get_YAML_content_from_YAML_file(yaml_file_in_gem_SRC)
21
-
22
21
  end
23
22
 
24
23
  # Get YAML content from a file in filesystem
@@ -33,7 +32,6 @@ module Transdifflation
33
32
 
34
33
  #read the yml content file
35
34
  get_YAML_content_from_YAML_file(yaml_file_path)
36
-
37
35
  end
38
36
 
39
37
  # Get YAML content from a file in filesystem
@@ -46,7 +44,7 @@ module Transdifflation
46
44
  raise ArgumentError.new("File '#{yaml_file_name}' does not exists in path '#{path_to_yaml}'") if (!File.file?(path_to_yaml))
47
45
 
48
46
  #read the yml content file
49
- get_YAML_content_from_YAML_file(path_to_yaml)
47
+ get_YAML_content_from_YAML_file(path_to_yaml)
50
48
  end
51
49
 
52
50
  private
@@ -8,7 +8,7 @@ module Transdifflation
8
8
  method = hash.respond_to?(:ya2yaml) ? :ya2yaml : :to_yaml
9
9
  string = hash.deep_stringify_keys.send(method)
10
10
  yaml_string = string.gsub("!ruby/symbol ", ":").sub("---","")
11
- yaml_string = yaml_string.gsub(/(\?) "([\w\s\\]+)"\n/) do |match|
11
+ yaml_string = yaml_string.gsub(/(\?) "([\w\s\\]+)"\n/) do |match| #Regex ? "es" \n
12
12
  match.sub(/\?\s+/, "").chomp
13
13
  end
14
14
  yaml_string = yaml_string.split("\n").map(&:rstrip).join("\n").strip
@@ -0,0 +1,7 @@
1
+ ADDED KEYS (Keys not found in your file, founded in source file) ********************
2
+ :es:
3
+ :home: ! '**NOT_TRANSLATED** hogar'
4
+
5
+ REMOVED KEYS (Keys not found in source file, founded in your file) ********************
6
+ :es:
7
+ :dorothy: Dorothy
@@ -0,0 +1,141 @@
1
+ require 'spec_helper'
2
+ require 'transdifflation'
3
+
4
+ describe :translation_coverage do
5
+ describe :coverage_rate do
6
+ it 'should return a message when hash_from_locale is an nil hash' do
7
+ @comparer = Transdifflation::Comparer.new
8
+ hash_from_locale = nil
9
+ hash_to_locale = {}
10
+ token = "**NOT TRANSLATED**"
11
+
12
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "Translation coverage error: from_locale language not detected."
13
+ end
14
+ it 'should return a message when hash_to_locale is an nil hash' do
15
+ @comparer = Transdifflation::Comparer.new
16
+ hash_from_locale = {}
17
+ hash_to_locale = nil
18
+ token = "**NOT TRANSLATED**"
19
+
20
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "Translation coverage error: to_locale language not detected."
21
+ end
22
+
23
+ it 'should return 100% when hash_from_locale is empty' do
24
+ @comparer = Transdifflation::Comparer.new
25
+ hash_from_locale = {}
26
+ hash_to_locale = {}
27
+ token = "**NOT TRANSLATED**"
28
+
29
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "from_locale is empty, so you have everything translated"
30
+ end
31
+
32
+ it 'should return 100% when hash_from_locale is empty, even if there is something at hash_to_locale' do
33
+ @comparer = Transdifflation::Comparer.new
34
+ hash_from_locale = {}
35
+ hash_to_locale = {:home => "hogar"}
36
+ token = "**NOT TRANSLATED**"
37
+
38
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "from_locale is empty, so you have everything translated"
39
+ end
40
+
41
+ it 'should return 0% when theres all to translate' do
42
+ @comparer = Transdifflation::Comparer.new
43
+ hash_from_locale = {:home => "home"}
44
+ hash_to_locale = {}
45
+ token = "**NOT TRANSLATED**"
46
+
47
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "0.00% 0/1 entries translated"
48
+ end
49
+
50
+ it 'should return 100% when you have everything translated (5/5)' do
51
+ @comparer = Transdifflation::Comparer.new
52
+ hash_from_locale = { :one => "one", :two => "two", :three => "tree", :four => "four", :five => "five" }
53
+ hash_to_locale = { :one => "uno", :two => "dos", :three => "tres", :four => "cuatro", :five => "cinco" }
54
+ token = "**NOT TRANSLATED**"
55
+
56
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "100.00% 5/5 entries translated"
57
+ end
58
+
59
+ it 'should return 80% when you have 8/10 terms translated' do
60
+ @comparer = Transdifflation::Comparer.new
61
+ hash_from_locale = { :one => "one", :two => "two", :three => "tree", :four => "four", :five => "five", :six => "six", :seven => "seven", :eight => "eight", :nine => "nine", :ten => "ten" }
62
+ hash_to_locale = { :one => "uno", :two => "dos", :three => "tres", :four => "cuatro", :five => "cinco", :six => "**NOT TRANSLATED** six", :seven => "**NOT TRANSLATED** seven", :eight => "ocho", :nine => "nueve", :ten => "diez" }
63
+ token = "**NOT TRANSLATED**"
64
+
65
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "80.00% 8/10 entries translated"
66
+ end
67
+
68
+
69
+ it 'should return 70% when you have 7/10 terms translated, but you dont have a term, even in the hash and 2 of them are not translated' do
70
+ @comparer = Transdifflation::Comparer.new
71
+ hash_from_locale = { :one => "one", :two => "two", :three => "tree", :four => "four", :five => "five", :six => "six", :seven => "seven", :eight => "eight", :nine => "nine", :ten => "ten" }
72
+ hash_to_locale = { :one => "uno", :two => "dos", :three => "tres", :four => "cuatro", :five => "cinco", :six => "**NOT TRANSLATED** six", :seven => "**NOT TRANSLATED** seven", :eight => "ocho", :nine => "nueve" }
73
+ token = "**NOT TRANSLATED**"
74
+
75
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "70.00% 7/10 entries translated"
76
+ end
77
+
78
+ it 'should return 62.50% when you have 5/8 terms translated' do
79
+ @comparer = Transdifflation::Comparer.new
80
+ hash_from_locale = { :one => "one", :two => "two", :three => "tree", :four => "four", :five => "five", :six => "six", :seven => "seven", :eight => "eight" }
81
+ hash_to_locale = { :one => "uno", :two => "**NOT TRANSLATED** two", :three => "tres", :four => "cuatro", :five => "cinco", :six => "**NOT TRANSLATED** six", :seven => "**NOT TRANSLATED** seven", :eight => "ocho"}
82
+ token = "**NOT TRANSLATED**"
83
+
84
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "62.50% 5/8 entries translated"
85
+ end
86
+
87
+ it 'should return 62.50% when you have 5/8 terms translated, having extra terms at the hash_to_locale hash' do
88
+ @comparer = Transdifflation::Comparer.new
89
+ hash_from_locale = { :one => "one", :two => "two", :three => "tree", :four => "four", :five => "five", :six => "six", :seven => "seven", :eight => "eight" }
90
+ hash_to_locale = { :one => "uno", :two => "**NOT TRANSLATED** two", :three => "tres", :four => "cuatro", :five => "cinco", :six => "**NOT TRANSLATED** six", :seven => "**NOT TRANSLATED** seven", :eight => "ocho", :puerta => "Puerta"}
91
+ token = "**NOT TRANSLATED**"
92
+
93
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "62.50% 5/8 entries translated"
94
+ end
95
+
96
+ it 'should return 100.00% in nested hash' do
97
+ @comparer = Transdifflation::Comparer.new
98
+ hash_from_locale = { :house => "house", :street => {:street_name => "street name", :postal => "postal code"}}
99
+ hash_to_locale = { :house => "casa", :street => {:street_name => "Nombre de la calle", :postal => "codigo postal"}}
100
+ token = "**NOT TRANSLATED**"
101
+
102
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "100.00% 3/3 entries translated"
103
+ end
104
+
105
+ it 'should return 3 entries, 2 translations found' do
106
+ @comparer = Transdifflation::Comparer.new
107
+ hash_from_locale = { :house => "house", :street => {:street_name => "street name", :postal => "postal code"}}
108
+ hash_to_locale = { :house => "casa", :street => {:street_name => "**NOT TRANSLATED** Nombre de la calle", :postal => "codigo postal"}}
109
+ token = "**NOT TRANSLATED**"
110
+
111
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "66.67% 2/3 entries translated"
112
+ end
113
+
114
+ it 'should return 0.00% in nested hash' do
115
+ @comparer = Transdifflation::Comparer.new
116
+ hash_from_locale = { :street => {:street_name => "**NOT TRANSLATED** Nombre de la calle", :postal => "codigo postal", :number => { :one => "one", :two => "two", :three => "tree"}}}
117
+ hash_to_locale = { :one => "uno"}
118
+ token = "**NOT TRANSLATED**"
119
+
120
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "0.00% 0/5 entries translated"
121
+ end
122
+
123
+ it 'should return 10.00% in nested hash' do
124
+ @comparer = Transdifflation::Comparer.new
125
+ hash_from_locale = { :one => "one", :two => "two", :three => "tree", :four => "four", :five => "five", :six => "six", :seven => "seven", :eight => "eight", :nine => "nine", :ten => "ten", :street => {:street_name => "**NOT TRANSLATED** Nombre de la calle", :postal => "codigo postal"}}
126
+ hash_to_locale = { :one => "uno"}
127
+ token = "**NOT TRANSLATED**"
128
+
129
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "8.33% 1/12 entries translated"
130
+ end
131
+
132
+ it 'should return 8.33% in nested hash with only one term' do
133
+ @comparer = Transdifflation::Comparer.new
134
+ hash_from_locale = { :one => "one", :two => "two", :three => "tree", :four => "four", :five => "five", :six => "six", :seven => "seven", :eight => "eight", :nine => "nine", :ten => "ten", :street => {:street_name => "Nombre de la calle", :postal => "codigo postal"}}
135
+ hash_to_locale = { :one => "uno"}
136
+ token = "**NOT TRANSLATED**"
137
+
138
+ @comparer.coverage_rate(hash_from_locale, hash_to_locale, token).should == "8.33% 1/12 entries translated"
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+ require 'transdifflation'
3
+
4
+ describe :lost_in_translation do
5
+
6
+ before (:each) do
7
+ @comparer = Transdifflation::Comparer.new
8
+ end
9
+
10
+ describe :inner_functionallity do
11
+ it 'should return no differences with same data' do
12
+ i18n = { :es => {:one_key => 'uno', :another_key => 'dos'} }
13
+ @comparer.get_rest_of_translation(i18n, i18n, :es, :es).should eql({})
14
+ end
15
+
16
+ it 'should return differences with different data' do
17
+ i18n_en = { :en => {:one_key => 'one', :another_key => 'another', :another_one => 'another_one_even'} }
18
+ i18n_es = { :es => {:one_key => 'uno', :another_key => 'dos'} }
19
+ @comparer.get_rest_of_translation(i18n_en, i18n_es, :en, :es).should eql( {"es" => {"another_one" => "another_one_even" }} )
20
+ end
21
+
22
+ it 'should return no differences if target has more info than source' do
23
+ i18n_en = { :en => {:one_key => 'one', :another_key => 'another'} }
24
+ i18n_es = { :es => {:one_key => 'uno', :another_key => 'dos', :another_one => 'tres'} }
25
+ @comparer.get_rest_of_translation(i18n_en, i18n_es, :en, :es).should eql({})
26
+ end
27
+ end
28
+ end
@@ -1,20 +1,274 @@
1
- # require 'spec_helper'
2
- # require 'transdifflation'
1
+ require 'spec_helper'
2
+ require_relative "../lib/transdifflation"
3
3
 
4
- #describe :get_transdifflation_from_gem do
5
- # it 'convert a key in a Hash (presumily from YAML) in symbol' do
6
- # gem_name = 'rake'
7
- # path_to_yaml_in_gem = '.'
8
- # from_locale= :en
9
- # to_locale = :es
10
- # Transdifflation::Comparer
11
- # end
12
- # xit 'another test' do
4
+ describe :get_transdifflation_from_gem do
13
5
 
6
+ before(:each) do
7
+ unless defined?(::Rails)
8
+ @mocked_rails_class = true
9
+ class ::Rails
10
+ end
11
+ end
14
12
 
15
- # end
13
+ @gem_name = 'rake'
14
+ @path_to_yaml_in_gem = 'spec/spec_helper.rb'
15
+ @from_locale= :en
16
+ @to_locale = :es
16
17
 
18
+ @comparer = Transdifflation::Comparer.new
17
19
 
20
+ #YAMLReader should returnb a valid hash
21
+ Transdifflation::YAMLReader.stub(:read_YAML_from_gem).and_return({es: {:home => "hogar"}})
22
+
23
+ #We require to simulate "Rails.root"
24
+ ::Rails.stub(:root).and_return('/rails')
25
+ end
26
+
27
+ it 'should call get_first_time_file if the files does not exist' do
28
+
29
+
30
+ #We actually don't care about basename, and we want to generate a testfile in our tests
31
+ File.stub(:basename).and_return('/dir/file_or_something')
32
+ File.stub(:join).and_return(File.join(File.dirname(__FILE__), '/assets/testfile'))
33
+
34
+ File.stub(:gsub).and_return('idontcare')
35
+
36
+ #File? Should return false, to simulate that the file is not created
37
+ File.stub(:file?).and_return(false)
38
+
39
+ @comparer = Transdifflation::Comparer.new
40
+ # And finally we are checking which method is being called, making them throw different exceptions
41
+ @comparer.stub(:get_first_time_file).and_raise(ArgumentError)
42
+ @comparer.stub(:generate_diff_file).and_raise(NameError)
43
+ @comparer.should_receive(:get_first_time_file)
44
+
45
+ expect {@comparer.get_transdifflation_from_gem(@gem_name, @path_to_yaml_in_gem, @from_locale, @to_locale) }.to raise_error(ArgumentError)
46
+ end
47
+
48
+ it 'should call generate_diff_file if the files exists' do
49
+
50
+ #We actually don't care about basename, and we want to generate a testfile in our tests
51
+ File.stub(:basename).and_return('/dir/file_or_something')
52
+ File.stub(:join).and_return(File.join(File.dirname(__FILE__), '/assets/testfile'))
53
+
54
+ File.stub(:gsub).and_return('idontcare')
55
+
56
+ #File? Should return true, to simulate that the file is exists
57
+ File.stub(:file?).and_return(true)
58
+
59
+ # And finally we are checking which method is being called, making them throw different exceptions
60
+ @comparer.stub(:get_first_time_file).and_raise(ArgumentError)
61
+ @comparer.stub(:generate_diff_file).and_raise(NameError)
62
+ @comparer.should_receive(:generate_diff_file)
63
+
64
+ expect {@comparer.get_transdifflation_from_gem(@gem_name, @path_to_yaml_in_gem, @from_locale, @to_locale) }.to raise_error(NameError)
65
+ end
66
+
67
+ it 'should translate yaml name from source locale to target locale' do
68
+
69
+ @path_to_yaml_in_gem = 'config/locales/en/gem_name.en.yml' #source file, it has to be translated, and match inner reg exp
70
+
71
+ #File? Should return true, to simulate that the file is exists
72
+ File.stub(:file?).and_return(true)
73
+ #Finally simulate the call to generate_diff_file
74
+ @comparer.stub(:generate_diff_file).and_return(nil)
75
+
76
+
77
+
78
+
79
+
80
+ #call to method
81
+ expect { @comparer.get_transdifflation_from_gem(@gem_name, @path_to_yaml_in_gem, @from_locale, @to_locale) }.to_not raise_error
82
+ end
83
+
84
+ end
85
+
86
+ describe :get_transdifflation_from_file do
87
+
88
+ before(:each) do
89
+ unless defined?(::Rails)
90
+ @mocked_rails_class = true
91
+ class ::Rails
92
+ end
93
+ end
94
+
95
+ @tag_name = 'my_tag'
96
+ @path_to_yaml_relative_from_rails_root = 'spec/spec_helper.rb'
97
+ @from_locale= :en
98
+ @to_locale = :es
99
+
100
+ @comparer = Transdifflation::Comparer.new
101
+
102
+ #YAMLReader should returnb a valid hash
103
+ Transdifflation::YAMLReader.stub(:read_YAML_from_pathfile).and_return({es: {:home => "hogar"}})
104
+
105
+ #We require to simulate "Rails.root"
106
+ ::Rails.stub(:root).and_return('/rails')
107
+
108
+ end
109
+
110
+ it 'should call get_first_time_file if the files does not exist' do
111
+
112
+
113
+ #We actually don't care about basename, and we want to generate a testfile in our tests
114
+ File.stub(:basename).and_return('/dir/file_or_something')
115
+ File.stub(:join).and_return('./spec/assets/testfile_path')
116
+ #We require to simulate "Rails.root"
117
+ ::Rails.should_receive(:root).and_return('/rails')
118
+ File.stub(:gsub).and_return('idontcare')
119
+ #File? Should return false, to simulate that the file is not created
120
+ File.stub(:file?).and_return(false)
121
+
122
+ # And finally we are checking which method is being called, making them throw different exceptions
123
+ @comparer.stub(:get_first_time_file).and_raise(ArgumentError)
124
+ @comparer.stub(:generate_diff_file).and_raise(NameError)
125
+ @comparer.should_receive(:get_first_time_file)
126
+ expect { @comparer.get_transdifflation_from_file(@tag_name, @path_to_yaml_relative_from_rails_root, @from_locale, @to_locale) }.to raise_error(ArgumentError)
127
+ end
128
+
129
+ it 'should call generate_diff_file if the files exists' do
130
+
131
+ #We actually don't care about basename, and we want to generate a testfile in our tests
132
+ File.stub(:basename).and_return('/dir/file_or_something')
133
+ File.stub(:join).and_return('./spec/assets/testfile')
134
+ #We require to simulate "Rails.root"
135
+ ::Rails.should_receive(:root).and_return('/rails')
136
+ File.stub(:gsub).and_return('idontcare')
137
+ #File? Should return false, to simulate that the file is not created
138
+ File.stub(:file?).and_return(true)
139
+
140
+ # And finally we are checking which method is being called, making them throw different exceptions
141
+ @comparer.stub(:get_first_time_file).and_raise(ArgumentError)
142
+ @comparer.stub(:generate_diff_file).and_raise(NameError)
143
+ @comparer.should_receive(:generate_diff_file)
144
+ expect { @comparer.get_transdifflation_from_file(@tag_name, @path_to_yaml_relative_from_rails_root, @from_locale, @to_locale) }.to raise_error(NameError)
145
+ end
146
+
147
+ it 'should translate yaml name from source locale to target locale' do
148
+
149
+ @path_to_yaml_relative_from_rails_root = '../config/locales/en/file_name.en.yml' #source file, it has to be translated, and match inner reg exp
150
+
151
+ #File? Should return true, to simulate that the file is exists
152
+ File.stub(:join).and_return('idontcare')
153
+ File.stub(:file?).and_return(true)
154
+ #Finally simulate the call to generate_diff_file
155
+ @comparer.stub(:generate_diff_file).and_return(nil)
156
+
157
+
158
+
159
+ #call to method
160
+ expect { @comparer.get_transdifflation_from_file(@tag_name, @path_to_yaml_relative_from_rails_root, @from_locale, @to_locale) }.to_not raise_error
161
+ end
162
+
163
+ end
164
+
165
+
166
+ describe :comparer_common_methods do
167
+
168
+ before(:each) do
169
+ unless defined?(::Rails)
170
+ @mocked_rails_class = true
171
+ class ::Rails
172
+ end
173
+ end
174
+
175
+ @gem_name = 'rake'
176
+ @path_to_yaml_in_gem = 'spec/spec_helper.rb'
177
+ @from_locale= :en
178
+ @to_locale = :es
179
+
180
+ @comparer = Transdifflation::Comparer.new
181
+
182
+ #YAMLReader should returnb a valid hash
183
+ Transdifflation::YAMLReader.stub(:read_YAML_from_gem).and_return({en: {:home => "hogar"}})
184
+
185
+
186
+ #We require to simulate "Rails.root"
187
+ ::Rails.stub(:root).and_return('/rails')
188
+ end
189
+
190
+ it 'should generate first timefile if the files does not exist' do
191
+
192
+
193
+ #We actually don't care about basename, and we want to generate a testfile in our tests
194
+ File.stub(:basename).and_return('config/locales/en/gem_name.en.yml')
195
+
196
+
197
+ #File? Should return false, to simulate that the file is not created
198
+ File.stub(:file?).and_return(false)
199
+
200
+
201
+ #now we must stub File.open, write and close in order to avoid fails on get_first_time_file
202
+ mock_file = mock("File")
203
+ mock_file.stub(:write).and_return(nil)
204
+ mock_file.stub(:close).and_return(nil)
205
+ File.stub(:open).and_return(mock_file)
206
+
207
+
208
+ expect {@comparer.get_transdifflation_from_gem(@gem_name, @path_to_yaml_in_gem, @from_locale, @to_locale) }.to_not raise_error
209
+ end
210
+
211
+ it 'should try to copy config_example_file if asked' do
212
+
213
+ FileUtils.stub(:copy).and_return(nil)
214
+ expect { Transdifflation::Comparer.generate_config_example_file('foo/bar') }.to_not raise_error
215
+ end
216
+
217
+ it 'should generate a valid diff_file when differences not exists' do
218
+
219
+ #We actually don't care about basename, and we want to generate a testfile in our tests
220
+ File.stub(:basename).and_return('/dir/file_or_something')
221
+ File.stub(:join).and_return('./spec/assets/testfile')
222
+ #We require to simulate "Rails.root"
223
+ ::Rails.should_receive(:root).and_return('/rails')
224
+ File.stub(:gsub).and_return('idontcare')
225
+ #File? Should return false, to simulate that the file is not created
226
+ File.stub(:file?).and_return(true)
227
+
228
+
229
+ #YAMLReader should return TWO valid hashes
230
+ Transdifflation::YAMLReader.stub(:read_YAML_from_pathfile).and_return( {es: {:dorothy => "Dorothy"}})
231
+
232
+ #now we must stub File.open, write and close in order to avoid fails on get_first_time_file
233
+ mock_file = mock("File")
234
+ mock_file.stub(:write).and_return(nil)
235
+ mock_file.stub(:close).and_return(nil)
236
+ File.stub(:open).and_return(mock_file)
237
+
238
+
239
+ expect { @comparer.get_transdifflation_from_gem(@gem_name, @path_to_yaml_in_gem, @from_locale, @to_locale) }.to_not raise_error
240
+
241
+
242
+ end
243
+
244
+ it 'should generate a clear diff_file when differences exists' do
245
+
246
+ #We actually don't care about basename, and we want to generate a testfile in our tests
247
+ File.stub(:basename).and_return('/dir/file_or_something')
248
+ File.stub(:join).and_return('./spec/assets/testfile')
249
+ #We require to simulate "Rails.root"
250
+ ::Rails.should_receive(:root).and_return('/rails')
251
+ File.stub(:gsub).and_return('idontcare')
252
+ #File? Should return false, to simulate that the file is not created
253
+ File.stub(:file?).and_return(true)
254
+
255
+
256
+ #now we must stub File.open, write and close in order to avoid fails on get_first_time_file
257
+ mock_file = mock("File")
258
+ mock_file.stub(:write).and_return(nil)
259
+ mock_file.stub(:close).and_return(nil)
260
+ File.stub(:open).and_return(mock_file)
261
+
262
+ #YAMLReader should return TWO valid hashes
263
+ Transdifflation::YAMLReader.stub(:read_YAML_from_pathfile).and_return({en: {:home => "hogar"}})
264
+
265
+
266
+ expect { @comparer.get_transdifflation_from_gem(@gem_name, @path_to_yaml_in_gem, @from_locale, @from_locale) }.to_not raise_error
267
+
268
+
269
+ end
270
+
271
+
272
+ end
18
273
 
19
274
 
20
- # end
@@ -10,18 +10,25 @@ describe :symbolize! do
10
10
  it 'convert all keys in a Hash (presumily from YAML) in symbols' do
11
11
  example_hash = { "es" => 666, "lala" => "truururur" }
12
12
  example_hash.symbolize!
13
- example_hash.should == { :es => 666, :lala => "truururur" }
13
+ example_hash.should == { :es => 666, :lala => "truururur" }
14
14
  end
15
15
 
16
16
  it 'convert all keys in a Hash (presumily from YAML) in symbols but if there is a hash it should leave it' do
17
17
  example_hash = { :es => 666, "lala" => "truururur" }
18
18
  example_hash.symbolize!
19
- example_hash.should == { :es => 666, :lala => "truururur" }
19
+ example_hash.should == { :es => 666, :lala => "truururur" }
20
20
  end
21
21
 
22
22
  it 'should return something usefull on nil' do
23
23
  example_hash = Hash.new
24
24
  example_hash.symbolize!
25
- example_hash.should == {}
25
+ example_hash.should == {}
26
+ end
27
+
28
+ it 'should call itself recursively' do
29
+ example_hash = { :es => 666, "lala" => "truururur", :nested => {:another => "Call for simbolize"}}
30
+ hash_translator = Transdifflation::HashSymbolTranslator.new
31
+ hash_translator.symbolize(example_hash)
32
+ example_hash.should == { :es => 666, "lala" => "truururur", :nested => {:another => "Call for simbolize"}}
26
33
  end
27
34
  end
@@ -26,6 +26,7 @@ describe :YAMLReader do
26
26
  File.stub(:file?).and_return(true)
27
27
  ::Rails.should_receive(:root).and_return('/rails')
28
28
 
29
+
29
30
  expect {Transdifflation::YAMLReader.read_YAML_from_filesystem('whatever')}.to_not raise_error(ArgumentError)
30
31
  end
31
32
  end
@@ -84,4 +85,4 @@ describe :YAMLReader do
84
85
  end
85
86
  end
86
87
 
87
- end
88
+ end
@@ -12,6 +12,14 @@ describe :YAMLWriter do
12
12
  hashy = {:movie => "Avengers"}
13
13
  Transdifflation::YAMLWriter.to_yaml(hashy).should be == ":movie: Avengers"
14
14
  end
15
+
16
+ it 'should chomp if matches with the regex: /\?\s+/' do
17
+ hashy = {:movie => "Avengers"}
18
+ Regex = "!ruby/symbol ---? \"es\"\n"
19
+ hashy.deep_stringify_keys.stub(:send).and_return(Regex)
20
+
21
+ Transdifflation::YAMLWriter.to_yaml(hashy).should be == ":\"es\""
22
+ end
15
23
  end
16
24
 
17
25
  describe :deep_stringify_keys do
@@ -19,6 +27,12 @@ describe :YAMLWriter do
19
27
  hashy = {:en=>{:date=>{:formats=>{:default=>"%d/%m/%Y", :short=>"%d %b"}}}}
20
28
  hashy.deep_stringify_keys.should == {:en=>{:date=>{:formats=>{:default=>"%d/%m/%Y", :short=>"%d %b"}}}}
21
29
  end
30
+
31
+ it 'should print all the nodes from a hash in the exact same order' do
32
+ hashy = {:en=>{:date=>{:formats=>{:default=>"%d/%m/%Y", :short=>"%d %b"}}}}
33
+ hashy.deep_stringify_keys.should == hashy
34
+ end
35
+
22
36
  it 'should print all the nodes from a hash in the exact same order' do
23
37
  hashy = {:en=>{:date=>{:formats=>{:default=>"%d/%m/%Y", :short=>"%d %b"}}}}
24
38
  hashy.deep_stringify_keys.should == hashy
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = "transdifflation"
15
15
  gem.require_paths = ["lib"]
16
- gem.version = "0.0.1"
16
+ gem.version = Transdifflation::VERSION
17
17
 
18
18
  #Dependencies
19
19
  gem.add_dependency 'rails', '~> 3.2.8'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transdifflation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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: 2012-10-11 00:00:00.000000000 Z
12
+ date: 2012-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -185,6 +185,8 @@ files:
185
185
  - LICENSE
186
186
  - README.md
187
187
  - Rakefile
188
+ - lib/tasks/lost_in_translation.rake
189
+ - lib/tasks/translation_coverage.rake
188
190
  - lib/transdifflation.rb
189
191
  - lib/transdifflation/exceptions.rb
190
192
  - lib/transdifflation/railtie.rb
@@ -193,6 +195,9 @@ files:
193
195
  - lib/transdifflation/version.rb
194
196
  - lib/transdifflation/yaml_reader.rb
195
197
  - lib/transdifflation/yaml_writer.rb
198
+ - spec/assets/testfile
199
+ - spec/coverage_spec.rb
200
+ - spec/lost_in_translation_spec.rb
196
201
  - spec/spec_helper.rb
197
202
  - spec/transdifflation_spec.rb
198
203
  - spec/utilities_spec.rb
@@ -225,6 +230,9 @@ specification_version: 3
225
230
  summary: Compares yml locate files with yours and generate diff files to maintain
226
231
  gems or adjacent projects
227
232
  test_files:
233
+ - spec/assets/testfile
234
+ - spec/coverage_spec.rb
235
+ - spec/lost_in_translation_spec.rb
228
236
  - spec/spec_helper.rb
229
237
  - spec/transdifflation_spec.rb
230
238
  - spec/utilities_spec.rb