latest_ruby 3.0.1 → 3.0.2

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: d1372e14386f3bc39260379989bbe303ece2e12f35de9f8121a661ef6e857f6f
4
- data.tar.gz: 4f4c9334d88ee51bc1be89bc4f32f18d1d84f8be8b799f028e862edfa8bc8d50
3
+ metadata.gz: 44752c31e92e9d96cccc4d874e268b76aa22e4b3dadab60a3fabe47f198021e5
4
+ data.tar.gz: 6e9ddbad378f7eeffa9347369c4b273f5247fa393cf01887202bcb7cfc7082b8
5
5
  SHA512:
6
- metadata.gz: 25bcee949e558da79a644e9e98c036fd796d1852b4838e8489ea4d3be55f55d645c765695fec9b7009dc34bebc98527408bc8a953d69b056bb3af7c4229ba398
7
- data.tar.gz: aacff4cc5194d465d9ac9b77f92f0a4586397ffce03bcfaad26b021fa9b8fa0b7faf71c9f4317feff59e926a76f21524aa3ca940d02044655ce3d30da9c5af2f
6
+ metadata.gz: d4208703d57438d7eff585d1fa79700c46cbdb422538778da4432dfe0eaba1dae0087c15aa61e5b2c30d7018147ff6316e33bb721b04a97061d460d7c60dbb03
7
+ data.tar.gz: 7c691b621198ce451e91e7a8a49100c9f6ae5bfc8757e6c3af098d21e4d22303d796bf81f8036143a69f370a47edc5e179f739b4cc96c3f9b305359d00b3711d
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Latest Ruby changelog
2
2
  =====================
3
3
 
4
+ ### v3.0.2 (September 9, 2021)
5
+
6
+ * Fixed support for Rubinius
7
+ ([#19](https://github.com/kyrylo/latest_ruby/pull/19))
8
+ * Dropped `rexml` dependency
9
+ ([#19](https://github.com/kyrylo/latest_ruby/pull/19))
10
+
4
11
  ### v3.0.1 (December 31, 2020)
5
12
 
6
13
  * Fixed support for Ruby 3.0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.1
1
+ 3.0.2
data/latest_ruby.gemspec CHANGED
@@ -12,8 +12,6 @@ Gem::Specification.new do |s|
12
12
  s.require_path = 'lib'
13
13
  s.files = `git ls-files`.split("\n")
14
14
 
15
- s.add_dependency 'rexml'
16
-
17
15
  s.add_development_dependency 'rake'
18
16
  s.add_development_dependency 'pry'
19
17
  end
@@ -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
 
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latest_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyrylo Silin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-31 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rexml
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rake
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
86
  - !ruby/object:Gem::Version
101
87
  version: '0'
102
88
  requirements: []
103
- rubygems_version: 3.1.2
89
+ rubygems_version: 3.2.15
104
90
  signing_key:
105
91
  specification_version: 4
106
92
  summary: Answers the question of what the latest Ruby version is