st_tools 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a7fcb770812f74e220c7964ea4f065807e643d6
4
- data.tar.gz: 692c8ba12cd6a0bc6d55f01e78e3b22653bc5978
3
+ metadata.gz: e496301e5474b3aa17cde2db505de4fe92cc1486
4
+ data.tar.gz: fc10191234b418a63d073498e2fadf1569fe0b38
5
5
  SHA512:
6
- metadata.gz: 9b3ccdc959bbaa8072d2753949442ec04cd56a1035ba0ad96106dac7edf8d3c1209d3b79658811715e9412fcfc068bb66a13cf7a328a40dab4240586af180a8e
7
- data.tar.gz: d5c7bbe1d071cc8d3b60581041f64e902d2e11749844115f61ea4ac03126b221a541cc92ee7457472fca679af07b3da16fe8fc5fd1130ed7b2239e0b4b3b9f61
6
+ metadata.gz: 96b78f8cc674be22b5418a5e2a97613f982ac0d0ca20faae3161787621136ffdc6a4815277d47ae27251269d58745cab5a32061df12ae5708624be410fced82b
7
+ data.tar.gz: b36d661ed52963ba0756d9b48162c8ae62e7daf03dbf0518999697094ea8c4c297630d1ef8e8e28fce8e176f5472cd4029ac89e368f7407e856fd3718c0d065e
data/lib/i18n/en.yml CHANGED
@@ -85,4 +85,4 @@ en:
85
85
  pretty_list:
86
86
  and: and
87
87
  or: or
88
-
88
+ god_socr: ""
data/lib/i18n/ru.yml CHANGED
@@ -62,3 +62,4 @@ ru:
62
62
  pretty_list:
63
63
  and: и
64
64
  or: или
65
+ god_socr: " г."
@@ -268,7 +268,7 @@ module StTools
268
268
 
269
269
  def self.format_time2_date(timestamp, format, god)
270
270
  res = I18n.l(timestamp, :format => "d#{format.to_s}".to_sym, locale: StTools.configuration.locale)
271
- res += " г." if god && StTools.configuration.locale == :ru
271
+ res += I18n.t("st_tools.god_socr", locale: StTools.configuration.locale) if god && format.to_sym == :human
272
272
  res
273
273
  end
274
274
 
@@ -1,3 +1,3 @@
1
1
  module StTools
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -22,6 +22,7 @@ describe 'Проверка методов StTools::Human.format_time2 (:ru)' do
22
22
  StTools.configure { |config| config.locale = :ru }
23
23
  test = ::StTools::Human.format_time2(Time.now, :full, :full)
24
24
  expect(test).to match(/\d{2}\/\d{2}\/\d{4}/)
25
+ expect(test).to_not match(/г\./)
25
26
  expect(test).to match(/\d{2}\:\d{2}\:\d{2}/)
26
27
  end
27
28
 
@@ -29,6 +30,7 @@ describe 'Проверка методов StTools::Human.format_time2 (:ru)' do
29
30
  StTools.configure { |config| config.locale = :ru }
30
31
  test = ::StTools::Human.format_time2(Time.now, :full, :short)
31
32
  expect(test).to match(/\d{2}\/\d{2}\/\d{4}/)
33
+ expect(test).to_not match(/г\./)
32
34
  expect(test).to_not match(/\d{2}\:\d{2}\:\d{2}/)
33
35
  end
34
36
  end
@@ -38,6 +40,7 @@ describe 'Проверка методов StTools::Human.format_time2 (:en)' do
38
40
  StTools.configure { |config| config.locale = :en }
39
41
  test = ::StTools::Human.format_time2(Time.now, :human, :full)
40
42
  expect(test).to match(/[a-zA-Z]{3,10}/)
43
+ expect(test).to_not match(/г\./)
41
44
  expect(test).to match(/\d{2}\:\d{2}\:\d{2}/)
42
45
  end
43
46
 
@@ -45,6 +48,7 @@ describe 'Проверка методов StTools::Human.format_time2 (:en)' do
45
48
  StTools.configure { |config| config.locale = :en }
46
49
  test = ::StTools::Human.format_time2(Time.now, :full, :full)
47
50
  expect(test).to match(/\d{2}\/\d{2}\/\d{4}/)
51
+ expect(test).to_not match(/г\./)
48
52
  expect(test).to match(/\d{2}\:\d{2}\:\d{2}/)
49
53
  end
50
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: st_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Zhuravlev