travis_check_rubies 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8cb26b63992baa996d1922cdee91e74f37ed36bc542458fb6325f85063167560
4
- data.tar.gz: 7e0036257b4ae7cc6c8d11ed1f2ae9b5fa296d79df14f7510276e8c14341474b
3
+ metadata.gz: 754293bfea3d3b93d0cca432c90b7b792ff7cf5634a670f8cdd8f82e4d3511b6
4
+ data.tar.gz: af8d4c0090e245130ac90dad26bd6068e08d340fe1c2a52f73352d3b0e15d1a7
5
5
  SHA512:
6
- metadata.gz: 51f56606429e36b3a081906604da422a2e174ab612fbfbac5e094e331bc8e9fe174cc59c9d57c59966ce71144318a44dbfa091c02c6aa7f05ea25da0dc126d19
7
- data.tar.gz: 99e6f2f37440bcf7cc415ddefffa98ef4d7bd70aa7acd6b29544d6d1a7e43309176318f4a4248724ce318ece24a7d678ca0fede5d067ca08acd01595161f9b36
6
+ metadata.gz: 73413645cbabaeea6f125258ad0df781e10f7dd2df886fdde4aac740cdd5651fa4bea375fb9860274a75b6a4100bd385ca1df3c3bd70ab7cab162c86b4e45cff
7
+ data.tar.gz: 026aec14d310b2b61bba7c34787c7159c6a11acc403af9cb4602f2d83b0559f03806ff7ad8ee97223315189cf9e3ee9b7223309ede98daf7f7b7df3fa96e7e04
data/.travis.yml CHANGED
@@ -1,14 +1,14 @@
1
- sudo: false
2
- dist: trusty
1
+ dist: xenial
3
2
  language: ruby
4
3
  rvm:
5
4
  - '2.3.8'
6
5
  - '2.4.10'
7
- - '2.5.8'
8
- - '2.6.6'
9
- - '2.7.1'
6
+ - '2.5.9'
7
+ - '2.6.7'
8
+ - '2.7.3'
9
+ - '3.0.1'
10
10
  - 'jruby-9.1.17.0'
11
- - 'jruby-9.2.11.1'
11
+ - 'jruby-9.2.14.0'
12
12
  before_script:
13
13
  - env
14
14
  - rvm debug
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2020 Ivan Kuchin
1
+ Copyright (c) 2017-2021 Ivan Kuchin
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.markdown CHANGED
@@ -43,4 +43,4 @@ bundle exec travis_check_rubies
43
43
 
44
44
  ## Copyright
45
45
 
46
- Copyright (c) 2017-2020 Ivan Kuchin. See [LICENSE.txt](LICENSE.txt) for details.
46
+ Copyright (c) 2017-2021 Ivan Kuchin. See [LICENSE.txt](LICENSE.txt) for details.
@@ -1,10 +1,21 @@
1
1
  require_relative 'fetcher'
2
2
 
3
+ require 'travis_check_rubies/travis_yml'
4
+
3
5
  module TravisCheckRubies
4
6
  class TravisIndex
5
7
  ROOT_URL = 'https://rubies.travis-ci.org/'
6
8
 
9
+ LTS_VERSIONS = {
10
+ precise: '12.04',
11
+ trusty: '14.04',
12
+ xenial: '16.04',
13
+ bionic: '18.04',
14
+ focal: '20.04',
15
+ }
16
+
7
17
  def version_strings
18
+ $stderr.puts "Using #{base_url}"
8
19
  index_urls.select do |url|
9
20
  url.start_with?(base_url)
10
21
  end.map do |url|
@@ -19,14 +30,15 @@ module TravisCheckRubies
19
30
  end
20
31
 
21
32
  def base_url
22
- @base_url ||= if ENV['TRAVIS']
23
- sys_path = `rvm debug`[/(?:system|remote.path):\s*"(.*?)"/, 1]
24
- "#{ROOT_URL}#{sys_path}/"
25
- else
33
+ @base_url ||= begin
26
34
  base_ubuntu_url = "#{ROOT_URL}ubuntu/"
27
- first_ubuntu_url = index_urls.sort.find{ |url| url.start_with?(base_ubuntu_url) }
28
- fail "First ubuntu url (#{ROOT_URL}ubuntu/*) not fount out of:\n#{index_urls.join("\n")}" unless first_ubuntu_url
29
- first_ubuntu_url[%r{^.*/}]
35
+ dist = TravisYml.new.dist
36
+ version = LTS_VERSIONS[dist.to_sym]
37
+ if version
38
+ "#{base_ubuntu_url}#{version}/x86_64/"
39
+ else
40
+ fail "Unknown dist #{dist}"
41
+ end
30
42
  end
31
43
  end
32
44
  end
@@ -15,6 +15,10 @@ module TravisCheckRubies
15
15
  @options = options
16
16
  end
17
17
 
18
+ def dist
19
+ original_object['dist'] || 'xenial'
20
+ end
21
+
18
22
  def warnings
19
23
  return @warnings if @warnings
20
24
 
@@ -40,7 +44,7 @@ module TravisCheckRubies
40
44
 
41
45
  @suggestions = []
42
46
 
43
- updates = Version.updates(rvm_versions, options)
47
+ updates = Version.updates(rvm_versions, **options)
44
48
  rvm_versions.each do |version|
45
49
  next unless (suggestions = updates[version])
46
50
  @suggestions << Suggestion.new('rvm', version, suggestions)
@@ -52,7 +56,7 @@ module TravisCheckRubies
52
56
  'include' => include_versions,
53
57
  }.each do |section, versions|
54
58
  versions.each do |version|
55
- next unless (suggestions = Version.update(version, options))
59
+ next unless (suggestions = Version.update(version, **options))
56
60
  next if suggestions.include?(version)
57
61
  to = section == 'include' && !options[:conservative] ? suggestions.last : suggestions.first
58
62
  @suggestions << Suggestion.new(section, version, suggestions, to)
@@ -57,7 +57,7 @@ module TravisCheckRubies
57
57
  updates = {}
58
58
  has = Set.new
59
59
  versions.uniq.sort.reverse_each do |version|
60
- deduplicated = (update(version, options) || [version]).select{ |v| has.add?(v) }
60
+ deduplicated = (update(version, **options) || [version]).select{ |v| has.add?(v) }
61
61
  updates[version] = [version] == deduplicated ? nil : deduplicated
62
62
  end
63
63
 
@@ -3,33 +3,14 @@ require 'travis_check_rubies/travis_index'
3
3
 
4
4
  describe TravisCheckRubies::TravisIndex do
5
5
  describe '#base_url' do
6
- before do
7
- allow(ENV).to receive(:[]).with('TRAVIS').and_return(env_travis)
8
- end
9
-
10
- context 'when env variable TRAVIS is set' do
11
- let(:env_travis){ 'true' }
12
-
13
- it 'gets base_url from rvm debug' do
14
-
15
- allow(subject).to receive(:`).with('rvm debug').
16
- and_return(%Q{ foo: "xxx" \n system: "XXX/YYY" \n bar: "yyy" })
17
-
18
- expect(subject.send(:base_url)).to eq('https://rubies.travis-ci.org/XXX/YYY/')
19
- end
20
- end
21
-
22
6
  context 'when env variable TRAVIS is not set' do
23
7
  let(:env_travis){ nil }
24
8
 
25
9
  it 'gets base_url from first ubuntu url in index' do
26
- allow(subject).to receive(:index_urls).and_return(%w[
27
- https://rubies.travis-ci.org/osx/AAA/1.tar.gz
28
- https://rubies.travis-ci.org/ubuntu/ZZZ/2.tar.gz
29
- https://rubies.travis-ci.org/ubuntu/BBB/3.tar.gz
30
- ])
10
+ allow(TravisCheckRubies::TravisYml).to receive(:new)
11
+ .and_return instance_double(TravisCheckRubies::TravisYml, dist: 'trusty')
31
12
 
32
- expect(subject.send(:base_url)).to eq('https://rubies.travis-ci.org/ubuntu/BBB/')
13
+ expect(subject.send(:base_url)).to eq('https://rubies.travis-ci.org/ubuntu/14.04/x86_64/')
33
14
  end
34
15
  end
35
16
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'travis_check_rubies'
5
- s.version = '0.5.1'
5
+ s.version = '0.6.0'
6
6
  s.summary = 'Are you using the latest rubies in .travis.yml?'
7
7
  s.description = 'Check if `.travis.yml` specifies latest available rubies from listed on https://rubies.travis-ci.org and propose changes'
8
8
  s.homepage = "https://github.com/toy/#{s.name}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis_check_rubies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kuchin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-04 00:00:00.000000000 Z
11
+ date: 2021-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fspath
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '3.0'
55
55
  description: Check if `.travis.yml` specifies latest available rubies from listed
56
56
  on https://rubies.travis-ci.org and propose changes
57
- email:
57
+ email:
58
58
  executables:
59
59
  - travis_check_rubies
60
60
  extensions: []
@@ -83,9 +83,9 @@ licenses:
83
83
  - MIT
84
84
  metadata:
85
85
  bug_tracker_uri: https://github.com/toy/travis_check_rubies/issues
86
- documentation_uri: https://www.rubydoc.info/gems/travis_check_rubies/0.5.1
86
+ documentation_uri: https://www.rubydoc.info/gems/travis_check_rubies/0.6.0
87
87
  source_code_uri: https://github.com/toy/travis_check_rubies
88
- post_install_message:
88
+ post_install_message:
89
89
  rdoc_options: []
90
90
  require_paths:
91
91
  - lib
@@ -100,8 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubygems_version: 3.1.2
104
- signing_key:
103
+ rubygems_version: 3.1.5
104
+ signing_key:
105
105
  specification_version: 4
106
106
  summary: Are you using the latest rubies in .travis.yml?
107
107
  test_files: