tolk 1.3.11 → 1.3.12

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZWJlYTQxNjE0NjM2YzM2ZTA0MmQ1ZjYwNTdkNmNhODk5YWQxOTdiZg==
5
+ data.tar.gz: !binary |-
6
+ YTUzOTA2NjU4YzcxYzZhNTgwYjI0YTk2NTEyZDU1MjNkOWE2OTJmMQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzJlNzkxN2FlMDllMDczOThmZTBjNzJkNzA5Y2UwNjFhMzIyNjYyZjJlYzcw
10
+ ZTViMWZkNDJiMTQ1NzhkYmI0NTFkODYyNjM5Nzg3MzQzMjc4ZDIwNzdkNjQ1
11
+ OGE4MDEwMzg0YTA0YjE1ODA5NmJkNzdkYTc1ZTRkMTdhMjRjMDY=
12
+ data.tar.gz: !binary |-
13
+ ZDY4ZDUzNTBhNWE1YjFjYzBiYzc2MTNjMzU2NzQyYTAxOWJhODljNzc1ODFh
14
+ NDNlMjlhNWU1M2VjMWFmOWE0YmQ4NGRhMWE0NzIwNzM3YmRiYmVhZTg1ODFj
15
+ OGY2ZGViZGY4NmE2MzZjMWE5ZTYwMmJjMTNkNDlmZDQxYjQ2NTY=
@@ -20,7 +20,7 @@ module Tolk
20
20
  self.locales_config_path = self._dump_path
21
21
 
22
22
  cattr_accessor :primary_locale_name
23
- self.primary_locale_name = I18n.default_locale.to_s
23
+ self.primary_locale_name = Tolk.config.primary_locale_name || I18n.default_locale.to_s
24
24
 
25
25
  include Tolk::Sync
26
26
  include Tolk::Import
@@ -6,7 +6,7 @@ module Tolk
6
6
 
7
7
  serialize :text
8
8
  serialize :previous_text
9
- validates_presence_of :text, :if => proc {|r| r.primary.blank? && !r.explicit_nil && !r.boolean?}
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
 
12
12
  validates_uniqueness_of :phrase_id, :scope => :locale_id
@@ -156,5 +156,10 @@ module Tolk
156
156
  end
157
157
  end
158
158
  end
159
+
160
+ def validate_text_not_nil
161
+ return unless text.nil?
162
+ errors.add :text, :blank
163
+ end
159
164
  end
160
165
  end
@@ -22,7 +22,7 @@ module Tolk
22
22
 
23
23
  display "Hello, Tolk installer will help you sets things up!", :black
24
24
  unless initializer
25
- install_generator = ask_boolean("Do you wan't to install the optional configuration file (to change mappings, locales dump location etc..) ?")
25
+ install_generator = ask_boolean("Do you want to install the optional configuration file (to change mappings, locales dump location etc..) ?")
26
26
  template "initializer.erb", "config/initializers/tolk.rb" if install_generator
27
27
  else
28
28
  display "You already have a config file. You're updating, heh? I'm generating a new 'tolk.rb.example' that you can review."
data/lib/tolk/config.rb CHANGED
@@ -11,6 +11,9 @@ module Tolk
11
11
  # Dump locale path by default the locales folder (config/locales)
12
12
  attr_accessor :dump_path
13
13
 
14
+ # primary locale to not be overriden by default locale in development mode
15
+ attr_accessor :primary_locale_name
16
+
14
17
  def reset
15
18
  @dump_path = Proc.new { "#{Rails.application.root}/config/locales" }
16
19
 
@@ -66,4 +69,4 @@ module Tolk
66
69
  # Set default values for configuration options on load
67
70
  self.reset
68
71
  end
69
- end
72
+ end
data/lib/tolk/engine.rb CHANGED
@@ -6,5 +6,11 @@ module Tolk
6
6
  SafeYAML::OPTIONS[:deserialize_symbols] = true
7
7
 
8
8
  isolate_namespace Tolk
9
+
10
+ if Rails.version >= '3.1'
11
+ initializer :assets do |app|
12
+ app.config.assets.precompile += ['tolk/libraries.js']
13
+ end
14
+ end
9
15
  end
10
16
  end
data/lib/tolk/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tolk
2
- VERSION = "1.3.11"
2
+ VERSION = "1.3.12"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tolk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.11
5
- prerelease:
4
+ version: 1.3.12
6
5
  platform: ruby
7
6
  authors:
8
7
  - David Heinemeier Hansson
@@ -13,12 +12,11 @@ authors:
13
12
  autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
- date: 2013-07-10 00:00:00.000000000 Z
15
+ date: 2013-12-26 00:00:00.000000000 Z
17
16
  dependencies:
18
17
  - !ruby/object:Gem::Dependency
19
18
  name: will_paginate
20
19
  requirement: !ruby/object:Gem::Requirement
21
- none: false
22
20
  requirements:
23
21
  - - ! '>='
24
22
  - !ruby/object:Gem::Version
@@ -26,7 +24,6 @@ dependencies:
26
24
  type: :runtime
27
25
  prerelease: false
28
26
  version_requirements: !ruby/object:Gem::Requirement
29
- none: false
30
27
  requirements:
31
28
  - - ! '>='
32
29
  - !ruby/object:Gem::Version
@@ -34,7 +31,6 @@ dependencies:
34
31
  - !ruby/object:Gem::Dependency
35
32
  name: safe_yaml
36
33
  requirement: !ruby/object:Gem::Requirement
37
- none: false
38
34
  requirements:
39
35
  - - ~>
40
36
  - !ruby/object:Gem::Version
@@ -42,7 +38,6 @@ dependencies:
42
38
  type: :runtime
43
39
  prerelease: false
44
40
  version_requirements: !ruby/object:Gem::Requirement
45
- none: false
46
41
  requirements:
47
42
  - - ~>
48
43
  - !ruby/object:Gem::Version
@@ -93,27 +88,27 @@ files:
93
88
  - app/views/tolk/searches/_form.html.erb
94
89
  - app/views/tolk/searches/show.html.erb
95
90
  homepage: http://github.com/tolk/tolk
96
- licenses: []
91
+ licenses:
92
+ - MIT
93
+ metadata: {}
97
94
  post_install_message:
98
95
  rdoc_options: []
99
96
  require_paths:
100
97
  - lib
101
98
  required_ruby_version: !ruby/object:Gem::Requirement
102
- none: false
103
99
  requirements:
104
100
  - - ! '>='
105
101
  - !ruby/object:Gem::Version
106
102
  version: '0'
107
103
  required_rubygems_version: !ruby/object:Gem::Requirement
108
- none: false
109
104
  requirements:
110
105
  - - ! '>='
111
106
  - !ruby/object:Gem::Version
112
107
  version: '0'
113
108
  requirements: []
114
109
  rubyforge_project:
115
- rubygems_version: 1.8.25
110
+ rubygems_version: 2.1.11
116
111
  signing_key:
117
- specification_version: 3
112
+ specification_version: 4
118
113
  summary: Rails engine providing web interface for managing i18n yaml files
119
114
  test_files: []