wwwjdic 13.0.0 → 16.0.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG +63 -1
- data/Gemfile +9 -1
- data/README.md +499 -225
- data/Rakefile +12 -3
- data/copyright.md +17 -29
- data/examples/basics.rb +55 -45
- data/examples/translate.rb +161 -86
- data/examples/uri.rb +50 -78
- data/html/CHANGELOG.html +80 -21
- data/html/COPYING_md.html +13 -24
- data/html/Gemfile.html +12 -21
- data/html/Object.html +810 -45
- data/html/README_md.html +309 -161
- data/html/Rakefile.html +15 -24
- data/html/WWWJDic.html +41 -81
- data/html/WWWJDic/ParsableDuckType.html +15 -34
- data/html/WWWJDic/Parser.html +25 -64
- data/html/WWWJDic/Parsers.html +8 -13
- data/html/WWWJDic/Parsers/Dict.html +29 -54
- data/html/WWWJDic/Parsers/Display.html +24 -47
- data/html/WWWJDic/Parsers/Key.html +25 -48
- data/html/WWWJDic/Parsers/Search.html +19 -38
- data/html/WWWJDic/Parsers/Server.html +24 -47
- data/html/WWWJDic/Splitter.html +49 -142
- data/html/WWWJDic/Utils.html +9 -14
- data/html/WWWJDic/Utils/Downloader.html +8 -13
- data/html/WWWJDic/Utils/Downloader/Downloader.html +29 -63
- data/html/WWWJDic/Utils/Raisers.html +21 -72
- data/html/WWWJDic/WWWJDic.html +131 -312
- data/html/copyright_md.html +206 -225
- data/html/created.rid +33 -58
- data/html/css/rdoc.css +35 -6
- data/html/index.html +301 -169
- data/html/js/darkfish.js +22 -99
- data/html/js/navigation.js +4 -40
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +32 -31
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +6 -6
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +160 -197
- data/lib/wwwjdic.rb +16 -15
- data/lib/wwwjdic/application.rb +69 -36
- data/lib/wwwjdic/constants.rb +48 -10
- data/lib/wwwjdic/locales/de.yml +9 -4
- data/lib/wwwjdic/locales/en.yml +9 -4
- data/lib/wwwjdic/locales/es.yml +9 -4
- data/lib/wwwjdic/locales/fr.yml +9 -4
- data/lib/wwwjdic/locales/hu.yml +9 -4
- data/lib/wwwjdic/locales/it.yml +9 -4
- data/lib/wwwjdic/locales/ja.yml +11 -5
- data/lib/wwwjdic/locales/nl.yml +9 -4
- data/lib/wwwjdic/locales/ru.yml +9 -4
- data/lib/wwwjdic/locales/sl.yml +9 -4
- data/lib/wwwjdic/locales/sv.yml +9 -4
- data/lib/wwwjdic/parser.rb +15 -8
- data/lib/wwwjdic/parsers/dict.rb +13 -8
- data/lib/wwwjdic/parsers/display.rb +10 -3
- data/lib/wwwjdic/parsers/key.rb +11 -3
- data/lib/wwwjdic/parsers/search.rb +12 -3
- data/lib/wwwjdic/parsers/server.rb +10 -3
- data/lib/wwwjdic/utils/downloader.rb +27 -30
- data/lib/wwwjdic/utils/raisers.rb +14 -15
- data/lib/wwwjdic/utils/splitter.rb +33 -18
- data/lib/wwwjdic/version.rb +28 -20
- data/test/test_helper.rb +12 -1
- data/test/test_wwwjdic.rb +12 -4
- data/test/wwwjdic/locales/de.yml +9 -1
- data/test/wwwjdic/locales/en.yml +9 -1
- data/test/wwwjdic/locales/es.yml +9 -1
- data/test/wwwjdic/locales/fr.yml +9 -1
- data/test/wwwjdic/locales/hu.yml +9 -1
- data/test/wwwjdic/locales/it.yml +10 -1
- data/test/wwwjdic/locales/ja.yml +11 -2
- data/test/wwwjdic/locales/nl.yml +9 -1
- data/test/wwwjdic/locales/ru.yml +9 -1
- data/test/wwwjdic/locales/sl.yml +9 -1
- data/test/wwwjdic/locales/sv.yml +9 -1
- data/test/wwwjdic/locales/test_locales.rb +43 -24
- data/test/wwwjdic/parsers/test_dict.rb +67 -37
- data/test/wwwjdic/parsers/test_display.rb +13 -5
- data/test/wwwjdic/parsers/test_key.rb +12 -4
- data/test/wwwjdic/parsers/test_server.rb +13 -5
- data/test/wwwjdic/test_application.rb +201 -149
- data/test/wwwjdic/test_parsable_duck_type.rb +11 -6
- data/test/wwwjdic/utils/test_downloader.rb +9 -1
- data/test/wwwjdic/utils/test_raisers.rb +48 -29
- data/wwwjdic.gemspec +46 -26
- metadata +55 -43
- data/acknowledgements.md +0 -55
- data/authors.md +0 -67
- data/html/acknowledgements_md.html +0 -149
- data/html/authors_md.html +0 -181
- data/html/js/jquery.js +0 -4
- data/html/wwwjdic_gemspec.html +0 -161
data/lib/wwwjdic/locales/hu.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
#--
|
1
2
|
# wwwjdic
|
2
|
-
#
|
3
|
+
# rubocop:disable Style/AsciiComments
|
4
|
+
# © 2014 Marco Bresciani
|
5
|
+
# rubocop:enable Style/AsciiComments
|
3
6
|
#
|
4
7
|
# This file is part of wwwjdic.
|
5
8
|
#
|
@@ -15,6 +18,11 @@
|
|
15
18
|
#
|
16
19
|
# You should have received a copy of the GNU General Public License
|
17
20
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
#
|
22
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
23
|
+
#
|
24
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
25
|
+
#++
|
18
26
|
|
19
27
|
hu:
|
20
28
|
error:
|
@@ -24,6 +32,3 @@ hu:
|
|
24
32
|
value: "Érték %{value} nem a megengedett tartományban."
|
25
33
|
warn:
|
26
34
|
deprecated: Ez a módszer már elavult.
|
27
|
-
test:
|
28
|
-
kotoba: hír
|
29
|
-
test: test data
|
data/lib/wwwjdic/locales/it.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
#--
|
1
2
|
# wwwjdic
|
2
|
-
#
|
3
|
+
# rubocop:disable Style/AsciiComments
|
4
|
+
# © 2014 Marco Bresciani
|
5
|
+
# rubocop:enable Style/AsciiComments
|
3
6
|
#
|
4
7
|
# This file is part of wwwjdic.
|
5
8
|
#
|
@@ -15,6 +18,11 @@
|
|
15
18
|
#
|
16
19
|
# You should have received a copy of the GNU General Public License
|
17
20
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
#
|
22
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
23
|
+
#
|
24
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
25
|
+
#++
|
18
26
|
|
19
27
|
it:
|
20
28
|
error:
|
@@ -24,6 +32,3 @@ it:
|
|
24
32
|
value: "Il valore %{value} non è nell'intervallo previsto."
|
25
33
|
warn:
|
26
34
|
deprecated: Questo metodo è obsoleto.
|
27
|
-
test:
|
28
|
-
kotoba: parola
|
29
|
-
test: dato di prova
|
data/lib/wwwjdic/locales/ja.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
#--
|
1
2
|
# wwwjdic
|
2
|
-
#
|
3
|
-
#
|
3
|
+
# © 2013 新部裕
|
4
|
+
# rubocop:disable Style/AsciiComments
|
5
|
+
# © 2014 Marco Bresciani
|
6
|
+
# rubocop:enable Style/AsciiComments
|
4
7
|
#
|
5
8
|
# This file is part of wwwjdic.
|
6
9
|
#
|
@@ -16,6 +19,12 @@
|
|
16
19
|
#
|
17
20
|
# You should have received a copy of the GNU General Public License
|
18
21
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
22
|
+
#
|
23
|
+
# SPDX-FileCopyrightText: 2013 新部裕
|
24
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
25
|
+
#
|
26
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
27
|
+
#++
|
19
28
|
|
20
29
|
ja:
|
21
30
|
error:
|
@@ -25,6 +34,3 @@ ja:
|
|
25
34
|
value: "値 %{value} が範囲外です。"
|
26
35
|
warn:
|
27
36
|
deprecated: このメソッドはすでに廃止され、推奨されていません。
|
28
|
-
test:
|
29
|
-
kotoba: 言葉
|
30
|
-
test: 試験データ
|
data/lib/wwwjdic/locales/nl.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
#--
|
1
2
|
# wwwjdic
|
2
|
-
#
|
3
|
+
# rubocop:disable Style/AsciiComments
|
4
|
+
# © 2014 Marco Bresciani
|
5
|
+
# rubocop:enable Style/AsciiComments
|
3
6
|
#
|
4
7
|
# This file is part of wwwjdic.
|
5
8
|
#
|
@@ -15,6 +18,11 @@
|
|
15
18
|
#
|
16
19
|
# You should have received a copy of the GNU General Public License
|
17
20
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
#
|
22
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
23
|
+
#
|
24
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
25
|
+
#++
|
18
26
|
|
19
27
|
nl:
|
20
28
|
error:
|
@@ -24,6 +32,3 @@ nl:
|
|
24
32
|
value: "Waarde %{value} is niet in toegestane bereik."
|
25
33
|
warn:
|
26
34
|
deprecated: Deze methode is verouderd.
|
27
|
-
test:
|
28
|
-
kotoba: taal
|
29
|
-
test: test data
|
data/lib/wwwjdic/locales/ru.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
#--
|
1
2
|
# wwwjdic
|
2
|
-
#
|
3
|
+
# rubocop:disable Style/AsciiComments
|
4
|
+
# © 2014 Marco Bresciani
|
5
|
+
# rubocop:enable Style/AsciiComments
|
3
6
|
#
|
4
7
|
# This file is part of wwwjdic.
|
5
8
|
#
|
@@ -15,6 +18,11 @@
|
|
15
18
|
#
|
16
19
|
# You should have received a copy of the GNU General Public License
|
17
20
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
#
|
22
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
23
|
+
#
|
24
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
25
|
+
#++
|
18
26
|
|
19
27
|
ru:
|
20
28
|
error:
|
@@ -24,6 +32,3 @@ ru:
|
|
24
32
|
value: "Значение %{value} не в допустимом диапазоне."
|
25
33
|
warn:
|
26
34
|
deprecated: Этот метод является устаревшим.
|
27
|
-
test:
|
28
|
-
kotoba: слово
|
29
|
-
test: test data
|
data/lib/wwwjdic/locales/sl.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
#--
|
1
2
|
# wwwjdic
|
2
|
-
#
|
3
|
+
# rubocop:disable Style/AsciiComments
|
4
|
+
# © 2014 Marco Bresciani
|
5
|
+
# rubocop:enable Style/AsciiComments
|
3
6
|
#
|
4
7
|
# This file is part of wwwjdic.
|
5
8
|
#
|
@@ -15,6 +18,11 @@
|
|
15
18
|
#
|
16
19
|
# You should have received a copy of the GNU General Public License
|
17
20
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
#
|
22
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
23
|
+
#
|
24
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
25
|
+
#++
|
18
26
|
|
19
27
|
sl:
|
20
28
|
error:
|
@@ -24,6 +32,3 @@ sl:
|
|
24
32
|
value: "Vrednost %{value} ni v dovoljenem obsegu."
|
25
33
|
warn:
|
26
34
|
deprecated: Ta metoda je bila opuščena.
|
27
|
-
test:
|
28
|
-
kotoba: beseda
|
29
|
-
test: test data
|
data/lib/wwwjdic/locales/sv.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
#--
|
1
2
|
# wwwjdic
|
2
|
-
#
|
3
|
+
# rubocop:disable Style/AsciiComments
|
4
|
+
# © 2014 Marco Bresciani
|
5
|
+
# rubocop:enable Style/AsciiComments
|
3
6
|
#
|
4
7
|
# This file is part of wwwjdic.
|
5
8
|
#
|
@@ -15,6 +18,11 @@
|
|
15
18
|
#
|
16
19
|
# You should have received a copy of the GNU General Public License
|
17
20
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
#
|
22
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
23
|
+
#
|
24
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
25
|
+
#++
|
18
26
|
|
19
27
|
sv:
|
20
28
|
error:
|
@@ -24,6 +32,3 @@ sv:
|
|
24
32
|
value: "Värde %{value} är inte tillåtet intervall."
|
25
33
|
warn:
|
26
34
|
deprecated: Denna metod har föråldrad.
|
27
|
-
test:
|
28
|
-
kotoba: ord
|
29
|
-
test: test data
|
data/lib/wwwjdic/parser.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#--
|
2
4
|
# wwwjdic
|
3
|
-
#
|
5
|
+
# rubocop:disable Style/AsciiComments
|
6
|
+
# © 2014 Marco Bresciani
|
7
|
+
# rubocop:enable Style/AsciiComments
|
4
8
|
#
|
5
9
|
# This file is part of wwwjdic.
|
6
10
|
#
|
@@ -16,31 +20,34 @@
|
|
16
20
|
#
|
17
21
|
# You should have received a copy of the GNU General Public License
|
18
22
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
#
|
24
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
25
|
+
#
|
26
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
19
27
|
#++
|
20
28
|
|
21
29
|
require_relative 'constants'
|
22
30
|
|
23
31
|
module WWWJDic
|
24
|
-
|
25
32
|
# This class is a simple utility that is used to parse and filter
|
26
33
|
# parameters for wwwjdic.
|
27
34
|
#
|
28
35
|
# Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
|
29
|
-
# Copyright::
|
36
|
+
# Copyright:: (C) 2014 Marco Bresciani
|
30
37
|
# License:: GNU General Public License version 3
|
31
38
|
class Parser
|
32
39
|
attr_reader :parsers
|
33
40
|
|
34
41
|
def initialize(args = {})
|
35
|
-
@parsers =
|
36
|
-
ALL_PARAMS.each {|param| parsers[param] = args[param]} unless args.nil?
|
42
|
+
@parsers = {}
|
43
|
+
ALL_PARAMS.each { |param| parsers[param] = args[param] } unless args.nil?
|
37
44
|
end
|
38
45
|
|
39
46
|
# Provides the duck type for a generic parsing object.
|
40
|
-
def parse(method = nil,
|
47
|
+
def parse(method = nil, params = nil)
|
41
48
|
a_parser = nil
|
42
|
-
a_parser = parsers[method.to_sym] unless method.nil?
|
43
|
-
a_parser
|
49
|
+
a_parser = parsers[method.to_sym] unless method.nil? || parsers.nil?
|
50
|
+
a_parser&.parse params
|
44
51
|
end
|
45
52
|
end
|
46
53
|
end
|
data/lib/wwwjdic/parsers/dict.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#--
|
2
4
|
# wwwjdic
|
3
|
-
#
|
5
|
+
# rubocop:disable Style/AsciiComments
|
6
|
+
# © 2014 Marco Bresciani
|
7
|
+
# rubocop:enable Style/AsciiComments
|
4
8
|
#
|
5
9
|
# This file is part of wwwjdic.
|
6
10
|
#
|
@@ -16,6 +20,10 @@
|
|
16
20
|
#
|
17
21
|
# You should have received a copy of the GNU General Public License
|
18
22
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
#
|
24
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
25
|
+
#
|
26
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
19
27
|
#++
|
20
28
|
|
21
29
|
require_relative '../constants'
|
@@ -23,7 +31,6 @@ require_relative '../utils/raisers'
|
|
23
31
|
|
24
32
|
module WWWJDic
|
25
33
|
module Parsers
|
26
|
-
|
27
34
|
# This class is an implementation of the Parsable duck type that
|
28
35
|
# checks the dictionary type. The only needed parameter is a valid
|
29
36
|
# dictionary.
|
@@ -32,7 +39,7 @@ module WWWJDic
|
|
32
39
|
# source of one of the pages to get the full list of codes.)
|
33
40
|
#
|
34
41
|
# Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
|
35
|
-
# Copyright::
|
42
|
+
# Copyright:: (C) 2014 Marco Bresciani
|
36
43
|
# License:: GNU General Public License version 3
|
37
44
|
class Dict
|
38
45
|
include Utils::Raisers
|
@@ -46,11 +53,9 @@ module WWWJDic
|
|
46
53
|
if value.length == 1
|
47
54
|
raiser_array('error.param', value, DICTIONARY_CODES)
|
48
55
|
value
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
DICTS_BY_NAMES[value]
|
53
|
-
end
|
56
|
+
elsif value.length > 1
|
57
|
+
raiser_array('error.param', value, DICTIONARY_NAMES)
|
58
|
+
DICTS_BY_NAMES[value]
|
54
59
|
end
|
55
60
|
end
|
56
61
|
end
|
@@ -1,6 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#--
|
2
4
|
# wwwjdic
|
3
|
-
#
|
5
|
+
# rubocop:disable Style/AsciiComments
|
6
|
+
# © 2014 Marco Bresciani
|
7
|
+
# rubocop:enable Style/AsciiComments
|
4
8
|
#
|
5
9
|
# This file is part of wwwjdic.
|
6
10
|
#
|
@@ -16,13 +20,16 @@
|
|
16
20
|
#
|
17
21
|
# You should have received a copy of the GNU General Public License
|
18
22
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
#
|
24
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
25
|
+
#
|
26
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
19
27
|
#++
|
20
28
|
|
21
29
|
require_relative '../constants'
|
22
30
|
|
23
31
|
module WWWJDic
|
24
32
|
module Parsers
|
25
|
-
|
26
33
|
# This class is an implementation of the Parsable duck type that
|
27
34
|
# checks the display type. The only needed parameter is a boolean,
|
28
35
|
# with +true+ for regular.
|
@@ -31,7 +38,7 @@ module WWWJDic
|
|
31
38
|
# dictionary display)
|
32
39
|
#
|
33
40
|
# Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
|
34
|
-
# Copyright::
|
41
|
+
# Copyright:: (C) 2014 Marco Bresciani
|
35
42
|
# License:: GNU General Public License version 3
|
36
43
|
class Display
|
37
44
|
include Utils::Raisers
|
data/lib/wwwjdic/parsers/key.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#--
|
2
4
|
# wwwjdic
|
3
|
-
#
|
5
|
+
# rubocop:disable Style/AsciiComments
|
6
|
+
# © 2014 Marco Bresciani
|
7
|
+
# rubocop:enable Style/AsciiComments
|
4
8
|
#
|
5
9
|
# This file is part of wwwjdic.
|
6
10
|
#
|
@@ -16,6 +20,10 @@
|
|
16
20
|
#
|
17
21
|
# You should have received a copy of the GNU General Public License
|
18
22
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
#
|
24
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
25
|
+
#
|
26
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
19
27
|
#++
|
20
28
|
|
21
29
|
require_relative '../constants'
|
@@ -56,13 +64,13 @@ module WWWJDic
|
|
56
64
|
# displayed.
|
57
65
|
#
|
58
66
|
# Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
|
59
|
-
# Copyright::
|
67
|
+
# Copyright:: (C) 2014 Marco Bresciani
|
60
68
|
# License:: GNU General Public License version 3
|
61
69
|
class Key
|
62
70
|
include Utils::Raisers
|
63
71
|
|
64
72
|
# The parsable duck type interface to every parser usage.
|
65
|
-
def parse(value = :
|
73
|
+
def parse(value = :english)
|
66
74
|
raise ArgumentError, I18n.t('error.nil') if value.nil?
|
67
75
|
raise ArgumentError, I18n.t('error.param', value: value) unless value.is_a? Symbol
|
68
76
|
|
@@ -1,6 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#--
|
2
4
|
# wwwjdic
|
3
|
-
#
|
5
|
+
# rubocop:disable Style/AsciiComments
|
6
|
+
# © 2014 Marco Bresciani
|
7
|
+
# rubocop:enable Style/AsciiComments
|
4
8
|
#
|
5
9
|
# This file is part of wwwjdic.
|
6
10
|
#
|
@@ -16,6 +20,10 @@
|
|
16
20
|
#
|
17
21
|
# You should have received a copy of the GNU General Public License
|
18
22
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
#
|
24
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
25
|
+
#
|
26
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
19
27
|
#++
|
20
28
|
|
21
29
|
module WWWJDic
|
@@ -47,12 +55,13 @@ module WWWJDic
|
|
47
55
|
# * for example sentence lookups using a regular expression, use T.
|
48
56
|
#
|
49
57
|
# Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
|
50
|
-
# Copyright::
|
58
|
+
# Copyright:: (C) 2014 Marco Bresciani
|
51
59
|
# License:: GNU General Public License version 3
|
52
60
|
class Search
|
53
61
|
# The parsable duck type interface to every parser usage.
|
54
62
|
def parse(value = '')
|
55
|
-
return 'D' if value == CGI
|
63
|
+
return 'D' if value == CGI.escape(value).to_s
|
64
|
+
|
56
65
|
'U'
|
57
66
|
end
|
58
67
|
end
|
@@ -1,6 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#--
|
2
4
|
# wwwjdic
|
3
|
-
#
|
5
|
+
# rubocop:disable Style/AsciiComments
|
6
|
+
# © 2014 Marco Bresciani
|
7
|
+
# rubocop:enable Style/AsciiComments
|
4
8
|
#
|
5
9
|
# This file is part of wwwjdic.
|
6
10
|
#
|
@@ -16,19 +20,22 @@
|
|
16
20
|
#
|
17
21
|
# You should have received a copy of the GNU General Public License
|
18
22
|
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
#
|
24
|
+
# SPDX-FileCopyrightText: 2014 Marco Bresciani
|
25
|
+
#
|
26
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
19
27
|
#++
|
20
28
|
|
21
29
|
require_relative '../constants'
|
22
30
|
|
23
31
|
module WWWJDic
|
24
32
|
module Parsers
|
25
|
-
|
26
33
|
# This class is an implementation of the Parsable duck type that
|
27
34
|
# checks the display type. The only needed parameter is a boolean,
|
28
35
|
# with +true+ for regular.
|
29
36
|
#
|
30
37
|
# Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
|
31
|
-
# Copyright::
|
38
|
+
# Copyright:: (C) 2014 Marco Bresciani
|
32
39
|
# License:: GNU General Public License version 3
|
33
40
|
class Server
|
34
41
|
include Utils::Raisers
|