language_cards 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +1 -0
- data/lib/language_cards/comparator.rb +7 -1
- data/lib/language_cards/mapping.rb +4 -0
- data/lib/language_cards/version.rb +1 -1
- data/lib/language_cards.rb +1 -1
- data/locales/en.yml +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9b17dee4ee233e521d211a5f25fb3ab666f619c
|
|
4
|
+
data.tar.gz: 43f4d40ecf065c78d19fe149812204175d672eae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26053e6f86a8e79fe943227b3fde5f2dd5310cf18c9490621282b7ed7aa1e628c53e1783f84680f1801c427fc752a73a1173bbe32ec94a46a4b3d23039d77236
|
|
7
|
+
data.tar.gz: 70b7c8c51b4cbbfb492ab0b912fce3962e58186db7879aebe785a649559016734ca808485fd6d430650fa8461a9d97a1f07518e34ca99d3b63123a46f55d882a
|
data/README.md
CHANGED
|
@@ -41,6 +41,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
41
41
|
## Contributing
|
|
42
42
|
|
|
43
43
|
Bug reports and pull requests are welcome on GitHub at https://github.com/danielpclark/language_cards.
|
|
44
|
+
Translations of the game itself are kept in the `locales` folder. Flash cards are stored in YAML format in the`cards` folder.
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
## License
|
|
@@ -6,7 +6,13 @@ module LanguageCards
|
|
|
6
6
|
##
|
|
7
7
|
# @title should be a hash like {"Romaji"=>"Katakana"}
|
|
8
8
|
# @mapping should be an array like [:k, :v]
|
|
9
|
-
|
|
9
|
+
raise I18n.t('Error.MappingNotFound') unless mapping.has_key? mapping_key
|
|
10
|
+
begin
|
|
11
|
+
@mapped_as, @mapping = mapping[mapping_key].reduce
|
|
12
|
+
rescue LocalJumpError
|
|
13
|
+
raise I18n.t('Errors.InvalidMapping')
|
|
14
|
+
end
|
|
15
|
+
|
|
10
16
|
@collection = collection
|
|
11
17
|
end
|
|
12
18
|
|
data/lib/language_cards.rb
CHANGED
data/locales/en.yml
CHANGED
|
@@ -20,6 +20,7 @@ en:
|
|
|
20
20
|
* and one with one language name as the key and the other as a value
|
|
21
21
|
Fix your language mapping.
|
|
22
22
|
EmptyCollection: Invalid option on empty card collection!
|
|
23
|
+
MappingNotFound: The key for the mapping you've provided isn't in the collection!
|
|
23
24
|
LanguageName:
|
|
24
25
|
Japanese: Japanese
|
|
25
26
|
Romaji: Romaji
|