cuculungwa 0.0.43 → 0.0.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cuculungwa.rb +19 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8cc9088b29d5d3d1751808a94e4528b80770324
|
4
|
+
data.tar.gz: 0f39f30bc27dc9b35d9910de8fdf0680c8a4b8b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93900c4399f99660c57dfbd400f815817e2bc61144fb4a389ccbea8be3c61e1432a8a182c0787fc949a2611eb54488062271113678724e05f68d213f2ee82e11
|
7
|
+
data.tar.gz: 0e720e29bc0fa0e39b86a017d13bdf55a898f08638f3cba4c3a7226a34e5b573314d44edaa9c06ef6d81f9c045727da863a994f6256f1d1df0306bc2430c0024
|
data/lib/cuculungwa.rb
CHANGED
@@ -16,6 +16,7 @@ if ENV['CONFIG']
|
|
16
16
|
config.merge!(YAML::load(File.open(ENV['CONFIG'])))
|
17
17
|
end
|
18
18
|
config['project']['default_host'] = config['project'][ENV['PROJECT'] || 'development']
|
19
|
+
config['framework']['i18n']['locale'] = ENV['LOCALE'] || config['framework']['i18n']['locale']
|
19
20
|
|
20
21
|
I18n.enforce_available_locales = false
|
21
22
|
I18n.locale = config['framework']['i18n']['locale'].to_sym
|
@@ -150,11 +151,15 @@ module Utils
|
|
150
151
|
end
|
151
152
|
|
152
153
|
def short_iban(iban)
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
154
|
+
if iban.length >= 15
|
155
|
+
first_part = iban[0..1]+" "+iban[2..3]+" "+iban[4..7]
|
156
|
+
middle_part=" ... "
|
157
|
+
last_part=iban[-4..-1]
|
158
|
+
iban_number=first_part+middle_part + last_part
|
159
|
+
else
|
160
|
+
iban_number = add_space = iban[0..1]+" "+iban[2..iban.length]
|
161
|
+
end
|
162
|
+
return iban_number
|
158
163
|
end
|
159
164
|
|
160
165
|
def wait_for_expected_result(timespan)
|
@@ -175,6 +180,15 @@ module Utils
|
|
175
180
|
#puts "Waiting for expected result took #{Time.now - _then}s."
|
176
181
|
end
|
177
182
|
|
183
|
+
def I18n_first(text)
|
184
|
+
begin
|
185
|
+
text = I18n.t(text, :raise => I18n::MissingTranslationData)
|
186
|
+
return text
|
187
|
+
rescue I18n::MissingTranslationData
|
188
|
+
return text
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
178
192
|
# Function creates localalized version of a number represented by a string based on locale_spec
|
179
193
|
# eg. 123456.55 -> 123,45.55 (with locale_spec = {:separator : ',', :delimiter '.'}
|
180
194
|
# 5123456.55 -> 5 123 45,55 (with locale_spec = {:separator : ' ', :delimiter '.'}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuculungwa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.45
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Kaftanski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-03-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aruba
|