Skip to content

Commit

Permalink
Merge pull request #884 from heroku/bump-node-versions
Browse files Browse the repository at this point in the history
Bump versions for Node and Yarn
  • Loading branch information
schneems authored May 28, 2019
2 parents 4433851 + 1d22667 commit ddac48e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
23 changes: 5 additions & 18 deletions lib/language_pack/helpers/nodebin.rb
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
require 'json'

class LanguagePack::Helpers::Nodebin
URL = "https://nodebin.herokai.com/v1/"

def self.query(q)
response = Net::HTTP.get_response(URI("#{URL}/#{q}"))
if response.code == '200'
JSON.parse(response.body)
end
end

def self.hardcoded_node_lts
version = "10.14.1"
version = "10.15.3"
{
"number" => version,
"url" => "https://s3.amazonaws.com/heroku-nodebin/node/release/linux-x64/node-v#{version}-linux-x64.tar.gz"
}
end

def self.hardcoded_yarn
version = "1.12.3"
version = "1.16.0"
{
"number" => version,
"url" => "https://s3.amazonaws.com/heroku-nodebin/yarn/release/yarn-v#{version}.tar.gz"
}
end

def self.node(q)
query("node/linux-x64/#{q}")
end

def self.node_lts
hardcoded_node_lts # node("latest?range=6.x")
hardcoded_node_lts
end

def self.yarn(q)
hardcoded_yarn # query("yarn/linux-x64/#{q}")
def self.yarn
hardcoded_yarn
end
end
2 changes: 1 addition & 1 deletion lib/language_pack/helpers/yarn_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class LanguagePack::Helpers::YarnInstaller
def initialize
# Grab latest yarn, until release practice stabilizes
# https:/yarnpkg/yarn/issues/376#issuecomment-253366910
nodebin = LanguagePack::Helpers::Nodebin.yarn("latest")
nodebin = LanguagePack::Helpers::Nodebin.yarn
@version = nodebin["number"]
@url = nodebin["url"]
@fetcher = LanguagePack::Fetcher.new("")
Expand Down

0 comments on commit ddac48e

Please sign in to comment.