Class: Cucumber::Cli::ProfileLoader
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/profile_loader.rb
Instance Method Summary collapse
- #args_from(profile) ⇒ Object
- #cucumber_yml_defined? ⇒ Boolean
-
#initialize ⇒ ProfileLoader
constructor
A new instance of ProfileLoader.
- #profile?(profile) ⇒ Boolean
Constructor Details
#initialize ⇒ ProfileLoader
Returns a new instance of ProfileLoader.
8 9 10 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/profile_loader.rb', line 8 def initialize @cucumber_yml = nil end |
Instance Method Details
#args_from(profile) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/profile_loader.rb', line 12 def args_from(profile) unless cucumber_yml.key?(profile) raise(ProfileNotFound, "Could not find profile: '\#{profile}'\n\nDefined profiles in cucumber.yml:\n * \#{cucumber_yml.keys.sort.join(\"\\n * \")}\n END_OF_ERROR\n end\n\n args_from_yml = cucumber_yml[profile] || ''\n\n case args_from_yml\n when String\n if args_from_yml =~ /^\\s*$/\n raise YmlLoadError, \"The '\#{profile}' profile in cucumber.yml was blank.\" \\\n \" Please define the command line arguments for the '\#{profile}' profile in cucumber.yml.\\n\"\n end\n\n args_from_yml = processed_shellwords(args_from_yml)\n when Array\n raise YmlLoadError, \"The '\#{profile}' profile in cucumber.yml was empty. Please define the command line arguments for the '\#{profile}' profile in cucumber.yml.\\n\" if args_from_yml.empty?\n else\n raise YmlLoadError, \"The '\#{profile}' profile in cucumber.yml was a \#{args_from_yml.class}. It must be a String or Array\"\n end\n\n args_from_yml\nend\n") |
#cucumber_yml_defined? ⇒ Boolean
45 46 47 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/profile_loader.rb', line 45 def cucumber_yml_defined? cucumber_file && File.exist?(cucumber_file) end |
#profile?(profile) ⇒ Boolean
41 42 43 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/profile_loader.rb', line 41 def profile?(profile) cucumber_yml.key?(profile) end |