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 +4 -4
- data/.ruby-version +1 -0
- data/CHANGELOG.md +8 -1
- data/README.md +1 -0
- data/lib/latest_version.rb +6 -1
- data/lib/latest_version/cli.rb +5 -0
- data/lib/latest_version/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4098d4e23776f927dab8201babec9d75d4c87ea
|
4
|
+
data.tar.gz: 35f1cf152cf9fd6cb7ba89538b599c800ac6e330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8be7627a6c532d1bbd8f0006931a36b882e5d7c12f402fbb85ce1abe0e32ed57913eb96a0e209e35194e06ddaa57b50057171a7786f8be3825adaf476f088ca
|
7
|
+
data.tar.gz: 964c14bed7b4743d6789814445362f8f7d724555362a68551490053382bf07b6affcf1b4ebf62d9467788422ff0bd8780047405c4b03cc3b68cb7484b8bb20ae
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.3
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
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
|
|
data/lib/latest_version.rb
CHANGED
@@ -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: -> {
|
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
|
data/lib/latest_version/cli.rb
CHANGED
@@ -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
|
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.
|
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-
|
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
|