singleton-ruby 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sgtn-client/api/source.rb +2 -1
- data/lib/sgtn-client/cldr/localized_datetime.rb +45 -9
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e74b238c58ac91cb373e48cd664ef4c8115bbb811b8ceb0427a82979b5d6bdfe
|
4
|
+
data.tar.gz: ae96f56fd84a59d82ce60d9aceea55baac70bc2004c1d87d00f94dee6a9ff2a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bae2bb630c92a26d5fc84141fda89193d48d373fefa8c1a48090cac524fc485cc0a80ee1de0076ca56e577a69e3774ace36d1ede442828a4025294a113c88223
|
7
|
+
data.tar.gz: 713f0b37a528eb1c1f5e1c50519985d7821b2fac1182912194a3f7ef17e09671a38ec34c073109d46edbe939e3ade572d1ef433a642e1dcbffdd79cd45b48116
|
@@ -1,27 +1,63 @@
|
|
1
1
|
require 'date'
|
2
2
|
require 'time'
|
3
3
|
|
4
|
-
DateTime.class_eval <<-LOCALIZE, __FILE__, __LINE__ +
|
5
|
-
def l_full_s(locale = TwitterCldr.locale)
|
6
|
-
|
4
|
+
DateTime.class_eval <<-LOCALIZE, __FILE__, __LINE__ + 2
|
5
|
+
def l_full_s(locale = TwitterCldr.locale, *args)
|
6
|
+
timezone = args[0]
|
7
|
+
display_name = args[1]
|
8
|
+
if timezone.nil?
|
9
|
+
self.localize(locale).to_full_s
|
10
|
+
elsif display_name.nil?
|
11
|
+
self.localize(locale).with_timezone(timezone).to_full_s
|
12
|
+
else
|
13
|
+
tz = TwitterCldr::Timezones::Timezone.instance(timezone, locale)
|
14
|
+
tz.display_name_for(self, display_name)
|
15
|
+
end
|
7
16
|
end
|
8
17
|
LOCALIZE
|
9
18
|
|
10
19
|
DateTime.class_eval <<-LOCALIZE, __FILE__, __LINE__ + 1
|
11
|
-
def l_long_s(locale = TwitterCldr.locale)
|
12
|
-
|
20
|
+
def l_long_s(locale = TwitterCldr.locale, *args)
|
21
|
+
timezone = args[0]
|
22
|
+
display_name = args[1]
|
23
|
+
if timezone.nil?
|
24
|
+
self.localize(locale).to_long_s
|
25
|
+
elsif display_name.nil?
|
26
|
+
self.localize(locale).with_timezone(timezone).to_long_s
|
27
|
+
else
|
28
|
+
tz = TwitterCldr::Timezones::Timezone.instance(timezone, locale)
|
29
|
+
tz.display_name_for(self, display_name)
|
30
|
+
end
|
13
31
|
end
|
14
32
|
LOCALIZE
|
15
33
|
|
16
34
|
DateTime.class_eval <<-LOCALIZE, __FILE__, __LINE__ + 1
|
17
|
-
def l_medium_s(locale = TwitterCldr.locale)
|
18
|
-
|
35
|
+
def l_medium_s(locale = TwitterCldr.locale, *args)
|
36
|
+
timezone = args[0]
|
37
|
+
display_name = args[1]
|
38
|
+
if timezone.nil?
|
39
|
+
self.localize(locale).to_medium_s
|
40
|
+
elsif display_name.nil?
|
41
|
+
self.localize(locale).with_timezone(timezone).to_medium_s
|
42
|
+
else
|
43
|
+
tz = TwitterCldr::Timezones::Timezone.instance(timezone, locale)
|
44
|
+
tz.display_name_for(self, display_name)
|
45
|
+
end
|
19
46
|
end
|
20
47
|
LOCALIZE
|
21
48
|
|
22
49
|
|
23
50
|
DateTime.class_eval <<-LOCALIZE, __FILE__, __LINE__ + 1
|
24
|
-
def l_short_s(locale = TwitterCldr.locale)
|
25
|
-
|
51
|
+
def l_short_s(locale = TwitterCldr.locale, *args)
|
52
|
+
timezone = args[0]
|
53
|
+
display_name = args[1]
|
54
|
+
if timezone.nil?
|
55
|
+
self.localize(locale).to_short_s
|
56
|
+
elsif display_name.nil?
|
57
|
+
self.localize(locale).with_timezone(timezone).to_short_s
|
58
|
+
else
|
59
|
+
tz = TwitterCldr::Timezones::Timezone.instance(timezone, locale)
|
60
|
+
tz.display_name_for(self, display_name)
|
61
|
+
end
|
26
62
|
end
|
27
63
|
LOCALIZE
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: singleton-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware G11n Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|