ar_translate 0.3.0 → 0.3.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
  SHA1:
3
- metadata.gz: 5f3f8018fe42557b8297b0f2a91d1df83b02d603
4
- data.tar.gz: 35a07e72a02f7cc75a8d717011cfa2c10725d465
3
+ metadata.gz: b1c2a8cf26e19d7f89aab4eda2bcf34cccaece09
4
+ data.tar.gz: 38c0cf132c2abeaeff108ab6aceffad23a2ac5fd
5
5
  SHA512:
6
- metadata.gz: 6a3fd5db556a35d9fe728a5b375367ae7c7f6a9c0864536e553dad631dda5998c2ca84e801189babc5c4a3a6a7d070329166e15c6319df1957a91f113a35d83e
7
- data.tar.gz: 9b7a2cdd33c9702b44b9803dbce162b05d74ccead208ba24b691235393c965844d0ae518a62df1f525b2e6397ea5658d0704eb761e9b6f78d50cac7ca3de4b07
6
+ metadata.gz: c139c869c0f693166ccc3edf1662fb791c8cb4ab099427f979589e8f4933cfc871b6409fdbe3051216522f12f0e934eaedd637c0ff94f7e777e6f35ed89c27d2
7
+ data.tar.gz: d01ac777a91e714584822773ea1ab9c81cabf22507b9626360e9def6e116d9a522c78b8562841507de90f49a321bc6f6df4c5c26e0366432d017567adf89d092
@@ -33,6 +33,14 @@ module ArTranslate
33
33
  langs.map { |lang| :"#{prefix}_#{lang}" }
34
34
  end
35
35
 
36
+ def langs
37
+ if !@langs.is_a?(Array) || @langs.empty?
38
+ fail Error, "No languages specified for column #{column}"
39
+ end
40
+
41
+ @langs.map { |lang| lang.to_s.downcase }.uniq
42
+ end
43
+
36
44
  def check_plural_name!
37
45
  return if column.pluralize == column
38
46
  return if column.singularize != column
@@ -41,12 +49,6 @@ module ArTranslate
41
49
  end
42
50
 
43
51
  def check_languages!
44
- if !langs.is_a?(Array) || langs.empty?
45
- fail Error, "No languages specified for column #{column}"
46
- end
47
-
48
- langs.map! { |lang| lang.to_s.downcase }
49
-
50
52
  langs.each do |lang|
51
53
  next if lang =~ /^[a-z]+$/ && !KEYWORDS.include?(lang)
52
54
  fail Error, "Invalid language '#{lang}' (should be letters only)"
@@ -1,3 +1,3 @@
1
1
  module ArTranslate
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niko Dziemba