Class: LanguageConfigParser
- Inherits:
-
Object
- Object
- LanguageConfigParser
- Defined in:
- lib/hiptest-publisher/options_parser.rb
Class Method Summary collapse
Instance Method Summary collapse
- #filtered_group_names ⇒ Object
- #group_names ⇒ Object
- #include_group?(group_name) ⇒ Boolean
-
#initialize(cli_options, language_config_path = nil) ⇒ LanguageConfigParser
constructor
A new instance of LanguageConfigParser.
- #language_group_configs ⇒ Object
- #name_action_word(name) ⇒ Object
Constructor Details
#initialize(cli_options, language_config_path = nil) ⇒ LanguageConfigParser
Returns a new instance of LanguageConfigParser.
653 654 655 656 657 |
# File 'lib/hiptest-publisher/options_parser.rb', line 653 def initialize(, language_config_path = nil) @cli_options = language_config_path ||= LanguageConfigParser.config_path_for() @config = ParseConfig.new(language_config_path) end |
Class Method Details
.config_path_for(cli_options) ⇒ Object
659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 |
# File 'lib/hiptest-publisher/options_parser.rb', line 659 def self.config_path_for() config_name = if .framework.empty? "#{.language}.conf" else "#{.language}-#{.framework}.conf" end config_path = File.("#{hiptest_publisher_path}/lib/config/#{config_name.downcase}") if !File.file?(config_path) = "cannot find configuration file in \"#{hiptest_publisher_path}/lib/config\"" << " for language #{.language.inspect}" << " and framework #{.framework.inspect}" unless .framework.to_s.empty? raise ArgumentError.new() end File.(config_path) end |
Instance Method Details
#filtered_group_names ⇒ Object
681 682 683 684 685 686 687 |
# File 'lib/hiptest-publisher/options_parser.rb', line 681 def filtered_group_names if @cli_options.groups_to_keep group_names.select {|group_name| @cli_options.groups_to_keep.include?(group_name)} else group_names end end |
#group_names ⇒ Object
675 676 677 678 679 |
# File 'lib/hiptest-publisher/options_parser.rb', line 675 def group_names @config.groups.reject {|group_name| group_name.start_with?('_') } end |
#include_group?(group_name) ⇒ Boolean
689 690 691 |
# File 'lib/hiptest-publisher/options_parser.rb', line 689 def include_group?(group_name) filtered_group_names.include?(group_name) end |
#language_group_configs ⇒ Object
693 694 695 |
# File 'lib/hiptest-publisher/options_parser.rb', line 693 def language_group_configs filtered_group_names.map {|group_name| make_language_group_config(group_name)} end |
#name_action_word(name) ⇒ Object
697 698 699 |
# File 'lib/hiptest-publisher/options_parser.rb', line 697 def name_action_word(name) name.send(get_key_from_group('actionwords', 'naming_convention')) end |