wwwjdic 14.0.0 → 15.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +19 -0
  3. data/Gemfile +5 -1
  4. data/README.md +461 -192
  5. data/Rakefile +7 -2
  6. data/copyright.md +17 -29
  7. data/examples/basics.rb +51 -45
  8. data/examples/translate.rb +135 -86
  9. data/examples/uri.rb +34 -78
  10. data/html/CHANGELOG.html +48 -31
  11. data/html/COPYING_md.html +31 -35
  12. data/html/Gemfile.html +28 -32
  13. data/html/Object.html +71 -71
  14. data/html/README_md.html +326 -159
  15. data/html/Rakefile.html +29 -33
  16. data/html/WWWJDic.html +137 -98
  17. data/html/WWWJDic/ParsableDuckType.html +55 -55
  18. data/html/WWWJDic/Parser.html +88 -88
  19. data/html/WWWJDic/Parsers.html +33 -33
  20. data/html/WWWJDic/Parsers/Dict.html +71 -73
  21. data/html/WWWJDic/Parsers/Display.html +66 -66
  22. data/html/WWWJDic/Parsers/Key.html +67 -67
  23. data/html/WWWJDic/Parsers/Search.html +59 -58
  24. data/html/WWWJDic/Parsers/Server.html +66 -66
  25. data/html/WWWJDic/Splitter.html +173 -172
  26. data/html/WWWJDic/Utils.html +34 -34
  27. data/html/WWWJDic/Utils/Downloader.html +33 -33
  28. data/html/WWWJDic/Utils/Downloader/Downloader.html +91 -89
  29. data/html/WWWJDic/Utils/Raisers.html +95 -95
  30. data/html/WWWJDic/WWWJDic.html +343 -345
  31. data/html/copyright_md.html +37 -51
  32. data/html/created.rid +55 -57
  33. data/html/index.html +334 -164
  34. data/html/js/darkfish.js +84 -84
  35. data/html/js/navigation.js.gz +0 -0
  36. data/html/js/search.js +110 -110
  37. data/html/js/search_index.js +1 -1
  38. data/html/js/search_index.js.gz +0 -0
  39. data/html/js/searcher.js +229 -229
  40. data/html/js/searcher.js.gz +0 -0
  41. data/html/table_of_contents.html +44 -75
  42. data/lib/wwwjdic.rb +7 -11
  43. data/lib/wwwjdic/application.rb +13 -7
  44. data/lib/wwwjdic/constants.rb +16 -8
  45. data/lib/wwwjdic/locales/de.yml +5 -4
  46. data/lib/wwwjdic/locales/en.yml +5 -4
  47. data/lib/wwwjdic/locales/es.yml +5 -4
  48. data/lib/wwwjdic/locales/fr.yml +6 -4
  49. data/lib/wwwjdic/locales/hu.yml +6 -4
  50. data/lib/wwwjdic/locales/it.yml +6 -4
  51. data/lib/wwwjdic/locales/ja.yml +8 -4
  52. data/lib/wwwjdic/locales/nl.yml +5 -4
  53. data/lib/wwwjdic/locales/ru.yml +5 -4
  54. data/lib/wwwjdic/locales/sl.yml +5 -4
  55. data/lib/wwwjdic/locales/sv.yml +5 -4
  56. data/lib/wwwjdic/parser.rb +8 -4
  57. data/lib/wwwjdic/parsers/dict.rb +9 -7
  58. data/lib/wwwjdic/parsers/display.rb +6 -2
  59. data/lib/wwwjdic/parsers/key.rb +8 -3
  60. data/lib/wwwjdic/parsers/search.rb +8 -3
  61. data/lib/wwwjdic/parsers/server.rb +6 -2
  62. data/lib/wwwjdic/utils/downloader.rb +21 -23
  63. data/lib/wwwjdic/utils/raisers.rb +7 -3
  64. data/lib/wwwjdic/utils/splitter.rb +20 -14
  65. data/lib/wwwjdic/version.rb +2 -6
  66. data/test/test_helper.rb +5 -1
  67. data/test/test_wwwjdic.rb +6 -2
  68. data/test/wwwjdic/locales/de.yml +7 -1
  69. data/test/wwwjdic/locales/en.yml +7 -1
  70. data/test/wwwjdic/locales/es.yml +7 -1
  71. data/test/wwwjdic/locales/fr.yml +7 -1
  72. data/test/wwwjdic/locales/hu.yml +7 -1
  73. data/test/wwwjdic/locales/it.yml +10 -3
  74. data/test/wwwjdic/locales/ja.yml +9 -2
  75. data/test/wwwjdic/locales/nl.yml +7 -1
  76. data/test/wwwjdic/locales/ru.yml +7 -1
  77. data/test/wwwjdic/locales/sl.yml +7 -1
  78. data/test/wwwjdic/locales/sv.yml +7 -1
  79. data/test/wwwjdic/locales/test_locales.rb +12 -9
  80. data/test/wwwjdic/parsers/test_dict.rb +6 -2
  81. data/test/wwwjdic/parsers/test_display.rb +6 -2
  82. data/test/wwwjdic/parsers/test_key.rb +6 -2
  83. data/test/wwwjdic/parsers/test_server.rb +6 -2
  84. data/test/wwwjdic/test_application.rb +12 -8
  85. data/test/wwwjdic/test_parsable_duck_type.rb +6 -2
  86. data/test/wwwjdic/utils/test_downloader.rb +5 -1
  87. data/test/wwwjdic/utils/test_raisers.rb +10 -6
  88. data/wwwjdic.gemspec +30 -14
  89. metadata +50 -22
  90. data/acknowledgements.md +0 -55
  91. data/authors.md +0 -67
  92. data/html/acknowledgements_md.html +0 -150
  93. data/html/authors_md.html +0 -182
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # wwwjdic
3
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
4
4
  #
5
5
  # This file is part of wwwjdic.
6
6
  #
@@ -16,6 +16,10 @@
16
16
  #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
19
23
  #++
20
24
 
21
25
 
@@ -28,7 +32,7 @@ module WWWJDic
28
32
  # methods...
29
33
  #
30
34
  # Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
31
- # Copyright:: Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
35
+ # Copyright:: (C) 2014 Marco Bresciani
32
36
  # License:: GNU General Public License version 3
33
37
  module Utils
34
38
 
@@ -36,7 +40,7 @@ module WWWJDic
36
40
  # to (possibly) common conditions.
37
41
  #
38
42
  # Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
39
- # Copyright:: Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
43
+ # Copyright:: (C) 2014 Marco Bresciani
40
44
  # License:: GNU General Public License version 3
41
45
  module Raisers
42
46
 
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # wwwjdic
3
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
4
4
  #
5
5
  # This file is part of wwwjdic.
6
6
  #
@@ -16,6 +16,10 @@
16
16
  #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
19
23
  #++
20
24
 
21
25
  require 'i18n'
@@ -27,7 +31,7 @@ module WWWJDic
27
31
  # This class is a simple API to interact with WWWJDic Backboor
28
32
  # Entry/API.
29
33
  # Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
30
- # Copyright:: Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
34
+ # Copyright:: (C) 2014 Marco Bresciani
31
35
  # License:: GNU General Public License version 3
32
36
  class Splitter
33
37
  # Creates a +Splitter+ object.
@@ -39,20 +43,21 @@ module WWWJDic
39
43
  end
40
44
 
41
45
  def title
42
- $1 if /<TITLE>(.*)<\/TITLE>/.match @translation
46
+ Regexp.last_match(1) if %r{<TITLE>(.*)</TITLE>}.match @translation
43
47
  end
44
48
 
45
49
  def translation
46
- $1.strip if /<pre>(.*)<\/pre>/m.match @translation
50
+ Regexp.last_match(1).strip if %r{<pre>(.*)</pre>}m.match @translation
47
51
  end
48
52
 
49
53
  def message
50
- return $1.strip if /<p>(.*)<p>/m.match @translation unless @translation.nil?
51
- $1 if /<p>(.*)<pre>/m.match @translation if @translation.nil?
54
+ return Regexp.last_match(1).strip unless @translation.nil? || !/<p>(.*)<p>/m.match(@translation)
55
+
56
+ Regexp.last_match(1) if @translation.nil? && /<p>(.*)<pre>/m.match(@translation)
52
57
  end
53
58
 
54
59
  def lines
55
- result = Array.new
60
+ result = []
56
61
  translation.each_line do |a_line|
57
62
  stripped_line = a_line.strip
58
63
  result.push stripped_line unless stripped_line.empty?
@@ -60,18 +65,19 @@ module WWWJDic
60
65
  result unless result.empty?
61
66
  end
62
67
 
68
+ # @return [Array] the arrays of elements containing the answer
63
69
  def content
64
- result = Array.new
70
+ result = []
65
71
  lines.each do |a_line|
66
- inner = Hash.new
72
+ inner = {}
67
73
  if /(.*)\[/m.match a_line
68
- inner[:word] = $1.strip
69
- inner[:kana] = $1.strip if /\[(.*)\]/m.match a_line
70
- inner[:text] = $1.strip if /\] \/(.*)\//m.match a_line
74
+ inner[:word] = Regexp.last_match(1).strip
75
+ inner[:kana] = Regexp.last_match(1).strip if /\[(.*)\]/m.match a_line
76
+ inner[:text] = Regexp.last_match(1).strip if %r{\] /(.*)/}m.match a_line
71
77
  else
72
- inner[:kana] = $1.strip if /^(.*)(\s)\//m.match a_line
78
+ inner[:kana] = Regexp.last_match(1).strip if %r{^(.*)(\s)/}m.match a_line
73
79
  inner[:word] = inner[:kana]
74
- inner[:text] = $1.strip if /\/(.*)\//m.match a_line
80
+ inner[:text] = Regexp.last_match(1).strip if %r{/(.*)/}m.match a_line
75
81
  end
76
82
  inner[:meanings] = inner[:text].split('/') if inner[:text].include? '/'
77
83
  result.push inner unless inner.empty?
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # wwwjdic
3
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
4
4
  #
5
5
  # This file is part of wwwjdic.
6
6
  #
@@ -18,11 +18,7 @@
18
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
19
  #++
20
20
 
21
- require 'digest/md5'
22
- require 'i18n'
23
- require 'uri'
24
-
25
21
  module WWWJDic
26
22
  # Current version number for WWWJDic gem.
27
- VERSION = '14.0.0'
23
+ VERSION = '15.0.0'.freeze
28
24
  end
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # wwwjdic
3
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
4
4
  #
5
5
  # This file is part of wwwjdic.
6
6
  #
@@ -16,6 +16,10 @@
16
16
  #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
19
23
  #++
20
24
 
21
25
  require 'simplecov'
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # wwwjdic
3
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
4
4
  #
5
5
  # This file is part of wwwjdic.
6
6
  #
@@ -16,13 +16,17 @@
16
16
  #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
19
23
  #++
20
24
 
21
25
  require_relative 'test_helper'
22
26
 
23
27
  describe WWWJDic::WWWJDic do
24
28
  describe 'when created' do
25
- subject { WWWJDic::breener }
29
+ subject { WWWJDic.breener }
26
30
 
27
31
  it 'must create a wwwjdic object' do
28
32
  _(subject).wont_be_nil
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  de:
20
26
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  en:
20
26
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  es:
20
26
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  fr:
20
26
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  hu:
20
26
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,7 +16,13 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  it:
20
- kotoba: parola
21
- test: dato di prova
26
+ test:
27
+ kotoba: parola
28
+ test: dato di prova
@@ -1,6 +1,7 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2013 新部裕
3
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 新部裕, Marco Bresciani
3
+ # © 2013 新部裕
4
+ # © 2014 Marco Bresciani
4
5
  #
5
6
  # This file is part of wwwjdic.
6
7
  #
@@ -16,6 +17,12 @@
16
17
  #
17
18
  # You should have received a copy of the GNU General Public License
18
19
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
20
+ #
21
+ # SPDX-FileCopyrightText: 2013 新部裕
22
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
23
+ #
24
+ # SPDX-License-Identifier: GPL-3.0-or-later
25
+ #++
19
26
 
20
27
  ja:
21
28
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  nl:
20
26
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  ru:
20
26
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  sl:
20
26
  test:
@@ -1,5 +1,6 @@
1
+ #--
1
2
  # wwwjdic
2
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
3
4
  #
4
5
  # This file is part of wwwjdic.
5
6
  #
@@ -15,6 +16,11 @@
15
16
  #
16
17
  # You should have received a copy of the GNU General Public License
17
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
23
+ #++
18
24
 
19
25
  sv:
20
26
  test:
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # wwwjdic
3
- # Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
3
+ # © 2014 Marco Bresciani
4
4
  #
5
5
  # This file is part of wwwjdic.
6
6
  #
@@ -16,15 +16,18 @@
16
16
  #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ # SPDX-FileCopyrightText: 2014 Marco Bresciani
21
+ #
22
+ # SPDX-License-Identifier: GPL-3.0-or-later
19
23
  #++
20
24
 
21
25
  require_relative '../../test_helper'
22
26
 
27
+ RELATIVE_PATH = './'.freeze
28
+
23
29
  describe WWWJDic::WWWJDic do
24
30
  describe 'when using I18N' do
25
-
26
- RELATIVE_PATH = '/../../../lib/wwwjdic/locales/'
27
-
28
31
  before do
29
32
  I18n.load_path = Dir[File.join(File.dirname(__FILE__), RELATIVE_PATH, '*.yml')]
30
33
  end
@@ -43,22 +46,22 @@ describe WWWJDic::WWWJDic do
43
46
 
44
47
  it 'shall contain a test.test signpost for each available locale' do
45
48
  def load_yaml_file(locale)
46
- filename = File::join(File::dirname(__FILE__), RELATIVE_PATH, "#{locale}.yml")
47
- filename = File::expand_path filename
48
- YAML::load(File::open "#{filename}")
49
+ filename = File.join(File.dirname(__FILE__), RELATIVE_PATH, "#{locale}.yml")
50
+ filename = File.expand_path filename
51
+ YAML.safe_load(File.open(filename.to_s))
49
52
  end
50
53
 
51
54
  subject.each do |locale|
52
55
  I18n.locale = locale
53
56
 
54
57
  translation = load_yaml_file(locale)
55
- _(translation["#{locale}"]['test']['test']).wont_be_nil
58
+ _(translation[locale.to_s]['test']['test']).wont_be_nil
56
59
 
57
60
  a_string = I18n.t('test.test')
58
61
  _(a_string).wont_be_nil
59
62
  _(a_string).wont_be_empty
60
63
  _(a_string).wont_include 'translation missing'
61
- _(a_string).must_equal translation["#{locale}"]['test']['test']
64
+ _(a_string).must_equal translation[locale.to_s]['test']['test']
62
65
  end
63
66
  end
64
67
  end