tramway-core 1.6 → 1.6.1

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: a7e6b600208a0aac1aac49df14d744385891acb532898ecf27dbac1cab935c40
4
- data.tar.gz: cbe160a3e54769372c33a1c890e79cd47335cc245715648688f3b9ea8a6f6210
3
+ metadata.gz: '038d11bab33834b37cee44fc2cfded45bf215d0847a0986fe62234b93885cfdb'
4
+ data.tar.gz: a208624475d9b43a3da6f45b266cf34be877a809d542d409a0c6e49dda2cb01d
5
5
  SHA512:
6
- metadata.gz: c8619069ed2f4b3f01aad7a0521e1f1c8d8aa6f657da86520e875eeb06f7bf517e15e6d371cc06397f7dd40002e6ed03e95fea6707e61379c7b6b7f532df2212
7
- data.tar.gz: a14f0760eccb8d942547e3e35028537c314f474c15944d1f1bf4d201d7dcf429156de1cf5f30206f2f7629b376f8ee189866cdc2ca97c0a40c480b3180742d84
6
+ metadata.gz: 14d9cf11bde869129ac7cfb66f8b2f8a2b4768f7eedf988eba6d05591de5e17ed221ee8a98e2cda57a5b0db87f0eb78d800690fe472c27a8ec701dadfaf52634
7
+ data.tar.gz: 27c94491389de90ab0e3eb48ab76c6c45ff0f5b8588e4e14017a7e56da3fd8b8a2c1937373b8d924fdd440082224308f6716f44c8c50b71f5eea4188fb1ee1d8
@@ -0,0 +1,23 @@
1
+ {
2
+ ru: {
3
+ i18n: {
4
+ plural: {
5
+ keys: [:zero, :one, :few, :many],
6
+ rule: lambda do |n|
7
+ if n == 0
8
+ :zero
9
+ elsif n % 10 == 1 && n % 100 != 11
10
+ # 1, 21, 31, 41, 51, 61...
11
+ :one
12
+ elsif [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100)
13
+ # 2-4, 22-24, 32-34...
14
+ :few
15
+ elsif n % 10 == 0 || ![5, 6, 7, 8, 9].include?(n % 10) || ![11, 12, 13, 14].include?(n % 100)
16
+ # 0, 5-20, 25-30, 35-40...
17
+ :many
18
+ end
19
+ end
20
+ }
21
+ }
22
+ }
23
+ }
@@ -4,6 +4,7 @@ ru:
4
4
  to: по
5
5
  formats:
6
6
  default: "%d.%m.%Y"
7
+ month_names: [~, января, февраля, марта, апреля, мая, июня, июля, августа, сентября, октября, ноября, декабря]
7
8
  time:
8
9
  formats:
9
10
  default: "%d.%m.%Y %H:%M"
data/lib/string.rb ADDED
@@ -0,0 +1,15 @@
1
+ require "active_support/inflector/methods"
2
+
3
+ class String
4
+ def pluralize(count = nil, locale = :en)
5
+ if locale == :ru
6
+ case count
7
+ when :many
8
+ I18n.t("cases.#{}")
9
+ end
10
+ else
11
+ locale = count if count.is_a? Symbol
12
+ count == 1 ? dup : ActiveSupport::Inflector.pluralize(self, locale)
13
+ end
14
+ end
15
+ end
data/lib/tramway/core.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "tramway/core/engine"
2
2
  require "tramway/collection"
3
3
  require "tramway/collections/helper"
4
+ #require 'string'
4
5
 
5
6
  module Tramway
6
7
  module Core
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Core
3
- VERSION = '1.6'
3
+ VERSION = '1.6.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.6'
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-25 00:00:00.000000000 Z
11
+ date: 2018-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reform-rails
@@ -237,11 +237,13 @@ files:
237
237
  - app/views/tramway/core/shared/_input_extended.html.haml
238
238
  - app/views/tramway/core/shared/_messages.html.haml
239
239
  - config/initializers/assets.rb
240
+ - config/initializers/plurals.rb
240
241
  - config/locales/ru/dates.yml
241
242
  - config/locales/ru/helpers.yml
242
243
  - config/locales/ru/models.yml
243
244
  - config/locales/ru/state_machines.yml
244
245
  - config/routes.rb
246
+ - lib/string.rb
245
247
  - lib/tasks/tramway/core_tasks.rake
246
248
  - lib/tramway/collection.rb
247
249
  - lib/tramway/collections/helper.rb