Class: Humidifier::Upgrade

Inherits:
Object
  • Object
show all
Defined in:
lib/humidifier/upgrade.rb

Constant Summary collapse

PATH =
-File.expand_path(File.join("..", "..", SPECIFICATION), __dir__)
URL =
"https://docs.aws.amazon.com/AWSCloudFormation/latest" \
"/UserGuide/cfn-resource-specification.html"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.performObject



20
21
22
# File 'lib/humidifier/upgrade.rb', line 20

def self.perform
  new.perform
end

Instance Method Details

#performObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/humidifier/upgrade.rb', line 9

def perform
  require "net/http"
  require "nokogiri"

  response = Net::HTTP.get_response(uri).body
  parsed = JSON.parse(response)

  File.write(PATH, JSON.pretty_generate(parsed))
  parsed["ResourceSpecificationVersion"]
end