latest_ruby 2.0.0 → 3.1.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: dd40ee3d84fd06fc75da25dec91ec8879728466717b20f1084f580bd2512cc00
4
- data.tar.gz: 6de6478f1ae09672c30eaa66726dccff01a16bdb01fff0aa7a16f2198fbd4919
3
+ metadata.gz: 78fd30461df8e4b2cb0daffd755f819f9b77258180ba478da683cd9c22cd18d3
4
+ data.tar.gz: 8e2109bb04c3e2b360c8d7c332381baa31c955edba543fd646409cbacc18797d
5
5
  SHA512:
6
- metadata.gz: 9b2c35c01bcea64f89ffd1204382a2fa8992faf3cd52db9470d9f4672ad40259d3a8c15fc6aff242bbbc588f7564f99955ab38c13d4a8f36edd021051151acb5
7
- data.tar.gz: 6a52c2c064244ce33fca844176f14e725bc9800ba42d04d8fbbcb6ba1e28eb70d56ba8708c187477af6d8c81c13316596b4a1852de013692b81b2a25b7d9817c
6
+ metadata.gz: 37148dc186b474d65c49490aa7b70bb11893f95a4d0db2cf31702eaa029d5b692b5551fca368fdb7fb00694c8e4a99f44fd788609b1c7d7336f8a522d3ff116b
7
+ data.tar.gz: e308d8cab04ec9a41ef382523550ed605e50f9b33e4195185fceb56e897966169b929d1694aab1fcd607b48364d0b6123302dfaa42a93396fc55efde64d36177
data/CHANGELOG.md CHANGED
@@ -1,6 +1,28 @@
1
1
  Latest Ruby changelog
2
2
  =====================
3
3
 
4
+ ### v3.1.0 (December 26, 2021)
5
+
6
+ * Added support for Ruby 3.1
7
+ ([#21](https://github.com/kyrylo/latest_ruby/pull/21))
8
+
9
+ ### v3.0.2 (September 9, 2021)
10
+
11
+ * Fixed support for Rubinius
12
+ ([#19](https://github.com/kyrylo/latest_ruby/pull/19))
13
+ * Dropped `rexml` dependency
14
+ ([#19](https://github.com/kyrylo/latest_ruby/pull/19))
15
+
16
+ ### v3.0.1 (December 31, 2020)
17
+
18
+ * Fixed support for Ruby 3.0
19
+ ([#17](https://github.com/kyrylo/latest_ruby/pull/17))
20
+
21
+ ### v3.0.0 (December 26, 2020)
22
+
23
+ * Added support for Ruby 3.0
24
+ ([#15](https://github.com/kyrylo/latest_ruby/pull/15))
25
+
4
26
  ### v2.0.0 (December 24, 2019)
5
27
 
6
28
  * Added support for Ruby 2.7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 3.1.0
@@ -1,18 +1,11 @@
1
- require 'rexml/document'
1
+ require 'json'
2
2
 
3
3
  module Latest
4
4
  class RubiniusRetriever
5
-
6
- include REXML
7
-
8
5
  def retrieve(rbx)
9
6
  page = Net::HTTP.get(URI(rbx.source))
10
- xml = Document.new(page)
11
- all_versions = XPath.match(xml, '//Contents//Key').map(&:text)
12
- candidates = all_versions.find_all { |v| v =~ /\Arubinius-/ }
13
- stables = candidates.flat_map { |v| v.scan(/-(\d\.\d\.\d)\.tar/) }.flatten
14
- stables.map { |v| RubyVersion.new(v) }.max
7
+ latest_version = JSON.parse(page)
8
+ RubyVersion.new(latest_version['tag_name'].scan(/\d.\d/).first)
15
9
  end
16
-
17
10
  end
18
11
  end
@@ -1,23 +1,23 @@
1
1
  module Latest
2
2
  class Rubinius
3
-
4
- SOURCE = 'http://asset.rubini.us/'
5
- AVAILABLE_EXTS = ['.tar.gz']
3
+ WEB_SOURCE = 'https://api.github.com/repos/rubinius/rubinius/releases/latest'
4
+ SOURCE = 'https://github.com/rubinius/rubinius/releases/download'
5
+ AVAILABLE_EXTS = ['.tar.bz2']
6
6
 
7
7
  attr_reader :source
8
8
 
9
9
  def initialize(retriever)
10
10
  @retriever = retriever
11
- @source = SOURCE
11
+ @source = WEB_SOURCE
12
12
  end
13
13
 
14
14
  def version
15
15
  @version ||= @retriever.retrieve(self)
16
16
  end
17
17
 
18
- def link(ext = '.tar.gz')
18
+ def link(ext = '.tar.bz2')
19
19
  if AVAILABLE_EXTS.include?(ext)
20
- source + 'rubinius-' + version.to_s + ext
20
+ "#{SOURCE}/v#{version}/rubinius-#{version}#{ext}"
21
21
  end
22
22
  end
23
23
 
data/lib/latest_ruby.rb CHANGED
@@ -21,6 +21,14 @@ module Latest
21
21
  File.read(VERSION_FILE).chomp : '(could not find VERSION file)'
22
22
 
23
23
  class << self
24
+ def ruby31
25
+ Ruby.new(MRI.new('3.1', MRIRetriever.new))
26
+ end
27
+
28
+ def ruby30
29
+ Ruby.new(MRI.new('3.0', MRIRetriever.new))
30
+ end
31
+
24
32
  def ruby27
25
33
  Ruby.new(MRI.new('2.7', MRIRetriever.new))
26
34
  end
@@ -34,7 +42,7 @@ module Latest
34
42
  end
35
43
 
36
44
  # The latest Ruby version by default.
37
- alias_method :ruby, :ruby27
45
+ alias_method :ruby, :ruby31
38
46
 
39
47
  def ruby24
40
48
  Ruby.new(MRI.new('2.4', MRIRetriever.new))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latest_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyrylo Silin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-24 00:00:00.000000000 Z
11
+ date: 2021-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -71,7 +71,7 @@ homepage: https://github.com/kyrylo/latest_ruby
71
71
  licenses:
72
72
  - zlib
73
73
  metadata: {}
74
- post_install_message:
74
+ post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths:
77
77
  - lib
@@ -86,9 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubyforge_project:
90
- rubygems_version: 2.7.6.2
91
- signing_key:
89
+ rubygems_version: 3.2.15
90
+ signing_key:
92
91
  specification_version: 4
93
92
  summary: Answers the question of what the latest Ruby version is
94
93
  test_files: []