Class: Buildless::Cli::FetchTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/buildless/cli/fetch_template.rb

Constant Summary collapse

COMMANDS =
%w[apply].freeze
API_URL =
'https://buildless.app/api/v1'

Instance Method Summary collapse

Instance Method Details

#call(uid) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/buildless/cli/fetch_template.rb', line 9

def call(uid)
  response = RestClient.get(API_URL + "/configurations/#{uid}") { |res| res }

  return if response.code != 200

  JSON.parse(response.body)
end

#gem_versionObject



17
18
19
20
21
22
# File 'lib/buildless/cli/fetch_template.rb', line 17

def gem_version
  response = RestClient.get(API_URL + "/configurations/gem_current_version")
  parsed_response = JSON.parse(response.body)

  parsed_response['version']
end