latest_version 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fa8085b7889c7b5a1cca136a75bcc5e152c9d52
4
- data.tar.gz: 81883c693d29eba5420a3d5487460760a9726954
3
+ metadata.gz: a4098d4e23776f927dab8201babec9d75d4c87ea
4
+ data.tar.gz: 35f1cf152cf9fd6cb7ba89538b599c800ac6e330
5
5
  SHA512:
6
- metadata.gz: d1622ad12b699d7d82e95741f2ebd6221e03824dbf4ac3346dafc5753c7f14c37b656fefd0130f7530e8e4ec83fd7a416e7ace22392b3653be2adaaec8ca5228
7
- data.tar.gz: 965390787d87ce376bb165368c2808705c968ed62f33fefcfce6f02e044a92ad41b38b7740dcd456870dd192bf0fe4e6f7470c046e6ee4200d43f139eb00055e
6
+ metadata.gz: c8be7627a6c532d1bbd8f0006931a36b882e5d7c12f402fbb85ce1abe0e32ed57913eb96a0e209e35194e06ddaa57b50057171a7786f8be3825adaf476f088ca
7
+ data.tar.gz: 964c14bed7b4743d6789814445362f8f7d724555362a68551490053382bf07b6affcf1b4ebf62d9467788422ff0bd8780047405c4b03cc3b68cb7484b8bb20ae
@@ -0,0 +1 @@
1
+ 2.3.3
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.4] - 2020-02-20
11
+
12
+ ### Added
13
+
14
+ - Support `latest_version rubygem GEM_NAME`.
15
+
10
16
  ## [0.1.3] - 2020-02-19
11
17
 
12
18
  ### Added
@@ -32,7 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
32
38
 
33
39
  - Support for ruby, rails and python.
34
40
 
35
- [unreleased]: https://github.com/zubin/latest_version/compare/v0.1.3...HEAD
41
+ [unreleased]: https://github.com/zubin/latest_version/compare/v0.1.4...HEAD
42
+ [0.1.4]: https://github.com/zubin/latest_version/compare/v0.1.3...v0.1.4
36
43
  [0.1.3]: https://github.com/zubin/latest_version/compare/v0.1.2...v0.1.3
37
44
  [0.1.2]: https://github.com/zubin/latest_version/compare/v0.1.1...v0.1.2
38
45
  [0.1.1]: https://github.com/zubin/latest_version/compare/v0.1.0...v0.1.1
data/README.md CHANGED
@@ -22,6 +22,7 @@ Commands:
22
22
  latest_version python # Returns latest version of python
23
23
  latest_version rails # Returns latest version of rails
24
24
  latest_version ruby # Returns latest version of ruby
25
+ latest_version rubygem GEM_NAME # Returns latest version of rubygem GEM_NAME
25
26
  latest_version rust # Returns latest version of rust
26
27
  ```
27
28
 
@@ -13,7 +13,7 @@ module LatestVersion
13
13
  regex: %r{<p>Latest: <a href="/downloads/release/python-\d+/">Python (\d+\.\d+\.\d+)</a></p>},
14
14
  )
15
15
  },
16
- rails: -> { latest_github_release(repo: 'rails/rails') },
16
+ rails: -> { of_rubygem('rails') },
17
17
  ruby: -> { latest_github_tag(repo: 'ruby/ruby').gsub('_', '.') },
18
18
  rust: -> { latest_github_tag(repo: 'rust-lang/rust') },
19
19
  }.freeze
@@ -24,6 +24,11 @@ module LatestVersion
24
24
  LIBRARIES.fetch(library.to_sym) { raise UnknownLibraryError, library }.call
25
25
  end
26
26
 
27
+ def self.of_rubygem(gem_name)
28
+ json = Net::HTTP.get(URI("https://rubygems.org/api/v1/versions/#{gem_name}/latest.json"))
29
+ JSON.parse(json, symbolize_names: true).fetch(:version)
30
+ end
31
+
27
32
  def self.supported_libraries
28
33
  LIBRARIES.keys.sort
29
34
  end
@@ -22,5 +22,10 @@ module LatestVersion
22
22
  def completions
23
23
  puts Completion::SUPPORTED.keys.join("\n")
24
24
  end
25
+
26
+ desc 'rubygem GEM_NAME', "Returns latest version of rubygem GEM_NAME"
27
+ def rubygem(gem_name)
28
+ puts LatestVersion.of_rubygem(gem_name)
29
+ end
25
30
  end
26
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LatestVersion
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latest_version
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zubin Henner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-18 00:00:00.000000000 Z
11
+ date: 2020-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -119,6 +119,7 @@ files:
119
119
  - ".gitignore"
120
120
  - ".rspec"
121
121
  - ".rubocop.yml"
122
+ - ".ruby-version"
122
123
  - ".travis.yml"
123
124
  - CHANGELOG.md
124
125
  - Gemfile