cuculungwa 0.0.43 → 0.0.45

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cuculungwa.rb +19 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b3ed555f53680327934d9ef2b0f755373f70c5d
4
- data.tar.gz: e348e27981a8bec389fa4190aeac834893a80460
3
+ metadata.gz: d8cc9088b29d5d3d1751808a94e4528b80770324
4
+ data.tar.gz: 0f39f30bc27dc9b35d9910de8fdf0680c8a4b8b6
5
5
  SHA512:
6
- metadata.gz: 9aa7d61ebac171e905ee5a482d4bc9bbfc1a13ca4a4116de751c18f0d805d7684e58527af116e31d47b9b1934027cac1806f718efa45f5b4b7b3d05c60bd53ec
7
- data.tar.gz: 66b50088be34f8684f99f49178d8b9fd228e18ef26ad5ea299beafbd1ed5650e66297c9b064581c26cd2102c1c9be5d9a3256ac0783b32ca8921030ce4917f7a
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
- first_part = iban[0..1]+" "+iban[2..3]+" "+iban[4..7]
154
- middle_part=" ... "
155
- last_part=iban[-4..-1]
156
- short_iban=first_part+middle_part + last_part
157
- return short_iban
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.43
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-02-03 00:00:00.000000000 Z
13
+ date: 2014-03-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: aruba