Class: Bump::CLI::Commands::Validate

Inherits:
Base
  • Object
show all
Defined in:
lib/bump/cli/commands/validate.rb

Constant Summary

Constants inherited from Base

Base::USER_AGENT

Instance Method Summary collapse

Instance Method Details

#call(file:, **options) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bump/cli/commands/validate.rb', line 19

def call(file:, **options)
  with_errors_rescued do
    response = post(
      url: API_URL + "/validations",
      body: body(file, **options).to_json,
      token: options[:token]
    )

    if response.code == 200
      puts "Definition is valid."
    else
      display_error(response)
    end
  end
end