-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.prospectus
42 lines (33 loc) · 924 Bytes
/
.prospectus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require 'open-uri'
Prospectus.extra_dep('file', 'nokogiri')
Prospectus.extra_dep('file', 'prospectus_travis')
Prospectus.extra_dep('file', 'prospectus_gems')
def upstream_version
page = Nokogiri::HTML(open('https://www.ruby-lang.org/en/downloads/'))
table = page.xpath('//*[@id="content"]/ul[2]')
categories = table.xpath('li').select do |x|
x.xpath('strong').text =~ /^(Stable|In security)/
end
versions = categories.map { |x| x.xpath('ul/li') }.flatten
versions.map { |x| x.text.split[1] }.join(', ')
end
UPSTREAM_VERSION = upstream_version
my_slug = 'akerl/gemplate'
item do
noop
deps do
item do
name 'ruby'
expected do
static
set UPSTREAM_VERSION
end
actual do
static
set File.read('.circle-ruby').chomp.gsub("\n",', ')
end
end
end
extend ProspectusTravis::Build.new(my_slug)
extend ProspectusGems::Gemspec.new
end