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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5de6a79064d4d85e04496152aac11d8fa60e14bde292f51990cc4cc006d146b
4
- data.tar.gz: 302345bdea17f7f41be7ebf0c141c872a628e6d1693036fc961327c79a2e1c3b
3
+ metadata.gz: ef7dfd14b400818821775dd81554dd57d93067cdc411dc326fb1ba84a63cb429
4
+ data.tar.gz: 7d6461627242236ef9244f455fb1d351df38e9aa48b9bc66a95e546ed8e9283d
5
5
  SHA512:
6
- metadata.gz: b674e81e5b20f24a5e9b573d63cbf18b5ee4881ee6522101635950757fee8947bd555fbb1e15b04c9a616b42eff2441b0844abbee2250a045de040d48e8ca7dd
7
- data.tar.gz: 1f1e0385b73dcd992a86965c4e98c9713fca8c7feae0865aa1a2c3886b367d594b85611011cb483606806c410f1a41ace06bde97d2a002b5068036e6bee92b5b
6
+ metadata.gz: bc32c25878d1cfa7624e3ffcece01b86b4ee53328a51cc52b032228e2fa7621207e8346f23c2ed2decbffce5a2259e55b01526a1a229f326fed14e2dd071d439
7
+ data.tar.gz: cb4dea705b81ca1563370b1ff7e951a6b1e42b5b5ca81f938dadc038dbdc9484dea7f849e3c3dcb3b650013260e06ee91caeefde5e8300db4f5557c39f5d68d7
@@ -17,7 +17,7 @@ module Tolk
17
17
 
18
18
  format.yaml do
19
19
  data = @locale.to_hash
20
- render :plain => Tolk::YAML.dump(data)
20
+ render :plain => YAML.dump(data)
21
21
  end
22
22
 
23
23
  end
@@ -23,7 +23,7 @@ module Tolk
23
23
  def yaml_value(value)
24
24
  if value.present?
25
25
  unless value.is_a?(String) || value.is_a?(TrueClass) || value.is_a?(FalseClass)
26
- value = Tolk::YAML.dump(value)
26
+ value = YAML.dump(value)
27
27
  end
28
28
  end
29
29
 
@@ -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
@@ -10,7 +10,7 @@ module Tolk
10
10
 
11
11
  def dump
12
12
  File.open("#{destination}/#{name}.yml", "w+") do |file|
13
- file.write(Tolk::YAML.dump(data))
13
+ file.write(YAML.dump(data))
14
14
  end
15
15
  end
16
16
 
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(Tolk::YAML.load_file(locale_file)[self.name])
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(Tolk::YAML.load_file(primary_file)[self.primary_locale_name])
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
@@ -1,3 +1,3 @@
1
1
  module Tolk
2
- VERSION = "5.0.2"
2
+ VERSION = "6.0.0"
3
3
  end
data/lib/tolk.rb CHANGED
@@ -1,10 +1,8 @@
1
- require 'safe_yaml/load'
2
1
  require 'tolk/config'
3
2
  require 'tolk/engine'
4
3
  require 'tolk/sync'
5
4
  require 'tolk/import'
6
5
  require 'tolk/export'
7
- require 'tolk/yaml'
8
6
  require 'tolk/pagination'
9
7
 
10
8
  module Tolk
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: 5.0.2
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-05 00:00:00.000000000 Z
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: '6.0'
23
+ version: '7.0'
24
24
  - - "<"
25
25
  - !ruby/object:Gem::Version
26
- version: '7.2'
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: '6.0'
33
+ version: '7.0'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '7.2'
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: '5.5'
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: '5.5'
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: 2.5.0
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