Module: Superbot::Validations
- Included in:
- CLI::RunCommand, CLI::TeleportCommand
- Defined in:
- lib/superbot/cli/validations.rb
Instance Method Summary collapse
Instance Method Details
#validates_browser_type(browser) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/superbot/cli/validations.rb', line 18 def validates_browser_type(browser) unless %w(local cloud local_cloud).include?(browser) raise ArgumentError, "The '#{browser}' browser option is not allowed. Should be either 'local' or 'cloud'." end browser end |
#validates_project_path(path) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/superbot/cli/validations.rb', line 5 def validates_project_path(path) unless Dir.exist? path raise ArgumentError, "directory #{path} does not exist" end entrypoint = File.join path, "main.rb" unless File.exist? entrypoint raise ArgumentError, "file #{entrypoint} does not exist" end path end |