Module: SpecI18n
- Defined in:
- lib/spec-i18n/platform.rb,
lib/spec-i18n/spec_language.rb,
lib/spec-i18n/command_line/main.rb,
lib/spec-i18n/command_line/options.rb,
lib/spec-i18n/parser/natural_language.rb,
lib/spec-i18n/command_line/language_help_formatter.rb
Defined Under Namespace
Modules: CommandLine, Parser
Constant Summary collapse
- VERSION =
[version[:major], version[:minor], version[:patch]].compact.join(".")
- SPEC_LANGUAGE_FILE =
File.(File.dirname(__FILE__) + '/languages.yml')
- SPEC_LANGUAGES =
YAML.load_file(SPEC_LANGUAGE_FILE)
Instance Method Summary collapse
-
#all_languages ⇒ Object
Return all the languages in languages.yml.
-
#grep_value(lang, key) ⇒ Object
Return the exaclty value of that keyword.
-
#list_languages ⇒ Object
List all languages available in the languages.yml.
-
#natural_language ⇒ Object
Return the new NaturalLanguage from spec language configuration.
-
#spec_language ⇒ Object
Read the configuration language put in the Spec::Runner configure block.
Instance Method Details
#all_languages ⇒ Object
Return all the languages in languages.yml
17 18 19 |
# File 'lib/spec-i18n/spec_language.rb', line 17 def all_languages SpecI18n::SPEC_LANGUAGES end |
#grep_value(lang, key) ⇒ Object
Return the exaclty value of that keyword
23 24 25 |
# File 'lib/spec-i18n/spec_language.rb', line 23 def grep_value(lang, key) SpecI18n::SPEC_LANGUAGES[lang][key] end |
#list_languages ⇒ Object
List all languages available in the languages.yml
29 30 31 32 33 |
# File 'lib/spec-i18n/spec_language.rb', line 29 def list_languages languages = all_languages.keys.sort.collect do |lang| [ lang, grep_value(lang, 'name'), grep_value(lang, 'native') ] end end |
#natural_language ⇒ Object
Return the new NaturalLanguage from spec language configuration
5 6 7 |
# File 'lib/spec-i18n/spec_language.rb', line 5 def natural_language Parser::NaturalLanguage.new(spec_language) end |