tolk 5.0.2 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/tolk/locales_controller.rb +1 -1
- data/app/helpers/tolk/application_helper.rb +1 -1
- data/app/models/tolk/translation.rb +2 -2
- data/lib/tolk/export.rb +1 -1
- data/lib/tolk/import.rb +1 -1
- data/lib/tolk/sync.rb +1 -1
- data/lib/tolk/version.rb +1 -1
- data/lib/tolk.rb +0 -2
- metadata +25 -26
- data/lib/tolk/yaml.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef7dfd14b400818821775dd81554dd57d93067cdc411dc326fb1ba84a63cb429
|
4
|
+
data.tar.gz: 7d6461627242236ef9244f455fb1d351df38e9aa48b9bc66a95e546ed8e9283d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc32c25878d1cfa7624e3ffcece01b86b4ee53328a51cc52b032228e2fa7621207e8346f23c2ed2decbffce5a2259e55b01526a1a229f326fed14e2dd071d439
|
7
|
+
data.tar.gz: cb4dea705b81ca1563370b1ff7e951a6b1e42b5b5ca81f938dadc038dbdc9484dea7f849e3c3dcb3b650013260e06ee91caeefde5e8300db4f5557c39f5d68d7
|
@@ -4,8 +4,8 @@ module Tolk
|
|
4
4
|
|
5
5
|
scope :containing_text, lambda {|query| where("tolk_translations.text LIKE ?", "%#{query}%") }
|
6
6
|
|
7
|
-
serialize :text
|
8
|
-
serialize :previous_text
|
7
|
+
serialize :text, coder: YAML, yaml: { permitted_classes: [Symbol, Time, nil, String, Array, Hash] }
|
8
|
+
serialize :previous_text, coder: YAML, yaml: { permitted_classes: [Symbol, Time, nil, String, Array, Hash] }
|
9
9
|
validate :validate_text_not_nil, :if => proc {|r| r.primary.blank? && !r.explicit_nil && !r.boolean?}
|
10
10
|
validate :check_matching_variables, :if => proc { |tr| tr.primary_translation.present? }
|
11
11
|
|
data/lib/tolk/export.rb
CHANGED
data/lib/tolk/import.rb
CHANGED
@@ -53,7 +53,7 @@ module Tolk
|
|
53
53
|
|
54
54
|
puts "[INFO] Reading #{locale_file} for locale #{self.name}"
|
55
55
|
begin
|
56
|
-
self.class.flat_hash(
|
56
|
+
self.class.flat_hash(YAML.load_file(locale_file)[self.name])
|
57
57
|
rescue
|
58
58
|
puts "[ERROR] File #{locale_file} expected to declare #{self.name} locale, but it does not. Skipping this file."
|
59
59
|
nil
|
data/lib/tolk/sync.rb
CHANGED
@@ -47,7 +47,7 @@ module Tolk
|
|
47
47
|
def read_primary_locale_file
|
48
48
|
primary_file = "#{self.locales_config_path}/#{self.primary_locale_name}.yml"
|
49
49
|
if File.exist?(primary_file)
|
50
|
-
flat_hash(
|
50
|
+
flat_hash(YAML.load_file(primary_file)[self.primary_locale_name])
|
51
51
|
else
|
52
52
|
{}
|
53
53
|
end
|
data/lib/tolk/version.rb
CHANGED
data/lib/tolk.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tolk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2024-09-
|
15
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
@@ -20,20 +20,20 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '7.0'
|
24
24
|
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '7.
|
26
|
+
version: '7.3'
|
27
27
|
type: :runtime
|
28
28
|
prerelease: false
|
29
29
|
version_requirements: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '7.0'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '7.
|
36
|
+
version: '7.3'
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: sprockets-rails
|
39
39
|
requirement: !ruby/object:Gem::Requirement
|
@@ -48,20 +48,6 @@ dependencies:
|
|
48
48
|
- - "~>"
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '3.4'
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: safe_yaml
|
53
|
-
requirement: !ruby/object:Gem::Requirement
|
54
|
-
requirements:
|
55
|
-
- - ">="
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 0.8.6
|
58
|
-
type: :runtime
|
59
|
-
prerelease: false
|
60
|
-
version_requirements: !ruby/object:Gem::Requirement
|
61
|
-
requirements:
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 0.8.6
|
65
51
|
- !ruby/object:Gem::Dependency
|
66
52
|
name: sqlite3
|
67
53
|
requirement: !ruby/object:Gem::Requirement
|
@@ -104,6 +90,20 @@ dependencies:
|
|
104
90
|
- - ">="
|
105
91
|
- !ruby/object:Gem::Version
|
106
92
|
version: '0'
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: rake
|
95
|
+
requirement: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '13.0'
|
100
|
+
type: :development
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - "~>"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '13.0'
|
107
107
|
- !ruby/object:Gem::Dependency
|
108
108
|
name: capybara
|
109
109
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,16 +150,16 @@ dependencies:
|
|
150
150
|
name: puma
|
151
151
|
requirement: !ruby/object:Gem::Requirement
|
152
152
|
requirements:
|
153
|
-
- - "
|
153
|
+
- - "~>"
|
154
154
|
- !ruby/object:Gem::Version
|
155
|
-
version: '
|
155
|
+
version: '6.0'
|
156
156
|
type: :development
|
157
157
|
prerelease: false
|
158
158
|
version_requirements: !ruby/object:Gem::Requirement
|
159
159
|
requirements:
|
160
|
-
- - "
|
160
|
+
- - "~>"
|
161
161
|
- !ruby/object:Gem::Version
|
162
|
-
version: '
|
162
|
+
version: '6.0'
|
163
163
|
- !ruby/object:Gem::Dependency
|
164
164
|
name: appraisal
|
165
165
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,7 +226,6 @@ files:
|
|
226
226
|
- lib/tolk/pagination.rb
|
227
227
|
- lib/tolk/sync.rb
|
228
228
|
- lib/tolk/version.rb
|
229
|
-
- lib/tolk/yaml.rb
|
230
229
|
homepage: https://github.com/tolk/tolk
|
231
230
|
licenses:
|
232
231
|
- MIT
|
@@ -239,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
238
|
requirements:
|
240
239
|
- - ">="
|
241
240
|
- !ruby/object:Gem::Version
|
242
|
-
version:
|
241
|
+
version: 3.0.0
|
243
242
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
243
|
requirements:
|
245
244
|
- - ">="
|
data/lib/tolk/yaml.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
module Tolk
|
2
|
-
module YAML
|
3
|
-
SAFE_YAML_OPTIONS = SafeYAML::Deep.freeze({
|
4
|
-
:default_mode => :safe,
|
5
|
-
:deserialize_symbols => true
|
6
|
-
})
|
7
|
-
|
8
|
-
def self.load(yaml)
|
9
|
-
# SafeYAML.load has different arity depending on the YAML engine used.
|
10
|
-
if SafeYAML::YAML_ENGINE == "psych"
|
11
|
-
SafeYAML.load(yaml, nil, SAFE_YAML_OPTIONS)
|
12
|
-
else # syck
|
13
|
-
SafeYAML.load(yaml, SAFE_YAML_OPTIONS)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.load_file(filename)
|
18
|
-
SafeYAML.load_file(filename, SAFE_YAML_OPTIONS)
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.dump(payload)
|
22
|
-
if payload.respond_to?(:ya2yaml)
|
23
|
-
payload.ya2yaml(:syck_compatible => true)
|
24
|
-
else
|
25
|
-
::YAML.dump(payload, line_width: Tolk::Config.yaml_line_width)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|