rs_russian 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -5
- data/lib/russian/version.rb +1 -1
- data/lib/russian.rb +0 -3
- metadata +3 -4
- data/lib/russian/rails_admin_datetime.rb +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 248a411f86b214a401416342ea41e062cdb18153
|
4
|
+
data.tar.gz: cb1b1ee82e4cdaa0eb7aa97e10e1b24e7035fe09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c802ad863ed8023ba8819b4d1696fe5a83e3193fc93d491f69dbd99aa59037e983f50469a32104dd2f33c3d90bfb153829d54754f8c82b7e64e98a803ce3862d
|
7
|
+
data.tar.gz: 3fc4bc908d5eee5f3fef505031eae07779c586f4ad7e259ca78f7e0b40c9f73686805bdc1783e4b4a8638c89373b03c09826ac8d36a49b9879fa8c6725a97d15
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rs_russian (0.9.
|
4
|
+
rs_russian (0.9.1)
|
5
5
|
activesupport (>= 3.0.0, < 5.0.0)
|
6
6
|
i18n (>= 0.6.0, < 0.8.0)
|
7
7
|
unicode (~> 0.4.4)
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (4.2.
|
12
|
+
activesupport (4.2.5)
|
13
13
|
i18n (~> 0.7)
|
14
14
|
json (~> 1.7, >= 1.7.7)
|
15
15
|
minitest (~> 5.1)
|
@@ -17,8 +17,8 @@ GEM
|
|
17
17
|
tzinfo (~> 1.1)
|
18
18
|
diff-lcs (1.2.5)
|
19
19
|
i18n (0.7.0)
|
20
|
-
json (1.8.
|
21
|
-
minitest (5.
|
20
|
+
json (1.8.3)
|
21
|
+
minitest (5.8.3)
|
22
22
|
rake (10.4.2)
|
23
23
|
rspec (2.99.0)
|
24
24
|
rspec-core (~> 2.99.0)
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
rspec-core (2.99.2)
|
28
28
|
rspec-expectations (2.99.2)
|
29
29
|
diff-lcs (>= 1.1.3, < 2.0)
|
30
|
-
rspec-mocks (2.99.
|
30
|
+
rspec-mocks (2.99.4)
|
31
31
|
thread_safe (0.3.5)
|
32
32
|
tzinfo (1.2.2)
|
33
33
|
thread_safe (~> 0.1)
|
@@ -41,3 +41,6 @@ DEPENDENCIES
|
|
41
41
|
rake
|
42
42
|
rs_russian!
|
43
43
|
rspec (~> 2.14)
|
44
|
+
|
45
|
+
BUNDLED WITH
|
46
|
+
1.10.6
|
data/lib/russian/version.rb
CHANGED
data/lib/russian.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rs_russian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
@@ -138,7 +138,6 @@ files:
|
|
138
138
|
- lib/russian/locale/datetime.yml
|
139
139
|
- lib/russian/locale/pluralization.rb
|
140
140
|
- lib/russian/locale/transliterator.rb
|
141
|
-
- lib/russian/rails_admin_datetime.rb
|
142
141
|
- lib/russian/russian_rails.rb
|
143
142
|
- lib/russian/transliteration.rb
|
144
143
|
- lib/russian/version.rb
|
@@ -171,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
170
|
version: '0'
|
172
171
|
requirements: []
|
173
172
|
rubyforge_project:
|
174
|
-
rubygems_version: 2.4.5
|
173
|
+
rubygems_version: 2.4.5.1
|
175
174
|
signing_key:
|
176
175
|
specification_version: 4
|
177
176
|
summary: Russian language support for Ruby and Rails
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'rails_admin'
|
2
|
-
require 'rails_admin/config/fields/types/datetime'
|
3
|
-
|
4
|
-
module RailsAdmin
|
5
|
-
module Config
|
6
|
-
module Fields
|
7
|
-
module Types
|
8
|
-
class Datetime < RailsAdmin::Config::Fields::Base
|
9
|
-
class << self
|
10
|
-
alias_method :normalize_without_russian, :normalize
|
11
|
-
def normalize(date_string, format)
|
12
|
-
unless I18n.locale == :en
|
13
|
-
format.to_s.scan(/%[AaBbp]/) do |match|
|
14
|
-
case match
|
15
|
-
when '%B'
|
16
|
-
english = I18n.t('date.month_names', :locale => :en)[1..-1]
|
17
|
-
common_month_names = I18n.t('date.common_month_names')[1..-1]
|
18
|
-
common_month_names.each_with_index {|m, i| date_string = date_string.gsub(/#{m}/i, english[i]) }
|
19
|
-
when '%b'
|
20
|
-
english = I18n.t('date.abbr_month_names', :locale => :en)[1..-1]
|
21
|
-
common_abbr_month_names = I18n.t('date.common_abbr_month_names')[1..-1]
|
22
|
-
common_abbr_month_names.each_with_index {|m, i| date_string = date_string.gsub(/#{m}/i, english[i]) }
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
normalize_without_russian(date_string, format)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def formatted_date_value
|
31
|
-
value = bindings[:object].new_record? && self.value.nil? && !self.default_value.nil? ? self.default_value : self.value
|
32
|
-
value.nil? ? "" : (I18n.l(value, format: '%2d').strip + ' ' + I18n.l(value, format: '%B %Y').strip)
|
33
|
-
end
|
34
|
-
|
35
|
-
def value
|
36
|
-
bindings[:object].send(name)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|